@hero-design/rn 7.18.0 → 7.19.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 (311) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/es/index.js +155 -143
  3. package/lib/index.js +155 -143
  4. package/package.json +2 -2
  5. package/src/components/Accordion/AccordionItem.tsx +5 -4
  6. package/src/components/Accordion/__tests__/index.spec.tsx +2 -1
  7. package/src/components/Accordion/index.tsx +3 -2
  8. package/src/components/Alert/StyledAlert.tsx +3 -2
  9. package/src/components/Alert/index.tsx +5 -3
  10. package/src/components/Avatar/index.tsx +2 -2
  11. package/src/components/Badge/Status.tsx +4 -2
  12. package/src/components/Badge/index.tsx +2 -1
  13. package/src/components/BottomNavigation/__tests__/index.spec.tsx +4 -2
  14. package/src/components/BottomNavigation/index.tsx +6 -8
  15. package/src/components/BottomSheet/Footer.tsx +2 -1
  16. package/src/components/BottomSheet/Header.tsx +2 -1
  17. package/src/components/BottomSheet/StyledBottomSheet.tsx +2 -2
  18. package/src/components/BottomSheet/index.tsx +4 -8
  19. package/src/components/Button/Button.tsx +5 -6
  20. package/src/components/Button/IconButton.tsx +4 -7
  21. package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +5 -3
  22. package/src/components/Button/LoadingIndicator/index.tsx +2 -8
  23. package/src/components/Button/StyledButton.tsx +4 -5
  24. package/src/components/Button/UtilityButton/index.tsx +5 -4
  25. package/src/components/Button/index.tsx +3 -2
  26. package/src/components/Calendar/StyledCalendar.tsx +2 -1
  27. package/src/components/Card/DataCard/index.tsx +3 -2
  28. package/src/components/Card/index.tsx +3 -2
  29. package/src/components/Checkbox/StyledCheckbox.tsx +44 -14
  30. package/src/components/Checkbox/__tests__/StyledCheckbox.spec.tsx +28 -3
  31. package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +95 -9
  32. package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +337 -23
  33. package/src/components/Checkbox/__tests__/index.spec.tsx +38 -7
  34. package/src/components/Checkbox/index.tsx +35 -18
  35. package/src/components/Collapse/index.tsx +4 -8
  36. package/src/components/ContentNavigator/index.tsx +1 -1
  37. package/src/components/DatePicker/DatePickerAndroid.tsx +1 -1
  38. package/src/components/DatePicker/DatePickerIOS.tsx +1 -1
  39. package/src/components/DatePicker/StyledDatePicker.tsx +2 -1
  40. package/src/components/DatePicker/__tests__/DatePickerIOS.spec.tsx +1 -2
  41. package/src/components/DatePicker/index.tsx +1 -1
  42. package/src/components/DatePicker/types.ts +1 -1
  43. package/src/components/Divider/index.tsx +1 -1
  44. package/src/components/Drawer/DragableDrawer/index.tsx +3 -2
  45. package/src/components/Drawer/StyledDrawer.tsx +3 -2
  46. package/src/components/Drawer/index.tsx +2 -1
  47. package/src/components/Empty/index.tsx +1 -2
  48. package/src/components/FAB/ActionGroup/ActionItem.tsx +3 -2
  49. package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +4 -3
  50. package/src/components/FAB/ActionGroup/StyledActionItem.tsx +4 -2
  51. package/src/components/FAB/ActionGroup/index.tsx +5 -3
  52. package/src/components/FAB/AnimatedFABIcon.tsx +1 -1
  53. package/src/components/FAB/FAB.tsx +2 -2
  54. package/src/components/FAB/StyledFAB.tsx +4 -7
  55. package/src/components/Icon/AnimatedIcon.tsx +2 -1
  56. package/src/components/Icon/index.tsx +1 -1
  57. package/src/components/List/BasicListItem.tsx +3 -3
  58. package/src/components/List/ListItem.tsx +6 -3
  59. package/src/components/List/StyledListItem.tsx +2 -1
  60. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +13 -27
  61. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +2 -0
  62. package/src/components/PinInput/PinCell.tsx +1 -1
  63. package/src/components/PinInput/index.tsx +3 -7
  64. package/src/components/Progress/ProgressBar.tsx +2 -1
  65. package/src/components/Progress/ProgressCircle.tsx +3 -9
  66. package/src/components/Progress/StyledProgressBar.tsx +3 -3
  67. package/src/components/Progress/StyledProgressCircle.tsx +3 -3
  68. package/src/components/Radio/Radio.tsx +20 -14
  69. package/src/components/Radio/RadioGroup.tsx +5 -3
  70. package/src/components/Radio/StyledRadio.tsx +12 -29
  71. package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +84 -50
  72. package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +124 -73
  73. package/src/components/RichTextEditor/EditorToolbar.tsx +4 -8
  74. package/src/components/RichTextEditor/RichTextEditor.tsx +5 -14
  75. package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +2 -6
  76. package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +2 -6
  77. package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +4 -7
  78. package/src/components/RichTextEditor/index.tsx +6 -6
  79. package/src/components/SectionHeading/index.tsx +5 -4
  80. package/src/components/Select/MultiSelect/Option.tsx +2 -1
  81. package/src/components/Select/MultiSelect/OptionList.tsx +3 -3
  82. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +605 -585
  83. package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +1 -1
  84. package/src/components/Select/MultiSelect/index.tsx +20 -16
  85. package/src/components/Select/SingleSelect/Option.tsx +2 -1
  86. package/src/components/Select/SingleSelect/OptionList.tsx +3 -3
  87. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +602 -582
  88. package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +1 -1
  89. package/src/components/Select/SingleSelect/index.tsx +20 -16
  90. package/src/components/Select/StyledOptionList.tsx +11 -9
  91. package/src/components/Select/helpers.tsx +1 -1
  92. package/src/components/Select/index.tsx +6 -4
  93. package/src/components/Select/types.ts +3 -3
  94. package/src/components/Spinner/StyledSpinner.tsx +2 -1
  95. package/src/components/Spinner/index.tsx +3 -3
  96. package/src/components/Switch/StyledSwitch.tsx +10 -26
  97. package/src/components/Switch/__tests__/StyledSwitch.spec.tsx +25 -0
  98. package/src/components/Switch/__tests__/__snapshots__/{StyledHeading.spec.tsx.snap → StyledSwitch.spec.tsx.snap} +45 -18
  99. package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +26 -52
  100. package/src/components/Switch/index.tsx +23 -20
  101. package/src/components/Tabs/ScrollableTabs.tsx +1 -1
  102. package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +4 -2
  103. package/src/components/Tabs/__tests__/index.spec.tsx +4 -2
  104. package/src/components/Tabs/index.tsx +7 -13
  105. package/src/components/Tag/index.tsx +1 -1
  106. package/src/components/TextInput/index.tsx +5 -5
  107. package/src/components/TimePicker/StyledTimePicker.tsx +2 -1
  108. package/src/components/TimePicker/TimePickerAndroid.tsx +1 -1
  109. package/src/components/TimePicker/TimePickerIOS.tsx +1 -1
  110. package/src/components/TimePicker/__tests__/TimePickerIOS.spec.tsx +1 -2
  111. package/src/components/TimePicker/index.tsx +1 -1
  112. package/src/components/TimePicker/types.ts +1 -1
  113. package/src/components/Toast/StyledToast.tsx +3 -8
  114. package/src/components/Toast/Toast.tsx +3 -2
  115. package/src/components/Toast/ToastContainer.tsx +2 -2
  116. package/src/components/Toast/ToastContext.ts +1 -1
  117. package/src/components/Toast/ToastProvider.tsx +5 -7
  118. package/src/components/Toast/__tests__/ToastContainer.spec.tsx +1 -1
  119. package/src/components/Toast/types.ts +3 -3
  120. package/src/components/Toolbar/StyledToolbar.tsx +2 -1
  121. package/src/components/Toolbar/ToolbarGroup.tsx +2 -1
  122. package/src/components/Toolbar/ToolbarItem.tsx +2 -1
  123. package/src/components/Toolbar/index.tsx +2 -1
  124. package/src/components/Typography/Text/index.tsx +3 -2
  125. package/src/testHelpers/renderWithTheme.tsx +2 -1
  126. package/src/theme/ThemeProvider.ts +1 -1
  127. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +24 -26
  128. package/src/theme/components/accordion.ts +1 -1
  129. package/src/theme/components/alert.ts +1 -1
  130. package/src/theme/components/avatar.ts +1 -1
  131. package/src/theme/components/badge.ts +1 -1
  132. package/src/theme/components/bottomNavigation.ts +1 -1
  133. package/src/theme/components/bottomSheet.ts +1 -1
  134. package/src/theme/components/button.ts +1 -1
  135. package/src/theme/components/calendar.ts +1 -1
  136. package/src/theme/components/card.ts +1 -1
  137. package/src/theme/components/checkbox.ts +12 -8
  138. package/src/theme/components/contentNavigator.ts +1 -1
  139. package/src/theme/components/divider.ts +1 -1
  140. package/src/theme/components/drawer.ts +1 -1
  141. package/src/theme/components/empty.ts +1 -1
  142. package/src/theme/components/fab.ts +1 -1
  143. package/src/theme/components/icon.ts +1 -1
  144. package/src/theme/components/list.ts +5 -4
  145. package/src/theme/components/pinInput.ts +1 -1
  146. package/src/theme/components/progress.ts +1 -1
  147. package/src/theme/components/radio.ts +3 -11
  148. package/src/theme/components/richTextEditor.ts +1 -1
  149. package/src/theme/components/sectionHeading.ts +1 -1
  150. package/src/theme/components/select.ts +1 -1
  151. package/src/theme/components/spinner.ts +1 -1
  152. package/src/theme/components/switch.ts +7 -8
  153. package/src/theme/components/tabs.ts +1 -1
  154. package/src/theme/components/tag.ts +1 -1
  155. package/src/theme/components/textInput.ts +1 -1
  156. package/src/theme/components/toast.ts +1 -1
  157. package/src/theme/components/toolbar.ts +1 -1
  158. package/src/theme/components/typography.ts +1 -1
  159. package/src/theme/getTheme.ts +4 -11
  160. package/src/theme/global/borders.ts +2 -1
  161. package/src/theme/global/colors/swag.ts +2 -3
  162. package/src/theme/global/colors/work.ts +1 -2
  163. package/src/theme/global/index.ts +6 -11
  164. package/src/theme/global/scale.ts +2 -1
  165. package/src/theme/global/space.ts +2 -1
  166. package/src/theme/global/typography.ts +2 -8
  167. package/src/theme/index.ts +5 -2
  168. package/src/types.ts +9 -10
  169. package/testUtils/setup.tsx +2 -0
  170. package/tsconfig.json +4 -9
  171. package/types/components/Accordion/AccordionItem.d.ts +3 -3
  172. package/types/components/Accordion/index.d.ts +3 -2
  173. package/types/components/Alert/StyledAlert.d.ts +2 -1
  174. package/types/components/Alert/index.d.ts +3 -3
  175. package/types/components/Avatar/index.d.ts +1 -1
  176. package/types/components/Badge/Status.d.ts +2 -2
  177. package/types/components/Badge/index.d.ts +2 -1
  178. package/types/components/BottomNavigation/index.d.ts +3 -3
  179. package/types/components/BottomSheet/Footer.d.ts +1 -1
  180. package/types/components/BottomSheet/Header.d.ts +1 -1
  181. package/types/components/BottomSheet/StyledBottomSheet.d.ts +2 -1
  182. package/types/components/BottomSheet/index.d.ts +2 -2
  183. package/types/components/Button/Button.d.ts +4 -4
  184. package/types/components/Button/IconButton.d.ts +2 -2
  185. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +3 -2
  186. package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
  187. package/types/components/Button/StyledButton.d.ts +3 -2
  188. package/types/components/Button/UtilityButton/index.d.ts +3 -3
  189. package/types/components/Button/index.d.ts +2 -2
  190. package/types/components/Calendar/StyledCalendar.d.ts +2 -1
  191. package/types/components/Card/DataCard/index.d.ts +2 -2
  192. package/types/components/Card/index.d.ts +2 -2
  193. package/types/components/Checkbox/StyledCheckbox.d.ts +21 -3
  194. package/types/components/Checkbox/index.d.ts +11 -3
  195. package/types/components/Collapse/index.d.ts +2 -2
  196. package/types/components/ContentNavigator/index.d.ts +1 -1
  197. package/types/components/DatePicker/DatePickerAndroid.d.ts +1 -1
  198. package/types/components/DatePicker/DatePickerIOS.d.ts +1 -1
  199. package/types/components/DatePicker/StyledDatePicker.d.ts +2 -1
  200. package/types/components/DatePicker/index.d.ts +1 -1
  201. package/types/components/DatePicker/types.d.ts +1 -1
  202. package/types/components/Divider/index.d.ts +1 -1
  203. package/types/components/Drawer/DragableDrawer/index.d.ts +1 -1
  204. package/types/components/Drawer/StyledDrawer.d.ts +2 -1
  205. package/types/components/Drawer/index.d.ts +1 -1
  206. package/types/components/Empty/index.d.ts +1 -1
  207. package/types/components/FAB/ActionGroup/ActionItem.d.ts +2 -2
  208. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +3 -2
  209. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +3 -2
  210. package/types/components/FAB/ActionGroup/index.d.ts +3 -3
  211. package/types/components/FAB/AnimatedFABIcon.d.ts +1 -1
  212. package/types/components/FAB/FAB.d.ts +2 -2
  213. package/types/components/FAB/StyledFAB.d.ts +3 -2
  214. package/types/components/Icon/AnimatedIcon.d.ts +1 -1
  215. package/types/components/Icon/index.d.ts +1 -1
  216. package/types/components/List/BasicListItem.d.ts +2 -2
  217. package/types/components/List/ListItem.d.ts +4 -3
  218. package/types/components/PinInput/PinCell.d.ts +1 -1
  219. package/types/components/PinInput/index.d.ts +2 -2
  220. package/types/components/Progress/ProgressBar.d.ts +1 -1
  221. package/types/components/Progress/ProgressCircle.d.ts +1 -1
  222. package/types/components/Progress/StyledProgressBar.d.ts +3 -2
  223. package/types/components/Progress/StyledProgressCircle.d.ts +3 -2
  224. package/types/components/Radio/Radio.d.ts +2 -2
  225. package/types/components/Radio/RadioGroup.d.ts +3 -3
  226. package/types/components/Radio/StyledRadio.d.ts +2 -12
  227. package/types/components/RichTextEditor/RichTextEditor.d.ts +3 -2
  228. package/types/components/RichTextEditor/index.d.ts +3 -2
  229. package/types/components/SectionHeading/index.d.ts +3 -3
  230. package/types/components/Select/MultiSelect/Option.d.ts +1 -1
  231. package/types/components/Select/MultiSelect/OptionList.d.ts +2 -2
  232. package/types/components/Select/MultiSelect/index.d.ts +1 -1
  233. package/types/components/Select/SingleSelect/Option.d.ts +1 -1
  234. package/types/components/Select/SingleSelect/OptionList.d.ts +2 -2
  235. package/types/components/Select/SingleSelect/index.d.ts +1 -1
  236. package/types/components/Select/StyledOptionList.d.ts +4 -4
  237. package/types/components/Select/helpers.d.ts +1 -1
  238. package/types/components/Select/index.d.ts +4 -3
  239. package/types/components/Select/types.d.ts +3 -3
  240. package/types/components/Spinner/StyledSpinner.d.ts +2 -1
  241. package/types/components/Spinner/index.d.ts +2 -2
  242. package/types/components/Switch/StyledSwitch.d.ts +3 -18
  243. package/types/components/{Radio/__tests__/StyledRadio.spec.d.ts → Switch/__tests__/StyledSwitch.spec.d.ts} +0 -0
  244. package/types/components/Switch/index.d.ts +3 -2
  245. package/types/components/Tabs/ScrollableTabs.d.ts +1 -1
  246. package/types/components/Tabs/index.d.ts +3 -3
  247. package/types/components/Tag/index.d.ts +1 -1
  248. package/types/components/TextInput/index.d.ts +3 -3
  249. package/types/components/TimePicker/StyledTimePicker.d.ts +2 -1
  250. package/types/components/TimePicker/TimePickerAndroid.d.ts +1 -1
  251. package/types/components/TimePicker/TimePickerIOS.d.ts +1 -1
  252. package/types/components/TimePicker/index.d.ts +1 -1
  253. package/types/components/TimePicker/types.d.ts +1 -1
  254. package/types/components/Toast/StyledToast.d.ts +2 -1
  255. package/types/components/Toast/Toast.d.ts +1 -1
  256. package/types/components/Toast/ToastContainer.d.ts +2 -2
  257. package/types/components/Toast/ToastContext.d.ts +1 -1
  258. package/types/components/Toast/ToastProvider.d.ts +2 -2
  259. package/types/components/Toast/types.d.ts +3 -3
  260. package/types/components/Toolbar/StyledToolbar.d.ts +2 -1
  261. package/types/components/Toolbar/ToolbarGroup.d.ts +1 -1
  262. package/types/components/Toolbar/ToolbarItem.d.ts +1 -1
  263. package/types/components/Toolbar/index.d.ts +1 -1
  264. package/types/components/Typography/Text/index.d.ts +2 -2
  265. package/types/testHelpers/renderWithTheme.d.ts +1 -1
  266. package/types/theme/ThemeProvider.d.ts +1 -1
  267. package/types/theme/components/accordion.d.ts +1 -1
  268. package/types/theme/components/alert.d.ts +1 -1
  269. package/types/theme/components/avatar.d.ts +1 -1
  270. package/types/theme/components/badge.d.ts +1 -1
  271. package/types/theme/components/bottomNavigation.d.ts +1 -1
  272. package/types/theme/components/bottomSheet.d.ts +1 -1
  273. package/types/theme/components/button.d.ts +1 -1
  274. package/types/theme/components/calendar.d.ts +1 -1
  275. package/types/theme/components/card.d.ts +1 -1
  276. package/types/theme/components/checkbox.d.ts +10 -7
  277. package/types/theme/components/contentNavigator.d.ts +1 -1
  278. package/types/theme/components/divider.d.ts +1 -1
  279. package/types/theme/components/drawer.d.ts +1 -1
  280. package/types/theme/components/empty.d.ts +1 -1
  281. package/types/theme/components/fab.d.ts +1 -1
  282. package/types/theme/components/icon.d.ts +1 -1
  283. package/types/theme/components/list.d.ts +8 -7
  284. package/types/theme/components/pinInput.d.ts +1 -1
  285. package/types/theme/components/progress.d.ts +1 -1
  286. package/types/theme/components/radio.d.ts +1 -8
  287. package/types/theme/components/richTextEditor.d.ts +1 -1
  288. package/types/theme/components/sectionHeading.d.ts +1 -1
  289. package/types/theme/components/select.d.ts +1 -1
  290. package/types/theme/components/spinner.d.ts +1 -1
  291. package/types/theme/components/switch.d.ts +7 -6
  292. package/types/theme/components/tabs.d.ts +1 -1
  293. package/types/theme/components/tag.d.ts +1 -1
  294. package/types/theme/components/textInput.d.ts +1 -1
  295. package/types/theme/components/toast.d.ts +1 -1
  296. package/types/theme/components/toolbar.d.ts +1 -1
  297. package/types/theme/components/typography.d.ts +1 -1
  298. package/types/theme/getTheme.d.ts +2 -2
  299. package/types/theme/global/borders.d.ts +2 -1
  300. package/types/theme/global/colors/swag.d.ts +1 -1
  301. package/types/theme/global/colors/work.d.ts +1 -1
  302. package/types/theme/global/index.d.ts +5 -3
  303. package/types/theme/global/scale.d.ts +2 -1
  304. package/types/theme/global/space.d.ts +2 -1
  305. package/types/theme/global/typography.d.ts +2 -1
  306. package/types/theme/index.d.ts +4 -2
  307. package/types/types.d.ts +9 -8
  308. package/src/components/Radio/__tests__/StyledRadio.spec.tsx +0 -43
  309. package/src/components/Radio/__tests__/__snapshots__/StyledRadio.spec.tsx.snap +0 -124
  310. package/src/components/Switch/__tests__/StyledHeading.spec.tsx +0 -42
  311. package/types/components/Switch/__tests__/StyledHeading.spec.d.ts +0 -1
