@hero-design/rn 7.4.0 → 7.6.1-alpha
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/.turbo/turbo-build.log +2 -2
- package/.turbo/turbo-build:types.log +1 -1
- package/.turbo/turbo-build:watch.log +1 -0
- package/.turbo/turbo-lint.log +2 -0
- package/.turbo/turbo-type-check.log +2 -7
- package/assets/fonts/hero-icons.ttf +0 -0
- package/{types/src → es}/components/Avatar/StyledAvatar.d.ts +0 -0
- package/{types/src → es}/components/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -0
- package/{types/src → es}/components/Avatar/__tests__/index.spec.d.ts +0 -0
- package/{types/src → es}/components/Avatar/index.d.ts +0 -0
- package/{types/src → es}/components/Badge/Status.d.ts +0 -0
- package/{types/src → es}/components/Badge/StyledBadge.d.ts +0 -0
- package/{types/src → es}/components/Badge/__tests__/Badge.spec.d.ts +0 -0
- package/{types/src → es}/components/Badge/__tests__/Status.spec.d.ts +0 -0
- package/{types/src → es}/components/Badge/index.d.ts +0 -0
- package/{types/src → es}/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
- package/{types/src → es}/components/BottomNavigation/__tests__/index.spec.d.ts +0 -0
- package/{types/src → es}/components/BottomNavigation/index.d.ts +0 -0
- package/{types/src → es}/components/Button/IconButton.d.ts +0 -0
- package/{types/src/components/Button/LoadingIndicator → es/components/Button}/__tests__/index.spec.d.ts +0 -0
- package/es/components/Button/index.d.ts +4 -0
- package/{types/src → es}/components/Card/StyledCard.d.ts +0 -0
- package/{types/src → es}/components/Card/__tests__/StyledCard.spec.d.ts +0 -0
- package/{types/src/components/Button → es/components/Card}/__tests__/index.spec.d.ts +0 -0
- package/{types/src → es}/components/Card/index.d.ts +0 -0
- package/{types/src → es}/components/Collapse/StyledCollapse.d.ts +0 -0
- package/{types/src → es}/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -0
- package/{types/src/components/Card → es/components/Collapse}/__tests__/index.spec.d.ts +0 -0
- package/{types/src → es}/components/Collapse/index.d.ts +0 -0
- package/{types/src → es}/components/Divider/StyledDivider.d.ts +0 -0
- package/{types/src → es}/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -0
- package/{types/src → es}/components/Divider/index.d.ts +0 -0
- package/{types/src → es}/components/Drawer/StyledDrawer.d.ts +0 -0
- package/{types/src/components/Collapse → es/components/Drawer}/__tests__/index.spec.d.ts +0 -0
- package/{types/src → es}/components/Drawer/index.d.ts +0 -0
- package/{types/src → es}/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
- package/{types/src → es}/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
- package/{types/src → es}/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
- package/{types/src → es}/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -0
- package/{types/src → es}/components/FAB/ActionGroup/index.d.ts +0 -0
- package/{types/src → es}/components/FAB/AnimatedFABIcon.d.ts +0 -0
- package/{types/src → es}/components/FAB/FAB.d.ts +0 -0
- package/{types/src → es}/components/FAB/StyledFAB.d.ts +0 -0
- package/{types/src → es}/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -0
- package/{types/src → es}/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -0
- package/{types/src/components/Drawer → es/components/FAB}/__tests__/index.spec.d.ts +0 -0
- package/{types/src → es}/components/FAB/index.d.ts +0 -0
- package/es/components/Icon/HeroIcon/index.d.ts +13 -0
- package/{types/src → es}/components/Icon/IconList.d.ts +0 -0
- package/{types/src/components/FAB → es/components/Icon}/__tests__/index.spec.d.ts +0 -0
- package/{types/src → es}/components/Icon/index.d.ts +0 -0
- package/{types/src → es}/components/Icon/utils.d.ts +1 -1
- package/{types/src → es}/components/Progress/ProgressBar.d.ts +0 -0
- package/{types/src → es}/components/Progress/ProgressCircle.d.ts +0 -0
- package/{types/src → es}/components/Progress/StyledProgressBar.d.ts +0 -0
- package/{types/src → es}/components/Progress/StyledProgressCircle.d.ts +0 -0
- package/{types/src → es}/components/Progress/index.d.ts +0 -0
- package/{types/src → es}/components/Progress/types.d.ts +0 -0
- package/{types/src → es}/components/Tabs/ActiveTabIndicator.d.ts +0 -0
- package/{types/src → es}/components/Tabs/ScrollableTabs.d.ts +0 -0
- package/{types/src → es}/components/Tabs/StyledScrollableTabs.d.ts +0 -0
- package/{types/src → es}/components/Tabs/StyledTabs.d.ts +0 -0
- package/{types/src → es}/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -0
- package/{types/src/components/Icon → es/components/Tabs}/__tests__/index.spec.d.ts +0 -0
- package/{types/src → es}/components/Tabs/index.d.ts +0 -0
- package/{types/src → es}/components/Tabs/utils.d.ts +0 -0
- package/{types/src → es}/components/Tag/StyledTag.d.ts +0 -0
- package/{types/src → es}/components/Tag/__tests__/Tag.spec.d.ts +0 -0
- package/{types/src → es}/components/Tag/index.d.ts +0 -0
- package/{types/src → es}/components/Typography/Text/StyledText.d.ts +0 -0
- package/{types/src → es}/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -0
- package/{types/src/components/Progress → es/components/Typography/Text}/__tests__/index.spec.d.ts +0 -0
- package/{types/src → es}/components/Typography/Text/index.d.ts +0 -0
- package/{types/src → es}/components/Typography/index.d.ts +0 -0
- package/{types/src → es}/index.d.ts +0 -0
- package/es/index.js +1499 -3212
- package/{types/src/components/Tabs → es/theme}/__tests__/index.spec.d.ts +0 -0
- package/{types/src → es}/theme/components/avatar.d.ts +0 -0
- package/{types/src → es}/theme/components/badge.d.ts +0 -0
- package/{types/src → es}/theme/components/bottomNavigation.d.ts +0 -0
- package/{types/src → es}/theme/components/card.d.ts +0 -0
- package/{types/src → es}/theme/components/divider.d.ts +0 -0
- package/{types/src → es}/theme/components/drawer.d.ts +0 -0
- package/{types/src → es}/theme/components/fab.d.ts +0 -0
- package/{types/src → es}/theme/components/icon.d.ts +0 -0
- package/{types/src → es}/theme/components/progress.d.ts +0 -0
- package/{types/src → es}/theme/components/tabs.d.ts +0 -0
- package/{types/src → es}/theme/components/tag.d.ts +0 -0
- package/{types/src → es}/theme/components/typography.d.ts +0 -0
- package/{types/src → es}/theme/global/borders.d.ts +0 -0
- package/{types/src → es}/theme/global/colors.d.ts +1 -3
- package/{types/src → es}/theme/global/index.d.ts +1 -3
- package/{types/src → es}/theme/global/scale.d.ts +0 -0
- package/{types/src → es}/theme/global/space.d.ts +0 -0
- package/{types/src → es}/theme/global/typography.d.ts +0 -0
- package/{types/src → es}/theme/index.d.ts +0 -2
- package/{types/src → es}/types.d.ts +0 -0
- package/{types/src → es}/utils/__tests__/scale.spec.d.ts +0 -0
- package/{types/src → es}/utils/helpers.d.ts +0 -0
- package/{types/src → es}/utils/hooks.d.ts +0 -0
- package/{types/src → es}/utils/scale.d.ts +0 -0
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/components/Avatar/StyledAvatar.d.ts +46 -0
- package/{types/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts → lib/components/Avatar/__tests__/StyledAvatar.spec.d.ts} +0 -0
- package/{types/src/components/Typography/Text → lib/components/Avatar}/__tests__/index.spec.d.ts +0 -0
- package/lib/components/Avatar/index.d.ts +25 -0
- package/lib/components/Badge/Status.d.ts +24 -0
- package/lib/components/Badge/StyledBadge.d.ts +28 -0
- package/{types/src/components/Button/__tests__/Button.spec.d.ts → lib/components/Badge/__tests__/Badge.spec.d.ts} +0 -0
- package/{types/src/components/Button/__tests__/IconButton.spec.d.ts → lib/components/Badge/__tests__/Status.spec.d.ts} +0 -0
- package/lib/components/Badge/index.d.ts +32 -0
- package/lib/components/BottomNavigation/StyledBottomNavigation.d.ts +52 -0
- package/{types/src/theme → lib/components/BottomNavigation}/__tests__/index.spec.d.ts +0 -0
- package/lib/components/BottomNavigation/index.d.ts +45 -0
- package/lib/components/Button/IconButton.d.ts +34 -0
- package/{types/src/components/Button/__tests__/StyledButton.spec.d.ts → lib/components/Button/__tests__/index.spec.d.ts} +0 -0
- package/lib/components/Button/index.d.ts +4 -0
- package/lib/components/Card/StyledCard.d.ts +17 -0
- package/lib/components/Card/__tests__/StyledCard.spec.d.ts +1 -0
- package/lib/components/Card/__tests__/index.spec.d.ts +1 -0
- package/lib/components/Card/index.d.ts +22 -0
- package/lib/components/Collapse/StyledCollapse.d.ts +15 -0
- package/lib/components/Collapse/__tests__/StyledCollapse.spec.d.ts +1 -0
- package/lib/components/Collapse/__tests__/index.spec.d.ts +1 -0
- package/lib/components/Collapse/index.d.ts +23 -0
- package/lib/components/Divider/StyledDivider.d.ts +13 -0
- package/lib/components/Divider/__tests__/StyledDivider.spec.d.ts +1 -0
- package/lib/components/Divider/index.d.ts +21 -0
- package/lib/components/Drawer/StyledDrawer.d.ts +25 -0
- package/lib/components/Drawer/__tests__/index.spec.d.ts +1 -0
- package/lib/components/Drawer/index.d.ts +25 -0
- package/lib/components/FAB/ActionGroup/ActionItem.d.ts +12 -0
- package/lib/components/FAB/ActionGroup/StyledActionGroup.d.ts +30 -0
- package/lib/components/FAB/ActionGroup/StyledActionItem.d.ts +13 -0
- package/lib/components/FAB/ActionGroup/__tests__/index.spec.d.ts +1 -0
- package/lib/components/FAB/ActionGroup/index.d.ts +34 -0
- package/lib/components/FAB/AnimatedFABIcon.d.ts +6 -0
- package/lib/components/FAB/FAB.d.ts +34 -0
- package/lib/components/FAB/StyledFAB.d.ts +20 -0
- package/lib/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +1 -0
- package/lib/components/FAB/__tests__/StyledFAB.spec.d.ts +1 -0
- package/lib/components/FAB/__tests__/index.spec.d.ts +1 -0
- package/lib/components/FAB/index.d.ts +4 -0
- package/lib/components/Icon/HeroIcon/index.d.ts +13 -0
- package/lib/components/Icon/IconList.d.ts +2 -0
- package/lib/components/Icon/__tests__/index.spec.d.ts +1 -0
- package/lib/components/Icon/index.d.ts +27 -0
- package/lib/components/Icon/utils.d.ts +2 -0
- package/lib/components/Progress/ProgressBar.d.ts +18 -0
- package/lib/components/Progress/ProgressCircle.d.ts +18 -0
- package/lib/components/Progress/StyledProgressBar.d.ts +18 -0
- package/lib/components/Progress/StyledProgressCircle.d.ts +38 -0
- package/lib/components/Progress/index.d.ts +5 -0
- package/lib/components/Progress/types.d.ts +1 -0
- package/lib/components/Tabs/ActiveTabIndicator.d.ts +8 -0
- package/lib/components/Tabs/ScrollableTabs.d.ts +3 -0
- package/lib/components/Tabs/StyledScrollableTabs.d.ts +61 -0
- package/lib/components/Tabs/StyledTabs.d.ts +55 -0
- package/lib/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +1 -0
- package/lib/components/Tabs/__tests__/index.spec.d.ts +1 -0
- package/lib/components/Tabs/index.d.ts +54 -0
- package/lib/components/Tabs/utils.d.ts +2 -0
- package/lib/components/Tag/StyledTag.d.ts +20 -0
- package/lib/components/Tag/__tests__/Tag.spec.d.ts +1 -0
- package/lib/components/Tag/index.d.ts +21 -0
- package/lib/components/Typography/Text/StyledText.d.ts +13 -0
- package/lib/components/Typography/Text/__tests__/StyledText.spec.d.ts +1 -0
- package/lib/components/Typography/Text/__tests__/index.spec.d.ts +1 -0
- package/lib/components/Typography/Text/index.d.ts +30 -0
- package/lib/components/Typography/index.d.ts +6 -0
- package/lib/index.d.ts +19 -0
- package/lib/index.js +1635 -3345
- package/lib/theme/__tests__/index.spec.d.ts +1 -0
- package/lib/theme/components/avatar.d.ts +32 -0
- package/lib/theme/components/badge.d.ts +29 -0
- package/lib/theme/components/bottomNavigation.d.ts +23 -0
- package/lib/theme/components/card.d.ts +10 -0
- package/lib/theme/components/divider.d.ts +17 -0
- package/lib/theme/components/drawer.d.ts +21 -0
- package/lib/theme/components/fab.d.ts +51 -0
- package/lib/theme/components/icon.d.ts +19 -0
- package/lib/theme/components/progress.d.ts +21 -0
- package/lib/theme/components/tabs.d.ts +27 -0
- package/lib/theme/components/tag.d.ts +30 -0
- package/lib/theme/components/typography.d.ts +26 -0
- package/lib/theme/global/borders.d.ts +11 -0
- package/lib/theme/global/colors.d.ts +29 -0
- package/lib/theme/global/index.d.ts +39 -0
- package/lib/theme/global/scale.d.ts +9 -0
- package/lib/theme/global/space.d.ts +13 -0
- package/lib/theme/global/typography.d.ts +21 -0
- package/lib/theme/index.d.ts +33 -0
- package/lib/types.d.ts +5 -0
- package/lib/utils/__tests__/scale.spec.d.ts +1 -0
- package/lib/utils/helpers.d.ts +2 -0
- package/lib/utils/hooks.d.ts +1 -0
- package/lib/utils/scale.d.ts +3 -0
- package/package.json +2 -3
- package/playground/package.json +3 -3
- package/playground/src/Alert.tsx +80 -0
- package/playground/src/App.tsx +12 -0
- package/playground/src/ContentNavigator.tsx +3 -10
- package/playground/src/MultipleThemes.tsx +34 -0
- package/playground/src/Select.tsx +32 -0
- package/playground/src/Switch.tsx +80 -0
- package/rollup.config.js +7 -1
- 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/Header.tsx +1 -1
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +8 -8
- package/src/components/BottomSheet/index.tsx +6 -0
- package/src/components/Icon/HeroIcon/selection.json +1 -1
- package/src/components/Icon/IconList.ts +2 -0
- package/src/components/Radio/RadioGroup.tsx +31 -7
- package/src/components/Radio/types.ts +1 -0
- package/src/components/SectionHeading/StyledHeading.tsx +5 -5
- package/src/components/SectionHeading/__tests__/{StyledHeading.tsx → StyledHeading.spec.tsx} +0 -0
- package/src/components/SectionHeading/__tests__/__snapshots__/{StyledHeading.tsx.snap → StyledHeading.spec.tsx.snap} +0 -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/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 +2 -6
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +1 -7
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +1 -22
- package/src/components/TextInput/__tests__/index.spec.tsx +2 -1
- package/src/components/TextInput/index.tsx +19 -6
- package/src/index.ts +7 -2
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +80 -1
- package/src/theme/components/alert.ts +32 -0
- package/src/theme/components/sectionHeading.ts +18 -0
- package/src/theme/components/select.ts +23 -0
- package/src/theme/components/switch.ts +50 -0
- package/src/theme/components/textInput.ts +1 -1
- package/src/theme/global/colors.ts +2 -0
- package/src/theme/index.ts +30 -4
- package/types/components/Alert/StyledAlert.d.ts +37 -0
- package/types/components/Alert/__tests__/index.spec.d.ts +1 -0
- package/types/components/Alert/index.d.ts +42 -0
- package/types/components/Avatar/StyledAvatar.d.ts +0 -0
- package/types/components/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -0
- package/types/components/Avatar/__tests__/index.spec.d.ts +0 -0
- package/types/components/Avatar/index.d.ts +0 -0
- package/types/components/Badge/Status.d.ts +0 -0
- package/types/components/Badge/StyledBadge.d.ts +0 -0
- package/types/components/Badge/__tests__/Badge.spec.d.ts +0 -0
- package/types/components/Badge/__tests__/Status.spec.d.ts +0 -0
- package/types/components/Badge/index.d.ts +0 -0
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
- package/types/components/BottomNavigation/__tests__/index.spec.d.ts +0 -0
- package/types/components/BottomNavigation/index.d.ts +0 -0
- package/types/components/BottomSheet/Footer.d.ts +0 -0
- package/types/components/BottomSheet/Header.d.ts +0 -0
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
- package/types/components/BottomSheet/__tests__/index.spec.d.ts +0 -0
- package/types/components/BottomSheet/index.d.ts +5 -1
- package/types/components/Button/Button.d.ts +0 -0
- package/types/components/Button/IconButton.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/index.d.ts +0 -0
- package/types/components/Button/StyledButton.d.ts +0 -0
- package/types/components/Button/__tests__/Button.spec.d.ts +0 -0
- package/types/components/Button/__tests__/IconButton.spec.d.ts +0 -0
- package/types/components/Button/__tests__/StyledButton.spec.d.ts +0 -0
- package/types/components/Button/index.d.ts +0 -0
- package/types/components/Card/StyledCard.d.ts +0 -0
- package/types/components/Card/__tests__/StyledCard.spec.d.ts +0 -0
- package/types/components/Card/__tests__/index.spec.d.ts +0 -0
- package/types/components/Card/index.d.ts +0 -0
- package/types/components/Checkbox/StyledCheckbox.d.ts +8 -0
- package/types/components/Checkbox/__tests__/StyledCheckbox.spec.d.ts +1 -0
- package/types/components/Checkbox/__tests__/index.spec.d.ts +1 -0
- package/types/components/Checkbox/index.d.ts +25 -0
- package/types/components/Collapse/StyledCollapse.d.ts +0 -0
- package/types/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -0
- package/types/components/Collapse/__tests__/index.spec.d.ts +0 -0
- package/types/components/Collapse/index.d.ts +0 -0
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
- package/types/components/ContentNavigator/__tests__/StyledContentNavigator.spec.d.ts +0 -0
- package/types/components/ContentNavigator/__tests__/index.spec.d.ts +0 -0
- package/types/components/ContentNavigator/index.d.ts +0 -0
- package/types/components/Divider/StyledDivider.d.ts +0 -0
- package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -0
- package/types/components/Divider/index.d.ts +0 -0
- package/types/components/Drawer/StyledDrawer.d.ts +0 -0
- package/types/components/Drawer/__tests__/index.spec.d.ts +0 -0
- package/types/components/Drawer/index.d.ts +0 -0
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
- package/types/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -0
- package/types/components/FAB/ActionGroup/index.d.ts +0 -0
- package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
- package/types/components/FAB/FAB.d.ts +0 -0
- package/types/components/FAB/StyledFAB.d.ts +0 -0
- package/types/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -0
- package/types/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -0
- package/types/components/FAB/__tests__/index.spec.d.ts +0 -0
- package/types/components/FAB/index.d.ts +0 -0
- package/types/components/Icon/HeroIcon/index.d.ts +0 -0
- package/types/components/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/__tests__/index.spec.d.ts +0 -0
- package/types/components/Icon/index.d.ts +0 -0
- package/types/components/Icon/utils.d.ts +1 -1
- package/types/components/Progress/ProgressBar.d.ts +0 -0
- package/types/components/Progress/ProgressCircle.d.ts +0 -0
- package/types/components/Progress/StyledProgressBar.d.ts +0 -0
- package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
- package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
- package/types/components/Progress/index.d.ts +0 -0
- package/types/components/Progress/types.d.ts +0 -0
- package/types/components/Radio/Radio.d.ts +0 -0
- package/types/components/Radio/RadioGroup.d.ts +11 -8
- package/types/components/Radio/StyledRadio.d.ts +0 -0
- package/types/components/Radio/__tests__/Radio.spec.d.ts +0 -0
- package/types/components/Radio/__tests__/RadioGroup.spec.d.ts +0 -0
- package/types/components/Radio/__tests__/StyledRadio.spec.d.ts +0 -0
- package/types/components/Radio/index.d.ts +1 -1
- package/types/components/Radio/types.d.ts +5 -0
- package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
- package/types/components/SectionHeading/__tests__/StyledHeading.d.ts +0 -0
- package/types/components/SectionHeading/__tests__/StyledHeading.spec.d.ts +1 -0
- package/types/components/SectionHeading/__tests__/index.spec.d.ts +0 -0
- package/types/components/SectionHeading/index.d.ts +0 -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 +0 -0
- package/types/components/Spinner/StyledSpinner.d.ts +0 -0
- package/types/components/Spinner/__tests__/AnimatedSpinner.spec.d.ts +0 -0
- package/types/components/Spinner/__tests__/StyledSpinner.spec.d.ts +0 -0
- package/types/components/Spinner/__tests__/index.spec.d.ts +0 -0
- package/types/components/Spinner/index.d.ts +0 -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/components/Tabs/ActiveTabIndicator.d.ts +0 -0
- package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/StyledTabs.d.ts +0 -0
- package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -0
- package/types/components/Tabs/__tests__/index.spec.d.ts +0 -0
- package/types/components/Tabs/index.d.ts +0 -0
- package/types/components/Tabs/utils.d.ts +0 -0
- package/types/components/Tag/StyledTag.d.ts +0 -0
- package/types/components/Tag/__tests__/Tag.spec.d.ts +0 -0
- package/types/components/Tag/index.d.ts +0 -0
- package/types/components/TextInput/StyledTextInput.d.ts +1 -5
- package/types/components/TextInput/__tests__/StyledTextInput.spec.d.ts +0 -0
- package/types/components/TextInput/__tests__/index.spec.d.ts +0 -0
- package/types/components/TextInput/index.d.ts +13 -5
- package/types/components/Typography/Text/StyledText.d.ts +0 -0
- package/types/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -0
- package/types/components/Typography/Text/__tests__/index.spec.d.ts +0 -0
- package/types/components/Typography/Text/index.d.ts +0 -0
- package/types/components/Typography/index.d.ts +0 -0
- package/types/index.d.ts +5 -3
- package/types/testHelpers/renderWithTheme.d.ts +0 -0
- package/types/theme/__tests__/index.spec.d.ts +0 -0
- package/types/theme/components/alert.d.ts +23 -0
- package/types/theme/components/avatar.d.ts +0 -0
- package/types/theme/components/badge.d.ts +0 -0
- package/types/theme/components/bottomNavigation.d.ts +0 -0
- package/types/theme/components/bottomSheet.d.ts +0 -0
- package/types/theme/components/button.d.ts +0 -0
- package/types/theme/components/card.d.ts +0 -0
- package/types/theme/components/checkbox.d.ts +21 -0
- package/types/theme/components/contentNavigator.d.ts +0 -0
- package/types/theme/components/divider.d.ts +0 -0
- package/types/theme/components/drawer.d.ts +0 -0
- package/types/theme/components/fab.d.ts +0 -0
- package/types/theme/components/icon.d.ts +0 -0
- package/types/theme/components/progress.d.ts +0 -0
- package/types/theme/components/radio.d.ts +0 -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 +0 -0
- package/types/theme/components/switch.d.ts +32 -0
- package/types/theme/components/tabs.d.ts +0 -0
- package/types/theme/components/tag.d.ts +0 -0
- package/types/theme/components/textInput.d.ts +1 -1
- package/types/theme/components/typography.d.ts +0 -0
- package/types/theme/global/borders.d.ts +0 -0
- package/types/theme/global/colors.d.ts +2 -0
- package/types/theme/global/index.d.ts +2 -0
- package/types/theme/global/scale.d.ts +0 -0
- package/types/theme/global/space.d.ts +0 -0
- package/types/theme/global/typography.d.ts +0 -0
- package/types/theme/index.d.ts +20 -3
- package/types/types.d.ts +0 -0
- package/types/utils/__tests__/scale.spec.d.ts +0 -0
- package/types/utils/helpers.d.ts +0 -0
- package/types/utils/hooks.d.ts +0 -0
- package/types/utils/scale.d.ts +0 -0
- package/.expo/README.md +0 -15
- package/.expo/packager-info.json +0 -10
- package/.expo/prebuild/cached-packages.json +0 -4
- package/.expo/settings.json +0 -10
- package/.expo/xcodebuild-error.log +0 -2
- package/.expo/xcodebuild.log +0 -11199
- package/.turbo/turbo-publish:npm.log +0 -0
- package/.turbo/turbo-test.log +0 -131
- package/playground/src/Button.tsx~origin_master +0 -170
- package/playground/src/emotion.d.ts +0 -7
- 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/Button/Button.d.ts +0 -57
- package/types/src/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -20
- package/types/src/components/Button/LoadingIndicator/index.d.ts +0 -26
- package/types/src/components/Button/StyledButton.d.ts +0 -40
- package/types/src/components/Button/index.d.ts +0 -8
- package/types/src/components/Icon/HeroIcon/index.d.ts +0 -13
- package/types/src/testHelpers/renderWithTheme.d.ts +0 -3
- package/types/src/theme/components/button.d.ts +0 -37
|
@@ -5,12 +5,13 @@ import TextInput from '../index';
|
|
|
5
5
|
describe('TextInput', () => {
|
|
6
6
|
it('renders label, prefix and native TextInput', () => {
|
|
7
7
|
const { queryAllByTestId, queryAllByText } = renderWithTheme(
|
|
8
|
-
<TextInput label="Input Label" prefix="user" />
|
|
8
|
+
<TextInput label="Input Label" prefix="user" suffix="arrow-down" />
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
expect(queryAllByText('Input Label')).toHaveLength(1);
|
|
12
12
|
expect(queryAllByTestId('input-label')).toHaveLength(1);
|
|
13
13
|
expect(queryAllByTestId('input-prefix')).toHaveLength(1);
|
|
14
|
+
expect(queryAllByTestId('input-suffix')).toHaveLength(1);
|
|
14
15
|
expect(queryAllByTestId('text-input')).toHaveLength(1);
|
|
15
16
|
});
|
|
16
17
|
});
|
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
TextInputProps as NativeTextInputProps,
|
|
4
4
|
StyleProp,
|
|
5
5
|
ViewStyle,
|
|
6
|
+
TextStyle,
|
|
6
7
|
} from 'react-native';
|
|
7
|
-
import { Container, Label,
|
|
8
|
-
import { IconName } from '../Icon';
|
|
8
|
+
import { Container, Label, StyledTextInput } from './StyledTextInput';
|
|
9
|
+
import Icon, { IconName } from '../Icon';
|
|
9
10
|
|
|
10
|
-
interface TextInputProps extends NativeTextInputProps {
|
|
11
|
+
export interface TextInputProps extends NativeTextInputProps {
|
|
11
12
|
/**
|
|
12
13
|
* Field label.
|
|
13
14
|
*/
|
|
@@ -17,15 +18,23 @@ interface TextInputProps extends NativeTextInputProps {
|
|
|
17
18
|
*/
|
|
18
19
|
prefix?: IconName;
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* Name of Icon to render on the right side of the input.
|
|
22
|
+
*/
|
|
23
|
+
suffix?: IconName;
|
|
24
|
+
/**
|
|
25
|
+
* Additional wrapper style.
|
|
21
26
|
*/
|
|
22
27
|
style?: StyleProp<ViewStyle>;
|
|
28
|
+
/**
|
|
29
|
+
* Input text style.
|
|
30
|
+
*/
|
|
31
|
+
textStyle?: StyleProp<TextStyle>;
|
|
23
32
|
/**
|
|
24
33
|
* Testing id of the component.
|
|
25
34
|
*/
|
|
26
35
|
testID?: string;
|
|
27
36
|
/**
|
|
28
|
-
* Accessibility
|
|
37
|
+
* Accessibility label for the input (Android).
|
|
29
38
|
*/
|
|
30
39
|
accessibilityLabelledBy?: string;
|
|
31
40
|
}
|
|
@@ -33,7 +42,9 @@ interface TextInputProps extends NativeTextInputProps {
|
|
|
33
42
|
const TextInput = ({
|
|
34
43
|
label,
|
|
35
44
|
prefix,
|
|
45
|
+
suffix,
|
|
36
46
|
style,
|
|
47
|
+
textStyle,
|
|
37
48
|
testID,
|
|
38
49
|
accessibilityLabelledBy,
|
|
39
50
|
...nativeProps
|
|
@@ -48,13 +59,15 @@ const TextInput = ({
|
|
|
48
59
|
{label}
|
|
49
60
|
</Label>
|
|
50
61
|
)}
|
|
51
|
-
{prefix && <
|
|
62
|
+
{prefix && <Icon testID="input-prefix" icon={prefix} size="xsmall" />}
|
|
52
63
|
<StyledTextInput
|
|
64
|
+
style={textStyle}
|
|
53
65
|
testID="text-input"
|
|
54
66
|
// @ts-ignore
|
|
55
67
|
accessibilityLabelledBy={accessibilityLabelledBy}
|
|
56
68
|
{...nativeProps}
|
|
57
69
|
/>
|
|
70
|
+
{suffix && <Icon testID="input-suffix" icon={suffix} size="xsmall" />}
|
|
58
71
|
</Container>
|
|
59
72
|
);
|
|
60
73
|
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ThemeProvider, useTheme } from '
|
|
2
|
-
import theme, { getTheme } from './theme';
|
|
1
|
+
import theme, { getTheme, ThemeProvider, useTheme } from './theme';
|
|
3
2
|
import { scale } from './utils/scale';
|
|
4
3
|
|
|
4
|
+
import Alert from './components/Alert';
|
|
5
5
|
import Avatar from './components/Avatar';
|
|
6
6
|
import Badge from './components/Badge';
|
|
7
7
|
import BottomNavigation from './components/BottomNavigation';
|
|
@@ -18,6 +18,8 @@ import Progress from './components/Progress';
|
|
|
18
18
|
import Spinner from './components/Spinner';
|
|
19
19
|
import Radio from './components/Radio';
|
|
20
20
|
import SectionHeading from './components/SectionHeading';
|
|
21
|
+
import Select from './components/Select';
|
|
22
|
+
import Switch from './components/Switch';
|
|
21
23
|
import Tabs from './components/Tabs';
|
|
22
24
|
import Tag from './components/Tag';
|
|
23
25
|
import TextInput from './components/TextInput';
|
|
@@ -29,6 +31,7 @@ export {
|
|
|
29
31
|
useTheme,
|
|
30
32
|
scale,
|
|
31
33
|
ThemeProvider,
|
|
34
|
+
Alert,
|
|
32
35
|
Avatar,
|
|
33
36
|
Badge,
|
|
34
37
|
BottomNavigation,
|
|
@@ -45,6 +48,8 @@ export {
|
|
|
45
48
|
Spinner,
|
|
46
49
|
Radio,
|
|
47
50
|
SectionHeading,
|
|
51
|
+
Select,
|
|
52
|
+
Switch,
|
|
48
53
|
Tabs,
|
|
49
54
|
Tag,
|
|
50
55
|
TextInput,
|
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
exports[`theme returns correct theme object 1`] = `
|
|
4
4
|
Object {
|
|
5
5
|
"__hd__": Object {
|
|
6
|
+
"alert": Object {
|
|
7
|
+
"borderWidths": Object {
|
|
8
|
+
"base": 1,
|
|
9
|
+
},
|
|
10
|
+
"colors": Object {
|
|
11
|
+
"divider": "#fafbfb",
|
|
12
|
+
"error": "#de350b",
|
|
13
|
+
"info": "#1dbeee",
|
|
14
|
+
"success": "#01b39c",
|
|
15
|
+
"warning": "#ffa234",
|
|
16
|
+
},
|
|
17
|
+
"radii": Object {
|
|
18
|
+
"default": 16,
|
|
19
|
+
},
|
|
20
|
+
"sizes": Object {
|
|
21
|
+
"height": 48,
|
|
22
|
+
},
|
|
23
|
+
"space": Object {
|
|
24
|
+
"padding": 16,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
6
27
|
"avatar": Object {
|
|
7
28
|
"borderWidths": Object {
|
|
8
29
|
"default": 1,
|
|
@@ -299,6 +320,32 @@ Object {
|
|
|
299
320
|
"wrapperPadding": 16,
|
|
300
321
|
},
|
|
301
322
|
},
|
|
323
|
+
"sectionHeading": Object {
|
|
324
|
+
"colors": Object {
|
|
325
|
+
"background": "#dadbde",
|
|
326
|
+
},
|
|
327
|
+
"space": Object {
|
|
328
|
+
"headingHorizontalPadding": 16,
|
|
329
|
+
"headingMarginBottom": 16,
|
|
330
|
+
"headingVerticalPadding": 8,
|
|
331
|
+
"iconMarginRight": 8,
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
"select": Object {
|
|
335
|
+
"colors": Object {
|
|
336
|
+
"checkedOption": "#f1e9fb",
|
|
337
|
+
"footerText": "#7622d7",
|
|
338
|
+
"option": "#ffffff",
|
|
339
|
+
},
|
|
340
|
+
"radii": Object {
|
|
341
|
+
"option": 4,
|
|
342
|
+
},
|
|
343
|
+
"space": Object {
|
|
344
|
+
"optionListPadding": 16,
|
|
345
|
+
"optionListSpacing": 4,
|
|
346
|
+
"optionPadding": 16,
|
|
347
|
+
},
|
|
348
|
+
},
|
|
302
349
|
"spinner": Object {
|
|
303
350
|
"color": Object {
|
|
304
351
|
"default": "#7622d7",
|
|
@@ -312,6 +359,36 @@ Object {
|
|
|
312
359
|
"spinnerTextPaddingTop": 8,
|
|
313
360
|
},
|
|
314
361
|
},
|
|
362
|
+
"switch": Object {
|
|
363
|
+
"borderWidths": Object {
|
|
364
|
+
"default": 1,
|
|
365
|
+
},
|
|
366
|
+
"colors": Object {
|
|
367
|
+
"active": "#7622d7",
|
|
368
|
+
"inactive": "#727478",
|
|
369
|
+
"thumb": "#ffffff",
|
|
370
|
+
},
|
|
371
|
+
"heights": Object {
|
|
372
|
+
"medium": 28.799999999999997,
|
|
373
|
+
"small": 24,
|
|
374
|
+
},
|
|
375
|
+
"radii": Object {
|
|
376
|
+
"rounded": 999,
|
|
377
|
+
},
|
|
378
|
+
"spaces": Object {
|
|
379
|
+
"inactive": 0,
|
|
380
|
+
"medium": 4,
|
|
381
|
+
"small": 4,
|
|
382
|
+
},
|
|
383
|
+
"thumbSizes": Object {
|
|
384
|
+
"medium": 20.8,
|
|
385
|
+
"small": 16,
|
|
386
|
+
},
|
|
387
|
+
"widths": Object {
|
|
388
|
+
"medium": 56,
|
|
389
|
+
"small": 48,
|
|
390
|
+
},
|
|
391
|
+
},
|
|
315
392
|
"tabs": Object {
|
|
316
393
|
"borderWidths": Object {
|
|
317
394
|
"headerBottom": 1,
|
|
@@ -381,10 +458,10 @@ Object {
|
|
|
381
458
|
},
|
|
382
459
|
"space": Object {
|
|
383
460
|
"containerPadding": 16,
|
|
461
|
+
"inputHorizontalMargin": 8,
|
|
384
462
|
"labelHorizontalPadding": 4,
|
|
385
463
|
"labelLeft": 16,
|
|
386
464
|
"labelTop": -10,
|
|
387
|
-
"prefixMarginRight": 8,
|
|
388
465
|
},
|
|
389
466
|
},
|
|
390
467
|
"typography": Object {
|
|
@@ -426,9 +503,11 @@ Object {
|
|
|
426
503
|
"dangerLight": "#f2ae9d",
|
|
427
504
|
"disabledLightText": "#ccced1",
|
|
428
505
|
"disabledText": "#8b8d92",
|
|
506
|
+
"inactiveBackground": "#727478",
|
|
429
507
|
"info": "#4568fb",
|
|
430
508
|
"infoBackground": "#ecf0ff",
|
|
431
509
|
"infoLight": "#d1d9fe",
|
|
510
|
+
"infoMediumLight": "#1dbeee",
|
|
432
511
|
"invertedText": "#ffffff",
|
|
433
512
|
"outline": "#dadbde",
|
|
434
513
|
"platformBackground": "#ffffff",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { scale } from '../../utils/scale';
|
|
2
|
+
import { GlobalTheme } from '../global';
|
|
3
|
+
|
|
4
|
+
const getAlertTheme = (theme: GlobalTheme) => {
|
|
5
|
+
const colors = {
|
|
6
|
+
success: theme.colors.success,
|
|
7
|
+
warning: theme.colors.warning,
|
|
8
|
+
error: theme.colors.danger,
|
|
9
|
+
info: theme.colors.infoMediumLight,
|
|
10
|
+
divider: theme.colors.backgroundLight,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const sizes = {
|
|
14
|
+
height: scale(48),
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const space = {
|
|
18
|
+
padding: theme.space.medium,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const radii = {
|
|
22
|
+
default: theme.radii.xlarge,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const borderWidths = {
|
|
26
|
+
base: theme.borderWidths.base,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return { colors, radii, sizes, space, borderWidths };
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default getAlertTheme;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GlobalTheme } from '../global';
|
|
2
|
+
|
|
3
|
+
const getSectionHeadingTheme = (theme: GlobalTheme) => {
|
|
4
|
+
const colors = {
|
|
5
|
+
background: theme.colors.outline,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const space = {
|
|
9
|
+
headingVerticalPadding: theme.space.small,
|
|
10
|
+
headingHorizontalPadding: theme.space.medium,
|
|
11
|
+
headingMarginBottom: theme.space.medium,
|
|
12
|
+
iconMarginRight: theme.space.small,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return { colors, space };
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default getSectionHeadingTheme;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GlobalTheme } from '../global';
|
|
2
|
+
|
|
3
|
+
const getSelectTheme = (theme: GlobalTheme) => {
|
|
4
|
+
const colors = {
|
|
5
|
+
option: theme.colors.platformBackground,
|
|
6
|
+
checkedOption: theme.colors.primaryBackground,
|
|
7
|
+
footerText: theme.colors.primary,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const space = {
|
|
11
|
+
optionPadding: theme.space.medium,
|
|
12
|
+
optionListPadding: theme.space.medium, // left padding should be 12 according to the design
|
|
13
|
+
optionListSpacing: theme.space.xsmall,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const radii = {
|
|
17
|
+
option: theme.radii.base,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return { space, colors, radii };
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default getSelectTheme;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { GlobalTheme } from '../global';
|
|
2
|
+
|
|
3
|
+
const getSwitchTheme = (theme: GlobalTheme) => {
|
|
4
|
+
const colors = {
|
|
5
|
+
thumb: theme.colors.platformBackground,
|
|
6
|
+
active: theme.colors.primary,
|
|
7
|
+
inactive: theme.colors.inactiveBackground,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const thumbSizes = {
|
|
11
|
+
small: theme.space.medium,
|
|
12
|
+
medium: theme.space.medium * 1.3,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const widths = {
|
|
16
|
+
small: theme.space.xxxlarge,
|
|
17
|
+
medium: theme.space.xxxxlarge,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const heights = {
|
|
21
|
+
small: theme.space.large,
|
|
22
|
+
medium: theme.space.large * 1.2,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const spaces = {
|
|
26
|
+
small: theme.space.xsmall,
|
|
27
|
+
medium: theme.space.xsmall,
|
|
28
|
+
inactive: 0,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const radii = {
|
|
32
|
+
rounded: theme.radii.rounded,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const borderWidths = {
|
|
36
|
+
default: theme.borderWidths.base,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
colors,
|
|
41
|
+
thumbSizes,
|
|
42
|
+
widths,
|
|
43
|
+
heights,
|
|
44
|
+
spaces,
|
|
45
|
+
radii,
|
|
46
|
+
borderWidths,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default getSwitchTheme;
|
|
@@ -11,7 +11,7 @@ const getTextInputTheme = (theme: GlobalTheme) => {
|
|
|
11
11
|
labelLeft: theme.space.medium,
|
|
12
12
|
labelTop: theme.lineHeights.small / -2,
|
|
13
13
|
labelHorizontalPadding: theme.space.xsmall,
|
|
14
|
-
|
|
14
|
+
inputHorizontalMargin: theme.space.small,
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
const fontSizes = {
|
|
@@ -8,6 +8,7 @@ const systemPalette = {
|
|
|
8
8
|
secondary: palette.dodgerBlue,
|
|
9
9
|
secondaryLight: palette.dodgerBlueLight75,
|
|
10
10
|
info: palette.dodgerBlue,
|
|
11
|
+
infoMediumLight: palette.blue,
|
|
11
12
|
infoLight: palette.dodgerBlueLight75,
|
|
12
13
|
infoBackground: palette.dodgerBlueLight90,
|
|
13
14
|
success: palette.green,
|
|
@@ -29,6 +30,7 @@ const systemPalette = {
|
|
|
29
30
|
outline: palette.greyLight60,
|
|
30
31
|
archived: palette.greyLight45,
|
|
31
32
|
black: palette.black,
|
|
33
|
+
inactiveBackground: palette.greyDark30,
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
type SystemPalette = typeof systemPalette;
|
package/src/theme/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as Emotion from '@emotion/react';
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
GlobalTheme,
|
|
3
5
|
Scale,
|
|
@@ -7,6 +9,7 @@ import {
|
|
|
7
9
|
defaultSystemPalette,
|
|
8
10
|
} from './global';
|
|
9
11
|
|
|
12
|
+
import getAlertTheme from './components/alert';
|
|
10
13
|
import getAvatarTheme from './components/avatar';
|
|
11
14
|
import getBadgeTheme from './components/badge';
|
|
12
15
|
import getBottomNavigationTheme from './components/bottomNavigation';
|
|
@@ -19,8 +22,11 @@ import getDrawerTheme from './components/drawer';
|
|
|
19
22
|
import getFABTheme from './components/fab';
|
|
20
23
|
import getIconTheme from './components/icon';
|
|
21
24
|
import getProgressTheme from './components/progress';
|
|
22
|
-
import getSpinnerTheme from './components/spinner';
|
|
23
25
|
import getRadioTheme from './components/radio';
|
|
26
|
+
import getSectionHeadingTheme from './components/sectionHeading';
|
|
27
|
+
import getSelectTheme from './components/select';
|
|
28
|
+
import getSpinnerTheme from './components/spinner';
|
|
29
|
+
import getSwitchTheme from './components/switch';
|
|
24
30
|
import getTabsTheme from './components/tabs';
|
|
25
31
|
import getTagTheme from './components/tag';
|
|
26
32
|
import getTextInputTheme from './components/textInput';
|
|
@@ -28,6 +34,7 @@ import getTypographyTheme from './components/typography';
|
|
|
28
34
|
|
|
29
35
|
type Theme = GlobalTheme & {
|
|
30
36
|
__hd__: {
|
|
37
|
+
alert: ReturnType<typeof getAlertTheme>;
|
|
31
38
|
avatar: ReturnType<typeof getAvatarTheme>;
|
|
32
39
|
badge: ReturnType<typeof getBadgeTheme>;
|
|
33
40
|
bottomNavigation: ReturnType<typeof getBottomNavigationTheme>;
|
|
@@ -40,8 +47,11 @@ type Theme = GlobalTheme & {
|
|
|
40
47
|
fab: ReturnType<typeof getFABTheme>;
|
|
41
48
|
icon: ReturnType<typeof getIconTheme>;
|
|
42
49
|
progress: ReturnType<typeof getProgressTheme>;
|
|
43
|
-
spinner: ReturnType<typeof getSpinnerTheme>;
|
|
44
50
|
radio: ReturnType<typeof getRadioTheme>;
|
|
51
|
+
sectionHeading: ReturnType<typeof getSectionHeadingTheme>;
|
|
52
|
+
select: ReturnType<typeof getSelectTheme>;
|
|
53
|
+
spinner: ReturnType<typeof getSpinnerTheme>;
|
|
54
|
+
switch: ReturnType<typeof getSwitchTheme>;
|
|
45
55
|
tabs: ReturnType<typeof getTabsTheme>;
|
|
46
56
|
tag: ReturnType<typeof getTagTheme>;
|
|
47
57
|
textInput: ReturnType<typeof getTextInputTheme>;
|
|
@@ -58,6 +68,7 @@ const getTheme = (
|
|
|
58
68
|
...globalTheme,
|
|
59
69
|
__hd__: {
|
|
60
70
|
avatar: getAvatarTheme(globalTheme),
|
|
71
|
+
alert: getAlertTheme(globalTheme),
|
|
61
72
|
badge: getBadgeTheme(globalTheme),
|
|
62
73
|
bottomNavigation: getBottomNavigationTheme(globalTheme),
|
|
63
74
|
bottomSheet: getBottomSheetTheme(globalTheme),
|
|
@@ -68,9 +79,12 @@ const getTheme = (
|
|
|
68
79
|
drawer: getDrawerTheme(globalTheme),
|
|
69
80
|
fab: getFABTheme(globalTheme),
|
|
70
81
|
icon: getIconTheme(globalTheme),
|
|
71
|
-
spinner: getSpinnerTheme(globalTheme),
|
|
72
82
|
progress: getProgressTheme(globalTheme),
|
|
73
83
|
radio: getRadioTheme(globalTheme),
|
|
84
|
+
sectionHeading: getSectionHeadingTheme(globalTheme),
|
|
85
|
+
select: getSelectTheme(globalTheme),
|
|
86
|
+
spinner: getSpinnerTheme(globalTheme),
|
|
87
|
+
switch: getSwitchTheme(globalTheme),
|
|
74
88
|
tabs: getTabsTheme(globalTheme),
|
|
75
89
|
tag: getTagTheme(globalTheme),
|
|
76
90
|
textInput: getTextInputTheme(globalTheme),
|
|
@@ -81,6 +95,18 @@ const getTheme = (
|
|
|
81
95
|
|
|
82
96
|
const theme = getTheme();
|
|
83
97
|
|
|
84
|
-
export
|
|
98
|
+
export interface ThemeProviderProps {
|
|
99
|
+
theme: Partial<Theme> | ((outerTheme: Theme) => Theme);
|
|
100
|
+
children: React.ReactNode;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
interface ThemeProviderType {
|
|
104
|
+
(props: ThemeProviderProps): React.ReactElement;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const ThemeProvider = Emotion.ThemeProvider as ThemeProviderType;
|
|
108
|
+
|
|
109
|
+
const useTheme = Emotion.useTheme as () => Theme;
|
|
110
|
+
export { Theme, getTheme, ThemeProvider, useTheme };
|
|
85
111
|
|
|
86
112
|
export default theme;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TouchableOpacity, View, ViewProps } from 'react-native';
|
|
2
|
+
declare const Container: import("@emotion/native").StyledComponent<ViewProps & {
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
themeVariant: 'default' | 'round';
|
|
7
|
+
themeIntent: 'success' | 'info' | 'warning' | 'error';
|
|
8
|
+
}, {}, {
|
|
9
|
+
ref?: import("react").Ref<View> | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
declare const IconContainer: import("@emotion/native").StyledComponent<ViewProps & {
|
|
12
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
13
|
+
as?: import("react").ElementType<any> | undefined;
|
|
14
|
+
}, {}, {
|
|
15
|
+
ref?: import("react").Ref<View> | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
declare const TextContainer: import("@emotion/native").StyledComponent<ViewProps & {
|
|
18
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
19
|
+
as?: import("react").ElementType<any> | undefined;
|
|
20
|
+
}, {}, {
|
|
21
|
+
ref?: import("react").Ref<View> | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
declare const ContentContainer: import("@emotion/native").StyledComponent<ViewProps & {
|
|
24
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
25
|
+
as?: import("react").ElementType<any> | undefined;
|
|
26
|
+
} & {
|
|
27
|
+
showDivider: boolean;
|
|
28
|
+
}, {}, {
|
|
29
|
+
ref?: import("react").Ref<View> | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
declare const CTAWrapper: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & {
|
|
32
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
33
|
+
as?: import("react").ElementType<any> | undefined;
|
|
34
|
+
}, {}, {
|
|
35
|
+
ref?: import("react").Ref<TouchableOpacity> | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
export { Container, ContentContainer, TextContainer, IconContainer, CTAWrapper, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { IconName } from '../Icon';
|
|
4
|
+
interface AlertProps {
|
|
5
|
+
/**
|
|
6
|
+
* Alert title.
|
|
7
|
+
*/
|
|
8
|
+
title?: string | ReactElement;
|
|
9
|
+
/**
|
|
10
|
+
* Alert content.
|
|
11
|
+
*/
|
|
12
|
+
content: string | ReactElement;
|
|
13
|
+
/**
|
|
14
|
+
* Icon name of the alert.
|
|
15
|
+
* - undefined: use default icon according to Alert intent.
|
|
16
|
+
* - null: no icon at all.
|
|
17
|
+
* - IconName: an icon identifier from hero-design icon list.
|
|
18
|
+
*/
|
|
19
|
+
icon?: null | IconName;
|
|
20
|
+
/**
|
|
21
|
+
* Visual intent color to apply to alert.
|
|
22
|
+
*/
|
|
23
|
+
intent?: 'success' | 'info' | 'warning' | 'error';
|
|
24
|
+
/**
|
|
25
|
+
* Closing callback. When onClose is available, an X button will be rendered on the right side of alert. The callback will be called when user clicks on X button.
|
|
26
|
+
*/
|
|
27
|
+
onClose?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Use rounded variant.
|
|
30
|
+
*/
|
|
31
|
+
variant?: 'default' | 'round';
|
|
32
|
+
/**
|
|
33
|
+
* Addtional style.
|
|
34
|
+
*/
|
|
35
|
+
style?: StyleProp<ViewStyle>;
|
|
36
|
+
/**
|
|
37
|
+
* Testing id of the component.
|
|
38
|
+
*/
|
|
39
|
+
testID?: string;
|
|
40
|
+
}
|
|
41
|
+
declare const Alert: ({ content, icon, title, intent, onClose, variant, style, testID, }: AlertProps) => JSX.Element;
|
|
42
|
+
export default Alert;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -26,6 +26,10 @@ interface BottomSheetProps {
|
|
|
26
26
|
* is being dismiss by interacting outside of the bottom sheet.
|
|
27
27
|
*/
|
|
28
28
|
onRequestClose?: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Callback that is called once the bottom sheet has been dismissed.
|
|
31
|
+
*/
|
|
32
|
+
onDismiss?: () => void;
|
|
29
33
|
/**
|
|
30
34
|
* Displays an X button on bottom sheet header that will invoke onRequestClose callback on press.
|
|
31
35
|
*/
|
|
@@ -47,5 +51,5 @@ interface BottomSheetProps {
|
|
|
47
51
|
*/
|
|
48
52
|
testID?: string;
|
|
49
53
|
}
|
|
50
|
-
declare const BottomSheet: ({ open, header, footer, children, onOpen, onRequestClose, showCloseButton, hasBackdrop, showDivider, style, testID, }: BottomSheetProps) => JSX.Element;
|
|
54
|
+
declare const BottomSheet: ({ open, header, footer, children, onOpen, onRequestClose, onDismiss, showCloseButton, hasBackdrop, showDivider, style, testID, }: BottomSheetProps) => JSX.Element;
|
|
51
55
|
export default BottomSheet;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|