@learningpool/ui 1.6.2 → 1.6.5
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/{dist/assets → assets}/Images.d.ts +0 -0
- package/{dist/assets → assets}/Images.js +0 -0
- package/{dist/components → components}/atoms/Autocomplete/Autocomplete.d.ts +0 -0
- package/{dist/components → components}/atoms/Autocomplete/Autocomplete.js +0 -0
- package/{dist/components → components}/atoms/Button/Button.d.ts +0 -0
- package/{dist/components → components}/atoms/Button/Button.js +0 -0
- package/{dist/components → components}/atoms/Checkbox/Checkbox.d.ts +0 -0
- package/{dist/components → components}/atoms/Checkbox/Checkbox.js +0 -0
- package/{dist/components → components}/atoms/IconButton/IconButton.d.ts +0 -0
- package/{dist/components → components}/atoms/IconButton/IconButton.js +0 -0
- package/{dist/components → components}/atoms/Radio/Radio.d.ts +0 -0
- package/{dist/components → components}/atoms/Radio/Radio.js +0 -0
- package/{dist/components → components}/atoms/Select/Select.d.ts +0 -0
- package/{dist/components → components}/atoms/Select/Select.js +0 -0
- package/{dist/components → components}/atoms/Slider/Slider.d.ts +0 -0
- package/{dist/components → components}/atoms/Slider/Slider.js +0 -0
- package/{dist/components → components}/atoms/Switch/Switch.d.ts +0 -0
- package/{dist/components → components}/atoms/Switch/Switch.js +0 -0
- package/{dist/components → components}/atoms/TextField/TextField.d.ts +0 -0
- package/{dist/components → components}/atoms/TextField/TextField.js +0 -0
- package/{dist/components → components}/atoms/ToggleButton/ToggleButton.d.ts +0 -0
- package/{dist/components → components}/atoms/ToggleButton/ToggleButton.js +0 -0
- package/{dist/components → components}/datadisplay/Avatar/Avatar.d.ts +0 -0
- package/{dist/components → components}/datadisplay/Avatar/Avatar.js +0 -0
- package/{dist/components → components}/datadisplay/Chip/Chip.d.ts +0 -0
- package/{dist/components → components}/datadisplay/Chip/Chip.js +0 -0
- package/{dist/components → components}/datadisplay/List/List.d.ts +0 -0
- package/{dist/components → components}/datadisplay/List/List.js +0 -0
- package/{dist/components → components}/datadisplay/Tooltip/Tooltip.d.ts +0 -0
- package/{dist/components → components}/datadisplay/Tooltip/Tooltip.js +0 -0
- package/{dist/components → components}/feedback/Alert/Alert.d.ts +0 -0
- package/{dist/components → components}/feedback/Alert/Alert.js +0 -0
- package/{dist/components → components}/landmarks/Header/Header.d.ts +0 -0
- package/{dist/components → components}/landmarks/Header/Header.js +0 -0
- package/{dist/components → components}/landmarks/Header/HeaderActionButtons.d.ts +0 -0
- package/{dist/components → components}/landmarks/Header/HeaderActionButtons.js +0 -0
- package/{dist/components → components}/landmarks/Header/HeaderStyles.d.ts +0 -0
- package/{dist/components → components}/landmarks/Header/HeaderStyles.js +0 -0
- package/{dist/components → components}/navigation/Drawer/Drawer.d.ts +0 -0
- package/{dist/components → components}/navigation/Drawer/Drawer.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigation.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigation.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationAvatar.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationAvatar.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationAvatarStyles.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationDrawer.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationDrawer.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationDrawerStyles.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationMotion.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationMotion.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationNotchIndicator.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationNotchIndicator.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationSearch.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationSearch.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationSearchStyles.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationStyles.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationToggleSearchX.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationToggleX.d.ts +0 -0
- package/{dist/components → components}/navigation/MobileNavigation/MobileNavigationToggleX.js +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigation.d.ts +1 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigation.js +12 -10
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationAvatar.d.ts +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationAvatar.js +11 -7
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +49 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +33 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.d.ts +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.d.ts +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +3 -3
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.d.ts +1 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +16 -15
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.d.ts +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +3 -3
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationMotion.d.ts +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationMotion.js +0 -0
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +6 -1
- package/{dist/components → components}/navigation/VerticalNavigation/VerticalNavigationStyles.js +14 -15
- package/{dist/components → components}/pages/ErrorPage/ErrorPage.d.ts +0 -0
- package/{dist/components → components}/pages/ErrorPage/ErrorPage.js +0 -0
- package/{dist/components → components}/pages/ErrorPage/ErrorPageStyles.d.ts +0 -0
- package/{dist/components → components}/pages/ErrorPage/ErrorPageStyles.js +0 -0
- package/{dist/components → components}/pages/SideInSide/SideInSide.d.ts +0 -0
- package/{dist/components → components}/pages/SideInSide/SideInSide.js +0 -0
- package/{dist/components → components}/pages/SideInSide/SideInSideStyles.d.ts +0 -0
- package/{dist/components → components}/pages/SideInSide/SideInSideStyles.js +0 -0
- package/{dist/components → components}/stream/AppSwitcher/AppSwitcher.d.ts +0 -0
- package/{dist/components → components}/stream/AppSwitcher/AppSwitcher.js +1 -11
- package/{dist/components → components}/stream/AppSwitcher/AppSwitcherItem.d.ts +1 -0
- package/{dist/components → components}/stream/AppSwitcher/AppSwitcherItem.js +14 -14
- package/{dist/components → components}/stream/AppSwitcher/AppSwitcherStyles.d.ts +0 -0
- package/{dist/components → components}/stream/AppSwitcher/AppSwitcherStyles.js +8 -6
- package/{dist/components → components}/stream/AppSwitcher/constants.d.ts +0 -0
- package/{dist/components → components}/stream/AppSwitcher/constants.js +0 -0
- package/{dist/index.d.ts → index.d.ts} +0 -0
- package/{dist/index.js → index.js} +0 -0
- package/lang/en-us.d.ts +15 -0
- package/lang/en-us.js +18 -0
- package/package.json +3 -70
- package/{dist/types → types}/components/navigation/VerticalNavigation.d.ts +0 -0
- package/{dist/types → types}/components/navigation/VerticalNavigation.js +0 -0
- package/{dist/types → types}/components/navigation/VerticalNavigationAvatar.d.ts +1 -0
- package/{dist/types → types}/components/navigation/VerticalNavigationAvatar.js +0 -0
- package/{dist/types → types}/components/stream/AppSwitcher.d.ts +0 -0
- package/{dist/types → types}/components/stream/AppSwitcher.js +0 -0
- package/{dist/types → types}/index.d.ts +0 -0
- package/{dist/types → types}/index.js +0 -0
- package/{dist/utils → utils}/constants.d.ts +0 -0
- package/{dist/utils → utils}/constants.js +0 -0
- package/{dist/utils → utils}/helpers.d.ts +0 -0
- package/{dist/utils → utils}/helpers.js +0 -0
- package/{dist/utils → utils}/hooks.d.ts +0 -0
- package/{dist/utils → utils}/hooks.js +0 -0
- package/{dist/utils → utils}/index.d.ts +0 -0
- package/{dist/utils → utils}/index.js +0 -0
- package/{dist/utils → utils}/theme.d.ts +0 -0
- package/{dist/utils → utils}/theme.js +0 -0
- package/.eslintrc.js +0 -40
- package/.github/pull_request_template.md +0 -23
- package/.github/renovate.json +0 -57
- package/.github/workflows/integration.yml +0 -53
- package/.github/workflows/wss.yml +0 -22
- package/.jest-test-results.json +0 -1
- package/.releaserc +0 -32
- package/.storybook/learningpoolTheme.js +0 -39
- package/.storybook/main.js +0 -21
- package/.storybook/manager-head.html +0 -175
- package/.storybook/manager.js +0 -34
- package/.storybook/preview-head.html +0 -212
- package/.storybook/preview.js +0 -120
- package/.storybook/storybook-sort.js +0 -54
- package/CHANGELOG.md +0 -13
- package/amplify.yml +0 -16
- package/babel.config.json +0 -14
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +0 -31
- package/dist/lang/en-us.d.ts +0 -6
- package/dist/lang/en-us.js +0 -6
- package/dist/package.json +0 -41
- package/jest.config.ts +0 -11
- package/jest.setup.ts +0 -5
- package/license +0 -7
- package/merge.js +0 -27
- 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 +0 -5
- package/public/assets/automation.svg +0 -1
- 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 +0 -6
- package/public/assets/flux/icon-light.svg +0 -1
- package/public/assets/flux/icon-white.svg +0 -6
- package/public/assets/flux/icon.svg +0 -6
- package/public/assets/flux/logo-dark.svg +0 -22
- package/public/assets/flux/logo-light.svg +0 -1
- package/public/assets/flux/logo-white.svg +0 -22
- package/public/assets/flux/logo.svg +0 -22
- 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 +0 -1
- package/public/assets/molecules.svg +0 -8
- package/public/assets/organisms.svg +0 -21
- package/public/assets/pages.svg +0 -4
- package/public/assets/particles.svg +0 -3
- package/public/assets/stream-dark.png +0 -0
- package/public/assets/stream-suite-logo.svg +0 -38
- package/public/assets/stream-white.png +0 -0
- package/public/assets/stream.png +0 -0
- package/public/assets/templates.svg +0 -3
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/public/site.webmanifest +0 -1
- package/readme.md +0 -132
- package/src/docs.tsx +0 -167
- package/src/lib/assets/Images.tsx +0 -47
- package/src/lib/assets/stream-suite-logo.svg +0 -38
- package/src/lib/components/atoms/Autocomplete/Autocomplete.test.tsx +0 -179
- package/src/lib/components/atoms/Autocomplete/Autocomplete.tsx +0 -14
- package/src/lib/components/atoms/Button/Button.test.tsx +0 -166
- package/src/lib/components/atoms/Button/Button.tsx +0 -16
- package/src/lib/components/atoms/Checkbox/Checkbox.test.tsx +0 -85
- package/src/lib/components/atoms/Checkbox/Checkbox.tsx +0 -10
- package/src/lib/components/atoms/IconButton/IconButton.test.tsx +0 -60
- package/src/lib/components/atoms/IconButton/IconButton.tsx +0 -9
- package/src/lib/components/atoms/Radio/Radio.test.tsx +0 -136
- package/src/lib/components/atoms/Radio/Radio.tsx +0 -10
- package/src/lib/components/atoms/Select/Select.test.tsx +0 -158
- package/src/lib/components/atoms/Select/Select.tsx +0 -12
- package/src/lib/components/atoms/Slider/Slider.test.tsx +0 -103
- package/src/lib/components/atoms/Slider/Slider.tsx +0 -10
- package/src/lib/components/atoms/Switch/Switch.test.tsx +0 -96
- package/src/lib/components/atoms/Switch/Switch.tsx +0 -10
- package/src/lib/components/atoms/TextField/TextField.test.tsx +0 -131
- package/src/lib/components/atoms/TextField/TextField.tsx +0 -31
- package/src/lib/components/atoms/ToggleButton/ToggleButton.test.tsx +0 -122
- package/src/lib/components/atoms/ToggleButton/ToggleButton.tsx +0 -10
- package/src/lib/components/datadisplay/Avatar/Avatar.test.tsx +0 -187
- package/src/lib/components/datadisplay/Avatar/Avatar.tsx +0 -35
- package/src/lib/components/datadisplay/Avatar/avatar-1.jpg +0 -0
- package/src/lib/components/datadisplay/Chip/Chip.test.tsx +0 -82
- package/src/lib/components/datadisplay/Chip/Chip.tsx +0 -11
- package/src/lib/components/datadisplay/List/List.test.tsx +0 -168
- package/src/lib/components/datadisplay/List/List.tsx +0 -8
- package/src/lib/components/datadisplay/Tooltip/Tooltip.test.tsx +0 -98
- package/src/lib/components/datadisplay/Tooltip/Tooltip.tsx +0 -9
- package/src/lib/components/feedback/Alert/Alert.test.tsx +0 -139
- package/src/lib/components/feedback/Alert/Alert.tsx +0 -10
- package/src/lib/components/landmarks/Header/Header.tsx +0 -140
- package/src/lib/components/landmarks/Header/HeaderActionButtons.tsx +0 -117
- package/src/lib/components/landmarks/Header/HeaderStyles.tsx +0 -62
- package/src/lib/components/navigation/Drawer/Drawer.test.tsx +0 -95
- package/src/lib/components/navigation/Drawer/Drawer.tsx +0 -21
- package/src/lib/components/navigation/MobileNavigation/MobileNavigation.tsx +0 -276
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationAvatar.tsx +0 -334
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.tsx +0 -77
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationDrawer.tsx +0 -197
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.tsx +0 -143
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.tsx +0 -192
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.tsx +0 -67
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.tsx +0 -192
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.tsx +0 -217
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationMotion.tsx +0 -119
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.tsx +0 -35
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationSearch.tsx +0 -114
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationSearchStyles.tsx +0 -47
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationStyles.tsx +0 -320
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.tsx +0 -59
- package/src/lib/components/navigation/MobileNavigation/MobileNavigationToggleX.tsx +0 -51
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigation.tsx +0 -468
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationAvatar.tsx +0 -208
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.tsx +0 -75
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.tsx +0 -196
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.tsx +0 -94
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.tsx +0 -212
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.tsx +0 -240
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationMotion.tsx +0 -119
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationStyles.tsx +0 -302
- package/src/lib/components/pages/ErrorPage/ErrorPage.test.tsx +0 -78
- package/src/lib/components/pages/ErrorPage/ErrorPage.tsx +0 -50
- package/src/lib/components/pages/ErrorPage/ErrorPageStyles.tsx +0 -30
- package/src/lib/components/pages/SideInSide/SideInSide.tsx +0 -100
- package/src/lib/components/pages/SideInSide/SideInSideStyles.tsx +0 -62
- package/src/lib/components/stream/AppSwitcher/AppSwitcher.tsx +0 -392
- package/src/lib/components/stream/AppSwitcher/AppSwitcherItem.tsx +0 -83
- package/src/lib/components/stream/AppSwitcher/AppSwitcherStyles.tsx +0 -325
- package/src/lib/components/stream/AppSwitcher/constants.tsx +0 -28
- package/src/lib/index.tsx +0 -148
- package/src/lib/lang/en-us.js +0 -6
- package/src/lib/types/components/navigation/VerticalNavigation.ts +0 -52
- package/src/lib/types/components/navigation/VerticalNavigationAvatar.ts +0 -26
- package/src/lib/types/components/stream/AppSwitcher.ts +0 -10
- package/src/lib/types/index.ts +0 -9
- package/src/lib/utils/constants.tsx +0 -11
- package/src/lib/utils/helpers.tsx +0 -77
- package/src/lib/utils/hooks.tsx +0 -33
- package/src/lib/utils/index.tsx +0 -4
- package/src/lib/utils/theme.tsx +0 -79
- package/src/react-app-env.d.ts +0 -1
- package/src/setupTests.ts +0 -5
- package/src/stories/Components/DataDisplay/Avatar/Accessibility.stories.mdx +0 -34
- package/src/stories/Components/DataDisplay/Avatar/AllCombinations.tsx +0 -56
- package/src/stories/Components/DataDisplay/Avatar/Avatar.stories.tsx +0 -19
- package/src/stories/Components/DataDisplay/Avatar/Examples.stories.tsx +0 -278
- package/src/stories/Components/DataDisplay/Avatar/Overview.stories.mdx +0 -47
- package/src/stories/Components/DataDisplay/Chip/Accessibility.stories.mdx +0 -29
- package/src/stories/Components/DataDisplay/Chip/AllCombinations.tsx +0 -58
- package/src/stories/Components/DataDisplay/Chip/Chip.stories.tsx +0 -21
- package/src/stories/Components/DataDisplay/Chip/Examples.stories.tsx +0 -126
- package/src/stories/Components/DataDisplay/Chip/Overview.stories.mdx +0 -57
- package/src/stories/Components/DataDisplay/List/Accessibility.stories.mdx +0 -54
- package/src/stories/Components/DataDisplay/List/AllCombinations.tsx +0 -396
- package/src/stories/Components/DataDisplay/List/Examples.stories.tsx +0 -501
- package/src/stories/Components/DataDisplay/List/List.stories.tsx +0 -35
- package/src/stories/Components/DataDisplay/List/Overview.stories.mdx +0 -69
- package/src/stories/Components/DataDisplay/Table/Overview.stories.mdx +0 -70
- package/src/stories/Components/DataDisplay/Tooltip/Accessibility.stories.mdx +0 -39
- package/src/stories/Components/DataDisplay/Tooltip/AllCombinations.tsx +0 -134
- package/src/stories/Components/DataDisplay/Tooltip/Examples.stories.tsx +0 -237
- package/src/stories/Components/DataDisplay/Tooltip/Overview.stories.mdx +0 -58
- package/src/stories/Components/DataDisplay/Tooltip/Tooltip.stories.tsx +0 -22
- package/src/stories/Components/Feedback/Alert/Accessibility.stories.mdx +0 -25
- package/src/stories/Components/Feedback/Alert/Alert.stories.tsx +0 -22
- package/src/stories/Components/Feedback/Alert/AllCombinations.tsx +0 -37
- package/src/stories/Components/Feedback/Alert/Examples.stories.tsx +0 -137
- package/src/stories/Components/Feedback/Alert/Overview.stories.mdx +0 -62
- package/src/stories/Components/Inputs/Autocomplete/Accessibility.stories.mdx +0 -31
- package/src/stories/Components/Inputs/Autocomplete/AllCombinations.tsx +0 -182
- package/src/stories/Components/Inputs/Autocomplete/Autocomplete.stories.tsx +0 -31
- package/src/stories/Components/Inputs/Autocomplete/Examples.stories.tsx +0 -233
- package/src/stories/Components/Inputs/Autocomplete/Overview.stories.mdx +0 -52
- package/src/stories/Components/Inputs/Button/Accessibility.stories.mdx +0 -52
- package/src/stories/Components/Inputs/Button/AllCombinations.tsx +0 -53
- package/src/stories/Components/Inputs/Button/Button.stories.tsx +0 -23
- package/src/stories/Components/Inputs/Button/Examples.stories.tsx +0 -190
- package/src/stories/Components/Inputs/Button/Overview.stories.mdx +0 -52
- package/src/stories/Components/Inputs/Checkbox/Accessibility.stories.mdx +0 -38
- package/src/stories/Components/Inputs/Checkbox/AllCombinations.tsx +0 -55
- package/src/stories/Components/Inputs/Checkbox/Checkbox.stories.tsx +0 -22
- package/src/stories/Components/Inputs/Checkbox/Examples.stories.tsx +0 -363
- package/src/stories/Components/Inputs/Checkbox/Overview.stories.mdx +0 -63
- package/src/stories/Components/Inputs/IconButton/Examples.stories.tsx +0 -24
- package/src/stories/Components/Inputs/IconButton/IconButton.stories.tsx +0 -26
- package/src/stories/Components/Inputs/Radio/Accessibility.stories.mdx +0 -61
- package/src/stories/Components/Inputs/Radio/AllCombinations.tsx +0 -75
- package/src/stories/Components/Inputs/Radio/Examples.stories.tsx +0 -333
- package/src/stories/Components/Inputs/Radio/Overview.stories.mdx +0 -74
- package/src/stories/Components/Inputs/Radio/Radio.stories.tsx +0 -22
- package/src/stories/Components/Inputs/Select/Accessibility.stories.mdx +0 -51
- package/src/stories/Components/Inputs/Select/AllCombinations.tsx +0 -63
- package/src/stories/Components/Inputs/Select/Examples.stories.tsx +0 -803
- package/src/stories/Components/Inputs/Select/Overview.stories.mdx +0 -73
- package/src/stories/Components/Inputs/Select/Select.stories.tsx +0 -22
- package/src/stories/Components/Inputs/Slider/Accessibility.stories.mdx +0 -43
- package/src/stories/Components/Inputs/Slider/AllCombinations.tsx +0 -30
- package/src/stories/Components/Inputs/Slider/Examples.stories.tsx +0 -146
- package/src/stories/Components/Inputs/Slider/Overview.stories.mdx +0 -59
- package/src/stories/Components/Inputs/Slider/Slider.stories.tsx +0 -27
- package/src/stories/Components/Inputs/Switch/Accessibility.stories.mdx +0 -34
- package/src/stories/Components/Inputs/Switch/AllCombinations.tsx +0 -45
- package/src/stories/Components/Inputs/Switch/Examples.stories.tsx +0 -213
- package/src/stories/Components/Inputs/Switch/Overview.stories.mdx +0 -62
- package/src/stories/Components/Inputs/Switch/Switch.stories.tsx +0 -22
- package/src/stories/Components/Inputs/TextField/Accessibility.stories.mdx +0 -29
- package/src/stories/Components/Inputs/TextField/AllCombinations.tsx +0 -57
- package/src/stories/Components/Inputs/TextField/Examples.stories.tsx +0 -127
- package/src/stories/Components/Inputs/TextField/Overview.stories.mdx +0 -60
- package/src/stories/Components/Inputs/TextField/TextField.stories.tsx +0 -261
- package/src/stories/Components/Inputs/ToggleButton/Accessibility.stories.mdx +0 -32
- package/src/stories/Components/Inputs/ToggleButton/AllCombinations.tsx +0 -113
- package/src/stories/Components/Inputs/ToggleButton/Examples.stories.tsx +0 -339
- package/src/stories/Components/Inputs/ToggleButton/Overview.stories.mdx +0 -55
- package/src/stories/Components/Inputs/ToggleButton/ToggleButton.stories.tsx +0 -19
- package/src/stories/Components/Landmarks/Header/Examples.stories.tsx +0 -197
- package/src/stories/Components/Landmarks/Header/Header.stories.tsx +0 -34
- package/src/stories/Components/Landmarks/Header/Overview.stories.mdx +0 -44
- package/src/stories/Components/Navigation/Drawer/Accessibility.stories.mdx +0 -13
- package/src/stories/Components/Navigation/Drawer/Drawer.stories.tsx +0 -80
- package/src/stories/Components/Navigation/Drawer/Examples.stories.tsx +0 -440
- package/src/stories/Components/Navigation/Drawer/Overview.stories.mdx +0 -43
- package/src/stories/Components/Navigation/MobileNavigation/Accessibility.stories.mdx +0 -14
- package/src/stories/Components/Navigation/MobileNavigation/Examples.stories.tsx +0 -384
- package/src/stories/Components/Navigation/MobileNavigation/MobileNavigation.stories.tsx +0 -24
- package/src/stories/Components/Navigation/MobileNavigation/Overview.stories.mdx +0 -47
- package/src/stories/Components/Navigation/VerticalNavigation/Accessibility.stories.mdx +0 -14
- package/src/stories/Components/Navigation/VerticalNavigation/Examples.stories.tsx +0 -307
- package/src/stories/Components/Navigation/VerticalNavigation/Overview.stories.mdx +0 -47
- package/src/stories/Components/Navigation/VerticalNavigation/VerticalNavigation.stories.tsx +0 -24
- package/src/stories/ContactUs.stories.mdx +0 -21
- package/src/stories/Experimental/Test.stories.mdx +0 -46
- package/src/stories/GettingStarted/Designer.stories.mdx +0 -86
- package/src/stories/GettingStarted/Developer.stories.mdx +0 -134
- package/src/stories/Guidelines/Accessibility/AssistiveTechnology.stories.mdx +0 -70
- package/src/stories/Guidelines/Accessibility/ColorAndContrast.stories.mdx +0 -109
- package/src/stories/Guidelines/Accessibility/Hierarchy.stories.mdx +0 -119
- package/src/stories/Guidelines/Accessibility/Imagery.stories.mdx +0 -136
- package/src/stories/Guidelines/Accessibility/Overview.stories.mdx +0 -44
- package/src/stories/Guidelines/Accessibility/Principles.stories.mdx +0 -156
- package/src/stories/Guidelines/Accessibility/SoundAndMotion.stories.mdx +0 -59
- package/src/stories/Guidelines/Accessibility/Typography.stories.mdx +0 -69
- package/src/stories/Guidelines/Accessibility/Writing.stories.mdx +0 -188
- package/src/stories/Guidelines/Styleguide/ColorSwatch.tsx +0 -53
- package/src/stories/Guidelines/Styleguide/Colors.stories.mdx +0 -118
- package/src/stories/Guidelines/Styleguide/Typography.stories.mdx +0 -84
- package/src/stories/Introduction.stories.mdx +0 -65
- package/src/stories/Pages/ErrorPage.stories.tsx +0 -30
- package/src/stories/Pages/SideInSide.stories.tsx +0 -195
- package/src/stories/Roadmap.stories.mdx +0 -19
- package/src/stories/Templates/Login.stories.mdx +0 -46
- package/src/stories/assets/Atomic_Design_Icons-Dark.svg +0 -24
- package/src/stories/assets/Atomic_Design_Icons-Light.svg +0 -25
- 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 +0 -6
- 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 +0 -9
- package/src/stories/assets/organisms.svg +0 -22
- package/src/stories/assets/pages.svg +0 -5
- package/src/stories/assets/particles.svg +0 -4
- package/src/stories/assets/templates.svg +0 -4
- package/src/stories/assets/testData.tsx +0 -102
- 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 +0 -44
- package/tsconfig.eslint.json +0 -16
- package/tsconfig.json +0 -50
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { cleanup, render, screen } from '@testing-library/react'
|
|
3
|
-
import userEvent from '@testing-library/user-event'
|
|
4
|
-
import Slider from './Slider'
|
|
5
|
-
|
|
6
|
-
// Note: running cleanup afterEach is done automatically for you in @testing-library/react@9.0.0 or higher
|
|
7
|
-
// unmount and cleanup DOM after the test is finished.
|
|
8
|
-
afterEach(cleanup)
|
|
9
|
-
|
|
10
|
-
describe('Test -- Slider component', () => {
|
|
11
|
-
it('renders a slider', () => {
|
|
12
|
-
render(
|
|
13
|
-
<Slider data-testid="sliderTest" defaultValue={50} aria-label="label" />
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
expect(screen.getByTestId('sliderTest')).toMatchInlineSnapshot(`
|
|
17
|
-
<span
|
|
18
|
-
class="MuiSlider-root MuiSlider-colorPrimary MuiSlider-sizeMedium css-187mznn-MuiSlider-root"
|
|
19
|
-
data-testid="sliderTest"
|
|
20
|
-
>
|
|
21
|
-
<span
|
|
22
|
-
class="MuiSlider-rail css-14pt78w-MuiSlider-rail"
|
|
23
|
-
/>
|
|
24
|
-
<span
|
|
25
|
-
class="MuiSlider-track css-1gv0vcd-MuiSlider-track"
|
|
26
|
-
style="left: 0%; width: 50%;"
|
|
27
|
-
/>
|
|
28
|
-
<span
|
|
29
|
-
class="MuiSlider-thumb MuiSlider-thumbColorPrimary MuiSlider-thumbSizeMedium css-eg0mwd-MuiSlider-thumb"
|
|
30
|
-
data-focusvisible="false"
|
|
31
|
-
data-index="0"
|
|
32
|
-
style="left: 50%;"
|
|
33
|
-
>
|
|
34
|
-
<input
|
|
35
|
-
aria-label="label"
|
|
36
|
-
aria-orientation="horizontal"
|
|
37
|
-
aria-valuemax="100"
|
|
38
|
-
aria-valuemin="0"
|
|
39
|
-
aria-valuenow="50"
|
|
40
|
-
data-index="0"
|
|
41
|
-
max="100"
|
|
42
|
-
min="0"
|
|
43
|
-
step="1"
|
|
44
|
-
style="border: 0px; height: 100%; margin: -1px; overflow: hidden; padding: 0px; position: absolute; white-space: nowrap; width: 100%; direction: ltr;"
|
|
45
|
-
type="range"
|
|
46
|
-
value="50"
|
|
47
|
-
/>
|
|
48
|
-
</span>
|
|
49
|
-
</span>
|
|
50
|
-
`)
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
it('responds to a click event', () => {
|
|
54
|
-
const mockCallBack = jest.fn()
|
|
55
|
-
render(<Slider onClick={mockCallBack} value={0} aria-label="label" />)
|
|
56
|
-
|
|
57
|
-
userEvent.click(screen.getByLabelText('label'))
|
|
58
|
-
expect(mockCallBack.mock.calls.length).toEqual(1)
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
it('should be disabled', () => {
|
|
62
|
-
render(<Slider disabled defaultValue={50} aria-label="label" />)
|
|
63
|
-
|
|
64
|
-
const slider = screen.getByLabelText('label')
|
|
65
|
-
expect(slider).toBeDisabled()
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
it('has a discrete range of values', () => {
|
|
69
|
-
render(<Slider value={[25, 50]} defaultValue={25} />)
|
|
70
|
-
|
|
71
|
-
const sliderMin = screen.getByDisplayValue('25')
|
|
72
|
-
expect(sliderMin).toHaveValue('25')
|
|
73
|
-
expect(sliderMin).toHaveAttribute('aria-valuenow', '25')
|
|
74
|
-
|
|
75
|
-
const sliderMax = screen.getByDisplayValue('50')
|
|
76
|
-
expect(sliderMax).toHaveValue('50')
|
|
77
|
-
expect(sliderMax).toHaveAttribute('aria-valuenow', '50')
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
it('has a proper default value', () => {
|
|
81
|
-
render(<Slider defaultValue={100} aria-label="label" />)
|
|
82
|
-
|
|
83
|
-
const slider = screen.getByLabelText('label')
|
|
84
|
-
expect(slider).toHaveAttribute('value', '100')
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
it('has the proper aria attributes', () => {
|
|
88
|
-
render(<Slider defaultValue={50} aria-label="label" />)
|
|
89
|
-
|
|
90
|
-
const slider = screen.getByLabelText('label')
|
|
91
|
-
expect(slider).toHaveAttribute('aria-label', 'label')
|
|
92
|
-
expect(slider).toHaveAttribute('aria-valuenow', '50')
|
|
93
|
-
expect(slider).toHaveAttribute('aria-valuemin', '0')
|
|
94
|
-
expect(slider).toHaveAttribute('aria-valuemax', '100')
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
it('has the proper type attribute', () => {
|
|
98
|
-
render(<Slider defaultValue={50} aria-label="label" />)
|
|
99
|
-
|
|
100
|
-
const slider = screen.getByLabelText('label')
|
|
101
|
-
expect(slider).toHaveAttribute('type', 'range')
|
|
102
|
-
})
|
|
103
|
-
})
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import MUISlider, { SliderProps } from '@mui/material/Slider'
|
|
3
|
-
|
|
4
|
-
interface ISliderProps extends SliderProps {}
|
|
5
|
-
|
|
6
|
-
export default function Slider ({ ...rest }: ISliderProps): JSX.Element {
|
|
7
|
-
return (
|
|
8
|
-
<MUISlider {...rest} />
|
|
9
|
-
)
|
|
10
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { cleanup, render, screen } from '@testing-library/react'
|
|
3
|
-
import userEvent from '@testing-library/user-event'
|
|
4
|
-
import Switch from './Switch'
|
|
5
|
-
|
|
6
|
-
// Note: running cleanup afterEach is done automatically for you in @testing-library/react@9.0.0 or higher
|
|
7
|
-
// unmount and cleanup DOM after the test is finished.
|
|
8
|
-
afterEach(cleanup)
|
|
9
|
-
|
|
10
|
-
describe('Test -- Switch component', () => {
|
|
11
|
-
it('renders a switch', () => {
|
|
12
|
-
render(
|
|
13
|
-
<Switch
|
|
14
|
-
data-testid="switchTest"
|
|
15
|
-
inputProps={{
|
|
16
|
-
'aria-label': 'label'
|
|
17
|
-
}}
|
|
18
|
-
/>
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
expect(screen.getByTestId('switchTest')).toMatchInlineSnapshot(`
|
|
22
|
-
<span
|
|
23
|
-
class="MuiButtonBase-root MuiSwitch-switchBase MuiSwitch-colorPrimary PrivateSwitchBase-root MuiSwitch-switchBase MuiSwitch-colorPrimary css-5ryogn-MuiButtonBase-root-MuiSwitch-switchBase"
|
|
24
|
-
data-testid="switchTest"
|
|
25
|
-
>
|
|
26
|
-
<input
|
|
27
|
-
aria-label="label"
|
|
28
|
-
class="PrivateSwitchBase-input MuiSwitch-input css-1m9pwf3"
|
|
29
|
-
type="checkbox"
|
|
30
|
-
/>
|
|
31
|
-
<span
|
|
32
|
-
class="MuiSwitch-thumb css-jsexje-MuiSwitch-thumb"
|
|
33
|
-
/>
|
|
34
|
-
<span
|
|
35
|
-
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
|
|
36
|
-
/>
|
|
37
|
-
</span>
|
|
38
|
-
`)
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
it('responds to a click event', () => {
|
|
42
|
-
const mockCallBack = jest.fn()
|
|
43
|
-
render(<Switch onClick={mockCallBack} data-testid="switchTest" />)
|
|
44
|
-
|
|
45
|
-
userEvent.click(screen.getByTestId('switchTest'))
|
|
46
|
-
expect(mockCallBack.mock.calls.length).toEqual(1)
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
it('changes checked state on click', () => {
|
|
50
|
-
render(<Switch />)
|
|
51
|
-
const switchTest = screen.getByRole('checkbox')
|
|
52
|
-
|
|
53
|
-
// Check initial state
|
|
54
|
-
expect(switchTest).not.toBeChecked()
|
|
55
|
-
|
|
56
|
-
// Check state after click
|
|
57
|
-
userEvent.click(switchTest)
|
|
58
|
-
expect(switchTest).toBeChecked()
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
it('should be disabled', () => {
|
|
62
|
-
render(<Switch disabled />)
|
|
63
|
-
|
|
64
|
-
const switchTest = screen.getByRole('checkbox')
|
|
65
|
-
expect(switchTest).toBeDisabled()
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
it('has the proper aria attributes', () => {
|
|
69
|
-
const { rerender } = render(
|
|
70
|
-
<Switch inputProps={{ 'aria-label': 'test label' }} />
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
// Default Switch has proper aria attributes
|
|
74
|
-
const switchInput = screen.getByRole('checkbox')
|
|
75
|
-
expect(switchInput).toHaveAttribute('aria-label', 'test label')
|
|
76
|
-
expect(switchInput).not.toHaveAttribute('aria-disabled')
|
|
77
|
-
|
|
78
|
-
// Disabled Switch has proper aria attribute
|
|
79
|
-
rerender(<Switch data-testid="switchTest" disabled />)
|
|
80
|
-
const switchSpan = screen.getByTestId('switchTest')
|
|
81
|
-
expect(switchSpan).toHaveAttribute('aria-disabled')
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
it('has the proper type attribute', () => {
|
|
85
|
-
render(<Switch />)
|
|
86
|
-
expect(screen.getByRole('checkbox')).toHaveAttribute('type', 'checkbox')
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
it('changes color', () => {
|
|
90
|
-
// Color prop changes css class
|
|
91
|
-
render(<Switch data-testid="switchTest" color="success" />)
|
|
92
|
-
expect(screen.getByTestId('switchTest')).toHaveClass(
|
|
93
|
-
'MuiSwitch-colorSuccess'
|
|
94
|
-
)
|
|
95
|
-
})
|
|
96
|
-
})
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import MUISwitch, { SwitchProps } from '@mui/material/Switch'
|
|
3
|
-
|
|
4
|
-
interface ISwitchProps extends SwitchProps {}
|
|
5
|
-
|
|
6
|
-
export default function Switch ({ ...rest }: ISwitchProps): JSX.Element {
|
|
7
|
-
return (
|
|
8
|
-
<MUISwitch {...rest} />
|
|
9
|
-
)
|
|
10
|
-
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-irregular-whitespace */
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { cleanup, render, screen } from '@testing-library/react'
|
|
4
|
-
import userEvent from '@testing-library/user-event'
|
|
5
|
-
import TextField from './TextField'
|
|
6
|
-
|
|
7
|
-
// Note: running cleanup afterEach is done automatically for you in @testing-library/react@9.0.0 or higher
|
|
8
|
-
// unmount and cleanup DOM after the test is finished.
|
|
9
|
-
afterEach(cleanup)
|
|
10
|
-
|
|
11
|
-
describe('Test -- TextField component', () => {
|
|
12
|
-
it('renders an outlined textField by default', () => {
|
|
13
|
-
render(
|
|
14
|
-
<TextField
|
|
15
|
-
data-testid="textFieldTest"
|
|
16
|
-
inputProps={{
|
|
17
|
-
'aria-label': 'label'
|
|
18
|
-
}}
|
|
19
|
-
/>
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
expect(screen.getByTestId('textFieldTest')).toMatchInlineSnapshot(`
|
|
23
|
-
<div
|
|
24
|
-
class="MuiFormControl-root MuiTextField-root css-1u3bzj6-MuiFormControl-root-MuiTextField-root"
|
|
25
|
-
data-testid="textFieldTest"
|
|
26
|
-
>
|
|
27
|
-
<div
|
|
28
|
-
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-formControl css-9ddj71-MuiInputBase-root-MuiOutlinedInput-root"
|
|
29
|
-
>
|
|
30
|
-
<input
|
|
31
|
-
aria-invalid="false"
|
|
32
|
-
aria-label="label"
|
|
33
|
-
class="MuiInputBase-input MuiOutlinedInput-input css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input"
|
|
34
|
-
id="mui-1"
|
|
35
|
-
type="text"
|
|
36
|
-
value=""
|
|
37
|
-
/>
|
|
38
|
-
<fieldset
|
|
39
|
-
aria-hidden="true"
|
|
40
|
-
class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
|
|
41
|
-
>
|
|
42
|
-
<legend
|
|
43
|
-
class="css-hdw1oc"
|
|
44
|
-
>
|
|
45
|
-
<span
|
|
46
|
-
class="notranslate"
|
|
47
|
-
>
|
|
48
|
-
|
|
49
|
-
</span>
|
|
50
|
-
</legend>
|
|
51
|
-
</fieldset>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
`)
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
it('responds to a click event', () => {
|
|
58
|
-
const mockCallBack = jest.fn()
|
|
59
|
-
render(<TextField onClick={mockCallBack} data-testid="textFieldTest" />)
|
|
60
|
-
|
|
61
|
-
userEvent.click(screen.getByTestId('textFieldTest'))
|
|
62
|
-
expect(mockCallBack.mock.calls.length).toEqual(1)
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
it('changes focused state on click', () => {
|
|
66
|
-
render(
|
|
67
|
-
<TextField
|
|
68
|
-
inputProps={{
|
|
69
|
-
'data-testid': 'textFieldTest'
|
|
70
|
-
}}
|
|
71
|
-
label="outlined"
|
|
72
|
-
/>
|
|
73
|
-
)
|
|
74
|
-
const textFieldTest = screen.getByTestId('textFieldTest')
|
|
75
|
-
|
|
76
|
-
// Check initial state
|
|
77
|
-
expect(textFieldTest).not.toHaveFocus()
|
|
78
|
-
|
|
79
|
-
// Check state after click
|
|
80
|
-
userEvent.click(textFieldTest)
|
|
81
|
-
expect(textFieldTest).toHaveFocus()
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
it('should be disabled', () => {
|
|
85
|
-
render(
|
|
86
|
-
<TextField
|
|
87
|
-
inputProps={{
|
|
88
|
-
'data-testid': 'textFieldTest'
|
|
89
|
-
}}
|
|
90
|
-
disabled
|
|
91
|
-
/>
|
|
92
|
-
)
|
|
93
|
-
|
|
94
|
-
const textFieldTest = screen.getByTestId('textFieldTest')
|
|
95
|
-
expect(textFieldTest).toBeDisabled()
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
it('has the proper aria attributes', () => {
|
|
99
|
-
render(
|
|
100
|
-
<TextField
|
|
101
|
-
inputProps={{
|
|
102
|
-
'aria-label': 'test label',
|
|
103
|
-
'data-testid': 'textFieldTest'
|
|
104
|
-
}}
|
|
105
|
-
/>
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
// Default TextField has proper aria attributes
|
|
109
|
-
const textFieldInput = screen.getByTestId('textFieldTest')
|
|
110
|
-
expect(textFieldInput).toHaveAttribute('aria-label', 'test label')
|
|
111
|
-
expect(textFieldInput).not.toHaveAttribute('aria-disabled')
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
it('has the proper type attribute', () => {
|
|
115
|
-
render(
|
|
116
|
-
<TextField
|
|
117
|
-
inputProps={{
|
|
118
|
-
'data-testid': 'textFieldTest'
|
|
119
|
-
}}
|
|
120
|
-
/>
|
|
121
|
-
)
|
|
122
|
-
const textFieldInput = screen.getByTestId('textFieldTest')
|
|
123
|
-
expect(textFieldInput).toHaveAttribute('type', 'text')
|
|
124
|
-
})
|
|
125
|
-
|
|
126
|
-
// it("changes color", () => {
|
|
127
|
-
// // Color prop changes css class
|
|
128
|
-
// render(<TextField data-testid="textFieldTest" color="success" />);
|
|
129
|
-
// expect(screen.getByTestId("textFieldTest")).toHaveClass("MuiTextField-colorSuccess");
|
|
130
|
-
// });
|
|
131
|
-
})
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import MUITextField, { BaseTextFieldProps } from '@mui/material/TextField'
|
|
3
|
-
import { OutlinedInputProps } from '@mui/material/OutlinedInput'
|
|
4
|
-
|
|
5
|
-
interface ITextFieldProps extends BaseTextFieldProps {
|
|
6
|
-
/**
|
|
7
|
-
* Callback fired when the value is changed.
|
|
8
|
-
*
|
|
9
|
-
* @param {object} event The event source of the callback.
|
|
10
|
-
* You can pull out the new value by accessing `event.target.value` (string).
|
|
11
|
-
*/
|
|
12
|
-
onChange?: OutlinedInputProps['onChange']
|
|
13
|
-
/**
|
|
14
|
-
* The variant to use.
|
|
15
|
-
* @default 'outlined'
|
|
16
|
-
*/
|
|
17
|
-
variant?: 'outlined'
|
|
18
|
-
/**
|
|
19
|
-
* Props applied to the Input element.
|
|
20
|
-
* It will be a [`FilledInput`](/api/filled-input/),
|
|
21
|
-
* [`OutlinedInput`](/api/outlined-input/) or [`Input`](/api/input/)
|
|
22
|
-
* component depending on the `variant` prop value.
|
|
23
|
-
*/
|
|
24
|
-
InputProps?: Partial<OutlinedInputProps>
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default function TextField (props: ITextFieldProps): JSX.Element {
|
|
28
|
-
return (
|
|
29
|
-
<MUITextField {...props} />
|
|
30
|
-
)
|
|
31
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { cleanup, render, screen } from '@testing-library/react'
|
|
3
|
-
import userEvent from '@testing-library/user-event'
|
|
4
|
-
import ToggleButton from '../../../../lib/components/atoms/ToggleButton/ToggleButton'
|
|
5
|
-
import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'
|
|
6
|
-
|
|
7
|
-
// Note: running cleanup afterEach is done automatically for you in @testing-library/react@9.0.0 or higher
|
|
8
|
-
// unmount and cleanup DOM after the test is finished.
|
|
9
|
-
afterEach(cleanup)
|
|
10
|
-
|
|
11
|
-
describe('Test -- ToggleButton component', () => {
|
|
12
|
-
it('renders a ToggleButton', () => {
|
|
13
|
-
render(
|
|
14
|
-
<ToggleButton
|
|
15
|
-
aria-label="label"
|
|
16
|
-
value="check"
|
|
17
|
-
data-testid="toggleButtonTest"
|
|
18
|
-
>
|
|
19
|
-
ToggleButton
|
|
20
|
-
</ToggleButton>
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
expect(screen.getByTestId('toggleButtonTest')).toMatchInlineSnapshot(`
|
|
24
|
-
<button
|
|
25
|
-
aria-label="label"
|
|
26
|
-
class="MuiButtonBase-root MuiToggleButton-root MuiToggleButton-sizeMedium MuiToggleButton-standard css-ueukts-MuiButtonBase-root-MuiToggleButton-root"
|
|
27
|
-
data-testid="toggleButtonTest"
|
|
28
|
-
tabindex="0"
|
|
29
|
-
type="button"
|
|
30
|
-
value="check"
|
|
31
|
-
>
|
|
32
|
-
ToggleButton
|
|
33
|
-
<span
|
|
34
|
-
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
|
|
35
|
-
/>
|
|
36
|
-
</button>
|
|
37
|
-
`)
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
it('responds to a click event', () => {
|
|
41
|
-
const mockCallBack = jest.fn()
|
|
42
|
-
render(
|
|
43
|
-
<ToggleButton
|
|
44
|
-
onClick={mockCallBack}
|
|
45
|
-
value={0}
|
|
46
|
-
data-testid="toggleButtonTest"
|
|
47
|
-
/>
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
userEvent.click(screen.getByTestId('toggleButtonTest'))
|
|
51
|
-
expect(mockCallBack.mock.calls.length).toEqual(1)
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
it('has the proper attributes', () => {
|
|
55
|
-
render(
|
|
56
|
-
<ToggleButtonGroup
|
|
57
|
-
value="two"
|
|
58
|
-
aria-label="ToggleButtonGroup label"
|
|
59
|
-
data-testid="toggleButtonTest"
|
|
60
|
-
>
|
|
61
|
-
<ToggleButton value="one" aria-label="ToggleButton one">One</ToggleButton>
|
|
62
|
-
<ToggleButton value="two" aria-label="ToggleButton two">Two</ToggleButton>
|
|
63
|
-
<ToggleButton value="three" aria-label="ToggleButton three" disabled>Three</ToggleButton>
|
|
64
|
-
</ToggleButtonGroup>
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
// Check toggleButtonGroup
|
|
68
|
-
const toggleButtonGroup = screen.getByTestId('toggleButtonTest')
|
|
69
|
-
expect(toggleButtonGroup).toHaveAttribute('aria-label', 'ToggleButtonGroup label')
|
|
70
|
-
expect(toggleButtonGroup).toHaveAttribute('role', 'group')
|
|
71
|
-
|
|
72
|
-
// Check toggleButton default
|
|
73
|
-
const toggleButtonOne = screen.getByLabelText('ToggleButton one')
|
|
74
|
-
expect(toggleButtonOne).toHaveAttribute('aria-pressed', 'false')
|
|
75
|
-
expect(toggleButtonOne).toHaveAttribute('tabindex', '0')
|
|
76
|
-
|
|
77
|
-
// Check toggleButton selected
|
|
78
|
-
const toggleButtonTwo = screen.getByLabelText('ToggleButton two')
|
|
79
|
-
expect(toggleButtonTwo).toHaveAttribute('aria-pressed', 'true')
|
|
80
|
-
|
|
81
|
-
// Check toggleButton disabled
|
|
82
|
-
const toggleButtonThree = screen.getByLabelText('ToggleButton three')
|
|
83
|
-
expect(toggleButtonThree).toBeDisabled()
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
it('properly changes focus state', () => {
|
|
87
|
-
render(
|
|
88
|
-
<ToggleButtonGroup
|
|
89
|
-
value="two"
|
|
90
|
-
aria-label="ToggleButtonGroup label"
|
|
91
|
-
data-testid="toggleButtonTest"
|
|
92
|
-
>
|
|
93
|
-
<ToggleButton value="one" aria-label="ToggleButton one">One</ToggleButton>
|
|
94
|
-
<ToggleButton value="two" aria-label="ToggleButton two">Two</ToggleButton>
|
|
95
|
-
<ToggleButton value="three" aria-label="ToggleButton three" disabled>Three</ToggleButton>
|
|
96
|
-
</ToggleButtonGroup>
|
|
97
|
-
)
|
|
98
|
-
const toggleButtonOne = screen.getByLabelText('ToggleButton one')
|
|
99
|
-
const toggleButtonTwo = screen.getByLabelText('ToggleButton two')
|
|
100
|
-
const toggleButtonThree = screen.getByLabelText('ToggleButton three')
|
|
101
|
-
|
|
102
|
-
// Check initial state
|
|
103
|
-
expect(toggleButtonOne).not.toHaveFocus()
|
|
104
|
-
expect(toggleButtonTwo).not.toHaveFocus()
|
|
105
|
-
expect(toggleButtonThree).not.toHaveFocus()
|
|
106
|
-
|
|
107
|
-
// Check state after click
|
|
108
|
-
userEvent.click(toggleButtonOne)
|
|
109
|
-
expect(toggleButtonOne).toHaveFocus()
|
|
110
|
-
expect(toggleButtonTwo).not.toHaveFocus()
|
|
111
|
-
|
|
112
|
-
// Check state after keyboard tab
|
|
113
|
-
userEvent.tab()
|
|
114
|
-
expect(toggleButtonOne).not.toHaveFocus()
|
|
115
|
-
expect(toggleButtonTwo).toHaveFocus()
|
|
116
|
-
expect(toggleButtonThree).not.toHaveFocus()
|
|
117
|
-
|
|
118
|
-
// Confirm disabled button does not receive focus
|
|
119
|
-
userEvent.tab()
|
|
120
|
-
expect(toggleButtonThree).not.toHaveFocus()
|
|
121
|
-
})
|
|
122
|
-
})
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import MUIToggleButton, { ToggleButtonProps } from '@mui/material/ToggleButton'
|
|
3
|
-
|
|
4
|
-
interface IToggleButtonProps extends ToggleButtonProps {}
|
|
5
|
-
|
|
6
|
-
export default function ToggleButton ({ ...rest }: IToggleButtonProps): JSX.Element {
|
|
7
|
-
return (
|
|
8
|
-
<MUIToggleButton {...rest} />
|
|
9
|
-
)
|
|
10
|
-
}
|