@hero-design/rn 8.41.3-alpha-0 → 8.41.3
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 +20 -5
- package/lib/index.js +20 -5
- package/package.json +7 -7
- package/src/components/BottomSheet/ScrollView.tsx +27 -13
- package/src/components/Carousel/__tests__/__snapshots__/CardCarousel.spec.tsx.snap +20 -0
- package/src/components/Carousel/__tests__/__snapshots__/StyledCardCarousel.spec.tsx.snap +15 -0
- package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +96 -3
- package/src/components/Carousel/__tests__/index.spec.tsx +47 -1
- package/src/components/Carousel/index.tsx +9 -4
- package/src/components/PageControl/__tests__/__snapshots__/index.spec.tsx.snap +15 -0
- package/src/components/PageControl/index.tsx +1 -0
- 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 +1 -1
- package/types/components/Carousel/types.d.ts +0 -0
- package/types/components/Checkbox/StyledCheckbox.d.ts +0 -0
- package/types/components/Checkbox/index.d.ts +0 -0
- 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 +0 -0
- 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/.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/Modal/ModalContentWrapper.d.ts +0 -16
- package/types/components/Modal/ModalPresenter/ModalPresenter.d.ts +0 -34
- package/types/components/Modal/ModalPresenter/index.d.ts +0 -3
- package/types/components/Modal/ModalProvider.d.ts +0 -5
- 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
package/.turbo/turbo-build.log
CHANGED
|
@@ -3,6 +3,6 @@ $ rollup -c
|
|
|
3
3
|
[36m
|
|
4
4
|
[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
5
5
|
[1m[33m(!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.[39m[22m
|
|
6
|
-
[1m[33m(!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/
|
|
7
|
-
[32mcreated [1mlib/index.js, es/index.js[22m in [
|
|
6
|
+
[1m[33m(!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning[39m[22m
|
|
7
|
+
[32mcreated [1mlib/index.js, es/index.js[22m in [1m27.1s[22m[39m
|
|
8
8
|
$ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
[36m@hero-design/rn:publish:npm[0m: cache hit, replaying output [2m507c34f3e0a508f6[0m
|
|
2
|
-
[36m@hero-design/rn:publish:npm: [0m$ yarn publish --access public
|
|
3
|
-
[36m@hero-design/rn:publish:npm: [0m[1/4] Bumping version...
|
|
4
|
-
[36m@hero-design/rn:publish:npm: [0minfo Current version: 8.12.0-rc.0
|
|
5
|
-
[36m@hero-design/rn:publish:npm: [0m[2/4] Logging in...
|
|
6
|
-
[36m@hero-design/rn:publish:npm: [0m[3/4] Publishing...
|
|
7
|
-
[36m@hero-design/rn:publish:npm: [0msuccess Published.
|
|
8
|
-
[36m@hero-design/rn:publish:npm: [0m[4/4] Revoking token...
|
|
9
|
-
[36m@hero-design/rn:publish:npm: [0minfo Not revoking login token, specified via config file.
|
package/es/index.js
CHANGED
|
@@ -1029,6 +1029,7 @@ var palette$b = {
|
|
|
1029
1029
|
grotesqueGreen: grotesqueGreen.base,
|
|
1030
1030
|
grotesqueGreenDark30: grotesqueGreen.darken30,
|
|
1031
1031
|
grotesqueGreenDark45: grotesqueGreen.darken45,
|
|
1032
|
+
grotesqueGreenLight30: grotesqueGreen.lighten30,
|
|
1032
1033
|
grotesqueGreenLight60: grotesqueGreen.lighten60,
|
|
1033
1034
|
grotesqueGreenLight75: grotesqueGreen.lighten75,
|
|
1034
1035
|
grotesqueGreenLight90: grotesqueGreen.lighten90,
|
|
@@ -1050,6 +1051,8 @@ var palette$b = {
|
|
|
1050
1051
|
pinkLight90: pink$1.lighten90,
|
|
1051
1052
|
purple: purple$1.base,
|
|
1052
1053
|
purpleDark15: purple$1.darken15,
|
|
1054
|
+
purpleDark30: purple$1.darken30,
|
|
1055
|
+
purpleLight30: purple$1.lighten30,
|
|
1053
1056
|
red: vermilion$2.base,
|
|
1054
1057
|
redDark15: vermilion$2.darken15,
|
|
1055
1058
|
redDark30: vermilion$2.darken30,
|
|
@@ -1060,6 +1063,7 @@ var palette$b = {
|
|
|
1060
1063
|
redLight75: vermilion$2.lighten75,
|
|
1061
1064
|
redLight90: vermilion$2.lighten90,
|
|
1062
1065
|
smalt: smalt.base,
|
|
1066
|
+
smaltDark30: smalt.darken30,
|
|
1063
1067
|
smaltDark75: smalt.darken75,
|
|
1064
1068
|
smaltLight30: smalt.lighten30,
|
|
1065
1069
|
smaltLight45: smalt.lighten45,
|
|
@@ -1077,7 +1081,9 @@ var palette$b = {
|
|
|
1077
1081
|
violetLight90: violet$1.lighten90,
|
|
1078
1082
|
yellow: yellow$1.base,
|
|
1079
1083
|
yellowDark15: yellow$1.darken15,
|
|
1084
|
+
yellowDark30: yellow$1.darken30,
|
|
1080
1085
|
yellowDark75: yellow$1.darken75,
|
|
1086
|
+
yellowLight30: yellow$1.lighten30,
|
|
1081
1087
|
yellowLight45: yellow$1.lighten45,
|
|
1082
1088
|
yellowLight60: yellow$1.lighten60,
|
|
1083
1089
|
yellowLight75: yellow$1.lighten75,
|
|
@@ -11496,6 +11502,9 @@ var PageControl = function PageControl(_ref) {
|
|
|
11496
11502
|
extrapolate: 'clamp'
|
|
11497
11503
|
});
|
|
11498
11504
|
return /*#__PURE__*/React.createElement(StyledPageControlAnimatedView, {
|
|
11505
|
+
accessibilityState: {
|
|
11506
|
+
selected: index === currentPage
|
|
11507
|
+
},
|
|
11499
11508
|
style: [{
|
|
11500
11509
|
width: indicatorWidth,
|
|
11501
11510
|
opacity: opacity
|
|
@@ -11875,7 +11884,7 @@ var CardCarousel = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
11875
11884
|
});
|
|
11876
11885
|
CardCarousel.displayName = 'CardCarousel';
|
|
11877
11886
|
|
|
11878
|
-
var _excluded$h = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "pageControlPosition"];
|
|
11887
|
+
var _excluded$h = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
|
|
11879
11888
|
function useStateFromProp(initialValue) {
|
|
11880
11889
|
var _useState = useState(initialValue),
|
|
11881
11890
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -11898,6 +11907,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
11898
11907
|
style = _ref.style,
|
|
11899
11908
|
_ref$shouldShowPagina = _ref.shouldShowPagination,
|
|
11900
11909
|
shouldShowPagination = _ref$shouldShowPagina === void 0 ? noop : _ref$shouldShowPagina,
|
|
11910
|
+
testID = _ref.testID,
|
|
11901
11911
|
_ref$pageControlPosit = _ref.pageControlPosition,
|
|
11902
11912
|
pageControlPosition = _ref$pageControlPosit === void 0 ? 'top' : _ref$pageControlPosit,
|
|
11903
11913
|
nativeProps = _objectWithoutProperties(_ref, _excluded$h);
|
|
@@ -11935,18 +11945,23 @@ var Carousel = function Carousel(_ref) {
|
|
|
11935
11945
|
viewAreaCoveragePercentThreshold: 50
|
|
11936
11946
|
}).current;
|
|
11937
11947
|
var onViewCallBack = React.useCallback(function (info) {
|
|
11938
|
-
|
|
11939
|
-
|
|
11948
|
+
var firstVisibleItem = info.viewableItems.find(function (view) {
|
|
11949
|
+
return view.index != null && view.isViewable;
|
|
11950
|
+
});
|
|
11951
|
+
if (firstVisibleItem) {
|
|
11952
|
+
internalOnItemIndexChange(firstVisibleItem.index || 0);
|
|
11940
11953
|
}
|
|
11941
|
-
}, []);
|
|
11954
|
+
}, [internalOnItemIndexChange]);
|
|
11942
11955
|
return /*#__PURE__*/React.createElement(View, _extends$1({
|
|
11943
|
-
style: style
|
|
11956
|
+
style: style,
|
|
11957
|
+
testID: testID
|
|
11944
11958
|
}, nativeProps), /*#__PURE__*/React.createElement(StyledBackDrop, {
|
|
11945
11959
|
themeSlideBackground: items[currentSlideIndex].background
|
|
11946
11960
|
}), /*#__PURE__*/React.createElement(StyledPageControlWrapper, null, pageControlPosition === 'top' && shouldShowPagination(currentSlideIndex) && /*#__PURE__*/React.createElement(StyledPageControl$1, {
|
|
11947
11961
|
numberOfPages: items.length,
|
|
11948
11962
|
currentPage: currentSlideIndex
|
|
11949
11963
|
})), /*#__PURE__*/React.createElement(StyledCarouselView, null, /*#__PURE__*/React.createElement(FlatList, {
|
|
11964
|
+
testID: testID ? "".concat(testID, "_flatlist") : undefined,
|
|
11950
11965
|
horizontal: true,
|
|
11951
11966
|
showsHorizontalScrollIndicator: false,
|
|
11952
11967
|
pagingEnabled: true,
|
package/lib/index.js
CHANGED
|
@@ -1059,6 +1059,7 @@ var palette$b = {
|
|
|
1059
1059
|
grotesqueGreen: grotesqueGreen.base,
|
|
1060
1060
|
grotesqueGreenDark30: grotesqueGreen.darken30,
|
|
1061
1061
|
grotesqueGreenDark45: grotesqueGreen.darken45,
|
|
1062
|
+
grotesqueGreenLight30: grotesqueGreen.lighten30,
|
|
1062
1063
|
grotesqueGreenLight60: grotesqueGreen.lighten60,
|
|
1063
1064
|
grotesqueGreenLight75: grotesqueGreen.lighten75,
|
|
1064
1065
|
grotesqueGreenLight90: grotesqueGreen.lighten90,
|
|
@@ -1080,6 +1081,8 @@ var palette$b = {
|
|
|
1080
1081
|
pinkLight90: pink$1.lighten90,
|
|
1081
1082
|
purple: purple$1.base,
|
|
1082
1083
|
purpleDark15: purple$1.darken15,
|
|
1084
|
+
purpleDark30: purple$1.darken30,
|
|
1085
|
+
purpleLight30: purple$1.lighten30,
|
|
1083
1086
|
red: vermilion$2.base,
|
|
1084
1087
|
redDark15: vermilion$2.darken15,
|
|
1085
1088
|
redDark30: vermilion$2.darken30,
|
|
@@ -1090,6 +1093,7 @@ var palette$b = {
|
|
|
1090
1093
|
redLight75: vermilion$2.lighten75,
|
|
1091
1094
|
redLight90: vermilion$2.lighten90,
|
|
1092
1095
|
smalt: smalt.base,
|
|
1096
|
+
smaltDark30: smalt.darken30,
|
|
1093
1097
|
smaltDark75: smalt.darken75,
|
|
1094
1098
|
smaltLight30: smalt.lighten30,
|
|
1095
1099
|
smaltLight45: smalt.lighten45,
|
|
@@ -1107,7 +1111,9 @@ var palette$b = {
|
|
|
1107
1111
|
violetLight90: violet$1.lighten90,
|
|
1108
1112
|
yellow: yellow$1.base,
|
|
1109
1113
|
yellowDark15: yellow$1.darken15,
|
|
1114
|
+
yellowDark30: yellow$1.darken30,
|
|
1110
1115
|
yellowDark75: yellow$1.darken75,
|
|
1116
|
+
yellowLight30: yellow$1.lighten30,
|
|
1111
1117
|
yellowLight45: yellow$1.lighten45,
|
|
1112
1118
|
yellowLight60: yellow$1.lighten60,
|
|
1113
1119
|
yellowLight75: yellow$1.lighten75,
|
|
@@ -11526,6 +11532,9 @@ var PageControl = function PageControl(_ref) {
|
|
|
11526
11532
|
extrapolate: 'clamp'
|
|
11527
11533
|
});
|
|
11528
11534
|
return /*#__PURE__*/React__default["default"].createElement(StyledPageControlAnimatedView, {
|
|
11535
|
+
accessibilityState: {
|
|
11536
|
+
selected: index === currentPage
|
|
11537
|
+
},
|
|
11529
11538
|
style: [{
|
|
11530
11539
|
width: indicatorWidth,
|
|
11531
11540
|
opacity: opacity
|
|
@@ -11905,7 +11914,7 @@ var CardCarousel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
11905
11914
|
});
|
|
11906
11915
|
CardCarousel.displayName = 'CardCarousel';
|
|
11907
11916
|
|
|
11908
|
-
var _excluded$h = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "pageControlPosition"];
|
|
11917
|
+
var _excluded$h = ["items", "onItemIndexChange", "renderActions", "selectedItemIndex", "style", "shouldShowPagination", "testID", "pageControlPosition"];
|
|
11909
11918
|
function useStateFromProp(initialValue) {
|
|
11910
11919
|
var _useState = React.useState(initialValue),
|
|
11911
11920
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -11928,6 +11937,7 @@ var Carousel = function Carousel(_ref) {
|
|
|
11928
11937
|
style = _ref.style,
|
|
11929
11938
|
_ref$shouldShowPagina = _ref.shouldShowPagination,
|
|
11930
11939
|
shouldShowPagination = _ref$shouldShowPagina === void 0 ? noop : _ref$shouldShowPagina,
|
|
11940
|
+
testID = _ref.testID,
|
|
11931
11941
|
_ref$pageControlPosit = _ref.pageControlPosition,
|
|
11932
11942
|
pageControlPosition = _ref$pageControlPosit === void 0 ? 'top' : _ref$pageControlPosit,
|
|
11933
11943
|
nativeProps = _objectWithoutProperties(_ref, _excluded$h);
|
|
@@ -11965,18 +11975,23 @@ var Carousel = function Carousel(_ref) {
|
|
|
11965
11975
|
viewAreaCoveragePercentThreshold: 50
|
|
11966
11976
|
}).current;
|
|
11967
11977
|
var onViewCallBack = React__default["default"].useCallback(function (info) {
|
|
11968
|
-
|
|
11969
|
-
|
|
11978
|
+
var firstVisibleItem = info.viewableItems.find(function (view) {
|
|
11979
|
+
return view.index != null && view.isViewable;
|
|
11980
|
+
});
|
|
11981
|
+
if (firstVisibleItem) {
|
|
11982
|
+
internalOnItemIndexChange(firstVisibleItem.index || 0);
|
|
11970
11983
|
}
|
|
11971
|
-
}, []);
|
|
11984
|
+
}, [internalOnItemIndexChange]);
|
|
11972
11985
|
return /*#__PURE__*/React__default["default"].createElement(reactNative.View, _extends$1({
|
|
11973
|
-
style: style
|
|
11986
|
+
style: style,
|
|
11987
|
+
testID: testID
|
|
11974
11988
|
}, nativeProps), /*#__PURE__*/React__default["default"].createElement(StyledBackDrop, {
|
|
11975
11989
|
themeSlideBackground: items[currentSlideIndex].background
|
|
11976
11990
|
}), /*#__PURE__*/React__default["default"].createElement(StyledPageControlWrapper, null, pageControlPosition === 'top' && shouldShowPagination(currentSlideIndex) && /*#__PURE__*/React__default["default"].createElement(StyledPageControl$1, {
|
|
11977
11991
|
numberOfPages: items.length,
|
|
11978
11992
|
currentPage: currentSlideIndex
|
|
11979
11993
|
})), /*#__PURE__*/React__default["default"].createElement(StyledCarouselView, null, /*#__PURE__*/React__default["default"].createElement(reactNative.FlatList, {
|
|
11994
|
+
testID: testID ? "".concat(testID, "_flatlist") : undefined,
|
|
11980
11995
|
horizontal: true,
|
|
11981
11996
|
showsHorizontalScrollIndicator: false,
|
|
11982
11997
|
pagingEnabled: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.41.3
|
|
3
|
+
"version": "8.41.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@emotion/native": "^11.9.3",
|
|
23
23
|
"@emotion/react": "^11.9.3",
|
|
24
|
-
"@hero-design/colors": "8.41.
|
|
24
|
+
"@hero-design/colors": "8.41.3",
|
|
25
25
|
"date-fns": "^2.16.1",
|
|
26
26
|
"events": "^3.2.0",
|
|
27
27
|
"hero-editor": "^1.9.21",
|
|
28
28
|
"nanoid": "^4.0.2"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@hero-design/react-native-month-year-picker": "^8.41.
|
|
31
|
+
"@hero-design/react-native-month-year-picker": "^8.41.3",
|
|
32
32
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
33
33
|
"@react-native-community/slider": "4.1.12",
|
|
34
34
|
"react": "18.0.0",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@babel/preset-typescript": "^7.17.12",
|
|
48
48
|
"@babel/runtime": "^7.18.9",
|
|
49
49
|
"@emotion/jest": "^11.11.0",
|
|
50
|
-
"@hero-design/eslint-plugin": "8.41.
|
|
51
|
-
"@hero-design/react-native-month-year-picker": "^8.41.
|
|
50
|
+
"@hero-design/eslint-plugin": "8.41.3",
|
|
51
|
+
"@hero-design/react-native-month-year-picker": "^8.41.3",
|
|
52
52
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
53
53
|
"@react-native-community/slider": "4.1.12",
|
|
54
54
|
"@rollup/plugin-babel": "^5.3.1",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"@types/react-native": "^0.67.7",
|
|
65
65
|
"@types/react-native-vector-icons": "^6.4.10",
|
|
66
66
|
"babel-plugin-inline-import": "^3.0.0",
|
|
67
|
-
"eslint-config-hd": "8.41.
|
|
67
|
+
"eslint-config-hd": "8.41.3",
|
|
68
68
|
"eslint-plugin-import": "^2.27.5",
|
|
69
69
|
"jest": "^29.6.2",
|
|
70
70
|
"jest-environment-jsdom": "^29.6.2",
|
|
71
71
|
"jest-junit": "^16.0.0",
|
|
72
|
-
"prettier-config-hd": "8.41.
|
|
72
|
+
"prettier-config-hd": "8.41.3",
|
|
73
73
|
"react": "18.0.0",
|
|
74
74
|
"react-native": "0.69.7",
|
|
75
75
|
"react-native-gesture-handler": "~2.5.0",
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import React, { useContext, useCallback } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
NativeScrollEvent,
|
|
4
|
+
NativeSyntheticEvent,
|
|
5
|
+
ScrollView,
|
|
6
|
+
ScrollViewProps,
|
|
7
|
+
} from 'react-native';
|
|
3
8
|
import BottomSheetContext, {
|
|
4
9
|
BottomSheetContextType,
|
|
5
10
|
} from './BottomSheetContext';
|
|
@@ -11,23 +16,32 @@ const BottomSheetScrollView = ({
|
|
|
11
16
|
const { setInternalShowDivider } =
|
|
12
17
|
useContext<BottomSheetContextType>(BottomSheetContext);
|
|
13
18
|
|
|
14
|
-
const onScrollBeginDrag = useCallback(
|
|
15
|
-
|
|
19
|
+
const onScrollBeginDrag = useCallback(
|
|
20
|
+
(e: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
21
|
+
setInternalShowDivider(true);
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
props?.onScrollBeginDrag?.(e);
|
|
24
|
+
},
|
|
25
|
+
[]
|
|
26
|
+
);
|
|
19
27
|
|
|
20
|
-
const onMomentumScrollBegin = useCallback(
|
|
21
|
-
|
|
28
|
+
const onMomentumScrollBegin = useCallback(
|
|
29
|
+
(e: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
30
|
+
setInternalShowDivider(true);
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
props?.onMomentumScrollEnd?.(e);
|
|
33
|
+
},
|
|
34
|
+
[]
|
|
35
|
+
);
|
|
25
36
|
|
|
26
|
-
const onMomentumScrollEnd = useCallback(
|
|
27
|
-
|
|
37
|
+
const onMomentumScrollEnd = useCallback(
|
|
38
|
+
(e: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
39
|
+
setInternalShowDivider(false);
|
|
28
40
|
|
|
29
|
-
|
|
30
|
-
|
|
41
|
+
props?.onMomentumScrollEnd?.(e);
|
|
42
|
+
},
|
|
43
|
+
[]
|
|
44
|
+
);
|
|
31
45
|
|
|
32
46
|
return (
|
|
33
47
|
<ScrollView
|
|
@@ -264,6 +264,11 @@ exports[`CardCarousel android should render correctly on iOS 1`] = `
|
|
|
264
264
|
testID="pageControl"
|
|
265
265
|
>
|
|
266
266
|
<View
|
|
267
|
+
accessibilityState={
|
|
268
|
+
{
|
|
269
|
+
"selected": true,
|
|
270
|
+
}
|
|
271
|
+
}
|
|
267
272
|
collapsable={false}
|
|
268
273
|
style={
|
|
269
274
|
{
|
|
@@ -278,6 +283,11 @@ exports[`CardCarousel android should render correctly on iOS 1`] = `
|
|
|
278
283
|
testID="page-control-indicator0"
|
|
279
284
|
/>
|
|
280
285
|
<View
|
|
286
|
+
accessibilityState={
|
|
287
|
+
{
|
|
288
|
+
"selected": false,
|
|
289
|
+
}
|
|
290
|
+
}
|
|
281
291
|
collapsable={false}
|
|
282
292
|
style={
|
|
283
293
|
{
|
|
@@ -559,6 +569,11 @@ exports[`CardCarousel ios should render correctly on iOS 1`] = `
|
|
|
559
569
|
testID="pageControl"
|
|
560
570
|
>
|
|
561
571
|
<View
|
|
572
|
+
accessibilityState={
|
|
573
|
+
{
|
|
574
|
+
"selected": true,
|
|
575
|
+
}
|
|
576
|
+
}
|
|
562
577
|
collapsable={false}
|
|
563
578
|
style={
|
|
564
579
|
{
|
|
@@ -573,6 +588,11 @@ exports[`CardCarousel ios should render correctly on iOS 1`] = `
|
|
|
573
588
|
testID="page-control-indicator0"
|
|
574
589
|
/>
|
|
575
590
|
<View
|
|
591
|
+
accessibilityState={
|
|
592
|
+
{
|
|
593
|
+
"selected": false,
|
|
594
|
+
}
|
|
595
|
+
}
|
|
576
596
|
collapsable={false}
|
|
577
597
|
style={
|
|
578
598
|
{
|
|
@@ -53,6 +53,11 @@ exports[`StyledPageControl should render correctly 1`] = `
|
|
|
53
53
|
}
|
|
54
54
|
>
|
|
55
55
|
<View
|
|
56
|
+
accessibilityState={
|
|
57
|
+
{
|
|
58
|
+
"selected": false,
|
|
59
|
+
}
|
|
60
|
+
}
|
|
56
61
|
collapsable={false}
|
|
57
62
|
style={
|
|
58
63
|
{
|
|
@@ -67,6 +72,11 @@ exports[`StyledPageControl should render correctly 1`] = `
|
|
|
67
72
|
testID="page-control-indicator0"
|
|
68
73
|
/>
|
|
69
74
|
<View
|
|
75
|
+
accessibilityState={
|
|
76
|
+
{
|
|
77
|
+
"selected": true,
|
|
78
|
+
}
|
|
79
|
+
}
|
|
70
80
|
collapsable={false}
|
|
71
81
|
style={
|
|
72
82
|
{
|
|
@@ -81,6 +91,11 @@ exports[`StyledPageControl should render correctly 1`] = `
|
|
|
81
91
|
testID="page-control-indicator1"
|
|
82
92
|
/>
|
|
83
93
|
<View
|
|
94
|
+
accessibilityState={
|
|
95
|
+
{
|
|
96
|
+
"selected": false,
|
|
97
|
+
}
|
|
98
|
+
}
|
|
84
99
|
collapsable={false}
|
|
85
100
|
style={
|
|
86
101
|
{
|
|
@@ -99,18 +99,29 @@ exports[`Carousel renders correctly with pageControlPosition bottom 1`] = `
|
|
|
99
99
|
onScroll={[Function]}
|
|
100
100
|
onScrollBeginDrag={[Function]}
|
|
101
101
|
onScrollEndDrag={[Function]}
|
|
102
|
+
onViewableItemsChanged={[Function]}
|
|
102
103
|
pagingEnabled={true}
|
|
103
104
|
removeClippedSubviews={false}
|
|
104
105
|
renderItem={[Function]}
|
|
105
106
|
scrollEventThrottle={32}
|
|
106
107
|
showsHorizontalScrollIndicator={false}
|
|
107
108
|
stickyHeaderIndices={[]}
|
|
109
|
+
testID="carousel_flatlist"
|
|
108
110
|
viewabilityConfig={
|
|
109
111
|
{
|
|
110
112
|
"viewAreaCoveragePercentThreshold": 50,
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
|
-
viewabilityConfigCallbackPairs={
|
|
115
|
+
viewabilityConfigCallbackPairs={
|
|
116
|
+
[
|
|
117
|
+
{
|
|
118
|
+
"onViewableItemsChanged": [Function],
|
|
119
|
+
"viewabilityConfig": {
|
|
120
|
+
"viewAreaCoveragePercentThreshold": 50,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
]
|
|
124
|
+
}
|
|
114
125
|
>
|
|
115
126
|
<View>
|
|
116
127
|
<View
|
|
@@ -667,6 +678,11 @@ exports[`Carousel renders correctly with pageControlPosition bottom 1`] = `
|
|
|
667
678
|
}
|
|
668
679
|
>
|
|
669
680
|
<View
|
|
681
|
+
accessibilityState={
|
|
682
|
+
{
|
|
683
|
+
"selected": true,
|
|
684
|
+
}
|
|
685
|
+
}
|
|
670
686
|
collapsable={false}
|
|
671
687
|
style={
|
|
672
688
|
{
|
|
@@ -681,6 +697,11 @@ exports[`Carousel renders correctly with pageControlPosition bottom 1`] = `
|
|
|
681
697
|
testID="page-control-indicator0"
|
|
682
698
|
/>
|
|
683
699
|
<View
|
|
700
|
+
accessibilityState={
|
|
701
|
+
{
|
|
702
|
+
"selected": false,
|
|
703
|
+
}
|
|
704
|
+
}
|
|
684
705
|
collapsable={false}
|
|
685
706
|
style={
|
|
686
707
|
{
|
|
@@ -695,6 +716,11 @@ exports[`Carousel renders correctly with pageControlPosition bottom 1`] = `
|
|
|
695
716
|
testID="page-control-indicator1"
|
|
696
717
|
/>
|
|
697
718
|
<View
|
|
719
|
+
accessibilityState={
|
|
720
|
+
{
|
|
721
|
+
"selected": false,
|
|
722
|
+
}
|
|
723
|
+
}
|
|
698
724
|
collapsable={false}
|
|
699
725
|
style={
|
|
700
726
|
{
|
|
@@ -709,6 +735,11 @@ exports[`Carousel renders correctly with pageControlPosition bottom 1`] = `
|
|
|
709
735
|
testID="page-control-indicator2"
|
|
710
736
|
/>
|
|
711
737
|
<View
|
|
738
|
+
accessibilityState={
|
|
739
|
+
{
|
|
740
|
+
"selected": false,
|
|
741
|
+
}
|
|
742
|
+
}
|
|
712
743
|
collapsable={false}
|
|
713
744
|
style={
|
|
714
745
|
{
|
|
@@ -777,6 +808,11 @@ exports[`Carousel renders correctly with pageControlPosition top 1`] = `
|
|
|
777
808
|
}
|
|
778
809
|
>
|
|
779
810
|
<View
|
|
811
|
+
accessibilityState={
|
|
812
|
+
{
|
|
813
|
+
"selected": true,
|
|
814
|
+
}
|
|
815
|
+
}
|
|
780
816
|
collapsable={false}
|
|
781
817
|
style={
|
|
782
818
|
{
|
|
@@ -791,6 +827,11 @@ exports[`Carousel renders correctly with pageControlPosition top 1`] = `
|
|
|
791
827
|
testID="page-control-indicator0"
|
|
792
828
|
/>
|
|
793
829
|
<View
|
|
830
|
+
accessibilityState={
|
|
831
|
+
{
|
|
832
|
+
"selected": false,
|
|
833
|
+
}
|
|
834
|
+
}
|
|
794
835
|
collapsable={false}
|
|
795
836
|
style={
|
|
796
837
|
{
|
|
@@ -805,6 +846,11 @@ exports[`Carousel renders correctly with pageControlPosition top 1`] = `
|
|
|
805
846
|
testID="page-control-indicator1"
|
|
806
847
|
/>
|
|
807
848
|
<View
|
|
849
|
+
accessibilityState={
|
|
850
|
+
{
|
|
851
|
+
"selected": false,
|
|
852
|
+
}
|
|
853
|
+
}
|
|
808
854
|
collapsable={false}
|
|
809
855
|
style={
|
|
810
856
|
{
|
|
@@ -819,6 +865,11 @@ exports[`Carousel renders correctly with pageControlPosition top 1`] = `
|
|
|
819
865
|
testID="page-control-indicator2"
|
|
820
866
|
/>
|
|
821
867
|
<View
|
|
868
|
+
accessibilityState={
|
|
869
|
+
{
|
|
870
|
+
"selected": false,
|
|
871
|
+
}
|
|
872
|
+
}
|
|
822
873
|
collapsable={false}
|
|
823
874
|
style={
|
|
824
875
|
{
|
|
@@ -901,18 +952,29 @@ exports[`Carousel renders correctly with pageControlPosition top 1`] = `
|
|
|
901
952
|
onScroll={[Function]}
|
|
902
953
|
onScrollBeginDrag={[Function]}
|
|
903
954
|
onScrollEndDrag={[Function]}
|
|
955
|
+
onViewableItemsChanged={[Function]}
|
|
904
956
|
pagingEnabled={true}
|
|
905
957
|
removeClippedSubviews={false}
|
|
906
958
|
renderItem={[Function]}
|
|
907
959
|
scrollEventThrottle={32}
|
|
908
960
|
showsHorizontalScrollIndicator={false}
|
|
909
961
|
stickyHeaderIndices={[]}
|
|
962
|
+
testID="carousel_flatlist"
|
|
910
963
|
viewabilityConfig={
|
|
911
964
|
{
|
|
912
965
|
"viewAreaCoveragePercentThreshold": 50,
|
|
913
966
|
}
|
|
914
967
|
}
|
|
915
|
-
viewabilityConfigCallbackPairs={
|
|
968
|
+
viewabilityConfigCallbackPairs={
|
|
969
|
+
[
|
|
970
|
+
{
|
|
971
|
+
"onViewableItemsChanged": [Function],
|
|
972
|
+
"viewabilityConfig": {
|
|
973
|
+
"viewAreaCoveragePercentThreshold": 50,
|
|
974
|
+
},
|
|
975
|
+
},
|
|
976
|
+
]
|
|
977
|
+
}
|
|
916
978
|
>
|
|
917
979
|
<View>
|
|
918
980
|
<View
|
|
@@ -1506,6 +1568,11 @@ exports[`Carousel should call skip call back when press skip 1`] = `
|
|
|
1506
1568
|
}
|
|
1507
1569
|
>
|
|
1508
1570
|
<View
|
|
1571
|
+
accessibilityState={
|
|
1572
|
+
{
|
|
1573
|
+
"selected": true,
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1509
1576
|
collapsable={false}
|
|
1510
1577
|
style={
|
|
1511
1578
|
{
|
|
@@ -1520,6 +1587,11 @@ exports[`Carousel should call skip call back when press skip 1`] = `
|
|
|
1520
1587
|
testID="page-control-indicator0"
|
|
1521
1588
|
/>
|
|
1522
1589
|
<View
|
|
1590
|
+
accessibilityState={
|
|
1591
|
+
{
|
|
1592
|
+
"selected": false,
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1523
1595
|
collapsable={false}
|
|
1524
1596
|
style={
|
|
1525
1597
|
{
|
|
@@ -1534,6 +1606,11 @@ exports[`Carousel should call skip call back when press skip 1`] = `
|
|
|
1534
1606
|
testID="page-control-indicator1"
|
|
1535
1607
|
/>
|
|
1536
1608
|
<View
|
|
1609
|
+
accessibilityState={
|
|
1610
|
+
{
|
|
1611
|
+
"selected": false,
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1537
1614
|
collapsable={false}
|
|
1538
1615
|
style={
|
|
1539
1616
|
{
|
|
@@ -1548,6 +1625,11 @@ exports[`Carousel should call skip call back when press skip 1`] = `
|
|
|
1548
1625
|
testID="page-control-indicator2"
|
|
1549
1626
|
/>
|
|
1550
1627
|
<View
|
|
1628
|
+
accessibilityState={
|
|
1629
|
+
{
|
|
1630
|
+
"selected": false,
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1551
1633
|
collapsable={false}
|
|
1552
1634
|
style={
|
|
1553
1635
|
{
|
|
@@ -1630,18 +1712,29 @@ exports[`Carousel should call skip call back when press skip 1`] = `
|
|
|
1630
1712
|
onScroll={[Function]}
|
|
1631
1713
|
onScrollBeginDrag={[Function]}
|
|
1632
1714
|
onScrollEndDrag={[Function]}
|
|
1715
|
+
onViewableItemsChanged={[Function]}
|
|
1633
1716
|
pagingEnabled={true}
|
|
1634
1717
|
removeClippedSubviews={false}
|
|
1635
1718
|
renderItem={[Function]}
|
|
1636
1719
|
scrollEventThrottle={32}
|
|
1637
1720
|
showsHorizontalScrollIndicator={false}
|
|
1638
1721
|
stickyHeaderIndices={[]}
|
|
1722
|
+
testID="carousel_flatlist"
|
|
1639
1723
|
viewabilityConfig={
|
|
1640
1724
|
{
|
|
1641
1725
|
"viewAreaCoveragePercentThreshold": 50,
|
|
1642
1726
|
}
|
|
1643
1727
|
}
|
|
1644
|
-
viewabilityConfigCallbackPairs={
|
|
1728
|
+
viewabilityConfigCallbackPairs={
|
|
1729
|
+
[
|
|
1730
|
+
{
|
|
1731
|
+
"onViewableItemsChanged": [Function],
|
|
1732
|
+
"viewabilityConfig": {
|
|
1733
|
+
"viewAreaCoveragePercentThreshold": 50,
|
|
1734
|
+
},
|
|
1735
|
+
},
|
|
1736
|
+
]
|
|
1737
|
+
}
|
|
1645
1738
|
>
|
|
1646
1739
|
<View>
|
|
1647
1740
|
<View
|
|
@@ -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 { theme } from '../../..';
|
|
7
|
+
import { ThemeProvider, theme } from '../../..';
|
|
8
8
|
import Button from '../../Button/Button';
|
|
9
9
|
|
|
10
10
|
const carouselData = [
|
|
@@ -112,4 +112,50 @@ describe('Carousel', () => {
|
|
|
112
112
|
fireEvent.press(queryByText('Skip'));
|
|
113
113
|
expect(onSkip).toBeCalled();
|
|
114
114
|
});
|
|
115
|
+
|
|
116
|
+
it("pageControl' current index should change to 1 when scroll", async () => {
|
|
117
|
+
const onSkip = jest.fn();
|
|
118
|
+
|
|
119
|
+
const { rerender, getByTestId } = renderWithTheme(
|
|
120
|
+
<Carousel
|
|
121
|
+
testID="carousel"
|
|
122
|
+
items={carouselData}
|
|
123
|
+
renderActions={(_) => {
|
|
124
|
+
return <Button text="Skip" onPress={onSkip} />;
|
|
125
|
+
}}
|
|
126
|
+
/>
|
|
127
|
+
);
|
|
128
|
+
const eventData = {
|
|
129
|
+
viewableItems: [
|
|
130
|
+
{
|
|
131
|
+
index: 0,
|
|
132
|
+
isViewable: false,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
index: 1,
|
|
136
|
+
isViewable: true,
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
};
|
|
140
|
+
fireEvent(
|
|
141
|
+
getByTestId('carousel_flatlist'),
|
|
142
|
+
'onViewableItemsChanged',
|
|
143
|
+
eventData
|
|
144
|
+
);
|
|
145
|
+
rerender(
|
|
146
|
+
<ThemeProvider theme={theme}>
|
|
147
|
+
<Carousel
|
|
148
|
+
testID="carousel"
|
|
149
|
+
items={carouselData}
|
|
150
|
+
renderActions={(_) => {
|
|
151
|
+
return <Button text="Skip" onPress={onSkip} />;
|
|
152
|
+
}}
|
|
153
|
+
/>
|
|
154
|
+
</ThemeProvider>
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
expect(getByTestId('page-control-indicator1')).toHaveAccessibilityState({
|
|
158
|
+
selected: true,
|
|
159
|
+
});
|
|
160
|
+
});
|
|
115
161
|
});
|