@atlaskit/atlassian-navigation 5.7.1 → 5.7.3

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 (312) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/afm-cc/tsconfig.json +0 -1
  3. package/afm-products/tsconfig.json +0 -1
  4. package/dist/cjs/common/action-section-desktop-css.js +12 -0
  5. package/dist/cjs/common/action-section-mobile-css.js +12 -0
  6. package/dist/cjs/common/constants.js +3 -0
  7. package/dist/cjs/common/styles.js +13 -9
  8. package/dist/cjs/components/AppSwitcher/app-switcher-nav4.js +61 -0
  9. package/dist/cjs/components/AppSwitcher/app-switcher.js +79 -0
  10. package/dist/cjs/components/AppSwitcher/index.js +1 -119
  11. package/dist/cjs/components/AtlassianNavigation/index.js +6 -0
  12. package/dist/cjs/components/AtlassianNavigation/skeleton.js +2 -0
  13. package/dist/cjs/components/Create/index.js +2 -0
  14. package/dist/cjs/components/Help/index.js +2 -0
  15. package/dist/cjs/components/IconButton/index.js +1 -0
  16. package/dist/cjs/components/Notifications/index.js +2 -0
  17. package/dist/cjs/components/PrimaryButton/index.js +2 -0
  18. package/dist/cjs/components/PrimaryDropdownButton/index.js +2 -0
  19. package/dist/cjs/components/PrimaryItemsContainer/index.js +5 -4
  20. package/dist/cjs/components/ProductHome/app-home.js +180 -0
  21. package/dist/cjs/components/ProductHome/custom-product-home.js +2 -0
  22. package/dist/cjs/components/ProductHome/product-home.js +21 -110
  23. package/dist/cjs/components/Profile/index.js +2 -0
  24. package/dist/cjs/components/Profile/profile.js +74 -0
  25. package/dist/cjs/components/Search/index.js +2 -0
  26. package/dist/cjs/components/Settings/index.js +2 -0
  27. package/dist/cjs/components/SignIn/index.js +2 -0
  28. package/dist/cjs/controllers/overflow/index.js +2 -0
  29. package/dist/cjs/controllers/overflow/overflow-context.js +16 -0
  30. package/dist/cjs/controllers/overflow/overflow-provider.js +27 -0
  31. package/dist/cjs/controllers/overflow/use-overflow-controller.js +111 -0
  32. package/dist/cjs/controllers/overflow/use-overflow-status.js +20 -0
  33. package/dist/cjs/entry-points/app-switcher.js +4 -3
  34. package/dist/cjs/entry-points/overflow.js +2 -2
  35. package/dist/cjs/entry-points/profile.js +2 -2
  36. package/dist/cjs/entry-points/skeleton-help-button.js +2 -1
  37. package/dist/cjs/index.js +8 -7
  38. package/dist/cjs/nav4-skeleton-help-button.js +33 -0
  39. package/dist/cjs/nav4-skeleton-notification-button.js +24 -0
  40. package/dist/cjs/nav4-skeleton-settings-button.js +23 -0
  41. package/dist/cjs/nav4-skeleton-switcher-button.js +24 -0
  42. package/dist/cjs/skeleton-help-button.js +1 -24
  43. package/dist/cjs/skeleton-notification-button.js +8 -16
  44. package/dist/cjs/skeleton-settings-button.js +8 -15
  45. package/dist/cjs/skeleton-switcher-button.js +14 -17
  46. package/dist/cjs/theme/atlassian-theme.js +16 -0
  47. package/dist/cjs/theme/convert-hex-shorthand.js +47 -0
  48. package/dist/cjs/theme/default-theme-brand-refresh.js +10 -0
  49. package/dist/cjs/theme/default-theme.js +1 -2
  50. package/dist/cjs/theme/generate-text-color.js +13 -0
  51. package/dist/cjs/theme/get-box-shadow.js +9 -0
  52. package/dist/cjs/theme/get-contrast-color.js +12 -0
  53. package/dist/cjs/theme/hex-to-rgba.js +18 -0
  54. package/dist/cjs/theme/index.js +2 -2
  55. package/dist/cjs/theme/theme-context.js +10 -0
  56. package/dist/cjs/theme/theme-generator.js +28 -18
  57. package/dist/cjs/theme/theme-helpers.js +10 -5
  58. package/dist/cjs/theme/theme-provider.js +11 -8
  59. package/dist/cjs/theme/themes.js +11 -8
  60. package/dist/cjs/theme/use-theme.js +2 -2
  61. package/dist/es2019/common/action-section-desktop-css.js +6 -0
  62. package/dist/es2019/common/action-section-mobile-css.js +6 -0
  63. package/dist/es2019/common/constants.js +3 -0
  64. package/dist/es2019/common/styles.js +2 -11
  65. package/dist/es2019/components/AppSwitcher/app-switcher-nav4.js +52 -0
  66. package/dist/es2019/components/AppSwitcher/app-switcher.js +70 -0
  67. package/dist/es2019/components/AppSwitcher/index.js +0 -116
  68. package/dist/es2019/components/AtlassianNavigation/index.js +6 -0
  69. package/dist/es2019/components/AtlassianNavigation/skeleton.js +2 -0
  70. package/dist/es2019/components/Create/index.js +2 -0
  71. package/dist/es2019/components/Help/index.js +2 -0
  72. package/dist/es2019/components/IconButton/index.js +1 -0
  73. package/dist/es2019/components/Notifications/index.js +2 -0
  74. package/dist/es2019/components/PrimaryButton/index.js +2 -0
  75. package/dist/es2019/components/PrimaryDropdownButton/index.js +2 -0
  76. package/dist/es2019/components/PrimaryItemsContainer/index.js +2 -1
  77. package/dist/es2019/components/ProductHome/app-home.js +185 -0
  78. package/dist/es2019/components/ProductHome/custom-product-home.js +2 -0
  79. package/dist/es2019/components/ProductHome/product-home.js +5 -110
  80. package/dist/es2019/components/Profile/index.js +2 -0
  81. package/dist/es2019/components/Profile/profile.js +65 -0
  82. package/dist/es2019/components/Search/index.js +2 -0
  83. package/dist/es2019/components/Settings/index.js +2 -0
  84. package/dist/es2019/components/SignIn/index.js +2 -0
  85. package/dist/es2019/controllers/overflow/index.js +2 -0
  86. package/dist/es2019/controllers/overflow/overflow-context.js +8 -0
  87. package/dist/es2019/controllers/overflow/overflow-provider.js +18 -0
  88. package/dist/es2019/controllers/overflow/use-overflow-controller.js +89 -0
  89. package/dist/es2019/controllers/overflow/use-overflow-status.js +13 -0
  90. package/dist/es2019/entry-points/app-switcher.js +2 -1
  91. package/dist/es2019/entry-points/overflow.js +1 -1
  92. package/dist/es2019/entry-points/profile.js +1 -1
  93. package/dist/es2019/entry-points/skeleton-help-button.js +2 -1
  94. package/dist/es2019/index.js +4 -3
  95. package/dist/es2019/nav4-skeleton-help-button.js +24 -0
  96. package/dist/es2019/nav4-skeleton-notification-button.js +15 -0
  97. package/dist/es2019/nav4-skeleton-settings-button.js +14 -0
  98. package/dist/es2019/nav4-skeleton-switcher-button.js +15 -0
  99. package/dist/es2019/skeleton-help-button.js +1 -22
  100. package/dist/es2019/skeleton-notification-button.js +1 -13
  101. package/dist/es2019/skeleton-settings-button.js +1 -12
  102. package/dist/es2019/skeleton-switcher-button.js +8 -14
  103. package/dist/es2019/theme/atlassian-theme.js +10 -0
  104. package/dist/es2019/theme/convert-hex-shorthand.js +27 -0
  105. package/dist/es2019/theme/default-theme-brand-refresh.js +3 -0
  106. package/dist/es2019/theme/default-theme.js +0 -1
  107. package/dist/es2019/theme/generate-text-color.js +6 -0
  108. package/dist/es2019/theme/get-box-shadow.js +1 -0
  109. package/dist/es2019/theme/get-contrast-color.js +3 -0
  110. package/dist/es2019/theme/hex-to-rgba.js +8 -0
  111. package/dist/es2019/theme/index.js +1 -1
  112. package/dist/es2019/theme/theme-context.js +4 -0
  113. package/dist/es2019/theme/theme-generator.js +12 -2
  114. package/dist/es2019/theme/theme-helpers.js +3 -5
  115. package/dist/es2019/theme/theme-provider.js +5 -7
  116. package/dist/es2019/theme/themes.js +6 -8
  117. package/dist/es2019/theme/use-theme.js +1 -1
  118. package/dist/esm/common/action-section-desktop-css.js +5 -0
  119. package/dist/esm/common/action-section-mobile-css.js +5 -0
  120. package/dist/esm/common/constants.js +3 -0
  121. package/dist/esm/common/styles.js +2 -8
  122. package/dist/esm/components/AppSwitcher/app-switcher-nav4.js +52 -0
  123. package/dist/esm/components/AppSwitcher/app-switcher.js +70 -0
  124. package/dist/esm/components/AppSwitcher/index.js +0 -115
  125. package/dist/esm/components/AtlassianNavigation/index.js +6 -0
  126. package/dist/esm/components/AtlassianNavigation/skeleton.js +2 -0
  127. package/dist/esm/components/Create/index.js +2 -0
  128. package/dist/esm/components/Help/index.js +2 -0
  129. package/dist/esm/components/IconButton/index.js +1 -0
  130. package/dist/esm/components/Notifications/index.js +2 -0
  131. package/dist/esm/components/PrimaryButton/index.js +2 -0
  132. package/dist/esm/components/PrimaryDropdownButton/index.js +2 -0
  133. package/dist/esm/components/PrimaryItemsContainer/index.js +2 -1
  134. package/dist/esm/components/ProductHome/app-home.js +172 -0
  135. package/dist/esm/components/ProductHome/custom-product-home.js +2 -0
  136. package/dist/esm/components/ProductHome/product-home.js +16 -110
  137. package/dist/esm/components/Profile/index.js +2 -0
  138. package/dist/esm/components/Profile/profile.js +65 -0
  139. package/dist/esm/components/Search/index.js +2 -0
  140. package/dist/esm/components/Settings/index.js +2 -0
  141. package/dist/esm/components/SignIn/index.js +2 -0
  142. package/dist/esm/controllers/overflow/index.js +2 -0
  143. package/dist/esm/controllers/overflow/overflow-context.js +8 -0
  144. package/dist/esm/controllers/overflow/overflow-provider.js +19 -0
  145. package/dist/esm/controllers/overflow/use-overflow-controller.js +103 -0
  146. package/dist/esm/controllers/overflow/use-overflow-status.js +15 -0
  147. package/dist/esm/entry-points/app-switcher.js +2 -1
  148. package/dist/esm/entry-points/overflow.js +1 -1
  149. package/dist/esm/entry-points/profile.js +1 -1
  150. package/dist/esm/entry-points/skeleton-help-button.js +2 -1
  151. package/dist/esm/index.js +4 -3
  152. package/dist/esm/nav4-skeleton-help-button.js +26 -0
  153. package/dist/esm/nav4-skeleton-notification-button.js +17 -0
  154. package/dist/esm/nav4-skeleton-settings-button.js +16 -0
  155. package/dist/esm/nav4-skeleton-switcher-button.js +17 -0
  156. package/dist/esm/skeleton-help-button.js +0 -23
  157. package/dist/esm/skeleton-notification-button.js +1 -15
  158. package/dist/esm/skeleton-settings-button.js +1 -14
  159. package/dist/esm/skeleton-switcher-button.js +8 -16
  160. package/dist/esm/theme/atlassian-theme.js +10 -0
  161. package/dist/esm/theme/convert-hex-shorthand.js +40 -0
  162. package/dist/esm/theme/default-theme-brand-refresh.js +3 -0
  163. package/dist/esm/theme/default-theme.js +0 -1
  164. package/dist/esm/theme/generate-text-color.js +6 -0
  165. package/dist/esm/theme/get-box-shadow.js +3 -0
  166. package/dist/esm/theme/get-contrast-color.js +5 -0
  167. package/dist/esm/theme/hex-to-rgba.js +11 -0
  168. package/dist/esm/theme/index.js +1 -1
  169. package/dist/esm/theme/theme-context.js +4 -0
  170. package/dist/esm/theme/theme-generator.js +12 -2
  171. package/dist/esm/theme/theme-helpers.js +3 -5
  172. package/dist/esm/theme/theme-provider.js +5 -7
  173. package/dist/esm/theme/themes.js +6 -8
  174. package/dist/esm/theme/use-theme.js +1 -1
  175. package/dist/types/common/action-section-desktop-css.d.ts +5 -0
  176. package/dist/types/common/action-section-mobile-css.d.ts +5 -0
  177. package/dist/types/common/constants.d.ts +3 -0
  178. package/dist/types/common/styles.d.ts +2 -10
  179. package/dist/types/components/AppSwitcher/app-switcher-nav4.d.ts +6 -0
  180. package/dist/types/components/AppSwitcher/app-switcher.d.ts +14 -0
  181. package/dist/types/components/AppSwitcher/index.d.ts +0 -12
  182. package/dist/types/components/AppSwitcher/types.d.ts +3 -0
  183. package/dist/types/components/AtlassianNavigation/index.d.ts +2 -0
  184. package/dist/types/components/AtlassianNavigation/skeleton.d.ts +2 -0
  185. package/dist/types/components/AtlassianNavigation/types.d.ts +6 -0
  186. package/dist/types/components/Create/index.d.ts +2 -0
  187. package/dist/types/components/Help/index.d.ts +2 -0
  188. package/dist/types/components/IconButton/index.d.ts +1 -0
  189. package/dist/types/components/Notifications/index.d.ts +2 -0
  190. package/dist/types/components/PrimaryButton/index.d.ts +2 -0
  191. package/dist/types/components/PrimaryDropdownButton/index.d.ts +2 -0
  192. package/dist/types/components/ProductHome/app-home.d.ts +20 -0
  193. package/dist/types/components/ProductHome/custom-product-home.d.ts +2 -0
  194. package/dist/types/components/ProductHome/product-home.d.ts +4 -13
  195. package/dist/types/components/Profile/index.d.ts +2 -0
  196. package/dist/types/components/Profile/profile.d.ts +14 -0
  197. package/dist/types/components/Profile/types.d.ts +3 -0
  198. package/dist/types/components/Search/index.d.ts +2 -0
  199. package/dist/types/components/Search/types.d.ts +3 -0
  200. package/dist/types/components/Settings/index.d.ts +2 -0
  201. package/dist/types/components/Settings/types.d.ts +3 -0
  202. package/dist/types/components/SignIn/index.d.ts +2 -0
  203. package/dist/types/components/SignIn/types.d.ts +3 -0
  204. package/dist/types/components/SkeletonCreateButton/types.d.ts +3 -0
  205. package/dist/types/components/SkeletonIconButton/types.d.ts +3 -0
  206. package/dist/types/components/SkeletonPrimaryButton/types.d.ts +3 -0
  207. package/dist/types/controllers/overflow/index.d.ts +2 -0
  208. package/dist/types/controllers/overflow/overflow-context.d.ts +17 -0
  209. package/dist/types/controllers/overflow/overflow-provider.d.ts +3 -0
  210. package/dist/types/controllers/overflow/use-overflow-controller.d.ts +7 -0
  211. package/dist/types/controllers/overflow/use-overflow-status.d.ts +11 -0
  212. package/dist/types/entry-points/app-switcher.d.ts +2 -1
  213. package/dist/types/entry-points/overflow.d.ts +1 -1
  214. package/dist/types/entry-points/profile.d.ts +1 -1
  215. package/dist/types/entry-points/skeleton-help-button.d.ts +2 -1
  216. package/dist/types/index.d.ts +4 -3
  217. package/dist/types/nav4-skeleton-help-button.d.ts +8 -0
  218. package/dist/types/nav4-skeleton-notification-button.d.ts +9 -0
  219. package/dist/types/nav4-skeleton-settings-button.d.ts +8 -0
  220. package/dist/types/nav4-skeleton-switcher-button.d.ts +8 -0
  221. package/dist/types/skeleton-help-button.d.ts +0 -6
  222. package/dist/types/skeleton-notification-button.d.ts +1 -7
  223. package/dist/types/skeleton-settings-button.d.ts +1 -6
  224. package/dist/types/skeleton-switcher-button.d.ts +6 -6
  225. package/dist/types/theme/atlassian-theme.d.ts +5 -0
  226. package/dist/types/theme/convert-hex-shorthand.d.ts +1 -0
  227. package/dist/types/theme/default-theme-brand-refresh.d.ts +1 -0
  228. package/dist/types/theme/default-theme.d.ts +0 -1
  229. package/dist/types/theme/generate-text-color.d.ts +1 -0
  230. package/dist/types/theme/get-box-shadow.d.ts +1 -0
  231. package/dist/types/theme/get-contrast-color.d.ts +1 -0
  232. package/dist/types/theme/hex-to-rgba.d.ts +1 -0
  233. package/dist/types/theme/index.d.ts +1 -1
  234. package/dist/types/theme/theme-context.d.ts +3 -0
  235. package/dist/types/theme/theme-generator.d.ts +5 -0
  236. package/dist/types/theme/theme-helpers.d.ts +1 -1
  237. package/dist/types/theme/theme-provider.d.ts +4 -2
  238. package/dist/types/theme/themes.d.ts +4 -1
  239. package/dist/types/theme/types.d.ts +30 -0
  240. package/dist/types-ts4.5/common/action-section-desktop-css.d.ts +5 -0
  241. package/dist/types-ts4.5/common/action-section-mobile-css.d.ts +5 -0
  242. package/dist/types-ts4.5/common/constants.d.ts +3 -0
  243. package/dist/types-ts4.5/common/styles.d.ts +2 -10
  244. package/dist/types-ts4.5/components/AppSwitcher/app-switcher-nav4.d.ts +6 -0
  245. package/dist/types-ts4.5/components/AppSwitcher/app-switcher.d.ts +14 -0
  246. package/dist/types-ts4.5/components/AppSwitcher/index.d.ts +0 -12
  247. package/dist/types-ts4.5/components/AppSwitcher/types.d.ts +3 -0
  248. package/dist/types-ts4.5/components/AtlassianNavigation/index.d.ts +2 -0
  249. package/dist/types-ts4.5/components/AtlassianNavigation/skeleton.d.ts +2 -0
  250. package/dist/types-ts4.5/components/AtlassianNavigation/types.d.ts +6 -0
  251. package/dist/types-ts4.5/components/Create/index.d.ts +2 -0
  252. package/dist/types-ts4.5/components/Help/index.d.ts +2 -0
  253. package/dist/types-ts4.5/components/IconButton/index.d.ts +1 -0
  254. package/dist/types-ts4.5/components/Notifications/index.d.ts +2 -0
  255. package/dist/types-ts4.5/components/PrimaryButton/index.d.ts +2 -0
  256. package/dist/types-ts4.5/components/PrimaryDropdownButton/index.d.ts +2 -0
  257. package/dist/types-ts4.5/components/ProductHome/app-home.d.ts +20 -0
  258. package/dist/types-ts4.5/components/ProductHome/custom-product-home.d.ts +2 -0
  259. package/dist/types-ts4.5/components/ProductHome/product-home.d.ts +4 -13
  260. package/dist/types-ts4.5/components/Profile/index.d.ts +2 -0
  261. package/dist/types-ts4.5/components/Profile/profile.d.ts +14 -0
  262. package/dist/types-ts4.5/components/Profile/types.d.ts +3 -0
  263. package/dist/types-ts4.5/components/Search/index.d.ts +2 -0
  264. package/dist/types-ts4.5/components/Search/types.d.ts +3 -0
  265. package/dist/types-ts4.5/components/Settings/index.d.ts +2 -0
  266. package/dist/types-ts4.5/components/Settings/types.d.ts +3 -0
  267. package/dist/types-ts4.5/components/SignIn/index.d.ts +2 -0
  268. package/dist/types-ts4.5/components/SignIn/types.d.ts +3 -0
  269. package/dist/types-ts4.5/components/SkeletonCreateButton/types.d.ts +3 -0
  270. package/dist/types-ts4.5/components/SkeletonIconButton/types.d.ts +3 -0
  271. package/dist/types-ts4.5/components/SkeletonPrimaryButton/types.d.ts +3 -0
  272. package/dist/types-ts4.5/controllers/overflow/index.d.ts +2 -0
  273. package/dist/types-ts4.5/controllers/overflow/overflow-context.d.ts +17 -0
  274. package/dist/types-ts4.5/controllers/overflow/overflow-provider.d.ts +3 -0
  275. package/dist/types-ts4.5/controllers/overflow/use-overflow-controller.d.ts +7 -0
  276. package/dist/types-ts4.5/controllers/overflow/use-overflow-status.d.ts +11 -0
  277. package/dist/types-ts4.5/entry-points/app-switcher.d.ts +2 -1
  278. package/dist/types-ts4.5/entry-points/overflow.d.ts +1 -1
  279. package/dist/types-ts4.5/entry-points/profile.d.ts +1 -1
  280. package/dist/types-ts4.5/entry-points/skeleton-help-button.d.ts +2 -1
  281. package/dist/types-ts4.5/index.d.ts +4 -3
  282. package/dist/types-ts4.5/nav4-skeleton-help-button.d.ts +8 -0
  283. package/dist/types-ts4.5/nav4-skeleton-notification-button.d.ts +9 -0
  284. package/dist/types-ts4.5/nav4-skeleton-settings-button.d.ts +8 -0
  285. package/dist/types-ts4.5/nav4-skeleton-switcher-button.d.ts +8 -0
  286. package/dist/types-ts4.5/skeleton-help-button.d.ts +0 -6
  287. package/dist/types-ts4.5/skeleton-notification-button.d.ts +1 -7
  288. package/dist/types-ts4.5/skeleton-settings-button.d.ts +1 -6
  289. package/dist/types-ts4.5/skeleton-switcher-button.d.ts +6 -6
  290. package/dist/types-ts4.5/theme/atlassian-theme.d.ts +5 -0
  291. package/dist/types-ts4.5/theme/convert-hex-shorthand.d.ts +1 -0
  292. package/dist/types-ts4.5/theme/default-theme-brand-refresh.d.ts +1 -0
  293. package/dist/types-ts4.5/theme/default-theme.d.ts +0 -1
  294. package/dist/types-ts4.5/theme/generate-text-color.d.ts +1 -0
  295. package/dist/types-ts4.5/theme/get-box-shadow.d.ts +1 -0
  296. package/dist/types-ts4.5/theme/get-contrast-color.d.ts +1 -0
  297. package/dist/types-ts4.5/theme/hex-to-rgba.d.ts +1 -0
  298. package/dist/types-ts4.5/theme/index.d.ts +1 -1
  299. package/dist/types-ts4.5/theme/theme-context.d.ts +3 -0
  300. package/dist/types-ts4.5/theme/theme-generator.d.ts +5 -0
  301. package/dist/types-ts4.5/theme/theme-helpers.d.ts +1 -1
  302. package/dist/types-ts4.5/theme/theme-provider.d.ts +4 -2
  303. package/dist/types-ts4.5/theme/themes.d.ts +4 -1
  304. package/dist/types-ts4.5/theme/types.d.ts +30 -0
  305. package/package.json +12 -12
  306. package/afm-jira/tsconfig.json +0 -64
  307. /package/dist/cjs/components/AppSwitcher/{index.compiled.css → app-switcher.compiled.css} +0 -0
  308. /package/dist/cjs/{skeleton-help-button.compiled.css → nav4-skeleton-help-button.compiled.css} +0 -0
  309. /package/dist/es2019/components/AppSwitcher/{index.compiled.css → app-switcher.compiled.css} +0 -0
  310. /package/dist/es2019/{skeleton-help-button.compiled.css → nav4-skeleton-help-button.compiled.css} +0 -0
  311. /package/dist/esm/components/AppSwitcher/{index.compiled.css → app-switcher.compiled.css} +0 -0
  312. /package/dist/esm/{skeleton-help-button.compiled.css → nav4-skeleton-help-button.compiled.css} +0 -0
