@evolve.ui/core-components 1.0.0 → 1.1.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/Checkbox.d.cts +1 -1
- package/Checkbox.d.mts +1 -1
- package/{DateInput-B8XQZPTx.d.cts → DateInput-CFxTZu3m.d.mts} +2 -2
- package/{DateInput-B8XQZPTx.d.cts.map → DateInput-CFxTZu3m.d.mts.map} +1 -1
- package/{DateInput-CfNmywqQ.d.mts → DateInput-DstMICTl.d.cts} +2 -2
- package/{DateInput-CfNmywqQ.d.mts.map → DateInput-DstMICTl.d.cts.map} +1 -1
- package/{FavoriteButton-CowOPoqo.d.cts → FavoriteButton-BGF-3dze.d.cts} +2 -2
- package/{FavoriteButton-BRY8FVpV.d.mts.map → FavoriteButton-BGF-3dze.d.cts.map} +1 -1
- package/{FavoriteButton-BRY8FVpV.d.mts → FavoriteButton-BZEGWrRo.d.mts} +2 -2
- package/{FavoriteButton-CowOPoqo.d.cts.map → FavoriteButton-BZEGWrRo.d.mts.map} +1 -1
- package/Input.d.cts +1 -1
- package/Input.d.mts +1 -1
- package/Radio.d.cts +1 -1
- package/Radio.d.mts +1 -1
- package/{TextInput-BhkeQZh4.d.cts → TextInput-B7lqQ1gh.d.cts} +3 -3
- package/{TextInput-BhkeQZh4.d.cts.map → TextInput-B7lqQ1gh.d.cts.map} +1 -1
- package/{TextInput-CWCeR18b.d.mts → TextInput-CxoT3np_.d.mts} +3 -3
- package/{TextInput-CWCeR18b.d.mts.map → TextInput-CxoT3np_.d.mts.map} +1 -1
- package/dateInput.d.cts +1 -1
- package/dateInput.d.mts +1 -1
- package/datePicker.d.cts +1 -1
- package/datePicker.d.mts +1 -1
- package/evolve-ui.entries.json +556 -0
- package/favoriteButton.d.cts +1 -1
- package/favoriteButton.d.mts +1 -1
- package/featureFlags/hooks.d.cts +1 -1
- package/featureFlags/hooks.d.mts +1 -1
- package/fileUpload/testUtils/mockFilesAndImages.d.cts +3 -3
- package/fileUpload/testUtils/mockFilesAndImages.d.cts.map +1 -1
- package/fileUpload/testUtils/mockFilesAndImages.d.mts +3 -3
- package/fileUpload/testUtils/mockFilesAndImages.d.mts.map +1 -1
- package/fileUpload/testUtils/testUtils.d.cts +1 -1
- package/fileUpload/testUtils/testUtils.d.cts.map +1 -1
- package/fileUpload/testUtils/testUtils.d.mts +1 -1
- package/fileUpload/testUtils/testUtils.d.mts.map +1 -1
- package/{index-BVb-FJDo.d.mts → index-BYPklw8m.d.mts} +2 -2
- package/{index-BVb-FJDo.d.mts.map → index-BYPklw8m.d.mts.map} +1 -1
- package/{index-3V0Y3AU3.d.mts → index-Bvn6svaT.d.cts} +2 -2
- package/{index-3V0Y3AU3.d.mts.map → index-Bvn6svaT.d.cts.map} +1 -1
- package/{index-Bu7c6X7O.d.mts → index-C2zPeUs9.d.mts} +5 -5
- package/{index-Bu7c6X7O.d.mts.map → index-C2zPeUs9.d.mts.map} +1 -1
- package/{index-BXz3rMMk.d.cts → index-Cmz2OD6x.d.cts} +2 -2
- package/{index-BXz3rMMk.d.cts.map → index-Cmz2OD6x.d.cts.map} +1 -1
- package/{index-kchg551L.d.cts → index-DsZAxqnF.d.mts} +2 -2
- package/{index-kchg551L.d.cts.map → index-DsZAxqnF.d.mts.map} +1 -1
- package/{index-BzN9RaXe.d.cts → index-QtMvgJcp.d.cts} +5 -5
- package/{index-BzN9RaXe.d.cts.map → index-QtMvgJcp.d.cts.map} +1 -1
- package/{index-dpfLYhgI.d.mts → index-hrztez-b.d.mts} +2 -2
- package/{index-DBYqF9Sr.d.cts.map → index-hrztez-b.d.mts.map} +1 -1
- package/{index-DBYqF9Sr.d.cts → index-o9dwzLLE.d.cts} +2 -2
- package/{index-dpfLYhgI.d.mts.map → index-o9dwzLLE.d.cts.map} +1 -1
- package/index.d.cts +7 -7
- package/index.d.mts +7 -7
- package/package.json +2 -2
- package/providers.d.cts +1 -1
- package/providers.d.mts +1 -1
- package/src/Accordion/Accordion.tsx +233 -0
- package/src/AddressDisplay/AddressDisplay.tsx +43 -0
- package/src/AddressDisplay/components/addressComponents.tsx +111 -0
- package/src/AddressDisplay/components/addressField.tsx +25 -0
- package/src/AddressDisplay/components/addressSection.tsx +8 -0
- package/src/AddressDisplay/components/getCountryValue.tsx +31 -0
- package/src/AddressDisplay/types.ts +26 -0
- package/src/AutomatedCarousel/AutomatedCarousel.tsx +163 -0
- package/src/AutomatedCarousel/automatedCarousel.types.ts +7 -0
- package/src/AutomatedCarousel/components/CarouselProgressBar/CarouselProgressBar.tsx +139 -0
- package/src/AutomatedCarousel/components/CarouselProgressBar/components/CarouselProgressBarUnit/CarouselProgressBarUnit.tsx +165 -0
- package/src/Badge/Badge.tsx +104 -0
- package/src/Badge/Badge.types.ts +58 -0
- package/src/Badge/ItemBadge.tsx +97 -0
- package/src/Badge/LiveStatusBadge.tsx +93 -0
- package/src/BannerNotification/BannerNotification.tsx +157 -0
- package/src/BannerNotification/components/BannerNotificationSkeleton.tsx +39 -0
- package/src/BannerNotification/components/CalloutIcon/BannerIcon.tsx +48 -0
- package/src/BannerNotification/utils/getRandomTooltipId.ts +3 -0
- package/src/BottomSheet/BottomSheet.tsx +476 -0
- package/src/BottomSheet/components/BottomSheetBackdrop/BottomSheetBackdrop.tsx +47 -0
- package/src/BottomSheet/components/BottomSheetContentArea/BottomSheetContentArea.tsx +92 -0
- package/src/BottomSheet/components/BottomSheetOverlay/BottomSheetOverlayTranslate3d.tsx +196 -0
- package/src/BottomSheet/components/SheetDescription/SheetDescription.tsx +22 -0
- package/src/BottomSheet/components/SheetTitle/SheetTitle.tsx +21 -0
- package/src/BottomSheet/components/index.tsx +5 -0
- package/src/BottomSheet/hooks/index.tsx +13 -0
- package/src/BottomSheet/hooks/useAriaHider.tsx +91 -0
- package/src/BottomSheet/hooks/useBottomSheetServices.tsx +224 -0
- package/src/BottomSheet/hooks/useDragHandler.tsx +282 -0
- package/src/BottomSheet/hooks/useFocusTrap.tsx +113 -0
- package/src/BottomSheet/hooks/useLayoutEffect.tsx +4 -0
- package/src/BottomSheet/hooks/useOptimizedResizeObserver.tsx +94 -0
- package/src/BottomSheet/hooks/useOptimizedScrollState.tsx +87 -0
- package/src/BottomSheet/hooks/useReady.tsx +34 -0
- package/src/BottomSheet/hooks/useReducedMotion.tsx +22 -0
- package/src/BottomSheet/hooks/useScrollLock.tsx +143 -0
- package/src/BottomSheet/hooks/useSnapPoints.tsx +355 -0
- package/src/BottomSheet/hooks/useSpring.tsx +47 -0
- package/src/BottomSheet/hooks/useSpringInterpolationsTranslate3d.tsx +101 -0
- package/src/BottomSheet/index.tsx +237 -0
- package/src/BottomSheet/state/atoms.ts +147 -0
- package/src/BottomSheet/state/useBottomSheetStateMachine.ts +246 -0
- package/src/BottomSheet/types.ts +172 -0
- package/src/BottomSheet/utils.ts +65 -0
- package/src/Breadcrumbs/Breadcrumbs.tsx +126 -0
- package/src/Button/Button.tsx +164 -0
- package/src/Button/Button.types.ts +80 -0
- package/src/Button/buttonColorClasses.ts +53 -0
- package/src/Callout/Callout.tsx +136 -0
- package/src/Callout/Callout.types.ts +29 -0
- package/src/Callout/components/CalloutIcon/CalloutIcon.tsx +56 -0
- package/src/Card/CardGrid.tsx +263 -0
- package/src/Card/SingleCard.tsx +22 -0
- package/src/Card/cardFactory.tsx +176 -0
- package/src/Card/components/createBadge.tsx +34 -0
- package/src/Card/components/createFavoriteButton.tsx +40 -0
- package/src/Card/components/createImage.tsx +64 -0
- package/src/Card/components/createInfo.tsx +84 -0
- package/src/Card/components/createName.tsx +63 -0
- package/src/Card/components/createPriceStatus.tsx +100 -0
- package/src/Card/components/types.ts +4 -0
- package/src/Card/hooks/useCardVisibilityTracking.ts +82 -0
- package/src/Card/sharedProps.ts +12 -0
- package/src/Card/types.ts +62 -0
- package/src/Carousel/Carousel.tsx +513 -0
- package/src/Carousel/Carousel.types.ts +43 -0
- package/src/Carousel/Carousel.utils.ts +63 -0
- package/src/Carousel/components/DotButton/DotButton.tsx +42 -0
- package/src/Carousel/components/NavigationButtons/NavigationButtons.tsx +77 -0
- package/src/Carousel/components/TitleSection/TitleSection.tsx +61 -0
- package/src/Carousel/components/TitleSection/components/SubHeaderLeft/SubHeaderLeft.tsx +53 -0
- package/src/Carousel/components/TitleSection/components/Title/Title.tsx +46 -0
- package/src/Carousel/index.ts +2 -0
- package/src/Carousel/testUtils.ts +10 -0
- package/src/Chips/Chip.tsx +153 -0
- package/src/Chips/ChipGroup.tsx +173 -0
- package/src/Chips/SuggestionChip.tsx +15 -0
- package/src/Chips/chipTypes.ts +113 -0
- package/src/Chips/index.ts +4 -0
- package/src/ChoiceListItem/Checkbox.tsx +69 -0
- package/src/ChoiceListItem/Radio.tsx +61 -0
- package/src/ChoiceListItem/choiceListItem.tsx +99 -0
- package/src/ChoiceListItem/common.tsx +148 -0
- package/src/ChoiceListItem/index.ts +3 -0
- package/src/Collapsible/Collapsible.tsx +58 -0
- package/src/Confetti/Confetti.tsx +270 -0
- package/src/Confetti/index.ts +2 -0
- package/src/ContentPager/ContentPager.tsx +189 -0
- package/src/ContentPager/components/Page.tsx +24 -0
- package/src/CookieConsent/components/CookieCategoryRow/CookieCategoryRow.tsx +30 -0
- package/src/CookieConsent/components/CookieConsent/CookieConsent.tsx +74 -0
- package/src/CookieConsent/components/CookieConsentBanner/CookieConsentBanner.tsx +51 -0
- package/src/CookieConsent/components/CookieConsentModal/CookieConsentModal.tsx +64 -0
- package/src/CookieConsent/hooks/useCookieConsent.ts +170 -0
- package/src/CookieConsent/hooks/useCookieConsentState.ts +142 -0
- package/src/CookieConsent/index.ts +16 -0
- package/src/CookieConsent/types/cookieConsent.types.ts +79 -0
- package/src/CookieConsent/types/index.ts +7 -0
- package/src/Countdown/Countdown.tsx +161 -0
- package/src/Countdown/Countdown.types.ts +4 -0
- package/src/Countdown/hooks/useGetCountdown.ts +103 -0
- package/src/DateTimeInput/dateInput/DateInput.tsx +199 -0
- package/src/DateTimeInput/datePicker/DatePicker.tsx +138 -0
- package/src/DateTimeInput/datePicker/components/calendar/Calendar.tsx +72 -0
- package/src/DateTimeInput/datePicker/index.ts +2 -0
- package/src/DateTimeInput/timeInput/TimeInput.tsx +128 -0
- package/src/DateTimeInput/timePicker/TimePicker.tsx +118 -0
- package/src/DateTimeInput/timePicker/components/TimePopover/AmPmSwitch.tsx +103 -0
- package/src/DateTimeInput/timePicker/components/TimePopover/TimeFieldInput.tsx +26 -0
- package/src/DateTimeInput/timePicker/components/TimePopover/TimePopover.tsx +84 -0
- package/src/DateTimeInput/timePicker/components/TimePopover/TimePopover.utils.ts +67 -0
- package/src/DateTimeInput/timePicker/components/TimePopover/TimePopoverActions.tsx +26 -0
- package/src/DateTimeInput/timePicker/index.ts +2 -0
- package/src/DateTimeInput/utils/getDisplayDate.ts +15 -0
- package/src/DateTimeInput/utils/getDisplayTime.ts +15 -0
- package/src/DateTimeInput/utils/index.ts +2 -0
- package/src/DateTimeInput/utils/parseTimeValue.ts +54 -0
- package/src/Drawer/Drawer.tsx +446 -0
- package/src/Drawer/atoms.ts +4 -0
- package/src/Drawer/components/DialogActions/DialogActions.tsx +33 -0
- package/src/Drawer/components/DialogContent/DialogContent.tsx +80 -0
- package/src/Drawer/components/DialogHeader/DialogHeader.tsx +68 -0
- package/src/EducationalPopover/EducationalPopover.tsx +174 -0
- package/src/FavoriteButton/FavoriteButton.tsx +64 -0
- package/src/FavoriteButton/components/IconOnlyFavoriteButton/IconOnlyFavoriteButton.tsx +80 -0
- package/src/FavoriteButton/components/LabeledAnimatedFavoriteButton/LabeledAnimatedFavoriteButton.tsx +179 -0
- package/src/FavoriteButton/components/LabeledFavoriteButton/LabeledFavoriteButton.tsx +71 -0
- package/src/FavoriteButton/components/SmallHeartStraightIcon/SmallHeartStraightIcon.tsx +14 -0
- package/src/FavoriteButton/hooks/useFavoriteButtonState.ts +30 -0
- package/src/FavoriteButton/index.ts +2 -0
- package/src/FavoriteButton/types/favoriteButton.ts +87 -0
- package/src/FeatureFlags/devTools/FeatureFlagDevToolsUI.tsx +226 -0
- package/src/FeatureFlags/devTools/getFeatureFlagCookieOverrides.ts +30 -0
- package/src/FeatureFlags/devTools/utils/cookies.ts +169 -0
- package/src/FeatureFlags/hooks/index.ts +2 -0
- package/src/FeatureFlags/hooks/useFeatureFlag.tsx +19 -0
- package/src/FeatureFlags/hooks/useFeatureFlags.tsx +15 -0
- package/src/FileUpload/components/FileCard/FileCard.tsx +50 -0
- package/src/FileUpload/components/FileDropzone/FileDropzone.tsx +221 -0
- package/src/FileUpload/components/FileDropzone/components/DropzoneContent/DropzoneContent.tsx +28 -0
- package/src/FileUpload/components/FileDropzone/components/DropzoneContent/DropzoneText.tsx +81 -0
- package/src/FileUpload/components/FileDropzone/components/FileDropzoneDebugger/FileDropzoneDebugger.tsx +40 -0
- package/src/FileUpload/components/FileDropzone/components/FileDropzoneDebugger/FileRejectionsDisplay.tsx +110 -0
- package/src/FileUpload/components/FileDropzoneOverlay/FileDropzoneOverlay.tsx +183 -0
- package/src/FileUpload/components/FileDropzoneOverlay/components/OverlayDropzoneContent.tsx +146 -0
- package/src/FileUpload/components/FileDropzoneOverlay/components/OverlayDropzoneDragText.tsx +42 -0
- package/src/FileUpload/components/FileDropzoneOverlay/styles.ts +79 -0
- package/src/FileUpload/components/FilePreviewList/FilePreviewList.tsx +251 -0
- package/src/FileUpload/components/FilePreviewList/virtualizerComponents/FilePreviewVirtualizedList/FilePreviewVirtualizedList.tsx +88 -0
- package/src/FileUpload/components/FileUpload/FileUpload.tsx +63 -0
- package/src/FileUpload/components/FileUploadCanvas/FileUploadCanvas.tsx +125 -0
- package/src/FileUpload/components/GridFileCard/GridFileCard.tsx +364 -0
- package/src/FileUpload/components/GridFileCard/utils/sortable.ts +48 -0
- package/src/FileUpload/components/ListFileCard/ListFileCard.tsx +259 -0
- package/src/FileUpload/components/types.ts +78 -0
- package/src/FileUpload/hooks/filePreview/useImageFilePreviewUrl.ts +62 -0
- package/src/FileUpload/hooks/index.ts +11 -0
- package/src/FileUpload/hooks/upload/useHandleDragEnter/useHandleDragEnter.ts +154 -0
- package/src/FileUpload/hooks/upload/useHandleDrop/createFileRejectionHelpers.ts +273 -0
- package/src/FileUpload/hooks/upload/useHandleDrop/useHandleDrop.ts +153 -0
- package/src/FileUpload/hooks/upload/useUploadAvailability/useUploadAvailability.ts +44 -0
- package/src/FileUpload/hooks/validation/createDropzoneValidator.ts +41 -0
- package/src/FileUpload/hooks/validation/useFileValidation.ts +25 -0
- package/src/FileUpload/hooks/validation/useFileValidationLogic.ts +107 -0
- package/src/FileUpload/hooks/validation/useValidationMessages.ts +92 -0
- package/src/FileUpload/hooks/validation/useValidationState.ts +171 -0
- package/src/FileUpload/index.ts +57 -0
- package/src/FileUpload/providers/FileUploadProvider.tsx +219 -0
- package/src/FileUpload/providers/UploadValidationProvider.tsx +159 -0
- package/src/FileUpload/testUtils/mockFilesAndImages.ts +64 -0
- package/src/FileUpload/testUtils/testUtils.ts +111 -0
- package/src/FileUpload/types/commonTypes.ts +267 -0
- package/src/FileUpload/types/index.ts +31 -0
- package/src/FileUpload/types/sharedTypes.ts +159 -0
- package/src/FileUpload/utils/constants.ts +79 -0
- package/src/FileUpload/utils/createMessageContext.ts +180 -0
- package/src/FileUpload/utils/getFileExtensionsFromAcceptedTypes.ts +73 -0
- package/src/FileUpload/utils/getFilePluralizationText.ts +68 -0
- package/src/FileUpload/utils/getMimeTypes.ts +26 -0
- package/src/FileUpload/utils/messageUtils.ts +41 -0
- package/src/FileUpload/utils/styles.ts +68 -0
- package/src/FormLabel/FormLabel.tsx +212 -0
- package/src/IconButton/IconButton.tsx +154 -0
- package/src/Icons/CreditCardIcon/CreditCardIcon.tsx +73 -0
- package/src/Icons/CreditCardIcon/cardIcons.tsx +270 -0
- package/src/Icons/IconBase.tsx +133 -0
- package/src/Icons/anyIcon.ts +3 -0
- package/src/Icons/generatedIcons/Archive.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowClockwise.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowDown.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowLeft.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowRight.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowSquareOut.tsx +51 -0
- package/src/Icons/generatedIcons/ArrowSquareRight.tsx +51 -0
- package/src/Icons/generatedIcons/ArrowUp.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowsCounterClockwise.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowsLeftRight.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowsOutCardinal.tsx +48 -0
- package/src/Icons/generatedIcons/Bank.tsx +48 -0
- package/src/Icons/generatedIcons/Bell.tsx +51 -0
- package/src/Icons/generatedIcons/BookBookmark.tsx +51 -0
- package/src/Icons/generatedIcons/BookmarksSimple.tsx +51 -0
- package/src/Icons/generatedIcons/Broadcast.tsx +48 -0
- package/src/Icons/generatedIcons/CalendarBlank.tsx +48 -0
- package/src/Icons/generatedIcons/CalendarStar.tsx +51 -0
- package/src/Icons/generatedIcons/Camera.tsx +51 -0
- package/src/Icons/generatedIcons/CaretDown.tsx +48 -0
- package/src/Icons/generatedIcons/CaretLeft.tsx +48 -0
- package/src/Icons/generatedIcons/CaretRight.tsx +48 -0
- package/src/Icons/generatedIcons/CaretUp.tsx +48 -0
- package/src/Icons/generatedIcons/Certificate.tsx +51 -0
- package/src/Icons/generatedIcons/ChartBar.tsx +48 -0
- package/src/Icons/generatedIcons/Check.tsx +51 -0
- package/src/Icons/generatedIcons/CheckCircle.tsx +48 -0
- package/src/Icons/generatedIcons/CirclesFour.tsx +51 -0
- package/src/Icons/generatedIcons/Clock.tsx +48 -0
- package/src/Icons/generatedIcons/ClockCountdown.tsx +48 -0
- package/src/Icons/generatedIcons/Close.tsx +51 -0
- package/src/Icons/generatedIcons/CloudArrowUp.tsx +51 -0
- package/src/Icons/generatedIcons/CloudWarning.tsx +51 -0
- package/src/Icons/generatedIcons/Code.tsx +48 -0
- package/src/Icons/generatedIcons/Compass.tsx +51 -0
- package/src/Icons/generatedIcons/Confetti.tsx +51 -0
- package/src/Icons/generatedIcons/Copy.tsx +48 -0
- package/src/Icons/generatedIcons/CornersOut.tsx +48 -0
- package/src/Icons/generatedIcons/CreditCard.tsx +48 -0
- package/src/Icons/generatedIcons/Crown.tsx +51 -0
- package/src/Icons/generatedIcons/CrownSimple.tsx +51 -0
- package/src/Icons/generatedIcons/CurrencyCircleDollar.tsx +48 -0
- package/src/Icons/generatedIcons/CurrencyDollarSimple.tsx +51 -0
- package/src/Icons/generatedIcons/Desktop.tsx +51 -0
- package/src/Icons/generatedIcons/Detective.tsx +51 -0
- package/src/Icons/generatedIcons/DotOutline.tsx +46 -0
- package/src/Icons/generatedIcons/DotsSixVertical.tsx +51 -0
- package/src/Icons/generatedIcons/DotsThreeOutline.tsx +51 -0
- package/src/Icons/generatedIcons/DotsThreeOutlineVertical.tsx +51 -0
- package/src/Icons/generatedIcons/DownloadSimple.tsx +51 -0
- package/src/Icons/generatedIcons/EnvelopeSimple.tsx +48 -0
- package/src/Icons/generatedIcons/Eraser.tsx +51 -0
- package/src/Icons/generatedIcons/Eye.tsx +51 -0
- package/src/Icons/generatedIcons/EyeSlash.tsx +51 -0
- package/src/Icons/generatedIcons/FacebookLogo.tsx +48 -0
- package/src/Icons/generatedIcons/FileArchive.tsx +48 -0
- package/src/Icons/generatedIcons/FileArrowDown.tsx +48 -0
- package/src/Icons/generatedIcons/FileCsv.tsx +48 -0
- package/src/Icons/generatedIcons/FilePdf.tsx +48 -0
- package/src/Icons/generatedIcons/FileText.tsx +48 -0
- package/src/Icons/generatedIcons/Files.tsx +51 -0
- package/src/Icons/generatedIcons/Fire.tsx +51 -0
- package/src/Icons/generatedIcons/Flag.tsx +51 -0
- package/src/Icons/generatedIcons/FlagBannerFold.tsx +48 -0
- package/src/Icons/generatedIcons/FloppyDisk.tsx +51 -0
- package/src/Icons/generatedIcons/Gauge.tsx +51 -0
- package/src/Icons/generatedIcons/Gavel.tsx +51 -0
- package/src/Icons/generatedIcons/Gear.tsx +51 -0
- package/src/Icons/generatedIcons/GlobeHemisphereWest.tsx +51 -0
- package/src/Icons/generatedIcons/GoogleLogo.tsx +48 -0
- package/src/Icons/generatedIcons/GridNine.tsx +51 -0
- package/src/Icons/generatedIcons/HandCoins.tsx +51 -0
- package/src/Icons/generatedIcons/HandbagSimple.tsx +51 -0
- package/src/Icons/generatedIcons/Headset.tsx +51 -0
- package/src/Icons/generatedIcons/HeartStraight.tsx +51 -0
- package/src/Icons/generatedIcons/HourglassLow.tsx +48 -0
- package/src/Icons/generatedIcons/House.tsx +51 -0
- package/src/Icons/generatedIcons/Image.tsx +51 -0
- package/src/Icons/generatedIcons/ImageSquare.tsx +51 -0
- package/src/Icons/generatedIcons/ImagesSquare.tsx +51 -0
- package/src/Icons/generatedIcons/Info.tsx +48 -0
- package/src/Icons/generatedIcons/InstagramLogo.tsx +51 -0
- package/src/Icons/generatedIcons/Lightning.tsx +48 -0
- package/src/Icons/generatedIcons/Link.tsx +51 -0
- package/src/Icons/generatedIcons/LinkedinLogo.tsx +51 -0
- package/src/Icons/generatedIcons/List.tsx +48 -0
- package/src/Icons/generatedIcons/Lock.tsx +51 -0
- package/src/Icons/generatedIcons/LockOpen.tsx +51 -0
- package/src/Icons/generatedIcons/MagnifyingGlass.tsx +48 -0
- package/src/Icons/generatedIcons/MapPin.tsx +51 -0
- package/src/Icons/generatedIcons/MapPinSimpleArea.tsx +48 -0
- package/src/Icons/generatedIcons/Medal.tsx +48 -0
- package/src/Icons/generatedIcons/Megaphone.tsx +48 -0
- package/src/Icons/generatedIcons/Minus.tsx +45 -0
- package/src/Icons/generatedIcons/Money.tsx +51 -0
- package/src/Icons/generatedIcons/Notches.tsx +48 -0
- package/src/Icons/generatedIcons/NotePencil.tsx +48 -0
- package/src/Icons/generatedIcons/Package.tsx +51 -0
- package/src/Icons/generatedIcons/PaintBrush.tsx +51 -0
- package/src/Icons/generatedIcons/PaperPlaneTilt.tsx +51 -0
- package/src/Icons/generatedIcons/Paperclip.tsx +51 -0
- package/src/Icons/generatedIcons/Pause.tsx +51 -0
- package/src/Icons/generatedIcons/PencilLine.tsx +51 -0
- package/src/Icons/generatedIcons/PencilRuler.tsx +51 -0
- package/src/Icons/generatedIcons/PencilSimple.tsx +51 -0
- package/src/Icons/generatedIcons/Phone.tsx +51 -0
- package/src/Icons/generatedIcons/PinterestLogo.tsx +51 -0
- package/src/Icons/generatedIcons/Play.tsx +51 -0
- package/src/Icons/generatedIcons/Plus.tsx +51 -0
- package/src/Icons/generatedIcons/PlusCircle.tsx +48 -0
- package/src/Icons/generatedIcons/Printer.tsx +51 -0
- package/src/Icons/generatedIcons/Question.tsx +48 -0
- package/src/Icons/generatedIcons/Receipt.tsx +51 -0
- package/src/Icons/generatedIcons/Rows.tsx +51 -0
- package/src/Icons/generatedIcons/SealCheck.tsx +51 -0
- package/src/Icons/generatedIcons/SelectionSlash.tsx +48 -0
- package/src/Icons/generatedIcons/ShareNetwork.tsx +51 -0
- package/src/Icons/generatedIcons/ShieldCheck.tsx +51 -0
- package/src/Icons/generatedIcons/ShieldStar.tsx +51 -0
- package/src/Icons/generatedIcons/ShoppingCart.tsx +48 -0
- package/src/Icons/generatedIcons/ShuffleAngular.tsx +48 -0
- package/src/Icons/generatedIcons/SidebarSimple.tsx +48 -0
- package/src/Icons/generatedIcons/SlidersHorizontal.tsx +51 -0
- package/src/Icons/generatedIcons/Smiley.tsx +48 -0
- package/src/Icons/generatedIcons/Sparkle.tsx +51 -0
- package/src/Icons/generatedIcons/SpinnerGap.tsx +48 -0
- package/src/Icons/generatedIcons/StackPlus.tsx +48 -0
- package/src/Icons/generatedIcons/Star.tsx +51 -0
- package/src/Icons/generatedIcons/Storefront.tsx +51 -0
- package/src/Icons/generatedIcons/Swap.tsx +51 -0
- package/src/Icons/generatedIcons/Tag.tsx +51 -0
- package/src/Icons/generatedIcons/ThumbsDown.tsx +48 -0
- package/src/Icons/generatedIcons/ThumbsUp.tsx +48 -0
- package/src/Icons/generatedIcons/Toolbox.tsx +48 -0
- package/src/Icons/generatedIcons/Trash.tsx +48 -0
- package/src/Icons/generatedIcons/TrendUp.tsx +48 -0
- package/src/Icons/generatedIcons/Trophy.tsx +51 -0
- package/src/Icons/generatedIcons/Truck.tsx +51 -0
- package/src/Icons/generatedIcons/UploadSimple.tsx +51 -0
- package/src/Icons/generatedIcons/User.tsx +48 -0
- package/src/Icons/generatedIcons/Users.tsx +48 -0
- package/src/Icons/generatedIcons/UsersThree.tsx +51 -0
- package/src/Icons/generatedIcons/VideoCamera.tsx +51 -0
- package/src/Icons/generatedIcons/Warning.tsx +51 -0
- package/src/Icons/generatedIcons/WarningCircle.tsx +48 -0
- package/src/Icons/generatedIcons/WifiHigh.tsx +51 -0
- package/src/Icons/generatedIcons/XCircle.tsx +48 -0
- package/src/Icons/generatedIcons/XLogo.tsx +48 -0
- package/src/Icons/generatedIcons/YoutubeLogo.tsx +51 -0
- package/src/Icons/importedIcons.ts +152 -0
- package/src/Icons/index.ts +149 -0
- package/src/Icons/socialIcons/appleSocialIcon.tsx +50 -0
- package/src/Icons/socialIcons/facebookSocialIcon.tsx +41 -0
- package/src/Icons/socialIcons/googleSocialIcon.tsx +134 -0
- package/src/ImageCluster/ImageCluster.tsx +125 -0
- package/src/ImageSlider/ImageSlider.tsx +582 -0
- package/src/ImageSlider/ImageSlider.types.ts +90 -0
- package/src/ImageSlider/components/IndexIndicator/IndexIndicator.tsx +21 -0
- package/src/ImageSlider/components/NavigationButtons/NavigationButtons.tsx +113 -0
- package/src/ImageSlider/components/ResponsiveImage/ResponsiveImage.tsx +114 -0
- package/src/ImageSlider/components/ResponsiveImage/index.ts +1 -0
- package/src/ImageSlider/components/Thumbnails/Thumbnails.tsx +184 -0
- package/src/ImageSlider/constants.ts +59 -0
- package/src/ImageSlider/hooks/index.ts +3 -0
- package/src/ImageSlider/hooks/useImageSlider.ts +57 -0
- package/src/ImageSlider/hooks/useImageSliderNavigation.ts +133 -0
- package/src/ImageSlider/hooks/useImageSliderScrollHandler.ts +171 -0
- package/src/ImageSlider/index.ts +3 -0
- package/src/ImageSlider/utils/imageOptimization.ts +97 -0
- package/src/ImageSlider/utils/index.ts +1 -0
- package/src/InlineNotification/InlineNotification.tsx +95 -0
- package/src/JumpMenu/JumpMenu.tsx +395 -0
- package/src/JumpMenu/components/JumpMenuItem/JumpMenuItem.tsx +62 -0
- package/src/JumpMenu/hooks/useContainerTracking.ts +171 -0
- package/src/JumpMenu/hooks/useIntersectionObserver.ts +77 -0
- package/src/JumpMenu/hooks/useKeyboardNavigation.ts +102 -0
- package/src/JumpMenu/hooks/useResizeObserver.ts +53 -0
- package/src/JumpMenu/hooks/useSectionObserver.ts +102 -0
- package/src/JumpMenu/index.ts +2 -0
- package/src/JumpMenu/types/index.ts +19 -0
- package/src/Loading/Loading.tsx +39 -0
- package/src/Loading/components/LoadingDot/LoadingDot.tsx +16 -0
- package/src/LoadingSpinner/LoadingSpinner.tsx +20 -0
- package/src/Menu/Menu.tsx +372 -0
- package/src/Menu/components/MenuDivider/MenuDivider.tsx +5 -0
- package/src/Menu/components/MenuItem/MenuItem.tsx +298 -0
- package/src/Menu/context/menuContext.tsx +20 -0
- package/src/Menu/hooks/useMenu.tsx +18 -0
- package/src/Menu/index.ts +3 -0
- package/src/Modal/ComposableModal.tsx +313 -0
- package/src/Modal/Modal.tsx +231 -0
- package/src/Modal/components/BackButton/BackButton.tsx +43 -0
- package/src/Modal/components/Backdrop/Backdrop.tsx +62 -0
- package/src/Modal/components/CloseButton/CloseButton.tsx +55 -0
- package/src/Modal/components/ModalActions/ModalActions.tsx +135 -0
- package/src/Modal/components/ModalContent/ModalContent.tsx +163 -0
- package/src/Modal/components/ModalHeader/ModalHeader.tsx +84 -0
- package/src/Modal/components/ModalHeader/hooks/useHeaderAnimation.tsx +49 -0
- package/src/Modal/components/ModalProgressSteps/ModalProgressSteps.tsx +26 -0
- package/src/Modal/components/ModalSubTitle/ModalSubTitle.tsx +29 -0
- package/src/Modal/components/ModalTitle/ModalTitle.tsx +22 -0
- package/src/Modal/components/PreventModalScroll/PreventModalScroll.tsx +106 -0
- package/src/Modal/components/index.ts +12 -0
- package/src/Modal/context.ts +33 -0
- package/src/Modal/hooks/useCloseModal.ts +133 -0
- package/src/NotificationBadge/NotificationBadge.tsx +34 -0
- package/src/Pagination/AdvancedPagination.tsx +48 -0
- package/src/Pagination/Pagination.tsx +216 -0
- package/src/Pagination/components/AdvancedPaginator/AdvancedPaginator.tsx +52 -0
- package/src/Pagination/components/AdvancedPaginator/components/PageSelect/PageSelect.tsx +43 -0
- package/src/Pagination/components/ItemCountDisplay/ItemCountDisplay.tsx +32 -0
- package/src/Pagination/components/ItemCountSelect/ItemCountSelect.tsx +33 -0
- package/src/Pagination/index.tsx +3 -0
- package/src/Pagination/paginationProvider.tsx +234 -0
- package/src/Pagination/utils.tsx +36 -0
- package/src/PhoneInput/PhoneInput.tsx +509 -0
- package/src/PhoneInput/useDropdownLogic.tsx +163 -0
- package/src/ProgressCircle/ProgressCircle.tsx +246 -0
- package/src/ProgressCircle/hooks/useProgressStatusTransitions.ts +49 -0
- package/src/ProgressCircle/utils/progressCircle.constants.ts +27 -0
- package/src/ProgressSteps/ProgressSteps.tsx +160 -0
- package/src/SaveConfetti/SaveConfetti.tsx +277 -0
- package/src/SaveConfetti/index.ts +2 -0
- package/src/SearchInput/SearchInput.tsx +236 -0
- package/src/SegmentedControl/SegmentedControl.tsx +111 -0
- package/src/SegmentedControl/SegmentedControlGroup.tsx +94 -0
- package/src/SegmentedControl/index.ts +4 -0
- package/src/Select/Select.tsx +154 -0
- package/src/Select/SelectAsync.tsx +13 -0
- package/src/Select/SelectAsyncCreatable.tsx +14 -0
- package/src/Select/SelectCreatable.tsx +12 -0
- package/src/Select/reexportedComponents.tsx +5 -0
- package/src/Select/selectComponents.tsx +306 -0
- package/src/Skeleton/Skeleton.tsx +13 -0
- package/src/SplitButton/SplitButton.tsx +298 -0
- package/src/SplitButton/SplitButtonTrigger.tsx +55 -0
- package/src/StarRating/StarRating.tsx +165 -0
- package/src/StarRating/components/StarComponent/StarComponent.tsx +44 -0
- package/src/Table/Table.tsx +474 -0
- package/src/Table/components/TableHeader/TableHeader.tsx +166 -0
- package/src/Table/components/TablePagination/TablePagination.tsx +18 -0
- package/src/Table/components/TablePagination/components/ItemCountDisplay/ItemCountDisplay.tsx +17 -0
- package/src/Table/components/TablePagination/components/ItemCountSelect/ItemCountSelect.tsx +31 -0
- package/src/Table/components/TablePagination/components/TablePaginator/TablePaginator.tsx +37 -0
- package/src/Table/components/TablePagination/components/TablePaginator/components/PageSelect/PageSelect.tsx +32 -0
- package/src/Table/components/TableRow/TableRows.tsx +147 -0
- package/src/Table/components/TableRow/components/TableRowCell/TableRowCell.tsx +49 -0
- package/src/Table/components/TableShadow/TableShadow.tsx +46 -0
- package/src/Table/index.ts +2 -0
- package/src/Table/sharedState.ts +30 -0
- package/src/Table/sharedStyles.ts +1 -0
- package/src/Table/types.ts +55 -0
- package/src/Tabs/Tabs.tsx +358 -0
- package/src/TextArea/TextArea.tsx +157 -0
- package/src/TextInput/TextInput.tsx +173 -0
- package/src/Toast/Toast.tsx +64 -0
- package/src/Toast/components/ToastContainer/ToastContainer.tsx +48 -0
- package/src/Toast/index.ts +2 -0
- package/src/Toast/types/role.ts +1 -0
- package/src/Toast/utils/getIcon.tsx +41 -0
- package/src/ToggleSwitch/ToggleSwitch.tsx +188 -0
- package/src/Tooltip/InfoIconTooltip.tsx +47 -0
- package/src/Tooltip/Tooltip.tsx +41 -0
- package/src/Typography/InlineButton/InlineButton.tsx +166 -0
- package/src/Typography/Links/Links.tsx +113 -0
- package/src/Typography/Text/Text.tsx +239 -0
- package/src/ViewMore/ViewMore.tsx +226 -0
- package/src/WebRTCPlayer/WebRTCPlayer.tsx +325 -0
- package/src/WebRTCPlayer/adaptor/NativeWebRTCAdaptor.ts +588 -0
- package/src/WebRTCPlayer/hooks/useWebRTCStream.ts +571 -0
- package/src/WebRTCPlayer/index.ts +22 -0
- package/src/WebRTCPlayer/types.ts +95 -0
- package/src/breakpoints/index.tsx +1 -0
- package/src/breakpoints/utils.tsx +50 -0
- package/src/declarations.d.ts +7 -0
- package/src/grid/gridHighlighter.tsx +83 -0
- package/src/grid/index.ts +3 -0
- package/src/grid/pageGrid.tsx +37 -0
- package/src/grid/useSubGridCSS.tsx +214 -0
- package/src/hooks/useHorizontalScrollFade.ts +44 -0
- package/src/hooks/usePrevious.ts +14 -0
- package/src/index.ts +351 -0
- package/src/intl/index.ts +4 -0
- package/src/intl/utils.ts +67 -0
- package/src/mixins/horizontalScrollFadeMixin.ts +56 -0
- package/src/mixins/index.ts +18 -0
- package/src/mixins/propMixins.ts +389 -0
- package/src/providers/createContextProvider.ts +22 -0
- package/src/providers/designSystemProvider.tsx +218 -0
- package/src/providers/errorBoundaryProvider.tsx +179 -0
- package/src/providers/featureFlagProvider.tsx +18 -0
- package/src/providers/gridSizeProvider.tsx +23 -0
- package/src/providers/index.ts +12 -0
- package/src/providers/linkProvider.tsx +32 -0
- package/src/providers/normalize.tsx +93 -0
- package/src/providers/targets/DatePickerTarget.tsx +10 -0
- package/src/providers/targets/ModalTarget.tsx +14 -0
- package/src/providers/targets/TimePickerTarget.tsx +10 -0
- package/src/providers/themeContext.tsx +24 -0
- package/src/providers/windowSizeProvider.tsx +125 -0
- package/src/spacing/index.ts +1 -0
- package/src/spacing/spacing.ts +11 -0
- package/src/utils/countriesWithISOCodes.ts +1419 -0
- package/src/utils/dateTimeFormat.ts +257 -0
- package/src/utils/effectEventListener.ts +11 -0
- package/src/utils/formatFileSize.ts +18 -0
- package/src/utils/isClientSide.ts +1 -0
- package/src/utils/keepTransition.ts +15 -0
- package/src/utils/nodeEnv.ts +9 -0
- package/src/utils/smoothScrollTo.ts +47 -0
- package/src/utils/utilityTypes.ts +13 -0
- package/textInput.d.cts +1 -1
- package/textInput.d.mts +1 -1
- package/timePicker.d.cts +1 -1
- package/timePicker.d.mts +1 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { colorIconDisabled, colorIconSecondary, colorIconSuccess } from '@evolve.ui/theme-system';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import { CheckCircle } from '../Icons/generatedIcons/CheckCircle';
|
|
5
|
+
import { getColor, IconProps } from '../Icons/IconBase';
|
|
6
|
+
import { useProgressStatusTransitions } from './hooks/useProgressStatusTransitions';
|
|
7
|
+
import {
|
|
8
|
+
CIRCLE_RADIUS,
|
|
9
|
+
circleBaseProps,
|
|
10
|
+
DASHED_PATTERN,
|
|
11
|
+
ICON_CONTAINER_SIZE,
|
|
12
|
+
progressCircleOuterSizes,
|
|
13
|
+
SPINNER_ARC_SIZE,
|
|
14
|
+
VIEWBOX_SIZE,
|
|
15
|
+
WAVE_ARC_SIZE,
|
|
16
|
+
WAVE_OFFSET,
|
|
17
|
+
} from './utils/progressCircle.constants';
|
|
18
|
+
|
|
19
|
+
type ProgressCircleProps = {
|
|
20
|
+
'aria-label'?: string;
|
|
21
|
+
centerIcon?: ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
color?: Exclude<IconProps['color'], 'disabled' | 'inherit'>;
|
|
24
|
+
'data-testid'?: string;
|
|
25
|
+
indeterminateAnimation?: 'spinner' | 'wave';
|
|
26
|
+
/**
|
|
27
|
+
* Progress value from 0-100. Only used when status is 'progressing'.
|
|
28
|
+
* If not provided while status is 'progressing', an indeterminate animation will be shown instead.
|
|
29
|
+
*/
|
|
30
|
+
progress?: number;
|
|
31
|
+
size?: keyof typeof progressCircleOuterSizes;
|
|
32
|
+
/**
|
|
33
|
+
* Current status of the operation:
|
|
34
|
+
* - 'pending': Shows dashed circle with gray arrow (not yet started)
|
|
35
|
+
* - 'progressing': Shows progress animation. If `progress` is not provided, automatically shows indeterminate animation
|
|
36
|
+
* - 'complete': Shows full circle with success checkmark animation
|
|
37
|
+
* - 'indeterminate': Always shows indeterminate animation, even if progress value is provided (use for explicit indeterminate state)
|
|
38
|
+
*/
|
|
39
|
+
status?: 'pending' | 'progressing' | 'complete' | 'indeterminate';
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const ProgressCircle = ({
|
|
43
|
+
'aria-label': ariaLabel = 'Progress Circle',
|
|
44
|
+
centerIcon,
|
|
45
|
+
className,
|
|
46
|
+
color = 'secondary',
|
|
47
|
+
'data-testid': dataTestId,
|
|
48
|
+
indeterminateAnimation = 'spinner',
|
|
49
|
+
progress,
|
|
50
|
+
size = 'md',
|
|
51
|
+
status = 'pending',
|
|
52
|
+
}: ProgressCircleProps) => {
|
|
53
|
+
const outerSize = progressCircleOuterSizes[size];
|
|
54
|
+
|
|
55
|
+
const strokeColor = getColor(color) ?? `rgb(var(${colorIconSecondary}))`;
|
|
56
|
+
const grayColor = `rgb(var(${colorIconDisabled}))`;
|
|
57
|
+
const successColor = `rgb(var(${colorIconSuccess}))`;
|
|
58
|
+
|
|
59
|
+
// Status flags for cleaner conditionals
|
|
60
|
+
const isPending = status === 'pending';
|
|
61
|
+
const isProgressing = status === 'progressing';
|
|
62
|
+
const isComplete = status === 'complete';
|
|
63
|
+
const isIndeterminate = status === 'indeterminate';
|
|
64
|
+
|
|
65
|
+
// When status is complete, always use success color for the progress circle
|
|
66
|
+
const progressCircleColor = isComplete ? successColor : strokeColor;
|
|
67
|
+
|
|
68
|
+
// Arrow color changes based on status: gray when pending, colored otherwise
|
|
69
|
+
const arrowColor = isPending ? grayColor : strokeColor;
|
|
70
|
+
|
|
71
|
+
// Calculate circle circumference for progress animation
|
|
72
|
+
const circumference = 2 * Math.PI * CIRCLE_RADIUS;
|
|
73
|
+
|
|
74
|
+
// Calculate foreignObject dimensions - centered in viewBox
|
|
75
|
+
const iconViewBoxOffset = (VIEWBOX_SIZE - ICON_CONTAINER_SIZE) / 2;
|
|
76
|
+
|
|
77
|
+
// Transition state from custom hook
|
|
78
|
+
const { animateToSolidCircle, isShowingCompletion } = useProgressStatusTransitions(status);
|
|
79
|
+
|
|
80
|
+
// Show fill and progress circles only when progressing or complete
|
|
81
|
+
const showProgressCircles = isProgressing || isComplete;
|
|
82
|
+
|
|
83
|
+
// Auto-set progress to 100% when status is complete
|
|
84
|
+
// Default to 0 if progress is undefined (though this should only be used when showProgressArc is true)
|
|
85
|
+
const resolvedProgressValue = isComplete ? 100 : (progress ?? 0);
|
|
86
|
+
|
|
87
|
+
// Gray fill circle: animates from circumference to 0 when animateToSolidCircle is true
|
|
88
|
+
const grayFillOffset = animateToSolidCircle ? 0 : circumference;
|
|
89
|
+
|
|
90
|
+
// Colored progress circle: tied to effective progress value (100% when complete)
|
|
91
|
+
const progressOffset = circumference - (resolvedProgressValue / 100) * circumference;
|
|
92
|
+
|
|
93
|
+
// Conditional rendering logic for indeterminate vs progress modes
|
|
94
|
+
// Show indeterminate if explicitly set OR if progressing without progress value
|
|
95
|
+
const hasProgressValue = typeof progress === 'number';
|
|
96
|
+
const isIndeterminateMode = isIndeterminate || (isProgressing && !hasProgressValue);
|
|
97
|
+
const showIndeterminateSpinner = isIndeterminateMode && animateToSolidCircle;
|
|
98
|
+
const showProgressArc = !isIndeterminateMode && showProgressCircles;
|
|
99
|
+
const showGrayFill = isIndeterminateMode || showProgressCircles;
|
|
100
|
+
|
|
101
|
+
// CSS custom properties for the wave animation keyframes (defined in plugin.ts).
|
|
102
|
+
// These must be inline styles because the values are calculated from the
|
|
103
|
+
// circle's circumference, which is derived from CIRCLE_RADIUS based off chosen size (sm, md, lg) at runtime.
|
|
104
|
+
const waveAnimationStyles = {
|
|
105
|
+
'--progress-wave-end': `1 ${circumference}`,
|
|
106
|
+
'--progress-wave-full': `${-circumference}`,
|
|
107
|
+
'--progress-wave-mid': `${circumference * WAVE_ARC_SIZE} ${circumference}`,
|
|
108
|
+
'--progress-wave-offset': `${-circumference * WAVE_OFFSET}`,
|
|
109
|
+
'--progress-wave-start': `1 ${circumference}`,
|
|
110
|
+
} as React.CSSProperties;
|
|
111
|
+
|
|
112
|
+
// Determine ARIA attributes based on whether we're showing determinate or indeterminate
|
|
113
|
+
// Show progressbar role only when actively progressing with progress value
|
|
114
|
+
// Complete status should be 'status' role, not 'progressbar'
|
|
115
|
+
const ariaRole = showProgressArc && !isComplete ? 'progressbar' : 'status';
|
|
116
|
+
const ariaBusy = isIndeterminateMode || isProgressing;
|
|
117
|
+
const ariaValueNow = showProgressArc ? resolvedProgressValue : undefined;
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<span
|
|
121
|
+
className={className}
|
|
122
|
+
data-testid={dataTestId}
|
|
123
|
+
style={waveAnimationStyles}
|
|
124
|
+
>
|
|
125
|
+
<svg
|
|
126
|
+
aria-busy={ariaBusy}
|
|
127
|
+
aria-label={ariaLabel}
|
|
128
|
+
aria-live="polite"
|
|
129
|
+
aria-valuemax={showProgressArc ? 100 : undefined}
|
|
130
|
+
aria-valuemin={showProgressArc ? 0 : undefined}
|
|
131
|
+
aria-valuenow={ariaValueNow}
|
|
132
|
+
className={
|
|
133
|
+
isShowingCompletion
|
|
134
|
+
? `min-h-[${outerSize}px] min-w-[${outerSize}px] animate-progress-completion`
|
|
135
|
+
: `min-h-[${outerSize}px] min-w-[${outerSize}px]`
|
|
136
|
+
}
|
|
137
|
+
fill="none"
|
|
138
|
+
height={outerSize}
|
|
139
|
+
role={ariaRole}
|
|
140
|
+
viewBox={`0 0 ${VIEWBOX_SIZE} ${VIEWBOX_SIZE}`}
|
|
141
|
+
width={outerSize}
|
|
142
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
143
|
+
>
|
|
144
|
+
{/* Dashed background circle */}
|
|
145
|
+
<circle
|
|
146
|
+
{...circleBaseProps}
|
|
147
|
+
stroke={grayColor}
|
|
148
|
+
strokeDasharray={DASHED_PATTERN}
|
|
149
|
+
/>
|
|
150
|
+
|
|
151
|
+
{/* Gray fill circle - animates 0→100% in 300ms when status is progressing or indeterminate */}
|
|
152
|
+
{showGrayFill && (
|
|
153
|
+
<circle
|
|
154
|
+
{...circleBaseProps}
|
|
155
|
+
className="origin-center -rotate-90 transition-[stroke-dashoffset] duration-300"
|
|
156
|
+
stroke={grayColor}
|
|
157
|
+
strokeDasharray={circumference}
|
|
158
|
+
strokeDashoffset={grayFillOffset}
|
|
159
|
+
strokeLinecap="round"
|
|
160
|
+
/>
|
|
161
|
+
)}
|
|
162
|
+
|
|
163
|
+
{/* Indeterminate spinner - 1/4 circle arc that rotates */}
|
|
164
|
+
{showIndeterminateSpinner && indeterminateAnimation === 'spinner' && (
|
|
165
|
+
<circle
|
|
166
|
+
{...circleBaseProps}
|
|
167
|
+
className="origin-center animate-spin"
|
|
168
|
+
stroke={strokeColor}
|
|
169
|
+
strokeDasharray={`${circumference * SPINNER_ARC_SIZE} ${circumference * (1 - SPINNER_ARC_SIZE)}`}
|
|
170
|
+
strokeLinecap="round"
|
|
171
|
+
/>
|
|
172
|
+
)}
|
|
173
|
+
|
|
174
|
+
{/* Indeterminate wave - Google Loader style animation */}
|
|
175
|
+
{showIndeterminateSpinner && indeterminateAnimation === 'wave' && (
|
|
176
|
+
<circle
|
|
177
|
+
{...circleBaseProps}
|
|
178
|
+
className="origin-center animate-progress-wave"
|
|
179
|
+
stroke={strokeColor}
|
|
180
|
+
strokeLinecap="round"
|
|
181
|
+
/>
|
|
182
|
+
)}
|
|
183
|
+
|
|
184
|
+
{/* Colored progress circle - tied to progress value (determinate mode) */}
|
|
185
|
+
{showProgressArc && (
|
|
186
|
+
<circle
|
|
187
|
+
{...circleBaseProps}
|
|
188
|
+
className="origin-center -rotate-90 transition-[stroke-dashoffset_0.5s_ease-in-out_0.3s,stroke_0.3s_ease-in-out]"
|
|
189
|
+
stroke={progressCircleColor}
|
|
190
|
+
strokeDasharray={circumference}
|
|
191
|
+
strokeDashoffset={progressOffset}
|
|
192
|
+
strokeLinecap="round"
|
|
193
|
+
/>
|
|
194
|
+
)}
|
|
195
|
+
|
|
196
|
+
{/* Center icon content */}
|
|
197
|
+
{!isShowingCompletion && (
|
|
198
|
+
<foreignObject
|
|
199
|
+
height={ICON_CONTAINER_SIZE}
|
|
200
|
+
width={ICON_CONTAINER_SIZE}
|
|
201
|
+
x={iconViewBoxOffset}
|
|
202
|
+
y={iconViewBoxOffset}
|
|
203
|
+
>
|
|
204
|
+
<div className="flex h-full w-full items-center justify-center">
|
|
205
|
+
{centerIcon || (
|
|
206
|
+
<svg
|
|
207
|
+
fill="none"
|
|
208
|
+
height={ICON_CONTAINER_SIZE}
|
|
209
|
+
viewBox={`0 0 ${VIEWBOX_SIZE} ${VIEWBOX_SIZE}`}
|
|
210
|
+
width={ICON_CONTAINER_SIZE}
|
|
211
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
212
|
+
>
|
|
213
|
+
<path
|
|
214
|
+
className="transition-[fill_0.3s_ease-in-out]"
|
|
215
|
+
d="M21.4015 16.5893C21.3406 16.6504 21.2681 16.699 21.1883 16.7321C21.1086 16.7652 21.0231 16.7823 20.9367 16.7823C20.8503 16.7823 20.7648 16.7652 20.685 16.7321C20.6053 16.699 20.5328 16.6504 20.4718 16.5893L17.656 13.7734V21.8125C17.656 21.9865 17.5868 22.1534 17.4638 22.2765C17.3407 22.3996 17.1738 22.4687 16.9997 22.4687C16.8257 22.4687 16.6588 22.3996 16.5357 22.2765C16.4126 22.1534 16.3435 21.9865 16.3435 21.8125V13.7734L13.5265 16.5893C13.4032 16.7125 13.236 16.7818 13.0617 16.7818C12.8873 16.7818 12.7201 16.7125 12.5968 16.5893C12.4736 16.466 12.4043 16.2988 12.4043 16.1244C12.4043 15.9501 12.4736 15.7829 12.5968 15.6596L16.5343 11.7221C16.5953 11.6609 16.6678 11.6123 16.7475 11.5792C16.8273 11.5461 16.9128 11.5291 16.9992 11.5291C17.0856 11.5291 17.1711 11.5461 17.2508 11.5792C17.3306 11.6123 17.4031 11.6609 17.464 11.7221L21.4015 15.6596C21.4627 15.7205 21.5113 15.793 21.5444 15.8728C21.5775 15.9525 21.5945 16.038 21.5945 16.1244C21.5945 16.2108 21.5775 16.2963 21.5444 16.3761C21.5113 16.4558 21.4627 16.5283 21.4015 16.5893Z"
|
|
216
|
+
fill={arrowColor}
|
|
217
|
+
/>
|
|
218
|
+
</svg>
|
|
219
|
+
)}
|
|
220
|
+
</div>
|
|
221
|
+
</foreignObject>
|
|
222
|
+
)}
|
|
223
|
+
|
|
224
|
+
{/* Completion CheckCircle */}
|
|
225
|
+
{isShowingCompletion && (
|
|
226
|
+
<foreignObject
|
|
227
|
+
height={ICON_CONTAINER_SIZE}
|
|
228
|
+
width={ICON_CONTAINER_SIZE}
|
|
229
|
+
x={iconViewBoxOffset}
|
|
230
|
+
y={iconViewBoxOffset}
|
|
231
|
+
>
|
|
232
|
+
<div className="flex h-full w-full animate-progress-icon-fade-in items-center justify-center">
|
|
233
|
+
<CheckCircle
|
|
234
|
+
color="success"
|
|
235
|
+
size="md"
|
|
236
|
+
style="fill"
|
|
237
|
+
/>
|
|
238
|
+
</div>
|
|
239
|
+
</foreignObject>
|
|
240
|
+
)}
|
|
241
|
+
</svg>
|
|
242
|
+
</span>
|
|
243
|
+
);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
ProgressCircle.displayName = 'ProgressCircle';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
type ProgressCircleStatus = 'pending' | 'progressing' | 'complete' | 'indeterminate';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Manages the animation state for the ProgressCircle component.
|
|
7
|
+
*
|
|
8
|
+
* Handles two animation concerns:
|
|
9
|
+
* 1. `animateToSolidCircle` - Controls the transition from dashed to solid circle
|
|
10
|
+
* 2. `isShowingCompletion` - Controls whether to show the completion checkmark
|
|
11
|
+
*
|
|
12
|
+
* @param status - The current status of the progress circle
|
|
13
|
+
* @returns Animation state flags for the component
|
|
14
|
+
*/
|
|
15
|
+
export const useProgressStatusTransitions = (status: ProgressCircleStatus) => {
|
|
16
|
+
const isComplete = status === 'complete';
|
|
17
|
+
const isProgressing = status === 'progressing';
|
|
18
|
+
const isIndeterminate = status === 'indeterminate';
|
|
19
|
+
|
|
20
|
+
// State to control animation trigger
|
|
21
|
+
const [animateToSolidCircle, setAnimateToSolidCircle] = useState(false);
|
|
22
|
+
// State to track completion animation
|
|
23
|
+
const [isShowingCompletion, setIsShowingCompletion] = useState(false);
|
|
24
|
+
|
|
25
|
+
// Trigger completion animation when status changes to/from 'complete'
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
setIsShowingCompletion(isComplete);
|
|
28
|
+
}, [isComplete]);
|
|
29
|
+
|
|
30
|
+
// Trigger animation when status changes to progressing, complete, or indeterminate
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (isProgressing || isComplete || isIndeterminate) {
|
|
33
|
+
// Small delay to ensure element is mounted before animating
|
|
34
|
+
const timer = setTimeout(() => {
|
|
35
|
+
setAnimateToSolidCircle(true);
|
|
36
|
+
}, 10);
|
|
37
|
+
|
|
38
|
+
return () => {
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
setAnimateToSolidCircle(false);
|
|
44
|
+
|
|
45
|
+
return undefined;
|
|
46
|
+
}, [isComplete, isIndeterminate, isProgressing]);
|
|
47
|
+
|
|
48
|
+
return { animateToSolidCircle, isShowingCompletion };
|
|
49
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// SVG dimensions and styling constants
|
|
2
|
+
export const VIEWBOX_SIZE = 34;
|
|
3
|
+
export const CIRCLE_RADIUS = 11.25;
|
|
4
|
+
export const CIRCLE_CENTER = 17;
|
|
5
|
+
export const STROKE_WIDTH = 1.5;
|
|
6
|
+
export const ICON_CONTAINER_SIZE = 34;
|
|
7
|
+
export const DASHED_PATTERN = '4 4';
|
|
8
|
+
|
|
9
|
+
// Outer circle sizes matching IconButton
|
|
10
|
+
export const progressCircleOuterSizes = {
|
|
11
|
+
lg: 54,
|
|
12
|
+
md: 42,
|
|
13
|
+
sm: 34,
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
// Animation calculation constants
|
|
17
|
+
export const WAVE_ARC_SIZE = 0.75;
|
|
18
|
+
export const WAVE_OFFSET = 0.125;
|
|
19
|
+
export const SPINNER_ARC_SIZE = 0.25;
|
|
20
|
+
|
|
21
|
+
// Base props for all circle SVG elements (derived from constants above)
|
|
22
|
+
export const circleBaseProps = {
|
|
23
|
+
cx: CIRCLE_CENTER,
|
|
24
|
+
cy: CIRCLE_CENTER,
|
|
25
|
+
r: CIRCLE_RADIUS,
|
|
26
|
+
strokeWidth: STROKE_WIDTH,
|
|
27
|
+
} as const;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from '@evolve.ui/theme-system';
|
|
4
|
+
import { ReactNode, useCallback } from 'react';
|
|
5
|
+
|
|
6
|
+
import { Check } from '../Icons';
|
|
7
|
+
import { IconComponent } from '../Icons/IconBase';
|
|
8
|
+
import { BodySecondary, Caption, LabelStrong } from '../Typography/Text/Text';
|
|
9
|
+
|
|
10
|
+
export type StepItem = {
|
|
11
|
+
StepIcon?: IconComponent;
|
|
12
|
+
description?: ReactNode;
|
|
13
|
+
isCompleted: boolean;
|
|
14
|
+
label: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type ProgressStepsProps = {
|
|
18
|
+
/** Used for passing styles down to the StepsComplete container. */
|
|
19
|
+
readonly className?: string;
|
|
20
|
+
/** Indicates the current step */
|
|
21
|
+
readonly currentStep?: number;
|
|
22
|
+
/** Adds a data-testid attribute to the dom element, used for end to end testing. */
|
|
23
|
+
readonly 'data-testid'?: string;
|
|
24
|
+
/** when true, the step labels will not be shown */
|
|
25
|
+
readonly hideStepLabels?: boolean;
|
|
26
|
+
/** when true, the steps will be displayed as numbers, overriding the icon */
|
|
27
|
+
readonly isNumeric?: boolean;
|
|
28
|
+
/** Array of steps */
|
|
29
|
+
readonly steps: StepItem[];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const ProgressSteps = ({
|
|
33
|
+
className,
|
|
34
|
+
currentStep = 0,
|
|
35
|
+
'data-testid': testid = 'progressSteps',
|
|
36
|
+
hideStepLabels = false,
|
|
37
|
+
isNumeric = false,
|
|
38
|
+
steps = [],
|
|
39
|
+
}: ProgressStepsProps) => {
|
|
40
|
+
if (!steps.length) {
|
|
41
|
+
throw new Error('Missing or empty step items.');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const buildProgressStep = useCallback(
|
|
45
|
+
(step: StepItem, index: number) => {
|
|
46
|
+
const StepIcon = step.StepIcon ?? null;
|
|
47
|
+
const thisStep = index + 1;
|
|
48
|
+
const isCurrentStep = currentStep === thisStep;
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
className="relative"
|
|
53
|
+
key={`progress-index-${thisStep}`}
|
|
54
|
+
>
|
|
55
|
+
{!step.isCompleted || isCurrentStep ? (
|
|
56
|
+
<div
|
|
57
|
+
className={cn(
|
|
58
|
+
'm-[3px] h-md w-md rounded-lg border-[1px] border-border-selected text-3xl text-primary-50',
|
|
59
|
+
{
|
|
60
|
+
'bg-icon-secondary': isCurrentStep,
|
|
61
|
+
}
|
|
62
|
+
)}
|
|
63
|
+
>
|
|
64
|
+
{isNumeric ? (
|
|
65
|
+
<LabelStrong
|
|
66
|
+
className={cn(
|
|
67
|
+
'block w-full text-center',
|
|
68
|
+
isCurrentStep ? 'text-text-inverse' : 'text-icon-secondary'
|
|
69
|
+
)}
|
|
70
|
+
>
|
|
71
|
+
{thisStep}
|
|
72
|
+
</LabelStrong>
|
|
73
|
+
) : (
|
|
74
|
+
StepIcon && (
|
|
75
|
+
<StepIcon
|
|
76
|
+
className="m-[4px]"
|
|
77
|
+
color={isCurrentStep ? 'inverse' : 'secondary'}
|
|
78
|
+
size="xs"
|
|
79
|
+
style="bold"
|
|
80
|
+
/>
|
|
81
|
+
)
|
|
82
|
+
)}
|
|
83
|
+
</div>
|
|
84
|
+
) : (
|
|
85
|
+
<div className="m-[3px] h-md w-md rounded-lg border-[1px] border-border-selected bg-icon-secondary p-[4px] text-3xl">
|
|
86
|
+
<Check
|
|
87
|
+
color="inverse"
|
|
88
|
+
size="xs"
|
|
89
|
+
style="bold"
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
)}
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
},
|
|
96
|
+
[currentStep, isNumeric]
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<div
|
|
101
|
+
className={cn('relative inline-flex w-full flex-row justify-between pb-10', className)}
|
|
102
|
+
data-hui-id="ProgressSteps"
|
|
103
|
+
data-testid={testid}
|
|
104
|
+
>
|
|
105
|
+
{steps.map((step: StepItem, index: number) => {
|
|
106
|
+
const afterBorderColor =
|
|
107
|
+
currentStep >= index + 1 ? 'after:border-border-selected' : 'after:border-border-secondary';
|
|
108
|
+
const beforeBorderColor =
|
|
109
|
+
currentStep >= index ? 'before:border-border-selected' : 'before:border-border-secondary';
|
|
110
|
+
return (
|
|
111
|
+
<div
|
|
112
|
+
className={cn(
|
|
113
|
+
'relative flex w-[140px] flex-shrink flex-grow flex-col items-center justify-start px-xs',
|
|
114
|
+
index < steps.length - 1 && [
|
|
115
|
+
"after:content-['']",
|
|
116
|
+
'after:absolute',
|
|
117
|
+
'after:left-[calc(50%+15px)]',
|
|
118
|
+
'after:right-0',
|
|
119
|
+
'after:top-[15px]',
|
|
120
|
+
'after:w-[50%]',
|
|
121
|
+
'after:h-[2px]',
|
|
122
|
+
'after:border-b-[2px]',
|
|
123
|
+
afterBorderColor,
|
|
124
|
+
'after:pointer-events-none',
|
|
125
|
+
],
|
|
126
|
+
index > 0 && [
|
|
127
|
+
"before:content-['']",
|
|
128
|
+
'before:absolute',
|
|
129
|
+
'before:right-[calc(50%+15px)]',
|
|
130
|
+
'before:top-[15px]',
|
|
131
|
+
'before:w-[50%]',
|
|
132
|
+
'before:h-[2px]',
|
|
133
|
+
'before:border-b-[2px]',
|
|
134
|
+
beforeBorderColor,
|
|
135
|
+
'before:pointer-events-none',
|
|
136
|
+
]
|
|
137
|
+
)}
|
|
138
|
+
key={index}
|
|
139
|
+
>
|
|
140
|
+
{buildProgressStep(step, index)}
|
|
141
|
+
{!hideStepLabels && (
|
|
142
|
+
<BodySecondary className="mt-xs inline-block text-center">{step.label}</BodySecondary>
|
|
143
|
+
)}
|
|
144
|
+
|
|
145
|
+
{step.description && (
|
|
146
|
+
<Caption
|
|
147
|
+
className="text-center"
|
|
148
|
+
color="secondary"
|
|
149
|
+
>
|
|
150
|
+
{step.description}
|
|
151
|
+
</Caption>
|
|
152
|
+
)}
|
|
153
|
+
</div>
|
|
154
|
+
);
|
|
155
|
+
})}
|
|
156
|
+
</div>
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
ProgressSteps.displayName = 'ProgressSteps';
|