@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
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import { jsx as _jsx,
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
24
|
import React, { useEffect } from 'react';
|
|
25
25
|
import { Person } from '@mui/icons-material';
|
|
26
26
|
import { StyledBottomNavigationAction, StyledPaper, StyledBottomNavigation } from './MobileNavigationStyles';
|
|
@@ -31,22 +31,45 @@ import SwipeableTemporaryAvatar from './MobileNavigationAvatar';
|
|
|
31
31
|
import NotchIndicator from './MobileNavigationNotchIndicator';
|
|
32
32
|
import ToggleX from './MobileNavigationToggleX';
|
|
33
33
|
import ToggleSearchX from './MobileNavigationToggleSearchX';
|
|
34
|
-
import { motion } from 'framer-motion';
|
|
35
34
|
import { MOBILE_NAV_PANEL_TYPES } from '../../../utils/constants';
|
|
36
35
|
import { handleAvatarInitials } from '../../../utils/helpers';
|
|
36
|
+
import { useSpring, animated, useSpringRef, config } from '@react-spring/web';
|
|
37
|
+
import { useCurrentWidth } from '../../../utils/hooks';
|
|
37
38
|
var MobileNavigation = function (props) {
|
|
38
|
-
var _a, _b;
|
|
39
|
+
var _a, _b, _c;
|
|
39
40
|
var items = props.items, secondaryItems = props.secondaryItems, hideAvatarInitials = props.hideAvatarInitials, hasSearch = props.hasSearch, hasAvatar = props.hasAvatar, showNotchIndicator = props.showNotchIndicator, rest = __rest(props, ["items", "secondaryItems", "hideAvatarInitials", "hasSearch", "hasAvatar", "showNotchIndicator"]);
|
|
40
41
|
var propIsDrawerOpen = typeof (props === null || props === void 0 ? void 0 : props.isDrawerOpen) === 'boolean' ? props.isDrawerOpen : undefined;
|
|
41
42
|
var propIsSearchOpen = typeof (props === null || props === void 0 ? void 0 : props.isSearchOpen) === 'boolean' ? props.isSearchOpen : undefined;
|
|
42
43
|
var propIsAvatarOpen = typeof (props === null || props === void 0 ? void 0 : props.isAvatarOpen) === 'boolean' ? props.isAvatarOpen : undefined;
|
|
43
44
|
var avatarName = (_a = props === null || props === void 0 ? void 0 : props.avatarName) !== null && _a !== void 0 ? _a : 'Avatar name';
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
45
|
+
var _d = React.useState(propIsDrawerOpen !== null && propIsDrawerOpen !== void 0 ? propIsDrawerOpen : false), isDrawerOpen = _d[0], setIsDrawerOpen = _d[1];
|
|
46
|
+
var _e = React.useState(propIsSearchOpen !== null && propIsSearchOpen !== void 0 ? propIsSearchOpen : false), isSearchOpen = _e[0], setIsSearchOpen = _e[1];
|
|
47
|
+
var _f = React.useState(propIsAvatarOpen !== null && propIsAvatarOpen !== void 0 ? propIsAvatarOpen : false), isAvatarOpen = _f[0], setIsAvatarOpen = _f[1];
|
|
48
|
+
var _g = React.useState(0), value = _g[0], setValue = _g[1];
|
|
48
49
|
var currentDirection = window.localStorage.getItem('@learningpool/ui/store/mobile-navigation-direction');
|
|
49
|
-
var
|
|
50
|
+
var _h = React.useState(currentDirection !== null && currentDirection !== void 0 ? currentDirection : 'ltr'), mobileNavDirection = _h[0], setMobileNavDirection = _h[1];
|
|
51
|
+
var _j = React.useState(0), mobileNotchPosition = _j[0], setMobileNotchPosition = _j[1];
|
|
52
|
+
var windowWidth = useCurrentWidth();
|
|
53
|
+
useEffect(function () {
|
|
54
|
+
window.localStorage.setItem('@learningpool/ui/store/mobile-navigation-direction', mobileNavDirection);
|
|
55
|
+
positionMobileNotch();
|
|
56
|
+
}, [mobileNavDirection]);
|
|
57
|
+
var NOTCH = {
|
|
58
|
+
Height: 50,
|
|
59
|
+
Width: 50
|
|
60
|
+
};
|
|
61
|
+
var BOTTOM_NAVIGATION_ITEM_DOM_ELEMENTS = document.querySelectorAll('.MuiBottomNavigationAction-root, .bottom-navigation-item');
|
|
62
|
+
var positionMobileNotch = function () {
|
|
63
|
+
var _a;
|
|
64
|
+
var selectedDOMRect = (_a = BOTTOM_NAVIGATION_ITEM_DOM_ELEMENTS[value]) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
65
|
+
setMobileNotchPosition(selectedDOMRect ? selectedDOMRect.left + (selectedDOMRect.width / 2) - (NOTCH.Width / 2) : mobileNotchPosition);
|
|
66
|
+
};
|
|
67
|
+
useEffect(function () { return positionMobileNotch(); }, [
|
|
68
|
+
value,
|
|
69
|
+
windowWidth,
|
|
70
|
+
// Fix notch position if scrollbar is hidden/shown
|
|
71
|
+
(_b = BOTTOM_NAVIGATION_ITEM_DOM_ELEMENTS[value]) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()
|
|
72
|
+
]);
|
|
50
73
|
useEffect(function () { return setIsDrawerOpen(propIsDrawerOpen !== null && propIsDrawerOpen !== void 0 ? propIsDrawerOpen : false); }, [propIsDrawerOpen]);
|
|
51
74
|
useEffect(function () { return setIsSearchOpen(propIsSearchOpen !== null && propIsSearchOpen !== void 0 ? propIsSearchOpen : false); }, [propIsSearchOpen]);
|
|
52
75
|
useEffect(function () { return setIsAvatarOpen(propIsAvatarOpen !== null && propIsAvatarOpen !== void 0 ? propIsAvatarOpen : false); }, [propIsAvatarOpen]);
|
|
@@ -60,7 +83,7 @@ var MobileNavigation = function (props) {
|
|
|
60
83
|
}
|
|
61
84
|
hideNotch();
|
|
62
85
|
}, [isDrawerOpen, isSearchOpen, isAvatarOpen]);
|
|
63
|
-
var
|
|
86
|
+
var _k = React.useState((_c = handleAvatarInitials(avatarName)) !== null && _c !== void 0 ? _c : 'AN'), avatarInitials = _k[0], setAvatarInitials = _k[1];
|
|
64
87
|
var toggleDrawer = function (open, action) { return function (event) {
|
|
65
88
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
66
89
|
if (event.type === 'keydown') {
|
|
@@ -91,40 +114,40 @@ var MobileNavigation = function (props) {
|
|
|
91
114
|
}
|
|
92
115
|
}
|
|
93
116
|
}; };
|
|
94
|
-
var
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
117
|
+
var api = useSpringRef();
|
|
118
|
+
var animationConfig = {
|
|
119
|
+
MobileNavigationPaper: {
|
|
120
|
+
from: { opacity: 0 },
|
|
121
|
+
to: { opacity: 1 }
|
|
122
|
+
},
|
|
123
|
+
MobileNavigation: {
|
|
124
|
+
from: { opacity: 0 },
|
|
125
|
+
to: { opacity: 1 }
|
|
126
|
+
},
|
|
127
|
+
MobileNavigationButton: {
|
|
128
|
+
from: { opacity: 0 },
|
|
129
|
+
to: { opacity: 1 }
|
|
130
|
+
},
|
|
131
|
+
MobileNavigationNotch: {
|
|
132
|
+
ref: api,
|
|
133
|
+
config: __assign(__assign({}, config.default), { mass: 1 }),
|
|
134
|
+
x: mobileNotchPosition,
|
|
135
|
+
y: value < 0 ? 100 : 0
|
|
111
136
|
}
|
|
112
137
|
};
|
|
113
|
-
|
|
138
|
+
var MobileNavigationPaperAnimation = useSpring(animationConfig.MobileNavigationPaper);
|
|
139
|
+
var MobileNavigationAnimation = useSpring(animationConfig.MobileNavigation);
|
|
140
|
+
var MobileNavigationButtonAnimation = useSpring(animationConfig.MobileNavigationButton);
|
|
141
|
+
return (_jsxs(_Fragment, { children: [_jsx(SwipeableTemporaryDrawer, __assign({ isDrawerOpen: isDrawerOpen, setIsDrawerOpen: setIsDrawerOpen, items: items, secondaryItems: secondaryItems, label: 'Primary' }, rest)), hasSearch && (_jsx(SwipeableTemporarySearch, __assign({ isSearchOpen: isSearchOpen, setIsSearchOpen: setIsSearchOpen }, rest))), hasAvatar && (_jsx(SwipeableTemporaryAvatar, __assign({ isAvatarOpen: isAvatarOpen, setIsAvatarOpen: setIsAvatarOpen, avatarName: avatarName, mobileNavDirection: mobileNavDirection, setMobileNavDirection: setMobileNavDirection }, rest))), _jsxs(StyledPaper, __assign({ elevation: 3,
|
|
114
142
|
// @ts-expect-error
|
|
115
|
-
component:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
} }), hasSearch && (_jsx(StyledBottomNavigationAction, { icon: (_jsxs(_Fragment, { children: [_jsx(ToggleSearchX, {}), showNotchIndicator && value === 1 && _jsx(NotchIndicator, {})] })), onClick: toggleDrawer(!isSearchOpen, MOBILE_NAV_PANEL_TYPES.SEARCH),
|
|
125
|
-
// @ts-expect-error
|
|
126
|
-
component: motion.div, animate: isSearchOpen ? 'open' : 'closed', variants: variantsButtons, "aria-label": isSearchOpen ? 'Close search panel' : 'Open search panel', "aria-expanded": isSearchOpen ? 'true' : 'false', "aria-controls": 'mobile-nav-menu' })), hasAvatar && (_jsx(StyledBottomNavigationAction, { onClick: toggleDrawer(!isAvatarOpen, MOBILE_NAV_PANEL_TYPES.AVATAR), icon: (_jsxs(_Fragment, { children: [!hideAvatarInitials ? _jsx(StyledAvatar, { children: avatarInitials }) : _jsx(Person, {}), showNotchIndicator && value === 2 && _jsx(NotchIndicator, {})] })),
|
|
127
|
-
// @ts-expect-error
|
|
128
|
-
component: motion.button, variants: variantsButtons, "aria-label": isAvatarOpen ? 'Close Profile Menu' : 'Open Profile Menu', "aria-expanded": isAvatarOpen ? 'true' : 'false', "aria-controls": 'mobile-nav-menu' }))] })) }))] }));
|
|
143
|
+
component: animated.div, style: MobileNavigationPaperAnimation }, { children: [showNotchIndicator && _jsx(NotchIndicator, __assign({}, animationConfig.MobileNavigationNotch)), _jsxs(StyledBottomNavigation, __assign({ value: value, onChange: function (event, newValue) { return setValue(newValue); },
|
|
144
|
+
// @ts-expect-error
|
|
145
|
+
component: animated.div, style: __assign({ flexDirection: mobileNavDirection && mobileNavDirection === 'rtl' ? 'row-reverse' : 'row' }, MobileNavigationAnimation) }, { children: [_jsx(StyledBottomNavigationAction, { icon: _jsx(ToggleX, { isOpen: isDrawerOpen }), onClick: toggleDrawer(!isDrawerOpen, MOBILE_NAV_PANEL_TYPES.DRAWER),
|
|
146
|
+
// @ts-expect-error
|
|
147
|
+
component: animated.div, "aria-label": isDrawerOpen ? 'Close drawer panel' : 'Open drawer panel', "aria-expanded": isDrawerOpen ? 'true' : 'false', "aria-controls": 'mobile-nav-menu', style: __assign({ marginInlineStart: (hasSearch || hasAvatar) && (mobileNavDirection && mobileNavDirection === 'rtl') ? 'auto' : 'initial', marginInlineEnd: (hasSearch || hasAvatar) && (mobileNavDirection && mobileNavDirection === 'rtl') ? 'initial' : 'auto' }, MobileNavigationButtonAnimation) }), hasSearch && (_jsx(StyledBottomNavigationAction, { icon: _jsx(ToggleSearchX, { isOpen: isSearchOpen }), onClick: toggleDrawer(!isSearchOpen, MOBILE_NAV_PANEL_TYPES.SEARCH),
|
|
148
|
+
// @ts-expect-error
|
|
149
|
+
component: animated.div, "aria-label": isSearchOpen ? 'Close search panel' : 'Open search panel', "aria-expanded": isSearchOpen ? 'true' : 'false', "aria-controls": 'mobile-nav-menu', style: MobileNavigationButtonAnimation })), hasAvatar && (_jsx(StyledBottomNavigationAction, { onClick: toggleDrawer(!isAvatarOpen, MOBILE_NAV_PANEL_TYPES.AVATAR), icon: !hideAvatarInitials ? _jsx(StyledAvatar, { children: avatarInitials }) : _jsx(Person, {}),
|
|
150
|
+
// @ts-expect-error
|
|
151
|
+
component: animated.button, "aria-label": isAvatarOpen ? 'Close Profile Menu' : 'Open Profile Menu', "aria-expanded": isAvatarOpen ? 'true' : 'false', "aria-controls": 'mobile-nav-menu', style: MobileNavigationButtonAnimation }))] }))] }))] }));
|
|
129
152
|
};
|
|
130
153
|
export default MobileNavigation;
|
package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatar.d.ts
RENAMED
|
File without changes
|
package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatar.js
RENAMED
|
@@ -16,11 +16,10 @@ import { StyledSwipeableAvatar, StyledBox, StyledBoxProfile, StyledAvatarName, S
|
|
|
16
16
|
import { useTheme } from '@mui/material/styles';
|
|
17
17
|
import EditIcon from '@mui/icons-material/Edit';
|
|
18
18
|
import LogoutIcon from '@mui/icons-material/Logout';
|
|
19
|
-
import { motion } from 'framer-motion';
|
|
20
|
-
import { motionParent, motionFadeIn, motionFadeInUp, motionWhileHover, motionWhileTap } from './MobileNavigationMotion';
|
|
21
19
|
import ToggleOffIcon from '@mui/icons-material/ToggleOff';
|
|
22
20
|
import ToggleOnIcon from '@mui/icons-material/ToggleOn';
|
|
23
|
-
import { handleAvatarInitials } from '../../../utils/helpers';
|
|
21
|
+
import { handleAvatarInitials, useStaggerAnimation } from '../../../utils/helpers';
|
|
22
|
+
import { animated } from '@react-spring/web';
|
|
24
23
|
var SwipeableTemporaryAvatar = function (props) {
|
|
25
24
|
var _a;
|
|
26
25
|
var theme = useTheme();
|
|
@@ -47,28 +46,24 @@ var SwipeableTemporaryAvatar = function (props) {
|
|
|
47
46
|
setMobileNavDirection(mobileNavDirection === 'rtl' ? 'ltr' : 'rtl');
|
|
48
47
|
avatarPanelOnClickSwitchDirection && avatarPanelOnClickSwitchDirection();
|
|
49
48
|
};
|
|
49
|
+
// First item starts at 70ms
|
|
50
|
+
// see STAGGER_ITEMS_DELAY in helpers.js
|
|
51
|
+
var animationCount = 1;
|
|
52
|
+
var incrementAnimationCount = function () { return animationCount++; };
|
|
50
53
|
return (_jsx(StyledSwipeableAvatar, __assign({ anchor: 'bottom', open: isOpen, onClose: toggleAvatar(false), hideBackdrop: true, ModalProps: {
|
|
51
54
|
keepMounted: true
|
|
52
|
-
} }, { children: _jsxs(StyledBox,
|
|
55
|
+
} }, { children: _jsxs(StyledBox, { children: [avatarPanelOnClickLogout && (_jsx(Button
|
|
53
56
|
// @ts-expect-error
|
|
54
57
|
, __assign({
|
|
55
58
|
// @ts-expect-error
|
|
56
|
-
component:
|
|
57
|
-
left: theme.direction === 'rtl' ? theme.spacing(1) : 'auto',
|
|
58
|
-
position: 'absolute',
|
|
59
|
-
right: theme.direction === 'rtl' ? 'auto' : theme.spacing(1),
|
|
60
|
-
top: theme.spacing(1)
|
|
61
|
-
}, onClick: function () {
|
|
59
|
+
component: animated.button, style: __assign({ left: theme.direction === 'rtl' ? theme.spacing(1) : 'auto', position: 'absolute', right: theme.direction === 'rtl' ? 'auto' : theme.spacing(1), top: theme.spacing(1) }, useStaggerAnimation(isOpen, animationCount, incrementAnimationCount)), onClick: function () {
|
|
62
60
|
handleOpenState(false);
|
|
63
61
|
avatarPanelOnClickLogout();
|
|
64
62
|
}, startIcon: _jsx(LogoutIcon, {}), variant: 'text', color: 'inherit' }, { children: avatarPanelLogoutString !== null && avatarPanelLogoutString !== void 0 ? avatarPanelLogoutString : 'Logout' }))), _jsxs(Box, __assign({ style: {
|
|
65
63
|
alignItems: 'center',
|
|
66
64
|
display: 'flex',
|
|
67
65
|
flexDirection: 'column'
|
|
68
|
-
} }, { children: [_jsxs(StyledBoxProfile, __assign({
|
|
69
|
-
flexDirection: 'row',
|
|
70
|
-
marginBottom: theme.spacing(1)
|
|
71
|
-
} }, { children: _jsxs(ButtonGroup, __assign({ variant: "contained", "aria-label": "split button" }, { children: [_jsx(Button, __assign({ variant: 'contained', color: 'primary', size: 'medium', onClick: function () {
|
|
66
|
+
} }, { children: [_jsxs(StyledBoxProfile, __assign({ style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount) }, { children: [_jsx(StyledAvatar, __assign({ style: { marginRight: '0.5rem' } }, { children: avatarInitials })), _jsxs(StyledAvatarName, { children: [_jsx("span", __assign({ style: { fontWeight: 300 } }, { children: "Hi," })), " ", _jsx("strong", { children: avatarName.split(' ')[0] })] })] })), avatarPanelOnClickViewProfile && (_jsx(StyledBoxProfileEdit, __assign({ style: __assign({ flexDirection: 'row', marginBottom: theme.spacing(1) }, useStaggerAnimation(isOpen, animationCount, incrementAnimationCount)) }, { children: _jsxs(ButtonGroup, __assign({ variant: "contained", "aria-label": "split button" }, { children: [_jsx(Button, __assign({ variant: 'contained', color: 'primary', size: 'medium', onClick: function () {
|
|
72
67
|
handleOpenState(false);
|
|
73
68
|
avatarPanelOnClickViewProfile();
|
|
74
69
|
} }, { children: avatarPanelViewProfileString !== null && avatarPanelViewProfileString !== void 0 ? avatarPanelViewProfileString : 'View Profile' })), avatarPanelOnClickEditProfile && (_jsx(Button, __assign({ size: 'medium', "aria-label": avatarPanelEditProfileString !== null && avatarPanelEditProfileString !== void 0 ? avatarPanelEditProfileString : 'Edit Profile', onClick: function () {
|
|
@@ -82,7 +77,10 @@ var SwipeableTemporaryAvatar = function (props) {
|
|
|
82
77
|
marginInlineStart: '3rem',
|
|
83
78
|
marginBottom: theme.spacing(2),
|
|
84
79
|
maxWidth: '18rem'
|
|
85
|
-
} }, { children: avatarPanelMenuItems.map(function (avatarMenuItem) { return (_jsx(ListItem, __assign({ component:
|
|
80
|
+
} }, { children: avatarPanelMenuItems.map(function (avatarMenuItem) { return (_jsx(ListItem, __assign({ component: animated.div, style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount),
|
|
81
|
+
// whileHover={motionWhileHover}
|
|
82
|
+
// whileTap={motionWhileTap}
|
|
83
|
+
disablePadding: true }, { children: _jsxs(StyledListItemButton
|
|
86
84
|
// TODO: figure out if these are links or buttons
|
|
87
85
|
// @ts-expect-error
|
|
88
86
|
, __assign({
|
|
@@ -97,12 +95,15 @@ var SwipeableTemporaryAvatar = function (props) {
|
|
|
97
95
|
// @ts-expect-error
|
|
98
96
|
, __assign({
|
|
99
97
|
// @ts-expect-error
|
|
100
|
-
component:
|
|
98
|
+
component: animated.button, style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount), disablePadding: true, variant: 'outlined', color: 'primary', size: 'medium', onClick: function () {
|
|
101
99
|
handleOpenState(false);
|
|
102
100
|
avatarPanelOnClickMainAction();
|
|
103
101
|
} }, { children: avatarPanelMainActionString })), _jsxs(List, __assign({ style: { marginBottom: theme.spacing(2) } }, { children: [avatarPanelSettingItems &&
|
|
104
102
|
avatarPanelSettingItems.length > 0 &&
|
|
105
|
-
avatarPanelSettingItems.map(function (avatarMenuItem) { return (_jsx(ListItem, __assign({ component:
|
|
103
|
+
avatarPanelSettingItems.map(function (avatarMenuItem) { return (_jsx(ListItem, __assign({ component: animated.div, style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount),
|
|
104
|
+
// whileHover={motionWhileHover}
|
|
105
|
+
// whileTap={motionWhileTap}
|
|
106
|
+
disablePadding: true }, { children: _jsxs(StyledListItemButton
|
|
106
107
|
// TODO: figure out if these are links or buttons
|
|
107
108
|
// @ts-expect-error
|
|
108
109
|
, __assign({
|
|
@@ -113,7 +114,10 @@ var SwipeableTemporaryAvatar = function (props) {
|
|
|
113
114
|
avatarMenuItem.onClick();
|
|
114
115
|
} }, { children: [_jsx(ListItemIcon, __assign({ "aria-hidden": true, style: {
|
|
115
116
|
minWidth: theme.spacing(5)
|
|
116
|
-
} }, { children: avatarMenuItem.icon })), _jsx(ListItemText, { primary: avatarMenuItem.label })] })) }))); }), avatarPanelOnClickSwitchDirection && (_jsx(ListItem, __assign({ component:
|
|
117
|
+
} }, { children: avatarMenuItem.icon })), _jsx(ListItemText, { primary: avatarMenuItem.label })] })) }))); }), avatarPanelOnClickSwitchDirection && (_jsx(ListItem, __assign({ component: animated.div, style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount),
|
|
118
|
+
// whileHover={motionWhileHover}
|
|
119
|
+
// whileTap={motionWhileTap}
|
|
120
|
+
disablePadding: true }, { children: _jsxs(StyledListItemButton
|
|
117
121
|
// TODO: figure out if these are links or buttons
|
|
118
122
|
// @ts-expect-error
|
|
119
123
|
, __assign({
|
|
@@ -135,6 +139,6 @@ var SwipeableTemporaryAvatar = function (props) {
|
|
|
135
139
|
height: '2em',
|
|
136
140
|
padding: '0.15em',
|
|
137
141
|
width: '2em'
|
|
138
|
-
} })) }))] })) })))] }))] }))] })
|
|
142
|
+
} })) }))] })) })))] }))] }))] }) })));
|
|
139
143
|
};
|
|
140
144
|
export default SwipeableTemporaryAvatar;
|