@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,101 @@
1
+
2
+ ._1r04ze3t{inset:var(--ds-space-0,0)}
3
+ ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
4
+ ._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
5
+ ._nd5l16dh{grid-area:elem-after}
6
+ ._nd5l17zh{grid-area:elem-before}
7
+ ._nd5l19l3{grid-area:interactive}
8
+ ._nd5lbc26{grid-area:actions}
9
+ ._zulp1b66{gap:var(--ds-space-050,4px)}
10
+ ._zulpv77o{gap:var(--ds-space-025,2px)}
11
+ ._1ii7kb7n{grid-row:1}
12
+ ._yyhyjvu9{grid-column:1/-1}
13
+ ._14iu13ro:active:not(:disabled){background-color:var(--ds-surface-pressed,#dddee1)}
14
+ ._14iunozp:active:not(:disabled){background-color:var(--ds-background-selected-pressed,#8fb8f6)}
15
+ ._152t1ssb{inset-block-start:50%}
16
+ ._18m915vq{overflow-y:hidden}
17
+ ._18ukglyw:not(:has(button,a)){pointer-events:none}
18
+ ._1bah1h6o{justify-content:center}
19
+ ._1bsb1tcg{width:24px}
20
+ ._1bsbty16{width:var(--actions-on-hover-width)}
21
+ ._1bsbyh40{width:2px}
22
+ ._1cykglyw{--drag-handle-display:none}
23
+ ._1djyglyw:has([aria-expanded=true][aria-haspopup=true]){--elem-after-display:none}
24
+ ._1e02ze3t{inset-inline-start:var(--ds-space-0,0)}
25
+ ._1e0c11p5{display:grid}
26
+ ._1e0c13yo{display:var(--elem-after-display)}
27
+ ._1e0c1txw{display:flex}
28
+ ._1ifmglyw{-webkit-touch-callout:none}
29
+ ._1lmcu4vt{grid-template-areas:"elem-before interactive elem-after actions"}
30
+ ._1o9zidpf{flex-shrink:0}
31
+ ._1q511b66{padding-block-start:var(--ds-space-050,4px)}
32
+ ._1rbv1wug:has([aria-expanded=true][aria-haspopup=true]){--actions-on-hover-width:auto}
33
+ ._1reo15vq{overflow-x:hidden}
34
+ ._1swv19i6:has([aria-expanded=true][aria-haspopup=true]){background-color:var(--ds-surface-hovered,#f0f1f2)}
35
+ ._1swvufnl:has([aria-expanded=true][aria-haspopup=true]){background-color:var(--ds-background-selected-hovered,#cfe1fd)}
36
+ ._1ul91c9m{min-width:1ch}
37
+ ._1ul9t9kd{min-width:72px}
38
+ ._1yyu1j28{--notch-color:transparent}
39
+ ._1yyujmqp{--notch-color:var(--ds-background-selected-bold,#1868db)}
40
+ ._2lx21bp4{flex-direction:column}
41
+ ._2z05hkll{grid-template-rows:1fr}
42
+ ._2z05nbh3{grid-template-rows:subgrid}
43
+ ._4cvr1h6o{align-items:center}
44
+ ._4t3i1crf{height:9pt}
45
+ ._4t3i1tcg{height:24px}
46
+ ._4t3i1wto{height:3rem}
47
+ ._4t3iviql{height:2rem}
48
+ ._85i51b66{padding-block-end:var(--ds-space-050,4px)}
49
+ ._91ju1txw{--elem-after-display:flex}
50
+ ._91juglyw{--elem-after-display:none}
51
+ ._ae4v1h6o{align-content:center}
52
+ ._bfhk15s3{background-color:var(--ds-background-selected,#e9f2fe)}
53
+ ._bfhk1j28{background-color:transparent}
54
+ ._bfhk1o0g{background-color:var(--notch-color)}
55
+ ._bfhkn7od{background-color:unset}
56
+ ._bozg12x7{padding-inline-start:var(--ds-space-075,6px)}
57
+ ._bozg1b66{padding-inline-start:var(--ds-space-050,4px)}
58
+ ._db801b66{--actions-on-hover-padding:var(--ds-space-050,4px)}
59
+ ._db80idpf{--actions-on-hover-padding:0}
60
+ ._kqswh2mm{position:relative}
61
+ ._kqswstnw{position:absolute}
62
+ ._kwq51b66:has([aria-expanded=true][aria-haspopup=true]){--actions-on-hover-padding:var(--ds-space-050,4px)}
63
+ ._pmxp1wug{--actions-on-hover-width:auto}
64
+ ._pmxpidpf{--actions-on-hover-width:0}
65
+ ._qxq9kb7n:has([aria-expanded=true][aria-haspopup=true]){--actions-on-hover-opacity:1}
66
+ ._syaz1gmx{color:var(--ds-text-disabled,#080f214a)}
67
+ ._syaz6x5g{color:var(--ds-text-selected,#1868db)}
68
+ ._syazazsu{color:var(--ds-text-subtle,#505258)}
69
+ ._t9ec1i34{transform:translateY(-50%)}
70
+ ._tzy41ou4{opacity:.4}
71
+ ._tzy4pnc3{opacity:var(--actions-on-hover-opacity)}
72
+ ._uiztglyw{-webkit-user-select:none;-ms-user-select:none;user-select:none}
73
+ ._uomdidpf{--actions-on-hover-opacity:0}
74
+ ._uomdkb7n{--actions-on-hover-opacity:1}
75
+ ._vchh1ntv{box-sizing:content-box}
76
+ ._vchhusvi{box-sizing:border-box}
77
+ ._y3gnv2br{text-align:start}
78
+ ._y4ti1b66{padding-inline-end:var(--ds-space-050,4px)}
79
+ ._y4tidria{padding-inline-end:var(--actions-on-hover-padding)}
80
+ ._yv0e7dup{grid-template-columns:minmax(0,auto) 1fr minmax(0,auto) minmax(0,auto)}
81
+ ._yv0enbh3{grid-template-columns:subgrid}
82
+ ._12s918uv:focus-within{overflow-y:initial}
83
+ ._1guo18uv:focus-within{overflow-x:initial}
84
+ ._1mfcglyw:focus-within{--elem-after-display:none}
85
+ ._91nl1wug:focus-within{--actions-on-hover-width:auto}
86
+ ._iy5o1b66:focus-within{--actions-on-hover-padding:var(--ds-space-050,4px)}
87
+ ._t7p8kb7n:focus-within{--actions-on-hover-opacity:1}._11om6b4r:hover{animation-name:k1xyysw3}
88
+ ._1sjuglyw:hover{--elem-after-display:none}
89
+ ._1uy01amc:hover{animation-delay:.8s}
90
+ ._30l31gmx:hover{color:var(--ds-text-disabled,#080f214a)}
91
+ ._30l36x5g:hover{color:var(--ds-text-selected,#1868db)}
92
+ ._7psyru3m:hover{animation-duration:0s}
93
+ ._bir2q7pw:hover{animation-fill-mode:forwards}
94
+ ._g4kikb7n:hover{--actions-on-hover-opacity:1}
95
+ ._irr319i6:hover{background-color:var(--ds-surface-hovered,#f0f1f2)}
96
+ ._irr3n7od:hover{background-color:unset}
97
+ ._irr3ufnl:hover{background-color:var(--ds-background-selected-hovered,#cfe1fd)}
98
+ ._v4o21b66:hover{--actions-on-hover-padding:var(--ds-space-050,4px)}
99
+ ._x0kw1txw:hover{--drag-handle-display:flex}
100
+ ._ynyi1wug:hover{--actions-on-hover-width:auto}
101
+ @keyframes k1xyysw3{to{cursor:grab}}
@@ -0,0 +1,383 @@
1
+ /* menu-item.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import "./menu-item.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import React, { Suspense, useCallback, useRef } from 'react';
6
+ import { cx } from '@compiled/react';
7
+ import { AvatarContext } from '@atlaskit/avatar';
8
+ import forwardRefWithGeneric from '@atlaskit/ds-lib/forward-ref-with-generic';
9
+ import mergeRefs from '@atlaskit/ds-lib/merge-refs';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
11
+ import { Anchor, Pressable, Text } from '@atlaskit/primitives/compiled';
12
+ import Tooltip from '@atlaskit/tooltip';
13
+ import { expandableMenuItemIndentation } from './constants';
14
+ import { LazyDragHandle } from './drag-handle/lazy-drag-handle';
15
+ import { useLevel } from './expandable-menu-item/expandable-menu-item-context';
16
+ import { useFlyoutMenuOpen, useSetFlyoutMenuOpen } from './flyout-menu-item/flyout-menu-item-context';
17
+ import { COLLAPSE_ELEM_BEFORE } from './menu-item-signals';
18
+ function isTextClamped(element) {
19
+ // Checking for vertical height rather than horizontal height.
20
+ // When text is "clamped", it's technically being clamped vertically! 🤯
21
+ return element.scrollHeight > element.clientHeight;
22
+ }
23
+ const defaultAvatarValues = {
24
+ size: 'small'
25
+ };
26
+ const elemAfterDisplayVar = '--elem-after-display';
27
+ const actionsOnHoverOpacityVar = '--actions-on-hover-opacity';
28
+ const actionsOnHoverWidthVar = '--actions-on-hover-width';
29
+ const actionsOnHoverPaddingInlineEndVar = '--actions-on-hover-padding';
30
+ const notchColorVar = '--notch-color';
31
+
32
+ // Note: this is also used in `drag-handle.tsx`
33
+ const dragHandleDisplayVar = '--drag-handle-display';
34
+ const dragCursorAnimation = null;
35
+
36
+ /**
37
+ * ## 🤹 `position:relative`
38
+ *
39
+ * We need `position:relative` on an element that takes
40
+ * up the full size of the interactive element so we
41
+ * can correctly use `position:absolute` to place:
42
+ * 1. the notch for links
43
+ * 2. drop indicators for drag and drop
44
+ * 3. a child of button / anchor to stretch it out to
45
+ * increase it's pressable area.
46
+ *
47
+ * ⛔️ We cannot add `position:relative` _only_ on the
48
+ * button / anchor as that will cause sibling elements
49
+ * to be rendered under the button / anchor when setting
50
+ * a background color on the button / anchor.
51
+ *
52
+ * 📖 Note: `position:relative` elements are painted after
53
+ * elements with `position:static` (the default)
54
+ * https://drafts.csswg.org/css-position-4/#painting-order
55
+ *
56
+ * ⛔️ We cannot add `position:relative` to the container
57
+ * element, as then the `:focus` ring styles on the
58
+ * button / anchor can be cut off by the next sibling if it has
59
+ * has a background color set (eg when selected)
60
+ *
61
+ * ✅ Add `position:relative` to all first level descendants
62
+ * of the container element so that we don't impact DOM ordered
63
+ * paint ordering within the item and the button / anchor focus
64
+ * ring can still bleed over siblings
65
+ *
66
+ * 📖 We could use `> * { position: relative; }` on the container,
67
+ * but that would violate our styling standard.
68
+ */
69
+ const topLevelSiblingStyles = {
70
+ root: "_kqswh2mm"
71
+ };
72
+
73
+ /**
74
+ * All slots on the menu item (eg `elemBefore`) are rendered as siblings
75
+ * of our main button / anchor element and they are visually placed on
76
+ * top of the main button / anchor.
77
+ *
78
+ * 📖 This is done so that we don't nest interactive elements in our markup.
79
+ *
80
+ * ✅ This is great when element in the slot is an interactive element
81
+ * as we don't want the main menu item button / anchor to be triggered
82
+ * when interacting with the element in the slot.
83
+ *
84
+ * ⛔️ When the element in the slot is static content (eg an `<Icon>`) it will
85
+ * prevent the main button / anchor (that is visually behind the element in
86
+ * the slot) from being clicked. The element in the slot is a sibling of our
87
+ * main button / anchor (not a child of it) so clicking on the element in the
88
+ * slot will not bubble up to the button / anchor.
89
+ *
90
+ * 🚀 We set `pointer-events:none` on a slot if it does not contain and interactive
91
+ * element so that static content in a slot does not prevent clicking on the main
92
+ * button / anchor.
93
+ */
94
+ const onTopOfButtonOrAnchorStyles = {
95
+ root: "_18ukglyw"
96
+ };
97
+
98
+ /**
99
+ * This is being _internally_ exported so it can be used in other menu item wrapper components, like
100
+ * ExpandableMenuItemTrigger.
101
+ *
102
+ * This selector is used to apply hover styling on the menu item if it contains an open nested popup.
103
+ * It's looking for a popup trigger with `aria-hasexpanded` and `aria-haspopup` attributes. The
104
+ * reason for targeting the _trigger_ instead of the popup itself, is the popup might be rendered
105
+ * outside the menu item, e.g. if rendered in a portal.
106
+ *
107
+ * An alternative solution might involve wrapping it with a popup context and listening to the popup
108
+ * events through it (and applying the hover style when the popup is open). Exploring this has been
109
+ * captured in [BLU-3354](https://jplat.atlassian.net/browse/BLU-3354).
110
+ */
111
+ export const nestedOpenPopupCSSSelector = '&:has([aria-expanded="true"][aria-haspopup="true"])';
112
+ const containerStyles = {
113
+ 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",
114
+ rootT26Shape: "_2rko1qi0",
115
+ removeElemAfter: "_91juglyw",
116
+ showHoverActions: "_uomdkb7n _pmxp1wug _db801b66",
117
+ removeElemAfterOnHoverOrOpenNestedPopup: "_1djyglyw _1mfcglyw _1sjuglyw",
118
+ selected: "_bfhk15s3 _syaz6x5g _1yyujmqp _1swvufnl _30l36x5g _irr3ufnl",
119
+ disabled: "_syaz1gmx _bfhkn7od _irr3n7od _30l31gmx",
120
+ hasDescription: "_4t3i1wto",
121
+ dragging: "_tzy41ou4"
122
+ };
123
+ const buttonOrAnchorStyles = {
124
+ root: "_2rko12b0 _yyhyjvu9 _1ii7kb7n _1e0c11p5 _yv0enbh3 _2z05nbh3 _y4ti1b66 _bozg1b66 _1q511b66 _85i51b66 _bfhk1j28 _syazazsu _4cvr1h6o _y3gnv2br _14iu13ro",
125
+ rootT26Shape: "_2rko1qi0",
126
+ selected: "_syaz6x5g _14iunozp",
127
+ hasDragIndicator: "_1ifmglyw _1cykglyw _x0kw1txw _11om6b4r _7psyru3m _1uy01amc _bir2q7pw"
128
+ };
129
+ const extendButtonOrAnchorStyles = {
130
+ root: "_1r04ze3t _kqswstnw"
131
+ };
132
+ const notchStyles = {
133
+ root: "_kqswstnw _152t1ssb _1e02ze3t _1bsbyh40 _4t3i1crf _t9ec1i34 _bfhk1o0g"
134
+ };
135
+ const actionStyles = {
136
+ root: "_zulp1b66 _nd5lbc26 _1reo15vq _18m915vq _1e0c1txw _4cvr1h6o _y4ti1b66 _1guo18uv _12s918uv"
137
+ };
138
+ const actionsOnHoverStyles = {
139
+ root: "_nd5l16dh _zulp1b66 _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _tzy4pnc3 _1bsbty16 _y4tidria _1guo18uv _12s918uv"
140
+ };
141
+ const textStyles = {
142
+ root: "_zulpv77o _1reo15vq _18m915vq _y4ti1b66 _bozg1b66 _1e0c1txw _2lx21bp4 _1ul91c9m _1guo18uv _12s918uv",
143
+ noElemBeforeIndent: "_bozg12x7"
144
+ };
145
+ const elemBeforeStyles = {
146
+ root: "_nd5l17zh _1reo15vq _18m915vq _1e0c1txw _1o9zidpf _1bsb1tcg _4t3i1tcg _4cvr1h6o _1bah1h6o _bozg1b66 _vchh1ntv _1guo18uv _12s918uv"
147
+ };
148
+ const elemAfterStyles = {
149
+ root: "_nd5l16dh _1reo15vq _18m915vq _1e0c13yo _1o9zidpf _4t3i1tcg _4cvr1h6o _y4ti1b66 _1guo18uv _12s918uv"
150
+ };
151
+
152
+ /**
153
+ * We are using a wrapping element for our interactive content
154
+ * even though only the `Text` element is the only thing not using `position:absolute`
155
+ *
156
+ * Rationale:
157
+ * - Super clear that everything inside the interactive content should be in a specific slot in the grid
158
+ * - To work around a browser bug in Safari where it does not work well with `position:absolute`
159
+ * on a subgrid child.
160
+ * Safari bug: https://bugs.webkit.org/show_bug.cgi?id=292516
161
+ */
162
+ const interactiveContentStyles = {
163
+ root: "_nd5l19l3 _1e0c1txw _2lx21bp4 _ae4v1h6o"
164
+ };
165
+ function getTextColor({
166
+ isDisabled,
167
+ isSelected
168
+ }) {
169
+ if (isDisabled) {
170
+ return 'color.text.disabled';
171
+ }
172
+ if (isSelected) {
173
+ return 'color.text.selected';
174
+ }
175
+ return 'color.text.subtle';
176
+ }
177
+
178
+ /**
179
+ * Includes all props that are used by any menu item, as MenuItembase is the base component for all menu item components.
180
+ *
181
+ * We also include additional `aria` props to support the menu item being a trigger for the FlyoutMenuItem popup and for the
182
+ * expanded content for ExpandableMenuItem.
183
+ */
184
+
185
+ /**
186
+ * This is the internal version of the component, to be passed into `forwardRef`.
187
+ *
188
+ * It contains a type argument `<T>`, to specify the type of the interactive element (`button` or `a`).
189
+ * This can be inferred from the type of the `onClick` prop.
190
+ */
191
+ const MenuItemBaseNoRef = ({
192
+ id,
193
+ testId,
194
+ actions,
195
+ actionsOnHover,
196
+ children,
197
+ description,
198
+ elemAfter,
199
+ elemBefore,
200
+ href,
201
+ target,
202
+ isDisabled,
203
+ isSelected,
204
+ onClick,
205
+ ariaControls,
206
+ ariaExpanded,
207
+ ariaHasPopup,
208
+ interactionName,
209
+ isContentTooltipDisabled,
210
+ visualContentRef,
211
+ isDragging,
212
+ hasDragIndicator,
213
+ dropIndicator
214
+ }, forwardedRef) => {
215
+ const level = useLevel();
216
+ const setFlyoutMenuOpen = useSetFlyoutMenuOpen();
217
+ const isFlyoutMenuOpen = useFlyoutMenuOpen();
218
+ const isLink = typeof href !== 'undefined';
219
+ const labelRef = useRef(null);
220
+ const descriptionRef = useRef(null);
221
+ const tooltipOnClick = useRef(null);
222
+ const handleClick = useCallback((event, analyticsEvent) => {
223
+ var _tooltipOnClick$curre;
224
+ onClick === null || onClick === void 0 ? void 0 : onClick(event, analyticsEvent);
225
+ // Toggle flyout menu open state when inside a flyout context provider
226
+ setFlyoutMenuOpen(!isFlyoutMenuOpen);
227
+ (_tooltipOnClick$curre = tooltipOnClick.current) === null || _tooltipOnClick$curre === void 0 ? void 0 : _tooltipOnClick$curre.call(tooltipOnClick, event);
228
+ }, [onClick, setFlyoutMenuOpen, isFlyoutMenuOpen]);
229
+
230
+ /**
231
+ * Show the tooltip if _either_ label or description is truncated
232
+ */
233
+ const canTooltipAppear = useCallback(() => {
234
+ if (isContentTooltipDisabled) {
235
+ return false;
236
+ }
237
+
238
+ // Show tooltip if _either_ label or description are clamped
239
+
240
+ const label = labelRef.current;
241
+ const description = descriptionRef.current;
242
+ if (label && isTextClamped(label)) {
243
+ return true;
244
+ }
245
+ return Boolean(description && isTextClamped(description));
246
+ }, [isContentTooltipDisabled]);
247
+
248
+ // By default provide the spacing for `elemBefore` to have good
249
+ // vertical alignment of labels and to give clear indentation between levels
250
+ // in the side navigation (even when items don't use elemBefore).
251
+ const showElemBefore = elemBefore !== COLLAPSE_ELEM_BEFORE;
252
+ const interactiveElemContent = /*#__PURE__*/React.createElement("div", {
253
+ className: ax([interactiveContentStyles.root])
254
+ }, /*#__PURE__*/React.createElement("div", {
255
+ // This extends the clickable area of nested menu items to the width
256
+ // of the root level menu items, while being visually indented.
257
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
258
+ style: {
259
+ insetInlineStart: `calc(-1 * ${level} * ${expandableMenuItemIndentation})`
260
+ },
261
+ "aria-hidden": "true",
262
+ className: ax([extendButtonOrAnchorStyles.root])
263
+ }), /*#__PURE__*/React.createElement("div", {
264
+ className: ax([textStyles.root, !showElemBefore && textStyles.noElemBeforeIndent])
265
+ }, /*#__PURE__*/React.createElement(Text, {
266
+ weight: "medium",
267
+ maxLines: 1,
268
+ color: getTextColor({
269
+ isDisabled,
270
+ isSelected
271
+ }),
272
+ ref: labelRef
273
+ }, children), description && /*#__PURE__*/React.createElement(Text, {
274
+ color: fg('platform-dst-menu-item-description-selected') ? getTextColor({
275
+ isDisabled,
276
+ isSelected
277
+ }) : isDisabled ? 'color.text.disabled' : 'color.text.subtle',
278
+ size: "small",
279
+ maxLines: 1,
280
+ ref: descriptionRef
281
+ }, description)), hasDragIndicator ? /*#__PURE__*/React.createElement(Suspense, {
282
+ fallback: null
283
+ }, /*#__PURE__*/React.createElement(LazyDragHandle, null)) : null, dropIndicator);
284
+
285
+ /**
286
+ * If the [expandable] menu item is expanded, show hover actions even when *not* hovered.
287
+ *
288
+ * Note: we also remove the `elemAfter` when showing `actionsOnHover`
289
+ */
290
+ const showHoverActionsWhenNotHovered = Boolean(ariaExpanded && actionsOnHover);
291
+ return /*#__PURE__*/React.createElement(AvatarContext.Provider, {
292
+ value: defaultAvatarValues
293
+ }, /*#__PURE__*/React.createElement("div", {
294
+ ref: visualContentRef,
295
+ "data-testid": testId ? `${testId}-container` : undefined,
296
+ "data-selected": isSelected,
297
+ 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])
298
+ }, /*#__PURE__*/React.createElement(Tooltip, {
299
+ content: () => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, children), description ? /*#__PURE__*/React.createElement("div", null, description) : null),
300
+ position: "right-start",
301
+ ignoreTooltipPointerEvents: true,
302
+ hideTooltipOnMouseDown: true
303
+ // We don't need a duplicate hidden element containing tooltip content
304
+ // as the content of the tooltip matches what is rendered for the menu item.
305
+ ,
306
+ isScreenReaderAnnouncementDisabled: true,
307
+ canAppear: canTooltipAppear
308
+ }, tooltipProps => {
309
+ // Putting the tooltip onClick into a ref.
310
+ // This way we don't need to create a new `onClick` function on each
311
+ // render (as we would need to merge `tooltipProps.onClick` and our `handleClick`)
312
+ tooltipOnClick.current = tooltipProps.onClick;
313
+ const sharedProps = {
314
+ ...tooltipProps,
315
+ 'aria-controls': ariaControls,
316
+ 'aria-haspopup': ariaHasPopup,
317
+ ref: mergeRefs([forwardedRef, tooltipProps.ref]),
318
+ id,
319
+ testId,
320
+ interactionName
321
+ };
322
+ return isLink ? /*#__PURE__*/React.createElement(Anchor, _extends({}, sharedProps, {
323
+ onClick: handleClick,
324
+ xcss: cx(buttonOrAnchorStyles.root, fg('platform-dst-shape-theme-default') && buttonOrAnchorStyles.rootT26Shape, topLevelSiblingStyles.root, isSelected && buttonOrAnchorStyles.selected, hasDragIndicator && buttonOrAnchorStyles.hasDragIndicator)
325
+ // Needed to override Anchor style due to a compiled/emotion conflict
326
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
327
+ ,
328
+ style: {
329
+ textDecoration: 'none'
330
+ },
331
+ "aria-current": isSelected ? 'page' : undefined,
332
+ href: href,
333
+ target: target
334
+ /**
335
+ * For anchors we don't want to have the standard drag and drop behaviour.
336
+ *
337
+ * Thinking on the topic:
338
+ *
339
+ * - Anchors look visually similar to buttons in the sidenav
340
+ * - Why should some menu items be natively draggable, while others are not?
341
+ * - A user cannot know which menu items are "natively" draggable (ie anchors)
342
+ * - If you wire up an anchor to be draggable using our standard affordances
343
+ * it will have a different preview experience to native anchor dragging.
344
+ *
345
+ * To promote consistency, all elements need to use the same visual affordances.
346
+ *
347
+ * Anchor elements will automatically attach URL information
348
+ * to the native data store.
349
+ *
350
+ * When `hasDragIndicator` is `true` we are expecting consumers to register
351
+ * the element as draggable through the `draggable()` Pragmatic drag and drop function.
352
+ * The `draggable()` function will add `draggable="true"` to the element.
353
+ */,
354
+ draggable: hasDragIndicator ? undefined : false
355
+ }), /*#__PURE__*/React.createElement("div", {
356
+ "aria-hidden": "true",
357
+ className: ax([notchStyles.root])
358
+ }), interactiveElemContent) : /*#__PURE__*/React.createElement(Pressable, _extends({}, sharedProps, {
359
+ onClick: handleClick,
360
+ xcss: cx(buttonOrAnchorStyles.root, fg('platform-dst-shape-theme-default') && buttonOrAnchorStyles.rootT26Shape, topLevelSiblingStyles.root, isSelected && buttonOrAnchorStyles.selected, hasDragIndicator && buttonOrAnchorStyles.hasDragIndicator),
361
+ "aria-expanded": ariaExpanded,
362
+ isDisabled: isDisabled
363
+ }), interactiveElemContent);
364
+ }), showElemBefore && /*#__PURE__*/React.createElement("div", {
365
+ className: ax([elemBeforeStyles.root, topLevelSiblingStyles.root, onTopOfButtonOrAnchorStyles.root])
366
+ }, elemBefore), actionsOnHover && /*#__PURE__*/React.createElement("div", {
367
+ className: ax([actionsOnHoverStyles.root])
368
+ }, actionsOnHover), elemAfter && /*#__PURE__*/React.createElement("div", {
369
+ className: ax([elemAfterStyles.root, topLevelSiblingStyles.root, onTopOfButtonOrAnchorStyles.root])
370
+ }, elemAfter), actions && /*#__PURE__*/React.createElement("div", {
371
+ className: ax([actionStyles.root, topLevelSiblingStyles.root, onTopOfButtonOrAnchorStyles.root])
372
+ }, actions)));
373
+ };
374
+
375
+ /**
376
+ * __MenuItemBase__
377
+ *
378
+ * The base menu item component used to compose ButtonMenuItem and LinkMenuItem.
379
+ *
380
+ * It contains a type argument `<T>`, to specify the type of the interactive element (`button` or `a`).
381
+ * This can be inferred from the type of the `onClick` prop.
382
+ */
383
+ export const 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 const 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 const 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
+ const 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
+ const level = useLevel();
28
+ useEffect(() => {
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,64 @@
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
+ const 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 ? 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({
35
+ elementRef,
36
+ isSelected
37
+ }) {
38
+ const areAllAncestorsExpanded = useAreAllAncestorsExpanded();
39
+ const waitingStateRef = useRef({
40
+ type: 'waiting-to-be-selected-and-all-ancestors-expanded'
41
+ });
42
+ useEffect(() => {
43
+ if (waitingStateRef.current.type === 'waiting-to-be-selected-and-all-ancestors-expanded') {
44
+ const shouldScroll = areAllAncestorsExpanded && isSelected;
45
+ if (!shouldScroll) {
46
+ return;
47
+ }
48
+ const element = elementRef.current;
49
+ invariant(element, 'Element ref must be set');
50
+ scrollMenuItemIntoView(element);
51
+
52
+ // Now that we are scrolled the menu item into view, we need to wait for the menu item to
53
+ // be unselected before checking again.
54
+ waitingStateRef.current.type = 'waiting-to-be-unselected';
55
+ return;
56
+ }
57
+ if (waitingStateRef.current.type === 'waiting-to-be-unselected') {
58
+ if (!isSelected) {
59
+ waitingStateRef.current.type = 'waiting-to-be-selected-and-all-ancestors-expanded';
60
+ }
61
+ return;
62
+ }
63
+ }, [areAllAncestorsExpanded, elementRef, isSelected]);
64
+ }
@@ -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,22 @@
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
+ const styles = null;
6
+
7
+ /**
8
+ * __Divider__
9
+ *
10
+ * A divider for use between menu sections.
11
+ */
12
+ export const Divider = () => /*#__PURE__*/React.createElement("hr", {
13
+ /**
14
+ * The existing usage of these dividers is presentational,
15
+ * so we are removing the separator semantics by default.
16
+ *
17
+ * In the future we may consider allowing opt-in separator semantics,
18
+ * but it probably isn't necessary.
19
+ */
20
+ role: "none",
21
+ className: ax(["_h7alglyw _179rglyw _mqm2ia51 _1bsb1osq"])
22
+ });
@@ -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 const MenuSectionContext = /*#__PURE__*/createContext(null);
9
+ export const useMenuSectionContext = () => {
10
+ const 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)}