@hero-design/rn 8.113.1 → 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 +12 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +651 -399
- package/package.json +1 -1
- package/src/components/Calendar/__tests__/CalendarRange.spec.tsx +1 -1
- package/src/components/Calendar/__tests__/index.spec.tsx +1 -1
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +3 -0
- 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/Tabs/ScrollableTabs.tsx +30 -9
- package/src/components/Tabs/ScrollableTabsHeader/ScrollableTabsHeader.tsx +1 -1
- package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +31 -6
- package/src/components/Tabs/index.tsx +2 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +8 -0
- 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 -48751
- 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 -8
- 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 -21
- package/types/components/List/BasicListItem.d.ts +0 -44
- 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 -14
- package/types/components/MapPin/StyledMapPin.d.ts +0 -41
- package/types/components/MapPin/index.d.ts +0 -6
- 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 -19
- package/types/components/Progress/ProgressCircle.d.ts +0 -21
- 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 -18
- 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 -4
- 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 -86
- 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
|
@@ -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 {
|
|
@@ -136,7 +136,7 @@ describe('Calendar', () => {
|
|
|
136
136
|
|
|
137
137
|
fireEvent.press(getByTestId('calendar-month-picker'));
|
|
138
138
|
|
|
139
|
-
// Pickers are mocked at
|
|
139
|
+
// Pickers are mocked at libs/rn/testUtils/setup.tsx
|
|
140
140
|
if (mockedPlatform === 'ios') {
|
|
141
141
|
expect(queryByText('IOS picker')).toBeDefined();
|
|
142
142
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"activate":59000,"add-emoji":59001,"add-person":59002,"adjustment":59003,"alignment":59004,"antenna":59005,"archive":59006,"assignment-warning":59007,"bank":59008,"bell":59009,"billing":59010,"bolt":59011,"bookmark-added":59012,"bookmark-checked":59013,"bookmark":59014,"box-check":59015,"box":59016,"bpay":59017,"buildings":59018,"cake":59019,"calendar-clock":59020,"calendar":59021,"candy-box-menu":59022,"caret-down-small":59023,"caret-down":59024,"caret-left-small":59025,"caret-left":59026,"caret-right-small":59027,"caret-right":59028,"caret-up-small":59029,"caret-up":59030,"check-radio":59031,"circle-add":59032,"circle-cancel":59033,"circle-check":59034,"circle-down":59035,"circle-info":59036,"circle-left":59037,"circle-ok":59038,"circle-pencil":59039,"circle-question":59040,"circle-remove":59041,"circle-right":59042,"circle-up":59043,"circle-warning":59044,"clock-3":59045,"clock":59046,"cloud-download":59047,"cloud-upload":59048,"cog":59049,"coin":59050,"contacts":59051,"credit-card":59052,"diamond":59053,"direction-arrows":59054,"directory":59055,"document":59056,"dollar-coin-shine":59057,"dot":59058,"double-buildings":59059,"edit-template":59060,"envelope":59061,"exclude":59062,"expand-content":59063,"expense":59064,"explore_nearby":59065,"eye-circle":59066,"eye-invisible":59067,"eye":59068,"face-meh":59069,"face-sad":59070,"face-smiley":59071,"feed":59072,"feedbacks":59073,"file-certified":59074,"file-clone":59075,"file-copy":59076,"file-csv":59077,"file-dispose":59078,"file-doc":59079,"file-excel":59080,"file-export":59081,"file-lock":59082,"file-pdf":59083,"file-powerpoint":59084,"file-search":59085,"file-secured":59086,"file-sheets":59087,"file-slide":59088,"file-verified":59089,"file-word":59090,"file":59091,"filter":59092,"folder-user":59093,"folder":59094,"format-bold":59095,"format-heading1":59096,"format-heading2":59097,"format-italic":59098,"format-list-bulleted":59099,"format-list-numbered":59100,"format-underlined":59101,"funnel-filter":59102,"global-dollar":59103,"global-pound":59104,"globe":59105,"graduation-cap":59106,"graph":59107,"happy-sun":59108,"health-bag":59109,"heart":59110,"hero-points":59111,"home":59112,"image":59113,"import":59114,"incident-siren":59115,"instapay-daily":59116,"instapay-now":59117,"instapay":59118,"list":59119,"loading-2":59120,"loading":59121,"location-on":59122,"location":59123,"lock":59124,"looks-one":59125,"looks-two":59126,"media-content":59127,"menu":59128,"money-notes":59129,"moneybag":59130,"moon":59131,"multiple-stars":59132,"multiple-users":59133,"near-me":59134,"node":59135,"open-folder":59136,"paperclip-vertical":59137,"paperclip":59138,"payment-summary":59139,"pencil":59140,"phone":59141,"piggy-bank":59142,"plane-up":59143,"plane":59144,"play-arrow":59145,"play-circle":59146,"pound-coin-shine":59147,"pound-sign":59148,"print":59149,"raising-hands":59150,"reply-arrow":59151,"reply":59152,"reschedule":59153,"rostering":59154,"salary-sacrifice":59155,"save":59156,"schedule-send":59157,"schedule":59158,"search-person":59159,"search":59160,"send":59161,"speaker-active":59162,"speaker":59163,"star-award":59164,"star-badge":59165,"star-circle":59166,"star-medal":59167,"star":59168,"steps-circle":59169,"stopwatch":59170,"suitcase":59171,"surfing":59172,"survey":59173,"swag-pillar-benefit":59174,"swag-pillar-career":59175,"swag-pillar-money":59176,"swag-pillar-work":59177,"swag":59178,"swipe-right":59179,"switch":59180,"tag":59181,"target":59182,"teams":59183,"thumb-down":59184,"thumb-up":59185,"timesheet":59186,"touch-id":59187,"trash-bin":59188,"unlock":59189,"user":59190,"video-1":59191,"video-2":59192,"wallet":59193,"warning":59194,"academic-hat-outlined":59195,"accommodation-outlined":59196,"activate-outlined":59197,"add-credit-card-outlined":59198,"add-person-outlined":59199,"add-section-outlined":59200,"add-time-outlined":59201,"add":59202,"adjustment-outlined":59203,"afternoon-outlined":59204,"ai-outlined":59205,"alignment-2-outlined":59206,"alignment-outlined":59207,"all-caps":59208,"application-outlined":59209,"arrow-down":59210,"arrow-downwards":59211,"arrow-left":59212,"arrow-leftwards":59213,"arrow-right":59214,"arrow-rightwards":59215,"arrow-up":59216,"arrow-upwards":59217,"article-outlined":59218,"at-sign":59219,"auto-graph-outlined":59220,"automotive-outlined":59221,"bakery-outlined":59222,"bar-outlined":59223,"beauty-outlined":59224,"beer-outlined":59225,"bell-active-outlined":59226,"bell-outlined":59227,"bell-slash-outlined":59228,"bill-management-outlined":59229,"billing-outlined":59230,"body-outlined":59231,"bold":59232,"bolt-outlined":59233,"book-outlined":59234,"bookmark-added-outlined":59235,"bookmark-checked-outlined":59236,"bookmark-outlined":59237,"box-1-outlined":59238,"box-check-outlined":59239,"box-outlined":59240,"bullet-points":59241,"cake-outlined":59242,"calculator-outlined":59243,"calendar-dates-outlined":59244,"calendar-star-outlined":59245,"call-outlined":59246,"call-split-outlined":59247,"camera-outlined":59248,"cancel":59249,"car-forward-outlined":59250,"cashback-outlined":59251,"charging-station-outlined":59252,"chat-bubble-outlined":59253,"chat-unread-outlined":59254,"checkmark":59255,"circle-add-outlined":59256,"circle-cancel-outlined":59257,"circle-down-outlined":59258,"circle-info-outlined":59259,"circle-left-outlined":59260,"circle-ok-outlined":59261,"circle-question-outlined":59262,"circle-remove-outlined":59263,"circle-right-outlined":59264,"circle-up-outlined":59265,"circle-warning-outlined":59266,"clock-2-outlined":59267,"clock-in-outlined":59268,"clock-out-outlined":59269,"clock-outlined":59270,"cog-outlined":59271,"coin-outlined":59272,"coin-super-outlined":59273,"comment-outlined":59274,"contacts-outlined":59275,"contacts-user-outlined":59276,"credit-card-outlined":59277,"cultural-site-outlined":59278,"cup-outlined":59279,"dentistry-outlined":59280,"direction-arrows-outlined":59281,"directory-outlined":59282,"document-outlined":59283,"dollar-box-outlined":59284,"dollar-card-outlined":59285,"dollar-coin-shine-outlined":59286,"dollar-credit-card-outlined":59287,"dollar-sign":59288,"double-buildings-outlined":59289,"double-left-arrows":59290,"double-right-arrows":59291,"download-box-outlined":59292,"download-outlined":59293,"edit-template-outlined":59294,"electronics-outlined":59295,"email-outlined":59296,"end-break-outlined":59297,"enter-arrow":59298,"entertainment-outlined":59299,"envelope-outlined":59300,"evening-outlined":59301,"expense-approval-outlined":59302,"expense-outlined":59303,"explore-outlined":59304,"extension-outlined":59305,"external-link":59306,"eye-invisible-outlined":59307,"eye-outlined":59308,"face-id":59309,"face-meh-outlined":59310,"face-open-smiley-outlined":59311,"face-sad-outlined":59312,"face-smiley-outlined":59313,"fastfood-outlined":59314,"feed-outlined":59315,"file-certified-outlined":59316,"file-clone-outlined":59317,"file-copy-outlined":59318,"file-dispose-outlined":59319,"file-dollar-certified-outlined":59320,"file-dollar-outlined":59321,"file-download-outlined":59322,"file-export-outlined":59323,"file-lock-outlined":59324,"file-outlined":59325,"file-pound-outlined":59326,"file-search-outlined":59327,"file-secured-outlined":59328,"file-statutory-outlined":59329,"file-verified-outlined":59330,"filter-outlined":59331,"fitness-outlined":59332,"folder-outlined":59333,"folder-upload-outlined":59334,"folder-user-outlined":59335,"form-outlined":59336,"funnel-filter-outline":59337,"goal-outlined":59338,"graph-outlined":59339,"grocery-outlined":59340,"hand-holding-user-outlined":59341,"handshake-outlined":59342,"happy-sun-outlined":59343,"health-bag-outlined":59344,"heart-outlined":59345,"home-active-outlined":59346,"home-outlined":59347,"id-card-outlined":59348,"image-outlined":59349,"import-outlined":59350,"instapay-outlined":59351,"italic":59352,"job-search-outlined":59353,"leave-approval-outlined":59354,"lighting-outlined":59355,"link-1":59356,"link-2":59357,"list-outlined":59358,"live-help-outlined":59359,"local_mall_outlined":59360,"location-on-outlined":59361,"location-outlined":59362,"lock-outlined":59363,"locked-file-outlined":59364,"log-out":59365,"mail-outlined":59366,"map-outlined":59367,"media-content-outlined":59368,"menu-close":59369,"menu-expand":59370,"menu-fold-outlined":59371,"menu-unfold-outlined":59372,"moneybag-outlined":59373,"moon-outlined":59374,"more-horizontal":59375,"more-vertical":59376,"morning-outlined":59377,"multiple-folders-outlined":59378,"multiple-users-outlined":59379,"near-me-outlined":59380,"node-outlined":59381,"number-points":59382,"number":59383,"overview-outlined":59384,"park-outlined":59385,"payment-summary-outlined":59386,"payslip-outlined":59387,"pencil-outlined":59388,"percentage":59389,"phone-outlined":59390,"piggy-bank-outlined":59391,"plane-outlined":59392,"play-circle-outlined":59393,"pound-box-outlined":59394,"pound-card-outlined":59395,"pound-coin-shine-outlined":59396,"pound-credit-card-outlined":59397,"print-outlined":59398,"propane-tank-outlined":59399,"qr-code-outlined":59400,"qualification-outlined":59401,"re-assign":59402,"redeem":59403,"refresh":59404,"remove":59405,"reply-outlined":59406,"restart":59407,"restaurant-outlined":59408,"resume-outlined":59409,"return-arrow":59410,"rostering-outlined":59411,"safety-outlined":59412,"save-outlined":59413,"schedule-outlined":59414,"search-outlined":59415,"search-secured-outlined":59416,"send-outlined":59417,"share-1":59418,"share-2":59419,"share-outlined-2":59420,"share-outlined":59421,"shield-check-outlined":59422,"shop-outlined":59423,"shopping_basket_outlined":59424,"show-chart-outlined":59425,"single-down-arrow":59426,"single-left-arrow":59427,"single-right-arrow":59428,"single-up-arrow":59429,"smart-match-outlined":59430,"sparkle-outlined":59431,"speaker-active-outlined":59432,"speaker-outlined":59433,"star-circle-outlined":59434,"star-outlined":59435,"start-break-outlined":59436,"stash-outlined":59437,"stopwatch-outlined":59438,"strikethrough":59439,"styler-outlined":59440,"suitcase-clock-outlined":59441,"suitcase-outlined":59442,"survey-outlined":59443,"switch-outlined":59444,"sync":59445,"tag-outlined":59446,"target-outlined":59447,"tennis-outlined":59448,"thumb-down-outlined":59449,"thumb-up-outlined":59450,"ticket-outlined":59451,"timesheet-outlined":59452,"timesheets-outlined":59453,"today-outlined":59454,"transfer":59455,"transportation-outlined":59456,"trash-bin-outlined":59457,"umbrela-outlined":59458,"unavailability-outlined":59459,"unavailable":59460,"underline":59461,"union-outlined":59462,"unlock-outlined":59463,"upload-outlined":59464,"user-circle-outlined":59465,"user-gear-outlined":59466,"user-outlined":59467,"user-rectangle-outlined":59468,"video-1-outlined":59469,"video-2-outlined":59470,"volunteer-outlined":59471,"wallet-outlined":59472,"wellness-outlined":59473}
|
|
1
|
+
{"activate":59000,"add-emoji":59001,"add-person":59002,"adjustment":59003,"alignment":59004,"antenna":59005,"archive":59006,"assignment-warning":59007,"bank":59008,"bell":59009,"billing":59010,"bolt":59011,"bookmark-added":59012,"bookmark-checked":59013,"bookmark":59014,"box-check":59015,"box":59016,"bpay":59017,"buildings":59018,"cake":59019,"calendar-clock":59020,"calendar":59021,"candy-box-menu":59022,"caret-down-small":59023,"caret-down":59024,"caret-left-small":59025,"caret-left":59026,"caret-right-small":59027,"caret-right":59028,"caret-up-small":59029,"caret-up":59030,"check-radio":59031,"circle-add":59032,"circle-cancel":59033,"circle-check":59034,"circle-down":59035,"circle-info":59036,"circle-left":59037,"circle-ok":59038,"circle-pencil":59039,"circle-question":59040,"circle-remove":59041,"circle-right":59042,"circle-up":59043,"circle-warning":59044,"clock-3":59045,"clock":59046,"cloud-download":59047,"cloud-upload":59048,"cog":59049,"coin":59050,"contacts":59051,"credit-card":59052,"diamond":59053,"direction-arrows":59054,"directory":59055,"document":59056,"dollar-coin-shine":59057,"dot":59058,"double-buildings":59059,"edit-template":59060,"envelope":59061,"exclude":59062,"expand-content":59063,"expense":59064,"explore_nearby":59065,"eye-circle":59066,"eye-invisible":59067,"eye":59068,"face-meh":59069,"face-sad":59070,"face-smiley":59071,"feed":59072,"feedbacks":59073,"file-certified":59074,"file-clone":59075,"file-copy":59076,"file-csv":59077,"file-dispose":59078,"file-doc":59079,"file-excel":59080,"file-export":59081,"file-lock":59082,"file-pdf":59083,"file-powerpoint":59084,"file-search":59085,"file-secured":59086,"file-sheets":59087,"file-slide":59088,"file-verified":59089,"file-word":59090,"file":59091,"filter":59092,"folder-user":59093,"folder":59094,"format-bold":59095,"format-heading1":59096,"format-heading2":59097,"format-italic":59098,"format-list-bulleted":59099,"format-list-numbered":59100,"format-underlined":59101,"funnel-filter":59102,"global-dollar":59103,"global-pound":59104,"globe":59105,"graduation-cap":59106,"graph":59107,"happy-sun":59108,"health-bag":59109,"heart":59110,"hero-points":59111,"home":59112,"image":59113,"import":59114,"incident-siren":59115,"instapay-daily":59116,"instapay-now":59117,"instapay":59118,"list":59119,"loading-2":59120,"loading":59121,"location-on":59122,"location":59123,"lock":59124,"looks-one":59125,"looks-two":59126,"media-content":59127,"menu":59128,"money-notes":59129,"moneybag":59130,"moon":59131,"multiple-stars":59132,"multiple-users":59133,"near-me":59134,"node":59135,"open-folder":59136,"paperclip-vertical":59137,"paperclip":59138,"payment-summary":59139,"pencil":59140,"phone":59141,"piggy-bank":59142,"plane-up":59143,"plane":59144,"play-arrow":59145,"play-circle":59146,"pound-coin-shine":59147,"pound-sign":59148,"print":59149,"raising-hands":59150,"reply-arrow":59151,"reply":59152,"reschedule":59153,"rocket-launch":59154,"rostering":59155,"salary-sacrifice":59156,"save":59157,"schedule-send":59158,"schedule":59159,"search-person":59160,"search":59161,"send":59162,"speaker-active":59163,"speaker":59164,"star-award":59165,"star-badge":59166,"star-circle":59167,"star-medal":59168,"star":59169,"steps-circle":59170,"stopwatch":59171,"suitcase":59172,"surfing":59173,"survey":59174,"swag-pillar-benefit":59175,"swag-pillar-career":59176,"swag-pillar-money":59177,"swag-pillar-work":59178,"swag":59179,"swipe-right":59180,"switch":59181,"tag":59182,"target":59183,"teams":59184,"thumb-down":59185,"thumb-up":59186,"timesheet":59187,"touch-id":59188,"trash-bin":59189,"unlock":59190,"user":59191,"video-1":59192,"video-2":59193,"wallet":59194,"warning":59195,"academic-hat-outlined":59196,"accommodation-outlined":59197,"activate-outlined":59198,"add-credit-card-outlined":59199,"add-person-outlined":59200,"add-section-outlined":59201,"add-time-outlined":59202,"add":59203,"adjustment-outlined":59204,"afternoon-outlined":59205,"ai-outlined":59206,"alignment-2-outlined":59207,"alignment-outlined":59208,"all-caps":59209,"application-outlined":59210,"arrow-down":59211,"arrow-downwards":59212,"arrow-left":59213,"arrow-leftwards":59214,"arrow-right":59215,"arrow-rightwards":59216,"arrow-up":59217,"arrow-upwards":59218,"article-outlined":59219,"at-sign":59220,"auto-graph-outlined":59221,"automotive-outlined":59222,"bakery-outlined":59223,"bar-outlined":59224,"beauty-outlined":59225,"beer-outlined":59226,"bell-active-outlined":59227,"bell-outlined":59228,"bell-slash-outlined":59229,"bill-management-outlined":59230,"billing-outlined":59231,"body-outlined":59232,"bold":59233,"bolt-outlined":59234,"book-outlined":59235,"bookmark-added-outlined":59236,"bookmark-checked-outlined":59237,"bookmark-outlined":59238,"box-1-outlined":59239,"box-check-outlined":59240,"box-outlined":59241,"bullet-points":59242,"cake-outlined":59243,"calculator-outlined":59244,"calendar-dates-outlined":59245,"calendar-star-outlined":59246,"call-outlined":59247,"call-split-outlined":59248,"camera-outlined":59249,"cancel":59250,"car-forward-outlined":59251,"cashback-outlined":59252,"charging-station-outlined":59253,"chat-bubble-outlined":59254,"chat-unread-outlined":59255,"checkmark":59256,"circle-add-outlined":59257,"circle-cancel-outlined":59258,"circle-down-outlined":59259,"circle-info-outlined":59260,"circle-left-outlined":59261,"circle-ok-outlined":59262,"circle-question-outlined":59263,"circle-remove-outlined":59264,"circle-right-outlined":59265,"circle-up-outlined":59266,"circle-warning-outlined":59267,"clock-2-outlined":59268,"clock-in-outlined":59269,"clock-out-outlined":59270,"clock-outlined":59271,"cog-outlined":59272,"coin-outlined":59273,"coin-super-outlined":59274,"comment-outlined":59275,"contacts-outlined":59276,"contacts-user-outlined":59277,"credit-card-outlined":59278,"cultural-site-outlined":59279,"cup-outlined":59280,"dentistry-outlined":59281,"diamond-outlined":59282,"direction-arrows-outlined":59283,"directory-outlined":59284,"document-outlined":59285,"dollar-box-outlined":59286,"dollar-card-outlined":59287,"dollar-coin-shine-outlined":59288,"dollar-credit-card-outlined":59289,"dollar-sign":59290,"double-buildings-outlined":59291,"double-left-arrows":59292,"double-right-arrows":59293,"download-box-outlined":59294,"download-outlined":59295,"edit-template-outlined":59296,"electronics-outlined":59297,"email-outlined":59298,"end-break-outlined":59299,"enter-arrow":59300,"entertainment-outlined":59301,"envelope-outlined":59302,"evening-outlined":59303,"expense-approval-outlined":59304,"expense-outlined":59305,"explore-outlined":59306,"extension-outlined":59307,"external-link":59308,"eye-invisible-outlined":59309,"eye-outlined":59310,"face-id":59311,"face-meh-outlined":59312,"face-open-smiley-outlined":59313,"face-sad-outlined":59314,"face-smiley-outlined":59315,"fastfood-outlined":59316,"feed-outlined":59317,"file-certified-outlined":59318,"file-clone-outlined":59319,"file-copy-outlined":59320,"file-dispose-outlined":59321,"file-dollar-certified-outlined":59322,"file-dollar-outlined":59323,"file-download-outlined":59324,"file-export-outlined":59325,"file-lock-outlined":59326,"file-outlined":59327,"file-pound-outlined":59328,"file-search-outlined":59329,"file-secured-outlined":59330,"file-statutory-outlined":59331,"file-verified-outlined":59332,"filter-outlined":59333,"fitness-outlined":59334,"folder-outlined":59335,"folder-upload-outlined":59336,"folder-user-outlined":59337,"form-outlined":59338,"funnel-filter-outline":59339,"goal-outlined":59340,"graph-outlined":59341,"grocery-outlined":59342,"hand-holding-user-outlined":59343,"handshake-outlined":59344,"happy-sun-outlined":59345,"health-bag-outlined":59346,"heart-outlined":59347,"home-active-outlined":59348,"home-outlined":59349,"id-card-outlined":59350,"image-outlined":59351,"import-outlined":59352,"instapay-outlined":59353,"italic":59354,"job-search-outlined":59355,"leave-approval-outlined":59356,"lighting-outlined":59357,"link-1":59358,"link-2":59359,"list-outlined":59360,"live-help-outlined":59361,"local_mall_outlined":59362,"location-on-outlined":59363,"location-outlined":59364,"lock-outlined":59365,"locked-file-outlined":59366,"log-out":59367,"mail-outlined":59368,"map-outlined":59369,"media-content-outlined":59370,"menu-close":59371,"menu-expand":59372,"menu-fold-outlined":59373,"menu-unfold-outlined":59374,"moneybag-outlined":59375,"moon-outlined":59376,"more-horizontal":59377,"more-vertical":59378,"morning-outlined":59379,"multiple-folders-outlined":59380,"multiple-users-outlined":59381,"near-me-outlined":59382,"node-outlined":59383,"number-points":59384,"number":59385,"overview-outlined":59386,"park-outlined":59387,"payment-summary-outlined":59388,"payslip-outlined":59389,"pencil-outlined":59390,"percentage":59391,"phone-outlined":59392,"piggy-bank-outlined":59393,"plane-outlined":59394,"play-circle-outlined":59395,"pound-box-outlined":59396,"pound-card-outlined":59397,"pound-coin-shine-outlined":59398,"pound-credit-card-outlined":59399,"print-outlined":59400,"propane-tank-outlined":59401,"qr-code-outlined":59402,"qualification-outlined":59403,"re-assign":59404,"redeem":59405,"refresh":59406,"remove":59407,"reply-outlined":59408,"restart":59409,"restaurant-outlined":59410,"resume-outlined":59411,"return-arrow":59412,"rocket-launch-outlined":59413,"rostering-outlined":59414,"safety-outlined":59415,"save-outlined":59416,"schedule-outlined":59417,"search-outlined":59418,"search-secured-outlined":59419,"send-outlined":59420,"share-1":59421,"share-2":59422,"share-outlined-2":59423,"share-outlined":59424,"shield-check-outlined":59425,"shop-outlined":59426,"shopping_basket_outlined":59427,"show-chart-outlined":59428,"single-down-arrow":59429,"single-left-arrow":59430,"single-right-arrow":59431,"single-up-arrow":59432,"smart-match-outlined":59433,"sparkle-outlined":59434,"speaker-active-outlined":59435,"speaker-outlined":59436,"star-circle-outlined":59437,"star-outlined":59438,"start-break-outlined":59439,"stash-outlined":59440,"stopwatch-outlined":59441,"strikethrough":59442,"styler-outlined":59443,"suitcase-clock-outlined":59444,"suitcase-outlined":59445,"survey-outlined":59446,"switch-outlined":59447,"sync":59448,"tag-outlined":59449,"target-outlined":59450,"tennis-outlined":59451,"thumb-down-outlined":59452,"thumb-up-outlined":59453,"ticket-outlined":59454,"timesheet-outlined":59455,"timesheets-outlined":59456,"today-outlined":59457,"transfer":59458,"transportation-outlined":59459,"trash-bin-outlined":59460,"umbrela-outlined":59461,"unavailability-outlined":59462,"unavailable":59463,"underline":59464,"union-outlined":59465,"unlock-outlined":59466,"upload-outlined":59467,"user-circle-outlined":59468,"user-gear-outlined":59469,"user-outlined":59470,"user-rectangle-outlined":59471,"video-1-outlined":59472,"video-2-outlined":59473,"volunteer-outlined":59474,"wallet-outlined":59475,"wellness-outlined":59476}
|
|
@@ -154,6 +154,7 @@ const IconList = [
|
|
|
154
154
|
'reply-arrow',
|
|
155
155
|
'reply',
|
|
156
156
|
'reschedule',
|
|
157
|
+
'rocket-launch',
|
|
157
158
|
'rostering',
|
|
158
159
|
'salary-sacrifice',
|
|
159
160
|
'save',
|
|
@@ -281,6 +282,7 @@ const IconList = [
|
|
|
281
282
|
'cultural-site-outlined',
|
|
282
283
|
'cup-outlined',
|
|
283
284
|
'dentistry-outlined',
|
|
285
|
+
'diamond-outlined',
|
|
284
286
|
'direction-arrows-outlined',
|
|
285
287
|
'directory-outlined',
|
|
286
288
|
'document-outlined',
|
|
@@ -411,6 +413,7 @@ const IconList = [
|
|
|
411
413
|
'restaurant-outlined',
|
|
412
414
|
'resume-outlined',
|
|
413
415
|
'return-arrow',
|
|
416
|
+
'rocket-launch-outlined',
|
|
414
417
|
'rostering-outlined',
|
|
415
418
|
'safety-outlined',
|
|
416
419
|
'save-outlined',
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import Typography from '../../Typography';
|
|
5
|
+
|
|
6
|
+
import { LegendCircle, LegendItem, LegendValue } from './StyledLegend';
|
|
7
|
+
import { getTextComponent } from './utils';
|
|
8
|
+
import type { SegmentedBarLegendDisplayValue } from './types';
|
|
9
|
+
|
|
10
|
+
interface ProgressSegmentedBarLegendItemProps {
|
|
11
|
+
title: string;
|
|
12
|
+
color: string;
|
|
13
|
+
displayValue?: SegmentedBarLegendDisplayValue;
|
|
14
|
+
testID?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const ProgressSegmentedBarLegendItem = ({
|
|
18
|
+
title,
|
|
19
|
+
color,
|
|
20
|
+
displayValue,
|
|
21
|
+
testID,
|
|
22
|
+
}: ProgressSegmentedBarLegendItemProps): ReactNode => {
|
|
23
|
+
const renderedDisplayValue = getTextComponent(
|
|
24
|
+
displayValue,
|
|
25
|
+
<Typography.Caption intent="muted">{displayValue}</Typography.Caption>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<LegendItem testID={testID}>
|
|
30
|
+
<LegendCircle themeColor={color} />
|
|
31
|
+
<Typography.Caption>{`${title}:`}</Typography.Caption>
|
|
32
|
+
{renderedDisplayValue ? (
|
|
33
|
+
<LegendValue>{renderedDisplayValue}</LegendValue>
|
|
34
|
+
) : null}
|
|
35
|
+
</LegendItem>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default ProgressSegmentedBarLegendItem;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import styled from '@emotion/native';
|
|
2
|
+
import Box from '../../Box';
|
|
3
|
+
|
|
4
|
+
const LegendBox = styled(Box)(({ theme }) => ({
|
|
5
|
+
flexDirection: 'row',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
flexWrap: 'wrap',
|
|
8
|
+
marginTop: theme.__hd__.progress.space.segmentedLegendMarginTop,
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
const LegendItem = styled(Box)(({ theme }) => ({
|
|
12
|
+
flexDirection: 'row',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
marginRight: theme.__hd__.progress.space.legendGap,
|
|
15
|
+
marginBottom: theme.__hd__.progress.space.legendGap,
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
const LegendCircle = styled(Box)<{ themeColor: string }>(
|
|
19
|
+
({ theme, themeColor }) => ({
|
|
20
|
+
width: theme.__hd__.progress.sizes.legendWidth,
|
|
21
|
+
height: theme.__hd__.progress.sizes.legendHeight,
|
|
22
|
+
borderRadius: theme.__hd__.progress.radii.legendCircle,
|
|
23
|
+
backgroundColor: themeColor,
|
|
24
|
+
marginRight: theme.__hd__.progress.space.legendInnerGap,
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const LegendValue = styled(Box)(({ theme }) => ({
|
|
29
|
+
marginLeft: theme.__hd__.progress.space.legendInnerGap,
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
export { LegendBox, LegendCircle, LegendItem, LegendValue };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import styled from '@emotion/native';
|
|
2
|
+
import Box from '../../Box';
|
|
3
|
+
|
|
4
|
+
const StyledHeader = styled(Box)(({ theme }) => ({
|
|
5
|
+
flexDirection: 'row',
|
|
6
|
+
justifyContent: 'space-between',
|
|
7
|
+
alignItems: 'baseline',
|
|
8
|
+
flexWrap: 'wrap',
|
|
9
|
+
marginBottom: theme.__hd__.progress.space.segmentedHeaderMarginBottom,
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
const StyledTrack = styled(Box)(({ theme }) => ({
|
|
13
|
+
width: '100%',
|
|
14
|
+
height: theme.__hd__.progress.sizes.barHeight,
|
|
15
|
+
borderRadius: theme.__hd__.progress.radii.default,
|
|
16
|
+
overflow: 'hidden',
|
|
17
|
+
flexDirection: 'row',
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
const StyledSegment = styled(Box)<{
|
|
21
|
+
themeColor: string;
|
|
22
|
+
themeWidthPercent: number;
|
|
23
|
+
}>(({ themeColor, themeWidthPercent }) => ({
|
|
24
|
+
backgroundColor: themeColor,
|
|
25
|
+
flexGrow: 0,
|
|
26
|
+
flexShrink: 0,
|
|
27
|
+
width: `${themeWidthPercent}%`,
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
export { StyledHeader, StyledSegment, StyledTrack };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import renderWithTheme from '../../../../testHelpers/renderWithTheme';
|
|
3
|
+
import ProgressSegmentedBar from '..';
|
|
4
|
+
import { SEGMENTED_BAR_ERRORS } from '../constants';
|
|
5
|
+
|
|
6
|
+
describe('Progress.SegmentedBar', () => {
|
|
7
|
+
it('renders correctly with header', () => {
|
|
8
|
+
const { getByTestId, getByText } = renderWithTheme(
|
|
9
|
+
<ProgressSegmentedBar
|
|
10
|
+
testID="progress-segmented"
|
|
11
|
+
headerConfig={{ left: 'Title', right: 'Right' }}
|
|
12
|
+
data={[
|
|
13
|
+
{ label: 'A', data: 25 },
|
|
14
|
+
{ label: 'B', data: 25 },
|
|
15
|
+
]}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
expect(getByTestId('progress-segmented')).toBeVisible();
|
|
20
|
+
expect(getByTestId('progress-segmented-header')).toBeVisible();
|
|
21
|
+
expect(getByTestId('progress-segmented-track')).toBeVisible();
|
|
22
|
+
expect(getByTestId('progress-segmented-segment-A')).toBeVisible();
|
|
23
|
+
expect(getByTestId('progress-segmented-segment-B')).toBeVisible();
|
|
24
|
+
expect(getByTestId('progress-segmented-segment-remainder')).toBeVisible();
|
|
25
|
+
expect(getByText('Title')).toBeVisible();
|
|
26
|
+
expect(getByText('Right')).toBeVisible();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('renders legend when legendConfig is provided', () => {
|
|
30
|
+
const { getByTestId, getByText } = renderWithTheme(
|
|
31
|
+
<ProgressSegmentedBar
|
|
32
|
+
testID="progress-segmented"
|
|
33
|
+
legendConfig={{ displayValues: ['40%', '60%'] }}
|
|
34
|
+
data={[
|
|
35
|
+
{ label: 'A', data: 40 },
|
|
36
|
+
{ label: 'B', data: 60 },
|
|
37
|
+
]}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
expect(getByTestId('progress-segmented-legend')).toBeVisible();
|
|
42
|
+
expect(getByTestId('progress-segmented-legend-A')).toBeVisible();
|
|
43
|
+
expect(getByText('A:')).toBeVisible();
|
|
44
|
+
expect(getByText('40%')).toBeVisible();
|
|
45
|
+
expect(getByText('B:')).toBeVisible();
|
|
46
|
+
expect(getByText('60%')).toBeVisible();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('renders without legend when legendConfig is not provided', () => {
|
|
50
|
+
const { getByTestId, queryByTestId } = renderWithTheme(
|
|
51
|
+
<ProgressSegmentedBar
|
|
52
|
+
testID="progress-segmented"
|
|
53
|
+
data={[
|
|
54
|
+
{ label: 'A', data: 40 },
|
|
55
|
+
{ label: 'B', data: 60 },
|
|
56
|
+
]}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
expect(getByTestId('progress-segmented-track')).toBeVisible();
|
|
61
|
+
expect(queryByTestId('progress-segmented-legend')).toBeNull();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('renders without legend when legendConfig is empty object', () => {
|
|
65
|
+
const { getByTestId, queryByTestId } = renderWithTheme(
|
|
66
|
+
<ProgressSegmentedBar
|
|
67
|
+
testID="progress-segmented"
|
|
68
|
+
legendConfig={{}}
|
|
69
|
+
data={[
|
|
70
|
+
{ label: 'A', data: 40 },
|
|
71
|
+
{ label: 'B', data: 60 },
|
|
72
|
+
]}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
expect(getByTestId('progress-segmented-track')).toBeVisible();
|
|
77
|
+
expect(queryByTestId('progress-segmented-legend')).toBeNull();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('throws on negative segment value', () => {
|
|
81
|
+
expect(() =>
|
|
82
|
+
renderWithTheme(
|
|
83
|
+
<ProgressSegmentedBar
|
|
84
|
+
testID="progress-segmented"
|
|
85
|
+
data={[
|
|
86
|
+
{ label: 'A', data: 25 },
|
|
87
|
+
{ label: 'B', data: -10 },
|
|
88
|
+
]}
|
|
89
|
+
/>
|
|
90
|
+
)
|
|
91
|
+
).toThrow(SEGMENTED_BAR_ERRORS.negativeValue.replace('$value', '-10'));
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it.each`
|
|
95
|
+
description | legendConfig
|
|
96
|
+
${'fewer display values than data'} | ${{ displayValues: ['30%'] }}
|
|
97
|
+
${'display values contain undefined'} | ${{ displayValues: ['40%', undefined] }}
|
|
98
|
+
${'more display values than data'} | ${{ displayValues: ['40%', '60%', 'extra'] }}
|
|
99
|
+
`(
|
|
100
|
+
'throws when legend display values are invalid: $description',
|
|
101
|
+
({ legendConfig }) => {
|
|
102
|
+
expect(() =>
|
|
103
|
+
renderWithTheme(
|
|
104
|
+
<ProgressSegmentedBar
|
|
105
|
+
data={[
|
|
106
|
+
{ label: 'A', data: 25 },
|
|
107
|
+
{ label: 'B', data: 25 },
|
|
108
|
+
]}
|
|
109
|
+
legendConfig={legendConfig}
|
|
110
|
+
/>
|
|
111
|
+
)
|
|
112
|
+
).toThrow(SEGMENTED_BAR_ERRORS.legendDisplayValues);
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getTextComponent } from '../utils';
|
|
3
|
+
import Typography from '../../../Typography';
|
|
4
|
+
|
|
5
|
+
const TextComponent = (
|
|
6
|
+
<Typography.Caption intent="muted">Sample Text</Typography.Caption>
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
describe('getTextComponent', () => {
|
|
10
|
+
it('should return null when content is falsy', () => {
|
|
11
|
+
expect(getTextComponent(null, TextComponent)).toBeNull();
|
|
12
|
+
expect(getTextComponent(undefined, TextComponent)).toBeNull();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('should return TextComponent when content is a string or number', () => {
|
|
16
|
+
expect(getTextComponent('Progress', TextComponent)).toBe(TextComponent);
|
|
17
|
+
expect(getTextComponent(50, TextComponent)).toBe(TextComponent);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should return content when it is a ReactNode', () => {
|
|
21
|
+
const customContent = <Typography.Body>Custom Content</Typography.Body>;
|
|
22
|
+
expect(getTextComponent(customContent, TextComponent)).toBe(customContent);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const MIN_PROGRESS_VALUE = 0;
|
|
2
|
+
export const MAX_PROGRESS_VALUE = 100;
|
|
3
|
+
|
|
4
|
+
export const SEGMENTED_BAR_ERRORS = {
|
|
5
|
+
negativeValue: '[Progress.SegmentedBar] value:$value is less than 0',
|
|
6
|
+
legendDisplayValues:
|
|
7
|
+
'[Progress.SegmentedBar] legendConfig.displayValues must include a non-null/non-undefined entry for each data series (length must match and no null/undefined values are allowed)',
|
|
8
|
+
} as const;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { SEGMENTED_BAR_ERRORS } from '../constants';
|
|
4
|
+
|
|
5
|
+
import { assert } from '../../../../utils/helpers';
|
|
6
|
+
import type {
|
|
7
|
+
SegmentedBarLegendConfig,
|
|
8
|
+
SegmentedBarLegendDisplayValue,
|
|
9
|
+
} from '../types';
|
|
10
|
+
|
|
11
|
+
export const useValidateSegmentedBarData = ({
|
|
12
|
+
values,
|
|
13
|
+
dataLength,
|
|
14
|
+
}: {
|
|
15
|
+
dataLength: number;
|
|
16
|
+
values: number[];
|
|
17
|
+
}) => {
|
|
18
|
+
const { hasNegativeValue, negativeValue } = React.useMemo(() => {
|
|
19
|
+
const foundNegativeValue = values.find((value) => value < 0);
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
hasNegativeValue: foundNegativeValue !== undefined,
|
|
23
|
+
negativeValue: foundNegativeValue,
|
|
24
|
+
};
|
|
25
|
+
}, [dataLength, values]);
|
|
26
|
+
|
|
27
|
+
assert(
|
|
28
|
+
!hasNegativeValue,
|
|
29
|
+
SEGMENTED_BAR_ERRORS.negativeValue.replace('$value', String(negativeValue))
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const useValidateSegmentedBarLegendDisplayValues = ({
|
|
34
|
+
dataLength,
|
|
35
|
+
legendConfig,
|
|
36
|
+
fallbackValues,
|
|
37
|
+
}: {
|
|
38
|
+
dataLength: number;
|
|
39
|
+
legendConfig: SegmentedBarLegendConfig | undefined;
|
|
40
|
+
fallbackValues: ReadonlyArray<SegmentedBarLegendDisplayValue>;
|
|
41
|
+
}): ReadonlyArray<SegmentedBarLegendDisplayValue> => {
|
|
42
|
+
const displayValues = legendConfig?.displayValues;
|
|
43
|
+
|
|
44
|
+
const { valuesToUse, hasLengthMismatch, hasEmptyEntry } =
|
|
45
|
+
React.useMemo(() => {
|
|
46
|
+
if (displayValues === undefined) {
|
|
47
|
+
return {
|
|
48
|
+
valuesToUse: fallbackValues,
|
|
49
|
+
hasLengthMismatch: false,
|
|
50
|
+
hasEmptyEntry: false,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const isLengthMismatch = displayValues.length !== dataLength;
|
|
55
|
+
const isEmptyEntry = displayValues.some(
|
|
56
|
+
(value) => value === undefined || value === null
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
valuesToUse: displayValues,
|
|
61
|
+
hasLengthMismatch: isLengthMismatch,
|
|
62
|
+
hasEmptyEntry: isEmptyEntry,
|
|
63
|
+
};
|
|
64
|
+
}, [dataLength, displayValues, fallbackValues]);
|
|
65
|
+
|
|
66
|
+
assert(
|
|
67
|
+
!(hasLengthMismatch || hasEmptyEntry),
|
|
68
|
+
SEGMENTED_BAR_ERRORS.legendDisplayValues
|
|
69
|
+
);
|
|
70
|
+
return valuesToUse;
|
|
71
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { useTheme } from '@emotion/react';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import Typography from '../../Typography';
|
|
6
|
+
|
|
7
|
+
import Box from '../../Box';
|
|
8
|
+
import { MAX_PROGRESS_VALUE, MIN_PROGRESS_VALUE } from './constants';
|
|
9
|
+
import {
|
|
10
|
+
useValidateSegmentedBarData,
|
|
11
|
+
useValidateSegmentedBarLegendDisplayValues,
|
|
12
|
+
} from './hooks/validation';
|
|
13
|
+
import LegendItem from './Legend';
|
|
14
|
+
import { LegendBox } from './StyledLegend';
|
|
15
|
+
import { StyledHeader, StyledSegment, StyledTrack } from './StyledSegmentedBar';
|
|
16
|
+
import type { ProgressSegmentedBarProps } from './types';
|
|
17
|
+
import { getTextComponent } from './utils';
|
|
18
|
+
|
|
19
|
+
const ProgressSegmentedBar = ({
|
|
20
|
+
data,
|
|
21
|
+
headerConfig,
|
|
22
|
+
legendConfig,
|
|
23
|
+
style,
|
|
24
|
+
testID,
|
|
25
|
+
...nativeProps
|
|
26
|
+
}: ProgressSegmentedBarProps): ReactElement => {
|
|
27
|
+
const values = React.useMemo(() => data.map((s) => s.data), [data]);
|
|
28
|
+
useValidateSegmentedBarData({ dataLength: data.length, values });
|
|
29
|
+
|
|
30
|
+
const legendDisplayValues = useValidateSegmentedBarLegendDisplayValues({
|
|
31
|
+
dataLength: data.length,
|
|
32
|
+
legendConfig,
|
|
33
|
+
fallbackValues: values,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const theme = useTheme();
|
|
37
|
+
const totalPercent = React.useMemo(
|
|
38
|
+
() => values.reduce((acc, value) => acc + value, 0),
|
|
39
|
+
[values]
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const ariaValueMax =
|
|
43
|
+
totalPercent > MAX_PROGRESS_VALUE ? totalPercent : MAX_PROGRESS_VALUE;
|
|
44
|
+
|
|
45
|
+
const remainderPercent = React.useMemo(() => {
|
|
46
|
+
return totalPercent >= MAX_PROGRESS_VALUE
|
|
47
|
+
? 0
|
|
48
|
+
: MAX_PROGRESS_VALUE - totalPercent;
|
|
49
|
+
}, [totalPercent]);
|
|
50
|
+
|
|
51
|
+
// Mock colors
|
|
52
|
+
const segmentColors = [
|
|
53
|
+
theme.colors.primary,
|
|
54
|
+
theme.colors.success,
|
|
55
|
+
theme.colors.warning,
|
|
56
|
+
theme.colors.error,
|
|
57
|
+
theme.colors.info,
|
|
58
|
+
theme.colors.archived,
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
const headerRight = React.useMemo(
|
|
62
|
+
() =>
|
|
63
|
+
getTextComponent(
|
|
64
|
+
headerConfig?.right,
|
|
65
|
+
<Typography.Caption intent="muted">
|
|
66
|
+
{headerConfig?.right}
|
|
67
|
+
</Typography.Caption>
|
|
68
|
+
),
|
|
69
|
+
[headerConfig?.right]
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const showHeader = Boolean(headerConfig?.left || headerRight);
|
|
73
|
+
const showLegend = Boolean(
|
|
74
|
+
legendConfig && Object.keys(legendConfig).length > 0
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<Box {...nativeProps} style={style} testID={testID}>
|
|
79
|
+
{showHeader ? (
|
|
80
|
+
<StyledHeader testID={testID ? `${testID}-header` : undefined}>
|
|
81
|
+
{headerConfig?.left ? (
|
|
82
|
+
<Typography.Body
|
|
83
|
+
variant="regular-bold"
|
|
84
|
+
testID={testID ? `${testID}-header-left` : undefined}
|
|
85
|
+
>
|
|
86
|
+
{headerConfig.left}
|
|
87
|
+
</Typography.Body>
|
|
88
|
+
) : null}
|
|
89
|
+
|
|
90
|
+
{headerRight ? (
|
|
91
|
+
<Box testID={testID ? `${testID}-header-right` : undefined}>
|
|
92
|
+
{headerRight}
|
|
93
|
+
</Box>
|
|
94
|
+
) : null}
|
|
95
|
+
</StyledHeader>
|
|
96
|
+
) : null}
|
|
97
|
+
|
|
98
|
+
<StyledTrack
|
|
99
|
+
testID={testID ? `${testID}-track` : undefined}
|
|
100
|
+
accessibilityRole="progressbar"
|
|
101
|
+
accessibilityValue={{
|
|
102
|
+
min: MIN_PROGRESS_VALUE,
|
|
103
|
+
max: ariaValueMax,
|
|
104
|
+
now: totalPercent,
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
{data.map((s, index) => {
|
|
108
|
+
const segmentColor = segmentColors[index % segmentColors.length];
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<StyledSegment
|
|
112
|
+
key={`${s.label}-${segmentColor}`}
|
|
113
|
+
themeColor={segmentColor}
|
|
114
|
+
themeWidthPercent={s.data}
|
|
115
|
+
testID={testID ? `${testID}-segment-${s.label}` : undefined}
|
|
116
|
+
/>
|
|
117
|
+
);
|
|
118
|
+
})}
|
|
119
|
+
|
|
120
|
+
{remainderPercent > 0 ? (
|
|
121
|
+
<StyledSegment
|
|
122
|
+
key="remainder"
|
|
123
|
+
themeColor={
|
|
124
|
+
theme.__hd__.progress.colors.segmentedRemainderBackground
|
|
125
|
+
}
|
|
126
|
+
themeWidthPercent={remainderPercent}
|
|
127
|
+
testID={testID ? `${testID}-segment-remainder` : undefined}
|
|
128
|
+
/>
|
|
129
|
+
) : null}
|
|
130
|
+
</StyledTrack>
|
|
131
|
+
|
|
132
|
+
{showLegend ? (
|
|
133
|
+
<LegendBox
|
|
134
|
+
testID={testID ? `${testID}-legend` : 'segmented-progress-legend'}
|
|
135
|
+
>
|
|
136
|
+
{data.map((item, index) => (
|
|
137
|
+
<LegendItem
|
|
138
|
+
key={`${item.label}-${
|
|
139
|
+
segmentColors[index % segmentColors.length]
|
|
140
|
+
}`}
|
|
141
|
+
title={item.label}
|
|
142
|
+
color={segmentColors[index % segmentColors.length]}
|
|
143
|
+
displayValue={legendDisplayValues[index]}
|
|
144
|
+
testID={testID ? `${testID}-legend-${item.label}` : undefined}
|
|
145
|
+
/>
|
|
146
|
+
))}
|
|
147
|
+
</LegendBox>
|
|
148
|
+
) : null}
|
|
149
|
+
</Box>
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export default ProgressSegmentedBar;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import type { ViewProps } from 'react-native';
|
|
4
|
+
|
|
5
|
+
export interface SegmentedBarSeries<Data> {
|
|
6
|
+
/**
|
|
7
|
+
* Label of series.
|
|
8
|
+
*/
|
|
9
|
+
label: string;
|
|
10
|
+
/**
|
|
11
|
+
* Data of series.
|
|
12
|
+
*/
|
|
13
|
+
data: Data;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type SegmentedBarData = Array<SegmentedBarSeries<number>>;
|
|
17
|
+
|
|
18
|
+
export interface SegmentedBarHeaderConfig {
|
|
19
|
+
/**
|
|
20
|
+
* Left header content.
|
|
21
|
+
*/
|
|
22
|
+
left?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Right header content.
|
|
25
|
+
*/
|
|
26
|
+
right?: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type SegmentedBarLegendDisplayValue = string | number | ReactElement;
|
|
30
|
+
|
|
31
|
+
export interface SegmentedBarLegendConfig {
|
|
32
|
+
/**
|
|
33
|
+
* Optional values shown next to each series label.
|
|
34
|
+
*
|
|
35
|
+
* Entries are index-aligned with `data`.
|
|
36
|
+
*/
|
|
37
|
+
displayValues?: Array<SegmentedBarLegendDisplayValue>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ProgressSegmentedBarProps extends ViewProps {
|
|
41
|
+
/**
|
|
42
|
+
* Segmented data.
|
|
43
|
+
*
|
|
44
|
+
* Each segment value is treated as a percentage amount.
|
|
45
|
+
*
|
|
46
|
+
* Runtime validation:
|
|
47
|
+
* - Throws if any segment value is negative.
|
|
48
|
+
* - Values do not need to sum to 100; if the total exceeds 100, the bar will be fully filled and no remainder segment will be shown.
|
|
49
|
+
*/
|
|
50
|
+
data: SegmentedBarData;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Optional header content.
|
|
54
|
+
*/
|
|
55
|
+
headerConfig?: SegmentedBarHeaderConfig;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Optional legend config.
|
|
59
|
+
* If provided, the legend is rendered below the segmented bar.
|
|
60
|
+
*/
|
|
61
|
+
legendConfig?: SegmentedBarLegendConfig;
|
|
62
|
+
}
|