@learningpool/ui 1.6.0-beta.9 → 1.6.1

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 (439) hide show
  1. package/.eslintrc.js +40 -0
  2. package/.github/pull_request_template.md +23 -0
  3. package/.github/renovate.json +57 -0
  4. package/.github/workflows/integration.yml +53 -0
  5. package/.github/workflows/wss.yml +22 -0
  6. package/.jest-test-results.json +1 -0
  7. package/.releaserc +32 -0
  8. package/.storybook/learningpoolTheme.js +39 -0
  9. package/.storybook/main.js +21 -0
  10. package/.storybook/manager-head.html +175 -0
  11. package/.storybook/manager.js +34 -0
  12. package/.storybook/preview-head.html +212 -0
  13. package/.storybook/preview.js +120 -0
  14. package/.storybook/storybook-sort.js +54 -0
  15. package/CHANGELOG.md +6 -0
  16. package/amplify.yml +16 -0
  17. package/babel.config.json +14 -0
  18. package/{assets → dist/assets}/Images.d.ts +0 -0
  19. package/{assets → dist/assets}/Images.js +0 -0
  20. package/{components → dist/components}/atoms/Autocomplete/Autocomplete.d.ts +0 -0
  21. package/{components → dist/components}/atoms/Autocomplete/Autocomplete.js +0 -0
  22. package/{components → dist/components}/atoms/Button/Button.d.ts +0 -0
  23. package/{components → dist/components}/atoms/Button/Button.js +0 -0
  24. package/{components → dist/components}/atoms/Checkbox/Checkbox.d.ts +0 -0
  25. package/{components → dist/components}/atoms/Checkbox/Checkbox.js +0 -0
  26. package/{components → dist/components}/atoms/IconButton/IconButton.d.ts +0 -0
  27. package/{components → dist/components}/atoms/IconButton/IconButton.js +0 -0
  28. package/{components → dist/components}/atoms/Radio/Radio.d.ts +0 -0
  29. package/{components → dist/components}/atoms/Radio/Radio.js +0 -0
  30. package/{components → dist/components}/atoms/Select/Select.d.ts +0 -0
  31. package/{components → dist/components}/atoms/Select/Select.js +0 -0
  32. package/{components → dist/components}/atoms/Slider/Slider.d.ts +0 -0
  33. package/{components → dist/components}/atoms/Slider/Slider.js +0 -0
  34. package/{components → dist/components}/atoms/Switch/Switch.d.ts +0 -0
  35. package/{components → dist/components}/atoms/Switch/Switch.js +0 -0
  36. package/{components → dist/components}/atoms/TextField/TextField.d.ts +0 -0
  37. package/{components → dist/components}/atoms/TextField/TextField.js +0 -0
  38. package/{components → dist/components}/atoms/ToggleButton/ToggleButton.d.ts +0 -0
  39. package/{components → dist/components}/atoms/ToggleButton/ToggleButton.js +0 -0
  40. package/{components → dist/components}/datadisplay/Avatar/Avatar.d.ts +0 -0
  41. package/{components → dist/components}/datadisplay/Avatar/Avatar.js +0 -0
  42. package/{components → dist/components}/datadisplay/Chip/Chip.d.ts +0 -0
  43. package/{components → dist/components}/datadisplay/Chip/Chip.js +0 -0
  44. package/{components → dist/components}/datadisplay/List/List.d.ts +0 -0
  45. package/{components → dist/components}/datadisplay/List/List.js +0 -0
  46. package/{components → dist/components}/datadisplay/Tooltip/Tooltip.d.ts +0 -0
  47. package/{components → dist/components}/datadisplay/Tooltip/Tooltip.js +0 -0
  48. package/{components → dist/components}/feedback/Alert/Alert.d.ts +0 -0
  49. package/{components → dist/components}/feedback/Alert/Alert.js +0 -0
  50. package/dist/components/landmarks/Header/Header.d.ts +26 -0
  51. package/dist/components/landmarks/Header/Header.js +75 -0
  52. package/dist/components/landmarks/Header/HeaderActionButtons.d.ts +3 -0
  53. package/dist/components/landmarks/Header/HeaderActionButtons.js +66 -0
  54. package/dist/components/landmarks/Header/HeaderStyles.d.ts +55 -0
  55. package/dist/components/landmarks/Header/HeaderStyles.js +13 -0
  56. package/{components → dist/components}/navigation/Drawer/Drawer.d.ts +0 -0
  57. package/{components → dist/components}/navigation/Drawer/Drawer.js +0 -0
  58. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigation.d.ts +1 -2
  59. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigation.js +56 -86
  60. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatar.d.ts +1 -1
  61. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatar.js +45 -23
  62. package/dist/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +3296 -0
  63. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatarStyles.js +4 -4
  64. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationDrawer.d.ts +0 -0
  65. package/dist/components/navigation/MobileNavigation/MobileNavigationDrawer.js +71 -0
  66. package/dist/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +1215 -0
  67. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationDrawerStyles.js +2 -2
  68. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.d.ts +0 -0
  69. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +0 -0
  70. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.d.ts +0 -0
  71. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.js +0 -0
  72. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.d.ts +1 -1
  73. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.js +0 -0
  74. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.d.ts +1 -1
  75. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.js +0 -0
  76. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationMotion.d.ts +0 -0
  77. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationMotion.js +0 -0
  78. package/dist/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.d.ts +3 -0
  79. package/dist/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.js +19 -0
  80. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationSearch.d.ts +0 -0
  81. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationSearch.js +8 -6
  82. package/dist/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +1080 -0
  83. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationSearchStyles.js +2 -2
  84. package/{components/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts → dist/components/navigation/MobileNavigation/MobileNavigationStyles.d.ts} +66 -3
  85. package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationStyles.js +19 -24
  86. package/dist/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.d.ts +3 -0
  87. package/dist/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +28 -0
  88. package/dist/components/navigation/MobileNavigation/MobileNavigationToggleX.d.ts +3 -0
  89. package/dist/components/navigation/MobileNavigation/MobileNavigationToggleX.js +28 -0
  90. package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigation.d.ts +3 -3
  91. package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigation.js +22 -25
  92. package/dist/components/navigation/VerticalNavigation/VerticalNavigationAvatar.d.ts +4 -0
  93. package/dist/components/navigation/VerticalNavigation/VerticalNavigationAvatar.js +79 -0
  94. package/dist/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +3296 -0
  95. package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +5 -5
  96. package/dist/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.d.ts +4 -0
  97. package/dist/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +99 -0
  98. package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.d.ts +1 -1
  99. package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +1 -1
  100. package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.d.ts +1 -1
  101. package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +0 -0
  102. package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.d.ts +1 -3
  103. package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +3 -5
  104. package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationMotion.d.ts +0 -0
  105. package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationMotion.js +0 -0
  106. package/dist/components/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +1163 -0
  107. package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationStyles.js +5 -4
  108. package/{components → dist/components}/pages/ErrorPage/ErrorPage.d.ts +0 -0
  109. package/{components → dist/components}/pages/ErrorPage/ErrorPage.js +0 -0
  110. package/{components → dist/components}/pages/ErrorPage/ErrorPageStyles.d.ts +0 -0
  111. package/{components → dist/components}/pages/ErrorPage/ErrorPageStyles.js +0 -0
  112. package/{components → dist/components}/pages/SideInSide/SideInSide.d.ts +0 -0
  113. package/{components → dist/components}/pages/SideInSide/SideInSide.js +0 -0
  114. package/{components → dist/components}/pages/SideInSide/SideInSideStyles.d.ts +0 -0
  115. package/{components → dist/components}/pages/SideInSide/SideInSideStyles.js +0 -0
  116. package/{components → dist/components}/stream/AppSwitcher/AppSwitcher.d.ts +1 -9
  117. package/{components → dist/components}/stream/AppSwitcher/AppSwitcher.js +6 -6
  118. package/{components → dist/components}/stream/AppSwitcher/AppSwitcherItem.d.ts +0 -0
  119. package/{components → dist/components}/stream/AppSwitcher/AppSwitcherItem.js +0 -0
  120. package/{components → dist/components}/stream/AppSwitcher/AppSwitcherStyles.d.ts +2 -2
  121. package/{components → dist/components}/stream/AppSwitcher/AppSwitcherStyles.js +16 -16
  122. package/{components → dist/components}/stream/AppSwitcher/constants.d.ts +0 -0
  123. package/{components → dist/components}/stream/AppSwitcher/constants.js +2 -2
  124. package/{index.d.ts → dist/index.d.ts} +1 -0
  125. package/{index.js → dist/index.js} +1 -0
  126. package/{lang → dist/lang}/en-us.d.ts +0 -0
  127. package/{lang → dist/lang}/en-us.js +0 -0
  128. package/dist/package.json +41 -0
  129. package/dist/types/components/navigation/VerticalNavigation.d.ts +49 -0
  130. package/dist/types/components/navigation/VerticalNavigation.js +1 -0
  131. package/{components/navigation/VerticalNavigation → dist/types/components/navigation}/VerticalNavigationAvatar.d.ts +3 -4
  132. package/dist/types/components/navigation/VerticalNavigationAvatar.js +1 -0
  133. package/dist/types/components/stream/AppSwitcher.d.ts +9 -0
  134. package/dist/types/components/stream/AppSwitcher.js +1 -0
  135. package/dist/types/index.d.ts +3 -0
  136. package/dist/types/index.js +3 -0
  137. package/{utils → dist/utils}/constants.d.ts +1 -0
  138. package/dist/utils/constants.js +9 -0
  139. package/dist/utils/helpers.d.ts +21 -0
  140. package/dist/utils/helpers.js +64 -0
  141. package/{utils → dist/utils}/hooks.d.ts +0 -0
  142. package/{utils → dist/utils}/hooks.js +0 -0
  143. package/{utils → dist/utils}/index.d.ts +0 -0
  144. package/{utils → dist/utils}/index.js +0 -0
  145. package/{utils → dist/utils}/theme.d.ts +2 -2
  146. package/{utils → dist/utils}/theme.js +3 -3
  147. package/jest.config.ts +11 -0
  148. package/jest.setup.ts +5 -0
  149. package/{LICENSE → license} +0 -0
  150. package/merge.js +27 -0
  151. package/package.json +72 -5
  152. package/public/android-chrome-192x192.png +0 -0
  153. package/public/android-chrome-512x512.png +0 -0
  154. package/public/apple-touch-icon.png +0 -0
  155. package/public/assets/atoms.svg +5 -0
  156. package/public/assets/automation.svg +1 -0
  157. package/public/assets/avatar-1.jpg +0 -0
  158. package/public/assets/avatar-2.jpg +0 -0
  159. package/public/assets/avatar-3.jpg +0 -0
  160. package/public/assets/flux/icon-dark.svg +6 -0
  161. package/public/assets/flux/icon-light.svg +1 -0
  162. package/public/assets/flux/icon-white.svg +6 -0
  163. package/public/assets/flux/icon.svg +6 -0
  164. package/public/assets/flux/logo-dark.svg +22 -0
  165. package/public/assets/flux/logo-light.svg +1 -0
  166. package/public/assets/flux/logo-white.svg +22 -0
  167. package/public/assets/flux/logo.svg +22 -0
  168. package/public/assets/iPhone6.jpg +0 -0
  169. package/public/assets/iPhone6Plus.jpg +0 -0
  170. package/public/assets/lp-logo.png +0 -0
  171. package/public/assets/lplogo.svg +1 -0
  172. package/public/assets/molecules.svg +8 -0
  173. package/public/assets/organisms.svg +21 -0
  174. package/public/assets/pages.svg +4 -0
  175. package/public/assets/particles.svg +3 -0
  176. package/public/assets/stream-dark.png +0 -0
  177. package/public/assets/stream-suite-logo.svg +38 -0
  178. package/public/assets/stream-white.png +0 -0
  179. package/public/assets/stream.png +0 -0
  180. package/public/assets/templates.svg +3 -0
  181. package/public/favicon-16x16.png +0 -0
  182. package/public/favicon-32x32.png +0 -0
  183. package/public/favicon.ico +0 -0
  184. package/public/index.html +43 -0
  185. package/public/logo192.png +0 -0
  186. package/public/logo512.png +0 -0
  187. package/public/manifest.json +25 -0
  188. package/public/robots.txt +3 -0
  189. package/public/site.webmanifest +1 -0
  190. package/{README.md → readme.md} +0 -0
  191. package/src/docs.tsx +167 -0
  192. package/src/lib/assets/Images.tsx +47 -0
  193. package/src/lib/assets/stream-suite-logo.svg +38 -0
  194. package/src/lib/components/atoms/Autocomplete/Autocomplete.test.tsx +179 -0
  195. package/src/lib/components/atoms/Autocomplete/Autocomplete.tsx +14 -0
  196. package/src/lib/components/atoms/Button/Button.test.tsx +166 -0
  197. package/src/lib/components/atoms/Button/Button.tsx +16 -0
  198. package/src/lib/components/atoms/Checkbox/Checkbox.test.tsx +85 -0
  199. package/src/lib/components/atoms/Checkbox/Checkbox.tsx +10 -0
  200. package/src/lib/components/atoms/IconButton/IconButton.test.tsx +60 -0
  201. package/src/lib/components/atoms/IconButton/IconButton.tsx +9 -0
  202. package/src/lib/components/atoms/Radio/Radio.test.tsx +136 -0
  203. package/src/lib/components/atoms/Radio/Radio.tsx +10 -0
  204. package/src/lib/components/atoms/Select/Select.test.tsx +158 -0
  205. package/src/lib/components/atoms/Select/Select.tsx +12 -0
  206. package/src/lib/components/atoms/Slider/Slider.test.tsx +103 -0
  207. package/src/lib/components/atoms/Slider/Slider.tsx +10 -0
  208. package/src/lib/components/atoms/Switch/Switch.test.tsx +96 -0
  209. package/src/lib/components/atoms/Switch/Switch.tsx +10 -0
  210. package/src/lib/components/atoms/TextField/TextField.test.tsx +131 -0
  211. package/src/lib/components/atoms/TextField/TextField.tsx +31 -0
  212. package/src/lib/components/atoms/ToggleButton/ToggleButton.test.tsx +122 -0
  213. package/src/lib/components/atoms/ToggleButton/ToggleButton.tsx +10 -0
  214. package/src/lib/components/datadisplay/Avatar/Avatar.test.tsx +187 -0
  215. package/src/lib/components/datadisplay/Avatar/Avatar.tsx +35 -0
  216. package/src/lib/components/datadisplay/Avatar/avatar-1.jpg +0 -0
  217. package/src/lib/components/datadisplay/Chip/Chip.test.tsx +82 -0
  218. package/src/lib/components/datadisplay/Chip/Chip.tsx +11 -0
  219. package/src/lib/components/datadisplay/List/List.test.tsx +168 -0
  220. package/src/lib/components/datadisplay/List/List.tsx +8 -0
  221. package/src/lib/components/datadisplay/Tooltip/Tooltip.test.tsx +98 -0
  222. package/src/lib/components/datadisplay/Tooltip/Tooltip.tsx +9 -0
  223. package/src/lib/components/feedback/Alert/Alert.test.tsx +139 -0
  224. package/src/lib/components/feedback/Alert/Alert.tsx +10 -0
  225. package/src/lib/components/landmarks/Header/Header.tsx +140 -0
  226. package/src/lib/components/landmarks/Header/HeaderActionButtons.tsx +117 -0
  227. package/src/lib/components/landmarks/Header/HeaderStyles.tsx +62 -0
  228. package/src/lib/components/navigation/Drawer/Drawer.test.tsx +95 -0
  229. package/src/lib/components/navigation/Drawer/Drawer.tsx +21 -0
  230. package/src/lib/components/navigation/MobileNavigation/MobileNavigation.tsx +276 -0
  231. package/src/lib/components/navigation/MobileNavigation/MobileNavigationAvatar.tsx +334 -0
  232. package/src/lib/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.tsx +77 -0
  233. package/src/lib/components/navigation/MobileNavigation/MobileNavigationDrawer.tsx +197 -0
  234. package/src/lib/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.tsx +143 -0
  235. package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.tsx +192 -0
  236. package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.tsx +67 -0
  237. package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.tsx +192 -0
  238. package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.tsx +217 -0
  239. package/src/lib/components/navigation/MobileNavigation/MobileNavigationMotion.tsx +119 -0
  240. package/src/lib/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.tsx +35 -0
  241. package/src/lib/components/navigation/MobileNavigation/MobileNavigationSearch.tsx +114 -0
  242. package/src/lib/components/navigation/MobileNavigation/MobileNavigationSearchStyles.tsx +47 -0
  243. package/src/lib/components/navigation/MobileNavigation/MobileNavigationStyles.tsx +320 -0
  244. package/src/lib/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.tsx +59 -0
  245. package/src/lib/components/navigation/MobileNavigation/MobileNavigationToggleX.tsx +51 -0
  246. package/src/lib/components/navigation/VerticalNavigation/VerticalNavigation.tsx +467 -0
  247. package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationAvatar.tsx +208 -0
  248. package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.tsx +75 -0
  249. package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.tsx +196 -0
  250. package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.tsx +94 -0
  251. package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.tsx +212 -0
  252. package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.tsx +240 -0
  253. package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationMotion.tsx +119 -0
  254. package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationStyles.tsx +303 -0
  255. package/src/lib/components/pages/ErrorPage/ErrorPage.test.tsx +78 -0
  256. package/src/lib/components/pages/ErrorPage/ErrorPage.tsx +50 -0
  257. package/src/lib/components/pages/ErrorPage/ErrorPageStyles.tsx +30 -0
  258. package/src/lib/components/pages/SideInSide/SideInSide.tsx +100 -0
  259. package/src/lib/components/pages/SideInSide/SideInSideStyles.tsx +62 -0
  260. package/src/lib/components/stream/AppSwitcher/AppSwitcher.tsx +392 -0
  261. package/src/lib/components/stream/AppSwitcher/AppSwitcherItem.tsx +83 -0
  262. package/src/lib/components/stream/AppSwitcher/AppSwitcherStyles.tsx +325 -0
  263. package/src/lib/components/stream/AppSwitcher/constants.tsx +28 -0
  264. package/src/lib/index.tsx +148 -0
  265. package/src/lib/lang/en-us.js +6 -0
  266. package/src/lib/types/components/navigation/VerticalNavigation.ts +52 -0
  267. package/src/lib/types/components/navigation/VerticalNavigationAvatar.ts +26 -0
  268. package/src/lib/types/components/stream/AppSwitcher.ts +10 -0
  269. package/src/lib/types/index.ts +9 -0
  270. package/src/lib/utils/constants.tsx +11 -0
  271. package/src/lib/utils/helpers.tsx +77 -0
  272. package/src/lib/utils/hooks.tsx +33 -0
  273. package/src/lib/utils/index.tsx +4 -0
  274. package/src/lib/utils/theme.tsx +79 -0
  275. package/src/react-app-env.d.ts +1 -0
  276. package/src/setupTests.ts +5 -0
  277. package/src/stories/Components/DataDisplay/Avatar/Accessibility.stories.mdx +34 -0
  278. package/src/stories/Components/DataDisplay/Avatar/AllCombinations.tsx +56 -0
  279. package/src/stories/Components/DataDisplay/Avatar/Avatar.stories.tsx +19 -0
  280. package/src/stories/Components/DataDisplay/Avatar/Examples.stories.tsx +278 -0
  281. package/src/stories/Components/DataDisplay/Avatar/Overview.stories.mdx +47 -0
  282. package/src/stories/Components/DataDisplay/Chip/Accessibility.stories.mdx +29 -0
  283. package/src/stories/Components/DataDisplay/Chip/AllCombinations.tsx +58 -0
  284. package/src/stories/Components/DataDisplay/Chip/Chip.stories.tsx +21 -0
  285. package/src/stories/Components/DataDisplay/Chip/Examples.stories.tsx +126 -0
  286. package/src/stories/Components/DataDisplay/Chip/Overview.stories.mdx +57 -0
  287. package/src/stories/Components/DataDisplay/List/Accessibility.stories.mdx +54 -0
  288. package/src/stories/Components/DataDisplay/List/AllCombinations.tsx +396 -0
  289. package/src/stories/Components/DataDisplay/List/Examples.stories.tsx +501 -0
  290. package/src/stories/Components/DataDisplay/List/List.stories.tsx +35 -0
  291. package/src/stories/Components/DataDisplay/List/Overview.stories.mdx +69 -0
  292. package/src/stories/Components/DataDisplay/Table/Overview.stories.mdx +70 -0
  293. package/src/stories/Components/DataDisplay/Tooltip/Accessibility.stories.mdx +39 -0
  294. package/src/stories/Components/DataDisplay/Tooltip/AllCombinations.tsx +134 -0
  295. package/src/stories/Components/DataDisplay/Tooltip/Examples.stories.tsx +237 -0
  296. package/src/stories/Components/DataDisplay/Tooltip/Overview.stories.mdx +58 -0
  297. package/src/stories/Components/DataDisplay/Tooltip/Tooltip.stories.tsx +22 -0
  298. package/src/stories/Components/Feedback/Alert/Accessibility.stories.mdx +25 -0
  299. package/src/stories/Components/Feedback/Alert/Alert.stories.tsx +22 -0
  300. package/src/stories/Components/Feedback/Alert/AllCombinations.tsx +37 -0
  301. package/src/stories/Components/Feedback/Alert/Examples.stories.tsx +137 -0
  302. package/src/stories/Components/Feedback/Alert/Overview.stories.mdx +62 -0
  303. package/src/stories/Components/Inputs/Autocomplete/Accessibility.stories.mdx +31 -0
  304. package/src/stories/Components/Inputs/Autocomplete/AllCombinations.tsx +182 -0
  305. package/src/stories/Components/Inputs/Autocomplete/Autocomplete.stories.tsx +31 -0
  306. package/src/stories/Components/Inputs/Autocomplete/Examples.stories.tsx +233 -0
  307. package/src/stories/Components/Inputs/Autocomplete/Overview.stories.mdx +52 -0
  308. package/src/stories/Components/Inputs/Button/Accessibility.stories.mdx +52 -0
  309. package/src/stories/Components/Inputs/Button/AllCombinations.tsx +53 -0
  310. package/src/stories/Components/Inputs/Button/Button.stories.tsx +23 -0
  311. package/src/stories/Components/Inputs/Button/Examples.stories.tsx +190 -0
  312. package/src/stories/Components/Inputs/Button/Overview.stories.mdx +52 -0
  313. package/src/stories/Components/Inputs/Checkbox/Accessibility.stories.mdx +38 -0
  314. package/src/stories/Components/Inputs/Checkbox/AllCombinations.tsx +55 -0
  315. package/src/stories/Components/Inputs/Checkbox/Checkbox.stories.tsx +22 -0
  316. package/src/stories/Components/Inputs/Checkbox/Examples.stories.tsx +363 -0
  317. package/src/stories/Components/Inputs/Checkbox/Overview.stories.mdx +63 -0
  318. package/src/stories/Components/Inputs/IconButton/Examples.stories.tsx +24 -0
  319. package/src/stories/Components/Inputs/IconButton/IconButton.stories.tsx +26 -0
  320. package/src/stories/Components/Inputs/Radio/Accessibility.stories.mdx +61 -0
  321. package/src/stories/Components/Inputs/Radio/AllCombinations.tsx +75 -0
  322. package/src/stories/Components/Inputs/Radio/Examples.stories.tsx +333 -0
  323. package/src/stories/Components/Inputs/Radio/Overview.stories.mdx +74 -0
  324. package/src/stories/Components/Inputs/Radio/Radio.stories.tsx +22 -0
  325. package/src/stories/Components/Inputs/Select/Accessibility.stories.mdx +51 -0
  326. package/src/stories/Components/Inputs/Select/AllCombinations.tsx +63 -0
  327. package/src/stories/Components/Inputs/Select/Examples.stories.tsx +803 -0
  328. package/src/stories/Components/Inputs/Select/Overview.stories.mdx +73 -0
  329. package/src/stories/Components/Inputs/Select/Select.stories.tsx +22 -0
  330. package/src/stories/Components/Inputs/Slider/Accessibility.stories.mdx +43 -0
  331. package/src/stories/Components/Inputs/Slider/AllCombinations.tsx +30 -0
  332. package/src/stories/Components/Inputs/Slider/Examples.stories.tsx +146 -0
  333. package/src/stories/Components/Inputs/Slider/Overview.stories.mdx +59 -0
  334. package/src/stories/Components/Inputs/Slider/Slider.stories.tsx +27 -0
  335. package/src/stories/Components/Inputs/Switch/Accessibility.stories.mdx +34 -0
  336. package/src/stories/Components/Inputs/Switch/AllCombinations.tsx +45 -0
  337. package/src/stories/Components/Inputs/Switch/Examples.stories.tsx +213 -0
  338. package/src/stories/Components/Inputs/Switch/Overview.stories.mdx +62 -0
  339. package/src/stories/Components/Inputs/Switch/Switch.stories.tsx +22 -0
  340. package/src/stories/Components/Inputs/TextField/Accessibility.stories.mdx +29 -0
  341. package/src/stories/Components/Inputs/TextField/AllCombinations.tsx +57 -0
  342. package/src/stories/Components/Inputs/TextField/Examples.stories.tsx +127 -0
  343. package/src/stories/Components/Inputs/TextField/Overview.stories.mdx +60 -0
  344. package/src/stories/Components/Inputs/TextField/TextField.stories.tsx +261 -0
  345. package/src/stories/Components/Inputs/ToggleButton/Accessibility.stories.mdx +32 -0
  346. package/src/stories/Components/Inputs/ToggleButton/AllCombinations.tsx +113 -0
  347. package/src/stories/Components/Inputs/ToggleButton/Examples.stories.tsx +339 -0
  348. package/src/stories/Components/Inputs/ToggleButton/Overview.stories.mdx +55 -0
  349. package/src/stories/Components/Inputs/ToggleButton/ToggleButton.stories.tsx +19 -0
  350. package/src/stories/Components/Landmarks/Header/Examples.stories.tsx +197 -0
  351. package/src/stories/Components/Landmarks/Header/Header.stories.tsx +34 -0
  352. package/src/stories/Components/Landmarks/Header/Overview.stories.mdx +44 -0
  353. package/src/stories/Components/Navigation/Drawer/Accessibility.stories.mdx +13 -0
  354. package/src/stories/Components/Navigation/Drawer/Drawer.stories.tsx +80 -0
  355. package/src/stories/Components/Navigation/Drawer/Examples.stories.tsx +440 -0
  356. package/src/stories/Components/Navigation/Drawer/Overview.stories.mdx +43 -0
  357. package/src/stories/Components/Navigation/MobileNavigation/Accessibility.stories.mdx +14 -0
  358. package/src/stories/Components/Navigation/MobileNavigation/Examples.stories.tsx +384 -0
  359. package/src/stories/Components/Navigation/MobileNavigation/MobileNavigation.stories.tsx +24 -0
  360. package/src/stories/Components/Navigation/MobileNavigation/Overview.stories.mdx +47 -0
  361. package/src/stories/Components/Navigation/VerticalNavigation/Accessibility.stories.mdx +14 -0
  362. package/src/stories/Components/Navigation/VerticalNavigation/Examples.stories.tsx +307 -0
  363. package/src/stories/Components/Navigation/VerticalNavigation/Overview.stories.mdx +47 -0
  364. package/src/stories/Components/Navigation/VerticalNavigation/VerticalNavigation.stories.tsx +24 -0
  365. package/src/stories/ContactUs.stories.mdx +21 -0
  366. package/src/stories/Experimental/Test.stories.mdx +46 -0
  367. package/src/stories/GettingStarted/Designer.stories.mdx +86 -0
  368. package/src/stories/GettingStarted/Developer.stories.mdx +134 -0
  369. package/src/stories/Guidelines/Accessibility/AssistiveTechnology.stories.mdx +70 -0
  370. package/src/stories/Guidelines/Accessibility/ColorAndContrast.stories.mdx +109 -0
  371. package/src/stories/Guidelines/Accessibility/Hierarchy.stories.mdx +119 -0
  372. package/src/stories/Guidelines/Accessibility/Imagery.stories.mdx +136 -0
  373. package/src/stories/Guidelines/Accessibility/Overview.stories.mdx +44 -0
  374. package/src/stories/Guidelines/Accessibility/Principles.stories.mdx +156 -0
  375. package/src/stories/Guidelines/Accessibility/SoundAndMotion.stories.mdx +59 -0
  376. package/src/stories/Guidelines/Accessibility/Typography.stories.mdx +69 -0
  377. package/src/stories/Guidelines/Accessibility/Writing.stories.mdx +188 -0
  378. package/src/stories/Guidelines/Styleguide/ColorSwatch.tsx +53 -0
  379. package/src/stories/Guidelines/Styleguide/Colors.stories.mdx +118 -0
  380. package/src/stories/Guidelines/Styleguide/Typography.stories.mdx +84 -0
  381. package/src/stories/Introduction.stories.mdx +65 -0
  382. package/src/stories/Pages/ErrorPage.stories.tsx +30 -0
  383. package/src/stories/Pages/SideInSide.stories.tsx +195 -0
  384. package/src/stories/Roadmap.stories.mdx +19 -0
  385. package/src/stories/Templates/Login.stories.mdx +46 -0
  386. package/src/stories/assets/Atomic_Design_Icons-Dark.svg +24 -0
  387. package/src/stories/assets/Atomic_Design_Icons-Light.svg +25 -0
  388. package/src/stories/assets/accessibility-1.png +0 -0
  389. package/src/stories/assets/accessibility-2.png +0 -0
  390. package/src/stories/assets/accessibility-3.png +0 -0
  391. package/src/stories/assets/accessibility-banner.png +0 -0
  392. package/src/stories/assets/atoms.svg +6 -0
  393. package/src/stories/assets/design_system_2022-02-11_12.22pm.png +0 -0
  394. package/src/stories/assets/figma-tokens.png +0 -0
  395. package/src/stories/assets/hierarchy-1.jpg +0 -0
  396. package/src/stories/assets/hierarchy-2.jpg +0 -0
  397. package/src/stories/assets/hierarchy-3.jpg +0 -0
  398. package/src/stories/assets/icon-contrast-1.jpg +0 -0
  399. package/src/stories/assets/icon-contrast-2.jpg +0 -0
  400. package/src/stories/assets/imagery-1.png +0 -0
  401. package/src/stories/assets/imagery-2.png +0 -0
  402. package/src/stories/assets/imagery-3.png +0 -0
  403. package/src/stories/assets/imagery-4.jpg +0 -0
  404. package/src/stories/assets/molecules.svg +9 -0
  405. package/src/stories/assets/organisms.svg +22 -0
  406. package/src/stories/assets/pages.svg +5 -0
  407. package/src/stories/assets/particles.svg +4 -0
  408. package/src/stories/assets/templates.svg +4 -0
  409. package/src/stories/assets/testData.tsx +102 -0
  410. package/src/stories/assets/text-contrast-1.jpg +0 -0
  411. package/src/stories/assets/text-contrast-2.jpg +0 -0
  412. package/src/stories/assets/typography-1.png +0 -0
  413. package/src/stories/assets/visual-clues-1.png +0 -0
  414. package/src/stories/assets/visual-clues-2.png +0 -0
  415. package/src/stories/assets/writing-1.jpg +0 -0
  416. package/src/stories/assets/writing-2.png +0 -0
  417. package/src/stories/assets/writing-3.png +0 -0
  418. package/src/stories/assets/writing-4.png +0 -0
  419. package/src/stories/utils/CustomIcons.tsx +44 -0
  420. package/tsconfig.eslint.json +16 -0
  421. package/tsconfig.json +50 -0
  422. package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +0 -827
  423. package/components/navigation/MobileNavigation/MobileNavigationDrawer.js +0 -148
  424. package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +0 -392
  425. package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +0 -257
  426. package/components/navigation/MobileNavigation/MobileNavigationStyles.d.ts +0 -405
  427. package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.d.ts +0 -2
  428. package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +0 -32
  429. package/components/navigation/MobileNavigation/MobileNavigationToggleX.d.ts +0 -2
  430. package/components/navigation/MobileNavigation/MobileNavigationToggleX.js +0 -26
  431. package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.d.ts +0 -36
  432. package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.js +0 -10
  433. package/components/navigation/VerticalNavigation/VerticalNavigationAvatar.js +0 -84
  434. package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +0 -827
  435. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.d.ts +0 -19
  436. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +0 -91
  437. package/utils/constants.js +0 -6
  438. package/utils/helpers.d.ts +0 -6
  439. package/utils/helpers.js +0 -17
