@hero-design/rn 8.113.0 → 8.114.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/CHANGELOG.md +23 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +674 -439
- package/package.json +4 -4
- package/src/components/Alert/index.tsx +1 -1
- package/src/components/Badge/Count.tsx +2 -2
- package/src/components/Badge/Status.tsx +2 -2
- package/src/components/Badge/index.tsx +2 -1
- package/src/components/BottomNavigation/StyledBottomNavigation.tsx +1 -1
- package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +32 -36
- package/src/components/BottomNavigation/__tests__/index.spec.tsx +17 -8
- package/src/components/BottomNavigation/index.tsx +4 -5
- package/src/components/BottomSheet/ScrollView.tsx +2 -1
- package/src/components/BottomSheet/index.tsx +1 -1
- package/src/components/Button/Button.tsx +2 -2
- package/src/components/Calendar/__tests__/CalendarRange.spec.tsx +1 -1
- package/src/components/Calendar/__tests__/index.spec.tsx +4 -9
- package/src/components/Card/DataCard/index.tsx +2 -2
- package/src/components/Card/index.tsx +2 -2
- package/src/components/Carousel/index.tsx +2 -2
- package/src/components/DatePicker/Dialog/__tests__/IOSDialog.spec.tsx +0 -6
- package/src/components/DatePicker/__tests__/DatePickerCalendar.spec.tsx +2 -10
- package/src/components/DatePicker/__tests__/DatePickerIOS.spec.tsx +27 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +176 -728
- package/src/components/Drawer/DragableDrawer/index.tsx +2 -2
- package/src/components/Drawer/index.tsx +2 -2
- package/src/components/FAB/__tests__/index.spec.tsx +33 -8
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +3 -0
- package/src/components/Image/index.tsx +2 -1
- package/src/components/List/BasicListItem.tsx +2 -1
- package/src/components/List/ListItem.tsx +1 -1
- package/src/components/MapPin/Focussed.tsx +2 -1
- package/src/components/MapPin/index.tsx +2 -1
- package/src/components/Modal/__tests__/index.spec.tsx +46 -0
- package/src/components/Modal/index.tsx +121 -149
- package/src/components/Progress/ProgressBar.tsx +2 -1
- package/src/components/Progress/ProgressCircle.tsx +2 -1
- package/src/components/Progress/SegmentedBar/Legend.tsx +39 -0
- package/src/components/Progress/SegmentedBar/StyledLegend.tsx +32 -0
- package/src/components/Progress/SegmentedBar/StyledSegmentedBar.tsx +30 -0
- package/src/components/Progress/SegmentedBar/__tests__/index.spec.tsx +115 -0
- package/src/components/Progress/SegmentedBar/__tests__/utils.spec.tsx +24 -0
- package/src/components/Progress/SegmentedBar/constants.ts +8 -0
- package/src/components/Progress/SegmentedBar/hooks/validation.ts +71 -0
- package/src/components/Progress/SegmentedBar/index.tsx +153 -0
- package/src/components/Progress/SegmentedBar/types.ts +62 -0
- package/src/components/Progress/SegmentedBar/utils.ts +16 -0
- package/src/components/Progress/index.tsx +2 -0
- package/src/components/RichTextEditor/MentionList.tsx +2 -1
- package/src/components/Tabs/ScrollableTabs.tsx +30 -9
- package/src/components/Tabs/ScrollableTabsHeader/ScrollableTabsHeader.tsx +5 -7
- package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +74 -38
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +105 -129
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +30 -42
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +0 -683
- package/src/components/Tabs/__tests__/index.spec.tsx +37 -25
- package/src/components/Tabs/index.tsx +4 -2
- package/src/components/Tag/index.tsx +1 -1
- package/src/components/TimePicker/__tests__/TimePickerIOS.spec.tsx +0 -6
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +237 -282
- package/src/components/Toast/Toast.tsx +2 -1
- package/src/components/Toolbar/ToolbarItem.tsx +2 -1
- package/src/components/Typography/Label/index.tsx +1 -1
- package/src/testHelpers/renderWithTheme.tsx +2 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +9 -1
- package/src/theme/components/bottomNavigation.ts +1 -1
- package/src/theme/components/progress.ts +8 -0
- package/src/types.ts +2 -0
- package/src/utils/helpers.ts +6 -0
- package/.turbo/turbo-build.log +0 -17
- package/es/index.js +0 -48768
- package/locales/en_AU.js +0 -10
- package/locales/en_AU.mjs +0 -8
- package/locales/en_CA.js +0 -10
- package/locales/en_CA.mjs +0 -8
- package/locales/index.js +0 -11
- package/locales/index.mjs +0 -9
- package/locales/types.js +0 -2
- package/locales/types.mjs +0 -1
- package/types/components/Accordion/AccordionItem.d.ts +0 -15
- package/types/components/Accordion/StyledAccordion.d.ts +0 -30
- package/types/components/Accordion/index.d.ts +0 -43
- package/types/components/Alert/StyledAlert.d.ts +0 -51
- package/types/components/Alert/index.d.ts +0 -66
- package/types/components/AnimatedScroller/AnimatedFAB.d.ts +0 -12
- package/types/components/AnimatedScroller/AnimatedScrollable.d.ts +0 -16
- package/types/components/AnimatedScroller/FlatListWithFAB.d.ts +0 -12
- package/types/components/AnimatedScroller/ScrollViewWithFAB.d.ts +0 -12
- package/types/components/AnimatedScroller/SectionListWithFAB.d.ts +0 -12
- package/types/components/AnimatedScroller/index.d.ts +0 -4
- package/types/components/AppCue/StyledAppCue.d.ts +0 -20
- package/types/components/AppCue/__tests__/StyledAppCue.d.ts +0 -1
- package/types/components/AppCue/index.d.ts +0 -21
- package/types/components/AppCue/utils.d.ts +0 -66
- package/types/components/Attachment/StyledAttachment.d.ts +0 -26
- package/types/components/Attachment/index.d.ts +0 -38
- package/types/components/Avatar/Avatar.d.ts +0 -34
- package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +0 -30
- package/types/components/Avatar/AvatarStack/index.d.ts +0 -36
- package/types/components/Avatar/AvatarStack/utils.d.ts +0 -4
- package/types/components/Avatar/StyledAvatar.d.ts +0 -32
- package/types/components/Avatar/index.d.ts +0 -6
- package/types/components/Badge/Count.d.ts +0 -27
- package/types/components/Badge/Status.d.ts +0 -23
- package/types/components/Badge/StyledBadge.d.ts +0 -43
- package/types/components/Badge/constants.d.ts +0 -1
- package/types/components/Badge/index.d.ts +0 -7
- package/types/components/Badge/types.d.ts +0 -53
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -51
- package/types/components/BottomNavigation/index.d.ts +0 -45
- package/types/components/BottomSheet/BottomSheetContext.d.ts +0 -5
- package/types/components/BottomSheet/Footer.d.ts +0 -7
- package/types/components/BottomSheet/Header.d.ts +0 -10
- package/types/components/BottomSheet/ScrollView.d.ts +0 -5
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -59
- package/types/components/BottomSheet/index.d.ts +0 -74
- package/types/components/Box/StyledBox.d.ts +0 -10
- package/types/components/Box/config.d.ts +0 -174
- package/types/components/Box/index.d.ts +0 -6
- package/types/components/Box/types.d.ts +0 -31
- package/types/components/Button/Button.d.ts +0 -64
- package/types/components/Button/IconButton.d.ts +0 -39
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -19
- package/types/components/Button/LoadingIndicator/index.d.ts +0 -27
- package/types/components/Button/StyledButton.d.ts +0 -61
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +0 -15
- package/types/components/Button/UtilityButton/index.d.ts +0 -24
- package/types/components/Button/index.d.ts +0 -10
- package/types/components/Calendar/CalendarRange.d.ts +0 -11
- package/types/components/Calendar/CalendarRangeConnector.d.ts +0 -11
- package/types/components/Calendar/CalendarRowItem.d.ts +0 -13
- package/types/components/Calendar/StyledCalendar.d.ts +0 -61
- package/types/components/Calendar/constants.d.ts +0 -4
- package/types/components/Calendar/helpers.d.ts +0 -35
- package/types/components/Calendar/index.d.ts +0 -9
- package/types/components/Calendar/shared/hooks/useCalendarLayout.d.ts +0 -8
- package/types/components/Calendar/types.d.ts +0 -58
- package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -22
- package/types/components/Card/DataCard/index.d.ts +0 -22
- package/types/components/Card/StyledCard.d.ts +0 -11
- package/types/components/Card/index.d.ts +0 -32
- package/types/components/Carousel/CardCarousel.d.ts +0 -46
- package/types/components/Carousel/CarouselItem.d.ts +0 -7
- package/types/components/Carousel/StyledCardCarousel.d.ts +0 -27
- package/types/components/Carousel/StyledCarousel.d.ts +0 -55
- package/types/components/Carousel/contants.d.ts +0 -2
- package/types/components/Carousel/index.d.ts +0 -46
- package/types/components/Carousel/types.d.ts +0 -14
- package/types/components/Chart/ChartSelect/StyledChartSelect.d.ts +0 -8
- package/types/components/Chart/ChartSelect/index.d.ts +0 -63
- package/types/components/Chart/ColumnChart/ColumnChartContent.d.ts +0 -29
- package/types/components/Chart/ColumnChart/Segment.d.ts +0 -14
- package/types/components/Chart/ColumnChart/StackedSegment.d.ts +0 -32
- package/types/components/Chart/ColumnChart/StyledColumnChart.d.ts +0 -8
- package/types/components/Chart/ColumnChart/index.d.ts +0 -86
- package/types/components/Chart/Line/Line.d.ts +0 -23
- package/types/components/Chart/Line/index.d.ts +0 -41
- package/types/components/Chart/StyledChart.d.ts +0 -9
- package/types/components/Chart/index.d.ts +0 -6
- package/types/components/Chart/shared/AxisLabel.d.ts +0 -7
- package/types/components/Chart/shared/ChartFrame.d.ts +0 -30
- package/types/components/Chart/shared/ChartHeader.d.ts +0 -8
- package/types/components/Chart/shared/EmptyState.d.ts +0 -8
- package/types/components/Chart/shared/XAxis.d.ts +0 -8
- package/types/components/Chart/shared/XAxisGrid.d.ts +0 -8
- package/types/components/Chart/shared/YAxis.d.ts +0 -10
- package/types/components/Chart/shared/YAxisGrid.d.ts +0 -10
- package/types/components/Chart/shared/constants.d.ts +0 -4
- package/types/components/Chart/shared/hooks/useColorScale.d.ts +0 -7
- package/types/components/Chart/shared/hooks/useCustomColor.d.ts +0 -22
- package/types/components/Chart/shared/hooks/useGenerateTicks.d.ts +0 -6
- package/types/components/Chart/shared/hooks/useScaleBandX.d.ts +0 -7
- package/types/components/Chart/shared/hooks/useScaleLinearY.d.ts +0 -8
- package/types/components/Chart/shared/niceNumbers.d.ts +0 -12
- package/types/components/Chart/shared/utils.d.ts +0 -11
- package/types/components/Chart/types.d.ts +0 -91
- package/types/components/Checkbox/DefaultCheckBox.d.ts +0 -40
- package/types/components/Checkbox/InlineCheckBox.d.ts +0 -38
- package/types/components/Checkbox/StyledDefaultCheckBox.d.ts +0 -33
- package/types/components/Checkbox/StyledInlineCheckBox.d.ts +0 -45
- package/types/components/Checkbox/index.d.ts +0 -6
- package/types/components/Checkbox/utils.d.ts +0 -7
- package/types/components/Chip/StyledChip.d.ts +0 -13
- package/types/components/Chip/index.d.ts +0 -43
- package/types/components/Collapse/StyledCollapse.d.ts +0 -23
- package/types/components/Collapse/index.d.ts +0 -20
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -8
- package/types/components/ContentNavigator/index.d.ts +0 -43
- package/types/components/DatePicker/DatePicker.d.ts +0 -4
- package/types/components/DatePicker/DatePickerAndroid.d.ts +0 -7
- package/types/components/DatePicker/DatePickerCalendar.d.ts +0 -4
- package/types/components/DatePicker/DatePickerIOS.d.ts +0 -7
- package/types/components/DatePicker/Dialog/AndroidDialog.d.ts +0 -5
- package/types/components/DatePicker/Dialog/IOSDialog.d.ts +0 -4
- package/types/components/DatePicker/Dialog/type.d.ts +0 -50
- package/types/components/DatePicker/Dialog.d.ts +0 -4
- package/types/components/DatePicker/StyledDatePicker.d.ts +0 -16
- package/types/components/DatePicker/hooks/useCalculateDate.d.ts +0 -4
- package/types/components/DatePicker/hooks/useFormatDate.d.ts +0 -10
- package/types/components/DatePicker/hooks/utils.d.ts +0 -6
- package/types/components/DatePicker/index.d.ts +0 -6
- package/types/components/DatePicker/index.internal.d.ts +0 -7
- package/types/components/DatePicker/types.d.ts +0 -109
- package/types/components/Divider/StyledDivider.d.ts +0 -12
- package/types/components/Divider/index.d.ts +0 -22
- package/types/components/Drawer/DragableDrawer/helpers.d.ts +0 -8
- package/types/components/Drawer/DragableDrawer/index.d.ts +0 -33
- package/types/components/Drawer/StyledDrawer.d.ts +0 -49
- package/types/components/Drawer/index.d.ts +0 -27
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -18
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -31
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -15
- package/types/components/FAB/ActionGroup/index.d.ts +0 -55
- package/types/components/FAB/AnimatedFABIcon.d.ts +0 -7
- package/types/components/FAB/FAB.d.ts +0 -40
- package/types/components/FAB/Pair/StyledFAB.d.ts +0 -12
- package/types/components/FAB/Pair/index.d.ts +0 -16
- package/types/components/FAB/StyledFAB.d.ts +0 -22
- package/types/components/FAB/index.d.ts +0 -5
- package/types/components/FilterTrigger/StyledFilterTrigger.d.ts +0 -20
- package/types/components/FilterTrigger/index.d.ts +0 -39
- package/types/components/FloatingIsland/StyledFloatingIsland.d.ts +0 -19
- package/types/components/FloatingIsland/index.d.ts +0 -24
- package/types/components/HeroDesignProvider/index.d.ts +0 -8
- package/types/components/Icon/AnimatedIcon.d.ts +0 -6
- package/types/components/Icon/HeroIcon/index.d.ts +0 -12
- package/types/components/Icon/IconList.d.ts +0 -2
- package/types/components/Icon/index.d.ts +0 -37
- package/types/components/Icon/utils.d.ts +0 -3
- package/types/components/Illustration/BaseSvg.d.ts +0 -8
- package/types/components/Illustration/assets/Add.d.ts +0 -4
- package/types/components/Illustration/assets/AllInOneSketch.d.ts +0 -4
- package/types/components/Illustration/assets/Boom.d.ts +0 -4
- package/types/components/Illustration/assets/Build.d.ts +0 -4
- package/types/components/Illustration/assets/CelebrationSketch.d.ts +0 -4
- package/types/components/Illustration/assets/Clock.d.ts +0 -4
- package/types/components/Illustration/assets/Confetti.d.ts +0 -4
- package/types/components/Illustration/assets/Connections.d.ts +0 -4
- package/types/components/Illustration/assets/DiySketch.d.ts +0 -4
- package/types/components/Illustration/assets/Error.d.ts +0 -4
- package/types/components/Illustration/assets/ErrorSketch.d.ts +0 -4
- package/types/components/Illustration/assets/FreedomSketch.d.ts +0 -4
- package/types/components/Illustration/assets/GrowingSketch.d.ts +0 -4
- package/types/components/Illustration/assets/Info.d.ts +0 -4
- package/types/components/Illustration/assets/InstantSketch.d.ts +0 -4
- package/types/components/Illustration/assets/LiftSketch.d.ts +0 -4
- package/types/components/Illustration/assets/List.d.ts +0 -4
- package/types/components/Illustration/assets/Location.d.ts +0 -4
- package/types/components/Illustration/assets/Lock.d.ts +0 -4
- package/types/components/Illustration/assets/Merge.d.ts +0 -4
- package/types/components/Illustration/assets/NoResult.d.ts +0 -4
- package/types/components/Illustration/assets/Notifications.d.ts +0 -4
- package/types/components/Illustration/assets/OnDemandSketch.d.ts +0 -4
- package/types/components/Illustration/assets/ProcessingSketch.d.ts +0 -4
- package/types/components/Illustration/assets/RemoteJobsSketch.d.ts +0 -4
- package/types/components/Illustration/assets/RewardSketch.d.ts +0 -4
- package/types/components/Illustration/assets/Search.d.ts +0 -4
- package/types/components/Illustration/assets/SearchSketch.d.ts +0 -4
- package/types/components/Illustration/assets/SecuritySketch.d.ts +0 -4
- package/types/components/Illustration/assets/SentSketch.d.ts +0 -4
- package/types/components/Illustration/assets/SpeedSketch.d.ts +0 -4
- package/types/components/Illustration/assets/Star.d.ts +0 -4
- package/types/components/Illustration/assets/Success.d.ts +0 -4
- package/types/components/Illustration/assets/SuperchargeSketch.d.ts +0 -4
- package/types/components/Illustration/assets/Unlock.d.ts +0 -4
- package/types/components/Illustration/assets/UnlockSketch.d.ts +0 -4
- package/types/components/Illustration/assets/User.d.ts +0 -4
- package/types/components/Illustration/assets/WorkflowSketch.d.ts +0 -4
- package/types/components/Illustration/constants.d.ts +0 -1
- package/types/components/Illustration/hooks/useMonoColor.d.ts +0 -5
- package/types/components/Illustration/illustrations.d.ts +0 -42
- package/types/components/Illustration/index.d.ts +0 -29
- package/types/components/Illustration/types.d.ts +0 -7
- package/types/components/Image/index.d.ts +0 -20
- package/types/components/List/BasicListItem.d.ts +0 -43
- package/types/components/List/ListItem.d.ts +0 -52
- package/types/components/List/StyledBasicListItem.d.ts +0 -27
- package/types/components/List/StyledListItem.d.ts +0 -49
- package/types/components/List/index.d.ts +0 -8
- package/types/components/LocaleProvider/__tests__/utils.specs.d.ts +0 -1
- package/types/components/LocaleProvider/context.d.ts +0 -3
- package/types/components/LocaleProvider/hooks.d.ts +0 -5
- package/types/components/LocaleProvider/index.d.ts +0 -7
- package/types/components/LocaleProvider/utils.d.ts +0 -3
- package/types/components/MapPin/Focussed.d.ts +0 -13
- package/types/components/MapPin/StyledMapPin.d.ts +0 -41
- package/types/components/MapPin/index.d.ts +0 -5
- package/types/components/MapPin/types.d.ts +0 -38
- package/types/components/Modal/index.d.ts +0 -38
- package/types/components/PageControl/StyledPageControl.d.ts +0 -12
- package/types/components/PageControl/index.d.ts +0 -22
- package/types/components/PinInput/PinCell.d.ts +0 -9
- package/types/components/PinInput/StyledPinInput.d.ts +0 -67
- package/types/components/PinInput/index.d.ts +0 -73
- package/types/components/Portal/PortalHost.d.ts +0 -5
- package/types/components/Portal/PortalProvider.d.ts +0 -7
- package/types/components/Portal/constants.d.ts +0 -8
- package/types/components/Portal/contexts.d.ts +0 -9
- package/types/components/Portal/index.d.ts +0 -19
- package/types/components/Portal/reducer.d.ts +0 -5
- package/types/components/Portal/types.d.ts +0 -23
- package/types/components/Portal/usePortal.d.ts +0 -8
- package/types/components/Portal/usePortalState.d.ts +0 -1
- package/types/components/Progress/ProgressBar.d.ts +0 -18
- package/types/components/Progress/ProgressCircle.d.ts +0 -20
- package/types/components/Progress/ProgressStep.d.ts +0 -20
- package/types/components/Progress/StyledProgressBar.d.ts +0 -18
- package/types/components/Progress/StyledProgressCircle.d.ts +0 -15
- package/types/components/Progress/StyledStep.d.ts +0 -23
- package/types/components/Progress/__tests__/index.spec.d.ts +0 -1
- package/types/components/Progress/constants.d.ts +0 -15
- package/types/components/Progress/index.d.ts +0 -6
- package/types/components/Progress/types.d.ts +0 -1
- package/types/components/Radio/Radio.d.ts +0 -43
- package/types/components/Radio/RadioGroup.d.ts +0 -40
- package/types/components/Radio/StyledRadio.d.ts +0 -30
- package/types/components/Radio/index.d.ts +0 -4
- package/types/components/Radio/types.d.ts +0 -10
- package/types/components/Rate/StyledRate.d.ts +0 -10
- package/types/components/Rate/index.d.ts +0 -29
- package/types/components/RefreshControl/index.d.ts +0 -5
- package/types/components/RichTextEditor/EditorEvent.d.ts +0 -3
- package/types/components/RichTextEditor/EditorToolbar.d.ts +0 -18
- package/types/components/RichTextEditor/MentionList.d.ts +0 -17
- package/types/components/RichTextEditor/RichTextEditor.d.ts +0 -27
- package/types/components/RichTextEditor/RichTextEditorInput.d.ts +0 -69
- package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -7
- package/types/components/RichTextEditor/StyledToolbar.d.ts +0 -19
- package/types/components/RichTextEditor/__mocks__/heroEditorApp.d.ts +0 -2
- package/types/components/RichTextEditor/constants.d.ts +0 -17
- package/types/components/RichTextEditor/heroEditorApp.d.ts +0 -2
- package/types/components/RichTextEditor/hooks/useRichTextEditorEvents.d.ts +0 -36
- package/types/components/RichTextEditor/index.d.ts +0 -71
- package/types/components/RichTextEditor/types.d.ts +0 -2
- package/types/components/RichTextEditor/utils/events.d.ts +0 -7
- package/types/components/RichTextEditor/utils/rnWebView.d.ts +0 -7
- package/types/components/Search/SearchOneLine.d.ts +0 -73
- package/types/components/Search/SearchSuffixIcon.d.ts +0 -24
- package/types/components/Search/SearchTwoLine.d.ts +0 -40
- package/types/components/Search/StyledSearch.d.ts +0 -49
- package/types/components/Search/index.d.ts +0 -10
- package/types/components/Search/utils.d.ts +0 -8
- package/types/components/SectionHeading/StyledHeading.d.ts +0 -23
- package/types/components/SectionHeading/index.d.ts +0 -45
- package/types/components/SegmentedControl/SegmentedItem.d.ts +0 -18
- package/types/components/SegmentedControl/StyledSegmentedControl.d.ts +0 -26
- package/types/components/SegmentedControl/index.d.ts +0 -31
- package/types/components/SegmentedControl/types.d.ts +0 -43
- package/types/components/Select/BaseOptionList.d.ts +0 -8
- package/types/components/Select/Footer.d.ts +0 -6
- package/types/components/Select/MultiSelect/Option.d.ts +0 -10
- package/types/components/Select/MultiSelect/OptionList.d.ts +0 -9
- package/types/components/Select/MultiSelect/index.d.ts +0 -35
- package/types/components/Select/MultiSelect/utils.d.ts +0 -2
- package/types/components/Select/SingleSelect/Option.d.ts +0 -10
- package/types/components/Select/SingleSelect/OptionList.d.ts +0 -11
- package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +0 -2
- package/types/components/Select/SingleSelect/index.d.ts +0 -28
- package/types/components/Select/StyledSelect.d.ts +0 -28
- package/types/components/Select/helpers.d.ts +0 -10
- package/types/components/Select/index.d.ts +0 -10
- package/types/components/Select/index.internal.d.ts +0 -21
- package/types/components/Select/types.d.ts +0 -88
- package/types/components/Skeleton/StyledSkeleton.d.ts +0 -16
- package/types/components/Skeleton/index.d.ts +0 -14
- package/types/components/Slider/RangeSlider.d.ts +0 -60
- package/types/components/Slider/SingleSlider.d.ts +0 -53
- package/types/components/Slider/StyledRangeSlider.d.ts +0 -10
- package/types/components/Slider/constants.d.ts +0 -3
- package/types/components/Slider/index.d.ts +0 -8
- package/types/components/Spinner/AnimatedSpinner.d.ts +0 -6
- package/types/components/Spinner/StyledSpinner.d.ts +0 -34
- package/types/components/Spinner/index.d.ts +0 -18
- package/types/components/StatusScreens/Empty/StyledEmpty.d.ts +0 -27
- package/types/components/StatusScreens/Empty/index.d.ts +0 -38
- package/types/components/StatusScreens/Error/StyledError.d.ts +0 -59
- package/types/components/StatusScreens/Error/index.d.ts +0 -62
- package/types/components/StatusScreens/Success/StyledSuccess.d.ts +0 -59
- package/types/components/StatusScreens/Success/index.d.ts +0 -56
- package/types/components/Swipeable/StyledSwipeable.d.ts +0 -7
- package/types/components/Swipeable/SwipeableAction.d.ts +0 -28
- package/types/components/Swipeable/index.d.ts +0 -50
- package/types/components/Switch/SelectorSwitch/Option.d.ts +0 -14
- package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +0 -19
- package/types/components/Switch/SelectorSwitch/index.d.ts +0 -37
- package/types/components/Switch/StyledSwitch.d.ts +0 -15
- package/types/components/Switch/index.d.ts +0 -28
- package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -9
- package/types/components/Tabs/SceneView.d.ts +0 -10
- package/types/components/Tabs/ScrollableTabs.d.ts +0 -7
- package/types/components/Tabs/ScrollableTabsHeader/ScrollableTabsHeader.d.ts +0 -40
- package/types/components/Tabs/ScrollableTabsHeader/hooks/useInitHighlightedAnimation.d.ts +0 -9
- package/types/components/Tabs/ScrollableTabsHeader/hooks/useInitUnderlinedAnimation.d.ts +0 -10
- package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -55
- package/types/components/Tabs/StyledTabs.d.ts +0 -45
- package/types/components/Tabs/TabWithBadge.d.ts +0 -17
- package/types/components/Tabs/index.d.ts +0 -62
- package/types/components/Tabs/useHandlePageScroll.d.ts +0 -8
- package/types/components/Tabs/useIsFocused.d.ts +0 -6
- package/types/components/Tabs/utils.d.ts +0 -2
- package/types/components/Tag/StyledTag.d.ts +0 -17
- package/types/components/Tag/index.d.ts +0 -28
- package/types/components/TextInput/StyledTextInput.d.ts +0 -89
- package/types/components/TextInput/index.d.ts +0 -136
- package/types/components/TimePicker/StyledTimePicker.d.ts +0 -16
- package/types/components/TimePicker/TimePicker.d.ts +0 -4
- package/types/components/TimePicker/TimePickerAndroid.d.ts +0 -4
- package/types/components/TimePicker/TimePickerIOS.d.ts +0 -4
- package/types/components/TimePicker/index.d.ts +0 -4
- package/types/components/TimePicker/index.internal.d.ts +0 -5
- package/types/components/TimePicker/types.d.ts +0 -76
- package/types/components/Toast/StyledToast.d.ts +0 -57
- package/types/components/Toast/Toast.d.ts +0 -3
- package/types/components/Toast/ToastContainer.d.ts +0 -5
- package/types/components/Toast/ToastContext.d.ts +0 -13
- package/types/components/Toast/ToastProvider.d.ts +0 -11
- package/types/components/Toast/index.d.ts +0 -8
- package/types/components/Toast/types.d.ts +0 -74
- package/types/components/Toolbar/StyledToolbar.d.ts +0 -69
- package/types/components/Toolbar/ToolbarGroup.d.ts +0 -25
- package/types/components/Toolbar/ToolbarItem.d.ts +0 -31
- package/types/components/Toolbar/ToolbarMessage.d.ts +0 -58
- package/types/components/Toolbar/index.d.ts +0 -14
- package/types/components/Typography/Body/StyledBody.d.ts +0 -15
- package/types/components/Typography/Body/__tests__/StyledBody.d.ts +0 -1
- package/types/components/Typography/Body/index.d.ts +0 -38
- package/types/components/Typography/Caption/StyledCaption.d.ts +0 -13
- package/types/components/Typography/Caption/index.d.ts +0 -32
- package/types/components/Typography/Label/StyledLabel.d.ts +0 -12
- package/types/components/Typography/Label/__tests__/StyledLabel.d.ts +0 -1
- package/types/components/Typography/Label/index.d.ts +0 -28
- package/types/components/Typography/Text/StyledText.d.ts +0 -13
- package/types/components/Typography/Text/index.d.ts +0 -40
- package/types/components/Typography/Title/StyledTitle.d.ts +0 -15
- package/types/components/Typography/Title/__tests__/StyledTitle.d.ts +0 -1
- package/types/components/Typography/Title/index.d.ts +0 -38
- package/types/components/Typography/index.d.ts +0 -17
- package/types/components/Typography/types.d.ts +0 -6
- package/types/index.d.ts +0 -64
- package/types/index.internal.d.ts +0 -19
- package/types/locales/en_AU.d.ts +0 -3
- package/types/locales/en_CA.d.ts +0 -3
- package/types/locales/index.d.ts +0 -5
- package/types/locales/types.d.ts +0 -10
- package/types/testHelpers/renderWithTheme.d.ts +0 -3
- package/types/testHelpers/utils.d.ts +0 -1
- package/types/theme/ThemeProvider.d.ts +0 -12
- package/types/theme/ThemeSwitcher.d.ts +0 -9
- package/types/theme/components/accordion.d.ts +0 -13
- package/types/theme/components/alert.d.ts +0 -48
- package/types/theme/components/appCue.d.ts +0 -16
- package/types/theme/components/attachment.d.ts +0 -21
- package/types/theme/components/avatar.d.ts +0 -50
- package/types/theme/components/badge.d.ts +0 -69
- package/types/theme/components/bottomNavigation.d.ts +0 -30
- package/types/theme/components/bottomSheet.d.ts +0 -29
- package/types/theme/components/button.d.ts +0 -127
- package/types/theme/components/calendar.d.ts +0 -33
- package/types/theme/components/card.d.ts +0 -26
- package/types/theme/components/cardCarousel.d.ts +0 -19
- package/types/theme/components/carousel.d.ts +0 -36
- package/types/theme/components/chart.d.ts +0 -22
- package/types/theme/components/checkbox.d.ts +0 -40
- package/types/theme/components/chip.d.ts +0 -43
- package/types/theme/components/columnChart.d.ts +0 -10
- package/types/theme/components/contentNavigator.d.ts +0 -7
- package/types/theme/components/datePicker.d.ts +0 -7
- package/types/theme/components/divider.d.ts +0 -17
- package/types/theme/components/drawer.d.ts +0 -30
- package/types/theme/components/empty.d.ts +0 -37
- package/types/theme/components/error.d.ts +0 -52
- package/types/theme/components/fab.d.ts +0 -73
- package/types/theme/components/filterTrigger.d.ts +0 -72
- package/types/theme/components/floatingIsland.d.ts +0 -32
- package/types/theme/components/icon.d.ts +0 -25
- package/types/theme/components/image.d.ts +0 -8
- package/types/theme/components/list.d.ts +0 -46
- package/types/theme/components/mapPin.d.ts +0 -43
- package/types/theme/components/pageControl.d.ts +0 -18
- package/types/theme/components/pinInput.d.ts +0 -57
- package/types/theme/components/progress.d.ts +0 -51
- package/types/theme/components/radio.d.ts +0 -24
- package/types/theme/components/rate.d.ts +0 -11
- package/types/theme/components/refreshControl.d.ts +0 -7
- package/types/theme/components/richTextEditor.d.ts +0 -28
- package/types/theme/components/search.d.ts +0 -58
- package/types/theme/components/sectionHeading.d.ts +0 -14
- package/types/theme/components/segmentedControl.d.ts +0 -55
- package/types/theme/components/select.d.ts +0 -18
- package/types/theme/components/skeleton.d.ts +0 -17
- package/types/theme/components/slider.d.ts +0 -33
- package/types/theme/components/spinner.d.ts +0 -27
- package/types/theme/components/success.d.ts +0 -45
- package/types/theme/components/swipeable.d.ts +0 -16
- package/types/theme/components/switch.d.ts +0 -38
- package/types/theme/components/tabs.d.ts +0 -31
- package/types/theme/components/tag.d.ts +0 -53
- package/types/theme/components/textInput.d.ts +0 -95
- package/types/theme/components/timePicker.d.ts +0 -7
- package/types/theme/components/toast.d.ts +0 -52
- package/types/theme/components/toolbar.d.ts +0 -48
- package/types/theme/components/typography.d.ts +0 -168
- package/types/theme/getTheme.d.ts +0 -119
- package/types/theme/global/borders.d.ts +0 -18
- package/types/theme/global/colors/__tests__/ehWork.spec.d.ts +0 -1
- package/types/theme/global/colors/eBens.d.ts +0 -6
- package/types/theme/global/colors/ehJobs.d.ts +0 -3
- package/types/theme/global/colors/ehWork.d.ts +0 -3
- package/types/theme/global/colors/ehWorkDark.d.ts +0 -3
- package/types/theme/global/colors/global.d.ts +0 -3
- package/types/theme/global/colors/globalDark.d.ts +0 -3
- package/types/theme/global/colors/jobs.d.ts +0 -6
- package/types/theme/global/colors/swag.d.ts +0 -6
- package/types/theme/global/colors/swagDark.d.ts +0 -6
- package/types/theme/global/colors/swagLight.d.ts +0 -6
- package/types/theme/global/colors/swagLightGlobal.d.ts +0 -3
- package/types/theme/global/colors/swagLightJobs.d.ts +0 -6
- package/types/theme/global/colors/swagSystemPalette.d.ts +0 -3
- package/types/theme/global/colors/types.d.ts +0 -58
- package/types/theme/global/colors/wallet.d.ts +0 -6
- package/types/theme/global/colors/work.d.ts +0 -6
- package/types/theme/global/index.d.ts +0 -78
- package/types/theme/global/scale.d.ts +0 -14
- package/types/theme/global/shadows/ehJobs.d.ts +0 -3
- package/types/theme/global/shadows/ehWork.d.ts +0 -3
- package/types/theme/global/shadows/ehWorkDark.d.ts +0 -3
- package/types/theme/global/shadows/index.d.ts +0 -3
- package/types/theme/global/shadows/types.d.ts +0 -16
- package/types/theme/global/sizes.d.ts +0 -14
- package/types/theme/global/space.d.ts +0 -16
- package/types/theme/global/typography.d.ts +0 -34
- package/types/theme/index.d.ts +0 -9
- package/types/types.d.ts +0 -42
- package/types/types.internal.d.ts +0 -18
- package/types/utils/functions.d.ts +0 -1
- package/types/utils/helpers.d.ts +0 -13
- package/types/utils/hooks.d.ts +0 -3
- package/types/utils/scale.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.114.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type-check": "tsc --noEmit",
|
|
11
11
|
"test": "jest --runInBand",
|
|
12
12
|
"test:watch": "jest --runInBand --watch",
|
|
13
|
-
"test:ci": "jest --c=jest-ci.config.js --i --logHeapUsage --coverage
|
|
13
|
+
"test:ci": "jest --c=jest-ci.config.js --i --logHeapUsage --coverage",
|
|
14
14
|
"build:js": "rollup -c",
|
|
15
15
|
"build:types": "tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json",
|
|
16
16
|
"build": "yarn build:js && yarn build:types",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@rollup/plugin-typescript": "^12.1.1",
|
|
70
70
|
"@testing-library/jest-native": "^5.4.2",
|
|
71
71
|
"@testing-library/react-hooks": "^8.0.1",
|
|
72
|
-
"@testing-library/react-native": "^
|
|
72
|
+
"@testing-library/react-native": "^13.0.0",
|
|
73
73
|
"@types/d3": "^7.4.3",
|
|
74
74
|
"@types/events": "^3.0.3",
|
|
75
75
|
"@types/jest": "^29.5.3",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"react-native-svg": "15.8.0",
|
|
95
95
|
"react-native-vector-icons": "^9.1.0",
|
|
96
96
|
"react-native-webview": "13.10.3",
|
|
97
|
-
"react-test-renderer": "18.
|
|
97
|
+
"react-test-renderer": "18.3.1",
|
|
98
98
|
"rollup": "^4.24.3",
|
|
99
99
|
"rollup-plugin-copy": "^3.5.0",
|
|
100
100
|
"rollup-plugin-flow": "^1.1.1",
|
|
@@ -115,7 +115,7 @@ const Alert = ({
|
|
|
115
115
|
style,
|
|
116
116
|
testID,
|
|
117
117
|
actionLabel,
|
|
118
|
-
}: AlertProps):
|
|
118
|
+
}: AlertProps): ReactElement => {
|
|
119
119
|
useDeprecation(
|
|
120
120
|
`Alert's notification intent is deprecated and will be removed in the next major release. Please use other intents instead.`,
|
|
121
121
|
intent === 'notification'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { View } from 'react-native';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
4
|
-
import type { ReactNode } from 'react';
|
|
4
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
5
5
|
import { StyledCount, StyledCountText } from './StyledBadge';
|
|
6
6
|
import { DEFAULT_MAX_NUMBER } from './constants';
|
|
7
7
|
|
|
@@ -40,7 +40,7 @@ const Status = ({
|
|
|
40
40
|
testID,
|
|
41
41
|
content: originalContent,
|
|
42
42
|
...nativeProps
|
|
43
|
-
}: CountProps):
|
|
43
|
+
}: CountProps): ReactElement => {
|
|
44
44
|
const content = useMemo(() => {
|
|
45
45
|
return originalContent > max ? `${max}+` : String(originalContent);
|
|
46
46
|
}, [originalContent, max]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { View, Animated } from 'react-native';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
4
|
-
import type { ReactNode } from 'react';
|
|
4
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
5
5
|
import { StyledStatus } from './StyledBadge';
|
|
6
6
|
|
|
7
7
|
export interface StatusProps extends ViewProps {
|
|
@@ -34,7 +34,7 @@ const Status = ({
|
|
|
34
34
|
style,
|
|
35
35
|
testID,
|
|
36
36
|
...nativeProps
|
|
37
|
-
}: StatusProps):
|
|
37
|
+
}: StatusProps): ReactElement => {
|
|
38
38
|
const { current: opacity } = React.useRef<Animated.Value>(
|
|
39
39
|
new Animated.Value(visible ? 1 : 0)
|
|
40
40
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Animated } from 'react-native';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
2
3
|
import React, { useMemo } from 'react';
|
|
3
4
|
import { StyledView, StyledText, StyledIcon } from './StyledBadge';
|
|
4
5
|
import BadgeStatus from './Status';
|
|
@@ -22,7 +23,7 @@ const Badge = ({
|
|
|
22
23
|
variant = 'filled',
|
|
23
24
|
icon,
|
|
24
25
|
...nativeProps
|
|
25
|
-
}: BadgeProps):
|
|
26
|
+
}: BadgeProps): ReactElement => {
|
|
26
27
|
const { current: opacity } = React.useRef<Animated.Value>(
|
|
27
28
|
new Animated.Value(visible ? 1 : 0)
|
|
28
29
|
);
|
|
@@ -43,7 +43,7 @@ const BottomBarItem = styled(View)({
|
|
|
43
43
|
alignItems: 'center',
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
const StyledBottomBarText = styled(Typography.
|
|
46
|
+
const StyledBottomBarText = styled(Typography.Label)(({ theme }) => ({
|
|
47
47
|
marginTop: theme.__hd__.bottomNavigation.space.titleMarginTop,
|
|
48
48
|
}));
|
|
49
49
|
|
|
@@ -158,20 +158,19 @@ exports[`BottomNavigation renders correctly 1`] = `
|
|
|
158
158
|
[
|
|
159
159
|
{
|
|
160
160
|
"color": "#401960",
|
|
161
|
-
"fontFamily": "BeVietnamPro-
|
|
162
|
-
"fontSize":
|
|
163
|
-
"letterSpacing": 0
|
|
164
|
-
"lineHeight":
|
|
161
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
162
|
+
"fontSize": 10,
|
|
163
|
+
"letterSpacing": 0,
|
|
164
|
+
"lineHeight": 14,
|
|
165
165
|
},
|
|
166
166
|
[
|
|
167
167
|
{
|
|
168
|
-
"marginTop":
|
|
168
|
+
"marginTop": 2,
|
|
169
169
|
},
|
|
170
170
|
undefined,
|
|
171
171
|
],
|
|
172
172
|
]
|
|
173
173
|
}
|
|
174
|
-
themeFontWeight="semi-bold"
|
|
175
174
|
themeIntent="primary"
|
|
176
175
|
themeIsItalic={false}
|
|
177
176
|
>
|
|
@@ -212,14 +211,14 @@ exports[`BottomNavigation renders correctly 1`] = `
|
|
|
212
211
|
style={
|
|
213
212
|
[
|
|
214
213
|
{
|
|
215
|
-
"color": "#
|
|
214
|
+
"color": "#4d6265",
|
|
216
215
|
"fontSize": 24,
|
|
217
216
|
},
|
|
218
217
|
undefined,
|
|
219
218
|
]
|
|
220
219
|
}
|
|
221
220
|
testID="hero-icon-speaker-outlined"
|
|
222
|
-
themeIntent="
|
|
221
|
+
themeIntent="muted"
|
|
223
222
|
themeSize="medium"
|
|
224
223
|
/>
|
|
225
224
|
<Text
|
|
@@ -228,22 +227,21 @@ exports[`BottomNavigation renders correctly 1`] = `
|
|
|
228
227
|
style={
|
|
229
228
|
[
|
|
230
229
|
{
|
|
231
|
-
"color": "#
|
|
232
|
-
"fontFamily": "BeVietnamPro-
|
|
233
|
-
"fontSize":
|
|
234
|
-
"letterSpacing": 0
|
|
235
|
-
"lineHeight":
|
|
230
|
+
"color": "#4d6265",
|
|
231
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
232
|
+
"fontSize": 10,
|
|
233
|
+
"letterSpacing": 0,
|
|
234
|
+
"lineHeight": 14,
|
|
236
235
|
},
|
|
237
236
|
[
|
|
238
237
|
{
|
|
239
|
-
"marginTop":
|
|
238
|
+
"marginTop": 2,
|
|
240
239
|
},
|
|
241
240
|
undefined,
|
|
242
241
|
],
|
|
243
242
|
]
|
|
244
243
|
}
|
|
245
|
-
|
|
246
|
-
themeIntent="body"
|
|
244
|
+
themeIntent="muted"
|
|
247
245
|
themeIsItalic={false}
|
|
248
246
|
>
|
|
249
247
|
Feed
|
|
@@ -283,14 +281,14 @@ exports[`BottomNavigation renders correctly 1`] = `
|
|
|
283
281
|
style={
|
|
284
282
|
[
|
|
285
283
|
{
|
|
286
|
-
"color": "#
|
|
284
|
+
"color": "#4d6265",
|
|
287
285
|
"fontSize": 24,
|
|
288
286
|
},
|
|
289
287
|
undefined,
|
|
290
288
|
]
|
|
291
289
|
}
|
|
292
290
|
testID="hero-icon-bell-outlined"
|
|
293
|
-
themeIntent="
|
|
291
|
+
themeIntent="muted"
|
|
294
292
|
themeSize="medium"
|
|
295
293
|
/>
|
|
296
294
|
<Text
|
|
@@ -299,22 +297,21 @@ exports[`BottomNavigation renders correctly 1`] = `
|
|
|
299
297
|
style={
|
|
300
298
|
[
|
|
301
299
|
{
|
|
302
|
-
"color": "#
|
|
303
|
-
"fontFamily": "BeVietnamPro-
|
|
304
|
-
"fontSize":
|
|
305
|
-
"letterSpacing": 0
|
|
306
|
-
"lineHeight":
|
|
300
|
+
"color": "#4d6265",
|
|
301
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
302
|
+
"fontSize": 10,
|
|
303
|
+
"letterSpacing": 0,
|
|
304
|
+
"lineHeight": 14,
|
|
307
305
|
},
|
|
308
306
|
[
|
|
309
307
|
{
|
|
310
|
-
"marginTop":
|
|
308
|
+
"marginTop": 2,
|
|
311
309
|
},
|
|
312
310
|
undefined,
|
|
313
311
|
],
|
|
314
312
|
]
|
|
315
313
|
}
|
|
316
|
-
|
|
317
|
-
themeIntent="body"
|
|
314
|
+
themeIntent="muted"
|
|
318
315
|
themeIsItalic={false}
|
|
319
316
|
>
|
|
320
317
|
Alerts
|
|
@@ -354,14 +351,14 @@ exports[`BottomNavigation renders correctly 1`] = `
|
|
|
354
351
|
style={
|
|
355
352
|
[
|
|
356
353
|
{
|
|
357
|
-
"color": "#
|
|
354
|
+
"color": "#4d6265",
|
|
358
355
|
"fontSize": 24,
|
|
359
356
|
},
|
|
360
357
|
undefined,
|
|
361
358
|
]
|
|
362
359
|
}
|
|
363
360
|
testID="hero-icon-user-outlined"
|
|
364
|
-
themeIntent="
|
|
361
|
+
themeIntent="muted"
|
|
365
362
|
themeSize="medium"
|
|
366
363
|
/>
|
|
367
364
|
<Text
|
|
@@ -370,22 +367,21 @@ exports[`BottomNavigation renders correctly 1`] = `
|
|
|
370
367
|
style={
|
|
371
368
|
[
|
|
372
369
|
{
|
|
373
|
-
"color": "#
|
|
374
|
-
"fontFamily": "BeVietnamPro-
|
|
375
|
-
"fontSize":
|
|
376
|
-
"letterSpacing": 0
|
|
377
|
-
"lineHeight":
|
|
370
|
+
"color": "#4d6265",
|
|
371
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
372
|
+
"fontSize": 10,
|
|
373
|
+
"letterSpacing": 0,
|
|
374
|
+
"lineHeight": 14,
|
|
378
375
|
},
|
|
379
376
|
[
|
|
380
377
|
{
|
|
381
|
-
"marginTop":
|
|
378
|
+
"marginTop": 2,
|
|
382
379
|
},
|
|
383
380
|
undefined,
|
|
384
381
|
],
|
|
385
382
|
]
|
|
386
383
|
}
|
|
387
|
-
|
|
388
|
-
themeIntent="body"
|
|
384
|
+
themeIntent="muted"
|
|
389
385
|
themeIsItalic={false}
|
|
390
386
|
>
|
|
391
387
|
Profile
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text } from 'react-native';
|
|
3
|
-
import { fireEvent } from '@testing-library/react-native';
|
|
3
|
+
import { act, fireEvent } from '@testing-library/react-native';
|
|
4
4
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
5
5
|
import type { ComponentProps } from 'react';
|
|
6
6
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
@@ -64,15 +64,24 @@ describe('BottomNavigation', () => {
|
|
|
64
64
|
|
|
65
65
|
expect(toJSON()).toMatchSnapshot();
|
|
66
66
|
expect(getByText('Home')).toBeDefined();
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
|
|
68
|
+
act(() => {
|
|
69
|
+
fireEvent.press(getByText('Feed'));
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
act(() => {
|
|
73
|
+
fireEvent.press(getByText('Alerts'));
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
act(() => {
|
|
77
|
+
fireEvent.press(getByText('Profile'));
|
|
78
|
+
});
|
|
70
79
|
|
|
71
80
|
// All screens are rendered and component is not unmounted when switching screen.
|
|
72
|
-
expect(getByText('Home Screen')).toBeDefined();
|
|
73
|
-
expect(getByText('Feed Screen')).toBeDefined();
|
|
74
|
-
expect(getByText('Alerts Screen')).toBeDefined();
|
|
75
|
-
expect(getByText('Profile Screen')).toBeDefined();
|
|
81
|
+
expect(getByText('Home Screen', { hidden: true })).toBeDefined();
|
|
82
|
+
expect(getByText('Feed Screen', { hidden: true })).toBeDefined();
|
|
83
|
+
expect(getByText('Alerts Screen', { hidden: true })).toBeDefined();
|
|
84
|
+
expect(getByText('Profile Screen', { hidden: true })).toBeDefined();
|
|
76
85
|
});
|
|
77
86
|
|
|
78
87
|
it('renders correctly with renderActiveTabOnly is true', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TouchableWithoutFeedback } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
-
import type { ReactNode } from 'react';
|
|
4
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
5
5
|
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
6
6
|
import Icon from '../Icon';
|
|
7
7
|
import { isHeroIcon } from '../Icon/utils';
|
|
@@ -70,7 +70,7 @@ const BottomNavigation = ({
|
|
|
70
70
|
selectedTabKey,
|
|
71
71
|
tabs,
|
|
72
72
|
...nativeProps
|
|
73
|
-
}: BottomNavigationProps):
|
|
73
|
+
}: BottomNavigationProps): ReactElement => {
|
|
74
74
|
const insets = useSafeAreaInsets();
|
|
75
75
|
|
|
76
76
|
/**
|
|
@@ -137,13 +137,12 @@ const BottomNavigation = ({
|
|
|
137
137
|
<BottomBarItem>
|
|
138
138
|
<Icon
|
|
139
139
|
icon={active ? icon : inactiveIcon}
|
|
140
|
-
intent={active ? 'primary' : '
|
|
140
|
+
intent={active ? 'primary' : 'muted'}
|
|
141
141
|
testID={`hero-icon-${icon}`}
|
|
142
142
|
/>
|
|
143
143
|
{!!title && (
|
|
144
144
|
<StyledBottomBarText
|
|
145
|
-
|
|
146
|
-
intent={active ? 'primary' : 'body'}
|
|
145
|
+
intent={active ? 'primary' : 'muted'}
|
|
147
146
|
numberOfLines={1}
|
|
148
147
|
>
|
|
149
148
|
{title}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
1
2
|
import React, { useContext, useCallback, forwardRef } from 'react';
|
|
2
3
|
import type {
|
|
3
4
|
NativeScrollEvent,
|
|
@@ -9,7 +10,7 @@ import type { BottomSheetContextType } from './BottomSheetContext';
|
|
|
9
10
|
import BottomSheetContext from './BottomSheetContext';
|
|
10
11
|
|
|
11
12
|
const BottomSheetScrollView = forwardRef<ScrollView, ScrollViewProps>(
|
|
12
|
-
({ scrollEventThrottle = 100, ...props }, ref):
|
|
13
|
+
({ scrollEventThrottle = 100, ...props }, ref): ReactElement => {
|
|
13
14
|
const { setInternalShowDivider } =
|
|
14
15
|
useContext<BottomSheetContextType>(BottomSheetContext);
|
|
15
16
|
|
|
@@ -104,7 +104,7 @@ const BottomSheet = ({
|
|
|
104
104
|
keyboardAvoidingViewProps = {},
|
|
105
105
|
supportedOrientations = ['portrait'],
|
|
106
106
|
variant = 'fixed',
|
|
107
|
-
}: BottomSheetProps):
|
|
107
|
+
}: BottomSheetProps): ReactElement => {
|
|
108
108
|
const { height } = Dimensions.get('window');
|
|
109
109
|
|
|
110
110
|
// Internal state to control modal open/close timing with animation
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactChild, ReactNode } from 'react';
|
|
1
|
+
import type { ReactChild, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
import type { Theme } from '../../theme';
|
|
@@ -188,7 +188,7 @@ const Button = ({
|
|
|
188
188
|
testID,
|
|
189
189
|
text,
|
|
190
190
|
variant = 'filled',
|
|
191
|
-
}: ButtonProps):
|
|
191
|
+
}: ButtonProps): ReactElement => {
|
|
192
192
|
const isInlineText =
|
|
193
193
|
variant === 'inline-text' || variant === 'inline-text-compact';
|
|
194
194
|
const isIconButtonOnly = !text;
|
|
@@ -226,7 +226,7 @@ describe('CalendarRange', () => {
|
|
|
226
226
|
|
|
227
227
|
fireEvent.press(getByTestId('calendar-month-picker'));
|
|
228
228
|
|
|
229
|
-
// Pickers are mocked at
|
|
229
|
+
// Pickers are mocked at libs/rn/testUtils/setup.tsx
|
|
230
230
|
if (mockedPlatform === 'ios') {
|
|
231
231
|
expect(queryByText('IOS picker')).toBeDefined();
|
|
232
232
|
} else {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fireEvent } from '@testing-library/react-native';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { Platform } from 'react-native';
|
|
3
4
|
import Calendar from '..';
|
|
4
5
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
5
6
|
import { setOrientation } from '../../../testHelpers/utils';
|
|
@@ -121,10 +122,7 @@ describe('Calendar', () => {
|
|
|
121
122
|
${'ios'}
|
|
122
123
|
${'android'}
|
|
123
124
|
`('renders correct picker on $platform', ({ platform: mockedPlatform }) => {
|
|
124
|
-
|
|
125
|
-
OS: mockedPlatform,
|
|
126
|
-
select: () => null,
|
|
127
|
-
}));
|
|
125
|
+
Platform.OS = mockedPlatform;
|
|
128
126
|
|
|
129
127
|
const { getByTestId, queryByText } = renderWithTheme(
|
|
130
128
|
<Calendar
|
|
@@ -138,7 +136,7 @@ describe('Calendar', () => {
|
|
|
138
136
|
|
|
139
137
|
fireEvent.press(getByTestId('calendar-month-picker'));
|
|
140
138
|
|
|
141
|
-
// Pickers are mocked at
|
|
139
|
+
// Pickers are mocked at libs/rn/testUtils/setup.tsx
|
|
142
140
|
if (mockedPlatform === 'ios') {
|
|
143
141
|
expect(queryByText('IOS picker')).toBeDefined();
|
|
144
142
|
} else {
|
|
@@ -153,10 +151,7 @@ describe('Calendar', () => {
|
|
|
153
151
|
`(
|
|
154
152
|
'onToggleMonthPicker is called when toggling month year picker on $platform',
|
|
155
153
|
({ platform: mockedPlatform }) => {
|
|
156
|
-
|
|
157
|
-
OS: mockedPlatform,
|
|
158
|
-
select: () => null,
|
|
159
|
-
}));
|
|
154
|
+
Platform.OS = mockedPlatform;
|
|
160
155
|
|
|
161
156
|
const onToggleMonthPicker = jest.fn();
|
|
162
157
|
const { getByTestId } = renderWithTheme(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
3
3
|
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
4
4
|
import { StyledDataCard, Indicator } from './StyledDataCard';
|
|
5
5
|
|
|
@@ -26,7 +26,7 @@ const DataCard = ({
|
|
|
26
26
|
intent = 'info',
|
|
27
27
|
children,
|
|
28
28
|
...nativeProps
|
|
29
|
-
}: DataCardProps):
|
|
29
|
+
}: DataCardProps): ReactElement => (
|
|
30
30
|
<StyledDataCard {...nativeProps}>
|
|
31
31
|
<Indicator themeIntent={intent} testID="data-card-indicator" />
|
|
32
32
|
{children}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
4
4
|
import DataCard from './DataCard';
|
|
@@ -37,7 +37,7 @@ const Card = ({
|
|
|
37
37
|
children,
|
|
38
38
|
variant = 'basic',
|
|
39
39
|
...nativeProps
|
|
40
|
-
}: CardProps):
|
|
40
|
+
}: CardProps): ReactElement => {
|
|
41
41
|
return (
|
|
42
42
|
<StyledCard {...nativeProps} themeIntent={intent} themeVariant={variant}>
|
|
43
43
|
{children}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Dispatch, SetStateAction } from 'react';
|
|
1
|
+
import type { Dispatch, ReactElement, SetStateAction } from 'react';
|
|
2
2
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import type {
|
|
4
4
|
StyleProp,
|
|
@@ -42,7 +42,7 @@ interface CarouselProps extends ViewProps {
|
|
|
42
42
|
/**
|
|
43
43
|
* Render action elements function.
|
|
44
44
|
*/
|
|
45
|
-
renderActions?: (pageIndex: number) =>
|
|
45
|
+
renderActions?: (pageIndex: number) => ReactElement;
|
|
46
46
|
/**
|
|
47
47
|
* @deprecated will be removed in 9.0.0
|
|
48
48
|
*
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { fireEvent } from '@testing-library/react-native';
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
-
import type { ModalProps } from 'react-native';
|
|
4
3
|
import renderWithTheme from '../../../../testHelpers/renderWithTheme';
|
|
5
4
|
import IOSDialog from '../IOSDialog';
|
|
6
5
|
import { setOrientation } from '../../../../testHelpers/utils';
|
|
7
6
|
import { Button } from '../../../..';
|
|
8
7
|
import type { DatePickerDialogProps } from '../type';
|
|
9
8
|
|
|
10
|
-
jest.mock('react-native/Libraries/Modal/Modal', () => {
|
|
11
|
-
const Modal = jest.requireActual('react-native/Libraries/Modal/Modal');
|
|
12
|
-
return (props: ModalProps) => <Modal {...props} />;
|
|
13
|
-
});
|
|
14
|
-
|
|
15
9
|
const IOSDialogExample = (
|
|
16
10
|
props: Omit<DatePickerDialogProps, 'open' | 'onClose'>
|
|
17
11
|
) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fireEvent } from '@testing-library/react-native';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
4
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
5
5
|
import DatePickerCalendar from '../DatePickerCalendar';
|
|
6
6
|
import { setOrientation } from '../../../testHelpers/utils';
|
|
@@ -10,11 +10,6 @@ import { theme } from '../../..';
|
|
|
10
10
|
import enAU from '../../../locales/en_AU';
|
|
11
11
|
import enCA from '../../../locales/en_CA';
|
|
12
12
|
|
|
13
|
-
jest.mock('react-native/Libraries/Modal/Modal', () => {
|
|
14
|
-
const Modal = jest.requireActual('react-native/Libraries/Modal/Modal');
|
|
15
|
-
return (props: ModalProps) => <Modal {...props} />;
|
|
16
|
-
});
|
|
17
|
-
|
|
18
13
|
describe('DatePickerCalendar', () => {
|
|
19
14
|
it('renders correctly', () => {
|
|
20
15
|
const onChange = jest.fn();
|
|
@@ -108,10 +103,7 @@ describe('DatePickerCalendar', () => {
|
|
|
108
103
|
`(
|
|
109
104
|
'renders month year picker when pressing on title',
|
|
110
105
|
({ platform: mockedPlatform }) => {
|
|
111
|
-
|
|
112
|
-
OS: mockedPlatform,
|
|
113
|
-
select: () => null,
|
|
114
|
-
}));
|
|
106
|
+
Platform.OS = mockedPlatform;
|
|
115
107
|
|
|
116
108
|
const { queryByText, getByText, getByTestId } = renderWithTheme(
|
|
117
109
|
<DatePickerCalendar
|
|
@@ -10,12 +10,39 @@ import { theme } from '../../..';
|
|
|
10
10
|
|
|
11
11
|
import enAU from '../../../locales/en_AU';
|
|
12
12
|
import enCA from '../../../locales/en_CA';
|
|
13
|
+
import type { BottomSheetProps } from '../../BottomSheet';
|
|
13
14
|
|
|
14
15
|
jest.mock('react-native/Libraries/Modal/Modal', () => {
|
|
15
16
|
const Modal = jest.requireActual('react-native/Libraries/Modal/Modal');
|
|
16
17
|
return (props: ModalProps) => <Modal {...props} />;
|
|
17
18
|
});
|
|
18
19
|
|
|
20
|
+
jest.mock('../../BottomSheet', () => {
|
|
21
|
+
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
22
|
+
const { View } = require('react-native');
|
|
23
|
+
|
|
24
|
+
const BottomSheet = ({
|
|
25
|
+
header,
|
|
26
|
+
open,
|
|
27
|
+
footer,
|
|
28
|
+
children,
|
|
29
|
+
testID,
|
|
30
|
+
}: BottomSheetProps) => {
|
|
31
|
+
if (!open) return null;
|
|
32
|
+
return (
|
|
33
|
+
<View testID={testID}>
|
|
34
|
+
{header && <View>{header}</View>}
|
|
35
|
+
{children}
|
|
36
|
+
{footer && <View>{footer}</View>}
|
|
37
|
+
</View>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
BottomSheet.ScrollView = View;
|
|
42
|
+
|
|
43
|
+
return BottomSheet;
|
|
44
|
+
});
|
|
45
|
+
|
|
19
46
|
describe('getDateValue', () => {
|
|
20
47
|
describe('when value is less than minDate', () => {
|
|
21
48
|
it('should return minDate', () => {
|