@evolve.ui/core-components 1.0.1 → 1.2.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/{BottomSheet-ZV_eq3xt.mjs → BottomSheet-CNVLnEoD.mjs} +3 -3
- package/BottomSheet-CNVLnEoD.mjs.map +1 -0
- package/{BottomSheet-emWP9Fct.cjs → BottomSheet-D5w0WZDl.cjs} +3 -3
- package/BottomSheet-D5w0WZDl.cjs.map +1 -0
- package/Button.cjs +1 -1
- package/Button.mjs +1 -1
- package/{CookieConsent-CIwm0bTz.mjs → CookieConsent-B9dg9WdC.mjs} +2 -2
- package/{CookieConsent-CIwm0bTz.mjs.map → CookieConsent-B9dg9WdC.mjs.map} +1 -1
- package/{CookieConsent-PIglB_bb.cjs → CookieConsent-BSXJHMwX.cjs} +2 -2
- package/{CookieConsent-PIglB_bb.cjs.map → CookieConsent-BSXJHMwX.cjs.map} +1 -1
- package/{Drawer-9HFG45OA.cjs → Drawer-3rA9dGCl.cjs} +2 -2
- package/{Drawer-9HFG45OA.cjs.map → Drawer-3rA9dGCl.cjs.map} +1 -1
- package/Drawer-CFZbwg0R.d.cts.map +1 -1
- package/Drawer-CFZbwg0R.d.mts.map +1 -1
- package/{Drawer-BkCPfK6P.mjs → Drawer-DzKEmewj.mjs} +2 -2
- package/{Drawer-BkCPfK6P.mjs.map → Drawer-DzKEmewj.mjs.map} +1 -1
- package/{FavoriteButton-CC3qL0lR.mjs → FavoriteButton-7nK77lQP.mjs} +6 -6
- package/FavoriteButton-7nK77lQP.mjs.map +1 -0
- package/{FavoriteButton-BGF-3dze.d.cts → FavoriteButton-B8r_qtlj.d.cts} +2 -2
- package/{FavoriteButton-BGF-3dze.d.cts.map → FavoriteButton-B8r_qtlj.d.cts.map} +1 -1
- package/{FavoriteButton-DliYzkfu.cjs → FavoriteButton-BkIaWfgD.cjs} +6 -6
- package/FavoriteButton-BkIaWfgD.cjs.map +1 -0
- package/{FavoriteButton-BZEGWrRo.d.mts → FavoriteButton-hIkGjcKH.d.mts} +2 -2
- package/{FavoriteButton-BZEGWrRo.d.mts.map → FavoriteButton-hIkGjcKH.d.mts.map} +1 -1
- package/{FileUpload-p_pl9NXr.mjs → FileUpload-BfZOMsLs.mjs} +6 -6
- package/FileUpload-BfZOMsLs.mjs.map +1 -0
- package/{FileUpload--e_UJ_ek.cjs → FileUpload-gjRbkgrL.cjs} +6 -6
- package/FileUpload-gjRbkgrL.cjs.map +1 -0
- package/IconButton.cjs +1 -1
- package/IconButton.mjs +1 -1
- package/{ImageSlider-BidXfnLj.cjs → ImageSlider-CAgxQffP.cjs} +3 -3
- package/ImageSlider-CAgxQffP.cjs.map +1 -0
- package/{ImageSlider-CDrg_TbL.mjs → ImageSlider-fdrJ6lIJ.mjs} +3 -3
- package/ImageSlider-fdrJ6lIJ.mjs.map +1 -0
- package/InfoIconTooltip.cjs +1 -1
- package/InfoIconTooltip.cjs.map +1 -1
- package/InfoIconTooltip.mjs +1 -1
- package/InfoIconTooltip.mjs.map +1 -1
- package/InlineButton-CRLbNJZ3.d.mts.map +1 -1
- package/InlineButton-DoXGLiSE.d.cts.map +1 -1
- package/Input.cjs +1 -1
- package/Input.cjs.map +1 -1
- package/Input.mjs +1 -1
- package/Input.mjs.map +1 -1
- package/JumpMenu-BXYZnPIH.cjs.map +1 -1
- package/JumpMenu-DcZjAiej.mjs.map +1 -1
- package/{Menu-Cxu8CaX1.mjs → Menu-Bn4smlEe.mjs} +2 -2
- package/Menu-Bn4smlEe.mjs.map +1 -0
- package/{Menu-ClUogmwE.cjs → Menu-DuDhtoNP.cjs} +2 -2
- package/Menu-DuDhtoNP.cjs.map +1 -0
- package/Modal-DM0aXJZ5.d.cts.map +1 -1
- package/Modal-DM0aXJZ5.d.mts.map +1 -1
- package/{Modal-C6gatdtT.mjs → Modal-DtxWd7Le.mjs} +3 -2
- package/{Modal-C6gatdtT.mjs.map → Modal-DtxWd7Le.mjs.map} +1 -1
- package/{Modal-CiBqXyiK.cjs → Modal-q4HhBAQU.cjs} +3 -2
- package/Modal-q4HhBAQU.cjs.map +1 -0
- package/{Pagination-bAtbN478.cjs → Pagination-Denb9_zB.cjs} +2 -2
- package/{Pagination-bAtbN478.cjs.map → Pagination-Denb9_zB.cjs.map} +1 -1
- package/{Pagination-DIpGKMLz.mjs → Pagination-Dyfeys4B.mjs} +2 -2
- package/{Pagination-DIpGKMLz.mjs.map → Pagination-Dyfeys4B.mjs.map} +1 -1
- package/PhoneInput-B5pkpkdt.mjs.map +1 -1
- package/PhoneInput-BXnkBME4.d.mts.map +1 -1
- package/PhoneInput-Bkrbrins.d.cts.map +1 -1
- package/PhoneInput-CUMPOSxJ.cjs.map +1 -1
- package/{ProgressCircle-BC81D9sU.cjs → ProgressCircle-B6R4dxoV.cjs} +2 -2
- package/{ProgressCircle-BC81D9sU.cjs.map → ProgressCircle-B6R4dxoV.cjs.map} +1 -1
- package/{ProgressCircle-ae8cvZhe.mjs → ProgressCircle-zSai1HTT.mjs} +2 -2
- package/{ProgressCircle-ae8cvZhe.mjs.map → ProgressCircle-zSai1HTT.mjs.map} +1 -1
- package/SearchInput-DYIPC8Cd.d.cts.map +1 -1
- package/SearchInput-IfEWePDQ.d.mts.map +1 -1
- package/{Select-BkZu8OLs.mjs → Select-CH_ZN88G.mjs} +2 -2
- package/Select-CH_ZN88G.mjs.map +1 -0
- package/{Select-BXDjzyDs.cjs → Select-DCCcyLT4.cjs} +2 -2
- package/Select-DCCcyLT4.cjs.map +1 -0
- package/{SplitButton-DcmmLW8j.cjs → SplitButton-B_Y253RU.cjs} +2 -2
- package/{SplitButton-DcmmLW8j.cjs.map → SplitButton-B_Y253RU.cjs.map} +1 -1
- package/{SplitButton-WE5ymwCQ.mjs → SplitButton-_poP9Ykq.mjs} +2 -2
- package/{SplitButton-WE5ymwCQ.mjs.map → SplitButton-_poP9Ykq.mjs.map} +1 -1
- package/{Table-M-rANdMt.mjs → Table-CQGtDpvH.mjs} +3 -3
- package/{Table-M-rANdMt.mjs.map → Table-CQGtDpvH.mjs.map} +1 -1
- package/{Table-CLlDragJ.cjs → Table-D4UYosb1.cjs} +3 -3
- package/{Table-CLlDragJ.cjs.map → Table-D4UYosb1.cjs.map} +1 -1
- package/Typography/InlineButton.cjs +1 -1
- package/Typography/InlineButton.cjs.map +1 -1
- package/Typography/InlineButton.mjs +1 -1
- package/Typography/InlineButton.mjs.map +1 -1
- package/{ViewMore-BBoUvo7p.cjs → ViewMore-BcoSRZSl.cjs} +14 -1
- package/ViewMore-BcoSRZSl.cjs.map +1 -0
- package/{ViewMore-BrZPuE4E.mjs → ViewMore-Be0TQZ_2.mjs} +14 -1
- package/ViewMore-Be0TQZ_2.mjs.map +1 -0
- package/bottomSheet.cjs +1 -1
- package/bottomSheet.mjs +1 -1
- package/{buttonColorClasses-C3hg1at8.cjs → buttonColorClasses-CQQmLYfk.cjs} +4 -4
- package/buttonColorClasses-CQQmLYfk.cjs.map +1 -0
- package/{buttonColorClasses-B7OU4aQA.mjs → buttonColorClasses-CQnqAJXl.mjs} +4 -4
- package/buttonColorClasses-CQnqAJXl.mjs.map +1 -0
- package/card/components/createFavoriteButton.cjs +1 -1
- package/card/components/createFavoriteButton.mjs +1 -1
- package/cookieConsent.cjs +1 -1
- package/cookieConsent.mjs +1 -1
- package/drawer.cjs +1 -1
- package/drawer.mjs +1 -1
- package/evolve-ui.entries.json +556 -0
- package/favoriteButton.cjs +1 -1
- package/favoriteButton.d.cts +1 -1
- package/favoriteButton.d.mts +1 -1
- package/favoriteButton.mjs +1 -1
- package/featureFlags/hooks.d.cts +1 -1
- package/featureFlags/hooks.d.mts +1 -1
- package/fileUpload.cjs +1 -1
- package/fileUpload.mjs +1 -1
- package/imageSlider.cjs +1 -1
- package/imageSlider.mjs +1 -1
- package/index.cjs +14 -14
- package/index.d.cts +1 -1
- package/index.d.mts +1 -1
- package/index.mjs +14 -14
- package/menu.cjs +1 -1
- package/menu.mjs +1 -1
- package/modal/useCloseModal.cjs +2 -1
- package/modal/useCloseModal.cjs.map +1 -1
- package/modal/useCloseModal.mjs +2 -1
- package/modal/useCloseModal.mjs.map +1 -1
- package/modal.cjs +1 -1
- package/modal.mjs +1 -1
- package/package.json +2 -4
- package/pagination.cjs +1 -1
- package/pagination.mjs +1 -1
- package/progressCircle.cjs +1 -1
- package/progressCircle.mjs +1 -1
- package/searchInput.cjs +4 -4
- package/searchInput.cjs.map +1 -1
- package/searchInput.mjs +4 -4
- package/searchInput.mjs.map +1 -1
- package/select.cjs +1 -1
- package/select.mjs +1 -1
- package/selectAsync.cjs +1 -1
- package/selectAsync.mjs +1 -1
- package/selectAsyncCreatable.cjs +1 -1
- package/selectAsyncCreatable.mjs +1 -1
- package/selectCreatable.cjs +1 -1
- package/selectCreatable.mjs +1 -1
- package/splitButton.cjs +1 -1
- package/splitButton.mjs +1 -1
- package/src/Accordion/Accordion.tsx +233 -0
- package/src/AddressDisplay/AddressDisplay.tsx +43 -0
- package/src/AddressDisplay/components/addressComponents.tsx +111 -0
- package/src/AddressDisplay/components/addressField.tsx +25 -0
- package/src/AddressDisplay/components/addressSection.tsx +8 -0
- package/src/AddressDisplay/components/getCountryValue.tsx +31 -0
- package/src/AddressDisplay/types.ts +26 -0
- package/src/AutomatedCarousel/AutomatedCarousel.tsx +163 -0
- package/src/AutomatedCarousel/automatedCarousel.types.ts +7 -0
- package/src/AutomatedCarousel/components/CarouselProgressBar/CarouselProgressBar.tsx +139 -0
- package/src/AutomatedCarousel/components/CarouselProgressBar/components/CarouselProgressBarUnit/CarouselProgressBarUnit.tsx +165 -0
- package/src/Badge/Badge.tsx +104 -0
- package/src/Badge/Badge.types.ts +58 -0
- package/src/Badge/ItemBadge.tsx +97 -0
- package/src/Badge/LiveStatusBadge.tsx +93 -0
- package/src/BannerNotification/BannerNotification.tsx +157 -0
- package/src/BannerNotification/components/BannerNotificationSkeleton.tsx +39 -0
- package/src/BannerNotification/components/CalloutIcon/BannerIcon.tsx +48 -0
- package/src/BannerNotification/utils/getRandomTooltipId.ts +3 -0
- package/src/BottomSheet/BottomSheet.tsx +476 -0
- package/src/BottomSheet/components/BottomSheetBackdrop/BottomSheetBackdrop.tsx +47 -0
- package/src/BottomSheet/components/BottomSheetContentArea/BottomSheetContentArea.tsx +93 -0
- package/src/BottomSheet/components/BottomSheetOverlay/BottomSheetOverlayTranslate3d.tsx +199 -0
- package/src/BottomSheet/components/SheetDescription/SheetDescription.tsx +22 -0
- package/src/BottomSheet/components/SheetTitle/SheetTitle.tsx +21 -0
- package/src/BottomSheet/components/index.tsx +5 -0
- package/src/BottomSheet/hooks/index.tsx +13 -0
- package/src/BottomSheet/hooks/useAriaHider.tsx +91 -0
- package/src/BottomSheet/hooks/useBottomSheetServices.tsx +224 -0
- package/src/BottomSheet/hooks/useDragHandler.tsx +282 -0
- package/src/BottomSheet/hooks/useFocusTrap.tsx +113 -0
- package/src/BottomSheet/hooks/useLayoutEffect.tsx +4 -0
- package/src/BottomSheet/hooks/useOptimizedResizeObserver.tsx +94 -0
- package/src/BottomSheet/hooks/useOptimizedScrollState.tsx +87 -0
- package/src/BottomSheet/hooks/useReady.tsx +34 -0
- package/src/BottomSheet/hooks/useReducedMotion.tsx +22 -0
- package/src/BottomSheet/hooks/useScrollLock.tsx +143 -0
- package/src/BottomSheet/hooks/useSnapPoints.tsx +355 -0
- package/src/BottomSheet/hooks/useSpring.tsx +47 -0
- package/src/BottomSheet/hooks/useSpringInterpolationsTranslate3d.tsx +101 -0
- package/src/BottomSheet/index.tsx +237 -0
- package/src/BottomSheet/state/atoms.ts +147 -0
- package/src/BottomSheet/state/useBottomSheetStateMachine.ts +246 -0
- package/src/BottomSheet/types.ts +172 -0
- package/src/BottomSheet/utils.ts +65 -0
- package/src/Breadcrumbs/Breadcrumbs.tsx +126 -0
- package/src/Button/Button.tsx +164 -0
- package/src/Button/Button.types.ts +80 -0
- package/src/Button/buttonColorClasses.ts +58 -0
- package/src/Callout/Callout.tsx +136 -0
- package/src/Callout/Callout.types.ts +29 -0
- package/src/Callout/components/CalloutIcon/CalloutIcon.tsx +56 -0
- package/src/Card/CardGrid.tsx +263 -0
- package/src/Card/SingleCard.tsx +22 -0
- package/src/Card/cardFactory.tsx +176 -0
- package/src/Card/components/createBadge.tsx +34 -0
- package/src/Card/components/createFavoriteButton.tsx +40 -0
- package/src/Card/components/createImage.tsx +64 -0
- package/src/Card/components/createInfo.tsx +84 -0
- package/src/Card/components/createName.tsx +63 -0
- package/src/Card/components/createPriceStatus.tsx +100 -0
- package/src/Card/components/types.ts +4 -0
- package/src/Card/hooks/useCardVisibilityTracking.ts +82 -0
- package/src/Card/sharedProps.ts +12 -0
- package/src/Card/types.ts +62 -0
- package/src/Carousel/Carousel.tsx +513 -0
- package/src/Carousel/Carousel.types.ts +43 -0
- package/src/Carousel/Carousel.utils.ts +63 -0
- package/src/Carousel/components/DotButton/DotButton.tsx +42 -0
- package/src/Carousel/components/NavigationButtons/NavigationButtons.tsx +77 -0
- package/src/Carousel/components/TitleSection/TitleSection.tsx +61 -0
- package/src/Carousel/components/TitleSection/components/SubHeaderLeft/SubHeaderLeft.tsx +53 -0
- package/src/Carousel/components/TitleSection/components/Title/Title.tsx +46 -0
- package/src/Carousel/index.ts +2 -0
- package/src/Carousel/testUtils.ts +10 -0
- package/src/Chips/Chip.tsx +153 -0
- package/src/Chips/ChipGroup.tsx +173 -0
- package/src/Chips/SuggestionChip.tsx +15 -0
- package/src/Chips/chipTypes.ts +113 -0
- package/src/Chips/index.ts +4 -0
- package/src/ChoiceListItem/Checkbox.tsx +69 -0
- package/src/ChoiceListItem/Radio.tsx +61 -0
- package/src/ChoiceListItem/choiceListItem.tsx +99 -0
- package/src/ChoiceListItem/common.tsx +148 -0
- package/src/ChoiceListItem/index.ts +3 -0
- package/src/Collapsible/Collapsible.tsx +58 -0
- package/src/Confetti/Confetti.tsx +270 -0
- package/src/Confetti/index.ts +2 -0
- package/src/ContentPager/ContentPager.tsx +189 -0
- package/src/ContentPager/components/Page.tsx +24 -0
- package/src/CookieConsent/components/CookieCategoryRow/CookieCategoryRow.tsx +30 -0
- package/src/CookieConsent/components/CookieConsent/CookieConsent.tsx +74 -0
- package/src/CookieConsent/components/CookieConsentBanner/CookieConsentBanner.tsx +51 -0
- package/src/CookieConsent/components/CookieConsentModal/CookieConsentModal.tsx +64 -0
- package/src/CookieConsent/hooks/useCookieConsent.ts +170 -0
- package/src/CookieConsent/hooks/useCookieConsentState.ts +142 -0
- package/src/CookieConsent/index.ts +16 -0
- package/src/CookieConsent/types/cookieConsent.types.ts +79 -0
- package/src/CookieConsent/types/index.ts +7 -0
- package/src/Countdown/Countdown.tsx +161 -0
- package/src/Countdown/Countdown.types.ts +4 -0
- package/src/Countdown/hooks/useGetCountdown.ts +103 -0
- package/src/DateTimeInput/dateInput/DateInput.tsx +199 -0
- package/src/DateTimeInput/datePicker/DatePicker.tsx +138 -0
- package/src/DateTimeInput/datePicker/components/calendar/Calendar.tsx +72 -0
- package/src/DateTimeInput/datePicker/index.ts +2 -0
- package/src/DateTimeInput/timeInput/TimeInput.tsx +128 -0
- package/src/DateTimeInput/timePicker/TimePicker.tsx +118 -0
- package/src/DateTimeInput/timePicker/components/TimePopover/AmPmSwitch.tsx +103 -0
- package/src/DateTimeInput/timePicker/components/TimePopover/TimeFieldInput.tsx +26 -0
- package/src/DateTimeInput/timePicker/components/TimePopover/TimePopover.tsx +84 -0
- package/src/DateTimeInput/timePicker/components/TimePopover/TimePopover.utils.ts +67 -0
- package/src/DateTimeInput/timePicker/components/TimePopover/TimePopoverActions.tsx +26 -0
- package/src/DateTimeInput/timePicker/index.ts +2 -0
- package/src/DateTimeInput/utils/getDisplayDate.ts +15 -0
- package/src/DateTimeInput/utils/getDisplayTime.ts +15 -0
- package/src/DateTimeInput/utils/index.ts +2 -0
- package/src/DateTimeInput/utils/parseTimeValue.ts +54 -0
- package/src/Drawer/Drawer.tsx +443 -0
- package/src/Drawer/atoms.ts +4 -0
- package/src/Drawer/components/DialogActions/DialogActions.tsx +33 -0
- package/src/Drawer/components/DialogContent/DialogContent.tsx +80 -0
- package/src/Drawer/components/DialogHeader/DialogHeader.tsx +68 -0
- package/src/EducationalPopover/EducationalPopover.tsx +174 -0
- package/src/FavoriteButton/FavoriteButton.tsx +64 -0
- package/src/FavoriteButton/components/IconOnlyFavoriteButton/IconOnlyFavoriteButton.tsx +83 -0
- package/src/FavoriteButton/components/LabeledAnimatedFavoriteButton/LabeledAnimatedFavoriteButton.tsx +186 -0
- package/src/FavoriteButton/components/LabeledFavoriteButton/LabeledFavoriteButton.tsx +71 -0
- package/src/FavoriteButton/components/SmallHeartStraightIcon/SmallHeartStraightIcon.tsx +14 -0
- package/src/FavoriteButton/hooks/useFavoriteButtonState.ts +30 -0
- package/src/FavoriteButton/index.ts +2 -0
- package/src/FavoriteButton/types/favoriteButton.ts +87 -0
- package/src/FeatureFlags/devTools/FeatureFlagDevToolsUI.tsx +226 -0
- package/src/FeatureFlags/devTools/getFeatureFlagCookieOverrides.ts +30 -0
- package/src/FeatureFlags/devTools/utils/cookies.ts +169 -0
- package/src/FeatureFlags/hooks/index.ts +2 -0
- package/src/FeatureFlags/hooks/useFeatureFlag.tsx +19 -0
- package/src/FeatureFlags/hooks/useFeatureFlags.tsx +15 -0
- package/src/FileUpload/components/FileCard/FileCard.tsx +50 -0
- package/src/FileUpload/components/FileDropzone/FileDropzone.tsx +221 -0
- package/src/FileUpload/components/FileDropzone/components/DropzoneContent/DropzoneContent.tsx +28 -0
- package/src/FileUpload/components/FileDropzone/components/DropzoneContent/DropzoneText.tsx +81 -0
- package/src/FileUpload/components/FileDropzone/components/FileDropzoneDebugger/FileDropzoneDebugger.tsx +40 -0
- package/src/FileUpload/components/FileDropzone/components/FileDropzoneDebugger/FileRejectionsDisplay.tsx +110 -0
- package/src/FileUpload/components/FileDropzoneOverlay/FileDropzoneOverlay.tsx +183 -0
- package/src/FileUpload/components/FileDropzoneOverlay/components/OverlayDropzoneContent.tsx +146 -0
- package/src/FileUpload/components/FileDropzoneOverlay/components/OverlayDropzoneDragText.tsx +42 -0
- package/src/FileUpload/components/FileDropzoneOverlay/styles.ts +79 -0
- package/src/FileUpload/components/FilePreviewList/FilePreviewList.tsx +251 -0
- package/src/FileUpload/components/FilePreviewList/virtualizerComponents/FilePreviewVirtualizedList/FilePreviewVirtualizedList.tsx +88 -0
- package/src/FileUpload/components/FileUpload/FileUpload.tsx +63 -0
- package/src/FileUpload/components/FileUploadCanvas/FileUploadCanvas.tsx +125 -0
- package/src/FileUpload/components/GridFileCard/GridFileCard.tsx +364 -0
- package/src/FileUpload/components/GridFileCard/utils/sortable.ts +48 -0
- package/src/FileUpload/components/ListFileCard/ListFileCard.tsx +259 -0
- package/src/FileUpload/components/types.ts +78 -0
- package/src/FileUpload/hooks/filePreview/useImageFilePreviewUrl.ts +62 -0
- package/src/FileUpload/hooks/index.ts +11 -0
- package/src/FileUpload/hooks/upload/useHandleDragEnter/useHandleDragEnter.ts +154 -0
- package/src/FileUpload/hooks/upload/useHandleDrop/createFileRejectionHelpers.ts +273 -0
- package/src/FileUpload/hooks/upload/useHandleDrop/useHandleDrop.ts +153 -0
- package/src/FileUpload/hooks/upload/useUploadAvailability/useUploadAvailability.ts +44 -0
- package/src/FileUpload/hooks/validation/createDropzoneValidator.ts +41 -0
- package/src/FileUpload/hooks/validation/useFileValidation.ts +25 -0
- package/src/FileUpload/hooks/validation/useFileValidationLogic.ts +107 -0
- package/src/FileUpload/hooks/validation/useValidationMessages.ts +92 -0
- package/src/FileUpload/hooks/validation/useValidationState.ts +171 -0
- package/src/FileUpload/index.ts +57 -0
- package/src/FileUpload/providers/FileUploadProvider.tsx +219 -0
- package/src/FileUpload/providers/UploadValidationProvider.tsx +159 -0
- package/src/FileUpload/testUtils/mockFilesAndImages.ts +64 -0
- package/src/FileUpload/testUtils/testUtils.ts +111 -0
- package/src/FileUpload/types/commonTypes.ts +267 -0
- package/src/FileUpload/types/index.ts +31 -0
- package/src/FileUpload/types/sharedTypes.ts +159 -0
- package/src/FileUpload/utils/constants.ts +79 -0
- package/src/FileUpload/utils/createMessageContext.ts +180 -0
- package/src/FileUpload/utils/getFileExtensionsFromAcceptedTypes.ts +73 -0
- package/src/FileUpload/utils/getFilePluralizationText.ts +68 -0
- package/src/FileUpload/utils/getMimeTypes.ts +26 -0
- package/src/FileUpload/utils/messageUtils.ts +41 -0
- package/src/FileUpload/utils/styles.ts +68 -0
- package/src/FormLabel/FormLabel.tsx +212 -0
- package/src/IconButton/IconButton.tsx +154 -0
- package/src/Icons/CreditCardIcon/CreditCardIcon.tsx +73 -0
- package/src/Icons/CreditCardIcon/cardIcons.tsx +270 -0
- package/src/Icons/IconBase.tsx +133 -0
- package/src/Icons/anyIcon.ts +3 -0
- package/src/Icons/generatedIcons/Archive.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowClockwise.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowDown.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowLeft.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowRight.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowSquareOut.tsx +51 -0
- package/src/Icons/generatedIcons/ArrowSquareRight.tsx +51 -0
- package/src/Icons/generatedIcons/ArrowUp.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowsCounterClockwise.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowsLeftRight.tsx +48 -0
- package/src/Icons/generatedIcons/ArrowsOutCardinal.tsx +48 -0
- package/src/Icons/generatedIcons/Bank.tsx +48 -0
- package/src/Icons/generatedIcons/Bell.tsx +51 -0
- package/src/Icons/generatedIcons/BookBookmark.tsx +51 -0
- package/src/Icons/generatedIcons/BookmarksSimple.tsx +51 -0
- package/src/Icons/generatedIcons/Broadcast.tsx +48 -0
- package/src/Icons/generatedIcons/CalendarBlank.tsx +48 -0
- package/src/Icons/generatedIcons/CalendarStar.tsx +51 -0
- package/src/Icons/generatedIcons/Camera.tsx +51 -0
- package/src/Icons/generatedIcons/CaretDown.tsx +48 -0
- package/src/Icons/generatedIcons/CaretLeft.tsx +48 -0
- package/src/Icons/generatedIcons/CaretRight.tsx +48 -0
- package/src/Icons/generatedIcons/CaretUp.tsx +48 -0
- package/src/Icons/generatedIcons/Certificate.tsx +51 -0
- package/src/Icons/generatedIcons/ChartBar.tsx +48 -0
- package/src/Icons/generatedIcons/Check.tsx +51 -0
- package/src/Icons/generatedIcons/CheckCircle.tsx +48 -0
- package/src/Icons/generatedIcons/CirclesFour.tsx +51 -0
- package/src/Icons/generatedIcons/Clock.tsx +48 -0
- package/src/Icons/generatedIcons/ClockCountdown.tsx +48 -0
- package/src/Icons/generatedIcons/Close.tsx +51 -0
- package/src/Icons/generatedIcons/CloudArrowUp.tsx +51 -0
- package/src/Icons/generatedIcons/CloudWarning.tsx +51 -0
- package/src/Icons/generatedIcons/Code.tsx +48 -0
- package/src/Icons/generatedIcons/Compass.tsx +51 -0
- package/src/Icons/generatedIcons/Confetti.tsx +51 -0
- package/src/Icons/generatedIcons/Copy.tsx +48 -0
- package/src/Icons/generatedIcons/CornersOut.tsx +48 -0
- package/src/Icons/generatedIcons/CreditCard.tsx +48 -0
- package/src/Icons/generatedIcons/Crown.tsx +51 -0
- package/src/Icons/generatedIcons/CrownSimple.tsx +51 -0
- package/src/Icons/generatedIcons/CurrencyCircleDollar.tsx +48 -0
- package/src/Icons/generatedIcons/CurrencyDollarSimple.tsx +51 -0
- package/src/Icons/generatedIcons/Desktop.tsx +51 -0
- package/src/Icons/generatedIcons/Detective.tsx +51 -0
- package/src/Icons/generatedIcons/DotOutline.tsx +46 -0
- package/src/Icons/generatedIcons/DotsSixVertical.tsx +51 -0
- package/src/Icons/generatedIcons/DotsThreeOutline.tsx +51 -0
- package/src/Icons/generatedIcons/DotsThreeOutlineVertical.tsx +51 -0
- package/src/Icons/generatedIcons/DownloadSimple.tsx +51 -0
- package/src/Icons/generatedIcons/EnvelopeSimple.tsx +48 -0
- package/src/Icons/generatedIcons/Eraser.tsx +51 -0
- package/src/Icons/generatedIcons/Eye.tsx +51 -0
- package/src/Icons/generatedIcons/EyeSlash.tsx +51 -0
- package/src/Icons/generatedIcons/FacebookLogo.tsx +48 -0
- package/src/Icons/generatedIcons/FileArchive.tsx +48 -0
- package/src/Icons/generatedIcons/FileArrowDown.tsx +48 -0
- package/src/Icons/generatedIcons/FileCsv.tsx +48 -0
- package/src/Icons/generatedIcons/FilePdf.tsx +48 -0
- package/src/Icons/generatedIcons/FileText.tsx +48 -0
- package/src/Icons/generatedIcons/Files.tsx +51 -0
- package/src/Icons/generatedIcons/Fire.tsx +51 -0
- package/src/Icons/generatedIcons/Flag.tsx +51 -0
- package/src/Icons/generatedIcons/FlagBannerFold.tsx +48 -0
- package/src/Icons/generatedIcons/FloppyDisk.tsx +51 -0
- package/src/Icons/generatedIcons/Gauge.tsx +51 -0
- package/src/Icons/generatedIcons/Gavel.tsx +51 -0
- package/src/Icons/generatedIcons/Gear.tsx +51 -0
- package/src/Icons/generatedIcons/GlobeHemisphereWest.tsx +51 -0
- package/src/Icons/generatedIcons/GoogleLogo.tsx +48 -0
- package/src/Icons/generatedIcons/GridNine.tsx +51 -0
- package/src/Icons/generatedIcons/HandCoins.tsx +51 -0
- package/src/Icons/generatedIcons/HandbagSimple.tsx +51 -0
- package/src/Icons/generatedIcons/Headset.tsx +51 -0
- package/src/Icons/generatedIcons/HeartStraight.tsx +51 -0
- package/src/Icons/generatedIcons/HourglassLow.tsx +48 -0
- package/src/Icons/generatedIcons/House.tsx +51 -0
- package/src/Icons/generatedIcons/Image.tsx +51 -0
- package/src/Icons/generatedIcons/ImageSquare.tsx +51 -0
- package/src/Icons/generatedIcons/ImagesSquare.tsx +51 -0
- package/src/Icons/generatedIcons/Info.tsx +48 -0
- package/src/Icons/generatedIcons/InstagramLogo.tsx +51 -0
- package/src/Icons/generatedIcons/Lightning.tsx +48 -0
- package/src/Icons/generatedIcons/Link.tsx +51 -0
- package/src/Icons/generatedIcons/LinkedinLogo.tsx +51 -0
- package/src/Icons/generatedIcons/List.tsx +48 -0
- package/src/Icons/generatedIcons/Lock.tsx +51 -0
- package/src/Icons/generatedIcons/LockOpen.tsx +51 -0
- package/src/Icons/generatedIcons/MagnifyingGlass.tsx +48 -0
- package/src/Icons/generatedIcons/MapPin.tsx +51 -0
- package/src/Icons/generatedIcons/MapPinSimpleArea.tsx +48 -0
- package/src/Icons/generatedIcons/Medal.tsx +48 -0
- package/src/Icons/generatedIcons/Megaphone.tsx +48 -0
- package/src/Icons/generatedIcons/Minus.tsx +45 -0
- package/src/Icons/generatedIcons/Money.tsx +51 -0
- package/src/Icons/generatedIcons/Notches.tsx +48 -0
- package/src/Icons/generatedIcons/NotePencil.tsx +48 -0
- package/src/Icons/generatedIcons/Package.tsx +51 -0
- package/src/Icons/generatedIcons/PaintBrush.tsx +51 -0
- package/src/Icons/generatedIcons/PaperPlaneTilt.tsx +51 -0
- package/src/Icons/generatedIcons/Paperclip.tsx +51 -0
- package/src/Icons/generatedIcons/Pause.tsx +51 -0
- package/src/Icons/generatedIcons/PencilLine.tsx +51 -0
- package/src/Icons/generatedIcons/PencilRuler.tsx +51 -0
- package/src/Icons/generatedIcons/PencilSimple.tsx +51 -0
- package/src/Icons/generatedIcons/Phone.tsx +51 -0
- package/src/Icons/generatedIcons/PinterestLogo.tsx +51 -0
- package/src/Icons/generatedIcons/Play.tsx +51 -0
- package/src/Icons/generatedIcons/Plus.tsx +51 -0
- package/src/Icons/generatedIcons/PlusCircle.tsx +48 -0
- package/src/Icons/generatedIcons/Printer.tsx +51 -0
- package/src/Icons/generatedIcons/Question.tsx +48 -0
- package/src/Icons/generatedIcons/Receipt.tsx +51 -0
- package/src/Icons/generatedIcons/Rows.tsx +51 -0
- package/src/Icons/generatedIcons/SealCheck.tsx +51 -0
- package/src/Icons/generatedIcons/SelectionSlash.tsx +48 -0
- package/src/Icons/generatedIcons/ShareNetwork.tsx +51 -0
- package/src/Icons/generatedIcons/ShieldCheck.tsx +51 -0
- package/src/Icons/generatedIcons/ShieldStar.tsx +51 -0
- package/src/Icons/generatedIcons/ShoppingCart.tsx +48 -0
- package/src/Icons/generatedIcons/ShuffleAngular.tsx +48 -0
- package/src/Icons/generatedIcons/SidebarSimple.tsx +48 -0
- package/src/Icons/generatedIcons/SlidersHorizontal.tsx +51 -0
- package/src/Icons/generatedIcons/Smiley.tsx +48 -0
- package/src/Icons/generatedIcons/Sparkle.tsx +51 -0
- package/src/Icons/generatedIcons/SpinnerGap.tsx +48 -0
- package/src/Icons/generatedIcons/StackPlus.tsx +48 -0
- package/src/Icons/generatedIcons/Star.tsx +51 -0
- package/src/Icons/generatedIcons/Storefront.tsx +51 -0
- package/src/Icons/generatedIcons/Swap.tsx +51 -0
- package/src/Icons/generatedIcons/Tag.tsx +51 -0
- package/src/Icons/generatedIcons/ThumbsDown.tsx +48 -0
- package/src/Icons/generatedIcons/ThumbsUp.tsx +48 -0
- package/src/Icons/generatedIcons/Toolbox.tsx +48 -0
- package/src/Icons/generatedIcons/Trash.tsx +48 -0
- package/src/Icons/generatedIcons/TrendUp.tsx +48 -0
- package/src/Icons/generatedIcons/Trophy.tsx +51 -0
- package/src/Icons/generatedIcons/Truck.tsx +51 -0
- package/src/Icons/generatedIcons/UploadSimple.tsx +51 -0
- package/src/Icons/generatedIcons/User.tsx +48 -0
- package/src/Icons/generatedIcons/Users.tsx +48 -0
- package/src/Icons/generatedIcons/UsersThree.tsx +51 -0
- package/src/Icons/generatedIcons/VideoCamera.tsx +51 -0
- package/src/Icons/generatedIcons/Warning.tsx +51 -0
- package/src/Icons/generatedIcons/WarningCircle.tsx +48 -0
- package/src/Icons/generatedIcons/WifiHigh.tsx +51 -0
- package/src/Icons/generatedIcons/XCircle.tsx +48 -0
- package/src/Icons/generatedIcons/XLogo.tsx +48 -0
- package/src/Icons/generatedIcons/YoutubeLogo.tsx +51 -0
- package/src/Icons/importedIcons.ts +152 -0
- package/src/Icons/index.ts +149 -0
- package/src/Icons/socialIcons/appleSocialIcon.tsx +50 -0
- package/src/Icons/socialIcons/facebookSocialIcon.tsx +41 -0
- package/src/Icons/socialIcons/googleSocialIcon.tsx +134 -0
- package/src/ImageCluster/ImageCluster.tsx +125 -0
- package/src/ImageSlider/ImageSlider.tsx +584 -0
- package/src/ImageSlider/ImageSlider.types.ts +90 -0
- package/src/ImageSlider/components/IndexIndicator/IndexIndicator.tsx +21 -0
- package/src/ImageSlider/components/NavigationButtons/NavigationButtons.tsx +113 -0
- package/src/ImageSlider/components/ResponsiveImage/ResponsiveImage.tsx +114 -0
- package/src/ImageSlider/components/ResponsiveImage/index.ts +1 -0
- package/src/ImageSlider/components/Thumbnails/Thumbnails.tsx +184 -0
- package/src/ImageSlider/constants.ts +59 -0
- package/src/ImageSlider/hooks/index.ts +3 -0
- package/src/ImageSlider/hooks/useImageSlider.ts +57 -0
- package/src/ImageSlider/hooks/useImageSliderNavigation.ts +133 -0
- package/src/ImageSlider/hooks/useImageSliderScrollHandler.ts +171 -0
- package/src/ImageSlider/index.ts +3 -0
- package/src/ImageSlider/utils/imageOptimization.ts +97 -0
- package/src/ImageSlider/utils/index.ts +1 -0
- package/src/InlineNotification/InlineNotification.tsx +95 -0
- package/src/JumpMenu/JumpMenu.tsx +395 -0
- package/src/JumpMenu/components/JumpMenuItem/JumpMenuItem.tsx +65 -0
- package/src/JumpMenu/hooks/useContainerTracking.ts +171 -0
- package/src/JumpMenu/hooks/useIntersectionObserver.ts +77 -0
- package/src/JumpMenu/hooks/useKeyboardNavigation.ts +102 -0
- package/src/JumpMenu/hooks/useResizeObserver.ts +53 -0
- package/src/JumpMenu/hooks/useSectionObserver.ts +102 -0
- package/src/JumpMenu/index.ts +2 -0
- package/src/JumpMenu/types/index.ts +19 -0
- package/src/Loading/Loading.tsx +39 -0
- package/src/Loading/components/LoadingDot/LoadingDot.tsx +16 -0
- package/src/LoadingSpinner/LoadingSpinner.tsx +20 -0
- package/src/Menu/Menu.tsx +372 -0
- package/src/Menu/components/MenuDivider/MenuDivider.tsx +5 -0
- package/src/Menu/components/MenuItem/MenuItem.tsx +298 -0
- package/src/Menu/context/menuContext.tsx +20 -0
- package/src/Menu/hooks/useMenu.tsx +18 -0
- package/src/Menu/index.ts +3 -0
- package/src/Modal/ComposableModal.tsx +321 -0
- package/src/Modal/Modal.tsx +231 -0
- package/src/Modal/components/BackButton/BackButton.tsx +43 -0
- package/src/Modal/components/Backdrop/Backdrop.tsx +62 -0
- package/src/Modal/components/CloseButton/CloseButton.tsx +55 -0
- package/src/Modal/components/ModalActions/ModalActions.tsx +135 -0
- package/src/Modal/components/ModalContent/ModalContent.tsx +163 -0
- package/src/Modal/components/ModalHeader/ModalHeader.tsx +84 -0
- package/src/Modal/components/ModalHeader/hooks/useHeaderAnimation.tsx +49 -0
- package/src/Modal/components/ModalProgressSteps/ModalProgressSteps.tsx +26 -0
- package/src/Modal/components/ModalSubTitle/ModalSubTitle.tsx +29 -0
- package/src/Modal/components/ModalTitle/ModalTitle.tsx +22 -0
- package/src/Modal/components/PreventModalScroll/PreventModalScroll.tsx +106 -0
- package/src/Modal/components/index.ts +12 -0
- package/src/Modal/context.ts +33 -0
- package/src/Modal/hooks/useCloseModal.ts +140 -0
- package/src/NotificationBadge/NotificationBadge.tsx +34 -0
- package/src/Pagination/AdvancedPagination.tsx +48 -0
- package/src/Pagination/Pagination.tsx +216 -0
- package/src/Pagination/components/AdvancedPaginator/AdvancedPaginator.tsx +52 -0
- package/src/Pagination/components/AdvancedPaginator/components/PageSelect/PageSelect.tsx +43 -0
- package/src/Pagination/components/ItemCountDisplay/ItemCountDisplay.tsx +32 -0
- package/src/Pagination/components/ItemCountSelect/ItemCountSelect.tsx +33 -0
- package/src/Pagination/index.tsx +3 -0
- package/src/Pagination/paginationProvider.tsx +234 -0
- package/src/Pagination/utils.tsx +36 -0
- package/src/PhoneInput/PhoneInput.tsx +515 -0
- package/src/PhoneInput/useDropdownLogic.tsx +163 -0
- package/src/ProgressCircle/ProgressCircle.tsx +246 -0
- package/src/ProgressCircle/hooks/useProgressStatusTransitions.ts +49 -0
- package/src/ProgressCircle/utils/progressCircle.constants.ts +27 -0
- package/src/ProgressSteps/ProgressSteps.tsx +160 -0
- package/src/SaveConfetti/SaveConfetti.tsx +277 -0
- package/src/SaveConfetti/index.ts +2 -0
- package/src/SearchInput/SearchInput.tsx +237 -0
- package/src/SegmentedControl/SegmentedControl.tsx +111 -0
- package/src/SegmentedControl/SegmentedControlGroup.tsx +94 -0
- package/src/SegmentedControl/index.ts +4 -0
- package/src/Select/Select.tsx +154 -0
- package/src/Select/SelectAsync.tsx +13 -0
- package/src/Select/SelectAsyncCreatable.tsx +14 -0
- package/src/Select/SelectCreatable.tsx +12 -0
- package/src/Select/reexportedComponents.tsx +5 -0
- package/src/Select/selectComponents.tsx +305 -0
- package/src/Skeleton/Skeleton.tsx +13 -0
- package/src/SplitButton/SplitButton.tsx +298 -0
- package/src/SplitButton/SplitButtonTrigger.tsx +55 -0
- package/src/StarRating/StarRating.tsx +165 -0
- package/src/StarRating/components/StarComponent/StarComponent.tsx +44 -0
- package/src/Table/Table.tsx +474 -0
- package/src/Table/components/TableHeader/TableHeader.tsx +166 -0
- package/src/Table/components/TablePagination/TablePagination.tsx +18 -0
- package/src/Table/components/TablePagination/components/ItemCountDisplay/ItemCountDisplay.tsx +17 -0
- package/src/Table/components/TablePagination/components/ItemCountSelect/ItemCountSelect.tsx +31 -0
- package/src/Table/components/TablePagination/components/TablePaginator/TablePaginator.tsx +37 -0
- package/src/Table/components/TablePagination/components/TablePaginator/components/PageSelect/PageSelect.tsx +32 -0
- package/src/Table/components/TableRow/TableRows.tsx +147 -0
- package/src/Table/components/TableRow/components/TableRowCell/TableRowCell.tsx +49 -0
- package/src/Table/components/TableShadow/TableShadow.tsx +46 -0
- package/src/Table/index.ts +2 -0
- package/src/Table/sharedState.ts +30 -0
- package/src/Table/sharedStyles.ts +1 -0
- package/src/Table/types.ts +55 -0
- package/src/Tabs/Tabs.tsx +358 -0
- package/src/TextArea/TextArea.tsx +159 -0
- package/src/TextInput/TextInput.tsx +173 -0
- package/src/Toast/Toast.tsx +64 -0
- package/src/Toast/components/ToastContainer/ToastContainer.tsx +48 -0
- package/src/Toast/index.ts +2 -0
- package/src/Toast/types/role.ts +1 -0
- package/src/Toast/utils/getIcon.tsx +41 -0
- package/src/ToggleSwitch/ToggleSwitch.tsx +188 -0
- package/src/Tooltip/InfoIconTooltip.tsx +47 -0
- package/src/Tooltip/Tooltip.tsx +41 -0
- package/src/Typography/InlineButton/InlineButton.tsx +167 -0
- package/src/Typography/Links/Links.tsx +113 -0
- package/src/Typography/Text/Text.tsx +239 -0
- package/src/ViewMore/ViewMore.tsx +226 -0
- package/src/WebRTCPlayer/WebRTCPlayer.tsx +325 -0
- package/src/WebRTCPlayer/adaptor/NativeWebRTCAdaptor.ts +588 -0
- package/src/WebRTCPlayer/hooks/useWebRTCStream.ts +571 -0
- package/src/WebRTCPlayer/index.ts +22 -0
- package/src/WebRTCPlayer/types.ts +95 -0
- package/src/breakpoints/index.tsx +1 -0
- package/src/breakpoints/utils.tsx +50 -0
- package/src/declarations.d.ts +7 -0
- package/src/grid/gridHighlighter.tsx +83 -0
- package/src/grid/index.ts +3 -0
- package/src/grid/pageGrid.tsx +37 -0
- package/src/grid/useSubGridCSS.tsx +214 -0
- package/src/hooks/useHorizontalScrollFade.ts +44 -0
- package/src/hooks/usePrevious.ts +14 -0
- package/src/index.ts +351 -0
- package/src/intl/index.ts +4 -0
- package/src/intl/utils.ts +67 -0
- package/src/mixins/horizontalScrollFadeMixin.ts +56 -0
- package/src/mixins/index.ts +18 -0
- package/src/mixins/propMixins.ts +389 -0
- package/src/providers/createContextProvider.ts +22 -0
- package/src/providers/designSystemProvider.tsx +218 -0
- package/src/providers/errorBoundaryProvider.tsx +179 -0
- package/src/providers/featureFlagProvider.tsx +18 -0
- package/src/providers/gridSizeProvider.tsx +23 -0
- package/src/providers/index.ts +12 -0
- package/src/providers/linkProvider.tsx +32 -0
- package/src/providers/normalize.tsx +93 -0
- package/src/providers/targets/DatePickerTarget.tsx +10 -0
- package/src/providers/targets/ModalTarget.tsx +14 -0
- package/src/providers/targets/TimePickerTarget.tsx +10 -0
- package/src/providers/themeContext.tsx +24 -0
- package/src/providers/windowSizeProvider.tsx +125 -0
- package/src/spacing/index.ts +1 -0
- package/src/spacing/spacing.ts +11 -0
- package/src/utils/countriesWithISOCodes.ts +1419 -0
- package/src/utils/dateTimeFormat.ts +257 -0
- package/src/utils/effectEventListener.ts +11 -0
- package/src/utils/formatFileSize.ts +18 -0
- package/src/utils/isClientSide.ts +1 -0
- package/src/utils/keepTransition.ts +15 -0
- package/src/utils/nodeEnv.ts +9 -0
- package/src/utils/smoothScrollTo.ts +65 -0
- package/src/utils/utilityTypes.ts +13 -0
- package/table.cjs +1 -1
- package/table.mjs +1 -1
- package/tabs.cjs +1 -1
- package/tabs.cjs.map +1 -1
- package/tabs.mjs +1 -1
- package/tabs.mjs.map +1 -1
- package/textArea.cjs.map +1 -1
- package/textArea.mjs.map +1 -1
- package/viewMore.cjs +1 -1
- package/viewMore.mjs +1 -1
- package/BottomSheet-ZV_eq3xt.mjs.map +0 -1
- package/BottomSheet-emWP9Fct.cjs.map +0 -1
- package/FavoriteButton-CC3qL0lR.mjs.map +0 -1
- package/FavoriteButton-DliYzkfu.cjs.map +0 -1
- package/FileUpload--e_UJ_ek.cjs.map +0 -1
- package/FileUpload-p_pl9NXr.mjs.map +0 -1
- package/ImageSlider-BidXfnLj.cjs.map +0 -1
- package/ImageSlider-CDrg_TbL.mjs.map +0 -1
- package/Menu-ClUogmwE.cjs.map +0 -1
- package/Menu-Cxu8CaX1.mjs.map +0 -1
- package/Modal-CiBqXyiK.cjs.map +0 -1
- package/Select-BXDjzyDs.cjs.map +0 -1
- package/Select-BkZu8OLs.mjs.map +0 -1
- package/ViewMore-BBoUvo7p.cjs.map +0 -1
- package/ViewMore-BrZPuE4E.mjs.map +0 -1
- package/buttonColorClasses-B7OU4aQA.mjs.map +0 -1
- package/buttonColorClasses-C3hg1at8.cjs.map +0 -1
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { cn } from '@evolve.ui/theme-system';
|
|
2
|
+
import { ComponentProps, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Button } from '../Button/Button';
|
|
5
|
+
import { IconButton } from '../IconButton/IconButton';
|
|
6
|
+
import { Close } from '../Icons';
|
|
7
|
+
import { AnyIcon } from '../Icons/anyIcon';
|
|
8
|
+
import { Tooltip } from '../Tooltip/Tooltip';
|
|
9
|
+
import { Caption, H5 } from '../Typography/Text/Text';
|
|
10
|
+
|
|
11
|
+
type Props = Omit<ComponentProps<typeof Tooltip>, 'children'> & {
|
|
12
|
+
/**
|
|
13
|
+
* The icon to show in the top-left corner.
|
|
14
|
+
* - If populated, the title is shown right below it.
|
|
15
|
+
* - If not populated, the title will show there instead.
|
|
16
|
+
* @default undefined
|
|
17
|
+
*/
|
|
18
|
+
icon?: AnyIcon;
|
|
19
|
+
/**
|
|
20
|
+
* Array of ReactElements that the user will click through to become educated.
|
|
21
|
+
*/
|
|
22
|
+
pages: ReactElement[];
|
|
23
|
+
/**
|
|
24
|
+
* Should the close button be shown in the top-right corner?
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
showCloseButton?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Should the step counter be shown in the bottom-left corner?
|
|
30
|
+
* If there is only a single page, it will not be shown, even if this prop is true.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
showStepCount?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Title of the educational modal.
|
|
36
|
+
* This will be shown over the main content of every page in the education flow.
|
|
37
|
+
* - If `icon` is populated, the title is shown right below it.
|
|
38
|
+
* - If `icon` is not populated, the title will show across from the close button instead.
|
|
39
|
+
*/
|
|
40
|
+
title?: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const EducationalPopover = ({
|
|
44
|
+
icon: Icon,
|
|
45
|
+
isOpen: isOpenProp = true,
|
|
46
|
+
pages,
|
|
47
|
+
showCloseButton = false,
|
|
48
|
+
showStepCount = false,
|
|
49
|
+
title,
|
|
50
|
+
...tooltipProps
|
|
51
|
+
}: Props) => {
|
|
52
|
+
const [isOpen, setIsOpen] = useState(isOpenProp);
|
|
53
|
+
|
|
54
|
+
const [currentPage, setCurrentPage] = useState(0);
|
|
55
|
+
const pageCount = pages.length;
|
|
56
|
+
const hasMultiplePages = pageCount > 1;
|
|
57
|
+
const isOnLastPage = currentPage + 1 === pageCount;
|
|
58
|
+
|
|
59
|
+
const showTopRow = Icon || title || showCloseButton;
|
|
60
|
+
const showLowerTitleRow = Icon && title;
|
|
61
|
+
const showBottomRow = hasMultiplePages;
|
|
62
|
+
|
|
63
|
+
const pageContent = useMemo(() => pages[currentPage], [currentPage, pages]);
|
|
64
|
+
|
|
65
|
+
const onClose = useCallback(() => {
|
|
66
|
+
setIsOpen(false);
|
|
67
|
+
}, []);
|
|
68
|
+
|
|
69
|
+
const onClickNextButton: ComponentProps<typeof Button>['onClick'] = useCallback(() => {
|
|
70
|
+
// User pressed "Got It" and will close popover
|
|
71
|
+
if (isOnLastPage) {
|
|
72
|
+
onClose();
|
|
73
|
+
}
|
|
74
|
+
// User pressed "Next" and will go to next page
|
|
75
|
+
else {
|
|
76
|
+
setCurrentPage((currentPage) => currentPage + 1);
|
|
77
|
+
}
|
|
78
|
+
}, [isOnLastPage, onClose]);
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
setCurrentPage(0);
|
|
82
|
+
}, [isOpen, pages]);
|
|
83
|
+
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
setIsOpen(isOpenProp);
|
|
86
|
+
}, [isOpenProp]);
|
|
87
|
+
|
|
88
|
+
if (pages.length === 0) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<Tooltip
|
|
94
|
+
className="!rounded-none"
|
|
95
|
+
isOpen={isOpen}
|
|
96
|
+
style={{ minWidth: '314px' }}
|
|
97
|
+
{...tooltipProps}
|
|
98
|
+
clickable
|
|
99
|
+
globalCloseEvents={{
|
|
100
|
+
clickOutsideAnchor: true,
|
|
101
|
+
escape: true,
|
|
102
|
+
}}
|
|
103
|
+
setIsOpen={setIsOpen}
|
|
104
|
+
>
|
|
105
|
+
<section className="py-xs">
|
|
106
|
+
{/* icon / close button */}
|
|
107
|
+
{showTopRow && (
|
|
108
|
+
<div className="mb-xs flex items-center justify-between">
|
|
109
|
+
{/* if icon exists, place it across from close button */}
|
|
110
|
+
{Icon && <Icon color={tooltipProps.isInverse ? 'inverse' : 'primary'} />}
|
|
111
|
+
{/* if icon does not exist, title is across from close button*/}
|
|
112
|
+
{!Icon && title && <H5 color={tooltipProps.isInverse ? 'inverse' : 'primary'}>{title}</H5>}
|
|
113
|
+
|
|
114
|
+
{showCloseButton && (
|
|
115
|
+
<IconButton
|
|
116
|
+
icon={Close}
|
|
117
|
+
onClick={onClose}
|
|
118
|
+
style={tooltipProps.isInverse ? 'inverse' : 'neutral'}
|
|
119
|
+
/>
|
|
120
|
+
)}
|
|
121
|
+
</div>
|
|
122
|
+
)}
|
|
123
|
+
{/* title is under icon if icon exists */}
|
|
124
|
+
{showLowerTitleRow && (
|
|
125
|
+
<H5
|
|
126
|
+
className="mb-xs"
|
|
127
|
+
color={tooltipProps.isInverse ? 'inverse' : 'primary'}
|
|
128
|
+
>
|
|
129
|
+
{title}
|
|
130
|
+
</H5>
|
|
131
|
+
)}
|
|
132
|
+
{/* main educational info */}
|
|
133
|
+
{pageContent}
|
|
134
|
+
{/* bottom content */}
|
|
135
|
+
{showBottomRow && (
|
|
136
|
+
<div
|
|
137
|
+
className={cn('mt-sm flex items-center', {
|
|
138
|
+
'justify-between': showStepCount || !isOnLastPage,
|
|
139
|
+
'justify-end': !(showStepCount || !isOnLastPage),
|
|
140
|
+
})}
|
|
141
|
+
>
|
|
142
|
+
{showStepCount && (
|
|
143
|
+
<Caption
|
|
144
|
+
className="items-start"
|
|
145
|
+
color={tooltipProps.isInverse ? 'inverse' : 'primary'}
|
|
146
|
+
>
|
|
147
|
+
{currentPage + 1} of {pageCount}
|
|
148
|
+
</Caption>
|
|
149
|
+
)}
|
|
150
|
+
<div className="flex items-end gap-sm">
|
|
151
|
+
{!isOnLastPage && (
|
|
152
|
+
<Button
|
|
153
|
+
onClick={onClose}
|
|
154
|
+
size="sm"
|
|
155
|
+
style={tooltipProps.isInverse ? 'inverse' : 'primary'}
|
|
156
|
+
variant="transparent"
|
|
157
|
+
>
|
|
158
|
+
Skip
|
|
159
|
+
</Button>
|
|
160
|
+
)}
|
|
161
|
+
<Button
|
|
162
|
+
onClick={onClickNextButton}
|
|
163
|
+
size="sm"
|
|
164
|
+
style={tooltipProps.isInverse ? 'inverse' : 'primary'}
|
|
165
|
+
>
|
|
166
|
+
{isOnLastPage ? 'Got It' : 'Next'}
|
|
167
|
+
</Button>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
)}
|
|
171
|
+
</section>
|
|
172
|
+
</Tooltip>
|
|
173
|
+
);
|
|
174
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Tooltip } from '../Tooltip/Tooltip';
|
|
4
|
+
import { IconOnlyFavoriteButton } from './components/IconOnlyFavoriteButton/IconOnlyFavoriteButton';
|
|
5
|
+
import { LabeledAnimatedFavoriteButton } from './components/LabeledAnimatedFavoriteButton/LabeledAnimatedFavoriteButton';
|
|
6
|
+
import { LabeledFavoriteButton } from './components/LabeledFavoriteButton/LabeledFavoriteButton';
|
|
7
|
+
import { FavoriteButtonProps } from './types/favoriteButton';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A button that allows users to mark an item as a favorite.
|
|
11
|
+
* The button displays a heart icon that changes appearance when favorited.
|
|
12
|
+
*
|
|
13
|
+
* Be aware that if you're using the tooltip option, make sure to use a unique id
|
|
14
|
+
* and set the `anchorSelect` prop on the tooltip to the id of the button.
|
|
15
|
+
*
|
|
16
|
+
* Available in four variants:
|
|
17
|
+
* - `circle`: Shows only the heart icon in a circular button (default)
|
|
18
|
+
* - `square`: Shows only the heart icon in a square button
|
|
19
|
+
* - `labeled`: Shows a button with text and the heart icon
|
|
20
|
+
* - `labeled-animated`: Shows a labeled button with animation-ready wrappers
|
|
21
|
+
*/
|
|
22
|
+
export const FavoriteButton = forwardRef<HTMLButtonElement, FavoriteButtonProps>((props, ref) => {
|
|
23
|
+
const { isActivating, isWiggling, tooltipProps, variant = 'circle', ...restProps } = props;
|
|
24
|
+
const { enabled = false, ...tooltipRestProps } = tooltipProps ?? {};
|
|
25
|
+
|
|
26
|
+
// Use a mapping object to determine which component to render
|
|
27
|
+
const variantComponents = {
|
|
28
|
+
circle: (
|
|
29
|
+
<IconOnlyFavoriteButton
|
|
30
|
+
ref={ref}
|
|
31
|
+
shape="circle"
|
|
32
|
+
{...restProps}
|
|
33
|
+
/>
|
|
34
|
+
),
|
|
35
|
+
labeled: (
|
|
36
|
+
<LabeledFavoriteButton
|
|
37
|
+
ref={ref}
|
|
38
|
+
{...restProps}
|
|
39
|
+
/>
|
|
40
|
+
),
|
|
41
|
+
'labeled-animated': (
|
|
42
|
+
<LabeledAnimatedFavoriteButton
|
|
43
|
+
ref={ref}
|
|
44
|
+
isActivating={isActivating}
|
|
45
|
+
isWiggling={isWiggling}
|
|
46
|
+
{...restProps}
|
|
47
|
+
/>
|
|
48
|
+
),
|
|
49
|
+
square: (
|
|
50
|
+
<IconOnlyFavoriteButton
|
|
51
|
+
ref={ref}
|
|
52
|
+
shape="square"
|
|
53
|
+
{...restProps}
|
|
54
|
+
/>
|
|
55
|
+
),
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<>
|
|
60
|
+
{enabled && <Tooltip {...tooltipRestProps} />}
|
|
61
|
+
{variantComponents[variant]}
|
|
62
|
+
</>
|
|
63
|
+
);
|
|
64
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { cn } from '@evolve.ui/theme-system';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { HeartStraight } from '../../../Icons';
|
|
5
|
+
import { useFavoriteButtonState } from '../../hooks/useFavoriteButtonState';
|
|
6
|
+
import { IconOnlyFavoriteButtonProps } from '../../types/favoriteButton';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Icon-only variant of the FavoriteButton component
|
|
10
|
+
* Displays only a heart icon in either a circle or square shape
|
|
11
|
+
*/
|
|
12
|
+
export const IconOnlyFavoriteButton = forwardRef<HTMLButtonElement, IconOnlyFavoriteButtonProps>(
|
|
13
|
+
(
|
|
14
|
+
{
|
|
15
|
+
'aria-label': ariaLabel = 'Favorite Toggle',
|
|
16
|
+
className,
|
|
17
|
+
disabled,
|
|
18
|
+
favorited,
|
|
19
|
+
onClick,
|
|
20
|
+
shape,
|
|
21
|
+
type,
|
|
22
|
+
...restProps
|
|
23
|
+
},
|
|
24
|
+
ref
|
|
25
|
+
) => {
|
|
26
|
+
const { handleMouseDown, handleMouseLeave, handleMouseUp, isActive } = useFavoriteButtonState();
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<button
|
|
30
|
+
aria-label={ariaLabel}
|
|
31
|
+
aria-pressed={Boolean(favorited)}
|
|
32
|
+
className={cn(
|
|
33
|
+
// Base styles
|
|
34
|
+
'group flex h-[30px] w-[30px] cursor-pointer items-center justify-center border border-solid',
|
|
35
|
+
// Shape styles
|
|
36
|
+
{
|
|
37
|
+
'rounded-container': shape === 'square',
|
|
38
|
+
'rounded-full': shape === 'circle',
|
|
39
|
+
},
|
|
40
|
+
// Default state
|
|
41
|
+
'bg-background-primary text-surface-500',
|
|
42
|
+
// Selected state
|
|
43
|
+
{
|
|
44
|
+
'bg-background-primary text-critical-500': favorited,
|
|
45
|
+
},
|
|
46
|
+
// Focus state
|
|
47
|
+
// Atomic: the bare-focus outline suppression had to go in the same edit as the de-prefix.
|
|
48
|
+
// Prefixed,
|
|
49
|
+
// the ring was 0,3,0 and beat it; bare it is 0,2,0 and would lose (DS-98 Phase 0).
|
|
50
|
+
'hui-focus-visible-outline focus-visible:outline-offset-1',
|
|
51
|
+
// Active state - immediately show critical color when clicked
|
|
52
|
+
'active:text-border-critical-400 active:bg-critical-50',
|
|
53
|
+
// Hover state
|
|
54
|
+
'hover:bg-critical-50 hover:text-critical-400',
|
|
55
|
+
// Disabled state
|
|
56
|
+
'disabled:cursor-not-allowed disabled:bg-background-primary disabled:text-border-disabled',
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
data-hui-id="FavoriteButton"
|
|
60
|
+
disabled={disabled}
|
|
61
|
+
onClick={onClick}
|
|
62
|
+
onMouseDown={handleMouseDown}
|
|
63
|
+
onMouseLeave={handleMouseLeave}
|
|
64
|
+
onMouseUp={handleMouseUp}
|
|
65
|
+
ref={ref}
|
|
66
|
+
type={type as 'button' | 'submit' | 'reset' | undefined}
|
|
67
|
+
{...restProps}
|
|
68
|
+
>
|
|
69
|
+
<HeartStraight
|
|
70
|
+
className={cn(
|
|
71
|
+
'mt-[1px] bg-transparent text-current transition-transform duration-200 ease-in-out',
|
|
72
|
+
{
|
|
73
|
+
'group-hover:scale-[1.125]': !disabled,
|
|
74
|
+
}
|
|
75
|
+
)}
|
|
76
|
+
color="inherit"
|
|
77
|
+
size="sm"
|
|
78
|
+
style={favorited || isActive ? 'fill' : 'regular'}
|
|
79
|
+
/>
|
|
80
|
+
</button>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
);
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { cn } from '@evolve.ui/theme-system';
|
|
2
|
+
import { ButtonHTMLAttributes, CSSProperties, forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { outlinedCriticalClasses, outlinedNeutralClasses } from '../../../Button/buttonColorClasses';
|
|
5
|
+
import { HeartStraight } from '../../../Icons';
|
|
6
|
+
import { SaveConfetti, type SaveConfettiHandle } from '../../../SaveConfetti/SaveConfetti';
|
|
7
|
+
import { useFavoriteButtonState } from '../../hooks/useFavoriteButtonState';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Labeled-animated variant of the FavoriteButton component.
|
|
11
|
+
*
|
|
12
|
+
* Visually identical to the `labeled` variant but exposes `isWiggling` and
|
|
13
|
+
* `isActivating` props that trigger the enhanced save-button nudge animations:
|
|
14
|
+
*
|
|
15
|
+
* - `isWiggling`: side-to-side wiggle (button), 3D twirl + bloom (heart icon),
|
|
16
|
+
* color flash (critical fill pulse on heart when not favorited), and shimmer (label text).
|
|
17
|
+
* During nudge the heart uses `fill` weight with critical color; at rest unfavorited uses `bold`.
|
|
18
|
+
* Apply for ~650ms, then reset to false to re-arm.
|
|
19
|
+
*
|
|
20
|
+
* - `isActivating`: pulse (button) and heart pop (icon). Apply for ~500ms.
|
|
21
|
+
*
|
|
22
|
+
* Animation CSS is driven by Tailwind `animate-*` utilities from the theme plugin
|
|
23
|
+
* (`theme.extend.animation`) — no runtime style injection. The shimmer uses the
|
|
24
|
+
* `.hui-fb-shimmer` component class from the plugin for its multi-property CSS.
|
|
25
|
+
* The heart-color flash uses `.hui-fb-color-flash` to animate fill on the nested
|
|
26
|
+
* SVG path via a descendant selector. Icon weight: `bold` when unfavorited at rest,
|
|
27
|
+
* `fill` during nudge, favorited, or active press — matching the static `labeled` variant at rest.
|
|
28
|
+
*
|
|
29
|
+
* Reduced motion is gated once at the registry level
|
|
30
|
+
* (`theme-system/src/tailwind/reducedMotion.ts`), so these call sites deliberately carry no
|
|
31
|
+
* `motion-reduce:` variants — adding them back would reintroduce a second mechanism. The
|
|
32
|
+
* shimmer is the one exception: `.hui-fb-shimmer` also drops its gradient under reduce, because
|
|
33
|
+
* the label is painted *by* that gradient (`-webkit-text-fill-color: transparent`) and would
|
|
34
|
+
* otherwise be illegible.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
type Props = {
|
|
38
|
+
/** Accessible label for screen readers. @default 'Favorite Toggle' */
|
|
39
|
+
'aria-label'?: string;
|
|
40
|
+
/** Whether the item is currently favorited. */
|
|
41
|
+
favorited?: boolean;
|
|
42
|
+
/** Label text shown when favorited. @default 'Saved' */
|
|
43
|
+
favoritedLabel?: string;
|
|
44
|
+
/**
|
|
45
|
+
* When true, fires the save-click animation (button pulse + heart pop) and
|
|
46
|
+
* a mini confetti burst from the button center.
|
|
47
|
+
* Reset to false after ~500ms to re-arm.
|
|
48
|
+
*/
|
|
49
|
+
isActivating?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* When true, fires the nudge animation (wiggle + twirl + shimmer + color flash).
|
|
52
|
+
* Reset to false after ~650ms to re-arm.
|
|
53
|
+
*/
|
|
54
|
+
isWiggling?: boolean;
|
|
55
|
+
/** Label text shown when not favorited. @default 'Save' */
|
|
56
|
+
label?: string;
|
|
57
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'style'>;
|
|
58
|
+
|
|
59
|
+
type AnimationPaletteCSSVar =
|
|
60
|
+
| '--hui-save-color-critical-500'
|
|
61
|
+
| '--hui-save-color-critical-300'
|
|
62
|
+
| '--hui-save-color-critical-200'
|
|
63
|
+
| '--hui-save-color-tertiary-400'
|
|
64
|
+
| '--hui-save-color-tertiary-200';
|
|
65
|
+
|
|
66
|
+
const BUTTON_INLINE_STYLES: CSSProperties & Record<AnimationPaletteCSSVar, string> = {
|
|
67
|
+
fontSize: 'var(--font-size-button-200)',
|
|
68
|
+
fontWeight: 'var(--font-weight-button)',
|
|
69
|
+
textTransform: 'var(--text-transform-button)' as CSSProperties['textTransform'],
|
|
70
|
+
// Expose canonical animation palette tokens for downstream orchestration.
|
|
71
|
+
'--hui-save-color-critical-500': 'var(--color-critical-500)',
|
|
72
|
+
'--hui-save-color-critical-300': 'var(--color-critical-300)',
|
|
73
|
+
'--hui-save-color-critical-200': 'var(--color-critical-200)',
|
|
74
|
+
'--hui-save-color-tertiary-400': 'var(--color-tertiary-400)',
|
|
75
|
+
'--hui-save-color-tertiary-200': 'var(--color-tertiary-200)',
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const LabeledAnimatedFavoriteButton = forwardRef<HTMLButtonElement, Props>(
|
|
79
|
+
(
|
|
80
|
+
{
|
|
81
|
+
'aria-label': ariaLabel = 'Favorite Toggle',
|
|
82
|
+
className,
|
|
83
|
+
disabled,
|
|
84
|
+
favorited,
|
|
85
|
+
favoritedLabel = 'Saved',
|
|
86
|
+
isActivating,
|
|
87
|
+
isWiggling,
|
|
88
|
+
label = 'Save',
|
|
89
|
+
onClick,
|
|
90
|
+
...restProps
|
|
91
|
+
},
|
|
92
|
+
ref
|
|
93
|
+
) => {
|
|
94
|
+
const { handleMouseDown, handleMouseLeave, handleMouseUp, isActive } = useFavoriteButtonState();
|
|
95
|
+
|
|
96
|
+
const internalButtonRef = useRef<HTMLButtonElement>(null);
|
|
97
|
+
const confettiRef = useRef<SaveConfettiHandle>(null);
|
|
98
|
+
|
|
99
|
+
// Preserve consumer-facing ref contract while keeping internal button access for confetti
|
|
100
|
+
useImperativeHandle(ref, () => internalButtonRef.current!);
|
|
101
|
+
|
|
102
|
+
// Fire confetti burst when the save-click animation triggers
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
if (!isActivating || !internalButtonRef.current) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
confettiRef.current?.fire(internalButtonRef.current);
|
|
108
|
+
}, [isActivating]);
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<>
|
|
112
|
+
<button
|
|
113
|
+
aria-busy={false}
|
|
114
|
+
aria-label={ariaLabel}
|
|
115
|
+
aria-live="polite"
|
|
116
|
+
aria-pressed={favorited ?? false}
|
|
117
|
+
className={cn(
|
|
118
|
+
// Base — exact match to Button's base class string
|
|
119
|
+
'hui-focus-visible-outline relative flex max-w-full items-center justify-center whitespace-nowrap rounded-button text-center font-primary tracking-[var(--letter-spacing-button)] outline outline-1 -outline-offset-1 transition-colors disabled:text-text-disabled',
|
|
120
|
+
// Color classes — same conditional used by LabeledFavoriteButton
|
|
121
|
+
favorited ? outlinedCriticalClasses : outlinedNeutralClasses,
|
|
122
|
+
// sm size
|
|
123
|
+
'gap-[4px] px-sm py-[13px] leading-[8px]',
|
|
124
|
+
// Height override (matches LabeledFavoriteButton)
|
|
125
|
+
'h-[34px]',
|
|
126
|
+
// Favorited state border
|
|
127
|
+
{ 'border-critical-500 text-critical-500': favorited },
|
|
128
|
+
// Hover/active overrides — same className passed by LabeledFavoriteButton to Button
|
|
129
|
+
'hover:border-critical-700 hover:bg-critical-50 hover:text-critical-700',
|
|
130
|
+
'active:border-critical-900 active:bg-critical-100 active:text-critical-900',
|
|
131
|
+
// Nudge animation — wiggle on button root + color flash on nested SVG path
|
|
132
|
+
isWiggling && 'animate-saveButtonWiggle',
|
|
133
|
+
isWiggling && !favorited && 'hui-fb-color-flash',
|
|
134
|
+
// Save-click animation — pulse on button root
|
|
135
|
+
isActivating && 'animate-saveButtonPulse',
|
|
136
|
+
className
|
|
137
|
+
)}
|
|
138
|
+
data-hui-id="FavoriteButton"
|
|
139
|
+
disabled={disabled}
|
|
140
|
+
onClick={onClick}
|
|
141
|
+
onMouseDown={handleMouseDown}
|
|
142
|
+
onMouseLeave={handleMouseLeave}
|
|
143
|
+
onMouseUp={handleMouseUp}
|
|
144
|
+
ref={internalButtonRef}
|
|
145
|
+
style={BUTTON_INLINE_STYLES}
|
|
146
|
+
{...restProps}
|
|
147
|
+
>
|
|
148
|
+
{/*
|
|
149
|
+
* Perspective wrapper — 3D twirl animation targets this element.
|
|
150
|
+
* Width/height matches Button's internal iconLeft container (14px for xs icon).
|
|
151
|
+
*/}
|
|
152
|
+
<span
|
|
153
|
+
className={cn(
|
|
154
|
+
'hui-fb-icon-frame relative flex items-center justify-center',
|
|
155
|
+
// Critical color during nudge so fill weight reads red immediately (not surface-500 grey)
|
|
156
|
+
isWiggling && !favorited && 'text-critical-500',
|
|
157
|
+
// Nudge animation — 3D twirl + bloom on icon frame
|
|
158
|
+
isWiggling && 'animate-saveHeartTwirlBloom'
|
|
159
|
+
)}
|
|
160
|
+
style={{ height: '14px', perspective: '200px', width: '14px' }}
|
|
161
|
+
>
|
|
162
|
+
<HeartStraight
|
|
163
|
+
className={cn(
|
|
164
|
+
'[transform-style:preserve-3d]',
|
|
165
|
+
// Save-click animation — heart pop on SVG element
|
|
166
|
+
isActivating && 'animate-saveHeartPop'
|
|
167
|
+
)}
|
|
168
|
+
color="inherit"
|
|
169
|
+
size="xs"
|
|
170
|
+
style={favorited || isActive || isWiggling ? 'fill' : 'bold'}
|
|
171
|
+
/>
|
|
172
|
+
</span>
|
|
173
|
+
{/* Shimmer wrapper — .hui-fb-shimmer bundles background-clip + gradient + animation */}
|
|
174
|
+
<span
|
|
175
|
+
className={cn('hui-fb-animated-label', isWiggling && 'hui-fb-shimmer animate-saveLabelShimmer')}
|
|
176
|
+
>
|
|
177
|
+
{favorited ? favoritedLabel : label}
|
|
178
|
+
</span>
|
|
179
|
+
</button>
|
|
180
|
+
<SaveConfetti ref={confettiRef} />
|
|
181
|
+
</>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
LabeledAnimatedFavoriteButton.displayName = 'LabeledAnimatedFavoriteButton';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { cn } from '@evolve.ui/theme-system';
|
|
2
|
+
import { ButtonHTMLAttributes, forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Button } from '../../../Button/Button';
|
|
5
|
+
import { useFavoriteButtonState } from '../../hooks/useFavoriteButtonState';
|
|
6
|
+
import { SmallHeartStraightIcon } from '../SmallHeartStraightIcon/SmallHeartStraightIcon';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Labeled variant of the FavoriteButton component
|
|
10
|
+
* Displays a button with text and a heart icon
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
type Props = {
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
favorited?: boolean;
|
|
16
|
+
favoritedLabel?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'style' | 'children'>;
|
|
19
|
+
|
|
20
|
+
export const LabeledFavoriteButton = forwardRef<HTMLButtonElement, Props>(
|
|
21
|
+
(
|
|
22
|
+
{
|
|
23
|
+
'aria-label': ariaLabel = 'Favorite Toggle',
|
|
24
|
+
className,
|
|
25
|
+
disabled,
|
|
26
|
+
favorited,
|
|
27
|
+
favoritedLabel = 'Saved',
|
|
28
|
+
label = 'Save',
|
|
29
|
+
onClick,
|
|
30
|
+
...restProps
|
|
31
|
+
},
|
|
32
|
+
ref
|
|
33
|
+
) => {
|
|
34
|
+
const { handleMouseDown, handleMouseLeave, handleMouseUp, isActive } = useFavoriteButtonState();
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Button
|
|
38
|
+
aria-label={ariaLabel}
|
|
39
|
+
aria-pressed={favorited ? true : false}
|
|
40
|
+
className={cn(
|
|
41
|
+
// Base styles
|
|
42
|
+
'h-[34px] text-surface-500',
|
|
43
|
+
// Selected state
|
|
44
|
+
{
|
|
45
|
+
'border-critical-500 text-critical-500': favorited,
|
|
46
|
+
},
|
|
47
|
+
// Hover state - same for both favorited and non-favorited
|
|
48
|
+
'hover:border-critical-700 hover:bg-critical-50 hover:text-critical-700',
|
|
49
|
+
// Active states - different for favorited and non-favorited
|
|
50
|
+
'active:border-critical-900 active:bg-critical-100 active:text-critical-900',
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
data-hui-id="FavoriteButton"
|
|
54
|
+
disabled={disabled}
|
|
55
|
+
iconLeft={SmallHeartStraightIcon}
|
|
56
|
+
iconStyle={favorited || isActive ? 'fill' : 'bold'}
|
|
57
|
+
onClick={onClick}
|
|
58
|
+
onMouseDown={handleMouseDown}
|
|
59
|
+
onMouseLeave={handleMouseLeave}
|
|
60
|
+
onMouseUp={handleMouseUp}
|
|
61
|
+
ref={ref}
|
|
62
|
+
size="sm"
|
|
63
|
+
style={favorited ? 'critical' : 'neutral'}
|
|
64
|
+
variant="outlined"
|
|
65
|
+
{...restProps}
|
|
66
|
+
>
|
|
67
|
+
{favorited ? favoritedLabel : label}
|
|
68
|
+
</Button>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps, forwardRef } from 'react';
|
|
2
|
+
|
|
3
|
+
import { CaretRight, HeartStraight } from '../../../Icons';
|
|
4
|
+
|
|
5
|
+
export const SmallHeartStraightIcon = forwardRef<SVGSVGElement, ComponentProps<typeof CaretRight>>((props, ref) => {
|
|
6
|
+
return (
|
|
7
|
+
<HeartStraight
|
|
8
|
+
style="bold"
|
|
9
|
+
{...props}
|
|
10
|
+
ref={ref}
|
|
11
|
+
size="xs"
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Custom hook for managing the active state of the FavoriteButton
|
|
5
|
+
* @returns Object containing the active state and event handlers
|
|
6
|
+
*/
|
|
7
|
+
export const useFavoriteButtonState = () => {
|
|
8
|
+
const [isActive, setIsActive] = useState(false);
|
|
9
|
+
|
|
10
|
+
const handleMouseDown = () => {
|
|
11
|
+
setIsActive(true);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const handleMouseUp = () => {
|
|
15
|
+
setIsActive(false);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const handleMouseLeave = () => {
|
|
19
|
+
if (isActive) {
|
|
20
|
+
setIsActive(false);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
handleMouseDown,
|
|
26
|
+
handleMouseLeave,
|
|
27
|
+
handleMouseUp,
|
|
28
|
+
isActive,
|
|
29
|
+
};
|
|
30
|
+
};
|