@@ -0,0 +1,66 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useState } from 'react';
14
+ import Icon from '@mui/material/Icon';
15
+ import Menu from '@mui/material/Menu';
16
+ import MenuItem from '@mui/material/MenuItem';
17
+ import IconButton from '@mui/material/IconButton';
18
+ import Tooltip from '@mui/material/Tooltip';
19
+ import MoreVertIcon from '@mui/icons-material/MoreVert';
20
+ var MAX_ICONS = 0;
21
+ var HeaderActionButtons = function (props) {
22
+ var options = props.options, styles = props.styles, forceListView = props.forceListView;
23
+ var _a = useState(null), anchorEl = _a[0], setAnchorEl = _a[1];
24
+ var handleClick = function (event) {
25
+ event === null || event === void 0 ? void 0 : event.stopPropagation();
26
+ setAnchorEl(event.currentTarget);
27
+ };
28
+ var handleClose = function (event) {
29
+ event === null || event === void 0 ? void 0 : event.stopPropagation();
30
+ setAnchorEl(null);
31
+ };
32
+ var handleOptionClick = function (event, option) {
33
+ event === null || event === void 0 ? void 0 : event.stopPropagation();
34
+ option === null || option === void 0 ? void 0 : option.onClick();
35
+ handleClose(event);
36
+ };
37
+ if (!options) {
38
+ console.log('Did you mean to pass items using the `options` parameter?');
39
+ return null;
40
+ }
41
+ // Show icon buttons if less than MAX_ICONS
42
+ if (options.length <= MAX_ICONS && !forceListView) {
43
+ return (_jsx("div", __assign({ style: styles }, { children: options.map(function (option) {
44
+ var label = option.label, icon = option.icon, onClick = option.onClick;
45
+ var handleOptionClick = onClick;
46
+ return (_jsx(Tooltip, __assign({ title: label, "aria-label": label, placement: 'bottom', enterDelay: 500, enterNextDelay: 50, leaveDelay: 50, disableInteractive: true }, { children: _jsx(IconButton, __assign({ size: 'small', "aria-label": label, onClick: handleOptionClick }, { children: _jsx(Icon, { children: icon }) })) }), label));
47
+ }) })));
48
+ }
49
+ // Show menu and v-ellipsis if more than MAX_ICONS
50
+ return (_jsxs("div", __assign({ style: styles }, { children: [_jsx(IconButton, __assign({ "aria-label": 'more', "aria-haspopup": 'true', onClick: handleClick }, { children: _jsx(MoreVertIcon, {}) })), _jsx(Menu, __assign({ id: 'actionButtonMenu', anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, anchorOrigin: {
51
+ vertical: 'bottom',
52
+ horizontal: 'center'
53
+ },
54
+ // getContentAnchorEl={null}
55
+ transformOrigin: {
56
+ vertical: 'top',
57
+ horizontal: 'center'
58
+ } }, { children: options.map(function (option) {
59
+ var label = option.label, isDisabled = option.isDisabled, actionKey = option.actionKey, hide = option.hide;
60
+ if (hide) {
61
+ return null;
62
+ }
63
+ return (_jsx(MenuItem, __assign({ onClick: function (event) { return handleOptionClick(event, option); }, "aria-label": label, disabled: isDisabled }, { children: label }), actionKey));
64
+ }) }))] })));
65
+ };
66
+ export default HeaderActionButtons;
@@ -0,0 +1,55 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledPaper: import("@emotion/styled").StyledComponent<{
3
+ children?: import("react").ReactNode;
4
+ classes?: Partial<import("@mui/material").PaperClasses> | undefined;
5
+ elevation?: number | undefined;
6
+ square?: boolean | undefined;
7
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
8
+ variant?: "outlined" | "elevation" | undefined;
9
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
10
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
11
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "square" | "elevation"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
12
+ export declare const StyledBreadcrumbs: import("@emotion/styled").StyledComponent<{
13
+ children?: import("react").ReactNode;
14
+ classes?: Partial<import("@mui/material").BreadcrumbsClasses> | undefined;
15
+ expandText?: string | undefined;
16
+ itemsAfterCollapse?: number | undefined;
17
+ itemsBeforeCollapse?: number | undefined;
18
+ maxItems?: number | undefined;
19
+ separator?: import("react").ReactNode;
20
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
21
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "key" | keyof import("react").HTMLAttributes<HTMLElement>> & {
22
+ ref?: ((instance: HTMLElement | null) => void) | import("react").RefObject<HTMLElement> | null | undefined;
23
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "separator" | "sx" | "expandText" | "itemsAfterCollapse" | "itemsBeforeCollapse" | "maxItems"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
24
+ export declare const StyledHeaderPrimary: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
25
+ children?: import("react").ReactNode;
26
+ component?: import("react").ElementType<any> | undefined;
27
+ ref?: import("react").Ref<unknown> | undefined;
28
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
29
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
30
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
31
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "ref" | "children" | "sx" | "component" | ("p" | "color" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint")> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
32
+ export declare const StyledHeaderSecondary: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
33
+ children?: import("react").ReactNode;
34
+ component?: import("react").ElementType<any> | undefined;
35
+ ref?: import("react").Ref<unknown> | undefined;
36
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
37
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
38
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
39
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "ref" | "children" | "sx" | "component" | ("p" | "color" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint")> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
40
+ export declare const StyledAdditionalButtonsContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
41
+ children?: import("react").ReactNode;
42
+ component?: import("react").ElementType<any> | undefined;
43
+ ref?: import("react").Ref<unknown> | undefined;
44
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
45
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
46
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
47
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "ref" | "children" | "sx" | "component" | ("p" | "color" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint")> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
48
+ export declare const StyledBox: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
49
+ children?: import("react").ReactNode;
50
+ component?: import("react").ElementType<any> | undefined;
51
+ ref?: import("react").Ref<unknown> | undefined;
52
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
53
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
54
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
55
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "ref" | "children" | "sx" | "component" | ("p" | "color" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint")> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,13 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import { Box, Paper } from '../../../index';
6
+ import { Breadcrumbs, styled } from '@mui/material';
7
+ export var StyledPaper = styled(Paper)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: ", ";\n position: relative;\n width: 100%;\n\n &.is-sticky {\n position: sticky;\n top: 0;\n z-index: 1;\n }\n"], ["\n display: flex;\n flex-direction: ", ";\n position: relative;\n width: 100%;\n\n &.is-sticky {\n position: sticky;\n top: 0;\n z-index: 1;\n }\n"])), function (props) { return props.theme.direction === 'ltr' ? 'row' : 'row-reverse'; });
8
+ export var StyledBreadcrumbs = styled(Breadcrumbs)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: ", ";\n margin-bottom: 0.5rem;\n\n ol {\n flex-direction: ", ";\n }\n"], ["\n font-size: ", ";\n margin-bottom: 0.5rem;\n\n ol {\n flex-direction: ", ";\n }\n"])), function (props) { return props.theme.typography.subtitle2.fontSize; }, function (props) { return props.theme.direction === 'ltr' ? 'row' : 'row-reverse'; });
9
+ export var StyledHeaderPrimary = styled(Box)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: ", ";\n display: flex;\n flex: 1 auto;\n flex-direction: column;\n padding: 1rem;\n padding-inline-start: 2rem;\n\n h1,\n h4 {\n font-size: clamp(1.125rem, 3.25vw, 2.75rem);\n text-align: ", ";\n }\n"], ["\n align-items: ", ";\n display: flex;\n flex: 1 auto;\n flex-direction: column;\n padding: 1rem;\n padding-inline-start: 2rem;\n\n h1,\n h4 {\n font-size: clamp(1.125rem, 3.25vw, 2.75rem);\n text-align: ", ";\n }\n"])), function (props) { return props.theme.direction === 'ltr' ? 'flex-start' : 'flex-end'; }, function (props) { return props.theme.direction === 'ltr' ? 'left' : 'right'; });
10
+ export var StyledHeaderSecondary = styled(Box)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n flex-direction: ", ";\n justify-content: flex-end;\n padding: 1rem;\n padding-inline-end: 2rem;\n\n button,\n a {\n white-space: nowrap;\n }\n"], ["\n align-items: center;\n display: flex;\n flex-direction: ", ";\n justify-content: flex-end;\n padding: 1rem;\n padding-inline-end: 2rem;\n\n button,\n a {\n white-space: nowrap;\n }\n"])), function (props) { return props.theme.direction === 'ltr' ? 'row' : 'row-reverse'; });
11
+ export var StyledAdditionalButtonsContainer = styled(Box)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-inline-start: ", ";\n margin-inline-end: ", ";\n"], ["\n margin-inline-start: ", ";\n margin-inline-end: ", ";\n"])), function (props) { return props.theme.direction === 'ltr' ? '0.5rem' : '0'; }, function (props) { return props.theme.direction === 'rtl' ? '0.5rem' : '0'; });
12
+ export var StyledBox = styled(Box)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: ", ";\n"], ["\n background: ", ";\n"])), function (props) { return props.theme.palette.background.default; });
13
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -15,8 +15,6 @@ interface MobileNavigationProps {
15
15
  isDrawerOpen?: boolean;
16
16
  isSearchOpen?: boolean;
17
17
  isAvatarOpen?: boolean;
18
- isPersistent?: boolean;
19
- setIsPersistent?: any;
20
18
  hideAvatarInitials?: boolean;
21
19
  showNotchIndicator?: boolean;
22
20
  hasSearch?: boolean;
@@ -24,6 +22,7 @@ interface MobileNavigationProps {
24
22
  searchPanelDefaultValue?: string;
25
23
  searchPanelOnClickSearch?: any;
26
24
  hasAvatar?: boolean;
25
+ avatarPanelLogoutString?: string;
27
26
  avatarPanelOnClickSwitchDirection?: any;
28
27
  avatarPanelOnClickLogout?: any;
29
28
  avatarPanelOnClickViewProfile?: any;
@@ -22,19 +22,19 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
24
  import React, { useEffect } from 'react';
25
- import { Person, PersonOutline } from '@mui/icons-material';
26
- import { StyledBottomNavigationAction, StyledPaper, StyledBottomNavigation, StyledNotchSVG, StyledNotchShadow, StyledNotchShadowMask } from './MobileNavigationStyles';
25
+ import { Person } from '@mui/icons-material';
26
+ import { StyledBottomNavigationAction, StyledPaper, StyledBottomNavigation } from './MobileNavigationStyles';
27
27
  import { StyledAvatar } from './MobileNavigationAvatarStyles';
28
28
  import SwipeableTemporaryDrawer from './MobileNavigationDrawer';
29
29
  import SwipeableTemporarySearch from './MobileNavigationSearch';
30
30
  import SwipeableTemporaryAvatar from './MobileNavigationAvatar';
31
- import { ToggleX } from './MobileNavigationToggleX';
32
- import { ToggleSearchX } from './MobileNavigationToggleSearchX';
33
- import { useCurrentWidth } from '../../../utils/hooks';
34
- import { slice } from 'lodash';
35
- import { motion } from 'framer-motion';
31
+ import NotchIndicator from './MobileNavigationNotchIndicator';
32
+ import ToggleX from './MobileNavigationToggleX';
33
+ import ToggleSearchX from './MobileNavigationToggleSearchX';
36
34
  import { MOBILE_NAV_PANEL_TYPES } from '../../../utils/constants';
37
35
  import { handleAvatarInitials } from '../../../utils/helpers';
36
+ import { useSpring, animated, useSpringRef, config } from '@react-spring/web';
37
+ import { useCurrentWidth } from '../../../utils/hooks';
38
38
  var MobileNavigation = function (props) {
39
39
  var _a, _b, _c;
40
40
  var items = props.items, secondaryItems = props.secondaryItems, hideAvatarInitials = props.hideAvatarInitials, hasSearch = props.hasSearch, hasAvatar = props.hasAvatar, showNotchIndicator = props.showNotchIndicator, rest = __rest(props, ["items", "secondaryItems", "hideAvatarInitials", "hasSearch", "hasAvatar", "showNotchIndicator"]);
@@ -45,17 +45,31 @@ var MobileNavigation = function (props) {
45
45
  var _d = React.useState(propIsDrawerOpen !== null && propIsDrawerOpen !== void 0 ? propIsDrawerOpen : false), isDrawerOpen = _d[0], setIsDrawerOpen = _d[1];
46
46
  var _e = React.useState(propIsSearchOpen !== null && propIsSearchOpen !== void 0 ? propIsSearchOpen : false), isSearchOpen = _e[0], setIsSearchOpen = _e[1];
47
47
  var _f = React.useState(propIsAvatarOpen !== null && propIsAvatarOpen !== void 0 ? propIsAvatarOpen : false), isAvatarOpen = _f[0], setIsAvatarOpen = _f[1];
48
- var maxMobilePrimaryItems = 3;
49
- var priorityItems = slice(items, 0, maxMobilePrimaryItems);
50
48
  var _g = React.useState(0), value = _g[0], setValue = _g[1];
51
- var _h = React.useState(0), mobileNotchPosition = _h[0], setMobileNotchPosition = _h[1];
52
- var windowWidth = useCurrentWidth();
53
49
  var currentDirection = window.localStorage.getItem('@learningpool/ui/store/mobile-navigation-direction');
54
- var _j = React.useState(currentDirection !== null && currentDirection !== void 0 ? currentDirection : 'ltr'), mobileNavDirection = _j[0], setMobileNavDirection = _j[1];
50
+ var _h = React.useState(currentDirection !== null && currentDirection !== void 0 ? currentDirection : 'ltr'), mobileNavDirection = _h[0], setMobileNavDirection = _h[1];
51
+ var _j = React.useState(0), mobileNotchPosition = _j[0], setMobileNotchPosition = _j[1];
52
+ var windowWidth = useCurrentWidth();
55
53
  useEffect(function () {
56
54
  window.localStorage.setItem('@learningpool/ui/store/mobile-navigation-direction', mobileNavDirection);
57
55
  positionMobileNotch();
58
56
  }, [mobileNavDirection]);
57
+ var NOTCH = {
58
+ Height: 50,
59
+ Width: 50
60
+ };
61
+ var BOTTOM_NAVIGATION_ITEM_DOM_ELEMENTS = document.querySelectorAll('.MuiBottomNavigationAction-root, .bottom-navigation-item');
62
+ var positionMobileNotch = function () {
63
+ var _a;
64
+ var selectedDOMRect = (_a = BOTTOM_NAVIGATION_ITEM_DOM_ELEMENTS[value]) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
65
+ setMobileNotchPosition(selectedDOMRect ? selectedDOMRect.left + (selectedDOMRect.width / 2) - (NOTCH.Width / 2) : mobileNotchPosition);
66
+ };
67
+ useEffect(function () { return positionMobileNotch(); }, [
68
+ value,
69
+ windowWidth,
70
+ // Fix notch position if scrollbar is hidden/shown
71
+ (_b = BOTTOM_NAVIGATION_ITEM_DOM_ELEMENTS[value]) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()
72
+ ]);
59
73
  useEffect(function () { return setIsDrawerOpen(propIsDrawerOpen !== null && propIsDrawerOpen !== void 0 ? propIsDrawerOpen : false); }, [propIsDrawerOpen]);
60
74
  useEffect(function () { return setIsSearchOpen(propIsSearchOpen !== null && propIsSearchOpen !== void 0 ? propIsSearchOpen : false); }, [propIsSearchOpen]);
61
75
  useEffect(function () { return setIsAvatarOpen(propIsAvatarOpen !== null && propIsAvatarOpen !== void 0 ? propIsAvatarOpen : false); }, [propIsAvatarOpen]);
@@ -69,7 +83,7 @@ var MobileNavigation = function (props) {
69
83
  }
70
84
  hideNotch();
71
85
  }, [isDrawerOpen, isSearchOpen, isAvatarOpen]);
72
- var _k = React.useState((_b = handleAvatarInitials(avatarName)) !== null && _b !== void 0 ? _b : 'AN'), avatarInitials = _k[0], setAvatarInitials = _k[1];
86
+ var _k = React.useState((_c = handleAvatarInitials(avatarName)) !== null && _c !== void 0 ? _c : 'AN'), avatarInitials = _k[0], setAvatarInitials = _k[1];
73
87
  var toggleDrawer = function (open, action) { return function (event) {
74
88
  event === null || event === void 0 ? void 0 : event.stopPropagation();
75
89
  if (event.type === 'keydown') {
@@ -90,6 +104,7 @@ var MobileNavigation = function (props) {
90
104
  }
91
105
  case MOBILE_NAV_PANEL_TYPES.AVATAR: {
92
106
  setIsAvatarOpen(open !== null && open !== void 0 ? open : !isAvatarOpen);
107
+ setValue(2);
93
108
  break;
94
109
  }
95
110
  default: {
@@ -99,85 +114,40 @@ var MobileNavigation = function (props) {
99
114
  }
100
115
  }
101
116
  }; };
102
- var NOTCH = {
103
- Height: 50,
104
- Width: 50
105
- };
106
- var BOTTOM_NAVIGATION_ITEM_DOM_ELEMENTS = document.querySelectorAll('.MuiBottomNavigationAction-root, .bottom-navigation-item');
107
- var positionMobileNotch = function () {
108
- var _a;
109
- var selectedDOMRect = (_a = BOTTOM_NAVIGATION_ITEM_DOM_ELEMENTS[value]) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
110
- setMobileNotchPosition(selectedDOMRect ? selectedDOMRect.left + (selectedDOMRect.width / 2) - (NOTCH.Width / 2) : mobileNotchPosition);
111
- };
112
- useEffect(function () { return positionMobileNotch(); }, [
113
- value,
114
- windowWidth,
115
- // Fix notch position if scrollbar is hidden/shown
116
- (_c = BOTTOM_NAVIGATION_ITEM_DOM_ELEMENTS[value]) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect()
117
- ]);
118
- var variantsPaper = {
119
- open: {
120
- opacity: 1
121
- }
122
- };
123
- var variantsContainer = {
124
- open: {
125
- transition: { staggerChildren: 0.07, delayChildren: 0.25 }
126
- }
127
- };
128
- var variantsButtons = {
129
- open: {
130
- y: 0,
131
- opacity: 1,
132
- transition: {
133
- y: { stiffness: 500, velocity: -100 }
134
- }
117
+ var api = useSpringRef();
118
+ var animationConfig = {
119
+ MobileNavigationPaper: {
120
+ from: { opacity: 0 },
121
+ to: { opacity: 1 }
122
+ },
123
+ MobileNavigation: {
124
+ from: { opacity: 0 },
125
+ to: { opacity: 1 }
126
+ },
127
+ MobileNavigationButton: {
128
+ from: { opacity: 0 },
129
+ to: { opacity: 1 }
130
+ },
131
+ MobileNavigationNotch: {
132
+ ref: api,
133
+ config: __assign(__assign({}, config.default), { mass: 1 }),
134
+ x: mobileNotchPosition,
135
+ y: value < 0 ? 100 : 0
135
136
  }
136
137
  };
137
- return (_jsxs(_Fragment, { children: [_jsx(SwipeableTemporaryDrawer, __assign({ isDrawerOpen: isDrawerOpen, setIsDrawerOpen: setIsDrawerOpen, items: items, secondaryItems: secondaryItems, label: 'Primary' }, rest)), hasSearch && (_jsx(SwipeableTemporarySearch, __assign({}, rest, { isSearchOpen: isSearchOpen, setIsSearchOpen: setIsSearchOpen }))), hasAvatar && (_jsx(SwipeableTemporaryAvatar, __assign({}, rest, { isAvatarOpen: isAvatarOpen, setIsAvatarOpen: setIsAvatarOpen, avatarName: avatarName, mobileNavDirection: mobileNavDirection, setMobileNavDirection: setMobileNavDirection }))), _jsxs(StyledPaper, __assign({ elevation: 3,
138
+ var MobileNavigationPaperAnimation = useSpring(animationConfig.MobileNavigationPaper);
139
+ var MobileNavigationAnimation = useSpring(animationConfig.MobileNavigation);
140
+ var MobileNavigationButtonAnimation = useSpring(animationConfig.MobileNavigationButton);
141
+ return (_jsxs(_Fragment, { children: [_jsx(SwipeableTemporaryDrawer, __assign({ isDrawerOpen: isDrawerOpen, setIsDrawerOpen: setIsDrawerOpen, items: items, secondaryItems: secondaryItems, label: 'Primary' }, rest)), hasSearch && (_jsx(SwipeableTemporarySearch, __assign({ isSearchOpen: isSearchOpen, setIsSearchOpen: setIsSearchOpen }, rest))), hasAvatar && (_jsx(SwipeableTemporaryAvatar, __assign({ isAvatarOpen: isAvatarOpen, setIsAvatarOpen: setIsAvatarOpen, avatarName: avatarName, mobileNavDirection: mobileNavDirection, setMobileNavDirection: setMobileNavDirection }, rest))), _jsxs(StyledPaper, __assign({ elevation: 3,
138
142
  // @ts-expect-error
139
- component: motion.div, animate: 'open', variants: variantsPaper, initial: { opacity: 0 }, transition: {
140
- // when: 'beforeChildren'
141
- } }, { children: [showNotchIndicator &&
142
- _jsxs(motion.div, __assign({ style: { zIndex: '-1' }, initial: {
143
- opacity: 0,
144
- x: -75,
145
- y: 100
146
- }, animate: {
147
- opacity: 1,
148
- x: mobileNotchPosition,
149
- y: value < 0 ? 100 : -2
150
- }, transition: {
151
- x: {
152
- // duration: 0.5,
153
- type: 'spring',
154
- // mass: 0.5,
155
- bounce: 0.25
156
- // stiffness: 50
157
- },
158
- y: {
159
- delay: 0.25,
160
- // duration: 0.5,
161
- type: 'spring',
162
- // mass: 0.5,
163
- bounce: 0
164
- }
165
- // duration: 0.5
166
- } }, { children: [_jsx(StyledNotchShadow, {}), _jsx(StyledNotchSVG, __assign({ viewBox: "0 0 22 85", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx(motion.path, { d: "M0 0V85V76.0381C0.774 69.7533 4.9101 64.7829 7.5488 63.5975C7.668 63.5518 7.7867 63.5052 7.9049 63.4576C16.1679 60.1279 22 52.035 22 42.5799C22 33.1612 16.2126 25.0941 8 21.7408C7.8723 21.6887 7.7441 21.6377 7.6153 21.5879C4.8325 20.3142 0.4173 14.8748 0 8.13255V0Z" }) })), _jsx(StyledNotchShadowMask, {})] })), _jsxs(StyledBottomNavigation, __assign({ value: value, onChange: function (event, newValue) { return setValue(newValue); },
143
+ component: animated.div, style: MobileNavigationPaperAnimation }, { children: [showNotchIndicator && _jsx(NotchIndicator, __assign({}, animationConfig.MobileNavigationNotch)), _jsxs(StyledBottomNavigation, __assign({ value: value, onChange: function (event, newValue) { return setValue(newValue); },
167
144
  // @ts-expect-error
168
- component: motion.div, animate: 'open', variants: variantsContainer, style: {
169
- flexDirection: mobileNavDirection && mobileNavDirection === 'rtl' ? 'row-reverse' : 'row'
170
- } }, { children: [_jsx(StyledBottomNavigationAction, { icon: _jsx(ToggleX, {}), onClick: toggleDrawer(!isDrawerOpen, MOBILE_NAV_PANEL_TYPES.DRAWER),
145
+ component: animated.div, style: __assign({ flexDirection: mobileNavDirection && mobileNavDirection === 'rtl' ? 'row-reverse' : 'row' }, MobileNavigationAnimation) }, { children: [_jsx(StyledBottomNavigationAction, { icon: _jsx(ToggleX, { isOpen: isDrawerOpen }), onClick: toggleDrawer(!isDrawerOpen, MOBILE_NAV_PANEL_TYPES.DRAWER),
171
146
  // @ts-expect-error
172
- component: motion.div, animate: isDrawerOpen ? 'open' : 'closed', variants: variantsButtons, "aria-label": isDrawerOpen ? 'Close drawer panel' : 'Open drawer panel', "aria-expanded": isDrawerOpen ? 'true' : 'false', "aria-controls": 'mobile-nav-menu', style: {
173
- marginInlineStart: (hasSearch || hasAvatar) && (mobileNavDirection && mobileNavDirection === 'rtl') ? 'auto' : 'initial',
174
- marginInlineEnd: (hasSearch || hasAvatar) && (mobileNavDirection && mobileNavDirection === 'rtl') ? 'initial' : 'auto'
175
- } }), hasSearch && (_jsx(StyledBottomNavigationAction, { icon: _jsx(ToggleSearchX, {}), onClick: toggleDrawer(!isSearchOpen, MOBILE_NAV_PANEL_TYPES.SEARCH),
147
+ component: animated.div, "aria-label": isDrawerOpen ? 'Close drawer panel' : 'Open drawer panel', "aria-expanded": isDrawerOpen ? 'true' : 'false', "aria-controls": 'mobile-nav-menu', style: __assign({ marginInlineStart: (hasSearch || hasAvatar) && (mobileNavDirection && mobileNavDirection === 'rtl') ? 'auto' : 'initial', marginInlineEnd: (hasSearch || hasAvatar) && (mobileNavDirection && mobileNavDirection === 'rtl') ? 'initial' : 'auto' }, MobileNavigationButtonAnimation) }), hasSearch && (_jsx(StyledBottomNavigationAction, { icon: _jsx(ToggleSearchX, { isOpen: isSearchOpen }), onClick: toggleDrawer(!isSearchOpen, MOBILE_NAV_PANEL_TYPES.SEARCH),
176
148
  // @ts-expect-error
177
- component: motion.div, animate: isSearchOpen ? 'open' : 'closed', variants: variantsButtons, "aria-label": isSearchOpen ? 'Close search panel' : 'Open search panel', "aria-expanded": isSearchOpen ? 'true' : 'false', "aria-controls": 'mobile-nav-menu' })), hasAvatar && (_jsx(StyledBottomNavigationAction, { onClick: toggleDrawer(!isAvatarOpen, MOBILE_NAV_PANEL_TYPES.AVATAR), icon: !hideAvatarInitials
178
- ? _jsx(StyledAvatar, { children: avatarInitials })
179
- : value === (priorityItems ? priorityItems.length + 1 : 1) ? _jsx(Person, {}) : _jsx(PersonOutline, {}),
149
+ component: animated.div, "aria-label": isSearchOpen ? 'Close search panel' : 'Open search panel', "aria-expanded": isSearchOpen ? 'true' : 'false', "aria-controls": 'mobile-nav-menu', style: MobileNavigationButtonAnimation })), hasAvatar && (_jsx(StyledBottomNavigationAction, { onClick: toggleDrawer(!isAvatarOpen, MOBILE_NAV_PANEL_TYPES.AVATAR), icon: !hideAvatarInitials ? _jsx(StyledAvatar, { children: avatarInitials }) : _jsx(Person, {}),
180
150
  // @ts-expect-error
181
- component: motion.button, variants: variantsButtons, "aria-label": isAvatarOpen ? 'Close Profile Menu' : 'Open Profile Menu', "aria-expanded": isAvatarOpen ? 'true' : 'false', "aria-controls": 'mobile-nav-menu' }))] }))] }))] }));
151
+ component: animated.button, "aria-label": isAvatarOpen ? 'Close Profile Menu' : 'Open Profile Menu', "aria-expanded": isAvatarOpen ? 'true' : 'false', "aria-controls": 'mobile-nav-menu', style: MobileNavigationButtonAnimation }))] }))] }))] }));
182
152
  };
183
153
  export default MobileNavigation;
@@ -7,11 +7,11 @@ export interface IAvatarMenuItemProps {
7
7
  export interface ISwipeableTemporaryAvatarProps {
8
8
  avatarName: string;
9
9
  editProfileText?: string;
10
- logoutText?: string;
11
10
  isAvatarOpen: boolean;
12
11
  setIsAvatarOpen?: any;
13
12
  mobileNavDirection?: string;
14
13
  setMobileNavDirection?: any;
14
+ avatarPanelLogoutString?: string;
15
15
  avatarPanelOnClickSwitchDirection?: any;
16
16
  avatarPanelOnClickLogout?: any;
17
17
  avatarPanelOnClickViewProfile?: any;
@@ -11,20 +11,19 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import React, { useEffect } from 'react';
14
- import { Box, ButtonGroup, IconButton, Button, Link, List, ListItem, ListItemIcon, ListItemText } from '../../../index';
14
+ import { Box, ButtonGroup, Button, Link, List, ListItem, ListItemIcon, ListItemText } from '../../../index';
15
15
  import { StyledSwipeableAvatar, StyledBox, StyledBoxProfile, StyledAvatarName, StyledAvatar, StyledOutlineButton, StyledBoxProfileEdit, StyledListItemButton } from './MobileNavigationAvatarStyles';
16
16
  import { useTheme } from '@mui/material/styles';
17
17
  import EditIcon from '@mui/icons-material/Edit';
18
18
  import LogoutIcon from '@mui/icons-material/Logout';
19
- import { motion } from 'framer-motion';
20
- import { motionParent, motionFadeIn, motionFadeInUp, motionWhileHover, motionWhileTap } from './MobileNavigationMotion';
21
19
  import ToggleOffIcon from '@mui/icons-material/ToggleOff';
22
20
  import ToggleOnIcon from '@mui/icons-material/ToggleOn';
23
- import { handleAvatarInitials } from '../../../utils/helpers';
21
+ import { handleAvatarInitials, useStaggerAnimation } from '../../../utils/helpers';
22
+ import { animated } from '@react-spring/web';
24
23
  var SwipeableTemporaryAvatar = function (props) {
25
24
  var _a;
26
25
  var theme = useTheme();
27
- var avatarName = props.avatarName, mobileNavDirection = props.mobileNavDirection, isAvatarOpen = props.isAvatarOpen, setIsAvatarOpen = props.setIsAvatarOpen, setMobileNavDirection = props.setMobileNavDirection, avatarPanelOnClickSwitchDirection = props.avatarPanelOnClickSwitchDirection, avatarPanelOnClickLogout = props.avatarPanelOnClickLogout, avatarPanelOnClickViewProfile = props.avatarPanelOnClickViewProfile, avatarPanelViewProfileString = props.avatarPanelViewProfileString, avatarPanelOnClickEditProfile = props.avatarPanelOnClickEditProfile, avatarPanelEditProfileString = props.avatarPanelEditProfileString, avatarPanelMenuItems = props.avatarPanelMenuItems, avatarPanelOnClickMainAction = props.avatarPanelOnClickMainAction, avatarPanelMainActionString = props.avatarPanelMainActionString, avatarPanelSettingItems = props.avatarPanelSettingItems, avatarPanelInvertNavString = props.avatarPanelInvertNavString;
26
+ var avatarName = props.avatarName, mobileNavDirection = props.mobileNavDirection, avatarPanelLogoutString = props.avatarPanelLogoutString, isAvatarOpen = props.isAvatarOpen, setIsAvatarOpen = props.setIsAvatarOpen, setMobileNavDirection = props.setMobileNavDirection, avatarPanelOnClickSwitchDirection = props.avatarPanelOnClickSwitchDirection, avatarPanelOnClickLogout = props.avatarPanelOnClickLogout, avatarPanelOnClickViewProfile = props.avatarPanelOnClickViewProfile, avatarPanelViewProfileString = props.avatarPanelViewProfileString, avatarPanelOnClickEditProfile = props.avatarPanelOnClickEditProfile, avatarPanelEditProfileString = props.avatarPanelEditProfileString, avatarPanelMenuItems = props.avatarPanelMenuItems, avatarPanelOnClickMainAction = props.avatarPanelOnClickMainAction, avatarPanelMainActionString = props.avatarPanelMainActionString, avatarPanelSettingItems = props.avatarPanelSettingItems, avatarPanelInvertNavString = props.avatarPanelInvertNavString;
28
27
  var _b = React.useState(isAvatarOpen !== null && isAvatarOpen !== void 0 ? isAvatarOpen : false), isOpen = _b[0], setIsOpen = _b[1];
29
28
  React.useEffect(function () { return handleOpenState(isAvatarOpen); }, [isAvatarOpen]);
30
29
  var handleOpenState = function (open) {
@@ -47,25 +46,30 @@ var SwipeableTemporaryAvatar = function (props) {
47
46
  setMobileNavDirection(mobileNavDirection === 'rtl' ? 'ltr' : 'rtl');
48
47
  avatarPanelOnClickSwitchDirection && avatarPanelOnClickSwitchDirection();
49
48
  };
49
+ // First item starts at 70ms
50
+ // see STAGGER_ITEMS_DELAY in helpers.js
51
+ var animationCount = 1;
52
+ var incrementAnimationCount = function () { return animationCount++; };
50
53
  return (_jsx(StyledSwipeableAvatar, __assign({ anchor: 'bottom', open: isOpen, onClose: toggleAvatar(false), hideBackdrop: true, ModalProps: {
51
54
  keepMounted: true
52
- } }, { children: _jsxs(StyledBox, __assign({ animate: isAvatarOpen ? 'open' : 'closed', variants: motionParent }, { children: [avatarPanelOnClickLogout && (_jsx(IconButton
55
+ } }, { children: _jsxs(StyledBox, { children: [avatarPanelOnClickLogout && (_jsx(Button
53
56
  // @ts-expect-error
54
57
  , __assign({
55
58
  // @ts-expect-error
56
- component: motion.button, variants: motionFadeIn, style: {
57
- left: theme.direction === 'rtl' ? theme.spacing(1) : 'auto',
58
- position: 'absolute',
59
- right: theme.direction === 'rtl' ? 'auto' : theme.spacing(1),
60
- top: theme.spacing(1)
61
- }, onClick: avatarPanelOnClickLogout }, { children: _jsx(LogoutIcon, {}) }))), _jsxs(Box, __assign({ style: {
59
+ component: animated.button, style: __assign({ left: theme.direction === 'rtl' ? theme.spacing(1) : 'auto', position: 'absolute', right: theme.direction === 'rtl' ? 'auto' : theme.spacing(1), top: theme.spacing(1) }, useStaggerAnimation(isOpen, animationCount, incrementAnimationCount)), onClick: function () {
60
+ handleOpenState(false);
61
+ avatarPanelOnClickLogout();
62
+ }, startIcon: _jsx(LogoutIcon, {}), variant: 'text', color: 'inherit' }, { children: avatarPanelLogoutString !== null && avatarPanelLogoutString !== void 0 ? avatarPanelLogoutString : 'Logout' }))), _jsxs(Box, __assign({ style: {
62
63
  alignItems: 'center',
63
64
  display: 'flex',
64
65
  flexDirection: 'column'
65
- } }, { children: [_jsxs(StyledBoxProfile, __assign({ variants: motionFadeInUp }, { children: [_jsx(StyledAvatar, __assign({ style: { marginRight: '0.5rem' } }, { children: avatarInitials })), _jsxs(StyledAvatarName, { children: [_jsx("span", __assign({ style: { fontWeight: 300 } }, { children: "Hi," })), " ", _jsx("strong", { children: avatarName.split(' ')[0] })] })] })), avatarPanelOnClickViewProfile && (_jsx(StyledBoxProfileEdit, __assign({ variants: motionFadeInUp, style: {
66
- flexDirection: 'row',
67
- marginBottom: theme.spacing(1)
68
- } }, { children: _jsxs(ButtonGroup, __assign({ variant: "contained", "aria-label": "split button" }, { children: [_jsx(Button, __assign({ variant: 'contained', color: 'primary', size: 'medium', onClick: avatarPanelOnClickViewProfile }, { children: avatarPanelViewProfileString !== null && avatarPanelViewProfileString !== void 0 ? avatarPanelViewProfileString : 'View Profile' })), avatarPanelOnClickEditProfile && (_jsx(Button, __assign({ size: 'medium', "aria-label": avatarPanelEditProfileString !== null && avatarPanelEditProfileString !== void 0 ? avatarPanelEditProfileString : 'Edit Profile', onClick: avatarPanelOnClickEditProfile }, { children: _jsx(EditIcon, {}) })))] })) })))] })), _jsxs(Box, __assign({ style: {
66
+ } }, { children: [_jsxs(StyledBoxProfile, __assign({ style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount) }, { children: [_jsx(StyledAvatar, __assign({ style: { marginRight: '0.5rem' } }, { children: avatarInitials })), _jsxs(StyledAvatarName, { children: [_jsx("span", __assign({ style: { fontWeight: 300 } }, { children: "Hi," })), " ", _jsx("strong", { children: avatarName.split(' ')[0] })] })] })), avatarPanelOnClickViewProfile && (_jsx(StyledBoxProfileEdit, __assign({ style: __assign({ flexDirection: 'row', marginBottom: theme.spacing(1) }, useStaggerAnimation(isOpen, animationCount, incrementAnimationCount)) }, { children: _jsxs(ButtonGroup, __assign({ variant: "contained", "aria-label": "split button" }, { children: [_jsx(Button, __assign({ variant: 'contained', color: 'primary', size: 'medium', onClick: function () {
67
+ handleOpenState(false);
68
+ avatarPanelOnClickViewProfile();
69
+ } }, { children: avatarPanelViewProfileString !== null && avatarPanelViewProfileString !== void 0 ? avatarPanelViewProfileString : 'View Profile' })), avatarPanelOnClickEditProfile && (_jsx(Button, __assign({ size: 'medium', "aria-label": avatarPanelEditProfileString !== null && avatarPanelEditProfileString !== void 0 ? avatarPanelEditProfileString : 'Edit Profile', onClick: function () {
70
+ handleOpenState(false);
71
+ avatarPanelOnClickEditProfile();
72
+ } }, { children: _jsx(EditIcon, {}) })))] })) })))] })), _jsxs(Box, __assign({ style: {
69
73
  alignItems: 'center',
70
74
  display: 'flex',
71
75
  flexDirection: 'column'
@@ -73,29 +77,47 @@ var SwipeableTemporaryAvatar = function (props) {
73
77
  marginInlineStart: '3rem',
74
78
  marginBottom: theme.spacing(2),
75
79
  maxWidth: '18rem'
76
- } }, { children: avatarPanelMenuItems.map(function (avatarMenuItem) { return (_jsx(ListItem, __assign({ component: motion.div, variants: motionFadeInUp, whileHover: motionWhileHover, whileTap: motionWhileTap, disablePadding: true }, { children: _jsxs(StyledListItemButton
80
+ } }, { children: avatarPanelMenuItems.map(function (avatarMenuItem) { return (_jsx(ListItem, __assign({ component: animated.div, style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount),
81
+ // whileHover={motionWhileHover}
82
+ // whileTap={motionWhileTap}
83
+ disablePadding: true }, { children: _jsxs(StyledListItemButton
77
84
  // TODO: figure out if these are links or buttons
78
85
  // @ts-expect-error
79
86
  , __assign({
80
87
  // TODO: figure out if these are links or buttons
81
88
  // @ts-expect-error
82
- component: Link, role: 'link', onClick: avatarMenuItem.onClick }, { children: [_jsx(ListItemIcon, __assign({ "aria-hidden": true, style: {
89
+ component: Link, role: 'link', onClick: function () {
90
+ handleOpenState(false);
91
+ avatarMenuItem.onClick();
92
+ } }, { children: [_jsx(ListItemIcon, __assign({ "aria-hidden": true, style: {
83
93
  minWidth: theme.spacing(5)
84
94
  } }, { children: avatarMenuItem.icon })), _jsx(ListItemText, { primary: avatarMenuItem.label })] })) }))); }) }))), avatarPanelOnClickMainAction && _jsx(StyledOutlineButton
85
95
  // @ts-expect-error
86
96
  , __assign({
87
97
  // @ts-expect-error
88
- component: motion.button, variants: motionFadeInUp, disablePadding: true, variant: 'outlined', color: 'primary', size: 'medium', onClick: avatarPanelOnClickMainAction }, { children: avatarPanelMainActionString })), _jsxs(List, __assign({ style: { marginBottom: theme.spacing(2) } }, { children: [avatarPanelSettingItems &&
98
+ component: animated.button, style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount), disablePadding: true, variant: 'outlined', color: 'primary', size: 'medium', onClick: function () {
99
+ handleOpenState(false);
100
+ avatarPanelOnClickMainAction();
101
+ } }, { children: avatarPanelMainActionString })), _jsxs(List, __assign({ style: { marginBottom: theme.spacing(2) } }, { children: [avatarPanelSettingItems &&
89
102
  avatarPanelSettingItems.length > 0 &&
90
- avatarPanelSettingItems.map(function (avatarMenuItem) { return (_jsx(ListItem, __assign({ component: motion.div, variants: motionFadeInUp, whileHover: motionWhileHover, whileTap: motionWhileTap, disablePadding: true }, { children: _jsxs(StyledListItemButton
103
+ avatarPanelSettingItems.map(function (avatarMenuItem) { return (_jsx(ListItem, __assign({ component: animated.div, style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount),
104
+ // whileHover={motionWhileHover}
105
+ // whileTap={motionWhileTap}
106
+ disablePadding: true }, { children: _jsxs(StyledListItemButton
91
107
  // TODO: figure out if these are links or buttons
92
108
  // @ts-expect-error
93
109
  , __assign({
94
110
  // TODO: figure out if these are links or buttons
95
111
  // @ts-expect-error
96
- component: Link, role: 'link', onClick: avatarMenuItem.onClick }, { children: [_jsx(ListItemIcon, __assign({ "aria-hidden": true, style: {
112
+ component: Link, role: 'link', onClick: function () {
113
+ handleOpenState(false);
114
+ avatarMenuItem.onClick();
115
+ } }, { children: [_jsx(ListItemIcon, __assign({ "aria-hidden": true, style: {
97
116
  minWidth: theme.spacing(5)
98
- } }, { children: avatarMenuItem.icon })), _jsx(ListItemText, { primary: avatarMenuItem.label })] })) }))); }), avatarPanelOnClickSwitchDirection && (_jsx(ListItem, __assign({ component: motion.div, variants: motionFadeInUp, whileHover: motionWhileHover, whileTap: motionWhileTap, disablePadding: true }, { children: _jsxs(StyledListItemButton
117
+ } }, { children: avatarMenuItem.icon })), _jsx(ListItemText, { primary: avatarMenuItem.label })] })) }))); }), avatarPanelOnClickSwitchDirection && (_jsx(ListItem, __assign({ component: animated.div, style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount),
118
+ // whileHover={motionWhileHover}
119
+ // whileTap={motionWhileTap}
120
+ disablePadding: true }, { children: _jsxs(StyledListItemButton
99
121
  // TODO: figure out if these are links or buttons
100
122
  // @ts-expect-error
101
123
  , __assign({
@@ -117,6 +139,6 @@ var SwipeableTemporaryAvatar = function (props) {
117
139
  height: '2em',
118
140
  padding: '0.15em',
119
141
  width: '2em'
120
- } })) }))] })) })))] }))] }))] })) })));
142
+ } })) }))] })) })))] }))] }))] }) })));
121
143
  };
122
144
  export default SwipeableTemporaryAvatar;