@coinbase/cds-common 0.0.0 → 8.13.2
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/CHANGELOG.md +37 -0
- package/README.md +3 -0
- package/dts/accordion/AccordionProvider.d.ts +30 -0
- package/dts/accordion/AccordionProvider.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 +10 -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 +21 -0
- package/dts/animation/tooltip.d.ts.map +1 -0
- package/dts/cards/getCardBodySpacingProps.d.ts +17 -0
- package/dts/cards/getCardBodySpacingProps.d.ts.map +1 -0
- package/dts/color/blendColors.d.ts +24 -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 +18 -0
- package/dts/color/getAccessibleForegroundGradient.d.ts.map +1 -0
- package/dts/color/getBlendedColor.d.ts +121 -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 +23 -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 +285 -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 +42 -0
- package/dts/dates/IntlDateFormat.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 +7 -0
- package/dts/dates/getTimesFromDatesAndRanges.d.ts.map +1 -0
- package/dts/dates/useDateInput.d.ts +39 -0
- package/dts/dates/useDateInput.d.ts.map +1 -0
- package/dts/dates/useDateInputValidation.d.ts +55 -0
- package/dts/dates/useDateInputValidation.d.ts.map +1 -0
- package/dts/hooks/useEventHandler.d.ts +12 -0
- package/dts/hooks/useEventHandler.d.ts.map +1 -0
- package/dts/hooks/useFallbackShape.d.ts +14 -0
- package/dts/hooks/useFallbackShape.d.ts.map +1 -0
- package/dts/hooks/useGroupToggler.d.ts +26 -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 +25 -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 +4 -0
- package/dts/hooks/useMergeRefs.d.ts.map +1 -0
- package/dts/hooks/usePrefixedId.d.ts +18 -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 +15 -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 +70 -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 +369 -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 +81 -0
- package/dts/internal/data/assets.d.ts.map +1 -0
- package/dts/internal/data/avatars.d.ts +6 -0
- package/dts/internal/data/avatars.d.ts.map +1 -0
- package/dts/internal/data/dataCards.d.ts +27 -0
- package/dts/internal/data/dataCards.d.ts.map +1 -0
- package/dts/internal/data/featureEntryCards.d.ts +20 -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 +3 -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 +33 -0
- package/dts/internal/data/product.d.ts.map +1 -0
- package/dts/internal/data/tabs.d.ts +18 -0
- package/dts/internal/data/tabs.d.ts.map +1 -0
- package/dts/internal/data/users.d.ts +13 -0
- package/dts/internal/data/users.d.ts.map +1 -0
- package/dts/internal/utils/storyBuilder.d.ts +154 -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 +14 -0
- package/dts/lottie/lottieUtils.d.ts.map +1 -0
- package/dts/lottie/useStatusAnimationPoller.d.ts +35 -0
- package/dts/lottie/useStatusAnimationPoller.d.ts.map +1 -0
- package/dts/media/getAvatarFallbackColor.d.ts +9 -0
- package/dts/media/getAvatarFallbackColor.d.ts.map +1 -0
- package/dts/media/remoteImageFallbackSrc.d.ts +8 -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 +89 -0
- package/dts/motion/checkbox.d.ts.map +1 -0
- package/dts/motion/dot.d.ts +89 -0
- package/dts/motion/dot.d.ts.map +1 -0
- package/dts/motion/hint.d.ts +52 -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 +904 -0
- package/dts/motion/tokens.d.ts.map +1 -0
- package/dts/motion/utils.d.ts +33 -0
- package/dts/motion/utils.d.ts.map +1 -0
- package/dts/numbers/IntlNumberFormat.d.ts +129 -0
- package/dts/numbers/IntlNumberFormat.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 +82 -0
- package/dts/overlays/ToastProvider.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/useStepper.d.ts +45 -0
- package/dts/stepper/useStepper.d.ts.map +1 -0
- package/dts/stepper/utils.d.ts +29 -0
- package/dts/stepper/utils.d.ts.map +1 -0
- package/dts/system/EventHandlerProvider.d.ts +33 -0
- package/dts/system/EventHandlerProvider.d.ts.map +1 -0
- package/dts/system/LocaleProvider.d.ts +15 -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/tabs/TabsContext.d.ts +5 -0
- package/dts/tabs/TabsContext.d.ts.map +1 -0
- package/dts/tabs/useTabs.d.ts +34 -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 +30 -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 +3 -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 +18 -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/useTour.d.ts +104 -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 +75 -0
- package/dts/types/BoxBaseProps.d.ts.map +1 -0
- package/dts/types/ButtonBaseProps.d.ts +8 -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 +33 -0
- package/dts/types/CardMediaProps.d.ts.map +1 -0
- package/dts/types/CardRemoteImageProps.d.ts +22 -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 +29 -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 +9 -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 +8 -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 +19 -0
- package/dts/types/IllustrationNames.d.ts.map +1 -0
- package/dts/types/IllustrationProps.d.ts +27 -0
- package/dts/types/IllustrationProps.d.ts.map +1 -0
- package/dts/types/InputBaseProps.d.ts +25 -0
- package/dts/types/InputBaseProps.d.ts.map +1 -0
- package/dts/types/LottiePlayer.d.ts +12 -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 +30 -0
- package/dts/types/LottieStatusAnimationProps.d.ts.map +1 -0
- package/dts/types/Motion.d.ts +71 -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 +10 -0
- package/dts/types/Responsive.d.ts.map +1 -0
- package/dts/types/ResponsiveProps.d.ts +31 -0
- package/dts/types/ResponsiveProps.d.ts.map +1 -0
- package/dts/types/SectionHeaderProps.d.ts +20 -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 +8 -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 +24 -0
- package/dts/types/StickyFooterProps.d.ts.map +1 -0
- package/dts/types/TagBaseProps.d.ts +7 -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/cell.d.ts +6 -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 +14 -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 +12 -0
- package/dts/utils/convertSizeWithMultiplier.d.ts.map +1 -0
- package/dts/utils/debounce.d.ts +5 -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 +9 -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 +33 -0
- package/dts/utils/getAccessibleColor.d.ts.map +1 -0
- package/dts/utils/getButtonSpacingProps.d.ts +19 -0
- package/dts/utils/getButtonSpacingProps.d.ts.map +1 -0
- package/dts/utils/getDefaultAspectRatioForIllustration.d.ts +11 -0
- package/dts/utils/getDefaultAspectRatioForIllustration.d.ts.map +1 -0
- package/dts/utils/getDefaultSizeObjectForIllustration.d.ts +6 -0
- package/dts/utils/getDefaultSizeObjectForIllustration.d.ts.map +1 -0
- package/dts/utils/getRectWidthVariant.d.ts +5 -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 +9 -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 +12 -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/getProgressCircleParams.d.ts +19 -0
- package/dts/visualizations/getProgressCircleParams.d.ts.map +1 -0
- package/dts/visualizations/getSparklineRange.d.ts +13 -0
- package/dts/visualizations/getSparklineRange.d.ts.map +1 -0
- package/dts/visualizations/getSparklineTransform.d.ts +8 -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 +11 -0
- package/dts/visualizations/useCounter.d.ts.map +1 -0
- package/dts/visualizations/useDateLookup.d.ts +12 -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 +28 -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 +24 -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 +20 -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 +62 -6
- package/index.js +0 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
import React, { useId, useMemo } from 'react';
|
|
7
|
+
import isObject from 'lodash/isObject';
|
|
8
|
+
import merge from 'lodash/merge';
|
|
9
|
+
import omit from 'lodash/omit';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
const emptyObject = {};
|
|
12
|
+
export const baseConfig = {
|
|
13
|
+
args: {
|
|
14
|
+
isDarkMode: false
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
isDarkMode: {
|
|
18
|
+
control: 'boolean',
|
|
19
|
+
description: 'Enable dark mode'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
parameters: {
|
|
23
|
+
// Percy specific params
|
|
24
|
+
percy: {
|
|
25
|
+
additionalSnapshots: [{
|
|
26
|
+
prefix: '[Dark mode] ',
|
|
27
|
+
args: {
|
|
28
|
+
isDarkMode: true
|
|
29
|
+
}
|
|
30
|
+
}]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function isArray(props) {
|
|
35
|
+
return Array.isArray(props);
|
|
36
|
+
}
|
|
37
|
+
export function sanitizeProps(props) {
|
|
38
|
+
if (isObject(props)) {
|
|
39
|
+
return omit(props, ['scale', 'spectrum']);
|
|
40
|
+
}
|
|
41
|
+
return emptyObject;
|
|
42
|
+
}
|
|
43
|
+
export function storyBuilder(builderConfig) {
|
|
44
|
+
function builder(Component, sharedConfig) {
|
|
45
|
+
const storiesSet = new Set();
|
|
46
|
+
const defaultConfig = merge({}, baseConfig, builderConfig);
|
|
47
|
+
function build(args, customConfig) {
|
|
48
|
+
var _mergedConfig$paramet;
|
|
49
|
+
const TemplateFn = props => {
|
|
50
|
+
const id = useId();
|
|
51
|
+
const sanitizedProps = useMemo(() => sanitizeProps(props), [props]);
|
|
52
|
+
return /*#__PURE__*/_jsx(Component, _objectSpread({}, sanitizedProps), id);
|
|
53
|
+
};
|
|
54
|
+
const Template = TemplateFn.bind({});
|
|
55
|
+
const mergedConfig = merge({}, defaultConfig, sharedConfig, {
|
|
56
|
+
args
|
|
57
|
+
}, customConfig);
|
|
58
|
+
Template.parameters = _objectSpread(_objectSpread({}, mergedConfig.parameters), {}, {
|
|
59
|
+
storyshots: {
|
|
60
|
+
disable: mergedConfig === null || mergedConfig === void 0 || (_mergedConfig$paramet = mergedConfig.parameters) === null || _mergedConfig$paramet === void 0 || (_mergedConfig$paramet = _mergedConfig$paramet.a11y) === null || _mergedConfig$paramet === void 0 ? void 0 : _mergedConfig$paramet.skip
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
Template.args = mergedConfig.args;
|
|
64
|
+
Template.argTypes = mergedConfig.argTypes;
|
|
65
|
+
storiesSet.add(Template);
|
|
66
|
+
return Template;
|
|
67
|
+
}
|
|
68
|
+
function buildSheet(args, config) {
|
|
69
|
+
var _mergedConfig$paramet2;
|
|
70
|
+
let stories = Array.from(storiesSet.values());
|
|
71
|
+
const StorySheet = () => null;
|
|
72
|
+
const Template = StorySheet.bind({});
|
|
73
|
+
if (isArray(args)) {
|
|
74
|
+
const storiesOverride = [];
|
|
75
|
+
args.forEach(itemArgs => {
|
|
76
|
+
stories.forEach(StoryTemplate => {
|
|
77
|
+
const StoryTemplateCopy = StoryTemplate.bind({});
|
|
78
|
+
StoryTemplateCopy.args = merge({}, StoryTemplate.args, itemArgs);
|
|
79
|
+
StoryTemplateCopy.argTypes = StoryTemplate.argTypes;
|
|
80
|
+
storiesOverride.push(StoryTemplateCopy);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
stories = storiesOverride;
|
|
84
|
+
}
|
|
85
|
+
const mergedConfig = merge({}, defaultConfig, sharedConfig, config);
|
|
86
|
+
Template.args = isArray(args) ? mergedConfig.args : args;
|
|
87
|
+
Template.argTypes = merge({}, mergedConfig.argTypes, stories[0].argTypes);
|
|
88
|
+
Template.parameters = _objectSpread(_objectSpread({}, mergedConfig.parameters), {}, {
|
|
89
|
+
storyshots: {
|
|
90
|
+
disable: (_mergedConfig$paramet2 = mergedConfig.parameters.a11y) === null || _mergedConfig$paramet2 === void 0 ? void 0 : _mergedConfig$paramet2.skip
|
|
91
|
+
},
|
|
92
|
+
stories
|
|
93
|
+
});
|
|
94
|
+
return Template;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
build,
|
|
98
|
+
buildSheet
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return builder;
|
|
102
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
import { asset as assetJSON } from '../data/asset';
|
|
7
|
+
const transformAndFilterPrices = data => {
|
|
8
|
+
// Filters out null timestamps and corrects the type
|
|
9
|
+
const filterNullTimestamps = value => {
|
|
10
|
+
if (!value.timestamp) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
return [{
|
|
14
|
+
price: value.price,
|
|
15
|
+
timestamp: value.timestamp
|
|
16
|
+
}];
|
|
17
|
+
};
|
|
18
|
+
return (data !== null && data !== void 0 ? data : []).flatMap(filterNullTimestamps).map(point => ({
|
|
19
|
+
value: parseFloat(point.price),
|
|
20
|
+
date: new Date(point.timestamp)
|
|
21
|
+
})).sort((a, b) => a.date.getTime() - b.date.getTime());
|
|
22
|
+
};
|
|
23
|
+
export const sparklineInteractiveData = (() => {
|
|
24
|
+
const {
|
|
25
|
+
asset
|
|
26
|
+
} = assetJSON.data.viewer.assetByUuid;
|
|
27
|
+
return {
|
|
28
|
+
hour: transformAndFilterPrices(asset.priceDataForHour.quotes),
|
|
29
|
+
day: transformAndFilterPrices(asset.priceDataForDay.quotes),
|
|
30
|
+
week: transformAndFilterPrices(asset.priceDataForWeek.quotes),
|
|
31
|
+
month: transformAndFilterPrices(asset.priceDataForMonth.quotes),
|
|
32
|
+
year: transformAndFilterPrices(asset.priceDataForYear.quotes),
|
|
33
|
+
all: transformAndFilterPrices(asset.priceDataForAll.quotes)
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
export const strokeColor = '#F7931A';
|
|
37
|
+
const strokeColor2 = '#03925e';
|
|
38
|
+
function generateTimeseriesList(data) {
|
|
39
|
+
const timeseries = [];
|
|
40
|
+
const prices = data;
|
|
41
|
+
timeseries.push({
|
|
42
|
+
points: prices,
|
|
43
|
+
id: 'hour',
|
|
44
|
+
strokeColor
|
|
45
|
+
});
|
|
46
|
+
timeseries.push({
|
|
47
|
+
points: prices.map(point => _objectSpread(_objectSpread({}, point), {}, {
|
|
48
|
+
value: point.value + 10000 + Math.random() * 1000
|
|
49
|
+
})),
|
|
50
|
+
id: 'hour 2',
|
|
51
|
+
strokeColor: strokeColor2
|
|
52
|
+
});
|
|
53
|
+
return timeseries;
|
|
54
|
+
}
|
|
55
|
+
export const sparklineInteractiveHoverData = (() => {
|
|
56
|
+
const {
|
|
57
|
+
asset
|
|
58
|
+
} = assetJSON.data.viewer.assetByUuid;
|
|
59
|
+
return {
|
|
60
|
+
hour: generateTimeseriesList(transformAndFilterPrices(asset.priceDataForHour.quotes)),
|
|
61
|
+
day: generateTimeseriesList(transformAndFilterPrices(asset.priceDataForDay.quotes)),
|
|
62
|
+
week: generateTimeseriesList(transformAndFilterPrices(asset.priceDataForWeek.quotes)),
|
|
63
|
+
month: generateTimeseriesList(transformAndFilterPrices(asset.priceDataForMonth.quotes)),
|
|
64
|
+
year: generateTimeseriesList(transformAndFilterPrices(asset.priceDataForYear.quotes)),
|
|
65
|
+
all: generateTimeseriesList(transformAndFilterPrices(asset.priceDataForAll.quotes))
|
|
66
|
+
};
|
|
67
|
+
})();
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @link https://caian.dev/posts/test-animations-react-native/
|
|
3
|
+
*/
|
|
4
|
+
import { advanceBy, advanceTo, clear } from 'jest-date-mock';
|
|
5
|
+
export const FRAME_TIME = 10;
|
|
6
|
+
function advanceOneFrame() {
|
|
7
|
+
advanceBy(FRAME_TIME);
|
|
8
|
+
jest.advanceTimersByTime(FRAME_TIME);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Setup tests for time travel (start date)
|
|
13
|
+
*/
|
|
14
|
+
export function setup() {
|
|
15
|
+
let startDate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
16
|
+
advanceTo(new Date(startDate));
|
|
17
|
+
jest.useFakeTimers();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Travel a specific amount of time (in ms) inside a test
|
|
22
|
+
*/
|
|
23
|
+
export function timeTravel() {
|
|
24
|
+
let time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : FRAME_TIME;
|
|
25
|
+
const frames = time / FRAME_TIME;
|
|
26
|
+
for (let i = 0; i < frames; i += 1) {
|
|
27
|
+
advanceOneFrame();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* End test with time travel
|
|
33
|
+
*/
|
|
34
|
+
export function teardown() {
|
|
35
|
+
clear();
|
|
36
|
+
jest.useRealTimers();
|
|
37
|
+
}
|
|
38
|
+
export const withTimeTravel = func => {
|
|
39
|
+
setup();
|
|
40
|
+
func(timeTravel);
|
|
41
|
+
teardown();
|
|
42
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
// frame / frameRate and multiply by 1000 to convert to milliseconds
|
|
7
|
+
export function getLottieFrameToMs(frame, fr) {
|
|
8
|
+
return frame / fr * 1000;
|
|
9
|
+
}
|
|
10
|
+
export function getLottieDuration(source) {
|
|
11
|
+
return getLottieFrameToMs(source.op, source.fr);
|
|
12
|
+
}
|
|
13
|
+
export function getLottieFrameRate(source) {
|
|
14
|
+
return source.fr;
|
|
15
|
+
}
|
|
16
|
+
export function getLottieMarkers(source, opts) {
|
|
17
|
+
return source.markers.reduce((prev, next) => _objectSpread(_objectSpread({}, prev), {}, {
|
|
18
|
+
["".concat(next.cm)]: opts !== null && opts !== void 0 && opts.ms ? getLottieFrameToMs(next.tm, source.fr) : next.tm
|
|
19
|
+
}), {});
|
|
20
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { getLottieDuration, getLottieFrameRate, getLottieFrameToMs, getLottieMarkers } from './lottieUtils';
|
|
2
|
+
describe('lottieUtils', () => {
|
|
3
|
+
it('getLottieFrameToMs - frame / frameRate and multiply by 1000 to convert to milliseconds', () => {
|
|
4
|
+
// Second frame of a 30 FPS animation
|
|
5
|
+
expect(getLottieFrameToMs(2, 30)).toEqual(2 / 30 * 1000);
|
|
6
|
+
});
|
|
7
|
+
it('getLottieMarkers', () => {
|
|
8
|
+
// If this fails you should update the types in lottie-files/tradeStatus index file
|
|
9
|
+
expect(getLottieMarkers({
|
|
10
|
+
markers: [{
|
|
11
|
+
// Animation frame of marker
|
|
12
|
+
tm: 10,
|
|
13
|
+
// Marker name
|
|
14
|
+
cm: 'marker1'
|
|
15
|
+
}]
|
|
16
|
+
})).toEqual({
|
|
17
|
+
marker1: 10
|
|
18
|
+
});
|
|
19
|
+
expect(getLottieMarkers({
|
|
20
|
+
fr: 20,
|
|
21
|
+
markers: [{
|
|
22
|
+
// Animation frame of marker
|
|
23
|
+
tm: 10,
|
|
24
|
+
// Marker name
|
|
25
|
+
cm: 'marker1'
|
|
26
|
+
}]
|
|
27
|
+
}, {
|
|
28
|
+
ms: true
|
|
29
|
+
})).toEqual({
|
|
30
|
+
marker1: 500
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
it('getLottieFrameRate', () => {
|
|
34
|
+
expect(getLottieFrameRate({
|
|
35
|
+
fr: 30
|
|
36
|
+
})).toBe(30);
|
|
37
|
+
});
|
|
38
|
+
it('getLottieDuration', () => {
|
|
39
|
+
expect(getLottieDuration({
|
|
40
|
+
fr: 60,
|
|
41
|
+
op: 30
|
|
42
|
+
})).toBe(500);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
// TODO: Figure out where we can codegen these types from lottie-files
|
|
4
|
+
|
|
5
|
+
export const useStatusAnimationPoller = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
status = 'loading',
|
|
8
|
+
playMarkers,
|
|
9
|
+
onFinish
|
|
10
|
+
} = _ref;
|
|
11
|
+
const isRunning = useRef(false);
|
|
12
|
+
const isComplete = useRef(false);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
// Play loading animation on mount if we aren't already running
|
|
15
|
+
if (!isRunning.current && !!playMarkers) {
|
|
16
|
+
playMarkers('loadingStart', 'loadingEnd');
|
|
17
|
+
isRunning.current = true;
|
|
18
|
+
}
|
|
19
|
+
}, [playMarkers]);
|
|
20
|
+
const previousStatusRef = useRef();
|
|
21
|
+
|
|
22
|
+
// onAnimationFinish will get triggered after our first useEffect
|
|
23
|
+
// play completes and then after each play within onAnimationFinish completes.
|
|
24
|
+
return useCallback(() => {
|
|
25
|
+
const previousStatus = previousStatusRef.current;
|
|
26
|
+
if (status === 'loading') {
|
|
27
|
+
playMarkers === null || playMarkers === void 0 || playMarkers('loadingStart', 'loadingEnd');
|
|
28
|
+
} else if (status === 'pending') {
|
|
29
|
+
if (previousStatus === 'pending') {
|
|
30
|
+
playMarkers === null || playMarkers === void 0 || playMarkers('pendingAltLoopStart', 'pendingAltLoopEnd');
|
|
31
|
+
} else {
|
|
32
|
+
playMarkers === null || playMarkers === void 0 || playMarkers('pendingAltStart', 'pendingAltEnd');
|
|
33
|
+
}
|
|
34
|
+
} else if (!isComplete.current) {
|
|
35
|
+
switch (status) {
|
|
36
|
+
case 'success':
|
|
37
|
+
{
|
|
38
|
+
if (previousStatus === 'pending') {
|
|
39
|
+
playMarkers === null || playMarkers === void 0 || playMarkers('successAltStart', 'successAltEnd');
|
|
40
|
+
} else {
|
|
41
|
+
playMarkers === null || playMarkers === void 0 || playMarkers('successStart', 'successEnd');
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
case 'cardSuccess':
|
|
46
|
+
{
|
|
47
|
+
playMarkers === null || playMarkers === void 0 || playMarkers('successCardStart', 'successCardEnd');
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
case 'failure':
|
|
51
|
+
{
|
|
52
|
+
if (previousStatus === 'pending') {
|
|
53
|
+
playMarkers === null || playMarkers === void 0 || playMarkers('failureAltStart', 'failureAltEnd');
|
|
54
|
+
} else {
|
|
55
|
+
playMarkers === null || playMarkers === void 0 || playMarkers('failureStart', 'failureEnd');
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
default:
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
isComplete.current = true;
|
|
63
|
+
onFinish === null || onFinish === void 0 || onFinish();
|
|
64
|
+
}
|
|
65
|
+
previousStatusRef.current = status;
|
|
66
|
+
}, [onFinish, playMarkers, status]);
|
|
67
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { hsl } from 'd3-color';
|
|
2
|
+
const hashFromString = s => s.split('').reduce((a, b) => {
|
|
3
|
+
a = (a << 5) - a + b.charCodeAt(0);
|
|
4
|
+
return a & a;
|
|
5
|
+
}, 0);
|
|
6
|
+
const rgbFromHash = hash => {
|
|
7
|
+
const rgbValue = [0, 0, 0];
|
|
8
|
+
rgbValue.forEach((_, idx) => {
|
|
9
|
+
const newVal = hash >> idx * 8 & 255;
|
|
10
|
+
rgbValue[idx] = newVal;
|
|
11
|
+
});
|
|
12
|
+
return "rgb(".concat(rgbValue[0], ", ").concat(rgbValue[1], ", ").concat(rgbValue[2], ")");
|
|
13
|
+
};
|
|
14
|
+
export const rgbToAvatarFallbackColor = color => {
|
|
15
|
+
const hslColor = hsl(color);
|
|
16
|
+
const hue = Math.round(hslColor.h);
|
|
17
|
+
// if gray (low saturation)
|
|
18
|
+
if (hslColor.s < 0.3 || Number.isNaN(hslColor.s)) return 'gray';
|
|
19
|
+
// if green or yellow
|
|
20
|
+
if (hue === 0 || hue >= 1 && hue <= 79) return 'green';
|
|
21
|
+
if (hue >= 80 && hue <= 169) return 'teal';
|
|
22
|
+
if (hue >= 70 && hue <= 249) return 'purple';
|
|
23
|
+
// if red or pink or orange
|
|
24
|
+
if (hue >= 250 && hue <= 344 || hue === 345) return 'pink';
|
|
25
|
+
|
|
26
|
+
// // Map hue ranges to all available colors
|
|
27
|
+
// // Hue range: 0-360 degrees
|
|
28
|
+
// if (hue >= 0 && hue < 20) return 'red'; // 0-19: Red
|
|
29
|
+
// if (hue >= 20 && hue < 40) return 'orange'; // 20-39: Orange
|
|
30
|
+
// if (hue >= 40 && hue < 70) return 'yellow'; // 40-69: Yellow
|
|
31
|
+
// if (hue >= 70 && hue < 100) return 'chartreuse'; // 70-99: Chartreuse
|
|
32
|
+
// if (hue >= 100 && hue < 140) return 'green'; // 100-139: Green
|
|
33
|
+
// if (hue >= 140 && hue < 180) return 'teal'; // 140-179: Teal
|
|
34
|
+
// if (hue >= 180 && hue < 220) return 'blue'; // 180-219: Blue
|
|
35
|
+
// if (hue >= 220 && hue < 260) return 'indigo'; // 220-259: Indigo
|
|
36
|
+
// if (hue >= 260 && hue < 300) return 'purple'; // 260-299: Purple
|
|
37
|
+
// if (hue >= 300 && hue < 340) return 'pink'; // 300-339: Pink
|
|
38
|
+
// if (hue >= 340 && hue <= 360) return 'red'; // 340-360: Red (wraps back)
|
|
39
|
+
|
|
40
|
+
return 'gray';
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Generates a fallback color for an Avatar based on a unique identifier
|
|
45
|
+
*/
|
|
46
|
+
export const getAvatarFallbackColor = id => {
|
|
47
|
+
const hash = hashFromString(id);
|
|
48
|
+
const rgbValue = rgbFromHash(hash);
|
|
49
|
+
return rgbToAvatarFallbackColor(rgbValue);
|
|
50
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* We provide a base64 encoded image instead of uploading and importing a jpg in code for 2 reasons:
|
|
2
|
+
* 1. You can place it in common code and anything can import it regardless of its build process
|
|
3
|
+
* 2. You don't need to turn on image exports in bazel which can possibly export more images than the remote fallback.
|
|
4
|
+
* 3. Use can use these as tokens if you wish to use them outside of RemoteImage
|
|
5
|
+
* */
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* These are svgs encoded base64 so they can scale for any size Remote Images
|
|
9
|
+
* */
|
|
10
|
+
export const remoteImageDarkFallbackSrc = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9IiM4QTkxOUUiLz4KPGNpcmNsZSBjeD0iMTYiIGN5PSIxNSIgcj0iMyIgZmlsbD0iIzBBMEIwRCIvPgo8cmVjdCB4PSIxMSIgeT0iNiIgd2lkdGg9IjUiIGhlaWdodD0iNSIgZmlsbD0iIzBBMEIwRCIvPgo8cGF0aCBkPSJNNSAxNUw4LjUgOUwxMiAxNUg1WiIgZmlsbD0iIzBBMEIwRCIvPgo8L3N2Zz4K';
|
|
11
|
+
export const remoteImageLightFallbackSrc = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9IiM1QjYxNkUiLz4KPGNpcmNsZSBjeD0iMTYiIGN5PSIxNSIgcj0iMyIgZmlsbD0id2hpdGUiLz4KPHJlY3QgeD0iMTEiIHk9IjYiIHdpZHRoPSI1IiBoZWlnaHQ9IjUiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik01IDE1TDguNSA5TDEyIDE1SDVaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createMotionConfig } from './tokens';
|
|
2
|
+
/**
|
|
3
|
+
* Motion specs
|
|
4
|
+
* @link https://coda.io/d/Motion-Foundations_d5KlLHcBPlL/CDS-Check-Box_suHNC#_luS1p
|
|
5
|
+
*/
|
|
6
|
+
export const checkboxOpacityEnterConfig = createMotionConfig('fadeIn', 'moderate1');
|
|
7
|
+
export const checkboxScaleEnterConfig = createMotionConfig('scaleUpS', 'moderate1');
|
|
8
|
+
export const checkboxOpacityExitConfig = createMotionConfig('fadeOut', 'moderate1');
|
|
9
|
+
export const checkboxScaleExitConfig = createMotionConfig('scaleDownS', 'moderate1');
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createMotionConfig } from './tokens';
|
|
2
|
+
/**
|
|
3
|
+
* Motion specs
|
|
4
|
+
* @link https://coda.io/d/Motion-Foundations_d5KlLHcBPlL/CDS-Dots_suq2C#_luRZr
|
|
5
|
+
*/
|
|
6
|
+
export const dotOpacityEnterConfig = createMotionConfig('fadeIn', 'moderate1');
|
|
7
|
+
export const dotScaleEnterConfig = createMotionConfig('scaleUpS', 'moderate1');
|
|
8
|
+
export const dotOpacityExitConfig = createMotionConfig('fadeOut', 'moderate1');
|
|
9
|
+
export const dotScaleExitConfig = createMotionConfig('scaleDownS', 'moderate1');
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createMotionConfig } from './tokens';
|
|
2
|
+
export const colorSurgeEnterConfig = createMotionConfig('fadeIn30', 'fast1');
|
|
3
|
+
export const colorSurgeExitConfig = createMotionConfig('fadeOut30', 'slow4', {
|
|
4
|
+
delay: 200
|
|
5
|
+
});
|
|
6
|
+
export const shakeTranslateX = [0, -8, 8, -6, 6, -4, 4, -2, 2, 0];
|
|
7
|
+
export const shakeTransitionConfig = {
|
|
8
|
+
easing: 'enterFunctional',
|
|
9
|
+
duration: 'slow2'
|
|
10
|
+
};
|
|
11
|
+
export const pulseTransitionConfig = {
|
|
12
|
+
easing: 'linear',
|
|
13
|
+
oneOffDuration: 2000
|
|
14
|
+
};
|
|
15
|
+
export const pulseVariantOpacity = {
|
|
16
|
+
moderate: 0.7,
|
|
17
|
+
subtle: 0.9,
|
|
18
|
+
heavy: 0.5
|
|
19
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
import { generateAnimToken } from './utils';
|
|
7
|
+
export const curves = {
|
|
8
|
+
global: [0.6, 0, 0.15, 1],
|
|
9
|
+
enterExpressive: [0.33, 0, 0, 1],
|
|
10
|
+
enterFunctional: [0, 0, 0.15, 1],
|
|
11
|
+
exitExpressive: [1, 0, 0.67, 1],
|
|
12
|
+
exitFunctional: [0.6, 0, 1, 1],
|
|
13
|
+
linear: [0, 0, 1, 1]
|
|
14
|
+
};
|
|
15
|
+
export const durations = {
|
|
16
|
+
quick: 33,
|
|
17
|
+
/** Buttons, Toggles, Text, Icons, Selection Controls */
|
|
18
|
+
fast1: 100,
|
|
19
|
+
fast2: 133,
|
|
20
|
+
fast3: 150,
|
|
21
|
+
/** Short distance movements, System Messaging, Navigation Drawer, Modals */
|
|
22
|
+
moderate1: 200,
|
|
23
|
+
moderate2: 250,
|
|
24
|
+
moderate3: 300,
|
|
25
|
+
/** Large distance movements, Page Transitions, Full screen dialogue */
|
|
26
|
+
slow1: 350,
|
|
27
|
+
slow2: 400,
|
|
28
|
+
slow3: 500,
|
|
29
|
+
slow4: 1000
|
|
30
|
+
};
|
|
31
|
+
export const animations = {
|
|
32
|
+
fadeIn: generateAnimToken('opacity', [0, 1], 'enterFunctional'),
|
|
33
|
+
fadeIn10: generateAnimToken('opacity', [0, 0.1], 'enterFunctional'),
|
|
34
|
+
fadeIn20: generateAnimToken('opacity', [0, 0.2], 'enterFunctional'),
|
|
35
|
+
fadeIn30: generateAnimToken('opacity', [0, 0.3], 'enterFunctional'),
|
|
36
|
+
fadeOut: generateAnimToken('opacity', [1, 0], 'global'),
|
|
37
|
+
fadeOut10: generateAnimToken('opacity', [0.1, 0], 'global'),
|
|
38
|
+
fadeOut20: generateAnimToken('opacity', [0.2, 0], 'global'),
|
|
39
|
+
fadeOut30: generateAnimToken('opacity', [0.3, 0], 'global'),
|
|
40
|
+
slideUp: generateAnimToken('y', '-100%', 'enterFunctional'),
|
|
41
|
+
slideUp8: generateAnimToken('y', -8, 'enterFunctional'),
|
|
42
|
+
slideUp16: generateAnimToken('y', -16, 'enterFunctional'),
|
|
43
|
+
slideUp24: generateAnimToken('y', -24, 'enterFunctional'),
|
|
44
|
+
slideUp40: generateAnimToken('y', -40, 'enterFunctional'),
|
|
45
|
+
slideDown: generateAnimToken('y', '100%', 'exitFunctional'),
|
|
46
|
+
slideDown8: generateAnimToken('y', 8, 'global'),
|
|
47
|
+
slideDown16: generateAnimToken('y', 16, 'global'),
|
|
48
|
+
slideDown24: generateAnimToken('y', 24, 'global'),
|
|
49
|
+
slideDown40: generateAnimToken('y', 40, 'global'),
|
|
50
|
+
slideRight: generateAnimToken('x', '100%', 'global'),
|
|
51
|
+
slideRight8: generateAnimToken('x', 8, 'global'),
|
|
52
|
+
slideRight16: generateAnimToken('x', 16, 'global'),
|
|
53
|
+
slideRight24: generateAnimToken('x', 24, 'global'),
|
|
54
|
+
slideRight40: generateAnimToken('x', 40, 'global'),
|
|
55
|
+
slideLeft: generateAnimToken('x', '-100%', 'global'),
|
|
56
|
+
slideLeft8: generateAnimToken('x', -8, 'global'),
|
|
57
|
+
slideLeft16: generateAnimToken('x', -16, 'global'),
|
|
58
|
+
slideLeft24: generateAnimToken('x', -24, 'global'),
|
|
59
|
+
slideLeft40: generateAnimToken('x', -40, 'global'),
|
|
60
|
+
scaleUpXXS: generateAnimToken('scale', [0.98, 1], 'enterFunctional'),
|
|
61
|
+
scaleUpXS: generateAnimToken('scale', [0.95, 1], 'enterFunctional'),
|
|
62
|
+
scaleUpS: generateAnimToken('scale', [0.9, 1], 'enterFunctional'),
|
|
63
|
+
scaleDownXXS: generateAnimToken('scale', [1, 0.98], 'global'),
|
|
64
|
+
scaleDownXS: generateAnimToken('scale', [1, 0.95], 'global'),
|
|
65
|
+
scaleDownS: generateAnimToken('scale', [1, 0.9], 'global')
|
|
66
|
+
};
|
|
67
|
+
export const createMotionConfig = (effect, duration, overrides) => {
|
|
68
|
+
return _objectSpread(_objectSpread({}, animations[effect]), {}, {
|
|
69
|
+
duration
|
|
70
|
+
}, overrides);
|
|
71
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const generateAnimToken = (property, values, easing) => {
|
|
2
|
+
if (Array.isArray(values)) {
|
|
3
|
+
return {
|
|
4
|
+
property,
|
|
5
|
+
fromValue: values[0],
|
|
6
|
+
toValue: values[1],
|
|
7
|
+
easing
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// animate from current value thus no specific fromValue
|
|
12
|
+
return {
|
|
13
|
+
property,
|
|
14
|
+
toValue: values,
|
|
15
|
+
easing
|
|
16
|
+
};
|
|
17
|
+
};
|