@hero-design/rn 7.2.0 → 7.3.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.
Files changed (244) hide show
  1. package/.expo/README.md +15 -0
  2. package/.expo/packager-info.json +10 -0
  3. package/.expo/prebuild/cached-packages.json +4 -0
  4. package/.expo/settings.json +10 -0
  5. package/.expo/xcodebuild-error.log +2 -0
  6. package/.expo/xcodebuild.log +11199 -0
  7. package/.turbo/turbo-build.log +8 -0
  8. package/.turbo/turbo-build:types.log +2 -0
  9. package/.turbo/turbo-publish:npm.log +0 -0
  10. package/.turbo/turbo-test.log +131 -0
  11. package/.turbo/turbo-type-check.log +7 -0
  12. package/es/index.js +2406 -469
  13. package/jest.config.js +1 -1
  14. package/lib/index.js +2423 -481
  15. package/package.json +4 -38
  16. package/playground/components/Avatar.tsx +102 -0
  17. package/playground/components/Badge.tsx +146 -9
  18. package/playground/components/Button.tsx +138 -35
  19. package/playground/components/Card.tsx +40 -14
  20. package/playground/components/Collapse.tsx +99 -0
  21. package/playground/components/Drawer.tsx +32 -0
  22. package/playground/components/FAB.tsx +15 -0
  23. package/playground/components/IconButton.tsx +67 -0
  24. package/playground/components/Progress.tsx +95 -0
  25. package/playground/components/Tabs.tsx +106 -14
  26. package/playground/components/Tag.tsx +45 -0
  27. package/playground/index.tsx +18 -0
  28. package/src/components/Avatar/StyledAvatar.tsx +61 -0
  29. package/src/components/Avatar/__tests__/StyledAvatar.spec.tsx +48 -0
  30. package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +87 -0
  31. package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +88 -0
  32. package/src/components/Avatar/__tests__/index.spec.tsx +26 -0
  33. package/src/components/Avatar/index.tsx +71 -0
  34. package/src/components/Badge/Status.tsx +77 -0
  35. package/src/components/Badge/StyledBadge.tsx +38 -26
  36. package/src/components/Badge/__tests__/Badge.spec.tsx +16 -0
  37. package/src/components/Badge/__tests__/Status.spec.tsx +27 -0
  38. package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +133 -52
  39. package/src/components/Badge/__tests__/__snapshots__/Status.spec.tsx.snap +89 -0
  40. package/src/components/Badge/index.tsx +77 -19
  41. package/src/components/Button/Button.tsx +163 -0
  42. package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +58 -0
  43. package/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.tsx +20 -0
  44. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +101 -0
  45. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +606 -0
  46. package/src/components/Button/LoadingIndicator/__tests__/index.spec.tsx +24 -0
  47. package/src/components/Button/LoadingIndicator/index.tsx +140 -0
  48. package/src/components/Button/StyledButton.tsx +254 -0
  49. package/src/components/Button/__tests__/Button.spec.tsx +86 -0
  50. package/src/components/Button/__tests__/{index.spec.tsx → IconButton.spec.tsx} +0 -0
  51. package/src/components/Button/__tests__/StyledButton.spec.tsx +154 -0
  52. package/src/components/Button/__tests__/__snapshots__/{index.spec.tsx.snap → IconButton.spec.tsx.snap} +0 -0
  53. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +895 -0
  54. package/src/components/Button/index.tsx +10 -2
  55. package/src/components/Card/StyledCard.tsx +27 -5
  56. package/src/components/Card/__tests__/StyledCard.spec.tsx +15 -3
  57. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +34 -2
  58. package/src/components/Card/__tests__/index.spec.tsx +16 -21
  59. package/src/components/Card/index.tsx +15 -2
  60. package/src/components/Collapse/StyledCollapse.tsx +15 -0
  61. package/src/components/Collapse/__tests__/StyledCollapse.spec.tsx +26 -0
  62. package/src/components/Collapse/__tests__/__snapshots__/StyledCollapse.spec.tsx.snap +37 -0
  63. package/src/components/Collapse/__tests__/__snapshots__/index.spec.tsx.snap +84 -0
  64. package/src/components/Collapse/__tests__/index.spec.tsx +42 -0
  65. package/src/components/Collapse/index.tsx +109 -0
  66. package/src/components/Divider/index.tsx +1 -1
  67. package/src/components/Drawer/StyledDrawer.tsx +39 -0
  68. package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +244 -0
  69. package/src/components/Drawer/__tests__/index.spec.tsx +37 -0
  70. package/src/components/Drawer/index.tsx +93 -0
  71. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +78 -62
  72. package/src/components/FAB/ActionGroup/__tests__/index.spec.tsx +2 -0
  73. package/src/components/FAB/ActionGroup/index.tsx +13 -1
  74. package/src/components/FAB/FAB.tsx +63 -13
  75. package/src/components/FAB/StyledFAB.tsx +25 -6
  76. package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +6 -2
  77. package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +7 -3
  78. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +88 -6
  79. package/src/components/FAB/__tests__/index.spec.tsx +16 -0
  80. package/src/components/Progress/ProgressBar.tsx +73 -0
  81. package/src/components/Progress/ProgressCircle.tsx +165 -0
  82. package/src/components/Progress/StyledProgressBar.tsx +21 -0
  83. package/src/components/Progress/StyledProgressCircle.tsx +66 -0
  84. package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +641 -0
  85. package/src/components/Progress/__tests__/index.spec.js +46 -0
  86. package/src/components/Progress/index.tsx +6 -0
  87. package/src/components/Progress/types.ts +1 -0
  88. package/src/components/Tabs/ActiveTabIndicator.tsx +37 -0
  89. package/src/components/Tabs/ScrollableTabs.tsx +216 -0
  90. package/src/components/Tabs/StyledScrollableTabs.tsx +60 -0
  91. package/src/components/Tabs/StyledTabs.tsx +30 -44
  92. package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +84 -0
  93. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +591 -0
  94. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +317 -224
  95. package/src/components/Tabs/__tests__/index.spec.tsx +22 -21
  96. package/src/components/Tabs/index.tsx +155 -114
  97. package/src/components/Tabs/utils.ts +13 -0
  98. package/src/components/Tag/StyledTag.tsx +35 -0
  99. package/src/components/Tag/__tests__/Tag.spec.tsx +41 -0
  100. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +153 -0
  101. package/src/components/Tag/index.tsx +41 -0
  102. package/src/components/Typography/Text/index.tsx +1 -1
  103. package/src/index.ts +10 -0
  104. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +181 -22
  105. package/src/theme/components/avatar.ts +40 -0
  106. package/src/theme/components/badge.ts +14 -16
  107. package/src/theme/components/button.ts +57 -0
  108. package/src/theme/components/card.ts +5 -5
  109. package/src/theme/components/drawer.ts +24 -0
  110. package/src/theme/components/fab.ts +9 -2
  111. package/src/theme/components/progress.ts +27 -0
  112. package/src/theme/components/tabs.ts +22 -7
  113. package/src/theme/components/tag.ts +39 -0
  114. package/src/theme/global/borders.ts +13 -1
  115. package/src/theme/global/colors.ts +7 -2
  116. package/src/theme/global/index.ts +3 -1
  117. package/src/theme/global/scale.ts +3 -0
  118. package/src/theme/index.ts +15 -0
  119. package/src/utils/hooks.ts +10 -0
  120. package/testUtils/setup.tsx +43 -0
  121. package/types/playground/components/Avatar.d.ts +2 -0
  122. package/types/playground/components/Badge.d.ts +0 -0
  123. package/types/playground/components/BottomNavigation.d.ts +0 -0
  124. package/types/playground/components/Button.d.ts +0 -0
  125. package/types/playground/components/Card.d.ts +0 -0
  126. package/types/playground/components/Collapse.d.ts +2 -0
  127. package/types/playground/components/Divider.d.ts +0 -0
  128. package/types/playground/components/Drawer.d.ts +2 -0
  129. package/types/playground/components/FAB.d.ts +0 -0
  130. package/types/playground/components/Icon.d.ts +0 -0
  131. package/types/playground/components/IconButton.d.ts +2 -0
  132. package/types/playground/components/Progress.d.ts +2 -0
  133. package/types/playground/components/Tabs.d.ts +0 -0
  134. package/types/playground/components/Tag.d.ts +2 -0
  135. package/types/playground/components/Typography.d.ts +0 -0
  136. package/types/playground/index.d.ts +0 -0
  137. package/types/src/components/Avatar/StyledAvatar.d.ts +46 -0
  138. package/types/src/components/Avatar/__tests__/StyledAvatar.spec.d.ts +1 -0
  139. package/types/src/components/Avatar/__tests__/index.spec.d.ts +1 -0
  140. package/types/src/components/Avatar/index.d.ts +25 -0
  141. package/types/src/components/Badge/Status.d.ts +24 -0
  142. package/types/src/components/Badge/StyledBadge.d.ts +17 -9
  143. package/types/src/components/Badge/__tests__/Badge.spec.d.ts +0 -0
  144. package/types/src/components/Badge/__tests__/Status.spec.d.ts +1 -0
  145. package/types/src/components/Badge/index.d.ts +17 -7
  146. package/types/src/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
  147. package/types/src/components/BottomNavigation/__tests__/index.spec.d.ts +0 -0
  148. package/types/src/components/BottomNavigation/index.d.ts +0 -0
  149. package/types/src/components/Button/Button.d.ts +57 -0
  150. package/types/src/components/Button/IconButton.d.ts +0 -0
  151. package/types/src/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +20 -0
  152. package/types/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +1 -0
  153. package/types/src/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +1 -0
  154. package/types/src/components/Button/LoadingIndicator/index.d.ts +26 -0
  155. package/types/src/components/Button/StyledButton.d.ts +40 -0
  156. package/types/src/components/Button/__tests__/Button.spec.d.ts +1 -0
  157. package/types/src/components/Button/__tests__/IconButton.spec.d.ts +1 -0
  158. package/types/src/components/Button/__tests__/StyledButton.spec.d.ts +1 -0
  159. package/types/src/components/Button/__tests__/index.spec.d.ts +0 -0
  160. package/types/src/components/Button/index.d.ts +8 -4
  161. package/types/src/components/Card/StyledCard.d.ts +9 -1
  162. package/types/src/components/Card/__tests__/StyledCard.spec.d.ts +0 -0
  163. package/types/src/components/Card/__tests__/index.spec.d.ts +0 -0
  164. package/types/src/components/Card/index.d.ts +5 -1
  165. package/types/src/components/Collapse/StyledCollapse.d.ts +15 -0
  166. package/types/src/components/Collapse/__tests__/StyledCollapse.spec.d.ts +1 -0
  167. package/types/src/components/Collapse/__tests__/index.spec.d.ts +1 -0
  168. package/types/src/components/Collapse/index.d.ts +23 -0
  169. package/types/src/components/Divider/StyledDivider.d.ts +0 -0
  170. package/types/src/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -0
  171. package/types/src/components/Divider/index.d.ts +0 -0
  172. package/types/src/components/Drawer/StyledDrawer.d.ts +25 -0
  173. package/types/src/components/Drawer/__tests__/index.spec.d.ts +1 -0
  174. package/types/src/components/Drawer/index.d.ts +25 -0
  175. package/types/src/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
  176. package/types/src/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
  177. package/types/src/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
  178. package/types/src/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -0
  179. package/types/src/components/FAB/ActionGroup/index.d.ts +8 -1
  180. package/types/src/components/FAB/AnimatedFABIcon.d.ts +0 -0
  181. package/types/src/components/FAB/FAB.d.ts +5 -1
  182. package/types/src/components/FAB/StyledFAB.d.ts +8 -2
  183. package/types/src/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -0
  184. package/types/src/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -0
  185. package/types/src/components/FAB/__tests__/index.spec.d.ts +0 -0
  186. package/types/src/components/FAB/index.d.ts +2 -2
  187. package/types/src/components/Icon/HeroIcon/index.d.ts +0 -0
  188. package/types/src/components/Icon/IconList.d.ts +0 -0
  189. package/types/src/components/Icon/__tests__/index.spec.d.ts +0 -0
  190. package/types/src/components/Icon/index.d.ts +0 -0
  191. package/types/src/components/Icon/utils.d.ts +1 -1
  192. package/types/src/components/Progress/ProgressBar.d.ts +18 -0
  193. package/types/src/components/Progress/ProgressCircle.d.ts +18 -0
  194. package/types/src/components/Progress/StyledProgressBar.d.ts +18 -0
  195. package/types/src/components/Progress/StyledProgressCircle.d.ts +38 -0
  196. package/types/src/components/Progress/__tests__/index.spec.d.ts +1 -0
  197. package/types/src/components/Progress/index.d.ts +5 -0
  198. package/types/src/components/Progress/types.d.ts +1 -0
  199. package/types/src/components/Tabs/ActiveTabIndicator.d.ts +8 -0
  200. package/types/src/components/Tabs/ScrollableTabs.d.ts +3 -0
  201. package/types/src/components/Tabs/StyledScrollableTabs.d.ts +61 -0
  202. package/types/src/components/Tabs/StyledTabs.d.ts +22 -22
  203. package/types/src/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +1 -0
  204. package/types/src/components/Tabs/__tests__/index.spec.d.ts +0 -0
  205. package/types/src/components/Tabs/index.d.ts +28 -19
  206. package/types/src/components/Tabs/utils.d.ts +2 -0
  207. package/types/src/components/Tag/StyledTag.d.ts +20 -0
  208. package/types/src/components/Tag/__tests__/Tag.spec.d.ts +1 -0
  209. package/types/src/components/Tag/index.d.ts +21 -0
  210. package/types/src/components/Typography/Text/StyledText.d.ts +0 -0
  211. package/types/src/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -0
  212. package/types/src/components/Typography/Text/__tests__/index.spec.d.ts +0 -0
  213. package/types/src/components/Typography/Text/index.d.ts +0 -0
  214. package/types/src/components/Typography/index.d.ts +0 -0
  215. package/types/src/index.d.ts +6 -1
  216. package/types/src/testHelpers/renderWithTheme.d.ts +0 -0
  217. package/types/src/theme/__tests__/index.spec.d.ts +0 -0
  218. package/types/src/theme/components/avatar.d.ts +32 -0
  219. package/types/src/theme/components/badge.d.ts +12 -13
  220. package/types/src/theme/components/bottomNavigation.d.ts +0 -0
  221. package/types/src/theme/components/button.d.ts +37 -0
  222. package/types/src/theme/components/card.d.ts +3 -3
  223. package/types/src/theme/components/divider.d.ts +0 -0
  224. package/types/src/theme/components/drawer.d.ts +21 -0
  225. package/types/src/theme/components/fab.d.ts +8 -1
  226. package/types/src/theme/components/icon.d.ts +0 -0
  227. package/types/src/theme/components/progress.d.ts +21 -0
  228. package/types/src/theme/components/tabs.d.ts +14 -2
  229. package/types/src/theme/components/tag.d.ts +30 -0
  230. package/types/src/theme/components/typography.d.ts +0 -0
  231. package/types/src/theme/global/borders.d.ts +7 -1
  232. package/types/src/theme/global/colors.d.ts +6 -1
  233. package/types/src/theme/global/index.d.ts +7 -1
  234. package/types/src/theme/global/scale.d.ts +1 -0
  235. package/types/src/theme/global/space.d.ts +0 -0
  236. package/types/src/theme/global/typography.d.ts +0 -0
  237. package/types/src/theme/index.d.ts +10 -0
  238. package/types/src/types.d.ts +0 -0
  239. package/types/src/utils/__tests__/scale.spec.d.ts +0 -0
  240. package/types/src/utils/helpers.d.ts +0 -0
  241. package/types/src/utils/hooks.d.ts +1 -0
  242. package/types/src/utils/scale.d.ts +0 -0
  243. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +0 -34
  244. package/testUtils/setup.ts +0 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -20,11 +20,12 @@
