@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.
- package/.turbo/turbo-build.log +2 -2
- package/.turbo/turbo-publish:npm.log +0 -9
- package/es/index.js +65 -54
- package/lib/index.js +65 -54
- package/package.json +7 -7
- package/src/components/Checkbox/StyledCheckbox.tsx +18 -17
- package/src/components/Checkbox/__tests__/StyledCheckbox.spec.tsx +28 -15
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +151 -4
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +339 -10
- package/src/components/Checkbox/__tests__/index.spec.tsx +28 -8
- package/src/components/Checkbox/index.tsx +54 -25
- package/src/components/FAB/ActionGroup/index.tsx +1 -1
- package/src/components/Portal/PortalHost.tsx +3 -0
- package/src/components/Portal/PortalProvider.tsx +6 -0
- package/src/components/Portal/index.tsx +11 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +5 -2
- package/src/theme/components/checkbox.ts +5 -2
- package/types/components/Accordion/AccordionItem.d.ts +0 -0
- package/types/components/Accordion/StyledAccordion.d.ts +0 -0
- package/types/components/Accordion/index.d.ts +0 -0
- package/types/components/Alert/StyledAlert.d.ts +0 -0
- package/types/components/Alert/index.d.ts +0 -0
- package/types/components/Attachment/StyledAttachment.d.ts +0 -0
- package/types/components/Attachment/index.d.ts +0 -0
- package/types/components/Avatar/Avatar.d.ts +0 -0
- package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +0 -0
- package/types/components/Avatar/AvatarStack/index.d.ts +0 -0
- package/types/components/Avatar/AvatarStack/utils.d.ts +0 -0
- package/types/components/Avatar/StyledAvatar.d.ts +0 -0
- package/types/components/Avatar/index.d.ts +0 -0
- package/types/components/Badge/Status.d.ts +0 -0
- package/types/components/Badge/StyledBadge.d.ts +0 -0
- package/types/components/Badge/index.d.ts +0 -0
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
- package/types/components/BottomNavigation/index.d.ts +0 -0
- package/types/components/BottomSheet/BottomSheetContext.d.ts +0 -0
- package/types/components/BottomSheet/Footer.d.ts +0 -0
- package/types/components/BottomSheet/Header.d.ts +0 -0
- package/types/components/BottomSheet/ScrollView.d.ts +0 -0
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
- package/types/components/BottomSheet/index.d.ts +0 -0
- package/types/components/Box/StyledBox.d.ts +0 -0
- package/types/components/Box/config.d.ts +0 -0
- package/types/components/Box/index.d.ts +0 -0
- package/types/components/Box/types.d.ts +0 -0
- package/types/components/Button/Button.d.ts +0 -0
- package/types/components/Button/IconButton.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/index.d.ts +0 -0
- package/types/components/Button/StyledButton.d.ts +0 -0
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +0 -0
- package/types/components/Button/UtilityButton/index.d.ts +0 -0
- package/types/components/Button/index.d.ts +0 -0
- package/types/components/Calendar/CalendarRowItem.d.ts +0 -0
- package/types/components/Calendar/StyledCalendar.d.ts +0 -0
- package/types/components/Calendar/helpers.d.ts +0 -0
- package/types/components/Calendar/index.d.ts +0 -0
- package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -0
- package/types/components/Card/DataCard/index.d.ts +0 -0
- package/types/components/Card/StyledCard.d.ts +0 -0
- package/types/components/Card/index.d.ts +0 -0
- package/types/components/Carousel/CardCarousel.d.ts +0 -0
- package/types/components/Carousel/CarouselItem.d.ts +0 -0
- package/types/components/Carousel/StyledCardCarousel.d.ts +0 -0
- package/types/components/Carousel/StyledCarousel.d.ts +0 -0
- package/types/components/Carousel/contants.d.ts +0 -0
- package/types/components/Carousel/index.d.ts +0 -0
- package/types/components/Carousel/types.d.ts +0 -0
- package/types/components/Checkbox/StyledCheckbox.d.ts +6 -2
- package/types/components/Checkbox/index.d.ts +10 -1
- package/types/components/Collapse/StyledCollapse.d.ts +0 -0
- package/types/components/Collapse/index.d.ts +0 -0
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
- package/types/components/ContentNavigator/index.d.ts +0 -0
- package/types/components/DatePicker/DatePickerAndroid.d.ts +0 -0
- package/types/components/DatePicker/DatePickerCalendar.d.ts +0 -0
- package/types/components/DatePicker/DatePickerIOS.d.ts +0 -0
- package/types/components/DatePicker/StyledDatePicker.d.ts +0 -0
- package/types/components/DatePicker/index.d.ts +0 -0
- package/types/components/DatePicker/types.d.ts +0 -0
- package/types/components/Divider/StyledDivider.d.ts +0 -0
- package/types/components/Divider/index.d.ts +0 -0
- package/types/components/Drawer/DragableDrawer/helpers.d.ts +0 -0
- package/types/components/Drawer/DragableDrawer/index.d.ts +0 -0
- package/types/components/Drawer/StyledDrawer.d.ts +0 -0
- package/types/components/Drawer/index.d.ts +0 -0
- package/types/components/Empty/StyledEmpty.d.ts +0 -0
- package/types/components/Empty/index.d.ts +0 -0
- package/types/components/Error/StyledError.d.ts +0 -0
- package/types/components/Error/index.d.ts +0 -0
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
- package/types/components/FAB/ActionGroup/index.d.ts +0 -0
- package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
- package/types/components/FAB/FAB.d.ts +0 -0
- package/types/components/FAB/StyledFAB.d.ts +0 -0
- package/types/components/FAB/index.d.ts +0 -0
- package/types/components/Icon/AnimatedIcon.d.ts +0 -0
- package/types/components/Icon/HeroIcon/index.d.ts +0 -0
- package/types/components/Icon/IconList.d.ts +0 -0
- package/types/components/Icon/index.d.ts +0 -0
- package/types/components/Icon/utils.d.ts +0 -0
- package/types/components/Image/index.d.ts +0 -0
- package/types/components/List/BasicListItem.d.ts +0 -0
- package/types/components/List/ListItem.d.ts +0 -0
- package/types/components/List/StyledBasicListItem.d.ts +0 -0
- package/types/components/List/StyledListItem.d.ts +0 -0
- package/types/components/List/index.d.ts +0 -0
- package/types/components/PageControl/StyledPageControl.d.ts +0 -0
- package/types/components/PageControl/index.d.ts +0 -0
- package/types/components/PinInput/PinCell.d.ts +0 -0
- package/types/components/PinInput/StyledPinInput.d.ts +0 -0
- package/types/components/PinInput/index.d.ts +0 -0
- package/types/components/Progress/ProgressBar.d.ts +0 -0
- package/types/components/Progress/ProgressCircle.d.ts +0 -0
- package/types/components/Progress/StyledProgressBar.d.ts +0 -0
- package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
- package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
- package/types/components/Progress/constants.d.ts +0 -0
- package/types/components/Progress/index.d.ts +0 -0
- package/types/components/Progress/types.d.ts +0 -0
- package/types/components/Radio/Radio.d.ts +0 -0
- package/types/components/Radio/RadioGroup.d.ts +0 -0
- package/types/components/Radio/StyledRadio.d.ts +0 -0
- package/types/components/Radio/index.d.ts +0 -0
- package/types/components/Radio/types.d.ts +0 -0
- package/types/components/RefreshControl/index.d.ts +0 -0
- package/types/components/RichTextEditor/EditorEvent.d.ts +0 -0
- package/types/components/RichTextEditor/EditorToolbar.d.ts +0 -0
- package/types/components/RichTextEditor/MentionList.d.ts +0 -0
- package/types/components/RichTextEditor/RichTextEditor.d.ts +0 -0
- package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -0
- package/types/components/RichTextEditor/StyledToolbar.d.ts +0 -0
- package/types/components/RichTextEditor/__mocks__/heroEditorApp.d.ts +0 -0
- package/types/components/RichTextEditor/constants.d.ts +0 -0
- package/types/components/RichTextEditor/heroEditorApp.d.ts +0 -0
- package/types/components/RichTextEditor/index.d.ts +0 -0
- package/types/components/RichTextEditor/types.d.ts +0 -0
- package/types/components/RichTextEditor/utils/events.d.ts +0 -0
- package/types/components/RichTextEditor/utils/rnWebView.d.ts +0 -0
- package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
- package/types/components/SectionHeading/index.d.ts +0 -0
- package/types/components/Select/BaseOptionList.d.ts +0 -0
- package/types/components/Select/Footer.d.ts +0 -0
- package/types/components/Select/MultiSelect/Option.d.ts +0 -0
- package/types/components/Select/MultiSelect/OptionList.d.ts +0 -0
- package/types/components/Select/MultiSelect/index.d.ts +0 -0
- package/types/components/Select/SingleSelect/Option.d.ts +0 -0
- package/types/components/Select/SingleSelect/OptionList.d.ts +0 -0
- package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +0 -0
- package/types/components/Select/SingleSelect/index.d.ts +0 -0
- package/types/components/Select/StyledSelect.d.ts +0 -0
- package/types/components/Select/helpers.d.ts +0 -0
- package/types/components/Select/index.d.ts +0 -0
- package/types/components/Select/types.d.ts +0 -0
- package/types/components/Skeleton/StyledSkeleton.d.ts +0 -0
- package/types/components/Skeleton/index.d.ts +0 -0
- package/types/components/Slider/index.d.ts +0 -0
- package/types/components/Spinner/AnimatedSpinner.d.ts +0 -0
- package/types/components/Spinner/StyledSpinner.d.ts +0 -0
- package/types/components/Spinner/index.d.ts +0 -0
- package/types/components/Success/StyledSuccess.d.ts +0 -0
- package/types/components/Success/index.d.ts +0 -0
- package/types/components/Swipeable/StyledSwipeable.d.ts +0 -0
- package/types/components/Swipeable/SwipeableAction.d.ts +0 -0
- package/types/components/Swipeable/index.d.ts +0 -0
- package/types/components/Switch/SelectorSwitch/Option.d.ts +0 -0
- package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +0 -0
- package/types/components/Switch/SelectorSwitch/index.d.ts +0 -0
- package/types/components/Switch/StyledSwitch.d.ts +0 -0
- package/types/components/Switch/index.d.ts +0 -0
- package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
- package/types/components/Tabs/SceneView.d.ts +0 -0
- package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/ScrollableTabsHeader.d.ts +0 -0
- package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/StyledTabs.d.ts +0 -0
- package/types/components/Tabs/TabWithBadge.d.ts +0 -0
- package/types/components/Tabs/index.d.ts +0 -0
- package/types/components/Tabs/useIsFocused.d.ts +0 -0
- package/types/components/Tabs/utils.d.ts +0 -0
- package/types/components/Tag/StyledTag.d.ts +0 -0
- package/types/components/Tag/index.d.ts +0 -0
- package/types/components/TextInput/StyledTextInput.d.ts +0 -0
- package/types/components/TextInput/index.d.ts +0 -0
- package/types/components/TimePicker/StyledTimePicker.d.ts +0 -0
- package/types/components/TimePicker/TimePickerAndroid.d.ts +0 -0
- package/types/components/TimePicker/TimePickerIOS.d.ts +0 -0
- package/types/components/TimePicker/index.d.ts +0 -0
- package/types/components/TimePicker/types.d.ts +0 -0
- package/types/components/Toast/StyledToast.d.ts +0 -0
- package/types/components/Toast/Toast.d.ts +0 -0
- package/types/components/Toast/ToastContainer.d.ts +0 -0
- package/types/components/Toast/ToastContext.d.ts +0 -0
- package/types/components/Toast/ToastProvider.d.ts +0 -0
- package/types/components/Toast/index.d.ts +0 -0
- package/types/components/Toast/types.d.ts +0 -0
- package/types/components/Toolbar/StyledToolbar.d.ts +0 -0
- package/types/components/Toolbar/ToolbarGroup.d.ts +0 -0
- package/types/components/Toolbar/ToolbarItem.d.ts +0 -0
- package/types/components/Toolbar/index.d.ts +0 -0
- package/types/components/Typography/Text/StyledText.d.ts +0 -0
- package/types/components/Typography/Text/index.d.ts +0 -0
- package/types/components/Typography/index.d.ts +0 -0
- package/types/index.d.ts +0 -0
- package/types/testHelpers/renderWithTheme.d.ts +0 -0
- package/types/theme/ThemeProvider.d.ts +0 -0
- package/types/theme/ThemeSwitcher.d.ts +0 -0
- package/types/theme/components/accordion.d.ts +0 -0
- package/types/theme/components/alert.d.ts +0 -0
- package/types/theme/components/attachment.d.ts +0 -0
- package/types/theme/components/avatar.d.ts +0 -0
- package/types/theme/components/badge.d.ts +0 -0
- package/types/theme/components/bottomNavigation.d.ts +0 -0
- package/types/theme/components/bottomSheet.d.ts +0 -0
- package/types/theme/components/button.d.ts +0 -0
- package/types/theme/components/calendar.d.ts +0 -0
- package/types/theme/components/card.d.ts +0 -0
- package/types/theme/components/cardCarousel.d.ts +0 -0
- package/types/theme/components/carousel.d.ts +0 -0
- package/types/theme/components/checkbox.d.ts +5 -2
- package/types/theme/components/contentNavigator.d.ts +0 -0
- package/types/theme/components/datePicker.d.ts +0 -0
- package/types/theme/components/divider.d.ts +0 -0
- package/types/theme/components/drawer.d.ts +0 -0
- package/types/theme/components/empty.d.ts +0 -0
- package/types/theme/components/error.d.ts +0 -0
- package/types/theme/components/fab.d.ts +0 -0
- package/types/theme/components/icon.d.ts +0 -0
- package/types/theme/components/image.d.ts +0 -0
- package/types/theme/components/list.d.ts +0 -0
- package/types/theme/components/pageControl.d.ts +0 -0
- package/types/theme/components/pinInput.d.ts +0 -0
- package/types/theme/components/progress.d.ts +0 -0
- package/types/theme/components/radio.d.ts +0 -0
- package/types/theme/components/refreshControl.d.ts +0 -0
- package/types/theme/components/richTextEditor.d.ts +0 -0
- package/types/theme/components/sectionHeading.d.ts +0 -0
- package/types/theme/components/select.d.ts +0 -0
- package/types/theme/components/skeleton.d.ts +0 -0
- package/types/theme/components/slider.d.ts +0 -0
- package/types/theme/components/spinner.d.ts +0 -0
- package/types/theme/components/success.d.ts +0 -0
- package/types/theme/components/swipeable.d.ts +0 -0
- package/types/theme/components/switch.d.ts +0 -0
- package/types/theme/components/tabs.d.ts +0 -0
- package/types/theme/components/tag.d.ts +0 -0
- package/types/theme/components/textInput.d.ts +0 -0
- package/types/theme/components/timePicker.d.ts +0 -0
- package/types/theme/components/toast.d.ts +0 -0
- package/types/theme/components/toolbar.d.ts +0 -0
- package/types/theme/components/typography.d.ts +0 -0
- package/types/theme/getTheme.d.ts +0 -0
- package/types/theme/global/borders.d.ts +0 -0
- package/types/theme/global/colors/eBens.d.ts +0 -0
- package/types/theme/global/colors/global.d.ts +0 -0
- package/types/theme/global/colors/globalDark.d.ts +0 -0
- package/types/theme/global/colors/jobs.d.ts +0 -0
- package/types/theme/global/colors/swag.d.ts +0 -0
- package/types/theme/global/colors/swagDark.d.ts +0 -0
- package/types/theme/global/colors/types.d.ts +0 -0
- package/types/theme/global/colors/wallet.d.ts +0 -0
- package/types/theme/global/colors/work.d.ts +0 -0
- package/types/theme/global/index.d.ts +0 -0
- package/types/theme/global/scale.d.ts +0 -0
- package/types/theme/global/sizes.d.ts +0 -0
- package/types/theme/global/space.d.ts +0 -0
- package/types/theme/global/typography.d.ts +0 -0
- package/types/theme/index.d.ts +0 -0
- package/types/types.d.ts +0 -0
- package/types/utils/functions.d.ts +0 -0
- package/types/utils/helpers.d.ts +0 -0
- package/types/utils/hooks.d.ts +0 -0
- package/types/utils/scale.d.ts +0 -0
- package/.tool-versions +0 -1
- package/.turbo/turbo-build:types.log +0 -1
- package/.turbo/turbo-lint.log +0 -172
- package/.turbo/turbo-test.log +0 -1
- package/.turbo/turbo-type-check.log +0 -1
- package/types/components/FAB/ActionGroup/FABModal.d.ts +0 -21
- package/types/components/FAB/ActionGroup/FABModalContentWrapper.d.ts +0 -18
- package/types/components/FAB/ActionGroup/FABProvider.d.ts +0 -5
- package/types/components/FAB/ActionGroup/ModalPresenter/ModalPresenter.d.ts +0 -34
- package/types/components/FAB/ActionGroup/ModalPresenter/index.d.ts +0 -3
- package/types/components/Tabs/ScrollableTabsV2/SceneView.d.ts +0 -10
- package/types/components/Tabs/ScrollableTabsV2/ScrollableTabsV2.d.ts +0 -9
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
371
|
+
themeState="default"
|
|
291
372
|
/>
|
|
292
373
|
</View>
|
|
293
374
|
</View>
|
|
294
375
|
`;
|
|
295
376
|
|
|
296
|
-
exports[`Checkbox renders correctly when disabled is
|
|
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
|
-
|
|
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
|
-
|
|
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
|
);
|