@hero-design/rn 8.42.4 → 8.43.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 +1 -1
- package/CHANGELOG.md +20 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +2174 -1988
- package/jest-setup.ts +2 -0
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +2173 -1986
- package/package.json +20 -20
- package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +68 -0
- package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +102 -0
- package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +85 -0
- package/src/components/Attachment/__tests__/__snapshots__/index.spec.tsx.snap +34 -0
- package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/StyledAvatarStack.spec.tsx.snap +12 -0
- package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/index.spec.tsx.snap +108 -0
- package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +17 -0
- package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +36 -0
- package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +36 -0
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +247 -211
- package/src/components/BottomSheet/index.tsx +1 -1
- package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +6 -10
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +0 -20
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +0 -70
- package/src/components/Button/StyledButton.tsx +4 -0
- package/src/components/Button/UtilityButton/__tests__/__snapshots__/index.spec.tsx.snap +34 -0
- package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +144 -42
- package/src/components/Button/__tests__/__snapshots__/IconButton.spec.tsx.snap +17 -0
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +90 -0
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +85 -0
- package/src/components/Carousel/CardCarousel.tsx +10 -7
- package/src/components/Carousel/__tests__/__snapshots__/CardCarousel.spec.tsx.snap +4 -0
- package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +39 -0
- package/src/components/Carousel/__tests__/index.spec.tsx +8 -10
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +68 -0
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +72 -0
- package/src/components/Chip/StyledChip.tsx +121 -0
- package/src/components/Chip/__tests__/__snapshots__/index.spec.tsx.snap +1147 -0
- package/src/components/Chip/__tests__/index.spec.tsx +136 -0
- package/src/components/Chip/index.tsx +82 -0
- package/src/components/Collapse/index.tsx +1 -1
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +72 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +48 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +12 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +12 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +470 -399
- package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +51 -0
- package/src/components/Error/__tests__/index.spec.tsx +9 -6
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +81 -0
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +16 -0
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +24 -0
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +1 -0
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +16 -0
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +60 -0
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +32 -0
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +32 -0
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +16 -0
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +24 -0
- package/src/components/Rate/__tests__/__snapshots__/index.spec.tsx.snap +180 -0
- package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +8 -10
- package/src/components/RichTextEditor/__tests__/__snapshots__/EditorToolbar.spec.tsx.snap +119 -0
- package/src/components/RichTextEditor/__tests__/__snapshots__/MentionList.spec.tsx.snap +1 -0
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +18 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +8 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +124 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +804 -455
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +7 -10
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +8 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +124 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +790 -532
- package/src/components/Success/__tests__/index.spec.tsx +9 -6
- package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +51 -0
- package/src/components/Swipeable/index.tsx +3 -3
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/index.spec.tsx.snap +9 -0
- package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +8 -0
- package/src/components/Tabs/__tests__/SceneView.spec.tsx +19 -23
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +171 -0
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +40 -0
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +159 -0
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +24 -0
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +482 -399
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +102 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +72 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +96 -0
- package/src/index.ts +2 -0
- package/src/testHelpers/renderWithTheme.tsx +1 -7
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +38 -1
- package/src/theme/components/button.ts +0 -1
- package/src/theme/components/chip.ts +47 -0
- package/src/theme/getTheme.ts +3 -0
- package/tsconfig.json +4 -1
- package/types/components/Accordion/AccordionItem.d.ts +2 -1
- package/types/components/Accordion/index.d.ts +1 -1
- package/types/components/Attachment/index.d.ts +2 -1
- package/types/components/Avatar/Avatar.d.ts +2 -1
- package/types/components/Avatar/AvatarStack/index.d.ts +2 -2
- package/types/components/Avatar/index.d.ts +3 -2
- package/types/components/Badge/StyledBadge.d.ts +0 -4
- package/types/components/BottomSheet/Footer.d.ts +2 -1
- package/types/components/BottomSheet/Header.d.ts +2 -1
- package/types/components/BottomSheet/ScrollView.d.ts +1 -0
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -4
- package/types/components/Box/index.d.ts +2 -1
- package/types/components/Button/IconButton.d.ts +2 -1
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +3 -3
- package/types/components/Button/LoadingIndicator/index.d.ts +2 -1
- package/types/components/Button/UtilityButton/index.d.ts +2 -1
- package/types/components/Calendar/CalendarRowItem.d.ts +2 -1
- package/types/components/Calendar/StyledCalendar.d.ts +1 -1
- package/types/components/Calendar/index.d.ts +2 -1
- package/types/components/Carousel/CardCarousel.d.ts +1 -1
- package/types/components/Carousel/CarouselItem.d.ts +2 -1
- package/types/components/Carousel/index.d.ts +2 -2
- package/types/components/Checkbox/index.d.ts +2 -1
- package/types/components/Chip/StyledChip.d.ts +31 -0
- package/types/components/Chip/index.d.ts +27 -0
- package/types/components/Collapse/StyledCollapse.d.ts +0 -2
- package/types/components/Collapse/index.d.ts +2 -1
- package/types/components/ContentNavigator/index.d.ts +2 -1
- package/types/components/DatePicker/DatePickerAndroid.d.ts +2 -1
- package/types/components/DatePicker/DatePickerCalendar.d.ts +2 -1
- package/types/components/DatePicker/DatePickerIOS.d.ts +2 -1
- package/types/components/DatePicker/index.d.ts +2 -1
- package/types/components/Divider/index.d.ts +2 -1
- package/types/components/Drawer/StyledDrawer.d.ts +0 -6
- package/types/components/Error/StyledError.d.ts +0 -4
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +2 -1
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -4
- package/types/components/FAB/AnimatedFABIcon.d.ts +2 -1
- package/types/components/HeroDesignProvider/index.d.ts +2 -1
- package/types/components/Icon/AnimatedIcon.d.ts +2 -1
- package/types/components/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/index.d.ts +3 -2
- package/types/components/Icon/utils.d.ts +1 -1
- package/types/components/Image/index.d.ts +1 -0
- package/types/components/Modal/index.d.ts +2 -2
- package/types/components/PageControl/StyledPageControl.d.ts +0 -2
- package/types/components/PageControl/index.d.ts +2 -1
- package/types/components/PinInput/PinCell.d.ts +2 -1
- package/types/components/Portal/PortalHost.d.ts +1 -1
- package/types/components/Portal/PortalProvider.d.ts +1 -1
- package/types/components/Portal/index.d.ts +2 -2
- package/types/components/Progress/ProgressBar.d.ts +1 -0
- package/types/components/Progress/StyledProgressBar.d.ts +0 -2
- package/types/components/Progress/index.d.ts +1 -0
- package/types/components/Rate/StyledRate.d.ts +0 -2
- package/types/components/Rate/index.d.ts +2 -1
- package/types/components/RefreshControl/index.d.ts +2 -1
- package/types/components/RichTextEditor/EditorToolbar.d.ts +2 -1
- package/types/components/RichTextEditor/MentionList.d.ts +2 -1
- package/types/components/RichTextEditor/index.d.ts +2 -2
- package/types/components/Select/BaseOptionList.d.ts +1 -1
- package/types/components/Select/Footer.d.ts +2 -1
- package/types/components/Select/MultiSelect/Option.d.ts +2 -1
- package/types/components/Select/MultiSelect/OptionList.d.ts +2 -1
- package/types/components/Select/MultiSelect/index.d.ts +1 -1
- package/types/components/Select/SingleSelect/Option.d.ts +2 -1
- package/types/components/Select/SingleSelect/OptionList.d.ts +1 -1
- package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +2 -1
- package/types/components/Select/SingleSelect/index.d.ts +1 -1
- package/types/components/Select/helpers.d.ts +1 -2
- package/types/components/Select/index.d.ts +2 -1
- package/types/components/Skeleton/index.d.ts +2 -1
- package/types/components/Slider/index.d.ts +2 -1
- package/types/components/Spinner/AnimatedSpinner.d.ts +2 -1
- package/types/components/Success/StyledSuccess.d.ts +0 -2
- package/types/components/Swipeable/SwipeableAction.d.ts +2 -2
- package/types/components/Swipeable/index.d.ts +3 -3
- package/types/components/Switch/SelectorSwitch/Option.d.ts +2 -1
- package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +0 -6
- package/types/components/Switch/StyledSwitch.d.ts +0 -2
- package/types/components/Tabs/ActiveTabIndicator.d.ts +2 -1
- package/types/components/Tabs/SceneView.d.ts +1 -1
- package/types/components/Tabs/ScrollableTabs.d.ts +2 -1
- package/types/components/Tabs/ScrollableTabsHeader.d.ts +2 -1
- package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -4
- package/types/components/Tabs/StyledTabs.d.ts +0 -4
- package/types/components/Tabs/TabWithBadge.d.ts +2 -2
- package/types/components/Tabs/index.d.ts +2 -1
- package/types/components/TextInput/StyledTextInput.d.ts +1 -1
- package/types/components/TextInput/index.d.ts +1 -1
- package/types/components/TimePicker/TimePickerAndroid.d.ts +2 -1
- package/types/components/TimePicker/TimePickerIOS.d.ts +2 -1
- package/types/components/TimePicker/index.d.ts +2 -1
- package/types/components/Toast/StyledToast.d.ts +0 -2
- package/types/components/Toast/Toast.d.ts +1 -0
- package/types/components/Toast/ToastProvider.d.ts +2 -1
- package/types/components/Toast/index.d.ts +1 -1
- package/types/components/Toolbar/ToolbarGroup.d.ts +2 -1
- package/types/components/Toolbar/ToolbarItem.d.ts +2 -1
- package/types/components/Toolbar/index.d.ts +3 -2
- package/types/components/Typography/Body/index.d.ts +2 -1
- package/types/components/Typography/Caption/index.d.ts +2 -1
- package/types/components/Typography/Label/index.d.ts +2 -1
- package/types/components/Typography/Text/index.d.ts +2 -1
- package/types/components/Typography/Title/index.d.ts +2 -1
- package/types/index.d.ts +2 -1
- package/types/testHelpers/renderWithTheme.d.ts +1 -0
- package/types/theme/ThemeSwitcher.d.ts +2 -2
- package/types/theme/components/button.d.ts +0 -1
- package/types/theme/components/chip.d.ts +40 -0
- package/types/theme/getTheme.d.ts +2 -0
- package/.turbo/turbo-publish:npm.log +0 -0
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`StyledButtonContainer has filled-danger style 1`] = `
|
|
4
4
|
<View
|
|
5
|
+
accessibilityValue={
|
|
6
|
+
{
|
|
7
|
+
"max": undefined,
|
|
8
|
+
"min": undefined,
|
|
9
|
+
"now": undefined,
|
|
10
|
+
"text": undefined,
|
|
11
|
+
}
|
|
12
|
+
}
|
|
5
13
|
accessible={true}
|
|
6
14
|
focusable={false}
|
|
7
15
|
onClick={[Function]}
|
|
@@ -19,6 +27,7 @@ exports[`StyledButtonContainer has filled-danger style 1`] = `
|
|
|
19
27
|
"backgroundColor": "#cb300a",
|
|
20
28
|
"borderRadius": 32,
|
|
21
29
|
"flexDirection": "row",
|
|
30
|
+
"height": 60,
|
|
22
31
|
"justifyContent": "center",
|
|
23
32
|
"padding": 16,
|
|
24
33
|
},
|
|
@@ -34,6 +43,14 @@ exports[`StyledButtonContainer has filled-danger style 1`] = `
|
|
|
34
43
|
|
|
35
44
|
exports[`StyledButtonContainer has filled-primary style 1`] = `
|
|
36
45
|
<View
|
|
46
|
+
accessibilityValue={
|
|
47
|
+
{
|
|
48
|
+
"max": undefined,
|
|
49
|
+
"min": undefined,
|
|
50
|
+
"now": undefined,
|
|
51
|
+
"text": undefined,
|
|
52
|
+
}
|
|
53
|
+
}
|
|
37
54
|
accessible={true}
|
|
38
55
|
focusable={false}
|
|
39
56
|
onClick={[Function]}
|
|
@@ -51,6 +68,7 @@ exports[`StyledButtonContainer has filled-primary style 1`] = `
|
|
|
51
68
|
"backgroundColor": "#401960",
|
|
52
69
|
"borderRadius": 32,
|
|
53
70
|
"flexDirection": "row",
|
|
71
|
+
"height": 60,
|
|
54
72
|
"justifyContent": "center",
|
|
55
73
|
"padding": 16,
|
|
56
74
|
},
|
|
@@ -66,6 +84,14 @@ exports[`StyledButtonContainer has filled-primary style 1`] = `
|
|
|
66
84
|
|
|
67
85
|
exports[`StyledButtonContainer has filled-secondary style 1`] = `
|
|
68
86
|
<View
|
|
87
|
+
accessibilityValue={
|
|
88
|
+
{
|
|
89
|
+
"max": undefined,
|
|
90
|
+
"min": undefined,
|
|
91
|
+
"now": undefined,
|
|
92
|
+
"text": undefined,
|
|
93
|
+
}
|
|
94
|
+
}
|
|
69
95
|
accessible={true}
|
|
70
96
|
focusable={false}
|
|
71
97
|
onClick={[Function]}
|
|
@@ -83,6 +109,7 @@ exports[`StyledButtonContainer has filled-secondary style 1`] = `
|
|
|
83
109
|
"backgroundColor": "#795e90",
|
|
84
110
|
"borderRadius": 32,
|
|
85
111
|
"flexDirection": "row",
|
|
112
|
+
"height": 60,
|
|
86
113
|
"justifyContent": "center",
|
|
87
114
|
"padding": 16,
|
|
88
115
|
},
|
|
@@ -98,6 +125,14 @@ exports[`StyledButtonContainer has filled-secondary style 1`] = `
|
|
|
98
125
|
|
|
99
126
|
exports[`StyledButtonContainer has outlined-danger style 1`] = `
|
|
100
127
|
<View
|
|
128
|
+
accessibilityValue={
|
|
129
|
+
{
|
|
130
|
+
"max": undefined,
|
|
131
|
+
"min": undefined,
|
|
132
|
+
"now": undefined,
|
|
133
|
+
"text": undefined,
|
|
134
|
+
}
|
|
135
|
+
}
|
|
101
136
|
accessible={true}
|
|
102
137
|
focusable={false}
|
|
103
138
|
onClick={[Function]}
|
|
@@ -117,6 +152,7 @@ exports[`StyledButtonContainer has outlined-danger style 1`] = `
|
|
|
117
152
|
"borderRadius": 32,
|
|
118
153
|
"borderWidth": 2,
|
|
119
154
|
"flexDirection": "row",
|
|
155
|
+
"height": 60,
|
|
120
156
|
"justifyContent": "center",
|
|
121
157
|
"padding": 14,
|
|
122
158
|
},
|
|
@@ -132,6 +168,14 @@ exports[`StyledButtonContainer has outlined-danger style 1`] = `
|
|
|
132
168
|
|
|
133
169
|
exports[`StyledButtonContainer has outlined-primary style 1`] = `
|
|
134
170
|
<View
|
|
171
|
+
accessibilityValue={
|
|
172
|
+
{
|
|
173
|
+
"max": undefined,
|
|
174
|
+
"min": undefined,
|
|
175
|
+
"now": undefined,
|
|
176
|
+
"text": undefined,
|
|
177
|
+
}
|
|
178
|
+
}
|
|
135
179
|
accessible={true}
|
|
136
180
|
focusable={false}
|
|
137
181
|
onClick={[Function]}
|
|
@@ -151,6 +195,7 @@ exports[`StyledButtonContainer has outlined-primary style 1`] = `
|
|
|
151
195
|
"borderRadius": 32,
|
|
152
196
|
"borderWidth": 2,
|
|
153
197
|
"flexDirection": "row",
|
|
198
|
+
"height": 60,
|
|
154
199
|
"justifyContent": "center",
|
|
155
200
|
"padding": 14,
|
|
156
201
|
},
|
|
@@ -166,6 +211,14 @@ exports[`StyledButtonContainer has outlined-primary style 1`] = `
|
|
|
166
211
|
|
|
167
212
|
exports[`StyledButtonContainer has outlined-secondary style 1`] = `
|
|
168
213
|
<View
|
|
214
|
+
accessibilityValue={
|
|
215
|
+
{
|
|
216
|
+
"max": undefined,
|
|
217
|
+
"min": undefined,
|
|
218
|
+
"now": undefined,
|
|
219
|
+
"text": undefined,
|
|
220
|
+
}
|
|
221
|
+
}
|
|
169
222
|
accessible={true}
|
|
170
223
|
focusable={false}
|
|
171
224
|
onClick={[Function]}
|
|
@@ -185,6 +238,7 @@ exports[`StyledButtonContainer has outlined-secondary style 1`] = `
|
|
|
185
238
|
"borderRadius": 32,
|
|
186
239
|
"borderWidth": 2,
|
|
187
240
|
"flexDirection": "row",
|
|
241
|
+
"height": 60,
|
|
188
242
|
"justifyContent": "center",
|
|
189
243
|
"padding": 14,
|
|
190
244
|
},
|
|
@@ -200,6 +254,14 @@ exports[`StyledButtonContainer has outlined-secondary style 1`] = `
|
|
|
200
254
|
|
|
201
255
|
exports[`StyledButtonContainer has text-danger style 1`] = `
|
|
202
256
|
<View
|
|
257
|
+
accessibilityValue={
|
|
258
|
+
{
|
|
259
|
+
"max": undefined,
|
|
260
|
+
"min": undefined,
|
|
261
|
+
"now": undefined,
|
|
262
|
+
"text": undefined,
|
|
263
|
+
}
|
|
264
|
+
}
|
|
203
265
|
accessible={true}
|
|
204
266
|
focusable={false}
|
|
205
267
|
onClick={[Function]}
|
|
@@ -217,6 +279,7 @@ exports[`StyledButtonContainer has text-danger style 1`] = `
|
|
|
217
279
|
"borderRadius": 4,
|
|
218
280
|
"borderWidth": 0,
|
|
219
281
|
"flexDirection": "row",
|
|
282
|
+
"height": 60,
|
|
220
283
|
"justifyContent": "center",
|
|
221
284
|
"padding": 12,
|
|
222
285
|
},
|
|
@@ -232,6 +295,14 @@ exports[`StyledButtonContainer has text-danger style 1`] = `
|
|
|
232
295
|
|
|
233
296
|
exports[`StyledButtonContainer has text-primary style 1`] = `
|
|
234
297
|
<View
|
|
298
|
+
accessibilityValue={
|
|
299
|
+
{
|
|
300
|
+
"max": undefined,
|
|
301
|
+
"min": undefined,
|
|
302
|
+
"now": undefined,
|
|
303
|
+
"text": undefined,
|
|
304
|
+
}
|
|
305
|
+
}
|
|
235
306
|
accessible={true}
|
|
236
307
|
focusable={false}
|
|
237
308
|
onClick={[Function]}
|
|
@@ -249,6 +320,7 @@ exports[`StyledButtonContainer has text-primary style 1`] = `
|
|
|
249
320
|
"borderRadius": 4,
|
|
250
321
|
"borderWidth": 0,
|
|
251
322
|
"flexDirection": "row",
|
|
323
|
+
"height": 60,
|
|
252
324
|
"justifyContent": "center",
|
|
253
325
|
"padding": 12,
|
|
254
326
|
},
|
|
@@ -264,6 +336,14 @@ exports[`StyledButtonContainer has text-primary style 1`] = `
|
|
|
264
336
|
|
|
265
337
|
exports[`StyledButtonContainer has text-secondary style 1`] = `
|
|
266
338
|
<View
|
|
339
|
+
accessibilityValue={
|
|
340
|
+
{
|
|
341
|
+
"max": undefined,
|
|
342
|
+
"min": undefined,
|
|
343
|
+
"now": undefined,
|
|
344
|
+
"text": undefined,
|
|
345
|
+
}
|
|
346
|
+
}
|
|
267
347
|
accessible={true}
|
|
268
348
|
focusable={false}
|
|
269
349
|
onClick={[Function]}
|
|
@@ -281,6 +361,7 @@ exports[`StyledButtonContainer has text-secondary style 1`] = `
|
|
|
281
361
|
"borderRadius": 4,
|
|
282
362
|
"borderWidth": 0,
|
|
283
363
|
"flexDirection": "row",
|
|
364
|
+
"height": 60,
|
|
284
365
|
"justifyContent": "center",
|
|
285
366
|
"padding": 12,
|
|
286
367
|
},
|
|
@@ -301,6 +382,14 @@ exports[`StyledButtonContainer renders disabled correctly 1`] = `
|
|
|
301
382
|
"disabled": true,
|
|
302
383
|
}
|
|
303
384
|
}
|
|
385
|
+
accessibilityValue={
|
|
386
|
+
{
|
|
387
|
+
"max": undefined,
|
|
388
|
+
"min": undefined,
|
|
389
|
+
"now": undefined,
|
|
390
|
+
"text": undefined,
|
|
391
|
+
}
|
|
392
|
+
}
|
|
304
393
|
accessible={true}
|
|
305
394
|
focusable={false}
|
|
306
395
|
onClick={[Function]}
|
|
@@ -318,6 +407,7 @@ exports[`StyledButtonContainer renders disabled correctly 1`] = `
|
|
|
318
407
|
"backgroundColor": "#bfc1c5",
|
|
319
408
|
"borderRadius": 32,
|
|
320
409
|
"flexDirection": "row",
|
|
410
|
+
"height": 60,
|
|
321
411
|
"justifyContent": "center",
|
|
322
412
|
"padding": 16,
|
|
323
413
|
},
|
|
@@ -17,6 +17,23 @@ exports[`CalendarRowItem renders correctly 1`] = `
|
|
|
17
17
|
testID="calendar-date-cell"
|
|
18
18
|
>
|
|
19
19
|
<View
|
|
20
|
+
accessibilityState={
|
|
21
|
+
{
|
|
22
|
+
"busy": undefined,
|
|
23
|
+
"checked": undefined,
|
|
24
|
+
"disabled": undefined,
|
|
25
|
+
"expanded": undefined,
|
|
26
|
+
"selected": undefined,
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
accessibilityValue={
|
|
30
|
+
{
|
|
31
|
+
"max": undefined,
|
|
32
|
+
"min": undefined,
|
|
33
|
+
"now": undefined,
|
|
34
|
+
"text": undefined,
|
|
35
|
+
}
|
|
36
|
+
}
|
|
20
37
|
accessible={true}
|
|
21
38
|
collapsable={false}
|
|
22
39
|
focusable={true}
|
|
@@ -99,6 +116,23 @@ exports[`CalendarRowItem renders correctly 2`] = `
|
|
|
99
116
|
testID="calendar-date-cell"
|
|
100
117
|
>
|
|
101
118
|
<View
|
|
119
|
+
accessibilityState={
|
|
120
|
+
{
|
|
121
|
+
"busy": undefined,
|
|
122
|
+
"checked": undefined,
|
|
123
|
+
"disabled": undefined,
|
|
124
|
+
"expanded": undefined,
|
|
125
|
+
"selected": undefined,
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
accessibilityValue={
|
|
129
|
+
{
|
|
130
|
+
"max": undefined,
|
|
131
|
+
"min": undefined,
|
|
132
|
+
"now": undefined,
|
|
133
|
+
"text": undefined,
|
|
134
|
+
}
|
|
135
|
+
}
|
|
102
136
|
accessible={true}
|
|
103
137
|
collapsable={false}
|
|
104
138
|
focusable={true}
|
|
@@ -181,6 +215,23 @@ exports[`CalendarRowItem renders correctly when is current date 1`] = `
|
|
|
181
215
|
testID="calendar-date-cell"
|
|
182
216
|
>
|
|
183
217
|
<View
|
|
218
|
+
accessibilityState={
|
|
219
|
+
{
|
|
220
|
+
"busy": undefined,
|
|
221
|
+
"checked": undefined,
|
|
222
|
+
"disabled": undefined,
|
|
223
|
+
"expanded": undefined,
|
|
224
|
+
"selected": undefined,
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
accessibilityValue={
|
|
228
|
+
{
|
|
229
|
+
"max": undefined,
|
|
230
|
+
"min": undefined,
|
|
231
|
+
"now": undefined,
|
|
232
|
+
"text": undefined,
|
|
233
|
+
}
|
|
234
|
+
}
|
|
184
235
|
accessible={true}
|
|
185
236
|
collapsable={false}
|
|
186
237
|
focusable={true}
|
|
@@ -263,6 +314,23 @@ exports[`CalendarRowItem renders correctly when selected, and is current date eq
|
|
|
263
314
|
testID="calendar-date-cell"
|
|
264
315
|
>
|
|
265
316
|
<View
|
|
317
|
+
accessibilityState={
|
|
318
|
+
{
|
|
319
|
+
"busy": undefined,
|
|
320
|
+
"checked": undefined,
|
|
321
|
+
"disabled": undefined,
|
|
322
|
+
"expanded": undefined,
|
|
323
|
+
"selected": undefined,
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
accessibilityValue={
|
|
327
|
+
{
|
|
328
|
+
"max": undefined,
|
|
329
|
+
"min": undefined,
|
|
330
|
+
"now": undefined,
|
|
331
|
+
"text": undefined,
|
|
332
|
+
}
|
|
333
|
+
}
|
|
266
334
|
accessible={true}
|
|
267
335
|
collapsable={false}
|
|
268
336
|
focusable={true}
|
|
@@ -345,6 +413,23 @@ exports[`CalendarRowItem renders correctly when selected, and is current date eq
|
|
|
345
413
|
testID="calendar-date-cell"
|
|
346
414
|
>
|
|
347
415
|
<View
|
|
416
|
+
accessibilityState={
|
|
417
|
+
{
|
|
418
|
+
"busy": undefined,
|
|
419
|
+
"checked": undefined,
|
|
420
|
+
"disabled": undefined,
|
|
421
|
+
"expanded": undefined,
|
|
422
|
+
"selected": undefined,
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
accessibilityValue={
|
|
426
|
+
{
|
|
427
|
+
"max": undefined,
|
|
428
|
+
"min": undefined,
|
|
429
|
+
"now": undefined,
|
|
430
|
+
"text": undefined,
|
|
431
|
+
}
|
|
432
|
+
}
|
|
348
433
|
accessible={true}
|
|
349
434
|
collapsable={false}
|
|
350
435
|
focusable={true}
|
|
@@ -8,13 +8,14 @@ import React, {
|
|
|
8
8
|
import {
|
|
9
9
|
FlatList,
|
|
10
10
|
LayoutChangeEvent,
|
|
11
|
+
ListRenderItem,
|
|
11
12
|
Platform,
|
|
12
13
|
StyleProp,
|
|
13
14
|
View,
|
|
14
15
|
ViewStyle,
|
|
16
|
+
ViewToken,
|
|
15
17
|
} from 'react-native';
|
|
16
18
|
import { useTheme } from '../../theme';
|
|
17
|
-
import { ITEM_WIDTH_RATE, VIEW_POSITION_CENTER } from './contants';
|
|
18
19
|
import {
|
|
19
20
|
StyledCard,
|
|
20
21
|
StyledItemWrapper,
|
|
@@ -22,6 +23,7 @@ import {
|
|
|
22
23
|
StyledShadow,
|
|
23
24
|
StyledWrapper,
|
|
24
25
|
} from './StyledCardCarousel';
|
|
26
|
+
import { ITEM_WIDTH_RATE, VIEW_POSITION_CENTER } from './contants';
|
|
25
27
|
|
|
26
28
|
export type CardCarouselHandles = {
|
|
27
29
|
snapToIndex: (index: number) => void;
|
|
@@ -90,7 +92,7 @@ export const CardCarousel = forwardRef<CardCarouselHandles, CardCarouselProps>(
|
|
|
90
92
|
const viewPosition =
|
|
91
93
|
Platform.OS === 'ios' ? VIEW_POSITION_CENTER : undefined;
|
|
92
94
|
const snapToIndex = useCallback(
|
|
93
|
-
(index) => {
|
|
95
|
+
(index: number) => {
|
|
94
96
|
let validIndex = 0;
|
|
95
97
|
if (index < 0) {
|
|
96
98
|
validIndex = 0;
|
|
@@ -149,12 +151,13 @@ export const CardCarousel = forwardRef<CardCarouselHandles, CardCarouselProps>(
|
|
|
149
151
|
}, [autoPlay, snapToNext, currentIndex, autoPlayInterval]);
|
|
150
152
|
|
|
151
153
|
const visibleSlideChanged = useCallback(
|
|
152
|
-
({ viewableItems }) => {
|
|
154
|
+
({ viewableItems }: { viewableItems: ViewToken[] }) => {
|
|
153
155
|
if (!viewableItems || (viewableItems && !viewableItems.length)) return;
|
|
154
156
|
const { index } = viewableItems[0];
|
|
155
|
-
|
|
157
|
+
|
|
158
|
+
setCurrentIndex(index || 0);
|
|
156
159
|
if (onItemIndexChange) {
|
|
157
|
-
onItemIndexChange(index);
|
|
160
|
+
onItemIndexChange(index || 0);
|
|
158
161
|
}
|
|
159
162
|
},
|
|
160
163
|
[onItemIndexChange]
|
|
@@ -170,7 +173,7 @@ export const CardCarousel = forwardRef<CardCarouselHandles, CardCarouselProps>(
|
|
|
170
173
|
);
|
|
171
174
|
|
|
172
175
|
const flatListOnLayout = useCallback(
|
|
173
|
-
(e) => {
|
|
176
|
+
(e: LayoutChangeEvent) => {
|
|
174
177
|
setFlatListWidth(e.nativeEvent.layout.width);
|
|
175
178
|
setTimeout(() => {
|
|
176
179
|
onLayout?.(e);
|
|
@@ -179,7 +182,7 @@ export const CardCarousel = forwardRef<CardCarouselHandles, CardCarouselProps>(
|
|
|
179
182
|
[setFlatListWidth, onLayout]
|
|
180
183
|
);
|
|
181
184
|
|
|
182
|
-
const renderItem = useCallback(
|
|
185
|
+
const renderItem: ListRenderItem<React.ReactNode> = useCallback(
|
|
183
186
|
({ item }) => {
|
|
184
187
|
return (
|
|
185
188
|
<StyledItemWrapper style={{ width: itemWidth }}>
|
|
@@ -78,6 +78,7 @@ exports[`CardCarousel android should render correctly on iOS 1`] = `
|
|
|
78
78
|
>
|
|
79
79
|
<View>
|
|
80
80
|
<View
|
|
81
|
+
onFocusCapture={[Function]}
|
|
81
82
|
style={
|
|
82
83
|
[
|
|
83
84
|
{
|
|
@@ -161,6 +162,7 @@ exports[`CardCarousel android should render correctly on iOS 1`] = `
|
|
|
161
162
|
</View>
|
|
162
163
|
</View>
|
|
163
164
|
<View
|
|
165
|
+
onFocusCapture={[Function]}
|
|
164
166
|
style={
|
|
165
167
|
[
|
|
166
168
|
{
|
|
@@ -383,6 +385,7 @@ exports[`CardCarousel ios should render correctly on iOS 1`] = `
|
|
|
383
385
|
>
|
|
384
386
|
<View>
|
|
385
387
|
<View
|
|
388
|
+
onFocusCapture={[Function]}
|
|
386
389
|
style={
|
|
387
390
|
[
|
|
388
391
|
{
|
|
@@ -466,6 +469,7 @@ exports[`CardCarousel ios should render correctly on iOS 1`] = `
|
|
|
466
469
|
</View>
|
|
467
470
|
</View>
|
|
468
471
|
<View
|
|
472
|
+
onFocusCapture={[Function]}
|
|
469
473
|
style={
|
|
470
474
|
[
|
|
471
475
|
{
|
|
@@ -125,6 +125,7 @@ exports[`Carousel renders correctly with pageControlPosition bottom 1`] = `
|
|
|
125
125
|
>
|
|
126
126
|
<View>
|
|
127
127
|
<View
|
|
128
|
+
onFocusCapture={[Function]}
|
|
128
129
|
onLayout={[Function]}
|
|
129
130
|
style={
|
|
130
131
|
[
|
|
@@ -235,6 +236,7 @@ exports[`Carousel renders correctly with pageControlPosition bottom 1`] = `
|
|
|
235
236
|
</View>
|
|
236
237
|
</View>
|
|
237
238
|
<View
|
|
239
|
+
onFocusCapture={[Function]}
|
|
238
240
|
onLayout={[Function]}
|
|
239
241
|
style={
|
|
240
242
|
[
|
|
@@ -366,6 +368,7 @@ exports[`Carousel renders correctly with pageControlPosition bottom 1`] = `
|
|
|
366
368
|
</View>
|
|
367
369
|
</View>
|
|
368
370
|
<View
|
|
371
|
+
onFocusCapture={[Function]}
|
|
369
372
|
onLayout={[Function]}
|
|
370
373
|
style={
|
|
371
374
|
[
|
|
@@ -486,6 +489,7 @@ exports[`Carousel renders correctly with pageControlPosition bottom 1`] = `
|
|
|
486
489
|
</View>
|
|
487
490
|
</View>
|
|
488
491
|
<View
|
|
492
|
+
onFocusCapture={[Function]}
|
|
489
493
|
onLayout={[Function]}
|
|
490
494
|
style={
|
|
491
495
|
[
|
|
@@ -605,6 +609,14 @@ exports[`Carousel renders correctly with pageControlPosition bottom 1`] = `
|
|
|
605
609
|
"disabled": false,
|
|
606
610
|
}
|
|
607
611
|
}
|
|
612
|
+
accessibilityValue={
|
|
613
|
+
{
|
|
614
|
+
"max": undefined,
|
|
615
|
+
"min": undefined,
|
|
616
|
+
"now": undefined,
|
|
617
|
+
"text": undefined,
|
|
618
|
+
}
|
|
619
|
+
}
|
|
608
620
|
accessible={true}
|
|
609
621
|
focusable={true}
|
|
610
622
|
onClick={[Function]}
|
|
@@ -622,6 +634,7 @@ exports[`Carousel renders correctly with pageControlPosition bottom 1`] = `
|
|
|
622
634
|
"backgroundColor": "#401960",
|
|
623
635
|
"borderRadius": 32,
|
|
624
636
|
"flexDirection": "row",
|
|
637
|
+
"height": 60,
|
|
625
638
|
"justifyContent": "center",
|
|
626
639
|
"padding": 16,
|
|
627
640
|
},
|
|
@@ -978,6 +991,7 @@ exports[`Carousel renders correctly with pageControlPosition top 1`] = `
|
|
|
978
991
|
>
|
|
979
992
|
<View>
|
|
980
993
|
<View
|
|
994
|
+
onFocusCapture={[Function]}
|
|
981
995
|
onLayout={[Function]}
|
|
982
996
|
style={
|
|
983
997
|
[
|
|
@@ -1088,6 +1102,7 @@ exports[`Carousel renders correctly with pageControlPosition top 1`] = `
|
|
|
1088
1102
|
</View>
|
|
1089
1103
|
</View>
|
|
1090
1104
|
<View
|
|
1105
|
+
onFocusCapture={[Function]}
|
|
1091
1106
|
onLayout={[Function]}
|
|
1092
1107
|
style={
|
|
1093
1108
|
[
|
|
@@ -1219,6 +1234,7 @@ exports[`Carousel renders correctly with pageControlPosition top 1`] = `
|
|
|
1219
1234
|
</View>
|
|
1220
1235
|
</View>
|
|
1221
1236
|
<View
|
|
1237
|
+
onFocusCapture={[Function]}
|
|
1222
1238
|
onLayout={[Function]}
|
|
1223
1239
|
style={
|
|
1224
1240
|
[
|
|
@@ -1339,6 +1355,7 @@ exports[`Carousel renders correctly with pageControlPosition top 1`] = `
|
|
|
1339
1355
|
</View>
|
|
1340
1356
|
</View>
|
|
1341
1357
|
<View
|
|
1358
|
+
onFocusCapture={[Function]}
|
|
1342
1359
|
onLayout={[Function]}
|
|
1343
1360
|
style={
|
|
1344
1361
|
[
|
|
@@ -1458,6 +1475,14 @@ exports[`Carousel renders correctly with pageControlPosition top 1`] = `
|
|
|
1458
1475
|
"disabled": false,
|
|
1459
1476
|
}
|
|
1460
1477
|
}
|
|
1478
|
+
accessibilityValue={
|
|
1479
|
+
{
|
|
1480
|
+
"max": undefined,
|
|
1481
|
+
"min": undefined,
|
|
1482
|
+
"now": undefined,
|
|
1483
|
+
"text": undefined,
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1461
1486
|
accessible={true}
|
|
1462
1487
|
focusable={true}
|
|
1463
1488
|
onClick={[Function]}
|
|
@@ -1475,6 +1500,7 @@ exports[`Carousel renders correctly with pageControlPosition top 1`] = `
|
|
|
1475
1500
|
"backgroundColor": "#401960",
|
|
1476
1501
|
"borderRadius": 32,
|
|
1477
1502
|
"flexDirection": "row",
|
|
1503
|
+
"height": 60,
|
|
1478
1504
|
"justifyContent": "center",
|
|
1479
1505
|
"padding": 16,
|
|
1480
1506
|
},
|
|
@@ -1738,6 +1764,7 @@ exports[`Carousel should call skip call back when press skip 1`] = `
|
|
|
1738
1764
|
>
|
|
1739
1765
|
<View>
|
|
1740
1766
|
<View
|
|
1767
|
+
onFocusCapture={[Function]}
|
|
1741
1768
|
onLayout={[Function]}
|
|
1742
1769
|
style={
|
|
1743
1770
|
[
|
|
@@ -1848,6 +1875,7 @@ exports[`Carousel should call skip call back when press skip 1`] = `
|
|
|
1848
1875
|
</View>
|
|
1849
1876
|
</View>
|
|
1850
1877
|
<View
|
|
1878
|
+
onFocusCapture={[Function]}
|
|
1851
1879
|
onLayout={[Function]}
|
|
1852
1880
|
style={
|
|
1853
1881
|
[
|
|
@@ -1979,6 +2007,7 @@ exports[`Carousel should call skip call back when press skip 1`] = `
|
|
|
1979
2007
|
</View>
|
|
1980
2008
|
</View>
|
|
1981
2009
|
<View
|
|
2010
|
+
onFocusCapture={[Function]}
|
|
1982
2011
|
onLayout={[Function]}
|
|
1983
2012
|
style={
|
|
1984
2013
|
[
|
|
@@ -2099,6 +2128,7 @@ exports[`Carousel should call skip call back when press skip 1`] = `
|
|
|
2099
2128
|
</View>
|
|
2100
2129
|
</View>
|
|
2101
2130
|
<View
|
|
2131
|
+
onFocusCapture={[Function]}
|
|
2102
2132
|
onLayout={[Function]}
|
|
2103
2133
|
style={
|
|
2104
2134
|
[
|
|
@@ -2218,6 +2248,14 @@ exports[`Carousel should call skip call back when press skip 1`] = `
|
|
|
2218
2248
|
"disabled": false,
|
|
2219
2249
|
}
|
|
2220
2250
|
}
|
|
2251
|
+
accessibilityValue={
|
|
2252
|
+
{
|
|
2253
|
+
"max": undefined,
|
|
2254
|
+
"min": undefined,
|
|
2255
|
+
"now": undefined,
|
|
2256
|
+
"text": undefined,
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2221
2259
|
accessible={true}
|
|
2222
2260
|
focusable={true}
|
|
2223
2261
|
onClick={[Function]}
|
|
@@ -2235,6 +2273,7 @@ exports[`Carousel should call skip call back when press skip 1`] = `
|
|
|
2235
2273
|
"backgroundColor": "#401960",
|
|
2236
2274
|
"borderRadius": 32,
|
|
2237
2275
|
"flexDirection": "row",
|
|
2276
|
+
"height": 60,
|
|
2238
2277
|
"justifyContent": "center",
|
|
2239
2278
|
"padding": 16,
|
|
2240
2279
|
},
|
|
@@ -4,7 +4,7 @@ import { ImageResizeMode } from 'react-native';
|
|
|
4
4
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
5
5
|
import Carousel from '..';
|
|
6
6
|
import Image from '../../Image';
|
|
7
|
-
import {
|
|
7
|
+
import { ThemeProvider, theme } from '../../..';
|
|
8
8
|
import Button from '../../Button/Button';
|
|
9
9
|
|
|
10
10
|
const carouselData = [
|
|
@@ -144,15 +144,13 @@ describe('Carousel', () => {
|
|
|
144
144
|
);
|
|
145
145
|
rerender(
|
|
146
146
|
<ThemeProvider theme={theme}>
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
/>
|
|
155
|
-
</Portal.Provider>
|
|
147
|
+
<Carousel
|
|
148
|
+
testID="carousel"
|
|
149
|
+
items={carouselData}
|
|
150
|
+
renderActions={(_) => {
|
|
151
|
+
return <Button text="Skip" onPress={onSkip} />;
|
|
152
|
+
}}
|
|
153
|
+
/>
|
|
156
154
|
</ThemeProvider>
|
|
157
155
|
);
|
|
158
156
|
|