@@ -1,7 +1,9 @@
1
- import { TouchableOpacity, TouchableOpacityProps } from 'react-native';
1
+ import { TouchableOpacity } from 'react-native';
2
2
  import styled from '@emotion/native';
3
+ import type { TouchableOpacityProps } from 'react-native';
3
4
  import Typography from '../../Typography';
4
- import Icon, { IconProps } from '../../Icon';
5
+ import Icon from '../../Icon';
6
+ import type { IconProps } from '../../Icon';
5
7
 
6
8
  const StyledActionItem = styled(TouchableOpacity)<TouchableOpacityProps>(
7
9
  ({ theme }) => ({
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
- import { Animated, View, StyleProp, ViewStyle } from 'react-native';
3
- import { IconName } from '../../Icon';
4
- import ActionItem, { ActionItemProps } from './ActionItem';
2
+ import { Animated, View } from 'react-native';
3
+ import type { StyleProp, ViewStyle } from 'react-native';
4
+ import ActionItem from './ActionItem';
5
5
  import {
6
6
  StyledBackdrop,
7
7
  StyledContainer,
@@ -9,6 +9,8 @@ import {
9
9
  StyledHeaderText,
10
10
  StyledActionGroupContainer,
11
11
  } from './StyledActionGroup';
12
+ import type { IconName } from '../../Icon';
13
+ import type { ActionItemProps } from './ActionItem';
12
14
 
13
15
  type ActionItemsContainerProps = {
14
16
  style?: StyleProp<ViewStyle>;
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
2
  import { Animated, StyleSheet } from 'react-native';
3
- import { IconProps } from '../Icon';
4
3
  import { StyledFABIcon } from './StyledFAB';
4
+ import type { IconProps } from '../Icon';
5
5
 
6
6
  const AnimatedIcons = Animated.createAnimatedComponent(StyledFABIcon);
7
7
 
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { StyleProp, ViewStyle } from 'react-native';
2
+ import type { StyleProp, ViewStyle } from 'react-native';
3
3
  import { AnimatedFABIcon } from './AnimatedFABIcon';
4
4
  import { StyledFABContainer, StyledFABIcon, StyledFABText } from './StyledFAB';
5
- import { IconName } from '../Icon';
5
+ import type { IconName } from '../Icon';
6
6
 
7
7
  export interface FABProps {
8
8
  /**
@@ -1,11 +1,8 @@
1
- import {
2
- Text,
3
- TextProps,
4
- TouchableHighlight,
5
- TouchableHighlightProps,
6
- } from 'react-native';
1
+ import { Text, TouchableHighlight } from 'react-native';
7
2
  import styled from '@emotion/native';
8
- import Icon, { IconProps } from '../Icon';
3
+ import type { TextProps, TouchableHighlightProps } from 'react-native';
4
+ import Icon from '../Icon';
5
+ import type { IconProps } from '../Icon';
9
6
 
10
7
  const StyledFABContainer = styled(TouchableHighlight)<TouchableHighlightProps>(
11
8
  ({ theme }) => ({
@@ -1,5 +1,6 @@
1
- import React, { useEffect, useRef, ComponentProps } from 'react';
1
+ import React, { useEffect, useRef } from 'react';
2
2
  import { Animated, Easing } from 'react-native';
3
+ import type { ComponentProps } from 'react';
3
4
  import StyledHeroIcon from './HeroIcon';
4
5
 
5
6
  type AnimatedIconProps = ComponentProps<typeof StyledHeroIcon>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { StyleProp, TextStyle } from 'react-native';
2
+ import type { StyleProp, TextStyle } from 'react-native';
3
3
  import IconList from './IconList';
4
4
  import HeroIcon from './HeroIcon';
5
5
  import AnimatedIcon from './AnimatedIcon';
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
-
3
- import { StyleProp, ViewStyle } from 'react-native';
2
+ import type { StyleProp, ViewStyle } from 'react-native';
4
3
  import { useTheme } from '../../theme';
5
- import Icon, { IconName } from '../Icon';
4
+ import Icon from '../Icon';
6
5
  import Typography from '../Typography';
7
6
  import {
8
7
  StyledPrefixContainer,
@@ -10,6 +9,7 @@ import {
10
9
  StyledTitleContainer,
11
10
  StyledListItemContainer,
12
11
  } from './StyledBasicListItem';
12
+ import type { IconName } from '../Icon';
13
13
 
14
14
  export interface ListItemProps {
15
15
  /**
@@ -1,8 +1,10 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
 
3
- import { StyleProp, ViewStyle, View } from 'react-native';
3
+ import { View } from 'react-native';
4
+ import type { ReactNode } from 'react';
5
+ import type { StyleProp, ViewStyle } from 'react-native';
4
6
  import { useTheme } from '../../theme';
5
- import Icon, { IconName } from '../Icon';
7
+ import Icon from '../Icon';
6
8
  import Typography from '../Typography';
7
9
  import {
8
10
  StyledListItemContainer,
@@ -13,6 +15,7 @@ import {
13
15
  StyledSuffixContainer,
14
16
  StyledTitleContainer,
15
17
  } from './StyledListItem';
18
+ import type { IconName } from '../Icon';
16
19
 
17
20
  export interface ListItemProps {
18
21
  /**
@@ -31,8 +31,9 @@ const StyledListItemContainer = styled(TouchableHighlight)<{
31
31
  borderRadius: theme.__hd__.list.radii.card,
32
32
  shadowColor: theme.colors.shadow,
33
33
  shadowRadius: theme.__hd__.list.radii.cardShadow,
34
- shadowOffset: theme.__hd__.list.offsets.cardShadow,
34
+ shadowOffset: theme.__hd__.list.shadows.cardOffset,
35
35
  shadowOpacity: theme.__hd__.list.opacity.cardShadow,
36
+ elevation: theme.__hd__.list.shadows.cardElevation,
36
37
  };
37
38
  default:
38
39
  return sharedStyles;
@@ -731,7 +731,9 @@ exports[`ListItem renders correctly ListItem with prefix suffix is React.Element
731
731
  Object {
732
732
  "backgroundColor": "#8505a2",
733
733
  "borderRadius": 999,
734
+ "display": "flex",
734
735
  "height": 28.799999999999997,
736
+ "justifyContent": "center",
735
737
  "paddingHorizontal": 4,
736
738
  "width": 56,
737
739
  },
@@ -739,39 +741,23 @@ exports[`ListItem renders correctly ListItem with prefix suffix is React.Element
739
741
  ]
740
742
  }
741
743
  testID="switch"
742
- themeChecked={true}
743
744
  themeSize="medium"
745
+ themeVariant="checked"
744
746
  >
745
747
  <View
748
+ collapsable={false}
749
+ nativeID="animatedComponent"
746
750
  style={
747
- Array [
748
- Object {
749
- "borderRadius": 999,
750
- "display": "flex",
751
- "height": 28.799999999999997,
752
- "justifyContent": "center",
753
- "width": 56,
754
- },
755
- undefined,
756
- ]
751
+ Object {
752
+ "backgroundColor": "#ffffff",
753
+ "borderRadius": 999,
754
+ "height": 20.8,
755
+ "left": 27.200000000000003,
756
+ "width": 20.8,
757
+ }
757
758
  }
758
759
  themeSize="medium"
759
- >
760
- <View
761
- collapsable={false}
762
- nativeID="animatedComponent"
763
- style={
764
- Object {
765
- "backgroundColor": "#ffffff",
766
- "borderRadius": 999,
767
- "height": 20.8,
768
- "left": 27.200000000000003,
769
- "width": 20.8,
770
- }
771
- }
772
- themeSize="medium"
773
- />
774
- </View>
760
+ />
775
761
  </View>
776
762
  </View>
777
763
  </View>
@@ -102,6 +102,7 @@ exports[`ListItemContainer renders correctly themeSelected false themeVariant ca
102
102
  "alignItems": "center",
103
103
  "backgroundColor": "#ffffff",
104
104
  "borderRadius": 8,
105
+ "elevation": 10,
105
106
  "flexDirection": "row",
106
107
  "padding": 16,
107
108
  "shadowColor": "#ccced1",
@@ -199,6 +200,7 @@ exports[`ListItemContainer renders correctly themeSelected true themeVariant car
199
200
  "alignItems": "center",
200
201
  "backgroundColor": "#f3e6f6",
201
202
  "borderRadius": 8,
203
+ "elevation": 10,
202
204
  "flexDirection": "row",
203
205
  "padding": 16,
204
206
  "shadowColor": "#ccced1",
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import {
3
- State,
4
3
  StyledCell,
5
4
  StyledCellText,
6
5
  StyledFilledMask,
7
6
  StyledMask,
8
7
  } from './StyledPinInput';
8
+ import type { State } from './StyledPinInput';
9
9
 
10
10
  function PinCell({
11
11
  value,
@@ -1,10 +1,6 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from 'react';
2
- import {
3
- InteractionManager,
4
- StyleProp,
5
- TextInput,
6
- ViewStyle,
7
- } from 'react-native';
2
+ import { InteractionManager, TextInput } from 'react-native';
3
+ import type { StyleProp, ViewStyle } from 'react-native';
8
4
  import Icon from '../Icon';
9
5
  import PinCell from './PinCell';
10
6
  import {
@@ -14,8 +10,8 @@ import {
14
10
  StyledSpacer,
15
11
  StyledPinWrapper,
16
12
  StyledWrapper,
17
- State,
18
13
  } from './StyledPinInput';
14
+ import type { State } from './StyledPinInput';
19
15
 
20
16
  interface PinInputProps {
21
17
  /**
@@ -1,6 +1,7 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { Animated, StyleProp, ViewStyle, ViewProps } from 'react-native';
2
+ import { Animated } from 'react-native';
3
3
 
4
+ import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
4
5
  import { StyledWrapper, StyledInner } from './StyledProgressBar';
5
6
 
6
7
  export interface ProgressBarProps extends ViewProps {
@@ -1,13 +1,7 @@
1
1
  import { useTheme } from '@emotion/react';
2
2
  import React, { useEffect, useRef } from 'react';
3
- import {
4
- Animated,
5
- View,
6
- StyleSheet,
7
- ViewProps,
8
- StyleProp,
9
- ViewStyle,
10
- } from 'react-native';
3
+ import { Animated, View, StyleSheet } from 'react-native';
4
+ import type { ViewProps, StyleProp, ViewStyle } from 'react-native';
11
5
  import {
12
6
  StyledContainer,
13
7
  StyledDonutCircle,
@@ -16,8 +10,8 @@ import {
16
10
  StyledHalfCircleWrapper,
17
11
  StyledStrokeEnd,
18
12
  } from './StyledProgressCircle';
19
- import { ThemeIntent } from './types';
20
13
  import Typography from '../Typography';
14
+ import type { ThemeIntent } from './types';
21
15
 
22
16
  export interface ProgressCircleProps extends ViewProps {
23
17
  /**
@@ -1,7 +1,7 @@
1
- import { Animated, View, ViewProps } from 'react-native';
1
+ import { Animated, View } from 'react-native';
2
2
  import styled from '@emotion/native';
3
-
4
- import { ThemeIntent } from './types';
3
+ import type { ViewProps } from 'react-native';
4
+ import type { ThemeIntent } from './types';
5
5
 
6
6
  const StyledWrapper = styled(View)<ViewProps>(({ theme }) => ({
7
7
  height: theme.__hd__.progress.sizes.barHeight,
@@ -1,7 +1,7 @@
1
- import { View, ViewProps } from 'react-native';
1
+ import { View } from 'react-native';
2
2
  import styled from '@emotion/native';
3
-
4
- import { ThemeIntent } from './types';
3
+ import type { ViewProps } from 'react-native';
4
+ import type { ThemeIntent } from './types';
5
5
 
6
6
  const INNER_CIRCLE_PERCENTAGE = 0.85; // 85% width according to design
7
7
  const STROKE_WIDTH_PERCENTAGE = 0.075; // 7.5% width according to design
@@ -1,7 +1,9 @@
1
- import React, { ReactElement } from 'react';
2
- import { StyleProp, View, ViewStyle } from 'react-native';
3
- import Typography from '../Typography';
4
- import { Circle, InnerCircle, Wrapper } from './StyledRadio';
1
+ import React from 'react';
2
+ import type { ReactElement } from 'react';
3
+ import type { StyleProp, ViewStyle } from 'react-native';
4
+
5
+ import List from '../List';
6
+ import { Circle, InnerCircle } from './StyledRadio';
5
7
 
6
8
  export interface RadioProps {
7
9
  /**
@@ -26,6 +28,15 @@ export interface RadioProps {
26
28
  testID?: string;
27
29
  }
28
30
 
31
+ const RadioCircle = ({
32
+ checked,
33
+ text,
34
+ }: Pick<RadioProps, 'text' | 'checked'>) => (
35
+ <Circle>
36
+ {checked && <InnerCircle testID={`${text}-selected-circle`} />}
37
+ </Circle>
38
+ );
39
+
29
40
  const Radio = ({
30
41
  text,
31
42
  checked = false,
@@ -33,19 +44,14 @@ const Radio = ({
33
44
  style,
34
45
  testID,
35
46
  }: RadioProps): ReactElement => (
36
- <Wrapper
47
+ <List.BasicItem
37
48
  onPress={onPress}
38
- themeChecked={checked}
49
+ selected={checked}
50
+ title={text}
51
+ suffix={<RadioCircle checked={checked} text={text} />}
39
52
  style={style}
40
53
  testID={testID}
41
- >
42
- <View style={{ flex: 1 }}>
43
- <Typography.Text fontSize="large">{text}</Typography.Text>
44
- </View>
45
- <Circle themeChecked={checked}>
46
- {checked && <InnerCircle testID={`${text}-selected-circle`} />}
47
- </Circle>
48
- </Wrapper>
54
+ />
49
55
  );
50
56
 
51
57
  export default Radio;
@@ -1,8 +1,10 @@
1
- import React, { ReactElement } from 'react';
2
- import { StyleProp, View, ViewStyle } from 'react-native';
1
+ import React from 'react';
2
+ import { View } from 'react-native';
3
+ import type { ReactElement } from 'react';
4
+ import type { StyleProp, ViewStyle } from 'react-native';
3
5
  import Radio from './Radio';
4
6
  import { Spacer } from './StyledRadio';
5
- import { OptionType } from './types';
7
+ import type { OptionType } from './types';
6
8
 
7
9
  export interface RadioGroupProps<T> {
8
10
  /**
@@ -1,42 +1,25 @@
1
- import { View, TouchableOpacity } from 'react-native';
1
+ import { View } from 'react-native';
2
2
  import styled from '@emotion/native';
3
3
 
4
- const Wrapper = styled(TouchableOpacity)<{ themeChecked: boolean }>(
5
- ({ theme, themeChecked }) => ({
6
- flexDirection: 'row',
7
- justifyContent: 'space-between',
8
- alignItems: 'center',
9
- borderRadius: theme.__hd__.radio.radii.wrapper,
10
- padding: theme.__hd__.radio.space.wrapperPadding,
11
- backgroundColor: themeChecked
12
- ? theme.__hd__.radio.colors.checkedWrapper
13
- : theme.__hd__.radio.colors.wrapper,
14
- })
15
- );
16
-
17
- const Circle = styled(View)<{ themeChecked: boolean }>(
18
- ({ theme, themeChecked }) => ({
19
- height: theme.__hd__.radio.sizes.circle,
20
- width: theme.__hd__.radio.sizes.circle,
21
- borderRadius: theme.radii.rounded,
22
- borderWidth: theme.__hd__.radio.borderWidths.circle,
23
- borderColor: themeChecked
24
- ? theme.__hd__.radio.colors.checkedCircle
25
- : theme.__hd__.radio.colors.circle,
26
- alignItems: 'center',
27
- justifyContent: 'center',
28
- })
29
- );
4
+ const Circle = styled(View)(({ theme }) => ({
5
+ height: theme.__hd__.radio.sizes.circle,
6
+ width: theme.__hd__.radio.sizes.circle,
7
+ borderRadius: theme.radii.rounded,
8
+ borderWidth: theme.__hd__.radio.borderWidths.circle,
9
+ borderColor: theme.__hd__.radio.colors.circle,
10
+ alignItems: 'center',
11
+ justifyContent: 'center',
12
+ }));
30
13
 
31
14
  const InnerCircle = styled(View)(({ theme }) => ({
32
15
  height: theme.__hd__.radio.sizes.innerCircle,
33
16
  width: theme.__hd__.radio.sizes.innerCircle,
34
17
  borderRadius: theme.radii.rounded,
35
- backgroundColor: theme.__hd__.radio.colors.checkedCircle,
18
+ backgroundColor: theme.__hd__.radio.colors.circle,
36
19
  }));
37
20
 
38
21
  const Spacer = styled(View)(({ theme }) => ({
39
22
  marginTop: theme.__hd__.radio.space.groupTopMargin,
40
23
  }));
41
24
 
42
- export { Wrapper, Circle, InnerCircle, Spacer };
25
+ export { Circle, InnerCircle, Spacer };
@@ -2,10 +2,13 @@
2
2
 
3
3
  exports[`rendering renders correctly when checked 1`] = `
4
4
  <View
5
+ accessibilityState={
6
+ Object {
7
+ "disabled": false,
8
+ }
9
+ }
5
10
  accessible={true}
6
- collapsable={false}
7
11
  focusable={true}
8
- nativeID="animatedComponent"
9
12
  onClick={[Function]}
10
13
  onResponderGrant={[Function]}
11
14
  onResponderMove={[Function]}
@@ -14,22 +17,26 @@ exports[`rendering renders correctly when checked 1`] = `
14
17
  onResponderTerminationRequest={[Function]}
15
18
  onStartShouldSetResponder={[Function]}
16
19
  style={
17
- Object {
18
- "alignItems": "center",
19
- "backgroundColor": "#f3e6f6",
20
- "borderRadius": 4,
21
- "flexDirection": "row",
22
- "justifyContent": "space-between",
23
- "opacity": 1,
24
- "padding": 16,
25
- }
20
+ Array [
21
+ Object {
22
+ "alignItems": "center",
23
+ "backgroundColor": "#f3e6f6",
24
+ "flexDirection": "row",
25
+ "opacity": 1,
26
+ "padding": 16,
27
+ },
28
+ undefined,
29
+ ]
26
30
  }
27
31
  >
28
32
  <View
29
33
  style={
30
- Object {
31
- "flex": 1,
32
- }
34
+ Array [
35
+ Object {
36
+ "flex": 1,
37
+ },
38
+ undefined,
39
+ ]
33
40
  }
34
41
  >
35
42
  <Text
@@ -56,43 +63,56 @@ exports[`rendering renders correctly when checked 1`] = `
56
63
  style={
57
64
  Array [
58
65
  Object {
59
- "alignItems": "center",
60
- "borderColor": "#8505a2",
61
- "borderRadius": 999,
62
- "borderWidth": 2,
63
- "height": 20,
64
- "justifyContent": "center",
65
- "width": 20,
66
+ "marginLeft": 8,
66
67
  },
67
68
  undefined,
68
69
  ]
69
70
  }
70
- themeChecked={true}
71
71
  >
72
72
  <View
73
73
  style={
74
74
  Array [
75
75
  Object {
76
- "backgroundColor": "#8505a2",
76
+ "alignItems": "center",
77
+ "borderColor": "#001f23",
77
78
  "borderRadius": 999,
78
- "height": 10,
79
- "width": 10,
79
+ "borderWidth": 2,
80
+ "height": 20,
81
+ "justifyContent": "center",
82
+ "width": 20,
80
83
  },
81
84
  undefined,
82
85
  ]
83
86
  }
84
- testID="Option A-selected-circle"
85
- />
87
+ >
88
+ <View
89
+ style={
90
+ Array [
91
+ Object {
92
+ "backgroundColor": "#001f23",
93
+ "borderRadius": 999,
94
+ "height": 10,
95
+ "width": 10,
96
+ },
97
+ undefined,
98
+ ]
99
+ }
100
+ testID="Option A-selected-circle"
101
+ />
102
+ </View>
86
103
  </View>
87
104
  </View>
88
105
  `;
89
106
 
90
107
  exports[`rendering renders correctly when not checked 1`] = `
91
108
  <View
109
+ accessibilityState={
110
+ Object {
111
+ "disabled": false,
112
+ }
113
+ }
92
114
  accessible={true}
93
- collapsable={false}
94
115
  focusable={true}
95
- nativeID="animatedComponent"
96
116
  onClick={[Function]}
97
117
  onResponderGrant={[Function]}
98
118
  onResponderMove={[Function]}
@@ -101,22 +121,26 @@ exports[`rendering renders correctly when not checked 1`] = `
101
121
  onResponderTerminationRequest={[Function]}
102
122
  onStartShouldSetResponder={[Function]}
103
123
  style={
104
- Object {
105
- "alignItems": "center",
106
- "backgroundColor": "#ffffff",
107
- "borderRadius": 4,
108
- "flexDirection": "row",
109
- "justifyContent": "space-between",
110
- "opacity": 1,
111
- "padding": 16,
112
- }
124
+ Array [
125
+ Object {
126
+ "alignItems": "center",
127
+ "backgroundColor": "#ffffff",
128
+ "flexDirection": "row",
129
+ "opacity": 1,
130
+ "padding": 16,
131
+ },
132
+ undefined,
133
+ ]
113
134
  }
114
135
  >
115
136
  <View
116
137
  style={
117
- Object {
118
- "flex": 1,
119
- }
138
+ Array [
139
+ Object {
140
+ "flex": 1,
141
+ },
142
+ undefined,
143
+ ]
120
144
  }
121
145
  >
122
146
  <Text
@@ -143,18 +167,28 @@ exports[`rendering renders correctly when not checked 1`] = `
143
167
  style={
144
168
  Array [
145
169
  Object {
146
- "alignItems": "center",
147
- "borderColor": "#000000",
148
- "borderRadius": 999,
149
- "borderWidth": 2,
150
- "height": 20,
151
- "justifyContent": "center",
152
- "width": 20,
170
+ "marginLeft": 8,
153
171
  },
154
172
  undefined,
155
173
  ]
156
174
  }
157
- themeChecked={false}
158
- />
175
+ >
176
+ <View
177
+ style={
178
+ Array [
179
+ Object {
180
+ "alignItems": "center",
181
+ "borderColor": "#001f23",
182
+ "borderRadius": 999,
183
+ "borderWidth": 2,
184
+ "height": 20,
185
+ "justifyContent": "center",
186
+ "width": 20,
187
+ },
188
+ undefined,
189
+ ]
190
+ }
191
+ />
192
+ </View>
159
193
  </View>
160
194
  `;