@hero-design/rn 7.7.0 → 7.9.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 (221) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/es/index.js +1775 -333
  3. package/lib/index.js +1780 -336
  4. package/package.json +4 -8
  5. package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  6. package/src/components/Avatar/index.tsx +1 -1
  7. package/src/components/Button/Button.tsx +4 -2
  8. package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +7 -2
  9. package/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.tsx +2 -0
  10. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +40 -0
  11. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +242 -0
  12. package/src/components/Button/LoadingIndicator/__tests__/index.spec.tsx +2 -0
  13. package/src/components/Button/LoadingIndicator/index.tsx +3 -1
  14. package/src/components/Button/StyledButton.tsx +15 -2
  15. package/src/components/Button/__tests__/Button.spec.tsx +2 -0
  16. package/src/components/Button/__tests__/StyledButton.spec.tsx +12 -0
  17. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +314 -0
  18. package/src/components/Card/DataCard/StyledDataCard.tsx +18 -0
  19. package/src/components/Card/DataCard/__tests__/StyledDataCard.spec.tsx +24 -0
  20. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +96 -0
  21. package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +151 -0
  22. package/src/components/Card/DataCard/__tests__/index.spec.tsx +30 -0
  23. package/src/components/Card/DataCard/index.tsx +35 -0
  24. package/src/components/Card/StyledCard.tsx +1 -3
  25. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +0 -1
  26. package/src/components/Card/index.tsx +7 -2
  27. package/src/components/Checkbox/index.tsx +1 -1
  28. package/src/components/Collapse/index.tsx +1 -1
  29. package/src/components/Icon/HeroIcon/index.tsx +3 -1
  30. package/src/components/Icon/index.tsx +3 -2
  31. package/src/components/List/BasicListItem.tsx +98 -0
  32. package/src/components/List/ListItem.tsx +142 -0
  33. package/src/components/List/StyledBasicListItem.tsx +34 -0
  34. package/src/components/List/StyledListItem.tsx +82 -0
  35. package/src/components/List/__tests__/BasicListItem.spec.tsx +37 -0
  36. package/src/components/List/__tests__/ListItem.spec.tsx +110 -0
  37. package/src/components/List/__tests__/StyledBasicListItem.spec.tsx +24 -0
  38. package/src/components/List/__tests__/StyledListItem.spec.tsx +48 -0
  39. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +103 -0
  40. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +760 -0
  41. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +105 -0
  42. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +200 -0
  43. package/src/components/List/index.tsx +14 -0
  44. package/src/components/SectionHeading/index.tsx +1 -1
  45. package/src/components/Select/Footer.tsx +13 -0
  46. package/src/components/Select/MultiSelect/Option.tsx +25 -0
  47. package/src/components/Select/MultiSelect/OptionList.tsx +30 -63
  48. package/src/components/Select/MultiSelect/__tests__/Option.spec.tsx +16 -0
  49. package/src/components/Select/MultiSelect/__tests__/OptionList.spec.tsx +42 -0
  50. package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +70 -0
  51. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +627 -0
  52. package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +6 -6
  53. package/src/components/Select/MultiSelect/index.tsx +8 -7
  54. package/src/components/Select/SingleSelect/Option.tsx +23 -0
  55. package/src/components/Select/SingleSelect/OptionList.tsx +43 -0
  56. package/src/components/Select/SingleSelect/__tests__/Option.spec.tsx +16 -0
  57. package/src/components/Select/SingleSelect/__tests__/OptionList.spec.tsx +42 -0
  58. package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +56 -0
  59. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +571 -0
  60. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +1430 -0
  61. package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +89 -0
  62. package/src/components/Select/SingleSelect/index.tsx +89 -0
  63. package/src/components/Select/{MultiSelect/StyledMultiSelect.tsx → StyledSelect.tsx} +1 -1
  64. package/src/components/Select/{MultiSelect/__tests__/StyledMultiSelect.spec.tsx → __tests__/StyledSelect.spec.tsx} +2 -2
  65. package/src/components/Select/{MultiSelect/__tests__/__snapshots__/StyledMultiSelect.spec.tsx.snap → __tests__/__snapshots__/StyledSelect.spec.tsx.snap} +0 -0
  66. package/src/components/Select/helpers.tsx +18 -0
  67. package/src/components/Select/index.tsx +4 -3
  68. package/src/components/Select/{MultiSelect/types.ts → types.ts} +0 -0
  69. package/src/components/Switch/index.tsx +1 -1
  70. package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +2 -2
  71. package/src/components/Toolbar/StyledToolbar.tsx +42 -0
  72. package/src/components/Toolbar/ToolbarGroup.tsx +31 -0
  73. package/src/components/Toolbar/ToolbarItem.tsx +57 -0
  74. package/src/components/Toolbar/__tests__/ToolbarGroup.spec.tsx +32 -0
  75. package/src/components/Toolbar/__tests__/ToolbarItem.spec.tsx +57 -0
  76. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +391 -0
  77. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +355 -0
  78. package/src/components/Toolbar/index.tsx +18 -0
  79. package/src/components/Typography/Text/StyledText.tsx +8 -1
  80. package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +5 -0
  81. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +110 -0
  82. package/src/components/Typography/Text/index.tsx +9 -2
  83. package/src/index.ts +4 -0
  84. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +83 -3
  85. package/src/theme/components/button.ts +2 -0
  86. package/src/theme/components/card.ts +13 -2
  87. package/src/theme/components/icon.ts +1 -0
  88. package/src/theme/components/list.ts +46 -0
  89. package/src/theme/components/toolbar.ts +27 -0
  90. package/src/theme/components/typography.ts +4 -0
  91. package/src/theme/global/colors.ts +9 -2
  92. package/src/theme/global/space.ts +2 -0
  93. package/src/theme/index.ts +6 -0
  94. package/tsconfig.json +1 -2
  95. package/types/components/Avatar/index.d.ts +1 -1
  96. package/types/components/Button/Button.d.ts +2 -2
  97. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +1 -1
  98. package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
  99. package/types/components/Button/StyledButton.d.ts +2 -2
  100. package/types/components/Card/DataCard/StyledDataCard.d.ts +16 -0
  101. package/types/components/{Select/MultiSelect/__tests__/StyledMultiSelect.spec.d.ts → Card/DataCard/__tests__/StyledDataCard.spec.d.ts} +0 -0
  102. package/types/components/Card/DataCard/__tests__/index.spec.d.ts +1 -0
  103. package/types/components/Card/DataCard/index.d.ts +22 -0
  104. package/types/components/Card/index.d.ts +7 -3
  105. package/types/components/Checkbox/index.d.ts +1 -1
  106. package/types/components/Collapse/index.d.ts +1 -1
  107. package/types/components/Icon/HeroIcon/index.d.ts +1 -1
  108. package/types/components/Icon/index.d.ts +2 -2
  109. package/types/components/List/BasicListItem.d.ts +43 -0
  110. package/types/components/List/ListItem.d.ts +51 -0
  111. package/types/components/List/StyledBasicListItem.d.ts +29 -0
  112. package/types/components/List/StyledListItem.d.ts +51 -0
  113. package/types/components/List/__tests__/BasicListItem.spec.d.ts +1 -0
  114. package/types/components/List/__tests__/ListItem.spec.d.ts +1 -0
  115. package/types/components/List/__tests__/StyledBasicListItem.spec.d.ts +1 -0
  116. package/types/components/List/__tests__/StyledListItem.spec.d.ts +1 -0
  117. package/types/components/List/index.d.ts +8 -0
  118. package/types/components/SectionHeading/index.d.ts +1 -1
  119. package/types/components/Select/{MultiSelect/Footer.d.ts → Footer.d.ts} +2 -2
  120. package/types/components/Select/MultiSelect/Option.d.ts +6 -0
  121. package/types/components/Select/MultiSelect/OptionList.d.ts +7 -1
  122. package/types/components/Select/MultiSelect/__tests__/Option.spec.d.ts +1 -0
  123. package/types/components/Select/MultiSelect/__tests__/OptionList.spec.d.ts +1 -0
  124. package/types/components/Select/MultiSelect/index.d.ts +4 -4
  125. package/types/components/Select/SingleSelect/Option.d.ts +6 -0
  126. package/types/components/Select/SingleSelect/OptionList.d.ts +9 -0
  127. package/types/components/Select/SingleSelect/__tests__/Option.spec.d.ts +1 -0
  128. package/types/components/Select/SingleSelect/__tests__/OptionList.spec.d.ts +1 -0
  129. package/types/components/Select/SingleSelect/__tests__/index.spec.d.ts +1 -0
  130. package/types/components/Select/SingleSelect/index.d.ts +35 -0
  131. package/types/components/Select/{MultiSelect/StyledMultiSelect.d.ts → StyledSelect.d.ts} +1 -1
  132. package/types/components/Select/__tests__/StyledSelect.spec.d.ts +1 -0
  133. package/types/components/Select/helpers.d.ts +2 -0
  134. package/types/components/Select/index.d.ts +3 -3
  135. package/types/components/Select/{MultiSelect/types.d.ts → types.d.ts} +0 -0
  136. package/types/components/Switch/index.d.ts +1 -1
  137. package/types/components/Toolbar/StyledToolbar.d.ts +22 -0
  138. package/types/components/Toolbar/ToolbarGroup.d.ts +13 -0
  139. package/types/components/Toolbar/ToolbarItem.d.ts +25 -0
  140. package/types/components/Toolbar/__tests__/ToolbarGroup.spec.d.ts +1 -0
  141. package/types/components/Toolbar/__tests__/ToolbarItem.spec.d.ts +1 -0
  142. package/types/components/Toolbar/index.d.ts +11 -0
  143. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  144. package/types/components/Typography/Text/index.d.ts +2 -2
  145. package/types/index.d.ts +3 -1
  146. package/types/theme/components/button.d.ts +2 -0
  147. package/types/theme/components/card.d.ts +10 -0
  148. package/types/theme/components/icon.d.ts +1 -0
  149. package/types/theme/components/list.d.ts +40 -0
  150. package/types/theme/components/toolbar.d.ts +21 -0
  151. package/types/theme/components/typography.d.ts +4 -0
  152. package/types/theme/global/colors.d.ts +5 -0
  153. package/types/theme/global/index.d.ts +5 -0
  154. package/types/theme/global/space.d.ts +1 -0
  155. package/types/theme/index.d.ts +4 -0
  156. package/playground/.detoxrc.json +0 -49
  157. package/playground/.prettierrc.json +0 -8
  158. package/playground/.turbo/turbo-type-check.log +0 -7
  159. package/playground/app.json +0 -9
  160. package/playground/babel.config.js +0 -63
  161. package/playground/e2e/config.json +0 -9
  162. package/playground/e2e/environment.js +0 -23
  163. package/playground/e2e/firstTest.e2e.js +0 -16
  164. package/playground/expoEntry.js +0 -5
  165. package/playground/fonts/be-vietnam-pro-light.ttf +0 -0
  166. package/playground/fonts/be-vietnam-pro-regular.ttf +0 -0
  167. package/playground/fonts/be-vietnam-pro-semibold.ttf +0 -0
  168. package/playground/fonts/hero-icons.ttf +0 -0
  169. package/playground/index.js +0 -7
  170. package/playground/ios/MobileHeroDesignPlayground/AppDelegate.h +0 -9
  171. package/playground/ios/MobileHeroDesignPlayground/AppDelegate.m +0 -75
  172. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
  173. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/Contents.json +0 -6
  174. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/Contents.json +0 -21
  175. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/image.png +0 -0
  176. package/playground/ios/MobileHeroDesignPlayground/Info.plist +0 -85
  177. package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground-Bridging-Header.h +0 -3
  178. package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground.entitlements +0 -8
  179. package/playground/ios/MobileHeroDesignPlayground/SplashScreen.storyboard +0 -40
  180. package/playground/ios/MobileHeroDesignPlayground/Supporting/Expo.plist +0 -16
  181. package/playground/ios/MobileHeroDesignPlayground/main.m +0 -10
  182. package/playground/ios/MobileHeroDesignPlayground/noop-file.swift +0 -4
  183. package/playground/ios/MobileHeroDesignPlayground.xcodeproj/project.pbxproj +0 -515
  184. package/playground/ios/MobileHeroDesignPlayground.xcodeproj/xcshareddata/xcschemes/MobileHeroDesignPlayground.xcscheme +0 -88
  185. package/playground/ios/MobileHeroDesignPlayground.xcworkspace/contents.xcworkspacedata +0 -10
  186. package/playground/ios/MobileHeroDesignPlayground.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  187. package/playground/ios/Podfile +0 -49
  188. package/playground/ios/Podfile.lock +0 -478
  189. package/playground/ios/Podfile.properties.json +0 -3
  190. package/playground/metro.config.js +0 -24
  191. package/playground/package.json +0 -63
  192. package/playground/src/Alert.tsx +0 -80
  193. package/playground/src/App.tsx +0 -210
  194. package/playground/src/Avatar.tsx +0 -102
  195. package/playground/src/Badge.tsx +0 -187
  196. package/playground/src/BottomNavigation.tsx +0 -72
  197. package/playground/src/BottomSheet.tsx +0 -43
  198. package/playground/src/Button.tsx +0 -170
  199. package/playground/src/Card.tsx +0 -342
  200. package/playground/src/Checkbox.tsx +0 -55
  201. package/playground/src/Collapse.tsx +0 -99
  202. package/playground/src/ContentNavigator.tsx +0 -58
  203. package/playground/src/Divider.tsx +0 -13
  204. package/playground/src/Drawer.tsx +0 -32
  205. package/playground/src/FAB.tsx +0 -66
  206. package/playground/src/Icon.tsx +0 -144
  207. package/playground/src/IconButton.tsx +0 -78
  208. package/playground/src/MultipleThemes.tsx +0 -34
  209. package/playground/src/Progress.tsx +0 -95
  210. package/playground/src/Radio.tsx +0 -25
  211. package/playground/src/SectionHeading.tsx +0 -68
  212. package/playground/src/Select.tsx +0 -32
  213. package/playground/src/Spinner.tsx +0 -19
  214. package/playground/src/Switch.tsx +0 -80
  215. package/playground/src/Tabs.tsx +0 -136
  216. package/playground/src/Tag.tsx +0 -45
  217. package/playground/src/TextInput.tsx +0 -14
  218. package/playground/src/Toast.tsx +0 -114
  219. package/playground/src/Typography.tsx +0 -23
  220. package/playground/tsconfig.json +0 -21
  221. package/src/components/Select/MultiSelect/Footer.tsx +0 -15