20
20
  "dependencies": {
21
21
  "@emotion/native": "^11.9.3",
22
22
  "@emotion/react": "^11.9.3",
23
- "@hero-design/colors": "7.2.0"
23
+ "@hero-design/colors": "7.3.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "17.0.2",
27
27
  "react-native": "0.65.1",
28
+ "react-native-pager-view": "^5.4.25",
28
29
  "react-native-safe-area-context": "^4.2.5",
29
30
  "react-native-vector-icons": "^9.1.0"
30
31
  },
@@ -62,6 +63,7 @@
62
63
  "prettier": "^2.5.1",
63
64
  "react": "17.0.2",
64
65
  "react-native": "0.65.1",
66
+ "react-native-pager-view": "^5.4.25",
65
67
  "react-native-safe-area-context": "^4.2.5",
66
68
  "react-native-screens": "^3.13.1",
67
69
  "react-native-vector-icons": "^9.1.0",
@@ -70,41 +72,5 @@
70
72
  "rollup-plugin-copy": "^3.4.0",
71
73
  "ts-jest": "^27.0.7",
72
74
  "typescript": "^4.5.5"
73
- },
74
- "nx": {
75
- "targets": {
76
- "type-check": {
77
- "dependsOn": [
78
- {
79
- "target": "build:types",
80
- "projects": "dependencies"
81
- }
82
- ]
83
- },
84
- "lint": {
85
- "dependsOn": [
86
- {
87
- "target": "build:js",
88
- "projects": "dependencies"
89
- }
90
- ]
91
- },
92
- "test:ci": {
93
- "dependsOn": [
94
- {
95
- "target": "build",
96
- "projects": "dependencies"
97
- }
98
- ]
99
- },
100
- "dev": {
101
- "dependsOn": [
102
- {
103
- "target": "build",
104
- "projects": "dependencies"
105
- }
106
- ]
107
- }
108
- }
109
75
  }
