@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,803 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box, Checkbox, Chip, Dialog, DialogActions, DialogContent, DialogTitle,
|
|
3
|
+
FormControl, FormHelperText, InputLabel, ListItemText, ListSubheader,
|
|
4
|
+
MenuItem, OutlinedInput
|
|
5
|
+
} from '@mui/material'
|
|
6
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react'
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { DOCS } from '../../../../docs'
|
|
9
|
+
import Select, { SelectChangeEvent } from '../../../../lib/components/atoms/Select/Select'
|
|
10
|
+
import Button from '../../../../lib/components/atoms/Button/Button'
|
|
11
|
+
import AllCombinations from './AllCombinations'
|
|
12
|
+
import MUINativeSelect from '@mui/material/NativeSelect'
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Components/Inputs/Select/Examples',
|
|
16
|
+
component: Select
|
|
17
|
+
} as ComponentMeta<typeof Select>
|
|
18
|
+
|
|
19
|
+
export const Default: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
20
|
+
const [age, setAge] = React.useState('')
|
|
21
|
+
|
|
22
|
+
const handleChange = (event: SelectChangeEvent): void => {
|
|
23
|
+
setAge(event.target.value)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Box sx={{ minWidth: 120 }}>
|
|
28
|
+
<FormControl fullWidth>
|
|
29
|
+
<InputLabel id="demo-simple-select-label">Age</InputLabel>
|
|
30
|
+
<Select
|
|
31
|
+
labelId="demo-simple-select-label"
|
|
32
|
+
id="demo-simple-select"
|
|
33
|
+
value={age}
|
|
34
|
+
label="Age"
|
|
35
|
+
onChange={handleChange}
|
|
36
|
+
>
|
|
37
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
38
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
39
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
40
|
+
</Select>
|
|
41
|
+
</FormControl>
|
|
42
|
+
</Box>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
Default.parameters = {
|
|
46
|
+
docs: {
|
|
47
|
+
description: {
|
|
48
|
+
component: DOCS.Select.Default
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
controls: {
|
|
52
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
53
|
+
// hideNoControlsWarning: true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const Variants: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
58
|
+
const [age, setAge] = React.useState('')
|
|
59
|
+
|
|
60
|
+
const handleChange = (event: SelectChangeEvent): void => {
|
|
61
|
+
setAge(event.target.value)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<div>
|
|
66
|
+
<FormControl variant="standard" sx={{ m: 1, minWidth: 120 }}>
|
|
67
|
+
<InputLabel id="demo-simple-select-standard-label">Age</InputLabel>
|
|
68
|
+
<Select
|
|
69
|
+
labelId="demo-simple-select-standard-label"
|
|
70
|
+
id="demo-simple-select-standard"
|
|
71
|
+
value={age}
|
|
72
|
+
onChange={handleChange}
|
|
73
|
+
label="Age"
|
|
74
|
+
>
|
|
75
|
+
<MenuItem value="">
|
|
76
|
+
<em>None</em>
|
|
77
|
+
</MenuItem>
|
|
78
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
79
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
80
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
81
|
+
</Select>
|
|
82
|
+
</FormControl>
|
|
83
|
+
<FormControl variant="filled" sx={{ m: 1, minWidth: 120 }}>
|
|
84
|
+
<InputLabel id="demo-simple-select-filled-label">Age</InputLabel>
|
|
85
|
+
<Select
|
|
86
|
+
labelId="demo-simple-select-filled-label"
|
|
87
|
+
id="demo-simple-select-filled"
|
|
88
|
+
value={age}
|
|
89
|
+
onChange={handleChange}
|
|
90
|
+
>
|
|
91
|
+
<MenuItem value="">
|
|
92
|
+
<em>None</em>
|
|
93
|
+
</MenuItem>
|
|
94
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
95
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
96
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
97
|
+
</Select>
|
|
98
|
+
</FormControl>
|
|
99
|
+
</div>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
Variants.parameters = {
|
|
103
|
+
docs: {
|
|
104
|
+
description: {
|
|
105
|
+
story: DOCS.Select.Variants
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const HelperText: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
111
|
+
const [age, setAge] = React.useState('')
|
|
112
|
+
|
|
113
|
+
const handleChange = (event: SelectChangeEvent): void => {
|
|
114
|
+
setAge(event.target.value)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<div>
|
|
119
|
+
<FormControl sx={{ m: 1, minWidth: 120 }}>
|
|
120
|
+
<InputLabel id="demo-simple-select-helper-label">Age</InputLabel>
|
|
121
|
+
<Select
|
|
122
|
+
labelId="demo-simple-select-helper-label"
|
|
123
|
+
id="demo-simple-select-helper"
|
|
124
|
+
value={age}
|
|
125
|
+
label="Age"
|
|
126
|
+
onChange={handleChange}
|
|
127
|
+
>
|
|
128
|
+
<MenuItem value="">
|
|
129
|
+
<em>None</em>
|
|
130
|
+
</MenuItem>
|
|
131
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
132
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
133
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
134
|
+
</Select>
|
|
135
|
+
<FormHelperText>With label + helper text</FormHelperText>
|
|
136
|
+
</FormControl>
|
|
137
|
+
<FormControl sx={{ m: 1, minWidth: 120 }}>
|
|
138
|
+
<Select
|
|
139
|
+
value={age}
|
|
140
|
+
onChange={handleChange}
|
|
141
|
+
displayEmpty
|
|
142
|
+
inputProps={{ 'aria-label': 'Without label' }}
|
|
143
|
+
>
|
|
144
|
+
<MenuItem value="">
|
|
145
|
+
<em>None</em>
|
|
146
|
+
</MenuItem>
|
|
147
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
148
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
149
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
150
|
+
</Select>
|
|
151
|
+
<FormHelperText>Without label</FormHelperText>
|
|
152
|
+
</FormControl>
|
|
153
|
+
</div>
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
HelperText.parameters = {
|
|
157
|
+
docs: {
|
|
158
|
+
description: {
|
|
159
|
+
story: DOCS.Select.HelperText
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export const AutoWidth: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
165
|
+
const [age, setAge] = React.useState('')
|
|
166
|
+
|
|
167
|
+
const handleChange = (event: SelectChangeEvent): void => {
|
|
168
|
+
setAge(event.target.value)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
<div>
|
|
173
|
+
<FormControl sx={{ m: 1, minWidth: 80 }}>
|
|
174
|
+
<InputLabel id="demo-simple-select-autowidth-label">Age</InputLabel>
|
|
175
|
+
<Select
|
|
176
|
+
labelId="demo-simple-select-autowidth-label"
|
|
177
|
+
id="demo-simple-select-autowidth"
|
|
178
|
+
value={age}
|
|
179
|
+
onChange={handleChange}
|
|
180
|
+
autoWidth
|
|
181
|
+
label="Age"
|
|
182
|
+
>
|
|
183
|
+
<MenuItem value="">
|
|
184
|
+
<em>None</em>
|
|
185
|
+
</MenuItem>
|
|
186
|
+
<MenuItem value={10}>Twenty</MenuItem>
|
|
187
|
+
<MenuItem value={21}>Twenty one</MenuItem>
|
|
188
|
+
<MenuItem value={22}>Twenty one and a half</MenuItem>
|
|
189
|
+
</Select>
|
|
190
|
+
</FormControl>
|
|
191
|
+
</div>
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
AutoWidth.parameters = {
|
|
195
|
+
docs: {
|
|
196
|
+
description: {
|
|
197
|
+
story: DOCS.Select.AutoWidth
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
controls: {
|
|
201
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
202
|
+
// hideNoControlsWarning: true
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export const OtherProps: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
207
|
+
const [age, setAge] = React.useState('')
|
|
208
|
+
|
|
209
|
+
const handleChange = (event: SelectChangeEvent): void => {
|
|
210
|
+
setAge(event.target.value)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return (
|
|
214
|
+
<div>
|
|
215
|
+
<FormControl sx={{ m: 1, minWidth: 120 }} disabled>
|
|
216
|
+
<InputLabel id="demo-simple-select-disabled-label">Age</InputLabel>
|
|
217
|
+
<Select
|
|
218
|
+
labelId="demo-simple-select-disabled-label"
|
|
219
|
+
id="demo-simple-select-disabled"
|
|
220
|
+
value={age}
|
|
221
|
+
label="Age"
|
|
222
|
+
onChange={handleChange}
|
|
223
|
+
>
|
|
224
|
+
<MenuItem value="">
|
|
225
|
+
<em>None</em>
|
|
226
|
+
</MenuItem>
|
|
227
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
228
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
229
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
230
|
+
</Select>
|
|
231
|
+
<FormHelperText>Disabled</FormHelperText>
|
|
232
|
+
</FormControl>
|
|
233
|
+
<FormControl sx={{ m: 1, minWidth: 120 }} error>
|
|
234
|
+
<InputLabel id="demo-simple-select-error-label">Age</InputLabel>
|
|
235
|
+
<Select
|
|
236
|
+
labelId="demo-simple-select-error-label"
|
|
237
|
+
id="demo-simple-select-error"
|
|
238
|
+
value={age}
|
|
239
|
+
label="Age"
|
|
240
|
+
onChange={handleChange}
|
|
241
|
+
renderValue={(value) => value}
|
|
242
|
+
>
|
|
243
|
+
<MenuItem value="">
|
|
244
|
+
<em>None</em>
|
|
245
|
+
</MenuItem>
|
|
246
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
247
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
248
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
249
|
+
</Select>
|
|
250
|
+
<FormHelperText>Error</FormHelperText>
|
|
251
|
+
</FormControl>
|
|
252
|
+
<FormControl sx={{ m: 1, minWidth: 120 }}>
|
|
253
|
+
<InputLabel id="demo-simple-select-readonly-label">Age</InputLabel>
|
|
254
|
+
<Select
|
|
255
|
+
labelId="demo-simple-select-readonly-label"
|
|
256
|
+
id="demo-simple-select-readonly"
|
|
257
|
+
value={age}
|
|
258
|
+
label="Age"
|
|
259
|
+
onChange={handleChange}
|
|
260
|
+
inputProps={{ readOnly: true }}
|
|
261
|
+
>
|
|
262
|
+
<MenuItem value="">
|
|
263
|
+
<em>None</em>
|
|
264
|
+
</MenuItem>
|
|
265
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
266
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
267
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
268
|
+
</Select>
|
|
269
|
+
<FormHelperText>Read only</FormHelperText>
|
|
270
|
+
</FormControl>
|
|
271
|
+
<FormControl required sx={{ m: 1, minWidth: 120 }}>
|
|
272
|
+
<InputLabel id="demo-simple-select-required-label">Age</InputLabel>
|
|
273
|
+
<Select
|
|
274
|
+
labelId="demo-simple-select-required-label"
|
|
275
|
+
id="demo-simple-select-required"
|
|
276
|
+
value={age}
|
|
277
|
+
label="Age *"
|
|
278
|
+
onChange={handleChange}
|
|
279
|
+
>
|
|
280
|
+
<MenuItem value="">
|
|
281
|
+
<em>None</em>
|
|
282
|
+
</MenuItem>
|
|
283
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
284
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
285
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
286
|
+
</Select>
|
|
287
|
+
<FormHelperText>Required</FormHelperText>
|
|
288
|
+
</FormControl>
|
|
289
|
+
</div>
|
|
290
|
+
)
|
|
291
|
+
}
|
|
292
|
+
OtherProps.parameters = {
|
|
293
|
+
docs: {
|
|
294
|
+
description: {
|
|
295
|
+
story: DOCS.Select.OtherProps
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
controls: {
|
|
299
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
300
|
+
// hideNoControlsWarning: true
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export const NativeSelect: ComponentStory<typeof MUINativeSelect> = (args): JSX.Element => {
|
|
305
|
+
return (
|
|
306
|
+
<Box sx={{ minWidth: 120 }}>
|
|
307
|
+
<FormControl fullWidth>
|
|
308
|
+
<InputLabel variant="standard" htmlFor="uncontrolled-native">
|
|
309
|
+
Age
|
|
310
|
+
</InputLabel>
|
|
311
|
+
<MUINativeSelect
|
|
312
|
+
defaultValue={30}
|
|
313
|
+
inputProps={{
|
|
314
|
+
name: 'age',
|
|
315
|
+
id: 'uncontrolled-native'
|
|
316
|
+
}}
|
|
317
|
+
>
|
|
318
|
+
<option value={10}>Ten</option>
|
|
319
|
+
<option value={20}>Twenty</option>
|
|
320
|
+
<option value={30}>Thirty</option>
|
|
321
|
+
</MUINativeSelect>
|
|
322
|
+
</FormControl>
|
|
323
|
+
</Box>
|
|
324
|
+
)
|
|
325
|
+
}
|
|
326
|
+
NativeSelect.parameters = {
|
|
327
|
+
docs: {
|
|
328
|
+
description: {
|
|
329
|
+
story: DOCS.Select.NativeSelect
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
controls: {
|
|
333
|
+
// exclude: /[a-zA-Z0-9]*/,
|
|
334
|
+
// hideNoControlsWarning: true
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const ITEM_HEIGHT = 48
|
|
339
|
+
const ITEM_PADDING_TOP = 8
|
|
340
|
+
const MenuProps = {
|
|
341
|
+
PaperProps: {
|
|
342
|
+
style: {
|
|
343
|
+
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
|
|
344
|
+
width: 250
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const names = [
|
|
350
|
+
'Oliver Hansen',
|
|
351
|
+
'Van Henry',
|
|
352
|
+
'April Tucker',
|
|
353
|
+
'Ralph Hubbard',
|
|
354
|
+
'Omar Alexander',
|
|
355
|
+
'Carlos Abbott',
|
|
356
|
+
'Miriam Wagner',
|
|
357
|
+
'Bradley Wilkerson',
|
|
358
|
+
'Virginia Andrews',
|
|
359
|
+
'Kelly Snyder'
|
|
360
|
+
]
|
|
361
|
+
|
|
362
|
+
// function getStyles(name: string, personName: string[], theme: Theme) {
|
|
363
|
+
// return {
|
|
364
|
+
// fontWeight:
|
|
365
|
+
// personName.indexOf(name) === -1
|
|
366
|
+
// ? theme.typography.fontWeightRegular
|
|
367
|
+
// : theme.typography.fontWeightMedium,
|
|
368
|
+
// };
|
|
369
|
+
// }
|
|
370
|
+
|
|
371
|
+
export const MultipleSelect: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
372
|
+
// const theme = useTheme();
|
|
373
|
+
const [personName, setPersonName] = React.useState<string[]>([])
|
|
374
|
+
|
|
375
|
+
const handleChange = (event: SelectChangeEvent<typeof personName>): void => {
|
|
376
|
+
const {
|
|
377
|
+
target: { value }
|
|
378
|
+
} = event
|
|
379
|
+
setPersonName(
|
|
380
|
+
// On autofill we get a stringified value.
|
|
381
|
+
typeof value === 'string' ? value.split(',') : value
|
|
382
|
+
)
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
return (
|
|
386
|
+
<div>
|
|
387
|
+
<FormControl sx={{ m: 1, width: 300 }}>
|
|
388
|
+
<InputLabel id="demo-multiple-name-label">Name</InputLabel>
|
|
389
|
+
<Select
|
|
390
|
+
labelId="demo-multiple-name-label"
|
|
391
|
+
id="demo-multiple-name"
|
|
392
|
+
multiple
|
|
393
|
+
value={personName}
|
|
394
|
+
onChange={handleChange}
|
|
395
|
+
input={<OutlinedInput label="Name" />}
|
|
396
|
+
MenuProps={MenuProps}
|
|
397
|
+
>
|
|
398
|
+
{names.map((name) => (
|
|
399
|
+
<MenuItem
|
|
400
|
+
key={name}
|
|
401
|
+
value={name}
|
|
402
|
+
// style={getStyles(name, personName, theme)}
|
|
403
|
+
>
|
|
404
|
+
{name}
|
|
405
|
+
</MenuItem>
|
|
406
|
+
))}
|
|
407
|
+
</Select>
|
|
408
|
+
</FormControl>
|
|
409
|
+
</div>
|
|
410
|
+
)
|
|
411
|
+
}
|
|
412
|
+
MultipleSelect.parameters = {
|
|
413
|
+
docs: {
|
|
414
|
+
description: {
|
|
415
|
+
story: DOCS.Select.MultipleSelect
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export const Checkmarks: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
421
|
+
const [personName, setPersonName] = React.useState<string[]>([])
|
|
422
|
+
|
|
423
|
+
const handleChange = (event: SelectChangeEvent<typeof personName>): void => {
|
|
424
|
+
const {
|
|
425
|
+
target: { value }
|
|
426
|
+
} = event
|
|
427
|
+
setPersonName(
|
|
428
|
+
// On autofill we get a stringified value.
|
|
429
|
+
typeof value === 'string' ? value.split(',') : value
|
|
430
|
+
)
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
return (
|
|
434
|
+
<div>
|
|
435
|
+
<FormControl sx={{ m: 1, width: 300 }}>
|
|
436
|
+
<InputLabel id="demo-multiple-checkbox-label">Tag</InputLabel>
|
|
437
|
+
<Select
|
|
438
|
+
labelId="demo-multiple-checkbox-label"
|
|
439
|
+
id="demo-multiple-checkbox"
|
|
440
|
+
multiple
|
|
441
|
+
value={personName}
|
|
442
|
+
onChange={handleChange}
|
|
443
|
+
input={<OutlinedInput label="Tag" />}
|
|
444
|
+
renderValue={(selected) => selected.join(', ')}
|
|
445
|
+
MenuProps={MenuProps}
|
|
446
|
+
>
|
|
447
|
+
{names.map((name) => (
|
|
448
|
+
<MenuItem key={name} value={name}>
|
|
449
|
+
<Checkbox checked={personName.includes(name)} />
|
|
450
|
+
<ListItemText primary={name} />
|
|
451
|
+
</MenuItem>
|
|
452
|
+
))}
|
|
453
|
+
</Select>
|
|
454
|
+
</FormControl>
|
|
455
|
+
</div>
|
|
456
|
+
)
|
|
457
|
+
}
|
|
458
|
+
Checkmarks.parameters = {
|
|
459
|
+
docs: {
|
|
460
|
+
description: {
|
|
461
|
+
story: DOCS.Select.Checkmarks
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export const Chips: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
467
|
+
const [personName, setPersonName] = React.useState<string[]>([])
|
|
468
|
+
|
|
469
|
+
const handleChange = (event: SelectChangeEvent<typeof personName>): void => {
|
|
470
|
+
const {
|
|
471
|
+
target: { value }
|
|
472
|
+
} = event
|
|
473
|
+
setPersonName(
|
|
474
|
+
// On autofill we get a stringified value.
|
|
475
|
+
typeof value === 'string' ? value.split(',') : value
|
|
476
|
+
)
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
return (
|
|
480
|
+
<div>
|
|
481
|
+
<FormControl sx={{ m: 1, width: 300 }}>
|
|
482
|
+
<InputLabel id="demo-multiple-chip-label">Chip</InputLabel>
|
|
483
|
+
<Select
|
|
484
|
+
labelId="demo-multiple-chip-label"
|
|
485
|
+
id="demo-multiple-chip"
|
|
486
|
+
multiple
|
|
487
|
+
value={personName}
|
|
488
|
+
onChange={handleChange}
|
|
489
|
+
input={<OutlinedInput id="select-multiple-chip" label="Chip" />}
|
|
490
|
+
renderValue={(selected) => (
|
|
491
|
+
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 0.5 }}>
|
|
492
|
+
{selected.map((value) => (
|
|
493
|
+
<Chip key={value} label={value} />
|
|
494
|
+
))}
|
|
495
|
+
</Box>
|
|
496
|
+
)}
|
|
497
|
+
MenuProps={MenuProps}
|
|
498
|
+
>
|
|
499
|
+
{names.map((name) => (
|
|
500
|
+
<MenuItem
|
|
501
|
+
key={name}
|
|
502
|
+
value={name}
|
|
503
|
+
// style={getStyles(name, personName, theme)}
|
|
504
|
+
>
|
|
505
|
+
{name}
|
|
506
|
+
</MenuItem>
|
|
507
|
+
))}
|
|
508
|
+
</Select>
|
|
509
|
+
</FormControl>
|
|
510
|
+
</div>
|
|
511
|
+
)
|
|
512
|
+
}
|
|
513
|
+
Chips.parameters = {
|
|
514
|
+
docs: {
|
|
515
|
+
description: {
|
|
516
|
+
story: DOCS.Select.Chips
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
export const Placeholder: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
522
|
+
const [personName, setPersonName] = React.useState<string[]>([])
|
|
523
|
+
|
|
524
|
+
const handleChange = (event: SelectChangeEvent<typeof personName>): void => {
|
|
525
|
+
const {
|
|
526
|
+
target: { value }
|
|
527
|
+
} = event
|
|
528
|
+
setPersonName(
|
|
529
|
+
// On autofill we get a stringified value.
|
|
530
|
+
typeof value === 'string' ? value.split(',') : value
|
|
531
|
+
)
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
return (
|
|
535
|
+
<div>
|
|
536
|
+
<FormControl sx={{ m: 1, width: 300, mt: 3 }}>
|
|
537
|
+
<Select
|
|
538
|
+
multiple
|
|
539
|
+
displayEmpty
|
|
540
|
+
value={personName}
|
|
541
|
+
onChange={handleChange}
|
|
542
|
+
input={<OutlinedInput />}
|
|
543
|
+
renderValue={(selected) => {
|
|
544
|
+
if (selected.length === 0) {
|
|
545
|
+
return <em>Placeholder</em>
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
return selected.join(', ')
|
|
549
|
+
}}
|
|
550
|
+
MenuProps={MenuProps}
|
|
551
|
+
inputProps={{ 'aria-label': 'Without label' }}
|
|
552
|
+
>
|
|
553
|
+
<MenuItem disabled value="">
|
|
554
|
+
<em>Placeholder</em>
|
|
555
|
+
</MenuItem>
|
|
556
|
+
{names.map((name) => (
|
|
557
|
+
<MenuItem
|
|
558
|
+
key={name}
|
|
559
|
+
value={name}
|
|
560
|
+
// style={getStyles(name, personName, theme)}
|
|
561
|
+
>
|
|
562
|
+
{name}
|
|
563
|
+
</MenuItem>
|
|
564
|
+
))}
|
|
565
|
+
</Select>
|
|
566
|
+
</FormControl>
|
|
567
|
+
</div>
|
|
568
|
+
)
|
|
569
|
+
}
|
|
570
|
+
Placeholder.parameters = {
|
|
571
|
+
docs: {
|
|
572
|
+
description: {
|
|
573
|
+
story: DOCS.Select.Placeholder
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
export const Native: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
579
|
+
const [personName, setPersonName] = React.useState<string[]>([])
|
|
580
|
+
const handleChangeMultiple = (event: React.ChangeEvent<HTMLSelectElement>): void => {
|
|
581
|
+
const { options } = event.target
|
|
582
|
+
const value: string[] = []
|
|
583
|
+
for (let i = 0, l = options.length; i < l; i += 1) {
|
|
584
|
+
if (options[i].selected) {
|
|
585
|
+
value.push(options[i].value)
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
setPersonName(value)
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
return (
|
|
592
|
+
<div>
|
|
593
|
+
<FormControl sx={{ m: 1, minWidth: 120, maxWidth: 300 }}>
|
|
594
|
+
<InputLabel shrink htmlFor="select-multiple-native">
|
|
595
|
+
Native
|
|
596
|
+
</InputLabel>
|
|
597
|
+
<Select
|
|
598
|
+
multiple
|
|
599
|
+
native
|
|
600
|
+
value={personName}
|
|
601
|
+
// @ts-expect-error Typings are not considering `native`
|
|
602
|
+
onChange={handleChangeMultiple}
|
|
603
|
+
label="Native"
|
|
604
|
+
inputProps={{
|
|
605
|
+
id: 'select-multiple-native'
|
|
606
|
+
}}
|
|
607
|
+
>
|
|
608
|
+
{names.map((name) => (
|
|
609
|
+
<option key={name} value={name}>
|
|
610
|
+
{name}
|
|
611
|
+
</option>
|
|
612
|
+
))}
|
|
613
|
+
</Select>
|
|
614
|
+
</FormControl>
|
|
615
|
+
</div>
|
|
616
|
+
)
|
|
617
|
+
}
|
|
618
|
+
Native.parameters = {
|
|
619
|
+
docs: {
|
|
620
|
+
description: {
|
|
621
|
+
story: DOCS.Select.Native
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export const Controlled: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
627
|
+
const [age, setAge] = React.useState<string | number>('')
|
|
628
|
+
const [open, setOpen] = React.useState(false)
|
|
629
|
+
|
|
630
|
+
const handleChange = (event: SelectChangeEvent<typeof age>): void => {
|
|
631
|
+
setAge(event.target.value)
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
const handleClose = (): void => {
|
|
635
|
+
setOpen(false)
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
const handleOpen = (): void => {
|
|
639
|
+
setOpen(true)
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
return (
|
|
643
|
+
<div>
|
|
644
|
+
<Button sx={{ display: 'block', mt: 2 }} onClick={handleOpen}>
|
|
645
|
+
Open the select
|
|
646
|
+
</Button>
|
|
647
|
+
<FormControl sx={{ m: 1, minWidth: 120 }}>
|
|
648
|
+
<InputLabel id="demo-controlled-open-select-label">Age</InputLabel>
|
|
649
|
+
<Select
|
|
650
|
+
labelId="demo-controlled-open-select-label"
|
|
651
|
+
id="demo-controlled-open-select"
|
|
652
|
+
open={open}
|
|
653
|
+
onClose={handleClose}
|
|
654
|
+
onOpen={handleOpen}
|
|
655
|
+
value={age}
|
|
656
|
+
label="Age"
|
|
657
|
+
onChange={handleChange}
|
|
658
|
+
>
|
|
659
|
+
<MenuItem value="">
|
|
660
|
+
<em>None</em>
|
|
661
|
+
</MenuItem>
|
|
662
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
663
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
664
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
665
|
+
</Select>
|
|
666
|
+
</FormControl>
|
|
667
|
+
</div>
|
|
668
|
+
)
|
|
669
|
+
}
|
|
670
|
+
Controlled.parameters = {
|
|
671
|
+
docs: {
|
|
672
|
+
description: {
|
|
673
|
+
story: DOCS.Select.Controlled
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export const WithDialog: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
679
|
+
const [open, setOpen] = React.useState(false)
|
|
680
|
+
const [age, setAge] = React.useState<number | string>('')
|
|
681
|
+
|
|
682
|
+
const handleChange = (event: SelectChangeEvent<typeof age>): void => {
|
|
683
|
+
setAge(Number(event.target.value) || '')
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
const handleClickOpen = (): void => {
|
|
687
|
+
setOpen(true)
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
const handleClose = (event: React.SyntheticEvent<unknown>, reason?: string): void => {
|
|
691
|
+
if (reason !== 'backdropClick') {
|
|
692
|
+
setOpen(false)
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
return (
|
|
697
|
+
<div>
|
|
698
|
+
<Button onClick={handleClickOpen}>Open select dialog</Button>
|
|
699
|
+
<Dialog disableEscapeKeyDown open={open} onClose={handleClose}>
|
|
700
|
+
<DialogTitle>Fill the form</DialogTitle>
|
|
701
|
+
<DialogContent>
|
|
702
|
+
<Box component="form" sx={{ display: 'flex', flexWrap: 'wrap' }}>
|
|
703
|
+
<FormControl sx={{ m: 1, minWidth: 120 }}>
|
|
704
|
+
<InputLabel htmlFor="demo-dialog-native">Age</InputLabel>
|
|
705
|
+
<Select
|
|
706
|
+
native
|
|
707
|
+
value={age}
|
|
708
|
+
onChange={handleChange}
|
|
709
|
+
input={<OutlinedInput label="Age" id="demo-dialog-native" />}
|
|
710
|
+
>
|
|
711
|
+
<option aria-label="None" value="" />
|
|
712
|
+
<option value={10}>Ten</option>
|
|
713
|
+
<option value={20}>Twenty</option>
|
|
714
|
+
<option value={30}>Thirty</option>
|
|
715
|
+
</Select>
|
|
716
|
+
</FormControl>
|
|
717
|
+
<FormControl sx={{ m: 1, minWidth: 120 }}>
|
|
718
|
+
<InputLabel id="demo-dialog-select-label">Age</InputLabel>
|
|
719
|
+
<Select
|
|
720
|
+
labelId="demo-dialog-select-label"
|
|
721
|
+
id="demo-dialog-select"
|
|
722
|
+
value={age}
|
|
723
|
+
onChange={handleChange}
|
|
724
|
+
input={<OutlinedInput label="Age" />}
|
|
725
|
+
>
|
|
726
|
+
<MenuItem value="">
|
|
727
|
+
<em>None</em>
|
|
728
|
+
</MenuItem>
|
|
729
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
730
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
731
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
732
|
+
</Select>
|
|
733
|
+
</FormControl>
|
|
734
|
+
</Box>
|
|
735
|
+
</DialogContent>
|
|
736
|
+
<DialogActions>
|
|
737
|
+
<Button onClick={handleClose}>Cancel</Button>
|
|
738
|
+
<Button onClick={handleClose}>Ok</Button>
|
|
739
|
+
</DialogActions>
|
|
740
|
+
</Dialog>
|
|
741
|
+
</div>
|
|
742
|
+
)
|
|
743
|
+
}
|
|
744
|
+
WithDialog.parameters = {
|
|
745
|
+
docs: {
|
|
746
|
+
description: {
|
|
747
|
+
story: DOCS.Select.WithDialog
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
export const Grouping: ComponentStory<typeof Select> = (args): JSX.Element => {
|
|
753
|
+
return (
|
|
754
|
+
<div>
|
|
755
|
+
<FormControl sx={{ m: 1, minWidth: 120 }}>
|
|
756
|
+
<InputLabel htmlFor="grouped-native-select">Grouping</InputLabel>
|
|
757
|
+
<Select native defaultValue="" id="grouped-native-select" label="Grouping">
|
|
758
|
+
<option aria-label="None" value="" />
|
|
759
|
+
<optgroup label="Category 1">
|
|
760
|
+
<option value={1}>Option 1</option>
|
|
761
|
+
<option value={2}>Option 2</option>
|
|
762
|
+
</optgroup>
|
|
763
|
+
<optgroup label="Category 2">
|
|
764
|
+
<option value={3}>Option 3</option>
|
|
765
|
+
<option value={4}>Option 4</option>
|
|
766
|
+
</optgroup>
|
|
767
|
+
</Select>
|
|
768
|
+
</FormControl>
|
|
769
|
+
<FormControl sx={{ m: 1, minWidth: 120 }}>
|
|
770
|
+
<InputLabel htmlFor="grouped-select">Grouping</InputLabel>
|
|
771
|
+
<Select defaultValue="" id="grouped-select" label="Grouping">
|
|
772
|
+
<MenuItem value="">
|
|
773
|
+
<em>None</em>
|
|
774
|
+
</MenuItem>
|
|
775
|
+
<ListSubheader>Category 1</ListSubheader>
|
|
776
|
+
<MenuItem value={1}>Option 1</MenuItem>
|
|
777
|
+
<MenuItem value={2}>Option 2</MenuItem>
|
|
778
|
+
<ListSubheader>Category 2</ListSubheader>
|
|
779
|
+
<MenuItem value={3}>Option 3</MenuItem>
|
|
780
|
+
<MenuItem value={4}>Option 4</MenuItem>
|
|
781
|
+
</Select>
|
|
782
|
+
</FormControl>
|
|
783
|
+
</div>
|
|
784
|
+
)
|
|
785
|
+
}
|
|
786
|
+
Grouping.parameters = {
|
|
787
|
+
docs: {
|
|
788
|
+
description: {
|
|
789
|
+
story: DOCS.Select.Grouping
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
export const All: ComponentStory<typeof AllCombinations> = (args): JSX.Element => (
|
|
795
|
+
<AllCombinations />
|
|
796
|
+
)
|
|
797
|
+
All.parameters = {
|
|
798
|
+
docs: {
|
|
799
|
+
description: {
|
|
800
|
+
story: DOCS.Select.All
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|