@hero-design/rn 8.36.0-alpha.0 → 8.36.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 (288) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/.turbo/turbo-publish:npm.log +0 -9
  3. package/es/index.js +65 -54
  4. package/lib/index.js +65 -54
  5. package/package.json +7 -7
  6. package/src/components/Checkbox/StyledCheckbox.tsx +18 -17
  7. package/src/components/Checkbox/__tests__/StyledCheckbox.spec.tsx +28 -15
  8. package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +151 -4
  9. package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +339 -10
  10. package/src/components/Checkbox/__tests__/index.spec.tsx +28 -8
  11. package/src/components/Checkbox/index.tsx +54 -25
  12. package/src/components/FAB/ActionGroup/index.tsx +1 -1
  13. package/src/components/Portal/PortalHost.tsx +3 -0
  14. package/src/components/Portal/PortalProvider.tsx +6 -0
  15. package/src/components/Portal/index.tsx +11 -0
  16. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +5 -2
  17. package/src/theme/components/checkbox.ts +5 -2
  18. package/types/components/Accordion/AccordionItem.d.ts +0 -0
  19. package/types/components/Accordion/StyledAccordion.d.ts +0 -0
  20. package/types/components/Accordion/index.d.ts +0 -0
  21. package/types/components/Alert/StyledAlert.d.ts +0 -0
  22. package/types/components/Alert/index.d.ts +0 -0
  23. package/types/components/Attachment/StyledAttachment.d.ts +0 -0
  24. package/types/components/Attachment/index.d.ts +0 -0
  25. package/types/components/Avatar/Avatar.d.ts +0 -0
  26. package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +0 -0
  27. package/types/components/Avatar/AvatarStack/index.d.ts +0 -0
  28. package/types/components/Avatar/AvatarStack/utils.d.ts +0 -0
  29. package/types/components/Avatar/StyledAvatar.d.ts +0 -0
  30. package/types/components/Avatar/index.d.ts +0 -0
  31. package/types/components/Badge/Status.d.ts +0 -0
  32. package/types/components/Badge/StyledBadge.d.ts +0 -0
  33. package/types/components/Badge/index.d.ts +0 -0
  34. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
  35. package/types/components/BottomNavigation/index.d.ts +0 -0
  36. package/types/components/BottomSheet/BottomSheetContext.d.ts +0 -0
  37. package/types/components/BottomSheet/Footer.d.ts +0 -0
  38. package/types/components/BottomSheet/Header.d.ts +0 -0
  39. package/types/components/BottomSheet/ScrollView.d.ts +0 -0
  40. package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
  41. package/types/components/BottomSheet/index.d.ts +0 -0
  42. package/types/components/Box/StyledBox.d.ts +0 -0
  43. package/types/components/Box/config.d.ts +0 -0
  44. package/types/components/Box/index.d.ts +0 -0
  45. package/types/components/Box/types.d.ts +0 -0
  46. package/types/components/Button/Button.d.ts +0 -0
  47. package/types/components/Button/IconButton.d.ts +0 -0
  48. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
  49. package/types/components/Button/LoadingIndicator/index.d.ts +0 -0
  50. package/types/components/Button/StyledButton.d.ts +0 -0
  51. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +0 -0
  52. package/types/components/Button/UtilityButton/index.d.ts +0 -0
  53. package/types/components/Button/index.d.ts +0 -0
  54. package/types/components/Calendar/CalendarRowItem.d.ts +0 -0
  55. package/types/components/Calendar/StyledCalendar.d.ts +0 -0
  56. package/types/components/Calendar/helpers.d.ts +0 -0
  57. package/types/components/Calendar/index.d.ts +0 -0
  58. package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -0
  59. package/types/components/Card/DataCard/index.d.ts +0 -0
  60. package/types/components/Card/StyledCard.d.ts +0 -0
  61. package/types/components/Card/index.d.ts +0 -0
  62. package/types/components/Carousel/CardCarousel.d.ts +0 -0
  63. package/types/components/Carousel/CarouselItem.d.ts +0 -0
  64. package/types/components/Carousel/StyledCardCarousel.d.ts +0 -0
  65. package/types/components/Carousel/StyledCarousel.d.ts +0 -0
  66. package/types/components/Carousel/contants.d.ts +0 -0
  67. package/types/components/Carousel/index.d.ts +0 -0
  68. package/types/components/Carousel/types.d.ts +0 -0
  69. package/types/components/Checkbox/StyledCheckbox.d.ts +6 -2
  70. package/types/components/Checkbox/index.d.ts +10 -1
  71. package/types/components/Collapse/StyledCollapse.d.ts +0 -0
  72. package/types/components/Collapse/index.d.ts +0 -0
  73. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
  74. package/types/components/ContentNavigator/index.d.ts +0 -0
  75. package/types/components/DatePicker/DatePickerAndroid.d.ts +0 -0
  76. package/types/components/DatePicker/DatePickerCalendar.d.ts +0 -0
  77. package/types/components/DatePicker/DatePickerIOS.d.ts +0 -0
  78. package/types/components/DatePicker/StyledDatePicker.d.ts +0 -0
  79. package/types/components/DatePicker/index.d.ts +0 -0
  80. package/types/components/DatePicker/types.d.ts +0 -0
  81. package/types/components/Divider/StyledDivider.d.ts +0 -0
  82. package/types/components/Divider/index.d.ts +0 -0
  83. package/types/components/Drawer/DragableDrawer/helpers.d.ts +0 -0
  84. package/types/components/Drawer/DragableDrawer/index.d.ts +0 -0
  85. package/types/components/Drawer/StyledDrawer.d.ts +0 -0
  86. package/types/components/Drawer/index.d.ts +0 -0
  87. package/types/components/Empty/StyledEmpty.d.ts +0 -0
  88. package/types/components/Empty/index.d.ts +0 -0
  89. package/types/components/Error/StyledError.d.ts +0 -0
  90. package/types/components/Error/index.d.ts +0 -0
  91. package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
  92. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
  93. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
  94. package/types/components/FAB/ActionGroup/index.d.ts +0 -0
  95. package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
  96. package/types/components/FAB/FAB.d.ts +0 -0
  97. package/types/components/FAB/StyledFAB.d.ts +0 -0
  98. package/types/components/FAB/index.d.ts +0 -0
  99. package/types/components/Icon/AnimatedIcon.d.ts +0 -0
  100. package/types/components/Icon/HeroIcon/index.d.ts +0 -0
  101. package/types/components/Icon/IconList.d.ts +0 -0
  102. package/types/components/Icon/index.d.ts +0 -0
  103. package/types/components/Icon/utils.d.ts +0 -0
  104. package/types/components/Image/index.d.ts +0 -0
  105. package/types/components/List/BasicListItem.d.ts +0 -0
  106. package/types/components/List/ListItem.d.ts +0 -0
  107. package/types/components/List/StyledBasicListItem.d.ts +0 -0
  108. package/types/components/List/StyledListItem.d.ts +0 -0
  109. package/types/components/List/index.d.ts +0 -0
  110. package/types/components/PageControl/StyledPageControl.d.ts +0 -0
  111. package/types/components/PageControl/index.d.ts +0 -0
  112. package/types/components/PinInput/PinCell.d.ts +0 -0
  113. package/types/components/PinInput/StyledPinInput.d.ts +0 -0
  114. package/types/components/PinInput/index.d.ts +0 -0
  115. package/types/components/Progress/ProgressBar.d.ts +0 -0
  116. package/types/components/Progress/ProgressCircle.d.ts +0 -0
  117. package/types/components/Progress/StyledProgressBar.d.ts +0 -0
  118. package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
  119. package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
  120. package/types/components/Progress/constants.d.ts +0 -0
  121. package/types/components/Progress/index.d.ts +0 -0
  122. package/types/components/Progress/types.d.ts +0 -0
  123. package/types/components/Radio/Radio.d.ts +0 -0
  124. package/types/components/Radio/RadioGroup.d.ts +0 -0
  125. package/types/components/Radio/StyledRadio.d.ts +0 -0
  126. package/types/components/Radio/index.d.ts +0 -0
  127. package/types/components/Radio/types.d.ts +0 -0
  128. package/types/components/RefreshControl/index.d.ts +0 -0
  129. package/types/components/RichTextEditor/EditorEvent.d.ts +0 -0
  130. package/types/components/RichTextEditor/EditorToolbar.d.ts +0 -0
  131. package/types/components/RichTextEditor/MentionList.d.ts +0 -0
  132. package/types/components/RichTextEditor/RichTextEditor.d.ts +0 -0
  133. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -0
  134. package/types/components/RichTextEditor/StyledToolbar.d.ts +0 -0
  135. package/types/components/RichTextEditor/__mocks__/heroEditorApp.d.ts +0 -0
  136. package/types/components/RichTextEditor/constants.d.ts +0 -0
  137. package/types/components/RichTextEditor/heroEditorApp.d.ts +0 -0
  138. package/types/components/RichTextEditor/index.d.ts +0 -0
  139. package/types/components/RichTextEditor/types.d.ts +0 -0
  140. package/types/components/RichTextEditor/utils/events.d.ts +0 -0
  141. package/types/components/RichTextEditor/utils/rnWebView.d.ts +0 -0
  142. package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
  143. package/types/components/SectionHeading/index.d.ts +0 -0
  144. package/types/components/Select/BaseOptionList.d.ts +0 -0
  145. package/types/components/Select/Footer.d.ts +0 -0
  146. package/types/components/Select/MultiSelect/Option.d.ts +0 -0
  147. package/types/components/Select/MultiSelect/OptionList.d.ts +0 -0
  148. package/types/components/Select/MultiSelect/index.d.ts +0 -0
  149. package/types/components/Select/SingleSelect/Option.d.ts +0 -0
  150. package/types/components/Select/SingleSelect/OptionList.d.ts +0 -0
  151. package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +0 -0
  152. package/types/components/Select/SingleSelect/index.d.ts +0 -0
  153. package/types/components/Select/StyledSelect.d.ts +0 -0
  154. package/types/components/Select/helpers.d.ts +0 -0
  155. package/types/components/Select/index.d.ts +0 -0
  156. package/types/components/Select/types.d.ts +0 -0
  157. package/types/components/Skeleton/StyledSkeleton.d.ts +0 -0
  158. package/types/components/Skeleton/index.d.ts +0 -0
  159. package/types/components/Slider/index.d.ts +0 -0
  160. package/types/components/Spinner/AnimatedSpinner.d.ts +0 -0
  161. package/types/components/Spinner/StyledSpinner.d.ts +0 -0
  162. package/types/components/Spinner/index.d.ts +0 -0
  163. package/types/components/Success/StyledSuccess.d.ts +0 -0
  164. package/types/components/Success/index.d.ts +0 -0
  165. package/types/components/Swipeable/StyledSwipeable.d.ts +0 -0
  166. package/types/components/Swipeable/SwipeableAction.d.ts +0 -0
  167. package/types/components/Swipeable/index.d.ts +0 -0
  168. package/types/components/Switch/SelectorSwitch/Option.d.ts +0 -0
  169. package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +0 -0
  170. package/types/components/Switch/SelectorSwitch/index.d.ts +0 -0
  171. package/types/components/Switch/StyledSwitch.d.ts +0 -0
  172. package/types/components/Switch/index.d.ts +0 -0
  173. package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
  174. package/types/components/Tabs/SceneView.d.ts +0 -0
  175. package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
  176. package/types/components/Tabs/ScrollableTabsHeader.d.ts +0 -0
  177. package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
  178. package/types/components/Tabs/StyledTabs.d.ts +0 -0
  179. package/types/components/Tabs/TabWithBadge.d.ts +0 -0
  180. package/types/components/Tabs/index.d.ts +0 -0
  181. package/types/components/Tabs/useIsFocused.d.ts +0 -0
  182. package/types/components/Tabs/utils.d.ts +0 -0
  183. package/types/components/Tag/StyledTag.d.ts +0 -0
  184. package/types/components/Tag/index.d.ts +0 -0
  185. package/types/components/TextInput/StyledTextInput.d.ts +0 -0
  186. package/types/components/TextInput/index.d.ts +0 -0
  187. package/types/components/TimePicker/StyledTimePicker.d.ts +0 -0
  188. package/types/components/TimePicker/TimePickerAndroid.d.ts +0 -0
  189. package/types/components/TimePicker/TimePickerIOS.d.ts +0 -0
  190. package/types/components/TimePicker/index.d.ts +0 -0
  191. package/types/components/TimePicker/types.d.ts +0 -0
  192. package/types/components/Toast/StyledToast.d.ts +0 -0
  193. package/types/components/Toast/Toast.d.ts +0 -0
  194. package/types/components/Toast/ToastContainer.d.ts +0 -0
  195. package/types/components/Toast/ToastContext.d.ts +0 -0
  196. package/types/components/Toast/ToastProvider.d.ts +0 -0
  197. package/types/components/Toast/index.d.ts +0 -0
  198. package/types/components/Toast/types.d.ts +0 -0
  199. package/types/components/Toolbar/StyledToolbar.d.ts +0 -0
  200. package/types/components/Toolbar/ToolbarGroup.d.ts +0 -0
  201. package/types/components/Toolbar/ToolbarItem.d.ts +0 -0
  202. package/types/components/Toolbar/index.d.ts +0 -0
  203. package/types/components/Typography/Text/StyledText.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/ThemeProvider.d.ts +0 -0
  209. package/types/theme/ThemeSwitcher.d.ts +0 -0
  210. package/types/theme/components/accordion.d.ts +0 -0
  211. package/types/theme/components/alert.d.ts +0 -0
  212. package/types/theme/components/attachment.d.ts +0 -0
  213. package/types/theme/components/avatar.d.ts +0 -0
  214. package/types/theme/components/badge.d.ts +0 -0
  215. package/types/theme/components/bottomNavigation.d.ts +0 -0
  216. package/types/theme/components/bottomSheet.d.ts +0 -0
  217. package/types/theme/components/button.d.ts +0 -0
  218. package/types/theme/components/calendar.d.ts +0 -0
  219. package/types/theme/components/card.d.ts +0 -0
  220. package/types/theme/components/cardCarousel.d.ts +0 -0
  221. package/types/theme/components/carousel.d.ts +0 -0
  222. package/types/theme/components/checkbox.d.ts +5 -2
  223. package/types/theme/components/contentNavigator.d.ts +0 -0
  224. package/types/theme/components/datePicker.d.ts +0 -0
  225. package/types/theme/components/divider.d.ts +0 -0
  226. package/types/theme/components/drawer.d.ts +0 -0
  227. package/types/theme/components/empty.d.ts +0 -0
  228. package/types/theme/components/error.d.ts +0 -0
  229. package/types/theme/components/fab.d.ts +0 -0
  230. package/types/theme/components/icon.d.ts +0 -0
  231. package/types/theme/components/image.d.ts +0 -0
  232. package/types/theme/components/list.d.ts +0 -0
  233. package/types/theme/components/pageControl.d.ts +0 -0
  234. package/types/theme/components/pinInput.d.ts +0 -0
  235. package/types/theme/components/progress.d.ts +0 -0
  236. package/types/theme/components/radio.d.ts +0 -0
  237. package/types/theme/components/refreshControl.d.ts +0 -0
  238. package/types/theme/components/richTextEditor.d.ts +0 -0
  239. package/types/theme/components/sectionHeading.d.ts +0 -0
  240. package/types/theme/components/select.d.ts +0 -0
  241. package/types/theme/components/skeleton.d.ts +0 -0
  242. package/types/theme/components/slider.d.ts +0 -0
  243. package/types/theme/components/spinner.d.ts +0 -0
  244. package/types/theme/components/success.d.ts +0 -0
  245. package/types/theme/components/swipeable.d.ts +0 -0
  246. package/types/theme/components/switch.d.ts +0 -0
  247. package/types/theme/components/tabs.d.ts +0 -0
  248. package/types/theme/components/tag.d.ts +0 -0
  249. package/types/theme/components/textInput.d.ts +0 -0
  250. package/types/theme/components/timePicker.d.ts +0 -0
  251. package/types/theme/components/toast.d.ts +0 -0
  252. package/types/theme/components/toolbar.d.ts +0 -0
  253. package/types/theme/components/typography.d.ts +0 -0
  254. package/types/theme/getTheme.d.ts +0 -0
  255. package/types/theme/global/borders.d.ts +0 -0
  256. package/types/theme/global/colors/eBens.d.ts +0 -0
  257. package/types/theme/global/colors/global.d.ts +0 -0
  258. package/types/theme/global/colors/globalDark.d.ts +0 -0
  259. package/types/theme/global/colors/jobs.d.ts +0 -0
  260. package/types/theme/global/colors/swag.d.ts +0 -0
  261. package/types/theme/global/colors/swagDark.d.ts +0 -0
  262. package/types/theme/global/colors/types.d.ts +0 -0
  263. package/types/theme/global/colors/wallet.d.ts +0 -0
  264. package/types/theme/global/colors/work.d.ts +0 -0
  265. package/types/theme/global/index.d.ts +0 -0
  266. package/types/theme/global/scale.d.ts +0 -0
  267. package/types/theme/global/sizes.d.ts +0 -0
  268. package/types/theme/global/space.d.ts +0 -0
  269. package/types/theme/global/typography.d.ts +0 -0
  270. package/types/theme/index.d.ts +0 -0
  271. package/types/types.d.ts +0 -0
  272. package/types/utils/functions.d.ts +0 -0
  273. package/types/utils/helpers.d.ts +0 -0
  274. package/types/utils/hooks.d.ts +0 -0
  275. package/types/utils/scale.d.ts +0 -0
  276. package/.tool-versions +0 -1
  277. package/.turbo/turbo-build:types.log +0 -1
  278. package/.turbo/turbo-lint.log +0 -172
  279. package/.turbo/turbo-test.log +0 -1
  280. package/.turbo/turbo-type-check.log +0 -1
  281. package/types/components/FAB/ActionGroup/FABModal.d.ts +0 -21
  282. package/types/components/FAB/ActionGroup/FABModalContentWrapper.d.ts +0 -18
  283. package/types/components/FAB/ActionGroup/FABProvider.d.ts +0 -5
  284. package/types/components/FAB/ActionGroup/ModalPresenter/ModalPresenter.d.ts +0 -34
  285. package/types/components/FAB/ActionGroup/ModalPresenter/index.d.ts +0 -3
  286. package/types/components/Tabs/ScrollableTabsV2/SceneView.d.ts +0 -10
  287. package/types/components/Tabs/ScrollableTabsV2/ScrollableTabsV2.d.ts +0 -9
  288. package/types/components/Tabs/ScrollableTabsV2/index.d.ts +0 -4
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`StyledCheckbox renders correctly when disabled is false 1`] = `
3
+ exports[`StyledCheckbox renders correctly when disabled is false and readonly is false 1`] = `
4
4
  <View
