@hero-design/rn 7.3.2 → 7.4.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 +8 -8
- package/.turbo/turbo-build:types.log +2 -0
- package/.turbo/turbo-test.log +131 -0
- package/.turbo/turbo-type-check.log +7 -0
- package/assets/fonts/hero-icons.ttf +0 -0
- package/es/index.js +2012 -1137
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +2016 -1135
- package/package.json +11 -9
- package/playground/.detoxrc.json +49 -0
- package/playground/.prettierrc.json +8 -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/{index.tsx → src/App.tsx} +57 -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/src/Button.tsx +170 -0
- package/playground/{components/Button.tsx → src/Button.tsx~origin_master} +0 -0
- package/playground/{components → src}/Card.tsx +1 -1
- package/playground/{components → src}/Collapse.tsx +1 -1
- package/playground/src/ContentNavigator.tsx +65 -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/{components → src}/Progress.tsx +1 -1
- package/playground/src/Radio.tsx +25 -0
- package/playground/src/SectionHeading.tsx +68 -0
- package/playground/src/Spinner.tsx +19 -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/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 +171 -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 +6 -0
- package/src/components/Icon/index.tsx +8 -1
- package/src/components/Radio/Radio.tsx +51 -0
- package/src/components/Radio/RadioGroup.tsx +50 -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/SectionHeading/StyledHeading.tsx +24 -0
- package/src/components/SectionHeading/__tests__/StyledHeading.tsx +28 -0
- package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.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/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/TextInput/StyledTextInput.tsx +34 -0
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +33 -0
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +88 -0
- package/src/components/TextInput/__tests__/index.spec.tsx +16 -0
- package/src/components/TextInput/index.tsx +61 -0
- package/src/index.ts +12 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +95 -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/spinner.ts +21 -0
- package/src/theme/components/textInput.ts +32 -0
- package/src/theme/global/borders.ts +6 -0
- package/src/theme/global/colors.ts +1 -0
- package/src/theme/index.ts +22 -7
- package/tsconfig.json +11 -3
- package/types/components/Avatar/StyledAvatar.d.ts +45 -0
- package/types/{src/components/Tabs/__tests__/ScrollableTab.spec.d.ts → components/Avatar/__tests__/StyledAvatar.spec.d.ts} +0 -0
- package/types/components/Avatar/__tests__/index.spec.d.ts +1 -0
- package/types/components/Avatar/index.d.ts +25 -0
- package/types/components/Badge/Status.d.ts +24 -0
- package/types/components/Badge/StyledBadge.d.ts +27 -0
- package/types/components/Badge/__tests__/Badge.spec.d.ts +1 -0
- package/types/components/Badge/__tests__/Status.spec.d.ts +1 -0
- package/types/components/Badge/index.d.ts +32 -0
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +51 -0
- package/types/components/BottomNavigation/__tests__/index.spec.d.ts +1 -0
- package/types/components/BottomNavigation/index.d.ts +45 -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/components/BottomSheet/__tests__/index.spec.d.ts +1 -0
- package/types/components/BottomSheet/index.d.ts +51 -0
- package/types/components/Button/Button.d.ts +57 -0
- package/types/components/Button/IconButton.d.ts +38 -0
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +19 -0
- package/types/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +1 -0
- package/types/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +1 -0
- package/types/components/Button/LoadingIndicator/index.d.ts +26 -0
- package/types/components/Button/StyledButton.d.ts +39 -0
- package/types/components/Button/__tests__/Button.spec.d.ts +1 -0
- package/types/components/Button/__tests__/IconButton.spec.d.ts +1 -0
- package/types/components/Button/__tests__/StyledButton.spec.d.ts +1 -0
- package/types/components/Button/index.d.ts +8 -0
- package/types/components/Card/StyledCard.d.ts +16 -0
- package/types/components/Card/__tests__/StyledCard.spec.d.ts +1 -0
- package/types/components/Card/__tests__/index.spec.d.ts +1 -0
- package/types/components/Card/index.d.ts +22 -0
- package/types/components/Collapse/StyledCollapse.d.ts +25 -0
- package/types/components/Collapse/__tests__/StyledCollapse.spec.d.ts +1 -0
- package/types/components/Collapse/__tests__/index.spec.d.ts +1 -0
- package/types/components/Collapse/index.d.ts +19 -0
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +12 -0
- package/types/components/ContentNavigator/__tests__/StyledContentNavigator.spec.d.ts +1 -0
- package/types/components/ContentNavigator/__tests__/index.spec.d.ts +1 -0
- package/types/components/ContentNavigator/index.d.ts +33 -0
- package/types/components/Divider/StyledDivider.d.ts +12 -0
- package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +1 -0
- package/types/components/Divider/index.d.ts +21 -0
- package/types/components/Drawer/StyledDrawer.d.ts +24 -0
- package/types/components/Drawer/__tests__/index.spec.d.ts +1 -0
- package/types/components/Drawer/index.d.ts +25 -0
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +12 -0
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +29 -0
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +12 -0
- package/types/components/FAB/ActionGroup/__tests__/index.spec.d.ts +1 -0
- package/types/components/FAB/ActionGroup/index.d.ts +34 -0
- package/types/components/FAB/AnimatedFABIcon.d.ts +6 -0
- package/types/components/FAB/FAB.d.ts +34 -0
- package/types/components/FAB/StyledFAB.d.ts +19 -0
- package/types/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +1 -0
- package/types/components/FAB/__tests__/StyledFAB.spec.d.ts +1 -0
- package/types/components/FAB/__tests__/index.spec.d.ts +1 -0
- package/types/components/FAB/index.d.ts +4 -0
- package/types/components/Icon/HeroIcon/index.d.ts +12 -0
- package/types/components/Icon/IconList.d.ts +2 -0
- package/types/components/Icon/__tests__/index.spec.d.ts +1 -0
- package/types/components/Icon/index.d.ts +27 -0
- package/types/components/Icon/utils.d.ts +2 -0
- package/types/components/Progress/ProgressBar.d.ts +18 -0
- package/types/components/Progress/ProgressCircle.d.ts +18 -0
- package/types/components/Progress/StyledProgressBar.d.ts +17 -0
- package/types/components/Progress/StyledProgressCircle.d.ts +37 -0
- package/types/components/Progress/__tests__/index.spec.d.ts +1 -0
- package/types/components/Progress/index.d.ts +5 -0
- package/types/components/Progress/types.d.ts +1 -0
- package/types/components/Radio/Radio.d.ts +26 -0
- package/types/components/Radio/RadioGroup.d.ts +29 -0
- package/types/components/Radio/StyledRadio.d.ts +30 -0
- package/types/components/Radio/__tests__/Radio.spec.d.ts +1 -0
- package/types/components/Radio/__tests__/RadioGroup.spec.d.ts +1 -0
- package/types/components/Radio/__tests__/StyledRadio.spec.d.ts +1 -0
- package/types/components/Radio/index.d.ts +4 -0
- package/types/components/SectionHeading/StyledHeading.d.ts +20 -0
- package/types/components/SectionHeading/__tests__/StyledHeading.d.ts +1 -0
- package/types/components/SectionHeading/__tests__/index.spec.d.ts +1 -0
- package/types/components/SectionHeading/index.d.ts +39 -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/Tabs/ActiveTabIndicator.d.ts +8 -0
- package/types/{src/components/Tabs/ScrollableTab.d.ts → components/Tabs/ScrollableTabs.d.ts} +1 -1
- package/types/{src/components/Tabs/StyledScrollableTab.d.ts → components/Tabs/StyledScrollableTabs.d.ts} +0 -1
- package/types/components/Tabs/StyledTabs.d.ts +54 -0
- package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +1 -0
- package/types/components/Tabs/__tests__/index.spec.d.ts +1 -0
- package/types/components/Tabs/index.d.ts +54 -0
- package/types/components/Tabs/utils.d.ts +2 -0
- package/types/components/Tag/StyledTag.d.ts +19 -0
- package/types/components/Tag/__tests__/Tag.spec.d.ts +1 -0
- package/types/components/Tag/index.d.ts +21 -0
- package/types/components/TextInput/StyledTextInput.d.ts +22 -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 +26 -0
- package/types/components/Typography/Text/StyledText.d.ts +12 -0
- 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/components/Typography/Text/index.d.ts +30 -0
- package/types/components/Typography/index.d.ts +6 -0
- package/types/index.d.ts +25 -0
- package/types/playground/components/IconButton.d.ts +0 -0
- package/types/src/components/Button/Button.d.ts +0 -0
- package/types/src/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
- package/types/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +0 -0
- package/types/src/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +0 -0
- package/types/src/components/Button/LoadingIndicator/index.d.ts +0 -0
- package/types/src/components/Button/StyledButton.d.ts +0 -0
- package/types/src/components/Button/__tests__/Button.spec.d.ts +0 -0
- package/types/src/components/Button/__tests__/IconButton.spec.d.ts +0 -0
- package/types/src/components/Button/__tests__/StyledButton.spec.d.ts +0 -0
- package/types/src/theme/components/button.d.ts +0 -0
- package/types/testHelpers/renderWithTheme.d.ts +3 -0
- package/types/theme/__tests__/index.spec.d.ts +1 -0
- package/types/theme/components/avatar.d.ts +32 -0
- package/types/theme/components/badge.d.ts +29 -0
- package/types/theme/components/bottomNavigation.d.ts +23 -0
- package/types/theme/components/bottomSheet.d.ts +29 -0
- package/types/theme/components/button.d.ts +37 -0
- package/types/theme/components/card.d.ts +10 -0
- package/types/theme/components/contentNavigator.d.ts +7 -0
- package/types/theme/components/divider.d.ts +17 -0
- package/types/theme/components/drawer.d.ts +21 -0
- package/types/theme/components/fab.d.ts +51 -0
- package/types/theme/components/icon.d.ts +20 -0
- package/types/theme/components/progress.d.ts +21 -0
- package/types/theme/components/radio.d.ts +25 -0
- package/types/theme/components/spinner.d.ts +15 -0
- package/types/theme/components/tabs.d.ts +27 -0
- package/types/theme/components/tag.d.ts +30 -0
- package/types/theme/components/textInput.d.ts +24 -0
- package/types/theme/components/typography.d.ts +26 -0
- package/types/theme/global/borders.d.ts +14 -0
- package/types/theme/global/colors.d.ts +32 -0
- package/types/theme/global/index.d.ts +42 -0
- package/types/theme/global/scale.d.ts +9 -0
- package/types/theme/global/space.d.ts +13 -0
- package/types/theme/global/typography.d.ts +21 -0
- package/types/theme/index.d.ts +45 -0
- package/types/types.d.ts +5 -0
- package/types/utils/__tests__/scale.spec.d.ts +1 -0
- package/types/utils/helpers.d.ts +2 -0
- package/types/utils/hooks.d.ts +1 -0
- package/types/utils/scale.d.ts +3 -0
- package/app.json +0 -8
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Spinner renders correctly 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
style={
|
|
6
|
+
Array [
|
|
7
|
+
Object {},
|
|
8
|
+
undefined,
|
|
9
|
+
]
|
|
10
|
+
}
|
|
11
|
+
>
|
|
12
|
+
<View
|
|
13
|
+
style={
|
|
14
|
+
Array [
|
|
15
|
+
Object {
|
|
16
|
+
"alignItems": "center",
|
|
17
|
+
"height": "100%",
|
|
18
|
+
"justifyContent": "center",
|
|
19
|
+
},
|
|
20
|
+
undefined,
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
testID="spinner"
|
|
24
|
+
>
|
|
25
|
+
<View
|
|
26
|
+
collapsable={false}
|
|
27
|
+
nativeID="animatedComponent"
|
|
28
|
+
style={
|
|
29
|
+
Object {
|
|
30
|
+
"transform": Array [
|
|
31
|
+
Object {
|
|
32
|
+
"rotate": "0deg",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
>
|
|
38
|
+
<View
|
|
39
|
+
collapsable={false}
|
|
40
|
+
nativeID="animatedComponent"
|
|
41
|
+
style={
|
|
42
|
+
Array [
|
|
43
|
+
Object {
|
|
44
|
+
"flexDirection": "row",
|
|
45
|
+
"marginBottom": 8,
|
|
46
|
+
},
|
|
47
|
+
Object {},
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
themePosition="top"
|
|
51
|
+
>
|
|
52
|
+
<View
|
|
53
|
+
collapsable={false}
|
|
54
|
+
nativeID="animatedComponent"
|
|
55
|
+
style={
|
|
56
|
+
Array [
|
|
57
|
+
Object {
|
|
58
|
+
"backgroundColor": "#7622d7",
|
|
59
|
+
"borderRadius": 8,
|
|
60
|
+
"height": 16,
|
|
61
|
+
"opacity": 1,
|
|
62
|
+
"width": 16,
|
|
63
|
+
},
|
|
64
|
+
Object {},
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
themePosition="topLeft"
|
|
68
|
+
/>
|
|
69
|
+
<View
|
|
70
|
+
collapsable={false}
|
|
71
|
+
nativeID="animatedComponent"
|
|
72
|
+
style={
|
|
73
|
+
Array [
|
|
74
|
+
Object {
|
|
75
|
+
"backgroundColor": "#7622d7",
|
|
76
|
+
"borderRadius": 8,
|
|
77
|
+
"height": 16,
|
|
78
|
+
"marginLeft": 8,
|
|
79
|
+
"opacity": 0.7,
|
|
80
|
+
"width": 16,
|
|
81
|
+
},
|
|
82
|
+
Object {},
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
themePosition="topRight"
|
|
86
|
+
/>
|
|
87
|
+
</View>
|
|
88
|
+
<View
|
|
89
|
+
collapsable={false}
|
|
90
|
+
nativeID="animatedComponent"
|
|
91
|
+
style={
|
|
92
|
+
Array [
|
|
93
|
+
Object {
|
|
94
|
+
"flexDirection": "row",
|
|
95
|
+
"marginBottom": 0,
|
|
96
|
+
},
|
|
97
|
+
Object {},
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
themePosition="bottom"
|
|
101
|
+
>
|
|
102
|
+
<View
|
|
103
|
+
collapsable={false}
|
|
104
|
+
nativeID="animatedComponent"
|
|
105
|
+
style={
|
|
106
|
+
Array [
|
|
107
|
+
Object {
|
|
108
|
+
"backgroundColor": "#7622d7",
|
|
109
|
+
"borderRadius": 8,
|
|
110
|
+
"height": 16,
|
|
111
|
+
"opacity": 0.5,
|
|
112
|
+
"width": 16,
|
|
113
|
+
},
|
|
114
|
+
Object {},
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
themePosition="bottomLeft"
|
|
118
|
+
/>
|
|
119
|
+
<View
|
|
120
|
+
collapsable={false}
|
|
121
|
+
nativeID="animatedComponent"
|
|
122
|
+
style={
|
|
123
|
+
Array [
|
|
124
|
+
Object {
|
|
125
|
+
"backgroundColor": "#7622d7",
|
|
126
|
+
"borderRadius": 8,
|
|
127
|
+
"height": 16,
|
|
128
|
+
"marginLeft": 8,
|
|
129
|
+
"opacity": 0.3,
|
|
130
|
+
"width": 16,
|
|
131
|
+
},
|
|
132
|
+
Object {},
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
themePosition="bottomRight"
|
|
136
|
+
/>
|
|
137
|
+
</View>
|
|
138
|
+
</View>
|
|
139
|
+
</View>
|
|
140
|
+
</View>
|
|
141
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
4
|
+
import Spinner from '..';
|
|
5
|
+
|
|
6
|
+
describe('Spinner', () => {
|
|
7
|
+
it('renders correctly', () => {
|
|
8
|
+
const { toJSON } = renderWithTheme(<Spinner testID="spinner" />);
|
|
9
|
+
|
|
10
|
+
expect(toJSON()).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { ViewProps } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { StyledSpinnerContainer, StyledView } from './StyledSpinner';
|
|
5
|
+
import { AnimatedSpinner } from './AnimatedSpinner';
|
|
6
|
+
|
|
7
|
+
interface SpinnerProps extends ViewProps {
|
|
8
|
+
/**
|
|
9
|
+
* Testing id of the component.
|
|
10
|
+
*/
|
|
11
|
+
testID?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const Spinner = ({ testID, ...nativeProps }: SpinnerProps): ReactElement => (
|
|
15
|
+
<StyledView {...nativeProps}>
|
|
16
|
+
<StyledSpinnerContainer testID={testID}>
|
|
17
|
+
<AnimatedSpinner />
|
|
18
|
+
</StyledSpinnerContainer>
|
|
19
|
+
</StyledView>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export default Spinner;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TextInput, View } from 'react-native';
|
|
2
|
+
import styled from '@emotion/native';
|
|
3
|
+
import Typography from '../Typography';
|
|
4
|
+
import Icon from '../Icon';
|
|
5
|
+
|
|
6
|
+
const Container = styled(View)(({ theme }) => ({
|
|
7
|
+
position: 'relative',
|
|
8
|
+
width: '100%',
|
|
9
|
+
borderWidth: theme.__hd__.textInput.borderWidths.container,
|
|
10
|
+
borderRadius: theme.__hd__.textInput.radii.container,
|
|
11
|
+
padding: theme.__hd__.textInput.space.containerPadding,
|
|
12
|
+
flexDirection: 'row',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
const Label = styled(Typography.Text)(({ theme }) => ({
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
left: theme.__hd__.textInput.space.labelLeft,
|
|
19
|
+
top: theme.__hd__.textInput.space.labelTop,
|
|
20
|
+
backgroundColor: theme.__hd__.textInput.colors.labelBackground,
|
|
21
|
+
zIndex: 1,
|
|
22
|
+
paddingHorizontal: theme.__hd__.textInput.space.labelHorizontalPadding,
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
const Prefix = styled(Icon)(({ theme }) => ({
|
|
26
|
+
marginRight: theme.__hd__.textInput.space.prefixMarginRight,
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
const StyledTextInput = styled(TextInput)(({ theme }) => ({
|
|
30
|
+
flex: 1,
|
|
31
|
+
fontSize: theme.__hd__.textInput.fontSizes.text,
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
export { Container, Label, Prefix, StyledTextInput };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
|
+
import { Container, Label, Prefix, StyledTextInput } from '../StyledTextInput';
|
|
4
|
+
|
|
5
|
+
describe('Container', () => {
|
|
6
|
+
it('renders correctly', () => {
|
|
7
|
+
const { toJSON } = renderWithTheme(<Container />);
|
|
8
|
+
|
|
9
|
+
expect(toJSON()).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
describe('Label', () => {
|
|
14
|
+
it('renders correctly', () => {
|
|
15
|
+
const { toJSON } = renderWithTheme(<Label>Label</Label>);
|
|
16
|
+
|
|
17
|
+
expect(toJSON()).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
describe('Prefix', () => {
|
|
21
|
+
it('renders correctly', () => {
|
|
22
|
+
const { toJSON } = renderWithTheme(<Prefix icon="user" />);
|
|
23
|
+
|
|
24
|
+
expect(toJSON()).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe('StyledTextInput', () => {
|
|
28
|
+
it('renders correctly', () => {
|
|
29
|
+
const { toJSON } = renderWithTheme(<StyledTextInput />);
|
|
30
|
+
|
|
31
|
+
expect(toJSON()).toMatchSnapshot();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Container renders correctly 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
style={
|
|
6
|
+
Array [
|
|
7
|
+
Object {
|
|
8
|
+
"alignItems": "center",
|
|
9
|
+
"borderRadius": 8,
|
|
10
|
+
"borderWidth": 1,
|
|
11
|
+
"flexDirection": "row",
|
|
12
|
+
"padding": 16,
|
|
13
|
+
"position": "relative",
|
|
14
|
+
"width": "100%",
|
|
15
|
+
},
|
|
16
|
+
undefined,
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
/>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports[`Label renders correctly 1`] = `
|
|
23
|
+
<Text
|
|
24
|
+
style={
|
|
25
|
+
Array [
|
|
26
|
+
Object {
|
|
27
|
+
"color": "#292a2b",
|
|
28
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
29
|
+
"fontSize": 14,
|
|
30
|
+
"letterSpacing": 0.42,
|
|
31
|
+
"lineHeight": 22,
|
|
32
|
+
},
|
|
33
|
+
Array [
|
|
34
|
+
Object {
|
|
35
|
+
"backgroundColor": "#ffffff",
|
|
36
|
+
"left": 16,
|
|
37
|
+
"paddingHorizontal": 4,
|
|
38
|
+
"position": "absolute",
|
|
39
|
+
"top": -10,
|
|
40
|
+
"zIndex": 1,
|
|
41
|
+
},
|
|
42
|
+
undefined,
|
|
43
|
+
],
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
themeFontSize="medium"
|
|
47
|
+
themeFontWeight="regular"
|
|
48
|
+
themeIntent="body"
|
|
49
|
+
>
|
|
50
|
+
Label
|
|
51
|
+
</Text>
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
exports[`Prefix renders correctly 1`] = `
|
|
55
|
+
<HeroIcon
|
|
56
|
+
name="user"
|
|
57
|
+
style={
|
|
58
|
+
Array [
|
|
59
|
+
Object {
|
|
60
|
+
"color": "#292a2b",
|
|
61
|
+
"fontSize": 24,
|
|
62
|
+
},
|
|
63
|
+
Array [
|
|
64
|
+
Object {
|
|
65
|
+
"marginRight": 8,
|
|
66
|
+
},
|
|
67
|
+
undefined,
|
|
68
|
+
],
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
themeIntent="text"
|
|
72
|
+
themeSize="medium"
|
|
73
|
+
/>
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
exports[`StyledTextInput renders correctly 1`] = `
|
|
77
|
+
<TextInput
|
|
78
|
+
style={
|
|
79
|
+
Array [
|
|
80
|
+
Object {
|
|
81
|
+
"flex": 1,
|
|
82
|
+
"fontSize": 16,
|
|
83
|
+
},
|
|
84
|
+
undefined,
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
/>
|
|
88
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
|
+
import TextInput from '../index';
|
|
4
|
+
|
|
5
|
+
describe('TextInput', () => {
|
|
6
|
+
it('renders label, prefix and native TextInput', () => {
|
|
7
|
+
const { queryAllByTestId, queryAllByText } = renderWithTheme(
|
|
8
|
+
<TextInput label="Input Label" prefix="user" />
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
expect(queryAllByText('Input Label')).toHaveLength(1);
|
|
12
|
+
expect(queryAllByTestId('input-label')).toHaveLength(1);
|
|
13
|
+
expect(queryAllByTestId('input-prefix')).toHaveLength(1);
|
|
14
|
+
expect(queryAllByTestId('text-input')).toHaveLength(1);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
TextInputProps as NativeTextInputProps,
|
|
4
|
+
StyleProp,
|
|
5
|
+
ViewStyle,
|
|
6
|
+
} from 'react-native';
|
|
7
|
+
import { Container, Label, Prefix, StyledTextInput } from './StyledTextInput';
|
|
8
|
+
import { IconName } from '../Icon';
|
|
9
|
+
|
|
10
|
+
interface TextInputProps extends NativeTextInputProps {
|
|
11
|
+
/**
|
|
12
|
+
* Field label.
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Name of Icon to render on the left side of the input, before the user's cursor.
|
|
17
|
+
*/
|
|
18
|
+
prefix?: IconName;
|
|
19
|
+
/**
|
|
20
|
+
* Additional style.
|
|
21
|
+
*/
|
|
22
|
+
style?: StyleProp<ViewStyle>;
|
|
23
|
+
/**
|
|
24
|
+
* Testing id of the component.
|
|
25
|
+
*/
|
|
26
|
+
testID?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Accessibility lable for the input (Android).
|
|
29
|
+
*/
|
|
30
|
+
accessibilityLabelledBy?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const TextInput = ({
|
|
34
|
+
label,
|
|
35
|
+
prefix,
|
|
36
|
+
style,
|
|
37
|
+
testID,
|
|
38
|
+
accessibilityLabelledBy,
|
|
39
|
+
...nativeProps
|
|
40
|
+
}: TextInputProps) => (
|
|
41
|
+
<Container style={style} testID={testID}>
|
|
42
|
+
{label && (
|
|
43
|
+
<Label
|
|
44
|
+
nativeID={accessibilityLabelledBy}
|
|
45
|
+
testID="input-label"
|
|
46
|
+
fontSize="small"
|
|
47
|
+
>
|
|
48
|
+
{label}
|
|
49
|
+
</Label>
|
|
50
|
+
)}
|
|
51
|
+
{prefix && <Prefix testID="input-prefix" icon={prefix} size="xsmall" />}
|
|
52
|
+
<StyledTextInput
|
|
53
|
+
testID="text-input"
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
accessibilityLabelledBy={accessibilityLabelledBy}
|
|
56
|
+
{...nativeProps}
|
|
57
|
+
/>
|
|
58
|
+
</Container>
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
export default TextInput;
|
package/src/index.ts
CHANGED
|
@@ -5,16 +5,22 @@ import { scale } from './utils/scale';
|
|
|
5
5
|
import Avatar from './components/Avatar';
|
|
6
6
|
import Badge from './components/Badge';
|
|
7
7
|
import BottomNavigation from './components/BottomNavigation';
|
|
8
|
+
import BottomSheet from './components/BottomSheet';
|
|
8
9
|
import Button from './components/Button';
|
|
9
10
|
import Card from './components/Card';
|
|
10
11
|
import Collapse from './components/Collapse';
|
|
12
|
+
import ContentNavigator from './components/ContentNavigator';
|
|
11
13
|
import Divider from './components/Divider';
|
|
12
14
|
import Drawer from './components/Drawer';
|
|
13
15
|
import FAB from './components/FAB';
|
|
14
16
|
import Icon from './components/Icon';
|
|
15
17
|
import Progress from './components/Progress';
|
|
18
|
+
import Spinner from './components/Spinner';
|
|
19
|
+
import Radio from './components/Radio';
|
|
20
|
+
import SectionHeading from './components/SectionHeading';
|
|
16
21
|
import Tabs from './components/Tabs';
|
|
17
22
|
import Tag from './components/Tag';
|
|
23
|
+
import TextInput from './components/TextInput';
|
|
18
24
|
import Typography from './components/Typography';
|
|
19
25
|
|
|
20
26
|
export {
|
|
@@ -26,16 +32,22 @@ export {
|
|
|
26
32
|
Avatar,
|
|
27
33
|
Badge,
|
|
28
34
|
BottomNavigation,
|
|
35
|
+
BottomSheet,
|
|
29
36
|
Button,
|
|
30
37
|
Card,
|
|
31
38
|
Collapse,
|
|
39
|
+
ContentNavigator,
|
|
32
40
|
Divider,
|
|
33
41
|
Drawer,
|
|
34
42
|
FAB,
|
|
35
43
|
Icon,
|
|
36
44
|
Progress,
|
|
45
|
+
Spinner,
|
|
46
|
+
Radio,
|
|
47
|
+
SectionHeading,
|
|
37
48
|
Tabs,
|
|
38
49
|
Tag,
|
|
50
|
+
TextInput,
|
|
39
51
|
Typography,
|
|
40
52
|
};
|
|
41
53
|
|
|
@@ -81,6 +81,33 @@ Object {
|
|
|
81
81
|
"titleMarginTop": 4,
|
|
82
82
|
},
|
|
83
83
|
},
|
|
84
|
+
"bottomSheet": Object {
|
|
85
|
+
"colors": Object {
|
|
86
|
+
"backdrop": "#292a2b",
|
|
87
|
+
"background": "#ffffff",
|
|
88
|
+
"shadow": "#292a2b",
|
|
89
|
+
},
|
|
90
|
+
"radii": Object {
|
|
91
|
+
"default": 16,
|
|
92
|
+
},
|
|
93
|
+
"shadows": Object {
|
|
94
|
+
"elevation": 10,
|
|
95
|
+
"offset": Object {
|
|
96
|
+
"height": 3,
|
|
97
|
+
"width": 0,
|
|
98
|
+
},
|
|
99
|
+
"opacity": 0.27,
|
|
100
|
+
"radius": 4.65,
|
|
101
|
+
},
|
|
102
|
+
"sizes": Object {
|
|
103
|
+
"closeIconWidth": 72,
|
|
104
|
+
"sectionHeight": 64,
|
|
105
|
+
},
|
|
106
|
+
"space": Object {
|
|
107
|
+
"horizontalPadding": 24,
|
|
108
|
+
"verticalPadding": 8,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
84
111
|
"button": Object {
|
|
85
112
|
"borderWidth": Object {
|
|
86
113
|
"default": 2,
|
|
@@ -124,6 +151,11 @@ Object {
|
|
|
124
151
|
"default": 12,
|
|
125
152
|
},
|
|
126
153
|
},
|
|
154
|
+
"contentNavigator": Object {
|
|
155
|
+
"space": Object {
|
|
156
|
+
"valueHorizontalPadding": 8,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
127
159
|
"divider": Object {
|
|
128
160
|
"borderWidths": Object {
|
|
129
161
|
"default": 1,
|
|
@@ -210,6 +242,7 @@ Object {
|
|
|
210
242
|
"icon": Object {
|
|
211
243
|
"colors": Object {
|
|
212
244
|
"danger": "#de350b",
|
|
245
|
+
"disabledText": "#8b8d92",
|
|
213
246
|
"info": "#4568fb",
|
|
214
247
|
"primary": "#7622d7",
|
|
215
248
|
"success": "#01b39c",
|
|
@@ -243,6 +276,42 @@ Object {
|
|
|
243
276
|
"strokeWidth": 8,
|
|
244
277
|
},
|
|
245
278
|
},
|
|
279
|
+
"radio": Object {
|
|
280
|
+
"borderWidths": Object {
|
|
281
|
+
"circle": 2,
|
|
282
|
+
},
|
|
283
|
+
"colors": Object {
|
|
284
|
+
"checkedCircle": "#7622d7",
|
|
285
|
+
"checkedWrapper": "#f1e9fb",
|
|
286
|
+
"circle": "#000000",
|
|
287
|
+
"wrapper": "#ffffff",
|
|
288
|
+
},
|
|
289
|
+
"radii": Object {
|
|
290
|
+
"wrapper": 4,
|
|
291
|
+
},
|
|
292
|
+
"sizes": Object {
|
|
293
|
+
"circle": 20,
|
|
294
|
+
"innerCircle": 10,
|
|
295
|
+
},
|
|
296
|
+
"space": Object {
|
|
297
|
+
"circleLeftMargin": 8,
|
|
298
|
+
"groupTopMargin": 4,
|
|
299
|
+
"wrapperPadding": 16,
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
"spinner": Object {
|
|
303
|
+
"color": Object {
|
|
304
|
+
"default": "#7622d7",
|
|
305
|
+
},
|
|
306
|
+
"radii": Object {
|
|
307
|
+
"default": 8,
|
|
308
|
+
},
|
|
309
|
+
"space": Object {
|
|
310
|
+
"spinnerDot": 16,
|
|
311
|
+
"spinnerDotPadding": 8,
|
|
312
|
+
"spinnerTextPaddingTop": 8,
|
|
313
|
+
},
|
|
314
|
+
},
|
|
246
315
|
"tabs": Object {
|
|
247
316
|
"borderWidths": Object {
|
|
248
317
|
"headerBottom": 1,
|
|
@@ -296,6 +365,28 @@ Object {
|
|
|
296
365
|
"verticalPadding": 2,
|
|
297
366
|
},
|
|
298
367
|
},
|
|
368
|
+
"textInput": Object {
|
|
369
|
+
"borderWidths": Object {
|
|
370
|
+
"container": 1,
|
|
371
|
+
},
|
|
372
|
+
"colors": Object {
|
|
373
|
+
"border": "#292a2b",
|
|
374
|
+
"labelBackground": "#ffffff",
|
|
375
|
+
},
|
|
376
|
+
"fontSizes": Object {
|
|
377
|
+
"text": 16,
|
|
378
|
+
},
|
|
379
|
+
"radii": Object {
|
|
380
|
+
"container": 8,
|
|
381
|
+
},
|
|
382
|
+
"space": Object {
|
|
383
|
+
"containerPadding": 16,
|
|
384
|
+
"labelHorizontalPadding": 4,
|
|
385
|
+
"labelLeft": 16,
|
|
386
|
+
"labelTop": -10,
|
|
387
|
+
"prefixMarginRight": 8,
|
|
388
|
+
},
|
|
389
|
+
},
|
|
299
390
|
"typography": Object {
|
|
300
391
|
"colors": Object {
|
|
301
392
|
"body": "#292a2b",
|
|
@@ -323,11 +414,13 @@ Object {
|
|
|
323
414
|
},
|
|
324
415
|
"borderWidths": Object {
|
|
325
416
|
"base": 1,
|
|
417
|
+
"medium": 2,
|
|
326
418
|
},
|
|
327
419
|
"colors": Object {
|
|
328
420
|
"archived": "#ccced1",
|
|
329
421
|
"backgroundDark": "#292a2b",
|
|
330
422
|
"backgroundLight": "#fafbfb",
|
|
423
|
+
"black": "#000000",
|
|
331
424
|
"danger": "#de350b",
|
|
332
425
|
"dangerBackground": "#fcebe7",
|
|
333
426
|
"dangerLight": "#f2ae9d",
|
|
@@ -382,8 +475,10 @@ Object {
|
|
|
382
475
|
},
|
|
383
476
|
"radii": Object {
|
|
384
477
|
"base": 4,
|
|
478
|
+
"large": 12,
|
|
385
479
|
"medium": 8,
|
|
386
480
|
"rounded": 999,
|
|
481
|
+
"xlarge": 16,
|
|
387
482
|
},
|
|
388
483
|
"space": Object {
|
|
389
484
|
"large": 24,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { GlobalTheme } from '../global';
|
|
2
|
+
|
|
3
|
+
const getBottomSheetTheme = (theme: GlobalTheme) => {
|
|
4
|
+
const colors = {
|
|
5
|
+
shadow: theme.colors.backgroundDark,
|
|
6
|
+
background: theme.colors.platformBackground,
|
|
7
|
+
backdrop: theme.colors.backgroundDark,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const sizes = {
|
|
11
|
+
sectionHeight: 64,
|
|
12
|
+
closeIconWidth: 72,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const space = {
|
|
16
|
+
horizontalPadding: theme.space.large,
|
|
17
|
+
verticalPadding: theme.space.small,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const shadows = {
|
|
21
|
+
offset: { width: 0, height: 3 },
|
|
22
|
+
opacity: 0.27,
|
|
23
|
+
radius: 4.65,
|
|
24
|
+
elevation: 10,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const radii = {
|
|
28
|
+
default: theme.radii.xlarge,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return { colors, shadows, radii, sizes, space };
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default getBottomSheetTheme;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { scale } from '../../utils/scale';
|
|
2
|
+
import { GlobalTheme } from '../global';
|
|
3
|
+
|
|
4
|
+
const getRadioTheme = (theme: GlobalTheme) => {
|
|
5
|
+
const colors = {
|
|
6
|
+
circle: theme.colors.black,
|
|
7
|
+
checkedCircle: theme.colors.primary,
|
|
8
|
+
wrapper: theme.colors.platformBackground,
|
|
9
|
+
checkedWrapper: theme.colors.primaryBackground,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const space = {
|
|
13
|
+
wrapperPadding: theme.space.medium, // left padding should be 12 according to the design
|
|
14
|
+
circleLeftMargin: theme.space.small,
|
|
15
|
+
groupTopMargin: theme.space.xsmall,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const sizes = {
|
|
19
|
+
circle: scale(20),
|
|
20
|
+
innerCircle: scale(10),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const borderWidths = {
|
|
24
|
+
circle: theme.borderWidths.medium,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const radii = {
|
|
28
|
+
wrapper: theme.radii.base,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return { sizes, borderWidths, space, colors, radii };
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default getRadioTheme;
|