@@ -0,0 +1,355 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`ToolbarItems renders correctly when disabled 1`] = `
4
+ <View
5
+ accessible={true}
6
+ collapsable={false}
7
+ focusable={true}
8
+ nativeID="animatedComponent"
9
+ onClick={[Function]}
10
+ onResponderGrant={[Function]}
11
+ onResponderMove={[Function]}
12
+ onResponderRelease={[Function]}
13
+ onResponderTerminate={[Function]}
14
+ onResponderTerminationRequest={[Function]}
15
+ onStartShouldSetResponder={[Function]}
16
+ style={
17
+ Object {
18
+ "alignItems": "center",
19
+ "opacity": 1,
20
+ "paddingHorizontal": 12,
21
+ "paddingVertical": 8,
22
+ }
23
+ }
24
+ >
25
+ <HeroIcon
26
+ name="home"
27
+ style={
28
+ Array [
29
+ Object {
30
+ "color": "#8b8d92",
31
+ "fontSize": 24,
32
+ },
33
+ undefined,
34
+ ]
35
+ }
36
+ testID="toolbar-item-icon-home"
37
+ themeIntent="disabled-text"
38
+ themeSize="medium"
39
+ />
40
+ <Text
41
+ style={
42
+ Array [
43
+ Object {
44
+ "color": "#8b8d92",
45
+ "fontFamily": "BeVietnamPro-SemiBold",
46
+ "fontSize": 12,
47
+ "letterSpacing": 0.36,
48
+ "lineHeight": 20,
49
+ },
50
+ undefined,
51
+ ]
52
+ }
53
+ themeFontSize="small"
54
+ themeFontWeight="semi-bold"
55
+ themeIntent="subdued"
56
+ >
57
+ Action
58
+ </Text>
59
+ </View>
60
+ `;
61
+
62
+ exports[`ToolbarItems renders correctly when intent is danger 1`] = `
63
+ <View
64
+ accessible={true}
65
+ collapsable={false}
66
+ focusable={true}
67
+ nativeID="animatedComponent"
68
+ onClick={[Function]}
69
+ onResponderGrant={[Function]}
70
+ onResponderMove={[Function]}
71
+ onResponderRelease={[Function]}
72
+ onResponderTerminate={[Function]}
73
+ onResponderTerminationRequest={[Function]}
74
+ onStartShouldSetResponder={[Function]}
75
+ style={
76
+ Object {
77
+ "alignItems": "center",
78
+ "opacity": 1,
79
+ "paddingHorizontal": 12,
80
+ "paddingVertical": 8,
81
+ }
82
+ }
83
+ >
84
+ <HeroIcon
85
+ name="home"
86
+ style={
87
+ Array [
88
+ Object {
89
+ "color": "#de350b",
90
+ "fontSize": 24,
91
+ },
92
+ undefined,
93
+ ]
94
+ }
95
+ testID="toolbar-item-icon-home"
96
+ themeIntent="danger"
97
+ themeSize="medium"
98
+ />
99
+ <Text
100
+ style={
101
+ Array [
102
+ Object {
103
+ "color": "#de350b",
104
+ "fontFamily": "BeVietnamPro-SemiBold",
105
+ "fontSize": 12,
106
+ "letterSpacing": 0.36,
107
+ "lineHeight": 20,
108
+ },
109
+ undefined,
110
+ ]
111
+ }
112
+ themeFontSize="small"
113
+ themeFontWeight="semi-bold"
114
+ themeIntent="danger"
115
+ >
116
+ Action
117
+ </Text>
118
+ </View>
119
+ `;
120
+
121
+ exports[`ToolbarItems renders correctly when intent is info 1`] = `
122
+ <View
123
+ accessible={true}
124
+ collapsable={false}
125
+ focusable={true}
126
+ nativeID="animatedComponent"
127
+ onClick={[Function]}
128
+ onResponderGrant={[Function]}
129
+ onResponderMove={[Function]}
130
+ onResponderRelease={[Function]}
131
+ onResponderTerminate={[Function]}
132
+ onResponderTerminationRequest={[Function]}
133
+ onStartShouldSetResponder={[Function]}
134
+ style={
135
+ Object {
136
+ "alignItems": "center",
137
+ "opacity": 1,
138
+ "paddingHorizontal": 12,
139
+ "paddingVertical": 8,
140
+ }
141
+ }
142
+ >
143
+ <HeroIcon
144
+ name="home"
145
+ style={
146
+ Array [
147
+ Object {
148
+ "color": "#4568fb",
149
+ "fontSize": 24,
150
+ },
151
+ undefined,
152
+ ]
153
+ }
154
+ testID="toolbar-item-icon-home"
155
+ themeIntent="info"
156
+ themeSize="medium"
157
+ />
158
+ <Text
159
+ style={
160
+ Array [
161
+ Object {
162
+ "color": "#4568fb",
163
+ "fontFamily": "BeVietnamPro-SemiBold",
164
+ "fontSize": 12,
165
+ "letterSpacing": 0.36,
166
+ "lineHeight": 20,
167
+ },
168
+ undefined,
169
+ ]
170
+ }
171
+ themeFontSize="small"
172
+ themeFontWeight="semi-bold"
173
+ themeIntent="info"
174
+ >
175
+ Action
176
+ </Text>
177
+ </View>
178
+ `;
179
+
180
+ exports[`ToolbarItems renders correctly when intent is primary 1`] = `
181
+ <View
182
+ accessible={true}
183
+ collapsable={false}
184
+ focusable={true}
185
+ nativeID="animatedComponent"
186
+ onClick={[Function]}
187
+ onResponderGrant={[Function]}
188
+ onResponderMove={[Function]}
189
+ onResponderRelease={[Function]}
190
+ onResponderTerminate={[Function]}
191
+ onResponderTerminationRequest={[Function]}
192
+ onStartShouldSetResponder={[Function]}
193
+ style={
194
+ Object {
195
+ "alignItems": "center",
196
+ "opacity": 1,
197
+ "paddingHorizontal": 12,
198
+ "paddingVertical": 8,
199
+ }
200
+ }
201
+ >
202
+ <HeroIcon
203
+ name="home"
204
+ style={
205
+ Array [
206
+ Object {
207
+ "color": "#7622d7",
208
+ "fontSize": 24,
209
+ },
210
+ undefined,
211
+ ]
212
+ }
213
+ testID="toolbar-item-icon-home"
214
+ themeIntent="primary"
215
+ themeSize="medium"
216
+ />
217
+ <Text
218
+ style={
219
+ Array [
220
+ Object {
221
+ "color": "#7622d7",
222
+ "fontFamily": "BeVietnamPro-SemiBold",
223
+ "fontSize": 12,
224
+ "letterSpacing": 0.36,
225
+ "lineHeight": 20,
226
+ },
227
+ undefined,
228
+ ]
229
+ }
230
+ themeFontSize="small"
231
+ themeFontWeight="semi-bold"
232
+ themeIntent="primary"
233
+ >
234
+ Action
235
+ </Text>
236
+ </View>
237
+ `;
238
+
239
+ exports[`ToolbarItems renders correctly when intent is success 1`] = `
240
+ <View
241
+ accessible={true}
242
+ collapsable={false}
243
+ focusable={true}
244
+ nativeID="animatedComponent"
245
+ onClick={[Function]}
246
+ onResponderGrant={[Function]}
247
+ onResponderMove={[Function]}
248
+ onResponderRelease={[Function]}
249
+ onResponderTerminate={[Function]}
250
+ onResponderTerminationRequest={[Function]}
251
+ onStartShouldSetResponder={[Function]}
252
+ style={
253
+ Object {
254
+ "alignItems": "center",
255
+ "opacity": 1,
256
+ "paddingHorizontal": 12,
257
+ "paddingVertical": 8,
258
+ }
259
+ }
260
+ >
261
+ <HeroIcon
262
+ name="home"
263
+ style={
264
+ Array [
265
+ Object {
266
+ "color": "#01b39c",
267
+ "fontSize": 24,
268
+ },
269
+ undefined,
270
+ ]
271
+ }
272
+ testID="toolbar-item-icon-home"
273
+ themeIntent="success"
274
+ themeSize="medium"
275
+ />
276
+ <Text
277
+ style={
278
+ Array [
279
+ Object {
280
+ "color": "#01b39c",
281
+ "fontFamily": "BeVietnamPro-SemiBold",
282
+ "fontSize": 12,
283
+ "letterSpacing": 0.36,
284
+ "lineHeight": 20,
285
+ },
286
+ undefined,
287
+ ]
288
+ }
289
+ themeFontSize="small"
290
+ themeFontWeight="semi-bold"
291
+ themeIntent="success"
292
+ >
293
+ Action
294
+ </Text>
295
+ </View>
296
+ `;
297
+
298
+ exports[`ToolbarItems renders correctly when intent is warning 1`] = `
299
+ <View
300
+ accessible={true}
301
+ collapsable={false}
302
+ focusable={true}
303
+ nativeID="animatedComponent"
304
+ onClick={[Function]}
305
+ onResponderGrant={[Function]}
306
+ onResponderMove={[Function]}
307
+ onResponderRelease={[Function]}
308
+ onResponderTerminate={[Function]}
309
+ onResponderTerminationRequest={[Function]}
310
+ onStartShouldSetResponder={[Function]}
311
+ style={
312
+ Object {
313
+ "alignItems": "center",
314
+ "opacity": 1,
315
+ "paddingHorizontal": 12,
316
+ "paddingVertical": 8,
317
+ }
318
+ }
319
+ >
320
+ <HeroIcon
321
+ name="home"
322
+ style={
323
+ Array [
324
+ Object {
325
+ "color": "#ffa234",
326
+ "fontSize": 24,
327
+ },
328
+ undefined,
329
+ ]
330
+ }
331
+ testID="toolbar-item-icon-home"
332
+ themeIntent="warning"
333
+ themeSize="medium"
334
+ />
335
+ <Text
336
+ style={
337
+ Array [
338
+ Object {
339
+ "color": "#ffa234",
340
+ "fontFamily": "BeVietnamPro-SemiBold",
341
+ "fontSize": 12,
342
+ "letterSpacing": 0.36,
343
+ "lineHeight": 20,
344
+ },
345
+ undefined,
346
+ ]
347
+ }
348
+ themeFontSize="small"
349
+ themeFontWeight="semi-bold"
350
+ themeIntent="warning"
351
+ >
352
+ Action
353
+ </Text>
354
+ </View>
355
+ `;
@@ -0,0 +1,18 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { ToolbarWrapper } from './StyledToolbar';
3
+ import ToolbarGroup from './ToolbarGroup';
4
+
5
+ export interface ToolbarProps {
6
+ /**
7
+ * Toolbar's content.
8
+ */
9
+ children?: ReactNode;
10
+ }
11
+
12
+ const Toolbar = ({ children }: ToolbarProps) => (
13
+ <ToolbarWrapper>{children}</ToolbarWrapper>
14
+ );
15
+
16
+ export default Object.assign(Toolbar, {
17
+ Group: ToolbarGroup,
18
+ });
@@ -10,7 +10,14 @@ const FONTWEIGHT_MAP = {
10
10
  const StyledText = styled(Text)<{
11
11
  themeFontSize: 'small' | 'medium' | 'large' | 'xlarge';
12
12
  themeFontWeight: 'light' | 'regular' | 'semi-bold';
13
- themeIntent: 'body' | 'subdued' | 'primary';
13
+ themeIntent:
14
+ | 'body'
15
+ | 'subdued'
16
+ | 'primary'
17
+ | 'success'
18
+ | 'info'
19
+ | 'warning'
20
+ | 'danger';
14
21
  }>(({ themeFontSize, themeFontWeight, themeIntent, theme }) => {
15
22
  const sizeStyles = {
16
23
  fontSize: theme.__hd__.typography.fontSizes[themeFontSize],
@@ -46,6 +46,11 @@ describe('StyledText', () => {
46
46
  intent
47
47
  ${'body'}
48
48
  ${'subdued'}
49
+ ${'primary'}
50
+ ${'success'}
51
+ ${'info'}
52
+ ${'warning'}
53
+ ${'danger'}
49
54
  `('has $intent intent style', ({ intent }) => {
50
55
  const { toJSON } = renderWithTheme(
51
56
  <StyledText
@@ -22,6 +22,50 @@ exports[`StyledText has body intent style 1`] = `
22
22
  </Text>
23
23
  `;
24
24
 
25
+ exports[`StyledText has danger intent style 1`] = `
26
+ <Text
27
+ style={
28
+ Array [
29
+ Object {
30
+ "color": "#de350b",
31
+ "fontFamily": "BeVietnamPro-Regular",
32
+ "fontSize": 14,
33
+ "letterSpacing": 0.42,
34
+ "lineHeight": 22,
35
+ },
36
+ undefined,
37
+ ]
38
+ }
39
+ themeFontSize="medium"
40
+ themeFontWeight="regular"
41
+ themeIntent="danger"
42
+ >
43
+ This is a test
44
+ </Text>
45
+ `;
46
+
47
+ exports[`StyledText has info intent style 1`] = `
48
+ <Text
49
+ style={
50
+ Array [
51
+ Object {
52
+ "color": "#4568fb",
53
+ "fontFamily": "BeVietnamPro-Regular",
54
+ "fontSize": 14,
55
+ "letterSpacing": 0.42,
56
+ "lineHeight": 22,
57
+ },
58
+ undefined,
59
+ ]
60
+ }
61
+ themeFontSize="medium"
62
+ themeFontWeight="regular"
63
+ themeIntent="info"
64
+ >
65
+ This is a test
66
+ </Text>
67
+ `;
68
+
25
69
  exports[`StyledText has large fontSize style 1`] = `
26
70
  <Text
27
71
  style={
@@ -88,6 +132,28 @@ exports[`StyledText has medium fontSize style 1`] = `
88
132
  </Text>
89
133
  `;
90
134
 
135
+ exports[`StyledText has primary intent style 1`] = `
136
+ <Text
137
+ style={
138
+ Array [
139
+ Object {
140
+ "color": "#7622d7",
141
+ "fontFamily": "BeVietnamPro-Regular",
142
+ "fontSize": 14,
143
+ "letterSpacing": 0.42,
144
+ "lineHeight": 22,
145
+ },
146
+ undefined,
147
+ ]
148
+ }
149
+ themeFontSize="medium"
150
+ themeFontWeight="regular"
151
+ themeIntent="primary"
152
+ >
153
+ This is a test
154
+ </Text>
155
+ `;
156
+
91
157
  exports[`StyledText has regular fontWeight style 1`] = `
92
158
  <Text
93
159
  style={
@@ -176,6 +242,50 @@ exports[`StyledText has subdued intent style 1`] = `
176
242
  </Text>
177
243
  `;
178
244
 
245
+ exports[`StyledText has success intent style 1`] = `
246
+ <Text
247
+ style={
248
+ Array [
249
+ Object {
250
+ "color": "#01b39c",
251
+ "fontFamily": "BeVietnamPro-Regular",
252
+ "fontSize": 14,
253
+ "letterSpacing": 0.42,
254
+ "lineHeight": 22,
255
+ },
256
+ undefined,
257
+ ]
258
+ }
259
+ themeFontSize="medium"
260
+ themeFontWeight="regular"
261
+ themeIntent="success"
262
+ >
263
+ This is a test
264
+ </Text>
265
+ `;
266
+
267
+ exports[`StyledText has warning intent style 1`] = `
268
+ <Text
269
+ style={
270
+ Array [
271
+ Object {
272
+ "color": "#ffa234",
273
+ "fontFamily": "BeVietnamPro-Regular",
274
+ "fontSize": 14,
275
+ "letterSpacing": 0.42,
276
+ "lineHeight": 22,
277
+ },
278
+ undefined,
279
+ ]
280
+ }
281
+ themeFontSize="medium"
282
+ themeFontWeight="regular"
283
+ themeIntent="warning"
284
+ >
285
+ This is a test
286
+ </Text>
287
+ `;
288
+
179
289
  exports[`StyledText has xlarge fontSize style 1`] = `
180
290
  <Text
181
291
  style={
@@ -22,9 +22,16 @@ export interface TextProps extends NativeTextProps {
22
22
  /**
23
23
  * Visual intent color to apply to the text.
24
24
  */
25
- intent?: 'body' | 'subdued' | 'primary';
25
+ intent?:
26
+ | 'body'
27
+ | 'subdued'
28
+ | 'primary'
29
+ | 'success'
30
+ | 'info'
31
+ | 'warning'
32
+ | 'danger';
26
33
  /**
27
- * Addditional style.
34
+ * Additional style.
28
35
  */
29
36
  style?: StyleProp<TextStyle>;
30
37
  /**
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ import Divider from './components/Divider';
15
15
  import Drawer from './components/Drawer';
16
16
  import FAB from './components/FAB';
17
17
  import Icon from './components/Icon';
18
+ import List from './components/List';
18
19
  import Progress from './components/Progress';
19
20
  import Spinner from './components/Spinner';
20
21
  import Radio from './components/Radio';
@@ -25,6 +26,7 @@ import Tabs from './components/Tabs';
25
26
  import Tag from './components/Tag';
26
27
  import TextInput from './components/TextInput';
27
28
  import Toast from './components/Toast';
29
+ import Toolbar from './components/Toolbar';
28
30
  import Typography from './components/Typography';
29
31
 
30
32
  export {
@@ -47,6 +49,7 @@ export {
47
49
  Drawer,
48
50
  FAB,
49
51
  Icon,
52
+ List,
50
53
  Progress,
51
54
  Spinner,
52
55
  Radio,
@@ -57,6 +60,7 @@ export {
57
60
  Tag,
58
61
  TextInput,
59
62
  Toast,
63
+ Toolbar,
60
64
  Typography,
61
65
  };
62
66