@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,363 @@
|
|
|
1
|
+
import FavoriteIcon from '@mui/icons-material/Favorite'
|
|
2
|
+
import FavoriteBorderIcon from '@mui/icons-material/FavoriteBorder'
|
|
3
|
+
import BookmarkIcon from '@mui/icons-material/Bookmark'
|
|
4
|
+
import BookmarkBorderIcon from '@mui/icons-material/BookmarkBorder'
|
|
5
|
+
import { Box, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Stack } from '@mui/material'
|
|
6
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react'
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { DOCS } from '../../../../docs'
|
|
9
|
+
import Checkbox from '../../../../lib/components/atoms/Checkbox/Checkbox'
|
|
10
|
+
import AllCombinations from './AllCombinations'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: 'Components/Inputs/Checkbox/Examples',
|
|
14
|
+
component: Checkbox
|
|
15
|
+
} as ComponentMeta<typeof Checkbox>
|
|
16
|
+
|
|
17
|
+
export const Default: ComponentStory<typeof Checkbox> = (args): JSX.Element => {
|
|
18
|
+
const label = { inputProps: { 'aria-label': 'Checkbox demo' } }
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Stack spacing={2} direction="row">
|
|
22
|
+
<Checkbox {...label} defaultChecked />
|
|
23
|
+
<Checkbox {...label} />
|
|
24
|
+
<Checkbox {...label} disabled />
|
|
25
|
+
<Checkbox {...label} disabled checked />
|
|
26
|
+
</Stack>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
Default.parameters = {
|
|
30
|
+
docs: {
|
|
31
|
+
description: {
|
|
32
|
+
component: DOCS.Checkbox.Default
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
controls: {
|
|
36
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
37
|
+
// hideNoControlsWarning: true
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const Label: ComponentStory<typeof Checkbox> = (args): JSX.Element => {
|
|
42
|
+
const label = { inputProps: { 'aria-label': 'Checkbox demo' } }
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<FormGroup>
|
|
46
|
+
<FormControlLabel control={<Checkbox {...label} defaultChecked />} label="Label checked"/>
|
|
47
|
+
<FormControlLabel control={<Checkbox {...label} />} label="Label"/>
|
|
48
|
+
<FormControlLabel control={<Checkbox {...label} disabled />} label="Disabled"/>
|
|
49
|
+
<FormControlLabel control={<Checkbox {...label} disabled checked />} label="Disabled checked"/>
|
|
50
|
+
</FormGroup>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
Label.parameters = {
|
|
54
|
+
docs: {
|
|
55
|
+
description: {
|
|
56
|
+
story: DOCS.Checkbox.Label
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const Colors: ComponentStory<typeof Checkbox> = (args): JSX.Element => {
|
|
62
|
+
const label = { inputProps: { 'aria-label': 'Checkbox demo' } }
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<Box>
|
|
66
|
+
<Checkbox {...label} defaultChecked color="default" />
|
|
67
|
+
<Checkbox {...label} defaultChecked />
|
|
68
|
+
<Checkbox {...label} defaultChecked color="secondary" />
|
|
69
|
+
<Checkbox {...label} defaultChecked color="error" />
|
|
70
|
+
<Checkbox {...label} defaultChecked color="success" />
|
|
71
|
+
<Checkbox {...label} defaultChecked color="info" />
|
|
72
|
+
<Checkbox {...label} defaultChecked color="warning" />
|
|
73
|
+
</Box>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
Colors.parameters = {
|
|
77
|
+
docs: {
|
|
78
|
+
description: {
|
|
79
|
+
story: DOCS.Checkbox.Colors
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
controls: {
|
|
83
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
84
|
+
// hideNoControlsWarning: true
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Sizes: ComponentStory<typeof Checkbox> = (args): JSX.Element => {
|
|
89
|
+
const label = { inputProps: { 'aria-label': 'Checkbox demo' } }
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<Box>
|
|
93
|
+
<Checkbox {...label} defaultChecked size="small" />
|
|
94
|
+
<Checkbox {...label} defaultChecked />
|
|
95
|
+
<Checkbox
|
|
96
|
+
{...label}
|
|
97
|
+
defaultChecked
|
|
98
|
+
sx={{ '& .MuiSvgIcon-root': { fontSize: 28 } }}
|
|
99
|
+
/>
|
|
100
|
+
</Box>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
Sizes.parameters = {
|
|
104
|
+
docs: {
|
|
105
|
+
description: {
|
|
106
|
+
story: DOCS.Checkbox.Sizes
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
controls: {
|
|
110
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
111
|
+
// hideNoControlsWarning: true
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const Icon: ComponentStory<typeof Checkbox> = (args): JSX.Element => {
|
|
116
|
+
const label = { inputProps: { 'aria-label': 'Checkbox demo' } }
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<Box>
|
|
120
|
+
<Checkbox {...label} icon={<FavoriteBorderIcon />} checkedIcon={<FavoriteIcon />} />
|
|
121
|
+
<Checkbox {...label} icon={<BookmarkBorderIcon />} checkedIcon={<BookmarkIcon />} />
|
|
122
|
+
</Box>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
Icon.parameters = {
|
|
126
|
+
docs: {
|
|
127
|
+
description: {
|
|
128
|
+
story: DOCS.Checkbox.Icon
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
controls: {
|
|
132
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
133
|
+
// hideNoControlsWarning: true
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export const Controlled: ComponentStory<typeof Checkbox> = (args): JSX.Element => {
|
|
138
|
+
const label = { inputProps: { 'aria-label': 'controlled' } }
|
|
139
|
+
const [checked, setChecked] = React.useState(true)
|
|
140
|
+
|
|
141
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
142
|
+
setChecked(event.target.checked)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<Checkbox
|
|
147
|
+
{...label}
|
|
148
|
+
checked={checked}
|
|
149
|
+
onChange={handleChange}
|
|
150
|
+
/>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
Controlled.parameters = {
|
|
154
|
+
docs: {
|
|
155
|
+
description: {
|
|
156
|
+
story: DOCS.Checkbox.Controlled
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
controls: {
|
|
160
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
161
|
+
// hideNoControlsWarning: true
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export const Indeterminate: ComponentStory<typeof Checkbox> = (args): JSX.Element => {
|
|
166
|
+
const label = { inputProps: { 'aria-label': 'indeterminate' } }
|
|
167
|
+
const [checked, setChecked] = React.useState([true, false])
|
|
168
|
+
|
|
169
|
+
const handleChange1 = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
170
|
+
setChecked([event.target.checked, event.target.checked])
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const handleChange2 = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
174
|
+
setChecked([event.target.checked, checked[1]])
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const handleChange3 = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
178
|
+
setChecked([checked[0], event.target.checked])
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const children = (
|
|
182
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', ml: 3 }}>
|
|
183
|
+
<FormControlLabel
|
|
184
|
+
label="Child 1"
|
|
185
|
+
control={<Checkbox {...label} checked={checked[0]} onChange={handleChange2} />}
|
|
186
|
+
/>
|
|
187
|
+
<FormControlLabel
|
|
188
|
+
label="Child 2"
|
|
189
|
+
control={<Checkbox {...label} checked={checked[1]} onChange={handleChange3} />}
|
|
190
|
+
/>
|
|
191
|
+
</Box>
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
return (
|
|
195
|
+
<div>
|
|
196
|
+
<FormControlLabel
|
|
197
|
+
label="Parent"
|
|
198
|
+
control={
|
|
199
|
+
<Checkbox
|
|
200
|
+
{...label}
|
|
201
|
+
checked={checked[0] && checked[1]}
|
|
202
|
+
indeterminate={checked[0] !== checked[1]}
|
|
203
|
+
onChange={handleChange1}
|
|
204
|
+
/>
|
|
205
|
+
}
|
|
206
|
+
/>
|
|
207
|
+
{children}
|
|
208
|
+
</div>
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
Indeterminate.parameters = {
|
|
212
|
+
docs: {
|
|
213
|
+
description: {
|
|
214
|
+
story: DOCS.Checkbox.Indeterminate
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
controls: {
|
|
218
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
219
|
+
// hideNoControlsWarning: true
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export const CheckboxesGroup: ComponentStory<typeof Checkbox> = (args): JSX.Element => {
|
|
224
|
+
const label = { inputProps: { 'aria-label': 'checkboxes group' } }
|
|
225
|
+
const [state, setState] = React.useState({
|
|
226
|
+
gilad: true,
|
|
227
|
+
jason: false,
|
|
228
|
+
antoine: false
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
232
|
+
setState({
|
|
233
|
+
...state,
|
|
234
|
+
[event.target.name]: event.target.checked
|
|
235
|
+
})
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const { gilad, jason, antoine } = state
|
|
239
|
+
const error = [gilad, jason, antoine].filter((v) => v).length !== 2
|
|
240
|
+
|
|
241
|
+
return (
|
|
242
|
+
<Box sx={{ display: 'flex' }}>
|
|
243
|
+
<FormControl sx={{ m: 3 }} component="fieldset" variant="standard">
|
|
244
|
+
<FormLabel component="legend">Assign responsibility</FormLabel>
|
|
245
|
+
<FormGroup>
|
|
246
|
+
<FormControlLabel
|
|
247
|
+
control={
|
|
248
|
+
<Checkbox {...label} checked={gilad} onChange={handleChange} name="gilad" />
|
|
249
|
+
}
|
|
250
|
+
label="Gilad Gray"
|
|
251
|
+
/>
|
|
252
|
+
<FormControlLabel
|
|
253
|
+
control={
|
|
254
|
+
<Checkbox {...label} checked={jason} onChange={handleChange} name="jason" />
|
|
255
|
+
}
|
|
256
|
+
label="Jason Killian"
|
|
257
|
+
/>
|
|
258
|
+
<FormControlLabel
|
|
259
|
+
control={
|
|
260
|
+
<Checkbox {...label} checked={antoine} onChange={handleChange} name="antoine" />
|
|
261
|
+
}
|
|
262
|
+
label="Antoine Llorca"
|
|
263
|
+
/>
|
|
264
|
+
</FormGroup>
|
|
265
|
+
<FormHelperText>Be careful</FormHelperText>
|
|
266
|
+
</FormControl>
|
|
267
|
+
<FormControl
|
|
268
|
+
required
|
|
269
|
+
error={error}
|
|
270
|
+
component="fieldset"
|
|
271
|
+
sx={{ m: 3 }}
|
|
272
|
+
variant="standard"
|
|
273
|
+
>
|
|
274
|
+
<FormLabel component="legend">Pick two</FormLabel>
|
|
275
|
+
<FormGroup>
|
|
276
|
+
<FormControlLabel
|
|
277
|
+
control={
|
|
278
|
+
<Checkbox {...label} checked={gilad} onChange={handleChange} name="gilad" />
|
|
279
|
+
}
|
|
280
|
+
label="Gilad Gray"
|
|
281
|
+
/>
|
|
282
|
+
<FormControlLabel
|
|
283
|
+
control={
|
|
284
|
+
<Checkbox {...label} checked={jason} onChange={handleChange} name="jason" />
|
|
285
|
+
}
|
|
286
|
+
label="Jason Killian"
|
|
287
|
+
/>
|
|
288
|
+
<FormControlLabel
|
|
289
|
+
control={
|
|
290
|
+
<Checkbox {...label} checked={antoine} onChange={handleChange} name="antoine" />
|
|
291
|
+
}
|
|
292
|
+
label="Antoine Llorca"
|
|
293
|
+
/>
|
|
294
|
+
</FormGroup>
|
|
295
|
+
<FormHelperText>You can display an error</FormHelperText>
|
|
296
|
+
</FormControl>
|
|
297
|
+
</Box>
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
CheckboxesGroup.parameters = {
|
|
301
|
+
docs: {
|
|
302
|
+
description: {
|
|
303
|
+
story: DOCS.Checkbox.CheckboxesGroup
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
controls: {
|
|
307
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
308
|
+
// hideNoControlsWarning: true
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export const LabelPosition: ComponentStory<typeof Checkbox> = (args): JSX.Element => (
|
|
313
|
+
<FormControl component="fieldset">
|
|
314
|
+
<FormGroup aria-label="position" row>
|
|
315
|
+
<FormControlLabel
|
|
316
|
+
value="top"
|
|
317
|
+
control={<Checkbox />}
|
|
318
|
+
label="Top"
|
|
319
|
+
labelPlacement="top"
|
|
320
|
+
/>
|
|
321
|
+
<FormControlLabel
|
|
322
|
+
value="start"
|
|
323
|
+
control={<Checkbox />}
|
|
324
|
+
label="Start"
|
|
325
|
+
labelPlacement="start"
|
|
326
|
+
/>
|
|
327
|
+
<FormControlLabel
|
|
328
|
+
value="bottom"
|
|
329
|
+
control={<Checkbox />}
|
|
330
|
+
label="Bottom"
|
|
331
|
+
labelPlacement="bottom"
|
|
332
|
+
/>
|
|
333
|
+
<FormControlLabel
|
|
334
|
+
value="end"
|
|
335
|
+
control={<Checkbox />}
|
|
336
|
+
label="End"
|
|
337
|
+
labelPlacement="end"
|
|
338
|
+
/>
|
|
339
|
+
</FormGroup>
|
|
340
|
+
</FormControl>
|
|
341
|
+
)
|
|
342
|
+
LabelPosition.parameters = {
|
|
343
|
+
docs: {
|
|
344
|
+
description: {
|
|
345
|
+
story: DOCS.Checkbox.LabelPosition
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
controls: {
|
|
349
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
350
|
+
// hideNoControlsWarning: true
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export const All: ComponentStory<typeof AllCombinations> = (args): JSX.Element => (
|
|
355
|
+
<AllCombinations />
|
|
356
|
+
)
|
|
357
|
+
All.parameters = {
|
|
358
|
+
docs: {
|
|
359
|
+
description: {
|
|
360
|
+
story: DOCS.Checkbox.All
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import Checkbox from '../../../../lib/components/atoms/Checkbox/Checkbox';
|
|
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/Inputs/Checkbox/Overview" component={Checkbox} />
|
|
8
|
+
|
|
9
|
+
[](#checkbox-accessibility)Checkbox Overview <span class="sbdocs-edit-link"><Chip clickable component="a" href="https://github.com/ht2-labs/design-system/tree/main/src/stories/Components/Inputs/Checkbox/Accessibility.stories.mdx" size="small" label="Edit" variant="outlined" /></span>
|
|
10
|
+
=================================================================================
|
|
11
|
+
|
|
12
|
+
### [](#what-does-it-do)What does it do?
|
|
13
|
+
|
|
14
|
+
Checkboxes allow the user to select one or more items from a set of options. A checkbox has an associated label that should clearly indicate to the user what action will be triggered.
|
|
15
|
+
|
|
16
|
+
<Stack direction="row" spacing={1}>
|
|
17
|
+
<Chip clickable component="a" href="https://mui.com/components/checkboxes/" size="small" icon={<MUIIcon viewBox="-5 0 40 30" />} label="Material UI" variant="outlined" />
|
|
18
|
+
<Chip clickable component="a" href="https://material.io/components/checkboxes" size="small" icon={<MaterialDesignIcon />} label="Material Design" variant="outlined" />
|
|
19
|
+
<Chip clickable component="a" href="https://www.w3.org/TR/wai-aria-practices/#checkbox" size="small" icon={<W3CIcon />} label="WAI-ARIA" variant="outlined" />
|
|
20
|
+
<Chip clickable component="a" href="https://www.figma.com/proto/mBDuFn79U8wQIIEoCGpMew/DS%3A-Component-Library?node-id=487%3A14431&scaling=min-zoom&page-id=310%3A35254&starting-point-node-id=487%3A14431" size="small" icon={<FigmaIcon />} label="Figma" variant="outlined" />
|
|
21
|
+
<Chip clickable component="a" href="https://github.com/HT2-Labs/design-system/tree/main/src/lib/components/atoms/Checkbox" size="small" icon={<GithubIcon />} label="Github" variant="outlined" />
|
|
22
|
+
</Stack>
|
|
23
|
+
|
|
24
|
+
### [](#why-use-it)Why use it?
|
|
25
|
+
|
|
26
|
+
* Used when there are multiple items to select that are not mutually exclusive.
|
|
27
|
+
* Used to filter data either on a page, in a menu, or within a component.
|
|
28
|
+
* Used when each selection in a group works independently from other selctions.
|
|
29
|
+
|
|
30
|
+
Understanding [Checkboxes vs Radio Buttons](https://www.nngroup.com/articles/checkboxes-vs-radio-buttons/)
|
|
31
|
+
|
|
32
|
+
### [](#how-to-implement-it)How to implement it?
|
|
33
|
+
|
|
34
|
+
Below is an overview of the baisc Checkbox components.
|
|
35
|
+
|
|
36
|
+
<Canvas isExpanded>
|
|
37
|
+
<Checkbox label="Default Checked" defaultChecked />
|
|
38
|
+
<Checkbox label="Default" />
|
|
39
|
+
<Checkbox label="Disabled" disabled />
|
|
40
|
+
<Checkbox label="Disabled Checked" disabled checked />
|
|
41
|
+
</Canvas>
|
|
42
|
+
|
|
43
|
+
### [](#when-to-avoid-it)When to avoid it?
|
|
44
|
+
|
|
45
|
+
* Do not use a checkbox when you only have a single option; use a switch instead.
|
|
46
|
+
* Do not use a checkbox to trigger an action based on a user's selection.
|
|
47
|
+
* Do not use a checkbox when you can only select one option from a list; use a radio button instead.
|
|
48
|
+
|
|
49
|
+
### [](#best-practices)Best practices
|
|
50
|
+
|
|
51
|
+
* Use a text hint to communicate how many options a user can select (ex 'Select all that apply').
|
|
52
|
+
* Ensure that all checkbox labels have a clear and concise description.
|
|
53
|
+
* Use positive and active wording for checkbox labels, so that it's clear what will happen if the user turns on the checkbox.
|
|
54
|
+
* When grouping multiple checkboxes, consider using the [FormGroup](https://mui.com/components/checkboxes/#formgroup) component.
|
|
55
|
+
|
|
56
|
+
### [](#design-prototype)Design prototype
|
|
57
|
+
<iframe
|
|
58
|
+
allowfullscreen
|
|
59
|
+
frameborder="0"
|
|
60
|
+
height="350"
|
|
61
|
+
width="100%"
|
|
62
|
+
src="https://www.figma.com/embed?embed_host=share&url=https://www.figma.com/proto/mBDuFn79U8wQIIEoCGpMew/DS%3A-Component-Library?node-id=1045%3A17968&scaling=min-zoom&page-id=1044%3A16798&starting-point-node-id=1045%3A17981"
|
|
63
|
+
/>
|
|
@@ -0,0 +1,24 @@
|
|
|
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 IconButton from '../../../../lib/components/atoms/IconButton/IconButton'
|
|
6
|
+
import DeleteIcon from '@mui/icons-material/Delete'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/Inputs/Button (IconButton)/Examples',
|
|
10
|
+
component: IconButton
|
|
11
|
+
} as ComponentMeta<typeof IconButton>
|
|
12
|
+
|
|
13
|
+
export const Default: ComponentStory<typeof IconButton> = (args) => (
|
|
14
|
+
<Stack spacing={2} direction="row">
|
|
15
|
+
<IconButton aria-label='Trash can'><DeleteIcon /></IconButton>
|
|
16
|
+
</Stack>
|
|
17
|
+
)
|
|
18
|
+
Default.parameters = {
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component: DOCS.IconButton.Default
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react'
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import IconButton from '../../../../lib/components/atoms/IconButton/IconButton'
|
|
4
|
+
import DeleteIcon from '@mui/icons-material/Delete'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Inputs/Button (IconButton)/Properties',
|
|
8
|
+
component: IconButton,
|
|
9
|
+
parameters: {
|
|
10
|
+
controls: {
|
|
11
|
+
sort: 'requiredFirst'
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
addons: {
|
|
15
|
+
panelPosition: 'right'
|
|
16
|
+
}
|
|
17
|
+
} as ComponentMeta<typeof IconButton>
|
|
18
|
+
|
|
19
|
+
// 👇 We create a “template” of how args map to rendering
|
|
20
|
+
const Template: ComponentStory<typeof IconButton> = (args) => <IconButton {...args} />
|
|
21
|
+
|
|
22
|
+
export const Properties = Template.bind({})
|
|
23
|
+
Properties.args = {
|
|
24
|
+
children: <DeleteIcon />,
|
|
25
|
+
'aria-label': 'Trash can'
|
|
26
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import Radio from '../../../../lib/components/atoms/Radio/Radio';
|
|
3
|
+
import RadioGroup from '@mui/material/RadioGroup';
|
|
4
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
5
|
+
import FormControl from '@mui/material/FormControl';
|
|
6
|
+
import FormLabel from '@mui/material/FormLabel';
|
|
7
|
+
import Chip from '@mui/material/Chip';
|
|
8
|
+
|
|
9
|
+
<Meta title="Components/Inputs/Radio/Accessibility" />
|
|
10
|
+
|
|
11
|
+
[](#radio-accessibility)Radio Accessibility <span class="sbdocs-edit-link"><Chip clickable component="a" href="https://github.com/ht2-labs/design-system/tree/main/src/stories/Components/Inputs/Radio/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 Radio Button](https://www.w3.org/TR/wai-aria-practices/#radiobutton) for more information.
|
|
17
|
+
|
|
18
|
+
## [](#guidelines)Guidelines
|
|
19
|
+
* Radio buttons must have a clear and concise description provided by a `<label>` element or `aria-label` attribute.
|
|
20
|
+
* When a radio group does not have a default selected the focus should move to the first radio button in the group.
|
|
21
|
+
* If the Radio button is a required field, include the `aria-required` property and indicate that it is a required field and use the validation message for input errors.
|
|
22
|
+
* Use positive and active wording for radio button labels, so that it's clear what will happen if the user turns on the Radio. In other words, avoid negations such as "Don't send me more email," which would mean that the user would have to check the box in order for something not to happen.
|
|
23
|
+
|
|
24
|
+
### [](#when-to-use-this-component)When to use this component
|
|
25
|
+
Radio buttons are used when there is a list of two or more options that are mutually exclusive and the user must select exactly one choice. In other words, clicking a non-selected radio button will deselect whatever other button was previously selected in the list.
|
|
26
|
+
|
|
27
|
+
### [](#screen-readers)Screen readers
|
|
28
|
+
Radio buttons should have unique labels to identify their usage to assistive technologies whenever possible. In most cases, this is done by using a `<label>` element generated by the `FormControlLabel` component:
|
|
29
|
+
<Canvas>
|
|
30
|
+
<FormControlLabel control={<Radio />} label="Your label goes here" />
|
|
31
|
+
</Canvas>
|
|
32
|
+
|
|
33
|
+
When a label element can't be used, it's necessary to add an attribute directly to the input component to provide information to assistive technologies. In this case, you can apply the additional attribute (e.g. `aria-label`, `aria-labelledby`, `title`) via the `inputProps` prop:
|
|
34
|
+
<Canvas>
|
|
35
|
+
<Radio
|
|
36
|
+
inputProps={{
|
|
37
|
+
'aria-label': 'Your label goes here',
|
|
38
|
+
}}
|
|
39
|
+
/>
|
|
40
|
+
</Canvas>
|
|
41
|
+
|
|
42
|
+
Always offer a default selection for radio button lists. By definition, radio buttons always have exactly one option selected, and you therefore shouldn't display them without a default selection.
|
|
43
|
+
|
|
44
|
+
If users might need to refrain from making a selection, you should provide a radio button for this choice, such as one labeled "None." Offering users an explicit, neutral option to click is better than requiring the implicit act of not selecting from the list, especially because doing the latter violates the rule of always having exactly one option chosen.
|
|
45
|
+
<Canvas>
|
|
46
|
+
<FormControl>
|
|
47
|
+
<FormLabel id="demo-radio-buttons-group-label">Form description here</FormLabel>
|
|
48
|
+
<RadioGroup
|
|
49
|
+
aria-labelledby="demo-radio-buttons-group-label"
|
|
50
|
+
defaultValue="none"
|
|
51
|
+
name="radio-buttons-group"
|
|
52
|
+
>
|
|
53
|
+
<FormControlLabel value="one" control={<Radio />} label="One" />
|
|
54
|
+
<FormControlLabel value="two" control={<Radio />} label="Two" />
|
|
55
|
+
<FormControlLabel value="three" control={<Radio />} label="Three" />
|
|
56
|
+
<FormControlLabel value="none" control={<Radio />} label="None" />
|
|
57
|
+
</RadioGroup>
|
|
58
|
+
</FormControl>
|
|
59
|
+
</Canvas>
|
|
60
|
+
|
|
61
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { Box, FormControl, FormControlLabel, FormLabel, RadioGroup } from '@mui/material'
|
|
3
|
+
import Radio from '../../../../lib/components/atoms/Radio/Radio'
|
|
4
|
+
|
|
5
|
+
const RadioGrid = (args: any): JSX.Element => {
|
|
6
|
+
const [selectedValue, setSelectedValue] = React.useState('a')
|
|
7
|
+
|
|
8
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
9
|
+
setSelectedValue(event.target.value)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const controlProps = (item: string): object => ({
|
|
13
|
+
checked: selectedValue === item,
|
|
14
|
+
onChange: handleChange,
|
|
15
|
+
value: item,
|
|
16
|
+
name: 'color-radio-button-demo',
|
|
17
|
+
inputProps: { 'aria-label': item }
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const [value, setValue] = React.useState('default')
|
|
21
|
+
|
|
22
|
+
const handleGroupChange = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
23
|
+
setValue((event.target as HTMLInputElement).value)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div>
|
|
28
|
+
<div>
|
|
29
|
+
<Radio {...controlProps('a')} {...args} color="default" />
|
|
30
|
+
<Radio {...controlProps('b')} {...args} />
|
|
31
|
+
<Radio {...controlProps('d')} {...args} color="secondary" />
|
|
32
|
+
<Radio {...controlProps('e')} {...args} color="error" />
|
|
33
|
+
<Radio {...controlProps('f')} {...args} color="success" />
|
|
34
|
+
<Radio {...controlProps('g')} {...args} color="info" />
|
|
35
|
+
<Radio {...controlProps('h')} {...args} color="warning" />
|
|
36
|
+
</div>
|
|
37
|
+
<div>
|
|
38
|
+
<FormControl>
|
|
39
|
+
<FormLabel id="demo-controlled-radio-buttons-group">Gender</FormLabel>
|
|
40
|
+
<RadioGroup
|
|
41
|
+
aria-labelledby="demo-controlled-radio-buttons-group"
|
|
42
|
+
name="controlled-radio-buttons-group"
|
|
43
|
+
value={value}
|
|
44
|
+
onChange={handleGroupChange}
|
|
45
|
+
row
|
|
46
|
+
>
|
|
47
|
+
<FormControlLabel value="default" control={<Radio {...args} color="default" />} label="Default" />
|
|
48
|
+
<FormControlLabel value="primary" control={<Radio {...args} color="primary" />} label="Primary" />
|
|
49
|
+
<FormControlLabel value="error" control={<Radio {...args} color="error" />} label="Error" />
|
|
50
|
+
<FormControlLabel value="success" control={<Radio {...args} color="success" />} label="Success" />
|
|
51
|
+
<FormControlLabel value="info" control={<Radio {...args} color="info" />} label="Info" />
|
|
52
|
+
<FormControlLabel value="warning" control={<Radio {...args} color="warning" />} label="Warning" />
|
|
53
|
+
</RadioGroup>
|
|
54
|
+
</FormControl>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default function AllCombinations (): JSX.Element {
|
|
61
|
+
const combinations = [
|
|
62
|
+
{ checked: true },
|
|
63
|
+
{ },
|
|
64
|
+
{ disabled: true },
|
|
65
|
+
{ disabled: true, checked: true }
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<Box>
|
|
70
|
+
{combinations.map(RadioConfig => (
|
|
71
|
+
<RadioGrid {...RadioConfig} />
|
|
72
|
+
))}
|
|
73
|
+
</Box>
|
|
74
|
+
)
|
|
75
|
+
}
|