@learningpool/ui 1.6.2 → 1.6.5
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/{dist/assets → assets}/Images.d.ts +0 -0
- package/{dist/assets → assets}/Images.js +0 -0
- package/{dist/components → components}/atoms/Autocomplete/Autocomplete.d.ts +0 -0
- package/{dist/components → components}/atoms/Autocomplete/Autocomplete.js +0 -0
- package/{dist/components → components}/atoms/Button/Button.d.ts +0 -0
- package/{dist/components → components}/atoms/Button/Button.js +0 -0
- package/{dist/components → components}/atoms/Checkbox/Checkbox.d.ts +0 -0
- package/{dist/components → components}/atoms/Checkbox/Checkbox.js +0 -0
- package/{dist/components → components}/atoms/IconButton/IconButton.d.ts +0 -0
- package/{dist/components → components}/atoms/IconButton/IconButton.js +0 -0
- package/{dist/components → components}/atoms/Radio/Radio.d.ts +0 -0
- package/{dist/components → components}/atoms/Radio/Radio.js +0 -0
- package/{dist/components → components}/atoms/Select/Select.d.ts +0 -0
- package/{dist/components → components}/atoms/Select/Select.js +0 -0
- package/{dist/components → components}/atoms/Slider/Slider.d.ts +0 -0
- package/{dist/components → components}/atoms/Slider/Slider.js +0 -0
- package/{dist/components → components}/atoms/Switch/Switch.d.ts +0 -0
- package/{dist/components → components}/atoms/Switch/Switch.js +0 -0
- package/{dist/components → components}/atoms/TextField/TextField.d.ts +0 -0
- package/{dist/components → components}/atoms/TextField/TextField.js +0 -0
- package/{dist/components → components}/atoms/ToggleButton/ToggleButton.d.ts +0 -0
- package/{dist/components → components}/atoms/ToggleButton/ToggleButton.js +0 -0
- package/{dist/components → components}/datadisplay/Avatar/Avatar.d.ts +0 -0
- package/{dist/components → components}/datadisplay/Avatar/Avatar.js +0 -0
- package/{dist/components → components}/datadisplay/Chip/Chip.d.ts +0 -0
- package/{dist/components → components}/datadisplay/Chip/Chip.js +0 -0
- package/{dist/components → components}/datadisplay/List/List.d.ts +0 -0
- package/{dist/components → components}/datadisplay/List/List.js +0 -0
- package/{dist/components → components}/datadisplay/Tooltip/Tooltip.d.ts +0 -0
- package/{dist/components → components}/datadisplay/Tooltip/Tooltip.js +0 -0
- package/{dist/components → components}/feedback/Alert/Alert.d.ts +0 -0
- package/{dist/components → components}/feedback/Alert/Alert.js +0 -0
- package/{dist/components → components}/landmarks/Header/Header.d.ts +0 -0
- package/{dist/components → components}/landmarks/Header/Header.js +0 -0
- package/{dist/components → components}/landmarks/Header/HeaderActionButtons.d.ts +0 -0
- package/{dist/components → components}/landmarks/Header/HeaderActionButtons.js +0 -0
- package/{dist/components → components}/landmarks/Header/HeaderStyles.d.ts +0 -0
- package/{dist/components → components}/landmarks/Header/HeaderStyles.js +0 -0
- package/{dist/components → components}/navigation/Drawer/Drawer.d.ts +0 -0
- package/{dist/components → components}/navigation/Drawer/Drawer.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigation.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigation.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationAvatar.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationAvatar.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationAvatarStyles.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationDrawer.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationDrawer.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationDrawerStyles.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationMotion.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationMotion.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationNotchIndicator.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationNotchIndicator.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationSearch.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationSearch.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationSearchStyles.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationStyles.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationToggleSearchX.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationToggleX.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationToggleX.js +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigation.d.ts +1 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigation.js +12 -10
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationAvatar.d.ts +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationAvatar.js +11 -7
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +49 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +33 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.d.ts +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.d.ts +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +3 -3
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.d.ts +1 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +16 -15
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +3 -3
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationMotion.d.ts +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationMotion.js +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +6 -1
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationStyles.js +14 -15
- package/{dist/components → components}/pages/ErrorPage/ErrorPage.d.ts +0 -0
- package/{dist/components → components}/pages/ErrorPage/ErrorPage.js +0 -0
- package/{dist/components → components}/pages/ErrorPage/ErrorPageStyles.d.ts +0 -0
- package/{dist/components → components}/pages/ErrorPage/ErrorPageStyles.js +0 -0
- package/{dist/components → components}/pages/SideInSide/SideInSide.d.ts +0 -0
- package/{dist/components → components}/pages/SideInSide/SideInSide.js +0 -0
- package/{dist/components → components}/pages/SideInSide/SideInSideStyles.d.ts +0 -0
- package/{dist/components → components}/pages/SideInSide/SideInSideStyles.js +0 -0
- package/{dist/components → components}/stream/AppSwitcher/AppSwitcher.d.ts +0 -0
- package/{dist/components → components}/stream/AppSwitcher/AppSwitcher.js +1 -11
- package/{dist/components → components}/stream/AppSwitcher/AppSwitcherItem.d.ts +1 -0
- package/{dist/components → components}/stream/AppSwitcher/AppSwitcherItem.js +14 -14
- package/{dist/components → components}/stream/AppSwitcher/AppSwitcherStyles.d.ts +0 -0
- package/{dist/components → components}/stream/AppSwitcher/AppSwitcherStyles.js +8 -6
- package/{dist/components → components}/stream/AppSwitcher/constants.d.ts +0 -0
- package/{dist/components → components}/stream/AppSwitcher/constants.js +0 -0
- package/{dist/index.d.ts → index.d.ts} +0 -0
- package/{dist/index.js → index.js} +0 -0
- package/lang/en-us.d.ts +15 -0
- package/lang/en-us.js +18 -0
- package/package.json +3 -70
- package/{dist/types → types}/components/navigation/VerticalNavigation.d.ts +0 -0
- package/{dist/types → types}/components/navigation/VerticalNavigation.js +0 -0
- package/{dist/types → types}/components/navigation/VerticalNavigationAvatar.d.ts +1 -0
- package/{dist/types → types}/components/navigation/VerticalNavigationAvatar.js +0 -0
- package/{dist/types → types}/components/stream/AppSwitcher.d.ts +0 -0
- package/{dist/types → types}/components/stream/AppSwitcher.js +0 -0
- package/{dist/types → types}/index.d.ts +0 -0
- package/{dist/types → types}/index.js +0 -0
- package/{dist/utils → utils}/constants.d.ts +0 -0
- package/{dist/utils → utils}/constants.js +0 -0
- package/{dist/utils → utils}/helpers.d.ts +0 -0
- package/{dist/utils → utils}/helpers.js +0 -0
- package/{dist/utils → utils}/hooks.d.ts +0 -0
- package/{dist/utils → utils}/hooks.js +0 -0
- package/{dist/utils → utils}/index.d.ts +0 -0
- package/{dist/utils → utils}/index.js +0 -0
- package/{dist/utils → utils}/theme.d.ts +0 -0
- package/{dist/utils → utils}/theme.js +0 -0
- package/.eslintrc.js +0 -40
- package/.github/pull_request_template.md +0 -23
- package/.github/renovate.json +0 -57
- package/.github/workflows/integration.yml +0 -53
- package/.github/workflows/wss.yml +0 -22
- package/.jest-test-results.json +0 -1
- package/.releaserc +0 -32
- package/.storybook/learningpoolTheme.js +0 -39
- package/.storybook/main.js +0 -21
- package/.storybook/manager-head.html +0 -175
- package/.storybook/manager.js +0 -34
- package/.storybook/preview-head.html +0 -212
- package/.storybook/preview.js +0 -120
- package/.storybook/storybook-sort.js +0 -54
- package/CHANGELOG.md +0 -13
- package/amplify.yml +0 -16
- package/babel.config.json +0 -14
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +0 -31
- package/dist/lang/en-us.d.ts +0 -6
- package/dist/lang/en-us.js +0 -6
- package/dist/package.json +0 -41
- package/jest.config.ts +0 -11
- package/jest.setup.ts +0 -5
- package/license +0 -7
- package/merge.js +0 -27
- 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 +0 -5
- package/public/assets/automation.svg +0 -1
- 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 +0 -6
- package/public/assets/flux/icon-light.svg +0 -1
- package/public/assets/flux/icon-white.svg +0 -6
- package/public/assets/flux/icon.svg +0 -6
- package/public/assets/flux/logo-dark.svg +0 -22
- package/public/assets/flux/logo-light.svg +0 -1
- package/public/assets/flux/logo-white.svg +0 -22
- package/public/assets/flux/logo.svg +0 -22
- 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 +0 -1
- package/public/assets/molecules.svg +0 -8
- package/public/assets/organisms.svg +0 -21
- package/public/assets/pages.svg +0 -4
- package/public/assets/particles.svg +0 -3
- package/public/assets/stream-dark.png +0 -0
- package/public/assets/stream-suite-logo.svg +0 -38
- package/public/assets/stream-white.png +0 -0
- package/public/assets/stream.png +0 -0
- package/public/assets/templates.svg +0 -3
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/public/site.webmanifest +0 -1
- package/readme.md +0 -132
- package/src/docs.tsx +0 -167
- package/src/lib/assets/Images.tsx +0 -47
- package/src/lib/assets/stream-suite-logo.svg +0 -38
- package/src/lib/components/atoms/Autocomplete/Autocomplete.test.tsx +0 -179
- package/src/lib/components/atoms/Autocomplete/Autocomplete.tsx +0 -14
- package/src/lib/components/atoms/Button/Button.test.tsx +0 -166
- package/src/lib/components/atoms/Button/Button.tsx +0 -16
- package/src/lib/components/atoms/Checkbox/Checkbox.test.tsx +0 -85
- package/src/lib/components/atoms/Checkbox/Checkbox.tsx +0 -10
- package/src/lib/components/atoms/IconButton/IconButton.test.tsx +0 -60
- package/src/lib/components/atoms/IconButton/IconButton.tsx +0 -9
- package/src/lib/components/atoms/Radio/Radio.test.tsx +0 -136
- package/src/lib/components/atoms/Radio/Radio.tsx +0 -10
- package/src/lib/components/atoms/Select/Select.test.tsx +0 -158
- package/src/lib/components/atoms/Select/Select.tsx +0 -12
- package/src/lib/components/atoms/Slider/Slider.test.tsx +0 -103
- package/src/lib/components/atoms/Slider/Slider.tsx +0 -10
- package/src/lib/components/atoms/Switch/Switch.test.tsx +0 -96
- package/src/lib/components/atoms/Switch/Switch.tsx +0 -10
- package/src/lib/components/atoms/TextField/TextField.test.tsx +0 -131
- package/src/lib/components/atoms/TextField/TextField.tsx +0 -31
- package/src/lib/components/atoms/ToggleButton/ToggleButton.test.tsx +0 -122
- package/src/lib/components/atoms/ToggleButton/ToggleButton.tsx +0 -10
- package/src/lib/components/datadisplay/Avatar/Avatar.test.tsx +0 -187
- package/src/lib/components/datadisplay/Avatar/Avatar.tsx +0 -35
- package/src/lib/components/datadisplay/Avatar/avatar-1.jpg +0 -0
- package/src/lib/components/datadisplay/Chip/Chip.test.tsx +0 -82
- package/src/lib/components/datadisplay/Chip/Chip.tsx +0 -11
- package/src/lib/components/datadisplay/List/List.test.tsx +0 -168
- package/src/lib/components/datadisplay/List/List.tsx +0 -8
- package/src/lib/components/datadisplay/Tooltip/Tooltip.test.tsx +0 -98
- package/src/lib/components/datadisplay/Tooltip/Tooltip.tsx +0 -9
- package/src/lib/components/feedback/Alert/Alert.test.tsx +0 -139
- package/src/lib/components/feedback/Alert/Alert.tsx +0 -10
- package/src/lib/components/landmarks/Header/Header.tsx +0 -140
- package/src/lib/components/landmarks/Header/HeaderActionButtons.tsx +0 -117
- package/src/lib/components/landmarks/Header/HeaderStyles.tsx +0 -62
- package/src/lib/components/navigation/Drawer/Drawer.test.tsx +0 -95
- package/src/lib/components/navigation/Drawer/Drawer.tsx +0 -21
- package/src/lib/components/navigation/MobileNavigation/MobileNavigation.tsx +0 -276
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationAvatar.tsx +0 -334
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.tsx +0 -77
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationDrawer.tsx +0 -197
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.tsx +0 -143
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.tsx +0 -192
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.tsx +0 -67
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.tsx +0 -192
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.tsx +0 -217
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationMotion.tsx +0 -119
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.tsx +0 -35
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationSearch.tsx +0 -114
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationSearchStyles.tsx +0 -47
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationStyles.tsx +0 -320
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.tsx +0 -59
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationToggleX.tsx +0 -51
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigation.tsx +0 -468
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationAvatar.tsx +0 -208
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.tsx +0 -75
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.tsx +0 -196
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.tsx +0 -94
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.tsx +0 -212
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.tsx +0 -240
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationMotion.tsx +0 -119
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationStyles.tsx +0 -302
- package/src/lib/components/pages/ErrorPage/ErrorPage.test.tsx +0 -78
- package/src/lib/components/pages/ErrorPage/ErrorPage.tsx +0 -50
- package/src/lib/components/pages/ErrorPage/ErrorPageStyles.tsx +0 -30
- package/src/lib/components/pages/SideInSide/SideInSide.tsx +0 -100
- package/src/lib/components/pages/SideInSide/SideInSideStyles.tsx +0 -62
- package/src/lib/components/stream/AppSwitcher/AppSwitcher.tsx +0 -392
- package/src/lib/components/stream/AppSwitcher/AppSwitcherItem.tsx +0 -83
- package/src/lib/components/stream/AppSwitcher/AppSwitcherStyles.tsx +0 -325
- package/src/lib/components/stream/AppSwitcher/constants.tsx +0 -28
- package/src/lib/index.tsx +0 -148
- package/src/lib/lang/en-us.js +0 -6
- package/src/lib/types/components/navigation/VerticalNavigation.ts +0 -52
- package/src/lib/types/components/navigation/VerticalNavigationAvatar.ts +0 -26
- package/src/lib/types/components/stream/AppSwitcher.ts +0 -10
- package/src/lib/types/index.ts +0 -9
- package/src/lib/utils/constants.tsx +0 -11
- package/src/lib/utils/helpers.tsx +0 -77
- package/src/lib/utils/hooks.tsx +0 -33
- package/src/lib/utils/index.tsx +0 -4
- package/src/lib/utils/theme.tsx +0 -79
- package/src/react-app-env.d.ts +0 -1
- package/src/setupTests.ts +0 -5
- package/src/stories/Components/DataDisplay/Avatar/Accessibility.stories.mdx +0 -34
- package/src/stories/Components/DataDisplay/Avatar/AllCombinations.tsx +0 -56
- package/src/stories/Components/DataDisplay/Avatar/Avatar.stories.tsx +0 -19
- package/src/stories/Components/DataDisplay/Avatar/Examples.stories.tsx +0 -278
- package/src/stories/Components/DataDisplay/Avatar/Overview.stories.mdx +0 -47
- package/src/stories/Components/DataDisplay/Chip/Accessibility.stories.mdx +0 -29
- package/src/stories/Components/DataDisplay/Chip/AllCombinations.tsx +0 -58
- package/src/stories/Components/DataDisplay/Chip/Chip.stories.tsx +0 -21
- package/src/stories/Components/DataDisplay/Chip/Examples.stories.tsx +0 -126
- package/src/stories/Components/DataDisplay/Chip/Overview.stories.mdx +0 -57
- package/src/stories/Components/DataDisplay/List/Accessibility.stories.mdx +0 -54
- package/src/stories/Components/DataDisplay/List/AllCombinations.tsx +0 -396
- package/src/stories/Components/DataDisplay/List/Examples.stories.tsx +0 -501
- package/src/stories/Components/DataDisplay/List/List.stories.tsx +0 -35
- package/src/stories/Components/DataDisplay/List/Overview.stories.mdx +0 -69
- package/src/stories/Components/DataDisplay/Table/Overview.stories.mdx +0 -70
- package/src/stories/Components/DataDisplay/Tooltip/Accessibility.stories.mdx +0 -39
- package/src/stories/Components/DataDisplay/Tooltip/AllCombinations.tsx +0 -134
- package/src/stories/Components/DataDisplay/Tooltip/Examples.stories.tsx +0 -237
- package/src/stories/Components/DataDisplay/Tooltip/Overview.stories.mdx +0 -58
- package/src/stories/Components/DataDisplay/Tooltip/Tooltip.stories.tsx +0 -22
- package/src/stories/Components/Feedback/Alert/Accessibility.stories.mdx +0 -25
- package/src/stories/Components/Feedback/Alert/Alert.stories.tsx +0 -22
- package/src/stories/Components/Feedback/Alert/AllCombinations.tsx +0 -37
- package/src/stories/Components/Feedback/Alert/Examples.stories.tsx +0 -137
- package/src/stories/Components/Feedback/Alert/Overview.stories.mdx +0 -62
- package/src/stories/Components/Inputs/Autocomplete/Accessibility.stories.mdx +0 -31
- package/src/stories/Components/Inputs/Autocomplete/AllCombinations.tsx +0 -182
- package/src/stories/Components/Inputs/Autocomplete/Autocomplete.stories.tsx +0 -31
- package/src/stories/Components/Inputs/Autocomplete/Examples.stories.tsx +0 -233
- package/src/stories/Components/Inputs/Autocomplete/Overview.stories.mdx +0 -52
- package/src/stories/Components/Inputs/Button/Accessibility.stories.mdx +0 -52
- package/src/stories/Components/Inputs/Button/AllCombinations.tsx +0 -53
- package/src/stories/Components/Inputs/Button/Button.stories.tsx +0 -23
- package/src/stories/Components/Inputs/Button/Examples.stories.tsx +0 -190
- package/src/stories/Components/Inputs/Button/Overview.stories.mdx +0 -52
- package/src/stories/Components/Inputs/Checkbox/Accessibility.stories.mdx +0 -38
- package/src/stories/Components/Inputs/Checkbox/AllCombinations.tsx +0 -55
- package/src/stories/Components/Inputs/Checkbox/Checkbox.stories.tsx +0 -22
- package/src/stories/Components/Inputs/Checkbox/Examples.stories.tsx +0 -363
- package/src/stories/Components/Inputs/Checkbox/Overview.stories.mdx +0 -63
- package/src/stories/Components/Inputs/IconButton/Examples.stories.tsx +0 -24
- package/src/stories/Components/Inputs/IconButton/IconButton.stories.tsx +0 -26
- package/src/stories/Components/Inputs/Radio/Accessibility.stories.mdx +0 -61
- package/src/stories/Components/Inputs/Radio/AllCombinations.tsx +0 -75
- package/src/stories/Components/Inputs/Radio/Examples.stories.tsx +0 -333
- package/src/stories/Components/Inputs/Radio/Overview.stories.mdx +0 -74
- package/src/stories/Components/Inputs/Radio/Radio.stories.tsx +0 -22
- package/src/stories/Components/Inputs/Select/Accessibility.stories.mdx +0 -51
- package/src/stories/Components/Inputs/Select/AllCombinations.tsx +0 -63
- package/src/stories/Components/Inputs/Select/Examples.stories.tsx +0 -803
- package/src/stories/Components/Inputs/Select/Overview.stories.mdx +0 -73
- package/src/stories/Components/Inputs/Select/Select.stories.tsx +0 -22
- package/src/stories/Components/Inputs/Slider/Accessibility.stories.mdx +0 -43
- package/src/stories/Components/Inputs/Slider/AllCombinations.tsx +0 -30
- package/src/stories/Components/Inputs/Slider/Examples.stories.tsx +0 -146
- package/src/stories/Components/Inputs/Slider/Overview.stories.mdx +0 -59
- package/src/stories/Components/Inputs/Slider/Slider.stories.tsx +0 -27
- package/src/stories/Components/Inputs/Switch/Accessibility.stories.mdx +0 -34
- package/src/stories/Components/Inputs/Switch/AllCombinations.tsx +0 -45
- package/src/stories/Components/Inputs/Switch/Examples.stories.tsx +0 -213
- package/src/stories/Components/Inputs/Switch/Overview.stories.mdx +0 -62
- package/src/stories/Components/Inputs/Switch/Switch.stories.tsx +0 -22
- package/src/stories/Components/Inputs/TextField/Accessibility.stories.mdx +0 -29
- package/src/stories/Components/Inputs/TextField/AllCombinations.tsx +0 -57
- package/src/stories/Components/Inputs/TextField/Examples.stories.tsx +0 -127
- package/src/stories/Components/Inputs/TextField/Overview.stories.mdx +0 -60
- package/src/stories/Components/Inputs/TextField/TextField.stories.tsx +0 -261
- package/src/stories/Components/Inputs/ToggleButton/Accessibility.stories.mdx +0 -32
- package/src/stories/Components/Inputs/ToggleButton/AllCombinations.tsx +0 -113
- package/src/stories/Components/Inputs/ToggleButton/Examples.stories.tsx +0 -339
- package/src/stories/Components/Inputs/ToggleButton/Overview.stories.mdx +0 -55
- package/src/stories/Components/Inputs/ToggleButton/ToggleButton.stories.tsx +0 -19
- package/src/stories/Components/Landmarks/Header/Examples.stories.tsx +0 -197
- package/src/stories/Components/Landmarks/Header/Header.stories.tsx +0 -34
- package/src/stories/Components/Landmarks/Header/Overview.stories.mdx +0 -44
- package/src/stories/Components/Navigation/Drawer/Accessibility.stories.mdx +0 -13
- package/src/stories/Components/Navigation/Drawer/Drawer.stories.tsx +0 -80
- package/src/stories/Components/Navigation/Drawer/Examples.stories.tsx +0 -440
- package/src/stories/Components/Navigation/Drawer/Overview.stories.mdx +0 -43
- package/src/stories/Components/Navigation/MobileNavigation/Accessibility.stories.mdx +0 -14
- package/src/stories/Components/Navigation/MobileNavigation/Examples.stories.tsx +0 -384
- package/src/stories/Components/Navigation/MobileNavigation/MobileNavigation.stories.tsx +0 -24
- package/src/stories/Components/Navigation/MobileNavigation/Overview.stories.mdx +0 -47
- package/src/stories/Components/Navigation/VerticalNavigation/Accessibility.stories.mdx +0 -14
- package/src/stories/Components/Navigation/VerticalNavigation/Examples.stories.tsx +0 -307
- package/src/stories/Components/Navigation/VerticalNavigation/Overview.stories.mdx +0 -47
- package/src/stories/Components/Navigation/VerticalNavigation/VerticalNavigation.stories.tsx +0 -24
- package/src/stories/ContactUs.stories.mdx +0 -21
- package/src/stories/Experimental/Test.stories.mdx +0 -46
- package/src/stories/GettingStarted/Designer.stories.mdx +0 -86
- package/src/stories/GettingStarted/Developer.stories.mdx +0 -134
- package/src/stories/Guidelines/Accessibility/AssistiveTechnology.stories.mdx +0 -70
- package/src/stories/Guidelines/Accessibility/ColorAndContrast.stories.mdx +0 -109
- package/src/stories/Guidelines/Accessibility/Hierarchy.stories.mdx +0 -119
- package/src/stories/Guidelines/Accessibility/Imagery.stories.mdx +0 -136
- package/src/stories/Guidelines/Accessibility/Overview.stories.mdx +0 -44
- package/src/stories/Guidelines/Accessibility/Principles.stories.mdx +0 -156
- package/src/stories/Guidelines/Accessibility/SoundAndMotion.stories.mdx +0 -59
- package/src/stories/Guidelines/Accessibility/Typography.stories.mdx +0 -69
- package/src/stories/Guidelines/Accessibility/Writing.stories.mdx +0 -188
- package/src/stories/Guidelines/Styleguide/ColorSwatch.tsx +0 -53
- package/src/stories/Guidelines/Styleguide/Colors.stories.mdx +0 -118
- package/src/stories/Guidelines/Styleguide/Typography.stories.mdx +0 -84
- package/src/stories/Introduction.stories.mdx +0 -65
- package/src/stories/Pages/ErrorPage.stories.tsx +0 -30
- package/src/stories/Pages/SideInSide.stories.tsx +0 -195
- package/src/stories/Roadmap.stories.mdx +0 -19
- package/src/stories/Templates/Login.stories.mdx +0 -46
- package/src/stories/assets/Atomic_Design_Icons-Dark.svg +0 -24
- package/src/stories/assets/Atomic_Design_Icons-Light.svg +0 -25
- 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 +0 -6
- 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 +0 -9
- package/src/stories/assets/organisms.svg +0 -22
- package/src/stories/assets/pages.svg +0 -5
- package/src/stories/assets/particles.svg +0 -4
- package/src/stories/assets/templates.svg +0 -4
- package/src/stories/assets/testData.tsx +0 -102
- 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 +0 -44
- package/tsconfig.eslint.json +0 -16
- package/tsconfig.json +0 -50
|
@@ -1,392 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, ReactElement } from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import jwtDecode from 'jwt-decode'
|
|
4
|
-
import queryString from 'query-string'
|
|
5
|
-
import { defaultMessages } from '../../../lang/en-us'
|
|
6
|
-
import AppSwitcherItem, { LogoVariants } from './AppSwitcherItem'
|
|
7
|
-
import {
|
|
8
|
-
AppListHeader, AppListItem, AppOrganisationCount, StyledSVG,
|
|
9
|
-
BackButton, MenuContent, OrganisationLink, OrganisationList,
|
|
10
|
-
SearchBox, SearchContent, SelectedOrganisation, AppSwitcherPanel
|
|
11
|
-
} from './AppSwitcherStyles'
|
|
12
|
-
import { Constants } from './constants'
|
|
13
|
-
import { DRAWER_WIDTH } from '../../navigation/VerticalNavigation/VerticalNavigationStyles'
|
|
14
|
-
import { IApplication } from '../../../types'
|
|
15
|
-
|
|
16
|
-
interface IProps {
|
|
17
|
-
userId?: string
|
|
18
|
-
layout?: string
|
|
19
|
-
token?: string
|
|
20
|
-
apiKey?: string
|
|
21
|
-
baseUrl?: string
|
|
22
|
-
applications?: IApplication[] | null
|
|
23
|
-
currentApplicationId?: number
|
|
24
|
-
localization?: any
|
|
25
|
-
isAppSwitcherOpen?: boolean
|
|
26
|
-
setIsAppSwitcherOpen?: any
|
|
27
|
-
isDrawerOpen?: boolean
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const AppSwitcher = (props: IProps): ReactElement | null => {
|
|
31
|
-
const {
|
|
32
|
-
isAppSwitcherOpen, setIsAppSwitcherOpen,
|
|
33
|
-
isDrawerOpen, localization,
|
|
34
|
-
apiKey = '', baseUrl
|
|
35
|
-
} = props
|
|
36
|
-
let { token } = props
|
|
37
|
-
|
|
38
|
-
// Controls whether the application panel is open or not.
|
|
39
|
-
// const [isOpen, setIsOpen] = useState(isAppSwitcherOpen)
|
|
40
|
-
// Holds the applications which are displayed.
|
|
41
|
-
const [applications, setApplications] = useState<IApplication[]>([])
|
|
42
|
-
// Controls which tab is active.
|
|
43
|
-
const [activeTab, setActiveTab] = useState(Constants.Tabs.ListApplications)
|
|
44
|
-
// Holds the list of filtered organisations (on the second tab).
|
|
45
|
-
const [filteredOrgs, setFilteredOrgs] = useState<any[] | undefined>([])
|
|
46
|
-
// Holds a reference to the active application (on the second tab).
|
|
47
|
-
const [activeApplication, setActiveApplication] = useState<IApplication | null>(null)
|
|
48
|
-
// Stores any org filter text (on the second tab).
|
|
49
|
-
const [searchString, setSearchString] = useState('')
|
|
50
|
-
|
|
51
|
-
const messages = { ...localization, ...defaultMessages }
|
|
52
|
-
|
|
53
|
-
let userId = props.userId ?? ''
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Toggles display of the Stream suite application dialog.
|
|
57
|
-
* @param event {React.MouseEvent} - Click event.
|
|
58
|
-
*/
|
|
59
|
-
// const handleToggleAppsClick = (event: React.MouseEvent<HTMLButtonElement>): void => {
|
|
60
|
-
// setIsOpen(!isOpen)
|
|
61
|
-
// }
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Handles closing of the application dialog.
|
|
65
|
-
*/
|
|
66
|
-
const handleDialogClose = (): void => {
|
|
67
|
-
// setIsOpen(false)
|
|
68
|
-
setIsAppSwitcherOpen(false)
|
|
69
|
-
|
|
70
|
-
setTimeout(() => {
|
|
71
|
-
setSearchString('')
|
|
72
|
-
setActiveApplication(null)
|
|
73
|
-
setActiveTab(Constants.Tabs.ListApplications)
|
|
74
|
-
}, 400)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Updates the search/filter text.
|
|
79
|
-
* @param event {React.ChangeEvent}
|
|
80
|
-
*/
|
|
81
|
-
const handleSearchChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
82
|
-
setSearchString(event.target.value)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Navigates to the organisation tab for an application with children.
|
|
87
|
-
* @param event {React.MouseEvent} - Click event.
|
|
88
|
-
* @param applicationId {number | undefined} - Unique identifier of the application.
|
|
89
|
-
* @returns {void}
|
|
90
|
-
*/
|
|
91
|
-
const handleGoToAppClick = (event: React.MouseEvent, applicationId: number | undefined): any => {
|
|
92
|
-
event?.preventDefault()
|
|
93
|
-
event?.stopPropagation()
|
|
94
|
-
|
|
95
|
-
if (!applicationId) {
|
|
96
|
-
return
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const selectedApplication = applications.find(a => a.applicationId === applicationId)
|
|
100
|
-
|
|
101
|
-
if (!selectedApplication) {
|
|
102
|
-
return
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
setFilteredOrgs(selectedApplication.children)
|
|
106
|
-
setActiveApplication(selectedApplication)
|
|
107
|
-
setActiveTab(Constants.Tabs.ListOrgs)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Renders an application logo.
|
|
112
|
-
* @param internalName {string | null | undefined } - Internal name of the application.
|
|
113
|
-
* @returns {ReactElement | null } SVG containing the application logo retrieved from the CDN.
|
|
114
|
-
*/
|
|
115
|
-
const renderApplicationLogo = (internalName: string | null | undefined, logoVariant: string): ReactElement | null => {
|
|
116
|
-
if (!internalName) {
|
|
117
|
-
return <></>
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const urlToIcon = `${Constants.AssetsUrl}${internalName}/logo/latest/${logoVariant ?? LogoVariants.Default}.svg`
|
|
121
|
-
|
|
122
|
-
return (
|
|
123
|
-
<svg>
|
|
124
|
-
<image xlinkHref={urlToIcon} width="60" height="60" />
|
|
125
|
-
</svg>
|
|
126
|
-
)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Queries the Steam Home API to fetch a list of applications.
|
|
131
|
-
* @returns {Promise<IApplication[]>} A list of applications the user has access to.
|
|
132
|
-
*/
|
|
133
|
-
const getApplicationsForUser = async (): Promise<IApplication[]> => {
|
|
134
|
-
// If the access token has changed the endpoint should be called again.
|
|
135
|
-
if (token && typeof token === 'string' && token !== window.localStorage.getItem(Constants.LocalStorageKey.Token)) {
|
|
136
|
-
if (!userId) {
|
|
137
|
-
// Extract user identifier from the JWT.
|
|
138
|
-
const decodedToken: any = jwtDecode(token)
|
|
139
|
-
userId = decodedToken[Constants.HomeAttributes.UserId]
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const response = await fetch(`${baseUrl ?? Constants.BaseUrl}/users/${userId}/application-instances`, {
|
|
143
|
-
method: 'get',
|
|
144
|
-
headers: new Headers({
|
|
145
|
-
Authorization: `Bearer ${token}`,
|
|
146
|
-
'x-api-key': apiKey
|
|
147
|
-
})
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
if (response.status !== 200) {
|
|
151
|
-
console.error('Unable to retrieve user applications from Stream Home')
|
|
152
|
-
return []
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const data = await response.json()
|
|
156
|
-
|
|
157
|
-
// Store the latest access token.
|
|
158
|
-
window.localStorage.setItem(Constants.LocalStorageKey.Token, token)
|
|
159
|
-
|
|
160
|
-
return data.map((application: IApplication) => {
|
|
161
|
-
const { applicationId, applicationName, shortName, internalName, customName, url } = application
|
|
162
|
-
|
|
163
|
-
return {
|
|
164
|
-
applicationId,
|
|
165
|
-
applicationName,
|
|
166
|
-
shortName,
|
|
167
|
-
internalName,
|
|
168
|
-
customName,
|
|
169
|
-
url: url || ''
|
|
170
|
-
}
|
|
171
|
-
}) as [IApplication]
|
|
172
|
-
} else {
|
|
173
|
-
return []
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
useEffect(() => {
|
|
178
|
-
const loadData = async (): Promise<void> => {
|
|
179
|
-
let applicationInstances: IApplication[] = []
|
|
180
|
-
let userApplications: IApplication[] = []
|
|
181
|
-
|
|
182
|
-
if (!token) {
|
|
183
|
-
const parsedQueryString = queryString.parse(window.location.search)
|
|
184
|
-
|
|
185
|
-
if (parsedQueryString.token && typeof parsedQueryString.token === 'string') {
|
|
186
|
-
token = parsedQueryString.token
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
if (!props.applications || props.applications.length === 0) {
|
|
191
|
-
applicationInstances = await getApplicationsForUser()
|
|
192
|
-
} else {
|
|
193
|
-
// A hard-coded list of applications has been passed to the component.
|
|
194
|
-
applicationInstances = props.applications
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (Array.isArray(applicationInstances) && applicationInstances.length) {
|
|
198
|
-
// Get a distinct list of applications the user has access to.
|
|
199
|
-
const uniqueApplicationIds: number[] = applicationInstances.map((item: { applicationId: number }) => item.applicationId).filter((value: number, index: number, self: number[]) => self.indexOf(value) === index)
|
|
200
|
-
|
|
201
|
-
// Iterate over these to build up the userApplications array.
|
|
202
|
-
uniqueApplicationIds.forEach(applicationId => {
|
|
203
|
-
const applications = applicationInstances.filter(instance => instance.applicationId === applicationId)
|
|
204
|
-
|
|
205
|
-
if (applications.length > 1) {
|
|
206
|
-
// This is an application with multiple orgs/tenants the user has access to.
|
|
207
|
-
userApplications.push({
|
|
208
|
-
applicationId,
|
|
209
|
-
applicationName: applications[0].applicationName,
|
|
210
|
-
shortName: applications[0].shortName,
|
|
211
|
-
internalName: applications[0].internalName,
|
|
212
|
-
url: '',
|
|
213
|
-
children: applications.map(a => {
|
|
214
|
-
return {
|
|
215
|
-
name: a.customName ?? a.applicationName,
|
|
216
|
-
url: a.url
|
|
217
|
-
}
|
|
218
|
-
})
|
|
219
|
-
})
|
|
220
|
-
} else {
|
|
221
|
-
// This is a standalone application.
|
|
222
|
-
userApplications.push({
|
|
223
|
-
applicationId: applications[0].applicationId,
|
|
224
|
-
applicationName: applications[0].applicationName,
|
|
225
|
-
shortName: applications[0].shortName,
|
|
226
|
-
internalName: applications[0].internalName,
|
|
227
|
-
url: applications[0].url
|
|
228
|
-
})
|
|
229
|
-
}
|
|
230
|
-
})
|
|
231
|
-
|
|
232
|
-
// Serialize and cache the applications returned.
|
|
233
|
-
window.localStorage.setItem(Constants.LocalStorageKey.Applications, JSON.stringify(userApplications))
|
|
234
|
-
} else {
|
|
235
|
-
const localApplications: string | null = window.localStorage.getItem(Constants.LocalStorageKey.Applications)
|
|
236
|
-
|
|
237
|
-
if (localApplications) {
|
|
238
|
-
// Recreate the application state from local storage.
|
|
239
|
-
userApplications = JSON.parse(localApplications)
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// Store the user's applications.
|
|
244
|
-
setApplications(userApplications)
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
loadData()
|
|
248
|
-
.catch(console.error)
|
|
249
|
-
}, [token, apiKey, baseUrl, userId])
|
|
250
|
-
|
|
251
|
-
const handleKeyDown = (event: React.KeyboardEvent) => {
|
|
252
|
-
if (event && event.type === 'keydown') {
|
|
253
|
-
// Close AppSwitcher if Escape key is pressed
|
|
254
|
-
if ((event as React.KeyboardEvent).key === 'Escape') {
|
|
255
|
-
handleDialogClose()
|
|
256
|
-
|
|
257
|
-
// Doesnt return focus but we need to investigate MUI again
|
|
258
|
-
// so that should handle it
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
if (!props.applications && (!token || !apiKey)) {
|
|
264
|
-
return null
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
return (
|
|
268
|
-
<AppSwitcherPanel
|
|
269
|
-
id="app-switcher-menu"
|
|
270
|
-
style={{
|
|
271
|
-
display: isAppSwitcherOpen ? 'block' : 'none',
|
|
272
|
-
left: isDrawerOpen ? DRAWER_WIDTH.Expanded : DRAWER_WIDTH.Collapsed - 3
|
|
273
|
-
}}
|
|
274
|
-
role='dialog'
|
|
275
|
-
aria-label="App Switcher"
|
|
276
|
-
onKeyDown={handleKeyDown}
|
|
277
|
-
>
|
|
278
|
-
{activeTab === Constants.Tabs.ListApplications
|
|
279
|
-
? (
|
|
280
|
-
<div>
|
|
281
|
-
<AppListHeader>
|
|
282
|
-
<svg>
|
|
283
|
-
<image
|
|
284
|
-
xlinkHref={`${Constants.AssetsUrl}suite/logo/latest/icon.svg`}
|
|
285
|
-
width="24"
|
|
286
|
-
height="24" />
|
|
287
|
-
</svg>
|
|
288
|
-
{messages['your-apps']}
|
|
289
|
-
</AppListHeader>
|
|
290
|
-
<MenuContent
|
|
291
|
-
style={{
|
|
292
|
-
display: activeTab === 1 ? 'flex' : 'none'
|
|
293
|
-
}}
|
|
294
|
-
>
|
|
295
|
-
{applications.map(({ applicationId, applicationName, shortName, internalName, url, children }) => (
|
|
296
|
-
<AppListItem key={applicationId}>
|
|
297
|
-
{url && (
|
|
298
|
-
<AppSwitcherItem
|
|
299
|
-
internalName={internalName}
|
|
300
|
-
shortName={shortName}
|
|
301
|
-
url={url}
|
|
302
|
-
handleGoToAppClick={handleGoToAppClick}
|
|
303
|
-
/>
|
|
304
|
-
)}
|
|
305
|
-
{!url && (
|
|
306
|
-
<AppSwitcherItem
|
|
307
|
-
internalName={internalName}
|
|
308
|
-
shortName={shortName}
|
|
309
|
-
handleGoToAppClick={handleGoToAppClick}
|
|
310
|
-
applicationId={applicationId}
|
|
311
|
-
/>
|
|
312
|
-
)}
|
|
313
|
-
{children && (
|
|
314
|
-
<AppOrganisationCount>
|
|
315
|
-
{children.length}
|
|
316
|
-
</AppOrganisationCount>
|
|
317
|
-
)}
|
|
318
|
-
</AppListItem>
|
|
319
|
-
))}
|
|
320
|
-
</MenuContent>
|
|
321
|
-
</div>)
|
|
322
|
-
: null}
|
|
323
|
-
{activeTab === Constants.Tabs.ListOrgs
|
|
324
|
-
? (
|
|
325
|
-
<SearchContent
|
|
326
|
-
style={{
|
|
327
|
-
display: activeTab === 2 ? 'flex' : 'none'
|
|
328
|
-
}}
|
|
329
|
-
>
|
|
330
|
-
<BackButton
|
|
331
|
-
onClick={() => {
|
|
332
|
-
setActiveTab(Constants.Tabs.ListApplications)
|
|
333
|
-
setSearchString('')
|
|
334
|
-
}}
|
|
335
|
-
>
|
|
336
|
-
<StyledSVG className="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiBox-root css-1om0hkc" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="ChevronLeftIcon">
|
|
337
|
-
<path d="M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"></path>
|
|
338
|
-
</StyledSVG>
|
|
339
|
-
{messages['back-to']}
|
|
340
|
-
</BackButton>
|
|
341
|
-
<SelectedOrganisation>
|
|
342
|
-
{renderApplicationLogo(activeApplication?.internalName, LogoVariants.Solid)}
|
|
343
|
-
<span>
|
|
344
|
-
{activeApplication ? activeApplication.applicationName : ''}
|
|
345
|
-
</span>
|
|
346
|
-
</SelectedOrganisation>
|
|
347
|
-
<SearchBox
|
|
348
|
-
id="app-switcher-search-org"
|
|
349
|
-
type={'text'}
|
|
350
|
-
value={searchString}
|
|
351
|
-
onChange={handleSearchChange}
|
|
352
|
-
placeholder={messages.search}
|
|
353
|
-
/>
|
|
354
|
-
<OrganisationList>
|
|
355
|
-
{filteredOrgs?.filter(o => o.name.toLowerCase().includes(searchString.toLowerCase())).map((org, i) => (
|
|
356
|
-
<OrganisationLink
|
|
357
|
-
key={i}
|
|
358
|
-
href={org.url}
|
|
359
|
-
target="_blank"
|
|
360
|
-
>
|
|
361
|
-
{org.name}
|
|
362
|
-
<StyledSVG className="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiBox-root css-1om0hkc" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="ChevronRightIcon">
|
|
363
|
-
<path d="M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path>
|
|
364
|
-
</StyledSVG>
|
|
365
|
-
</OrganisationLink>
|
|
366
|
-
))}
|
|
367
|
-
</OrganisationList>
|
|
368
|
-
</SearchContent>)
|
|
369
|
-
: null}
|
|
370
|
-
</AppSwitcherPanel>
|
|
371
|
-
)
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
AppSwitcher.propTypes = {
|
|
375
|
-
accessToken: PropTypes.string,
|
|
376
|
-
apiKey: PropTypes.string,
|
|
377
|
-
layout: PropTypes.string,
|
|
378
|
-
userId: PropTypes.number,
|
|
379
|
-
baseUrl: PropTypes.string,
|
|
380
|
-
localization: PropTypes.object,
|
|
381
|
-
currentApplicationId: PropTypes.number,
|
|
382
|
-
applications: PropTypes.array
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
AppSwitcher.defaultProps = {
|
|
386
|
-
layout: Constants.Layout.Vertical,
|
|
387
|
-
baseUrl: Constants.BaseUrl,
|
|
388
|
-
localization: {},
|
|
389
|
-
applications: []
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
export default AppSwitcher
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react'
|
|
2
|
-
import { Constants } from './constants'
|
|
3
|
-
import { AppLink, AppName, StyledLogoSVG } from './AppSwitcherStyles'
|
|
4
|
-
|
|
5
|
-
// Bug in the naming of the icons on the CDN
|
|
6
|
-
export const LogoVariants = {
|
|
7
|
-
Default: 'icon',
|
|
8
|
-
Solid: 'icon-solid',
|
|
9
|
-
Outlined: 'icon-outlined',
|
|
10
|
-
White: 'icon-white'
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface IAppSwitcherItemProps {
|
|
14
|
-
internalName: string
|
|
15
|
-
shortName: string
|
|
16
|
-
handleGoToAppClick: Function
|
|
17
|
-
applicationId?: number
|
|
18
|
-
url?: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const AppSwitcherItem = (props: IAppSwitcherItemProps): ReactElement => {
|
|
22
|
-
const {
|
|
23
|
-
applicationId, internalName, shortName,
|
|
24
|
-
url, handleGoToAppClick
|
|
25
|
-
} = props
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Renders an application logo.
|
|
29
|
-
* @param internalName {string | null | undefined } - Internal name of the application.
|
|
30
|
-
* @returns {ReactElement | null } SVG containing the application logo retrieved from the CDN.
|
|
31
|
-
*/
|
|
32
|
-
const renderApplicationLogo = (internalName: string | null | undefined, logoVariant: string): ReactElement | null => {
|
|
33
|
-
if (!internalName) {
|
|
34
|
-
return <></>
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const urlToIcon = `${Constants.AssetsUrl}${internalName}/logo/latest/${logoVariant ?? LogoVariants.Default}.svg`
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<StyledLogoSVG>
|
|
41
|
-
<image xlinkHref={urlToIcon} width="60" height="60" />
|
|
42
|
-
</StyledLogoSVG>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const solidLogo = renderApplicationLogo(internalName, LogoVariants.Solid)
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<AppLink
|
|
50
|
-
href={url ?? '#'}
|
|
51
|
-
target="_blank"
|
|
52
|
-
onClick={event => applicationId ? handleGoToAppClick(event, applicationId) : null}
|
|
53
|
-
>
|
|
54
|
-
{applicationId && (
|
|
55
|
-
// Create a stack effect to indicate multiple
|
|
56
|
-
<>
|
|
57
|
-
<span style={{
|
|
58
|
-
position: 'absolute',
|
|
59
|
-
top: '4px',
|
|
60
|
-
transform: 'scale(0.8)',
|
|
61
|
-
zIndex: 0
|
|
62
|
-
}}>
|
|
63
|
-
{solidLogo}
|
|
64
|
-
</span>
|
|
65
|
-
<span style={{
|
|
66
|
-
position: 'absolute',
|
|
67
|
-
top: '10px',
|
|
68
|
-
transform: 'scale(0.9)',
|
|
69
|
-
zIndex: 0
|
|
70
|
-
}}>
|
|
71
|
-
{solidLogo}
|
|
72
|
-
</span>
|
|
73
|
-
</>
|
|
74
|
-
)}
|
|
75
|
-
{solidLogo}
|
|
76
|
-
<AppName>
|
|
77
|
-
{shortName}
|
|
78
|
-
</AppName>
|
|
79
|
-
</AppLink>
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export default AppSwitcherItem
|