@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,333 @@
|
|
|
1
|
+
import { FormControl, FormControlLabel, FormHelperText, FormLabel, RadioGroup } from '@mui/material'
|
|
2
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react'
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { DOCS } from '../../../../docs'
|
|
5
|
+
import Radio from '../../../../lib/components/atoms/Radio/Radio'
|
|
6
|
+
import Button from '../../../../lib/components/atoms/Button/Button'
|
|
7
|
+
import AllCombinations from './AllCombinations'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Components/Inputs/Radio/Examples',
|
|
11
|
+
component: Radio
|
|
12
|
+
} as ComponentMeta<typeof Radio>
|
|
13
|
+
|
|
14
|
+
export const Default: ComponentStory<typeof Radio> = (args): JSX.Element => (
|
|
15
|
+
<FormControl>
|
|
16
|
+
<FormLabel id="demo-radio-buttons-group-label">Gender</FormLabel>
|
|
17
|
+
<RadioGroup
|
|
18
|
+
aria-labelledby="demo-radio-buttons-group-label"
|
|
19
|
+
defaultValue="female"
|
|
20
|
+
name="radio-buttons-group"
|
|
21
|
+
>
|
|
22
|
+
<FormControlLabel value="female" control={<Radio />} label="Female" />
|
|
23
|
+
<FormControlLabel value="male" control={<Radio />} label="Male" />
|
|
24
|
+
<FormControlLabel value="other" control={<Radio />} label="Other" />
|
|
25
|
+
</RadioGroup>
|
|
26
|
+
</FormControl>
|
|
27
|
+
)
|
|
28
|
+
Default.parameters = {
|
|
29
|
+
docs: {
|
|
30
|
+
description: {
|
|
31
|
+
component: DOCS.Radio.Default
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
controls: {
|
|
35
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
36
|
+
// hideNoControlsWarning: true
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const Direction: ComponentStory<typeof Radio> = (args): JSX.Element => {
|
|
41
|
+
return (
|
|
42
|
+
<FormControl>
|
|
43
|
+
<FormLabel id="demo-row-radio-buttons-direction">Gender</FormLabel>
|
|
44
|
+
<RadioGroup
|
|
45
|
+
row
|
|
46
|
+
aria-labelledby="demo-row-radio-buttons-direction"
|
|
47
|
+
name="row-radio-buttons-direction"
|
|
48
|
+
>
|
|
49
|
+
<FormControlLabel value="female" control={<Radio />} label="Female" />
|
|
50
|
+
<FormControlLabel value="male" control={<Radio />} label="Male" />
|
|
51
|
+
<FormControlLabel value="other" control={<Radio />} label="Other" />
|
|
52
|
+
<FormControlLabel
|
|
53
|
+
value="disabled"
|
|
54
|
+
disabled
|
|
55
|
+
control={<Radio />}
|
|
56
|
+
label="other"
|
|
57
|
+
/>
|
|
58
|
+
</RadioGroup>
|
|
59
|
+
</FormControl>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
Direction.parameters = {
|
|
63
|
+
docs: {
|
|
64
|
+
description: {
|
|
65
|
+
story: DOCS.Radio.Direction
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const Controlled: ComponentStory<typeof Radio> = (args): JSX.Element => {
|
|
71
|
+
const [value, setValue] = React.useState('female')
|
|
72
|
+
|
|
73
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
74
|
+
setValue((event.target as HTMLInputElement).value)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<FormControl>
|
|
79
|
+
<FormLabel id="demo-controlled-radio-buttons-controlled">Gender</FormLabel>
|
|
80
|
+
<RadioGroup
|
|
81
|
+
aria-labelledby="demo-controlled-radio-buttons-controlled"
|
|
82
|
+
name="controlled-radio-buttons-controlled"
|
|
83
|
+
value={value}
|
|
84
|
+
onChange={handleChange}
|
|
85
|
+
>
|
|
86
|
+
<FormControlLabel value="female" control={<Radio />} label="Female" />
|
|
87
|
+
<FormControlLabel value="male" control={<Radio />} label="Male" />
|
|
88
|
+
</RadioGroup>
|
|
89
|
+
</FormControl>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
Controlled.parameters = {
|
|
93
|
+
docs: {
|
|
94
|
+
description: {
|
|
95
|
+
story: DOCS.Radio.Controlled
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
controls: {
|
|
99
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
100
|
+
// hideNoControlsWarning: true
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export const Standalone: ComponentStory<typeof Radio> = (args): JSX.Element => {
|
|
105
|
+
const [selectedValue, setSelectedValue] = React.useState('a')
|
|
106
|
+
|
|
107
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
108
|
+
setSelectedValue(event.target.value)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<div>
|
|
113
|
+
<Radio
|
|
114
|
+
checked={selectedValue === 'a'}
|
|
115
|
+
onChange={handleChange}
|
|
116
|
+
value="a"
|
|
117
|
+
name="radio-buttons"
|
|
118
|
+
inputProps={{ 'aria-label': 'A' }}
|
|
119
|
+
/>
|
|
120
|
+
<Radio
|
|
121
|
+
checked={selectedValue === 'b'}
|
|
122
|
+
onChange={handleChange}
|
|
123
|
+
value="b"
|
|
124
|
+
name="radio-buttons"
|
|
125
|
+
inputProps={{ 'aria-label': 'B' }}
|
|
126
|
+
/>
|
|
127
|
+
</div>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
Standalone.parameters = {
|
|
131
|
+
docs: {
|
|
132
|
+
description: {
|
|
133
|
+
story: DOCS.Radio.Standalone
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
controls: {
|
|
137
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
138
|
+
// hideNoControlsWarning: true
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export const Sizes: ComponentStory<typeof Radio> = (args): JSX.Element => {
|
|
143
|
+
const [selectedValue, setSelectedValue] = React.useState('a')
|
|
144
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
145
|
+
setSelectedValue(event.target.value)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const controlProps = (item: string): object => ({
|
|
149
|
+
checked: selectedValue === item,
|
|
150
|
+
onChange: handleChange,
|
|
151
|
+
value: item,
|
|
152
|
+
name: 'size-radio-button-demo',
|
|
153
|
+
inputProps: { 'aria-label': item }
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<div>
|
|
158
|
+
<Radio {...controlProps('a')} size="small" />
|
|
159
|
+
<Radio {...controlProps('b')} />
|
|
160
|
+
<Radio
|
|
161
|
+
{...controlProps('c')}
|
|
162
|
+
sx={{
|
|
163
|
+
'& .MuiSvgIcon-root': {
|
|
164
|
+
fontSize: 28
|
|
165
|
+
}
|
|
166
|
+
}}
|
|
167
|
+
/>
|
|
168
|
+
</div>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
Sizes.parameters = {
|
|
172
|
+
docs: {
|
|
173
|
+
description: {
|
|
174
|
+
story: DOCS.Radio.Sizes
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
controls: {
|
|
178
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
179
|
+
// hideNoControlsWarning: true
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export const Colors: ComponentStory<typeof Radio> = (args): JSX.Element => {
|
|
184
|
+
const [selectedValue, setSelectedValue] = React.useState('a')
|
|
185
|
+
|
|
186
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
187
|
+
setSelectedValue(event.target.value)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const controlProps = (item: string): object => ({
|
|
191
|
+
checked: selectedValue === item,
|
|
192
|
+
onChange: handleChange,
|
|
193
|
+
value: item,
|
|
194
|
+
name: 'color-radio-button-demo',
|
|
195
|
+
inputProps: { 'aria-label': item }
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
return (
|
|
199
|
+
<div>
|
|
200
|
+
<Radio {...controlProps('a')} color="default" />
|
|
201
|
+
<Radio {...controlProps('b')} />
|
|
202
|
+
<Radio {...controlProps('d')} color="secondary" />
|
|
203
|
+
<Radio {...controlProps('e')} color="error" />
|
|
204
|
+
<Radio {...controlProps('f')} color="success" />
|
|
205
|
+
<Radio {...controlProps('g')} color="info" />
|
|
206
|
+
<Radio {...controlProps('h')} color="warning" />
|
|
207
|
+
</div>
|
|
208
|
+
)
|
|
209
|
+
}
|
|
210
|
+
Colors.parameters = {
|
|
211
|
+
docs: {
|
|
212
|
+
description: {
|
|
213
|
+
story: DOCS.Radio.Colors
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
controls: {
|
|
217
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
218
|
+
// hideNoControlsWarning: true
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export const LabelPosition: ComponentStory<typeof Radio> = (args): JSX.Element => (
|
|
223
|
+
<FormControl>
|
|
224
|
+
<FormLabel id="demo-form-control-label-placement">labelPlacement</FormLabel>
|
|
225
|
+
<RadioGroup
|
|
226
|
+
row
|
|
227
|
+
aria-labelledby="demo-form-control-label-placement"
|
|
228
|
+
name="position"
|
|
229
|
+
defaultValue="top"
|
|
230
|
+
>
|
|
231
|
+
<FormControlLabel
|
|
232
|
+
value="top"
|
|
233
|
+
control={<Radio />}
|
|
234
|
+
label="Top"
|
|
235
|
+
labelPlacement="top"
|
|
236
|
+
/>
|
|
237
|
+
<FormControlLabel
|
|
238
|
+
value="start"
|
|
239
|
+
control={<Radio />}
|
|
240
|
+
label="Start"
|
|
241
|
+
labelPlacement="start"
|
|
242
|
+
/>
|
|
243
|
+
<FormControlLabel
|
|
244
|
+
value="bottom"
|
|
245
|
+
control={<Radio />}
|
|
246
|
+
label="Bottom"
|
|
247
|
+
labelPlacement="bottom"
|
|
248
|
+
/>
|
|
249
|
+
<FormControlLabel value="end" control={<Radio />} label="End" />
|
|
250
|
+
</RadioGroup>
|
|
251
|
+
</FormControl>
|
|
252
|
+
)
|
|
253
|
+
LabelPosition.parameters = {
|
|
254
|
+
docs: {
|
|
255
|
+
description: {
|
|
256
|
+
story: DOCS.Radio.LabelPosition
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
controls: {
|
|
260
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
261
|
+
// hideNoControlsWarning: true
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export const ShowError: ComponentStory<typeof Radio> = (args): JSX.Element => {
|
|
266
|
+
const [value, setValue] = React.useState('')
|
|
267
|
+
const [error, setError] = React.useState(false)
|
|
268
|
+
const [helperText, setHelperText] = React.useState('Choose wisely')
|
|
269
|
+
|
|
270
|
+
const handleRadioChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
271
|
+
setValue((event.target as HTMLInputElement).value)
|
|
272
|
+
setHelperText(' ')
|
|
273
|
+
setError(false)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const handleSubmit = (event: React.FormEvent<HTMLFormElement>): void => {
|
|
277
|
+
event.preventDefault()
|
|
278
|
+
|
|
279
|
+
if (value === 'best') {
|
|
280
|
+
setHelperText('You got it!')
|
|
281
|
+
setError(false)
|
|
282
|
+
} else if (value === 'worst') {
|
|
283
|
+
setHelperText('Sorry, wrong answer!')
|
|
284
|
+
setError(true)
|
|
285
|
+
} else {
|
|
286
|
+
setHelperText('Please select an option.')
|
|
287
|
+
setError(true)
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return (
|
|
292
|
+
<form onSubmit={handleSubmit}>
|
|
293
|
+
<FormControl sx={{ m: 3 }} error={error} variant="standard">
|
|
294
|
+
<FormLabel id="demo-error-radios">Pop quiz: MUI is...</FormLabel>
|
|
295
|
+
<RadioGroup
|
|
296
|
+
aria-labelledby="demo-error-radios"
|
|
297
|
+
name="quiz"
|
|
298
|
+
value={value}
|
|
299
|
+
onChange={handleRadioChange}
|
|
300
|
+
>
|
|
301
|
+
<FormControlLabel value="best" control={<Radio />} label="The best!" />
|
|
302
|
+
<FormControlLabel value="worst" control={<Radio />} label="The worst." />
|
|
303
|
+
</RadioGroup>
|
|
304
|
+
<FormHelperText>{helperText}</FormHelperText>
|
|
305
|
+
<Button sx={{ mt: 1, mr: 1 }} type="submit" variant="outlined">
|
|
306
|
+
Check Answer
|
|
307
|
+
</Button>
|
|
308
|
+
</FormControl>
|
|
309
|
+
</form>
|
|
310
|
+
)
|
|
311
|
+
}
|
|
312
|
+
ShowError.parameters = {
|
|
313
|
+
docs: {
|
|
314
|
+
description: {
|
|
315
|
+
story: DOCS.Radio.ShowError
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
controls: {
|
|
319
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
320
|
+
// hideNoControlsWarning: true
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export const All: ComponentStory<typeof AllCombinations> = (args) => (
|
|
325
|
+
<AllCombinations />
|
|
326
|
+
)
|
|
327
|
+
All.parameters = {
|
|
328
|
+
docs: {
|
|
329
|
+
description: {
|
|
330
|
+
story: DOCS.Radio.All
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import Radio from '../../../../lib/components/atoms/Radio/Radio';
|
|
3
|
+
import { MUIIcon, MaterialDesignIcon, W3CIcon, FigmaIcon, GithubIcon } from '../../../utils/CustomIcons';
|
|
4
|
+
import RadioGroup from '@mui/material/RadioGroup';
|
|
5
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
6
|
+
import FormControl from '@mui/material/FormControl';
|
|
7
|
+
import FormLabel from '@mui/material/FormLabel';
|
|
8
|
+
import Chip from '@mui/material/Chip';
|
|
9
|
+
import Stack from '@mui/material/Stack';
|
|
10
|
+
|
|
11
|
+
<Meta title="Components/Inputs/Radio/Overview" component={Radio} />
|
|
12
|
+
|
|
13
|
+
[](#radio-overview)Radio Overview <span class="sbdocs-edit-link"><Chip clickable component="a" href="https://github.com/ht2-labs/design-system/tree/main/src/stories/Components/Inputs/Radio/Overview.stories.mdx" size="small" label="Edit" variant="outlined" /></span>
|
|
14
|
+
=================================================================================
|
|
15
|
+
|
|
16
|
+
### [](#what-does-it-do)What does it do?
|
|
17
|
+
|
|
18
|
+
Radio buttons allow the user to select one item from a set of options. A radio button has an associated label that should clearly describe the option.
|
|
19
|
+
|
|
20
|
+
<Stack direction="row" spacing={1}>
|
|
21
|
+
<Chip clickable component="a" href="https://mui.com/components/radio-buttons/" size="small" icon={<MUIIcon viewBox="-5 0 40 30" />} label="Material UI" variant="outlined" />
|
|
22
|
+
<Chip clickable component="a" href="https://material.io/components/selection-controls#radio-buttons" size="small" icon={<MaterialDesignIcon />} label="Material Design" variant="outlined" />
|
|
23
|
+
<Chip clickable component="a" href="https://www.w3.org/TR/wai-aria-practices/#radiobutton" size="small" icon={<W3CIcon />} label="WAI-ARIA" variant="outlined" />
|
|
24
|
+
<Chip clickable component="a" href="https://www.figma.com/proto/mBDuFn79U8wQIIEoCGpMew/DS%3A-Component-Library?node-id=1065%3A17356&scaling=min-zoom&page-id=1059%3A17709&starting-point-node-id=1065%3A17356" size="small" icon={<FigmaIcon />} label="Figma" variant="outlined" />
|
|
25
|
+
<Chip clickable component="a" href="https://github.com/HT2-Labs/design-system/tree/main/src/lib/components/atoms/Radio" size="small" icon={<GithubIcon />} label="Github" variant="outlined" />
|
|
26
|
+
</Stack>
|
|
27
|
+
|
|
28
|
+
### [](#why-use-it)Why use it?
|
|
29
|
+
|
|
30
|
+
* Radio buttons are used for mutually exclusive choices, not for multiple choices.
|
|
31
|
+
* Use radio buttons when the user needs to see all available options.
|
|
32
|
+
* A radio button can also be used for changing settings in a menu or selecting a singular item in a data table.
|
|
33
|
+
|
|
34
|
+
Understanding [Checkboxes vs Radio Buttons](https://www.nngroup.com/articles/checkboxes-vs-radio-buttons/)
|
|
35
|
+
|
|
36
|
+
### [](#how-to-implement-it)How to implement it?
|
|
37
|
+
|
|
38
|
+
Below is an overview of the baisc Radio button component that uses the `RadioGroup`, `FormControl` and `FormControlLabel` components. Thid makes it easy to group Radio components and provides an easier API with proper keyboard accessibility to the group.
|
|
39
|
+
|
|
40
|
+
<Canvas isExpanded>
|
|
41
|
+
<FormControl>
|
|
42
|
+
<FormLabel id="demo-radio-buttons-group-label">How many items?</FormLabel>
|
|
43
|
+
<RadioGroup
|
|
44
|
+
aria-labelledby="demo-radio-buttons-group-label"
|
|
45
|
+
defaultValue="none"
|
|
46
|
+
name="radio-buttons-group"
|
|
47
|
+
>
|
|
48
|
+
<FormControlLabel value="none" control={<Radio />} label="None" />
|
|
49
|
+
<FormControlLabel value="one" control={<Radio />} label="One" />
|
|
50
|
+
<FormControlLabel value="two" control={<Radio />} label="Two" />
|
|
51
|
+
<FormControlLabel value="three" control={<Radio />} label="Three" />
|
|
52
|
+
</RadioGroup>
|
|
53
|
+
</FormControl>
|
|
54
|
+
</Canvas>
|
|
55
|
+
|
|
56
|
+
### [](#when-to-avoid-it)When to avoid it?
|
|
57
|
+
|
|
58
|
+
* Do not use a radio button when a user can select more than one option from a list; use a checkbox instead.
|
|
59
|
+
* Do not use a radio button to trigger an action based on a user's selection.
|
|
60
|
+
|
|
61
|
+
### [](#best-practices)Best practices
|
|
62
|
+
|
|
63
|
+
* Radio buttons should have the most commonly used option selected by default.
|
|
64
|
+
* When grouping multiple radio buttons, use the [RadioGroup](https://mui.com/api/radio-group/) component.
|
|
65
|
+
* Ensure that all radio buttons have a clear and concise label description.
|
|
66
|
+
|
|
67
|
+
### [](#design-prototype)Design prototype
|
|
68
|
+
<iframe
|
|
69
|
+
allowfullscreen
|
|
70
|
+
frameborder="0"
|
|
71
|
+
height="350"
|
|
72
|
+
width="100%"
|
|
73
|
+
src="https://www.figma.com/embed?embed_host=share&url=https://www.figma.com/proto/mBDuFn79U8wQIIEoCGpMew/DS%3A-Component-Library?node-id=1065%3A17356&scaling=min-zoom&page-id=1059%3A17709&starting-point-node-id=1065%3A17356"
|
|
74
|
+
/>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react'
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import Radio from '../../../../lib/components/atoms/Radio/Radio'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Inputs/Radio/Properties',
|
|
7
|
+
component: Radio,
|
|
8
|
+
parameters: {
|
|
9
|
+
controls: {
|
|
10
|
+
sort: 'requiredFirst'
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
addons: {
|
|
14
|
+
panelPosition: 'right'
|
|
15
|
+
}
|
|
16
|
+
} as ComponentMeta<typeof Radio>
|
|
17
|
+
|
|
18
|
+
// 👇 We create a “template” of how args map to rendering
|
|
19
|
+
const Template: ComponentStory<typeof Radio> = (args) => <Radio {...args} />
|
|
20
|
+
|
|
21
|
+
export const Properties = Template.bind({})
|
|
22
|
+
Properties.args = {}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Canvas, Meta, Story, Preview } from '@storybook/addon-docs';
|
|
2
|
+
import Select from '../../../../lib/components/atoms/Select/Select';
|
|
3
|
+
import NativeSelect from '@mui/material/NativeSelect';
|
|
4
|
+
import InputLabel from '@mui/material/InputLabel';
|
|
5
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
6
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
7
|
+
import Chip from '@mui/material/Chip';
|
|
8
|
+
|
|
9
|
+
<Meta title="Components/Inputs/Select/Accessibility" />
|
|
10
|
+
|
|
11
|
+
[](#select-accessibility)Select Accessibility <span class="sbdocs-edit-link"><Chip clickable component="a" href="https://github.com/ht2-labs/design-system/tree/main/src/stories/Components/Inputs/Select/Accessibility.stories.mdx" size="small" label="Edit" variant="outlined" /></span>
|
|
12
|
+
=================================================================================
|
|
13
|
+
|
|
14
|
+
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.
|
|
15
|
+
|
|
16
|
+
Please follow the guidance in this section and see [WAI-ARIA Select](https://www.w3.org/TR/wai-aria-practices/#switch) for more information.
|
|
17
|
+
|
|
18
|
+
## [](#guidelines)Guidelines
|
|
19
|
+
* Use the label to provide a clear and concise description of the Select options.
|
|
20
|
+
* Avoid long option names to make it easier to understand and increase usability.
|
|
21
|
+
* If the select field is required include the `aria-required` property and clearly indicate that it is a required field.
|
|
22
|
+
|
|
23
|
+
### [](#when-to-use-this-component)When to use this component
|
|
24
|
+
Use the select component inside a form where users are selecting from a list of options and submitting data.
|
|
25
|
+
|
|
26
|
+
### [](#screen-readers)Screen readers
|
|
27
|
+
To properly label your `Select` input you need an extra element with an `id` that contains a `label`. That `id` needs to match the `labelId` of the `Select` e.g.
|
|
28
|
+
<Canvas isExpanded>
|
|
29
|
+
<InputLabel id="label">Age</InputLabel>
|
|
30
|
+
<Select labelId="label" id="select" value="20">
|
|
31
|
+
<MenuItem value="10">Ten</MenuItem>
|
|
32
|
+
<MenuItem value="20">Twenty</MenuItem>
|
|
33
|
+
</Select>
|
|
34
|
+
</Canvas>
|
|
35
|
+
|
|
36
|
+
Alternatively a `TextField` with an `id` and `label` creates the proper markup and ids for you:
|
|
37
|
+
<Preview isExpanded>
|
|
38
|
+
<TextField id="select" label="Age" value="20" select>
|
|
39
|
+
<MenuItem value="10">Ten</MenuItem>
|
|
40
|
+
<MenuItem value="20">Twenty</MenuItem>
|
|
41
|
+
</TextField>
|
|
42
|
+
</Preview>
|
|
43
|
+
|
|
44
|
+
For a [native select](https://mui.com/components/selects/#native-select), you should mention a label by giving the value of the `id` attribute of the select element to the `InputLabel`'s `htmlFor` attribute:
|
|
45
|
+
<Canvas isExpanded>
|
|
46
|
+
<InputLabel htmlFor="select">Age</InputLabel>
|
|
47
|
+
<NativeSelect id="select">
|
|
48
|
+
<option value="10">Ten</option>
|
|
49
|
+
<option value="20">Twenty</option>
|
|
50
|
+
</NativeSelect>
|
|
51
|
+
</Canvas>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { Box, FormControl, FormHelperText, InputLabel, MenuItem } from '@mui/material'
|
|
3
|
+
import Select, { SelectChangeEvent } from '../../../../lib/components/atoms/Select/Select'
|
|
4
|
+
|
|
5
|
+
const SelectGrid = (args: any): JSX.Element => {
|
|
6
|
+
const [age, setAge] = React.useState('')
|
|
7
|
+
|
|
8
|
+
const handleChange = (event: SelectChangeEvent): void => {
|
|
9
|
+
setAge(event.target.value)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<Box>
|
|
14
|
+
{[
|
|
15
|
+
{ },
|
|
16
|
+
{ error: true },
|
|
17
|
+
{ disabled: true },
|
|
18
|
+
{ withLabel: true },
|
|
19
|
+
{ withoutLabel: true }
|
|
20
|
+
].map(selectItem => {
|
|
21
|
+
const { error, disabled, withLabel, withoutLabel } = selectItem
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<FormControl sx={{ m: 1, minWidth: 120 }} error={error}>
|
|
25
|
+
{withoutLabel ? null : <InputLabel id="demo-simple-select-label">Age</InputLabel>}
|
|
26
|
+
<Select
|
|
27
|
+
labelId="demo-simple-select-label"
|
|
28
|
+
id="demo-simple-select"
|
|
29
|
+
value={age}
|
|
30
|
+
label="Age"
|
|
31
|
+
onChange={handleChange}
|
|
32
|
+
disabled={disabled}
|
|
33
|
+
displayEmpty={withoutLabel}
|
|
34
|
+
{...args}
|
|
35
|
+
>
|
|
36
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
37
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
38
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
39
|
+
</Select>
|
|
40
|
+
{withLabel ? <FormHelperText>With label + helper text</FormHelperText> : null}
|
|
41
|
+
{withoutLabel ? <FormHelperText>Without label</FormHelperText> : null}
|
|
42
|
+
</FormControl>
|
|
43
|
+
)
|
|
44
|
+
})}
|
|
45
|
+
</Box>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default function AllCombinations (): JSX.Element {
|
|
50
|
+
const combinations = [
|
|
51
|
+
{ variant: 'standard' },
|
|
52
|
+
{ variant: 'outlined' },
|
|
53
|
+
{ variant: 'filled' }
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<Box>
|
|
58
|
+
{combinations.map(selectConfig => (
|
|
59
|
+
<SelectGrid {...selectConfig} />
|
|
60
|
+
))}
|
|
61
|
+
</Box>
|
|
62
|
+
)
|
|
63
|
+
}
|