@learningpool/ui 1.6.0 → 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.
- package/.eslintrc.js +40 -0
- package/.github/pull_request_template.md +23 -0
- package/.github/renovate.json +57 -0
- package/.github/workflows/integration.yml +53 -0
- package/.github/workflows/wss.yml +22 -0
- package/.jest-test-results.json +1 -0
- package/.releaserc +32 -0
- package/.storybook/learningpoolTheme.js +39 -0
- package/.storybook/main.js +21 -0
- package/.storybook/manager-head.html +175 -0
- package/.storybook/manager.js +34 -0
- package/.storybook/preview-head.html +212 -0
- package/.storybook/preview.js +120 -0
- package/.storybook/storybook-sort.js +54 -0
- package/CHANGELOG.md +6 -0
- package/amplify.yml +16 -0
- package/babel.config.json +14 -0
- package/{assets → dist/assets}/Images.d.ts +0 -0
- package/{assets → dist/assets}/Images.js +0 -0
- package/{components → dist/components}/atoms/Autocomplete/Autocomplete.d.ts +0 -0
- package/{components → dist/components}/atoms/Autocomplete/Autocomplete.js +0 -0
- package/{components → dist/components}/atoms/Button/Button.d.ts +0 -0
- package/{components → dist/components}/atoms/Button/Button.js +0 -0
- package/{components → dist/components}/atoms/Checkbox/Checkbox.d.ts +0 -0
- package/{components → dist/components}/atoms/Checkbox/Checkbox.js +0 -0
- package/{components → dist/components}/atoms/IconButton/IconButton.d.ts +0 -0
- package/{components → dist/components}/atoms/IconButton/IconButton.js +0 -0
- package/{components → dist/components}/atoms/Radio/Radio.d.ts +0 -0
- package/{components → dist/components}/atoms/Radio/Radio.js +0 -0
- package/{components → dist/components}/atoms/Select/Select.d.ts +0 -0
- package/{components → dist/components}/atoms/Select/Select.js +0 -0
- package/{components → dist/components}/atoms/Slider/Slider.d.ts +0 -0
- package/{components → dist/components}/atoms/Slider/Slider.js +0 -0
- package/{components → dist/components}/atoms/Switch/Switch.d.ts +0 -0
- package/{components → dist/components}/atoms/Switch/Switch.js +0 -0
- package/{components → dist/components}/atoms/TextField/TextField.d.ts +0 -0
- package/{components → dist/components}/atoms/TextField/TextField.js +0 -0
- package/{components → dist/components}/atoms/ToggleButton/ToggleButton.d.ts +0 -0
- package/{components → dist/components}/atoms/ToggleButton/ToggleButton.js +0 -0
- package/{components → dist/components}/datadisplay/Avatar/Avatar.d.ts +0 -0
- package/{components → dist/components}/datadisplay/Avatar/Avatar.js +0 -0
- package/{components → dist/components}/datadisplay/Chip/Chip.d.ts +0 -0
- package/{components → dist/components}/datadisplay/Chip/Chip.js +0 -0
- package/{components → dist/components}/datadisplay/List/List.d.ts +0 -0
- package/{components → dist/components}/datadisplay/List/List.js +0 -0
- package/{components → dist/components}/datadisplay/Tooltip/Tooltip.d.ts +0 -0
- package/{components → dist/components}/datadisplay/Tooltip/Tooltip.js +0 -0
- package/{components → dist/components}/feedback/Alert/Alert.d.ts +0 -0
- package/{components → dist/components}/feedback/Alert/Alert.js +0 -0
- package/{components → dist/components}/landmarks/Header/Header.d.ts +0 -0
- package/{components → dist/components}/landmarks/Header/Header.js +0 -0
- package/{components → dist/components}/landmarks/Header/HeaderActionButtons.d.ts +0 -0
- package/{components → dist/components}/landmarks/Header/HeaderActionButtons.js +0 -0
- package/{components → dist/components}/landmarks/Header/HeaderStyles.d.ts +0 -0
- package/{components → dist/components}/landmarks/Header/HeaderStyles.js +0 -0
- package/{components → dist/components}/navigation/Drawer/Drawer.d.ts +0 -0
- package/{components → dist/components}/navigation/Drawer/Drawer.js +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigation.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigation.js +64 -41
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatar.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatar.js +23 -19
- package/dist/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +3296 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatarStyles.js +4 -4
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationDrawer.d.ts +0 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationDrawer.js +71 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +1215 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationDrawerStyles.js +2 -2
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.js +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.js +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.js +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationMotion.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationMotion.js +0 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.d.ts +3 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.js +19 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationSearch.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationSearch.js +8 -6
- package/dist/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +1080 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationSearchStyles.js +2 -2
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationStyles.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationStyles.js +0 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.d.ts +3 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +28 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationToggleX.d.ts +3 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationToggleX.js +28 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigation.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigation.js +18 -16
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationAvatar.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationAvatar.js +20 -25
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +3296 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +4 -4
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +5 -1
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationMotion.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationMotion.js +0 -0
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +1163 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationStyles.js +3 -2
- package/{components → dist/components}/pages/ErrorPage/ErrorPage.d.ts +0 -0
- package/{components → dist/components}/pages/ErrorPage/ErrorPage.js +0 -0
- package/{components → dist/components}/pages/ErrorPage/ErrorPageStyles.d.ts +0 -0
- package/{components → dist/components}/pages/ErrorPage/ErrorPageStyles.js +0 -0
- package/{components → dist/components}/pages/SideInSide/SideInSide.d.ts +0 -0
- package/{components → dist/components}/pages/SideInSide/SideInSide.js +0 -0
- package/{components → dist/components}/pages/SideInSide/SideInSideStyles.d.ts +0 -0
- package/{components → dist/components}/pages/SideInSide/SideInSideStyles.js +0 -0
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcher.d.ts +0 -0
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcher.js +0 -0
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcherItem.d.ts +0 -0
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcherItem.js +0 -0
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcherStyles.d.ts +0 -0
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcherStyles.js +0 -0
- package/{components → dist/components}/stream/AppSwitcher/constants.d.ts +0 -0
- package/{components → dist/components}/stream/AppSwitcher/constants.js +0 -0
- package/{index.d.ts → dist/index.d.ts} +0 -0
- package/{index.js → dist/index.js} +0 -0
- package/{lang → dist/lang}/en-us.d.ts +0 -0
- package/{lang → dist/lang}/en-us.js +0 -0
- package/dist/package.json +41 -0
- package/{types → dist/types}/components/navigation/VerticalNavigation.d.ts +0 -0
- package/{types → dist/types}/components/navigation/VerticalNavigation.js +0 -0
- package/{types → dist/types}/components/navigation/VerticalNavigationAvatar.d.ts +1 -0
- package/{types → dist/types}/components/navigation/VerticalNavigationAvatar.js +0 -0
- package/{types → dist/types}/components/stream/AppSwitcher.d.ts +0 -0
- package/{types → dist/types}/components/stream/AppSwitcher.js +0 -0
- package/{types → dist/types}/index.d.ts +0 -0
- package/{types → dist/types}/index.js +0 -0
- package/{utils → dist/utils}/constants.d.ts +0 -0
- package/{utils → dist/utils}/constants.js +0 -0
- package/dist/utils/helpers.d.ts +21 -0
- package/dist/utils/helpers.js +64 -0
- package/{utils → dist/utils}/hooks.d.ts +0 -0
- package/{utils → dist/utils}/hooks.js +0 -0
- package/{utils → dist/utils}/index.d.ts +0 -0
- package/{utils → dist/utils}/index.js +0 -0
- package/{utils → dist/utils}/theme.d.ts +0 -0
- package/{utils → dist/utils}/theme.js +0 -0
- package/jest.config.ts +11 -0
- package/jest.setup.ts +5 -0
- package/{LICENSE → license} +0 -0
- package/merge.js +27 -0
- package/package.json +71 -4
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/assets/atoms.svg +5 -0
- package/public/assets/automation.svg +1 -0
- package/public/assets/avatar-1.jpg +0 -0
- package/public/assets/avatar-2.jpg +0 -0
- package/public/assets/avatar-3.jpg +0 -0
- package/public/assets/flux/icon-dark.svg +6 -0
- package/public/assets/flux/icon-light.svg +1 -0
- package/public/assets/flux/icon-white.svg +6 -0
- package/public/assets/flux/icon.svg +6 -0
- package/public/assets/flux/logo-dark.svg +22 -0
- package/public/assets/flux/logo-light.svg +1 -0
- package/public/assets/flux/logo-white.svg +22 -0
- package/public/assets/flux/logo.svg +22 -0
- package/public/assets/iPhone6.jpg +0 -0
- package/public/assets/iPhone6Plus.jpg +0 -0
- package/public/assets/lp-logo.png +0 -0
- package/public/assets/lplogo.svg +1 -0
- package/public/assets/molecules.svg +8 -0
- package/public/assets/organisms.svg +21 -0
- package/public/assets/pages.svg +4 -0
- package/public/assets/particles.svg +3 -0
- package/public/assets/stream-dark.png +0 -0
- package/public/assets/stream-suite-logo.svg +38 -0
- package/public/assets/stream-white.png +0 -0
- package/public/assets/stream.png +0 -0
- package/public/assets/templates.svg +3 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/public/site.webmanifest +1 -0
- package/{README.md → readme.md} +0 -0
- package/src/docs.tsx +167 -0
- package/src/lib/assets/Images.tsx +47 -0
- package/src/lib/assets/stream-suite-logo.svg +38 -0
- package/src/lib/components/atoms/Autocomplete/Autocomplete.test.tsx +179 -0
- package/src/lib/components/atoms/Autocomplete/Autocomplete.tsx +14 -0
- package/src/lib/components/atoms/Button/Button.test.tsx +166 -0
- package/src/lib/components/atoms/Button/Button.tsx +16 -0
- package/src/lib/components/atoms/Checkbox/Checkbox.test.tsx +85 -0
- package/src/lib/components/atoms/Checkbox/Checkbox.tsx +10 -0
- package/src/lib/components/atoms/IconButton/IconButton.test.tsx +60 -0
- package/src/lib/components/atoms/IconButton/IconButton.tsx +9 -0
- package/src/lib/components/atoms/Radio/Radio.test.tsx +136 -0
- package/src/lib/components/atoms/Radio/Radio.tsx +10 -0
- package/src/lib/components/atoms/Select/Select.test.tsx +158 -0
- package/src/lib/components/atoms/Select/Select.tsx +12 -0
- package/src/lib/components/atoms/Slider/Slider.test.tsx +103 -0
- package/src/lib/components/atoms/Slider/Slider.tsx +10 -0
- package/src/lib/components/atoms/Switch/Switch.test.tsx +96 -0
- package/src/lib/components/atoms/Switch/Switch.tsx +10 -0
- package/src/lib/components/atoms/TextField/TextField.test.tsx +131 -0
- package/src/lib/components/atoms/TextField/TextField.tsx +31 -0
- package/src/lib/components/atoms/ToggleButton/ToggleButton.test.tsx +122 -0
- package/src/lib/components/atoms/ToggleButton/ToggleButton.tsx +10 -0
- package/src/lib/components/datadisplay/Avatar/Avatar.test.tsx +187 -0
- package/src/lib/components/datadisplay/Avatar/Avatar.tsx +35 -0
- package/src/lib/components/datadisplay/Avatar/avatar-1.jpg +0 -0
- package/src/lib/components/datadisplay/Chip/Chip.test.tsx +82 -0
- package/src/lib/components/datadisplay/Chip/Chip.tsx +11 -0
- package/src/lib/components/datadisplay/List/List.test.tsx +168 -0
- package/src/lib/components/datadisplay/List/List.tsx +8 -0
- package/src/lib/components/datadisplay/Tooltip/Tooltip.test.tsx +98 -0
- package/src/lib/components/datadisplay/Tooltip/Tooltip.tsx +9 -0
- package/src/lib/components/feedback/Alert/Alert.test.tsx +139 -0
- package/src/lib/components/feedback/Alert/Alert.tsx +10 -0
- package/src/lib/components/landmarks/Header/Header.tsx +140 -0
- package/src/lib/components/landmarks/Header/HeaderActionButtons.tsx +117 -0
- package/src/lib/components/landmarks/Header/HeaderStyles.tsx +62 -0
- package/src/lib/components/navigation/Drawer/Drawer.test.tsx +95 -0
- package/src/lib/components/navigation/Drawer/Drawer.tsx +21 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigation.tsx +276 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationAvatar.tsx +334 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.tsx +77 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationDrawer.tsx +197 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.tsx +143 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.tsx +192 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.tsx +67 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.tsx +192 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.tsx +217 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationMotion.tsx +119 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.tsx +35 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationSearch.tsx +114 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationSearchStyles.tsx +47 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationStyles.tsx +320 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.tsx +59 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationToggleX.tsx +51 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigation.tsx +467 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationAvatar.tsx +208 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.tsx +75 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.tsx +196 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.tsx +94 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.tsx +212 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.tsx +240 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationMotion.tsx +119 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationStyles.tsx +303 -0
- package/src/lib/components/pages/ErrorPage/ErrorPage.test.tsx +78 -0
- package/src/lib/components/pages/ErrorPage/ErrorPage.tsx +50 -0
- package/src/lib/components/pages/ErrorPage/ErrorPageStyles.tsx +30 -0
- package/src/lib/components/pages/SideInSide/SideInSide.tsx +100 -0
- package/src/lib/components/pages/SideInSide/SideInSideStyles.tsx +62 -0
- package/src/lib/components/stream/AppSwitcher/AppSwitcher.tsx +392 -0
- package/src/lib/components/stream/AppSwitcher/AppSwitcherItem.tsx +83 -0
- package/src/lib/components/stream/AppSwitcher/AppSwitcherStyles.tsx +325 -0
- package/src/lib/components/stream/AppSwitcher/constants.tsx +28 -0
- package/src/lib/index.tsx +148 -0
- package/src/lib/lang/en-us.js +6 -0
- package/src/lib/types/components/navigation/VerticalNavigation.ts +52 -0
- package/src/lib/types/components/navigation/VerticalNavigationAvatar.ts +26 -0
- package/src/lib/types/components/stream/AppSwitcher.ts +10 -0
- package/src/lib/types/index.ts +9 -0
- package/src/lib/utils/constants.tsx +11 -0
- package/src/lib/utils/helpers.tsx +77 -0
- package/src/lib/utils/hooks.tsx +33 -0
- package/src/lib/utils/index.tsx +4 -0
- package/src/lib/utils/theme.tsx +79 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/setupTests.ts +5 -0
- package/src/stories/Components/DataDisplay/Avatar/Accessibility.stories.mdx +34 -0
- package/src/stories/Components/DataDisplay/Avatar/AllCombinations.tsx +56 -0
- package/src/stories/Components/DataDisplay/Avatar/Avatar.stories.tsx +19 -0
- package/src/stories/Components/DataDisplay/Avatar/Examples.stories.tsx +278 -0
- package/src/stories/Components/DataDisplay/Avatar/Overview.stories.mdx +47 -0
- package/src/stories/Components/DataDisplay/Chip/Accessibility.stories.mdx +29 -0
- package/src/stories/Components/DataDisplay/Chip/AllCombinations.tsx +58 -0
- package/src/stories/Components/DataDisplay/Chip/Chip.stories.tsx +21 -0
- package/src/stories/Components/DataDisplay/Chip/Examples.stories.tsx +126 -0
- package/src/stories/Components/DataDisplay/Chip/Overview.stories.mdx +57 -0
- package/src/stories/Components/DataDisplay/List/Accessibility.stories.mdx +54 -0
- package/src/stories/Components/DataDisplay/List/AllCombinations.tsx +396 -0
- package/src/stories/Components/DataDisplay/List/Examples.stories.tsx +501 -0
- package/src/stories/Components/DataDisplay/List/List.stories.tsx +35 -0
- package/src/stories/Components/DataDisplay/List/Overview.stories.mdx +69 -0
- package/src/stories/Components/DataDisplay/Table/Overview.stories.mdx +70 -0
- package/src/stories/Components/DataDisplay/Tooltip/Accessibility.stories.mdx +39 -0
- package/src/stories/Components/DataDisplay/Tooltip/AllCombinations.tsx +134 -0
- package/src/stories/Components/DataDisplay/Tooltip/Examples.stories.tsx +237 -0
- package/src/stories/Components/DataDisplay/Tooltip/Overview.stories.mdx +58 -0
- package/src/stories/Components/DataDisplay/Tooltip/Tooltip.stories.tsx +22 -0
- package/src/stories/Components/Feedback/Alert/Accessibility.stories.mdx +25 -0
- package/src/stories/Components/Feedback/Alert/Alert.stories.tsx +22 -0
- package/src/stories/Components/Feedback/Alert/AllCombinations.tsx +37 -0
- package/src/stories/Components/Feedback/Alert/Examples.stories.tsx +137 -0
- package/src/stories/Components/Feedback/Alert/Overview.stories.mdx +62 -0
- package/src/stories/Components/Inputs/Autocomplete/Accessibility.stories.mdx +31 -0
- package/src/stories/Components/Inputs/Autocomplete/AllCombinations.tsx +182 -0
- package/src/stories/Components/Inputs/Autocomplete/Autocomplete.stories.tsx +31 -0
- package/src/stories/Components/Inputs/Autocomplete/Examples.stories.tsx +233 -0
- package/src/stories/Components/Inputs/Autocomplete/Overview.stories.mdx +52 -0
- package/src/stories/Components/Inputs/Button/Accessibility.stories.mdx +52 -0
- package/src/stories/Components/Inputs/Button/AllCombinations.tsx +53 -0
- package/src/stories/Components/Inputs/Button/Button.stories.tsx +23 -0
- package/src/stories/Components/Inputs/Button/Examples.stories.tsx +190 -0
- package/src/stories/Components/Inputs/Button/Overview.stories.mdx +52 -0
- package/src/stories/Components/Inputs/Checkbox/Accessibility.stories.mdx +38 -0
- package/src/stories/Components/Inputs/Checkbox/AllCombinations.tsx +55 -0
- package/src/stories/Components/Inputs/Checkbox/Checkbox.stories.tsx +22 -0
- package/src/stories/Components/Inputs/Checkbox/Examples.stories.tsx +363 -0
- package/src/stories/Components/Inputs/Checkbox/Overview.stories.mdx +63 -0
- package/src/stories/Components/Inputs/IconButton/Examples.stories.tsx +24 -0
- package/src/stories/Components/Inputs/IconButton/IconButton.stories.tsx +26 -0
- package/src/stories/Components/Inputs/Radio/Accessibility.stories.mdx +61 -0
- package/src/stories/Components/Inputs/Radio/AllCombinations.tsx +75 -0
- package/src/stories/Components/Inputs/Radio/Examples.stories.tsx +333 -0
- package/src/stories/Components/Inputs/Radio/Overview.stories.mdx +74 -0
- package/src/stories/Components/Inputs/Radio/Radio.stories.tsx +22 -0
- package/src/stories/Components/Inputs/Select/Accessibility.stories.mdx +51 -0
- package/src/stories/Components/Inputs/Select/AllCombinations.tsx +63 -0
- package/src/stories/Components/Inputs/Select/Examples.stories.tsx +803 -0
- package/src/stories/Components/Inputs/Select/Overview.stories.mdx +73 -0
- package/src/stories/Components/Inputs/Select/Select.stories.tsx +22 -0
- package/src/stories/Components/Inputs/Slider/Accessibility.stories.mdx +43 -0
- package/src/stories/Components/Inputs/Slider/AllCombinations.tsx +30 -0
- package/src/stories/Components/Inputs/Slider/Examples.stories.tsx +146 -0
- package/src/stories/Components/Inputs/Slider/Overview.stories.mdx +59 -0
- package/src/stories/Components/Inputs/Slider/Slider.stories.tsx +27 -0
- package/src/stories/Components/Inputs/Switch/Accessibility.stories.mdx +34 -0
- package/src/stories/Components/Inputs/Switch/AllCombinations.tsx +45 -0
- package/src/stories/Components/Inputs/Switch/Examples.stories.tsx +213 -0
- package/src/stories/Components/Inputs/Switch/Overview.stories.mdx +62 -0
- package/src/stories/Components/Inputs/Switch/Switch.stories.tsx +22 -0
- package/src/stories/Components/Inputs/TextField/Accessibility.stories.mdx +29 -0
- package/src/stories/Components/Inputs/TextField/AllCombinations.tsx +57 -0
- package/src/stories/Components/Inputs/TextField/Examples.stories.tsx +127 -0
- package/src/stories/Components/Inputs/TextField/Overview.stories.mdx +60 -0
- package/src/stories/Components/Inputs/TextField/TextField.stories.tsx +261 -0
- package/src/stories/Components/Inputs/ToggleButton/Accessibility.stories.mdx +32 -0
- package/src/stories/Components/Inputs/ToggleButton/AllCombinations.tsx +113 -0
- package/src/stories/Components/Inputs/ToggleButton/Examples.stories.tsx +339 -0
- package/src/stories/Components/Inputs/ToggleButton/Overview.stories.mdx +55 -0
- package/src/stories/Components/Inputs/ToggleButton/ToggleButton.stories.tsx +19 -0
- package/src/stories/Components/Landmarks/Header/Examples.stories.tsx +197 -0
- package/src/stories/Components/Landmarks/Header/Header.stories.tsx +34 -0
- package/src/stories/Components/Landmarks/Header/Overview.stories.mdx +44 -0
- package/src/stories/Components/Navigation/Drawer/Accessibility.stories.mdx +13 -0
- package/src/stories/Components/Navigation/Drawer/Drawer.stories.tsx +80 -0
- package/src/stories/Components/Navigation/Drawer/Examples.stories.tsx +440 -0
- package/src/stories/Components/Navigation/Drawer/Overview.stories.mdx +43 -0
- package/src/stories/Components/Navigation/MobileNavigation/Accessibility.stories.mdx +14 -0
- package/src/stories/Components/Navigation/MobileNavigation/Examples.stories.tsx +384 -0
- package/src/stories/Components/Navigation/MobileNavigation/MobileNavigation.stories.tsx +24 -0
- package/src/stories/Components/Navigation/MobileNavigation/Overview.stories.mdx +47 -0
- package/src/stories/Components/Navigation/VerticalNavigation/Accessibility.stories.mdx +14 -0
- package/src/stories/Components/Navigation/VerticalNavigation/Examples.stories.tsx +307 -0
- package/src/stories/Components/Navigation/VerticalNavigation/Overview.stories.mdx +47 -0
- package/src/stories/Components/Navigation/VerticalNavigation/VerticalNavigation.stories.tsx +24 -0
- package/src/stories/ContactUs.stories.mdx +21 -0
- package/src/stories/Experimental/Test.stories.mdx +46 -0
- package/src/stories/GettingStarted/Designer.stories.mdx +86 -0
- package/src/stories/GettingStarted/Developer.stories.mdx +134 -0
- package/src/stories/Guidelines/Accessibility/AssistiveTechnology.stories.mdx +70 -0
- package/src/stories/Guidelines/Accessibility/ColorAndContrast.stories.mdx +109 -0
- package/src/stories/Guidelines/Accessibility/Hierarchy.stories.mdx +119 -0
- package/src/stories/Guidelines/Accessibility/Imagery.stories.mdx +136 -0
- package/src/stories/Guidelines/Accessibility/Overview.stories.mdx +44 -0
- package/src/stories/Guidelines/Accessibility/Principles.stories.mdx +156 -0
- package/src/stories/Guidelines/Accessibility/SoundAndMotion.stories.mdx +59 -0
- package/src/stories/Guidelines/Accessibility/Typography.stories.mdx +69 -0
- package/src/stories/Guidelines/Accessibility/Writing.stories.mdx +188 -0
- package/src/stories/Guidelines/Styleguide/ColorSwatch.tsx +53 -0
- package/src/stories/Guidelines/Styleguide/Colors.stories.mdx +118 -0
- package/src/stories/Guidelines/Styleguide/Typography.stories.mdx +84 -0
- package/src/stories/Introduction.stories.mdx +65 -0
- package/src/stories/Pages/ErrorPage.stories.tsx +30 -0
- package/src/stories/Pages/SideInSide.stories.tsx +195 -0
- package/src/stories/Roadmap.stories.mdx +19 -0
- package/src/stories/Templates/Login.stories.mdx +46 -0
- package/src/stories/assets/Atomic_Design_Icons-Dark.svg +24 -0
- package/src/stories/assets/Atomic_Design_Icons-Light.svg +25 -0
- package/src/stories/assets/accessibility-1.png +0 -0
- package/src/stories/assets/accessibility-2.png +0 -0
- package/src/stories/assets/accessibility-3.png +0 -0
- package/src/stories/assets/accessibility-banner.png +0 -0
- package/src/stories/assets/atoms.svg +6 -0
- package/src/stories/assets/design_system_2022-02-11_12.22pm.png +0 -0
- package/src/stories/assets/figma-tokens.png +0 -0
- package/src/stories/assets/hierarchy-1.jpg +0 -0
- package/src/stories/assets/hierarchy-2.jpg +0 -0
- package/src/stories/assets/hierarchy-3.jpg +0 -0
- package/src/stories/assets/icon-contrast-1.jpg +0 -0
- package/src/stories/assets/icon-contrast-2.jpg +0 -0
- package/src/stories/assets/imagery-1.png +0 -0
- package/src/stories/assets/imagery-2.png +0 -0
- package/src/stories/assets/imagery-3.png +0 -0
- package/src/stories/assets/imagery-4.jpg +0 -0
- package/src/stories/assets/molecules.svg +9 -0
- package/src/stories/assets/organisms.svg +22 -0
- package/src/stories/assets/pages.svg +5 -0
- package/src/stories/assets/particles.svg +4 -0
- package/src/stories/assets/templates.svg +4 -0
- package/src/stories/assets/testData.tsx +102 -0
- package/src/stories/assets/text-contrast-1.jpg +0 -0
- package/src/stories/assets/text-contrast-2.jpg +0 -0
- package/src/stories/assets/typography-1.png +0 -0
- package/src/stories/assets/visual-clues-1.png +0 -0
- package/src/stories/assets/visual-clues-2.png +0 -0
- package/src/stories/assets/writing-1.jpg +0 -0
- package/src/stories/assets/writing-2.png +0 -0
- package/src/stories/assets/writing-3.png +0 -0
- package/src/stories/assets/writing-4.png +0 -0
- package/src/stories/utils/CustomIcons.tsx +44 -0
- package/tsconfig.eslint.json +16 -0
- package/tsconfig.json +50 -0
- package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +0 -827
- package/components/navigation/MobileNavigation/MobileNavigationDrawer.js +0 -147
- package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +0 -392
- package/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.d.ts +0 -3
- package/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.js +0 -31
- package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +0 -257
- package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.d.ts +0 -3
- package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +0 -33
- package/components/navigation/MobileNavigation/MobileNavigationToggleX.d.ts +0 -3
- package/components/navigation/MobileNavigation/MobileNavigationToggleX.js +0 -27
- package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.d.ts +0 -36
- package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.js +0 -10
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +0 -827
- package/components/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +0 -88
- package/utils/helpers.d.ts +0 -6
- package/utils/helpers.js +0 -17
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
|
+
import { useTheme } from '@mui/material/styles'
|
|
3
|
+
import {
|
|
4
|
+
Avatar, List, Tooltip
|
|
5
|
+
} from '../../../index'
|
|
6
|
+
import { Box, Modal } from '@mui/material'
|
|
7
|
+
import { StreamSuiteLogo, NotchSVG, NotchExtendSVG } from '../../../assets/Images'
|
|
8
|
+
import AppSwitcher from '../../stream/AppSwitcher/AppSwitcher'
|
|
9
|
+
import { Apps, ChevronLeft, ChevronRight, PushPin } from '@mui/icons-material'
|
|
10
|
+
import VerticalNavigationItem from './VerticalNavigationItem/VerticalNavigationItem'
|
|
11
|
+
import {
|
|
12
|
+
DRAWER_WIDTH, DrawerHeader, DrawerToggle, DrawerToggleHitboxContent,
|
|
13
|
+
StyledDivider, StyledNav, StyledNavSecondary, DrawerShadow, StyledAside,
|
|
14
|
+
NotchContainer, NotchBackground, NotchBackgroundClip, NotchSeemMask,
|
|
15
|
+
StyledDrawer
|
|
16
|
+
} from './VerticalNavigationStyles'
|
|
17
|
+
import { ListItemText } from './VerticalNavigationItem/VerticalNavigationItemStyles'
|
|
18
|
+
import AvatarPanel from './VerticalNavigationAvatar'
|
|
19
|
+
import { motion } from '../../../utils/theme'
|
|
20
|
+
import { handleAvatarInitials, useFadeIn } from '../../../utils/helpers'
|
|
21
|
+
import { DEFAULT_REACT_APP_ID } from '../../../utils/constants'
|
|
22
|
+
import { IApplication, IAvatarMenuItemProps, IVerticalNavigationItemProps } from '../../../types'
|
|
23
|
+
import { animated } from '@react-spring/web'
|
|
24
|
+
|
|
25
|
+
interface VerticalNavigationProps {
|
|
26
|
+
logo?: string
|
|
27
|
+
logoText?: string
|
|
28
|
+
logoOnClick?: any
|
|
29
|
+
items?: IVerticalNavigationItemProps[]
|
|
30
|
+
secondaryItems?: IVerticalNavigationItemProps[]
|
|
31
|
+
hasStreamHome?: boolean
|
|
32
|
+
streamHomeAccessToken?: string
|
|
33
|
+
streamHomeBaseUrl?: string
|
|
34
|
+
streamHomeApiKey?: string
|
|
35
|
+
streamHomeApplications?: IApplication[]
|
|
36
|
+
avatarName?: string
|
|
37
|
+
isDrawerOpen?: boolean
|
|
38
|
+
isPersistent?: boolean
|
|
39
|
+
setIsPersistent?: any
|
|
40
|
+
appRootID?: string
|
|
41
|
+
|
|
42
|
+
// Avatar panel props
|
|
43
|
+
hasAvatar?: boolean
|
|
44
|
+
avatarPanelLogoutString?: string
|
|
45
|
+
avatarPanelOnClickSwitchDirection?: any
|
|
46
|
+
avatarPanelOnClickLogout?: any
|
|
47
|
+
avatarPanelOnClickViewProfile?: any
|
|
48
|
+
avatarPanelViewProfileString?: string
|
|
49
|
+
avatarPanelOnClickEditProfile?: any
|
|
50
|
+
avatarPanelEditProfileString?: string
|
|
51
|
+
avatarPanelMenuItems?: Array<IAvatarMenuItemProps>
|
|
52
|
+
avatarPanelOnClickMainAction?: any
|
|
53
|
+
avatarPanelMainActionString?: string
|
|
54
|
+
avatarPanelSettingItems?: Array<IAvatarMenuItemProps>
|
|
55
|
+
avatarPanelFootnote?: any
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const VerticalNavigation = (
|
|
59
|
+
props: VerticalNavigationProps
|
|
60
|
+
): React.ReactElement => {
|
|
61
|
+
const theme = useTheme()
|
|
62
|
+
const {
|
|
63
|
+
items, secondaryItems, logo, logoText, logoOnClick, appRootID,
|
|
64
|
+
hasStreamHome, streamHomeApiKey, streamHomeBaseUrl,
|
|
65
|
+
streamHomeAccessToken, streamHomeApplications, ...rest
|
|
66
|
+
} = props
|
|
67
|
+
const propIsDrawerOpen = typeof props?.isDrawerOpen === 'boolean' ? props.isDrawerOpen : undefined
|
|
68
|
+
const propIsPersistent = typeof props?.isPersistent === 'boolean' ? props.isPersistent : undefined
|
|
69
|
+
const avatarName = props?.avatarName ?? 'Avatar name'
|
|
70
|
+
|
|
71
|
+
const [isDrawerOpen, setIsDrawerOpen] = React.useState(propIsDrawerOpen ?? false)
|
|
72
|
+
const [isAvatarOpen, setIsAvatarOpen] = React.useState(false)
|
|
73
|
+
const [isPersistent, setIsPersistent] = React.useState(propIsPersistent ?? false)
|
|
74
|
+
|
|
75
|
+
// Controls whether the application panel is open or not.
|
|
76
|
+
const [isAppSwitcherOpen, setIsAppSwitcherOpen] = React.useState(false)
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Toggles display of the Stream suite application dialog.
|
|
80
|
+
*/
|
|
81
|
+
const handleToggleAppsClick = (): void => {
|
|
82
|
+
setIsAppSwitcherOpen(!isAppSwitcherOpen)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const logoHeight = 38
|
|
86
|
+
const logoWidth = 38
|
|
87
|
+
|
|
88
|
+
useEffect(() => setIsDrawerOpen(propIsDrawerOpen ?? false), [propIsDrawerOpen])
|
|
89
|
+
useEffect(() => setIsDrawerOpen(propIsPersistent ?? false), [propIsPersistent])
|
|
90
|
+
useEffect(() => setAvatarInitials(handleAvatarInitials(avatarName)), [avatarName])
|
|
91
|
+
|
|
92
|
+
// This fixes an issue with how MUI handles the modal and aria-hidden.
|
|
93
|
+
// When open, the Modal adds aria-hidden="true" to a top-level element,
|
|
94
|
+
// which causes some screen readers to annouce the elements as "blank".
|
|
95
|
+
// This fix just overrides the default aria-hidden attribute.
|
|
96
|
+
//
|
|
97
|
+
// https://github.com/mui/material-ui/issues/19450
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (isDrawerOpen) {
|
|
100
|
+
const root = window.document.getElementById(appRootID ?? DEFAULT_REACT_APP_ID)
|
|
101
|
+
root?.removeAttribute('aria-hidden')
|
|
102
|
+
}
|
|
103
|
+
}, [isDrawerOpen])
|
|
104
|
+
|
|
105
|
+
const handleIsPersistent = (): void => {
|
|
106
|
+
if (props?.setIsPersistent) {
|
|
107
|
+
props.setIsPersistent(!propIsPersistent ?? false)
|
|
108
|
+
setIsPersistent(!propIsPersistent ?? false)
|
|
109
|
+
return
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
setIsPersistent(propIsPersistent ?? false)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const [avatarInitials, setAvatarInitials] = React.useState(handleAvatarInitials(avatarName) ?? 'AN')
|
|
116
|
+
|
|
117
|
+
const toggleDrawer = (open: boolean) => (event: React.KeyboardEvent | React.MouseEvent) => {
|
|
118
|
+
event?.stopPropagation()
|
|
119
|
+
|
|
120
|
+
if (event.type === 'keydown') {
|
|
121
|
+
if ((event as React.KeyboardEvent).key === 'Tab' || (event as React.KeyboardEvent).key === 'Shift') {
|
|
122
|
+
return
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
setIsAppSwitcherOpen(false)
|
|
127
|
+
setIsDrawerOpen(open ?? !isDrawerOpen)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// First item starts at 70ms
|
|
131
|
+
// see STAGGER_ITEMS_DELAY in helpers.js
|
|
132
|
+
let animationCount = 1
|
|
133
|
+
const incrementAnimationCount = () => animationCount++
|
|
134
|
+
|
|
135
|
+
const listContent = (): React.ReactElement => (
|
|
136
|
+
<Box
|
|
137
|
+
sx={{
|
|
138
|
+
display: 'flex',
|
|
139
|
+
flex: '1 auto',
|
|
140
|
+
flexDirection: 'column',
|
|
141
|
+
justifyContent: 'flex-start',
|
|
142
|
+
'.wrapper': {
|
|
143
|
+
display: 'flex',
|
|
144
|
+
position: 'relative'
|
|
145
|
+
},
|
|
146
|
+
'.wrapper > :not(:first-child)': {
|
|
147
|
+
position: 'absolute',
|
|
148
|
+
right: 0,
|
|
149
|
+
background: 'transparent',
|
|
150
|
+
fontSize: 0
|
|
151
|
+
}
|
|
152
|
+
}}
|
|
153
|
+
className='grid-container'
|
|
154
|
+
>
|
|
155
|
+
<div
|
|
156
|
+
className='wrapper'
|
|
157
|
+
style={{
|
|
158
|
+
backgroundColor: theme.palette.mode === 'dark'
|
|
159
|
+
? theme.palette.primary.main
|
|
160
|
+
: theme.palette.background.paper
|
|
161
|
+
}}
|
|
162
|
+
>
|
|
163
|
+
<DrawerHeader
|
|
164
|
+
onClick={logoOnClick ?? null}
|
|
165
|
+
isDrawerOpen={isDrawerOpen || isPersistent}
|
|
166
|
+
style={useFadeIn(animationCount, incrementAnimationCount)}
|
|
167
|
+
>
|
|
168
|
+
<Tooltip
|
|
169
|
+
disableHoverListener={isDrawerOpen || isPersistent}
|
|
170
|
+
disableFocusListener={isDrawerOpen || isPersistent}
|
|
171
|
+
disableTouchListener={isDrawerOpen || isPersistent}
|
|
172
|
+
title={logoText ?? ''}
|
|
173
|
+
placement={theme.direction === 'rtl' ? 'left' : 'right'}
|
|
174
|
+
>
|
|
175
|
+
{logo
|
|
176
|
+
? typeof logo === 'string'
|
|
177
|
+
? (
|
|
178
|
+
<img
|
|
179
|
+
src={logo}
|
|
180
|
+
height={`${logoHeight}px`}
|
|
181
|
+
width={`${logoWidth}px`}
|
|
182
|
+
style={{
|
|
183
|
+
marginRight: '16px'
|
|
184
|
+
}}
|
|
185
|
+
alt="Site Logo"
|
|
186
|
+
/>)
|
|
187
|
+
: logo
|
|
188
|
+
: (
|
|
189
|
+
<StreamSuiteLogo style={{
|
|
190
|
+
height: `${logoHeight}px`,
|
|
191
|
+
width: `${logoWidth}px`,
|
|
192
|
+
marginRight: '16px',
|
|
193
|
+
fill: theme.palette.mode === 'dark'
|
|
194
|
+
? theme.palette.primary.contrastText
|
|
195
|
+
: theme.palette.primary.main
|
|
196
|
+
}} />)}
|
|
197
|
+
</Tooltip>
|
|
198
|
+
<ListItemText primary={logoText ?? ''} isDrawerOpen={isDrawerOpen || isPersistent} />
|
|
199
|
+
</DrawerHeader>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<div className='wrapper'>
|
|
203
|
+
<NotchContainer sx={{ height: '85px', position: 'relative !important' }}>
|
|
204
|
+
<NotchBackground />
|
|
205
|
+
{!isPersistent && <NotchBackgroundClip />}
|
|
206
|
+
<NotchSeemMask />
|
|
207
|
+
</NotchContainer>
|
|
208
|
+
{!isPersistent && <DrawerToggle
|
|
209
|
+
onClick={toggleDrawer(!isDrawerOpen)}
|
|
210
|
+
aria-label={isDrawerOpen ? 'Close Navigation' : 'Open Navigation'}
|
|
211
|
+
aria-expanded={isDrawerOpen ? 'true' : 'false'}
|
|
212
|
+
aria-controls="vertical-navigation"
|
|
213
|
+
// @ts-expect-error
|
|
214
|
+
component={animated.button}
|
|
215
|
+
style={{
|
|
216
|
+
...useFadeIn(animationCount, incrementAnimationCount),
|
|
217
|
+
transform: 'translate(22px, calc(50% - 5.5px))'
|
|
218
|
+
}}
|
|
219
|
+
>
|
|
220
|
+
<DrawerToggleHitboxContent>
|
|
221
|
+
{isDrawerOpen
|
|
222
|
+
? (
|
|
223
|
+
<ChevronLeft style={{
|
|
224
|
+
fontSize: '1.75rem',
|
|
225
|
+
height: '1.75rem',
|
|
226
|
+
width: '1.75rem'
|
|
227
|
+
}} />)
|
|
228
|
+
: (
|
|
229
|
+
<ChevronRight style={{
|
|
230
|
+
fontSize: '1.75rem',
|
|
231
|
+
height: '1.75rem',
|
|
232
|
+
width: '1.75rem'
|
|
233
|
+
}} />)}
|
|
234
|
+
</DrawerToggleHitboxContent>
|
|
235
|
+
</DrawerToggle>}
|
|
236
|
+
|
|
237
|
+
<Box style={{
|
|
238
|
+
borderRadius: '50%',
|
|
239
|
+
boxShadow: '5px 0 15px 0 rgb(0 0 0 / 10%)',
|
|
240
|
+
display: 'none',
|
|
241
|
+
height: '50px',
|
|
242
|
+
left: '12px',
|
|
243
|
+
position: 'fixed',
|
|
244
|
+
right: 'auto !important',
|
|
245
|
+
top: '50%',
|
|
246
|
+
transform: 'translate(50%, -50%)',
|
|
247
|
+
width: '50px'
|
|
248
|
+
}} />
|
|
249
|
+
<DrawerToggle
|
|
250
|
+
onClick={handleIsPersistent}
|
|
251
|
+
aria-label={isDrawerOpen ? 'Close Navigation' : 'Open Navigation'}
|
|
252
|
+
aria-expanded={isDrawerOpen ? 'true' : 'false'}
|
|
253
|
+
aria-controls="vertical-navigation"
|
|
254
|
+
style={{
|
|
255
|
+
display: 'none',
|
|
256
|
+
position: 'fixed',
|
|
257
|
+
top: '50%',
|
|
258
|
+
transform: 'translate(50%, -50%)',
|
|
259
|
+
zIndex: 10
|
|
260
|
+
}}
|
|
261
|
+
>
|
|
262
|
+
<NotchExtendSVG style={{
|
|
263
|
+
display: 'block',
|
|
264
|
+
fill: theme.palette.mode === 'dark'
|
|
265
|
+
? theme.palette.primary.main
|
|
266
|
+
: theme.palette.background.paper,
|
|
267
|
+
height: '165px',
|
|
268
|
+
left: '-12px',
|
|
269
|
+
padding: '0',
|
|
270
|
+
position: 'absolute',
|
|
271
|
+
top: '-61px',
|
|
272
|
+
transition: 'none',
|
|
273
|
+
width: '90px',
|
|
274
|
+
zIndex: '-1'
|
|
275
|
+
}} />
|
|
276
|
+
<DrawerToggleHitboxContent style={{
|
|
277
|
+
background: 'transparent',
|
|
278
|
+
boxShadow: 'none',
|
|
279
|
+
fontSize: '1.3rem',
|
|
280
|
+
height: '1.3rem',
|
|
281
|
+
padding: theme.spacing(1),
|
|
282
|
+
width: '1.3rem'
|
|
283
|
+
}}>
|
|
284
|
+
{isPersistent
|
|
285
|
+
? (
|
|
286
|
+
<PushPin style={{
|
|
287
|
+
fontSize: '1.3rem',
|
|
288
|
+
height: '1.3rem',
|
|
289
|
+
width: '1.3rem'
|
|
290
|
+
}} />)
|
|
291
|
+
: (
|
|
292
|
+
<PushPin style={{
|
|
293
|
+
fontSize: '1.3rem',
|
|
294
|
+
height: '1.3rem',
|
|
295
|
+
width: '1.3rem'
|
|
296
|
+
}} />)}
|
|
297
|
+
</DrawerToggleHitboxContent>
|
|
298
|
+
</DrawerToggle>
|
|
299
|
+
</div>
|
|
300
|
+
|
|
301
|
+
<NotchSVG style={{ height: '0', position: 'absolute', width: '0' }} />
|
|
302
|
+
|
|
303
|
+
<div
|
|
304
|
+
className='wrapper'
|
|
305
|
+
style={{
|
|
306
|
+
backgroundColor: theme.palette.mode === 'dark'
|
|
307
|
+
? theme.palette.primary.main
|
|
308
|
+
: theme.palette.background.paper,
|
|
309
|
+
flex: '1 1px',
|
|
310
|
+
overflow: 'auto',
|
|
311
|
+
position: 'relative'
|
|
312
|
+
}}
|
|
313
|
+
>
|
|
314
|
+
<StyledNav tabIndex={-1} aria-label='Primary'>
|
|
315
|
+
<List
|
|
316
|
+
style={{
|
|
317
|
+
height: '100%',
|
|
318
|
+
width: DRAWER_WIDTH.Expanded,
|
|
319
|
+
marginTop: `-${theme.spacing(0.5)} !important`
|
|
320
|
+
}}
|
|
321
|
+
>
|
|
322
|
+
{items && items.length > 0 && items.map((item, index) => (
|
|
323
|
+
<VerticalNavigationItem
|
|
324
|
+
{...item}
|
|
325
|
+
index={index}
|
|
326
|
+
isDrawerOpen={isDrawerOpen || isPersistent}
|
|
327
|
+
style={useFadeIn(animationCount, incrementAnimationCount)}
|
|
328
|
+
/>
|
|
329
|
+
))}
|
|
330
|
+
</List>
|
|
331
|
+
</StyledNav>
|
|
332
|
+
</div>
|
|
333
|
+
|
|
334
|
+
<div
|
|
335
|
+
className='wrapper'
|
|
336
|
+
style={{
|
|
337
|
+
backgroundColor: theme.palette.mode === 'dark'
|
|
338
|
+
? theme.palette.primary.main
|
|
339
|
+
: theme.palette.background.paper
|
|
340
|
+
}}
|
|
341
|
+
>
|
|
342
|
+
<StyledNavSecondary
|
|
343
|
+
aria-label='Secondary'
|
|
344
|
+
// style={{ height: secondaryItems && secondaryItems.length > 0 ? `${logoHeight * (secondaryItems.length + 1)}px` : logoHeight }}
|
|
345
|
+
>
|
|
346
|
+
<StyledDivider isDrawerOpen={isDrawerOpen || isPersistent}/>
|
|
347
|
+
<List
|
|
348
|
+
style={{
|
|
349
|
+
width: DRAWER_WIDTH.Expanded,
|
|
350
|
+
backgroundColor: theme.palette.mode === 'dark'
|
|
351
|
+
? theme.palette.primary.main
|
|
352
|
+
: theme.palette.background.paper
|
|
353
|
+
}}
|
|
354
|
+
>
|
|
355
|
+
{hasStreamHome
|
|
356
|
+
? (
|
|
357
|
+
<VerticalNavigationItem
|
|
358
|
+
label='App Switcher'
|
|
359
|
+
icon={<Apps />}
|
|
360
|
+
onClick={handleToggleAppsClick}
|
|
361
|
+
content={(
|
|
362
|
+
<AppSwitcher
|
|
363
|
+
isAppSwitcherOpen={isAppSwitcherOpen}
|
|
364
|
+
setIsAppSwitcherOpen={setIsAppSwitcherOpen}
|
|
365
|
+
applications={streamHomeApplications}
|
|
366
|
+
apiKey={streamHomeApiKey ?? ''}
|
|
367
|
+
baseUrl={streamHomeBaseUrl ?? ''}
|
|
368
|
+
token={streamHomeAccessToken ?? ''}
|
|
369
|
+
isDrawerOpen={isDrawerOpen}
|
|
370
|
+
/>
|
|
371
|
+
)}
|
|
372
|
+
isDrawerOpen={isDrawerOpen || isPersistent}
|
|
373
|
+
isSecondary
|
|
374
|
+
hasCustomContent
|
|
375
|
+
style={useFadeIn(animationCount, incrementAnimationCount)}
|
|
376
|
+
/>
|
|
377
|
+
)
|
|
378
|
+
: null}
|
|
379
|
+
|
|
380
|
+
{secondaryItems && secondaryItems.length > 0 && secondaryItems.map((item, index) => (
|
|
381
|
+
<VerticalNavigationItem
|
|
382
|
+
{...item}
|
|
383
|
+
index={index}
|
|
384
|
+
isDrawerOpen={isDrawerOpen || isPersistent}
|
|
385
|
+
isSecondary
|
|
386
|
+
style={useFadeIn(animationCount, incrementAnimationCount)}
|
|
387
|
+
/>
|
|
388
|
+
))}
|
|
389
|
+
|
|
390
|
+
{avatarName
|
|
391
|
+
? (
|
|
392
|
+
<VerticalNavigationItem
|
|
393
|
+
label={avatarName}
|
|
394
|
+
aria-controls='avatar-panel'
|
|
395
|
+
icon={<Avatar
|
|
396
|
+
style={{
|
|
397
|
+
// backgroundColor: mainTheme.colorButtonText,
|
|
398
|
+
// color: mainTheme.colorButton,
|
|
399
|
+
fontSize: '0.75rem',
|
|
400
|
+
height: 32,
|
|
401
|
+
width: 32
|
|
402
|
+
}}
|
|
403
|
+
>
|
|
404
|
+
{avatarInitials}
|
|
405
|
+
</Avatar>}
|
|
406
|
+
style={{
|
|
407
|
+
maxHeight: isDrawerOpen ? '200px' : '48px',
|
|
408
|
+
overflow: 'hidden',
|
|
409
|
+
padding: 0,
|
|
410
|
+
minHeight: 52,
|
|
411
|
+
transition: `max-height 225ms ${motion.easeInOut} 0ms !important`,
|
|
412
|
+
...useFadeIn(animationCount, incrementAnimationCount)
|
|
413
|
+
}}
|
|
414
|
+
onClick={() => setIsAvatarOpen(!isAvatarOpen)}
|
|
415
|
+
hasFlyout
|
|
416
|
+
fullHeightFlyout
|
|
417
|
+
content={<AvatarPanel
|
|
418
|
+
avatarName={avatarName}
|
|
419
|
+
isAvatarOpen={isAvatarOpen}
|
|
420
|
+
{...rest}
|
|
421
|
+
/>}
|
|
422
|
+
isDrawerOpen={isDrawerOpen}
|
|
423
|
+
/>)
|
|
424
|
+
: null}
|
|
425
|
+
</List>
|
|
426
|
+
</StyledNavSecondary>
|
|
427
|
+
</div>
|
|
428
|
+
{/* <NotchBackgroundSVG style={{ height: '0', position: 'absolute', width: '0' }} />
|
|
429
|
+
|
|
430
|
+
<svg id='notch-background-svg' viewBox="0 0 25 865" xmlns="http://www.w3.org/2000/svg" style={{ height: '0', position: 'absolute', width: '0' }}>
|
|
431
|
+
<path fill={theme.palette.mode === 'dark' ? theme.palette.primary.main : theme.palette.background.paper} fill-rule="evenodd" clip-rule="evenodd" d="M25 0H0V865H25V468.5V466.451C24.6432 460.704 21.3624 455.984 18.6792 453.948C9.58731 451.059 3 442.549 3 432.5C3 422.927 8.97844 414.75 17.4054 411.5H17C19.7393 410.587 24.563 405.088 25 398.049V396V0Z" />
|
|
432
|
+
</svg> */}
|
|
433
|
+
</Box>
|
|
434
|
+
)
|
|
435
|
+
|
|
436
|
+
return (
|
|
437
|
+
<StyledAside aria-label="Site navigation">
|
|
438
|
+
<DrawerShadow
|
|
439
|
+
className='drawerShadow'
|
|
440
|
+
aria-hidden='true'
|
|
441
|
+
isDrawerOpen={isDrawerOpen || isPersistent}
|
|
442
|
+
style={{
|
|
443
|
+
display: isPersistent ? 'none' : 'block'
|
|
444
|
+
}}
|
|
445
|
+
/>
|
|
446
|
+
<Modal
|
|
447
|
+
aria-hidden={false}
|
|
448
|
+
keepMounted={true}
|
|
449
|
+
disablePortal={true}
|
|
450
|
+
open={isDrawerOpen}
|
|
451
|
+
onClose={toggleDrawer(false)}
|
|
452
|
+
>
|
|
453
|
+
<StyledDrawer
|
|
454
|
+
id='vertical-navigation'
|
|
455
|
+
anchor='left'
|
|
456
|
+
open={isDrawerOpen || isPersistent}
|
|
457
|
+
onClose={toggleDrawer(false)}
|
|
458
|
+
variant='permanent'
|
|
459
|
+
>
|
|
460
|
+
{listContent()}
|
|
461
|
+
</StyledDrawer>
|
|
462
|
+
</Modal>
|
|
463
|
+
</StyledAside>
|
|
464
|
+
)
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
export default VerticalNavigation
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
Box, ButtonGroup, Button, Link,
|
|
4
|
+
List, ListItem, ListItemIcon, ListItemText
|
|
5
|
+
} from '../../../index'
|
|
6
|
+
import {
|
|
7
|
+
StyledBox, StyledBoxProfile,
|
|
8
|
+
StyledAvatarName, StyledAvatar, StyledOutlineButton,
|
|
9
|
+
StyledBoxProfileEdit, StyledListItemButton
|
|
10
|
+
} from './VerticalNavigationAvatarStyles'
|
|
11
|
+
import { useTheme } from '@mui/material/styles'
|
|
12
|
+
import EditIcon from '@mui/icons-material/Edit'
|
|
13
|
+
import LogoutIcon from '@mui/icons-material/Logout'
|
|
14
|
+
import { handleAvatarInitials, useStaggerAnimation } from '../../../utils/helpers'
|
|
15
|
+
import { Person, Settings } from '@mui/icons-material'
|
|
16
|
+
import { IAvatarMenuItemProps, IAvatarPanelProps } from '../../../types'
|
|
17
|
+
import { animated } from '@react-spring/web'
|
|
18
|
+
|
|
19
|
+
const AvatarPanel = (
|
|
20
|
+
props: IAvatarPanelProps
|
|
21
|
+
): React.ReactElement => {
|
|
22
|
+
const theme = useTheme()
|
|
23
|
+
const {
|
|
24
|
+
avatarName, avatarPanelOnClickLogout, avatarPanelLogoutString,
|
|
25
|
+
avatarPanelOnClickViewProfile, avatarPanelViewProfileString,
|
|
26
|
+
avatarPanelOnClickEditProfile, avatarPanelEditProfileString,
|
|
27
|
+
avatarPanelMenuItems, avatarPanelOnClickMainAction,
|
|
28
|
+
avatarPanelMainActionString, avatarPanelSettingItems,
|
|
29
|
+
avatarPanelFootnote, isAvatarOpen
|
|
30
|
+
} = props
|
|
31
|
+
|
|
32
|
+
useEffect(() => setAvatarInitials(handleAvatarInitials(avatarName)), [
|
|
33
|
+
avatarName
|
|
34
|
+
])
|
|
35
|
+
|
|
36
|
+
const [avatarInitials, setAvatarInitials] = React.useState(
|
|
37
|
+
handleAvatarInitials(avatarName) ?? 'AN'
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
// First item starts at 70ms
|
|
41
|
+
// see STAGGER_ITEMS_DELAY in helpers.js
|
|
42
|
+
let animationCount = 1
|
|
43
|
+
const incrementAnimationCount = () => animationCount++
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<StyledBox>
|
|
47
|
+
{avatarPanelOnClickLogout && (
|
|
48
|
+
<Button
|
|
49
|
+
// @ts-expect-error
|
|
50
|
+
component={animated.button}
|
|
51
|
+
style={{
|
|
52
|
+
left: theme.direction === 'rtl' ? theme.spacing(1) : 'auto',
|
|
53
|
+
position: 'absolute',
|
|
54
|
+
right: theme.direction === 'rtl' ? 'auto' : theme.spacing(1),
|
|
55
|
+
top: theme.spacing(1),
|
|
56
|
+
...useStaggerAnimation(isAvatarOpen, animationCount, incrementAnimationCount)
|
|
57
|
+
}}
|
|
58
|
+
onClick={avatarPanelOnClickLogout}
|
|
59
|
+
startIcon={<LogoutIcon />}
|
|
60
|
+
variant='text'
|
|
61
|
+
color='inherit'
|
|
62
|
+
>
|
|
63
|
+
{avatarPanelLogoutString ?? 'Logout'}
|
|
64
|
+
</Button>
|
|
65
|
+
)}
|
|
66
|
+
|
|
67
|
+
<Box
|
|
68
|
+
style={{
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
display: 'flex',
|
|
71
|
+
flexDirection: 'column'
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
<StyledBoxProfile style={useStaggerAnimation(isAvatarOpen, animationCount, incrementAnimationCount)}>
|
|
75
|
+
<StyledAvatar style={{ marginRight: '0.5rem' }}>
|
|
76
|
+
{avatarInitials}
|
|
77
|
+
</StyledAvatar>
|
|
78
|
+
<StyledAvatarName>
|
|
79
|
+
<span style={{ fontWeight: 300 }}>
|
|
80
|
+
Hi,</span> <strong>{avatarName.split(' ')[0]}
|
|
81
|
+
</strong>
|
|
82
|
+
</StyledAvatarName>
|
|
83
|
+
</StyledBoxProfile>
|
|
84
|
+
|
|
85
|
+
{avatarPanelOnClickViewProfile && (
|
|
86
|
+
<StyledBoxProfileEdit
|
|
87
|
+
style={{
|
|
88
|
+
flexDirection: 'row',
|
|
89
|
+
marginBottom: theme.spacing(2),
|
|
90
|
+
...useStaggerAnimation(isAvatarOpen, animationCount, incrementAnimationCount)
|
|
91
|
+
}}>
|
|
92
|
+
<ButtonGroup variant="contained" aria-label="split button">
|
|
93
|
+
<Button
|
|
94
|
+
variant='contained'
|
|
95
|
+
color='primary'
|
|
96
|
+
size='medium'
|
|
97
|
+
onClick={avatarPanelOnClickViewProfile}
|
|
98
|
+
startIcon={<Person />}
|
|
99
|
+
>{avatarPanelViewProfileString ?? 'View Profile'}</Button>
|
|
100
|
+
{avatarPanelOnClickEditProfile && (
|
|
101
|
+
<Button
|
|
102
|
+
size='medium'
|
|
103
|
+
aria-label={avatarPanelEditProfileString ?? 'Edit Profile'}
|
|
104
|
+
onClick={avatarPanelOnClickEditProfile}
|
|
105
|
+
>
|
|
106
|
+
<EditIcon />
|
|
107
|
+
</Button>
|
|
108
|
+
)}
|
|
109
|
+
</ButtonGroup>
|
|
110
|
+
</StyledBoxProfileEdit>
|
|
111
|
+
)}
|
|
112
|
+
</Box>
|
|
113
|
+
|
|
114
|
+
<Box
|
|
115
|
+
style={{
|
|
116
|
+
alignItems: 'center',
|
|
117
|
+
display: 'flex',
|
|
118
|
+
flexDirection: 'column'
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
{avatarPanelMenuItems && avatarPanelMenuItems.length > 0 && (
|
|
122
|
+
<List style={{
|
|
123
|
+
marginBottom: theme.spacing(2),
|
|
124
|
+
maxWidth: '14rem'
|
|
125
|
+
}}>
|
|
126
|
+
{avatarPanelMenuItems.map((avatarMenuItem: IAvatarMenuItemProps) => (
|
|
127
|
+
<ListItem
|
|
128
|
+
component={animated.div}
|
|
129
|
+
style={useStaggerAnimation(isAvatarOpen, animationCount, incrementAnimationCount)}
|
|
130
|
+
// whileHover={motionWhileHover}
|
|
131
|
+
// whileTap={motionWhileTap}
|
|
132
|
+
disablePadding
|
|
133
|
+
>
|
|
134
|
+
<StyledListItemButton
|
|
135
|
+
// TODO: figure out if these are links or buttons
|
|
136
|
+
// @ts-expect-error
|
|
137
|
+
component={Link}
|
|
138
|
+
role='link'
|
|
139
|
+
onClick={avatarMenuItem.onClick}
|
|
140
|
+
>
|
|
141
|
+
<ListItemIcon
|
|
142
|
+
aria-hidden={true}
|
|
143
|
+
style={{
|
|
144
|
+
minWidth: theme.spacing(5)
|
|
145
|
+
}}
|
|
146
|
+
>
|
|
147
|
+
{avatarMenuItem.icon}
|
|
148
|
+
</ListItemIcon>
|
|
149
|
+
<ListItemText primary={avatarMenuItem.label} />
|
|
150
|
+
</StyledListItemButton>
|
|
151
|
+
</ListItem>
|
|
152
|
+
))}
|
|
153
|
+
</List>
|
|
154
|
+
)}
|
|
155
|
+
|
|
156
|
+
{avatarPanelOnClickMainAction && <StyledOutlineButton
|
|
157
|
+
// @ts-expect-error
|
|
158
|
+
component={animated.button}
|
|
159
|
+
style={useStaggerAnimation(isAvatarOpen, animationCount, incrementAnimationCount)}
|
|
160
|
+
disablePadding
|
|
161
|
+
variant='outlined'
|
|
162
|
+
color='primary'
|
|
163
|
+
size='medium'
|
|
164
|
+
onClick={avatarPanelOnClickMainAction}
|
|
165
|
+
startIcon={<Settings />}
|
|
166
|
+
>{avatarPanelMainActionString}</StyledOutlineButton>}
|
|
167
|
+
|
|
168
|
+
<List style={{ marginBottom: theme.spacing(2) }}>
|
|
169
|
+
{avatarPanelSettingItems &&
|
|
170
|
+
avatarPanelSettingItems.length > 0 &&
|
|
171
|
+
avatarPanelSettingItems.map((avatarMenuItem: IAvatarMenuItemProps) => (
|
|
172
|
+
<ListItem
|
|
173
|
+
component={animated.div}
|
|
174
|
+
style={useStaggerAnimation(isAvatarOpen, animationCount, incrementAnimationCount)}
|
|
175
|
+
// whileHover={motionWhileHover}
|
|
176
|
+
// whileTap={motionWhileTap}
|
|
177
|
+
disablePadding
|
|
178
|
+
>
|
|
179
|
+
<StyledListItemButton
|
|
180
|
+
// TODO: figure out if these are links or buttons
|
|
181
|
+
// @ts-expect-error
|
|
182
|
+
component={Link}
|
|
183
|
+
role='link'
|
|
184
|
+
onClick={avatarMenuItem.onClick}
|
|
185
|
+
>
|
|
186
|
+
<ListItemIcon
|
|
187
|
+
aria-hidden={true}
|
|
188
|
+
style={{
|
|
189
|
+
minWidth: theme.spacing(5)
|
|
190
|
+
}}
|
|
191
|
+
>
|
|
192
|
+
{avatarMenuItem.icon}
|
|
193
|
+
</ListItemIcon>
|
|
194
|
+
<ListItemText primary={avatarMenuItem.label} />
|
|
195
|
+
</StyledListItemButton>
|
|
196
|
+
</ListItem>
|
|
197
|
+
))}
|
|
198
|
+
</List>
|
|
199
|
+
</Box>
|
|
200
|
+
|
|
201
|
+
<Box className='avatar-panel-footnote'>
|
|
202
|
+
{avatarPanelFootnote && avatarPanelFootnote}
|
|
203
|
+
</Box>
|
|
204
|
+
</StyledBox>
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export default AvatarPanel
|