@atlaskit/side-nav-items 1.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 (332) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/LICENSE.md +11 -0
  3. package/README.md +5 -0
  4. package/button-menu-item/package.json +17 -0
  5. package/container-avatar/package.json +17 -0
  6. package/dist/cjs/entry-points/button-menu-item.js +19 -0
  7. package/dist/cjs/entry-points/container-avatar.js +12 -0
  8. package/dist/cjs/entry-points/drag-and-drop/drag-handle.js +12 -0
  9. package/dist/cjs/entry-points/drag-and-drop/drag-preview.js +12 -0
  10. package/dist/cjs/entry-points/drag-and-drop/drop-indicator.js +12 -0
  11. package/dist/cjs/entry-points/drag-and-drop/group-drop-indicator.js +12 -0
  12. package/dist/cjs/entry-points/drag-and-drop/hitbox.js +18 -0
  13. package/dist/cjs/entry-points/drag-and-drop/use-menu-item-drag-and-drop.js +12 -0
  14. package/dist/cjs/entry-points/expandable-menu-item.js +33 -0
  15. package/dist/cjs/entry-points/flyout-menu-item.js +54 -0
  16. package/dist/cjs/entry-points/link-menu-item.js +19 -0
  17. package/dist/cjs/entry-points/menu-list-item.js +12 -0
  18. package/dist/cjs/entry-points/menu-list.js +12 -0
  19. package/dist/cjs/entry-points/menu-section.js +26 -0
  20. package/dist/cjs/entry-points/top-level-spacer.js +12 -0
  21. package/dist/cjs/index.js +5 -0
  22. package/dist/cjs/ui/menu-item/button-menu-item.js +66 -0
  23. package/dist/cjs/ui/menu-item/constants.js +21 -0
  24. package/dist/cjs/ui/menu-item/container-avatar.compiled.css +4 -0
  25. package/dist/cjs/ui/menu-item/container-avatar.js +34 -0
  26. package/dist/cjs/ui/menu-item/drag-and-drop/drag-preview.compiled.css +9 -0
  27. package/dist/cjs/ui/menu-item/drag-and-drop/drag-preview.js +65 -0
  28. package/dist/cjs/ui/menu-item/drag-and-drop/drop-indicator.js +12 -0
  29. package/dist/cjs/ui/menu-item/drag-and-drop/group-drop-indicator.js +12 -0
  30. package/dist/cjs/ui/menu-item/drag-and-drop/hitbox.js +18 -0
  31. package/dist/cjs/ui/menu-item/drag-and-drop/use-menu-item-drag-and-drop.js +202 -0
  32. package/dist/cjs/ui/menu-item/drag-handle/drag-handle.compiled.css +9 -0
  33. package/dist/cjs/ui/menu-item/drag-handle/drag-handle.js +28 -0
  34. package/dist/cjs/ui/menu-item/drag-handle/lazy-drag-handle.js +20 -0
  35. package/dist/cjs/ui/menu-item/expandable-menu-item/expandable-menu-item-content.compiled.css +2 -0
  36. package/dist/cjs/ui/menu-item/expandable-menu-item/expandable-menu-item-content.js +50 -0
  37. package/dist/cjs/ui/menu-item/expandable-menu-item/expandable-menu-item-context.js +64 -0
  38. package/dist/cjs/ui/menu-item/expandable-menu-item/expandable-menu-item-level-context.js +14 -0
  39. package/dist/cjs/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.compiled.css +14 -0
  40. package/dist/cjs/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.js +150 -0
  41. package/dist/cjs/ui/menu-item/expandable-menu-item/expandable-menu-item.compiled.css +1 -0
  42. package/dist/cjs/ui/menu-item/expandable-menu-item/expandable-menu-item.js +69 -0
  43. package/dist/cjs/ui/menu-item/flyout-menu-item/close-button.js +33 -0
  44. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-body.compiled.css +11 -0
  45. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-body.js +38 -0
  46. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-footer.compiled.css +5 -0
  47. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-footer.js +29 -0
  48. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-header.compiled.css +11 -0
  49. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-header.js +54 -0
  50. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item-content.compiled.css +8 -0
  51. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item-content.js +223 -0
  52. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item-context.js +58 -0
  53. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item-trigger.compiled.css +2 -0
  54. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item-trigger.js +68 -0
  55. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item.js +76 -0
  56. package/dist/cjs/ui/menu-item/link-menu-item.compiled.css +1 -0
  57. package/dist/cjs/ui/menu-item/link-menu-item.js +81 -0
  58. package/dist/cjs/ui/menu-item/list-item.js +30 -0
  59. package/dist/cjs/ui/menu-item/list.js +40 -0
  60. package/dist/cjs/ui/menu-item/menu-item-signals.js +11 -0
  61. package/dist/cjs/ui/menu-item/menu-item.compiled.css +101 -0
  62. package/dist/cjs/ui/menu-item/menu-item.js +394 -0
  63. package/dist/cjs/ui/menu-item/menu-list-item.js +18 -0
  64. package/dist/cjs/ui/menu-item/menu-list.js +14 -0
  65. package/dist/cjs/ui/menu-item/top-level-spacer.compiled.css +1 -0
  66. package/dist/cjs/ui/menu-item/top-level-spacer.js +46 -0
  67. package/dist/cjs/ui/menu-item/types.js +5 -0
  68. package/dist/cjs/ui/menu-item/use-scroll-menu-item-into-view.js +70 -0
  69. package/dist/cjs/ui/menu-section/divider.compiled.css +4 -0
  70. package/dist/cjs/ui/menu-section/divider.js +32 -0
  71. package/dist/cjs/ui/menu-section/menu-section-context.js +19 -0
  72. package/dist/cjs/ui/menu-section/menu-section-heading.compiled.css +4 -0
  73. package/dist/cjs/ui/menu-section/menu-section-heading.js +30 -0
  74. package/dist/cjs/ui/menu-section/menu-section.js +49 -0
  75. package/dist/es2019/entry-points/button-menu-item.js +2 -0
  76. package/dist/es2019/entry-points/container-avatar.js +1 -0
  77. package/dist/es2019/entry-points/drag-and-drop/drag-handle.js +1 -0
  78. package/dist/es2019/entry-points/drag-and-drop/drag-preview.js +1 -0
  79. package/dist/es2019/entry-points/drag-and-drop/drop-indicator.js +1 -0
  80. package/dist/es2019/entry-points/drag-and-drop/group-drop-indicator.js +1 -0
  81. package/dist/es2019/entry-points/drag-and-drop/hitbox.js +1 -0
  82. package/dist/es2019/entry-points/drag-and-drop/use-menu-item-drag-and-drop.js +1 -0
  83. package/dist/es2019/entry-points/expandable-menu-item.js +4 -0
  84. package/dist/es2019/entry-points/flyout-menu-item.js +7 -0
  85. package/dist/es2019/entry-points/link-menu-item.js +2 -0
  86. package/dist/es2019/entry-points/menu-list-item.js +1 -0
  87. package/dist/es2019/entry-points/menu-list.js +1 -0
  88. package/dist/es2019/entry-points/menu-section.js +3 -0
  89. package/dist/es2019/entry-points/top-level-spacer.js +1 -0
  90. package/dist/es2019/index.js +3 -0
  91. package/dist/es2019/ui/menu-item/button-menu-item.js +59 -0
  92. package/dist/es2019/ui/menu-item/constants.js +15 -0
  93. package/dist/es2019/ui/menu-item/container-avatar.compiled.css +4 -0
  94. package/dist/es2019/ui/menu-item/container-avatar.js +25 -0
  95. package/dist/es2019/ui/menu-item/drag-and-drop/drag-preview.compiled.css +9 -0
  96. package/dist/es2019/ui/menu-item/drag-and-drop/drag-preview.js +60 -0
  97. package/dist/es2019/ui/menu-item/drag-and-drop/drop-indicator.js +7 -0
  98. package/dist/es2019/ui/menu-item/drag-and-drop/group-drop-indicator.js +7 -0
  99. package/dist/es2019/ui/menu-item/drag-and-drop/hitbox.js +7 -0
  100. package/dist/es2019/ui/menu-item/drag-and-drop/use-menu-item-drag-and-drop.js +192 -0
  101. package/dist/es2019/ui/menu-item/drag-handle/drag-handle.compiled.css +9 -0
  102. package/dist/es2019/ui/menu-item/drag-handle/drag-handle.js +19 -0
  103. package/dist/es2019/ui/menu-item/drag-handle/lazy-drag-handle.js +9 -0
  104. package/dist/es2019/ui/menu-item/expandable-menu-item/expandable-menu-item-content.compiled.css +2 -0
  105. package/dist/es2019/ui/menu-item/expandable-menu-item/expandable-menu-item-content.js +43 -0
  106. package/dist/es2019/ui/menu-item/expandable-menu-item/expandable-menu-item-context.js +53 -0
  107. package/dist/es2019/ui/menu-item/expandable-menu-item/expandable-menu-item-level-context.js +9 -0
  108. package/dist/es2019/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.compiled.css +14 -0
  109. package/dist/es2019/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.js +141 -0
  110. package/dist/es2019/ui/menu-item/expandable-menu-item/expandable-menu-item.compiled.css +1 -0
  111. package/dist/es2019/ui/menu-item/expandable-menu-item/expandable-menu-item.js +54 -0
  112. package/dist/es2019/ui/menu-item/flyout-menu-item/close-button.js +25 -0
  113. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-body.compiled.css +11 -0
  114. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-body.js +33 -0
  115. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-footer.compiled.css +5 -0
  116. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-footer.js +24 -0
  117. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-header.compiled.css +11 -0
  118. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-header.js +47 -0
  119. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item-content.compiled.css +8 -0
  120. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item-content.js +211 -0
  121. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item-context.js +45 -0
  122. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item-trigger.compiled.css +2 -0
  123. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item-trigger.js +57 -0
  124. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item.js +61 -0
  125. package/dist/es2019/ui/menu-item/link-menu-item.compiled.css +1 -0
  126. package/dist/es2019/ui/menu-item/link-menu-item.js +73 -0
  127. package/dist/es2019/ui/menu-item/list-item.js +23 -0
  128. package/dist/es2019/ui/menu-item/list.js +33 -0
  129. package/dist/es2019/ui/menu-item/menu-item-signals.js +5 -0
  130. package/dist/es2019/ui/menu-item/menu-item.compiled.css +101 -0
  131. package/dist/es2019/ui/menu-item/menu-item.js +383 -0
  132. package/dist/es2019/ui/menu-item/menu-list-item.js +12 -0
  133. package/dist/es2019/ui/menu-item/menu-list.js +9 -0
  134. package/dist/es2019/ui/menu-item/top-level-spacer.compiled.css +1 -0
  135. package/dist/es2019/ui/menu-item/top-level-spacer.js +38 -0
  136. package/dist/es2019/ui/menu-item/types.js +1 -0
  137. package/dist/es2019/ui/menu-item/use-scroll-menu-item-into-view.js +64 -0
  138. package/dist/es2019/ui/menu-section/divider.compiled.css +4 -0
  139. package/dist/es2019/ui/menu-section/divider.js +22 -0
  140. package/dist/es2019/ui/menu-section/menu-section-context.js +13 -0
  141. package/dist/es2019/ui/menu-section/menu-section-heading.compiled.css +4 -0
  142. package/dist/es2019/ui/menu-section/menu-section-heading.js +23 -0
  143. package/dist/es2019/ui/menu-section/menu-section.js +42 -0
  144. package/dist/esm/entry-points/button-menu-item.js +2 -0
  145. package/dist/esm/entry-points/container-avatar.js +1 -0
  146. package/dist/esm/entry-points/drag-and-drop/drag-handle.js +1 -0
  147. package/dist/esm/entry-points/drag-and-drop/drag-preview.js +1 -0
  148. package/dist/esm/entry-points/drag-and-drop/drop-indicator.js +1 -0
  149. package/dist/esm/entry-points/drag-and-drop/group-drop-indicator.js +1 -0
  150. package/dist/esm/entry-points/drag-and-drop/hitbox.js +1 -0
  151. package/dist/esm/entry-points/drag-and-drop/use-menu-item-drag-and-drop.js +1 -0
  152. package/dist/esm/entry-points/expandable-menu-item.js +4 -0
  153. package/dist/esm/entry-points/flyout-menu-item.js +7 -0
  154. package/dist/esm/entry-points/link-menu-item.js +2 -0
  155. package/dist/esm/entry-points/menu-list-item.js +1 -0
  156. package/dist/esm/entry-points/menu-list.js +1 -0
  157. package/dist/esm/entry-points/menu-section.js +3 -0
  158. package/dist/esm/entry-points/top-level-spacer.js +1 -0
  159. package/dist/esm/index.js +3 -0
  160. package/dist/esm/ui/menu-item/button-menu-item.js +58 -0
  161. package/dist/esm/ui/menu-item/constants.js +15 -0
  162. package/dist/esm/ui/menu-item/container-avatar.compiled.css +4 -0
  163. package/dist/esm/ui/menu-item/container-avatar.js +26 -0
  164. package/dist/esm/ui/menu-item/drag-and-drop/drag-preview.compiled.css +9 -0
  165. package/dist/esm/ui/menu-item/drag-and-drop/drag-preview.js +58 -0
  166. package/dist/esm/ui/menu-item/drag-and-drop/drop-indicator.js +7 -0
  167. package/dist/esm/ui/menu-item/drag-and-drop/group-drop-indicator.js +7 -0
  168. package/dist/esm/ui/menu-item/drag-and-drop/hitbox.js +7 -0
  169. package/dist/esm/ui/menu-item/drag-and-drop/use-menu-item-drag-and-drop.js +193 -0
  170. package/dist/esm/ui/menu-item/drag-handle/drag-handle.compiled.css +9 -0
  171. package/dist/esm/ui/menu-item/drag-handle/drag-handle.js +19 -0
  172. package/dist/esm/ui/menu-item/drag-handle/lazy-drag-handle.js +11 -0
  173. package/dist/esm/ui/menu-item/expandable-menu-item/expandable-menu-item-content.compiled.css +2 -0
  174. package/dist/esm/ui/menu-item/expandable-menu-item/expandable-menu-item-content.js +42 -0
  175. package/dist/esm/ui/menu-item/expandable-menu-item/expandable-menu-item-context.js +57 -0
  176. package/dist/esm/ui/menu-item/expandable-menu-item/expandable-menu-item-level-context.js +9 -0
  177. package/dist/esm/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.compiled.css +14 -0
  178. package/dist/esm/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.js +141 -0
  179. package/dist/esm/ui/menu-item/expandable-menu-item/expandable-menu-item.compiled.css +1 -0
  180. package/dist/esm/ui/menu-item/expandable-menu-item/expandable-menu-item.js +60 -0
  181. package/dist/esm/ui/menu-item/flyout-menu-item/close-button.js +26 -0
  182. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-body.compiled.css +11 -0
  183. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-body.js +31 -0
  184. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-footer.compiled.css +5 -0
  185. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-footer.js +22 -0
  186. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-header.compiled.css +11 -0
  187. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-header.js +45 -0
  188. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item-content.compiled.css +8 -0
  189. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item-content.js +214 -0
  190. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item-context.js +51 -0
  191. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item-trigger.compiled.css +2 -0
  192. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item-trigger.js +59 -0
  193. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item.js +67 -0
  194. package/dist/esm/ui/menu-item/link-menu-item.compiled.css +1 -0
  195. package/dist/esm/ui/menu-item/link-menu-item.js +72 -0
  196. package/dist/esm/ui/menu-item/list-item.js +22 -0
  197. package/dist/esm/ui/menu-item/list.js +32 -0
  198. package/dist/esm/ui/menu-item/menu-item-signals.js +5 -0
  199. package/dist/esm/ui/menu-item/menu-item.compiled.css +101 -0
  200. package/dist/esm/ui/menu-item/menu-item.js +385 -0
  201. package/dist/esm/ui/menu-item/menu-list-item.js +12 -0
  202. package/dist/esm/ui/menu-item/menu-list.js +9 -0
  203. package/dist/esm/ui/menu-item/top-level-spacer.compiled.css +1 -0
  204. package/dist/esm/ui/menu-item/top-level-spacer.js +38 -0
  205. package/dist/esm/ui/menu-item/types.js +1 -0
  206. package/dist/esm/ui/menu-item/use-scroll-menu-item-into-view.js +63 -0
  207. package/dist/esm/ui/menu-section/divider.compiled.css +4 -0
  208. package/dist/esm/ui/menu-section/divider.js +24 -0
  209. package/dist/esm/ui/menu-section/menu-section-context.js +13 -0
  210. package/dist/esm/ui/menu-section/menu-section-heading.compiled.css +4 -0
  211. package/dist/esm/ui/menu-section/menu-section-heading.js +22 -0
  212. package/dist/esm/ui/menu-section/menu-section.js +42 -0
  213. package/dist/types/entry-points/button-menu-item.d.ts +3 -0
  214. package/dist/types/entry-points/container-avatar.d.ts +1 -0
  215. package/dist/types/entry-points/drag-and-drop/drag-handle.d.ts +1 -0
  216. package/dist/types/entry-points/drag-and-drop/drag-preview.d.ts +1 -0
  217. package/dist/types/entry-points/drag-and-drop/drop-indicator.d.ts +1 -0
  218. package/dist/types/entry-points/drag-and-drop/group-drop-indicator.d.ts +1 -0
  219. package/dist/types/entry-points/drag-and-drop/hitbox.d.ts +1 -0
  220. package/dist/types/entry-points/drag-and-drop/use-menu-item-drag-and-drop.d.ts +1 -0
  221. package/dist/types/entry-points/expandable-menu-item.d.ts +4 -0
  222. package/dist/types/entry-points/flyout-menu-item.d.ts +7 -0
  223. package/dist/types/entry-points/link-menu-item.d.ts +3 -0
  224. package/dist/types/entry-points/menu-list-item.d.ts +1 -0
  225. package/dist/types/entry-points/menu-list.d.ts +1 -0
  226. package/dist/types/entry-points/menu-section.d.ts +3 -0
  227. package/dist/types/entry-points/top-level-spacer.d.ts +1 -0
  228. package/dist/types/index.d.ts +1 -0
  229. package/dist/types/ui/menu-item/button-menu-item.d.ts +42 -0
  230. package/dist/types/ui/menu-item/constants.d.ts +15 -0
  231. package/dist/types/ui/menu-item/container-avatar.d.ts +18 -0
  232. package/dist/types/ui/menu-item/drag-and-drop/drag-preview.d.ts +24 -0
  233. package/dist/types/ui/menu-item/drag-and-drop/drop-indicator.d.ts +6 -0
  234. package/dist/types/ui/menu-item/drag-and-drop/group-drop-indicator.d.ts +6 -0
  235. package/dist/types/ui/menu-item/drag-and-drop/hitbox.d.ts +6 -0
  236. package/dist/types/ui/menu-item/drag-and-drop/use-menu-item-drag-and-drop.d.ts +62 -0
  237. package/dist/types/ui/menu-item/drag-handle/drag-handle.d.ts +6 -0
  238. package/dist/types/ui/menu-item/drag-handle/lazy-drag-handle.d.ts +4 -0
  239. package/dist/types/ui/menu-item/expandable-menu-item/expandable-menu-item-content.d.ts +17 -0
  240. package/dist/types/ui/menu-item/expandable-menu-item/expandable-menu-item-context.d.ts +36 -0
  241. package/dist/types/ui/menu-item/expandable-menu-item/expandable-menu-item-level-context.d.ts +4 -0
  242. package/dist/types/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.d.ts +65 -0
  243. package/dist/types/ui/menu-item/expandable-menu-item/expandable-menu-item.d.ts +65 -0
  244. package/dist/types/ui/menu-item/flyout-menu-item/close-button.d.ts +34 -0
  245. package/dist/types/ui/menu-item/flyout-menu-item/flyout-body.d.ts +38 -0
  246. package/dist/types/ui/menu-item/flyout-menu-item/flyout-footer.d.ts +25 -0
  247. package/dist/types/ui/menu-item/flyout-menu-item/flyout-header.d.ts +35 -0
  248. package/dist/types/ui/menu-item/flyout-menu-item/flyout-menu-item-content.d.ts +39 -0
  249. package/dist/types/ui/menu-item/flyout-menu-item/flyout-menu-item-context.d.ts +38 -0
  250. package/dist/types/ui/menu-item/flyout-menu-item/flyout-menu-item-trigger.d.ts +46 -0
  251. package/dist/types/ui/menu-item/flyout-menu-item/flyout-menu-item.d.ts +52 -0
  252. package/dist/types/ui/menu-item/link-menu-item.d.ts +22 -0
  253. package/dist/types/ui/menu-item/list-item.d.ts +27 -0
  254. package/dist/types/ui/menu-item/list.d.ts +28 -0
  255. package/dist/types/ui/menu-item/menu-item-signals.d.ts +6 -0
  256. package/dist/types/ui/menu-item/menu-item.d.ts +51 -0
  257. package/dist/types/ui/menu-item/menu-list-item.d.ts +11 -0
  258. package/dist/types/ui/menu-item/menu-list.d.ts +8 -0
  259. package/dist/types/ui/menu-item/top-level-spacer.d.ts +20 -0
  260. package/dist/types/ui/menu-item/types.d.ts +164 -0
  261. package/dist/types/ui/menu-item/use-scroll-menu-item-into-view.d.ts +12 -0
  262. package/dist/types/ui/menu-section/divider.d.ts +6 -0
  263. package/dist/types/ui/menu-section/menu-section-context.d.ts +6 -0
  264. package/dist/types/ui/menu-section/menu-section-heading.d.ts +16 -0
  265. package/dist/types/ui/menu-section/menu-section.d.ts +41 -0
  266. package/dist/types-ts4.5/entry-points/button-menu-item.d.ts +3 -0
  267. package/dist/types-ts4.5/entry-points/container-avatar.d.ts +1 -0
  268. package/dist/types-ts4.5/entry-points/drag-and-drop/drag-handle.d.ts +1 -0
  269. package/dist/types-ts4.5/entry-points/drag-and-drop/drag-preview.d.ts +1 -0
  270. package/dist/types-ts4.5/entry-points/drag-and-drop/drop-indicator.d.ts +1 -0
  271. package/dist/types-ts4.5/entry-points/drag-and-drop/group-drop-indicator.d.ts +1 -0
  272. package/dist/types-ts4.5/entry-points/drag-and-drop/hitbox.d.ts +1 -0
  273. package/dist/types-ts4.5/entry-points/drag-and-drop/use-menu-item-drag-and-drop.d.ts +1 -0
  274. package/dist/types-ts4.5/entry-points/expandable-menu-item.d.ts +4 -0
  275. package/dist/types-ts4.5/entry-points/flyout-menu-item.d.ts +7 -0
  276. package/dist/types-ts4.5/entry-points/link-menu-item.d.ts +3 -0
  277. package/dist/types-ts4.5/entry-points/menu-list-item.d.ts +1 -0
  278. package/dist/types-ts4.5/entry-points/menu-list.d.ts +1 -0
  279. package/dist/types-ts4.5/entry-points/menu-section.d.ts +3 -0
  280. package/dist/types-ts4.5/entry-points/top-level-spacer.d.ts +1 -0
  281. package/dist/types-ts4.5/index.d.ts +1 -0
  282. package/dist/types-ts4.5/ui/menu-item/button-menu-item.d.ts +42 -0
  283. package/dist/types-ts4.5/ui/menu-item/constants.d.ts +15 -0
  284. package/dist/types-ts4.5/ui/menu-item/container-avatar.d.ts +18 -0
  285. package/dist/types-ts4.5/ui/menu-item/drag-and-drop/drag-preview.d.ts +24 -0
  286. package/dist/types-ts4.5/ui/menu-item/drag-and-drop/drop-indicator.d.ts +6 -0
  287. package/dist/types-ts4.5/ui/menu-item/drag-and-drop/group-drop-indicator.d.ts +6 -0
  288. package/dist/types-ts4.5/ui/menu-item/drag-and-drop/hitbox.d.ts +6 -0
  289. package/dist/types-ts4.5/ui/menu-item/drag-and-drop/use-menu-item-drag-and-drop.d.ts +62 -0
  290. package/dist/types-ts4.5/ui/menu-item/drag-handle/drag-handle.d.ts +6 -0
  291. package/dist/types-ts4.5/ui/menu-item/drag-handle/lazy-drag-handle.d.ts +4 -0
  292. package/dist/types-ts4.5/ui/menu-item/expandable-menu-item/expandable-menu-item-content.d.ts +17 -0
  293. package/dist/types-ts4.5/ui/menu-item/expandable-menu-item/expandable-menu-item-context.d.ts +36 -0
  294. package/dist/types-ts4.5/ui/menu-item/expandable-menu-item/expandable-menu-item-level-context.d.ts +4 -0
  295. package/dist/types-ts4.5/ui/menu-item/expandable-menu-item/expandable-menu-item-trigger.d.ts +65 -0
  296. package/dist/types-ts4.5/ui/menu-item/expandable-menu-item/expandable-menu-item.d.ts +65 -0
  297. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/close-button.d.ts +34 -0
  298. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-body.d.ts +38 -0
  299. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-footer.d.ts +25 -0
  300. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-header.d.ts +35 -0
  301. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-menu-item-content.d.ts +39 -0
  302. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-menu-item-context.d.ts +38 -0
  303. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-menu-item-trigger.d.ts +46 -0
  304. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-menu-item.d.ts +52 -0
  305. package/dist/types-ts4.5/ui/menu-item/link-menu-item.d.ts +22 -0
  306. package/dist/types-ts4.5/ui/menu-item/list-item.d.ts +27 -0
  307. package/dist/types-ts4.5/ui/menu-item/list.d.ts +28 -0
  308. package/dist/types-ts4.5/ui/menu-item/menu-item-signals.d.ts +6 -0
  309. package/dist/types-ts4.5/ui/menu-item/menu-item.d.ts +51 -0
  310. package/dist/types-ts4.5/ui/menu-item/menu-list-item.d.ts +11 -0
  311. package/dist/types-ts4.5/ui/menu-item/menu-list.d.ts +8 -0
  312. package/dist/types-ts4.5/ui/menu-item/top-level-spacer.d.ts +20 -0
  313. package/dist/types-ts4.5/ui/menu-item/types.d.ts +164 -0
  314. package/dist/types-ts4.5/ui/menu-item/use-scroll-menu-item-into-view.d.ts +12 -0
  315. package/dist/types-ts4.5/ui/menu-section/divider.d.ts +6 -0
  316. package/dist/types-ts4.5/ui/menu-section/menu-section-context.d.ts +6 -0
  317. package/dist/types-ts4.5/ui/menu-section/menu-section-heading.d.ts +16 -0
  318. package/dist/types-ts4.5/ui/menu-section/menu-section.d.ts +41 -0
  319. package/drag-and-drop/drag-handle/package.json +17 -0
  320. package/drag-and-drop/drag-preview/package.json +17 -0
  321. package/drag-and-drop/drop-indicator/package.json +17 -0
  322. package/drag-and-drop/group-drop-indicator/package.json +17 -0
  323. package/drag-and-drop/hitbox/package.json +17 -0
  324. package/drag-and-drop/use-menu-item-drag-and-drop/package.json +17 -0
  325. package/expandable-menu-item/package.json +17 -0
  326. package/flyout-menu-item/package.json +17 -0
  327. package/link-menu-item/package.json +17 -0
  328. package/menu-list/package.json +17 -0
  329. package/menu-list-item/package.json +17 -0
  330. package/menu-section/package.json +17 -0
  331. package/package.json +121 -0
  332. package/top-level-spacer/package.json +17 -0
