@learningpool/ui 1.6.0-beta.9 → 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/dist/components/landmarks/Header/Header.d.ts +26 -0
- package/dist/components/landmarks/Header/Header.js +75 -0
- package/dist/components/landmarks/Header/HeaderActionButtons.d.ts +3 -0
- package/dist/components/landmarks/Header/HeaderActionButtons.js +66 -0
- package/dist/components/landmarks/Header/HeaderStyles.d.ts +55 -0
- package/dist/components/landmarks/Header/HeaderStyles.js +13 -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 +1 -2
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigation.js +56 -86
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatar.d.ts +1 -1
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationAvatar.js +45 -23
- 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 +1 -1
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.js +0 -0
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.d.ts +1 -1
- 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/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts → dist/components/navigation/MobileNavigation/MobileNavigationStyles.d.ts} +66 -3
- package/{components → dist/components}/navigation/MobileNavigation/MobileNavigationStyles.js +19 -24
- 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 +3 -3
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigation.js +22 -25
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationAvatar.d.ts +4 -0
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationAvatar.js +79 -0
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +3296 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +5 -5
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.d.ts +4 -0
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +99 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.d.ts +1 -1
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +1 -1
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.d.ts +1 -1
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +0 -0
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.d.ts +1 -3
- package/{components → dist/components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +3 -5
- 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 +5 -4
- 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 +1 -9
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcher.js +6 -6
- 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 +2 -2
- package/{components → dist/components}/stream/AppSwitcher/AppSwitcherStyles.js +16 -16
- package/{components → dist/components}/stream/AppSwitcher/constants.d.ts +0 -0
- package/{components → dist/components}/stream/AppSwitcher/constants.js +2 -2
- package/{index.d.ts → dist/index.d.ts} +1 -0
- package/{index.js → dist/index.js} +1 -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/dist/types/components/navigation/VerticalNavigation.d.ts +49 -0
- package/dist/types/components/navigation/VerticalNavigation.js +1 -0
- package/{components/navigation/VerticalNavigation → dist/types/components/navigation}/VerticalNavigationAvatar.d.ts +3 -4
- package/dist/types/components/navigation/VerticalNavigationAvatar.js +1 -0
- package/dist/types/components/stream/AppSwitcher.d.ts +9 -0
- package/dist/types/components/stream/AppSwitcher.js +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +3 -0
- package/{utils → dist/utils}/constants.d.ts +1 -0
- package/dist/utils/constants.js +9 -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 +2 -2
- package/{utils → dist/utils}/theme.js +3 -3
- 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 +72 -5
- 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 -148
- package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +0 -392
- package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +0 -257
- package/components/navigation/MobileNavigation/MobileNavigationStyles.d.ts +0 -405
- package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.d.ts +0 -2
- package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +0 -32
- package/components/navigation/MobileNavigation/MobileNavigationToggleX.d.ts +0 -2
- package/components/navigation/MobileNavigation/MobileNavigationToggleX.js +0 -26
- package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.d.ts +0 -36
- package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.js +0 -10
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatar.js +0 -84
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +0 -827
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.d.ts +0 -19
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +0 -91
- package/utils/constants.js +0 -6
- package/utils/helpers.d.ts +0 -6
- package/utils/helpers.js +0 -17
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Stack } from '@mui/material'
|
|
2
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react'
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { DOCS } from '../../../../docs'
|
|
5
|
+
import Alert from '../../../../lib/components/feedback/Alert/Alert'
|
|
6
|
+
import AlertTitle from '@mui/material/AlertTitle'
|
|
7
|
+
import Button from '../../../../lib/components/atoms/Button/Button'
|
|
8
|
+
import CheckIcon from '@mui/icons-material/Check'
|
|
9
|
+
import AllCombinations from './AllCombinations'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Components/Feedback/Alert/Examples',
|
|
13
|
+
component: Alert
|
|
14
|
+
} as ComponentMeta<typeof Alert>
|
|
15
|
+
|
|
16
|
+
export const Default: ComponentStory<typeof Alert> = (args) => {
|
|
17
|
+
return (
|
|
18
|
+
<Stack sx={{ width: '100%' }} spacing={2}>
|
|
19
|
+
<Alert severity="error">This is an error alert — check it out!</Alert>
|
|
20
|
+
<Alert severity="warning">This is a warning alert — check it out!</Alert>
|
|
21
|
+
<Alert severity="info">This is an info alert — check it out!</Alert>
|
|
22
|
+
<Alert severity="success">This is a success alert — check it out!</Alert>
|
|
23
|
+
</Stack>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
Default.parameters = {
|
|
27
|
+
docs: {
|
|
28
|
+
description: {
|
|
29
|
+
component: DOCS.Alert.Default
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const Description: ComponentStory<typeof Alert> = (args) => {
|
|
35
|
+
return (
|
|
36
|
+
<Stack sx={{ width: '100%' }} spacing={2}>
|
|
37
|
+
<Alert severity="error">
|
|
38
|
+
<AlertTitle>Error</AlertTitle>
|
|
39
|
+
This is an error alert — <strong>check it out!</strong>
|
|
40
|
+
</Alert>
|
|
41
|
+
<Alert severity="warning">
|
|
42
|
+
<AlertTitle>Warning</AlertTitle>
|
|
43
|
+
This is a warning alert — <strong>check it out!</strong>
|
|
44
|
+
</Alert>
|
|
45
|
+
<Alert severity="info">
|
|
46
|
+
<AlertTitle>Info</AlertTitle>
|
|
47
|
+
This is an info alert — <strong>check it out!</strong>
|
|
48
|
+
</Alert>
|
|
49
|
+
<Alert severity="success">
|
|
50
|
+
<AlertTitle>Success</AlertTitle>
|
|
51
|
+
This is a success alert — <strong>check it out!</strong>
|
|
52
|
+
</Alert>
|
|
53
|
+
</Stack>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
Description.parameters = {
|
|
57
|
+
docs: {
|
|
58
|
+
description: {
|
|
59
|
+
story: DOCS.Alert.Description
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const Actions: ComponentStory<typeof Alert> = (args) => {
|
|
65
|
+
return (
|
|
66
|
+
<Stack sx={{ width: '100%' }} spacing={2}>
|
|
67
|
+
<Alert onClose={() => {}}>This is a success alert — check it out!</Alert>
|
|
68
|
+
<Alert
|
|
69
|
+
action={
|
|
70
|
+
<Button color="success" size="small">
|
|
71
|
+
UNDO
|
|
72
|
+
</Button>
|
|
73
|
+
}
|
|
74
|
+
>
|
|
75
|
+
This is a success alert — check it out!
|
|
76
|
+
</Alert>
|
|
77
|
+
</Stack>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
Actions.parameters = {
|
|
81
|
+
docs: {
|
|
82
|
+
description: {
|
|
83
|
+
story: DOCS.Alert.Actions
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Icons: ComponentStory<typeof Alert> = (args) => {
|
|
89
|
+
return (
|
|
90
|
+
<Stack sx={{ width: '100%' }} spacing={2}>
|
|
91
|
+
<Alert icon={<CheckIcon fontSize="inherit" />} severity="success">
|
|
92
|
+
This is a success alert — check it out!
|
|
93
|
+
</Alert>
|
|
94
|
+
<Alert icon={false} severity="success">
|
|
95
|
+
This is a success alert — check it out!
|
|
96
|
+
</Alert>
|
|
97
|
+
</Stack>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
Icons.parameters = {
|
|
101
|
+
docs: {
|
|
102
|
+
description: {
|
|
103
|
+
story: DOCS.Alert.Icons
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const Variants: ComponentStory<typeof Alert> = (args) => {
|
|
109
|
+
return (
|
|
110
|
+
<Stack sx={{ width: '100%' }} spacing={2}>
|
|
111
|
+
<Alert variant="filled" severity="success">
|
|
112
|
+
This is a success alert — check it out!
|
|
113
|
+
</Alert>
|
|
114
|
+
<Alert variant="outlined" severity="success">
|
|
115
|
+
This is a success alert — check it out!
|
|
116
|
+
</Alert>
|
|
117
|
+
</Stack>
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
Variants.parameters = {
|
|
121
|
+
docs: {
|
|
122
|
+
description: {
|
|
123
|
+
story: DOCS.Alert.Variants
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export const All: ComponentStory<typeof AllCombinations> = (args) => (
|
|
129
|
+
<AllCombinations />
|
|
130
|
+
)
|
|
131
|
+
All.parameters = {
|
|
132
|
+
docs: {
|
|
133
|
+
description: {
|
|
134
|
+
story: DOCS.Alert.All
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import Alert from '../../../../lib/components/feedback/Alert/Alert';
|
|
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/Feedback/Alert/Overview" component={Alert} />
|
|
8
|
+
|
|
9
|
+
[](#alert-overview)Alert Overview <span class="sbdocs-edit-link"><Chip clickable component="a" href="https://github.com/ht2-labs/design-system/tree/main/src/stories/Components/Feedback/Alert/Overview.stories.mdx" size="small" label="Edit" variant="outlined" /></span>
|
|
10
|
+
=================================================================================
|
|
11
|
+
|
|
12
|
+
### [](#what-does-it-do)What does it do?
|
|
13
|
+
|
|
14
|
+
An alert displays a short, important message in a way that attracts the user's attention without interrupting the user's task.
|
|
15
|
+
|
|
16
|
+
<Stack direction="row" spacing={1}>
|
|
17
|
+
<Chip clickable component="a" href="https://mui.com/components/alertes/" 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#alertes" 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/atoms/Alert" size="small" icon={<GithubIcon />} label="Github" variant="outlined" />
|
|
21
|
+
</Stack>
|
|
22
|
+
|
|
23
|
+
### [](#why-use-it)Why use it?
|
|
24
|
+
|
|
25
|
+
* Use alerts to inform users of important status changes and updates.
|
|
26
|
+
* Task-generated alerts are initiated in response to user action and they give direct, immediate feedback.
|
|
27
|
+
* System-generated alerts are initiated by the system, independent of user action and they provide updates on background system status or out-of-context events that have finished.
|
|
28
|
+
|
|
29
|
+
### [](#how-to-implement-it)How to implement it?
|
|
30
|
+
|
|
31
|
+
The basic Alert component includes four severity levels that set a distinctive icon and color.
|
|
32
|
+
|
|
33
|
+
<Canvas isExpanded>
|
|
34
|
+
<Stack sx={{ width: '100%' }} spacing={2}>
|
|
35
|
+
<Alert severity="error">This is an error alert — check it out!</Alert>
|
|
36
|
+
<Alert severity="warning">This is a warning alert — check it out!</Alert>
|
|
37
|
+
<Alert severity="info">This is an info alert — check it out!</Alert>
|
|
38
|
+
<Alert severity="success">This is a success alert — check it out!</Alert>
|
|
39
|
+
</Stack>
|
|
40
|
+
</Canvas>
|
|
41
|
+
|
|
42
|
+
### [](#when-to-avoid-it)When to avoid it?
|
|
43
|
+
|
|
44
|
+
* Only use alerts when necessary. Frequent interruptions can create a frustrating user experience, so these should be limited when possible.
|
|
45
|
+
* Frequent distractions lower productivity and can lead to alert fatigue.
|
|
46
|
+
|
|
47
|
+
### [](#best-practices)Best practices
|
|
48
|
+
|
|
49
|
+
Alert severity helps convey the information being communicated and corresponds with a color and icon to provide a consistent, universal experience for users.
|
|
50
|
+
* `severity="info"` - Provides additional information to users that may not be tied to their current action or task.
|
|
51
|
+
* `severity="success"` - Confirms a task was completed as expected.
|
|
52
|
+
* `severity="warning"` - Informs users that their actions are not desirable or might have unexpected results.
|
|
53
|
+
* `severity="error"` - Informs users of an error or critical failure.
|
|
54
|
+
|
|
55
|
+
### [](#design-prototype)Design prototype
|
|
56
|
+
<iframe
|
|
57
|
+
allowfullscreen
|
|
58
|
+
frameborder="0"
|
|
59
|
+
height="350"
|
|
60
|
+
width="100%"
|
|
61
|
+
src="https://www.figma.com/embed?embed_host=share&url=https://www.figma.com/proto/mBDuFn79U8wQIIEoCGpMew/DS%3A-Component-Library?node-id=1059%3A17697&scaling=min-zoom&page-id=1059%3A17118&starting-point-node-id=1059%3A17697"
|
|
62
|
+
/>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import Autocomplete from '../../../../lib/components/atoms/Autocomplete/Autocomplete';
|
|
3
|
+
import TextField from '../../../../lib/components/atoms/TextField/TextField';
|
|
4
|
+
import Chip from '@mui/material/Chip';
|
|
5
|
+
import { top100Films } from '../../../assets/testData'
|
|
6
|
+
|
|
7
|
+
<Meta title="Components/Inputs/Autocomplete/Accessibility" />
|
|
8
|
+
|
|
9
|
+
[](#autocomplete-accessibility)Autocomplete Accessibility <span class="sbdocs-edit-link"><Chip clickable component="a" href="https://github.com/ht2-labs/design-system/tree/main/src/stories/Components/Inputs/Autocomplete/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
|
+
Please follow the guidance in this section and see [WAI-ARIA](https://www.w3.org/TR/wai-aria-practices/#combobox) for more information.
|
|
15
|
+
|
|
16
|
+
## [](#guidelines)Guidelines
|
|
17
|
+
* The Autocomplete component automatically implements the WAI-ARIA authoring best practices. However, you need to be sure to add a descriptive `label` to the `TextField` component.
|
|
18
|
+
|
|
19
|
+
### [](#when-to-use-this-component)When to use this component
|
|
20
|
+
Use and Autocomplete component when you want to provide users with a panel of options or to suggest a word or phrase based on a user's input.
|
|
21
|
+
|
|
22
|
+
### [](#screen-readers)Screen readers
|
|
23
|
+
Be sure to add a clear and concise `label` to the `TextField` to ensure that screen readers can understand the purpose of the component.
|
|
24
|
+
<Canvas isExpanded>
|
|
25
|
+
<Autocomplete
|
|
26
|
+
renderInput={(params) => <TextField {...params} label="Description here" />}
|
|
27
|
+
id="combo-box-demo"
|
|
28
|
+
options={top100Films.map((option) => option.title)}
|
|
29
|
+
sx={{ width: 300 }}
|
|
30
|
+
/>
|
|
31
|
+
</Canvas>
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { Box } from '@mui/material'
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import Autocomplete from '../../../../lib/components/atoms/Autocomplete/Autocomplete'
|
|
4
|
+
import TextField from '../../../../lib/components/atoms/TextField/TextField'
|
|
5
|
+
import Stack from '@mui/material/Stack'
|
|
6
|
+
import { top100Films } from '../../../assets/testData'
|
|
7
|
+
|
|
8
|
+
interface FilmOptionType {
|
|
9
|
+
title: string
|
|
10
|
+
year: number
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const AutocompleteGrid = (args: any): JSX.Element => {
|
|
14
|
+
const defaultProps = {
|
|
15
|
+
options: top100Films,
|
|
16
|
+
getOptionLabel: (option: FilmOptionType) => option.title || ''
|
|
17
|
+
}
|
|
18
|
+
const flatProps = {
|
|
19
|
+
options: top100Films.map((option) => option.title)
|
|
20
|
+
}
|
|
21
|
+
const [value, setValue] = React.useState<any>(null)
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Stack spacing={1} sx={{ width: 300 }}>
|
|
25
|
+
<Autocomplete
|
|
26
|
+
{...defaultProps}
|
|
27
|
+
id="disable-close-on-select"
|
|
28
|
+
disableCloseOnSelect
|
|
29
|
+
renderInput={(params) => (
|
|
30
|
+
<TextField {...params} label="disableCloseOnSelect" />
|
|
31
|
+
)}
|
|
32
|
+
/>
|
|
33
|
+
<Autocomplete
|
|
34
|
+
{...defaultProps}
|
|
35
|
+
id="clear-on-escape"
|
|
36
|
+
clearOnEscape
|
|
37
|
+
renderInput={(params) => (
|
|
38
|
+
<TextField {...params} label="clearOnEscape" />
|
|
39
|
+
)}
|
|
40
|
+
/>
|
|
41
|
+
<Autocomplete
|
|
42
|
+
{...defaultProps}
|
|
43
|
+
id="disable-clearable"
|
|
44
|
+
disableClearable
|
|
45
|
+
renderInput={(params) => (
|
|
46
|
+
<TextField {...params} label="disableClearable" />
|
|
47
|
+
)}
|
|
48
|
+
/>
|
|
49
|
+
<Autocomplete
|
|
50
|
+
{...defaultProps}
|
|
51
|
+
id="include-input-in-list"
|
|
52
|
+
includeInputInList
|
|
53
|
+
renderInput={(params) => (
|
|
54
|
+
<TextField {...params} label="includeInputInList" />
|
|
55
|
+
)}
|
|
56
|
+
/>
|
|
57
|
+
<Autocomplete
|
|
58
|
+
{...flatProps}
|
|
59
|
+
id="flat-demo"
|
|
60
|
+
renderInput={(params) => (
|
|
61
|
+
<TextField {...params} label="flat" />
|
|
62
|
+
)}
|
|
63
|
+
/>
|
|
64
|
+
<Autocomplete
|
|
65
|
+
{...defaultProps}
|
|
66
|
+
id="controlled-demo"
|
|
67
|
+
value={value}
|
|
68
|
+
onChange={(event: any, newValue: any) => {
|
|
69
|
+
setValue(newValue)
|
|
70
|
+
}}
|
|
71
|
+
renderInput={(params) => (
|
|
72
|
+
<TextField {...params} label="controlled" />
|
|
73
|
+
)}
|
|
74
|
+
/>
|
|
75
|
+
<Autocomplete
|
|
76
|
+
{...defaultProps}
|
|
77
|
+
id="auto-complete"
|
|
78
|
+
autoComplete
|
|
79
|
+
includeInputInList
|
|
80
|
+
renderInput={(params) => (
|
|
81
|
+
<TextField {...params} label="autoComplete" />
|
|
82
|
+
)}
|
|
83
|
+
/>
|
|
84
|
+
<Autocomplete
|
|
85
|
+
{...defaultProps}
|
|
86
|
+
id="disable-list-wrap"
|
|
87
|
+
disableListWrap
|
|
88
|
+
renderInput={(params) => (
|
|
89
|
+
<TextField {...params} label="disableListWrap" />
|
|
90
|
+
)}
|
|
91
|
+
/>
|
|
92
|
+
<Autocomplete
|
|
93
|
+
{...defaultProps}
|
|
94
|
+
id="open-on-focus"
|
|
95
|
+
openOnFocus
|
|
96
|
+
renderInput={(params) => (
|
|
97
|
+
<TextField {...params} label="openOnFocus" />
|
|
98
|
+
)}
|
|
99
|
+
/>
|
|
100
|
+
<Autocomplete
|
|
101
|
+
{...defaultProps}
|
|
102
|
+
id="auto-highlight"
|
|
103
|
+
autoHighlight
|
|
104
|
+
renderInput={(params) => (
|
|
105
|
+
<TextField {...params} label="autoHighlight" />
|
|
106
|
+
)}
|
|
107
|
+
/>
|
|
108
|
+
<Autocomplete
|
|
109
|
+
{...defaultProps}
|
|
110
|
+
id="auto-select"
|
|
111
|
+
autoSelect
|
|
112
|
+
renderInput={(params) => (
|
|
113
|
+
<TextField {...params} label="autoSelect" />
|
|
114
|
+
)}
|
|
115
|
+
/>
|
|
116
|
+
<Autocomplete
|
|
117
|
+
{...defaultProps}
|
|
118
|
+
id="disabled"
|
|
119
|
+
disabled
|
|
120
|
+
renderInput={(params) => (
|
|
121
|
+
<TextField {...params} label="disabled" />
|
|
122
|
+
)}
|
|
123
|
+
/>
|
|
124
|
+
<Autocomplete
|
|
125
|
+
{...defaultProps}
|
|
126
|
+
id="disable-portal"
|
|
127
|
+
disablePortal
|
|
128
|
+
renderInput={(params) => (
|
|
129
|
+
<TextField {...params} label="disablePortal" />
|
|
130
|
+
)}
|
|
131
|
+
/>
|
|
132
|
+
<Autocomplete
|
|
133
|
+
{...defaultProps}
|
|
134
|
+
id="blur-on-select"
|
|
135
|
+
blurOnSelect
|
|
136
|
+
renderInput={(params) => (
|
|
137
|
+
<TextField {...params} label="blurOnSelect" />
|
|
138
|
+
)}
|
|
139
|
+
/>
|
|
140
|
+
<Autocomplete
|
|
141
|
+
{...defaultProps}
|
|
142
|
+
id="clear-on-blur"
|
|
143
|
+
clearOnBlur
|
|
144
|
+
renderInput={(params) => (
|
|
145
|
+
<TextField {...params} label="clearOnBlur" />
|
|
146
|
+
)}
|
|
147
|
+
/>
|
|
148
|
+
<Autocomplete
|
|
149
|
+
{...defaultProps}
|
|
150
|
+
id="select-on-focus"
|
|
151
|
+
selectOnFocus
|
|
152
|
+
renderInput={(params) => (
|
|
153
|
+
<TextField {...params} label="selectOnFocus" />
|
|
154
|
+
)}
|
|
155
|
+
/>
|
|
156
|
+
<Autocomplete
|
|
157
|
+
{...flatProps}
|
|
158
|
+
id="readOnly"
|
|
159
|
+
readOnly
|
|
160
|
+
defaultValue={[flatProps.options[13]]}
|
|
161
|
+
renderInput={(params) => (
|
|
162
|
+
<TextField {...params} label="readOnly" />
|
|
163
|
+
)}
|
|
164
|
+
/>
|
|
165
|
+
</Stack>
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export default function AllCombinations (): JSX.Element {
|
|
170
|
+
const combinations = [
|
|
171
|
+
{ },
|
|
172
|
+
{ freeSolo: true }
|
|
173
|
+
]
|
|
174
|
+
|
|
175
|
+
return (
|
|
176
|
+
<Box>
|
|
177
|
+
{combinations.map((AutocompleteConfig, i) => (
|
|
178
|
+
<AutocompleteGrid key={i} {...AutocompleteConfig} />
|
|
179
|
+
))}
|
|
180
|
+
</Box>
|
|
181
|
+
)
|
|
182
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react'
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import Autocomplete from '../../../../lib/components/atoms/Autocomplete/Autocomplete'
|
|
4
|
+
import TextField from '../../../../lib/components/atoms/TextField/TextField'
|
|
5
|
+
import { top100Films } from '../../../assets/testData'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/Inputs/Autocomplete/Properties',
|
|
9
|
+
component: Autocomplete,
|
|
10
|
+
parameters: {
|
|
11
|
+
controls: {
|
|
12
|
+
sort: 'requiredFirst'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
addons: {
|
|
16
|
+
panelPosition: 'right'
|
|
17
|
+
}
|
|
18
|
+
} as ComponentMeta<typeof Autocomplete>
|
|
19
|
+
|
|
20
|
+
// 👇 We create a “template” of how args map to rendering
|
|
21
|
+
const Template: ComponentStory<typeof Autocomplete> = (args) => <Autocomplete {...args} />
|
|
22
|
+
|
|
23
|
+
export const Properties = Template.bind({})
|
|
24
|
+
Properties.args = {
|
|
25
|
+
renderInput: (params) => (
|
|
26
|
+
<TextField {...params} label="Top 100 Movies" />
|
|
27
|
+
),
|
|
28
|
+
options: top100Films.map((option) => option.title),
|
|
29
|
+
id: 'combo-box-demo',
|
|
30
|
+
sx: { width: 300 }
|
|
31
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { Stack } from '@mui/material'
|
|
2
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react'
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { DOCS } from '../../../../docs'
|
|
5
|
+
import Autocomplete from '../../../../lib/components/atoms/Autocomplete/Autocomplete'
|
|
6
|
+
import Chip from '../../../../lib/components/datadisplay/Chip/Chip'
|
|
7
|
+
import TextField from '../../../../lib/components/atoms/TextField/TextField'
|
|
8
|
+
import AllCombinations from './AllCombinations'
|
|
9
|
+
import { top100Films } from '../../../assets/testData'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Components/Inputs/Autocomplete/Examples',
|
|
13
|
+
component: Autocomplete
|
|
14
|
+
} as ComponentMeta<typeof Autocomplete>
|
|
15
|
+
|
|
16
|
+
// For grouped demo
|
|
17
|
+
const options = top100Films.map((option) => {
|
|
18
|
+
const firstLetter = option.title[0].toUpperCase()
|
|
19
|
+
return {
|
|
20
|
+
firstLetter: /[0-9]/.test(firstLetter) ? '0-9' : firstLetter,
|
|
21
|
+
...option
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
// For disabled options demo
|
|
26
|
+
const timeSlots = Array.from(new Array(24 * 2)).map(
|
|
27
|
+
(_, index) =>
|
|
28
|
+
`${index < 20 ? '0' : ''}${Math.floor(index / 2)}:${
|
|
29
|
+
index % 2 === 0 ? '00' : '30'
|
|
30
|
+
}`
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
export const Default: ComponentStory<typeof Autocomplete> = (args) => (
|
|
34
|
+
<Autocomplete
|
|
35
|
+
id="default-demo"
|
|
36
|
+
options={[]}
|
|
37
|
+
sx={{ width: 300 }}
|
|
38
|
+
renderInput={(params) => <TextField {...params} label="Demo" />}
|
|
39
|
+
/>
|
|
40
|
+
)
|
|
41
|
+
Default.parameters = {
|
|
42
|
+
docs: {
|
|
43
|
+
description: {
|
|
44
|
+
component: DOCS.Autocomplete.Default
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const ComboBox: ComponentStory<typeof Autocomplete> = (args) => (
|
|
50
|
+
<Autocomplete
|
|
51
|
+
id="combo-box-demo"
|
|
52
|
+
options={top100Films.map((option) => option.title)}
|
|
53
|
+
sx={{ width: 300 }}
|
|
54
|
+
renderInput={(params) => <TextField {...params} label="Movie" />}
|
|
55
|
+
/>
|
|
56
|
+
)
|
|
57
|
+
ComboBox.parameters = {
|
|
58
|
+
docs: {
|
|
59
|
+
description: {
|
|
60
|
+
story: DOCS.Autocomplete.ComboBox
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const FreeSolo: ComponentStory<typeof Autocomplete> = (args) => (
|
|
66
|
+
<Stack spacing={2} sx={{ width: 300 }}>
|
|
67
|
+
<Autocomplete
|
|
68
|
+
id="free-solo-demo"
|
|
69
|
+
freeSolo
|
|
70
|
+
options={top100Films.map((option) => option.title)}
|
|
71
|
+
renderInput={(params) => <TextField {...params} label="freeSolo" />}
|
|
72
|
+
/>
|
|
73
|
+
<Autocomplete
|
|
74
|
+
freeSolo
|
|
75
|
+
id="free-solo-2-demo"
|
|
76
|
+
disableClearable
|
|
77
|
+
options={top100Films.map((option) => option.title)}
|
|
78
|
+
renderInput={(params) => (
|
|
79
|
+
<TextField
|
|
80
|
+
{...params}
|
|
81
|
+
label="Search input"
|
|
82
|
+
InputProps={{
|
|
83
|
+
...params.InputProps,
|
|
84
|
+
type: 'search'
|
|
85
|
+
}}
|
|
86
|
+
/>
|
|
87
|
+
)}
|
|
88
|
+
/>
|
|
89
|
+
</Stack>
|
|
90
|
+
)
|
|
91
|
+
FreeSolo.parameters = {
|
|
92
|
+
docs: {
|
|
93
|
+
description: {
|
|
94
|
+
story: DOCS.Autocomplete.FreeSolo
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const Grouped: ComponentStory<typeof Autocomplete> = (args) => (
|
|
100
|
+
<Autocomplete
|
|
101
|
+
id="grouped-demo"
|
|
102
|
+
options={options.sort((a, b) => -b.firstLetter.localeCompare(a.firstLetter))}
|
|
103
|
+
groupBy={(option) => option.firstLetter}
|
|
104
|
+
getOptionLabel={(option) => option.name || ''}
|
|
105
|
+
sx={{ width: 300 }}
|
|
106
|
+
renderInput={(params) => <TextField {...params} label="With categories" />}
|
|
107
|
+
/>
|
|
108
|
+
)
|
|
109
|
+
Grouped.parameters = {
|
|
110
|
+
docs: {
|
|
111
|
+
description: {
|
|
112
|
+
story: DOCS.Autocomplete.Grouped
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const DisabledOptions: ComponentStory<typeof Autocomplete> = (args) => (
|
|
118
|
+
<Autocomplete
|
|
119
|
+
id="disabled-options-demo"
|
|
120
|
+
options={timeSlots}
|
|
121
|
+
getOptionDisabled={(option) =>
|
|
122
|
+
option === timeSlots[0] || option === timeSlots[2]
|
|
123
|
+
}
|
|
124
|
+
sx={{ width: 300 }}
|
|
125
|
+
renderInput={(params) => <TextField {...params} label="Disabled options" />}
|
|
126
|
+
/>
|
|
127
|
+
)
|
|
128
|
+
DisabledOptions.parameters = {
|
|
129
|
+
docs: {
|
|
130
|
+
description: {
|
|
131
|
+
story: DOCS.Autocomplete.DisabledOptions
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export const MultipleValues: ComponentStory<typeof Autocomplete> = (args) => (
|
|
137
|
+
<Stack spacing={3} sx={{ width: 500 }}>
|
|
138
|
+
<Autocomplete
|
|
139
|
+
multiple
|
|
140
|
+
id="tags-standard"
|
|
141
|
+
options={top100Films}
|
|
142
|
+
getOptionLabel={(option) => option.title}
|
|
143
|
+
defaultValue={[top100Films[13]]}
|
|
144
|
+
renderInput={(params) => (
|
|
145
|
+
<TextField
|
|
146
|
+
{...params}
|
|
147
|
+
label="Multiple values"
|
|
148
|
+
placeholder="Favorites"
|
|
149
|
+
/>
|
|
150
|
+
)}
|
|
151
|
+
/>
|
|
152
|
+
<Autocomplete
|
|
153
|
+
multiple
|
|
154
|
+
id="tags-outlined"
|
|
155
|
+
options={top100Films}
|
|
156
|
+
getOptionLabel={(option) => option.title}
|
|
157
|
+
defaultValue={[top100Films[13]]}
|
|
158
|
+
filterSelectedOptions
|
|
159
|
+
renderInput={(params) => (
|
|
160
|
+
<TextField
|
|
161
|
+
{...params}
|
|
162
|
+
label="filterSelectedOptions"
|
|
163
|
+
placeholder="Favorites"
|
|
164
|
+
/>
|
|
165
|
+
)}
|
|
166
|
+
/>
|
|
167
|
+
<Autocomplete
|
|
168
|
+
multiple
|
|
169
|
+
id="tags-filled"
|
|
170
|
+
options={top100Films.map((option) => option.title)}
|
|
171
|
+
defaultValue={[top100Films[13].title]}
|
|
172
|
+
freeSolo
|
|
173
|
+
renderTags={(value: readonly string[], getTagProps) =>
|
|
174
|
+
value.map((option: string, index: number) => (
|
|
175
|
+
<Chip variant="outlined" label={option} {...getTagProps({ index })} />
|
|
176
|
+
))
|
|
177
|
+
}
|
|
178
|
+
renderInput={(params) => (
|
|
179
|
+
<TextField
|
|
180
|
+
{...params}
|
|
181
|
+
label="freeSolo"
|
|
182
|
+
placeholder="Favorites"
|
|
183
|
+
/>
|
|
184
|
+
)}
|
|
185
|
+
/>
|
|
186
|
+
<Autocomplete
|
|
187
|
+
multiple
|
|
188
|
+
id="tags-readOnly"
|
|
189
|
+
options={top100Films.map((option) => option.title)}
|
|
190
|
+
defaultValue={[top100Films[12].title, top100Films[13].title]}
|
|
191
|
+
readOnly
|
|
192
|
+
renderInput={(params) => (
|
|
193
|
+
<TextField {...params} label="readOnly" placeholder="Favorites" />
|
|
194
|
+
)}
|
|
195
|
+
/>
|
|
196
|
+
</Stack>
|
|
197
|
+
)
|
|
198
|
+
MultipleValues.parameters = {
|
|
199
|
+
docs: {
|
|
200
|
+
description: {
|
|
201
|
+
story: DOCS.Autocomplete.MultipleValues
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export const Sizes: ComponentStory<typeof Autocomplete> = (args) => (
|
|
207
|
+
<Stack spacing={2}>
|
|
208
|
+
<Autocomplete
|
|
209
|
+
id="size-demo-1"
|
|
210
|
+
size='small'
|
|
211
|
+
options={top100Films.map((option) => option.title)}
|
|
212
|
+
sx={{ width: 300 }}
|
|
213
|
+
renderInput={(params) => <TextField {...params} label="Movie" />}
|
|
214
|
+
/>
|
|
215
|
+
<Autocomplete
|
|
216
|
+
id="size-demo-2"
|
|
217
|
+
options={top100Films.map((option) => option.title)}
|
|
218
|
+
sx={{ width: 300 }}
|
|
219
|
+
renderInput={(params) => <TextField {...params} label="Movie" />}
|
|
220
|
+
/>
|
|
221
|
+
</Stack>
|
|
222
|
+
)
|
|
223
|
+
Sizes.parameters = {
|
|
224
|
+
docs: {
|
|
225
|
+
description: {
|
|
226
|
+
story: DOCS.Autocomplete.Sizes
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export const All: ComponentStory<typeof AllCombinations> = (args) => (
|
|
232
|
+
<AllCombinations />
|
|
233
|
+
)
|