@hero-design/rn 8.83.0-test.0 → 8.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +3 -4
- package/CHANGELOG.md +22 -2
- package/es/index.js +538 -87
- package/eslint.config.js +2 -4
- package/lib/index.js +536 -84
- package/package.json +6 -6
- package/src/components/AppCue/StyledAppCue.tsx +46 -0
- package/src/components/AppCue/__tests__/StyledAppCue.tsx +18 -0
- package/src/components/AppCue/__tests__/__snapshots__/StyledAppCue.tsx.snap +200 -0
- package/src/components/AppCue/__tests__/__snapshots__/index.spec.tsx.snap +391 -0
- package/src/components/AppCue/__tests__/index.spec.tsx +61 -0
- package/src/components/AppCue/__tests__/utils.spec.ts +90 -0
- package/src/components/AppCue/index.tsx +188 -0
- package/src/components/AppCue/utils.ts +122 -0
- package/src/components/Button/Button.tsx +73 -26
- package/src/components/Button/StyledButton.tsx +137 -48
- package/src/components/Button/UtilityButton/StyledUtilityButton.tsx +1 -1
- package/src/components/Button/__tests__/Button.spec.tsx +39 -31
- package/src/components/Button/__tests__/StyledButton.spec.tsx +52 -0
- package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +774 -0
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +489 -0
- package/src/components/Chip/StyledChip.tsx +9 -9
- package/src/components/Chip/__tests__/__snapshots__/index.spec.tsx.snap +434 -0
- package/src/components/Chip/__tests__/index.spec.tsx +4 -0
- package/src/components/Chip/index.tsx +32 -5
- package/src/components/Slider/{Range.tsx → RangeSlider.tsx} +29 -19
- package/src/components/Slider/StyledRangeSlider.tsx +16 -0
- package/src/components/Slider/__tests__/{Range.spec.tsx → RangeSlider.spec.tsx} +23 -9
- package/src/components/Slider/__tests__/{Single.spec.tsx → SingleSlider.spec.tsx} +1 -1
- package/src/components/Slider/__tests__/__snapshots__/{Range.spec.tsx.snap → RangeSlider.spec.tsx.snap} +110 -26
- package/src/components/Slider/index.tsx +3 -3
- package/src/components/Tabs/StyledScrollableTabs.tsx +2 -1
- package/src/components/Tabs/StyledTabs.tsx +1 -0
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +3 -0
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +2 -0
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +3 -0
- package/src/index.ts +2 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +53 -4
- package/src/theme/components/appCue.ts +22 -0
- package/src/theme/components/button.ts +14 -4
- package/src/theme/components/slider.ts +8 -1
- package/src/theme/components/tabs.ts +1 -0
- package/src/theme/getTheme.ts +3 -0
- package/src/types.ts +1 -1
- package/stats/8.83.0/rn-stats.html +4844 -0
- package/stats/8.84.0/rn-stats.html +4842 -0
- package/types/components/Accordion/AccordionItem.d.ts +1 -1
- package/types/components/Accordion/StyledAccordion.d.ts +11 -11
- package/types/components/Accordion/index.d.ts +1 -1
- package/types/components/Alert/StyledAlert.d.ts +16 -16
- package/types/components/Alert/index.d.ts +1 -1
- package/types/components/AppCue/StyledAppCue.d.ts +20 -0
- package/types/components/AppCue/__tests__/StyledAppCue.d.ts +1 -0
- package/types/components/AppCue/index.d.ts +21 -0
- package/types/components/AppCue/utils.d.ts +63 -0
- package/types/components/Attachment/StyledAttachment.d.ts +8 -8
- 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 +9 -9
- 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 +10 -10
- 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 +12 -12
- package/types/components/Badge/index.d.ts +1 -1
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +15 -15
- package/types/components/BottomNavigation/index.d.ts +1 -1
- package/types/components/BottomSheet/BottomSheetContext.d.ts +1 -1
- package/types/components/BottomSheet/Footer.d.ts +0 -0
- package/types/components/BottomSheet/Header.d.ts +2 -2
- package/types/components/BottomSheet/ScrollView.d.ts +0 -0
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +22 -22
- package/types/components/BottomSheet/index.d.ts +0 -0
- package/types/components/Box/StyledBox.d.ts +2 -2
- package/types/components/Box/config.d.ts +2 -2
- package/types/components/Box/index.d.ts +0 -0
- package/types/components/Box/types.d.ts +3 -3
- package/types/components/Button/Button.d.ts +2 -2
- package/types/components/Button/IconButton.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +6 -6
- package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +33 -23
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +6 -6
- 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 +22 -22
- 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 +5 -5
- package/types/components/Card/DataCard/index.d.ts +0 -0
- package/types/components/Card/StyledCard.d.ts +4 -4
- package/types/components/Card/index.d.ts +0 -0
- package/types/components/Carousel/CardCarousel.d.ts +1 -1
- package/types/components/Carousel/CarouselItem.d.ts +0 -0
- package/types/components/Carousel/StyledCardCarousel.d.ts +8 -8
- package/types/components/Carousel/StyledCarousel.d.ts +21 -21
- 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 +2 -2
- package/types/components/Checkbox/StyledCheckbox.d.ts +11 -11
- package/types/components/Checkbox/index.d.ts +1 -1
- package/types/components/Chip/StyledChip.d.ts +6 -6
- package/types/components/Chip/index.d.ts +2 -2
- package/types/components/Collapse/StyledCollapse.d.ts +6 -6
- package/types/components/Collapse/index.d.ts +0 -0
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +2 -2
- package/types/components/ContentNavigator/index.d.ts +0 -0
- package/types/components/DatePicker/DatePickerAndroid.d.ts +1 -1
- package/types/components/DatePicker/DatePickerCalendar.d.ts +1 -1
- package/types/components/DatePicker/DatePickerIOS.d.ts +1 -1
- package/types/components/DatePicker/StyledDatePicker.d.ts +2 -2
- package/types/components/DatePicker/index.d.ts +0 -0
- package/types/components/DatePicker/types.d.ts +0 -0
- package/types/components/DatePicker/useCalculateDate.d.ts +1 -1
- package/types/components/Divider/StyledDivider.d.ts +5 -5
- package/types/components/Divider/index.d.ts +0 -0
- package/types/components/Drawer/DragableDrawer/helpers.d.ts +1 -1
- package/types/components/Drawer/DragableDrawer/index.d.ts +0 -0
- package/types/components/Drawer/StyledDrawer.d.ts +15 -15
- package/types/components/Drawer/index.d.ts +0 -0
- package/types/components/Empty/StyledEmpty.d.ts +7 -7
- package/types/components/Empty/index.d.ts +0 -0
- package/types/components/Error/StyledError.d.ts +21 -21
- 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 +10 -10
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +6 -6
- package/types/components/FAB/ActionGroup/index.d.ts +1 -1
- package/types/components/FAB/AnimatedFABIcon.d.ts +1 -1
- package/types/components/FAB/FAB.d.ts +1 -1
- package/types/components/FAB/Pair/StyledFAB.d.ts +6 -6
- package/types/components/FAB/Pair/index.d.ts +1 -1
- package/types/components/FAB/StyledFAB.d.ts +9 -9
- package/types/components/FAB/index.d.ts +0 -0
- package/types/components/FloatingIsland/StyledFloatingIsland.d.ts +10 -10
- package/types/components/Icon/AnimatedIcon.d.ts +1 -1
- package/types/components/Icon/HeroIcon/index.d.ts +4 -4
- package/types/components/Icon/IconList.d.ts +0 -0
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/Icon/utils.d.ts +2 -1
- 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 +10 -10
- package/types/components/List/StyledListItem.d.ts +18 -18
- package/types/components/List/index.d.ts +0 -0
- package/types/components/MapPin/StyledMapPin.d.ts +11 -11
- package/types/components/MapPin/types.d.ts +1 -1
- package/types/components/PageControl/StyledPageControl.d.ts +4 -4
- 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 +21 -21
- package/types/components/PinInput/index.d.ts +0 -0
- package/types/components/Portal/reducer.d.ts +1 -1
- package/types/components/Portal/types.d.ts +1 -1
- package/types/components/Progress/ProgressBar.d.ts +0 -0
- package/types/components/Progress/ProgressCircle.d.ts +0 -0
- package/types/components/Progress/ProgressStep.d.ts +1 -1
- package/types/components/Progress/StyledProgressBar.d.ts +4 -4
- package/types/components/Progress/StyledProgressCircle.d.ts +12 -12
- package/types/components/Progress/StyledStep.d.ts +10 -10
- 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 +1 -1
- 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 +9 -9
- package/types/components/Radio/index.d.ts +1 -1
- package/types/components/Radio/types.d.ts +1 -1
- package/types/components/Rate/StyledRate.d.ts +4 -4
- package/types/components/RefreshControl/index.d.ts +1 -1
- package/types/components/RichTextEditor/EditorEvent.d.ts +0 -1
- 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 +1 -1
- package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +4 -4
- package/types/components/RichTextEditor/StyledToolbar.d.ts +6 -6
- 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 +1 -1
- package/types/components/RichTextEditor/utils/events.d.ts +0 -0
- package/types/components/RichTextEditor/utils/rnWebView.d.ts +0 -0
- package/types/components/Search/SearchOneLine.d.ts +5 -5
- package/types/components/Search/StyledSearch.d.ts +18 -18
- package/types/components/Search/index.d.ts +1 -1
- package/types/components/Search/utils.d.ts +2 -2
- package/types/components/SectionHeading/StyledHeading.d.ts +7 -7
- package/types/components/SectionHeading/index.d.ts +0 -0
- package/types/components/Select/BaseOptionList.d.ts +1 -1
- package/types/components/Select/Footer.d.ts +0 -0
- package/types/components/Select/MultiSelect/Option.d.ts +2 -2
- package/types/components/Select/MultiSelect/OptionList.d.ts +1 -1
- package/types/components/Select/MultiSelect/index.d.ts +0 -0
- package/types/components/Select/SingleSelect/Option.d.ts +2 -2
- 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 +0 -0
- package/types/components/Select/StyledSelect.d.ts +6 -6
- package/types/components/Select/helpers.d.ts +2 -2
- package/types/components/Select/index.d.ts +0 -0
- package/types/components/Select/types.d.ts +6 -6
- package/types/components/Skeleton/StyledSkeleton.d.ts +6 -6
- package/types/components/Skeleton/index.d.ts +0 -0
- package/types/components/Slider/{Range.d.ts → RangeSlider.d.ts} +1 -1
- package/types/components/Slider/StyledRangeSlider.d.ts +10 -0
- package/types/components/Slider/index.d.ts +2 -2
- package/types/components/Spinner/AnimatedSpinner.d.ts +2 -2
- package/types/components/Spinner/StyledSpinner.d.ts +13 -13
- package/types/components/Spinner/index.d.ts +0 -0
- package/types/components/Success/StyledSuccess.d.ts +19 -19
- package/types/components/Success/index.d.ts +0 -0
- package/types/components/Swipeable/StyledSwipeable.d.ts +3 -3
- package/types/components/Swipeable/SwipeableAction.d.ts +0 -0
- package/types/components/Swipeable/index.d.ts +2 -2
- package/types/components/Switch/SelectorSwitch/Option.d.ts +3 -5
- package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +8 -8
- package/types/components/Switch/SelectorSwitch/index.d.ts +3 -3
- package/types/components/Switch/StyledSwitch.d.ts +5 -5
- package/types/components/Switch/index.d.ts +3 -3
- package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
- package/types/components/Tabs/SceneView.d.ts +3 -3
- package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/ScrollableTabsHeader/hooks/useInitHighlightedAnimation.d.ts +2 -2
- package/types/components/Tabs/ScrollableTabsHeader/hooks/useInitUnderlinedAnimation.d.ts +2 -2
- package/types/components/Tabs/StyledScrollableTabs.d.ts +17 -17
- package/types/components/Tabs/StyledTabs.d.ts +14 -14
- package/types/components/Tabs/TabWithBadge.d.ts +3 -3
- package/types/components/Tabs/index.d.ts +2 -2
- package/types/components/Tabs/useHandlePageScroll.d.ts +1 -1
- 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 +5 -5
- package/types/components/Tag/index.d.ts +0 -0
- package/types/components/TextInput/StyledTextInput.d.ts +28 -28
- package/types/components/TextInput/index.d.ts +16 -16
- package/types/components/TimePicker/StyledTimePicker.d.ts +2 -2
- 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 +18 -18
- 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 +2 -2
- package/types/components/Toast/ToastProvider.d.ts +1 -1
- package/types/components/Toast/index.d.ts +0 -0
- package/types/components/Toast/types.d.ts +2 -2
- package/types/components/Toolbar/StyledToolbar.d.ts +25 -25
- package/types/components/Toolbar/ToolbarGroup.d.ts +0 -0
- package/types/components/Toolbar/ToolbarItem.d.ts +0 -0
- package/types/components/Toolbar/ToolbarMessage.d.ts +4 -4
- package/types/components/Toolbar/index.d.ts +0 -0
- package/types/components/Typography/Body/StyledBody.d.ts +4 -4
- package/types/components/Typography/Caption/StyledCaption.d.ts +3 -3
- package/types/components/Typography/Label/StyledLabel.d.ts +2 -2
- package/types/components/Typography/Text/StyledText.d.ts +6 -6
- package/types/components/Typography/Text/index.d.ts +0 -0
- package/types/components/Typography/Title/StyledTitle.d.ts +4 -4
- package/types/components/Typography/index.d.ts +0 -0
- package/types/components/Typography/types.d.ts +1 -1
- package/types/index.d.ts +2 -1
- package/types/testHelpers/renderWithTheme.d.ts +0 -0
- package/types/testHelpers/utils.d.ts +1 -1
- package/types/theme/ThemeProvider.d.ts +0 -0
- package/types/theme/ThemeSwitcher.d.ts +3 -3
- package/types/theme/components/accordion.d.ts +0 -0
- package/types/theme/components/alert.d.ts +0 -0
- package/types/theme/components/appCue.d.ts +16 -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 +1 -1
- 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 +15 -5
- 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 +1 -1
- 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 +1 -1
- package/types/theme/components/error.d.ts +1 -1
- package/types/theme/components/fab.d.ts +1 -1
- 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 +1 -1
- 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 +6 -0
- package/types/theme/components/spinner.d.ts +0 -0
- package/types/theme/components/success.d.ts +1 -1
- 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 +1 -0
- package/types/theme/components/tag.d.ts +1 -1
- 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 +3 -1
- 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 +3 -3
- 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 +4 -4
- package/types/theme/global/scale.d.ts +1 -1
- package/types/theme/global/shadows.d.ts +1 -1
- 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 +1 -1
- package/types/theme/index.d.ts +0 -0
- package/types/types.d.ts +1 -1
- 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$colon$types.log +0 -0
- package/.turbo/turbo-lint.log +0 -183
- package/.turbo/turbo-publish:npm.log +0 -9
- package/.turbo/turbo-test.log +0 -4726
- package/.turbo/turbo-type-check.log +0 -0
- package/types/components/CompoundSearch/CompoundSearchHandler.d.ts +0 -31
- package/types/components/CompoundSearch/CompoundSearchTextInput.d.ts +0 -60
- package/types/components/CompoundSearch/StyledCompoundSearch.d.ts +0 -40
- package/types/components/CompoundSearch/index.d.ts +0 -8
- package/types/components/CompoundSearch/utils.d.ts +0 -8
- package/types/components/HeroDesignProvider/HeroDesignContext.d.ts +0 -5
- package/types/components/Search/SearchBasic.d.ts +0 -31
- package/types/components/Search/SearchCompound.d.ts +0 -60
- package/types/components/Tabs/ScrollableTabsHeader.d.ts +0 -35
- package/types/theme/components/compoundSearch.d.ts +0 -36
- /package/src/components/Slider/{Single.tsx → SingleSlider.tsx} +0 -0
- /package/src/components/Slider/__tests__/__snapshots__/{Single.spec.tsx.snap → SingleSlider.spec.tsx.snap} +0 -0
- /package/types/components/Slider/{Single.d.ts → SingleSlider.d.ts} +0 -0
|
@@ -1460,6 +1460,214 @@ exports[`Chip renders correctly with variant filled and selected true 1`] = `
|
|
|
1460
1460
|
</View>
|
|
1461
1461
|
`;
|
|
1462
1462
|
|
|
1463
|
+
exports[`Chip renders correctly with variant filter and selected false 1`] = `
|
|
1464
|
+
<View
|
|
1465
|
+
style={
|
|
1466
|
+
{
|
|
1467
|
+
"flex": 1,
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
>
|
|
1471
|
+
<View
|
|
1472
|
+
accessibilityState={
|
|
1473
|
+
{
|
|
1474
|
+
"busy": undefined,
|
|
1475
|
+
"checked": undefined,
|
|
1476
|
+
"disabled": undefined,
|
|
1477
|
+
"expanded": undefined,
|
|
1478
|
+
"selected": undefined,
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
accessibilityValue={
|
|
1482
|
+
{
|
|
1483
|
+
"max": undefined,
|
|
1484
|
+
"min": undefined,
|
|
1485
|
+
"now": undefined,
|
|
1486
|
+
"text": undefined,
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
accessible={true}
|
|
1490
|
+
collapsable={false}
|
|
1491
|
+
focusable={false}
|
|
1492
|
+
onClick={[Function]}
|
|
1493
|
+
onResponderGrant={[Function]}
|
|
1494
|
+
onResponderMove={[Function]}
|
|
1495
|
+
onResponderRelease={[Function]}
|
|
1496
|
+
onResponderTerminate={[Function]}
|
|
1497
|
+
onResponderTerminationRequest={[Function]}
|
|
1498
|
+
onStartShouldSetResponder={[Function]}
|
|
1499
|
+
style={
|
|
1500
|
+
{
|
|
1501
|
+
"alignItems": "center",
|
|
1502
|
+
"alignSelf": "flex-start",
|
|
1503
|
+
"backgroundColor": "#ffffff",
|
|
1504
|
+
"borderColor": "transparent",
|
|
1505
|
+
"borderRadius": 999,
|
|
1506
|
+
"elevation": 3,
|
|
1507
|
+
"flexDirection": "row",
|
|
1508
|
+
"justifyContent": "center",
|
|
1509
|
+
"opacity": 1,
|
|
1510
|
+
"paddingHorizontal": 12,
|
|
1511
|
+
"paddingVertical": 8,
|
|
1512
|
+
"shadowColor": "#001f23",
|
|
1513
|
+
"shadowOffset": {
|
|
1514
|
+
"height": 2,
|
|
1515
|
+
"width": 0,
|
|
1516
|
+
},
|
|
1517
|
+
"shadowOpacity": 0.12,
|
|
1518
|
+
"shadowRadius": 4,
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
testID="chip"
|
|
1522
|
+
>
|
|
1523
|
+
<Text
|
|
1524
|
+
allowFontScaling={false}
|
|
1525
|
+
style={
|
|
1526
|
+
[
|
|
1527
|
+
{
|
|
1528
|
+
"color": "#001f23",
|
|
1529
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
1530
|
+
"fontSize": 14,
|
|
1531
|
+
"letterSpacing": 0.48,
|
|
1532
|
+
"lineHeight": 22,
|
|
1533
|
+
},
|
|
1534
|
+
undefined,
|
|
1535
|
+
]
|
|
1536
|
+
}
|
|
1537
|
+
themeIntent="body"
|
|
1538
|
+
themeTypeface="neutral"
|
|
1539
|
+
themeVariant="small"
|
|
1540
|
+
>
|
|
1541
|
+
Cover my bills
|
|
1542
|
+
</Text>
|
|
1543
|
+
</View>
|
|
1544
|
+
<View
|
|
1545
|
+
pointerEvents="box-none"
|
|
1546
|
+
position="bottom"
|
|
1547
|
+
style={
|
|
1548
|
+
[
|
|
1549
|
+
{
|
|
1550
|
+
"bottom": 0,
|
|
1551
|
+
"elevation": 9999,
|
|
1552
|
+
"flexDirection": "column-reverse",
|
|
1553
|
+
"left": 0,
|
|
1554
|
+
"paddingHorizontal": 24,
|
|
1555
|
+
"paddingVertical": 16,
|
|
1556
|
+
"position": "absolute",
|
|
1557
|
+
"right": 0,
|
|
1558
|
+
"top": 0,
|
|
1559
|
+
},
|
|
1560
|
+
undefined,
|
|
1561
|
+
]
|
|
1562
|
+
}
|
|
1563
|
+
/>
|
|
1564
|
+
</View>
|
|
1565
|
+
`;
|
|
1566
|
+
|
|
1567
|
+
exports[`Chip renders correctly with variant filter and selected true 1`] = `
|
|
1568
|
+
<View
|
|
1569
|
+
style={
|
|
1570
|
+
{
|
|
1571
|
+
"flex": 1,
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
>
|
|
1575
|
+
<View
|
|
1576
|
+
accessibilityState={
|
|
1577
|
+
{
|
|
1578
|
+
"busy": undefined,
|
|
1579
|
+
"checked": undefined,
|
|
1580
|
+
"disabled": undefined,
|
|
1581
|
+
"expanded": undefined,
|
|
1582
|
+
"selected": undefined,
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
accessibilityValue={
|
|
1586
|
+
{
|
|
1587
|
+
"max": undefined,
|
|
1588
|
+
"min": undefined,
|
|
1589
|
+
"now": undefined,
|
|
1590
|
+
"text": undefined,
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
accessible={true}
|
|
1594
|
+
collapsable={false}
|
|
1595
|
+
focusable={false}
|
|
1596
|
+
onClick={[Function]}
|
|
1597
|
+
onResponderGrant={[Function]}
|
|
1598
|
+
onResponderMove={[Function]}
|
|
1599
|
+
onResponderRelease={[Function]}
|
|
1600
|
+
onResponderTerminate={[Function]}
|
|
1601
|
+
onResponderTerminationRequest={[Function]}
|
|
1602
|
+
onStartShouldSetResponder={[Function]}
|
|
1603
|
+
style={
|
|
1604
|
+
{
|
|
1605
|
+
"alignItems": "center",
|
|
1606
|
+
"alignSelf": "flex-start",
|
|
1607
|
+
"backgroundColor": "#ece8ef",
|
|
1608
|
+
"borderColor": "transparent",
|
|
1609
|
+
"borderRadius": 999,
|
|
1610
|
+
"elevation": 3,
|
|
1611
|
+
"flexDirection": "row",
|
|
1612
|
+
"justifyContent": "center",
|
|
1613
|
+
"opacity": 1,
|
|
1614
|
+
"paddingHorizontal": 12,
|
|
1615
|
+
"paddingVertical": 8,
|
|
1616
|
+
"shadowColor": "#001f23",
|
|
1617
|
+
"shadowOffset": {
|
|
1618
|
+
"height": 2,
|
|
1619
|
+
"width": 0,
|
|
1620
|
+
},
|
|
1621
|
+
"shadowOpacity": 0.12,
|
|
1622
|
+
"shadowRadius": 4,
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
testID="chip"
|
|
1626
|
+
>
|
|
1627
|
+
<Text
|
|
1628
|
+
allowFontScaling={false}
|
|
1629
|
+
style={
|
|
1630
|
+
[
|
|
1631
|
+
{
|
|
1632
|
+
"color": "#001f23",
|
|
1633
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
1634
|
+
"fontSize": 14,
|
|
1635
|
+
"letterSpacing": 0.48,
|
|
1636
|
+
"lineHeight": 22,
|
|
1637
|
+
},
|
|
1638
|
+
undefined,
|
|
1639
|
+
]
|
|
1640
|
+
}
|
|
1641
|
+
themeIntent="body"
|
|
1642
|
+
themeTypeface="neutral"
|
|
1643
|
+
themeVariant="small"
|
|
1644
|
+
>
|
|
1645
|
+
Cover my bills
|
|
1646
|
+
</Text>
|
|
1647
|
+
</View>
|
|
1648
|
+
<View
|
|
1649
|
+
pointerEvents="box-none"
|
|
1650
|
+
position="bottom"
|
|
1651
|
+
style={
|
|
1652
|
+
[
|
|
1653
|
+
{
|
|
1654
|
+
"bottom": 0,
|
|
1655
|
+
"elevation": 9999,
|
|
1656
|
+
"flexDirection": "column-reverse",
|
|
1657
|
+
"left": 0,
|
|
1658
|
+
"paddingHorizontal": 24,
|
|
1659
|
+
"paddingVertical": 16,
|
|
1660
|
+
"position": "absolute",
|
|
1661
|
+
"right": 0,
|
|
1662
|
+
"top": 0,
|
|
1663
|
+
},
|
|
1664
|
+
undefined,
|
|
1665
|
+
]
|
|
1666
|
+
}
|
|
1667
|
+
/>
|
|
1668
|
+
</View>
|
|
1669
|
+
`;
|
|
1670
|
+
|
|
1463
1671
|
exports[`Chip renders correctly with variant outlined and selected false 1`] = `
|
|
1464
1672
|
<View
|
|
1465
1673
|
style={
|
|
@@ -1685,3 +1893,229 @@ exports[`Chip renders correctly with variant outlined and selected true 1`] = `
|
|
|
1685
1893
|
/>
|
|
1686
1894
|
</View>
|
|
1687
1895
|
`;
|
|
1896
|
+
|
|
1897
|
+
exports[`Chip renders correctly with variant selection and selected false 1`] = `
|
|
1898
|
+
<View
|
|
1899
|
+
style={
|
|
1900
|
+
{
|
|
1901
|
+
"flex": 1,
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
>
|
|
1905
|
+
<View
|
|
1906
|
+
accessibilityState={
|
|
1907
|
+
{
|
|
1908
|
+
"busy": undefined,
|
|
1909
|
+
"checked": undefined,
|
|
1910
|
+
"disabled": undefined,
|
|
1911
|
+
"expanded": undefined,
|
|
1912
|
+
"selected": undefined,
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
accessibilityValue={
|
|
1916
|
+
{
|
|
1917
|
+
"max": undefined,
|
|
1918
|
+
"min": undefined,
|
|
1919
|
+
"now": undefined,
|
|
1920
|
+
"text": undefined,
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
accessible={true}
|
|
1924
|
+
collapsable={false}
|
|
1925
|
+
focusable={false}
|
|
1926
|
+
onClick={[Function]}
|
|
1927
|
+
onResponderGrant={[Function]}
|
|
1928
|
+
onResponderMove={[Function]}
|
|
1929
|
+
onResponderRelease={[Function]}
|
|
1930
|
+
onResponderTerminate={[Function]}
|
|
1931
|
+
onResponderTerminationRequest={[Function]}
|
|
1932
|
+
onStartShouldSetResponder={[Function]}
|
|
1933
|
+
style={
|
|
1934
|
+
{
|
|
1935
|
+
"alignItems": "center",
|
|
1936
|
+
"alignSelf": "flex-start",
|
|
1937
|
+
"backgroundColor": "#ffffff",
|
|
1938
|
+
"borderColor": "#bfc1c5",
|
|
1939
|
+
"borderRadius": 999,
|
|
1940
|
+
"borderWidth": 1,
|
|
1941
|
+
"flexDirection": "row",
|
|
1942
|
+
"justifyContent": "center",
|
|
1943
|
+
"opacity": 1,
|
|
1944
|
+
"paddingHorizontal": 12,
|
|
1945
|
+
"paddingVertical": 8,
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
testID="chip"
|
|
1949
|
+
>
|
|
1950
|
+
<Text
|
|
1951
|
+
allowFontScaling={false}
|
|
1952
|
+
style={
|
|
1953
|
+
[
|
|
1954
|
+
{
|
|
1955
|
+
"color": "#001f23",
|
|
1956
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
1957
|
+
"fontSize": 14,
|
|
1958
|
+
"letterSpacing": 0.48,
|
|
1959
|
+
"lineHeight": 22,
|
|
1960
|
+
},
|
|
1961
|
+
undefined,
|
|
1962
|
+
]
|
|
1963
|
+
}
|
|
1964
|
+
themeIntent="body"
|
|
1965
|
+
themeTypeface="neutral"
|
|
1966
|
+
themeVariant="small"
|
|
1967
|
+
>
|
|
1968
|
+
Cover my bills
|
|
1969
|
+
</Text>
|
|
1970
|
+
</View>
|
|
1971
|
+
<View
|
|
1972
|
+
pointerEvents="box-none"
|
|
1973
|
+
position="bottom"
|
|
1974
|
+
style={
|
|
1975
|
+
[
|
|
1976
|
+
{
|
|
1977
|
+
"bottom": 0,
|
|
1978
|
+
"elevation": 9999,
|
|
1979
|
+
"flexDirection": "column-reverse",
|
|
1980
|
+
"left": 0,
|
|
1981
|
+
"paddingHorizontal": 24,
|
|
1982
|
+
"paddingVertical": 16,
|
|
1983
|
+
"position": "absolute",
|
|
1984
|
+
"right": 0,
|
|
1985
|
+
"top": 0,
|
|
1986
|
+
},
|
|
1987
|
+
undefined,
|
|
1988
|
+
]
|
|
1989
|
+
}
|
|
1990
|
+
/>
|
|
1991
|
+
</View>
|
|
1992
|
+
`;
|
|
1993
|
+
|
|
1994
|
+
exports[`Chip renders correctly with variant selection and selected true 1`] = `
|
|
1995
|
+
<View
|
|
1996
|
+
style={
|
|
1997
|
+
{
|
|
1998
|
+
"flex": 1,
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
>
|
|
2002
|
+
<View
|
|
2003
|
+
accessibilityState={
|
|
2004
|
+
{
|
|
2005
|
+
"busy": undefined,
|
|
2006
|
+
"checked": undefined,
|
|
2007
|
+
"disabled": undefined,
|
|
2008
|
+
"expanded": undefined,
|
|
2009
|
+
"selected": undefined,
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
accessibilityValue={
|
|
2013
|
+
{
|
|
2014
|
+
"max": undefined,
|
|
2015
|
+
"min": undefined,
|
|
2016
|
+
"now": undefined,
|
|
2017
|
+
"text": undefined,
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
accessible={true}
|
|
2021
|
+
collapsable={false}
|
|
2022
|
+
focusable={false}
|
|
2023
|
+
onClick={[Function]}
|
|
2024
|
+
onResponderGrant={[Function]}
|
|
2025
|
+
onResponderMove={[Function]}
|
|
2026
|
+
onResponderRelease={[Function]}
|
|
2027
|
+
onResponderTerminate={[Function]}
|
|
2028
|
+
onResponderTerminationRequest={[Function]}
|
|
2029
|
+
onStartShouldSetResponder={[Function]}
|
|
2030
|
+
style={
|
|
2031
|
+
{
|
|
2032
|
+
"alignItems": "center",
|
|
2033
|
+
"alignSelf": "flex-start",
|
|
2034
|
+
"backgroundColor": "#e8e9ea",
|
|
2035
|
+
"borderColor": "#001f23",
|
|
2036
|
+
"borderRadius": 999,
|
|
2037
|
+
"borderWidth": 1,
|
|
2038
|
+
"flexDirection": "row",
|
|
2039
|
+
"justifyContent": "center",
|
|
2040
|
+
"opacity": 1,
|
|
2041
|
+
"paddingHorizontal": 12,
|
|
2042
|
+
"paddingVertical": 8,
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
testID="chip"
|
|
2046
|
+
>
|
|
2047
|
+
<Text
|
|
2048
|
+
allowFontScaling={false}
|
|
2049
|
+
style={
|
|
2050
|
+
[
|
|
2051
|
+
{
|
|
2052
|
+
"color": "#001f23",
|
|
2053
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
2054
|
+
"fontSize": 14,
|
|
2055
|
+
"letterSpacing": 0.48,
|
|
2056
|
+
"lineHeight": 22,
|
|
2057
|
+
},
|
|
2058
|
+
undefined,
|
|
2059
|
+
]
|
|
2060
|
+
}
|
|
2061
|
+
themeIntent="body"
|
|
2062
|
+
themeTypeface="neutral"
|
|
2063
|
+
themeVariant="small"
|
|
2064
|
+
>
|
|
2065
|
+
Cover my bills
|
|
2066
|
+
</Text>
|
|
2067
|
+
<View
|
|
2068
|
+
marginLeft="small"
|
|
2069
|
+
style={
|
|
2070
|
+
[
|
|
2071
|
+
{
|
|
2072
|
+
"marginLeft": 8,
|
|
2073
|
+
},
|
|
2074
|
+
undefined,
|
|
2075
|
+
]
|
|
2076
|
+
}
|
|
2077
|
+
>
|
|
2078
|
+
<HeroIcon
|
|
2079
|
+
name="cancel"
|
|
2080
|
+
style={
|
|
2081
|
+
[
|
|
2082
|
+
{
|
|
2083
|
+
"color": "#001f23",
|
|
2084
|
+
"fontSize": 24,
|
|
2085
|
+
},
|
|
2086
|
+
[
|
|
2087
|
+
{
|
|
2088
|
+
"fontSize": 12,
|
|
2089
|
+
},
|
|
2090
|
+
undefined,
|
|
2091
|
+
],
|
|
2092
|
+
]
|
|
2093
|
+
}
|
|
2094
|
+
testID="selected-chip-icon-cancel"
|
|
2095
|
+
themeIntent="text"
|
|
2096
|
+
themeSize="medium"
|
|
2097
|
+
/>
|
|
2098
|
+
</View>
|
|
2099
|
+
</View>
|
|
2100
|
+
<View
|
|
2101
|
+
pointerEvents="box-none"
|
|
2102
|
+
position="bottom"
|
|
2103
|
+
style={
|
|
2104
|
+
[
|
|
2105
|
+
{
|
|
2106
|
+
"bottom": 0,
|
|
2107
|
+
"elevation": 9999,
|
|
2108
|
+
"flexDirection": "column-reverse",
|
|
2109
|
+
"left": 0,
|
|
2110
|
+
"paddingHorizontal": 24,
|
|
2111
|
+
"paddingVertical": 16,
|
|
2112
|
+
"position": "absolute",
|
|
2113
|
+
"right": 0,
|
|
2114
|
+
"top": 0,
|
|
2115
|
+
},
|
|
2116
|
+
undefined,
|
|
2117
|
+
]
|
|
2118
|
+
}
|
|
2119
|
+
/>
|
|
2120
|
+
</View>
|
|
2121
|
+
`;
|
|
@@ -87,6 +87,10 @@ describe('Chip', () => {
|
|
|
87
87
|
${'filled'} | ${false}
|
|
88
88
|
${'outlined'} | ${true}
|
|
89
89
|
${'outlined'} | ${false}
|
|
90
|
+
${'filter'} | ${true}
|
|
91
|
+
${'filter'} | ${false}
|
|
92
|
+
${'selection'} | ${true}
|
|
93
|
+
${'selection'} | ${false}
|
|
90
94
|
${'compact'} | ${true}
|
|
91
95
|
${'compact'} | ${false}
|
|
92
96
|
${'compact-outlined'} | ${true}
|
|
@@ -4,6 +4,7 @@ import Box from '../Box';
|
|
|
4
4
|
import { IconName } from '../Icon';
|
|
5
5
|
import Typography from '../Typography';
|
|
6
6
|
import { StyledChipIcon, StyledChipWrapper } from './StyledChip';
|
|
7
|
+
import { useDeprecation } from '../../utils/hooks';
|
|
7
8
|
|
|
8
9
|
export interface ChipProps extends ViewProps {
|
|
9
10
|
/**
|
|
@@ -11,9 +12,15 @@ export interface ChipProps extends ViewProps {
|
|
|
11
12
|
*/
|
|
12
13
|
label: string | ReactNode;
|
|
13
14
|
/**
|
|
14
|
-
* Variant of the chip.
|
|
15
|
+
* Variant of the chip. `outlined` and `filled` are deprecated.
|
|
15
16
|
*/
|
|
16
|
-
variant?:
|
|
17
|
+
variant?:
|
|
18
|
+
| 'selection'
|
|
19
|
+
| 'filter'
|
|
20
|
+
| 'compact'
|
|
21
|
+
| 'compact-outlined'
|
|
22
|
+
| 'outlined'
|
|
23
|
+
| 'filled';
|
|
17
24
|
/**
|
|
18
25
|
* Whether the chip is selected.
|
|
19
26
|
*/
|
|
@@ -40,17 +47,37 @@ const getChipLabel = (label: string | ReactNode) => {
|
|
|
40
47
|
return label;
|
|
41
48
|
};
|
|
42
49
|
|
|
50
|
+
const getChipVariant = (variant: ChipProps['variant'] = 'selection') => {
|
|
51
|
+
switch (variant) {
|
|
52
|
+
case 'selection':
|
|
53
|
+
case 'filter':
|
|
54
|
+
case 'compact':
|
|
55
|
+
case 'compact-outlined':
|
|
56
|
+
return variant;
|
|
57
|
+
case 'outlined':
|
|
58
|
+
return 'selection';
|
|
59
|
+
case 'filled':
|
|
60
|
+
return 'filter';
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
43
64
|
const Chip = ({
|
|
44
65
|
label,
|
|
45
|
-
variant = '
|
|
66
|
+
variant = 'selection',
|
|
46
67
|
selected = false,
|
|
47
68
|
icon,
|
|
48
69
|
onPress,
|
|
49
70
|
showSelectedIcon = true,
|
|
50
71
|
...otherProps
|
|
51
72
|
}: ChipProps) => {
|
|
73
|
+
useDeprecation(
|
|
74
|
+
'Chip variant `outlined` and `filled` are deprecated.',
|
|
75
|
+
variant === 'outlined' || variant === 'filled'
|
|
76
|
+
);
|
|
77
|
+
const renamedVariant = getChipVariant(variant);
|
|
78
|
+
|
|
52
79
|
const shouldShowSelectedIcon =
|
|
53
|
-
(
|
|
80
|
+
(renamedVariant === 'selection' || renamedVariant === 'compact-outlined') &&
|
|
54
81
|
selected &&
|
|
55
82
|
showSelectedIcon;
|
|
56
83
|
|
|
@@ -59,7 +86,7 @@ const Chip = ({
|
|
|
59
86
|
return (
|
|
60
87
|
<StyledChipWrapper
|
|
61
88
|
onPress={onPress}
|
|
62
|
-
themeVariant={
|
|
89
|
+
themeVariant={renamedVariant}
|
|
63
90
|
themeSelected={selected}
|
|
64
91
|
{...otherProps}
|
|
65
92
|
>
|
|
@@ -3,6 +3,7 @@ import MultiSlider from '@ptomasroos/react-native-multi-slider';
|
|
|
3
3
|
|
|
4
4
|
import { LayoutChangeEvent, StyleProp, View, ViewStyle } from 'react-native';
|
|
5
5
|
import { useTheme } from '../../theme';
|
|
6
|
+
import { StyledMarker } from './StyledRangeSlider';
|
|
6
7
|
|
|
7
8
|
export type SliderRangeValue = {
|
|
8
9
|
start: number;
|
|
@@ -98,27 +99,32 @@ const Slider = ({
|
|
|
98
99
|
|
|
99
100
|
const { trackHeight } = theme.__hd__.slider.sizes;
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
// Define styles for disabled and enabled states
|
|
103
|
+
const disabledStyles = {
|
|
104
|
+
track: {
|
|
105
|
+
backgroundColor: disabledTrackBackground,
|
|
104
106
|
height: trackHeight,
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
},
|
|
108
|
+
selected: {
|
|
109
|
+
backgroundColor: disabledThumbTint,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
109
112
|
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
backgroundColor:
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
113
|
+
const enabledStyles = {
|
|
114
|
+
track: {
|
|
115
|
+
backgroundColor: trackBackground,
|
|
116
|
+
height: trackHeight,
|
|
117
|
+
},
|
|
118
|
+
selected: {
|
|
119
|
+
backgroundColor: thumbTint,
|
|
120
|
+
},
|
|
121
|
+
};
|
|
116
122
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
// Use styles based on the `disabled` state
|
|
124
|
+
const trackStyle = disabled ? disabledStyles.track : enabledStyles.track;
|
|
125
|
+
const selectedStyle = disabled
|
|
126
|
+
? disabledStyles.selected
|
|
127
|
+
: enabledStyles.selected;
|
|
122
128
|
|
|
123
129
|
const handleOnValueChangeStart = useCallback(() => {
|
|
124
130
|
if (onSlidingStart) {
|
|
@@ -145,6 +151,10 @@ const Slider = ({
|
|
|
145
151
|
});
|
|
146
152
|
}, []);
|
|
147
153
|
|
|
154
|
+
const CustomMarker = useMemo(() => {
|
|
155
|
+
return () => <StyledMarker themeDisabled={disabled} />;
|
|
156
|
+
}, [disabled]);
|
|
157
|
+
|
|
148
158
|
return (
|
|
149
159
|
<View
|
|
150
160
|
onLayout={onLayoutCallback}
|
|
@@ -167,8 +177,8 @@ const Slider = ({
|
|
|
167
177
|
enabledTwo={!disabled}
|
|
168
178
|
allowOverlap={allowOverlap}
|
|
169
179
|
trackStyle={trackStyle}
|
|
170
|
-
markerStyle={makerStyle}
|
|
171
180
|
selectedStyle={selectedStyle}
|
|
181
|
+
customMarker={CustomMarker}
|
|
172
182
|
/>
|
|
173
183
|
</View>
|
|
174
184
|
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled from '@emotion/native';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
const StyledMarker = styled(View)<{ themeDisabled: boolean }>(
|
|
5
|
+
({ themeDisabled, theme }) => ({
|
|
6
|
+
height: theme.__hd__.slider.sizes.markerHeight,
|
|
7
|
+
width: theme.__hd__.slider.sizes.markerWidth,
|
|
8
|
+
borderRadius: theme.__hd__.slider.radii.marker,
|
|
9
|
+
backgroundColor: themeDisabled
|
|
10
|
+
? theme.__hd__.slider.colors.disabledThumbTint
|
|
11
|
+
: theme.__hd__.slider.colors.thumbTint,
|
|
12
|
+
...theme.__hd__.slider.shadows.marker,
|
|
13
|
+
})
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export { StyledMarker };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { fireEvent } from '@testing-library/react-native';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
4
|
-
import RangeSlider from '../
|
|
4
|
+
import RangeSlider from '../RangeSlider';
|
|
5
|
+
import { StyledMarker } from '../StyledRangeSlider';
|
|
5
6
|
|
|
6
7
|
describe('Slider.Range', () => {
|
|
7
8
|
it('renders correctly by default', async () => {
|
|
@@ -24,11 +25,6 @@ describe('Slider.Range', () => {
|
|
|
24
25
|
});
|
|
25
26
|
expect(toJSON()).toMatchSnapshot();
|
|
26
27
|
|
|
27
|
-
// verify style
|
|
28
|
-
expect(nativeComponent.props['markerStyle'].backgroundColor).toBe(
|
|
29
|
-
'#401960'
|
|
30
|
-
);
|
|
31
|
-
|
|
32
28
|
expect(nativeComponent.props['selectedStyle'].backgroundColor).toBe(
|
|
33
29
|
'#401960'
|
|
34
30
|
);
|
|
@@ -65,9 +61,6 @@ describe('Slider.Range', () => {
|
|
|
65
61
|
|
|
66
62
|
expect(toJSON()).toMatchSnapshot();
|
|
67
63
|
const nativeComponent = getByTestId('native-multi-slider');
|
|
68
|
-
expect(nativeComponent.props['markerStyle'].backgroundColor).toBe(
|
|
69
|
-
'#bfc1c5'
|
|
70
|
-
);
|
|
71
64
|
|
|
72
65
|
expect(nativeComponent.props['selectedStyle'].backgroundColor).toBe(
|
|
73
66
|
'#bfc1c5'
|
|
@@ -103,3 +96,24 @@ describe('Slider.Range', () => {
|
|
|
103
96
|
expect(onSlidingCompleteSpy).toHaveBeenCalledWith({ start: 2, end: 5 });
|
|
104
97
|
});
|
|
105
98
|
});
|
|
99
|
+
|
|
100
|
+
describe('StyledMarker', () => {
|
|
101
|
+
it.each`
|
|
102
|
+
themeDisabled | expectedBackgroundColor
|
|
103
|
+
${false} | ${'#401960'}
|
|
104
|
+
${true} | ${'#bfc1c5'}
|
|
105
|
+
`(
|
|
106
|
+
'renders correctly when disabled is $themeDisabled',
|
|
107
|
+
({ themeDisabled, expectedBackgroundColor }) => {
|
|
108
|
+
const { getByTestId, toJSON } = renderWithTheme(
|
|
109
|
+
<StyledMarker testID="marker" themeDisabled={themeDisabled} />
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
expect(toJSON()).toMatchSnapshot();
|
|
113
|
+
|
|
114
|
+
expect(getByTestId('marker')).toHaveStyle({
|
|
115
|
+
backgroundColor: expectedBackgroundColor,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
});
|