@evolve.ui/core-components 1.0.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/Accordion--J93KLdp.d.cts +38 -0
- package/Accordion--J93KLdp.d.cts.map +1 -0
- package/Accordion-CdgdzUNC.d.mts +38 -0
- package/Accordion-CdgdzUNC.d.mts.map +1 -0
- package/AddressDisplay-C6av_Ava.d.cts +40 -0
- package/AddressDisplay-C6av_Ava.d.cts.map +1 -0
- package/AddressDisplay-C6av_Ava.d.mts +40 -0
- package/AddressDisplay-C6av_Ava.d.mts.map +1 -0
- package/AddressDisplay-CI1h4Pyv.cjs +1504 -0
- package/AddressDisplay-CI1h4Pyv.cjs.map +1 -0
- package/AddressDisplay-D5p9wJT6.mjs +1499 -0
- package/AddressDisplay-D5p9wJT6.mjs.map +1 -0
- package/AutomatedCarousel-BbH74siI.d.mts +48 -0
- package/AutomatedCarousel-BbH74siI.d.mts.map +1 -0
- package/AutomatedCarousel-CmVyxeSl.mjs +274 -0
- package/AutomatedCarousel-CmVyxeSl.mjs.map +1 -0
- package/AutomatedCarousel-Dhr1za_D.d.cts +48 -0
- package/AutomatedCarousel-Dhr1za_D.d.cts.map +1 -0
- package/AutomatedCarousel-ylYqkHPX.cjs +281 -0
- package/AutomatedCarousel-ylYqkHPX.cjs.map +1 -0
- package/Badge/ItemBadge.cjs +75 -0
- package/Badge/ItemBadge.cjs.map +1 -0
- package/Badge/ItemBadge.d.cts +2 -0
- package/Badge/ItemBadge.d.mts +2 -0
- package/Badge/ItemBadge.mjs +71 -0
- package/Badge/ItemBadge.mjs.map +1 -0
- package/Badge/LiveStatusBadge.cjs +78 -0
- package/Badge/LiveStatusBadge.cjs.map +1 -0
- package/Badge/LiveStatusBadge.d.cts +2 -0
- package/Badge/LiveStatusBadge.d.mts +2 -0
- package/Badge/LiveStatusBadge.mjs +74 -0
- package/Badge/LiveStatusBadge.mjs.map +1 -0
- package/Badge-C1BBu1fH.d.mts +71 -0
- package/Badge-C1BBu1fH.d.mts.map +1 -0
- package/Badge-lOH4Ssq_.d.cts +71 -0
- package/Badge-lOH4Ssq_.d.cts.map +1 -0
- package/Badge.cjs +72 -0
- package/Badge.cjs.map +1 -0
- package/Badge.d.cts +2 -0
- package/Badge.d.mts +2 -0
- package/Badge.mjs +68 -0
- package/Badge.mjs.map +1 -0
- package/BannerNotification-D9Sfa2si.cjs +156 -0
- package/BannerNotification-D9Sfa2si.cjs.map +1 -0
- package/BannerNotification-DM78PllX.d.cts +59 -0
- package/BannerNotification-DM78PllX.d.cts.map +1 -0
- package/BannerNotification-DM78PllX.d.mts +59 -0
- package/BannerNotification-DM78PllX.d.mts.map +1 -0
- package/BannerNotification-DzprO7bZ.mjs +151 -0
- package/BannerNotification-DzprO7bZ.mjs.map +1 -0
- package/BottomSheet-ZV_eq3xt.mjs +1708 -0
- package/BottomSheet-ZV_eq3xt.mjs.map +1 -0
- package/BottomSheet-emWP9Fct.cjs +1715 -0
- package/BottomSheet-emWP9Fct.cjs.map +1 -0
- package/Breadcrumbs-7jTSZ7NM.cjs +98 -0
- package/Breadcrumbs-7jTSZ7NM.cjs.map +1 -0
- package/Breadcrumbs-CopNM2AH.d.cts +30 -0
- package/Breadcrumbs-CopNM2AH.d.cts.map +1 -0
- package/Breadcrumbs-CopNM2AH.d.mts +30 -0
- package/Breadcrumbs-CopNM2AH.d.mts.map +1 -0
- package/Breadcrumbs-blgWG9cP.mjs +93 -0
- package/Breadcrumbs-blgWG9cP.mjs.map +1 -0
- package/Button-B9vfIXTi.d.cts +12 -0
- package/Button-B9vfIXTi.d.cts.map +1 -0
- package/Button-Bitf-VVv.d.mts +12 -0
- package/Button-Bitf-VVv.d.mts.map +1 -0
- package/Button.cjs +102 -0
- package/Button.cjs.map +1 -0
- package/Button.d.cts +2 -0
- package/Button.d.mts +2 -0
- package/Button.mjs +98 -0
- package/Button.mjs.map +1 -0
- package/Button.types-CjidejRG.d.cts +79 -0
- package/Button.types-CjidejRG.d.cts.map +1 -0
- package/Button.types-CyzsUcMe.d.mts +79 -0
- package/Button.types-CyzsUcMe.d.mts.map +1 -0
- package/Callout-BDrz5jjK.d.mts +45 -0
- package/Callout-BDrz5jjK.d.mts.map +1 -0
- package/Callout-BiFCfawA.d.cts +45 -0
- package/Callout-BiFCfawA.d.cts.map +1 -0
- package/Callout-DrWwRGi4.cjs +132 -0
- package/Callout-DrWwRGi4.cjs.map +1 -0
- package/Callout-Olv0CM82.mjs +127 -0
- package/Callout-Olv0CM82.mjs.map +1 -0
- package/Callout.cjs +8 -0
- package/Callout.d.cts +2 -0
- package/Callout.d.mts +2 -0
- package/Callout.mjs +4 -0
- package/CardGrid-BhfrwrN0.d.cts +72 -0
- package/CardGrid-BhfrwrN0.d.cts.map +1 -0
- package/CardGrid-BpX_oOS4.mjs +175 -0
- package/CardGrid-BpX_oOS4.mjs.map +1 -0
- package/CardGrid-CHZSF83h.d.mts +72 -0
- package/CardGrid-CHZSF83h.d.mts.map +1 -0
- package/CardGrid-CXi9XvDo.cjs +180 -0
- package/CardGrid-CXi9XvDo.cjs.map +1 -0
- package/Carousel-8CbTiwMk.mjs +462 -0
- package/Carousel-8CbTiwMk.mjs.map +1 -0
- package/Carousel-Du89BCCK.cjs +487 -0
- package/Carousel-Du89BCCK.cjs.map +1 -0
- package/CheckCircle-BcTMEm4l.mjs +42 -0
- package/CheckCircle-BcTMEm4l.mjs.map +1 -0
- package/CheckCircle-BjBbSga6.cjs +49 -0
- package/CheckCircle-BjBbSga6.cjs.map +1 -0
- package/Checkbox.cjs +13 -0
- package/Checkbox.d.cts +2 -0
- package/Checkbox.d.mts +2 -0
- package/Checkbox.mjs +3 -0
- package/Chip-UMJoX3ST.d.cts +38 -0
- package/Chip-UMJoX3ST.d.cts.map +1 -0
- package/Chip-giQtR8GC.d.mts +38 -0
- package/Chip-giQtR8GC.d.mts.map +1 -0
- package/ChipGroup-DIyCVKZm.d.cts +24 -0
- package/ChipGroup-DIyCVKZm.d.cts.map +1 -0
- package/ChipGroup-VGpv5cHt.d.mts +24 -0
- package/ChipGroup-VGpv5cHt.d.mts.map +1 -0
- package/ChoiceListItem-BqZ3bIj9.mjs +168 -0
- package/ChoiceListItem-BqZ3bIj9.mjs.map +1 -0
- package/ChoiceListItem-D_74Zcpd.cjs +209 -0
- package/ChoiceListItem-D_74Zcpd.cjs.map +1 -0
- package/Collapsible-Bbs4SWEA.d.cts +18 -0
- package/Collapsible-Bbs4SWEA.d.cts.map +1 -0
- package/Collapsible-Bbs4SWEA.d.mts +18 -0
- package/Collapsible-Bbs4SWEA.d.mts.map +1 -0
- package/Confetti--vMcCOQ7.cjs +166 -0
- package/Confetti--vMcCOQ7.cjs.map +1 -0
- package/Confetti-Csdjmzfv.mjs +161 -0
- package/Confetti-Csdjmzfv.mjs.map +1 -0
- package/ContentPager-AM9sSsgG.d.cts +37 -0
- package/ContentPager-AM9sSsgG.d.cts.map +1 -0
- package/ContentPager-B9UIPahb.mjs +138 -0
- package/ContentPager-B9UIPahb.mjs.map +1 -0
- package/ContentPager-BJo1L64Y.cjs +158 -0
- package/ContentPager-BJo1L64Y.cjs.map +1 -0
- package/ContentPager-DuxgJP42.d.mts +37 -0
- package/ContentPager-DuxgJP42.d.mts.map +1 -0
- package/CookieConsent-CIwm0bTz.mjs +401 -0
- package/CookieConsent-CIwm0bTz.mjs.map +1 -0
- package/CookieConsent-PIglB_bb.cjs +430 -0
- package/CookieConsent-PIglB_bb.cjs.map +1 -0
- package/Countdown-BaqV0LJL.d.mts +45 -0
- package/Countdown-BaqV0LJL.d.mts.map +1 -0
- package/Countdown-D4-QPv6V.cjs +181 -0
- package/Countdown-D4-QPv6V.cjs.map +1 -0
- package/Countdown-Dw5j-JJ4.d.cts +45 -0
- package/Countdown-Dw5j-JJ4.d.cts.map +1 -0
- package/Countdown-Hiu5EYUI.mjs +174 -0
- package/Countdown-Hiu5EYUI.mjs.map +1 -0
- package/Countdown.types-B7yecprx.d.cts +8 -0
- package/Countdown.types-B7yecprx.d.cts.map +1 -0
- package/Countdown.types-B7yecprx.d.mts +8 -0
- package/Countdown.types-B7yecprx.d.mts.map +1 -0
- package/CreditCardIcon-DirCX2rx.d.cts +29 -0
- package/CreditCardIcon-DirCX2rx.d.cts.map +1 -0
- package/CreditCardIcon-DirCX2rx.d.mts +29 -0
- package/CreditCardIcon-DirCX2rx.d.mts.map +1 -0
- package/CreditCardIcon-OqdAEE3e.cjs +281 -0
- package/CreditCardIcon-OqdAEE3e.cjs.map +1 -0
- package/CreditCardIcon-rpcjx4S_.mjs +270 -0
- package/CreditCardIcon-rpcjx4S_.mjs.map +1 -0
- package/DateInput-B8XQZPTx.d.cts +34 -0
- package/DateInput-B8XQZPTx.d.cts.map +1 -0
- package/DateInput-CfNmywqQ.d.mts +34 -0
- package/DateInput-CfNmywqQ.d.mts.map +1 -0
- package/DatePickerTarget-BcX_noF3.d.cts +14 -0
- package/DatePickerTarget-BcX_noF3.d.cts.map +1 -0
- package/DatePickerTarget-BcX_noF3.d.mts +14 -0
- package/DatePickerTarget-BcX_noF3.d.mts.map +1 -0
- package/DatePickerTarget-CKni-6Rq.mjs +14 -0
- package/DatePickerTarget-CKni-6Rq.mjs.map +1 -0
- package/DatePickerTarget-D_gR7380.cjs +25 -0
- package/DatePickerTarget-D_gR7380.cjs.map +1 -0
- package/Drawer-9HFG45OA.cjs +259 -0
- package/Drawer-9HFG45OA.cjs.map +1 -0
- package/Drawer-BkCPfK6P.mjs +254 -0
- package/Drawer-BkCPfK6P.mjs.map +1 -0
- package/Drawer-CFZbwg0R.d.cts +231 -0
- package/Drawer-CFZbwg0R.d.cts.map +1 -0
- package/Drawer-CFZbwg0R.d.mts +231 -0
- package/Drawer-CFZbwg0R.d.mts.map +1 -0
- package/EducationalPopover-CLNgGomH.d.cts +48 -0
- package/EducationalPopover-CLNgGomH.d.cts.map +1 -0
- package/EducationalPopover-DP63Yqlm.d.mts +48 -0
- package/EducationalPopover-DP63Yqlm.d.mts.map +1 -0
- package/FavoriteButton-BRY8FVpV.d.mts +142 -0
- package/FavoriteButton-BRY8FVpV.d.mts.map +1 -0
- package/FavoriteButton-CC3qL0lR.mjs +199 -0
- package/FavoriteButton-CC3qL0lR.mjs.map +1 -0
- package/FavoriteButton-CowOPoqo.d.cts +142 -0
- package/FavoriteButton-CowOPoqo.d.cts.map +1 -0
- package/FavoriteButton-DliYzkfu.cjs +204 -0
- package/FavoriteButton-DliYzkfu.cjs.map +1 -0
- package/FeatureFlagDevToolsUI-B13AuQ2A.mjs +276 -0
- package/FeatureFlagDevToolsUI-B13AuQ2A.mjs.map +1 -0
- package/FeatureFlagDevToolsUI-CutvngLI.d.cts +39 -0
- package/FeatureFlagDevToolsUI-CutvngLI.d.cts.map +1 -0
- package/FeatureFlagDevToolsUI-CutvngLI.d.mts +39 -0
- package/FeatureFlagDevToolsUI-CutvngLI.d.mts.map +1 -0
- package/FeatureFlagDevToolsUI-MBFES3GM.cjs +281 -0
- package/FeatureFlagDevToolsUI-MBFES3GM.cjs.map +1 -0
- package/FileUpload--e_UJ_ek.cjs +1771 -0
- package/FileUpload--e_UJ_ek.cjs.map +1 -0
- package/FileUpload-p_pl9NXr.mjs +1706 -0
- package/FileUpload-p_pl9NXr.mjs.map +1 -0
- package/FormLabel-D4602qfd.d.cts +140 -0
- package/FormLabel-D4602qfd.d.cts.map +1 -0
- package/FormLabel-D4602qfd.d.mts +140 -0
- package/FormLabel-D4602qfd.d.mts.map +1 -0
- package/IconBase-C_Lx9rDx.d.cts +89 -0
- package/IconBase-C_Lx9rDx.d.cts.map +1 -0
- package/IconBase-C_Lx9rDx.d.mts +89 -0
- package/IconBase-C_Lx9rDx.d.mts.map +1 -0
- package/IconButton-DHTn5DQ_.d.mts +40 -0
- package/IconButton-DHTn5DQ_.d.mts.map +1 -0
- package/IconButton-Df9usxq_.d.cts +40 -0
- package/IconButton-Df9usxq_.d.cts.map +1 -0
- package/IconButton.cjs +68 -0
- package/IconButton.cjs.map +1 -0
- package/IconButton.d.cts +2 -0
- package/IconButton.d.mts +2 -0
- package/IconButton.mjs +64 -0
- package/IconButton.mjs.map +1 -0
- package/Icons/CreditCardIcon.cjs +7 -0
- package/Icons/CreditCardIcon.d.cts +2 -0
- package/Icons/CreditCardIcon.d.mts +2 -0
- package/Icons/CreditCardIcon.mjs +2 -0
- package/Icons/IconBase.cjs +60 -0
- package/Icons/IconBase.cjs.map +1 -0
- package/Icons/IconBase.d.cts +2 -0
- package/Icons/IconBase.d.mts +2 -0
- package/Icons/IconBase.mjs +54 -0
- package/Icons/IconBase.mjs.map +1 -0
- package/Icons/anyIcon.cjs +0 -0
- package/Icons/anyIcon.d.cts +2 -0
- package/Icons/anyIcon.d.mts +2 -0
- package/Icons/anyIcon.mjs +1 -0
- package/Icons/socialIcons/appleSocialIcon.cjs +48 -0
- package/Icons/socialIcons/appleSocialIcon.cjs.map +1 -0
- package/Icons/socialIcons/appleSocialIcon.d.cts +19 -0
- package/Icons/socialIcons/appleSocialIcon.d.cts.map +1 -0
- package/Icons/socialIcons/appleSocialIcon.d.mts +19 -0
- package/Icons/socialIcons/appleSocialIcon.d.mts.map +1 -0
- package/Icons/socialIcons/appleSocialIcon.mjs +42 -0
- package/Icons/socialIcons/appleSocialIcon.mjs.map +1 -0
- package/Icons/socialIcons/facebookSocialIcon.cjs +41 -0
- package/Icons/socialIcons/facebookSocialIcon.cjs.map +1 -0
- package/Icons/socialIcons/facebookSocialIcon.d.cts +14 -0
- package/Icons/socialIcons/facebookSocialIcon.d.cts.map +1 -0
- package/Icons/socialIcons/facebookSocialIcon.d.mts +14 -0
- package/Icons/socialIcons/facebookSocialIcon.d.mts.map +1 -0
- package/Icons/socialIcons/facebookSocialIcon.mjs +36 -0
- package/Icons/socialIcons/facebookSocialIcon.mjs.map +1 -0
- package/Icons/socialIcons/googleSocialIcon.cjs +135 -0
- package/Icons/socialIcons/googleSocialIcon.cjs.map +1 -0
- package/Icons/socialIcons/googleSocialIcon.d.cts +19 -0
- package/Icons/socialIcons/googleSocialIcon.d.cts.map +1 -0
- package/Icons/socialIcons/googleSocialIcon.d.mts +19 -0
- package/Icons/socialIcons/googleSocialIcon.d.mts.map +1 -0
- package/Icons/socialIcons/googleSocialIcon.mjs +129 -0
- package/Icons/socialIcons/googleSocialIcon.mjs.map +1 -0
- package/Icons.cjs +5489 -0
- package/Icons.cjs.map +1 -0
- package/Icons.d.cts +2 -0
- package/Icons.d.mts +2 -0
- package/Icons.mjs +5335 -0
- package/Icons.mjs.map +1 -0
- package/ImageCluster-BXaQi8SB.d.cts +24 -0
- package/ImageCluster-BXaQi8SB.d.cts.map +1 -0
- package/ImageCluster-BXaQi8SB.d.mts +24 -0
- package/ImageCluster-BXaQi8SB.d.mts.map +1 -0
- package/ImageSlider-BidXfnLj.cjs +861 -0
- package/ImageSlider-BidXfnLj.cjs.map +1 -0
- package/ImageSlider-CDrg_TbL.mjs +838 -0
- package/ImageSlider-CDrg_TbL.mjs.map +1 -0
- package/InfoIconTooltip-CZax9TVq.d.cts +27 -0
- package/InfoIconTooltip-CZax9TVq.d.cts.map +1 -0
- package/InfoIconTooltip-Ca4AHkY2.d.mts +27 -0
- package/InfoIconTooltip-Ca4AHkY2.d.mts.map +1 -0
- package/InfoIconTooltip.cjs +29 -0
- package/InfoIconTooltip.cjs.map +1 -0
- package/InfoIconTooltip.d.cts +2 -0
- package/InfoIconTooltip.d.mts +2 -0
- package/InfoIconTooltip.mjs +25 -0
- package/InfoIconTooltip.mjs.map +1 -0
- package/InlineButton-CRLbNJZ3.d.mts +68 -0
- package/InlineButton-CRLbNJZ3.d.mts.map +1 -0
- package/InlineButton-DoXGLiSE.d.cts +68 -0
- package/InlineButton-DoXGLiSE.d.cts.map +1 -0
- package/InlineNotification--hYpy2m2.d.cts +18 -0
- package/InlineNotification--hYpy2m2.d.cts.map +1 -0
- package/InlineNotification--hYpy2m2.d.mts +18 -0
- package/InlineNotification--hYpy2m2.d.mts.map +1 -0
- package/Input.cjs +104 -0
- package/Input.cjs.map +1 -0
- package/Input.d.cts +2 -0
- package/Input.d.mts +2 -0
- package/Input.mjs +100 -0
- package/Input.mjs.map +1 -0
- package/ItemBadge-D1S8YsIy.d.cts +46 -0
- package/ItemBadge-D1S8YsIy.d.cts.map +1 -0
- package/ItemBadge-D1S8YsIy.d.mts +46 -0
- package/ItemBadge-D1S8YsIy.d.mts.map +1 -0
- package/JumpMenu-BXYZnPIH.cjs +499 -0
- package/JumpMenu-BXYZnPIH.cjs.map +1 -0
- package/JumpMenu-DcZjAiej.mjs +494 -0
- package/JumpMenu-DcZjAiej.mjs.map +1 -0
- package/Links-Ch0YdIz6.d.cts +214 -0
- package/Links-Ch0YdIz6.d.cts.map +1 -0
- package/Links-Ch0YdIz6.d.mts +214 -0
- package/Links-Ch0YdIz6.d.mts.map +1 -0
- package/LiveStatusBadge-D1TX11B6.d.cts +53 -0
- package/LiveStatusBadge-D1TX11B6.d.cts.map +1 -0
- package/LiveStatusBadge-D1TX11B6.d.mts +53 -0
- package/LiveStatusBadge-D1TX11B6.d.mts.map +1 -0
- package/Loading-B9LLlAyM.d.cts +19 -0
- package/Loading-B9LLlAyM.d.cts.map +1 -0
- package/Loading-B9LLlAyM.d.mts +19 -0
- package/Loading-B9LLlAyM.d.mts.map +1 -0
- package/Loading-BL7_u25j.cjs +47 -0
- package/Loading-BL7_u25j.cjs.map +1 -0
- package/Loading-BenQpF_w.mjs +42 -0
- package/Loading-BenQpF_w.mjs.map +1 -0
- package/LoadingSpinner-BWwhuAGb.d.mts +16 -0
- package/LoadingSpinner-BWwhuAGb.d.mts.map +1 -0
- package/LoadingSpinner-DjC4uC_2.d.cts +16 -0
- package/LoadingSpinner-DjC4uC_2.d.cts.map +1 -0
- package/LoadingSpinner.cjs +25 -0
- package/LoadingSpinner.cjs.map +1 -0
- package/LoadingSpinner.d.cts +2 -0
- package/LoadingSpinner.d.mts +2 -0
- package/LoadingSpinner.mjs +21 -0
- package/LoadingSpinner.mjs.map +1 -0
- package/Menu-ClUogmwE.cjs +385 -0
- package/Menu-ClUogmwE.cjs.map +1 -0
- package/Menu-Cxu8CaX1.mjs +368 -0
- package/Menu-Cxu8CaX1.mjs.map +1 -0
- package/Modal-C6gatdtT.mjs +301 -0
- package/Modal-C6gatdtT.mjs.map +1 -0
- package/Modal-CiBqXyiK.cjs +306 -0
- package/Modal-CiBqXyiK.cjs.map +1 -0
- package/Modal-DM0aXJZ5.d.cts +265 -0
- package/Modal-DM0aXJZ5.d.cts.map +1 -0
- package/Modal-DM0aXJZ5.d.mts +265 -0
- package/Modal-DM0aXJZ5.d.mts.map +1 -0
- package/ModalTarget-CD0Nmzfb.d.cts +14 -0
- package/ModalTarget-CD0Nmzfb.d.cts.map +1 -0
- package/ModalTarget-CD0Nmzfb.d.mts +14 -0
- package/ModalTarget-CD0Nmzfb.d.mts.map +1 -0
- package/NotificationBadge-B442UBjI.d.cts +22 -0
- package/NotificationBadge-B442UBjI.d.cts.map +1 -0
- package/NotificationBadge-B442UBjI.d.mts +22 -0
- package/NotificationBadge-B442UBjI.d.mts.map +1 -0
- package/Pagination-DIpGKMLz.mjs +386 -0
- package/Pagination-DIpGKMLz.mjs.map +1 -0
- package/Pagination-bAtbN478.cjs +409 -0
- package/Pagination-bAtbN478.cjs.map +1 -0
- package/PhoneInput-B5pkpkdt.mjs +398 -0
- package/PhoneInput-B5pkpkdt.mjs.map +1 -0
- package/PhoneInput-BXnkBME4.d.mts +70 -0
- package/PhoneInput-BXnkBME4.d.mts.map +1 -0
- package/PhoneInput-Bkrbrins.d.cts +70 -0
- package/PhoneInput-Bkrbrins.d.cts.map +1 -0
- package/PhoneInput-CUMPOSxJ.cjs +408 -0
- package/PhoneInput-CUMPOSxJ.cjs.map +1 -0
- package/ProgressCircle-B2dfVdH-.d.cts +50 -0
- package/ProgressCircle-B2dfVdH-.d.cts.map +1 -0
- package/ProgressCircle-BC81D9sU.cjs +196 -0
- package/ProgressCircle-BC81D9sU.cjs.map +1 -0
- package/ProgressCircle-CxrflaLd.d.mts +50 -0
- package/ProgressCircle-CxrflaLd.d.mts.map +1 -0
- package/ProgressCircle-ae8cvZhe.mjs +191 -0
- package/ProgressCircle-ae8cvZhe.mjs.map +1 -0
- package/ProgressSteps-C3xJUDTs.d.mts +32 -0
- package/ProgressSteps-C3xJUDTs.d.mts.map +1 -0
- package/ProgressSteps-Ls0XahjM.d.cts +32 -0
- package/ProgressSteps-Ls0XahjM.d.cts.map +1 -0
- package/Radio.cjs +13 -0
- package/Radio.d.cts +2 -0
- package/Radio.d.mts +2 -0
- package/Radio.mjs +3 -0
- package/SaveConfetti-DI0MTd63.mjs +179 -0
- package/SaveConfetti-DI0MTd63.mjs.map +1 -0
- package/SaveConfetti-DSJtuE3b.cjs +184 -0
- package/SaveConfetti-DSJtuE3b.cjs.map +1 -0
- package/SearchInput-DYIPC8Cd.d.cts +126 -0
- package/SearchInput-DYIPC8Cd.d.cts.map +1 -0
- package/SearchInput-IfEWePDQ.d.mts +126 -0
- package/SearchInput-IfEWePDQ.d.mts.map +1 -0
- package/SegmentedControl-B5FZ0uX8.cjs +107 -0
- package/SegmentedControl-B5FZ0uX8.cjs.map +1 -0
- package/SegmentedControl-DHf4SQQL.mjs +96 -0
- package/SegmentedControl-DHf4SQQL.mjs.map +1 -0
- package/Select-BXDjzyDs.cjs +248 -0
- package/Select-BXDjzyDs.cjs.map +1 -0
- package/Select-BkZu8OLs.mjs +241 -0
- package/Select-BkZu8OLs.mjs.map +1 -0
- package/Select-g4yFQq1-.d.mts +36 -0
- package/Select-g4yFQq1-.d.mts.map +1 -0
- package/Select-ghtIe-gD.d.cts +36 -0
- package/Select-ghtIe-gD.d.cts.map +1 -0
- package/SelectAsync-267GxTnI.d.cts +11 -0
- package/SelectAsync-267GxTnI.d.cts.map +1 -0
- package/SelectAsync-CLcESc8k.d.mts +11 -0
- package/SelectAsync-CLcESc8k.d.mts.map +1 -0
- package/SelectAsyncCreatable-B2gB_MWk.d.mts +11 -0
- package/SelectAsyncCreatable-B2gB_MWk.d.mts.map +1 -0
- package/SelectAsyncCreatable-BhuvLhbk.d.cts +11 -0
- package/SelectAsyncCreatable-BhuvLhbk.d.cts.map +1 -0
- package/SelectCreatable-C87i1L43.d.cts +11 -0
- package/SelectCreatable-C87i1L43.d.cts.map +1 -0
- package/SelectCreatable-CNVa1sx-.d.mts +11 -0
- package/SelectCreatable-CNVa1sx-.d.mts.map +1 -0
- package/SingleCard-DPaHU2wR.d.mts +19 -0
- package/SingleCard-DPaHU2wR.d.mts.map +1 -0
- package/SingleCard-X1dP0AHZ.d.cts +19 -0
- package/SingleCard-X1dP0AHZ.d.cts.map +1 -0
- package/Skeleton-40Vi20JV.d.cts +15 -0
- package/Skeleton-40Vi20JV.d.cts.map +1 -0
- package/Skeleton-40Vi20JV.d.mts +15 -0
- package/Skeleton-40Vi20JV.d.mts.map +1 -0
- package/SplitButton-DK-LdIwN.d.cts +80 -0
- package/SplitButton-DK-LdIwN.d.cts.map +1 -0
- package/SplitButton-DK-LdIwN.d.mts +80 -0
- package/SplitButton-DK-LdIwN.d.mts.map +1 -0
- package/SplitButton-DcmmLW8j.cjs +184 -0
- package/SplitButton-DcmmLW8j.cjs.map +1 -0
- package/SplitButton-WE5ymwCQ.mjs +179 -0
- package/SplitButton-WE5ymwCQ.mjs.map +1 -0
- package/StarRating-CRGx_jeU.mjs +81 -0
- package/StarRating-CRGx_jeU.mjs.map +1 -0
- package/StarRating-Dski54FS.cjs +86 -0
- package/StarRating-Dski54FS.cjs.map +1 -0
- package/StarRating-Dx1nbkcG.d.mts +89 -0
- package/StarRating-Dx1nbkcG.d.mts.map +1 -0
- package/StarRating-TfkOMATk.d.cts +89 -0
- package/StarRating-TfkOMATk.d.cts.map +1 -0
- package/SuggestionChip-BLq_0VFE.d.cts +13 -0
- package/SuggestionChip-BLq_0VFE.d.cts.map +1 -0
- package/SuggestionChip-CilkTYTJ.d.mts +13 -0
- package/SuggestionChip-CilkTYTJ.d.mts.map +1 -0
- package/Table-CLlDragJ.cjs +500 -0
- package/Table-CLlDragJ.cjs.map +1 -0
- package/Table-M-rANdMt.mjs +495 -0
- package/Table-M-rANdMt.mjs.map +1 -0
- package/Tabs-DRT-IQZk.d.cts +41 -0
- package/Tabs-DRT-IQZk.d.cts.map +1 -0
- package/Tabs-DRT-IQZk.d.mts +41 -0
- package/Tabs-DRT-IQZk.d.mts.map +1 -0
- package/Text-BVoakc0X.d.cts +63 -0
- package/Text-BVoakc0X.d.cts.map +1 -0
- package/Text-OlyNC1yj.d.mts +63 -0
- package/Text-OlyNC1yj.d.mts.map +1 -0
- package/TextArea-C-a06VpC.d.cts +58 -0
- package/TextArea-C-a06VpC.d.cts.map +1 -0
- package/TextArea-CTHcW_IE.d.mts +58 -0
- package/TextArea-CTHcW_IE.d.mts.map +1 -0
- package/TextInput-BhkeQZh4.d.cts +47 -0
- package/TextInput-BhkeQZh4.d.cts.map +1 -0
- package/TextInput-CWCeR18b.d.mts +47 -0
- package/TextInput-CWCeR18b.d.mts.map +1 -0
- package/Thumbnails-B-eOrf55.d.cts +226 -0
- package/Thumbnails-B-eOrf55.d.cts.map +1 -0
- package/Thumbnails-B-eOrf55.d.mts +226 -0
- package/Thumbnails-B-eOrf55.d.mts.map +1 -0
- package/TimePickerTarget-BHceCsfc.cjs +25 -0
- package/TimePickerTarget-BHceCsfc.cjs.map +1 -0
- package/TimePickerTarget-DlbryTho.mjs +14 -0
- package/TimePickerTarget-DlbryTho.mjs.map +1 -0
- package/TimePickerTarget-pYRxAfb2.d.cts +14 -0
- package/TimePickerTarget-pYRxAfb2.d.cts.map +1 -0
- package/TimePickerTarget-pYRxAfb2.d.mts +14 -0
- package/TimePickerTarget-pYRxAfb2.d.mts.map +1 -0
- package/Toast-CPEKESLZ.cjs +107 -0
- package/Toast-CPEKESLZ.cjs.map +1 -0
- package/Toast-CdUaFVpt.mjs +96 -0
- package/Toast-CdUaFVpt.mjs.map +1 -0
- package/ToggleSwitch-D-HRkEg2.d.cts +60 -0
- package/ToggleSwitch-D-HRkEg2.d.cts.map +1 -0
- package/ToggleSwitch-D-HRkEg2.d.mts +60 -0
- package/ToggleSwitch-D-HRkEg2.d.mts.map +1 -0
- package/Tooltip-D6_5Rsmd.d.cts +21 -0
- package/Tooltip-D6_5Rsmd.d.cts.map +1 -0
- package/Tooltip-D6_5Rsmd.d.mts +21 -0
- package/Tooltip-D6_5Rsmd.d.mts.map +1 -0
- package/Tooltip.cjs +38 -0
- package/Tooltip.cjs.map +1 -0
- package/Tooltip.d.cts +2 -0
- package/Tooltip.d.mts +2 -0
- package/Tooltip.mjs +26 -0
- package/Tooltip.mjs.map +1 -0
- package/Typography/InlineButton.cjs +63 -0
- package/Typography/InlineButton.cjs.map +1 -0
- package/Typography/InlineButton.d.cts +2 -0
- package/Typography/InlineButton.d.mts +2 -0
- package/Typography/InlineButton.mjs +59 -0
- package/Typography/InlineButton.mjs.map +1 -0
- package/Typography/Links.cjs +62 -0
- package/Typography/Links.cjs.map +1 -0
- package/Typography/Links.d.cts +2 -0
- package/Typography/Links.d.mts +2 -0
- package/Typography/Links.mjs +51 -0
- package/Typography/Links.mjs.map +1 -0
- package/Typography/Text.cjs +178 -0
- package/Typography/Text.cjs.map +1 -0
- package/Typography/Text.d.cts +2 -0
- package/Typography/Text.d.mts +2 -0
- package/Typography/Text.mjs +163 -0
- package/Typography/Text.mjs.map +1 -0
- package/ViewMore-BBoUvo7p.cjs +138 -0
- package/ViewMore-BBoUvo7p.cjs.map +1 -0
- package/ViewMore-BrZPuE4E.mjs +133 -0
- package/ViewMore-BrZPuE4E.mjs.map +1 -0
- package/ViewMore-DKC9SYL4.d.cts +93 -0
- package/ViewMore-DKC9SYL4.d.cts.map +1 -0
- package/ViewMore-DKC9SYL4.d.mts +93 -0
- package/ViewMore-DKC9SYL4.d.mts.map +1 -0
- package/WebRTCPlayer-C-sTtskR.mjs +940 -0
- package/WebRTCPlayer-C-sTtskR.mjs.map +1 -0
- package/WebRTCPlayer-CssffyCM.cjs +983 -0
- package/WebRTCPlayer-CssffyCM.cjs.map +1 -0
- package/accordion.cjs +126 -0
- package/accordion.cjs.map +1 -0
- package/accordion.d.cts +2 -0
- package/accordion.d.mts +2 -0
- package/accordion.mjs +120 -0
- package/accordion.mjs.map +1 -0
- package/addressDisplay.cjs +7 -0
- package/addressDisplay.d.cts +2 -0
- package/addressDisplay.d.mts +2 -0
- package/addressDisplay.mjs +3 -0
- package/anyIcon-C3IQzJJ9.d.cts +7 -0
- package/anyIcon-C3IQzJJ9.d.cts.map +1 -0
- package/anyIcon-eR07wvJb.d.mts +7 -0
- package/anyIcon-eR07wvJb.d.mts.map +1 -0
- package/automatedCarousel.cjs +7 -0
- package/automatedCarousel.d.cts +2 -0
- package/automatedCarousel.d.mts +2 -0
- package/automatedCarousel.mjs +3 -0
- package/bannerNotification.cjs +7 -0
- package/bannerNotification.d.cts +2 -0
- package/bannerNotification.d.mts +2 -0
- package/bannerNotification.mjs +3 -0
- package/bottomSheet.cjs +7 -0
- package/bottomSheet.d.cts +2 -0
- package/bottomSheet.d.mts +2 -0
- package/bottomSheet.mjs +3 -0
- package/breadcrumbs.cjs +7 -0
- package/breadcrumbs.d.cts +2 -0
- package/breadcrumbs.d.mts +2 -0
- package/breadcrumbs.mjs +3 -0
- package/breakpoints.cjs +53 -0
- package/breakpoints.cjs.map +1 -0
- package/breakpoints.d.cts +2 -0
- package/breakpoints.d.mts +2 -0
- package/breakpoints.mjs +46 -0
- package/breakpoints.mjs.map +1 -0
- package/buttonColorClasses-B7OU4aQA.mjs +22 -0
- package/buttonColorClasses-B7OU4aQA.mjs.map +1 -0
- package/buttonColorClasses-C3hg1at8.cjs +93 -0
- package/buttonColorClasses-C3hg1at8.cjs.map +1 -0
- package/card/cardGrid.cjs +7 -0
- package/card/cardGrid.d.cts +2 -0
- package/card/cardGrid.d.mts +2 -0
- package/card/cardGrid.mjs +3 -0
- package/card/components/createBadge.cjs +27 -0
- package/card/components/createBadge.cjs.map +1 -0
- package/card/components/createBadge.d.cts +2 -0
- package/card/components/createBadge.d.mts +2 -0
- package/card/components/createBadge.mjs +23 -0
- package/card/components/createBadge.mjs.map +1 -0
- package/card/components/createFavoriteButton.cjs +31 -0
- package/card/components/createFavoriteButton.cjs.map +1 -0
- package/card/components/createFavoriteButton.d.cts +2 -0
- package/card/components/createFavoriteButton.d.mts +2 -0
- package/card/components/createFavoriteButton.mjs +27 -0
- package/card/components/createFavoriteButton.mjs.map +1 -0
- package/card/components/createImage.cjs +44 -0
- package/card/components/createImage.cjs.map +1 -0
- package/card/components/createImage.d.cts +2 -0
- package/card/components/createImage.d.mts +2 -0
- package/card/components/createImage.mjs +40 -0
- package/card/components/createImage.mjs.map +1 -0
- package/card/components/createInfo.cjs +61 -0
- package/card/components/createInfo.cjs.map +1 -0
- package/card/components/createInfo.d.cts +2 -0
- package/card/components/createInfo.d.mts +2 -0
- package/card/components/createInfo.mjs +56 -0
- package/card/components/createInfo.mjs.map +1 -0
- package/card/components/createName.cjs +43 -0
- package/card/components/createName.cjs.map +1 -0
- package/card/components/createName.d.cts +2 -0
- package/card/components/createName.d.mts +2 -0
- package/card/components/createName.mjs +39 -0
- package/card/components/createName.mjs.map +1 -0
- package/card/components/createPriceStatus.cjs +77 -0
- package/card/components/createPriceStatus.cjs.map +1 -0
- package/card/components/createPriceStatus.d.cts +2 -0
- package/card/components/createPriceStatus.d.mts +2 -0
- package/card/components/createPriceStatus.mjs +70 -0
- package/card/components/createPriceStatus.mjs.map +1 -0
- package/card/factory.cjs +7 -0
- package/card/factory.d.cts +3 -0
- package/card/factory.d.mts +3 -0
- package/card/factory.mjs +3 -0
- package/card/singleCard.cjs +18 -0
- package/card/singleCard.cjs.map +1 -0
- package/card/singleCard.d.cts +2 -0
- package/card/singleCard.d.mts +2 -0
- package/card/singleCard.mjs +14 -0
- package/card/singleCard.mjs.map +1 -0
- package/cardFactory-B0Ah0Qb8.mjs +102 -0
- package/cardFactory-B0Ah0Qb8.mjs.map +1 -0
- package/cardFactory-CEKTSSXs.d.cts +37 -0
- package/cardFactory-CEKTSSXs.d.cts.map +1 -0
- package/cardFactory-DTU3jY-R.cjs +107 -0
- package/cardFactory-DTU3jY-R.cjs.map +1 -0
- package/cardFactory-Z5a675Nr.d.mts +37 -0
- package/cardFactory-Z5a675Nr.d.mts.map +1 -0
- package/carousel.cjs +10 -0
- package/carousel.d.cts +2 -0
- package/carousel.d.mts +2 -0
- package/carousel.mjs +3 -0
- package/chipTypes-Bi0ZROty.d.cts +109 -0
- package/chipTypes-Bi0ZROty.d.cts.map +1 -0
- package/chipTypes-Bi0ZROty.d.mts +109 -0
- package/chipTypes-Bi0ZROty.d.mts.map +1 -0
- package/chips/chip.cjs +102 -0
- package/chips/chip.cjs.map +1 -0
- package/chips/chip.d.cts +2 -0
- package/chips/chip.d.mts +2 -0
- package/chips/chip.mjs +98 -0
- package/chips/chip.mjs.map +1 -0
- package/chips/chipGroup.cjs +127 -0
- package/chips/chipGroup.cjs.map +1 -0
- package/chips/chipGroup.d.cts +2 -0
- package/chips/chipGroup.d.mts +2 -0
- package/chips/chipGroup.mjs +123 -0
- package/chips/chipGroup.mjs.map +1 -0
- package/chips/suggestion.cjs +20 -0
- package/chips/suggestion.cjs.map +1 -0
- package/chips/suggestion.d.cts +2 -0
- package/chips/suggestion.d.mts +2 -0
- package/chips/suggestion.mjs +16 -0
- package/chips/suggestion.mjs.map +1 -0
- package/chips/types.cjs +1 -0
- package/chips/types.d.cts +2 -0
- package/chips/types.d.mts +2 -0
- package/chips/types.mjs +2 -0
- package/chips.cjs +12 -0
- package/chips.d.cts +5 -0
- package/chips.d.mts +5 -0
- package/chips.mjs +6 -0
- package/collapsible.cjs +47 -0
- package/collapsible.cjs.map +1 -0
- package/collapsible.d.cts +2 -0
- package/collapsible.d.mts +2 -0
- package/collapsible.mjs +43 -0
- package/collapsible.mjs.map +1 -0
- package/components-BPFB_cmZ.mjs +346 -0
- package/components-BPFB_cmZ.mjs.map +1 -0
- package/components-CL4KcKF0.cjs +393 -0
- package/components-CL4KcKF0.cjs.map +1 -0
- package/confetti.cjs +7 -0
- package/confetti.d.cts +2 -0
- package/confetti.d.mts +2 -0
- package/confetti.mjs +3 -0
- package/contentPager.cjs +9 -0
- package/contentPager.d.cts +2 -0
- package/contentPager.d.mts +2 -0
- package/contentPager.mjs +3 -0
- package/context--_0mDNFa.d.cts +24 -0
- package/context--_0mDNFa.d.cts.map +1 -0
- package/context--_0mDNFa.d.mts +24 -0
- package/context--_0mDNFa.d.mts.map +1 -0
- package/cookieConsent.cjs +11 -0
- package/cookieConsent.d.cts +2 -0
- package/cookieConsent.d.mts +2 -0
- package/cookieConsent.mjs +3 -0
- package/countdown/types.cjs +1 -0
- package/countdown/types.d.cts +2 -0
- package/countdown/types.d.mts +2 -0
- package/countdown/types.mjs +2 -0
- package/countdown.cjs +7 -0
- package/countdown.d.cts +2 -0
- package/countdown.d.mts +2 -0
- package/countdown.mjs +3 -0
- package/createBadge-CYumy92O.d.mts +19 -0
- package/createBadge-CYumy92O.d.mts.map +1 -0
- package/createBadge-LFbUXGlB.d.cts +19 -0
- package/createBadge-LFbUXGlB.d.cts.map +1 -0
- package/createFavoriteButton-8xbCWiTD.d.mts +21 -0
- package/createFavoriteButton-8xbCWiTD.d.mts.map +1 -0
- package/createFavoriteButton-Bnp0UOEq.d.cts +21 -0
- package/createFavoriteButton-Bnp0UOEq.d.cts.map +1 -0
- package/createImage-BYnNgRok.d.mts +26 -0
- package/createImage-BYnNgRok.d.mts.map +1 -0
- package/createImage-DYLD7AJb.d.cts +26 -0
- package/createImage-DYLD7AJb.d.cts.map +1 -0
- package/createInfo-C9sqGWBq.d.mts +44 -0
- package/createInfo-C9sqGWBq.d.mts.map +1 -0
- package/createInfo-USBqE7Tt.d.cts +44 -0
- package/createInfo-USBqE7Tt.d.cts.map +1 -0
- package/createName-DB7BL9GP.d.cts +26 -0
- package/createName-DB7BL9GP.d.cts.map +1 -0
- package/createName-U7oHRNVL.d.mts +26 -0
- package/createName-U7oHRNVL.d.mts.map +1 -0
- package/createPriceStatus-C-amebFt.d.cts +30 -0
- package/createPriceStatus-C-amebFt.d.cts.map +1 -0
- package/createPriceStatus-DBWT6ob8.d.mts +30 -0
- package/createPriceStatus-DBWT6ob8.d.mts.map +1 -0
- package/dateInput.cjs +98 -0
- package/dateInput.cjs.map +1 -0
- package/dateInput.d.cts +2 -0
- package/dateInput.d.mts +2 -0
- package/dateInput.mjs +94 -0
- package/dateInput.mjs.map +1 -0
- package/datePicker-DQ32Z8yo.mjs +136 -0
- package/datePicker-DQ32Z8yo.mjs.map +1 -0
- package/datePicker-DaYegd15.cjs +141 -0
- package/datePicker-DaYegd15.cjs.map +1 -0
- package/datePicker.cjs +9 -0
- package/datePicker.d.cts +3 -0
- package/datePicker.d.mts +3 -0
- package/datePicker.mjs +4 -0
- package/dateTimeInput/utils.cjs +8 -0
- package/dateTimeInput/utils.d.cts +2 -0
- package/dateTimeInput/utils.d.mts +2 -0
- package/dateTimeInput/utils.mjs +3 -0
- package/drawer.cjs +7 -0
- package/drawer.d.cts +2 -0
- package/drawer.d.mts +2 -0
- package/drawer.mjs +3 -0
- package/educationalPopover.cjs +110 -0
- package/educationalPopover.cjs.map +1 -0
- package/educationalPopover.d.cts +2 -0
- package/educationalPopover.d.mts +2 -0
- package/educationalPopover.mjs +106 -0
- package/educationalPopover.mjs.map +1 -0
- package/effectEventListener-DmVY5Sgy.cjs +16 -0
- package/effectEventListener-DmVY5Sgy.cjs.map +1 -0
- package/effectEventListener-WApakaup.mjs +11 -0
- package/effectEventListener-WApakaup.mjs.map +1 -0
- package/favoriteButton.cjs +7 -0
- package/favoriteButton.d.cts +2 -0
- package/favoriteButton.d.mts +2 -0
- package/favoriteButton.mjs +3 -0
- package/featureFlagProvider-Cl66ibpA.cjs +25 -0
- package/featureFlagProvider-Cl66ibpA.cjs.map +1 -0
- package/featureFlagProvider-_wGBROhw.mjs +14 -0
- package/featureFlagProvider-_wGBROhw.mjs.map +1 -0
- package/featureFlags/devTools/FeatureFlagDevToolsUI.cjs +7 -0
- package/featureFlags/devTools/FeatureFlagDevToolsUI.d.cts +2 -0
- package/featureFlags/devTools/FeatureFlagDevToolsUI.d.mts +2 -0
- package/featureFlags/devTools/FeatureFlagDevToolsUI.mjs +3 -0
- package/featureFlags/devTools/getFeatureFlagCookieOverrides.cjs +27 -0
- package/featureFlags/devTools/getFeatureFlagCookieOverrides.cjs.map +1 -0
- package/featureFlags/devTools/getFeatureFlagCookieOverrides.d.cts +15 -0
- package/featureFlags/devTools/getFeatureFlagCookieOverrides.d.cts.map +1 -0
- package/featureFlags/devTools/getFeatureFlagCookieOverrides.d.mts +15 -0
- package/featureFlags/devTools/getFeatureFlagCookieOverrides.d.mts.map +1 -0
- package/featureFlags/devTools/getFeatureFlagCookieOverrides.mjs +23 -0
- package/featureFlags/devTools/getFeatureFlagCookieOverrides.mjs.map +1 -0
- package/featureFlags/hooks.cjs +9 -0
- package/featureFlags/hooks.d.cts +2 -0
- package/featureFlags/hooks.d.mts +2 -0
- package/featureFlags/hooks.mjs +4 -0
- package/fileUpload/hooks.cjs +8 -0
- package/fileUpload/hooks.d.cts +2 -0
- package/fileUpload/hooks.d.mts +2 -0
- package/fileUpload/hooks.mjs +3 -0
- package/fileUpload/testUtils/mockFilesAndImages.cjs +68 -0
- package/fileUpload/testUtils/mockFilesAndImages.cjs.map +1 -0
- package/fileUpload/testUtils/mockFilesAndImages.d.cts +19 -0
- package/fileUpload/testUtils/mockFilesAndImages.d.cts.map +1 -0
- package/fileUpload/testUtils/mockFilesAndImages.d.mts +19 -0
- package/fileUpload/testUtils/mockFilesAndImages.d.mts.map +1 -0
- package/fileUpload/testUtils/mockFilesAndImages.mjs +52 -0
- package/fileUpload/testUtils/mockFilesAndImages.mjs.map +1 -0
- package/fileUpload/testUtils/testUtils.cjs +91 -0
- package/fileUpload/testUtils/testUtils.cjs.map +1 -0
- package/fileUpload/testUtils/testUtils.d.cts +13 -0
- package/fileUpload/testUtils/testUtils.d.cts.map +1 -0
- package/fileUpload/testUtils/testUtils.d.mts +13 -0
- package/fileUpload/testUtils/testUtils.d.mts.map +1 -0
- package/fileUpload/testUtils/testUtils.mjs +81 -0
- package/fileUpload/testUtils/testUtils.mjs.map +1 -0
- package/fileUpload/types.cjs +31 -0
- package/fileUpload/types.cjs.map +1 -0
- package/fileUpload/types.d.cts +2 -0
- package/fileUpload/types.d.mts +2 -0
- package/fileUpload/types.mjs +26 -0
- package/fileUpload/types.mjs.map +1 -0
- package/fileUpload.cjs +24 -0
- package/fileUpload.d.cts +4 -0
- package/fileUpload.d.mts +4 -0
- package/fileUpload.mjs +4 -0
- package/formLabel.cjs +108 -0
- package/formLabel.cjs.map +1 -0
- package/formLabel.d.cts +2 -0
- package/formLabel.d.mts +2 -0
- package/formLabel.mjs +103 -0
- package/formLabel.mjs.map +1 -0
- package/grid.cjs +128 -0
- package/grid.cjs.map +1 -0
- package/grid.d.cts +3 -0
- package/grid.d.mts +3 -0
- package/grid.mjs +118 -0
- package/grid.mjs.map +1 -0
- package/gridHighlighter-BU9PvG5f.d.cts +29 -0
- package/gridHighlighter-BU9PvG5f.d.cts.map +1 -0
- package/gridHighlighter-BU9PvG5f.d.mts +29 -0
- package/gridHighlighter-BU9PvG5f.d.mts.map +1 -0
- package/gridHighlighter-BcGNd3EE.mjs +55 -0
- package/gridHighlighter-BcGNd3EE.mjs.map +1 -0
- package/gridHighlighter-BiSMM7lW.cjs +66 -0
- package/gridHighlighter-BiSMM7lW.cjs.map +1 -0
- package/hooks/usePrevious.cjs +21 -0
- package/hooks/usePrevious.cjs.map +1 -0
- package/hooks/usePrevious.d.cts +2 -0
- package/hooks/usePrevious.d.mts +2 -0
- package/hooks/usePrevious.mjs +17 -0
- package/hooks/usePrevious.mjs.map +1 -0
- package/hooks-8VsDqwlb.cjs +672 -0
- package/hooks-8VsDqwlb.cjs.map +1 -0
- package/hooks-BudbgYTF.mjs +22 -0
- package/hooks-BudbgYTF.mjs.map +1 -0
- package/hooks-D4sJ62Xl.mjs +607 -0
- package/hooks-D4sJ62Xl.mjs.map +1 -0
- package/hooks-DDMD_CDN.cjs +27 -0
- package/hooks-DDMD_CDN.cjs.map +1 -0
- package/horizontalScrollFadeMixin-BBr1qJpj.mjs +38 -0
- package/horizontalScrollFadeMixin-BBr1qJpj.mjs.map +1 -0
- package/horizontalScrollFadeMixin-ChYR-9hE.cjs +43 -0
- package/horizontalScrollFadeMixin-ChYR-9hE.cjs.map +1 -0
- package/imageCluster.cjs +54 -0
- package/imageCluster.cjs.map +1 -0
- package/imageCluster.d.cts +2 -0
- package/imageCluster.d.mts +2 -0
- package/imageCluster.mjs +50 -0
- package/imageCluster.mjs.map +1 -0
- package/imageSlider.cjs +10 -0
- package/imageSlider.d.cts +2 -0
- package/imageSlider.d.mts +2 -0
- package/imageSlider.mjs +3 -0
- package/index-3V0Y3AU3.d.mts +25 -0
- package/index-3V0Y3AU3.d.mts.map +1 -0
- package/index-9649Aqry.d.cts +84 -0
- package/index-9649Aqry.d.cts.map +1 -0
- package/index-9649Aqry.d.mts +84 -0
- package/index-9649Aqry.d.mts.map +1 -0
- package/index-B-GVogfk2.d.mts +519 -0
- package/index-B-GVogfk2.d.mts.map +1 -0
- package/index-BAR19_eg.d.cts +494 -0
- package/index-BAR19_eg.d.cts.map +1 -0
- package/index-BAR19_eg.d.mts +494 -0
- package/index-BAR19_eg.d.mts.map +1 -0
- package/index-BIbZcTRq.d.cts +236 -0
- package/index-BIbZcTRq.d.cts.map +1 -0
- package/index-BVb-FJDo.d.mts +322 -0
- package/index-BVb-FJDo.d.mts.map +1 -0
- package/index-BXz3rMMk.d.cts +322 -0
- package/index-BXz3rMMk.d.cts.map +1 -0
- package/index-Bm-eSWuV.d.mts +75 -0
- package/index-Bm-eSWuV.d.mts.map +1 -0
- package/index-BsA0Oogf.d.cts +75 -0
- package/index-BsA0Oogf.d.cts.map +1 -0
- package/index-Bu7c6X7O.d.mts +117 -0
- package/index-Bu7c6X7O.d.mts.map +1 -0
- package/index-BvJOKeoD.d.cts +94 -0
- package/index-BvJOKeoD.d.cts.map +1 -0
- package/index-BvJOKeoD.d.mts +94 -0
- package/index-BvJOKeoD.d.mts.map +1 -0
- package/index-ByYgcpRS.d.cts +1644 -0
- package/index-ByYgcpRS.d.cts.map +1 -0
- package/index-ByZJ4iMT2.d.mts +143 -0
- package/index-ByZJ4iMT2.d.mts.map +1 -0
- package/index-BzN9RaXe.d.cts +117 -0
- package/index-BzN9RaXe.d.cts.map +1 -0
- package/index-C1knx8x3.d.cts +8 -0
- package/index-C1knx8x3.d.cts.map +1 -0
- package/index-C1knx8x3.d.mts +8 -0
- package/index-C1knx8x3.d.mts.map +1 -0
- package/index-CEUCcUr8.d.mts +26 -0
- package/index-CEUCcUr8.d.mts.map +1 -0
- package/index-CQb7B4U7.d.mts +25 -0
- package/index-CQb7B4U7.d.mts.map +1 -0
- package/index-CTGvafCc.d.mts +68 -0
- package/index-CTGvafCc.d.mts.map +1 -0
- package/index-CTfIOH2Z2.d.cts +519 -0
- package/index-CTfIOH2Z2.d.cts.map +1 -0
- package/index-CXbRJmrm.d.cts +49 -0
- package/index-CXbRJmrm.d.cts.map +1 -0
- package/index-CXbRJmrm.d.mts +49 -0
- package/index-CXbRJmrm.d.mts.map +1 -0
- package/index-Co9X1Vty.d.cts +25 -0
- package/index-Co9X1Vty.d.cts.map +1 -0
- package/index-D1Zpm1h7.d.cts +58 -0
- package/index-D1Zpm1h7.d.cts.map +1 -0
- package/index-D1Zpm1h7.d.mts +58 -0
- package/index-D1Zpm1h7.d.mts.map +1 -0
- package/index-D2HDrkK3.d.cts +172 -0
- package/index-D2HDrkK3.d.cts.map +1 -0
- package/index-D2HDrkK3.d.mts +172 -0
- package/index-D2HDrkK3.d.mts.map +1 -0
- package/index-D8NtFEaq.d.cts +193 -0
- package/index-D8NtFEaq.d.cts.map +1 -0
- package/index-D8NtFEaq.d.mts +193 -0
- package/index-D8NtFEaq.d.mts.map +1 -0
- package/index-DBYqF9Sr.d.cts +39 -0
- package/index-DBYqF9Sr.d.cts.map +1 -0
- package/index-DS-jIZFO.d.mts +1644 -0
- package/index-DS-jIZFO.d.mts.map +1 -0
- package/index-DTEgNDXq.d.mts +111 -0
- package/index-DTEgNDXq.d.mts.map +1 -0
- package/index-DTEgNDXq2.d.cts +111 -0
- package/index-DTEgNDXq2.d.cts.map +1 -0
- package/index-DUdcrvAe.d.cts +26 -0
- package/index-DUdcrvAe.d.cts.map +1 -0
- package/index-DUdcrvAe.d.mts +26 -0
- package/index-DUdcrvAe.d.mts.map +1 -0
- package/index-DwA_GqJq.d.cts +26 -0
- package/index-DwA_GqJq.d.cts.map +1 -0
- package/index-MX_CgDGs.d.cts +147 -0
- package/index-MX_CgDGs.d.cts.map +1 -0
- package/index-MX_CgDGs.d.mts +147 -0
- package/index-MX_CgDGs.d.mts.map +1 -0
- package/index-NeSBj5ci.d.cts +200 -0
- package/index-NeSBj5ci.d.cts.map +1 -0
- package/index-NeSBj5ci.d.mts +200 -0
- package/index-NeSBj5ci.d.mts.map +1 -0
- package/index-XZwBshBM.d.cts +177 -0
- package/index-XZwBshBM.d.cts.map +1 -0
- package/index-XZwBshBM.d.mts +177 -0
- package/index-XZwBshBM.d.mts.map +1 -0
- package/index-dpfLYhgI.d.mts +39 -0
- package/index-dpfLYhgI.d.mts.map +1 -0
- package/index-kchg551L.d.cts +25 -0
- package/index-kchg551L.d.cts.map +1 -0
- package/index-l7Awc0i3.d.cts +68 -0
- package/index-l7Awc0i3.d.cts.map +1 -0
- package/index-ojxI7tqs.d.cts +143 -0
- package/index-ojxI7tqs.d.cts.map +1 -0
- package/index-otqj7yHa.d.mts +236 -0
- package/index-otqj7yHa.d.mts.map +1 -0
- package/index.cjs +472 -0
- package/index.d.cts +101 -0
- package/index.d.mts +101 -0
- package/index.mjs +99 -0
- package/inlineNotification.cjs +82 -0
- package/inlineNotification.cjs.map +1 -0
- package/inlineNotification.d.cts +2 -0
- package/inlineNotification.d.mts +2 -0
- package/inlineNotification.mjs +78 -0
- package/inlineNotification.mjs.map +1 -0
- package/intl/utils.cjs +41 -0
- package/intl/utils.cjs.map +1 -0
- package/intl/utils.d.cts +18 -0
- package/intl/utils.d.cts.map +1 -0
- package/intl/utils.d.mts +18 -0
- package/intl/utils.d.mts.map +1 -0
- package/intl/utils.mjs +34 -0
- package/intl/utils.mjs.map +1 -0
- package/intl.cjs +34 -0
- package/intl.d.cts +5 -0
- package/intl.d.mts +5 -0
- package/intl.mjs +6 -0
- package/jumpMenu.cjs +7 -0
- package/jumpMenu.d.cts +2 -0
- package/jumpMenu.d.mts +2 -0
- package/jumpMenu.mjs +3 -0
- package/loading.cjs +7 -0
- package/loading.d.cts +2 -0
- package/loading.d.mts +2 -0
- package/loading.mjs +3 -0
- package/menu.cjs +9 -0
- package/menu.d.cts +2 -0
- package/menu.d.mts +2 -0
- package/menu.mjs +3 -0
- package/menuContext-4P6eKzkH.mjs +14 -0
- package/menuContext-4P6eKzkH.mjs.map +1 -0
- package/menuContext-B6MhMBDf.cjs +25 -0
- package/menuContext-B6MhMBDf.cjs.map +1 -0
- package/mixins-CoXneD1m.mjs +235 -0
- package/mixins-CoXneD1m.mjs.map +1 -0
- package/mixins-D56ptENc.cjs +282 -0
- package/mixins-D56ptENc.cjs.map +1 -0
- package/mixins.cjs +13 -0
- package/mixins.d.cts +2 -0
- package/mixins.d.mts +2 -0
- package/mixins.mjs +2 -0
- package/modal/components.cjs +16 -0
- package/modal/components.d.cts +3 -0
- package/modal/components.d.mts +3 -0
- package/modal/components.mjs +4 -0
- package/modal/context.cjs +26 -0
- package/modal/context.cjs.map +1 -0
- package/modal/context.d.cts +2 -0
- package/modal/context.d.mts +2 -0
- package/modal/context.mjs +21 -0
- package/modal/context.mjs.map +1 -0
- package/modal/useCloseModal.cjs +103 -0
- package/modal/useCloseModal.cjs.map +1 -0
- package/modal/useCloseModal.d.cts +2 -0
- package/modal/useCloseModal.d.mts +2 -0
- package/modal/useCloseModal.mjs +98 -0
- package/modal/useCloseModal.mjs.map +1 -0
- package/modal.cjs +7 -0
- package/modal.d.cts +2 -0
- package/modal.d.mts +2 -0
- package/modal.mjs +3 -0
- package/nodeEnv-B4v61vkJ.mjs +6 -0
- package/nodeEnv-B4v61vkJ.mjs.map +1 -0
- package/nodeEnv-BdQ-HyQz.cjs +11 -0
- package/nodeEnv-BdQ-HyQz.cjs.map +1 -0
- package/notificationBadge.cjs +24 -0
- package/notificationBadge.cjs.map +1 -0
- package/notificationBadge.d.cts +2 -0
- package/notificationBadge.d.mts +2 -0
- package/notificationBadge.mjs +20 -0
- package/notificationBadge.mjs.map +1 -0
- package/package.json +73 -0
- package/pagination.cjs +10 -0
- package/pagination.d.cts +2 -0
- package/pagination.d.mts +2 -0
- package/pagination.mjs +3 -0
- package/phoneInput.cjs +34 -0
- package/phoneInput.d.cts +5 -0
- package/phoneInput.d.mts +5 -0
- package/phoneInput.mjs +6 -0
- package/progressCircle.cjs +7 -0
- package/progressCircle.d.cts +2 -0
- package/progressCircle.d.mts +2 -0
- package/progressCircle.mjs +3 -0
- package/progressSteps.cjs +92 -0
- package/progressSteps.cjs.map +1 -0
- package/progressSteps.d.cts +2 -0
- package/progressSteps.d.mts +2 -0
- package/progressSteps.mjs +88 -0
- package/progressSteps.mjs.map +1 -0
- package/providers.cjs +333 -0
- package/providers.cjs.map +1 -0
- package/providers.d.cts +5 -0
- package/providers.d.mts +5 -0
- package/providers.mjs +292 -0
- package/providers.mjs.map +1 -0
- package/rolldown-runtime-D6vf50IK.cjs +28 -0
- package/saveConfetti.cjs +7 -0
- package/saveConfetti.d.cts +2 -0
- package/saveConfetti.d.mts +2 -0
- package/saveConfetti.mjs +3 -0
- package/searchInput.cjs +92 -0
- package/searchInput.cjs.map +1 -0
- package/searchInput.d.cts +2 -0
- package/searchInput.d.mts +2 -0
- package/searchInput.mjs +88 -0
- package/searchInput.mjs.map +1 -0
- package/segmentedControl.cjs +8 -0
- package/segmentedControl.d.cts +2 -0
- package/segmentedControl.d.mts +2 -0
- package/segmentedControl.mjs +3 -0
- package/select.cjs +9 -0
- package/select.d.cts +2 -0
- package/select.d.mts +2 -0
- package/select.mjs +3 -0
- package/selectAsync.cjs +20 -0
- package/selectAsync.cjs.map +1 -0
- package/selectAsync.d.cts +2 -0
- package/selectAsync.d.mts +2 -0
- package/selectAsync.mjs +14 -0
- package/selectAsync.mjs.map +1 -0
- package/selectAsyncCreatable.cjs +19 -0
- package/selectAsyncCreatable.cjs.map +1 -0
- package/selectAsyncCreatable.d.cts +2 -0
- package/selectAsyncCreatable.d.mts +2 -0
- package/selectAsyncCreatable.mjs +13 -0
- package/selectAsyncCreatable.mjs.map +1 -0
- package/selectComponents.cjs +12 -0
- package/selectComponents.d.cts +2 -0
- package/selectComponents.d.mts +2 -0
- package/selectComponents.mjs +3 -0
- package/selectCreatable.cjs +19 -0
- package/selectCreatable.cjs.map +1 -0
- package/selectCreatable.d.cts +2 -0
- package/selectCreatable.d.mts +2 -0
- package/selectCreatable.mjs +13 -0
- package/selectCreatable.mjs.map +1 -0
- package/sharedProps-D7PSXdXt.d.mts +16 -0
- package/sharedProps-D7PSXdXt.d.mts.map +1 -0
- package/sharedProps-DPhLON6O.d.cts +16 -0
- package/sharedProps-DPhLON6O.d.cts.map +1 -0
- package/skeleton.cjs +24 -0
- package/skeleton.cjs.map +1 -0
- package/skeleton.d.cts +2 -0
- package/skeleton.d.mts +2 -0
- package/skeleton.mjs +18 -0
- package/skeleton.mjs.map +1 -0
- package/spacing.cjs +27 -0
- package/spacing.cjs.map +1 -0
- package/spacing.d.cts +13 -0
- package/spacing.d.cts.map +1 -0
- package/spacing.d.mts +13 -0
- package/spacing.d.mts.map +1 -0
- package/spacing.mjs +15 -0
- package/spacing.mjs.map +1 -0
- package/splitButton.cjs +7 -0
- package/splitButton.d.cts +2 -0
- package/splitButton.d.mts +2 -0
- package/splitButton.mjs +3 -0
- package/starRating.cjs +7 -0
- package/starRating.d.cts +2 -0
- package/starRating.d.mts +2 -0
- package/starRating.mjs +3 -0
- package/table.cjs +7 -0
- package/table.d.cts +2 -0
- package/table.d.mts +2 -0
- package/table.mjs +3 -0
- package/tabs.cjs +191 -0
- package/tabs.cjs.map +1 -0
- package/tabs.d.cts +2 -0
- package/tabs.d.mts +2 -0
- package/tabs.mjs +187 -0
- package/tabs.mjs.map +1 -0
- package/textArea.cjs +75 -0
- package/textArea.cjs.map +1 -0
- package/textArea.d.cts +2 -0
- package/textArea.d.mts +2 -0
- package/textArea.mjs +71 -0
- package/textArea.mjs.map +1 -0
- package/textInput.cjs +7 -0
- package/textInput.d.cts +2 -0
- package/textInput.d.mts +2 -0
- package/textInput.mjs +3 -0
- package/timePicker-BPrJk5TQ.mjs +376 -0
- package/timePicker-BPrJk5TQ.mjs.map +1 -0
- package/timePicker-Bs25zweI.cjs +381 -0
- package/timePicker-Bs25zweI.cjs.map +1 -0
- package/timePicker.cjs +9 -0
- package/timePicker.d.cts +3 -0
- package/timePicker.d.mts +3 -0
- package/timePicker.mjs +4 -0
- package/toast.cjs +8 -0
- package/toast.d.cts +2 -0
- package/toast.d.mts +2 -0
- package/toast.mjs +3 -0
- package/toggleSwitch.cjs +95 -0
- package/toggleSwitch.cjs.map +1 -0
- package/toggleSwitch.d.cts +2 -0
- package/toggleSwitch.d.mts +2 -0
- package/toggleSwitch.mjs +91 -0
- package/toggleSwitch.mjs.map +1 -0
- package/types-rTX1-GHe.d.cts +8 -0
- package/types-rTX1-GHe.d.cts.map +1 -0
- package/types-rTX1-GHe.d.mts +8 -0
- package/types-rTX1-GHe.d.mts.map +1 -0
- package/types-wcNSa96H.d.cts +60 -0
- package/types-wcNSa96H.d.cts.map +1 -0
- package/types-wcNSa96H.d.mts +60 -0
- package/types-wcNSa96H.d.mts.map +1 -0
- package/useCloseModal-CIPrwKwM.d.cts +26 -0
- package/useCloseModal-CIPrwKwM.d.cts.map +1 -0
- package/useCloseModal-CIPrwKwM.d.mts +26 -0
- package/useCloseModal-CIPrwKwM.d.mts.map +1 -0
- package/useFeatureFlags--GRuT9Qc.cjs +24 -0
- package/useFeatureFlags--GRuT9Qc.cjs.map +1 -0
- package/useFeatureFlags-Dmf_37f8.mjs +19 -0
- package/useFeatureFlags-Dmf_37f8.mjs.map +1 -0
- package/useIntersectionObserver-Q6Y3c3sz.mjs +47 -0
- package/useIntersectionObserver-Q6Y3c3sz.mjs.map +1 -0
- package/useIntersectionObserver-oYkZjzFF.cjs +52 -0
- package/useIntersectionObserver-oYkZjzFF.cjs.map +1 -0
- package/usePrevious-DLOWI2sB.d.cts +8 -0
- package/usePrevious-DLOWI2sB.d.cts.map +1 -0
- package/usePrevious-DLOWI2sB.d.mts +8 -0
- package/usePrevious-DLOWI2sB.d.mts.map +1 -0
- package/utils/dateTimeFormat.cjs +217 -0
- package/utils/dateTimeFormat.cjs.map +1 -0
- package/utils/dateTimeFormat.d.cts +176 -0
- package/utils/dateTimeFormat.d.cts.map +1 -0
- package/utils/dateTimeFormat.d.mts +176 -0
- package/utils/dateTimeFormat.d.mts.map +1 -0
- package/utils/dateTimeFormat.mjs +199 -0
- package/utils/dateTimeFormat.mjs.map +1 -0
- package/utils/formatFileSize.cjs +24 -0
- package/utils/formatFileSize.cjs.map +1 -0
- package/utils/formatFileSize.d.cts +5 -0
- package/utils/formatFileSize.d.cts.map +1 -0
- package/utils/formatFileSize.d.mts +5 -0
- package/utils/formatFileSize.d.mts.map +1 -0
- package/utils/formatFileSize.mjs +20 -0
- package/utils/formatFileSize.mjs.map +1 -0
- package/utils-C6Ngn6x9.mjs +23 -0
- package/utils-C6Ngn6x9.mjs.map +1 -0
- package/utils-CvmfGpqu.cjs +34 -0
- package/utils-CvmfGpqu.cjs.map +1 -0
- package/viewMore.cjs +7 -0
- package/viewMore.d.cts +2 -0
- package/viewMore.d.mts +2 -0
- package/viewMore.mjs +3 -0
- package/webRTCPlayer.cjs +13 -0
- package/webRTCPlayer.d.cts +2 -0
- package/webRTCPlayer.d.mts +2 -0
- package/webRTCPlayer.mjs +3 -0
- package/windowSizeProvider-BMaATFiZ.cjs +147 -0
- package/windowSizeProvider-BMaATFiZ.cjs.map +1 -0
- package/windowSizeProvider-sYwAqaOy.mjs +64 -0
- package/windowSizeProvider-sYwAqaOy.mjs.map +1 -0
|
@@ -0,0 +1,1706 @@
|
|
|
1
|
+
import { DotsSixVertical, DotsThreeOutlineVertical, FileArchive, FileCsv, FilePdf, FileText, Files, ImageSquare, ImagesSquare, Paperclip, Trash, UploadSimple } from "./Icons.mjs";
|
|
2
|
+
import { BodyPrimary, BodySecondary, Caption, H4, LabelMini } from "./Typography/Text.mjs";
|
|
3
|
+
import { f as useWindowWidth, l as useWindowIsMobile } from "./windowSizeProvider-sYwAqaOy.mjs";
|
|
4
|
+
import { SubtleLink } from "./Typography/Links.mjs";
|
|
5
|
+
import { IconButton } from "./IconButton.mjs";
|
|
6
|
+
import { Badge } from "./Badge.mjs";
|
|
7
|
+
import { t as Checkbox } from "./ChoiceListItem-BqZ3bIj9.mjs";
|
|
8
|
+
import { formatFileSize } from "./utils/formatFileSize.mjs";
|
|
9
|
+
import { d as builtInErrorCodes, i as UploadValidationProvider, n as useFileValidation, o as resolveContextAwareMessage, s as createMessageContext, t as useImageFilePreviewUrl, u as ACCEPTED_MIME_TYPES } from "./hooks-D4sJ62Xl.mjs";
|
|
10
|
+
import { Tabs } from "./tabs.mjs";
|
|
11
|
+
import { t as Table } from "./Table-M-rANdMt.mjs";
|
|
12
|
+
import { r as MenuItem, t as Menu } from "./Menu-Cxu8CaX1.mjs";
|
|
13
|
+
import { t as ProgressCircle } from "./ProgressCircle-ae8cvZhe.mjs";
|
|
14
|
+
import { cn } from "@evolve.ui/theme-system";
|
|
15
|
+
import { createContext, useCallback, useContext, useMemo, useRef, useState } from "react";
|
|
16
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { breakpoints } from "@evolve.ui/theme-system/themes/common";
|
|
18
|
+
import { useDropzone } from "react-dropzone";
|
|
19
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
20
|
+
//#region src/FileUpload/providers/FileUploadProvider.tsx
|
|
21
|
+
/**
|
|
22
|
+
* React context for file upload state and operations
|
|
23
|
+
* Used by the useFileUploadContext hook
|
|
24
|
+
*/
|
|
25
|
+
const FileUploadContext = createContext(void 0);
|
|
26
|
+
/**
|
|
27
|
+
* Provider component for file upload functionality
|
|
28
|
+
*
|
|
29
|
+
* This provider manages both file state and validation rules:
|
|
30
|
+
* 1. Maintains file state (selected/uploaded files)
|
|
31
|
+
* 2. Provides context for drag/drop operations and file management
|
|
32
|
+
* 3. Wraps children with validation context for enforcing file rules
|
|
33
|
+
*
|
|
34
|
+
* While FileDropzone and FilePreviewList can function as standalone components,
|
|
35
|
+
* using this provider offers coordinated state management when using multiple
|
|
36
|
+
* file upload components together.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <FileUploadProvider
|
|
41
|
+
* accept="images"
|
|
42
|
+
* maxFiles={5}
|
|
43
|
+
* maxSize={2 * 1024 * 1024}
|
|
44
|
+
* onDropAccepted={(files) => console.log('Accepted:', files)}
|
|
45
|
+
* >
|
|
46
|
+
* <FileDropzone />
|
|
47
|
+
* <FilePreviewList />
|
|
48
|
+
* </FileUploadProvider>
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
const FileUploadProvider = ({ accept, children, disabled = false, error, initialFiles = [], maxFiles, maxSize, onDrop, onDropAccepted, onDropRejected, onFileDelete, strictValidation, validator }) => {
|
|
52
|
+
const [files, setFiles] = useState(initialFiles);
|
|
53
|
+
const value = {
|
|
54
|
+
accept,
|
|
55
|
+
disabled,
|
|
56
|
+
files,
|
|
57
|
+
onDrop,
|
|
58
|
+
onDropAccepted,
|
|
59
|
+
onDropRejected,
|
|
60
|
+
onFileDelete,
|
|
61
|
+
setFiles
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ jsx(UploadValidationProvider, {
|
|
64
|
+
accept,
|
|
65
|
+
error,
|
|
66
|
+
maxFiles,
|
|
67
|
+
maxSize,
|
|
68
|
+
strictValidation,
|
|
69
|
+
validator,
|
|
70
|
+
children: /* @__PURE__ */ jsx(FileUploadContext.Provider, {
|
|
71
|
+
value,
|
|
72
|
+
children
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
FileUploadProvider.displayName = "FileUploadProvider";
|
|
77
|
+
/**
|
|
78
|
+
* Hook to access the file upload context
|
|
79
|
+
*
|
|
80
|
+
* Provides access to the current files array and operations for
|
|
81
|
+
* managing file uploads within the FileUploadProvider.
|
|
82
|
+
*
|
|
83
|
+
* @throws Error if used outside of a FileUploadProvider
|
|
84
|
+
* @returns The FileUploadContextType object with files array and handlers
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```tsx
|
|
88
|
+
* const { files, setFiles, onFileDelete } = useFileUploadContext();
|
|
89
|
+
*
|
|
90
|
+
* // Remove a file
|
|
91
|
+
* const handleDelete = (fileToDelete) => {
|
|
92
|
+
* onFileDelete?.(fileToDelete);
|
|
93
|
+
* setFiles(files.filter(file => file.name !== fileToDelete.name));
|
|
94
|
+
* };
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
const useFileUploadContext = () => {
|
|
98
|
+
const context = useContext(FileUploadContext);
|
|
99
|
+
if (!context) throw new Error("useFileUploadContext must be used within FileUploadProvider");
|
|
100
|
+
return context;
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/FileUpload/hooks/upload/useHandleDragEnter/useHandleDragEnter.ts
|
|
104
|
+
const useHandleDragEnter = ({ files, mimeTypes, validation, validator }) => {
|
|
105
|
+
const { accept, clearAllValidation, formattedMaxSize, getValidationMessage, maxFiles, maxSize, setDragValidationError, validateCustomRules, validateFileCount, validateFileType } = validation;
|
|
106
|
+
return useCallback((event) => {
|
|
107
|
+
clearAllValidation();
|
|
108
|
+
const items = event.dataTransfer.items;
|
|
109
|
+
if (items.length === 0) return;
|
|
110
|
+
if (validator) {
|
|
111
|
+
const file = items[0];
|
|
112
|
+
const validationResult = validateCustomRules(file);
|
|
113
|
+
if (validationResult) {
|
|
114
|
+
const result = validationResult[0];
|
|
115
|
+
const messageContext = createMessageContext({
|
|
116
|
+
accept,
|
|
117
|
+
code: result.code,
|
|
118
|
+
count: items.length,
|
|
119
|
+
dragItems: items,
|
|
120
|
+
formattedMaxSize,
|
|
121
|
+
maxFiles,
|
|
122
|
+
maxSize,
|
|
123
|
+
messageType: "drag"
|
|
124
|
+
});
|
|
125
|
+
setDragValidationError({
|
|
126
|
+
code: result.code,
|
|
127
|
+
message: resolveContextAwareMessage(result.message, messageContext)
|
|
128
|
+
});
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (!validateFileCount(files.length, items.length)) {
|
|
133
|
+
const overflowCount = files.length + items.length - (maxFiles ?? Infinity);
|
|
134
|
+
const errorCode = "too-many-files";
|
|
135
|
+
const errorMessage = getValidationMessage({
|
|
136
|
+
code: errorCode,
|
|
137
|
+
count: overflowCount,
|
|
138
|
+
messageType: "drag"
|
|
139
|
+
});
|
|
140
|
+
setDragValidationError({
|
|
141
|
+
code: errorCode,
|
|
142
|
+
message: errorMessage
|
|
143
|
+
});
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const invalidTypeFiles = Array.from(items).filter((item) => {
|
|
147
|
+
if (!item.type || item.kind === "directory") return false;
|
|
148
|
+
return !validateFileType(item.type, mimeTypes);
|
|
149
|
+
});
|
|
150
|
+
if (invalidTypeFiles.length > 0) {
|
|
151
|
+
const errorCode = "file-invalid-type";
|
|
152
|
+
const errorMessage = getValidationMessage({
|
|
153
|
+
code: errorCode,
|
|
154
|
+
count: invalidTypeFiles.length,
|
|
155
|
+
messageType: "drag"
|
|
156
|
+
});
|
|
157
|
+
setDragValidationError({
|
|
158
|
+
code: errorCode,
|
|
159
|
+
message: errorMessage
|
|
160
|
+
});
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
}, [
|
|
164
|
+
files.length,
|
|
165
|
+
mimeTypes,
|
|
166
|
+
clearAllValidation,
|
|
167
|
+
setDragValidationError,
|
|
168
|
+
getValidationMessage,
|
|
169
|
+
validateFileCount,
|
|
170
|
+
maxFiles,
|
|
171
|
+
validateFileType,
|
|
172
|
+
validateCustomRules,
|
|
173
|
+
validator,
|
|
174
|
+
accept,
|
|
175
|
+
formattedMaxSize,
|
|
176
|
+
maxSize
|
|
177
|
+
]);
|
|
178
|
+
};
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/FileUpload/hooks/upload/useHandleDrop/createFileRejectionHelpers.ts
|
|
181
|
+
/**
|
|
182
|
+
* Creates helper functions for processing file rejections and formatting error messages
|
|
183
|
+
* @param validation Validation context containing message formatters and validation rules
|
|
184
|
+
* @returns Object with helper functions for processing file rejections
|
|
185
|
+
*/
|
|
186
|
+
const createRejectionHelpers = (validation) => {
|
|
187
|
+
const { accept, formattedMaxSize, getValidationMessage, maxFiles, maxSize, strictValidation, validateFileCount } = validation;
|
|
188
|
+
/**
|
|
189
|
+
* Ensures an error group exists for the given code, creating one if necessary
|
|
190
|
+
*
|
|
191
|
+
* @param errorGroups - Record of existing error groups indexed by error code
|
|
192
|
+
* @param code - The error code to get or create a group for
|
|
193
|
+
* @param message - Optional error message to use when creating a new group
|
|
194
|
+
* @returns The existing or newly created error group for the specified code
|
|
195
|
+
* @remarks
|
|
196
|
+
* - Error groups track files that failed with the same error code
|
|
197
|
+
* - Each group maintains a count of files, file references, and a shared message
|
|
198
|
+
* - New groups are initialized with empty arrays and zero counts
|
|
199
|
+
*/
|
|
200
|
+
const getOrCreateErrorGroup = (errorGroups, code, message) => {
|
|
201
|
+
if (!(code in errorGroups)) errorGroups[code] = {
|
|
202
|
+
count: 0,
|
|
203
|
+
files: [],
|
|
204
|
+
message: message ?? ""
|
|
205
|
+
};
|
|
206
|
+
return errorGroups[code];
|
|
207
|
+
};
|
|
208
|
+
return {
|
|
209
|
+
/**
|
|
210
|
+
* Formats a human-readable error message for display based on error code and grouped files
|
|
211
|
+
*
|
|
212
|
+
* This function handles two types of validation errors:
|
|
213
|
+
*
|
|
214
|
+
* 1. System errors (built-in): For standard error codes like 'file-too-large' or 'too-many-files',
|
|
215
|
+
* it uses the built-in message system with appropriate pluralization and formatting.
|
|
216
|
+
*
|
|
217
|
+
* 2. Custom validator errors: For custom error codes from user-defined validators,
|
|
218
|
+
* it enriches the message with context about the rejected files (count, names, etc.).
|
|
219
|
+
*
|
|
220
|
+
* Used in two key scenarios:
|
|
221
|
+
* - Creating consolidated error messages for the UI (one message per error type)
|
|
222
|
+
* - Formatting individual file rejection messages for callbacks
|
|
223
|
+
*
|
|
224
|
+
* @param code - The error code identifying the validation failure
|
|
225
|
+
* @param error - The error object containing the message (string or function)
|
|
226
|
+
* @param errorGroups - Record of grouped errors with counts and file references
|
|
227
|
+
* @returns A formatted, human-readable error message ready for display
|
|
228
|
+
*/
|
|
229
|
+
getFormattedErrorGroupMessage: (code, error, errorGroups) => {
|
|
230
|
+
const isSystemError = builtInErrorCodes.includes(code);
|
|
231
|
+
const errorGroup = errorGroups[code];
|
|
232
|
+
if (isSystemError) return getValidationMessage({
|
|
233
|
+
code,
|
|
234
|
+
count: errorGroup.count,
|
|
235
|
+
messageType: "drop"
|
|
236
|
+
});
|
|
237
|
+
const messageContext = createMessageContext({
|
|
238
|
+
accept,
|
|
239
|
+
code,
|
|
240
|
+
count: errorGroup.count,
|
|
241
|
+
dropFiles: errorGroup.files,
|
|
242
|
+
formattedMaxSize,
|
|
243
|
+
maxFiles,
|
|
244
|
+
maxSize,
|
|
245
|
+
messageType: "drop"
|
|
246
|
+
});
|
|
247
|
+
return resolveContextAwareMessage(error.message, messageContext);
|
|
248
|
+
},
|
|
249
|
+
getOrCreateErrorGroup,
|
|
250
|
+
/**
|
|
251
|
+
* Handles file count limits and returns updated accepted/rejected files
|
|
252
|
+
*
|
|
253
|
+
* This function enforces the maxFiles constraint by calculating whether adding
|
|
254
|
+
* new files would exceed the configured limit.
|
|
255
|
+
*
|
|
256
|
+
* @param currentFiles - Existing files already uploaded or selected
|
|
257
|
+
* @param droppedAcceptedFiles - New files that passed initial type/size validation
|
|
258
|
+
* @param droppedRejectedFiles - New files that already failed validation for other reasons
|
|
259
|
+
* @returns Object containing the final accepted and rejected files after limit checks
|
|
260
|
+
* @remarks
|
|
261
|
+
* - Considers both existing files and newly dropped files when checking limits
|
|
262
|
+
* - Handles two validation modes:
|
|
263
|
+
* 1. Strict validation (strictValidation: true):
|
|
264
|
+
* If adding any files would exceed the limit, ALL files are rejected
|
|
265
|
+
* 2. Partial upload (strictValidation: false):
|
|
266
|
+
* Accepts files up to the remaining limit, rejecting only overflow files
|
|
267
|
+
* - Calculates remaining slots as (maxFiles - currentFiles.length)
|
|
268
|
+
* - When no maxFiles is defined, accepts all files (Infinity limit)
|
|
269
|
+
* - Adds appropriate error metadata to the rejected files for UI feedback
|
|
270
|
+
*/
|
|
271
|
+
handleFileCountLimits: (currentFiles, droppedAcceptedFiles, droppedRejectedFiles) => {
|
|
272
|
+
let acceptedResult = droppedAcceptedFiles;
|
|
273
|
+
let rejectionsResult = [...droppedRejectedFiles];
|
|
274
|
+
const totalDroppedFiles = droppedAcceptedFiles.length + droppedRejectedFiles.length;
|
|
275
|
+
const wouldExceedLimit = !validateFileCount(currentFiles.length, totalDroppedFiles);
|
|
276
|
+
const remainingSlots = maxFiles ? maxFiles - currentFiles.length : Infinity;
|
|
277
|
+
if (wouldExceedLimit) {
|
|
278
|
+
const overflowCount = currentFiles.length + totalDroppedFiles - (maxFiles ?? Infinity);
|
|
279
|
+
const errorCode = "too-many-files";
|
|
280
|
+
const maxFilesError = {
|
|
281
|
+
code: errorCode,
|
|
282
|
+
message: getValidationMessage({
|
|
283
|
+
code: errorCode,
|
|
284
|
+
count: overflowCount,
|
|
285
|
+
messageType: "drop"
|
|
286
|
+
})
|
|
287
|
+
};
|
|
288
|
+
const fileCountRejections = acceptedResult.slice(remainingSlots).map((file) => ({
|
|
289
|
+
errors: [maxFilesError],
|
|
290
|
+
file
|
|
291
|
+
}));
|
|
292
|
+
rejectionsResult = [...rejectionsResult, ...fileCountRejections];
|
|
293
|
+
if (!strictValidation) acceptedResult = acceptedResult.slice(0, remainingSlots);
|
|
294
|
+
else acceptedResult = [];
|
|
295
|
+
}
|
|
296
|
+
return {
|
|
297
|
+
allAcceptedFiles: acceptedResult,
|
|
298
|
+
allRejections: rejectionsResult
|
|
299
|
+
};
|
|
300
|
+
},
|
|
301
|
+
/**
|
|
302
|
+
* Handles file size validation and returns updated accepted/rejected files
|
|
303
|
+
*
|
|
304
|
+
* This function checks if files exceed the maximum allowed size (maxSize)
|
|
305
|
+
* and updates accept/reject lists accordingly.
|
|
306
|
+
*
|
|
307
|
+
* @param acceptedFiles - Files that have passed previous validation steps
|
|
308
|
+
* @returns Object containing validated files and size-related rejections
|
|
309
|
+
* @remarks
|
|
310
|
+
* - Files exceeding maxSize are identified and grouped with a 'file-too-large' error
|
|
311
|
+
* - Handles two validation modes:
|
|
312
|
+
* 1. Strict validation (strictValidation: true):
|
|
313
|
+
* If ANY file exceeds the size limit, ALL files are rejected
|
|
314
|
+
* 2. Partial upload (strictValidation: false):
|
|
315
|
+
* Only oversized files are rejected, others proceed normally
|
|
316
|
+
* - When maxSize is undefined, all files pass size validation
|
|
317
|
+
* - Adds appropriate error metadata to rejected files for UI feedback
|
|
318
|
+
* - The returned object has separate lists for valid files and size rejections
|
|
319
|
+
*/
|
|
320
|
+
handleFileSizeValidation: (acceptedFiles) => {
|
|
321
|
+
let validFiles = [...acceptedFiles];
|
|
322
|
+
let sizeRejections = [];
|
|
323
|
+
const oversizedFiles = acceptedFiles.filter((file) => maxSize && file.size > maxSize);
|
|
324
|
+
if (oversizedFiles.length > 0) {
|
|
325
|
+
const errorCode = "file-too-large";
|
|
326
|
+
const fileSizeError = {
|
|
327
|
+
code: errorCode,
|
|
328
|
+
message: getValidationMessage({
|
|
329
|
+
code: errorCode,
|
|
330
|
+
count: oversizedFiles.length,
|
|
331
|
+
messageType: "drop"
|
|
332
|
+
})
|
|
333
|
+
};
|
|
334
|
+
sizeRejections = oversizedFiles.map((file) => ({
|
|
335
|
+
errors: [fileSizeError],
|
|
336
|
+
file
|
|
337
|
+
}));
|
|
338
|
+
if (!strictValidation) validFiles = acceptedFiles.filter((file) => !maxSize || file.size <= maxSize);
|
|
339
|
+
else validFiles = [];
|
|
340
|
+
}
|
|
341
|
+
return {
|
|
342
|
+
sizeRejections,
|
|
343
|
+
validFiles
|
|
344
|
+
};
|
|
345
|
+
},
|
|
346
|
+
/**
|
|
347
|
+
* Processes file rejections and groups them by error code
|
|
348
|
+
*
|
|
349
|
+
* This function takes an array of file rejections and organizes them into
|
|
350
|
+
* error groups based on the error codes. Each group tracks a count of affected
|
|
351
|
+
* files and the file references.
|
|
352
|
+
*
|
|
353
|
+
* @param rejections - Array of file rejections to process
|
|
354
|
+
* @returns A record of error groups indexed by error code
|
|
355
|
+
* @remarks
|
|
356
|
+
* - Multiple files with the same error code are consolidated into a single group
|
|
357
|
+
* - A file can appear in multiple groups if it has multiple error codes
|
|
358
|
+
* - Each group tracks:
|
|
359
|
+
* - count: Number of files affected by this error
|
|
360
|
+
* - files: References to the affected files
|
|
361
|
+
* - message: The error message (shared across the group)
|
|
362
|
+
* - Used for generating consolidated error messages and UI summaries
|
|
363
|
+
*/
|
|
364
|
+
processRejections: (rejections) => {
|
|
365
|
+
const groups = {};
|
|
366
|
+
rejections.forEach((rejection) => {
|
|
367
|
+
rejection.errors.forEach((error) => {
|
|
368
|
+
const group = getOrCreateErrorGroup(groups, error.code, error.message);
|
|
369
|
+
group.count++;
|
|
370
|
+
group.files.push(rejection.file);
|
|
371
|
+
});
|
|
372
|
+
});
|
|
373
|
+
return groups;
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
//#endregion
|
|
378
|
+
//#region src/FileUpload/hooks/upload/useHandleDrop/useHandleDrop.ts
|
|
379
|
+
const useHandleDrop = ({ files, onDrop, onDropAccepted, onDropRejected, setFiles, validation }) => {
|
|
380
|
+
const { clearAllValidation, setDropValidationErrors, setFileRejections, strictValidation } = validation;
|
|
381
|
+
return useCallback((acceptedFiles, rejectedFiles) => {
|
|
382
|
+
const { getFormattedErrorGroupMessage, handleFileCountLimits, handleFileSizeValidation, processRejections } = createRejectionHelpers(validation);
|
|
383
|
+
const { sizeRejections, validFiles } = handleFileSizeValidation(acceptedFiles);
|
|
384
|
+
const { allAcceptedFiles, allRejections } = handleFileCountLimits(files.filter((file) => file instanceof File), validFiles, [...rejectedFiles, ...sizeRejections]);
|
|
385
|
+
const errorGroups = processRejections(allRejections);
|
|
386
|
+
const errors = Object.entries(errorGroups).map(([code]) => ({
|
|
387
|
+
code,
|
|
388
|
+
message: getFormattedErrorGroupMessage(code, {
|
|
389
|
+
code,
|
|
390
|
+
message: errorGroups[code].message
|
|
391
|
+
}, errorGroups)
|
|
392
|
+
}));
|
|
393
|
+
const processedRejections = allRejections.map((rejection) => ({
|
|
394
|
+
errors: rejection.errors.map((error) => ({
|
|
395
|
+
code: error.code,
|
|
396
|
+
message: getFormattedErrorGroupMessage(error.code, error, errorGroups)
|
|
397
|
+
})),
|
|
398
|
+
file: rejection.file
|
|
399
|
+
}));
|
|
400
|
+
const hasRejections = processedRejections.length > 0;
|
|
401
|
+
if (strictValidation && hasRejections) {
|
|
402
|
+
const strictRejections = [...processedRejections, ...allAcceptedFiles.map((file) => ({
|
|
403
|
+
errors,
|
|
404
|
+
file
|
|
405
|
+
}))];
|
|
406
|
+
setFileRejections(strictRejections);
|
|
407
|
+
setDropValidationErrors(errors);
|
|
408
|
+
onDropRejected?.(strictRejections);
|
|
409
|
+
onDrop?.([], strictRejections);
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
setFileRejections(processedRejections);
|
|
413
|
+
setDropValidationErrors(errors);
|
|
414
|
+
onDropRejected?.(processedRejections);
|
|
415
|
+
if (allAcceptedFiles.length > 0) {
|
|
416
|
+
if (!hasRejections) clearAllValidation();
|
|
417
|
+
setFiles([...files, ...allAcceptedFiles]);
|
|
418
|
+
onDropAccepted?.(allAcceptedFiles);
|
|
419
|
+
}
|
|
420
|
+
onDrop?.(allAcceptedFiles, processedRejections);
|
|
421
|
+
}, [
|
|
422
|
+
files,
|
|
423
|
+
clearAllValidation,
|
|
424
|
+
setDropValidationErrors,
|
|
425
|
+
setFiles,
|
|
426
|
+
onDrop,
|
|
427
|
+
onDropAccepted,
|
|
428
|
+
onDropRejected,
|
|
429
|
+
setFileRejections,
|
|
430
|
+
strictValidation,
|
|
431
|
+
validation
|
|
432
|
+
]);
|
|
433
|
+
};
|
|
434
|
+
//#endregion
|
|
435
|
+
//#region src/FileUpload/hooks/upload/useUploadAvailability/useUploadAvailability.ts
|
|
436
|
+
const useUploadAvailability = ({ disabled = false, files, maxFiles }) => {
|
|
437
|
+
const hasReachedFileLimit = maxFiles !== void 0 && files.length >= maxFiles;
|
|
438
|
+
return {
|
|
439
|
+
hasReachedFileLimit,
|
|
440
|
+
isDisabled: disabled || hasReachedFileLimit
|
|
441
|
+
};
|
|
442
|
+
};
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region src/FileUpload/hooks/validation/createDropzoneValidator.ts
|
|
445
|
+
/**
|
|
446
|
+
* Creates an optimized validator function for React-Dropzone that preserves
|
|
447
|
+
* function-based validation messages for later resolution
|
|
448
|
+
*
|
|
449
|
+
* @param validationContext - The validation context containing the custom validator
|
|
450
|
+
* @returns A validator function compatible with React-Dropzone
|
|
451
|
+
*/
|
|
452
|
+
const createDropzoneValidator = (validationContext) => {
|
|
453
|
+
const { validateCustomRules } = validationContext;
|
|
454
|
+
if (typeof validateCustomRules !== "function") return;
|
|
455
|
+
return (file) => {
|
|
456
|
+
const validationResult = validateCustomRules(file);
|
|
457
|
+
if (!validationResult) return null;
|
|
458
|
+
if (validationResult.length === 0) return null;
|
|
459
|
+
return validationResult.map((error) => ({
|
|
460
|
+
code: error.code,
|
|
461
|
+
message: error.message
|
|
462
|
+
}));
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region src/FileUpload/utils/getMimeTypes.ts
|
|
467
|
+
/**
|
|
468
|
+
* Utility function that converts file type restrictions into MIME type format for react-dropzone
|
|
469
|
+
* @param accept - Optional file type restrictions, can be either:
|
|
470
|
+
* - A preset category from CommonFileTypes (e.g., 'images', 'pdfs', 'documents')
|
|
471
|
+
* - An array of specific MIME types (e.g., ['image/jpeg', 'image/png'])
|
|
472
|
+
* @returns Object mapping MIME types to empty arrays for react-dropzone's accept prop
|
|
473
|
+
* @remarks
|
|
474
|
+
* - Returns undefined when no restrictions are provided (accepts all file types)
|
|
475
|
+
* - Handles both preset categories and custom MIME type arrays
|
|
476
|
+
* - Formats MIME types to match react-dropzone's expected structure
|
|
477
|
+
*/
|
|
478
|
+
const getMimeTypes = (accept) => {
|
|
479
|
+
if (!accept) return;
|
|
480
|
+
if (Array.isArray(accept)) return accept.reduce((acc, curr) => ({
|
|
481
|
+
...acc,
|
|
482
|
+
[curr]: []
|
|
483
|
+
}), {});
|
|
484
|
+
return ACCEPTED_MIME_TYPES[accept].reduce((acc, curr) => ({
|
|
485
|
+
...acc,
|
|
486
|
+
[curr]: []
|
|
487
|
+
}), {});
|
|
488
|
+
};
|
|
489
|
+
//#endregion
|
|
490
|
+
//#region src/FileUpload/utils/styles.ts
|
|
491
|
+
const getUploadZoneStyles = ({ disabled, disableDragValidation, isDragActive, validationError }) => {
|
|
492
|
+
const isInvalid = Boolean(validationError);
|
|
493
|
+
const isErrorState = disableDragValidation ? false : isInvalid;
|
|
494
|
+
return cn([
|
|
495
|
+
"relative",
|
|
496
|
+
"flex flex-col",
|
|
497
|
+
"h-full w-full",
|
|
498
|
+
"items-center justify-center",
|
|
499
|
+
"rounded-container",
|
|
500
|
+
"outline-dashed outline-1 -outline-offset-1",
|
|
501
|
+
"p-sm",
|
|
502
|
+
"transition-colors",
|
|
503
|
+
"hover:bg-background-hover hover:outline-border-hover"
|
|
504
|
+
], ["hui-focus-visible-outline"], {
|
|
505
|
+
"cursor-not-allowed bg-background-disabled outline-border-disabled hover:bg-background-disabled hover:outline-border-disabled": disabled,
|
|
506
|
+
"cursor-pointer active:bg-background-pressed active:outline active:outline-4 active:outline-focus-primary": !disabled,
|
|
507
|
+
"outline outline-4 outline-offset-0 outline-focus-primary": isDragActive && !disabled
|
|
508
|
+
}, {
|
|
509
|
+
"bg-background-critical-light outline-dashed outline-1 -outline-offset-1 outline-border-critical": isErrorState && !disabled,
|
|
510
|
+
"bg-background-hover": isDragActive && (disableDragValidation || !isInvalid) && !isErrorState && !disabled,
|
|
511
|
+
"bg-background-primary outline-border-secondary": !isDragActive && !isErrorState && !disabled
|
|
512
|
+
});
|
|
513
|
+
};
|
|
514
|
+
//#endregion
|
|
515
|
+
//#region src/FileUpload/components/FileDropzone/components/DropzoneContent/DropzoneText.tsx
|
|
516
|
+
const DropzoneText = ({ disableDragValidation, filePluralizationText, hasReachedFileLimit, isDisabled, isDragActive, isDragReject, maxFiles, validation }) => {
|
|
517
|
+
const isMobile = useWindowIsMobile();
|
|
518
|
+
const { dragValidationError } = validation;
|
|
519
|
+
return /* @__PURE__ */ jsx(Fragment, { children: useMemo(() => {
|
|
520
|
+
if (hasReachedFileLimit) return /* @__PURE__ */ jsx(Fragment, { children: `${maxFiles} file limit reached. Remove files to upload more.` });
|
|
521
|
+
if (isDragActive && dragValidationError?.code) return /* @__PURE__ */ jsx(Fragment, { children: dragValidationError.message });
|
|
522
|
+
if (isDragActive && (disableDragValidation || !isDragReject)) return /* @__PURE__ */ jsx(Fragment, { children: "Drop files here to upload" });
|
|
523
|
+
if (isMobile) return /* @__PURE__ */ jsx(Fragment, { children: `Click to browse and add ${filePluralizationText}` });
|
|
524
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
525
|
+
/* @__PURE__ */ jsx(SubtleLink, {
|
|
526
|
+
className: "group-hover:underline",
|
|
527
|
+
disabled: isDisabled,
|
|
528
|
+
href: "#",
|
|
529
|
+
onClick: (e) => e.preventDefault(),
|
|
530
|
+
children: "Browse"
|
|
531
|
+
}),
|
|
532
|
+
" ",
|
|
533
|
+
"or drag ",
|
|
534
|
+
filePluralizationText,
|
|
535
|
+
" here to upload"
|
|
536
|
+
] });
|
|
537
|
+
}, [
|
|
538
|
+
filePluralizationText,
|
|
539
|
+
hasReachedFileLimit,
|
|
540
|
+
isDisabled,
|
|
541
|
+
isDragActive,
|
|
542
|
+
isDragReject,
|
|
543
|
+
disableDragValidation,
|
|
544
|
+
maxFiles,
|
|
545
|
+
isMobile,
|
|
546
|
+
dragValidationError
|
|
547
|
+
]) });
|
|
548
|
+
};
|
|
549
|
+
DropzoneText.displayName = "DropzoneText";
|
|
550
|
+
//#endregion
|
|
551
|
+
//#region src/FileUpload/components/FileDropzone/components/DropzoneContent/DropzoneContent.tsx
|
|
552
|
+
const DropzoneContent = ({ dropzoneTextProps, isDisabled }) => {
|
|
553
|
+
const dropzoneTextColor = isDisabled ? "disabled" : "primary";
|
|
554
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
555
|
+
className: "flex w-full flex-col items-center gap-xs",
|
|
556
|
+
children: [/* @__PURE__ */ jsx(UploadSimple, { color: dropzoneTextColor }), /* @__PURE__ */ jsx(BodyPrimary, {
|
|
557
|
+
className: "text-center",
|
|
558
|
+
color: dropzoneTextColor,
|
|
559
|
+
children: /* @__PURE__ */ jsx(DropzoneText, { ...dropzoneTextProps })
|
|
560
|
+
})]
|
|
561
|
+
});
|
|
562
|
+
};
|
|
563
|
+
DropzoneContent.displayName = "DropzoneContent";
|
|
564
|
+
//#endregion
|
|
565
|
+
//#region src/FileUpload/components/FileDropzone/components/FileDropzoneDebugger/FileRejectionsDisplay.tsx
|
|
566
|
+
const BadgeCell = ({ codes }) => {
|
|
567
|
+
return /* @__PURE__ */ jsx("div", {
|
|
568
|
+
className: "flex flex-col justify-start gap-[4px]",
|
|
569
|
+
children: (Array.isArray(codes) ? codes : [codes]).map((code, index) => /* @__PURE__ */ jsx(Badge, {
|
|
570
|
+
className: "my-[2px]",
|
|
571
|
+
color: "critical",
|
|
572
|
+
"data-testid": `badge-${code}`,
|
|
573
|
+
emphasis: builtInErrorCodes.includes(code) ? "subtle" : "bold",
|
|
574
|
+
size: "xs",
|
|
575
|
+
children: code
|
|
576
|
+
}, `${code}-${index}`))
|
|
577
|
+
});
|
|
578
|
+
};
|
|
579
|
+
const FileRejectionsDisplay = ({ displayMode, fileRejections = [] }) => {
|
|
580
|
+
const totalErrors = fileRejections.reduce((sum, rejection) => sum + rejection.errors.length, 0);
|
|
581
|
+
const tableData = displayMode === "by-error" ? fileRejections.flatMap((rejection, fileIndex) => rejection.errors.map((error, errorIndex) => ({
|
|
582
|
+
col1: rejection.file.name,
|
|
583
|
+
col2: error.code,
|
|
584
|
+
col3: error.message,
|
|
585
|
+
key: `${rejection.file.name}-${fileIndex}-${errorIndex}`
|
|
586
|
+
}))) : fileRejections.map((rejection, index) => ({
|
|
587
|
+
col1: rejection.file.name,
|
|
588
|
+
col2: rejection.errors.map((error) => error.code),
|
|
589
|
+
col3: rejection.errors.map((error) => error.message),
|
|
590
|
+
key: `${rejection.file.name}-${index}`
|
|
591
|
+
}));
|
|
592
|
+
const columns = [
|
|
593
|
+
{
|
|
594
|
+
align: "left",
|
|
595
|
+
header: "File Name",
|
|
596
|
+
key: "col1"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
header: displayMode === "by-error" ? "Error Code" : "Error Codes",
|
|
600
|
+
key: "col2",
|
|
601
|
+
renderItem: (data) => /* @__PURE__ */ jsx(BadgeCell, { codes: data.col2 })
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
header: displayMode === "by-error" ? "Message" : "Messages",
|
|
605
|
+
key: "col3",
|
|
606
|
+
renderItem: displayMode === "by-file" ? (data) => /* @__PURE__ */ jsx("div", {
|
|
607
|
+
className: "flex flex-col gap-[2px]",
|
|
608
|
+
children: data.col3.map((message, index) => /* @__PURE__ */ jsx("span", { children: message }, index))
|
|
609
|
+
}) : void 0
|
|
610
|
+
}
|
|
611
|
+
];
|
|
612
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
613
|
+
className: "mb-xs mt-sm flex items-center justify-between px-[2px]",
|
|
614
|
+
children: [/* @__PURE__ */ jsxs(H4, { children: ["File Rejections ", displayMode === "by-error" ? "(by Error)" : "(by File)"] }), /* @__PURE__ */ jsxs(BodyPrimary, { children: [
|
|
615
|
+
fileRejections.length,
|
|
616
|
+
" files (",
|
|
617
|
+
totalErrors,
|
|
618
|
+
" errors)"
|
|
619
|
+
] })]
|
|
620
|
+
}), /* @__PURE__ */ jsx(Table, {
|
|
621
|
+
columns,
|
|
622
|
+
data: tableData,
|
|
623
|
+
emptyStateHeaderText: "No files rejected",
|
|
624
|
+
emptyStateSupportingText: "Upload files to monitor rejections",
|
|
625
|
+
fillHorizontal: true,
|
|
626
|
+
hideBorder: true,
|
|
627
|
+
rowDensity: "sm"
|
|
628
|
+
})] });
|
|
629
|
+
};
|
|
630
|
+
FileRejectionsDisplay.displayName = "FileRejectionsDisplay";
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region src/FileUpload/components/FileDropzone/components/FileDropzoneDebugger/FileDropzoneDebugger.tsx
|
|
633
|
+
const FileDropzoneDebugger = ({ fileRejections = [] }) => {
|
|
634
|
+
return /* @__PURE__ */ jsx("div", {
|
|
635
|
+
className: "mt-md rounded-container p-sm outline-dashed outline-1 -outline-offset-1 outline-border-secondary",
|
|
636
|
+
children: /* @__PURE__ */ jsx(Tabs, { tabs: [{
|
|
637
|
+
content: /* @__PURE__ */ jsx(FileRejectionsDisplay, {
|
|
638
|
+
displayMode: "by-error",
|
|
639
|
+
fileRejections
|
|
640
|
+
}),
|
|
641
|
+
contentId: "rejections-by-error",
|
|
642
|
+
label: "Errors"
|
|
643
|
+
}, {
|
|
644
|
+
content: /* @__PURE__ */ jsx(FileRejectionsDisplay, {
|
|
645
|
+
displayMode: "by-file",
|
|
646
|
+
fileRejections
|
|
647
|
+
}),
|
|
648
|
+
contentId: "rejections-by-file",
|
|
649
|
+
label: "Files"
|
|
650
|
+
}] })
|
|
651
|
+
});
|
|
652
|
+
};
|
|
653
|
+
FileDropzoneDebugger.displayName = "FileDropzoneDebugger";
|
|
654
|
+
//#endregion
|
|
655
|
+
//#region src/FileUpload/components/FileDropzone/FileDropzone.tsx
|
|
656
|
+
/**
|
|
657
|
+
* FileDropzone component for handling file uploads with drag and drop support.
|
|
658
|
+
* This is a versatile file input component that can work both as a standalone
|
|
659
|
+
* component or as part of the FileUpload system.
|
|
660
|
+
*/
|
|
661
|
+
/**
|
|
662
|
+
* Handles the dual-mode functionality of the FileDropzone component, supporting both standalone usage
|
|
663
|
+
* and provider-wrapped usage.
|
|
664
|
+
*
|
|
665
|
+
* ## Validation Modes
|
|
666
|
+
* - **Provider Mode**: Uses validation context from FileUploadProvider for coordinated validation across components
|
|
667
|
+
* - **Standalone Mode**: Creates local validation instance for independent operation
|
|
668
|
+
*
|
|
669
|
+
* ## Props & Context Resolution
|
|
670
|
+
* The component follows a specific precedence order for each property:
|
|
671
|
+
* 1. Direct props take highest priority (for granular control)
|
|
672
|
+
* 2. Context values serve as fallbacks (for coordinated state)
|
|
673
|
+
* 3. Default values as final fallbacks (for safety)
|
|
674
|
+
*
|
|
675
|
+
* This enables two key use cases:
|
|
676
|
+
* 1. Standalone Usage: <FileDropzone maxFiles={5} onDrop={handleDrop} />
|
|
677
|
+
* 2. Provider Usage:
|
|
678
|
+
* <FileUploadProvider maxFiles={5}>
|
|
679
|
+
* <FileDropzone /> // Inherits provider config
|
|
680
|
+
* <FileDropzone maxFiles={1} /> // Overrides specific provider values
|
|
681
|
+
* </FileUploadProvider>
|
|
682
|
+
*/
|
|
683
|
+
const FileDropzone = ({ accept: acceptProp, ariaLabel = "Browse or drag files here to upload.", className, "data-testid": dataTestId = "file-dropzone", disabled: disabledProp = false, disableDragValidation = false, error, files: filesProp, helpText, helpTextAlignCenter, hideErrors = false, hideHelpText = false, labelText, maxFiles: maxFilesProp, maxSize: maxSizeProp, onDrop: onDropProp, onDropAccepted: onDropAcceptedProp, onDropRejected: onDropRejectedProp, onFilesChange: onFilesChangeProp, showDebugger, strictValidation, validator }) => {
|
|
684
|
+
const uploadContext = useContext(FileUploadContext);
|
|
685
|
+
const validation = useFileValidation({
|
|
686
|
+
accept: acceptProp,
|
|
687
|
+
error,
|
|
688
|
+
maxFiles: maxFilesProp,
|
|
689
|
+
maxSize: maxSizeProp,
|
|
690
|
+
strictValidation,
|
|
691
|
+
validator
|
|
692
|
+
});
|
|
693
|
+
const files = filesProp ?? uploadContext?.files ?? [];
|
|
694
|
+
const setFiles = onFilesChangeProp ?? uploadContext?.setFiles ?? (() => {});
|
|
695
|
+
const disabled = disabledProp || uploadContext?.disabled;
|
|
696
|
+
const onDrop = onDropProp ?? uploadContext?.onDrop;
|
|
697
|
+
const onDropAccepted = onDropAcceptedProp ?? uploadContext?.onDropAccepted;
|
|
698
|
+
const onDropRejected = onDropRejectedProp ?? uploadContext?.onDropRejected;
|
|
699
|
+
const maxFiles = maxFilesProp ?? validation.maxFiles;
|
|
700
|
+
const maxSize = maxSizeProp ?? validation.maxSize;
|
|
701
|
+
const accept = acceptProp ?? validation.accept;
|
|
702
|
+
const { hasReachedFileLimit, isDisabled } = useUploadAvailability({
|
|
703
|
+
disabled,
|
|
704
|
+
files,
|
|
705
|
+
maxFiles
|
|
706
|
+
});
|
|
707
|
+
const formattedMaxSize = maxSize ? formatFileSize(maxSize) : void 0;
|
|
708
|
+
const defaultHelpText = formattedMaxSize ? `File size must be smaller than ${formattedMaxSize}` : void 0;
|
|
709
|
+
const helpTextToDisplay = hideHelpText ? void 0 : helpText ?? defaultHelpText;
|
|
710
|
+
const allowMultipleFiles = maxFiles === void 0 || maxFiles > 1;
|
|
711
|
+
const filePluralizationText = allowMultipleFiles ? "files" : "a file";
|
|
712
|
+
const mimeTypes = getMimeTypes(accept);
|
|
713
|
+
const handleDrop = useHandleDrop({
|
|
714
|
+
files,
|
|
715
|
+
onDrop,
|
|
716
|
+
onDropAccepted,
|
|
717
|
+
onDropRejected,
|
|
718
|
+
setFiles,
|
|
719
|
+
validation
|
|
720
|
+
});
|
|
721
|
+
const handleDragEnter = useHandleDragEnter({
|
|
722
|
+
files,
|
|
723
|
+
mimeTypes,
|
|
724
|
+
validation,
|
|
725
|
+
validator
|
|
726
|
+
});
|
|
727
|
+
const { getInputProps, getRootProps, isDragActive, isDragReject } = useDropzone({
|
|
728
|
+
accept: mimeTypes,
|
|
729
|
+
disabled: isDisabled,
|
|
730
|
+
maxSize,
|
|
731
|
+
multiple: allowMultipleFiles,
|
|
732
|
+
onDragEnter: disableDragValidation ? validation.clearAllValidation : handleDragEnter,
|
|
733
|
+
onDragLeave: validation.clearAllValidation,
|
|
734
|
+
onDrop: handleDrop,
|
|
735
|
+
validator: createDropzoneValidator(validation)
|
|
736
|
+
});
|
|
737
|
+
const uploadZoneStyles = getUploadZoneStyles({
|
|
738
|
+
disabled: isDisabled,
|
|
739
|
+
disableDragValidation,
|
|
740
|
+
isDragActive,
|
|
741
|
+
validationError: isDragActive ? validation.dragValidationError : validation.dropValidationErrors[0]
|
|
742
|
+
});
|
|
743
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
744
|
+
"aria-label": ariaLabel,
|
|
745
|
+
className: cn("flex h-full w-full flex-col gap-[4px]", className),
|
|
746
|
+
role: "region",
|
|
747
|
+
children: [
|
|
748
|
+
labelText && /* @__PURE__ */ jsx(LabelMini, {
|
|
749
|
+
color: isDisabled ? "disabled" : "secondary",
|
|
750
|
+
children: labelText
|
|
751
|
+
}),
|
|
752
|
+
/* @__PURE__ */ jsxs("div", {
|
|
753
|
+
...getRootProps({
|
|
754
|
+
"aria-disabled": isDisabled,
|
|
755
|
+
className: cn("group min-h-[88px] w-full", uploadZoneStyles),
|
|
756
|
+
"data-testid": `${dataTestId}-container`,
|
|
757
|
+
onClick: validation.clearAllValidation,
|
|
758
|
+
role: "button"
|
|
759
|
+
}),
|
|
760
|
+
children: [/* @__PURE__ */ jsx("input", { ...getInputProps({
|
|
761
|
+
"aria-label": `Upload ${filePluralizationText}`,
|
|
762
|
+
"data-testid": `${dataTestId}-input`
|
|
763
|
+
}) }), /* @__PURE__ */ jsx(DropzoneContent, {
|
|
764
|
+
dropzoneTextProps: {
|
|
765
|
+
disableDragValidation,
|
|
766
|
+
filePluralizationText,
|
|
767
|
+
hasReachedFileLimit,
|
|
768
|
+
isDisabled,
|
|
769
|
+
isDragActive,
|
|
770
|
+
isDragReject,
|
|
771
|
+
maxFiles,
|
|
772
|
+
validation
|
|
773
|
+
},
|
|
774
|
+
isDisabled
|
|
775
|
+
})]
|
|
776
|
+
}),
|
|
777
|
+
/* @__PURE__ */ jsxs("div", {
|
|
778
|
+
className: cn("relative flex flex-col gap-[4px]", { "items-center": helpTextAlignCenter }),
|
|
779
|
+
children: [helpTextToDisplay && /* @__PURE__ */ jsx(Caption, {
|
|
780
|
+
color: isDisabled ? "disabled" : "secondary",
|
|
781
|
+
children: helpTextToDisplay
|
|
782
|
+
}), !hideErrors && validation.dropValidationErrors.map((error, index) => /* @__PURE__ */ jsx(Caption, {
|
|
783
|
+
color: "critical",
|
|
784
|
+
role: "alert",
|
|
785
|
+
children: error.message
|
|
786
|
+
}, `${error.code}-${index}`))]
|
|
787
|
+
}),
|
|
788
|
+
showDebugger && /* @__PURE__ */ jsx(FileDropzoneDebugger, { fileRejections: validation.fileRejections })
|
|
789
|
+
]
|
|
790
|
+
});
|
|
791
|
+
};
|
|
792
|
+
FileDropzone.displayName = "FileDropzone";
|
|
793
|
+
//#endregion
|
|
794
|
+
//#region src/FileUpload/components/GridFileCard/utils/sortable.ts
|
|
795
|
+
/**
|
|
796
|
+
* Helper function to check if an element or its parents have the data-no-drag attribute
|
|
797
|
+
* Exported for testing, you should probably be using the `dataNoDragSortable` function instead
|
|
798
|
+
* @param element - The element to check
|
|
799
|
+
* @returns Whether the element or any of its parents have the data-no-drag attribute
|
|
800
|
+
*/
|
|
801
|
+
const hasDataNoDragOrParent = (element) => {
|
|
802
|
+
if (!element) return false;
|
|
803
|
+
if (element.hasAttribute("data-no-drag")) return true;
|
|
804
|
+
if (element.parentElement) return hasDataNoDragOrParent(element.parentElement);
|
|
805
|
+
return false;
|
|
806
|
+
};
|
|
807
|
+
/**
|
|
808
|
+
* Modified sortable object that stops propagation if the parent element has the data-no-drag attribute
|
|
809
|
+
* @param sortable - The sortable object to modify
|
|
810
|
+
* @returns The modified sortable object
|
|
811
|
+
*/
|
|
812
|
+
const dataNoDragSortable = (sortable) => {
|
|
813
|
+
if (!sortable) return null;
|
|
814
|
+
return {
|
|
815
|
+
...sortable,
|
|
816
|
+
attributes: { ...sortable.attributes },
|
|
817
|
+
listeners: {
|
|
818
|
+
...sortable.listeners,
|
|
819
|
+
onPointerDown: (e) => {
|
|
820
|
+
if (hasDataNoDragOrParent(e.target)) {
|
|
821
|
+
e.stopPropagation();
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
824
|
+
sortable.listeners?.onPointerDown?.(e);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
};
|
|
829
|
+
//#endregion
|
|
830
|
+
//#region src/FileUpload/components/GridFileCard/GridFileCard.tsx
|
|
831
|
+
/**
|
|
832
|
+
* Actions to render. First 3 actions will be visible buttons,
|
|
833
|
+
* remaining will appear in overflow menu.
|
|
834
|
+
*/
|
|
835
|
+
const MAX_VISIBLE_ACTIONS = 3;
|
|
836
|
+
const GridFileCard = ({ actions = [], badge, className, "data-testid": dataTestId = "grid-file-card", draggable, errorMessage, fileName, hideFileName = false, hideFileSize = false, hideFileStatus = false, imageSource, isSelected, onDelete, onImageError, onSelect, progress, selectable, sortable, status = "default", statusIcon, statusText }) => {
|
|
837
|
+
const previewUrl = useImageFilePreviewUrl(imageSource);
|
|
838
|
+
const isRemoteFile = "url" in imageSource;
|
|
839
|
+
const fileSize = isRemoteFile ? "" : formatFileSize(imageSource.size);
|
|
840
|
+
const shouldHideFileSize = hideFileSize || isRemoteFile;
|
|
841
|
+
const defaultFileName = isRemoteFile ? imageSource.url.split("/").pop() ?? "image" : imageSource.name;
|
|
842
|
+
const fileDisplayName = fileName ?? defaultFileName;
|
|
843
|
+
const isError = status === "error";
|
|
844
|
+
const isPending = status === "pending";
|
|
845
|
+
const isProgressing = status === "progressing";
|
|
846
|
+
const isComplete = status === "complete";
|
|
847
|
+
const isDragging = sortable?.isDragging ?? false;
|
|
848
|
+
const shouldShowProgressCircle = !statusIcon && (isPending || isProgressing || isComplete);
|
|
849
|
+
let fileStatusText = null;
|
|
850
|
+
if (isError && errorMessage && !hideFileStatus) fileStatusText = /* @__PURE__ */ jsx(BodySecondary, {
|
|
851
|
+
className: "text-text-critical",
|
|
852
|
+
"data-no-drag": true,
|
|
853
|
+
children: errorMessage
|
|
854
|
+
});
|
|
855
|
+
else if ((isProgressing || isPending) && !hideFileStatus) fileStatusText = /* @__PURE__ */ jsx(BodySecondary, {
|
|
856
|
+
color: "secondary",
|
|
857
|
+
"data-no-drag": true,
|
|
858
|
+
children: statusText ?? (isPending ? "Pending" : "Uploading")
|
|
859
|
+
});
|
|
860
|
+
else if (!shouldHideFileSize) fileStatusText = /* @__PURE__ */ jsx(BodySecondary, {
|
|
861
|
+
color: isError ? "critical" : "secondary",
|
|
862
|
+
"data-no-drag": true,
|
|
863
|
+
children: fileSize
|
|
864
|
+
});
|
|
865
|
+
const actionsWithDelete = [...actions, ...onDelete ? [{
|
|
866
|
+
icon: Trash,
|
|
867
|
+
iconStyle: "regular",
|
|
868
|
+
name: "Delete",
|
|
869
|
+
onClick: (_, fileResource) => onDelete(fileResource)
|
|
870
|
+
}] : []];
|
|
871
|
+
const modifiedSortable = dataNoDragSortable(sortable);
|
|
872
|
+
const visibleActions = actionsWithDelete.slice(0, MAX_VISIBLE_ACTIONS);
|
|
873
|
+
const overflowActions = actionsWithDelete.slice(MAX_VISIBLE_ACTIONS);
|
|
874
|
+
let progressCircleStatus;
|
|
875
|
+
if (isPending) progressCircleStatus = "pending";
|
|
876
|
+
else if (isProgressing) progressCircleStatus = "progressing";
|
|
877
|
+
else progressCircleStatus = "complete";
|
|
878
|
+
const isProcessing = isPending || isProgressing;
|
|
879
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
880
|
+
"aria-busy": isProcessing || void 0,
|
|
881
|
+
className: cn("group/grid-file-card relative flex w-full min-w-0 cursor-pointer flex-col gap-xs", "rounded-container p-xs", "ring-1", "transition-all duration-200", "hover:z-10", "focus-within:z-10", {
|
|
882
|
+
"bg-background-critical-light ring-border-critical focus-within:bg-background-critical-light focus-within:ring-border-critical hover:bg-background-critical-light hover:ring-border-critical": isError && !isDragging,
|
|
883
|
+
"bg-background-primary ring-transparent focus-within:bg-background-subdued focus-within:ring-border-secondary hover:bg-background-subdued hover:ring-border-secondary": !isError && !isDragging,
|
|
884
|
+
"z-50 scale-105 border-border-selected bg-background-secondary shadow-01": isDragging
|
|
885
|
+
}, className),
|
|
886
|
+
"data-testid": dataTestId,
|
|
887
|
+
ref: modifiedSortable?.setNodeRef,
|
|
888
|
+
style: modifiedSortable?.styles,
|
|
889
|
+
...modifiedSortable?.attributes,
|
|
890
|
+
...modifiedSortable?.listeners,
|
|
891
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
892
|
+
className: "relative aspect-square min-w-0 items-center justify-center rounded-container bg-background-subdued",
|
|
893
|
+
children: [
|
|
894
|
+
/* @__PURE__ */ jsxs("div", {
|
|
895
|
+
className: "absolute left-0 top-0 z-10 flex items-center gap-[2px] p-xs",
|
|
896
|
+
children: [selectable && /* @__PURE__ */ jsx("div", {
|
|
897
|
+
"data-no-drag": true,
|
|
898
|
+
children: /* @__PURE__ */ jsx(Checkbox.Option, {
|
|
899
|
+
checked: isSelected,
|
|
900
|
+
className: "![grid-template-columns:24px_0px_1fr]",
|
|
901
|
+
onChange: (e) => {
|
|
902
|
+
e.stopPropagation();
|
|
903
|
+
onSelect?.(imageSource, e.target.checked);
|
|
904
|
+
}
|
|
905
|
+
})
|
|
906
|
+
}), badge && /* @__PURE__ */ jsx(Badge, {
|
|
907
|
+
className: "mt-[3px]",
|
|
908
|
+
color: "neutral",
|
|
909
|
+
emphasis: "bold",
|
|
910
|
+
round: true,
|
|
911
|
+
size: "xs",
|
|
912
|
+
children: badge
|
|
913
|
+
})]
|
|
914
|
+
}),
|
|
915
|
+
draggable && /* @__PURE__ */ jsx("div", {
|
|
916
|
+
className: "absolute right-[4.4px] top-[8px] z-10 p-[2px]",
|
|
917
|
+
children: /* @__PURE__ */ jsx(DotsSixVertical, {
|
|
918
|
+
className: "flex-shrink-0 cursor-grab",
|
|
919
|
+
color: "inverse",
|
|
920
|
+
size: "sm",
|
|
921
|
+
style: "bold"
|
|
922
|
+
})
|
|
923
|
+
}),
|
|
924
|
+
previewUrl ? /* @__PURE__ */ jsx("img", {
|
|
925
|
+
alt: fileDisplayName,
|
|
926
|
+
className: "absolute inset-0 h-full w-full rounded-container object-cover",
|
|
927
|
+
onError: () => onImageError?.(imageSource),
|
|
928
|
+
src: previewUrl
|
|
929
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
930
|
+
className: "absolute inset-0 flex items-center justify-center",
|
|
931
|
+
children: /* @__PURE__ */ jsx(Paperclip, {
|
|
932
|
+
color: "primary",
|
|
933
|
+
size: "md"
|
|
934
|
+
})
|
|
935
|
+
}),
|
|
936
|
+
/* @__PURE__ */ jsx("div", {
|
|
937
|
+
className: cn("absolute inset-0", "flex items-end justify-center", "rounded-container bg-background-overlay/20 p-xs", "opacity-0 transition-opacity duration-200", "group-focus-within/grid-file-card:opacity-100 group-hover/grid-file-card:opacity-100", "cursor-pointer", { "cursor-grab": draggable }),
|
|
938
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
939
|
+
className: "flex items-center gap-xs",
|
|
940
|
+
children: [visibleActions.map((action, index) => /* @__PURE__ */ jsx(IconButton, {
|
|
941
|
+
"aria-label": action.name,
|
|
942
|
+
"data-no-drag": true,
|
|
943
|
+
disabled: isProcessing,
|
|
944
|
+
hideTooltip: true,
|
|
945
|
+
icon: action.icon,
|
|
946
|
+
iconStyle: action.iconStyle,
|
|
947
|
+
onClick: (e) => {
|
|
948
|
+
e.stopPropagation();
|
|
949
|
+
action.onClick(e, imageSource);
|
|
950
|
+
},
|
|
951
|
+
shape: "circle",
|
|
952
|
+
size: "xs",
|
|
953
|
+
style: "inverse",
|
|
954
|
+
type: "button",
|
|
955
|
+
variant: "transparent"
|
|
956
|
+
}, `${action.name}-${index}`)), overflowActions.length > 0 && /* @__PURE__ */ jsx(Menu, {
|
|
957
|
+
"data-no-drag": true,
|
|
958
|
+
hasRoundedBorders: true,
|
|
959
|
+
menuPlacement: "bottom-start",
|
|
960
|
+
menuSize: "sm",
|
|
961
|
+
numberOfColumns: 3,
|
|
962
|
+
trigger: /* @__PURE__ */ jsx(IconButton, {
|
|
963
|
+
"data-no-drag": true,
|
|
964
|
+
disabled: isProcessing,
|
|
965
|
+
hideTooltip: true,
|
|
966
|
+
icon: DotsThreeOutlineVertical,
|
|
967
|
+
iconStyle: "fill",
|
|
968
|
+
onClick: () => {},
|
|
969
|
+
shape: "circle",
|
|
970
|
+
size: "xs",
|
|
971
|
+
style: "inverse",
|
|
972
|
+
type: "button",
|
|
973
|
+
variant: "transparent"
|
|
974
|
+
}),
|
|
975
|
+
children: overflowActions.map((action, index) => /* @__PURE__ */ jsx(MenuItem, {
|
|
976
|
+
color: action.name === "Delete" ? "critical" : void 0,
|
|
977
|
+
"data-no-drag": true,
|
|
978
|
+
id: `${action.name}-${fileDisplayName}`,
|
|
979
|
+
leftIcon: action.icon,
|
|
980
|
+
onClick: () => {
|
|
981
|
+
action.onClick({}, imageSource);
|
|
982
|
+
},
|
|
983
|
+
primaryLabel: action.name
|
|
984
|
+
}, `${action.name}-${index}`))
|
|
985
|
+
})]
|
|
986
|
+
})
|
|
987
|
+
})
|
|
988
|
+
]
|
|
989
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
990
|
+
className: "flex items-center gap-[2px]",
|
|
991
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
992
|
+
className: "flex min-w-0 flex-1 cursor-auto flex-col gap-[2px]",
|
|
993
|
+
children: [!hideFileName && /* @__PURE__ */ jsx(BodyPrimary, {
|
|
994
|
+
className: "truncate",
|
|
995
|
+
color: isError ? "critical" : "primary",
|
|
996
|
+
"data-no-drag": true,
|
|
997
|
+
children: fileDisplayName
|
|
998
|
+
}), fileStatusText]
|
|
999
|
+
}), shouldShowProgressCircle ? /* @__PURE__ */ jsx("div", {
|
|
1000
|
+
className: "flex items-center",
|
|
1001
|
+
"data-testid": "grid-file-card-progress-circle",
|
|
1002
|
+
children: /* @__PURE__ */ jsx(ProgressCircle, {
|
|
1003
|
+
progress,
|
|
1004
|
+
size: "sm",
|
|
1005
|
+
status: progressCircleStatus
|
|
1006
|
+
})
|
|
1007
|
+
}) : statusIcon ? statusIcon.type === "progressCircle" ? /* @__PURE__ */ jsx("div", {
|
|
1008
|
+
className: "flex items-center",
|
|
1009
|
+
"data-testid": "grid-file-card-progress-circle",
|
|
1010
|
+
children: /* @__PURE__ */ jsx(ProgressCircle, {
|
|
1011
|
+
centerIcon: statusIcon.centerIcon,
|
|
1012
|
+
color: statusIcon.color,
|
|
1013
|
+
indeterminateAnimation: statusIcon.indeterminateAnimation,
|
|
1014
|
+
progress,
|
|
1015
|
+
size: "sm",
|
|
1016
|
+
status: progressCircleStatus
|
|
1017
|
+
})
|
|
1018
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
1019
|
+
className: "flex items-center",
|
|
1020
|
+
"data-testid": "grid-file-card-status-icon",
|
|
1021
|
+
children: /* @__PURE__ */ jsx(statusIcon.icon, {
|
|
1022
|
+
color: statusIcon.color,
|
|
1023
|
+
size: "sm",
|
|
1024
|
+
style: statusIcon.style
|
|
1025
|
+
})
|
|
1026
|
+
}) : null]
|
|
1027
|
+
})]
|
|
1028
|
+
});
|
|
1029
|
+
};
|
|
1030
|
+
GridFileCard.displayName = "GridFileCard";
|
|
1031
|
+
//#endregion
|
|
1032
|
+
//#region src/FileUpload/components/ListFileCard/ListFileCard.tsx
|
|
1033
|
+
const ListFileCard = ({ actions, cardStyle, className, "data-testid": dataTestId = "list-file-card", draggable, errorMessage, fileName, hideFileName = false, hideFileSize = false, hideFileStatus = false, imageSource, isSelected, onDelete, onImageError, onSelect, progress, selectable, showActionsOnHover, status = "default", statusIcon, statusText }) => {
|
|
1034
|
+
const previewUrl = useImageFilePreviewUrl(imageSource);
|
|
1035
|
+
const isRemoteFile = "url" in imageSource;
|
|
1036
|
+
const fileSize = isRemoteFile ? "" : formatFileSize(imageSource.size);
|
|
1037
|
+
const shouldHideFileSize = hideFileSize || isRemoteFile;
|
|
1038
|
+
const defaultFileName = isRemoteFile ? imageSource.url.split("/").pop() ?? "image" : imageSource.name;
|
|
1039
|
+
const fileDisplayName = fileName ?? defaultFileName;
|
|
1040
|
+
const isError = status === "error";
|
|
1041
|
+
const isPending = status === "pending";
|
|
1042
|
+
const isProgressing = status === "progressing";
|
|
1043
|
+
const isComplete = status === "complete";
|
|
1044
|
+
const isDragging = false;
|
|
1045
|
+
const shouldShowProgressCircle = !statusIcon && (isPending || isProgressing || isComplete);
|
|
1046
|
+
let fileStatusText = null;
|
|
1047
|
+
if (isError && errorMessage && !hideFileStatus) fileStatusText = /* @__PURE__ */ jsx(BodySecondary, {
|
|
1048
|
+
className: "text-text-critical",
|
|
1049
|
+
children: errorMessage
|
|
1050
|
+
});
|
|
1051
|
+
else if ((isProgressing || isPending) && !hideFileStatus) fileStatusText = /* @__PURE__ */ jsx(BodySecondary, {
|
|
1052
|
+
color: "secondary",
|
|
1053
|
+
children: statusText ?? (isPending ? "Pending" : "Uploading")
|
|
1054
|
+
});
|
|
1055
|
+
else if (!shouldHideFileSize) fileStatusText = /* @__PURE__ */ jsx(BodySecondary, {
|
|
1056
|
+
color: isError ? "critical" : "secondary",
|
|
1057
|
+
children: fileSize
|
|
1058
|
+
});
|
|
1059
|
+
const actionBtnClasses = showActionsOnHover ? cn("opacity-0 group-focus-within/list-file-card:opacity-100 group-hover/list-file-card:opacity-100", "focus:opacity-100", "transition-opacity duration-200") : "";
|
|
1060
|
+
const isProcessing = isPending || isProgressing;
|
|
1061
|
+
let progressCircleStatus;
|
|
1062
|
+
if (isPending) progressCircleStatus = "pending";
|
|
1063
|
+
else if (isProgressing) progressCircleStatus = "progressing";
|
|
1064
|
+
else progressCircleStatus = "complete";
|
|
1065
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1066
|
+
"aria-busy": isProcessing || void 0,
|
|
1067
|
+
className: cn("group/list-file-card flex w-full min-w-0 cursor-pointer items-center justify-between p-xs", "transition-all duration-200", {
|
|
1068
|
+
"bg-background-critical-light": isError && true,
|
|
1069
|
+
"bg-background-primary": !isError && true,
|
|
1070
|
+
"z-50 scale-105 border-border-selected bg-background-secondary shadow-01": isDragging
|
|
1071
|
+
}, cardStyle === "contained" ? cn("rounded-container border", {
|
|
1072
|
+
"border-border-critical hover:border-border-critical hover:bg-background-critical-light": isError && true,
|
|
1073
|
+
"border-border-secondary hover:border-border-secondary hover:bg-background-hover": !isError && true
|
|
1074
|
+
}) : cn("rounded-b-none border-b", {
|
|
1075
|
+
"border-b-border-critical focus-within:border-b-border-critical hover:bg-background-critical-light": isError && true,
|
|
1076
|
+
"border-b-border-secondary hover:bg-background-hover": !isError && true
|
|
1077
|
+
}), className),
|
|
1078
|
+
"data-testid": dataTestId,
|
|
1079
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1080
|
+
className: "flex min-w-0 flex-1 items-center gap-xs",
|
|
1081
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1082
|
+
className: "flex items-center gap-[4px]",
|
|
1083
|
+
children: [selectable ? /* @__PURE__ */ jsx(Checkbox.Option, {
|
|
1084
|
+
checked: isSelected,
|
|
1085
|
+
className: "![grid-template-columns:24px_0px_1fr]",
|
|
1086
|
+
"data-testid": "list-file-card-select-checkbox",
|
|
1087
|
+
onChange: (e) => {
|
|
1088
|
+
e.stopPropagation();
|
|
1089
|
+
onSelect?.(imageSource, e.target.checked);
|
|
1090
|
+
}
|
|
1091
|
+
}) : draggable ? /* @__PURE__ */ jsx(DotsSixVertical, {
|
|
1092
|
+
color: "primary",
|
|
1093
|
+
size: "sm",
|
|
1094
|
+
style: "bold"
|
|
1095
|
+
}) : null, previewUrl ? /* @__PURE__ */ jsx("div", {
|
|
1096
|
+
className: "relative h-xl w-xl items-center justify-center overflow-hidden rounded-container bg-background-subdued",
|
|
1097
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
1098
|
+
alt: fileDisplayName,
|
|
1099
|
+
className: "absolute inset-0 h-full w-full object-cover",
|
|
1100
|
+
onError: () => {
|
|
1101
|
+
onImageError?.(imageSource);
|
|
1102
|
+
},
|
|
1103
|
+
src: previewUrl
|
|
1104
|
+
})
|
|
1105
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
1106
|
+
className: "flex aspect-square min-w-xl items-center justify-center rounded-container bg-background-subdued",
|
|
1107
|
+
children: /* @__PURE__ */ jsx(Paperclip, {
|
|
1108
|
+
color: "primary",
|
|
1109
|
+
size: "sm"
|
|
1110
|
+
})
|
|
1111
|
+
})]
|
|
1112
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1113
|
+
className: "flex min-w-0 flex-1 flex-col gap-[2px]",
|
|
1114
|
+
children: [!hideFileName && /* @__PURE__ */ jsx(BodyPrimary, {
|
|
1115
|
+
className: "truncate",
|
|
1116
|
+
color: isError ? "critical" : "primary",
|
|
1117
|
+
children: fileDisplayName
|
|
1118
|
+
}), fileStatusText]
|
|
1119
|
+
})]
|
|
1120
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1121
|
+
className: "flex items-center gap-[4px]",
|
|
1122
|
+
children: [
|
|
1123
|
+
actions?.map((action, index) => /* @__PURE__ */ jsx(IconButton, {
|
|
1124
|
+
"aria-label": action.name,
|
|
1125
|
+
className: actionBtnClasses,
|
|
1126
|
+
disabled: isProcessing,
|
|
1127
|
+
icon: action.icon,
|
|
1128
|
+
onClick: (e) => {
|
|
1129
|
+
e.stopPropagation();
|
|
1130
|
+
action.onClick(e, imageSource);
|
|
1131
|
+
},
|
|
1132
|
+
size: "sm",
|
|
1133
|
+
type: "button"
|
|
1134
|
+
}, `${action.name}-${index}`)),
|
|
1135
|
+
onDelete && /* @__PURE__ */ jsx(IconButton, {
|
|
1136
|
+
"aria-label": "Remove file",
|
|
1137
|
+
className: actionBtnClasses,
|
|
1138
|
+
"data-testid": "remove-file-button",
|
|
1139
|
+
disabled: isProcessing,
|
|
1140
|
+
icon: Trash,
|
|
1141
|
+
onClick: () => onDelete(imageSource),
|
|
1142
|
+
size: "sm",
|
|
1143
|
+
type: "button"
|
|
1144
|
+
}),
|
|
1145
|
+
shouldShowProgressCircle ? /* @__PURE__ */ jsx("div", {
|
|
1146
|
+
className: "flex items-center",
|
|
1147
|
+
"data-testid": "list-file-card-progress-circle",
|
|
1148
|
+
children: /* @__PURE__ */ jsx(ProgressCircle, {
|
|
1149
|
+
progress,
|
|
1150
|
+
size: "sm",
|
|
1151
|
+
status: progressCircleStatus
|
|
1152
|
+
})
|
|
1153
|
+
}) : statusIcon ? statusIcon.type === "progressCircle" ? /* @__PURE__ */ jsx("div", {
|
|
1154
|
+
className: "flex items-center",
|
|
1155
|
+
"data-testid": "list-file-card-progress-circle",
|
|
1156
|
+
children: /* @__PURE__ */ jsx(ProgressCircle, {
|
|
1157
|
+
centerIcon: statusIcon.centerIcon,
|
|
1158
|
+
color: statusIcon.color,
|
|
1159
|
+
indeterminateAnimation: statusIcon.indeterminateAnimation,
|
|
1160
|
+
progress,
|
|
1161
|
+
size: "sm",
|
|
1162
|
+
status: progressCircleStatus
|
|
1163
|
+
})
|
|
1164
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
1165
|
+
className: "flex items-center",
|
|
1166
|
+
"data-testid": "list-file-card-status-icon",
|
|
1167
|
+
children: /* @__PURE__ */ jsx(statusIcon.icon, {
|
|
1168
|
+
color: statusIcon.color,
|
|
1169
|
+
size: "md",
|
|
1170
|
+
style: statusIcon.style
|
|
1171
|
+
})
|
|
1172
|
+
}) : null
|
|
1173
|
+
]
|
|
1174
|
+
})]
|
|
1175
|
+
});
|
|
1176
|
+
};
|
|
1177
|
+
ListFileCard.displayName = "ListFileCard";
|
|
1178
|
+
//#endregion
|
|
1179
|
+
//#region src/FileUpload/components/FileCard/FileCard.tsx
|
|
1180
|
+
const FileCard = ({ badge, cardStyle = "contained", "data-testid": dataTestId, errorMessage, progress, showActionsOnHover = false, status, statusIcon, statusText, ...props }) => cardStyle === "card" ? /* @__PURE__ */ jsx(GridFileCard, {
|
|
1181
|
+
...props,
|
|
1182
|
+
badge,
|
|
1183
|
+
"data-testid": dataTestId,
|
|
1184
|
+
errorMessage,
|
|
1185
|
+
progress,
|
|
1186
|
+
status,
|
|
1187
|
+
statusIcon,
|
|
1188
|
+
statusText
|
|
1189
|
+
}) : /* @__PURE__ */ jsx(ListFileCard, {
|
|
1190
|
+
...props,
|
|
1191
|
+
cardStyle,
|
|
1192
|
+
"data-testid": dataTestId,
|
|
1193
|
+
errorMessage,
|
|
1194
|
+
progress,
|
|
1195
|
+
showActionsOnHover,
|
|
1196
|
+
status,
|
|
1197
|
+
statusIcon,
|
|
1198
|
+
statusText
|
|
1199
|
+
});
|
|
1200
|
+
FileCard.displayName = "FileCard";
|
|
1201
|
+
//#endregion
|
|
1202
|
+
//#region src/FileUpload/components/FilePreviewList/virtualizerComponents/FilePreviewVirtualizedList/FilePreviewVirtualizedList.tsx
|
|
1203
|
+
/**
|
|
1204
|
+
* A virtualized list component for efficiently rendering large lists of file previews
|
|
1205
|
+
* Only renders items that are currently visible in the viewport
|
|
1206
|
+
*/
|
|
1207
|
+
const FilePreviewVirtualizedList = ({ createFileCardProps, files, previewStyle }) => {
|
|
1208
|
+
const scrollRef = useRef(null);
|
|
1209
|
+
const listItemHeight = previewStyle === "list" ? 66 : 65;
|
|
1210
|
+
const listItemGap = previewStyle === "list" ? 8 : 0;
|
|
1211
|
+
const virtualizer = useVirtualizer({
|
|
1212
|
+
count: files.length,
|
|
1213
|
+
estimateSize: () => listItemHeight,
|
|
1214
|
+
gap: listItemGap,
|
|
1215
|
+
getScrollElement: () => scrollRef.current,
|
|
1216
|
+
overscan: 5
|
|
1217
|
+
});
|
|
1218
|
+
const virtualItems = virtualizer.getVirtualItems();
|
|
1219
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1220
|
+
className: "relative h-full overflow-y-auto",
|
|
1221
|
+
ref: scrollRef,
|
|
1222
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
1223
|
+
className: cn("flex flex-col", previewStyle === "list" && "gap-xs"),
|
|
1224
|
+
"data-testid": "file-preview-virtualized-list-element",
|
|
1225
|
+
style: {
|
|
1226
|
+
height: `${virtualizer.getTotalSize()}px`,
|
|
1227
|
+
position: "relative",
|
|
1228
|
+
width: "100%"
|
|
1229
|
+
},
|
|
1230
|
+
children: virtualItems.map((virtualItem) => {
|
|
1231
|
+
const file = files[virtualItem.index];
|
|
1232
|
+
return /* @__PURE__ */ jsx("li", {
|
|
1233
|
+
"data-index": virtualItem.index,
|
|
1234
|
+
"data-testid": `file-preview-virtualized-list-item-${virtualItem.index}`,
|
|
1235
|
+
style: {
|
|
1236
|
+
height: `${virtualItem.size}px`,
|
|
1237
|
+
left: 0,
|
|
1238
|
+
position: "absolute",
|
|
1239
|
+
top: 0,
|
|
1240
|
+
transform: `translateY(${virtualItem.start}px)`,
|
|
1241
|
+
width: "100%"
|
|
1242
|
+
},
|
|
1243
|
+
children: /* @__PURE__ */ jsx(FileCard, {
|
|
1244
|
+
"data-testid": `file-preview-virtualized-list-card-${virtualItem.index}`,
|
|
1245
|
+
...createFileCardProps(file, virtualItem.index)
|
|
1246
|
+
})
|
|
1247
|
+
}, virtualItem.key);
|
|
1248
|
+
})
|
|
1249
|
+
})
|
|
1250
|
+
});
|
|
1251
|
+
};
|
|
1252
|
+
FilePreviewVirtualizedList.displayName = "FilePreviewVirtualizedList";
|
|
1253
|
+
//#endregion
|
|
1254
|
+
//#region src/FileUpload/components/FilePreviewList/FilePreviewList.tsx
|
|
1255
|
+
const VIEW_TO_CARD_STYLE = {
|
|
1256
|
+
compactList: "compact",
|
|
1257
|
+
grid: "card",
|
|
1258
|
+
list: "contained"
|
|
1259
|
+
};
|
|
1260
|
+
const FilePreviewList = ({ bulkSelectionEnabled = false, className, colsByBreakpoint = {
|
|
1261
|
+
lg: 5,
|
|
1262
|
+
md: 4,
|
|
1263
|
+
sm: 3,
|
|
1264
|
+
xl: 5,
|
|
1265
|
+
xs: 3
|
|
1266
|
+
}, "data-testid": dataTestId = "file-preview-list", draggable = false, files: filesProp, getFileStatusConfig, hideDeleteAction = false, hideFileNames = false, hideFileSizes = false, hideFileStatuses = false, onDelete, onSelect, previewStyle = "list", showActionsOnHover = false, virtualized = false }) => {
|
|
1267
|
+
const uploadContext = useContext(FileUploadContext);
|
|
1268
|
+
const files = filesProp ?? uploadContext?.files ?? [];
|
|
1269
|
+
const handleDeleteFile = useCallback((fileToDelete) => {
|
|
1270
|
+
if (uploadContext && !onDelete) {
|
|
1271
|
+
const fileToDeleteId = getItemIdentifier(fileToDelete);
|
|
1272
|
+
uploadContext.setFiles((prevFiles) => prevFiles.filter((file) => getItemIdentifier(file) !== fileToDeleteId));
|
|
1273
|
+
}
|
|
1274
|
+
onDelete?.(fileToDelete);
|
|
1275
|
+
}, [uploadContext, onDelete]);
|
|
1276
|
+
const width = useWindowWidth();
|
|
1277
|
+
const [selectedFiles, setSelectedFiles] = useState([]);
|
|
1278
|
+
const { lgMinValue, mdMinValue, smMinValue, xlMinValue } = breakpoints;
|
|
1279
|
+
const gridColumns = useMemo(() => {
|
|
1280
|
+
let columns = colsByBreakpoint.xs;
|
|
1281
|
+
if (width >= smMinValue && colsByBreakpoint.sm) columns = colsByBreakpoint.sm;
|
|
1282
|
+
if (width >= mdMinValue && colsByBreakpoint.md) columns = colsByBreakpoint.md;
|
|
1283
|
+
if (width >= lgMinValue && colsByBreakpoint.lg) columns = colsByBreakpoint.lg;
|
|
1284
|
+
if (width >= xlMinValue && colsByBreakpoint.xl) columns = colsByBreakpoint.xl;
|
|
1285
|
+
return columns;
|
|
1286
|
+
}, [
|
|
1287
|
+
width,
|
|
1288
|
+
colsByBreakpoint,
|
|
1289
|
+
lgMinValue,
|
|
1290
|
+
mdMinValue,
|
|
1291
|
+
smMinValue,
|
|
1292
|
+
xlMinValue
|
|
1293
|
+
]);
|
|
1294
|
+
const handleSelect = useCallback((file, isSelected) => {
|
|
1295
|
+
setSelectedFiles((prev) => {
|
|
1296
|
+
const name = file.name;
|
|
1297
|
+
if (isSelected) return [...prev, name];
|
|
1298
|
+
return prev.filter((n) => n !== name);
|
|
1299
|
+
});
|
|
1300
|
+
onSelect?.(file, isSelected);
|
|
1301
|
+
}, [onSelect]);
|
|
1302
|
+
const containerClasses = cn(previewStyle === "grid" && ["grid", gridColumns && `grid-cols-${gridColumns}`], previewStyle !== "grid" && ["flex flex-col", previewStyle === "list" && "gap-xs"]);
|
|
1303
|
+
const cardStyle = VIEW_TO_CARD_STYLE[previewStyle];
|
|
1304
|
+
const shouldUseVirtualizedList = virtualized && (previewStyle === "list" || previewStyle === "compactList");
|
|
1305
|
+
const commonProps = {
|
|
1306
|
+
bulkSelectionEnabled,
|
|
1307
|
+
draggable,
|
|
1308
|
+
hideDeleteAction,
|
|
1309
|
+
hideFileNames,
|
|
1310
|
+
hideFileSizes,
|
|
1311
|
+
hideFileStatuses,
|
|
1312
|
+
showActionsOnHover
|
|
1313
|
+
};
|
|
1314
|
+
const getItemIdentifier = (item) => {
|
|
1315
|
+
if ("url" in item) return item.id ?? item.url;
|
|
1316
|
+
return `${item.name}-${item.size}-${item.lastModified}`;
|
|
1317
|
+
};
|
|
1318
|
+
const createFileCardProps = useCallback((fileResource, index) => {
|
|
1319
|
+
const name = fileResource.name;
|
|
1320
|
+
const isSelected = selectedFiles.includes(name);
|
|
1321
|
+
const deleteHandler = hideDeleteAction ? void 0 : handleDeleteFile;
|
|
1322
|
+
const statusConfig = getFileStatusConfig?.(fileResource, index);
|
|
1323
|
+
return {
|
|
1324
|
+
cardStyle,
|
|
1325
|
+
draggable,
|
|
1326
|
+
errorMessage: statusConfig?.errorMessage,
|
|
1327
|
+
hideFileName: hideFileNames,
|
|
1328
|
+
hideFileSize: hideFileSizes,
|
|
1329
|
+
hideFileStatus: hideFileStatuses,
|
|
1330
|
+
imageSource: fileResource,
|
|
1331
|
+
onDelete: deleteHandler,
|
|
1332
|
+
onSelect: bulkSelectionEnabled ? handleSelect : void 0,
|
|
1333
|
+
...bulkSelectionEnabled ? {
|
|
1334
|
+
isSelected,
|
|
1335
|
+
selectable: true
|
|
1336
|
+
} : { selectable: false },
|
|
1337
|
+
progress: statusConfig?.progress,
|
|
1338
|
+
showActionsOnHover,
|
|
1339
|
+
status: statusConfig?.status,
|
|
1340
|
+
statusIcon: statusConfig?.statusIcon,
|
|
1341
|
+
statusText: statusConfig?.statusText
|
|
1342
|
+
};
|
|
1343
|
+
}, [
|
|
1344
|
+
bulkSelectionEnabled,
|
|
1345
|
+
cardStyle,
|
|
1346
|
+
draggable,
|
|
1347
|
+
getFileStatusConfig,
|
|
1348
|
+
handleDeleteFile,
|
|
1349
|
+
handleSelect,
|
|
1350
|
+
hideDeleteAction,
|
|
1351
|
+
hideFileNames,
|
|
1352
|
+
hideFileSizes,
|
|
1353
|
+
hideFileStatuses,
|
|
1354
|
+
selectedFiles,
|
|
1355
|
+
showActionsOnHover
|
|
1356
|
+
]);
|
|
1357
|
+
return /* @__PURE__ */ jsx("section", {
|
|
1358
|
+
"aria-label": "File preview list",
|
|
1359
|
+
className: cn("flex w-full flex-col", { "h-full": previewStyle !== "grid" }, className),
|
|
1360
|
+
children: shouldUseVirtualizedList ? /* @__PURE__ */ jsx(FilePreviewVirtualizedList, {
|
|
1361
|
+
...commonProps,
|
|
1362
|
+
createFileCardProps,
|
|
1363
|
+
files,
|
|
1364
|
+
previewStyle,
|
|
1365
|
+
selectedFiles
|
|
1366
|
+
}) : /* @__PURE__ */ jsx("ul", {
|
|
1367
|
+
className: containerClasses,
|
|
1368
|
+
"data-testid": dataTestId,
|
|
1369
|
+
children: files.map((fileResource, index) => /* @__PURE__ */ jsx("li", {
|
|
1370
|
+
"data-testid": `${dataTestId}-item-${index}`,
|
|
1371
|
+
children: /* @__PURE__ */ jsx(FileCard, {
|
|
1372
|
+
"data-testid": `${dataTestId}-card-${index}`,
|
|
1373
|
+
...createFileCardProps(fileResource, index)
|
|
1374
|
+
})
|
|
1375
|
+
}, `${getItemIdentifier(fileResource)}-${index}`))
|
|
1376
|
+
})
|
|
1377
|
+
});
|
|
1378
|
+
};
|
|
1379
|
+
FilePreviewList.displayName = "FilePreviewList";
|
|
1380
|
+
//#endregion
|
|
1381
|
+
//#region src/FileUpload/components/FileUpload/FileUpload.tsx
|
|
1382
|
+
/**
|
|
1383
|
+
* FileUpload component for handling single or multiple file uploads
|
|
1384
|
+
* with built-in validation and preview capabilities.
|
|
1385
|
+
*
|
|
1386
|
+
* This is the main container component that combines the drag-and-drop area (FileDropzone)
|
|
1387
|
+
* and the file preview list (FilePreviewList) into a single, cohesive interface.
|
|
1388
|
+
* It handles the file validation, upload state management, and preview display through
|
|
1389
|
+
* the FileUploadProvider context.
|
|
1390
|
+
*
|
|
1391
|
+
*/
|
|
1392
|
+
const FileUpload = ({ disabled, error, hideFilePreview = false, initialFiles, maxFiles, maxSize, onDrop, onDropAccepted, onDropRejected, onFileDelete, previewConfig, previewStyle = "list", ...dropzoneProps }) => {
|
|
1393
|
+
return /* @__PURE__ */ jsx(FileUploadProvider, {
|
|
1394
|
+
accept: dropzoneProps.accept,
|
|
1395
|
+
disabled,
|
|
1396
|
+
error,
|
|
1397
|
+
initialFiles,
|
|
1398
|
+
maxFiles,
|
|
1399
|
+
maxSize,
|
|
1400
|
+
onDrop,
|
|
1401
|
+
onDropAccepted,
|
|
1402
|
+
onDropRejected,
|
|
1403
|
+
onFileDelete,
|
|
1404
|
+
strictValidation: dropzoneProps.strictValidation,
|
|
1405
|
+
validator: dropzoneProps.validator,
|
|
1406
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1407
|
+
className: "flex flex-col gap-md",
|
|
1408
|
+
children: [/* @__PURE__ */ jsx(FileDropzone, { ...dropzoneProps }), !hideFilePreview && /* @__PURE__ */ jsx(FilePreviewList, {
|
|
1409
|
+
...previewConfig,
|
|
1410
|
+
onDelete: onFileDelete,
|
|
1411
|
+
previewStyle
|
|
1412
|
+
})]
|
|
1413
|
+
})
|
|
1414
|
+
});
|
|
1415
|
+
};
|
|
1416
|
+
FileUpload.displayName = "FileUpload";
|
|
1417
|
+
//#endregion
|
|
1418
|
+
//#region src/FileUpload/components/FileDropzoneOverlay/components/OverlayDropzoneDragText.tsx
|
|
1419
|
+
const OverlayDropzoneDragText = ({ dragText, isDragActive, validation }) => {
|
|
1420
|
+
const overlayText = useMemo(() => {
|
|
1421
|
+
if (!isDragActive) return null;
|
|
1422
|
+
if (validation.dragValidationError?.message) return validation.dragValidationError.message;
|
|
1423
|
+
return dragText;
|
|
1424
|
+
}, [
|
|
1425
|
+
isDragActive,
|
|
1426
|
+
validation.dragValidationError,
|
|
1427
|
+
dragText
|
|
1428
|
+
]);
|
|
1429
|
+
if (!overlayText) return null;
|
|
1430
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1431
|
+
className: cn("text-xl font-medium", validation.dragValidationError ? "text-text-critical" : "text-blue-600"),
|
|
1432
|
+
children: overlayText
|
|
1433
|
+
});
|
|
1434
|
+
};
|
|
1435
|
+
//#endregion
|
|
1436
|
+
//#region src/FileUpload/components/FileDropzoneOverlay/components/OverlayDropzoneContent.tsx
|
|
1437
|
+
const OverlayDropzoneContent = ({ accept, customIcon, dragText, isDragActive, maxFiles, validation }) => {
|
|
1438
|
+
const iconColor = validation.dragValidationError ? "critical" : "secondary";
|
|
1439
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1440
|
+
className: "text-center",
|
|
1441
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1442
|
+
className: "mb-xs flex justify-center",
|
|
1443
|
+
children: useMemo(() => {
|
|
1444
|
+
if (customIcon) return customIcon;
|
|
1445
|
+
const isSingleFile = maxFiles === 1;
|
|
1446
|
+
if (accept === "images" || Array.isArray(accept) && accept.some((type) => type.startsWith("image/"))) {
|
|
1447
|
+
if (isSingleFile) return /* @__PURE__ */ jsx(ImageSquare, {
|
|
1448
|
+
color: iconColor,
|
|
1449
|
+
size: "lg",
|
|
1450
|
+
style: "duotone"
|
|
1451
|
+
});
|
|
1452
|
+
return /* @__PURE__ */ jsx(ImagesSquare, {
|
|
1453
|
+
color: iconColor,
|
|
1454
|
+
size: "lg",
|
|
1455
|
+
style: "duotone"
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
if (accept === "documents") {
|
|
1459
|
+
if (isSingleFile) return /* @__PURE__ */ jsx(FileText, {
|
|
1460
|
+
color: iconColor,
|
|
1461
|
+
size: "lg",
|
|
1462
|
+
style: "duotone"
|
|
1463
|
+
});
|
|
1464
|
+
return /* @__PURE__ */ jsx(Files, {
|
|
1465
|
+
color: iconColor,
|
|
1466
|
+
size: "lg",
|
|
1467
|
+
style: "duotone"
|
|
1468
|
+
});
|
|
1469
|
+
}
|
|
1470
|
+
if (accept === "pdfs" || Array.isArray(accept) && accept.some((type) => type === "application/pdf")) return /* @__PURE__ */ jsx(FilePdf, {
|
|
1471
|
+
color: iconColor,
|
|
1472
|
+
size: "lg",
|
|
1473
|
+
style: "duotone"
|
|
1474
|
+
});
|
|
1475
|
+
if (Array.isArray(accept) && accept.some((type) => type === "text/csv" || type === ".csv" || type.includes("csv"))) return /* @__PURE__ */ jsx(FileCsv, {
|
|
1476
|
+
color: iconColor,
|
|
1477
|
+
size: "lg",
|
|
1478
|
+
style: "duotone"
|
|
1479
|
+
});
|
|
1480
|
+
if (Array.isArray(accept) && accept.some((type) => type.includes("zip") || type.includes("rar") || type.includes("7z") || type.includes("tar") || type.includes("gzip") || type === "application/x-zip-compressed" || type === "application/x-rar-compressed" || type === "application/x-7z-compressed")) return /* @__PURE__ */ jsx(FileArchive, {
|
|
1481
|
+
color: iconColor,
|
|
1482
|
+
size: "lg",
|
|
1483
|
+
style: "duotone"
|
|
1484
|
+
});
|
|
1485
|
+
return /* @__PURE__ */ jsx(Files, {
|
|
1486
|
+
color: iconColor,
|
|
1487
|
+
size: "lg",
|
|
1488
|
+
style: "duotone"
|
|
1489
|
+
});
|
|
1490
|
+
}, [
|
|
1491
|
+
customIcon,
|
|
1492
|
+
accept,
|
|
1493
|
+
maxFiles,
|
|
1494
|
+
iconColor
|
|
1495
|
+
])
|
|
1496
|
+
}), /* @__PURE__ */ jsx(OverlayDropzoneDragText, {
|
|
1497
|
+
dragText,
|
|
1498
|
+
isDragActive,
|
|
1499
|
+
validation
|
|
1500
|
+
})]
|
|
1501
|
+
});
|
|
1502
|
+
};
|
|
1503
|
+
//#endregion
|
|
1504
|
+
//#region src/FileUpload/components/FileDropzoneOverlay/styles.ts
|
|
1505
|
+
const getUploadOverlayStyles = ({ disableClickThrough, disabled, disableDragValidation, isDragActive, styleOptions = {}, validationError }) => {
|
|
1506
|
+
const { blurOnDrag = false, showDashedBorder = true } = styleOptions;
|
|
1507
|
+
const isInvalid = Boolean(validationError);
|
|
1508
|
+
const isErrorState = disableDragValidation ? false : isInvalid;
|
|
1509
|
+
const isDraggedOver = isDragActive && (disableDragValidation || !isInvalid);
|
|
1510
|
+
return cn([
|
|
1511
|
+
"absolute inset-0",
|
|
1512
|
+
"flex flex-col",
|
|
1513
|
+
"h-full w-full",
|
|
1514
|
+
"items-center justify-center",
|
|
1515
|
+
"rounded-[var(--container-border-radius)]",
|
|
1516
|
+
showDashedBorder && "outline-dashed outline-1 -outline-offset-1",
|
|
1517
|
+
"transition-colors",
|
|
1518
|
+
disableClickThrough && "cursor-pointer group-hover/dropzone:bg-background-hover group-hover/dropzone:outline-border-hover"
|
|
1519
|
+
], !disableClickThrough && "pointer-events-none", "z-10", ["hui-focus-visible-outline"], { "outline outline-4 outline-offset-0 outline-focus-primary": isDragActive }, {
|
|
1520
|
+
"backdrop-blur-[2px]": blurOnDrag && isDraggedOver && !isErrorState && !disabled,
|
|
1521
|
+
"backdrop-blur-sm": blurOnDrag && isDragActive && isErrorState,
|
|
1522
|
+
"bg-background-critical-light/50 outline-border-critical": isErrorState && !disabled && isDragActive,
|
|
1523
|
+
"bg-background-hover bg-background-secondary/90": isDraggedOver && !isErrorState && !disabled,
|
|
1524
|
+
"bg-transparent outline-border-secondary": !isDragActive
|
|
1525
|
+
});
|
|
1526
|
+
};
|
|
1527
|
+
//#endregion
|
|
1528
|
+
//#region src/FileUpload/components/FileDropzoneOverlay/FileDropzoneOverlay.tsx
|
|
1529
|
+
const FileDropzoneOverlay = ({ accept: acceptProp, ariaLabel, children, className, "data-testid": dataTestId = "file-dropzone-overlay", disableClickThrough = false, disabled: disabledProp = false, disableDragValidation = false, dragText = "Drop files to upload", error, files: filesProp, icon, maxFiles: maxFilesProp, maxSize: maxSizeProp, onDrop: onDropProp, onDropAccepted: onDropAcceptedProp, onDropRejected: onDropRejectedProp, onFilesChange: onFilesChangeProp, showDebugger, strictValidation, styleOptions, validator }) => {
|
|
1530
|
+
const uploadContext = useContext(FileUploadContext);
|
|
1531
|
+
const validation = useFileValidation({
|
|
1532
|
+
accept: acceptProp,
|
|
1533
|
+
error,
|
|
1534
|
+
maxFiles: maxFilesProp,
|
|
1535
|
+
maxSize: maxSizeProp,
|
|
1536
|
+
strictValidation,
|
|
1537
|
+
validator
|
|
1538
|
+
});
|
|
1539
|
+
const files = filesProp ?? uploadContext?.files ?? [];
|
|
1540
|
+
const setFiles = onFilesChangeProp ?? uploadContext?.setFiles ?? (() => {});
|
|
1541
|
+
const disabled = disabledProp || uploadContext?.disabled;
|
|
1542
|
+
const onDrop = onDropProp ?? uploadContext?.onDrop;
|
|
1543
|
+
const onDropAccepted = onDropAcceptedProp ?? uploadContext?.onDropAccepted;
|
|
1544
|
+
const onDropRejected = onDropRejectedProp ?? uploadContext?.onDropRejected;
|
|
1545
|
+
const maxFiles = maxFilesProp ?? validation.maxFiles;
|
|
1546
|
+
const maxSize = maxSizeProp ?? validation.maxSize;
|
|
1547
|
+
const accept = acceptProp ?? validation.accept;
|
|
1548
|
+
const { isDisabled } = useUploadAvailability({
|
|
1549
|
+
disabled,
|
|
1550
|
+
files,
|
|
1551
|
+
maxFiles
|
|
1552
|
+
});
|
|
1553
|
+
const allowMultipleFiles = maxFiles === void 0 || maxFiles > 1;
|
|
1554
|
+
const filePluralizationText = allowMultipleFiles ? "files" : "a file";
|
|
1555
|
+
const mimeTypes = getMimeTypes(accept);
|
|
1556
|
+
const handleDrop = useHandleDrop({
|
|
1557
|
+
files,
|
|
1558
|
+
onDrop,
|
|
1559
|
+
onDropAccepted,
|
|
1560
|
+
onDropRejected,
|
|
1561
|
+
setFiles,
|
|
1562
|
+
validation
|
|
1563
|
+
});
|
|
1564
|
+
const handleDragEnter = useHandleDragEnter({
|
|
1565
|
+
files,
|
|
1566
|
+
mimeTypes,
|
|
1567
|
+
validation,
|
|
1568
|
+
validator
|
|
1569
|
+
});
|
|
1570
|
+
const { getInputProps, getRootProps, isDragActive } = useDropzone({
|
|
1571
|
+
accept: mimeTypes,
|
|
1572
|
+
disabled: isDisabled,
|
|
1573
|
+
maxSize,
|
|
1574
|
+
multiple: allowMultipleFiles,
|
|
1575
|
+
noClick: !disableClickThrough,
|
|
1576
|
+
noKeyboard: !disableClickThrough,
|
|
1577
|
+
onDragEnter: disableDragValidation ? validation.clearAllValidation : handleDragEnter,
|
|
1578
|
+
onDragLeave: validation.clearAllValidation,
|
|
1579
|
+
onDrop: handleDrop,
|
|
1580
|
+
validator: createDropzoneValidator(validation)
|
|
1581
|
+
});
|
|
1582
|
+
const uploadZoneStyles = getUploadOverlayStyles({
|
|
1583
|
+
disableClickThrough,
|
|
1584
|
+
disabled: isDisabled,
|
|
1585
|
+
disableDragValidation,
|
|
1586
|
+
isDragActive,
|
|
1587
|
+
styleOptions,
|
|
1588
|
+
validationError: isDragActive ? validation.dragValidationError : validation.dropValidationErrors[0]
|
|
1589
|
+
});
|
|
1590
|
+
const innerPaddingClass = styleOptions?.innerPadding ? {
|
|
1591
|
+
"2xl": "p-2xl",
|
|
1592
|
+
lg: "p-lg",
|
|
1593
|
+
md: "p-md",
|
|
1594
|
+
sm: "p-sm",
|
|
1595
|
+
xl: "p-xl",
|
|
1596
|
+
xs: "p-xs"
|
|
1597
|
+
}[styleOptions.innerPadding] : void 0;
|
|
1598
|
+
const fillParentClass = styleOptions?.fillParent ? "h-full" : "relative";
|
|
1599
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
1600
|
+
...getRootProps({
|
|
1601
|
+
"aria-disabled": isDisabled,
|
|
1602
|
+
"aria-label": ariaLabel ?? (isDragActive ? dragText : void 0),
|
|
1603
|
+
className: cn("group/dropzone", fillParentClass, className),
|
|
1604
|
+
"data-testid": `${dataTestId}-root`
|
|
1605
|
+
}),
|
|
1606
|
+
children: [
|
|
1607
|
+
/* @__PURE__ */ jsx("input", { ...getInputProps({
|
|
1608
|
+
"aria-label": `Upload ${filePluralizationText}`,
|
|
1609
|
+
"data-testid": `${dataTestId}-input`
|
|
1610
|
+
}) }),
|
|
1611
|
+
/* @__PURE__ */ jsx("div", {
|
|
1612
|
+
className: cn("isolate", fillParentClass, innerPaddingClass),
|
|
1613
|
+
children
|
|
1614
|
+
}),
|
|
1615
|
+
/* @__PURE__ */ jsx("div", {
|
|
1616
|
+
className: cn("w-full", uploadZoneStyles),
|
|
1617
|
+
"data-testid": `${dataTestId}-container`,
|
|
1618
|
+
children: isDragActive && /* @__PURE__ */ jsx(OverlayDropzoneContent, {
|
|
1619
|
+
accept,
|
|
1620
|
+
customIcon: icon,
|
|
1621
|
+
dragText,
|
|
1622
|
+
isDragActive,
|
|
1623
|
+
maxFiles,
|
|
1624
|
+
validation
|
|
1625
|
+
})
|
|
1626
|
+
})
|
|
1627
|
+
]
|
|
1628
|
+
}), showDebugger && /* @__PURE__ */ jsx(FileDropzoneDebugger, { fileRejections: validation.fileRejections })] });
|
|
1629
|
+
};
|
|
1630
|
+
FileDropzoneOverlay.displayName = "FileDropzoneOverlay";
|
|
1631
|
+
//#endregion
|
|
1632
|
+
//#region src/FileUpload/components/FileUploadCanvas/FileUploadCanvas.tsx
|
|
1633
|
+
/**
|
|
1634
|
+
* Empty state component displayed when no files are present
|
|
1635
|
+
*/
|
|
1636
|
+
const EmptyState = () => {
|
|
1637
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1638
|
+
className: cn("flex h-full flex-col items-center justify-center gap-xs", "bg-gray-50 px-md py-2xl"),
|
|
1639
|
+
children: [/* @__PURE__ */ jsx(UploadSimple, { color: "secondary" }), /* @__PURE__ */ jsx(BodyPrimary, {
|
|
1640
|
+
className: "text-center",
|
|
1641
|
+
color: "secondary",
|
|
1642
|
+
children: "Drag files here to upload"
|
|
1643
|
+
})]
|
|
1644
|
+
});
|
|
1645
|
+
};
|
|
1646
|
+
/**
|
|
1647
|
+
* Canvas content that shows either FilePreviewList or empty state
|
|
1648
|
+
*/
|
|
1649
|
+
const CanvasContent = ({ onFileDelete, previewConfig, previewStyle }) => {
|
|
1650
|
+
if ((useContext(FileUploadContext)?.files ?? []).length === 0) return /* @__PURE__ */ jsx(EmptyState, {});
|
|
1651
|
+
return /* @__PURE__ */ jsx(FilePreviewList, {
|
|
1652
|
+
...previewConfig,
|
|
1653
|
+
onDelete: onFileDelete,
|
|
1654
|
+
previewStyle
|
|
1655
|
+
});
|
|
1656
|
+
};
|
|
1657
|
+
/**
|
|
1658
|
+
* FileUploadCanvas component - An out-of-the-box solution for drag-and-drop file uploads
|
|
1659
|
+
* with overlay-based interaction.
|
|
1660
|
+
*
|
|
1661
|
+
* This component wraps FilePreviewList with FileDropzoneOverlay, allowing users to drag
|
|
1662
|
+
* files over existing content. The overlay appears during drag operations and provides
|
|
1663
|
+
* visual feedback. It uses FileUploadProvider for state management.
|
|
1664
|
+
*
|
|
1665
|
+
* Key differences from FileUpload:
|
|
1666
|
+
* - Uses FileDropzoneOverlay (overlay-based) instead of FileDropzone (dedicated area)
|
|
1667
|
+
* - Supports disableClickThrough for interactive content underneath
|
|
1668
|
+
* - Always shows FilePreviewList (no hideFilePreview option)
|
|
1669
|
+
* - Ideal for gallery views and canvas-style interfaces
|
|
1670
|
+
*/
|
|
1671
|
+
const FileUploadCanvas = ({ className, disabled, error, initialFiles, maxFiles, maxSize, onDrop, onDropAccepted, onDropRejected, onFileDelete, previewConfig, previewStyle = "list", ...dropzoneOverlayProps }) => {
|
|
1672
|
+
return /* @__PURE__ */ jsx(FileUploadProvider, {
|
|
1673
|
+
accept: dropzoneOverlayProps.accept,
|
|
1674
|
+
disabled,
|
|
1675
|
+
error,
|
|
1676
|
+
initialFiles,
|
|
1677
|
+
maxFiles,
|
|
1678
|
+
maxSize,
|
|
1679
|
+
onDrop,
|
|
1680
|
+
onDropAccepted,
|
|
1681
|
+
onDropRejected,
|
|
1682
|
+
onFileDelete,
|
|
1683
|
+
strictValidation: dropzoneOverlayProps.strictValidation,
|
|
1684
|
+
validator: dropzoneOverlayProps.validator,
|
|
1685
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1686
|
+
className: cn("h-full w-full overflow-y-auto", className),
|
|
1687
|
+
children: /* @__PURE__ */ jsx(FileDropzoneOverlay, {
|
|
1688
|
+
...dropzoneOverlayProps,
|
|
1689
|
+
styleOptions: {
|
|
1690
|
+
...dropzoneOverlayProps.styleOptions,
|
|
1691
|
+
fillParent: true
|
|
1692
|
+
},
|
|
1693
|
+
children: /* @__PURE__ */ jsx(CanvasContent, {
|
|
1694
|
+
onFileDelete,
|
|
1695
|
+
previewConfig,
|
|
1696
|
+
previewStyle
|
|
1697
|
+
})
|
|
1698
|
+
})
|
|
1699
|
+
})
|
|
1700
|
+
});
|
|
1701
|
+
};
|
|
1702
|
+
FileUploadCanvas.displayName = "FileUploadCanvas";
|
|
1703
|
+
//#endregion
|
|
1704
|
+
export { FileCard as a, FileDropzone as c, useFileUploadContext as d, FilePreviewList as i, FileUploadContext as l, FileDropzoneOverlay as n, ListFileCard as o, FileUpload as r, GridFileCard as s, FileUploadCanvas as t, FileUploadProvider as u };
|
|
1705
|
+
|
|
1706
|
+
//# sourceMappingURL=FileUpload-p_pl9NXr.mjs.map
|