@hero-design/rn 7.3.2 → 7.6.0
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/.expo/README.md +15 -0
- package/.expo/packager-info.json +10 -0
- package/.expo/prebuild/cached-packages.json +4 -0
- package/.expo/settings.json +10 -0
- package/.expo/xcodebuild-error.log +2 -0
- package/.expo/xcodebuild.log +11199 -0
- package/.turbo/turbo-build.log +2 -2
- package/assets/fonts/hero-icons.ttf +0 -0
- package/es/index.js +7093 -5663
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +7101 -5662
- package/package.json +11 -9
- package/playground/.detoxrc.json +49 -0
- package/playground/.prettierrc.json +8 -0
- package/playground/.turbo/turbo-type-check.log +7 -0
- package/playground/app.json +9 -0
- package/playground/babel.config.js +63 -0
- package/playground/e2e/config.json +9 -0
- package/playground/e2e/environment.js +23 -0
- package/playground/e2e/firstTest.e2e.js +16 -0
- package/{expoEntry.js → playground/expoEntry.js} +1 -1
- package/playground/fonts/be-vietnam-pro-light.ttf +0 -0
- package/playground/fonts/be-vietnam-pro-regular.ttf +0 -0
- package/playground/fonts/be-vietnam-pro-semibold.ttf +0 -0
- package/playground/fonts/hero-icons.ttf +0 -0
- package/playground/index.js +7 -0
- package/playground/ios/MobileHeroDesignPlayground/AppDelegate.h +9 -0
- package/playground/ios/MobileHeroDesignPlayground/AppDelegate.m +75 -0
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/Contents.json +6 -0
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/Contents.json +21 -0
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/image.png +0 -0
- package/playground/ios/MobileHeroDesignPlayground/Info.plist +85 -0
- package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground-Bridging-Header.h +3 -0
- package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground.entitlements +8 -0
- package/playground/ios/MobileHeroDesignPlayground/SplashScreen.storyboard +40 -0
- package/playground/ios/MobileHeroDesignPlayground/Supporting/Expo.plist +16 -0
- package/playground/ios/MobileHeroDesignPlayground/main.m +10 -0
- package/playground/ios/MobileHeroDesignPlayground/noop-file.swift +4 -0
- package/playground/ios/MobileHeroDesignPlayground.xcodeproj/project.pbxproj +515 -0
- package/playground/ios/MobileHeroDesignPlayground.xcodeproj/xcshareddata/xcschemes/MobileHeroDesignPlayground.xcscheme +88 -0
- package/playground/ios/MobileHeroDesignPlayground.xcworkspace/contents.xcworkspacedata +10 -0
- package/playground/ios/MobileHeroDesignPlayground.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/playground/ios/Podfile +49 -0
- package/playground/ios/Podfile.lock +478 -0
- package/playground/ios/Podfile.properties.json +3 -0
- package/{metro.config.js → playground/metro.config.js} +10 -2
- package/playground/package.json +63 -0
- package/playground/src/Alert.tsx +80 -0
- package/playground/{index.tsx → src/App.tsx} +69 -29
- package/playground/{components → src}/Avatar.tsx +1 -1
- package/playground/{components → src}/Badge.tsx +1 -1
- package/playground/{components → src}/BottomNavigation.tsx +1 -1
- package/playground/src/BottomSheet.tsx +43 -0
- package/playground/{components → src}/Button.tsx +1 -1
- package/playground/{components → src}/Card.tsx +1 -1
- package/playground/{components → src}/Collapse.tsx +1 -1
- package/playground/src/ContentNavigator.tsx +58 -0
- package/playground/{components → src}/Divider.tsx +1 -1
- package/playground/{components → src}/Drawer.tsx +1 -1
- package/playground/{components → src}/FAB.tsx +1 -1
- package/playground/{components → src}/Icon.tsx +7 -3
- package/playground/{components → src}/IconButton.tsx +12 -1
- package/playground/src/MultipleThemes.tsx +34 -0
- package/playground/{components → src}/Progress.tsx +1 -1
- package/playground/src/Radio.tsx +25 -0
- package/playground/src/SectionHeading.tsx +68 -0
- package/playground/src/Select.tsx +32 -0
- package/playground/src/Spinner.tsx +19 -0
- package/playground/src/Switch.tsx +80 -0
- package/playground/{components → src}/Tabs.tsx +1 -1
- package/playground/{components → src}/Tag.tsx +1 -1
- package/playground/src/TextInput.tsx +14 -0
- package/playground/{components → src}/Typography.tsx +1 -1
- package/playground/src/emotion.d.ts +7 -0
- package/playground/tsconfig.json +21 -0
- package/src/components/Alert/StyledAlert.tsx +48 -0
- package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +686 -0
- package/src/components/Alert/__tests__/index.spec.tsx +83 -0
- package/src/components/Alert/index.tsx +109 -0
- package/src/components/BottomSheet/Footer.tsx +19 -0
- package/src/components/BottomSheet/Header.tsx +49 -0
- package/src/components/BottomSheet/StyledBottomSheet.tsx +75 -0
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +531 -0
- package/src/components/BottomSheet/__tests__/index.spec.tsx +107 -0
- package/src/components/BottomSheet/index.tsx +177 -0
- package/src/components/Button/IconButton.tsx +11 -1
- package/src/components/Collapse/StyledCollapse.tsx +11 -2
- package/src/components/Collapse/__tests__/__snapshots__/index.spec.tsx.snap +36 -31
- package/src/components/Collapse/__tests__/index.spec.tsx +1 -13
- package/src/components/Collapse/index.tsx +20 -50
- package/src/components/ContentNavigator/StyledContentNavigator.tsx +15 -0
- package/src/components/ContentNavigator/__tests__/StyledContentNavigator.spec.tsx +19 -0
- package/src/components/ContentNavigator/__tests__/__snapshots__/StyledContentNavigator.spec.tsx.snap +43 -0
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +217 -0
- package/src/components/ContentNavigator/__tests__/index.spec.tsx +74 -0
- package/src/components/ContentNavigator/index.tsx +65 -0
- package/src/components/Icon/HeroIcon/index.tsx +13 -2
- package/src/components/Icon/HeroIcon/selection.json +1 -1
- package/src/components/Icon/IconList.ts +8 -0
- package/src/components/Icon/index.tsx +8 -1
- package/src/components/Radio/Radio.tsx +51 -0
- package/src/components/Radio/RadioGroup.tsx +74 -0
- package/src/components/Radio/StyledRadio.tsx +42 -0
- package/src/components/Radio/__tests__/Radio.spec.tsx +38 -0
- package/src/components/Radio/__tests__/RadioGroup.spec.tsx +36 -0
- package/src/components/Radio/__tests__/StyledRadio.spec.tsx +43 -0
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +160 -0
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +248 -0
- package/src/components/Radio/__tests__/__snapshots__/StyledRadio.spec.tsx.snap +124 -0
- package/src/components/Radio/index.tsx +5 -0
- package/src/components/Radio/types.ts +1 -0
- package/src/components/SectionHeading/StyledHeading.tsx +24 -0
- package/src/components/SectionHeading/__tests__/StyledHeading.spec.tsx +28 -0
- package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +48 -0
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +208 -0
- package/src/components/SectionHeading/__tests__/index.spec.tsx +39 -0
- package/src/components/SectionHeading/index.tsx +93 -0
- package/src/components/Select/MultiSelect/Footer.tsx +15 -0
- package/src/components/Select/MultiSelect/OptionList.tsx +76 -0
- package/src/components/Select/MultiSelect/StyledMultiSelect.tsx +30 -0
- package/src/components/Select/MultiSelect/__tests__/StyledMultiSelect.spec.tsx +49 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/StyledMultiSelect.spec.tsx.snap +108 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +1630 -0
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +94 -0
- package/src/components/Select/MultiSelect/index.tsx +103 -0
- package/src/components/Select/MultiSelect/types.ts +1 -0
- package/src/components/Select/index.tsx +5 -0
- package/src/components/Spinner/AnimatedSpinner.tsx +55 -0
- package/src/components/Spinner/StyledSpinner.tsx +59 -0
- package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +11 -0
- package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +56 -0
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +118 -0
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +235 -0
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +141 -0
- package/src/components/Spinner/__tests__/index.spec.tsx +12 -0
- package/src/components/Spinner/index.tsx +22 -0
- package/src/components/Switch/StyledSwitch.tsx +50 -0
- package/src/components/Switch/__tests__/StyledHeading.spec.tsx +42 -0
- package/src/components/Switch/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +74 -0
- package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +129 -0
- package/src/components/Switch/__tests__/index.spec.tsx +24 -0
- package/src/components/Switch/index.tsx +87 -0
- package/src/components/TextInput/StyledTextInput.tsx +30 -0
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +27 -0
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +67 -0
- package/src/components/TextInput/__tests__/index.spec.tsx +17 -0
- package/src/components/TextInput/index.tsx +74 -0
- package/src/index.ts +18 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +174 -0
- package/src/theme/components/alert.ts +32 -0
- package/src/theme/components/bottomSheet.ts +34 -0
- package/src/theme/components/contentNavigator.ts +11 -0
- package/src/theme/components/icon.ts +1 -0
- package/src/theme/components/radio.ts +34 -0
- package/src/theme/components/sectionHeading.ts +18 -0
- package/src/theme/components/select.ts +23 -0
- package/src/theme/components/spinner.ts +21 -0
- package/src/theme/components/switch.ts +50 -0
- package/src/theme/components/textInput.ts +32 -0
- package/src/theme/global/borders.ts +6 -0
- package/src/theme/global/colors.ts +3 -0
- package/src/theme/index.ts +34 -7
- package/tsconfig.json +11 -3
- package/types/components/Alert/StyledAlert.d.ts +37 -0
- package/types/{src/components/Avatar → components/Alert}/__tests__/index.spec.d.ts +0 -0
- package/types/components/Alert/index.d.ts +42 -0
- package/types/{src/components → components}/Avatar/StyledAvatar.d.ts +0 -1
- package/types/{src/components → components}/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -0
- package/types/{src/components/BottomNavigation → components/Avatar}/__tests__/index.spec.d.ts +0 -0
- package/types/{src/components → components}/Avatar/index.d.ts +0 -0
- package/types/{src/components → components}/Badge/Status.d.ts +0 -0
- package/types/{src/components → components}/Badge/StyledBadge.d.ts +0 -1
- package/types/{src/components → components}/Badge/__tests__/Badge.spec.d.ts +0 -0
- package/types/{src/components → components}/Badge/__tests__/Status.spec.d.ts +0 -0
- package/types/{src/components → components}/Badge/index.d.ts +0 -0
- package/types/{src/components → components}/BottomNavigation/StyledBottomNavigation.d.ts +0 -1
- package/types/{src/components/Button/LoadingIndicator → components/BottomNavigation}/__tests__/index.spec.d.ts +0 -0
- package/types/{src/components → components}/BottomNavigation/index.d.ts +0 -0
- package/types/components/BottomSheet/Footer.d.ts +6 -0
- package/types/components/BottomSheet/Header.d.ts +8 -0
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +46 -0
- package/types/{src/components/Button → components/BottomSheet}/__tests__/index.spec.d.ts +0 -0
- package/types/components/BottomSheet/index.d.ts +55 -0
- package/types/{src/components → components}/Button/Button.d.ts +0 -0
- package/types/{src/components → components}/Button/IconButton.d.ts +5 -1
- package/types/{src/components → components}/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -1
- package/types/{src/components → components}/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +0 -0
- package/types/{src/components/Card → components/Button/LoadingIndicator}/__tests__/index.spec.d.ts +0 -0
- package/types/{src/components → components}/Button/LoadingIndicator/index.d.ts +0 -0
- package/types/{src/components → components}/Button/StyledButton.d.ts +0 -1
- package/types/{src/components → components}/Button/__tests__/Button.spec.d.ts +0 -0
- package/types/{src/components → components}/Button/__tests__/IconButton.spec.d.ts +0 -0
- package/types/{src/components → components}/Button/__tests__/StyledButton.spec.d.ts +0 -0
- package/types/{src/components → components}/Button/index.d.ts +0 -0
- package/types/{src/components → components}/Card/StyledCard.d.ts +0 -1
- package/types/{src/components → components}/Card/__tests__/StyledCard.spec.d.ts +0 -0
- package/types/{src/components/Collapse → components/Card}/__tests__/index.spec.d.ts +0 -0
- package/types/{src/components → components}/Card/index.d.ts +0 -0
- package/types/{src/components → components}/Collapse/StyledCollapse.d.ts +12 -2
- package/types/{src/components → components}/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -0
- package/types/{src/components/Drawer → components/Collapse}/__tests__/index.spec.d.ts +0 -0
- package/types/{src/components → components}/Collapse/index.d.ts +1 -5
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +12 -0
- package/types/{src/components/Divider/__tests__/StyledDivider.spec.d.ts → components/ContentNavigator/__tests__/StyledContentNavigator.spec.d.ts} +0 -0
- package/types/{src/components/FAB → components/ContentNavigator}/__tests__/index.spec.d.ts +0 -0
- package/types/components/ContentNavigator/index.d.ts +33 -0
- package/types/{src/components → components}/Divider/StyledDivider.d.ts +0 -1
- package/types/{src/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts → components/Divider/__tests__/StyledDivider.spec.d.ts} +0 -0
- package/types/{src/components → components}/Divider/index.d.ts +0 -0
- package/types/{src/components → components}/Drawer/StyledDrawer.d.ts +0 -1
- package/types/{src/components/Icon → components/Drawer}/__tests__/index.spec.d.ts +0 -0
- package/types/{src/components → components}/Drawer/index.d.ts +0 -0
- package/types/{src/components → components}/FAB/ActionGroup/ActionItem.d.ts +0 -0
- package/types/{src/components → components}/FAB/ActionGroup/StyledActionGroup.d.ts +0 -1
- package/types/{src/components → components}/FAB/ActionGroup/StyledActionItem.d.ts +0 -1
- package/types/{src/components → components}/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -0
- package/types/{src/components → components}/FAB/ActionGroup/index.d.ts +0 -0
- package/types/{src/components → components}/FAB/AnimatedFABIcon.d.ts +0 -0
- package/types/{src/components → components}/FAB/FAB.d.ts +0 -0
- package/types/{src/components → components}/FAB/StyledFAB.d.ts +0 -1
- package/types/{src/components/FAB/__tests__/StyledFAB.spec.d.ts → components/FAB/__tests__/AnimatedFABIcon.spec.d.ts} +0 -0
- package/types/{src/components/Progress/__tests__/index.spec.d.ts → components/FAB/__tests__/StyledFAB.spec.d.ts} +0 -0
- package/types/{src/components/Tabs → components/FAB}/__tests__/index.spec.d.ts +0 -0
- package/types/{src/components → components}/FAB/index.d.ts +0 -0
- package/types/{src/components → components}/Icon/HeroIcon/index.d.ts +1 -2
- package/types/components/Icon/IconList.d.ts +2 -0
- package/types/{src/components/Typography/Text → components/Icon}/__tests__/index.spec.d.ts +0 -0
- package/types/{src/components → components}/Icon/index.d.ts +1 -1
- package/types/components/Icon/utils.d.ts +2 -0
- package/types/{src/components → components}/Progress/ProgressBar.d.ts +0 -0
- package/types/{src/components → components}/Progress/ProgressCircle.d.ts +0 -0
- package/types/{src/components → components}/Progress/StyledProgressBar.d.ts +0 -1
- package/types/{src/components → components}/Progress/StyledProgressCircle.d.ts +0 -1
- package/types/{src/theme → components/Progress}/__tests__/index.spec.d.ts +0 -0
- package/types/{src/components → components}/Progress/index.d.ts +0 -0
- package/types/{src/components → components}/Progress/types.d.ts +0 -0
- package/types/components/Radio/Radio.d.ts +26 -0
- package/types/components/Radio/RadioGroup.d.ts +32 -0
- package/types/components/Radio/StyledRadio.d.ts +30 -0
- package/types/{src/components/Tabs/__tests__/ScrollableTab.spec.d.ts → components/Radio/__tests__/Radio.spec.d.ts} +0 -0
- package/types/{src/components/Tabs/__tests__/ScrollableTabs.spec.d.ts → components/Radio/__tests__/RadioGroup.spec.d.ts} +0 -0
- package/types/{src/components/Tag/__tests__/Tag.spec.d.ts → components/Radio/__tests__/StyledRadio.spec.d.ts} +0 -0
- package/types/components/Radio/index.d.ts +4 -0
- package/types/components/Radio/types.d.ts +5 -0
- package/types/components/SectionHeading/StyledHeading.d.ts +20 -0
- package/types/{src/components/Typography/Text/__tests__/StyledText.spec.d.ts → components/SectionHeading/__tests__/StyledHeading.spec.d.ts} +0 -0
- package/types/{src/utils/__tests__/scale.spec.d.ts → components/SectionHeading/__tests__/index.spec.d.ts} +0 -0
- package/types/components/SectionHeading/index.d.ts +39 -0
- package/types/components/Select/MultiSelect/Footer.d.ts +5 -0
- package/types/components/Select/MultiSelect/OptionList.d.ts +3 -0
- package/types/components/Select/MultiSelect/StyledMultiSelect.d.ts +26 -0
- package/types/components/Select/MultiSelect/__tests__/StyledMultiSelect.spec.d.ts +1 -0
- package/types/components/Select/MultiSelect/__tests__/index.spec.d.ts +1 -0
- package/types/components/Select/MultiSelect/index.d.ts +39 -0
- package/types/components/Select/MultiSelect/types.d.ts +5 -0
- package/types/components/Select/index.d.ts +5 -0
- package/types/components/Spinner/AnimatedSpinner.d.ts +2 -0
- package/types/components/Spinner/StyledSpinner.d.ts +30 -0
- package/types/components/Spinner/__tests__/AnimatedSpinner.spec.d.ts +1 -0
- package/types/components/Spinner/__tests__/StyledSpinner.spec.d.ts +1 -0
- package/types/components/Spinner/__tests__/index.spec.d.ts +1 -0
- package/types/components/Spinner/index.d.ts +10 -0
- package/types/components/Switch/StyledSwitch.d.ts +36 -0
- package/types/components/Switch/__tests__/StyledHeading.spec.d.ts +1 -0
- package/types/components/Switch/__tests__/index.spec.d.ts +1 -0
- package/types/components/Switch/index.d.ts +30 -0
- package/types/{src/components → components}/Tabs/ActiveTabIndicator.d.ts +0 -0
- package/types/{src/components → components}/Tabs/ScrollableTabs.d.ts +0 -0
- package/types/{src/components → components}/Tabs/StyledScrollableTabs.d.ts +0 -1
- package/types/{src/components → components}/Tabs/StyledTabs.d.ts +0 -1
- package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +1 -0
- package/types/components/Tabs/__tests__/index.spec.d.ts +1 -0
- package/types/{src/components → components}/Tabs/index.d.ts +0 -0
- package/types/{src/components → components}/Tabs/utils.d.ts +0 -0
- package/types/{src/components → components}/Tag/StyledTag.d.ts +0 -1
- package/types/components/Tag/__tests__/Tag.spec.d.ts +1 -0
- package/types/{src/components → components}/Tag/index.d.ts +0 -0
- package/types/components/TextInput/StyledTextInput.d.ts +18 -0
- package/types/components/TextInput/__tests__/StyledTextInput.spec.d.ts +1 -0
- package/types/components/TextInput/__tests__/index.spec.d.ts +1 -0
- package/types/components/TextInput/index.d.ts +34 -0
- package/types/{src/components → components}/Typography/Text/StyledText.d.ts +0 -1
- package/types/components/Typography/Text/__tests__/StyledText.spec.d.ts +1 -0
- package/types/components/Typography/Text/__tests__/index.spec.d.ts +1 -0
- package/types/{src/components → components}/Typography/Text/index.d.ts +0 -0
- package/types/{src/components → components}/Typography/index.d.ts +0 -0
- package/types/{src/index.d.ts → index.d.ts} +10 -1
- package/types/{src/testHelpers → testHelpers}/renderWithTheme.d.ts +0 -0
- package/types/theme/__tests__/index.spec.d.ts +1 -0
- package/types/theme/components/alert.d.ts +23 -0
- package/types/{src/theme → theme}/components/avatar.d.ts +0 -0
- package/types/{src/theme → theme}/components/badge.d.ts +0 -0
- package/types/{src/theme → theme}/components/bottomNavigation.d.ts +0 -0
- package/types/theme/components/bottomSheet.d.ts +29 -0
- package/types/{src/theme → theme}/components/button.d.ts +0 -0
- package/types/{src/theme → theme}/components/card.d.ts +0 -0
- package/types/theme/components/contentNavigator.d.ts +7 -0
- package/types/{src/theme → theme}/components/divider.d.ts +0 -0
- package/types/{src/theme → theme}/components/drawer.d.ts +0 -0
- package/types/{src/theme → theme}/components/fab.d.ts +0 -0
- package/types/{src/theme → theme}/components/icon.d.ts +1 -0
- package/types/{src/theme → theme}/components/progress.d.ts +0 -0
- package/types/theme/components/radio.d.ts +25 -0
- package/types/theme/components/sectionHeading.d.ts +13 -0
- package/types/theme/components/select.d.ts +17 -0
- package/types/theme/components/spinner.d.ts +15 -0
- package/types/theme/components/switch.d.ts +32 -0
- package/types/{src/theme → theme}/components/tabs.d.ts +0 -0
- package/types/{src/theme → theme}/components/tag.d.ts +0 -0
- package/types/theme/components/textInput.d.ts +24 -0
- package/types/{src/theme → theme}/components/typography.d.ts +0 -0
- package/types/{src/theme → theme}/global/borders.d.ts +3 -0
- package/types/{src/theme → theme}/global/colors.d.ts +3 -0
- package/types/{src/theme → theme}/global/index.d.ts +3 -0
- package/types/{src/theme → theme}/global/scale.d.ts +0 -0
- package/types/{src/theme → theme}/global/space.d.ts +0 -0
- package/types/{src/theme → theme}/global/typography.d.ts +0 -0
- package/types/{src/theme → theme}/index.d.ts +23 -5
- package/types/{src/types.d.ts → types.d.ts} +0 -0
- package/types/utils/__tests__/scale.spec.d.ts +1 -0
- package/types/{src/utils → utils}/helpers.d.ts +0 -0
- package/types/{src/utils → utils}/hooks.d.ts +0 -0
- package/types/{src/utils → utils}/scale.d.ts +0 -0
- package/app.json +0 -8
- package/types/playground/components/Avatar.d.ts +0 -2
- package/types/playground/components/Badge.d.ts +0 -2
- package/types/playground/components/BottomNavigation.d.ts +0 -2
- package/types/playground/components/Button.d.ts +0 -2
- package/types/playground/components/Card.d.ts +0 -2
- package/types/playground/components/Collapse.d.ts +0 -2
- package/types/playground/components/Divider.d.ts +0 -2
- package/types/playground/components/Drawer.d.ts +0 -2
- package/types/playground/components/FAB.d.ts +0 -2
- package/types/playground/components/Icon.d.ts +0 -2
- package/types/playground/components/IconButton.d.ts +0 -2
- package/types/playground/components/Progress.d.ts +0 -2
- package/types/playground/components/Tabs.d.ts +0 -2
- package/types/playground/components/Tag.d.ts +0 -2
- package/types/playground/components/Typography.d.ts +0 -2
- package/types/playground/index.d.ts +0 -2
- package/types/src/components/Icon/IconList.d.ts +0 -2
- package/types/src/components/Icon/utils.d.ts +0 -2
- package/types/src/components/Tabs/ScrollableTab.d.ts +0 -3
- package/types/src/components/Tabs/StyledScrollableTab.d.ts +0 -61
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`BottomSheet renders correctly with close state 1`] = `
|
|
4
|
+
<Modal
|
|
5
|
+
hardwareAccelerated={false}
|
|
6
|
+
onRequestClose={[MockFunction]}
|
|
7
|
+
transparent={true}
|
|
8
|
+
visible={false}
|
|
9
|
+
>
|
|
10
|
+
<View
|
|
11
|
+
pointerEvents="box-none"
|
|
12
|
+
style={
|
|
13
|
+
Array [
|
|
14
|
+
Object {
|
|
15
|
+
"bottom": 0,
|
|
16
|
+
"flexDirection": "column-reverse",
|
|
17
|
+
"left": 0,
|
|
18
|
+
"position": "absolute",
|
|
19
|
+
"right": 0,
|
|
20
|
+
"top": 0,
|
|
21
|
+
},
|
|
22
|
+
undefined,
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
>
|
|
26
|
+
<View
|
|
27
|
+
accessible={true}
|
|
28
|
+
collapsable={false}
|
|
29
|
+
focusable={true}
|
|
30
|
+
nativeID="animatedComponent"
|
|
31
|
+
onBlur={[Function]}
|
|
32
|
+
onClick={[Function]}
|
|
33
|
+
onFocus={[Function]}
|
|
34
|
+
onResponderGrant={[Function]}
|
|
35
|
+
onResponderMove={[Function]}
|
|
36
|
+
onResponderRelease={[Function]}
|
|
37
|
+
onResponderTerminate={[Function]}
|
|
38
|
+
onResponderTerminationRequest={[Function]}
|
|
39
|
+
onStartShouldSetResponder={[Function]}
|
|
40
|
+
style={
|
|
41
|
+
Object {
|
|
42
|
+
"backgroundColor": "#292a2b",
|
|
43
|
+
"bottom": 0,
|
|
44
|
+
"left": 0,
|
|
45
|
+
"opacity": 0.48,
|
|
46
|
+
"position": "absolute",
|
|
47
|
+
"right": 0,
|
|
48
|
+
"top": 0,
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
<View
|
|
53
|
+
collapsable={false}
|
|
54
|
+
nativeID="animatedComponent"
|
|
55
|
+
onLayout={[Function]}
|
|
56
|
+
style={
|
|
57
|
+
Object {
|
|
58
|
+
"backgroundColor": "#ffffff",
|
|
59
|
+
"borderTopLeftRadius": 16,
|
|
60
|
+
"borderTopRightRadius": 16,
|
|
61
|
+
"elevation": 10,
|
|
62
|
+
"maxHeight": "94%",
|
|
63
|
+
"shadowColor": "#292a2b",
|
|
64
|
+
"shadowOffset": Object {
|
|
65
|
+
"height": 3,
|
|
66
|
+
"width": 0,
|
|
67
|
+
},
|
|
68
|
+
"shadowOpacity": 0.27,
|
|
69
|
+
"shadowRadius": 4.65,
|
|
70
|
+
"transform": Array [
|
|
71
|
+
Object {
|
|
72
|
+
"scaleY": 0,
|
|
73
|
+
},
|
|
74
|
+
Object {
|
|
75
|
+
"translateY": 0,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
"width": "100%",
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
>
|
|
82
|
+
<View
|
|
83
|
+
style={
|
|
84
|
+
Array [
|
|
85
|
+
Object {
|
|
86
|
+
"flexDirection": "row",
|
|
87
|
+
"minHeight": 64,
|
|
88
|
+
},
|
|
89
|
+
undefined,
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
>
|
|
93
|
+
<View
|
|
94
|
+
adjacentIcon={true}
|
|
95
|
+
style={
|
|
96
|
+
Array [
|
|
97
|
+
Object {
|
|
98
|
+
"flex": 1,
|
|
99
|
+
"justifyContent": "center",
|
|
100
|
+
"paddingLeft": 24,
|
|
101
|
+
"paddingRight": 0,
|
|
102
|
+
"paddingVertical": 8,
|
|
103
|
+
},
|
|
104
|
+
undefined,
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
>
|
|
108
|
+
<Text
|
|
109
|
+
style={
|
|
110
|
+
Array [
|
|
111
|
+
Object {
|
|
112
|
+
"color": "#292a2b",
|
|
113
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
114
|
+
"fontSize": 16,
|
|
115
|
+
"letterSpacing": 0.48,
|
|
116
|
+
"lineHeight": 24,
|
|
117
|
+
},
|
|
118
|
+
undefined,
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
themeFontSize="large"
|
|
122
|
+
themeFontWeight="semi-bold"
|
|
123
|
+
themeIntent="body"
|
|
124
|
+
>
|
|
125
|
+
Title
|
|
126
|
+
</Text>
|
|
127
|
+
</View>
|
|
128
|
+
<View
|
|
129
|
+
style={
|
|
130
|
+
Array [
|
|
131
|
+
Object {
|
|
132
|
+
"alignItems": "center",
|
|
133
|
+
"justifyContent": "center",
|
|
134
|
+
"width": 72,
|
|
135
|
+
},
|
|
136
|
+
undefined,
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
>
|
|
140
|
+
<View
|
|
141
|
+
accessible={true}
|
|
142
|
+
collapsable={false}
|
|
143
|
+
focusable={true}
|
|
144
|
+
nativeID="animatedComponent"
|
|
145
|
+
onClick={[Function]}
|
|
146
|
+
onResponderGrant={[Function]}
|
|
147
|
+
onResponderMove={[Function]}
|
|
148
|
+
onResponderRelease={[Function]}
|
|
149
|
+
onResponderTerminate={[Function]}
|
|
150
|
+
onResponderTerminationRequest={[Function]}
|
|
151
|
+
onStartShouldSetResponder={[Function]}
|
|
152
|
+
style={
|
|
153
|
+
Object {
|
|
154
|
+
"opacity": 1,
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
testID="bottom-sheet-close-icon"
|
|
158
|
+
>
|
|
159
|
+
<HeroIcon
|
|
160
|
+
name="cancel"
|
|
161
|
+
style={
|
|
162
|
+
Array [
|
|
163
|
+
Object {
|
|
164
|
+
"color": "#292a2b",
|
|
165
|
+
"fontSize": 24,
|
|
166
|
+
},
|
|
167
|
+
undefined,
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
themeIntent="text"
|
|
171
|
+
themeSize="medium"
|
|
172
|
+
/>
|
|
173
|
+
</View>
|
|
174
|
+
</View>
|
|
175
|
+
</View>
|
|
176
|
+
<View
|
|
177
|
+
style={
|
|
178
|
+
Array [
|
|
179
|
+
Object {
|
|
180
|
+
"borderBottomColor": "#dadbde",
|
|
181
|
+
"borderBottomWidth": 1,
|
|
182
|
+
"maxWidth": "100%",
|
|
183
|
+
},
|
|
184
|
+
undefined,
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
/>
|
|
188
|
+
<Text>
|
|
189
|
+
Content
|
|
190
|
+
</Text>
|
|
191
|
+
<View>
|
|
192
|
+
<View
|
|
193
|
+
style={
|
|
194
|
+
Array [
|
|
195
|
+
Object {
|
|
196
|
+
"borderBottomColor": "#dadbde",
|
|
197
|
+
"borderBottomWidth": 1,
|
|
198
|
+
"maxWidth": "100%",
|
|
199
|
+
},
|
|
200
|
+
undefined,
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
/>
|
|
204
|
+
<View
|
|
205
|
+
style={
|
|
206
|
+
Array [
|
|
207
|
+
Object {
|
|
208
|
+
"alignItems": "center",
|
|
209
|
+
"flexDirection": "row",
|
|
210
|
+
"justifyContent": "flex-end",
|
|
211
|
+
"minHeight": 64,
|
|
212
|
+
"paddingHorizontal": 24,
|
|
213
|
+
"paddingVertical": 8,
|
|
214
|
+
},
|
|
215
|
+
undefined,
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
>
|
|
219
|
+
<View
|
|
220
|
+
accessibilityRole="button"
|
|
221
|
+
accessible={true}
|
|
222
|
+
collapsable={false}
|
|
223
|
+
focusable={false}
|
|
224
|
+
nativeID="animatedComponent"
|
|
225
|
+
onClick={[Function]}
|
|
226
|
+
onResponderGrant={[Function]}
|
|
227
|
+
onResponderMove={[Function]}
|
|
228
|
+
onResponderRelease={[Function]}
|
|
229
|
+
onResponderTerminate={[Function]}
|
|
230
|
+
onResponderTerminationRequest={[Function]}
|
|
231
|
+
onStartShouldSetResponder={[Function]}
|
|
232
|
+
style={
|
|
233
|
+
Object {
|
|
234
|
+
"opacity": 1,
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
>
|
|
238
|
+
<View
|
|
239
|
+
style={
|
|
240
|
+
Array [
|
|
241
|
+
Object {},
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
>
|
|
245
|
+
<Text
|
|
246
|
+
style={
|
|
247
|
+
Array [
|
|
248
|
+
Object {
|
|
249
|
+
"color": "#007AFF",
|
|
250
|
+
"fontSize": 18,
|
|
251
|
+
"margin": 8,
|
|
252
|
+
"textAlign": "center",
|
|
253
|
+
},
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
>
|
|
257
|
+
Footer CTA
|
|
258
|
+
</Text>
|
|
259
|
+
</View>
|
|
260
|
+
</View>
|
|
261
|
+
</View>
|
|
262
|
+
</View>
|
|
263
|
+
</View>
|
|
264
|
+
</View>
|
|
265
|
+
</Modal>
|
|
266
|
+
`;
|
|
267
|
+
|
|
268
|
+
exports[`BottomSheet renders correctly with open state 1`] = `
|
|
269
|
+
<Modal
|
|
270
|
+
hardwareAccelerated={false}
|
|
271
|
+
onRequestClose={[MockFunction]}
|
|
272
|
+
transparent={true}
|
|
273
|
+
visible={true}
|
|
274
|
+
>
|
|
275
|
+
<View
|
|
276
|
+
pointerEvents="box-none"
|
|
277
|
+
style={
|
|
278
|
+
Array [
|
|
279
|
+
Object {
|
|
280
|
+
"bottom": 0,
|
|
281
|
+
"flexDirection": "column-reverse",
|
|
282
|
+
"left": 0,
|
|
283
|
+
"position": "absolute",
|
|
284
|
+
"right": 0,
|
|
285
|
+
"top": 0,
|
|
286
|
+
},
|
|
287
|
+
undefined,
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
>
|
|
291
|
+
<View
|
|
292
|
+
accessible={true}
|
|
293
|
+
collapsable={false}
|
|
294
|
+
focusable={true}
|
|
295
|
+
nativeID="animatedComponent"
|
|
296
|
+
onBlur={[Function]}
|
|
297
|
+
onClick={[Function]}
|
|
298
|
+
onFocus={[Function]}
|
|
299
|
+
onResponderGrant={[Function]}
|
|
300
|
+
onResponderMove={[Function]}
|
|
301
|
+
onResponderRelease={[Function]}
|
|
302
|
+
onResponderTerminate={[Function]}
|
|
303
|
+
onResponderTerminationRequest={[Function]}
|
|
304
|
+
onStartShouldSetResponder={[Function]}
|
|
305
|
+
style={
|
|
306
|
+
Object {
|
|
307
|
+
"backgroundColor": "#292a2b",
|
|
308
|
+
"bottom": 0,
|
|
309
|
+
"left": 0,
|
|
310
|
+
"opacity": 0,
|
|
311
|
+
"position": "absolute",
|
|
312
|
+
"right": 0,
|
|
313
|
+
"top": 0,
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/>
|
|
317
|
+
<View
|
|
318
|
+
collapsable={false}
|
|
319
|
+
nativeID="animatedComponent"
|
|
320
|
+
onLayout={[Function]}
|
|
321
|
+
style={
|
|
322
|
+
Object {
|
|
323
|
+
"backgroundColor": "#ffffff",
|
|
324
|
+
"borderTopLeftRadius": 16,
|
|
325
|
+
"borderTopRightRadius": 16,
|
|
326
|
+
"elevation": 10,
|
|
327
|
+
"maxHeight": "94%",
|
|
328
|
+
"shadowColor": "#292a2b",
|
|
329
|
+
"shadowOffset": Object {
|
|
330
|
+
"height": 3,
|
|
331
|
+
"width": 0,
|
|
332
|
+
},
|
|
333
|
+
"shadowOpacity": 0.27,
|
|
334
|
+
"shadowRadius": 4.65,
|
|
335
|
+
"transform": Array [
|
|
336
|
+
Object {
|
|
337
|
+
"scaleY": 0,
|
|
338
|
+
},
|
|
339
|
+
Object {
|
|
340
|
+
"translateY": 0,
|
|
341
|
+
},
|
|
342
|
+
],
|
|
343
|
+
"width": "100%",
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
>
|
|
347
|
+
<View
|
|
348
|
+
style={
|
|
349
|
+
Array [
|
|
350
|
+
Object {
|
|
351
|
+
"flexDirection": "row",
|
|
352
|
+
"minHeight": 64,
|
|
353
|
+
},
|
|
354
|
+
undefined,
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
>
|
|
358
|
+
<View
|
|
359
|
+
adjacentIcon={true}
|
|
360
|
+
style={
|
|
361
|
+
Array [
|
|
362
|
+
Object {
|
|
363
|
+
"flex": 1,
|
|
364
|
+
"justifyContent": "center",
|
|
365
|
+
"paddingLeft": 24,
|
|
366
|
+
"paddingRight": 0,
|
|
367
|
+
"paddingVertical": 8,
|
|
368
|
+
},
|
|
369
|
+
undefined,
|
|
370
|
+
]
|
|
371
|
+
}
|
|
372
|
+
>
|
|
373
|
+
<Text
|
|
374
|
+
style={
|
|
375
|
+
Array [
|
|
376
|
+
Object {
|
|
377
|
+
"color": "#292a2b",
|
|
378
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
379
|
+
"fontSize": 16,
|
|
380
|
+
"letterSpacing": 0.48,
|
|
381
|
+
"lineHeight": 24,
|
|
382
|
+
},
|
|
383
|
+
undefined,
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
themeFontSize="large"
|
|
387
|
+
themeFontWeight="semi-bold"
|
|
388
|
+
themeIntent="body"
|
|
389
|
+
>
|
|
390
|
+
Title
|
|
391
|
+
</Text>
|
|
392
|
+
</View>
|
|
393
|
+
<View
|
|
394
|
+
style={
|
|
395
|
+
Array [
|
|
396
|
+
Object {
|
|
397
|
+
"alignItems": "center",
|
|
398
|
+
"justifyContent": "center",
|
|
399
|
+
"width": 72,
|
|
400
|
+
},
|
|
401
|
+
undefined,
|
|
402
|
+
]
|
|
403
|
+
}
|
|
404
|
+
>
|
|
405
|
+
<View
|
|
406
|
+
accessible={true}
|
|
407
|
+
collapsable={false}
|
|
408
|
+
focusable={true}
|
|
409
|
+
nativeID="animatedComponent"
|
|
410
|
+
onClick={[Function]}
|
|
411
|
+
onResponderGrant={[Function]}
|
|
412
|
+
onResponderMove={[Function]}
|
|
413
|
+
onResponderRelease={[Function]}
|
|
414
|
+
onResponderTerminate={[Function]}
|
|
415
|
+
onResponderTerminationRequest={[Function]}
|
|
416
|
+
onStartShouldSetResponder={[Function]}
|
|
417
|
+
style={
|
|
418
|
+
Object {
|
|
419
|
+
"opacity": 1,
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
testID="bottom-sheet-close-icon"
|
|
423
|
+
>
|
|
424
|
+
<HeroIcon
|
|
425
|
+
name="cancel"
|
|
426
|
+
style={
|
|
427
|
+
Array [
|
|
428
|
+
Object {
|
|
429
|
+
"color": "#292a2b",
|
|
430
|
+
"fontSize": 24,
|
|
431
|
+
},
|
|
432
|
+
undefined,
|
|
433
|
+
]
|
|
434
|
+
}
|
|
435
|
+
themeIntent="text"
|
|
436
|
+
themeSize="medium"
|
|
437
|
+
/>
|
|
438
|
+
</View>
|
|
439
|
+
</View>
|
|
440
|
+
</View>
|
|
441
|
+
<View
|
|
442
|
+
style={
|
|
443
|
+
Array [
|
|
444
|
+
Object {
|
|
445
|
+
"borderBottomColor": "#dadbde",
|
|
446
|
+
"borderBottomWidth": 1,
|
|
447
|
+
"maxWidth": "100%",
|
|
448
|
+
},
|
|
449
|
+
undefined,
|
|
450
|
+
]
|
|
451
|
+
}
|
|
452
|
+
/>
|
|
453
|
+
<Text>
|
|
454
|
+
Content
|
|
455
|
+
</Text>
|
|
456
|
+
<View>
|
|
457
|
+
<View
|
|
458
|
+
style={
|
|
459
|
+
Array [
|
|
460
|
+
Object {
|
|
461
|
+
"borderBottomColor": "#dadbde",
|
|
462
|
+
"borderBottomWidth": 1,
|
|
463
|
+
"maxWidth": "100%",
|
|
464
|
+
},
|
|
465
|
+
undefined,
|
|
466
|
+
]
|
|
467
|
+
}
|
|
468
|
+
/>
|
|
469
|
+
<View
|
|
470
|
+
style={
|
|
471
|
+
Array [
|
|
472
|
+
Object {
|
|
473
|
+
"alignItems": "center",
|
|
474
|
+
"flexDirection": "row",
|
|
475
|
+
"justifyContent": "flex-end",
|
|
476
|
+
"minHeight": 64,
|
|
477
|
+
"paddingHorizontal": 24,
|
|
478
|
+
"paddingVertical": 8,
|
|
479
|
+
},
|
|
480
|
+
undefined,
|
|
481
|
+
]
|
|
482
|
+
}
|
|
483
|
+
>
|
|
484
|
+
<View
|
|
485
|
+
accessibilityRole="button"
|
|
486
|
+
accessible={true}
|
|
487
|
+
collapsable={false}
|
|
488
|
+
focusable={false}
|
|
489
|
+
nativeID="animatedComponent"
|
|
490
|
+
onClick={[Function]}
|
|
491
|
+
onResponderGrant={[Function]}
|
|
492
|
+
onResponderMove={[Function]}
|
|
493
|
+
onResponderRelease={[Function]}
|
|
494
|
+
onResponderTerminate={[Function]}
|
|
495
|
+
onResponderTerminationRequest={[Function]}
|
|
496
|
+
onStartShouldSetResponder={[Function]}
|
|
497
|
+
style={
|
|
498
|
+
Object {
|
|
499
|
+
"opacity": 1,
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
>
|
|
503
|
+
<View
|
|
504
|
+
style={
|
|
505
|
+
Array [
|
|
506
|
+
Object {},
|
|
507
|
+
]
|
|
508
|
+
}
|
|
509
|
+
>
|
|
510
|
+
<Text
|
|
511
|
+
style={
|
|
512
|
+
Array [
|
|
513
|
+
Object {
|
|
514
|
+
"color": "#007AFF",
|
|
515
|
+
"fontSize": 18,
|
|
516
|
+
"margin": 8,
|
|
517
|
+
"textAlign": "center",
|
|
518
|
+
},
|
|
519
|
+
]
|
|
520
|
+
}
|
|
521
|
+
>
|
|
522
|
+
Footer CTA
|
|
523
|
+
</Text>
|
|
524
|
+
</View>
|
|
525
|
+
</View>
|
|
526
|
+
</View>
|
|
527
|
+
</View>
|
|
528
|
+
</View>
|
|
529
|
+
</View>
|
|
530
|
+
</Modal>
|
|
531
|
+
`;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { fireEvent } from '@testing-library/react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Button, Text } from 'react-native';
|
|
4
|
+
import BottomSheet from '..';
|
|
5
|
+
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
6
|
+
|
|
7
|
+
const Content = () => <Text>Content</Text>;
|
|
8
|
+
|
|
9
|
+
describe('BottomSheet', () => {
|
|
10
|
+
it('renders correctly with open state', () => {
|
|
11
|
+
const { toJSON, getByText } = renderWithTheme(
|
|
12
|
+
<BottomSheet
|
|
13
|
+
open
|
|
14
|
+
header="Title"
|
|
15
|
+
footer={<Button title="Footer CTA" />}
|
|
16
|
+
onRequestClose={jest.fn()}
|
|
17
|
+
>
|
|
18
|
+
<Content />
|
|
19
|
+
</BottomSheet>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
expect(toJSON()).toMatchSnapshot();
|
|
23
|
+
expect(getByText('Title')).toBeDefined();
|
|
24
|
+
expect(getByText('Footer CTA')).toBeDefined();
|
|
25
|
+
expect(getByText('Content')).toBeDefined();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('renders correctly with close state', () => {
|
|
29
|
+
const { toJSON } = renderWithTheme(
|
|
30
|
+
<BottomSheet
|
|
31
|
+
open={false}
|
|
32
|
+
header="Title"
|
|
33
|
+
footer={<Button title="Footer CTA" />}
|
|
34
|
+
onRequestClose={jest.fn()}
|
|
35
|
+
>
|
|
36
|
+
<Content />
|
|
37
|
+
</BottomSheet>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
expect(toJSON()).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe('Header', () => {
|
|
44
|
+
it('renders default header correctly', () => {
|
|
45
|
+
const { getByText } = renderWithTheme(
|
|
46
|
+
<BottomSheet open header="Title">
|
|
47
|
+
<Content />
|
|
48
|
+
</BottomSheet>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
expect(getByText('Title')).toBeDefined();
|
|
52
|
+
expect(getByText('Content')).toBeDefined();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('renders custom header correctly', () => {
|
|
56
|
+
const { getByText } = renderWithTheme(
|
|
57
|
+
<BottomSheet open header={<Text>Custom Title</Text>}>
|
|
58
|
+
<Content />
|
|
59
|
+
</BottomSheet>
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
expect(getByText('Custom Title')).toBeDefined();
|
|
63
|
+
expect(getByText('Content')).toBeDefined();
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('renders header close button correctly', () => {
|
|
67
|
+
const onRequestClose = jest.fn();
|
|
68
|
+
|
|
69
|
+
const { getByText, getByTestId } = renderWithTheme(
|
|
70
|
+
<BottomSheet open header="Title" onRequestClose={onRequestClose}>
|
|
71
|
+
<Content />
|
|
72
|
+
</BottomSheet>
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
expect(getByText('Content')).toBeDefined();
|
|
76
|
+
expect(getByTestId('bottom-sheet-close-icon')).toBeDefined();
|
|
77
|
+
|
|
78
|
+
// Invoke onRequestClose when pressed
|
|
79
|
+
fireEvent.press(getByTestId('bottom-sheet-close-icon'));
|
|
80
|
+
expect(onRequestClose).toBeCalled();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('not render header close button', () => {
|
|
84
|
+
const { getByText, queryByTestId } = renderWithTheme(
|
|
85
|
+
<BottomSheet open header="Title" showCloseButton={false}>
|
|
86
|
+
<Content />
|
|
87
|
+
</BottomSheet>
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
expect(queryByTestId('bottom-sheet-close-icon')).toBeNull();
|
|
91
|
+
expect(getByText('Content')).toBeDefined();
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
describe('Footer', () => {
|
|
96
|
+
it('renders footer correctly', () => {
|
|
97
|
+
const { getByText } = renderWithTheme(
|
|
98
|
+
<BottomSheet open footer={<Button title="Footer Button" />}>
|
|
99
|
+
<Content />
|
|
100
|
+
</BottomSheet>
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
expect(getByText('Footer Button')).toBeDefined();
|
|
104
|
+
expect(getByText('Content')).toBeDefined();
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
});
|