110
76
  }
@@ -0,0 +1,102 @@
1
+ import React from 'react';
2
+ import { Alert, View } from 'react-native';
3
+ import { Avatar, Typography, useTheme } from '../../src/index';
4
+
5
+ const AvatarPlayground = () => {
6
+ const theme = useTheme();
7
+ const source = { uri: 'https://i.pravatar.cc/300' };
8
+ const text = 'MD';
9
+
10
+ const createTwoButtonAlert = () =>
11
+ Alert.alert('Alert Title', 'My Alert Msg', [
12
+ {
13
+ text: 'Cancel',
14
+ onPress: () => {},
15
+ style: 'cancel',
16
+ },
17
+ { text: 'OK', onPress: () => {} },
18
+ ]);
19
+
20
+ return (
21
+ <View
22
+ style={{
23
+ marginVertical: theme.space.medium,
24
+ marginHorizontal: theme.space.medium,
25
+ }}
26
+ >
27
+ <Typography.Text style={{ marginBottom: theme.space.xsmall }}>
28
+ Avatar with different sizes
29
+ </Typography.Text>
30
+ <View
31
+ style={{
32
+ flexDirection: 'row',
33
+ marginBottom: theme.space.large,
34
+ alignItems: 'flex-end',
35
+ }}
36
+ >
37
+ <Avatar source={source} />
38
+ <Avatar
39
+ source={source}
40
+ size="medium"
41
+ style={{ marginLeft: theme.space.xsmall }}
42
+ />
43
+ <Avatar
44
+ source={source}
45
+ size="large"
46
+ style={{ marginLeft: theme.space.xsmall }}
47
+ />
48
+ <Avatar
49
+ source={source}
50
+ size="xlarge"
51
+ style={{ marginLeft: theme.space.xsmall }}
52
+ />
53
+ </View>
54
+
55
+ <Typography.Text style={{ marginBottom: theme.space.xsmall }}>
56
+ Text Avatar with different sizes
57
+ </Typography.Text>
58
+ <View
59
+ style={{
60
+ flexDirection: 'row',
61
+ marginBottom: theme.space.large,
62
+ alignItems: 'flex-end',
63
+ }}
64
+ >
65
+ <Avatar title={text} />
66
+ <Avatar
67
+ title={text}
68
+ size="medium"
69
+ intent="info"
70
+ style={{ marginLeft: theme.space.xsmall }}
71
+ />
72
+ <Avatar
73
+ title={text}
74
+ size="large"
75
+ intent="success"
76
+ style={{ marginLeft: theme.space.xsmall }}
77
+ />
78
+ <Avatar
79
+ title={text}
80
+ size="xlarge"
81
+ intent="danger"
82
+ style={{ marginLeft: theme.space.xsmall }}
83
+ />
84
+ </View>
85
+
86
+ <Typography.Text style={{ marginBottom: theme.space.xsmall }}>
87
+ Pressable avatar
88
+ </Typography.Text>
89
+ <View
90
+ style={{
91
+ flexDirection: 'row',
92
+ marginBottom: theme.space.large,
93
+ alignItems: 'flex-end',
94
+ }}
95
+ >
96
+ <Avatar source={source} onPress={createTwoButtonAlert} size="large" />
97
+ </View>
98
+ </View>
99
+ );
100
+ };
101
+
102
+ export default AvatarPlayground;
@@ -1,17 +1,18 @@
1
1
  import React from 'react';