@@ -0,0 +1,385 @@
1
+ /* menu-item.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ import "./menu-item.compiled.css";
5
+ import { ax, ix } from "@compiled/react/runtime";
6
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
+ import React, { Suspense, useCallback, useRef } from 'react';
9
+ import { cx } from '@compiled/react';
10
+ import { AvatarContext } from '@atlaskit/avatar';
11
+ import forwardRefWithGeneric from '@atlaskit/ds-lib/forward-ref-with-generic';
12
+ import mergeRefs from '@atlaskit/ds-lib/merge-refs';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
14
+ import { Anchor, Pressable, Text } from '@atlaskit/primitives/compiled';
15
+ import Tooltip from '@atlaskit/tooltip';
16
+ import { expandableMenuItemIndentation } from './constants';
17
+ import { LazyDragHandle } from './drag-handle/lazy-drag-handle';
18
+ import { useLevel } from './expandable-menu-item/expandable-menu-item-context';
19
+ import { useFlyoutMenuOpen, useSetFlyoutMenuOpen } from './flyout-menu-item/flyout-menu-item-context';
20
+ import { COLLAPSE_ELEM_BEFORE } from './menu-item-signals';
21
+ function isTextClamped(element) {
22
+ // Checking for vertical height rather than horizontal height.
23
+ // When text is "clamped", it's technically being clamped vertically! 🤯
24
+ return element.scrollHeight > element.clientHeight;
25
+ }
26
+ var defaultAvatarValues = {
27
+ size: 'small'
28
+ };
29
+ var elemAfterDisplayVar = '--elem-after-display';
30
+ var actionsOnHoverOpacityVar = '--actions-on-hover-opacity';
31
+ var actionsOnHoverWidthVar = '--actions-on-hover-width';
32
+ var actionsOnHoverPaddingInlineEndVar = '--actions-on-hover-padding';
33
+ var notchColorVar = '--notch-color';
34
+
35
+ // Note: this is also used in `drag-handle.tsx`
36
+ var dragHandleDisplayVar = '--drag-handle-display';
37
+ var dragCursorAnimation = null;
38
+
39
+ /**
40
+ * ## 🤹 `position:relative`
41
+ *
42
+ * We need `position:relative` on an element that takes
43
+ * up the full size of the interactive element so we
44
+ * can correctly use `position:absolute` to place:
45
+ * 1. the notch for links
46
+ * 2. drop indicators for drag and drop
47
+ * 3. a child of button / anchor to stretch it out to
48
+ * increase it's pressable area.
49
+ *
50
+ * ⛔️ We cannot add `position:relative` _only_ on the
51
+ * button / anchor as that will cause sibling elements
52
+ * to be rendered under the button / anchor when setting
53
+ * a background color on the button / anchor.
54
+ *
55
+ * 📖 Note: `position:relative` elements are painted after
56
+ * elements with `position:static` (the default)
57
+ * https://drafts.csswg.org/css-position-4/#painting-order
58
+ *
59
+ * ⛔️ We cannot add `position:relative` to the container
60
+ * element, as then the `:focus` ring styles on the
61
+ * button / anchor can be cut off by the next sibling if it has
62
+ * has a background color set (eg when selected)
63
+ *
64
+ * ✅ Add `position:relative` to all first level descendants
65
+ * of the container element so that we don't impact DOM ordered
66
+ * paint ordering within the item and the button / anchor focus
67
+ * ring can still bleed over siblings
68
+ *
69
+ * 📖 We could use `> * { position: relative; }` on the container,
70
+ * but that would violate our styling standard.
71
+ */
72
+ var topLevelSiblingStyles = {
73
+ root: "_kqswh2mm"
74
+ };
75
+
76
+ /**
77
+ * All slots on the menu item (eg `elemBefore`) are rendered as siblings
78
+ * of our main button / anchor element and they are visually placed on
79
+ * top of the main button / anchor.
80
+ *
81
+ * 📖 This is done so that we don't nest interactive elements in our markup.
82
+ *
83
+ * ✅ This is great when element in the slot is an interactive element
84
+ * as we don't want the main menu item button / anchor to be triggered
85
+ * when interacting with the element in the slot.
86
+ *
87
+ * ⛔️ When the element in the slot is static content (eg an `<Icon>`) it will
88
+ * prevent the main button / anchor (that is visually behind the element in
89
+ * the slot) from being clicked. The element in the slot is a sibling of our
90
+ * main button / anchor (not a child of it) so clicking on the element in the
91
+ * slot will not bubble up to the button / anchor.
92
+ *
93
+ * 🚀 We set `pointer-events:none` on a slot if it does not contain and interactive
94
+ * element so that static content in a slot does not prevent clicking on the main
95
+ * button / anchor.
96
+ */
97
+ var onTopOfButtonOrAnchorStyles = {
98
+ root: "_18ukglyw"
99
+ };
100
+
101
+ /**
102
+ * This is being _internally_ exported so it can be used in other menu item wrapper components, like
103
+ * ExpandableMenuItemTrigger.
104
+ *
105
+ * This selector is used to apply hover styling on the menu item if it contains an open nested popup.
106
+ * It's looking for a popup trigger with `aria-hasexpanded` and `aria-haspopup` attributes. The
107
+ * reason for targeting the _trigger_ instead of the popup itself, is the popup might be rendered
108
+ * outside the menu item, e.g. if rendered in a portal.
109
+ *
110
+ * An alternative solution might involve wrapping it with a popup context and listening to the popup
111
+ * events through it (and applying the hover style when the popup is open). Exploring this has been
112
+ * captured in [BLU-3354](https://jplat.atlassian.net/browse/BLU-3354).
113
+ */
114
+ export var nestedOpenPopupCSSSelector = '&:has([aria-expanded="true"][aria-haspopup="true"])';
115
+ var containerStyles = {
116
+ root: "_2rko12b0 _vchhusvi _1e0c11p5 _yv0e7dup _2z05hkll _1lmcu4vt _1ul9t9kd _4t3iviql _4cvr1h6o _uiztglyw _syazazsu _1yyu1j28 _91ju1txw _uomdidpf _pmxpidpf _db80idpf _qxq9kb7n _1rbv1wug _kwq51b66 _1swv19i6 _irr319i6 _t7p8kb7n _g4kikb7n _91nl1wug _ynyi1wug _iy5o1b66 _v4o21b66",
117
+ rootT26Shape: "_2rko1qi0",
118
+ removeElemAfter: "_91juglyw",
119
+ showHoverActions: "_uomdkb7n _pmxp1wug _db801b66",
120
+ removeElemAfterOnHoverOrOpenNestedPopup: "_1djyglyw _1mfcglyw _1sjuglyw",
121
+ selected: "_bfhk15s3 _syaz6x5g _1yyujmqp _1swvufnl _30l36x5g _irr3ufnl",
122
+ disabled: "_syaz1gmx _bfhkn7od _irr3n7od _30l31gmx",
123
+ hasDescription: "_4t3i1wto",
124
+ dragging: "_tzy41ou4"
125
+ };
126
+ var buttonOrAnchorStyles = {
127
+ root: "_2rko12b0 _yyhyjvu9 _1ii7kb7n _1e0c11p5 _yv0enbh3 _2z05nbh3 _y4ti1b66 _bozg1b66 _1q511b66 _85i51b66 _bfhk1j28 _syazazsu _4cvr1h6o _y3gnv2br _14iu13ro",
128
+ rootT26Shape: "_2rko1qi0",
129
+ selected: "_syaz6x5g _14iunozp",
130
+ hasDragIndicator: "_1ifmglyw _1cykglyw _x0kw1txw _11om6b4r _7psyru3m _1uy01amc _bir2q7pw"
131
+ };
132
+ var extendButtonOrAnchorStyles = {
133
+ root: "_1r04ze3t _kqswstnw"
134
+ };
135
+ var notchStyles = {
136
+ root: "_kqswstnw _152t1ssb _1e02ze3t _1bsbyh40 _4t3i1crf _t9ec1i34 _bfhk1o0g"
137
+ };
138
+ var actionStyles = {
139
+ root: "_zulp1b66 _nd5lbc26 _1reo15vq _18m915vq _1e0c1txw _4cvr1h6o _y4ti1b66 _1guo18uv _12s918uv"
140
+ };
141
+ var actionsOnHoverStyles = {
142
+ root: "_nd5l16dh _zulp1b66 _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _tzy4pnc3 _1bsbty16 _y4tidria _1guo18uv _12s918uv"
143
+ };
144
+ var textStyles = {
145
+ root: "_zulpv77o _1reo15vq _18m915vq _y4ti1b66 _bozg1b66 _1e0c1txw _2lx21bp4 _1ul91c9m _1guo18uv _12s918uv",
146
+ noElemBeforeIndent: "_bozg12x7"
147
+ };
148
+ var elemBeforeStyles = {
149
+ root: "_nd5l17zh _1reo15vq _18m915vq _1e0c1txw _1o9zidpf _1bsb1tcg _4t3i1tcg _4cvr1h6o _1bah1h6o _bozg1b66 _vchh1ntv _1guo18uv _12s918uv"
150
+ };
151
+ var elemAfterStyles = {
152
+ root: "_nd5l16dh _1reo15vq _18m915vq _1e0c13yo _1o9zidpf _4t3i1tcg _4cvr1h6o _y4ti1b66 _1guo18uv _12s918uv"
153
+ };
154
+
155
+ /**
156
+ * We are using a wrapping element for our interactive content
157
+ * even though only the `Text` element is the only thing not using `position:absolute`
158
+ *
159
+ * Rationale:
160
+ * - Super clear that everything inside the interactive content should be in a specific slot in the grid
161
+ * - To work around a browser bug in Safari where it does not work well with `position:absolute`
162
+ * on a subgrid child.
163
+ * Safari bug: https://bugs.webkit.org/show_bug.cgi?id=292516
164
+ */
165
+ var interactiveContentStyles = {
166
+ root: "_nd5l19l3 _1e0c1txw _2lx21bp4 _ae4v1h6o"
167
+ };
168
+ function getTextColor(_ref) {
169
+ var isDisabled = _ref.isDisabled,
170
+ isSelected = _ref.isSelected;
171
+ if (isDisabled) {
172
+ return 'color.text.disabled';
173
+ }
174
+ if (isSelected) {
175
+ return 'color.text.selected';
176
+ }
177
+ return 'color.text.subtle';
178
+ }
179
+
180
+ /**
181
+ * Includes all props that are used by any menu item, as MenuItembase is the base component for all menu item components.
182
+ *
183
+ * We also include additional `aria` props to support the menu item being a trigger for the FlyoutMenuItem popup and for the
184
+ * expanded content for ExpandableMenuItem.
185
+ */
186
+
187
+ /**
188
+ * This is the internal version of the component, to be passed into `forwardRef`.
189
+ *
190
+ * It contains a type argument `<T>`, to specify the type of the interactive element (`button` or `a`).
191
+ * This can be inferred from the type of the `onClick` prop.
192
+ */
193
+ var MenuItemBaseNoRef = function MenuItemBaseNoRef(_ref2, forwardedRef) {
194
+ var id = _ref2.id,
195
+ testId = _ref2.testId,
196
+ actions = _ref2.actions,
197
+ actionsOnHover = _ref2.actionsOnHover,
198
+ children = _ref2.children,
199
+ description = _ref2.description,
200
+ elemAfter = _ref2.elemAfter,
201
+ elemBefore = _ref2.elemBefore,
202
+ href = _ref2.href,
203
+ target = _ref2.target,
204
+ isDisabled = _ref2.isDisabled,
205
+ isSelected = _ref2.isSelected,
206
+ onClick = _ref2.onClick,
207
+ ariaControls = _ref2.ariaControls,
208
+ ariaExpanded = _ref2.ariaExpanded,
209
+ ariaHasPopup = _ref2.ariaHasPopup,
210
+ interactionName = _ref2.interactionName,
211
+ isContentTooltipDisabled = _ref2.isContentTooltipDisabled,
212
+ visualContentRef = _ref2.visualContentRef,
213
+ isDragging = _ref2.isDragging,
214
+ hasDragIndicator = _ref2.hasDragIndicator,
215
+ dropIndicator = _ref2.dropIndicator;
216
+ var level = useLevel();
217
+ var setFlyoutMenuOpen = useSetFlyoutMenuOpen();
218
+ var isFlyoutMenuOpen = useFlyoutMenuOpen();
219
+ var isLink = typeof href !== 'undefined';
220
+ var labelRef = useRef(null);
221
+ var descriptionRef = useRef(null);
222
+ var tooltipOnClick = useRef(null);
223
+ var handleClick = useCallback(function (event, analyticsEvent) {
224
+ var _tooltipOnClick$curre;
225
+ onClick === null || onClick === void 0 || onClick(event, analyticsEvent);
226
+ // Toggle flyout menu open state when inside a flyout context provider
227
+ setFlyoutMenuOpen(!isFlyoutMenuOpen);
228
+ (_tooltipOnClick$curre = tooltipOnClick.current) === null || _tooltipOnClick$curre === void 0 || _tooltipOnClick$curre.call(tooltipOnClick, event);
229
+ }, [onClick, setFlyoutMenuOpen, isFlyoutMenuOpen]);
230
+
231
+ /**
232
+ * Show the tooltip if _either_ label or description is truncated
233
+ */
234
+ var canTooltipAppear = useCallback(function () {
235
+ if (isContentTooltipDisabled) {
236
+ return false;
237
+ }
238
+
239
+ // Show tooltip if _either_ label or description are clamped
240
+
241
+ var label = labelRef.current;
242
+ var description = descriptionRef.current;
243
+ if (label && isTextClamped(label)) {
244
+ return true;
245
+ }
246
+ return Boolean(description && isTextClamped(description));
247
+ }, [isContentTooltipDisabled]);
248
+
249
+ // By default provide the spacing for `elemBefore` to have good
250
+ // vertical alignment of labels and to give clear indentation between levels
251
+ // in the side navigation (even when items don't use elemBefore).
252
+ var showElemBefore = elemBefore !== COLLAPSE_ELEM_BEFORE;
253
+ var interactiveElemContent = /*#__PURE__*/React.createElement("div", {
254
+ className: ax([interactiveContentStyles.root])
255
+ }, /*#__PURE__*/React.createElement("div", {
256
+ // This extends the clickable area of nested menu items to the width
257
+ // of the root level menu items, while being visually indented.
258
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
259
+ style: {
260
+ insetInlineStart: "calc(-1 * ".concat(level, " * ").concat(expandableMenuItemIndentation, ")")
261
+ },
262
+ "aria-hidden": "true",
263
+ className: ax([extendButtonOrAnchorStyles.root])
264
+ }), /*#__PURE__*/React.createElement("div", {
265
+ className: ax([textStyles.root, !showElemBefore && textStyles.noElemBeforeIndent])
266
+ }, /*#__PURE__*/React.createElement(Text, {
267
+ weight: "medium",
268
+ maxLines: 1,
269
+ color: getTextColor({
270
+ isDisabled: isDisabled,
271
+ isSelected: isSelected
272
+ }),
273
+ ref: labelRef
274
+ }, children), description && /*#__PURE__*/React.createElement(Text, {
275
+ color: fg('platform-dst-menu-item-description-selected') ? getTextColor({
276
+ isDisabled: isDisabled,
277
+ isSelected: isSelected
278
+ }) : isDisabled ? 'color.text.disabled' : 'color.text.subtle',
279
+ size: "small",
280
+ maxLines: 1,
281
+ ref: descriptionRef
282
+ }, description)), hasDragIndicator ? /*#__PURE__*/React.createElement(Suspense, {
283
+ fallback: null
284
+ }, /*#__PURE__*/React.createElement(LazyDragHandle, null)) : null, dropIndicator);
285
+
286
+ /**
287
+ * If the [expandable] menu item is expanded, show hover actions even when *not* hovered.
288
+ *
289
+ * Note: we also remove the `elemAfter` when showing `actionsOnHover`
290
+ */
291
+ var showHoverActionsWhenNotHovered = Boolean(ariaExpanded && actionsOnHover);
292
+ return /*#__PURE__*/React.createElement(AvatarContext.Provider, {
293
+ value: defaultAvatarValues
294
+ }, /*#__PURE__*/React.createElement("div", {
295
+ ref: visualContentRef,
296
+ "data-testid": testId ? "".concat(testId, "-container") : undefined,
297
+ "data-selected": isSelected,
298
+ className: ax([containerStyles.root, fg('platform-dst-shape-theme-default') && containerStyles.rootT26Shape, isSelected && containerStyles.selected, isDragging && containerStyles.dragging, description && containerStyles.hasDescription, showHoverActionsWhenNotHovered && containerStyles.showHoverActions, showHoverActionsWhenNotHovered && elemAfter && containerStyles.removeElemAfter, actionsOnHover && elemAfter && containerStyles.removeElemAfterOnHoverOrOpenNestedPopup, isDisabled && containerStyles.disabled])
299
+ }, /*#__PURE__*/React.createElement(Tooltip, {
300
+ content: function content() {
301
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, children), description ? /*#__PURE__*/React.createElement("div", null, description) : null);
302
+ },
303
+ position: "right-start",
304
+ ignoreTooltipPointerEvents: true,
305
+ hideTooltipOnMouseDown: true
306
+ // We don't need a duplicate hidden element containing tooltip content
307
+ // as the content of the tooltip matches what is rendered for the menu item.
308
+ ,
309
+ isScreenReaderAnnouncementDisabled: true,
310
+ canAppear: canTooltipAppear
311
+ }, function (tooltipProps) {
312
+ // Putting the tooltip onClick into a ref.
313
+ // This way we don't need to create a new `onClick` function on each
314
+ // render (as we would need to merge `tooltipProps.onClick` and our `handleClick`)
315
+ tooltipOnClick.current = tooltipProps.onClick;
316
+ var sharedProps = _objectSpread(_objectSpread({}, tooltipProps), {}, {
317
+ 'aria-controls': ariaControls,
318
+ 'aria-haspopup': ariaHasPopup,
319
+ ref: mergeRefs([forwardedRef, tooltipProps.ref]),
320
+ id: id,
321
+ testId: testId,
322
+ interactionName: interactionName
323
+ });
324
+ return isLink ? /*#__PURE__*/React.createElement(Anchor, _extends({}, sharedProps, {
325
+ onClick: handleClick,
326
+ xcss: cx(buttonOrAnchorStyles.root, fg('platform-dst-shape-theme-default') && buttonOrAnchorStyles.rootT26Shape, topLevelSiblingStyles.root, isSelected && buttonOrAnchorStyles.selected, hasDragIndicator && buttonOrAnchorStyles.hasDragIndicator)
327
+ // Needed to override Anchor style due to a compiled/emotion conflict
328
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
329
+ ,
330
+ style: {
331
+ textDecoration: 'none'
332
+ },
333
+ "aria-current": isSelected ? 'page' : undefined,
334
+ href: href,
335
+ target: target
336
+ /**
337
+ * For anchors we don't want to have the standard drag and drop behaviour.
338
+ *
339
+ * Thinking on the topic:
340
+ *
341
+ * - Anchors look visually similar to buttons in the sidenav
342
+ * - Why should some menu items be natively draggable, while others are not?
343
+ * - A user cannot know which menu items are "natively" draggable (ie anchors)
344
+ * - If you wire up an anchor to be draggable using our standard affordances
345
+ * it will have a different preview experience to native anchor dragging.
346
+ *
347
+ * To promote consistency, all elements need to use the same visual affordances.
348
+ *
349
+ * Anchor elements will automatically attach URL information
350
+ * to the native data store.
351
+ *
352
+ * When `hasDragIndicator` is `true` we are expecting consumers to register
353
+ * the element as draggable through the `draggable()` Pragmatic drag and drop function.
354
+ * The `draggable()` function will add `draggable="true"` to the element.
355
+ */,
356
+ draggable: hasDragIndicator ? undefined : false
357
+ }), /*#__PURE__*/React.createElement("div", {
358
+ "aria-hidden": "true",
359
+ className: ax([notchStyles.root])
360
+ }), interactiveElemContent) : /*#__PURE__*/React.createElement(Pressable, _extends({}, sharedProps, {
361
+ onClick: handleClick,
362
+ xcss: cx(buttonOrAnchorStyles.root, fg('platform-dst-shape-theme-default') && buttonOrAnchorStyles.rootT26Shape, topLevelSiblingStyles.root, isSelected && buttonOrAnchorStyles.selected, hasDragIndicator && buttonOrAnchorStyles.hasDragIndicator),
363
+ "aria-expanded": ariaExpanded,
364
+ isDisabled: isDisabled
365
+ }), interactiveElemContent);
366
+ }), showElemBefore && /*#__PURE__*/React.createElement("div", {
367
+ className: ax([elemBeforeStyles.root, topLevelSiblingStyles.root, onTopOfButtonOrAnchorStyles.root])
368
+ }, elemBefore), actionsOnHover && /*#__PURE__*/React.createElement("div", {
369
+ className: ax([actionsOnHoverStyles.root])
370
+ }, actionsOnHover), elemAfter && /*#__PURE__*/React.createElement("div", {
371
+ className: ax([elemAfterStyles.root, topLevelSiblingStyles.root, onTopOfButtonOrAnchorStyles.root])
372
+ }, elemAfter), actions && /*#__PURE__*/React.createElement("div", {
373
+ className: ax([actionStyles.root, topLevelSiblingStyles.root, onTopOfButtonOrAnchorStyles.root])
374
+ }, actions)));
375
+ };
376
+
377
+ /**
378
+ * __MenuItemBase__
379
+ *
380
+ * The base menu item component used to compose ButtonMenuItem and LinkMenuItem.
381
+ *
382
+ * It contains a type argument `<T>`, to specify the type of the interactive element (`button` or `a`).
383
+ * This can be inferred from the type of the `onClick` prop.
384
+ */
385
+ export var MenuItemBase = forwardRefWithGeneric(MenuItemBaseNoRef);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { ListItem } from './list-item';
6
+
7
+ /**
8
+ * __Menu list item__
9
+ *
10
+ * A [list item](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li) with visual styles removed.
11
+ */
12
+ export var MenuListItem = ListItem;
@@ -0,0 +1,9 @@
1
+ import { List } from './list';
2
+
3
+ /**
4
+ * __Menu list__
5
+ *
6
+ * An [unordered list](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul) with visual styles removed,
7
+ * for semantically grouping list items.
8
+ */
9
+ export var MenuList = List;
@@ -0,0 +1 @@
1
+ ._4t3iutpp{height:var(--ds-space-150,9pt)}
@@ -0,0 +1,38 @@
1
+ /* top-level-spacer.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import "./top-level-spacer.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { useEffect } from 'react';
6
+ import { useLevel } from './expandable-menu-item/expandable-menu-item-context';
7
+ var styles = {
8
+ root: "_4t3iutpp"
9
+ };
10
+
11
+ /**
12
+ * Use this component to create visual separation between the:
13
+ *
14
+ * - global app shortcut section
15
+ * - 'more' button menu item
16
+ * - starred spaces (in Confluence)
17
+ *
18
+ * Only use this component in the top level of the menu,
19
+ * and exercise caution when using it in new situations.
20
+ *
21
+ * This component exists to fulfil product design requirements but has not yet
22
+ * been consolidated into the wider navigation system.
23
+ *
24
+ * It may not exist in the future when global apps are no longer in the side navigation.
25
+ */
26
+ export function TopLevelSpacer() {
27
+ var level = useLevel();
28
+ useEffect(function () {
29
+ if (process.env.NODE_ENV !== 'production') {
30
+ if (level !== 0) {
31
+ throw new Error('TopLevelSpacer should only be used in the top level of the menu. Please speak with DST if you have a novel use case.');
32
+ }
33
+ }
34
+ }, [level]);
35
+ return /*#__PURE__*/React.createElement("div", {
36
+ className: ax([styles.root])
37
+ });
38
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,63 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import invariant from 'tiny-invariant';
3
+ import { useAreAllAncestorsExpanded } from './expandable-menu-item/expandable-menu-item-context';
4
+ function scrollMenuItemIntoView(element) {
5
+ var _element$scrollIntoVi;
6
+ /**
7
+ * If [scrollIntoViewIfNeeded](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded) is available,
8
+ * we are using it to scroll the element into view _in the center_ of the scroll container. Because it is a non-standard method
9
+ * and not available on all browsers (currently not supported in Firefox), we are using it for progressive enhancement.
10
+ *
11
+ * Otherwise, we are falling back to [scrollIntoView](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView).
12
+ */
13
+ var elementWithScrollMethod = element;
14
+ if (typeof elementWithScrollMethod.scrollIntoViewIfNeeded === 'function') {
15
+ elementWithScrollMethod.scrollIntoViewIfNeeded(true);
16
+ return;
17
+ }
18
+
19
+ // JSDOM does not support scrollIntoView, so defensively using it (see https://github.com/jsdom/jsdom/issues/1695)
20
+ (_element$scrollIntoVi = element.scrollIntoView) === null || _element$scrollIntoVi === void 0 || _element$scrollIntoVi.call(element, {
21
+ // We are using `nearest` to prevent scrolling on user interaction when the menu item is already in view.
22
+ block: 'nearest'
23
+ });
24
+ }
25
+
26
+ /**
27
+ * Scrolls the element into view once it is selected, and once all its ancestors (expandable
28
+ * parent menu items) are expanded.
29
+ *
30
+ * Once that has happened, we don't want to scroll it into view again until it has been unselected.
31
+ * This is to prevent the menu item from being scrolled into view again if the user collapses a
32
+ * parent and then expands it again, without changing what menu item is selected.
33
+ */
34
+ export function useScrollMenuItemIntoView(_ref) {
35
+ var elementRef = _ref.elementRef,
36
+ isSelected = _ref.isSelected;
37
+ var areAllAncestorsExpanded = useAreAllAncestorsExpanded();
38
+ var waitingStateRef = useRef({
39
+ type: 'waiting-to-be-selected-and-all-ancestors-expanded'
40
+ });
41
+ useEffect(function () {
42
+ if (waitingStateRef.current.type === 'waiting-to-be-selected-and-all-ancestors-expanded') {
43
+ var shouldScroll = areAllAncestorsExpanded && isSelected;
44
+ if (!shouldScroll) {
45
+ return;
46
+ }
47
+ var element = elementRef.current;
48
+ invariant(element, 'Element ref must be set');
49
+ scrollMenuItemIntoView(element);
50
+
51
+ // Now that we are scrolled the menu item into view, we need to wait for the menu item to
52
+ // be unselected before checking again.
53
+ waitingStateRef.current.type = 'waiting-to-be-unselected';
54
+ return;
55
+ }
56
+ if (waitingStateRef.current.type === 'waiting-to-be-unselected') {
57
+ if (!isSelected) {
58
+ waitingStateRef.current.type = 'waiting-to-be-selected-and-all-ancestors-expanded';
59
+ }
60
+ return;
61
+ }
62
+ }, [areAllAncestorsExpanded, elementRef, isSelected]);
63
+ }
@@ -0,0 +1,4 @@
1
+
2
+ ._h7alglyw{border-inline:none}._179rglyw{border-block-end:none}
3
+ ._mqm2ia51{border-block-start:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}
4
+ ._1bsb1osq{width:100%}
@@ -0,0 +1,24 @@
1
+ /* divider.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import "./divider.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ var styles = null;
6
+
7
+ /**
8
+ * __Divider__
9
+ *
10
+ * A divider for use between menu sections.
11
+ */
12
+ export var Divider = function Divider() {
13
+ return /*#__PURE__*/React.createElement("hr", {
14
+ /**
15
+ * The existing usage of these dividers is presentational,
16
+ * so we are removing the separator semantics by default.
17
+ *
18
+ * In the future we may consider allowing opt-in separator semantics,
19
+ * but it probably isn't necessary.
20
+ */
21
+ role: "none",
22
+ className: ax(["_h7alglyw _179rglyw _mqm2ia51 _1bsb1osq"])
23
+ });
24
+ };
@@ -0,0 +1,13 @@
1
+ import { createContext, useContext } from 'react';
2
+ import invariant from 'tiny-invariant';
3
+
4
+ /**
5
+ * Context for the current menu section. It holds a unique ID for the section, used for associating the section heading
6
+ * as an accessible label for the group.
7
+ */
8
+ export var MenuSectionContext = /*#__PURE__*/createContext(null);
9
+ export var useMenuSectionContext = function useMenuSectionContext() {
10
+ var context = useContext(MenuSectionContext);
11
+ invariant(context, 'useMenuSectionContext must be used within a MenuSection');
12
+ return context;
13
+ };
@@ -0,0 +1,4 @@
1
+ ._11c8i4vh{font:var(--ds-font-heading-xxsmall,normal 653 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
+ ._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
3
+ ._bozg12x7{padding-inline-start:var(--ds-space-075,6px)}
4
+ ._syaz1rpy{color:var(--ds-text-subtlest,#6b6e76)}
@@ -0,0 +1,22 @@
1
+ /* menu-section-heading.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import "./menu-section-heading.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { useMenuSectionContext } from './menu-section-context';
6
+ var styles = {
7
+ root: "_11c8i4vh _1rjcu2gc _syaz1rpy _bozg12x7"
8
+ };
9
+
10
+ /**
11
+ * __MenuSectionHeading__
12
+ *
13
+ * The label for the menu section group.
14
+ */
15
+ export var MenuSectionHeading = function MenuSectionHeading(_ref) {
16
+ var children = _ref.children;
17
+ var id = useMenuSectionContext();
18
+ return /*#__PURE__*/React.createElement("p", {
19
+ id: "".concat(id, "-heading"),
20
+ className: ax([styles.root])
21
+ }, children);
22
+ };
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { useId } from '@atlaskit/ds-lib/use-id';
3
+ import { MenuListItem } from '../menu-item/menu-list-item';
4
+ import { MenuSectionContext } from './menu-section-context';
5
+ /**
6
+ * __MenuSection__
7
+ *
8
+ * A composable component for grouping menu items, along with a heading (`MenuSectionHeading`) and a divider (`Divider`).
9
+ *
10
+ * Usage example:
11
+ * ```tsx
12
+ * <MenuSection>
13
+ * <MenuSectionHeading>Section heading</MenuSectionHeading>
14
+ * <MenuList>
15
+ * <MenuItem>Item 1</MenuItem>
16
+ * <MenuItem>Item 2</MenuItem>
17
+ * </MenuList>
18
+ * <Divider />
19
+ * </MenuSection>
20
+ * ```
21
+ */
22
+ export var MenuSection = function MenuSection(_ref) {
23
+ var children = _ref.children,
24
+ testId = _ref.testId,
25
+ _ref$isMenuListItem = _ref.isMenuListItem,
26
+ isMenuListItem = _ref$isMenuListItem === void 0 ? false : _ref$isMenuListItem;
27
+ var id = useId();
28
+ var content = /*#__PURE__*/React.createElement(MenuSectionContext.Provider, {
29
+ value: id
30
+ }, /*#__PURE__*/React.createElement("div", {
31
+ role: "group",
32
+ "aria-labelledby": "".concat(id, "-heading")
33
+ }, children));
34
+ if (isMenuListItem) {
35
+ return /*#__PURE__*/React.createElement(MenuListItem, {
36
+ testId: testId
37
+ }, content);
38
+ }
39
+
40
+ // Legacy. isMenuListItem should become default.
41
+ return content;
42
+ };
@@ -0,0 +1,3 @@
1
+ export { ButtonMenuItem, type ButtonMenuItemProps } from '../ui/menu-item/button-menu-item';
2
+ export { COLLAPSE_ELEM_BEFORE } from '../ui/menu-item/menu-item-signals';
3
+ export type { MenuItemOnClick } from '../ui/menu-item/types';
@@ -0,0 +1 @@
1
+ export { ContainerAvatar, type ContainerAvatarProps } from '../ui/menu-item/container-avatar';
@@ -0,0 +1 @@
1
+ export { LazyDragHandle } from '../../ui/menu-item/drag-handle/lazy-drag-handle';
@@ -0,0 +1 @@
1
+ export { DragPreview } from '../../ui/menu-item/drag-and-drop/drag-preview';
@@ -0,0 +1 @@
1
+ export { DropIndicator, type Instruction, type Operation, } from '../../ui/menu-item/drag-and-drop/drop-indicator';
@@ -0,0 +1 @@
1
+ export { GroupDropIndicator } from '../../ui/menu-item/drag-and-drop/group-drop-indicator';
@@ -0,0 +1 @@
1
+ export { attachInstruction, extractInstruction, type Availability, type Operation, type Instruction, } from '../../ui/menu-item/drag-and-drop/hitbox';
@@ -0,0 +1 @@
1
+ export { useMenuItemDragAndDrop, type TMenuItemDragAndDropState, } from '../../ui/menu-item/drag-and-drop/use-menu-item-drag-and-drop';