@learningpool/ui 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +40 -0
- package/.github/pull_request_template.md +23 -0
- package/.github/renovate.json +57 -0
- package/.github/workflows/integration.yml +53 -0
- package/.github/workflows/wss.yml +22 -0
- package/.jest-test-results.json +1 -0
- package/.releaserc +32 -0
- package/.storybook/learningpoolTheme.js +39 -0
- package/.storybook/main.js +21 -0
- package/.storybook/manager-head.html +175 -0
- package/.storybook/manager.js +34 -0
- package/.storybook/preview-head.html +212 -0
- package/.storybook/preview.js +120 -0
- package/.storybook/storybook-sort.js +54 -0
- package/CHANGELOG.md +6 -0
- package/amplify.yml +16 -0
- package/babel.config.json +14 -0
- package/{assets → dist/assets}/Images.d.ts +0 -0
- package/{assets → dist/assets}/Images.js +0 -0
- package/{components → dist/components}/atoms/Autocomplete/Autocomplete.d.ts +0 -0
- package/{components → dist/components}/atoms/Autocomplete/Autocomplete.js +0 -0
- package/{components → dist/components}/atoms/Button/Button.d.ts +0 -0
- package/{components → dist/components}/atoms/Button/Button.js +0 -0
- package/{components → dist/components}/atoms/Checkbox/Checkbox.d.ts +0 -0
- package/{components → dist/components}/atoms/Checkbox/Checkbox.js +0 -0
- package/{components → dist/components}/atoms/IconButton/IconButton.d.ts +0 -0
- package/{components → dist/components}/atoms/IconButton/IconButton.js +0 -0
- package/{components → dist/components}/atoms/Radio/Radio.d.ts +0 -0
- package/{components → dist/components}/atoms/Radio/Radio.js +0 -0
- package/{components → dist/components}/atoms/Select/Select.d.ts +0 -0
- package/{components → dist/components}/atoms/Select/Select.js +0 -0
- package/{components → dist/components}/atoms/Slider/Slider.d.ts +0 -0
- package/{components → dist/components}/atoms/Slider/Slider.js +0 -0
- package/{components → dist/components}/atoms/Switch/Switch.d.ts +0 -0
- package/{components → dist/components}/atoms/Switch/Switch.js +0 -0
- package/{components → dist/components}/atoms/TextField/TextField.d.ts +0 -0
- package/{components → dist/components}/atoms/TextField/TextField.js +0 -0
- package/{components → dist/components}/atoms/ToggleButton/ToggleButton.d.ts +0 -0
- package/{components → dist/components}/atoms/ToggleButton/ToggleButton.js +0 -0
- package/{components → dist/components}/datadisplay/Avatar/Avatar.d.ts +0 -0
- package/{components → dist/components}/datadisplay/Avatar/Avatar.js +0 -0
- package/{components → dist/components}/datadisplay/Chip/Chip.d.ts +0 -0
- package/{components → dist/components}/datadisplay/Chip/Chip.js +0 -0
- package/{components → dist/components}/datadisplay/List/List.d.ts +0 -0
- package/{components → dist/components}/datadisplay/List/List.js +0 -0
- package/{components → dist/components}/datadisplay/Tooltip/Tooltip.d.ts +0 -0
- package/{components → dist/components}/datadisplay/Tooltip/Tooltip.js +0 -0
- package/{components → dist/components}/feedback/Alert/Alert.d.ts +0 -0
- package/{components → dist/components}/feedback/Alert/Alert.js +0 -0
- package/{components → dist/components}/landmarks/Header/Header.d.ts +0 -0
- package/{components → dist/components}/landmarks/Header/Header.js +0 -0
- package/{components → dist/components}/landmarks/Header/HeaderActionButtons.d.ts +0 -0
- package/{components → dist/components}/landmarks/Header/HeaderActionButtons.js +0 -0
- package/{components → dist/components}/landmarks/Header/HeaderStyles.d.ts +0 -0
- package/{components → dist/components}/landmarks/Header/HeaderStyles.js +0 -0
- package/{components → dist/components}/navigation/Drawer/Drawer.d.ts +0 -0
- package/{components → dist/components}/navigation/Drawer/Drawer.js +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigation.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigation.js +64 -41
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatar.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatar.js +23 -19
- package/dist/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +3296 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatarStyles.js +4 -4
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationDrawer.d.ts +0 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationDrawer.js +71 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +1215 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationDrawerStyles.js +2 -2
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.js +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.js +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.js +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationMotion.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationMotion.js +0 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.d.ts +3 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.js +19 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationSearch.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationSearch.js +8 -6
- package/dist/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +1080 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationSearchStyles.js +2 -2
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationStyles.d.ts +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationStyles.js +0 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.d.ts +3 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +28 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationToggleX.d.ts +3 -0
- package/dist/components/navigation/MobileNavigation/MobileNavigationToggleX.js +28 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigation.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigation.js +18 -16
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationAvatar.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationAvatar.js +20 -25
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +3296 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +4 -4
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +5 -1
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationMotion.d.ts +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationMotion.js +0 -0
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +1163 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationStyles.js +3 -2
- package/{components → dist/components}/pages/ErrorPage/ErrorPage.d.ts +0 -0
- package/{components → dist/components}/pages/ErrorPage/ErrorPage.js +0 -0
- package/{components → dist/components}/pages/ErrorPage/ErrorPageStyles.d.ts +0 -0
- package/{components → dist/components}/pages/ErrorPage/ErrorPageStyles.js +0 -0
- package/{components → dist/components}/pages/SideInSide/SideInSide.d.ts +0 -0
- package/{components → dist/components}/pages/SideInSide/SideInSide.js +0 -0
- package/{components → dist/components}/pages/SideInSide/SideInSideStyles.d.ts +0 -0
- package/{components → dist/components}/pages/SideInSide/SideInSideStyles.js +0 -0
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcher.d.ts +0 -0
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcher.js +0 -0
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcherItem.d.ts +0 -0
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcherItem.js +0 -0
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcherStyles.d.ts +0 -0
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcherStyles.js +0 -0
- package/{components → dist/components}/stream/AppSwitcher/constants.d.ts +0 -0
- package/{components → dist/components}/stream/AppSwitcher/constants.js +0 -0
- package/{index.d.ts → dist/index.d.ts} +0 -0
- package/{index.js → dist/index.js} +0 -0
- package/{lang → dist/lang}/en-us.d.ts +0 -0
- package/{lang → dist/lang}/en-us.js +0 -0
- package/dist/package.json +41 -0
- package/{types → dist/types}/components/navigation/VerticalNavigation.d.ts +0 -0
- package/{types → dist/types}/components/navigation/VerticalNavigation.js +0 -0
- package/{types → dist/types}/components/navigation/VerticalNavigationAvatar.d.ts +1 -0
- package/{types → dist/types}/components/navigation/VerticalNavigationAvatar.js +0 -0
- package/{types → dist/types}/components/stream/AppSwitcher.d.ts +0 -0
- package/{types → dist/types}/components/stream/AppSwitcher.js +0 -0
- package/{types → dist/types}/index.d.ts +0 -0
- package/{types → dist/types}/index.js +0 -0
- package/{utils → dist/utils}/constants.d.ts +0 -0
- package/{utils → dist/utils}/constants.js +0 -0
- package/dist/utils/helpers.d.ts +21 -0
- package/dist/utils/helpers.js +64 -0
- package/{utils → dist/utils}/hooks.d.ts +0 -0
- package/{utils → dist/utils}/hooks.js +0 -0
- package/{utils → dist/utils}/index.d.ts +0 -0
- package/{utils → dist/utils}/index.js +0 -0
- package/{utils → dist/utils}/theme.d.ts +0 -0
- package/{utils → dist/utils}/theme.js +0 -0
- package/jest.config.ts +11 -0
- package/jest.setup.ts +5 -0
- package/{LICENSE → license} +0 -0
- package/merge.js +27 -0
- package/package.json +71 -4
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/assets/atoms.svg +5 -0
- package/public/assets/automation.svg +1 -0
- package/public/assets/avatar-1.jpg +0 -0
- package/public/assets/avatar-2.jpg +0 -0
- package/public/assets/avatar-3.jpg +0 -0
- package/public/assets/flux/icon-dark.svg +6 -0
- package/public/assets/flux/icon-light.svg +1 -0
- package/public/assets/flux/icon-white.svg +6 -0
- package/public/assets/flux/icon.svg +6 -0
- package/public/assets/flux/logo-dark.svg +22 -0
- package/public/assets/flux/logo-light.svg +1 -0
- package/public/assets/flux/logo-white.svg +22 -0
- package/public/assets/flux/logo.svg +22 -0
- package/public/assets/iPhone6.jpg +0 -0
- package/public/assets/iPhone6Plus.jpg +0 -0
- package/public/assets/lp-logo.png +0 -0
- package/public/assets/lplogo.svg +1 -0
- package/public/assets/molecules.svg +8 -0
- package/public/assets/organisms.svg +21 -0
- package/public/assets/pages.svg +4 -0
- package/public/assets/particles.svg +3 -0
- package/public/assets/stream-dark.png +0 -0
- package/public/assets/stream-suite-logo.svg +38 -0
- package/public/assets/stream-white.png +0 -0
- package/public/assets/stream.png +0 -0
- package/public/assets/templates.svg +3 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/public/site.webmanifest +1 -0
- package/{README.md → readme.md} +0 -0
- package/src/docs.tsx +167 -0
- package/src/lib/assets/Images.tsx +47 -0
- package/src/lib/assets/stream-suite-logo.svg +38 -0
- package/src/lib/components/atoms/Autocomplete/Autocomplete.test.tsx +179 -0
- package/src/lib/components/atoms/Autocomplete/Autocomplete.tsx +14 -0
- package/src/lib/components/atoms/Button/Button.test.tsx +166 -0
- package/src/lib/components/atoms/Button/Button.tsx +16 -0
- package/src/lib/components/atoms/Checkbox/Checkbox.test.tsx +85 -0
- package/src/lib/components/atoms/Checkbox/Checkbox.tsx +10 -0
- package/src/lib/components/atoms/IconButton/IconButton.test.tsx +60 -0
- package/src/lib/components/atoms/IconButton/IconButton.tsx +9 -0
- package/src/lib/components/atoms/Radio/Radio.test.tsx +136 -0
- package/src/lib/components/atoms/Radio/Radio.tsx +10 -0
- package/src/lib/components/atoms/Select/Select.test.tsx +158 -0
- package/src/lib/components/atoms/Select/Select.tsx +12 -0
- package/src/lib/components/atoms/Slider/Slider.test.tsx +103 -0
- package/src/lib/components/atoms/Slider/Slider.tsx +10 -0
- package/src/lib/components/atoms/Switch/Switch.test.tsx +96 -0
- package/src/lib/components/atoms/Switch/Switch.tsx +10 -0
- package/src/lib/components/atoms/TextField/TextField.test.tsx +131 -0
- package/src/lib/components/atoms/TextField/TextField.tsx +31 -0
- package/src/lib/components/atoms/ToggleButton/ToggleButton.test.tsx +122 -0
- package/src/lib/components/atoms/ToggleButton/ToggleButton.tsx +10 -0
- package/src/lib/components/datadisplay/Avatar/Avatar.test.tsx +187 -0
- package/src/lib/components/datadisplay/Avatar/Avatar.tsx +35 -0
- package/src/lib/components/datadisplay/Avatar/avatar-1.jpg +0 -0
- package/src/lib/components/datadisplay/Chip/Chip.test.tsx +82 -0
- package/src/lib/components/datadisplay/Chip/Chip.tsx +11 -0
- package/src/lib/components/datadisplay/List/List.test.tsx +168 -0
- package/src/lib/components/datadisplay/List/List.tsx +8 -0
- package/src/lib/components/datadisplay/Tooltip/Tooltip.test.tsx +98 -0
- package/src/lib/components/datadisplay/Tooltip/Tooltip.tsx +9 -0
- package/src/lib/components/feedback/Alert/Alert.test.tsx +139 -0
- package/src/lib/components/feedback/Alert/Alert.tsx +10 -0
- package/src/lib/components/landmarks/Header/Header.tsx +140 -0
- package/src/lib/components/landmarks/Header/HeaderActionButtons.tsx +117 -0
- package/src/lib/components/landmarks/Header/HeaderStyles.tsx +62 -0
- package/src/lib/components/navigation/Drawer/Drawer.test.tsx +95 -0
- package/src/lib/components/navigation/Drawer/Drawer.tsx +21 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigation.tsx +276 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationAvatar.tsx +334 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.tsx +77 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationDrawer.tsx +197 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.tsx +143 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.tsx +192 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.tsx +67 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.tsx +192 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.tsx +217 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationMotion.tsx +119 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.tsx +35 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationSearch.tsx +114 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationSearchStyles.tsx +47 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationStyles.tsx +320 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.tsx +59 -0
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationToggleX.tsx +51 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigation.tsx +467 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationAvatar.tsx +208 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.tsx +75 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.tsx +196 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.tsx +94 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.tsx +212 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.tsx +240 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationMotion.tsx +119 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationStyles.tsx +303 -0
- package/src/lib/components/pages/ErrorPage/ErrorPage.test.tsx +78 -0
- package/src/lib/components/pages/ErrorPage/ErrorPage.tsx +50 -0
- package/src/lib/components/pages/ErrorPage/ErrorPageStyles.tsx +30 -0
- package/src/lib/components/pages/SideInSide/SideInSide.tsx +100 -0
- package/src/lib/components/pages/SideInSide/SideInSideStyles.tsx +62 -0
- package/src/lib/components/stream/AppSwitcher/AppSwitcher.tsx +392 -0
- package/src/lib/components/stream/AppSwitcher/AppSwitcherItem.tsx +83 -0
- package/src/lib/components/stream/AppSwitcher/AppSwitcherStyles.tsx +325 -0
- package/src/lib/components/stream/AppSwitcher/constants.tsx +28 -0
- package/src/lib/index.tsx +148 -0
- package/src/lib/lang/en-us.js +6 -0
- package/src/lib/types/components/navigation/VerticalNavigation.ts +52 -0
- package/src/lib/types/components/navigation/VerticalNavigationAvatar.ts +26 -0
- package/src/lib/types/components/stream/AppSwitcher.ts +10 -0
- package/src/lib/types/index.ts +9 -0
- package/src/lib/utils/constants.tsx +11 -0
- package/src/lib/utils/helpers.tsx +77 -0
- package/src/lib/utils/hooks.tsx +33 -0
- package/src/lib/utils/index.tsx +4 -0
- package/src/lib/utils/theme.tsx +79 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/setupTests.ts +5 -0
- package/src/stories/Components/DataDisplay/Avatar/Accessibility.stories.mdx +34 -0
- package/src/stories/Components/DataDisplay/Avatar/AllCombinations.tsx +56 -0
- package/src/stories/Components/DataDisplay/Avatar/Avatar.stories.tsx +19 -0
- package/src/stories/Components/DataDisplay/Avatar/Examples.stories.tsx +278 -0
- package/src/stories/Components/DataDisplay/Avatar/Overview.stories.mdx +47 -0
- package/src/stories/Components/DataDisplay/Chip/Accessibility.stories.mdx +29 -0
- package/src/stories/Components/DataDisplay/Chip/AllCombinations.tsx +58 -0
- package/src/stories/Components/DataDisplay/Chip/Chip.stories.tsx +21 -0
- package/src/stories/Components/DataDisplay/Chip/Examples.stories.tsx +126 -0
- package/src/stories/Components/DataDisplay/Chip/Overview.stories.mdx +57 -0
- package/src/stories/Components/DataDisplay/List/Accessibility.stories.mdx +54 -0
- package/src/stories/Components/DataDisplay/List/AllCombinations.tsx +396 -0
- package/src/stories/Components/DataDisplay/List/Examples.stories.tsx +501 -0
- package/src/stories/Components/DataDisplay/List/List.stories.tsx +35 -0
- package/src/stories/Components/DataDisplay/List/Overview.stories.mdx +69 -0
- package/src/stories/Components/DataDisplay/Table/Overview.stories.mdx +70 -0
- package/src/stories/Components/DataDisplay/Tooltip/Accessibility.stories.mdx +39 -0
- package/src/stories/Components/DataDisplay/Tooltip/AllCombinations.tsx +134 -0
- package/src/stories/Components/DataDisplay/Tooltip/Examples.stories.tsx +237 -0
- package/src/stories/Components/DataDisplay/Tooltip/Overview.stories.mdx +58 -0
- package/src/stories/Components/DataDisplay/Tooltip/Tooltip.stories.tsx +22 -0
- package/src/stories/Components/Feedback/Alert/Accessibility.stories.mdx +25 -0
- package/src/stories/Components/Feedback/Alert/Alert.stories.tsx +22 -0
- package/src/stories/Components/Feedback/Alert/AllCombinations.tsx +37 -0
- package/src/stories/Components/Feedback/Alert/Examples.stories.tsx +137 -0
- package/src/stories/Components/Feedback/Alert/Overview.stories.mdx +62 -0
- package/src/stories/Components/Inputs/Autocomplete/Accessibility.stories.mdx +31 -0
- package/src/stories/Components/Inputs/Autocomplete/AllCombinations.tsx +182 -0
- package/src/stories/Components/Inputs/Autocomplete/Autocomplete.stories.tsx +31 -0
- package/src/stories/Components/Inputs/Autocomplete/Examples.stories.tsx +233 -0
- package/src/stories/Components/Inputs/Autocomplete/Overview.stories.mdx +52 -0
- package/src/stories/Components/Inputs/Button/Accessibility.stories.mdx +52 -0
- package/src/stories/Components/Inputs/Button/AllCombinations.tsx +53 -0
- package/src/stories/Components/Inputs/Button/Button.stories.tsx +23 -0
- package/src/stories/Components/Inputs/Button/Examples.stories.tsx +190 -0
- package/src/stories/Components/Inputs/Button/Overview.stories.mdx +52 -0
- package/src/stories/Components/Inputs/Checkbox/Accessibility.stories.mdx +38 -0
- package/src/stories/Components/Inputs/Checkbox/AllCombinations.tsx +55 -0
- package/src/stories/Components/Inputs/Checkbox/Checkbox.stories.tsx +22 -0
- package/src/stories/Components/Inputs/Checkbox/Examples.stories.tsx +363 -0
- package/src/stories/Components/Inputs/Checkbox/Overview.stories.mdx +63 -0
- package/src/stories/Components/Inputs/IconButton/Examples.stories.tsx +24 -0
- package/src/stories/Components/Inputs/IconButton/IconButton.stories.tsx +26 -0
- package/src/stories/Components/Inputs/Radio/Accessibility.stories.mdx +61 -0
- package/src/stories/Components/Inputs/Radio/AllCombinations.tsx +75 -0
- package/src/stories/Components/Inputs/Radio/Examples.stories.tsx +333 -0
- package/src/stories/Components/Inputs/Radio/Overview.stories.mdx +74 -0
- package/src/stories/Components/Inputs/Radio/Radio.stories.tsx +22 -0
- package/src/stories/Components/Inputs/Select/Accessibility.stories.mdx +51 -0
- package/src/stories/Components/Inputs/Select/AllCombinations.tsx +63 -0
- package/src/stories/Components/Inputs/Select/Examples.stories.tsx +803 -0
- package/src/stories/Components/Inputs/Select/Overview.stories.mdx +73 -0
- package/src/stories/Components/Inputs/Select/Select.stories.tsx +22 -0
- package/src/stories/Components/Inputs/Slider/Accessibility.stories.mdx +43 -0
- package/src/stories/Components/Inputs/Slider/AllCombinations.tsx +30 -0
- package/src/stories/Components/Inputs/Slider/Examples.stories.tsx +146 -0
- package/src/stories/Components/Inputs/Slider/Overview.stories.mdx +59 -0
- package/src/stories/Components/Inputs/Slider/Slider.stories.tsx +27 -0
- package/src/stories/Components/Inputs/Switch/Accessibility.stories.mdx +34 -0
- package/src/stories/Components/Inputs/Switch/AllCombinations.tsx +45 -0
- package/src/stories/Components/Inputs/Switch/Examples.stories.tsx +213 -0
- package/src/stories/Components/Inputs/Switch/Overview.stories.mdx +62 -0
- package/src/stories/Components/Inputs/Switch/Switch.stories.tsx +22 -0
- package/src/stories/Components/Inputs/TextField/Accessibility.stories.mdx +29 -0
- package/src/stories/Components/Inputs/TextField/AllCombinations.tsx +57 -0
- package/src/stories/Components/Inputs/TextField/Examples.stories.tsx +127 -0
- package/src/stories/Components/Inputs/TextField/Overview.stories.mdx +60 -0
- package/src/stories/Components/Inputs/TextField/TextField.stories.tsx +261 -0
- package/src/stories/Components/Inputs/ToggleButton/Accessibility.stories.mdx +32 -0
- package/src/stories/Components/Inputs/ToggleButton/AllCombinations.tsx +113 -0
- package/src/stories/Components/Inputs/ToggleButton/Examples.stories.tsx +339 -0
- package/src/stories/Components/Inputs/ToggleButton/Overview.stories.mdx +55 -0
- package/src/stories/Components/Inputs/ToggleButton/ToggleButton.stories.tsx +19 -0
- package/src/stories/Components/Landmarks/Header/Examples.stories.tsx +197 -0
- package/src/stories/Components/Landmarks/Header/Header.stories.tsx +34 -0
- package/src/stories/Components/Landmarks/Header/Overview.stories.mdx +44 -0
- package/src/stories/Components/Navigation/Drawer/Accessibility.stories.mdx +13 -0
- package/src/stories/Components/Navigation/Drawer/Drawer.stories.tsx +80 -0
- package/src/stories/Components/Navigation/Drawer/Examples.stories.tsx +440 -0
- package/src/stories/Components/Navigation/Drawer/Overview.stories.mdx +43 -0
- package/src/stories/Components/Navigation/MobileNavigation/Accessibility.stories.mdx +14 -0
- package/src/stories/Components/Navigation/MobileNavigation/Examples.stories.tsx +384 -0
- package/src/stories/Components/Navigation/MobileNavigation/MobileNavigation.stories.tsx +24 -0
- package/src/stories/Components/Navigation/MobileNavigation/Overview.stories.mdx +47 -0
- package/src/stories/Components/Navigation/VerticalNavigation/Accessibility.stories.mdx +14 -0
- package/src/stories/Components/Navigation/VerticalNavigation/Examples.stories.tsx +307 -0
- package/src/stories/Components/Navigation/VerticalNavigation/Overview.stories.mdx +47 -0
- package/src/stories/Components/Navigation/VerticalNavigation/VerticalNavigation.stories.tsx +24 -0
- package/src/stories/ContactUs.stories.mdx +21 -0
- package/src/stories/Experimental/Test.stories.mdx +46 -0
- package/src/stories/GettingStarted/Designer.stories.mdx +86 -0
- package/src/stories/GettingStarted/Developer.stories.mdx +134 -0
- package/src/stories/Guidelines/Accessibility/AssistiveTechnology.stories.mdx +70 -0
- package/src/stories/Guidelines/Accessibility/ColorAndContrast.stories.mdx +109 -0
- package/src/stories/Guidelines/Accessibility/Hierarchy.stories.mdx +119 -0
- package/src/stories/Guidelines/Accessibility/Imagery.stories.mdx +136 -0
- package/src/stories/Guidelines/Accessibility/Overview.stories.mdx +44 -0
- package/src/stories/Guidelines/Accessibility/Principles.stories.mdx +156 -0
- package/src/stories/Guidelines/Accessibility/SoundAndMotion.stories.mdx +59 -0
- package/src/stories/Guidelines/Accessibility/Typography.stories.mdx +69 -0
- package/src/stories/Guidelines/Accessibility/Writing.stories.mdx +188 -0
- package/src/stories/Guidelines/Styleguide/ColorSwatch.tsx +53 -0
- package/src/stories/Guidelines/Styleguide/Colors.stories.mdx +118 -0
- package/src/stories/Guidelines/Styleguide/Typography.stories.mdx +84 -0
- package/src/stories/Introduction.stories.mdx +65 -0
- package/src/stories/Pages/ErrorPage.stories.tsx +30 -0
- package/src/stories/Pages/SideInSide.stories.tsx +195 -0
- package/src/stories/Roadmap.stories.mdx +19 -0
- package/src/stories/Templates/Login.stories.mdx +46 -0
- package/src/stories/assets/Atomic_Design_Icons-Dark.svg +24 -0
- package/src/stories/assets/Atomic_Design_Icons-Light.svg +25 -0
- package/src/stories/assets/accessibility-1.png +0 -0
- package/src/stories/assets/accessibility-2.png +0 -0
- package/src/stories/assets/accessibility-3.png +0 -0
- package/src/stories/assets/accessibility-banner.png +0 -0
- package/src/stories/assets/atoms.svg +6 -0
- package/src/stories/assets/design_system_2022-02-11_12.22pm.png +0 -0
- package/src/stories/assets/figma-tokens.png +0 -0
- package/src/stories/assets/hierarchy-1.jpg +0 -0
- package/src/stories/assets/hierarchy-2.jpg +0 -0
- package/src/stories/assets/hierarchy-3.jpg +0 -0
- package/src/stories/assets/icon-contrast-1.jpg +0 -0
- package/src/stories/assets/icon-contrast-2.jpg +0 -0
- package/src/stories/assets/imagery-1.png +0 -0
- package/src/stories/assets/imagery-2.png +0 -0
- package/src/stories/assets/imagery-3.png +0 -0
- package/src/stories/assets/imagery-4.jpg +0 -0
- package/src/stories/assets/molecules.svg +9 -0
- package/src/stories/assets/organisms.svg +22 -0
- package/src/stories/assets/pages.svg +5 -0
- package/src/stories/assets/particles.svg +4 -0
- package/src/stories/assets/templates.svg +4 -0
- package/src/stories/assets/testData.tsx +102 -0
- package/src/stories/assets/text-contrast-1.jpg +0 -0
- package/src/stories/assets/text-contrast-2.jpg +0 -0
- package/src/stories/assets/typography-1.png +0 -0
- package/src/stories/assets/visual-clues-1.png +0 -0
- package/src/stories/assets/visual-clues-2.png +0 -0
- package/src/stories/assets/writing-1.jpg +0 -0
- package/src/stories/assets/writing-2.png +0 -0
- package/src/stories/assets/writing-3.png +0 -0
- package/src/stories/assets/writing-4.png +0 -0
- package/src/stories/utils/CustomIcons.tsx +44 -0
- package/tsconfig.eslint.json +16 -0
- package/tsconfig.json +50 -0
- package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +0 -827
- package/components/navigation/MobileNavigation/MobileNavigationDrawer.js +0 -147
- package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +0 -392
- package/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.d.ts +0 -3
- package/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.js +0 -31
- package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +0 -257
- package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.d.ts +0 -3
- package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +0 -33
- package/components/navigation/MobileNavigation/MobileNavigationToggleX.d.ts +0 -3
- package/components/navigation/MobileNavigation/MobileNavigationToggleX.js +0 -27
- package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.d.ts +0 -36
- package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.js +0 -10
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +0 -827
- package/components/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +0 -88
- package/utils/helpers.d.ts +0 -6
- package/utils/helpers.js +0 -17
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { useSpring, config } from '@react-spring/web'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Accepts a string and returns 2 characters (max) as initials e.g. AN from Avatar Name
|
|
5
|
+
* @param avatarName string - Expected full name but accepts any string
|
|
6
|
+
* @returns string
|
|
7
|
+
*/
|
|
8
|
+
export const handleAvatarInitials = (avatarName: string): string => {
|
|
9
|
+
let firstInitial = avatarName.split('')[0] || ''
|
|
10
|
+
let secondInitial = ''
|
|
11
|
+
|
|
12
|
+
if (avatarName.split(' ')?.length > 1) {
|
|
13
|
+
firstInitial = avatarName.split(' ')[0][0]
|
|
14
|
+
|
|
15
|
+
if (avatarName.split(' ')[1]?.length > 0) {
|
|
16
|
+
secondInitial = avatarName?.split(' ')[1][0]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return `${firstInitial}${secondInitial}`
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const STAGGER_ITEMS_DELAY = 70
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Accepts a number and returns a react-spring style object from useSpring
|
|
27
|
+
* @param trigger boolean - Trigger to reverse the animation from main component
|
|
28
|
+
* @param animationCount number - Count tracking items from main component
|
|
29
|
+
* @param incrementAnimationCount Function - Function to increment animationCount from main component
|
|
30
|
+
* @returns Object
|
|
31
|
+
*/
|
|
32
|
+
export const useStaggerAnimation = (trigger: boolean, animationCount: number, incrementAnimationCount: Function): Object => {
|
|
33
|
+
const defaultAnimationConfig = {
|
|
34
|
+
from: { opacity: 0, y: 10 },
|
|
35
|
+
to: { opacity: 1, y: 0 },
|
|
36
|
+
reverse: !trigger,
|
|
37
|
+
config: {
|
|
38
|
+
...config.default,
|
|
39
|
+
mass: 1
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const staggerAnimation = useSpring({
|
|
44
|
+
...defaultAnimationConfig,
|
|
45
|
+
delay: trigger ? STAGGER_ITEMS_DELAY * (animationCount + 1) : 0
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
incrementAnimationCount()
|
|
49
|
+
|
|
50
|
+
return staggerAnimation
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Accepts a number and returns a react-spring style object from useSpring
|
|
55
|
+
* @param animationCount number - Count tracking items from main component
|
|
56
|
+
* @param incrementAnimationCount Function - Function to increment animationCount from main component
|
|
57
|
+
* @returns Object
|
|
58
|
+
*/
|
|
59
|
+
export const useFadeIn = (animationCount: number, incrementAnimationCount: Function): Object => {
|
|
60
|
+
const defaultAnimationConfig = {
|
|
61
|
+
from: { opacity: 0 },
|
|
62
|
+
to: { opacity: 1 },
|
|
63
|
+
config: {
|
|
64
|
+
...config.default,
|
|
65
|
+
mass: 1
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const staggerFadeInUpAnimation = useSpring({
|
|
70
|
+
...defaultAnimationConfig,
|
|
71
|
+
delay: STAGGER_ITEMS_DELAY * (animationCount + 1)
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
incrementAnimationCount()
|
|
75
|
+
|
|
76
|
+
return staggerFadeInUpAnimation
|
|
77
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react'
|
|
2
|
+
|
|
3
|
+
const getWidth = () => window.innerWidth ??
|
|
4
|
+
document.documentElement.clientWidth ??
|
|
5
|
+
document.body.clientWidth
|
|
6
|
+
|
|
7
|
+
export const useCurrentWidth = () => {
|
|
8
|
+
// save current window width in the state object
|
|
9
|
+
const [width, setWidth] = useState(getWidth())
|
|
10
|
+
|
|
11
|
+
// in this case useEffect will execute only once because
|
|
12
|
+
// it does not have any dependencies.
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
// timeoutId for debounce mechanism
|
|
15
|
+
let timeoutId: any
|
|
16
|
+
const resizeListener = () => {
|
|
17
|
+
// prevent execution of previous setTimeout
|
|
18
|
+
clearTimeout(timeoutId)
|
|
19
|
+
// change width from the state object after 150 milliseconds
|
|
20
|
+
timeoutId = setTimeout(() => setWidth(getWidth()), 150)
|
|
21
|
+
}
|
|
22
|
+
// set resize listener
|
|
23
|
+
window.addEventListener('resize', resizeListener)
|
|
24
|
+
|
|
25
|
+
// clean up function
|
|
26
|
+
return () => {
|
|
27
|
+
// remove resize listener
|
|
28
|
+
window.removeEventListener('resize', resizeListener)
|
|
29
|
+
}
|
|
30
|
+
}, [])
|
|
31
|
+
|
|
32
|
+
return width
|
|
33
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { amber, blue } from '@mui/material/colors'
|
|
2
|
+
|
|
3
|
+
const DEFAULT_HEADER_TYPOGRAPHY = {
|
|
4
|
+
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif'
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const DEFAULT_BODY_TYPOGRAPHY = {
|
|
8
|
+
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// @TODO: Discuss this with the experience design team, according to the UUI Figma
|
|
12
|
+
export const defaultTheme = {
|
|
13
|
+
typography: {
|
|
14
|
+
...DEFAULT_BODY_TYPOGRAPHY,
|
|
15
|
+
h1: DEFAULT_HEADER_TYPOGRAPHY,
|
|
16
|
+
h2: DEFAULT_HEADER_TYPOGRAPHY,
|
|
17
|
+
h3: DEFAULT_HEADER_TYPOGRAPHY,
|
|
18
|
+
h4: DEFAULT_HEADER_TYPOGRAPHY,
|
|
19
|
+
h5: DEFAULT_HEADER_TYPOGRAPHY,
|
|
20
|
+
h6: DEFAULT_HEADER_TYPOGRAPHY,
|
|
21
|
+
subtitle1: DEFAULT_BODY_TYPOGRAPHY,
|
|
22
|
+
subtitle2: DEFAULT_BODY_TYPOGRAPHY,
|
|
23
|
+
body1: DEFAULT_BODY_TYPOGRAPHY,
|
|
24
|
+
body2: DEFAULT_BODY_TYPOGRAPHY,
|
|
25
|
+
button: {
|
|
26
|
+
...DEFAULT_BODY_TYPOGRAPHY,
|
|
27
|
+
fontWeight: 700
|
|
28
|
+
},
|
|
29
|
+
caption: DEFAULT_BODY_TYPOGRAPHY,
|
|
30
|
+
overline: DEFAULT_BODY_TYPOGRAPHY
|
|
31
|
+
}
|
|
32
|
+
// overrides: {
|
|
33
|
+
// MuiCssBaseline: {
|
|
34
|
+
// '@global': {
|
|
35
|
+
// '.MuiAvatarGroup-root .MuiAvatar-root:first-of-type': {
|
|
36
|
+
// backgroundColor: '#eee',
|
|
37
|
+
// color: '#333'
|
|
38
|
+
// }
|
|
39
|
+
// }
|
|
40
|
+
// }
|
|
41
|
+
// }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const lightTheme = {
|
|
45
|
+
palette: {
|
|
46
|
+
primary: {
|
|
47
|
+
main: '#0069b4'
|
|
48
|
+
},
|
|
49
|
+
secondary: {
|
|
50
|
+
main: blue[500]
|
|
51
|
+
},
|
|
52
|
+
divider: 'rgba(0, 0, 0, 0.075)',
|
|
53
|
+
text: {
|
|
54
|
+
primary: 'rgba(0,0,0,0.95)'
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const darkTheme = {
|
|
60
|
+
palette: {
|
|
61
|
+
primary: amber,
|
|
62
|
+
divider: 'rgba(255, 255, 255, 0.075)',
|
|
63
|
+
text: {
|
|
64
|
+
primary: 'rgba(255,255,255,0.95)'
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const motion = {
|
|
70
|
+
ease: 'cubic-bezier(0.4, 0.0, 0.2, 1)',
|
|
71
|
+
easeOut: 'cubic-bezier(0.0, 0.0, 0.2, 1)',
|
|
72
|
+
easeIn: 'cubic-bezier(0.4, 0.0, 1, 1)',
|
|
73
|
+
easeInOut: 'cubic-bezier(0.4, 0.0, 0.6, 1)'
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const tooltipDelay = {
|
|
77
|
+
start: 500,
|
|
78
|
+
end: 200
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="react-scripts" />
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs'
|
|
2
|
+
import { Avatar, AvatarGroup } from '../../../../lib/'
|
|
3
|
+
import Chip from '../../../../lib/components/datadisplay/Chip/Chip'
|
|
4
|
+
import { Box, Typography, IconButton} from '@mui/material'
|
|
5
|
+
import DeleteIcon from '@mui/icons-material/Delete'
|
|
6
|
+
|
|
7
|
+
<Meta title="Components/Data Display/Avatar/Accessibility" />
|
|
8
|
+
|
|
9
|
+
[](#avatar-accessibility)Avatar Accessibility <span class="sbdocs-edit-link"><Chip clickable component="a" href="https://github.com/ht2-labs/design-system/tree/main/src/stories/Components/DataDisplay/Avatar/Accessibility.stories.mdx" size="small" label="Edit" variant="outlined" /></span>
|
|
10
|
+
=================================================================================
|
|
11
|
+
|
|
12
|
+
This component has been validated to meet the WCAG 2.1 AA and Section 508 accessibility guidelines; however, changes made by the developer can affect accessibility compliance.
|
|
13
|
+
|
|
14
|
+
## [](#guidelines)Guidelines
|
|
15
|
+
|
|
16
|
+
* When using the Avatar with text initials on a background color, the component will automatically set the correct text color with the highest contrast ratio.
|
|
17
|
+
|
|
18
|
+
### [](#screen-readers)Screen readers
|
|
19
|
+
|
|
20
|
+
When using the Avatar with an image, include a clear and concise description with an `alt` tag.
|
|
21
|
+
|
|
22
|
+
<Canvas isExpanded>
|
|
23
|
+
<Stack direction="row" spacing={2}>
|
|
24
|
+
<Avatar alt="User One Profile" src="/assets/avatar-1.jpg" />
|
|
25
|
+
</Stack>
|
|
26
|
+
</Canvas>
|
|
27
|
+
|
|
28
|
+
When using the Avatar with text initials, include a clear and concise description with an `aria-label` tag.
|
|
29
|
+
|
|
30
|
+
<Canvas isExpanded>
|
|
31
|
+
<Stack direction="row" spacing={2}>
|
|
32
|
+
<Avatar aria-label="LP User Profile">LP</Avatar>
|
|
33
|
+
</Stack>
|
|
34
|
+
</Canvas>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { Stack } from '@mui/material'
|
|
3
|
+
import { Avatar, AvatarGroup } from '../../../../lib/'
|
|
4
|
+
import FolderIcon from '@mui/icons-material/Folder'
|
|
5
|
+
|
|
6
|
+
const AvatarGrid = (args: any): JSX.Element => {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<Stack direction="column" mb={5}>
|
|
10
|
+
<Stack direction="row" spacing={2} alignItems="center" mb={1}>
|
|
11
|
+
<Avatar {...args} alt="User One" src="/assets/avatar-1.jpg" />
|
|
12
|
+
<Avatar {...args}>LP</Avatar>
|
|
13
|
+
<Avatar {...args} sx={{ bgcolor: '#333' }}>LP</Avatar>
|
|
14
|
+
<Avatar {...args}>
|
|
15
|
+
<FolderIcon />
|
|
16
|
+
</Avatar>
|
|
17
|
+
<Avatar {...args} sx={{ width: 64, height: 64 }}>LP</Avatar>
|
|
18
|
+
</Stack>
|
|
19
|
+
<Stack direction="row" spacing={2} alignItems="center" mb={1}>
|
|
20
|
+
<AvatarGroup max={4}>
|
|
21
|
+
<Avatar {...args}>RD</Avatar>
|
|
22
|
+
<Avatar {...args}>NS</Avatar>
|
|
23
|
+
<Avatar {...args}>AM</Avatar>
|
|
24
|
+
<Avatar {...args}>KW</Avatar>
|
|
25
|
+
<Avatar {...args}>DD</Avatar>
|
|
26
|
+
<Avatar {...args}>NT</Avatar>
|
|
27
|
+
</AvatarGroup>
|
|
28
|
+
<AvatarGroup total={25}>
|
|
29
|
+
<Avatar {...args}>RD</Avatar>
|
|
30
|
+
<Avatar {...args}>NS</Avatar>
|
|
31
|
+
<Avatar {...args}>AM</Avatar>
|
|
32
|
+
<Avatar {...args}>KW</Avatar>
|
|
33
|
+
<Avatar {...args}>DD</Avatar>
|
|
34
|
+
<Avatar {...args}>NT</Avatar>
|
|
35
|
+
</AvatarGroup>
|
|
36
|
+
</Stack>
|
|
37
|
+
</Stack>
|
|
38
|
+
</>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default function AllCombinations (): JSX.Element {
|
|
43
|
+
const combinations = [
|
|
44
|
+
{ variant: 'circular' },
|
|
45
|
+
{ variant: 'square' },
|
|
46
|
+
{ variant: 'rounded' }
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Stack>
|
|
51
|
+
{combinations.map(AvatarConfig => (
|
|
52
|
+
<AvatarGrid {...AvatarConfig} />
|
|
53
|
+
))}
|
|
54
|
+
</Stack>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react'
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { Avatar } from '../../../../lib/'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Data Display/Avatar/Properties',
|
|
7
|
+
component: Avatar,
|
|
8
|
+
parameters: {
|
|
9
|
+
controls: {
|
|
10
|
+
sort: 'requiredFirst'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
} as ComponentMeta<typeof Avatar>
|
|
14
|
+
|
|
15
|
+
// 👇 We create a “template” of how args map to rendering
|
|
16
|
+
const Template: ComponentStory<typeof Avatar> = (args) => <Avatar {...args}>LP</Avatar>
|
|
17
|
+
|
|
18
|
+
export const Properties = Template.bind({})
|
|
19
|
+
Properties.args = {}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react'
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { DOCS } from '../../../../docs'
|
|
4
|
+
import { Avatar, AvatarGroup } from '../../../../lib/'
|
|
5
|
+
import { Stack, Badge } from '@mui/material'
|
|
6
|
+
import FolderIcon from '@mui/icons-material/Folder'
|
|
7
|
+
import PageviewIcon from '@mui/icons-material/Pageview'
|
|
8
|
+
import AssignmentIcon from '@mui/icons-material/Assignment'
|
|
9
|
+
import { green, blue } from '@mui/material/colors'
|
|
10
|
+
import { styled } from '@mui/material/styles'
|
|
11
|
+
import AllCombinations from './AllCombinations'
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
title: 'Components/Data Display/Avatar/Examples',
|
|
15
|
+
component: Avatar
|
|
16
|
+
} as ComponentMeta<typeof Avatar>
|
|
17
|
+
|
|
18
|
+
export const Default: ComponentStory<typeof Avatar> = (args): JSX.Element => {
|
|
19
|
+
return (
|
|
20
|
+
<Stack direction="row" spacing={2}>
|
|
21
|
+
<Avatar alt="LP">LP</Avatar>
|
|
22
|
+
</Stack>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
Default.parameters = {
|
|
26
|
+
docs: {
|
|
27
|
+
description: {
|
|
28
|
+
component: DOCS.Avatar.Default
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const ImageAvatars: ComponentStory<typeof Avatar> = (args): JSX.Element => {
|
|
34
|
+
return (
|
|
35
|
+
<Stack direction="row" spacing={2}>
|
|
36
|
+
<Avatar alt="User One" src="/assets/avatar-1.jpg" />
|
|
37
|
+
<Avatar alt="User Two" src="/assets/avatar-2.jpg" />
|
|
38
|
+
<Avatar alt="User Three" src="/assets/avatar-3.jpg" />
|
|
39
|
+
</Stack>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
ImageAvatars.parameters = {
|
|
43
|
+
docs: {
|
|
44
|
+
description: {
|
|
45
|
+
story: DOCS.Avatar.ImageAvatars
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const LetterAvatars: ComponentStory<typeof Avatar> = (args): JSX.Element => {
|
|
51
|
+
return (
|
|
52
|
+
<Stack direction="row" spacing={2}>
|
|
53
|
+
<Avatar>L</Avatar>
|
|
54
|
+
<Avatar>P</Avatar>
|
|
55
|
+
<Avatar>LP</Avatar>
|
|
56
|
+
</Stack>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
LetterAvatars.parameters = {
|
|
60
|
+
docs: {
|
|
61
|
+
description: {
|
|
62
|
+
story: DOCS.Avatar.LetterAvatars
|
|
63
|
+
},
|
|
64
|
+
source: {
|
|
65
|
+
type: 'code'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const Sizes: ComponentStory<typeof Avatar> = (args): JSX.Element => {
|
|
71
|
+
return (
|
|
72
|
+
<Stack direction="row" spacing={2}>
|
|
73
|
+
<Avatar sx={{ width: 24, height: 24 }} alt="User One" src="/assets/avatar-1.jpg" />
|
|
74
|
+
<Avatar alt="User One" src="/assets/avatar-1.jpg" />
|
|
75
|
+
<Avatar sx={{ width: 56, height: 56 }} alt="User One" src="/assets/avatar-1.jpg" />
|
|
76
|
+
</Stack>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
Sizes.parameters = {
|
|
80
|
+
docs: {
|
|
81
|
+
description: {
|
|
82
|
+
story: DOCS.Avatar.Sizes
|
|
83
|
+
},
|
|
84
|
+
source: {
|
|
85
|
+
type: 'code'
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const Colors: ComponentStory<typeof Avatar> = (args): JSX.Element => {
|
|
91
|
+
return (
|
|
92
|
+
<Stack direction="row" spacing={2}>
|
|
93
|
+
<Avatar sx={{ bgcolor: '#eee' }}>LP</Avatar>
|
|
94
|
+
<Avatar sx={{ bgcolor: '#333' }}>LP</Avatar>
|
|
95
|
+
<Avatar sx={{ bgcolor: green[500] }}>LP</Avatar>
|
|
96
|
+
</Stack>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
Colors.parameters = {
|
|
100
|
+
docs: {
|
|
101
|
+
description: {
|
|
102
|
+
story: DOCS.Avatar.Colors
|
|
103
|
+
},
|
|
104
|
+
source: {
|
|
105
|
+
type: 'code'
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const IconAvatars: ComponentStory<typeof Avatar> = (args): JSX.Element => {
|
|
111
|
+
return (
|
|
112
|
+
<Stack direction="row" spacing={2}>
|
|
113
|
+
<Avatar>
|
|
114
|
+
<AssignmentIcon />
|
|
115
|
+
</Avatar>
|
|
116
|
+
<Avatar sx={{ bgcolor: '#eee' }}>
|
|
117
|
+
<FolderIcon />
|
|
118
|
+
</Avatar>
|
|
119
|
+
<Avatar sx={{ bgcolor: '#333' }}>
|
|
120
|
+
<PageviewIcon />
|
|
121
|
+
</Avatar>
|
|
122
|
+
</Stack>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
IconAvatars.parameters = {
|
|
126
|
+
docs: {
|
|
127
|
+
description: {
|
|
128
|
+
story: DOCS.Avatar.IconAvatars
|
|
129
|
+
},
|
|
130
|
+
source: {
|
|
131
|
+
type: 'code'
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export const Variants: ComponentStory<typeof Avatar> = (args): JSX.Element => {
|
|
137
|
+
return (
|
|
138
|
+
<Stack direction="row" spacing={2}>
|
|
139
|
+
<Avatar variant="square" sx={{ bgcolor: blue[800] }}>LP</Avatar>
|
|
140
|
+
<Avatar variant="rounded" sx={{ bgcolor: blue[800] }}>LP</Avatar>
|
|
141
|
+
</Stack>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
Variants.parameters = {
|
|
145
|
+
docs: {
|
|
146
|
+
description: {
|
|
147
|
+
story: DOCS.Avatar.Variants
|
|
148
|
+
},
|
|
149
|
+
source: {
|
|
150
|
+
type: 'code'
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export const Grouped: ComponentStory<typeof Avatar> = (args): JSX.Element => {
|
|
156
|
+
return (
|
|
157
|
+
<AvatarGroup max={4}>
|
|
158
|
+
<Avatar>RD</Avatar>
|
|
159
|
+
<Avatar>NS</Avatar>
|
|
160
|
+
<Avatar>AM</Avatar>
|
|
161
|
+
<Avatar>KW</Avatar>
|
|
162
|
+
<Avatar>DD</Avatar>
|
|
163
|
+
<Avatar>NT</Avatar>
|
|
164
|
+
</AvatarGroup>
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
Grouped.parameters = {
|
|
168
|
+
docs: {
|
|
169
|
+
description: {
|
|
170
|
+
story: DOCS.Avatar.Grouped
|
|
171
|
+
},
|
|
172
|
+
source: {
|
|
173
|
+
type: 'code'
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export const TotalAvatars: ComponentStory<typeof Avatar> = (args): JSX.Element => {
|
|
179
|
+
return (
|
|
180
|
+
<AvatarGroup total={25}>
|
|
181
|
+
<Avatar>RD</Avatar>
|
|
182
|
+
<Avatar>NS</Avatar>
|
|
183
|
+
<Avatar>AM</Avatar>
|
|
184
|
+
<Avatar>KW</Avatar>
|
|
185
|
+
<Avatar>DD</Avatar>
|
|
186
|
+
<Avatar>NT</Avatar>
|
|
187
|
+
</AvatarGroup>
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
TotalAvatars.parameters = {
|
|
191
|
+
docs: {
|
|
192
|
+
description: {
|
|
193
|
+
story: DOCS.Avatar.TotalAvatars
|
|
194
|
+
},
|
|
195
|
+
source: {
|
|
196
|
+
type: 'code'
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export const BadgeAvatars: ComponentStory<typeof AllCombinations> = (args): JSX.Element => {
|
|
202
|
+
const StyledBadge = styled(Badge)(({ theme }) => ({
|
|
203
|
+
'& .MuiBadge-badge': {
|
|
204
|
+
backgroundColor: '#44b700',
|
|
205
|
+
color: '#44b700',
|
|
206
|
+
boxShadow: `0 0 0 2px ${theme.palette.background.paper}`,
|
|
207
|
+
'&::after': {
|
|
208
|
+
position: 'absolute',
|
|
209
|
+
top: 0,
|
|
210
|
+
left: 0,
|
|
211
|
+
width: '100%',
|
|
212
|
+
height: '100%',
|
|
213
|
+
borderRadius: '50%',
|
|
214
|
+
animation: 'ripple 1.2s infinite ease-in-out',
|
|
215
|
+
border: '1px solid currentColor',
|
|
216
|
+
content: '""'
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
'@keyframes ripple': {
|
|
220
|
+
'0%': {
|
|
221
|
+
transform: 'scale(.8)',
|
|
222
|
+
opacity: 1
|
|
223
|
+
},
|
|
224
|
+
'100%': {
|
|
225
|
+
transform: 'scale(2.4)',
|
|
226
|
+
opacity: 0
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}))
|
|
230
|
+
|
|
231
|
+
const SmallAvatar = styled(Avatar)(({ theme }) => ({
|
|
232
|
+
width: 22,
|
|
233
|
+
height: 22,
|
|
234
|
+
border: '2px solid #eee'
|
|
235
|
+
}))
|
|
236
|
+
|
|
237
|
+
return (
|
|
238
|
+
<Stack direction="row" spacing={2}>
|
|
239
|
+
<StyledBadge
|
|
240
|
+
overlap="circular"
|
|
241
|
+
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
|
|
242
|
+
variant="dot"
|
|
243
|
+
>
|
|
244
|
+
<Avatar alt="User One" src="/assets/avatar-1.jpg" />
|
|
245
|
+
</StyledBadge>
|
|
246
|
+
<Badge
|
|
247
|
+
overlap="circular"
|
|
248
|
+
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
|
|
249
|
+
badgeContent={
|
|
250
|
+
<SmallAvatar alt="User One" src="/assets/avatar-1.jpg" />
|
|
251
|
+
}
|
|
252
|
+
>
|
|
253
|
+
<Avatar alt="User One" src="/assets/avatar-1.jpg" />
|
|
254
|
+
</Badge>
|
|
255
|
+
</Stack>
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
BadgeAvatars.parameters = {
|
|
259
|
+
docs: {
|
|
260
|
+
description: {
|
|
261
|
+
story: DOCS.Avatar.BadgeAvatars
|
|
262
|
+
},
|
|
263
|
+
source: {
|
|
264
|
+
type: 'code'
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export const All: ComponentStory<typeof AllCombinations> = (args): JSX.Element => (
|
|
270
|
+
<AllCombinations />
|
|
271
|
+
)
|
|
272
|
+
All.parameters = {
|
|
273
|
+
docs: {
|
|
274
|
+
description: {
|
|
275
|
+
story: DOCS.Avatar.All
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import { Avatar } from '../../../../lib/'
|
|
3
|
+
import { MUIIcon, MaterialDesignIcon, W3CIcon, FigmaIcon, GithubIcon } from '../../../utils/CustomIcons';
|
|
4
|
+
import Chip from '@mui/material/Chip';
|
|
5
|
+
import Stack from '@mui/material/Stack';
|
|
6
|
+
|
|
7
|
+
<Meta title="Components/Data Display/Avatar/Overview" component={Avatar} />
|
|
8
|
+
|
|
9
|
+
[](#Avatar-overview)Avatar Overview <span class="sbdocs-edit-link"><Chip clickable component="a" href="https://github.com/ht2-labs/design-system/tree/main/src/stories/Components/DataDisplay/Avatar/Overview.stories.mdx" size="small" label="Edit" variant="outlined" /></span>
|
|
10
|
+
=================================================================================
|
|
11
|
+
|
|
12
|
+
### [](#what-does-it-do)What does it do?
|
|
13
|
+
|
|
14
|
+
Avatars are found throughout material design with uses in everything from tables to dialog menus.
|
|
15
|
+
|
|
16
|
+
<Stack direction="row" spacing={1}>
|
|
17
|
+
<Chip clickable component="a" href="https://mui.com/components/Avatares/" size="small" icon={<MUIIcon viewBox="-5 0 40 30" />} label="Material UI" variant="outlined" />
|
|
18
|
+
<Chip clickable component="a" href="https://material.io/components/selection-controls#Avatares" size="small" icon={<MaterialDesignIcon />} label="Material Design" variant="outlined" />
|
|
19
|
+
<Chip clickable component="a" href="https://www.figma.com/proto/mBDuFn79U8wQIIEoCGpMew/DS%3A-Component-Library?node-id=1142%3A17936&scaling=min-zoom&page-id=1141%3A18763&starting-point-node-id=1142%3A17936" size="small" icon={<FigmaIcon />} label="Figma" variant="outlined" />
|
|
20
|
+
<Chip clickable component="a" href="https://github.com/HT2-Labs/design-system/tree/main/src/lib/components/datadisplay/Avatar" size="small" icon={<GithubIcon />} label="Github" variant="outlined" />
|
|
21
|
+
</Stack>
|
|
22
|
+
|
|
23
|
+
### [](#why-use-it)Why use it?
|
|
24
|
+
|
|
25
|
+
* Use an Avatar as a visual representation of a user.
|
|
26
|
+
* Use an AvatarGroup to display a group of avatars.
|
|
27
|
+
|
|
28
|
+
### [](#how-to-implement-it)How to implement it?
|
|
29
|
+
|
|
30
|
+
An Avatar can be `circular`, `square` or `rounded` depending on usage. The default is a circular.
|
|
31
|
+
|
|
32
|
+
<Canvas isExpanded>
|
|
33
|
+
<Stack direction="row" spacing={2}>
|
|
34
|
+
<Avatar>LP</Avatar>
|
|
35
|
+
<Avatar variant="square">LP</Avatar>
|
|
36
|
+
<Avatar variant="rounded">LP</Avatar>
|
|
37
|
+
</Stack>
|
|
38
|
+
</Canvas>
|
|
39
|
+
|
|
40
|
+
### [](#best-practices)Best practices
|
|
41
|
+
|
|
42
|
+
* Follow the [Badge Avatar example](/?path=/docs/components-data-display-avatar-examples--badge-avatars#badge-avatars) pattern to display a user's status with a round indicator at the bottom right.
|
|
43
|
+
* Use the `AvatarGroup` component to display a group of avatars.
|
|
44
|
+
* Provide an `alt` tag with a clear description of the avatar for screen readers when using an image.
|
|
45
|
+
|
|
46
|
+
### [](#design-prototype)Design prototype
|
|
47
|
+
TODO: Add design prototype
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import Chip from '../../../../lib/components/datadisplay/Chip/Chip';
|
|
3
|
+
import { Box, Typography} from '@mui/material';
|
|
4
|
+
|
|
5
|
+
<Meta title="Components/Data Display/Chip/Accessibility" />
|
|
6
|
+
|
|
7
|
+
[](#Chip-accessibility)Chip Accessibility <span class="sbdocs-edit-link"><Chip clickable component="a" href="https://github.com/ht2-labs/design-system/tree/main/src/stories/Components/DataDisplay/Chip/Accessibility.stories.mdx" size="small" label="Edit" variant="outlined" /></span>
|
|
8
|
+
=================================================================================
|
|
9
|
+
|
|
10
|
+
This component has been validated to meet the WCAG 2.1 AA and Section 508 accessibility guidelines; however, changes made by the developer can affect accessibility compliance.
|
|
11
|
+
|
|
12
|
+
Please follow the guidance in this section and see [WAI-ARIA](https://www.w3.org/TR/wai-aria-practices/) for more information.
|
|
13
|
+
|
|
14
|
+
## [](#guidelines)Guidelines
|
|
15
|
+
The component handles most of the work necessary to make it accessible. However, you need to make sure that:
|
|
16
|
+
|
|
17
|
+
* A chip should have a short and clear label.
|
|
18
|
+
* Color should not be used as the only means to differentiate between different chip categories.
|
|
19
|
+
* If a Chip is deletable or clickable then it is a button in tab order.
|
|
20
|
+
* When a Chip is focused, releasing (keyup event) `Backspace` or `Delete` will call the `onDelete` handler, while releasing `Escape` will blur the Chip.
|
|
21
|
+
|
|
22
|
+
### [](#when-to-use-this-component)When to use this component
|
|
23
|
+
Chips are used for content that needs to be labeled, categorized, or organized using keywords that describe them.
|
|
24
|
+
|
|
25
|
+
### [](#screen-readers)Screen readers
|
|
26
|
+
Chips should have a short and concise label using the `label` prop. Adding Chips can increase the visual noise on a page, so use short labels to make scanning easy.
|
|
27
|
+
<Canvas isExpanded>
|
|
28
|
+
<Chip label="Chip Label" />
|
|
29
|
+
</Canvas>
|