2
- import { View } from 'react-native';
3
- import { Badge, useTheme } from '../../src/index';
2
+ import { Button, View } from 'react-native';
3
+ import { Badge, Icon, Typography, useTheme } from '../../src/index';
4
4
 
5
5
  const BadgePlayground = () => {
6
6
  const theme = useTheme();
7
+ const [isVisibleBadge, setIsVisibleBadge] = React.useState(true);
8
+ const [isVisibleStatusBadge, setIsVisibleStatusBadge] = React.useState(true);
7
9
 
8
10
  return (
9
- <View
10
- style={{
11
- marginVertical: theme.space.medium,
12
- marginHorizontal: theme.space.medium,
13
- }}
14
- >
11
+ <View style={{ margin: theme.space.medium }}>
12
+ <Typography.Text fontWeight="semi-bold">Standalone</Typography.Text>
13
+ <Typography.Text style={{ marginBottom: theme.space.xsmall }}>
14
+ Text
15
+ </Typography.Text>
15
16
  <View
16
17
  style={{
17
18
  display: 'flex',
@@ -34,6 +35,7 @@ const BadgePlayground = () => {
34
35
  style={{
35
36
  display: 'flex',
36
37
  flexDirection: 'row',
38
+ marginBottom: theme.space.small,
37
39
  }}
38
40
  >
39
41
  <Badge
@@ -41,7 +43,142 @@ const BadgePlayground = () => {
41
43
  intent="danger"
42
44
  style={{ marginEnd: theme.space.small }}
43
45
  />
44
- <Badge content="SUBMITTED" style={{ marginEnd: theme.space.small }} />
46
+ <Badge
47
+ content="SUBMITTED"
48
+ intent="info"
49
+ style={{ marginEnd: theme.space.small }}
50
+ />
51
+ <Badge
52
+ content="ARCHIVED"
53
+ intent="archived"
54
+ style={{ marginEnd: theme.space.small }}
55
+ />
56
+ </View>
57
+
58
+ <Typography.Text style={{ marginBottom: theme.space.xsmall }}>
59
+ Number
60
+ </Typography.Text>
61
+ <View
62
+ style={{
63
+ display: 'flex',
64
+ flexDirection: 'row',
65
+ marginBottom: theme.space.small,
66
+ }}
67
+ >
68
+ <Badge content={9} style={{ marginEnd: theme.space.small }} />
69
+ <Badge content={99} style={{ marginEnd: theme.space.small }} />
70
+ <Badge content={100} />
71
+ </View>
72
+ <View
73
+ style={{
74
+ display: 'flex',
75
+ flexDirection: 'row',
76
+ marginBottom: theme.space.large,
77
+ }}
78
+ >
79
+ <Badge
80
+ content={9}
81
+ style={{ marginEnd: theme.space.small }}
82
+ intent="success"
83
+ />
84
+ <Badge
85
+ content={9}
86
+ max={5}
87
+ style={{ marginEnd: theme.space.small }}
88
+ intent="warning"
89
+ />
90
+ <Badge
91
+ content={90}
92
+ max={80}
93
+ intent="danger"
94
+ style={{ marginEnd: theme.space.small }}
95
+ />
96
+ <Badge
97
+ content={99}
98
+ intent="info"
99
+ style={{ marginEnd: theme.space.small }}
100
+ />
101
+ <Badge max={999} content={1000} intent="archived" />
102
+ </View>
103
+ <Typography.Text style={{ marginBottom: theme.space.xsmall }}>
104
+ Visible Badge
105
+ </Typography.Text>
106
+ <View
107
+ style={{
108
+ display: 'flex',
109
+ flexDirection: 'row',
110
+ marginBottom: theme.space.large,
111
+ }}
112
+ >
113
+ <View
114
+ style={{
115
+ display: 'flex',
116
+ flexDirection: 'row',
117
+ alignItems: 'center',
118
+ marginEnd: theme.space.medium,
119
+ }}
120
+ >
121
+ <Typography.Text style={{ marginEnd: theme.space.small }}>
122
+ Notes
123
+ </Typography.Text>
124
+ <Badge content={1} intent="archived" visible={isVisibleBadge} />
125
+ </View>
126
+ <Button
127
+ title="Click"
128
+ onPress={() => setIsVisibleBadge(visible => !visible)}
129
+ />
130
+ </View>
131
+
132
+ <Typography.Text fontWeight="semi-bold">Status</Typography.Text>
133
+ <View
134
+ style={{
135
+ display: 'flex',
136
+ flexDirection: 'row',
137
+ marginBottom: theme.space.small,
138
+ }}
139
+ >
140
+ <Badge.Status style={{ marginEnd: theme.space.small }}>
141
+ <Icon icon="bell" size="small" />
142
+ </Badge.Status>
143
+ <Badge.Status intent="warning" style={{ marginEnd: theme.space.small }}>
144
+ <Icon icon="bell" size="small" />
145
+ </Badge.Status>
146
+ <Badge.Status intent="info" style={{ marginEnd: theme.space.small }}>
147
+ <Icon icon="bell" size="small" />
148
+ </Badge.Status>
149
+ <Badge.Status intent="success" style={{ marginEnd: theme.space.small }}>
150
+ <Icon icon="bell" size="small" />
151
+ </Badge.Status>
152
+ <Badge.Status
153
+ intent="archived"
154
+ style={{ marginEnd: theme.space.small }}
155
+ >
156
+ <Icon icon="bell" size="small" />
157
+ </Badge.Status>
158
+ <Badge.Status style={{ marginEnd: theme.space.small }}>
159
+ <Typography.Text>Activity</Typography.Text>
160
+ </Badge.Status>
161
+ </View>
162
+ <Typography.Text style={{ marginBottom: theme.space.xsmall }}>
163
+ Visible Status Badge
164
+ </Typography.Text>
165
+ <View
166
+ style={{
167
+ display: 'flex',
168
+ flexDirection: 'row',
169
+ alignItems: 'center',
170
+ }}
171
+ >
172
+ <Badge.Status
173
+ visible={isVisibleStatusBadge}
174
+ style={{ marginEnd: theme.space.small }}
175
+ >
176
+ <Typography.Text>Activity</Typography.Text>
177
+ </Badge.Status>
178
+ <Button
179
+ title="Click"
180
+ onPress={() => setIsVisibleStatusBadge(visible => !visible)}
181
+ />
45
182
  </View>
46
183
  </View>
47
184
  );
@@ -1,66 +1,169 @@
1
1
  import React from 'react';
2
- import { View } from 'react-native';
2
+ import { ScrollView, View } from 'react-native';
3
3
 
4
4
  import { Button, Typography, useTheme } from '../../src/index';
5
5
 
6
6
  const ButtonPlayground = (): JSX.Element => {
7
7
  const theme = useTheme();
8
8
  return (
9
- <View style={{ padding: theme.space.small }}>
9
+ <ScrollView style={{ padding: theme.space.small }}>
10
10
  <Typography.Text style={{ marginBottom: theme.space.xsmall }}>
11
- Different Intents and Sizes from Icon
11
+ Variants
12
12
  </Typography.Text>
13
13
  <View
14
14
  style={{
15
- flexDirection: 'row',
16
- alignItems: 'center',
15
+ flexDirection: 'column',
17
16
  marginBottom: theme.space.large,
18
17
  }}
19
18
  >
20
- <Button.Icon
21
- icon="circle-add-outlined"
22
- intent="text"
23
- size="xsmall"
19
+ <View
20
+ style={{
21
+ backgroundColor: theme.colors.primary,
22
+ paddingVertical: theme.space.large,
23
+ marginBottom: theme.space.medium,
24
+ }}
25
+ >
26
+ <Button
27
+ text="Basic Transparent"
28
+ variant="basic-transparent"
29
+ onPress={() => {}}
30
+ />
31
+ </View>
32
+ <Button
33
+ text="Primary (Filled)"
34
+ variant="filled"
35
+ intent="primary"
36
+ onPress={() => {}}
37
+ style={{ marginBottom: theme.space.medium }}
38
+ />
39
+ <Button
40
+ text="Secondary (Filled)"
41
+ variant="filled"
42
+ intent="secondary"
24
43
  onPress={() => {}}
25
- style={{ marginEnd: theme.space.medium }}
44
+ style={{ marginBottom: theme.space.medium }}
26
45
  />
27
- <Button.Icon
28
- icon="circle-add-outlined"
46
+ <Button
47
+ text="Primary (Outlined)"
48
+ variant="outlined"
29
49
  intent="primary"
30
- size="xsmall"
31
50
  onPress={() => {}}
32
- style={{ marginEnd: theme.space.medium }}
51
+ style={{ marginBottom: theme.space.medium }}
33
52
  />
34
- <Button.Icon
35
- icon="circle-add-outlined"
36
- intent="success"
37
- size="small"
53
+ <Button
54
+ text="Secondary (Outlined)"
55
+ variant="outlined"
56
+ intent="secondary"
38
57
  onPress={() => {}}
39
- style={{ marginEnd: theme.space.medium }}
58
+ style={{ marginBottom: theme.space.medium }}
40
59
  />
41
- <Button.Icon
42
- icon="circle-add-outlined"
43
- intent="info"
44
- size="medium"
60
+ </View>
61
+ <Typography.Text style={{ marginBottom: theme.space.xsmall }}>
62
+ With Icon
63
+ </Typography.Text>
64
+ <View
65
+ style={{
66
+ flexDirection: 'column',
67
+ marginBottom: theme.space.large,
68
+ }}
69
+ >
70
+ <Button
71
+ text="Add Item"
72
+ variant="filled"
73
+ intent="primary"
74
+ icon="add"
75
+ onPress={() => {}}
76
+ style={{ marginBottom: theme.space.medium }}
77
+ />
78
+ <Button
79
+ text="Delete"
80
+ variant="filled"
81
+ intent="primary"
82
+ icon="trash-bin-outlined"
83
+ onPress={() => {}}
84
+ style={{ marginBottom: theme.space.medium }}
85
+ />
86
+ <Button
87
+ text="More"
88
+ variant="outlined"
89
+ intent="secondary"
90
+ rightIcon="arrow-down"
91
+ onPress={() => {}}
92
+ style={{ marginBottom: theme.space.medium }}
93
+ />
94
+ </View>
95
+ <Typography.Text style={{ marginBottom: theme.space.xsmall }}>
96
+ Loading
97
+ </Typography.Text>
98
+ <View
99
+ style={{
100
+ flexDirection: 'column',
101
+ marginBottom: theme.space.large,
102
+ }}
103
+ >
104
+ <View
105
+ style={{
106
+ backgroundColor: theme.colors.primary,
107
+ paddingVertical: theme.space.large,
108
+ marginBottom: theme.space.medium,
109
+ }}
110
+ >
111
+ <Button
112
+ text="Basic Transparent (Loading)"
113
+ variant="basic-transparent"
114
+ onPress={() => {}}
115
+ loading
116
+ />
117
+ </View>
118
+ <Button
119
+ text="Filled (Loading)"
120
+ variant="filled"
121
+ intent="primary"
122
+ onPress={() => {}}
123
+ style={{ marginBottom: theme.space.medium }}
124
+ loading
125
+ />
126
+ <Button
127
+ text="Outlined (Loading)"
128
+ variant="outlined"
129
+ intent="primary"
130
+ onPress={() => {}}
131
+ style={{ marginBottom: theme.space.medium }}
132
+ loading
133
+ />
134
+ </View>
135
+ <Typography.Text style={{ marginBottom: theme.space.xsmall }}>
136
+ Disabled
137
+ </Typography.Text>
138
+ <View
139
+ style={{
140
+ flexDirection: 'column',
141
+ marginBottom: theme.space.large,
142
+ }}
143
+ >
144
+ <Button
145
+ text="Basic Transparent (Disabled)"
146
+ variant="basic-transparent"
45
147
  onPress={() => {}}
46
- style={{ marginEnd: theme.space.medium }}
148
+ style={{ marginBottom: theme.space.medium }}
149
+ disabled
47
150
  />
48
- <Button.Icon
49
- icon="circle-add-outlined"
50
- intent="warning"
51
- size="large"
151
+ <Button
152
+ text="Filled (Disabled)"
153
+ variant="filled"
52
154
  onPress={() => {}}
53
- style={{ marginEnd: theme.space.medium }}
155
+ style={{ marginBottom: theme.space.medium }}
156
+ disabled
54
157
  />
55
- <Button.Icon
56
- icon="circle-add-outlined"
57
- intent="danger"
58
- size="xlarge"
158
+ <Button
159
+ text="Outlined (Disabled)"
160
+ variant="outlined"
59
161
  onPress={() => {}}
60
- style={{ marginEnd: theme.space.medium }}
162
+ style={{ marginBottom: theme.space.medium }}
163
+ disabled
61
164
  />
62
165
  </View>
63
- </View>
166
+ </ScrollView>
64
167
  );
65
168
  };
66
169
 
@@ -6,7 +6,7 @@ import {
6
6
  TouchableOpacity,
7
7
  ScrollView,
8
8
  } from 'react-native';
9
- import { palette } from '@hero-design/colors';
9
+ import palette from '@hero-design/colors';
10
10
  import {
11
11
  scale,
12
12
  Card,
@@ -71,13 +71,7 @@ const ApprovalCard = ({ style }: ViewProps) => {
71
71
  return (
72
72
  <Card
73
73
  style={StyleSheet.flatten([
74
- {
75
- backgroundColor: palette.greyLight90,
76
- paddingTop: 0,
77
- paddingRight: 0,
78
- paddingBottom: 0,
79
- paddingLeft: 0,
80
- },
74
+ { backgroundColor: palette.greyLight90 },
81
75
  style,
82
76
  ])}
83
77
  >
@@ -117,7 +111,7 @@ const DashboardCard = ({
117
111
  const theme = useTheme();
118
112
 
119
113
  return (
120
- <Card style={style}>
114
+ <Card style={StyleSheet.flatten([{ padding: theme.space.small }, style])}>
121
115
  <View style={{ flex: 1, alignItems: 'flex-end' }}>
122
116
  <Icon icon={icon} />
123
117
  </View>
@@ -175,6 +169,7 @@ const RostersCard = (props: ViewProps) => {
175
169
  flexDirection: 'row',
176
170
  alignItems: 'center',
177
171
  backgroundColor: palette.greyLight90,
172
+ padding: theme.space.small,
178
173
  },
179
174
  style,
180
175
  ])}
@@ -184,7 +179,7 @@ const RostersCard = (props: ViewProps) => {
184
179
  style={{
185
180
  padding: theme.space.small,
186
181
  backgroundColor: theme.colors.infoLight,
187
- borderRadius: 999,
182
+ borderRadius: theme.radii.rounded,
188
183
  }}
189
184
  >
190
185
  <Icon icon="calendar-clock" />
@@ -211,10 +206,6 @@ const MyLeaveCard = (props: ViewProps) => {
211
206
  style={StyleSheet.flatten([
212
207
  {
213
208
  backgroundColor: palette.greyLight90,
214
- paddingBottom: 0,
215
- paddingTop: 0,
216
- paddingRight: 0,
217
- paddingLeft: 0,
218
209
  },
219
210
  style,
220
211
  ])}
@@ -274,6 +265,35 @@ const MyLeaveCard = (props: ViewProps) => {
274
265
  );
275
266
  };
276
267
 
268
+ const DataCard = ({ style }: ViewProps) => {
269
+ const theme = useTheme();
270
+
271
+ return (
272
+ <Card variant="data" style={style}>
273
+ <View style={{ padding: theme.space.medium }}>
274
+ <Typography.Text fontSize="small" intent="subdued">
275
+ Update Key Results
276
+ </Typography.Text>
277
+ <Typography.Text
278
+ fontSize="xlarge"
279
+ fontWeight="semi-bold"
280
+ style={{ marginTop: theme.space.small }}
281
+ >
282
+ CX Global Ready
283
+ </Typography.Text>
284
+ <Typography.Text fontSize="small">From 20% to 25%</Typography.Text>
285
+ <Typography.Text
286
+ fontSize="small"
287
+ intent="subdued"
288
+ style={{ marginTop: theme.space.small }}
289
+ >
290
+ Making progress
291
+ </Typography.Text>
292
+ </View>
293
+ </Card>
294
+ );
295
+ };
296
+
277
297
  const CardPlayground = () => {
278
298
  const theme = useTheme();
279
299
 
@@ -309,6 +329,12 @@ const CardPlayground = () => {
309
329
  <RostersCard style={{ marginTop: theme.space.medium }} />
310
330
  <MyLeaveCard style={{ marginTop: theme.space.medium }} />
311
331
  <ApprovalCard style={{ marginTop: theme.space.medium }} />
332
+ <DataCard
333
+ style={{
334
+ marginTop: theme.space.medium,
335
+ backgroundColor: palette.greyLight90,
336
+ }}
337
+ />
312
338
  </ScrollView>
313
339
  );
314
340
  };