@evolve.ui/core-components 1.0.1 → 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/evolve-ui.entries.json +556 -0
- 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/package.json +2 -2
- 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
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { cn } from '@evolve.ui/theme-system';
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { useDropzone } from 'react-dropzone';
|
|
4
|
+
|
|
5
|
+
import { Caption, LabelMini } from '../../../Typography/Text/Text';
|
|
6
|
+
import { formatFileSize } from '../../../utils/formatFileSize';
|
|
7
|
+
import { useFileValidation } from '../../hooks';
|
|
8
|
+
import { useHandleDragEnter } from '../../hooks/upload/useHandleDragEnter/useHandleDragEnter';
|
|
9
|
+
import { useHandleDrop } from '../../hooks/upload/useHandleDrop/useHandleDrop';
|
|
10
|
+
import { useUploadAvailability } from '../../hooks/upload/useUploadAvailability/useUploadAvailability';
|
|
11
|
+
import { createDropzoneValidator } from '../../hooks/validation/createDropzoneValidator';
|
|
12
|
+
import { FileUploadContext, FileUploadContextType } from '../../providers/FileUploadProvider';
|
|
13
|
+
import { FileDropzoneProps } from '../../types/sharedTypes';
|
|
14
|
+
import { getMimeTypes } from '../../utils/getMimeTypes';
|
|
15
|
+
import { getUploadZoneStyles } from '../../utils/styles';
|
|
16
|
+
import { DropzoneContent } from './components/DropzoneContent/DropzoneContent';
|
|
17
|
+
import { FileDropzoneDebugger } from './components/FileDropzoneDebugger/FileDropzoneDebugger';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* FileDropzone component for handling file uploads with drag and drop support.
|
|
21
|
+
* This is a versatile file input component that can work both as a standalone
|
|
22
|
+
* component or as part of the FileUpload system.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Handles the dual-mode functionality of the FileDropzone component, supporting both standalone usage
|
|
27
|
+
* and provider-wrapped usage.
|
|
28
|
+
*
|
|
29
|
+
* ## Validation Modes
|
|
30
|
+
* - **Provider Mode**: Uses validation context from FileUploadProvider for coordinated validation across components
|
|
31
|
+
* - **Standalone Mode**: Creates local validation instance for independent operation
|
|
32
|
+
*
|
|
33
|
+
* ## Props & Context Resolution
|
|
34
|
+
* The component follows a specific precedence order for each property:
|
|
35
|
+
* 1. Direct props take highest priority (for granular control)
|
|
36
|
+
* 2. Context values serve as fallbacks (for coordinated state)
|
|
37
|
+
* 3. Default values as final fallbacks (for safety)
|
|
38
|
+
*
|
|
39
|
+
* This enables two key use cases:
|
|
40
|
+
* 1. Standalone Usage: <FileDropzone maxFiles={5} onDrop={handleDrop} />
|
|
41
|
+
* 2. Provider Usage:
|
|
42
|
+
* <FileUploadProvider maxFiles={5}>
|
|
43
|
+
* <FileDropzone /> // Inherits provider config
|
|
44
|
+
* <FileDropzone maxFiles={1} /> // Overrides specific provider values
|
|
45
|
+
* </FileUploadProvider>
|
|
46
|
+
*/
|
|
47
|
+
export const FileDropzone = ({
|
|
48
|
+
accept: acceptProp,
|
|
49
|
+
ariaLabel = 'Browse or drag files here to upload.',
|
|
50
|
+
className,
|
|
51
|
+
'data-testid': dataTestId = 'file-dropzone',
|
|
52
|
+
disabled: disabledProp = false,
|
|
53
|
+
disableDragValidation = false,
|
|
54
|
+
error,
|
|
55
|
+
files: filesProp,
|
|
56
|
+
helpText,
|
|
57
|
+
helpTextAlignCenter,
|
|
58
|
+
hideErrors = false,
|
|
59
|
+
hideHelpText = false,
|
|
60
|
+
labelText,
|
|
61
|
+
maxFiles: maxFilesProp,
|
|
62
|
+
maxSize: maxSizeProp,
|
|
63
|
+
onDrop: onDropProp,
|
|
64
|
+
onDropAccepted: onDropAcceptedProp,
|
|
65
|
+
onDropRejected: onDropRejectedProp,
|
|
66
|
+
onFilesChange: onFilesChangeProp,
|
|
67
|
+
showDebugger,
|
|
68
|
+
strictValidation,
|
|
69
|
+
validator,
|
|
70
|
+
}: FileDropzoneProps) => {
|
|
71
|
+
const uploadContext = useContext<FileUploadContextType | undefined>(FileUploadContext);
|
|
72
|
+
|
|
73
|
+
const validationConfig = {
|
|
74
|
+
accept: acceptProp,
|
|
75
|
+
error,
|
|
76
|
+
maxFiles: maxFilesProp,
|
|
77
|
+
maxSize: maxSizeProp,
|
|
78
|
+
strictValidation,
|
|
79
|
+
validator,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/* IMPORTANT: This component supports both standalone usage and provider usage */
|
|
83
|
+
// useFileValidation automatically detects if we're in a provider context
|
|
84
|
+
// If not in provider, create local validation for standalone usage
|
|
85
|
+
const validation = useFileValidation(validationConfig);
|
|
86
|
+
|
|
87
|
+
// Determine whether to use context or local state for files and setFiles
|
|
88
|
+
const files = filesProp ?? uploadContext?.files ?? [];
|
|
89
|
+
const setFiles = onFilesChangeProp ?? uploadContext?.setFiles ?? (() => {});
|
|
90
|
+
|
|
91
|
+
// Intentionally check both props and context with precedence order
|
|
92
|
+
const disabled = disabledProp || uploadContext?.disabled;
|
|
93
|
+
const onDrop = onDropProp ?? uploadContext?.onDrop;
|
|
94
|
+
const onDropAccepted = onDropAcceptedProp ?? uploadContext?.onDropAccepted;
|
|
95
|
+
const onDropRejected = onDropRejectedProp ?? uploadContext?.onDropRejected;
|
|
96
|
+
const maxFiles = maxFilesProp ?? validation.maxFiles;
|
|
97
|
+
const maxSize = maxSizeProp ?? validation.maxSize;
|
|
98
|
+
const accept = acceptProp ?? validation.accept;
|
|
99
|
+
/* END IMPORTANT */
|
|
100
|
+
|
|
101
|
+
// Check if upload is disabled based on current state
|
|
102
|
+
const { hasReachedFileLimit, isDisabled } = useUploadAvailability({
|
|
103
|
+
disabled,
|
|
104
|
+
files,
|
|
105
|
+
maxFiles,
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const formattedMaxSize = maxSize ? formatFileSize(maxSize) : undefined;
|
|
109
|
+
|
|
110
|
+
const defaultHelpText = formattedMaxSize ? `File size must be smaller than ${formattedMaxSize}` : undefined;
|
|
111
|
+
|
|
112
|
+
// If custom help text is provided, use it. Otherwise, use the default help text, or hide it.
|
|
113
|
+
const helpTextToDisplay = hideHelpText ? undefined : (helpText ?? defaultHelpText);
|
|
114
|
+
|
|
115
|
+
// Configure text based on multiple vs single file mode
|
|
116
|
+
const allowMultipleFiles = maxFiles === undefined || maxFiles > 1;
|
|
117
|
+
const filePluralizationText = allowMultipleFiles ? 'files' : 'a file';
|
|
118
|
+
const mimeTypes = getMimeTypes(accept);
|
|
119
|
+
|
|
120
|
+
// Set up drag and drop handlers
|
|
121
|
+
const handleDrop = useHandleDrop({
|
|
122
|
+
files,
|
|
123
|
+
onDrop,
|
|
124
|
+
onDropAccepted,
|
|
125
|
+
onDropRejected,
|
|
126
|
+
setFiles,
|
|
127
|
+
validation,
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const handleDragEnter = useHandleDragEnter({
|
|
131
|
+
files,
|
|
132
|
+
mimeTypes,
|
|
133
|
+
validation,
|
|
134
|
+
validator,
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// Configure the dropzone
|
|
138
|
+
const { getInputProps, getRootProps, isDragActive, isDragReject } = useDropzone({
|
|
139
|
+
accept: mimeTypes,
|
|
140
|
+
disabled: isDisabled,
|
|
141
|
+
maxSize,
|
|
142
|
+
multiple: allowMultipleFiles,
|
|
143
|
+
onDragEnter: disableDragValidation ? validation.clearAllValidation : handleDragEnter,
|
|
144
|
+
onDragLeave: validation.clearAllValidation,
|
|
145
|
+
onDrop: handleDrop,
|
|
146
|
+
// @ts-expect-error Our validator returns potentially function-based messages, React-Dropzone expects strings.
|
|
147
|
+
// This is intentional and allows us to resolve dynamic messages later with proper file counts.
|
|
148
|
+
validator: createDropzoneValidator(validation),
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// Determine Dropzone styles based on interaction state
|
|
152
|
+
const activeCode = isDragActive ? validation.dragValidationError : validation.dropValidationErrors[0];
|
|
153
|
+
const uploadZoneStyles = getUploadZoneStyles({
|
|
154
|
+
disabled: isDisabled,
|
|
155
|
+
disableDragValidation,
|
|
156
|
+
isDragActive,
|
|
157
|
+
validationError: activeCode,
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<div
|
|
162
|
+
aria-label={ariaLabel}
|
|
163
|
+
className={cn('flex h-full w-full flex-col gap-[4px]', className)}
|
|
164
|
+
role="region"
|
|
165
|
+
>
|
|
166
|
+
{labelText && <LabelMini color={isDisabled ? 'disabled' : 'secondary'}>{labelText}</LabelMini>}
|
|
167
|
+
<div
|
|
168
|
+
{...getRootProps({
|
|
169
|
+
'aria-disabled': isDisabled,
|
|
170
|
+
className: cn('group min-h-[88px] w-full', uploadZoneStyles),
|
|
171
|
+
'data-testid': `${dataTestId}-container`,
|
|
172
|
+
onClick: validation.clearAllValidation,
|
|
173
|
+
role: 'button',
|
|
174
|
+
})}
|
|
175
|
+
>
|
|
176
|
+
<input
|
|
177
|
+
{...getInputProps({
|
|
178
|
+
'aria-label': `Upload ${filePluralizationText}`,
|
|
179
|
+
'data-testid': `${dataTestId}-input`,
|
|
180
|
+
})}
|
|
181
|
+
/>
|
|
182
|
+
<DropzoneContent
|
|
183
|
+
dropzoneTextProps={{
|
|
184
|
+
disableDragValidation,
|
|
185
|
+
filePluralizationText,
|
|
186
|
+
hasReachedFileLimit,
|
|
187
|
+
isDisabled,
|
|
188
|
+
isDragActive,
|
|
189
|
+
isDragReject,
|
|
190
|
+
maxFiles,
|
|
191
|
+
validation,
|
|
192
|
+
}}
|
|
193
|
+
isDisabled={isDisabled}
|
|
194
|
+
/>
|
|
195
|
+
</div>
|
|
196
|
+
<div
|
|
197
|
+
className={cn('relative flex flex-col gap-[4px]', {
|
|
198
|
+
'items-center': helpTextAlignCenter,
|
|
199
|
+
})}
|
|
200
|
+
>
|
|
201
|
+
{helpTextToDisplay && (
|
|
202
|
+
<Caption color={isDisabled ? 'disabled' : 'secondary'}>{helpTextToDisplay}</Caption>
|
|
203
|
+
)}
|
|
204
|
+
{!hideErrors &&
|
|
205
|
+
validation.dropValidationErrors.map((error, index) => (
|
|
206
|
+
<Caption
|
|
207
|
+
color="critical"
|
|
208
|
+
key={`${error.code}-${index}`}
|
|
209
|
+
role="alert"
|
|
210
|
+
>
|
|
211
|
+
{error.message}
|
|
212
|
+
</Caption>
|
|
213
|
+
))}
|
|
214
|
+
</div>
|
|
215
|
+
{/* Display debug information around fileRejections when showDebugger is true */}
|
|
216
|
+
{showDebugger && <FileDropzoneDebugger fileRejections={validation.fileRejections} />}
|
|
217
|
+
</div>
|
|
218
|
+
);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
FileDropzone.displayName = 'FileDropzone';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TextColorAliases } from '@evolve.ui/theme-system';
|
|
2
|
+
|
|
3
|
+
import { UploadSimple } from '../../../../../Icons';
|
|
4
|
+
import { BodyPrimary } from '../../../../../Typography/Text/Text';
|
|
5
|
+
import { DropzoneText } from './DropzoneText';
|
|
6
|
+
|
|
7
|
+
type DropzoneContentProps = {
|
|
8
|
+
dropzoneTextProps: React.ComponentProps<typeof DropzoneText>;
|
|
9
|
+
isDisabled: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const DropzoneContent = ({ dropzoneTextProps, isDisabled }: DropzoneContentProps) => {
|
|
13
|
+
const dropzoneTextColor: TextColorAliases = isDisabled ? 'disabled' : 'primary';
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div className="flex w-full flex-col items-center gap-xs">
|
|
17
|
+
<UploadSimple color={dropzoneTextColor} />
|
|
18
|
+
<BodyPrimary
|
|
19
|
+
className="text-center"
|
|
20
|
+
color={dropzoneTextColor}
|
|
21
|
+
>
|
|
22
|
+
<DropzoneText {...dropzoneTextProps} />
|
|
23
|
+
</BodyPrimary>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
DropzoneContent.displayName = 'DropzoneContent';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useWindowIsMobile } from '../../../../../providers';
|
|
4
|
+
import { SubtleLink } from '../../../../../Typography/Links/Links';
|
|
5
|
+
import { UploadValidationContextType } from '../../../../providers/UploadValidationProvider';
|
|
6
|
+
|
|
7
|
+
type DropzoneTextProps = {
|
|
8
|
+
disableDragValidation: boolean;
|
|
9
|
+
filePluralizationText: string;
|
|
10
|
+
hasReachedFileLimit: boolean;
|
|
11
|
+
isDisabled: boolean;
|
|
12
|
+
isDragActive: boolean;
|
|
13
|
+
isDragReject: boolean;
|
|
14
|
+
maxFiles?: number;
|
|
15
|
+
validation: UploadValidationContextType;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const DropzoneText = ({
|
|
19
|
+
disableDragValidation,
|
|
20
|
+
filePluralizationText,
|
|
21
|
+
hasReachedFileLimit,
|
|
22
|
+
isDisabled,
|
|
23
|
+
isDragActive,
|
|
24
|
+
isDragReject,
|
|
25
|
+
maxFiles,
|
|
26
|
+
validation,
|
|
27
|
+
}: DropzoneTextProps) => {
|
|
28
|
+
const isMobile = useWindowIsMobile();
|
|
29
|
+
const { dragValidationError } = validation;
|
|
30
|
+
|
|
31
|
+
const dropzoneText = useMemo(() => {
|
|
32
|
+
// Static states (before any drag)
|
|
33
|
+
if (hasReachedFileLimit) {
|
|
34
|
+
return <>{`${maxFiles} file limit reached. Remove files to upload more.`}</>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Show validation messages during drag
|
|
38
|
+
if (isDragActive && dragValidationError?.code) {
|
|
39
|
+
return <>{dragValidationError.message}</>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Show "Drop files here" during valid drag
|
|
43
|
+
if (isDragActive && (disableDragValidation || !isDragReject)) {
|
|
44
|
+
return <>Drop files here to upload</>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Default states (no drag)
|
|
48
|
+
if (isMobile) {
|
|
49
|
+
return <>{`Click to browse and add ${filePluralizationText}`}</>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Desktop default
|
|
53
|
+
return (
|
|
54
|
+
<>
|
|
55
|
+
<SubtleLink
|
|
56
|
+
className="group-hover:underline"
|
|
57
|
+
disabled={isDisabled}
|
|
58
|
+
href="#"
|
|
59
|
+
onClick={(e) => e.preventDefault()}
|
|
60
|
+
>
|
|
61
|
+
Browse
|
|
62
|
+
</SubtleLink>{' '}
|
|
63
|
+
or drag {filePluralizationText} here to upload
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
}, [
|
|
67
|
+
filePluralizationText,
|
|
68
|
+
hasReachedFileLimit,
|
|
69
|
+
isDisabled,
|
|
70
|
+
isDragActive,
|
|
71
|
+
isDragReject,
|
|
72
|
+
disableDragValidation,
|
|
73
|
+
maxFiles,
|
|
74
|
+
isMobile,
|
|
75
|
+
dragValidationError,
|
|
76
|
+
]);
|
|
77
|
+
|
|
78
|
+
return <>{dropzoneText}</>;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
DropzoneText.displayName = 'DropzoneText';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Tabs } from '../../../../../Tabs/Tabs';
|
|
2
|
+
import { FileRejection } from '../../../../types/commonTypes';
|
|
3
|
+
import { FileRejectionsDisplay } from './FileRejectionsDisplay';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
fileRejections: FileRejection[];
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const FileDropzoneDebugger = ({ fileRejections = [] }: Props) => {
|
|
10
|
+
return (
|
|
11
|
+
<div className="mt-md rounded-container p-sm outline-dashed outline-1 -outline-offset-1 outline-border-secondary">
|
|
12
|
+
<Tabs
|
|
13
|
+
tabs={[
|
|
14
|
+
{
|
|
15
|
+
content: (
|
|
16
|
+
<FileRejectionsDisplay
|
|
17
|
+
displayMode="by-error"
|
|
18
|
+
fileRejections={fileRejections}
|
|
19
|
+
/>
|
|
20
|
+
),
|
|
21
|
+
contentId: 'rejections-by-error',
|
|
22
|
+
label: 'Errors',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
content: (
|
|
26
|
+
<FileRejectionsDisplay
|
|
27
|
+
displayMode="by-file"
|
|
28
|
+
fileRejections={fileRejections}
|
|
29
|
+
/>
|
|
30
|
+
),
|
|
31
|
+
contentId: 'rejections-by-file',
|
|
32
|
+
label: 'Files',
|
|
33
|
+
},
|
|
34
|
+
]}
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
FileDropzoneDebugger.displayName = 'FileDropzoneDebugger';
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Badge } from '../../../../../Badge/Badge';
|
|
2
|
+
import { ColumnType, Table } from '../../../../../Table';
|
|
3
|
+
import { BodyPrimary, H4 } from '../../../../../Typography/Text/Text';
|
|
4
|
+
import { FileErrorCode, FileRejection } from '../../../../types';
|
|
5
|
+
import { builtInErrorCodes } from '../../../../utils/constants';
|
|
6
|
+
|
|
7
|
+
type DisplayMode = 'by-error' | 'by-file';
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
displayMode: DisplayMode;
|
|
11
|
+
fileRejections: FileRejection[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type TableData = {
|
|
15
|
+
col1: string;
|
|
16
|
+
col2: string | string[];
|
|
17
|
+
col3: string | string[];
|
|
18
|
+
key: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const BadgeCell = ({ codes }: { codes: string | string[] }) => {
|
|
22
|
+
const codeArray = Array.isArray(codes) ? codes : [codes];
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div className="flex flex-col justify-start gap-[4px]">
|
|
26
|
+
{codeArray.map((code, index) => (
|
|
27
|
+
<Badge
|
|
28
|
+
className="my-[2px]"
|
|
29
|
+
color="critical"
|
|
30
|
+
data-testid={`badge-${code}`}
|
|
31
|
+
emphasis={builtInErrorCodes.includes(code as FileErrorCode) ? 'subtle' : 'bold'}
|
|
32
|
+
key={`${code}-${index}`}
|
|
33
|
+
size="xs"
|
|
34
|
+
>
|
|
35
|
+
{code}
|
|
36
|
+
</Badge>
|
|
37
|
+
))}
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const FileRejectionsDisplay = ({ displayMode, fileRejections = [] }: Props) => {
|
|
43
|
+
const totalErrors = fileRejections.reduce((sum, rejection) => sum + rejection.errors.length, 0);
|
|
44
|
+
|
|
45
|
+
const tableData =
|
|
46
|
+
displayMode === 'by-error'
|
|
47
|
+
? fileRejections.flatMap((rejection, fileIndex) =>
|
|
48
|
+
rejection.errors.map((error, errorIndex) => ({
|
|
49
|
+
col1: rejection.file.name,
|
|
50
|
+
col2: error.code,
|
|
51
|
+
col3: error.message,
|
|
52
|
+
key: `${rejection.file.name}-${fileIndex}-${errorIndex}`,
|
|
53
|
+
}))
|
|
54
|
+
)
|
|
55
|
+
: fileRejections.map((rejection, index) => ({
|
|
56
|
+
col1: rejection.file.name,
|
|
57
|
+
col2: rejection.errors.map((error) => error.code),
|
|
58
|
+
col3: rejection.errors.map((error) => error.message),
|
|
59
|
+
key: `${rejection.file.name}-${index}`,
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
const columns: ColumnType<TableData>[] = [
|
|
63
|
+
{
|
|
64
|
+
align: 'left',
|
|
65
|
+
header: 'File Name',
|
|
66
|
+
key: 'col1',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
header: displayMode === 'by-error' ? 'Error Code' : 'Error Codes',
|
|
70
|
+
key: 'col2',
|
|
71
|
+
renderItem: (data: TableData) => <BadgeCell codes={data.col2} />,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
header: displayMode === 'by-error' ? 'Message' : 'Messages',
|
|
75
|
+
key: 'col3',
|
|
76
|
+
renderItem:
|
|
77
|
+
displayMode === 'by-file'
|
|
78
|
+
? (data: TableData) => (
|
|
79
|
+
<div className="flex flex-col gap-[2px]">
|
|
80
|
+
{(data.col3 as string[]).map((message, index) => (
|
|
81
|
+
<span key={index}>{message}</span>
|
|
82
|
+
))}
|
|
83
|
+
</div>
|
|
84
|
+
)
|
|
85
|
+
: undefined,
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<>
|
|
91
|
+
<div className="mb-xs mt-sm flex items-center justify-between px-[2px]">
|
|
92
|
+
<H4>File Rejections {displayMode === 'by-error' ? '(by Error)' : '(by File)'}</H4>
|
|
93
|
+
<BodyPrimary>
|
|
94
|
+
{fileRejections.length} files ({totalErrors} errors)
|
|
95
|
+
</BodyPrimary>
|
|
96
|
+
</div>
|
|
97
|
+
<Table
|
|
98
|
+
columns={columns}
|
|
99
|
+
data={tableData}
|
|
100
|
+
emptyStateHeaderText="No files rejected"
|
|
101
|
+
emptyStateSupportingText="Upload files to monitor rejections"
|
|
102
|
+
fillHorizontal
|
|
103
|
+
hideBorder
|
|
104
|
+
rowDensity="sm"
|
|
105
|
+
/>
|
|
106
|
+
</>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
FileRejectionsDisplay.displayName = 'FileRejectionsDisplay';
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { cn } from '@evolve.ui/theme-system';
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { useDropzone } from 'react-dropzone';
|
|
4
|
+
|
|
5
|
+
import { useFileValidation } from '../../hooks';
|
|
6
|
+
import { useHandleDragEnter } from '../../hooks/upload/useHandleDragEnter/useHandleDragEnter';
|
|
7
|
+
import { useHandleDrop } from '../../hooks/upload/useHandleDrop/useHandleDrop';
|
|
8
|
+
import { useUploadAvailability } from '../../hooks/upload/useUploadAvailability/useUploadAvailability';
|
|
9
|
+
import { createDropzoneValidator } from '../../hooks/validation/createDropzoneValidator';
|
|
10
|
+
import { FileUploadContext, FileUploadContextType } from '../../providers/FileUploadProvider';
|
|
11
|
+
import { FileDropzoneOverlayProps } from '../../types/sharedTypes';
|
|
12
|
+
import { getMimeTypes } from '../../utils/getMimeTypes';
|
|
13
|
+
import { FileDropzoneDebugger } from '../FileDropzone/components/FileDropzoneDebugger/FileDropzoneDebugger';
|
|
14
|
+
import { OverlayDropzoneContent } from './components/OverlayDropzoneContent';
|
|
15
|
+
import { getUploadOverlayStyles } from './styles';
|
|
16
|
+
|
|
17
|
+
export const FileDropzoneOverlay = ({
|
|
18
|
+
accept: acceptProp,
|
|
19
|
+
ariaLabel,
|
|
20
|
+
children,
|
|
21
|
+
className,
|
|
22
|
+
'data-testid': dataTestId = 'file-dropzone-overlay',
|
|
23
|
+
disableClickThrough = false,
|
|
24
|
+
disabled: disabledProp = false,
|
|
25
|
+
disableDragValidation = false,
|
|
26
|
+
dragText = 'Drop files to upload',
|
|
27
|
+
error,
|
|
28
|
+
files: filesProp,
|
|
29
|
+
icon,
|
|
30
|
+
maxFiles: maxFilesProp,
|
|
31
|
+
maxSize: maxSizeProp,
|
|
32
|
+
onDrop: onDropProp,
|
|
33
|
+
onDropAccepted: onDropAcceptedProp,
|
|
34
|
+
onDropRejected: onDropRejectedProp,
|
|
35
|
+
onFilesChange: onFilesChangeProp,
|
|
36
|
+
showDebugger,
|
|
37
|
+
strictValidation,
|
|
38
|
+
styleOptions,
|
|
39
|
+
validator,
|
|
40
|
+
}: FileDropzoneOverlayProps) => {
|
|
41
|
+
const uploadContext = useContext<FileUploadContextType | undefined>(FileUploadContext);
|
|
42
|
+
|
|
43
|
+
const validationConfig = {
|
|
44
|
+
accept: acceptProp,
|
|
45
|
+
error,
|
|
46
|
+
maxFiles: maxFilesProp,
|
|
47
|
+
maxSize: maxSizeProp,
|
|
48
|
+
strictValidation,
|
|
49
|
+
validator,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/* IMPORTANT: This component supports both standalone usage and provider usage */
|
|
53
|
+
// useFileValidation automatically detects if we're in a provider context
|
|
54
|
+
// If not in provider, create local validation for standalone usage
|
|
55
|
+
const validation = useFileValidation(validationConfig);
|
|
56
|
+
|
|
57
|
+
// Determine whether to use context or local state for files and setFiles
|
|
58
|
+
const files = filesProp ?? uploadContext?.files ?? [];
|
|
59
|
+
const setFiles = onFilesChangeProp ?? uploadContext?.setFiles ?? (() => {});
|
|
60
|
+
|
|
61
|
+
// Intentionally check both props and context with precedence order
|
|
62
|
+
const disabled = disabledProp || uploadContext?.disabled;
|
|
63
|
+
const onDrop = onDropProp ?? uploadContext?.onDrop;
|
|
64
|
+
const onDropAccepted = onDropAcceptedProp ?? uploadContext?.onDropAccepted;
|
|
65
|
+
const onDropRejected = onDropRejectedProp ?? uploadContext?.onDropRejected;
|
|
66
|
+
const maxFiles = maxFilesProp ?? validation.maxFiles;
|
|
67
|
+
const maxSize = maxSizeProp ?? validation.maxSize;
|
|
68
|
+
const accept = acceptProp ?? validation.accept;
|
|
69
|
+
/* END IMPORTANT */
|
|
70
|
+
|
|
71
|
+
// Check if upload is disabled based on current state
|
|
72
|
+
const { isDisabled } = useUploadAvailability({
|
|
73
|
+
disabled,
|
|
74
|
+
files,
|
|
75
|
+
maxFiles,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Configure text based on multiple vs single file mode
|
|
79
|
+
const allowMultipleFiles = maxFiles === undefined || maxFiles > 1;
|
|
80
|
+
const filePluralizationText = allowMultipleFiles ? 'files' : 'a file';
|
|
81
|
+
const mimeTypes = getMimeTypes(accept);
|
|
82
|
+
|
|
83
|
+
// Set up drag and drop handlers
|
|
84
|
+
const handleDrop = useHandleDrop({
|
|
85
|
+
files,
|
|
86
|
+
onDrop,
|
|
87
|
+
onDropAccepted,
|
|
88
|
+
onDropRejected,
|
|
89
|
+
setFiles,
|
|
90
|
+
validation,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const handleDragEnter = useHandleDragEnter({
|
|
94
|
+
files,
|
|
95
|
+
mimeTypes,
|
|
96
|
+
validation,
|
|
97
|
+
validator,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// Configure the dropzone
|
|
101
|
+
const { getInputProps, getRootProps, isDragActive } = useDropzone({
|
|
102
|
+
accept: mimeTypes,
|
|
103
|
+
disabled: isDisabled,
|
|
104
|
+
maxSize,
|
|
105
|
+
multiple: allowMultipleFiles,
|
|
106
|
+
noClick: !disableClickThrough, // When clickThrough is not disabled, prevent file picker dialog
|
|
107
|
+
noKeyboard: !disableClickThrough, // When clickThrough is not disabled, prevent keyboard interactions
|
|
108
|
+
onDragEnter: disableDragValidation ? validation.clearAllValidation : handleDragEnter,
|
|
109
|
+
onDragLeave: validation.clearAllValidation,
|
|
110
|
+
onDrop: handleDrop,
|
|
111
|
+
// @ts-expect-error Our validator returns potentially function-based messages, React-Dropzone expects strings.
|
|
112
|
+
// This is intentional and allows us to resolve dynamic messages later with proper file counts.
|
|
113
|
+
validator: createDropzoneValidator(validation),
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Determine Dropzone styles based on interaction state
|
|
117
|
+
const activeCode = isDragActive ? validation.dragValidationError : validation.dropValidationErrors[0];
|
|
118
|
+
const uploadZoneStyles = getUploadOverlayStyles({
|
|
119
|
+
disableClickThrough,
|
|
120
|
+
disabled: isDisabled,
|
|
121
|
+
disableDragValidation,
|
|
122
|
+
isDragActive,
|
|
123
|
+
styleOptions,
|
|
124
|
+
validationError: activeCode,
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Map innerPadding to Tailwind padding classes
|
|
128
|
+
const paddingMap = {
|
|
129
|
+
'2xl': 'p-2xl',
|
|
130
|
+
lg: 'p-lg',
|
|
131
|
+
md: 'p-md',
|
|
132
|
+
sm: 'p-sm',
|
|
133
|
+
xl: 'p-xl',
|
|
134
|
+
xs: 'p-xs',
|
|
135
|
+
} as const;
|
|
136
|
+
const innerPaddingClass = styleOptions?.innerPadding ? paddingMap[styleOptions.innerPadding] : undefined;
|
|
137
|
+
const fillParentClass = styleOptions?.fillParent ? 'h-full' : 'relative';
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<>
|
|
141
|
+
<div
|
|
142
|
+
{...getRootProps({
|
|
143
|
+
'aria-disabled': isDisabled,
|
|
144
|
+
'aria-label': ariaLabel ?? (isDragActive ? dragText : undefined),
|
|
145
|
+
className: cn('group/dropzone', fillParentClass, className),
|
|
146
|
+
'data-testid': `${dataTestId}-root`,
|
|
147
|
+
})}
|
|
148
|
+
>
|
|
149
|
+
<input
|
|
150
|
+
{...getInputProps({
|
|
151
|
+
'aria-label': `Upload ${filePluralizationText}`,
|
|
152
|
+
'data-testid': `${dataTestId}-input`,
|
|
153
|
+
})}
|
|
154
|
+
/>
|
|
155
|
+
|
|
156
|
+
{/* Child content - isolation-isolate scopes children's z-indices so the overlay can sit above them */}
|
|
157
|
+
<div className={cn('isolate', fillParentClass, innerPaddingClass)}>{children}</div>
|
|
158
|
+
|
|
159
|
+
{/* Visual overlay - only appears when dragging */}
|
|
160
|
+
<div
|
|
161
|
+
className={cn('w-full', uploadZoneStyles)}
|
|
162
|
+
data-testid={`${dataTestId}-container`}
|
|
163
|
+
>
|
|
164
|
+
{/* Only show visual feedback when actively dragging */}
|
|
165
|
+
{isDragActive && (
|
|
166
|
+
<OverlayDropzoneContent
|
|
167
|
+
accept={accept}
|
|
168
|
+
customIcon={icon}
|
|
169
|
+
dragText={dragText}
|
|
170
|
+
isDragActive={isDragActive}
|
|
171
|
+
maxFiles={maxFiles}
|
|
172
|
+
validation={validation}
|
|
173
|
+
/>
|
|
174
|
+
)}
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
{/* Display debug information around fileRejections when showDebugger is true */}
|
|
178
|
+
{showDebugger && <FileDropzoneDebugger fileRejections={validation.fileRejections} />}
|
|
179
|
+
</>
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
FileDropzoneOverlay.displayName = 'FileDropzoneOverlay';
|