@coinbase/cds-common 0.0.0 → 8.13.1
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/README.md +3 -0
- package/dts/accordion/AccordionProvider.d.ts +24 -0
- package/dts/accordion/AccordionProvider.d.ts.map +1 -0
- package/dts/accordion/__tests__/AccordionProvider.test.d.ts +2 -0
- package/dts/accordion/__tests__/AccordionProvider.test.d.ts.map +1 -0
- package/dts/animation/accordion.d.ts +4 -0
- package/dts/animation/accordion.d.ts.map +1 -0
- package/dts/animation/border.d.ts +4 -0
- package/dts/animation/border.d.ts.map +1 -0
- package/dts/animation/carousel.d.ts +8 -0
- package/dts/animation/carousel.d.ts.map +1 -0
- package/dts/animation/collapsible.d.ts +15 -0
- package/dts/animation/collapsible.d.ts.map +1 -0
- package/dts/animation/dot.d.ts +6 -0
- package/dts/animation/dot.d.ts.map +1 -0
- package/dts/animation/drawer.d.ts +20 -0
- package/dts/animation/drawer.d.ts.map +1 -0
- package/dts/animation/dropdown.d.ts +27 -0
- package/dts/animation/dropdown.d.ts.map +1 -0
- package/dts/animation/fullscreenModal.d.ts +12 -0
- package/dts/animation/fullscreenModal.d.ts.map +1 -0
- package/dts/animation/likeButton.d.ts +6 -0
- package/dts/animation/likeButton.d.ts.map +1 -0
- package/dts/animation/menu.d.ts +29 -0
- package/dts/animation/menu.d.ts.map +1 -0
- package/dts/animation/modal.d.ts +10 -0
- package/dts/animation/modal.d.ts.map +1 -0
- package/dts/animation/overlay.d.ts +6 -0
- package/dts/animation/overlay.d.ts.map +1 -0
- package/dts/animation/paddle.d.ts +7 -0
- package/dts/animation/paddle.d.ts.map +1 -0
- package/dts/animation/progress.d.ts +3 -0
- package/dts/animation/progress.d.ts.map +1 -0
- package/dts/animation/rotate.d.ts +3 -0
- package/dts/animation/rotate.d.ts.map +1 -0
- package/dts/animation/select.d.ts +4 -0
- package/dts/animation/select.d.ts.map +1 -0
- package/dts/animation/sparkline.d.ts +7 -0
- package/dts/animation/sparkline.d.ts.map +1 -0
- package/dts/animation/tabs.d.ts +5 -0
- package/dts/animation/tabs.d.ts.map +1 -0
- package/dts/animation/toast.d.ts +12 -0
- package/dts/animation/toast.d.ts.map +1 -0
- package/dts/animation/tooltip.d.ts +18 -0
- package/dts/animation/tooltip.d.ts.map +1 -0
- package/dts/cards/getCardBodySpacingProps.d.ts +5 -0
- package/dts/cards/getCardBodySpacingProps.d.ts.map +1 -0
- package/dts/color/__tests__/blendColors.test.d.ts +2 -0
- package/dts/color/__tests__/blendColors.test.d.ts.map +1 -0
- package/dts/color/__tests__/isLightOrDarkColor.test.d.ts +2 -0
- package/dts/color/__tests__/isLightOrDarkColor.test.d.ts.map +1 -0
- package/dts/color/__tests__/overrideAlpha.test.d.ts +2 -0
- package/dts/color/__tests__/overrideAlpha.test.d.ts.map +1 -0
- package/dts/color/blendColors.d.ts +21 -0
- package/dts/color/blendColors.d.ts.map +1 -0
- package/dts/color/colorToHex.d.ts +7 -0
- package/dts/color/colorToHex.d.ts.map +1 -0
- package/dts/color/darkenColor.d.ts +2 -0
- package/dts/color/darkenColor.d.ts.map +1 -0
- package/dts/color/getAccessibleForegroundGradient.d.ts +13 -0
- package/dts/color/getAccessibleForegroundGradient.d.ts.map +1 -0
- package/dts/color/getBlendedColor.d.ts +114 -0
- package/dts/color/getBlendedColor.d.ts.map +1 -0
- package/dts/color/getContrastRatio.d.ts +6 -0
- package/dts/color/getContrastRatio.d.ts.map +1 -0
- package/dts/color/getLuminance.d.ts +13 -0
- package/dts/color/getLuminance.d.ts.map +1 -0
- package/dts/color/isAccessibleColor.d.ts +18 -0
- package/dts/color/isAccessibleColor.d.ts.map +1 -0
- package/dts/color/isLightOrDarkColor.d.ts +2 -0
- package/dts/color/isLightOrDarkColor.d.ts.map +1 -0
- package/dts/color/overrideAlpha.d.ts +8 -0
- package/dts/color/overrideAlpha.d.ts.map +1 -0
- package/dts/core/theme.d.ts +286 -0
- package/dts/core/theme.d.ts.map +1 -0
- package/dts/dates/DateInputValidationError.d.ts +6 -0
- package/dts/dates/DateInputValidationError.d.ts.map +1 -0
- package/dts/dates/IntlDateFormat.d.ts +45 -0
- package/dts/dates/IntlDateFormat.d.ts.map +1 -0
- package/dts/dates/__tests__/IntlDateFormat.test.d.ts +2 -0
- package/dts/dates/__tests__/IntlDateFormat.test.d.ts.map +1 -0
- package/dts/dates/__tests__/useDateInput.test.d.ts +2 -0
- package/dts/dates/__tests__/useDateInput.test.d.ts.map +1 -0
- package/dts/dates/generateCalendarMonth.d.ts +5 -0
- package/dts/dates/generateCalendarMonth.d.ts.map +1 -0
- package/dts/dates/getISOStringLocal.d.ts +5 -0
- package/dts/dates/getISOStringLocal.d.ts.map +1 -0
- package/dts/dates/getMidnightDate.d.ts +5 -0
- package/dts/dates/getMidnightDate.d.ts.map +1 -0
- package/dts/dates/getTimesFromDatesAndRanges.d.ts +5 -0
- package/dts/dates/getTimesFromDatesAndRanges.d.ts.map +1 -0
- package/dts/dates/useDateInput.d.ts +23 -0
- package/dts/dates/useDateInput.d.ts.map +1 -0
- package/dts/dates/useDateInputValidation.d.ts +46 -0
- package/dts/dates/useDateInputValidation.d.ts.map +1 -0
- package/dts/hooks/__tests__/useFallbackShape.test.d.ts +2 -0
- package/dts/hooks/__tests__/useFallbackShape.test.d.ts.map +1 -0
- package/dts/hooks/__tests__/usePrefixedId.test.d.ts +2 -0
- package/dts/hooks/__tests__/usePrefixedId.test.d.ts.map +1 -0
- package/dts/hooks/__tests__/usePreviousValue.test.d.ts +2 -0
- package/dts/hooks/__tests__/usePreviousValue.test.d.ts.map +1 -0
- package/dts/hooks/__tests__/useRefMap.test.d.ts +2 -0
- package/dts/hooks/__tests__/useRefMap.test.d.ts.map +1 -0
- package/dts/hooks/__tests__/useSort.test.d.ts +2 -0
- package/dts/hooks/__tests__/useSort.test.d.ts.map +1 -0
- package/dts/hooks/__tests__/useTimer.test.d.ts +2 -0
- package/dts/hooks/__tests__/useTimer.test.d.ts.map +1 -0
- package/dts/hooks/useEventHandler.d.ts +3 -0
- package/dts/hooks/useEventHandler.d.ts.map +1 -0
- package/dts/hooks/useFallbackShape.d.ts +10 -0
- package/dts/hooks/useFallbackShape.d.ts.map +1 -0
- package/dts/hooks/useGroupToggler.d.ts +23 -0
- package/dts/hooks/useGroupToggler.d.ts.map +1 -0
- package/dts/hooks/useHasMounted.d.ts +2 -0
- package/dts/hooks/useHasMounted.d.ts.map +1 -0
- package/dts/hooks/useIndexCounter.d.ts +18 -0
- package/dts/hooks/useIndexCounter.d.ts.map +1 -0
- package/dts/hooks/useInputVariant.d.ts +3 -0
- package/dts/hooks/useInputVariant.d.ts.map +1 -0
- package/dts/hooks/useLogo.d.ts +26 -0
- package/dts/hooks/useLogo.d.ts.map +1 -0
- package/dts/hooks/useMergeRefs.d.ts +2 -0
- package/dts/hooks/useMergeRefs.d.ts.map +1 -0
- package/dts/hooks/usePrefixedId.d.ts +12 -0
- package/dts/hooks/usePrefixedId.d.ts.map +1 -0
- package/dts/hooks/usePreviousValue.d.ts +2 -0
- package/dts/hooks/usePreviousValue.d.ts.map +1 -0
- package/dts/hooks/usePreviousValues.d.ts +5 -0
- package/dts/hooks/usePreviousValues.d.ts.map +1 -0
- package/dts/hooks/useRefMap.d.ts +13 -0
- package/dts/hooks/useRefMap.d.ts.map +1 -0
- package/dts/hooks/useSort.d.ts +19 -0
- package/dts/hooks/useSort.d.ts.map +1 -0
- package/dts/hooks/useSubBrandLogo.d.ts +62 -0
- package/dts/hooks/useSubBrandLogo.d.ts.map +1 -0
- package/dts/hooks/useTimer.d.ts +7 -0
- package/dts/hooks/useTimer.d.ts.map +1 -0
- package/dts/hooks/useToggler.d.ts +10 -0
- package/dts/hooks/useToggler.d.ts.map +1 -0
- package/dts/hooks/useValueChanges.d.ts +8 -0
- package/dts/hooks/useValueChanges.d.ts.map +1 -0
- package/dts/index.d.ts +8 -0
- package/dts/index.d.ts.map +1 -0
- package/dts/internal/data/accounts.d.ts +359 -0
- package/dts/internal/data/accounts.d.ts.map +1 -0
- package/dts/internal/data/announcementCards.d.ts +10 -0
- package/dts/internal/data/announcementCards.d.ts.map +1 -0
- package/dts/internal/data/asset.d.ts +171 -0
- package/dts/internal/data/asset.d.ts.map +1 -0
- package/dts/internal/data/assets.d.ts +78 -0
- package/dts/internal/data/assets.d.ts.map +1 -0
- package/dts/internal/data/avatars.d.ts +3 -0
- package/dts/internal/data/avatars.d.ts.map +1 -0
- package/dts/internal/data/dataCards.d.ts +23 -0
- package/dts/internal/data/dataCards.d.ts.map +1 -0
- package/dts/internal/data/featureEntryCards.d.ts +17 -0
- package/dts/internal/data/featureEntryCards.d.ts.map +1 -0
- package/dts/internal/data/feedImages.d.ts +2 -0
- package/dts/internal/data/feedImages.d.ts.map +1 -0
- package/dts/internal/data/iconData.d.ts +2 -0
- package/dts/internal/data/iconData.d.ts.map +1 -0
- package/dts/internal/data/loremIpsum.d.ts +2 -0
- package/dts/internal/data/loremIpsum.d.ts.map +1 -0
- package/dts/internal/data/navigation.d.ts +7 -0
- package/dts/internal/data/navigation.d.ts.map +1 -0
- package/dts/internal/data/prices.d.ts +7 -0
- package/dts/internal/data/prices.d.ts.map +1 -0
- package/dts/internal/data/product.d.ts +25 -0
- package/dts/internal/data/product.d.ts.map +1 -0
- package/dts/internal/data/tabs.d.ts +15 -0
- package/dts/internal/data/tabs.d.ts.map +1 -0
- package/dts/internal/data/users.d.ts +10 -0
- package/dts/internal/data/users.d.ts.map +1 -0
- package/dts/internal/utils/storyBuilder.d.ts +113 -0
- package/dts/internal/utils/storyBuilder.d.ts.map +1 -0
- package/dts/internal/visualizations/SparklineInteractiveData.d.ts +13 -0
- package/dts/internal/visualizations/SparklineInteractiveData.d.ts.map +1 -0
- package/dts/jest/timeTravel.d.ts +15 -0
- package/dts/jest/timeTravel.d.ts.map +1 -0
- package/dts/lottie/lottieUtils.d.ts +11 -0
- package/dts/lottie/lottieUtils.d.ts.map +1 -0
- package/dts/lottie/lottieUtils.test.d.ts +2 -0
- package/dts/lottie/lottieUtils.test.d.ts.map +1 -0
- package/dts/lottie/useStatusAnimationPoller.d.ts +12 -0
- package/dts/lottie/useStatusAnimationPoller.d.ts.map +1 -0
- package/dts/media/getAvatarFallbackColor.d.ts +7 -0
- package/dts/media/getAvatarFallbackColor.d.ts.map +1 -0
- package/dts/media/remoteImageFallbackSrc.d.ts +6 -0
- package/dts/media/remoteImageFallbackSrc.d.ts.map +1 -0
- package/dts/motion/animatedCaret.d.ts +3 -0
- package/dts/motion/animatedCaret.d.ts.map +1 -0
- package/dts/motion/checkbox.d.ts +81 -0
- package/dts/motion/checkbox.d.ts.map +1 -0
- package/dts/motion/dot.d.ts +81 -0
- package/dts/motion/dot.d.ts.map +1 -0
- package/dts/motion/hint.d.ts +48 -0
- package/dts/motion/hint.d.ts.map +1 -0
- package/dts/motion/switch.d.ts +7 -0
- package/dts/motion/switch.d.ts.map +1 -0
- package/dts/motion/tokens.d.ts +422 -0
- package/dts/motion/tokens.d.ts.map +1 -0
- package/dts/motion/utils.d.ts +15 -0
- package/dts/motion/utils.d.ts.map +1 -0
- package/dts/numbers/IntlNumberFormat.d.ts +131 -0
- package/dts/numbers/IntlNumberFormat.d.ts.map +1 -0
- package/dts/numbers/__tests__/formatToParts.test.d.ts +2 -0
- package/dts/numbers/__tests__/formatToParts.test.d.ts.map +1 -0
- package/dts/numbers/__tests__/subscript.test.d.ts +2 -0
- package/dts/numbers/__tests__/subscript.test.d.ts.map +1 -0
- package/dts/numbers/subscript.d.ts +7 -0
- package/dts/numbers/subscript.d.ts.map +1 -0
- package/dts/overlays/ModalContext.d.ts +25 -0
- package/dts/overlays/ModalContext.d.ts.map +1 -0
- package/dts/overlays/OverlayContentContext.d.ts +13 -0
- package/dts/overlays/OverlayContentContext.d.ts.map +1 -0
- package/dts/overlays/PortalContext.d.ts +8 -0
- package/dts/overlays/PortalContext.d.ts.map +1 -0
- package/dts/overlays/ToastProvider.d.ts +73 -0
- package/dts/overlays/ToastProvider.d.ts.map +1 -0
- package/dts/overlays/__tests__/useOverlay.test.d.ts +2 -0
- package/dts/overlays/__tests__/useOverlay.test.d.ts.map +1 -0
- package/dts/overlays/__tests__/useToastQueue.test.d.ts +2 -0
- package/dts/overlays/__tests__/useToastQueue.test.d.ts.map +1 -0
- package/dts/overlays/useAlert.d.ts +8 -0
- package/dts/overlays/useAlert.d.ts.map +1 -0
- package/dts/overlays/useModal.d.ts +8 -0
- package/dts/overlays/useModal.d.ts.map +1 -0
- package/dts/overlays/useOverlay.d.ts +6 -0
- package/dts/overlays/useOverlay.d.ts.map +1 -0
- package/dts/overlays/usePortal.d.ts +2 -0
- package/dts/overlays/usePortal.d.ts.map +1 -0
- package/dts/overlays/usePortalState.d.ts +24 -0
- package/dts/overlays/usePortalState.d.ts.map +1 -0
- package/dts/overlays/useToastQueue.d.ts +11 -0
- package/dts/overlays/useToastQueue.d.ts.map +1 -0
- package/dts/stepper/__tests__/useStepper.test.d.ts +2 -0
- package/dts/stepper/__tests__/useStepper.test.d.ts.map +1 -0
- package/dts/stepper/__tests__/utils.test.d.ts +2 -0
- package/dts/stepper/__tests__/utils.test.d.ts.map +1 -0
- package/dts/stepper/useStepper.d.ts +41 -0
- package/dts/stepper/useStepper.d.ts.map +1 -0
- package/dts/stepper/utils.d.ts +22 -0
- package/dts/stepper/utils.d.ts.map +1 -0
- package/dts/system/EventHandlerProvider.d.ts +31 -0
- package/dts/system/EventHandlerProvider.d.ts.map +1 -0
- package/dts/system/LocaleProvider.d.ts +12 -0
- package/dts/system/LocaleProvider.d.ts.map +1 -0
- package/dts/system/RefMapContext.d.ts +10 -0
- package/dts/system/RefMapContext.d.ts.map +1 -0
- package/dts/system/__tests__/EventHandlerProvider.test.d.ts +2 -0
- package/dts/system/__tests__/EventHandlerProvider.test.d.ts.map +1 -0
- package/dts/tabs/TabsContext.d.ts +5 -0
- package/dts/tabs/TabsContext.d.ts.map +1 -0
- package/dts/tabs/__tests__/TabsContext.test.d.ts +2 -0
- package/dts/tabs/__tests__/TabsContext.test.d.ts.map +1 -0
- package/dts/tabs/__tests__/useTabs.test.d.ts +2 -0
- package/dts/tabs/__tests__/useTabs.test.d.ts.map +1 -0
- package/dts/tabs/useTabs.d.ts +29 -0
- package/dts/tabs/useTabs.d.ts.map +1 -0
- package/dts/tokens/accordion.d.ts +7 -0
- package/dts/tokens/accordion.d.ts.map +1 -0
- package/dts/tokens/appSwitcher.d.ts +4 -0
- package/dts/tokens/appSwitcher.d.ts.map +1 -0
- package/dts/tokens/avatar.d.ts +14 -0
- package/dts/tokens/avatar.d.ts.map +1 -0
- package/dts/tokens/banner.d.ts +15 -0
- package/dts/tokens/banner.d.ts.map +1 -0
- package/dts/tokens/borderRadius.d.ts +3 -0
- package/dts/tokens/borderRadius.d.ts.map +1 -0
- package/dts/tokens/button.d.ts +65 -0
- package/dts/tokens/button.d.ts.map +1 -0
- package/dts/tokens/card.d.ts +29 -0
- package/dts/tokens/card.d.ts.map +1 -0
- package/dts/tokens/cell.d.ts +27 -0
- package/dts/tokens/cell.d.ts.map +1 -0
- package/dts/tokens/chip.d.ts +2 -0
- package/dts/tokens/chip.d.ts.map +1 -0
- package/dts/tokens/dot.d.ts +12 -0
- package/dts/tokens/dot.d.ts.map +1 -0
- package/dts/tokens/drawer.d.ts +12 -0
- package/dts/tokens/drawer.d.ts.map +1 -0
- package/dts/tokens/illustrations.d.ts +28 -0
- package/dts/tokens/illustrations.d.ts.map +1 -0
- package/dts/tokens/input.d.ts +6 -0
- package/dts/tokens/input.d.ts.map +1 -0
- package/dts/tokens/interactable.d.ts +5 -0
- package/dts/tokens/interactable.d.ts.map +1 -0
- package/dts/tokens/interactableHeight.d.ts +5 -0
- package/dts/tokens/interactableHeight.d.ts.map +1 -0
- package/dts/tokens/menu.d.ts +3 -0
- package/dts/tokens/menu.d.ts.map +1 -0
- package/dts/tokens/multiContentModule.d.ts +2 -0
- package/dts/tokens/multiContentModule.d.ts.map +1 -0
- package/dts/tokens/navigation.d.ts +2 -0
- package/dts/tokens/navigation.d.ts.map +1 -0
- package/dts/tokens/overlays.d.ts +2 -0
- package/dts/tokens/overlays.d.ts.map +1 -0
- package/dts/tokens/page.d.ts +3 -0
- package/dts/tokens/page.d.ts.map +1 -0
- package/dts/tokens/select.d.ts +7 -0
- package/dts/tokens/select.d.ts.map +1 -0
- package/dts/tokens/sidebar.d.ts +3 -0
- package/dts/tokens/sidebar.d.ts.map +1 -0
- package/dts/tokens/sizing.d.ts +3 -0
- package/dts/tokens/sizing.d.ts.map +1 -0
- package/dts/tokens/sparkline.d.ts +11 -0
- package/dts/tokens/sparkline.d.ts.map +1 -0
- package/dts/tokens/tags.d.ts +12 -0
- package/dts/tokens/tags.d.ts.map +1 -0
- package/dts/tokens/tile.d.ts +4 -0
- package/dts/tokens/tile.d.ts.map +1 -0
- package/dts/tokens/toast.d.ts +5 -0
- package/dts/tokens/toast.d.ts.map +1 -0
- package/dts/tokens/tooltip.d.ts +4 -0
- package/dts/tokens/tooltip.d.ts.map +1 -0
- package/dts/tokens/zIndex.d.ts +14 -0
- package/dts/tokens/zIndex.d.ts.map +1 -0
- package/dts/tour/TourContext.d.ts +6 -0
- package/dts/tour/TourContext.d.ts.map +1 -0
- package/dts/tour/__tests__/TourContext.test.d.ts +2 -0
- package/dts/tour/__tests__/TourContext.test.d.ts.map +1 -0
- package/dts/tour/__tests__/useTour.test.d.ts +2 -0
- package/dts/tour/__tests__/useTour.test.d.ts.map +1 -0
- package/dts/tour/useTour.d.ts +98 -0
- package/dts/tour/useTour.d.ts.map +1 -0
- package/dts/types/AvatarBaseProps.d.ts +6 -0
- package/dts/types/AvatarBaseProps.d.ts.map +1 -0
- package/dts/types/AvatarSize.d.ts +2 -0
- package/dts/types/AvatarSize.d.ts.map +1 -0
- package/dts/types/BannerBaseProps.d.ts +3 -0
- package/dts/types/BannerBaseProps.d.ts.map +1 -0
- package/dts/types/BoxBaseProps.d.ts +62 -0
- package/dts/types/BoxBaseProps.d.ts.map +1 -0
- package/dts/types/ButtonBaseProps.d.ts +2 -0
- package/dts/types/ButtonBaseProps.d.ts.map +1 -0
- package/dts/types/CardHeaderProps.d.ts +12 -0
- package/dts/types/CardHeaderProps.d.ts.map +1 -0
- package/dts/types/CardMediaProps.d.ts +27 -0
- package/dts/types/CardMediaProps.d.ts.map +1 -0
- package/dts/types/CardRemoteImageProps.d.ts +18 -0
- package/dts/types/CardRemoteImageProps.d.ts.map +1 -0
- package/dts/types/CdsPlatform.d.ts +2 -0
- package/dts/types/CdsPlatform.d.ts.map +1 -0
- package/dts/types/CellBaseProps.d.ts +8 -0
- package/dts/types/CellBaseProps.d.ts.map +1 -0
- package/dts/types/Chart.d.ts +27 -0
- package/dts/types/Chart.d.ts.map +1 -0
- package/dts/types/CollapsibleBaseProps.d.ts +2 -0
- package/dts/types/CollapsibleBaseProps.d.ts.map +1 -0
- package/dts/types/Color.d.ts +6 -0
- package/dts/types/Color.d.ts.map +1 -0
- package/dts/types/ComponentEventHandlerProps.d.ts +6 -0
- package/dts/types/ComponentEventHandlerProps.d.ts.map +1 -0
- package/dts/types/DimensionStyles.d.ts +24 -0
- package/dts/types/DimensionStyles.d.ts.map +1 -0
- package/dts/types/Display.d.ts +2 -0
- package/dts/types/Display.d.ts.map +1 -0
- package/dts/types/DotBaseProps.d.ts +5 -0
- package/dts/types/DotBaseProps.d.ts.map +1 -0
- package/dts/types/DotCountBaseProps.d.ts +5 -0
- package/dts/types/DotCountBaseProps.d.ts.map +1 -0
- package/dts/types/ElevationLevels.d.ts +7 -0
- package/dts/types/ElevationLevels.d.ts.map +1 -0
- package/dts/types/FallbackBaseProps.d.ts +10 -0
- package/dts/types/FallbackBaseProps.d.ts.map +1 -0
- package/dts/types/Grid.d.ts +2 -0
- package/dts/types/Grid.d.ts.map +1 -0
- package/dts/types/Helpers.d.ts +4 -0
- package/dts/types/Helpers.d.ts.map +1 -0
- package/dts/types/IconButtonBaseProps.d.ts +3 -0
- package/dts/types/IconButtonBaseProps.d.ts.map +1 -0
- package/dts/types/IconName.d.ts +3 -0
- package/dts/types/IconName.d.ts.map +1 -0
- package/dts/types/IconSize.d.ts +3 -0
- package/dts/types/IconSize.d.ts.map +1 -0
- package/dts/types/IllustrationNames.d.ts +8 -0
- package/dts/types/IllustrationNames.d.ts.map +1 -0
- package/dts/types/IllustrationProps.d.ts +15 -0
- package/dts/types/IllustrationProps.d.ts.map +1 -0
- package/dts/types/InputBaseProps.d.ts +19 -0
- package/dts/types/InputBaseProps.d.ts.map +1 -0
- package/dts/types/LottiePlayer.d.ts +9 -0
- package/dts/types/LottiePlayer.d.ts.map +1 -0
- package/dts/types/LottieSource.d.ts +30 -0
- package/dts/types/LottieSource.d.ts.map +1 -0
- package/dts/types/LottieStatusAnimationProps.d.ts +24 -0
- package/dts/types/LottieStatusAnimationProps.d.ts.map +1 -0
- package/dts/types/Motion.d.ts +34 -0
- package/dts/types/Motion.d.ts.map +1 -0
- package/dts/types/OverlayLifecycleProps.d.ts +19 -0
- package/dts/types/OverlayLifecycleProps.d.ts.map +1 -0
- package/dts/types/Palette.d.ts +5 -0
- package/dts/types/Palette.d.ts.map +1 -0
- package/dts/types/Placement.d.ts +3 -0
- package/dts/types/Placement.d.ts.map +1 -0
- package/dts/types/Position.d.ts +2 -0
- package/dts/types/Position.d.ts.map +1 -0
- package/dts/types/ProgressContainerWithButtonsProps.d.ts +8 -0
- package/dts/types/ProgressContainerWithButtonsProps.d.ts.map +1 -0
- package/dts/types/PulseBaseProps.d.ts +2 -0
- package/dts/types/PulseBaseProps.d.ts.map +1 -0
- package/dts/types/React.d.ts +3 -0
- package/dts/types/React.d.ts.map +1 -0
- package/dts/types/Rect.d.ts +8 -0
- package/dts/types/Rect.d.ts.map +1 -0
- package/dts/types/Responsive.d.ts +3 -0
- package/dts/types/Responsive.d.ts.map +1 -0
- package/dts/types/ResponsiveProps.d.ts +24 -0
- package/dts/types/ResponsiveProps.d.ts.map +1 -0
- package/dts/types/SectionHeaderProps.d.ts +18 -0
- package/dts/types/SectionHeaderProps.d.ts.map +1 -0
- package/dts/types/Shape.d.ts +3 -0
- package/dts/types/Shape.d.ts.map +1 -0
- package/dts/types/SharedAccessibilityProps.d.ts +34 -0
- package/dts/types/SharedAccessibilityProps.d.ts.map +1 -0
- package/dts/types/SharedProps.d.ts +9 -0
- package/dts/types/SharedProps.d.ts.map +1 -0
- package/dts/types/SpacingProps.d.ts +46 -0
- package/dts/types/SpacingProps.d.ts.map +1 -0
- package/dts/types/SparklineInteractiveHeaderBaseProps.d.ts +3 -0
- package/dts/types/SparklineInteractiveHeaderBaseProps.d.ts.map +1 -0
- package/dts/types/SpreadPropsSafely.d.ts +28 -0
- package/dts/types/SpreadPropsSafely.d.ts.map +1 -0
- package/dts/types/StickyFooterProps.d.ts +22 -0
- package/dts/types/StickyFooterProps.d.ts.map +1 -0
- package/dts/types/TagBaseProps.d.ts +4 -0
- package/dts/types/TagBaseProps.d.ts.map +1 -0
- package/dts/types/TextBaseProps.d.ts +10 -0
- package/dts/types/TextBaseProps.d.ts.map +1 -0
- package/dts/types/TooltipBaseProps.d.ts +2 -0
- package/dts/types/TooltipBaseProps.d.ts.map +1 -0
- package/dts/types/TypeOrNumber.d.ts +3 -0
- package/dts/types/TypeOrNumber.d.ts.map +1 -0
- package/dts/types/Visibility.d.ts +5 -0
- package/dts/types/Visibility.d.ts.map +1 -0
- package/dts/types/Weight.d.ts +2 -0
- package/dts/types/Weight.d.ts.map +1 -0
- package/dts/types/index.d.ts +57 -0
- package/dts/types/index.d.ts.map +1 -0
- package/dts/utils/__tests__/cell.test.d.ts +2 -0
- package/dts/utils/__tests__/cell.test.d.ts.map +1 -0
- package/dts/utils/__tests__/chart.test.d.ts +2 -0
- package/dts/utils/__tests__/chart.test.d.ts.map +1 -0
- package/dts/utils/__tests__/flattenNodes.test.d.ts +2 -0
- package/dts/utils/__tests__/flattenNodes.test.d.ts.map +1 -0
- package/dts/utils/__tests__/formatCount.test.d.ts +2 -0
- package/dts/utils/__tests__/formatCount.test.d.ts.map +1 -0
- package/dts/utils/__tests__/getRectWidthVariant.test.d.ts +2 -0
- package/dts/utils/__tests__/getRectWidthVariant.test.d.ts.map +1 -0
- package/dts/utils/cell.d.ts +3 -0
- package/dts/utils/cell.d.ts.map +1 -0
- package/dts/utils/chart.d.ts +2 -0
- package/dts/utils/chart.d.ts.map +1 -0
- package/dts/utils/circle.d.ts +4 -0
- package/dts/utils/circle.d.ts.map +1 -0
- package/dts/utils/convertDimensionToAspectRatio.d.ts +4 -0
- package/dts/utils/convertDimensionToAspectRatio.d.ts.map +1 -0
- package/dts/utils/convertDimensionToSize.d.ts +8 -0
- package/dts/utils/convertDimensionToSize.d.ts.map +1 -0
- package/dts/utils/convertSizeWithMultiplier.d.ts +9 -0
- package/dts/utils/convertSizeWithMultiplier.d.ts.map +1 -0
- package/dts/utils/debounce.d.ts +2 -0
- package/dts/utils/debounce.d.ts.map +1 -0
- package/dts/utils/delay.d.ts +5 -0
- package/dts/utils/delay.d.ts.map +1 -0
- package/dts/utils/flattenNodes.d.ts +5 -0
- package/dts/utils/flattenNodes.d.ts.map +1 -0
- package/dts/utils/formatCount.d.ts +26 -0
- package/dts/utils/formatCount.d.ts.map +1 -0
- package/dts/utils/getAccessibleColor.d.ts +28 -0
- package/dts/utils/getAccessibleColor.d.ts.map +1 -0
- package/dts/utils/getButtonSpacingProps.d.ts +16 -0
- package/dts/utils/getButtonSpacingProps.d.ts.map +1 -0
- package/dts/utils/getDefaultAspectRatioForIllustration.d.ts +4 -0
- package/dts/utils/getDefaultAspectRatioForIllustration.d.ts.map +1 -0
- package/dts/utils/getDefaultSizeObjectForIllustration.d.ts +4 -0
- package/dts/utils/getDefaultSizeObjectForIllustration.d.ts.map +1 -0
- package/dts/utils/getRectWidthVariant.d.ts +2 -0
- package/dts/utils/getRectWidthVariant.d.ts.map +1 -0
- package/dts/utils/getWidthInEm.d.ts +6 -0
- package/dts/utils/getWidthInEm.d.ts.map +1 -0
- package/dts/utils/join.d.ts +6 -0
- package/dts/utils/join.d.ts.map +1 -0
- package/dts/utils/mergeProps.d.ts +3 -0
- package/dts/utils/mergeProps.d.ts.map +1 -0
- package/dts/utils/mockUtils.d.ts +2 -0
- package/dts/utils/mockUtils.d.ts.map +1 -0
- package/dts/utils/modulate.d.ts +9 -0
- package/dts/utils/modulate.d.ts.map +1 -0
- package/dts/utils/parseDotCountMaxOverflow.d.ts +3 -0
- package/dts/utils/parseDotCountMaxOverflow.d.ts.map +1 -0
- package/dts/visualizations/__tests__/getSparklineRange.test.d.ts +2 -0
- package/dts/visualizations/__tests__/getSparklineRange.test.d.ts.map +1 -0
- package/dts/visualizations/__tests__/largestTriangleThreeBucket.test.d.ts +2 -0
- package/dts/visualizations/__tests__/largestTriangleThreeBucket.test.d.ts.map +1 -0
- package/dts/visualizations/__tests__/useCounter.test.d.ts +2 -0
- package/dts/visualizations/__tests__/useCounter.test.d.ts.map +1 -0
- package/dts/visualizations/__tests__/useSparklineArea.test.d.ts +2 -0
- package/dts/visualizations/__tests__/useSparklineArea.test.d.ts.map +1 -0
- package/dts/visualizations/__tests__/useSparklineCoordinates.test.d.ts +2 -0
- package/dts/visualizations/__tests__/useSparklineCoordinates.test.d.ts.map +1 -0
- package/dts/visualizations/__tests__/useSparklinePath.test.d.ts +2 -0
- package/dts/visualizations/__tests__/useSparklinePath.test.d.ts.map +1 -0
- package/dts/visualizations/getProgressCircleParams.d.ts +15 -0
- package/dts/visualizations/getProgressCircleParams.d.ts.map +1 -0
- package/dts/visualizations/getSparklineRange.d.ts +9 -0
- package/dts/visualizations/getSparklineRange.d.ts.map +1 -0
- package/dts/visualizations/getSparklineTransform.d.ts +4 -0
- package/dts/visualizations/getSparklineTransform.d.ts.map +1 -0
- package/dts/visualizations/largestTriangleThreeBucket.d.ts +16 -0
- package/dts/visualizations/largestTriangleThreeBucket.d.ts.map +1 -0
- package/dts/visualizations/useCounter.d.ts +7 -0
- package/dts/visualizations/useCounter.d.ts.map +1 -0
- package/dts/visualizations/useDateLookup.d.ts +8 -0
- package/dts/visualizations/useDateLookup.d.ts.map +1 -0
- package/dts/visualizations/useProgressSize.d.ts +3 -0
- package/dts/visualizations/useProgressSize.d.ts.map +1 -0
- package/dts/visualizations/useSparklineArea.d.ts +3 -0
- package/dts/visualizations/useSparklineArea.d.ts.map +1 -0
- package/dts/visualizations/useSparklineAreaOpacity.d.ts +2 -0
- package/dts/visualizations/useSparklineAreaOpacity.d.ts.map +1 -0
- package/dts/visualizations/useSparklineCoordinates.d.ts +21 -0
- package/dts/visualizations/useSparklineCoordinates.d.ts.map +1 -0
- package/dts/visualizations/useSparklinePath.d.ts +3 -0
- package/dts/visualizations/useSparklinePath.d.ts.map +1 -0
- package/dts/visualizations/useSparklinePathGenerator.d.ts +18 -0
- package/dts/visualizations/useSparklinePathGenerator.d.ts.map +1 -0
- package/dts/visualizations/useTimeseriesPaths.d.ts +11 -0
- package/dts/visualizations/useTimeseriesPaths.d.ts.map +1 -0
- package/dts/visualizations/useVisualizationDimensions.d.ts +15 -0
- package/dts/visualizations/useVisualizationDimensions.d.ts.map +1 -0
- package/esm/accordion/AccordionProvider.js +38 -0
- package/esm/animation/accordion.js +3 -0
- package/esm/animation/border.js +10 -0
- package/esm/animation/carousel.js +21 -0
- package/esm/animation/collapsible.js +75 -0
- package/esm/animation/dot.js +15 -0
- package/esm/animation/drawer.js +19 -0
- package/esm/animation/dropdown.js +31 -0
- package/esm/animation/fullscreenModal.js +39 -0
- package/esm/animation/likeButton.js +18 -0
- package/esm/animation/menu.js +31 -0
- package/esm/animation/modal.js +32 -0
- package/esm/animation/overlay.js +16 -0
- package/esm/animation/paddle.js +17 -0
- package/esm/animation/progress.js +4 -0
- package/esm/animation/rotate.js +5 -0
- package/esm/animation/select.js +16 -0
- package/esm/animation/sparkline.js +8 -0
- package/esm/animation/tabs.js +5 -0
- package/esm/animation/toast.js +36 -0
- package/esm/animation/tooltip.js +87 -0
- package/esm/cards/getCardBodySpacingProps.js +25 -0
- package/esm/color/blendColors.js +44 -0
- package/esm/color/colorToHex.js +11 -0
- package/esm/color/darkenColor.js +5 -0
- package/esm/color/getAccessibleForegroundGradient.js +32 -0
- package/esm/color/getBlendedColor.js +202 -0
- package/esm/color/getContrastRatio.js +11 -0
- package/esm/color/getLuminance.js +28 -0
- package/esm/color/isAccessibleColor.js +31 -0
- package/esm/color/isLightOrDarkColor.js +21 -0
- package/esm/color/overrideAlpha.js +15 -0
- package/esm/core/theme.js +26 -0
- package/esm/dates/DateInputValidationError.js +7 -0
- package/esm/dates/IntlDateFormat.js +66 -0
- package/esm/dates/generateCalendarMonth.js +22 -0
- package/esm/dates/getISOStringLocal.js +8 -0
- package/esm/dates/getMidnightDate.js +4 -0
- package/esm/dates/getTimesFromDatesAndRanges.js +16 -0
- package/esm/dates/useDateInput.js +105 -0
- package/esm/dates/useDateInputValidation.js +50 -0
- package/esm/hooks/useEventHandler.js +54 -0
- package/esm/hooks/useFallbackShape.js +29 -0
- package/esm/hooks/useGroupToggler.js +105 -0
- package/esm/hooks/useHasMounted.js +6 -0
- package/esm/hooks/useIndexCounter.js +47 -0
- package/esm/hooks/useInputVariant.js +4 -0
- package/esm/hooks/useLogo.js +60 -0
- package/esm/hooks/useMergeRefs.js +14 -0
- package/esm/hooks/usePrefixedId.js +25 -0
- package/esm/hooks/usePreviousValue.js +16 -0
- package/esm/hooks/usePreviousValues.js +26 -0
- package/esm/hooks/useRefMap.js +17 -0
- package/esm/hooks/useSort.js +26 -0
- package/esm/hooks/useSubBrandLogo.js +244 -0
- package/esm/hooks/useTimer.js +51 -0
- package/esm/hooks/useToggler.js +24 -0
- package/esm/hooks/useValueChanges.js +15 -0
- package/esm/index.js +7 -0
- package/esm/internal/data/accounts.js +1838 -0
- package/esm/internal/data/announcementCards.js +23 -0
- package/esm/internal/data/asset.js +6345 -0
- package/esm/internal/data/assets.js +82 -0
- package/esm/internal/data/avatars.js +2 -0
- package/esm/internal/data/dataCards.js +22 -0
- package/esm/internal/data/featureEntryCards.js +28 -0
- package/esm/internal/data/feedImages.js +1 -0
- package/esm/internal/data/iconData.js +1 -0
- package/esm/internal/data/loremIpsum.js +1 -0
- package/esm/internal/data/navigation.js +11 -0
- package/esm/internal/data/prices.js +7 -0
- package/esm/internal/data/product.js +24 -0
- package/esm/internal/data/tabs.js +58 -0
- package/esm/internal/data/users.js +9 -0
- package/esm/internal/utils/storyBuilder.js +102 -0
- package/esm/internal/visualizations/SparklineInteractiveData.js +67 -0
- package/esm/jest/timeTravel.js +42 -0
- package/esm/lottie/lottieUtils.js +20 -0
- package/esm/lottie/lottieUtils.test.js +44 -0
- package/esm/lottie/useStatusAnimationPoller.js +67 -0
- package/esm/media/getAvatarFallbackColor.js +50 -0
- package/esm/media/remoteImageFallbackSrc.js +11 -0
- package/esm/motion/animatedCaret.js +6 -0
- package/esm/motion/checkbox.js +9 -0
- package/esm/motion/dot.js +9 -0
- package/esm/motion/hint.js +19 -0
- package/esm/motion/switch.js +8 -0
- package/esm/motion/tokens.js +71 -0
- package/esm/motion/utils.js +17 -0
- package/esm/numbers/IntlNumberFormat.js +204 -0
- package/esm/numbers/subscript.js +53 -0
- package/esm/overlays/ModalContext.js +8 -0
- package/esm/overlays/OverlayContentContext.js +24 -0
- package/esm/overlays/PortalContext.js +6 -0
- package/esm/overlays/ToastProvider.js +51 -0
- package/esm/overlays/useAlert.js +8 -0
- package/esm/overlays/useModal.js +16 -0
- package/esm/overlays/useOverlay.js +28 -0
- package/esm/overlays/usePortal.js +10 -0
- package/esm/overlays/usePortalState.js +55 -0
- package/esm/overlays/useToastQueue.js +67 -0
- package/esm/stepper/useStepper.js +124 -0
- package/esm/stepper/utils.js +45 -0
- package/esm/system/EventHandlerProvider.js +24 -0
- package/esm/system/LocaleProvider.js +19 -0
- package/esm/system/RefMapContext.js +7 -0
- package/esm/tabs/TabsContext.js +7 -0
- package/esm/tabs/useTabs.js +43 -0
- package/esm/tokens/accordion.js +6 -0
- package/esm/tokens/appSwitcher.js +3 -0
- package/esm/tokens/avatar.js +13 -0
- package/esm/tokens/banner.js +39 -0
- package/esm/tokens/borderRadius.js +7 -0
- package/esm/tokens/button.js +64 -0
- package/esm/tokens/card.js +29 -0
- package/esm/tokens/cell.js +40 -0
- package/esm/tokens/chip.js +1 -0
- package/esm/tokens/dot.js +31 -0
- package/esm/tokens/drawer.js +11 -0
- package/esm/tokens/illustrations.js +28 -0
- package/esm/tokens/input.js +5 -0
- package/esm/tokens/interactable.js +4 -0
- package/esm/tokens/interactableHeight.js +4 -0
- package/esm/tokens/menu.js +2 -0
- package/esm/tokens/multiContentModule.js +1 -0
- package/esm/tokens/navigation.js +1 -0
- package/esm/tokens/overlays.js +1 -0
- package/esm/tokens/page.js +2 -0
- package/esm/tokens/select.js +26 -0
- package/esm/tokens/sidebar.js +2 -0
- package/esm/tokens/sizing.js +2 -0
- package/esm/tokens/sparkline.js +24 -0
- package/esm/tokens/tags.js +66 -0
- package/esm/tokens/tile.js +9 -0
- package/esm/tokens/toast.js +4 -0
- package/esm/tokens/tooltip.js +5 -0
- package/esm/tokens/zIndex.js +15 -0
- package/esm/tour/TourContext.js +7 -0
- package/esm/tour/useTour.js +84 -0
- package/esm/types/AvatarBaseProps.js +1 -0
- package/esm/types/AvatarSize.js +1 -0
- package/esm/types/BannerBaseProps.js +1 -0
- package/esm/types/BoxBaseProps.js +1 -0
- package/esm/types/ButtonBaseProps.js +1 -0
- package/esm/types/CardHeaderProps.js +1 -0
- package/esm/types/CardMediaProps.js +1 -0
- package/esm/types/CardRemoteImageProps.js +1 -0
- package/esm/types/CdsPlatform.js +1 -0
- package/esm/types/CellBaseProps.js +1 -0
- package/esm/types/Chart.js +1 -0
- package/esm/types/CollapsibleBaseProps.js +1 -0
- package/esm/types/Color.js +1 -0
- package/esm/types/ComponentEventHandlerProps.js +1 -0
- package/esm/types/DimensionStyles.js +1 -0
- package/esm/types/Display.js +1 -0
- package/esm/types/DotBaseProps.js +1 -0
- package/esm/types/DotCountBaseProps.js +1 -0
- package/esm/types/ElevationLevels.js +1 -0
- package/esm/types/FallbackBaseProps.js +1 -0
- package/esm/types/Grid.js +1 -0
- package/esm/types/Helpers.js +1 -0
- package/esm/types/IconButtonBaseProps.js +1 -0
- package/esm/types/IconName.js +1 -0
- package/esm/types/IconSize.js +1 -0
- package/esm/types/IllustrationNames.js +1 -0
- package/esm/types/IllustrationProps.js +1 -0
- package/esm/types/InputBaseProps.js +1 -0
- package/esm/types/LottiePlayer.js +1 -0
- package/esm/types/LottieSource.js +1 -0
- package/esm/types/LottieStatusAnimationProps.js +1 -0
- package/esm/types/Motion.js +1 -0
- package/esm/types/OverlayLifecycleProps.js +1 -0
- package/esm/types/Palette.js +1 -0
- package/esm/types/Placement.js +1 -0
- package/esm/types/Position.js +1 -0
- package/esm/types/ProgressContainerWithButtonsProps.js +1 -0
- package/esm/types/PulseBaseProps.js +1 -0
- package/esm/types/React.js +1 -0
- package/esm/types/Rect.js +6 -0
- package/esm/types/Responsive.js +1 -0
- package/esm/types/ResponsiveProps.js +1 -0
- package/esm/types/SectionHeaderProps.js +1 -0
- package/esm/types/Shape.js +1 -0
- package/esm/types/SharedAccessibilityProps.js +1 -0
- package/esm/types/SharedProps.js +1 -0
- package/esm/types/SpacingProps.js +1 -0
- package/esm/types/SparklineInteractiveHeaderBaseProps.js +1 -0
- package/esm/types/SpreadPropsSafely.js +1 -0
- package/esm/types/StickyFooterProps.js +1 -0
- package/esm/types/TagBaseProps.js +1 -0
- package/esm/types/TextBaseProps.js +1 -0
- package/esm/types/TooltipBaseProps.js +1 -0
- package/esm/types/TypeOrNumber.js +1 -0
- package/esm/types/Visibility.js +1 -0
- package/esm/types/Weight.js +1 -0
- package/esm/types/index.js +58 -0
- package/esm/utils/cell.js +5 -0
- package/esm/utils/chart.js +14 -0
- package/esm/utils/circle.js +12 -0
- package/esm/utils/convertDimensionToAspectRatio.js +5 -0
- package/esm/utils/convertDimensionToSize.js +9 -0
- package/esm/utils/convertSizeWithMultiplier.js +7 -0
- package/esm/utils/debounce.js +16 -0
- package/esm/utils/delay.js +6 -0
- package/esm/utils/flattenNodes.js +33 -0
- package/esm/utils/formatCount.js +43 -0
- package/esm/utils/getAccessibleColor.js +50 -0
- package/esm/utils/getButtonSpacingProps.js +24 -0
- package/esm/utils/getDefaultAspectRatioForIllustration.js +6 -0
- package/esm/utils/getDefaultSizeObjectForIllustration.js +7 -0
- package/esm/utils/getRectWidthVariant.js +1 -0
- package/esm/utils/getWidthInEm.js +13 -0
- package/esm/utils/join.js +11 -0
- package/esm/utils/mergeProps.js +25 -0
- package/esm/utils/mockUtils.js +1 -0
- package/esm/utils/modulate.js +32 -0
- package/esm/utils/parseDotCountMaxOverflow.js +7 -0
- package/esm/visualizations/getProgressCircleParams.js +18 -0
- package/esm/visualizations/getSparklineRange.js +13 -0
- package/esm/visualizations/getSparklineTransform.js +19 -0
- package/esm/visualizations/largestTriangleThreeBucket.js +57 -0
- package/esm/visualizations/useCounter.js +52 -0
- package/esm/visualizations/useDateLookup.js +18 -0
- package/esm/visualizations/useProgressSize.js +15 -0
- package/esm/visualizations/useSparklineArea.js +30 -0
- package/esm/visualizations/useSparklineAreaOpacity.js +3 -0
- package/esm/visualizations/useSparklineCoordinates.js +73 -0
- package/esm/visualizations/useSparklinePath.js +22 -0
- package/esm/visualizations/useSparklinePathGenerator.js +38 -0
- package/esm/visualizations/useTimeseriesPaths.js +41 -0
- package/esm/visualizations/useVisualizationDimensions.js +27 -0
- package/package.json +61 -5
- package/index.js +0 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useCallback, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The TourStepArrowComponent must forwardRef onto the underlying element for `@floating-ui` to correctly position the element.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Web only.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** A controlled hook for managing tour state, such as the currently active tour step. */
|
|
12
|
+
export const useTour = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
steps,
|
|
15
|
+
activeTourStep,
|
|
16
|
+
onChange
|
|
17
|
+
} = _ref;
|
|
18
|
+
const startTour = useCallback(async tourStepId => {
|
|
19
|
+
if (typeof tourStepId === 'undefined') return onChange(steps[0]);
|
|
20
|
+
let newActiveTourStep = null;
|
|
21
|
+
if (typeof tourStepId === 'string') {
|
|
22
|
+
newActiveTourStep = steps.find(step => step.id === tourStepId);
|
|
23
|
+
newActiveTourStep || (newActiveTourStep = steps[0]);
|
|
24
|
+
}
|
|
25
|
+
if (newActiveTourStep !== activeTourStep) {
|
|
26
|
+
var _activeTourStep$onBef, _newActiveTourStep, _newActiveTourStep$on, _activeTourStep$onIna, _newActiveTourStep2, _newActiveTourStep2$o;
|
|
27
|
+
await Promise.all([activeTourStep === null || activeTourStep === void 0 || (_activeTourStep$onBef = activeTourStep.onBeforeInactive) === null || _activeTourStep$onBef === void 0 ? void 0 : _activeTourStep$onBef.call(activeTourStep), (_newActiveTourStep = newActiveTourStep) === null || _newActiveTourStep === void 0 || (_newActiveTourStep$on = _newActiveTourStep.onBeforeActive) === null || _newActiveTourStep$on === void 0 ? void 0 : _newActiveTourStep$on.call(_newActiveTourStep)]);
|
|
28
|
+
onChange(newActiveTourStep);
|
|
29
|
+
await Promise.all([activeTourStep === null || activeTourStep === void 0 || (_activeTourStep$onIna = activeTourStep.onInactive) === null || _activeTourStep$onIna === void 0 ? void 0 : _activeTourStep$onIna.call(activeTourStep), (_newActiveTourStep2 = newActiveTourStep) === null || _newActiveTourStep2 === void 0 || (_newActiveTourStep2$o = _newActiveTourStep2.onActive) === null || _newActiveTourStep2$o === void 0 ? void 0 : _newActiveTourStep2$o.call(_newActiveTourStep2)]);
|
|
30
|
+
}
|
|
31
|
+
}, [activeTourStep, steps, onChange]);
|
|
32
|
+
const setActiveTourStep = useCallback(async tourStepId => startTour(tourStepId), [startTour]);
|
|
33
|
+
const stopTour = useCallback(async () => {
|
|
34
|
+
var _activeTourStep$onBef2, _activeTourStep$onIna2;
|
|
35
|
+
if (activeTourStep === null) return;
|
|
36
|
+
await ((_activeTourStep$onBef2 = activeTourStep.onBeforeInactive) === null || _activeTourStep$onBef2 === void 0 ? void 0 : _activeTourStep$onBef2.call(activeTourStep));
|
|
37
|
+
onChange(null);
|
|
38
|
+
await ((_activeTourStep$onIna2 = activeTourStep.onInactive) === null || _activeTourStep$onIna2 === void 0 ? void 0 : _activeTourStep$onIna2.call(activeTourStep));
|
|
39
|
+
}, [activeTourStep, onChange]);
|
|
40
|
+
const goNextTourStep = useCallback(async () => {
|
|
41
|
+
var _steps$at;
|
|
42
|
+
// If no active step, or active step is the last step, or there are 0 - 1 steps, do nothing
|
|
43
|
+
if (!activeTourStep || activeTourStep.id === ((_steps$at = steps.at(-1)) === null || _steps$at === void 0 ? void 0 : _steps$at.id) || steps.length < 2) return;
|
|
44
|
+
const activeStepIndex = steps.findIndex(step => step.id === activeTourStep.id);
|
|
45
|
+
// Find next step that isn't disabled
|
|
46
|
+
for (let i = activeStepIndex + 1; i < steps.length; i++) {
|
|
47
|
+
const step = steps[i];
|
|
48
|
+
if (!step.disabled) {
|
|
49
|
+
var _activeTourStep$onBef3, _step$onBeforeActive, _activeTourStep$onIna3, _step$onActive;
|
|
50
|
+
await Promise.all([(_activeTourStep$onBef3 = activeTourStep.onBeforeInactive) === null || _activeTourStep$onBef3 === void 0 ? void 0 : _activeTourStep$onBef3.call(activeTourStep), (_step$onBeforeActive = step.onBeforeActive) === null || _step$onBeforeActive === void 0 ? void 0 : _step$onBeforeActive.call(step)]);
|
|
51
|
+
onChange(step);
|
|
52
|
+
await Promise.all([(_activeTourStep$onIna3 = activeTourStep.onInactive) === null || _activeTourStep$onIna3 === void 0 ? void 0 : _activeTourStep$onIna3.call(activeTourStep), (_step$onActive = step.onActive) === null || _step$onActive === void 0 ? void 0 : _step$onActive.call(step)]);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}, [activeTourStep, steps, onChange]);
|
|
57
|
+
const goPreviousTourStep = useCallback(async () => {
|
|
58
|
+
var _steps$;
|
|
59
|
+
// If no active step, or active step is the first step, or there are 0 - 1 steps, do nothing
|
|
60
|
+
if (!activeTourStep || activeTourStep.id === ((_steps$ = steps[0]) === null || _steps$ === void 0 ? void 0 : _steps$.id) || steps.length < 2) return;
|
|
61
|
+
const activeStepIndex = steps.findIndex(step => step.id === activeTourStep.id);
|
|
62
|
+
// Find previous step that isn't disabled
|
|
63
|
+
for (let i = activeStepIndex - 1; i >= 0; i--) {
|
|
64
|
+
const step = steps[i];
|
|
65
|
+
if (!step.disabled) {
|
|
66
|
+
var _activeTourStep$onBef4, _step$onBeforeActive2, _activeTourStep$onIna4, _step$onActive2;
|
|
67
|
+
await Promise.all([(_activeTourStep$onBef4 = activeTourStep.onBeforeInactive) === null || _activeTourStep$onBef4 === void 0 ? void 0 : _activeTourStep$onBef4.call(activeTourStep), (_step$onBeforeActive2 = step.onBeforeActive) === null || _step$onBeforeActive2 === void 0 ? void 0 : _step$onBeforeActive2.call(step)]);
|
|
68
|
+
onChange(step);
|
|
69
|
+
await Promise.all([(_activeTourStep$onIna4 = activeTourStep.onInactive) === null || _activeTourStep$onIna4 === void 0 ? void 0 : _activeTourStep$onIna4.call(activeTourStep), (_step$onActive2 = step.onActive) === null || _step$onActive2 === void 0 ? void 0 : _step$onActive2.call(step)]);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}, [activeTourStep, steps, onChange]);
|
|
74
|
+
const api = useMemo(() => ({
|
|
75
|
+
steps,
|
|
76
|
+
activeTourStep,
|
|
77
|
+
setActiveTourStep,
|
|
78
|
+
startTour,
|
|
79
|
+
stopTour,
|
|
80
|
+
goNextTourStep,
|
|
81
|
+
goPreviousTourStep
|
|
82
|
+
}), [steps, activeTourStep, setActiveTourStep, startTour, stopTour, goNextTourStep, goPreviousTourStep]);
|
|
83
|
+
return api;
|
|
84
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// codegen:start {preset: barrel, include: ./*.ts}
|
|
2
|
+
export * from './AvatarBaseProps';
|
|
3
|
+
export * from './AvatarSize';
|
|
4
|
+
export * from './BannerBaseProps';
|
|
5
|
+
export * from './BoxBaseProps';
|
|
6
|
+
export * from './ButtonBaseProps';
|
|
7
|
+
export * from './CardHeaderProps';
|
|
8
|
+
export * from './CardMediaProps';
|
|
9
|
+
export * from './CardRemoteImageProps';
|
|
10
|
+
export * from './CdsPlatform';
|
|
11
|
+
export * from './CellBaseProps';
|
|
12
|
+
export * from './Chart';
|
|
13
|
+
export * from './CollapsibleBaseProps';
|
|
14
|
+
export * from './Color';
|
|
15
|
+
export * from './ComponentEventHandlerProps';
|
|
16
|
+
export * from './DimensionStyles';
|
|
17
|
+
export * from './Display';
|
|
18
|
+
export * from './DotBaseProps';
|
|
19
|
+
export * from './DotCountBaseProps';
|
|
20
|
+
export * from './ElevationLevels';
|
|
21
|
+
export * from './FallbackBaseProps';
|
|
22
|
+
export * from './Grid';
|
|
23
|
+
export * from './Helpers';
|
|
24
|
+
export * from './IconButtonBaseProps';
|
|
25
|
+
export * from './IconName';
|
|
26
|
+
export * from './IconSize';
|
|
27
|
+
export * from './IllustrationNames';
|
|
28
|
+
export * from './IllustrationProps';
|
|
29
|
+
export * from './InputBaseProps';
|
|
30
|
+
export * from './LottiePlayer';
|
|
31
|
+
export * from './LottieSource';
|
|
32
|
+
export * from './LottieStatusAnimationProps';
|
|
33
|
+
export * from './Motion';
|
|
34
|
+
export * from './OverlayLifecycleProps';
|
|
35
|
+
export * from './Palette';
|
|
36
|
+
export * from './Placement';
|
|
37
|
+
export * from './Position';
|
|
38
|
+
export * from './ProgressContainerWithButtonsProps';
|
|
39
|
+
export * from './PulseBaseProps';
|
|
40
|
+
export * from './React';
|
|
41
|
+
export * from './Rect';
|
|
42
|
+
export * from './Responsive';
|
|
43
|
+
export * from './ResponsiveProps';
|
|
44
|
+
export * from './SectionHeaderProps';
|
|
45
|
+
export * from './Shape';
|
|
46
|
+
export * from './SharedAccessibilityProps';
|
|
47
|
+
export * from './SharedProps';
|
|
48
|
+
export * from './SpacingProps';
|
|
49
|
+
export * from './SparklineInteractiveHeaderBaseProps';
|
|
50
|
+
export * from './SpreadPropsSafely';
|
|
51
|
+
export * from './StickyFooterProps';
|
|
52
|
+
export * from './TagBaseProps';
|
|
53
|
+
export * from './TextBaseProps';
|
|
54
|
+
export * from './TooltipBaseProps';
|
|
55
|
+
export * from './TypeOrNumber';
|
|
56
|
+
export * from './Visibility';
|
|
57
|
+
export * from './Weight';
|
|
58
|
+
// codegen:end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const minMax = (data, dataToNumFn) => {
|
|
2
|
+
let min;
|
|
3
|
+
let max;
|
|
4
|
+
for (const datum of data) {
|
|
5
|
+
const value = dataToNumFn(datum);
|
|
6
|
+
if (min === undefined || value < dataToNumFn(min)) {
|
|
7
|
+
min = datum;
|
|
8
|
+
}
|
|
9
|
+
if (max === undefined || value > dataToNumFn(max)) {
|
|
10
|
+
max = datum;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return [min, max];
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function getRadius(containerSize) {
|
|
2
|
+
let strokeWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
3
|
+
return containerSize / 2 - strokeWidth / 2;
|
|
4
|
+
}
|
|
5
|
+
export function getCircumference(radius) {
|
|
6
|
+
return 2 * Math.PI * radius;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// size is diameter + strokeWidth
|
|
10
|
+
export function getCenter(containerSize) {
|
|
11
|
+
return containerSize / 2;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { illustrationSizes } from '../tokens/illustrations';
|
|
2
|
+
/** Statically lookup a dimension string such as "24x24" and return it's size object { width: 24, height: 24 } */
|
|
3
|
+
export function convertDimensionToSize(dimension) {
|
|
4
|
+
const [width, height] = illustrationSizes[dimension];
|
|
5
|
+
return {
|
|
6
|
+
width,
|
|
7
|
+
height
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Returns a function, that, as long as it continues to be invoked, will not
|
|
2
|
+
// be triggered. The function will be called after it stops being called for
|
|
3
|
+
// N milliseconds. If `immediate` is passed, trigger the function on the
|
|
4
|
+
// leading edge, instead of the trailing.
|
|
5
|
+
export function debounce(func, timeout) {
|
|
6
|
+
let timer;
|
|
7
|
+
return function () {
|
|
8
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9
|
+
args[_key] = arguments[_key];
|
|
10
|
+
}
|
|
11
|
+
clearTimeout(timer);
|
|
12
|
+
timer = setTimeout(() => {
|
|
13
|
+
func(...args);
|
|
14
|
+
}, timeout);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Similar to React's built-in Children.toArray method, this utility takes children and returns them as an array for
|
|
3
|
+
introspection or filtering. Different from Children.toArray, it will flatten arrays and React.Fragments into a
|
|
4
|
+
regular, one-dimensional array while ensuring element and fragment keys are preserved, unique, and stable between renders.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { Children, cloneElement, isValidElement } from 'react';
|
|
8
|
+
import { isFragment } from 'react-is';
|
|
9
|
+
// typeguard to check for props in a ReactChild
|
|
10
|
+
export function hasProps(child) {
|
|
11
|
+
return child.props !== undefined;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line no-restricted-exports
|
|
15
|
+
export default function flattenNodes(children) {
|
|
16
|
+
let depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
17
|
+
let keys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
18
|
+
return Children.toArray(children).reduce((acc, node, nodeIndex) => {
|
|
19
|
+
if (isFragment(node)) {
|
|
20
|
+
var _node$key;
|
|
21
|
+
return [...acc, ...flattenNodes(node.props.children, depth + 1, keys.concat((_node$key = node.key) !== null && _node$key !== void 0 ? _node$key : nodeIndex))];
|
|
22
|
+
}
|
|
23
|
+
if (/*#__PURE__*/isValidElement(node)) {
|
|
24
|
+
return [...acc, /*#__PURE__*/cloneElement(node, {
|
|
25
|
+
key: keys.concat(String(node.key)).join('.')
|
|
26
|
+
})];
|
|
27
|
+
}
|
|
28
|
+
if (typeof node === 'string' || typeof node === 'number') {
|
|
29
|
+
return [...acc, node];
|
|
30
|
+
}
|
|
31
|
+
return acc;
|
|
32
|
+
}, []);
|
|
33
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a count number into a string representation.
|
|
3
|
+
* @param count - The count number to be formatted.
|
|
4
|
+
* @returns The formatted count as a string.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // returns '999'
|
|
8
|
+
* formatCount(999)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // returns '1.5K'
|
|
12
|
+
* formatCount(1500)
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // returns '1.5M
|
|
16
|
+
* formatCount(1500000)
|
|
17
|
+
* @example
|
|
18
|
+
* // returns '1.5B'
|
|
19
|
+
* formatCount(1500000000)
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // returns '1.5T'
|
|
23
|
+
* formatCount(1500000000000)
|
|
24
|
+
*/
|
|
25
|
+
export const formatCount = count => {
|
|
26
|
+
let divisor = 1;
|
|
27
|
+
let label = '';
|
|
28
|
+
if (count >= 1000000000000) {
|
|
29
|
+
divisor = 1000000000000;
|
|
30
|
+
label = 'T';
|
|
31
|
+
} else if (count >= 1000000000) {
|
|
32
|
+
divisor = 1000000000;
|
|
33
|
+
label = 'B';
|
|
34
|
+
} else if (count >= 1000000) {
|
|
35
|
+
divisor = 1000000;
|
|
36
|
+
label = 'M';
|
|
37
|
+
} else if (count >= 1000) {
|
|
38
|
+
divisor = 1000;
|
|
39
|
+
label = 'K';
|
|
40
|
+
}
|
|
41
|
+
const v = Math.floor(count / divisor * 10) / 10;
|
|
42
|
+
return "".concat(v).concat(label);
|
|
43
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { rgb } from 'd3-color';
|
|
2
|
+
import { isAccessibleColor } from '../color/isAccessibleColor';
|
|
3
|
+
const contrastRatio = (l1, l2) => {
|
|
4
|
+
return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* People with low vision often have difficulty reading text that does not contrast with its background.
|
|
8
|
+
* This can be exacerbated if the person has a color vision deficiency that lowers the contrast even further.
|
|
9
|
+
* Providing a minimum luminance contrast ratio between the text and its background can make the text more
|
|
10
|
+
* readable even if the person does not see the full range of colors. It also works for the rare individuals who see no color.
|
|
11
|
+
*
|
|
12
|
+
* If foreground='auto:
|
|
13
|
+
* 2. Return white or black based on contrast ratio with background.
|
|
14
|
+
*
|
|
15
|
+
* If foreground does not exist or doesn't meet contrast criteria:
|
|
16
|
+
* 1. Check background color contrast ratios with white and black
|
|
17
|
+
* 2. Return the color with higher contrast.
|
|
18
|
+
*/
|
|
19
|
+
export const getAccessibleColor = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
background,
|
|
22
|
+
foreground,
|
|
23
|
+
usage = 'normalText',
|
|
24
|
+
enhanced
|
|
25
|
+
} = _ref;
|
|
26
|
+
if (foreground === 'auto') return isAccessibleColor({
|
|
27
|
+
background,
|
|
28
|
+
foreground: 'white',
|
|
29
|
+
usage,
|
|
30
|
+
enhanced
|
|
31
|
+
}) ? 'rgb(255,255,255)' : 'rgb(0,0,0)';
|
|
32
|
+
const {
|
|
33
|
+
r,
|
|
34
|
+
g,
|
|
35
|
+
b
|
|
36
|
+
} = rgb(background);
|
|
37
|
+
const rLuminance = (r / 255) ** 2.2;
|
|
38
|
+
const gLuminance = (g / 255) ** 2.2;
|
|
39
|
+
const bLuminance = (b / 255) ** 2.2;
|
|
40
|
+
|
|
41
|
+
// sRGB constants
|
|
42
|
+
const colorLuminance = 0.2126 * rLuminance + 0.7151 * gLuminance + 0.0721 * bLuminance;
|
|
43
|
+
|
|
44
|
+
// Contrast ratios with white and black
|
|
45
|
+
const whiteContrast = contrastRatio(colorLuminance, 1); // White luminance = 1
|
|
46
|
+
const blackContrast = contrastRatio(colorLuminance, 0); // Black luminance = 0
|
|
47
|
+
|
|
48
|
+
// Return the color with higher contrast
|
|
49
|
+
return whiteContrast >= blackContrast ? '#ffffff' : '#000000';
|
|
50
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const buttonPaddingX = {
|
|
2
|
+
default: 4,
|
|
3
|
+
compact: 2,
|
|
4
|
+
flush: 2
|
|
5
|
+
};
|
|
6
|
+
const buttonPaddingY = {
|
|
7
|
+
default: 2,
|
|
8
|
+
compact: 1
|
|
9
|
+
};
|
|
10
|
+
export const getButtonSpacingProps = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
compact,
|
|
13
|
+
flush
|
|
14
|
+
} = _ref;
|
|
15
|
+
if (flush) return {
|
|
16
|
+
paddingX: buttonPaddingX.flush,
|
|
17
|
+
marginEnd: flush === 'end' ? -buttonPaddingX.flush : undefined,
|
|
18
|
+
marginStart: flush === 'start' ? -buttonPaddingX.flush : undefined
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
paddingX: compact ? buttonPaddingX.compact : buttonPaddingX.default,
|
|
22
|
+
paddingY: compact ? buttonPaddingY.compact : buttonPaddingY.default
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { illustrationDimensionDefaults, illustrationSizes } from '../tokens/illustrations';
|
|
2
|
+
/** Returns the default aspect ratio tuple for an illustration variant */
|
|
3
|
+
export function getDefaultAspectRatioForIllustration(variant) {
|
|
4
|
+
const dimensions = illustrationDimensionDefaults[variant];
|
|
5
|
+
return illustrationSizes[dimensions];
|
|
6
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { illustrationDimensionDefaults } from '../tokens/illustrations';
|
|
2
|
+
import { convertDimensionToSize } from './convertDimensionToSize';
|
|
3
|
+
|
|
4
|
+
/** Returns the default size object for an illustration variant */
|
|
5
|
+
export function getDefaultSizeObjectForIllustration(variant) {
|
|
6
|
+
return convertDimensionToSize(illustrationDimensionDefaults[variant !== null && variant !== void 0 ? variant : 'all']);
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const getRectWidthVariant = (variant, increment) => variant === undefined ? undefined : variant + increment;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the width of an element in em units by dividing its computed width by font-size.
|
|
3
|
+
* Useful for animating width across font-size changes without hardcoding pixels.
|
|
4
|
+
*/
|
|
5
|
+
export const getWidthInEm = element => {
|
|
6
|
+
const {
|
|
7
|
+
width,
|
|
8
|
+
fontSize
|
|
9
|
+
} = getComputedStyle(element);
|
|
10
|
+
const widthPx = parseFloat(width);
|
|
11
|
+
const fontSizePx = parseFloat(fontSize);
|
|
12
|
+
return "".concat(widthPx / fontSizePx, "em");
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Util for adding a separator element between react components excluding the last item
|
|
5
|
+
*/
|
|
6
|
+
import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export const join = (arr, node) => arr.map((item, index) => /*#__PURE__*/_jsx(Fragment, {
|
|
8
|
+
children: /*#__PURE__*/_jsxs(_Fragment, {
|
|
9
|
+
children: [item, index !== arr.length - 1 && node]
|
|
10
|
+
})
|
|
11
|
+
}, index));
|