@hero-design/rn 7.9.0 → 7.10.1

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 (252) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/assets/fonts/hero-icons.ttf +0 -0
  3. package/es/index.js +731 -252
  4. package/lib/assets/fonts/hero-icons.ttf +0 -0
  5. package/lib/index.js +730 -251
  6. package/package.json +2 -2
  7. package/src/components/Button/Button.tsx +10 -2
  8. package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +7 -1
  9. package/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.tsx +3 -0
  10. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +60 -0
  11. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +363 -0
  12. package/src/components/Button/LoadingIndicator/__tests__/index.spec.tsx +3 -0
  13. package/src/components/Button/LoadingIndicator/index.tsx +4 -1
  14. package/src/components/Button/StyledButton.tsx +57 -1
  15. package/src/components/Button/UtilityButton/__tests__/__snapshots__/index.spec.tsx.snap +167 -0
  16. package/src/components/Button/UtilityButton/__tests__/index.spec.tsx +55 -0
  17. package/src/components/Button/UtilityButton/index.tsx +53 -0
  18. package/src/components/Button/UtilityButton/styled.tsx +25 -0
  19. package/src/components/Button/__tests__/Button.spec.tsx +3 -0
  20. package/src/components/Button/__tests__/StyledButton.spec.tsx +18 -0
  21. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +468 -0
  22. package/src/components/Button/index.tsx +3 -0
  23. package/src/components/Icon/HeroIcon/selection.json +1 -1
  24. package/src/components/Icon/IconList.ts +2 -0
  25. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +248 -94
  26. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +248 -94
  27. package/src/components/TextInput/StyledTextInput.tsx +133 -11
  28. package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +143 -7
  29. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +922 -15
  30. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +2078 -0
  31. package/src/components/TextInput/__tests__/index.spec.tsx +302 -11
  32. package/src/components/TextInput/index.tsx +232 -28
  33. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +69 -3
  34. package/src/theme/components/button.ts +6 -0
  35. package/src/theme/components/textInput.ts +62 -3
  36. package/src/theme/global/colors.ts +1 -0
  37. package/src/types.ts +8 -1
  38. package/types/components/Alert/StyledAlert.d.ts +0 -0
  39. package/types/components/Alert/__tests__/index.spec.d.ts +0 -0
  40. package/types/components/Alert/index.d.ts +0 -0
  41. package/types/components/Avatar/StyledAvatar.d.ts +0 -0
  42. package/types/components/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -0
  43. package/types/components/Avatar/__tests__/index.spec.d.ts +0 -0
  44. package/types/components/Avatar/index.d.ts +0 -0
  45. package/types/components/Badge/Status.d.ts +0 -0
  46. package/types/components/Badge/StyledBadge.d.ts +0 -0
  47. package/types/components/Badge/__tests__/Badge.spec.d.ts +0 -0
  48. package/types/components/Badge/__tests__/Status.spec.d.ts +0 -0
  49. package/types/components/Badge/index.d.ts +0 -0
  50. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
  51. package/types/components/BottomNavigation/__tests__/index.spec.d.ts +0 -0
  52. package/types/components/BottomNavigation/index.d.ts +0 -0
  53. package/types/components/BottomSheet/Footer.d.ts +0 -0
  54. package/types/components/BottomSheet/Header.d.ts +0 -0
  55. package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
  56. package/types/components/BottomSheet/__tests__/index.spec.d.ts +0 -0
  57. package/types/components/BottomSheet/index.d.ts +0 -0
  58. package/types/components/Button/Button.d.ts +2 -2
  59. package/types/components/Button/IconButton.d.ts +0 -0
  60. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +1 -1
  61. package/types/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +0 -0
  62. package/types/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +0 -0
  63. package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
  64. package/types/components/Button/StyledButton.d.ts +1 -1
  65. package/types/components/Button/UtilityButton/__tests__/index.spec.d.ts +1 -0
  66. package/types/components/Button/UtilityButton/index.d.ts +23 -0
  67. package/types/components/Button/UtilityButton/styled.d.ts +17 -0
  68. package/types/components/Button/__tests__/Button.spec.d.ts +0 -0
  69. package/types/components/Button/__tests__/IconButton.spec.d.ts +0 -0
  70. package/types/components/Button/__tests__/StyledButton.spec.d.ts +0 -0
  71. package/types/components/Button/index.d.ts +2 -0
  72. package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -0
  73. package/types/components/Card/DataCard/__tests__/StyledDataCard.spec.d.ts +0 -0
  74. package/types/components/Card/DataCard/__tests__/index.spec.d.ts +0 -0
  75. package/types/components/Card/DataCard/index.d.ts +0 -0
  76. package/types/components/Card/StyledCard.d.ts +0 -0
  77. package/types/components/Card/__tests__/StyledCard.spec.d.ts +0 -0
  78. package/types/components/Card/__tests__/index.spec.d.ts +0 -0
  79. package/types/components/Card/index.d.ts +0 -0
  80. package/types/components/Checkbox/StyledCheckbox.d.ts +0 -0
  81. package/types/components/Checkbox/__tests__/StyledCheckbox.spec.d.ts +0 -0
  82. package/types/components/Checkbox/__tests__/index.spec.d.ts +0 -0
  83. package/types/components/Checkbox/index.d.ts +0 -0
  84. package/types/components/Collapse/StyledCollapse.d.ts +0 -0
  85. package/types/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -0
  86. package/types/components/Collapse/__tests__/index.spec.d.ts +0 -0
  87. package/types/components/Collapse/index.d.ts +0 -0
  88. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
  89. package/types/components/ContentNavigator/__tests__/StyledContentNavigator.spec.d.ts +0 -0
  90. package/types/components/ContentNavigator/__tests__/index.spec.d.ts +0 -0
  91. package/types/components/ContentNavigator/index.d.ts +0 -0
  92. package/types/components/Divider/StyledDivider.d.ts +0 -0
  93. package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -0
  94. package/types/components/Divider/index.d.ts +0 -0
  95. package/types/components/Drawer/StyledDrawer.d.ts +0 -0
  96. package/types/components/Drawer/__tests__/index.spec.d.ts +0 -0
  97. package/types/components/Drawer/index.d.ts +0 -0
  98. package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
  99. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
  100. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
  101. package/types/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -0
  102. package/types/components/FAB/ActionGroup/index.d.ts +0 -0
  103. package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
  104. package/types/components/FAB/FAB.d.ts +0 -0
  105. package/types/components/FAB/StyledFAB.d.ts +0 -0
  106. package/types/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -0
  107. package/types/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -0
  108. package/types/components/FAB/__tests__/index.spec.d.ts +0 -0
  109. package/types/components/FAB/index.d.ts +0 -0
  110. package/types/components/Icon/HeroIcon/index.d.ts +0 -0
  111. package/types/components/Icon/IconList.d.ts +1 -1
  112. package/types/components/Icon/__tests__/index.spec.d.ts +0 -0
  113. package/types/components/Icon/index.d.ts +0 -0
  114. package/types/components/Icon/utils.d.ts +1 -1
  115. package/types/components/List/BasicListItem.d.ts +0 -0
  116. package/types/components/List/ListItem.d.ts +0 -0
  117. package/types/components/List/StyledBasicListItem.d.ts +0 -0
  118. package/types/components/List/StyledListItem.d.ts +0 -0
  119. package/types/components/List/__tests__/BasicListItem.spec.d.ts +0 -0
  120. package/types/components/List/__tests__/ListItem.spec.d.ts +0 -0
  121. package/types/components/List/__tests__/StyledBasicListItem.spec.d.ts +0 -0
  122. package/types/components/List/__tests__/StyledListItem.spec.d.ts +0 -0
  123. package/types/components/List/index.d.ts +0 -0
  124. package/types/components/Progress/ProgressBar.d.ts +0 -0
  125. package/types/components/Progress/ProgressCircle.d.ts +0 -0
  126. package/types/components/Progress/StyledProgressBar.d.ts +0 -0
  127. package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
  128. package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
  129. package/types/components/Progress/index.d.ts +0 -0
  130. package/types/components/Progress/types.d.ts +0 -0
  131. package/types/components/Radio/Radio.d.ts +0 -0
  132. package/types/components/Radio/RadioGroup.d.ts +0 -0
  133. package/types/components/Radio/StyledRadio.d.ts +0 -0
  134. package/types/components/Radio/__tests__/Radio.spec.d.ts +0 -0
  135. package/types/components/Radio/__tests__/RadioGroup.spec.d.ts +0 -0
  136. package/types/components/Radio/__tests__/StyledRadio.spec.d.ts +0 -0
  137. package/types/components/Radio/index.d.ts +0 -0
  138. package/types/components/Radio/types.d.ts +0 -0
  139. package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
  140. package/types/components/SectionHeading/__tests__/StyledHeading.spec.d.ts +0 -0
  141. package/types/components/SectionHeading/__tests__/index.spec.d.ts +0 -0
  142. package/types/components/SectionHeading/index.d.ts +0 -0
  143. package/types/components/Select/Footer.d.ts +0 -0
  144. package/types/components/Select/MultiSelect/Option.d.ts +0 -0
  145. package/types/components/Select/MultiSelect/OptionList.d.ts +0 -0
  146. package/types/components/Select/MultiSelect/__tests__/Option.spec.d.ts +0 -0
  147. package/types/components/Select/MultiSelect/__tests__/OptionList.spec.d.ts +0 -0
  148. package/types/components/Select/MultiSelect/__tests__/index.spec.d.ts +0 -0
  149. package/types/components/Select/MultiSelect/index.d.ts +0 -0
  150. package/types/components/Select/SingleSelect/Option.d.ts +0 -0
  151. package/types/components/Select/SingleSelect/OptionList.d.ts +0 -0
  152. package/types/components/Select/SingleSelect/__tests__/Option.spec.d.ts +0 -0
  153. package/types/components/Select/SingleSelect/__tests__/OptionList.spec.d.ts +0 -0
  154. package/types/components/Select/SingleSelect/__tests__/index.spec.d.ts +0 -0
  155. package/types/components/Select/SingleSelect/index.d.ts +0 -0
  156. package/types/components/Select/StyledSelect.d.ts +0 -0
  157. package/types/components/Select/__tests__/StyledSelect.spec.d.ts +0 -0
  158. package/types/components/Select/helpers.d.ts +0 -0
  159. package/types/components/Select/index.d.ts +0 -0
  160. package/types/components/Select/types.d.ts +0 -0
  161. package/types/components/Spinner/AnimatedSpinner.d.ts +0 -0
  162. package/types/components/Spinner/StyledSpinner.d.ts +0 -0
  163. package/types/components/Spinner/__tests__/AnimatedSpinner.spec.d.ts +0 -0
  164. package/types/components/Spinner/__tests__/StyledSpinner.spec.d.ts +0 -0
  165. package/types/components/Spinner/__tests__/index.spec.d.ts +0 -0
  166. package/types/components/Spinner/index.d.ts +0 -0
  167. package/types/components/Switch/StyledSwitch.d.ts +0 -0
  168. package/types/components/Switch/__tests__/StyledHeading.spec.d.ts +0 -0
  169. package/types/components/Switch/__tests__/index.spec.d.ts +0 -0
  170. package/types/components/Switch/index.d.ts +0 -0
  171. package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
  172. package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
  173. package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
  174. package/types/components/Tabs/StyledTabs.d.ts +0 -0
  175. package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -0
  176. package/types/components/Tabs/__tests__/index.spec.d.ts +0 -0
  177. package/types/components/Tabs/index.d.ts +0 -0
  178. package/types/components/Tabs/utils.d.ts +0 -0
  179. package/types/components/Tag/StyledTag.d.ts +0 -0
  180. package/types/components/Tag/__tests__/Tag.spec.d.ts +0 -0
  181. package/types/components/Tag/index.d.ts +0 -0
  182. package/types/components/TextInput/StyledTextInput.d.ts +82 -3
  183. package/types/components/TextInput/__tests__/StyledTextInput.spec.d.ts +0 -0
  184. package/types/components/TextInput/__tests__/index.spec.d.ts +0 -0
  185. package/types/components/TextInput/index.d.ts +33 -5
  186. package/types/components/Toast/StyledToast.d.ts +0 -0
  187. package/types/components/Toast/Toast.d.ts +0 -0
  188. package/types/components/Toast/ToastContainer.d.ts +0 -0
  189. package/types/components/Toast/ToastContext.d.ts +0 -0
  190. package/types/components/Toast/ToastProvider.d.ts +0 -0
  191. package/types/components/Toast/__tests__/Toast.spec.d.ts +0 -0
  192. package/types/components/Toast/__tests__/ToastContainer.spec.d.ts +0 -0
  193. package/types/components/Toast/index.d.ts +0 -0
  194. package/types/components/Toast/types.d.ts +0 -0
  195. package/types/components/Toolbar/StyledToolbar.d.ts +0 -0
  196. package/types/components/Toolbar/ToolbarGroup.d.ts +0 -0
  197. package/types/components/Toolbar/ToolbarItem.d.ts +0 -0
  198. package/types/components/Toolbar/__tests__/ToolbarGroup.spec.d.ts +0 -0
  199. package/types/components/Toolbar/__tests__/ToolbarItem.spec.d.ts +0 -0
  200. package/types/components/Toolbar/index.d.ts +0 -0
  201. package/types/components/Typography/Text/StyledText.d.ts +0 -0
  202. package/types/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -0
  203. package/types/components/Typography/Text/__tests__/index.spec.d.ts +0 -0
  204. package/types/components/Typography/Text/index.d.ts +0 -0
  205. package/types/components/Typography/index.d.ts +0 -0
  206. package/types/index.d.ts +0 -0
  207. package/types/testHelpers/renderWithTheme.d.ts +0 -0
  208. package/types/theme/__tests__/index.spec.d.ts +0 -0
  209. package/types/theme/components/alert.d.ts +0 -0
  210. package/types/theme/components/avatar.d.ts +0 -0
  211. package/types/theme/components/badge.d.ts +0 -0
  212. package/types/theme/components/bottomNavigation.d.ts +0 -0
  213. package/types/theme/components/bottomSheet.d.ts +0 -0
  214. package/types/theme/components/button.d.ts +6 -0
  215. package/types/theme/components/card.d.ts +0 -0
  216. package/types/theme/components/checkbox.d.ts +0 -0
  217. package/types/theme/components/contentNavigator.d.ts +0 -0
  218. package/types/theme/components/divider.d.ts +0 -0
  219. package/types/theme/components/drawer.d.ts +0 -0
  220. package/types/theme/components/fab.d.ts +0 -0
  221. package/types/theme/components/icon.d.ts +0 -0
  222. package/types/theme/components/list.d.ts +0 -0
  223. package/types/theme/components/progress.d.ts +0 -0
  224. package/types/theme/components/radio.d.ts +0 -0
  225. package/types/theme/components/sectionHeading.d.ts +0 -0
  226. package/types/theme/components/select.d.ts +0 -0
  227. package/types/theme/components/spinner.d.ts +0 -0
  228. package/types/theme/components/switch.d.ts +0 -0
  229. package/types/theme/components/tabs.d.ts +0 -0
  230. package/types/theme/components/tag.d.ts +0 -0
  231. package/types/theme/components/textInput.d.ts +61 -2
  232. package/types/theme/components/toast.d.ts +0 -0
  233. package/types/theme/components/toolbar.d.ts +0 -0
  234. package/types/theme/components/typography.d.ts +0 -0
  235. package/types/theme/global/borders.d.ts +0 -0
  236. package/types/theme/global/colors.d.ts +1 -0
  237. package/types/theme/global/index.d.ts +1 -0
  238. package/types/theme/global/scale.d.ts +0 -0
  239. package/types/theme/global/space.d.ts +0 -0
  240. package/types/theme/global/typography.d.ts +0 -0
  241. package/types/theme/index.d.ts +0 -0
  242. package/types/types.d.ts +2 -1
  243. package/types/utils/__tests__/scale.spec.d.ts +0 -0
  244. package/types/utils/helpers.d.ts +0 -0
  245. package/types/utils/hooks.d.ts +0 -0
  246. package/types/utils/scale.d.ts +0 -0
  247. package/.expo/README.md +0 -15
  248. package/.expo/packager-info.json +0 -10
  249. package/.expo/prebuild/cached-packages.json +0 -4
  250. package/.expo/settings.json +0 -10
  251. package/.expo/xcodebuild-error.log +0 -2
  252. package/.expo/xcodebuild.log +0 -11199
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "7.9.0",
3
+ "version": "7.10.1",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@emotion/native": "^11.9.3",
23
23
  "@emotion/react": "^11.9.3",