@@ -0,0 +1,185 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
6
+ import React, { Fragment } from 'react';
7
+
8
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
+ import { css, jsx } from '@emotion/react';
10
+ import { Inline, Text } from '@atlaskit/primitives/compiled';
11
+ import { PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
12
+ import { useTheme } from '../../theme';
13
+ import { stripEmptyProperties } from '../../utils';
14
+ import { getTag } from './utils';
15
+ const VAR_PRODUCT_HOME_COLOR_ACTIVE = '--product-home-color-active';
16
+ const VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE = '--product-home-bg-color-active';
17
+ const VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE = '--product-home-box-shadow-active';
18
+ const VAR_PRODUCT_HOME_COLOR_FOCUS = '--product-home-color-focus';
19
+ const VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS = '--product-home-bg-color-focus';
20
+ const VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS = '--product-home-box-shadow-focus';
21
+ const VAR_PRODUCT_HOME_COLOR_HOVER = '--product-home-color-hover';
22
+ const VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER = '--product-home-bg-color-hover';
23
+ const VAR_PRODUCT_HOME_BOX_SHADOW_HOVER = '--product-home-box-shadow-hover';
24
+ const productHomeButtonStyles = css({
25
+ display: 'flex',
26
+ padding: "var(--ds-space-050, 4px)",
27
+ alignItems: 'center',
28
+ background: 'none',
29
+ border: 0,
30
+ borderRadius: "var(--ds-radius-small, 3px)",
31
+ color: 'inherit',
32
+ cursor: 'pointer',
33
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
34
+ '&::-moz-focus-inner': {
35
+ border: 0
36
+ },
37
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
38
+ '&:first-of-type': {
39
+ marginInlineStart: 0
40
+ },
41
+ '&:hover': {
42
+ backgroundColor: `var(${VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER})`,
43
+ boxShadow: `var(${VAR_PRODUCT_HOME_BOX_SHADOW_HOVER})`,
44
+ color: `var(${VAR_PRODUCT_HOME_COLOR_HOVER})`
45
+ },
46
+ '&:active': {
47
+ backgroundColor: `var(${VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE})`,
48
+ boxShadow: `var(${VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE})`,
49
+ color: `var(${VAR_PRODUCT_HOME_COLOR_ACTIVE})`
50
+ },
51
+ '&:focus-visible': {
52
+ backgroundColor: `var(${VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS})`,
53
+ color: `var(${VAR_PRODUCT_HOME_COLOR_FOCUS})`,
54
+ outline: `${"var(--ds-border-width-focused, 2px)"} solid ${"var(--ds-border-focused, #4688EC)"}`
55
+ },
56
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
57
+ 'div&': {
58
+ pointerEvents: 'none'
59
+ },
60
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
61
+ [`@media (max-width: ${PRODUCT_HOME_BREAKPOINT - 0.1}px)`]: {
62
+ margin: `0 ${"var(--ds-space-100, 8px)"}`
63
+ },
64
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
65
+ [`@media (min-width: ${PRODUCT_HOME_BREAKPOINT}px)`]: {
66
+ margin: `0 ${"var(--ds-space-200, 16px)"}`
67
+ }
68
+ });
69
+ const appHomeIconStyles = css({
70
+ borderRadius: '10px'
71
+ });
72
+ const appIconStyles = css({
73
+ display: 'flex',
74
+ maxWidth: 24
75
+ });
76
+ const appLogoTextStyles = css({
77
+ // Logo text should never wrap or overflow
78
+ width: 'max-content',
79
+ paddingInlineEnd: "var(--ds-space-025, 2px)",
80
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
81
+ [`@media (max-width: ${PRODUCT_HOME_BREAKPOINT - 0.1}px)`]: {
82
+ display: 'none'
83
+ }
84
+ });
85
+ const siteTitleStyles = css({
86
+ display: 'flex',
87
+ alignItems: 'center',
88
+ marginInlineEnd: "var(--ds-space-050, 4px)",
89
+ marginInlineStart: "var(--ds-space-050, 4px)",
90
+ paddingInlineEnd: "var(--ds-space-200, 16px)"
91
+ });
92
+
93
+ /**
94
+ * __App home__
95
+ *
96
+ * A variant of the ProductHome component designed for use with the updated app logos.
97
+ *
98
+ * Takes an icon, displayed at all viewport sizes, and a product name, which is
99
+ * displayed only at larger viewport sizes.
100
+ *
101
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-product-home)
102
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
103
+ *
104
+ * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
105
+ */
106
+ export const AppHome = ({
107
+ 'aria-label': ariaLabel,
108
+ href,
109
+ name,
110
+ icon: Icon,
111
+ onClick,
112
+ onMouseDown,
113
+ siteTitle,
114
+ testId,
115
+ ...rest
116
+ }) => {
117
+ const theme = useTheme();
118
+ const primaryButton = theme.mode.primaryButton;
119
+ // After the brand refresh, iconColor and textColor should be set to 'undefined' to allow the original
120
+ // multi-color logo tile colors to be visible, rather than a hardcoded blue.
121
+ let {
122
+ iconColor = undefined,
123
+ textColor = undefined
124
+ } = theme.mode.productHome;
125
+
126
+ // The default theme is set at module scope and immediately used in context.
127
+ // To allow the feature flag to switch the logo color at runtime, we also detect the original hardcoded
128
+ // values and override them to undefined.
129
+ if (iconColor === '#357DE8' && textColor === "var(--ds-text, #292A2E)") {
130
+ iconColor = undefined;
131
+ textColor = undefined;
132
+ }
133
+ const Tag = getTag(onClick, href);
134
+ const preventFocusRing = e => {
135
+ e.preventDefault();
136
+ onMouseDown && onMouseDown(e);
137
+ };
138
+ const productHomeButtonDynamicStyles = stripEmptyProperties({
139
+ [VAR_PRODUCT_HOME_COLOR_ACTIVE]: primaryButton.active.color,
140
+ [VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE]: primaryButton.active.backgroundColor,
141
+ [VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE]: primaryButton.active.boxShadow,
142
+ [VAR_PRODUCT_HOME_COLOR_FOCUS]: primaryButton.focus.color,
143
+ [VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS]: primaryButton.focus.backgroundColor,
144
+ [VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS]: primaryButton.focus.boxShadow,
145
+ [VAR_PRODUCT_HOME_COLOR_HOVER]: primaryButton.hover.color,
146
+ [VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER]: primaryButton.hover.backgroundColor,
147
+ [VAR_PRODUCT_HOME_BOX_SHADOW_HOVER]: primaryButton.hover.boxShadow
148
+ });
149
+ return jsx(Fragment, null, jsx(Tag
150
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
151
+ , _extends({
152
+ style: productHomeButtonDynamicStyles,
153
+ css: [productHomeButtonStyles, appHomeIconStyles],
154
+ href: href,
155
+ onClick: onClick,
156
+ onMouseDown: preventFocusRing,
157
+ "data-testid": testId && `${testId}-container`,
158
+ "aria-label": ariaLabel
159
+ // Made all props explicit, leaving just in case
160
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
161
+ }, rest), jsx(Inline, {
162
+ space: "space.075",
163
+ alignBlock: "center"
164
+ }, jsx("div", {
165
+ css: [appIconStyles],
166
+ "data-testid": testId && `${testId}-icon`
167
+ }, jsx(Icon, {
168
+ iconColor: iconColor,
169
+ shouldUseNewLogoDesign: true,
170
+ size: "small",
171
+ appearance: "brand"
172
+ })), jsx("span", {
173
+ css: appLogoTextStyles
174
+ }, jsx(Text, {
175
+ "aria-hidden": true,
176
+ color: "inherit",
177
+ weight: "semibold"
178
+ }, name)))), siteTitle && jsx("div", {
179
+ style: {
180
+ borderRight: theme.mode.productHome.borderRight
181
+ },
182
+ css: siteTitleStyles,
183
+ "data-testid": testId && `${testId}-site-title`
184
+ }, siteTitle));
185
+ };
@@ -100,6 +100,8 @@ const siteTitleStyles = css({
100
100
  *
101
101
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#custom-product-home)
102
102
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
103
+ *
104
+ * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
103
105
  */
104
106
  const CustomProductHome = props => {
105
107
  const {
@@ -9,7 +9,7 @@ import React, { Fragment } from 'react';
9
9
  import { css, jsx } from '@emotion/react';
10
10
 
11
11
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
12
- import { Inline, Text } from '@atlaskit/primitives/compiled';
12
+
13
13
  import { PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
14
14
  import { useTheme } from '../../theme';
15
15
  import { stripEmptyProperties } from '../../utils';
@@ -103,22 +103,6 @@ const productIconStyles = css({
103
103
  display: 'none'
104
104
  }
105
105
  });
106
- const appHomeIconStyles = css({
107
- borderRadius: '10px'
108
- });
109
- const appIconStyles = css({
110
- display: 'flex',
111
- maxWidth: 24
112
- });
113
- const appLogoTextStyles = css({
114
- // Logo text should never wrap or overflow
115
- width: 'max-content',
116
- paddingInlineEnd: "var(--ds-space-025, 2px)",
117
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
118
- [`@media (max-width: ${PRODUCT_HOME_BREAKPOINT - 0.1}px)`]: {
119
- display: 'none'
120
- }
121
- });
122
106
  const siteTitleStyles = css({
123
107
  display: 'flex',
124
108
  alignItems: 'center',
@@ -127,98 +111,6 @@ const siteTitleStyles = css({
127
111
  paddingInlineEnd: "var(--ds-space-200, 16px)"
128
112
  });
129
113
 
130
- /**
131
- * __App home__
132
- *
133
- * A variant of the ProductHome component designed for use with the updated app logos.
134
- *
135
- * Takes an icon, displayed at all viewport sizes, and a product name, which is
136
- * displayed only at larger viewport sizes.
137
- *
138
- * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#app-product-home)
139
- * - [Code](https://atlassian.design/components/atlassian-navigation/code)
140
- */
141
- export const AppHome = ({
142
- 'aria-label': ariaLabel,
143
- href,
144
- name,
145
- icon: Icon,
146
- onClick,
147
- onMouseDown,
148
- siteTitle,
149
- testId,
150
- ...rest
151
- }) => {
152
- const theme = useTheme();
153
- const primaryButton = theme.mode.primaryButton;
154
- // After the brand refresh, iconColor and textColor should be set to 'undefined' to allow the original
155
- // multi-color logo tile colors to be visible, rather than a hardcoded blue.
156
- let {
157
- iconColor = undefined,
158
- textColor = undefined
159
- } = theme.mode.productHome;
160
-
161
- // The default theme is set at module scope and immediately used in context.
162
- // To allow the feature flag to switch the logo color at runtime, we also detect the original hardcoded
163
- // values and override them to undefined.
164
- if (iconColor === '#357DE8' && textColor === "var(--ds-text, #292A2E)") {
165
- iconColor = undefined;
166
- textColor = undefined;
167
- }
168
- const Tag = getTag(onClick, href);
169
- const preventFocusRing = e => {
170
- e.preventDefault();
171
- onMouseDown && onMouseDown(e);
172
- };
173
- const productHomeButtonDynamicStyles = stripEmptyProperties({
174
- [VAR_PRODUCT_HOME_COLOR_ACTIVE]: primaryButton.active.color,
175
- [VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE]: primaryButton.active.backgroundColor,
176
- [VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE]: primaryButton.active.boxShadow,
177
- [VAR_PRODUCT_HOME_COLOR_FOCUS]: primaryButton.focus.color,
178
- [VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS]: primaryButton.focus.backgroundColor,
179
- [VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS]: primaryButton.focus.boxShadow,
180
- [VAR_PRODUCT_HOME_COLOR_HOVER]: primaryButton.hover.color,
181
- [VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER]: primaryButton.hover.backgroundColor,
182
- [VAR_PRODUCT_HOME_BOX_SHADOW_HOVER]: primaryButton.hover.boxShadow
183
- });
184
- return jsx(Fragment, null, jsx(Tag
185
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
186
- , _extends({
187
- style: productHomeButtonDynamicStyles,
188
- css: [productHomeButtonStyles, appHomeIconStyles],
189
- href: href,
190
- onClick: onClick,
191
- onMouseDown: preventFocusRing,
192
- "data-testid": testId && `${testId}-container`,
193
- "aria-label": ariaLabel
194
- // Made all props explicit, leaving just in case
195
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
196
- }, rest), jsx(Inline, {
197
- space: "space.075",
198
- alignBlock: "center"
199
- }, jsx("div", {
200
- css: [appIconStyles],
201
- "data-testid": testId && `${testId}-icon`
202
- }, jsx(Icon, {
203
- iconColor: iconColor,
204
- shouldUseNewLogoDesign: true,
205
- size: "small",
206
- appearance: "brand"
207
- })), jsx("span", {
208
- css: appLogoTextStyles
209
- }, jsx(Text, {
210
- "aria-hidden": true,
211
- color: "inherit",
212
- weight: "semibold"
213
- }, name)))), siteTitle && jsx("div", {
214
- style: {
215
- borderRight: theme.mode.productHome.borderRight
216
- },
217
- css: siteTitleStyles,
218
- "data-testid": testId && `${testId}-site-title`
219
- }, siteTitle));
220
- };
221
-
222
114
  /**
223
115
  * __Product home__
224
116
  *
@@ -229,6 +121,8 @@ export const AppHome = ({
229
121
  *
230
122
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#product-home)
231
123
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
124
+ *
125
+ * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
232
126
  */
233
127
  const ProductHome = ({
234
128
  'aria-label': ariaLabel,
@@ -309,4 +203,5 @@ const ProductHome = ({
309
203
  "data-testid": testId && `${testId}-site-title`
310
204
  }, siteTitle));
311
205
  };
312
- export default ProductHome;
206
+ export default ProductHome;
207
+ export { AppHome } from './app-home';
@@ -9,6 +9,8 @@ import { IconButton } from '../IconButton';
9
9
  *
10
10
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
11
11
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
12
+ *
13
+ * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
12
14
  */
13
15
  export const Profile = /*#__PURE__*/forwardRef((props, ref) => {
14
16
  const {
@@ -0,0 +1,65 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { forwardRef } from 'react';
3
+ import { IconButton } from '../IconButton';
4
+ /**
5
+ * __Profile__
6
+ *
7
+ * A profile button which takes an icon/avatar component can be that can be
8
+ * passed into `AtlassianNavigation`'s `renderProfile` prop.
9
+ *
10
+ * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#profile)
11
+ * - [Code](https://atlassian.design/components/atlassian-navigation/code)
12
+ *
13
+ * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
14
+ */
15
+ export const Profile = /*#__PURE__*/forwardRef((props, ref) => {
16
+ const {
17
+ component,
18
+ href,
19
+ icon,
20
+ id,
21
+ isDisabled,
22
+ isSelected,
23
+ label: labelProp,
24
+ onBlur,
25
+ onClick,
26
+ onFocus,
27
+ onMouseDown,
28
+ onMouseEnter,
29
+ onMouseLeave,
30
+ onMouseUp,
31
+ target,
32
+ testId,
33
+ theme,
34
+ tooltip,
35
+ ...rest
36
+ } = props;
37
+ const label = labelProp || (typeof tooltip === 'string' ? tooltip : 'Your profile and settings');
38
+ return /*#__PURE__*/React.createElement("div", {
39
+ role: "listitem"
40
+ }, /*#__PURE__*/React.createElement(IconButton, _extends({
41
+ component: component,
42
+ href: href,
43
+ icon: icon,
44
+ id: id,
45
+ isDisabled: isDisabled,
46
+ isSelected: isSelected,
47
+ label: label,
48
+ onBlur: onBlur,
49
+ onClick: onClick,
50
+ onFocus: onFocus,
51
+ onMouseDown: onMouseDown,
52
+ onMouseEnter: onMouseEnter,
53
+ onMouseLeave: onMouseLeave,
54
+ onMouseUp: onMouseUp,
55
+ ref: ref,
56
+ target: target,
57
+ testId: testId
58
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
59
+ ,
60
+ theme: theme,
61
+ tooltip: tooltip,
62
+ isTooltipAnnouncementDisabled: true
63
+ // These are mostly explicit, leaving it in just in case
64
+ }, rest)));
65
+ });
@@ -124,6 +124,8 @@ const SearchComponent = props => {
124
124
  *
125
125
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#search)
126
126
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
127
+ *
128
+ * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
127
129
  */
128
130
  export const Search = props => {
129
131
  const {
@@ -17,6 +17,8 @@ const iconSpacingStyles = {
17
17
  *
18
18
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#settings)
19
19
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
20
+ *
21
+ * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
20
22
  */
21
23
  export const Settings = /*#__PURE__*/forwardRef((props, ref) => {
22
24
  const {
@@ -17,6 +17,8 @@ const iconSpacingStyles = {
17
17
  *
18
18
  * - [Examples](https://atlassian.design/components/atlassian-navigation/examples#sign-in)
19
19
  * - [Code](https://atlassian.design/components/atlassian-navigation/code)
20
+ *
21
+ * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
20
22
  */
21
23
  export const SignIn = props => {
22
24
  const {
@@ -46,6 +46,8 @@ export const OverflowProvider = ({
46
46
  * Returns the current context value for the nearest OverflowProvider.
47
47
  *
48
48
  * - [Example](https://atlassian.design/components/atlassian-navigation/examples#responsive)
49
+ *
50
+ * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
49
51
  */
50
52
  export const useOverflowStatus = () => useContext(OverflowContext);
51
53
  export const useOverflowController = nodes => {
@@ -0,0 +1,8 @@
1
+ /* eslint-disable @repo/internal/react/require-jsdoc */
2
+ import { createContext } from 'react';
3
+ import noop from '@atlaskit/ds-lib/noop';
4
+ export const OverflowContext = /*#__PURE__*/createContext({
5
+ isVisible: true,
6
+ openOverflowMenu: noop,
7
+ closeOverflowMenu: noop
8
+ });
@@ -0,0 +1,18 @@
1
+ import React, { useMemo } from 'react';
2
+ import { OverflowContext } from './overflow-context';
3
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
4
+ export const OverflowProvider = ({
5
+ children,
6
+ isVisible,
7
+ openOverflowMenu,
8
+ closeOverflowMenu
9
+ }) => {
10
+ const value = useMemo(() => ({
11
+ isVisible,
12
+ openOverflowMenu,
13
+ closeOverflowMenu
14
+ }), [isVisible, openOverflowMenu, closeOverflowMenu]);
15
+ return /*#__PURE__*/React.createElement(OverflowContext.Provider, {
16
+ value: value
17
+ }, children);
18
+ };
@@ -0,0 +1,89 @@
1
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
2
+
3
+ // eslint-disable-next-line @atlassian/tangerine/import/entry-points
4
+
5
+ import throttle from 'lodash/throttle';
6
+ const THROTTLE_INTERVAL = 16 * 4;
7
+ const ITEM_APPROX_MINWIDTH = 70;
8
+ const calculateHash = (w, n) => w + '#' + n;
9
+ const updateHashRef = (currentRef, value) => {
10
+ currentRef.unshift(value);
11
+ currentRef.length = 3;
12
+ };
13
+ export const useOverflowController = nodes => {
14
+ const items = React.Children.toArray(nodes);
15
+ const [width, setWidth] = useState(9999);
16
+ const [itemsLimit, setItemsLimit] = useState(items.length);
17
+ const [forceEffectValue, triggerForceEffect] = useState({});
18
+ // Storing items approximate width so we can try expanding when there is enough room
19
+ const itemsWidths = useRef([]).current;
20
+ // Storing a couple of width + items count in order to stabilize
21
+ const hashRef = useRef([]);
22
+
23
+ // AFP-2511 TODO: Fix automatic suppressions below
24
+ // eslint-disable-next-line react-hooks/exhaustive-deps
25
+ const throttleSetWidth = useCallback(throttle(setWidth, THROTTLE_INTERVAL), [setWidth]);
26
+ useEffect(() => {
27
+ const lastItemWidth = itemsWidths[itemsLimit] || 0;
28
+ const wasJustLimited = lastItemWidth < 0;
29
+ const currentHash = calculateHash(width, itemsLimit);
30
+ if (hashRef.current[0] === currentHash) {
31
+ // After removing an item, if width has not changed yet we schedule a force update
32
+ // to handle case where removing an item does not actually trigger width change
33
+ const t = setTimeout(() => {
34
+ updateHashRef(hashRef.current, '');
35
+ triggerForceEffect({});
36
+ }, THROTTLE_INTERVAL * 1.5);
37
+ return () => clearTimeout(t);
38
+ }
39
+ if (wasJustLimited) {
40
+ // Width was updated either via resize or after changing the limit
41
+ // we cap the width between ITEM_APPROX_MINWIDTH and 2*ITEM_APPROX_MINWIDTH
42
+ // because width is throttled as when fast expanding/resizing partialWidth
43
+ // will not be reliable (edge case)
44
+ const partialWidth = Math.max(Math.min(width + lastItemWidth, ITEM_APPROX_MINWIDTH * 2), ITEM_APPROX_MINWIDTH);
45
+ itemsWidths[itemsLimit] = partialWidth;
46
+ }
47
+ if (width < ITEM_APPROX_MINWIDTH * 0.9 && itemsLimit) {
48
+ // If current width is less than an item approx width we remove an item
49
+ // marking the width as negative so we will calculate it on width update
50
+ // plus we set the hash to stabilise and not removing more than one element
51
+ // until we are sure width was updated
52
+ const nextHash = calculateHash(width, itemsLimit - 1);
53
+ if (hashRef.current.indexOf(nextHash) === -1) {
54
+ setItemsLimit(itemsLimit - 1);
55
+ itemsWidths[itemsLimit - 1] = -(width || 1);
56
+ updateHashRef(hashRef.current, nextHash);
57
+ }
58
+ return;
59
+ }
60
+
61
+ /**
62
+ * This is not necessarily equal to `lastItemWidth` because the
63
+ * ```js
64
+ * if (wasJustLimited) {}
65
+ * ```
66
+ * branch above modifies `itemsWidths`.
67
+ *
68
+ * Using `lastItemWidth` here can cause collapsing behavior to fail,
69
+ * such as the issue reported in DSP-7329.
70
+ */
71
+ const currentLastItemWidth = itemsWidths[itemsLimit] || 0;
72
+ if (width - currentLastItemWidth > ITEM_APPROX_MINWIDTH * 1.1 && itemsLimit < items.length) {
73
+ // If we have enough room to accomodate next item width we increase the limit
74
+ // unless it has been recently removed
75
+ const nextHash = calculateHash(width, itemsLimit + 1);
76
+ if (hashRef.current.indexOf(nextHash) === -1) {
77
+ setItemsLimit(itemsLimit + 1);
78
+ updateHashRef(hashRef.current, nextHash);
79
+ }
80
+ return;
81
+ }
82
+ return;
83
+ }, [width, hashRef, itemsLimit, itemsWidths, forceEffectValue, items.length]);
84
+ return {
85
+ visibleItems: items.slice(0, itemsLimit),
86
+ overflowItems: items.slice(itemsLimit),
87
+ updateWidth: throttleSetWidth
88
+ };
89
+ };
@@ -0,0 +1,13 @@
1
+ import { useContext } from 'react';
2
+ import { OverflowContext } from './overflow-context';
3
+
4
+ /**
5
+ * __useOverFlowStatus__
6
+ *
7
+ * Returns the current context value for the nearest OverflowProvider.
8
+ *
9
+ * - [Example](https://atlassian.design/components/atlassian-navigation/examples#responsive)
10
+ *
11
+ * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead.
12
+ */
13
+ export const useOverflowStatus = () => useContext(OverflowContext);
@@ -1 +1,2 @@
1
- export { AppSwitcher, AppSwitcherNav4 } from '../components/AppSwitcher/index';
1
+ export { AppSwitcher } from '../components/AppSwitcher/app-switcher';
2
+ export { AppSwitcherNav4 } from '../components/AppSwitcher/app-switcher-nav4';
@@ -1 +1 @@
1
- export { useOverflowStatus } from '../controllers/overflow/index';
1
+ export { useOverflowStatus } from '../controllers/overflow/use-overflow-status';
@@ -1 +1 @@
1
- export { Profile } from '../components/Profile/index';
1
+ export { Profile } from '../components/Profile/profile';
@@ -1 +1,2 @@
1
- export { Nav4SkeletonHelpButton, SkeletonHelpButton } from '../skeleton-help-button';
1
+ export { Nav4SkeletonHelpButton } from '../nav4-skeleton-help-button';
2
+ export { SkeletonHelpButton } from '../skeleton-help-button';
@@ -1,5 +1,6 @@
1
1
  export { AtlassianNavigation } from './components/AtlassianNavigation';
2
- export { AppSwitcher, AppSwitcherNav4 } from './components/AppSwitcher';
2
+ export { AppSwitcher } from './components/AppSwitcher/app-switcher';
3
+ export { AppSwitcherNav4 } from './components/AppSwitcher/app-switcher-nav4';
3
4
  export { Create } from './components/Create';
4
5
  export { Help } from './components/Help';
5
6
  export { Notifications } from './components/Notifications';
@@ -7,10 +8,10 @@ export { PrimaryButton } from './components/PrimaryButton';
7
8
  export { PrimaryDropdownButton } from './components/PrimaryDropdownButton';
8
9
  export { IconButton } from './components/IconButton';
9
10
  export { CustomProductHome, ProductHome, AppHome } from './components/ProductHome';
10
- export { Profile } from './components/Profile';
11
+ export { Profile } from './components/Profile/profile';
11
12
  export { Search } from './components/Search';
12
13
  export { Settings } from './components/Settings';
13
14
  export { SignIn } from './components/SignIn';
14
- export { useOverflowStatus } from './controllers/overflow';
15
+ export { useOverflowStatus } from './controllers/overflow/use-overflow-status';
15
16
  export { HORIZONTAL_GLOBAL_NAV_HEIGHT } from './common/constants';
16
17
  export { atlassianTheme, generateTheme, ThemeProvider } from './theme';
@@ -0,0 +1,24 @@
1
+ /* nav4-skeleton-help-button.tsx generated by @compiled/babel-plugin v0.39.1 */
2
+ import "./nav4-skeleton-help-button.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React from 'react';
5
+ import QuestionCircleIcon from '@atlaskit/icon/core/question-circle';
6
+ import { Flex } from '@atlaskit/primitives/compiled';
7
+ import { SkeletonIconButton } from './components/SkeletonIconButton';
8
+ const iconSpacingStyles = {
9
+ space050: "_1rjc1b66 _18zr1b66"
10
+ };
11
+
12
+ /**
13
+ * __Nav 4 skeleton help button__
14
+ *
15
+ * A nav 4 skeleton help button {description}.
16
+ */
17
+ export const Nav4SkeletonHelpButton = ({
18
+ label = ''
19
+ }) => /*#__PURE__*/React.createElement(SkeletonIconButton, null, /*#__PURE__*/React.createElement(Flex, {
20
+ xcss: iconSpacingStyles.space050
21
+ }, /*#__PURE__*/React.createElement(QuestionCircleIcon, {
22
+ label: label,
23
+ color: "var(--ds-icon, #292A2E)"
24
+ })));