@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,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Avatar, Button,
|
|
3
|
+
ListItemButton, Typography
|
|
4
|
+
} from '../../../index'
|
|
5
|
+
import { Drawer } from '@mui/material'
|
|
6
|
+
import { styled } from '@mui/material/styles'
|
|
7
|
+
import { animated } from '@react-spring/web'
|
|
8
|
+
|
|
9
|
+
export const StyledSwipeableAvatar = styled(Drawer)`
|
|
10
|
+
.MuiPaper-root {
|
|
11
|
+
color: ${props => props.theme.palette.mode === 'dark'
|
|
12
|
+
? props.theme.palette.primary.contrastText
|
|
13
|
+
: props.theme.palette.text.primary};
|
|
14
|
+
height: 100vh;
|
|
15
|
+
border: none;
|
|
16
|
+
z-index: 1;
|
|
17
|
+
}
|
|
18
|
+
`
|
|
19
|
+
|
|
20
|
+
export const StyledBox = styled(animated.div)`
|
|
21
|
+
align-items: center;
|
|
22
|
+
background-color: ${props => props.theme.palette.mode === 'dark'
|
|
23
|
+
? props.theme.palette.primary.dark
|
|
24
|
+
: '#E6EAF0'};
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
font-family: ${props => props.theme.typography.fontFamily};
|
|
28
|
+
height: 100%;
|
|
29
|
+
justify-content: flex-start;
|
|
30
|
+
overflow: auto;
|
|
31
|
+
padding: 15vh ${props => props.theme.spacing(2)};
|
|
32
|
+
position: relative;
|
|
33
|
+
`
|
|
34
|
+
|
|
35
|
+
export const StyledBoxProfile = styled(animated.div)`
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: row;
|
|
38
|
+
align-items: center;
|
|
39
|
+
margin-bottom: 2rem;
|
|
40
|
+
`
|
|
41
|
+
|
|
42
|
+
export const StyledBoxProfileEdit = styled(animated.div)`
|
|
43
|
+
display: flex;
|
|
44
|
+
`
|
|
45
|
+
|
|
46
|
+
export const StyledAvatarName = styled(Typography)`
|
|
47
|
+
color: ${props => props.theme.palette.mode === 'dark'
|
|
48
|
+
? props.theme.palette.primary.contrastText
|
|
49
|
+
: props.theme.palette.text.primary};
|
|
50
|
+
font-size: 1.75rem;
|
|
51
|
+
`
|
|
52
|
+
|
|
53
|
+
export const StyledOutlineButton = styled(Button)`
|
|
54
|
+
border-color: ${props => props.theme.palette.mode === 'dark'
|
|
55
|
+
? props.theme.palette.primary.contrastText
|
|
56
|
+
: props.theme.palette.primary.main};
|
|
57
|
+
color: ${props => props.theme.palette.mode === 'dark'
|
|
58
|
+
? props.theme.palette.primary.contrastText
|
|
59
|
+
: props.theme.palette.primary.main};
|
|
60
|
+
`
|
|
61
|
+
|
|
62
|
+
export const StyledAvatar = styled(Avatar)`
|
|
63
|
+
background-color: ${props => props.theme.palette.mode === 'dark'
|
|
64
|
+
? props.theme.palette.primary.contrastText
|
|
65
|
+
: props.theme.palette.primary.main};
|
|
66
|
+
color: ${props => props.theme.palette.mode === 'dark'
|
|
67
|
+
? props.theme.palette.primary.main
|
|
68
|
+
: props.theme.palette.primary.contrastText};
|
|
69
|
+
font-size: 0.85rem;
|
|
70
|
+
`
|
|
71
|
+
|
|
72
|
+
export const StyledListItemButton = styled(ListItemButton)`
|
|
73
|
+
border-radius: 50px;
|
|
74
|
+
white-space: normal;
|
|
75
|
+
`
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useTheme } from '@mui/material/styles'
|
|
3
|
+
import {
|
|
4
|
+
Link, List, Tooltip, Collapse
|
|
5
|
+
} from '../../../../index'
|
|
6
|
+
import MailIcon from '@mui/icons-material/Mail'
|
|
7
|
+
import {
|
|
8
|
+
ListItem, ListItemButton, ListItemButtonChild,
|
|
9
|
+
ListItemIcon, ListItemText
|
|
10
|
+
} from './VerticalNavigationItemStyles'
|
|
11
|
+
import { tooltipDelay } from '../../../../utils/theme'
|
|
12
|
+
import VerticalNavigationItemFlyoutMenu from './VerticalNavigationItemFlyoutMenu'
|
|
13
|
+
import { IVerticalNavigationItemProps } from '../../../../types'
|
|
14
|
+
import { animated } from '@react-spring/web'
|
|
15
|
+
|
|
16
|
+
const VerticalNavigationItem = (
|
|
17
|
+
props: IVerticalNavigationItemProps
|
|
18
|
+
): React.ReactElement => {
|
|
19
|
+
const theme = useTheme()
|
|
20
|
+
const {
|
|
21
|
+
label, icon, onClick, isActive, children, isDrawerOpen,
|
|
22
|
+
index, hasFlyout, fullHeightFlyout, isSecondary,
|
|
23
|
+
content, style, hasCustomContent, ...rest
|
|
24
|
+
} = props
|
|
25
|
+
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null)
|
|
26
|
+
const open = Boolean(anchorEl)
|
|
27
|
+
const handlePopoverOpen = (event: (React.MouseEvent<HTMLElement> | any)): void => {
|
|
28
|
+
if (open) {
|
|
29
|
+
handlePopoverClose()
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
setAnchorEl(event?.currentTarget)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const handlePopoverClose = (): void => {
|
|
37
|
+
setAnchorEl(null)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const handleClick = (event: (React.MouseEvent<HTMLElement> | any)): void => {
|
|
41
|
+
if (fullHeightFlyout) {
|
|
42
|
+
handlePopoverOpen(event)
|
|
43
|
+
onClick && onClick(event)
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (onClick) {
|
|
48
|
+
onClick(event)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
setAnchorEl(null)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const handleChildItemClick = (event: (React.MouseEvent<HTMLElement> | any), item: IVerticalNavigationItemProps): void => {
|
|
55
|
+
if (!event) {
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
event.preventDefault()
|
|
60
|
+
|
|
61
|
+
if (item.onClick) {
|
|
62
|
+
item.onClick(event)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<ListItem
|
|
68
|
+
disablePadding
|
|
69
|
+
// @ts-expect-error
|
|
70
|
+
component={animated.li}
|
|
71
|
+
style={style}
|
|
72
|
+
{...rest}
|
|
73
|
+
isDrawerOpen={isDrawerOpen}
|
|
74
|
+
>
|
|
75
|
+
<ListItemButton
|
|
76
|
+
// @ts-expect-error
|
|
77
|
+
component={Link}
|
|
78
|
+
key={label}
|
|
79
|
+
onClick={handleClick}
|
|
80
|
+
isActive={isActive}
|
|
81
|
+
isDrawerOpen={isDrawerOpen}
|
|
82
|
+
open={open}
|
|
83
|
+
onMouseEnter={event => (fullHeightFlyout || isDrawerOpen)
|
|
84
|
+
? null
|
|
85
|
+
: handlePopoverOpen(event)}
|
|
86
|
+
onMouseLeave={() => (fullHeightFlyout || isDrawerOpen)
|
|
87
|
+
? null
|
|
88
|
+
: handlePopoverClose()}
|
|
89
|
+
onFocus={event => (fullHeightFlyout || isDrawerOpen)
|
|
90
|
+
? null
|
|
91
|
+
: handlePopoverOpen(event)}
|
|
92
|
+
onBlur={() => (fullHeightFlyout || isDrawerOpen)
|
|
93
|
+
? null
|
|
94
|
+
: handlePopoverClose()}
|
|
95
|
+
aria-expanded={fullHeightFlyout ? open : null}
|
|
96
|
+
// aria-haspopup={(children && children.length > 0) ? 'true' : null}
|
|
97
|
+
aria-current={isActive ? 'page' : null}
|
|
98
|
+
role={(children && children.length > 0) || fullHeightFlyout ? 'button' : 'link'}
|
|
99
|
+
>
|
|
100
|
+
<Tooltip
|
|
101
|
+
disableHoverListener={(children && children.length > 0) ?? isDrawerOpen}
|
|
102
|
+
disableFocusListener={(children && children.length > 0) ?? isDrawerOpen}
|
|
103
|
+
disableTouchListener={(children && children.length > 0) ?? isDrawerOpen}
|
|
104
|
+
title={label}
|
|
105
|
+
placement={theme.direction === 'rtl' ? 'left' : 'right'}
|
|
106
|
+
enterDelay={tooltipDelay.start}
|
|
107
|
+
leaveDelay={tooltipDelay.end}
|
|
108
|
+
>
|
|
109
|
+
<ListItemIcon aria-hidden={true}>
|
|
110
|
+
{icon ?? <MailIcon />}
|
|
111
|
+
</ListItemIcon>
|
|
112
|
+
</Tooltip>
|
|
113
|
+
<ListItemText
|
|
114
|
+
primary={label}
|
|
115
|
+
isDrawerOpen={isDrawerOpen}
|
|
116
|
+
index={index}
|
|
117
|
+
sx={{
|
|
118
|
+
'& .MuiTypography-root': {
|
|
119
|
+
fontSize: isSecondary ? '14px' : 'inherit'
|
|
120
|
+
}
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
{/* {children && children.length > 0
|
|
124
|
+
? isExpanded
|
|
125
|
+
? <StyledExpandLess isDrawerOpen={isDrawerOpen} />
|
|
126
|
+
: <StyledExpandMore isDrawerOpen={isDrawerOpen} />
|
|
127
|
+
: null
|
|
128
|
+
} */}
|
|
129
|
+
</ListItemButton>
|
|
130
|
+
|
|
131
|
+
{children && children.length > 0 && (
|
|
132
|
+
<Collapse component='div' in={isDrawerOpen}>
|
|
133
|
+
<List
|
|
134
|
+
aria-label={label}
|
|
135
|
+
disablePadding
|
|
136
|
+
>
|
|
137
|
+
{children.map((childItem, index) => (
|
|
138
|
+
<ListItem
|
|
139
|
+
disablePadding
|
|
140
|
+
isDrawerOpen={isDrawerOpen}
|
|
141
|
+
>
|
|
142
|
+
<ListItemButtonChild
|
|
143
|
+
// @ts-expect-error
|
|
144
|
+
component={Link}
|
|
145
|
+
role='link'
|
|
146
|
+
key={label}
|
|
147
|
+
index={index}
|
|
148
|
+
isDrawerOpen={isDrawerOpen}
|
|
149
|
+
onClick={event => handleChildItemClick(event, childItem)}
|
|
150
|
+
>
|
|
151
|
+
<ListItemIcon>{childItem.icon}</ListItemIcon>
|
|
152
|
+
<ListItemText
|
|
153
|
+
primary={childItem.label}
|
|
154
|
+
isDrawerOpen={isDrawerOpen}
|
|
155
|
+
sx={{
|
|
156
|
+
'& .MuiTypography-root': {
|
|
157
|
+
fontSize: '14px !important',
|
|
158
|
+
color: theme.palette.mode === 'dark'
|
|
159
|
+
? theme.palette.primary.contrastText
|
|
160
|
+
: theme.palette.getContrastText(theme.palette.background.paper)
|
|
161
|
+
}
|
|
162
|
+
}}
|
|
163
|
+
/>
|
|
164
|
+
</ListItemButtonChild>
|
|
165
|
+
</ListItem>
|
|
166
|
+
))}
|
|
167
|
+
</List>
|
|
168
|
+
</Collapse>
|
|
169
|
+
)}
|
|
170
|
+
|
|
171
|
+
{hasCustomContent && content}
|
|
172
|
+
|
|
173
|
+
{!fullHeightFlyout && children && children.length > 0 && !isDrawerOpen && (
|
|
174
|
+
<VerticalNavigationItemFlyoutMenu
|
|
175
|
+
isDrawerOpen={isDrawerOpen}
|
|
176
|
+
anchorEl={anchorEl}
|
|
177
|
+
open={open}
|
|
178
|
+
children={children}
|
|
179
|
+
label={label}
|
|
180
|
+
/>
|
|
181
|
+
)}
|
|
182
|
+
|
|
183
|
+
{fullHeightFlyout && content && (
|
|
184
|
+
<VerticalNavigationItemFlyoutMenu
|
|
185
|
+
isDrawerOpen={isDrawerOpen}
|
|
186
|
+
fullHeightFlyout
|
|
187
|
+
anchorEl={anchorEl}
|
|
188
|
+
open={open}
|
|
189
|
+
content={content}
|
|
190
|
+
/>
|
|
191
|
+
)}
|
|
192
|
+
</ListItem>
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export default VerticalNavigationItem
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Link, ListItemText } from '../../../../index'
|
|
3
|
+
import { IVerticalNavigationItemProps } from '../../../../types'
|
|
4
|
+
import {
|
|
5
|
+
FullHeightFlyoutMenuPaper,
|
|
6
|
+
FullHeightFlyoutMenuWrapper,
|
|
7
|
+
FlyoutNotchMask,
|
|
8
|
+
NotchMini,
|
|
9
|
+
FlyoutMenuHeader,
|
|
10
|
+
FlyoutMenuPaper,
|
|
11
|
+
FlyoutMenuWrap,
|
|
12
|
+
FlyoutMenuList,
|
|
13
|
+
FlyoutMenuButton,
|
|
14
|
+
FlyoutMenuItem
|
|
15
|
+
} from './VerticalNavigationItemFlyoutMenuStyles'
|
|
16
|
+
export interface IVerticalNavigationItemFlyoutMenuProps {
|
|
17
|
+
label?: string
|
|
18
|
+
children?: IVerticalNavigationItemProps[]
|
|
19
|
+
isDrawerOpen?: boolean
|
|
20
|
+
hasFlyout?: boolean
|
|
21
|
+
content?: React.ReactElement
|
|
22
|
+
style?: any
|
|
23
|
+
|
|
24
|
+
fullHeightFlyout?: boolean
|
|
25
|
+
anchorEl?: null | HTMLElement
|
|
26
|
+
open?: boolean
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const VerticalNavigationItemFlyoutMenu = (
|
|
30
|
+
props: IVerticalNavigationItemFlyoutMenuProps
|
|
31
|
+
): React.ReactElement => {
|
|
32
|
+
const {
|
|
33
|
+
label, children, isDrawerOpen,
|
|
34
|
+
fullHeightFlyout,
|
|
35
|
+
content, anchorEl
|
|
36
|
+
} = props
|
|
37
|
+
const [flyoutHovered, setFlyoutHovered] = React.useState(false)
|
|
38
|
+
const open = flyoutHovered || props?.open
|
|
39
|
+
|
|
40
|
+
if (fullHeightFlyout && content) {
|
|
41
|
+
return (
|
|
42
|
+
<FullHeightFlyoutMenuPaper
|
|
43
|
+
isDrawerOpen={isDrawerOpen}
|
|
44
|
+
open={open}
|
|
45
|
+
id="avatar-panel"
|
|
46
|
+
>
|
|
47
|
+
<FullHeightFlyoutMenuWrapper open={open}>
|
|
48
|
+
<FlyoutNotchMask />
|
|
49
|
+
<NotchMini tabIndex={-1} style={{ bottom: '24px' }} />
|
|
50
|
+
{content}
|
|
51
|
+
</FullHeightFlyoutMenuWrapper>
|
|
52
|
+
</FullHeightFlyoutMenuPaper>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<FlyoutMenuPaper
|
|
58
|
+
isDrawerOpen={isDrawerOpen}
|
|
59
|
+
open={open}
|
|
60
|
+
anchorEl={anchorEl ?? undefined}
|
|
61
|
+
onMouseEnter={() => setFlyoutHovered(true)}
|
|
62
|
+
onMouseLeave={() => setFlyoutHovered(false)}
|
|
63
|
+
onFocus={() => setFlyoutHovered(true)}
|
|
64
|
+
onBlur={() => setFlyoutHovered(false)}
|
|
65
|
+
>
|
|
66
|
+
<FlyoutMenuWrap open={open}>
|
|
67
|
+
<NotchMini style={{ top: '12px' }} />
|
|
68
|
+
<FlyoutMenuHeader>
|
|
69
|
+
{label}
|
|
70
|
+
</FlyoutMenuHeader>
|
|
71
|
+
<FlyoutMenuList
|
|
72
|
+
aria-label={label}
|
|
73
|
+
open={open}
|
|
74
|
+
>
|
|
75
|
+
{children?.map(childItem => (
|
|
76
|
+
<FlyoutMenuItem>
|
|
77
|
+
<FlyoutMenuButton
|
|
78
|
+
// @ts-expect-error
|
|
79
|
+
component={Link}
|
|
80
|
+
role='link'
|
|
81
|
+
key={childItem.label}
|
|
82
|
+
onClick={childItem.onClick}
|
|
83
|
+
>
|
|
84
|
+
<ListItemText primary={childItem.label} />
|
|
85
|
+
</FlyoutMenuButton>
|
|
86
|
+
</FlyoutMenuItem>
|
|
87
|
+
))}
|
|
88
|
+
</FlyoutMenuList>
|
|
89
|
+
</FlyoutMenuWrap>
|
|
90
|
+
</FlyoutMenuPaper>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export default VerticalNavigationItemFlyoutMenu
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import {
|
|
2
|
+
List, ListItem, ListItemButton as SSListItemButton,
|
|
3
|
+
Paper, Typography
|
|
4
|
+
} from '../../../../index'
|
|
5
|
+
import { styled } from '@mui/material/styles'
|
|
6
|
+
import { NotchMiniSVG } from '../../../../assets/Images'
|
|
7
|
+
|
|
8
|
+
export const DRAWER_WIDTH = {
|
|
9
|
+
Collapsed: 60,
|
|
10
|
+
Expanded: 300
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const FlyoutMenuPaper = styled(Paper, {
|
|
14
|
+
shouldForwardProp: (prop) => prop !== 'isDrawerOpen' && prop !== 'open' && prop !== 'anchorEl'
|
|
15
|
+
})<{
|
|
16
|
+
anchorEl: HTMLElement | undefined
|
|
17
|
+
isDrawerOpen?: boolean
|
|
18
|
+
open?: boolean
|
|
19
|
+
}>`
|
|
20
|
+
background: transparent none;
|
|
21
|
+
box-shadow: none;
|
|
22
|
+
left: ${props => props.isDrawerOpen ? `${DRAWER_WIDTH.Expanded}px` : `${DRAWER_WIDTH.Collapsed - 3}px`};
|
|
23
|
+
perspective: 800px;
|
|
24
|
+
pointer-events: ${props => props.open ? 'auto' : 'none'};
|
|
25
|
+
position: fixed;
|
|
26
|
+
/* Check against height of browser should be top or bottom positioned */
|
|
27
|
+
top: ${props => props.anchorEl
|
|
28
|
+
? `${props.anchorEl.getBoundingClientRect().top}px`
|
|
29
|
+
: 'auto'};
|
|
30
|
+
width: 200px;
|
|
31
|
+
z-index: 2;
|
|
32
|
+
`
|
|
33
|
+
|
|
34
|
+
export const FlyoutMenuWrap = styled('div', {
|
|
35
|
+
shouldForwardProp: (prop) => prop !== 'open'
|
|
36
|
+
})<{ open?: boolean }>`
|
|
37
|
+
background-color: ${props => props.theme.palette.mode === 'dark'
|
|
38
|
+
? props.theme.palette.primary.dark
|
|
39
|
+
: '#E6EAF0'};
|
|
40
|
+
color: ${props => props.theme.palette.mode === 'dark'
|
|
41
|
+
? props.theme.palette.primary.contrastText
|
|
42
|
+
: props.theme.palette.getContrastText(props.theme.palette.background.paper)};
|
|
43
|
+
border-radius: 0 8px 8px 0;
|
|
44
|
+
box-shadow: 5px 7px 8px -10px rgb(0 0 0 / 20%), 5px 12px 17px -10px rgb(0 0 0 / 14%), 5px 5px 22px -10px rgb(0 0 0 / 12%);
|
|
45
|
+
opacity: ${props => props.open ? 1 : 0};
|
|
46
|
+
visibility: ${props => props.open ? 'visible' : 'hidden'};
|
|
47
|
+
transform: ${props => props.open ? 'rotateY(0deg) scale(1)' : 'rotateY(15deg) scale(.97)'};
|
|
48
|
+
transform-origin: left center;
|
|
49
|
+
transition: ${props => props.open
|
|
50
|
+
? `all
|
|
51
|
+
${props.theme.transitions.duration.enteringScreen}ms
|
|
52
|
+
${props.theme.transitions.easing.easeOut}`
|
|
53
|
+
: `all
|
|
54
|
+
${props.theme.transitions.duration.leavingScreen}ms
|
|
55
|
+
${props.theme.transitions.easing.easeIn}`};
|
|
56
|
+
`
|
|
57
|
+
|
|
58
|
+
export const FlyoutMenuList = styled(List, {
|
|
59
|
+
shouldForwardProp: (prop) => prop !== 'open'
|
|
60
|
+
})<{ open?: boolean }>`
|
|
61
|
+
padding: ${props => props.theme.spacing(1, 2)};
|
|
62
|
+
pointer-events: ${props => props.open ? 'auto' : 'none'};
|
|
63
|
+
`
|
|
64
|
+
|
|
65
|
+
export const FlyoutMenuHeader = styled(Typography)`
|
|
66
|
+
font-weight: bold;
|
|
67
|
+
padding: 12px ${props => props.theme.spacing(2)} 0 ${props => props.theme.spacing(3)};
|
|
68
|
+
`
|
|
69
|
+
|
|
70
|
+
export const FlyoutMenuItem = styled(ListItem)`
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
padding: 0;
|
|
73
|
+
white-space: normal;
|
|
74
|
+
background: transparent !important;
|
|
75
|
+
`
|
|
76
|
+
|
|
77
|
+
export const FlyoutMenuButton = styled(SSListItemButton, {
|
|
78
|
+
shouldForwardProp: (prop) => prop !== 'isDrawerOpen' && prop !== 'isExpanded'
|
|
79
|
+
})<{
|
|
80
|
+
isDrawerOpen?: boolean
|
|
81
|
+
isExpanded?: boolean
|
|
82
|
+
}>`
|
|
83
|
+
align-items: flex-start;
|
|
84
|
+
background-color: transparent;
|
|
85
|
+
color: ${props =>
|
|
86
|
+
props.theme.palette.mode === 'dark'
|
|
87
|
+
? props.theme.palette.primary.contrastText
|
|
88
|
+
: props.theme.palette.getContrastText(props.theme.palette.background.paper)};
|
|
89
|
+
border-radius: 5px;
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-wrap: wrap;
|
|
92
|
+
text-decoration: none;
|
|
93
|
+
text-transform: none;
|
|
94
|
+
transition: all
|
|
95
|
+
${props => props.theme.transitions.duration.enteringScreen}ms
|
|
96
|
+
${props => props.theme.transitions.easing.easeOut};
|
|
97
|
+
padding: ${props => props.theme.spacing(1, 2)};
|
|
98
|
+
width: 100%;
|
|
99
|
+
|
|
100
|
+
/* Indicator */
|
|
101
|
+
:before {
|
|
102
|
+
background-color: ${props =>
|
|
103
|
+
props.theme.palette.mode === 'dark'
|
|
104
|
+
? 'rgba(255, 255, 255, 0.5)'
|
|
105
|
+
: props.theme.palette.primary.main};
|
|
106
|
+
border-radius: 50px;
|
|
107
|
+
content: '';
|
|
108
|
+
height: calc(100% - 10px);
|
|
109
|
+
opacity: 0;
|
|
110
|
+
position: absolute;
|
|
111
|
+
top: 5px;
|
|
112
|
+
left: 5px;
|
|
113
|
+
transition: all
|
|
114
|
+
${props => props.theme.transitions.duration.enteringScreen}ms
|
|
115
|
+
${props => props.theme.transitions.easing.easeOut};
|
|
116
|
+
width: 4px;
|
|
117
|
+
transform: scale(.95);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:hover:before,
|
|
121
|
+
:focus:before {
|
|
122
|
+
opacity: 1;
|
|
123
|
+
transform: scale(1);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:hover {
|
|
127
|
+
background-color: rgba(0, 0, 0, .05);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:focus {
|
|
131
|
+
background-color: ${props =>
|
|
132
|
+
props.theme.palette.mode === 'dark'
|
|
133
|
+
? props.theme.palette.primary.dark
|
|
134
|
+
: '#E6EAF0'};
|
|
135
|
+
}
|
|
136
|
+
`
|
|
137
|
+
|
|
138
|
+
// FullHeight
|
|
139
|
+
export const FullHeightFlyoutMenuPaper = styled(Paper, {
|
|
140
|
+
shouldForwardProp: (prop) => prop !== 'isDrawerOpen' && prop !== 'open'
|
|
141
|
+
})<{
|
|
142
|
+
isDrawerOpen?: boolean
|
|
143
|
+
open?: boolean
|
|
144
|
+
}>`
|
|
145
|
+
background: transparent none;
|
|
146
|
+
box-shadow: none;
|
|
147
|
+
color: ${props => props.theme.palette.mode === 'dark'
|
|
148
|
+
? props.theme.palette.primary.contrastText
|
|
149
|
+
: props.theme.palette.getContrastText(props.theme.palette.background.paper)};
|
|
150
|
+
height: 100%;
|
|
151
|
+
left: ${props => props.isDrawerOpen ? `${DRAWER_WIDTH.Expanded}px` : `${DRAWER_WIDTH.Collapsed - 3}px`};
|
|
152
|
+
perspective: 800px;
|
|
153
|
+
pointer-events: ${props => props.open ? 'auto' : 'none'};
|
|
154
|
+
position: fixed;
|
|
155
|
+
top: 0;
|
|
156
|
+
transition: ${props => props.open
|
|
157
|
+
? `all
|
|
158
|
+
${props.theme.transitions.duration.enteringScreen}ms
|
|
159
|
+
${props.theme.transitions.easing.easeOut}`
|
|
160
|
+
: `all
|
|
161
|
+
${props.theme.transitions.duration.leavingScreen}ms
|
|
162
|
+
${props.theme.transitions.easing.easeIn}`};
|
|
163
|
+
z-index: 1;
|
|
164
|
+
`
|
|
165
|
+
|
|
166
|
+
export const FullHeightFlyoutMenuWrapper = styled('div', {
|
|
167
|
+
shouldForwardProp: (prop) => prop !== 'open'
|
|
168
|
+
})<{ open?: boolean }>`
|
|
169
|
+
background-color: ${props => props.theme.palette.mode === 'dark'
|
|
170
|
+
? props.theme.palette.primary.main
|
|
171
|
+
: props.theme.palette.background.paper};
|
|
172
|
+
box-shadow: 35px 0 15px 0 rgb(0 0 0 / 10%);
|
|
173
|
+
height: 100%;
|
|
174
|
+
max-width: 300px;
|
|
175
|
+
min-width: 300px;
|
|
176
|
+
opacity: ${props => props.open ? 1 : 0};
|
|
177
|
+
pointer-events: ${props => props.open ? 'auto' : 'none'};
|
|
178
|
+
transform: ${props => props.open ? 'rotateY(0deg) scale(1)' : 'rotateY(8deg) scale(.98)'};
|
|
179
|
+
transform-origin: left center;
|
|
180
|
+
transition: ${props => props.open
|
|
181
|
+
? `all
|
|
182
|
+
${props.theme.transitions.duration.enteringScreen}ms
|
|
183
|
+
${props.theme.transitions.easing.easeOut}`
|
|
184
|
+
: `all
|
|
185
|
+
${props.theme.transitions.duration.leavingScreen}ms
|
|
186
|
+
${props.theme.transitions.easing.easeIn}`};
|
|
187
|
+
visibility: ${props => props.open ? 'visible' : 'hidden'};
|
|
188
|
+
width: ${props => props.open ? '300' : 0};
|
|
189
|
+
`
|
|
190
|
+
|
|
191
|
+
export const FlyoutNotchMask = styled('div')`
|
|
192
|
+
background-color: ${props => props.theme.palette.mode === 'dark'
|
|
193
|
+
? props.theme.palette.primary.dark
|
|
194
|
+
: '#E6EAF0'};
|
|
195
|
+
content: '';
|
|
196
|
+
display: block;
|
|
197
|
+
height: 80px;
|
|
198
|
+
left: -40px;
|
|
199
|
+
position: absolute;
|
|
200
|
+
top: 65px;
|
|
201
|
+
width: 80px;
|
|
202
|
+
z-index: -1;
|
|
203
|
+
`
|
|
204
|
+
|
|
205
|
+
export const NotchMini = styled(NotchMiniSVG)`
|
|
206
|
+
fill: ${props => props.theme.palette.mode === 'dark'
|
|
207
|
+
? props.theme.palette.primary.dark
|
|
208
|
+
: '#E6EAF0'};
|
|
209
|
+
left: -12px;
|
|
210
|
+
pointer-events: none;
|
|
211
|
+
position: absolute;
|
|
212
|
+
`
|