24
- "@hero-design/colors": "7.9.0"
24
+ "@hero-design/colors": "7.10.1"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "17.0.2",
@@ -60,7 +60,7 @@ export interface ButtonProps {
60
60
  /**
61
61
  * Button type.
62
62
  */
63
- variant?: 'basic-transparent' | 'filled' | 'outlined';
63
+ variant?: 'basic-transparent' | 'filled' | 'outlined' | 'text';
64
64
  }
65
65
 
66
66
  const FILLED_VARIANTS = {
@@ -75,8 +75,14 @@ const OUTLINED_VARIANTS = {
75
75
  danger: 'outlined-danger',
76
76
  } as const;
77
77
 
78
+ const TEXT_VARIANTS = {
79
+ primary: 'text-primary',
80
+ secondary: 'text-secondary',
81
+ danger: 'text-danger',
82
+ } as const;
83
+
78
84
  export const getThemeVariant = (
79
- variant: 'basic-transparent' | 'filled' | 'outlined',
85
+ variant: 'basic-transparent' | 'filled' | 'outlined' | 'text',
80
86
  intent: Intent
81
87
  ): ThemeVariant => {
82
88
  switch (variant) {
@@ -86,6 +92,8 @@ export const getThemeVariant = (
86
92
  return FILLED_VARIANTS[intent];
87
93
  case 'outlined':
88
94
  return OUTLINED_VARIANTS[intent];
95
+ case 'text':
96
+ return TEXT_VARIANTS[intent];
89
97
  }
90
98
  };
91
99
 
@@ -11,7 +11,10 @@ type ThemeVariant =
11
11
  | 'filled-danger'
12
12
  | 'outlined-primary'
13
13
  | 'outlined-secondary'
14
- | 'outlined-danger';
14
+ | 'outlined-danger'
15
+ | 'text-primary'
16
+ | 'text-secondary'
17
+ | 'text-danger';
15
18
 
16
19
  const genLoadingIndicatorStyles = (
17
20
  theme: Theme,
@@ -41,10 +44,13 @@ const StyledLoadingDot = styled(View)<{
41
44
  backgroundColor: theme.__hd__.button.colors.invertedText,
42
45
  };
43
46
  case 'outlined-primary':
47
+ case 'text-primary':
44
48
  return genLoadingIndicatorStyles(theme, 'primary');
45
49
  case 'outlined-secondary':
50
+ case 'text-secondary':
46
51
  return genLoadingIndicatorStyles(theme, 'secondary');
47
52
  case 'outlined-danger':
53
+ case 'text-danger':
48
54
  return genLoadingIndicatorStyles(theme, 'danger');
49
55
  }
50
56
  };
@@ -13,6 +13,9 @@ describe('StyledLoadingIndicator', () => {
13
13
  ${'outlined-primary'}
14
14
  ${'outlined-secondary'}
15
15
  ${'outlined-danger'}
16
+ ${'text-primary'}
17
+ ${'text-secondary'}
18
+ ${'text-danger'}
16
19
  `('has $themeVariant style', ({ themeVariant }) => {
17
20
  const { toJSON } = renderWithTheme(
18
21
  <StyledLoadingDot themeVariant={themeVariant} />
@@ -139,3 +139,63 @@ exports[`StyledLoadingIndicator has outlined-secondary style 1`] = `
139
139
  themeVariant="outlined-secondary"
140
140
  />
141
141
  `;
142
+
143
+ exports[`StyledLoadingIndicator has text-danger style 1`] = `
144
+ <View
145
+ style={
146
+ Array [
147
+ Object {
148
+ "backgroundColor": "#de350b",
149
+ "borderRadius": 8,
150
+ "height": 12,
151
+ "marginBottom": 4,
152
+ "marginHorizontal": 8,
153
+ "marginTop": 4,
154
+ "width": 12,
155
+ },
156
+ undefined,
157
+ ]
158
+ }
159
+ themeVariant="text-danger"
160
+ />
161
+ `;
162
+
163
+ exports[`StyledLoadingIndicator has text-primary style 1`] = `
164
+ <View
165
+ style={
166
+ Array [
167
+ Object {
168
+ "backgroundColor": "#7622d7",
169
+ "borderRadius": 8,
170
+ "height": 12,
171
+ "marginBottom": 4,
172
+ "marginHorizontal": 8,
173
+ "marginTop": 4,
174
+ "width": 12,
175
+ },
176
+ undefined,
177
+ ]
178
+ }
179
+ themeVariant="text-primary"
180
+ />
181
+ `;
182
+
183
+ exports[`StyledLoadingIndicator has text-secondary style 1`] = `
184
+ <View
185
+ style={
186
+ Array [
187
+ Object {
188
+ "backgroundColor": "#4568fb",
189
+ "borderRadius": 8,
190
+ "height": 12,
191
+ "marginBottom": 4,
192
+ "marginHorizontal": 8,
193
+ "marginTop": 4,
194
+ "width": 12,
195
+ },
196
+ undefined,
197
+ ]
198
+ }
199
+ themeVariant="text-secondary"
200
+ />
201
+ `;
@@ -846,3 +846,366 @@ exports[`LoadingIndicator renders correctly when themeVariant is outlined-second
846
846
  </View>
847
847
  </View>
848
848
  `;
849
+
850
+ exports[`LoadingIndicator renders correctly when themeVariant is text-danger 1`] = `
851
+ <View
852
+ collapsable={false}
853
+ nativeID="animatedComponent"
854
+ style={
855
+ Array [
856
+ Object {
857
+ "alignItems": "center",
858
+ "flexDirection": "row",
859
+ "justifyContent": "center",
860
+ "paddingVertical": 2,
861
+ },
862
+ Object {},
863
+ ]
864
+ }
865
+ >
866
+ <View
867
+ collapsable={false}
868
+ nativeID="animatedComponent"
869
+ style={
870
+ Object {
871
+ "transform": Array [
872
+ Object {
873
+ "scale": 1,
874
+ },
875
+ ],
876
+ }
877
+ }
878
+ >
879
+ <View
880
+ collapsable={false}
881
+ nativeID="animatedComponent"
882
+ size={12}
883
+ style={
884
+ Array [
885
+ Object {
886
+ "backgroundColor": "#de350b",
887
+ "borderRadius": 8,
888
+ "height": 12,
889
+ "marginBottom": 4,
890
+ "marginHorizontal": 8,
891
+ "marginTop": 4,
892
+ "width": 12,
893
+ },
894
+ Object {},
895
+ ]
896
+ }
897
+ themeVariant="text-danger"
898
+ />
899
+ </View>
900
+ <View
901
+ collapsable={false}
902
+ nativeID="animatedComponent"
903
+ style={
904
+ Object {
905
+ "transform": Array [
906
+ Object {
907
+ "scale": 1,
908
+ },
909
+ ],
910
+ }
911
+ }
912
+ >
913
+ <View
914
+ collapsable={false}
915
+ nativeID="animatedComponent"
916
+ size={12}
917
+ style={
918
+ Array [
919
+ Object {
920
+ "backgroundColor": "#de350b",
921
+ "borderRadius": 8,
922
+ "height": 12,
923
+ "marginBottom": 4,
924
+ "marginHorizontal": 8,
925
+ "marginTop": 4,
926
+ "width": 12,
927
+ },
928
+ Object {},
929
+ ]
930
+ }
931
+ themeVariant="text-danger"
932
+ />
933
+ </View>
934
+ <View
935
+ collapsable={false}
936
+ nativeID="animatedComponent"
937
+ style={
938
+ Object {
939
+ "transform": Array [
940
+ Object {
941
+ "scale": 1,
942
+ },
943
+ ],
944
+ }
945
+ }
946
+ >
947
+ <View
948
+ collapsable={false}
949
+ nativeID="animatedComponent"
950
+ size={12}
951
+ style={
952
+ Array [
953
+ Object {
954
+ "backgroundColor": "#de350b",
955
+ "borderRadius": 8,
956
+ "height": 12,
957
+ "marginBottom": 4,
958
+ "marginHorizontal": 8,
959
+ "marginTop": 4,
960
+ "width": 12,
961
+ },
962
+ Object {},
963
+ ]
964
+ }
965
+ themeVariant="text-danger"
966
+ />
967
+ </View>
968
+ </View>
969
+ `;
970
+
971
+ exports[`LoadingIndicator renders correctly when themeVariant is text-primary 1`] = `
972
+ <View
973
+ collapsable={false}
974
+ nativeID="animatedComponent"
975
+ style={
976
+ Array [
977
+ Object {
978
+ "alignItems": "center",
979
+ "flexDirection": "row",
980
+ "justifyContent": "center",
981
+ "paddingVertical": 2,
982
+ },
983
+ Object {},
984
+ ]
985
+ }
986
+ >
987
+ <View
988
+ collapsable={false}
989
+ nativeID="animatedComponent"
990
+ style={
991
+ Object {
992
+ "transform": Array [
993
+ Object {
994
+ "scale": 1,
995
+ },
996
+ ],
997
+ }
998
+ }
999
+ >
1000
+ <View
1001
+ collapsable={false}
1002
+ nativeID="animatedComponent"
1003
+ size={12}
1004
+ style={
1005
+ Array [
1006
+ Object {
1007
+ "backgroundColor": "#7622d7",
1008
+ "borderRadius": 8,
1009
+ "height": 12,
1010
+ "marginBottom": 4,
1011
+ "marginHorizontal": 8,
1012
+ "marginTop": 4,
1013
+ "width": 12,
1014
+ },
1015
+ Object {},
1016
+ ]
1017
+ }
1018
+ themeVariant="text-primary"
1019
+ />
1020
+ </View>
1021
+ <View
1022
+ collapsable={false}
1023
+ nativeID="animatedComponent"
1024
+ style={
1025
+ Object {
1026
+ "transform": Array [
1027
+ Object {
1028
+ "scale": 1,
1029
+ },
1030
+ ],
1031
+ }
1032
+ }
1033
+ >
1034
+ <View
1035
+ collapsable={false}
1036
+ nativeID="animatedComponent"
1037
+ size={12}
1038
+ style={
1039
+ Array [
1040
+ Object {
1041
+ "backgroundColor": "#7622d7",
1042
+ "borderRadius": 8,
1043
+ "height": 12,
1044
+ "marginBottom": 4,
1045
+ "marginHorizontal": 8,
1046
+ "marginTop": 4,
1047
+ "width": 12,
1048
+ },
1049
+ Object {},
1050
+ ]
1051
+ }
1052
+ themeVariant="text-primary"
1053
+ />
1054
+ </View>
1055
+ <View
1056
+ collapsable={false}
1057
+ nativeID="animatedComponent"
1058
+ style={
1059
+ Object {
1060
+ "transform": Array [
1061
+ Object {
1062
+ "scale": 1,
1063
+ },
1064
+ ],
1065
+ }
1066
+ }
1067
+ >
1068
+ <View
1069
+ collapsable={false}
1070
+ nativeID="animatedComponent"
1071
+ size={12}
1072
+ style={
1073
+ Array [
1074
+ Object {
1075
+ "backgroundColor": "#7622d7",
1076
+ "borderRadius": 8,
1077
+ "height": 12,
1078
+ "marginBottom": 4,
1079
+ "marginHorizontal": 8,
1080
+ "marginTop": 4,
1081
+ "width": 12,
1082
+ },
1083
+ Object {},
1084
+ ]
1085
+ }
1086
+ themeVariant="text-primary"
1087
+ />
1088
+ </View>
1089
+ </View>
1090
+ `;
1091
+
1092
+ exports[`LoadingIndicator renders correctly when themeVariant is text-secondary 1`] = `
1093
+ <View
1094
+ collapsable={false}
1095
+ nativeID="animatedComponent"
1096
+ style={
1097
+ Array [
1098
+ Object {
1099
+ "alignItems": "center",
1100
+ "flexDirection": "row",
1101
+ "justifyContent": "center",
1102
+ "paddingVertical": 2,
1103
+ },
1104
+ Object {},
1105
+ ]
1106
+ }
1107
+ >
1108
+ <View
1109
+ collapsable={false}
1110
+ nativeID="animatedComponent"
1111
+ style={
1112
+ Object {
1113
+ "transform": Array [
1114
+ Object {
1115
+ "scale": 1,
1116
+ },
1117
+ ],
1118
+ }
1119
+ }
1120
+ >
1121
+ <View
1122
+ collapsable={false}
1123
+ nativeID="animatedComponent"
1124
+ size={12}
1125
+ style={
1126
+ Array [
1127
+ Object {
1128
+ "backgroundColor": "#4568fb",
1129
+ "borderRadius": 8,
1130
+ "height": 12,
1131
+ "marginBottom": 4,
1132
+ "marginHorizontal": 8,
1133
+ "marginTop": 4,
1134
+ "width": 12,
1135
+ },
1136
+ Object {},
1137
+ ]
1138
+ }
1139
+ themeVariant="text-secondary"
1140
+ />
1141
+ </View>
1142
+ <View
1143
+ collapsable={false}
1144
+ nativeID="animatedComponent"
1145
+ style={
1146
+ Object {
1147
+ "transform": Array [
1148
+ Object {
1149
+ "scale": 1,
1150
+ },
1151
+ ],
1152
+ }
1153
+ }
1154
+ >
1155
+ <View
1156
+ collapsable={false}
1157
+ nativeID="animatedComponent"
1158
+ size={12}
1159
+ style={
1160
+ Array [
1161
+ Object {
1162
+ "backgroundColor": "#4568fb",
1163
+ "borderRadius": 8,
1164
+ "height": 12,
1165
+ "marginBottom": 4,
1166
+ "marginHorizontal": 8,
1167
+ "marginTop": 4,
1168
+ "width": 12,
1169
+ },
1170
+ Object {},
1171
+ ]
1172
+ }
1173
+ themeVariant="text-secondary"
1174
+ />
1175
+ </View>
1176
+ <View
1177
+ collapsable={false}
1178
+ nativeID="animatedComponent"
1179
+ style={
1180
+ Object {
1181
+ "transform": Array [
1182
+ Object {
1183
+ "scale": 1,
1184
+ },
1185
+ ],
1186
+ }
1187
+ }
1188
+ >
1189
+ <View
1190
+ collapsable={false}
1191
+ nativeID="animatedComponent"
1192
+ size={12}
1193
+ style={
1194
+ Array [
1195
+ Object {
1196
+ "backgroundColor": "#4568fb",
1197
+ "borderRadius": 8,
1198
+ "height": 12,
1199
+ "marginBottom": 4,
1200
+ "marginHorizontal": 8,
1201
+ "marginTop": 4,
1202
+ "width": 12,
1203
+ },
1204
+ Object {},
1205
+ ]
1206
+ }
1207
+ themeVariant="text-secondary"
1208
+ />
1209
+ </View>
1210
+ </View>
1211
+ `;
@@ -13,6 +13,9 @@ describe('LoadingIndicator', () => {
13
13
  ${'outlined-primary'}
14
14
  ${'outlined-secondary'}
15
15
  ${'outlined-danger'}
16
+ ${'text-primary'}
17
+ ${'text-secondary'}
18
+ ${'text-danger'}
16
19
  `(
17
20
  'renders correctly when themeVariant is $themeVariant',
18
21
  ({ themeVariant }) => {
@@ -19,7 +19,10 @@ type ThemeVariant =
19
19
  | 'filled-danger'
20
20
  | 'outlined-primary'
21
21
  | 'outlined-secondary'
22
- | 'outlined-danger';
22
+ | 'outlined-danger'
23
+ | 'text-primary'
24
+ | 'text-secondary'
25
+ | 'text-danger';
23
26
 
24
27
  const AnimatedLoadingIndicatorWrapper = Animated.createAnimatedComponent(
25
28
  StyledLoadingIndicatorWrapper
@@ -14,7 +14,10 @@ type ThemeVariant =
14
14
  | 'filled-danger'
15
15
  | 'outlined-primary'
16
16
  | 'outlined-secondary'
17
- | 'outlined-danger';
17
+ | 'outlined-danger'
18
+ | 'text-primary'
19
+ | 'text-secondary'
20
+ | 'text-danger';
18
21
 
19
22
  const PRESSED_COLORS = {
20
23
  primary: 'pressedPrimary',
@@ -152,6 +155,35 @@ const genOutlineTextStyles = (
152
155
  };
153
156
  };
154
157
 
158
+ const genTextVariantTextStyles = (
159
+ theme: Theme,
160
+ intent: Intent,
161
+ pressed?: boolean,
162
+ disabled?: boolean
163
+ ): ReactNativeStyle => {
164
+ const textColorStyling = () => {
165
+ if (disabled) {
166
+ return {
167
+ color: theme.__hd__.button.colors.disabledText,
168
+ };
169
+ }
170
+
171
+ if (pressed) {
172
+ return {
173
+ color: theme.__hd__.button.colors[PRESSED_COLORS[intent]],
174
+ };
175
+ }
176
+
177
+ return { color: theme.__hd__.button.colors[intent] };
178
+ };
179
+
180
+ return {
181
+ fontSize: theme.__hd__.button.fontSize.textVariant,
182
+ lineHeight: theme.__hd__.button.lineHeight.default,
183
+ ...textColorStyling(),
184
+ };
185
+ };
186
+
155
187
  const StyledButtonContainer = styled(View)<{
156
188
  disabled?: boolean;
157
189
  pressed?: boolean;
@@ -172,6 +204,18 @@ const StyledButtonContainer = styled(View)<{
172
204
  return genOutlineContainerStyles(theme, 'secondary', pressed, disabled);
173
205
  case 'outlined-danger':
174
206
  return genOutlineContainerStyles(theme, 'danger', pressed, disabled);
207
+ case 'text-primary':
208
+ case 'text-secondary':
209
+ case 'text-danger':
210
+ return {
211
+ width: '100%',
212
+ flexDirection: 'row',
213
+ justifyContent: 'center',
214
+ alignItems: 'center',
215
+ padding: theme.__hd__.button.space.buttonPadding,
216
+ borderWidth: 0,
217
+ backgroundColor: 'transparent',
218
+ };
175
219
  }
176
220
  });
177
221
 
@@ -204,6 +248,12 @@ const StyledButtonText = styled(Typography.Text)<{
204
248
  return genOutlineTextStyles(theme, 'secondary', pressed, disabled);
205
249
  case 'outlined-danger':
206
250
  return genOutlineTextStyles(theme, 'danger', pressed, disabled);
251
+ case 'text-primary':
252
+ return genTextVariantTextStyles(theme, 'primary', pressed, disabled);
253
+ case 'text-secondary':
254
+ return genTextVariantTextStyles(theme, 'secondary', pressed, disabled);
255
+ case 'text-danger':
256
+ return genTextVariantTextStyles(theme, 'danger', pressed, disabled);
207
257
  }
208
258
  };
209
259
  return {
@@ -248,6 +298,12 @@ const StyledButtonIcon = styled(Icon)<{
248
298
  return genOutlineTextStyles(theme, 'secondary', pressed, disabled);
249
299
  case 'outlined-danger':
250
300
  return genOutlineTextStyles(theme, 'danger', pressed, disabled);
301
+ case 'text-primary':
302
+ return genTextVariantTextStyles(theme, 'primary', pressed, disabled);
303
+ case 'text-secondary':
304
+ return genTextVariantTextStyles(theme, 'secondary', pressed, disabled);
305
+ case 'text-danger':
306
+ return genTextVariantTextStyles(theme, 'danger', pressed, disabled);
251
307
  }
252
308
  };
253
309