5
5
  style={
6
6
  Array [
@@ -13,11 +13,45 @@ exports[`StyledCheckbox renders correctly when disabled is false 1`] = `
13
13
  undefined,
14
14
  ]
15
15
  }
16
- themeDisabled={false}
16
+ themeState="default"
17
17
  />
18
18
  `;
19
19
 
20
- exports[`StyledCheckbox renders correctly when disabled is true 1`] = `
20
+ exports[`StyledCheckbox renders correctly when disabled is false and readonly is true 1`] = `
21
+ <View
22
+ style={
23
+ Array [
24
+ Object {
25
+ "borderColor": "#808f91",
26
+ "borderRadius": 4,
27
+ "borderWidth": 2,
28
+ "flex": 1,
29
+ },
30
+ undefined,
31
+ ]
32
+ }
33
+ themeState="readonly"
34
+ />
35
+ `;
36
+
37
+ exports[`StyledCheckbox renders correctly when disabled is true and readonly is false 1`] = `
38
+ <View
39
+ style={
40
+ Array [
41
+ Object {
42
+ "borderColor": "#bfc1c5",
43
+ "borderRadius": 4,
44
+ "borderWidth": 2,
45
+ "flex": 1,
46
+ },
47
+ undefined,
48
+ ]
49
+ }
50
+ themeState="disabled"
51
+ />
52
+ `;
53
+
54
+ exports[`StyledCheckbox renders correctly when disabled is true and readonly is true 1`] = `
21
55
  <View
22
56
  style={
23
57
  Array [
@@ -30,7 +64,7 @@ exports[`StyledCheckbox renders correctly when disabled is true 1`] = `
30
64
  undefined,
31
65
  ]
32
66
  }
33
- themeDisabled={true}
67
+ themeState="disabled"
34
68
  />
35
69
  `;
36
70
 
@@ -55,6 +89,27 @@ exports[`StyledWrapper renders correctly when disabled is false, withBorder is f
55
89
  />
56
90
  `;
57
91
 
92
+ exports[`StyledWrapper renders correctly when disabled is false, withBorder is false 2`] = `
93
+ <View
94
+ accessible={true}
95
+ collapsable={false}
96
+ focusable={false}
97
+ onClick={[Function]}
98
+ onResponderGrant={[Function]}
99
+ onResponderMove={[Function]}
100
+ onResponderRelease={[Function]}
101
+ onResponderTerminate={[Function]}
102
+ onResponderTerminationRequest={[Function]}
103
+ onStartShouldSetResponder={[Function]}
104
+ style={
105
+ Object {
106
+ "flexDirection": "row",
107
+ "opacity": 1,
108
+ }
109
+ }
110
+ />
111
+ `;
112
+
58
113
  exports[`StyledWrapper renders correctly when disabled is false, withBorder is true 1`] = `
59
114
  <View
60
115
  accessible={true}
@@ -80,6 +135,73 @@ exports[`StyledWrapper renders correctly when disabled is false, withBorder is t
80
135
  />
81
136
  `;
82
137
 
138
+ exports[`StyledWrapper renders correctly when disabled is false, withBorder is true 2`] = `
139
+ <View
140
+ accessible={true}
141
+ collapsable={false}
142
+ focusable={false}
143
+ onClick={[Function]}
144
+ onResponderGrant={[Function]}
145
+ onResponderMove={[Function]}
146
+ onResponderRelease={[Function]}
147
+ onResponderTerminate={[Function]}
148
+ onResponderTerminationRequest={[Function]}
149
+ onStartShouldSetResponder={[Function]}
150
+ style={
151
+ Object {
152
+ "borderColor": "#808f91",
153
+ "borderRadius": 8,
154
+ "borderWidth": 1,
155
+ "flexDirection": "row",
156
+ "opacity": 1,
157
+ "padding": 16,
158
+ }
159
+ }
160
+ />
161
+ `;
162
+
163
+ exports[`StyledWrapper renders correctly when disabled is true, withBorder is false 1`] = `
164
+ <View
165
+ accessible={true}
166
+ collapsable={false}
167
+ focusable={false}
168
+ onClick={[Function]}
169
+ onResponderGrant={[Function]}
170
+ onResponderMove={[Function]}
171
+ onResponderRelease={[Function]}
172
+ onResponderTerminate={[Function]}
173
+ onResponderTerminationRequest={[Function]}
174
+ onStartShouldSetResponder={[Function]}
175
+ style={
176
+ Object {
177
+ "flexDirection": "row",
178
+ "opacity": 1,
179
+ }
180
+ }
181
+ />
182
+ `;
183
+
184
+ exports[`StyledWrapper renders correctly when disabled is true, withBorder is false 2`] = `
185
+ <View
186
+ accessible={true}
187
+ collapsable={false}
188
+ focusable={false}
189
+ onClick={[Function]}
190
+ onResponderGrant={[Function]}
191
+ onResponderMove={[Function]}
192
+ onResponderRelease={[Function]}
193
+ onResponderTerminate={[Function]}
194
+ onResponderTerminationRequest={[Function]}
195
+ onStartShouldSetResponder={[Function]}
196
+ style={
197
+ Object {
198
+ "flexDirection": "row",
199
+ "opacity": 1,
200
+ }
201
+ }
202
+ />
203
+ `;
204
+
83
205
  exports[`StyledWrapper renders correctly when disabled is true, withBorder is true 1`] = `
84
206
  <View
85
207
  accessible={true}
@@ -104,3 +226,28 @@ exports[`StyledWrapper renders correctly when disabled is true, withBorder is tr
104
226
  }
105
227
  />
106
228
  `;
229
+
230
+ exports[`StyledWrapper renders correctly when disabled is true, withBorder is true 2`] = `
231
+ <View
232
+ accessible={true}
233
+ collapsable={false}
234
+ focusable={false}
235
+ onClick={[Function]}
236
+ onResponderGrant={[Function]}
237
+ onResponderMove={[Function]}
238
+ onResponderRelease={[Function]}
239
+ onResponderTerminate={[Function]}
240
+ onResponderTerminationRequest={[Function]}
241
+ onStartShouldSetResponder={[Function]}
242
+ style={
243
+ Object {
244
+ "borderColor": "#bfc1c5",
245
+ "borderRadius": 8,
246
+ "borderWidth": 1,
247
+ "flexDirection": "row",
248
+ "opacity": 1,
249
+ "padding": 16,
250
+ }
251
+ }
252
+ />
253
+ `;
@@ -48,7 +48,7 @@ exports[`Checkbox renders correctly when checked is false and there is no descri
48
48
  undefined,
49
49
  ]
50
50
  }
51
- themeDisabled={false}
51
+ themeState="default"
52
52
  />
53
53
  </View>
54
54
  </View>
@@ -100,6 +100,7 @@ exports[`Checkbox renders correctly when checked is true and there is no descrip
100
100
  },
101
101
  Array [
102
102
  Object {
103
+ "color": "#001f23",
103
104
  "position": "absolute",
104
105
  "top": 0,
105
106
  },
@@ -123,13 +124,13 @@ exports[`Checkbox renders correctly when checked is true and there is no descrip
123
124
  undefined,
124
125
  ]
125
126
  }
126
- themeDisabled={false}
127
+ themeState="default"
127
128
  />
128
129
  </View>
129
130
  </View>
130
131
  `;
131
132
 
132
- exports[`Checkbox renders correctly when disabled is false, withBorder is false 1`] = `
133
+ exports[`Checkbox renders correctly when disabled is false, withBorder is false and readonly is false 1`] = `
133
134
  <View
134
135
  accessibilityState={
135
136
  Object {
@@ -203,13 +204,93 @@ exports[`Checkbox renders correctly when disabled is false, withBorder is false
203
204
  undefined,
204
205
  ]
205
206
  }
206
- themeDisabled={false}
207
+ themeState="default"
207
208
  />
208
209
  </View>
209
210
  </View>
210
211
  `;
211
212
 
212
- exports[`Checkbox renders correctly when disabled is false, withBorder is true 1`] = `
213
+ exports[`Checkbox renders correctly when disabled is false, withBorder is false and readonly is true 1`] = `
214
+ <View
215
+ accessibilityState={
216
+ Object {
217
+ "disabled": true,
218
+ }
219
+ }
220
+ accessible={true}
221
+ collapsable={false}
222
+ focusable={false}
223
+ onClick={[Function]}
224
+ onResponderGrant={[Function]}
225
+ onResponderMove={[Function]}
226
+ onResponderRelease={[Function]}
227
+ onResponderTerminate={[Function]}
228
+ onResponderTerminationRequest={[Function]}
229
+ onStartShouldSetResponder={[Function]}
230
+ style={
231
+ Object {
232
+ "flexDirection": "row",
233
+ "opacity": 1,
234
+ }
235
+ }
236
+ >
237
+ <Text
238
+ allowFontScaling={false}
239
+ style={
240
+ Array [
241
+ Object {
242
+ "color": "#001f23",
243
+ "fontFamily": "BeVietnamPro-Regular",
244
+ "fontSize": 14,
245
+ "letterSpacing": 0.48,
246
+ "lineHeight": 22,
247
+ },
248
+ Array [
249
+ Object {
250
+ "flex": 1,
251
+ "paddingRight": 12,
252
+ },
253
+ undefined,
254
+ ],
255
+ ]
256
+ }
257
+ themeIntent="body"
258
+ themeTypeface="neutral"
259
+ themeVariant="small"
260
+ >
261
+ Please agree to our privacy policy
262
+ </Text>
263
+ <View
264
+ style={
265
+ Array [
266
+ Object {
267
+ "height": 24,
268
+ "overflow": "hidden",
269
+ "width": 24,
270
+ },
271
+ undefined,
272
+ ]
273
+ }
274
+ >
275
+ <View
276
+ style={
277
+ Array [
278
+ Object {
279
+ "borderColor": "#808f91",
280
+ "borderRadius": 4,
281
+ "borderWidth": 2,
282
+ "flex": 1,
283
+ },
284
+ undefined,
285
+ ]
286
+ }
287
+ themeState="readonly"
288
+ />
289
+ </View>
290
+ </View>
291
+ `;
292
+
293
+ exports[`Checkbox renders correctly when disabled is false, withBorder is true and readonly is false 1`] = `
213
294
  <View
214
295
  accessibilityState={
215
296
  Object {
@@ -287,13 +368,13 @@ exports[`Checkbox renders correctly when disabled is false, withBorder is true 1
287
368
  undefined,
288
369
  ]
289
370
  }
290
- themeDisabled={false}
371
+ themeState="default"
291
372
  />
292
373
  </View>
293
374
  </View>
294
375
  `;
295
376
 
296
- exports[`Checkbox renders correctly when disabled is true, withBorder is false 1`] = `
377
+ exports[`Checkbox renders correctly when disabled is false, withBorder is true and readonly is true 1`] = `
297
378
  <View
298
379
  accessibilityState={
299
380
  Object {
@@ -312,8 +393,256 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is false 1
312
393
  onStartShouldSetResponder={[Function]}
313
394
  style={
314
395
  Object {
396
+ "borderColor": "#808f91",
397
+ "borderRadius": 8,
398
+ "borderWidth": 1,
315
399
  "flexDirection": "row",
316
400
  "opacity": 1,
401
+ "padding": 16,
402
+ }
403
+ }
404
+ >
405
+ <Text
406
+ allowFontScaling={false}
407
+ style={
408
+ Array [
409
+ Object {
410
+ "color": "#001f23",
411
+ "fontFamily": "BeVietnamPro-Regular",
412
+ "fontSize": 14,
413
+ "letterSpacing": 0.48,
414
+ "lineHeight": 22,
415
+ },
416
+ Array [
417
+ Object {
418
+ "flex": 1,
419
+ "paddingRight": 12,
420
+ },
421
+ undefined,
422
+ ],
423
+ ]
424
+ }
425
+ themeIntent="body"
426
+ themeTypeface="neutral"
427
+ themeVariant="small"
428
+ >
429
+ Please agree to our privacy policy
430
+ </Text>
431
+ <View
432
+ style={
433
+ Array [
434
+ Object {
435
+ "height": 24,
436
+ "overflow": "hidden",
437
+ "width": 24,
438
+ },
439
+ undefined,
440
+ ]
441
+ }
442
+ >
443
+ <View
444
+ style={
445
+ Array [
446
+ Object {
447
+ "borderColor": "#808f91",
448
+ "borderRadius": 4,
449
+ "borderWidth": 2,
450
+ "flex": 1,
451
+ },
452
+ undefined,
453
+ ]
454
+ }
455
+ themeState="readonly"
456
+ />
457
+ </View>
458
+ </View>
459
+ `;
460
+
461
+ exports[`Checkbox renders correctly when disabled is true, withBorder is false and readonly is false 1`] = `
462
+ <View
463
+ accessibilityState={
464
+ Object {
465
+ "disabled": true,
466
+ }
467
+ }
468
+ accessible={true}
469
+ collapsable={false}
470
+ focusable={false}
471
+ onClick={[Function]}
472
+ onResponderGrant={[Function]}
473
+ onResponderMove={[Function]}
474
+ onResponderRelease={[Function]}
475
+ onResponderTerminate={[Function]}
476
+ onResponderTerminationRequest={[Function]}
477
+ onStartShouldSetResponder={[Function]}
478
+ style={
479
+ Object {
480
+ "flexDirection": "row",
481
+ "opacity": 1,
482
+ }
483
+ }
484
+ >
485
+ <Text
486
+ allowFontScaling={false}
487
+ style={
488
+ Array [
489
+ Object {
490
+ "color": "#4d6265",
491
+ "fontFamily": "BeVietnamPro-Regular",
492
+ "fontSize": 14,
493
+ "letterSpacing": 0.48,
494
+ "lineHeight": 22,
495
+ },
496
+ Array [
497
+ Object {
498
+ "flex": 1,
499
+ "paddingRight": 12,
500
+ },
501
+ undefined,
502
+ ],
503
+ ]
504
+ }
505
+ themeIntent="subdued"
506
+ themeTypeface="neutral"
507
+ themeVariant="small"
508
+ >
509
+ Please agree to our privacy policy
510
+ </Text>
511
+ <View
512
+ style={
513
+ Array [
514
+ Object {
515
+ "height": 24,
516
+ "overflow": "hidden",
517
+ "width": 24,
518
+ },
519
+ undefined,
520
+ ]
521
+ }
522
+ >
523
+ <View
524
+ style={
525
+ Array [
526
+ Object {
527
+ "borderColor": "#bfc1c5",
528
+ "borderRadius": 4,
529
+ "borderWidth": 2,
530
+ "flex": 1,
531
+ },
532
+ undefined,
533
+ ]
534
+ }
535
+ themeState="disabled"
536
+ />
537
+ </View>
538
+ </View>
539
+ `;
540
+
541
+ exports[`Checkbox renders correctly when disabled is true, withBorder is false and readonly is true 1`] = `
542
+ <View
543
+ accessibilityState={
544
+ Object {
545
+ "disabled": true,
546
+ }
547
+ }
548
+ accessible={true}
549
+ collapsable={false}
550
+ focusable={false}
551
+ onClick={[Function]}
552
+ onResponderGrant={[Function]}
553
+ onResponderMove={[Function]}
554
+ onResponderRelease={[Function]}
555
+ onResponderTerminate={[Function]}
556
+ onResponderTerminationRequest={[Function]}
557
+ onStartShouldSetResponder={[Function]}
558
+ style={
559
+ Object {
560
+ "flexDirection": "row",
561
+ "opacity": 1,
562
+ }
563
+ }
564
+ >
565
+ <Text
566
+ allowFontScaling={false}
567
+ style={
568
+ Array [
569
+ Object {
570
+ "color": "#4d6265",
571
+ "fontFamily": "BeVietnamPro-Regular",
572
+ "fontSize": 14,
573
+ "letterSpacing": 0.48,
574
+ "lineHeight": 22,
575
+ },
576
+ Array [
577
+ Object {
578
+ "flex": 1,
579
+ "paddingRight": 12,
580
+ },
581
+ undefined,
582
+ ],
583
+ ]
584
+ }
585
+ themeIntent="subdued"
586
+ themeTypeface="neutral"
587
+ themeVariant="small"
588
+ >
589
+ Please agree to our privacy policy
590
+ </Text>
591
+ <View
592
+ style={
593
+ Array [
594
+ Object {
595
+ "height": 24,
596
+ "overflow": "hidden",
597
+ "width": 24,
598
+ },
599
+ undefined,
600
+ ]
601
+ }
602
+ >
603
+ <View
604
+ style={
605
+ Array [
606
+ Object {
607
+ "borderColor": "#bfc1c5",
608
+ "borderRadius": 4,
609
+ "borderWidth": 2,
610
+ "flex": 1,
611
+ },
612
+ undefined,
613
+ ]
614
+ }
615
+ themeState="disabled"
616
+ />
617
+ </View>
618
+ </View>
619
+ `;
620
+
621
+ exports[`Checkbox renders correctly when disabled is true, withBorder is true and readonly is false 1`] = `
622
+ <View
623
+ accessibilityState={
624
+ Object {
625
+ "disabled": true,
626
+ }
627
+ }
628
+ accessible={true}
629
+ collapsable={false}
630
+ focusable={false}
631
+ onClick={[Function]}
632
+ onResponderGrant={[Function]}
633
+ onResponderMove={[Function]}
634
+ onResponderRelease={[Function]}
635
+ onResponderTerminate={[Function]}
636
+ onResponderTerminationRequest={[Function]}
637
+ onStartShouldSetResponder={[Function]}
638
+ style={
639
+ Object {
640
+ "borderColor": "#bfc1c5",
641
+ "borderRadius": 8,
642
+ "borderWidth": 1,
643
+ "flexDirection": "row",
644
+ "opacity": 1,
645
+ "padding": 16,
317
646
  }
318
647
  }
319
648
  >
@@ -367,13 +696,13 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is false 1
367
696
  undefined,
368
697
  ]
369
698
  }
370
- themeDisabled={true}
699
+ themeState="disabled"
371
700
  />
372
701
  </View>
373
702
  </View>
374
703
  `;
375
704
 
376
- exports[`Checkbox renders correctly when disabled is true, withBorder is true 1`] = `
705
+ exports[`Checkbox renders correctly when disabled is true, withBorder is true and readonly is true 1`] = `
377
706
  <View
378
707
  accessibilityState={
379
708
  Object {
@@ -451,7 +780,7 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is true 1`
451
780
  undefined,
452
781
  ]
453
782
  }
454
- themeDisabled={true}
783
+ themeState="disabled"
455
784
  />
456
785
  </View>
457
786
  </View>
@@ -2,22 +2,42 @@ import React from 'react';
2
2
  import { fireEvent } from '@testing-library/react-native';
3
3
 
4
4
  import renderWithTheme from '../../../testHelpers/renderWithTheme';
5
- import Checkbox from '..';
5
+ import Checkbox, { getThemeState } from '..';
6
+
7
+ describe('getThemeState', () => {
8
+ it.each`
9
+ disabled | readonly | expected
10
+ ${false} | ${false} | ${'default'}
11
+ ${false} | ${true} | ${'readonly'}
12
+ ${true} | ${false} | ${'disabled'}
13
+ ${true} | ${true} | ${'disabled'}
14
+ `(
15
+ `should return correctly if disabled is $disabled and readonly is $readonly`,
16
+ ({ disabled, readonly, expected }) => {
17
+ expect(getThemeState({ disabled, readonly })).toBe(expected);
18
+ }
19
+ );
20
+ });
6
21
 
7
22
  describe('Checkbox', () => {
8
23
  it.each`
9
- withBorder | disabled
10
- ${false} | ${false}
11
- ${false} | ${true}
12
- ${true} | ${false}
13
- ${true} | ${true}
24
+ withBorder | disabled | readonly
25
+ ${false} | ${false} | ${false}
26
+ ${false} | ${true} | ${false}
27
+ ${true} | ${false} | ${false}
28
+ ${true} | ${true} | ${false}
29
+ ${false} | ${false} | ${true}
30
+ ${false} | ${true} | ${true}
31
+ ${true} | ${false} | ${true}
32
+ ${true} | ${true} | ${true}
14
33
  `(
15
- 'renders correctly when disabled is $disabled, withBorder is $withBorder',
16
- ({ disabled, withBorder }) => {
34
+ 'renders correctly when disabled is $disabled, withBorder is $withBorder and readonly is $readonly',
35
+ ({ disabled, withBorder, readonly }) => {
17
36
  const wrapper = renderWithTheme(
18
37
  <Checkbox
19
38
  disabled={disabled}
20
39
  withBorder={withBorder}
40
+ readonly={readonly}
21
41
  description="Please agree to our privacy policy"
22
42
  />
23
43
  );