@coinbase/cds-common 8.13.1 → 8.13.5
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 +58 -0
- package/dts/accordion/AccordionProvider.d.ts +23 -17
- package/dts/animation/accordion.d.ts +1 -1
- package/dts/animation/border.d.ts +9 -3
- package/dts/animation/carousel.d.ts +1 -1
- package/dts/animation/collapsible.d.ts +4 -4
- package/dts/animation/dot.d.ts +1 -1
- package/dts/animation/drawer.d.ts +8 -8
- package/dts/animation/dropdown.d.ts +19 -19
- package/dts/animation/fullscreenModal.d.ts +1 -1
- package/dts/animation/likeButton.d.ts +1 -1
- package/dts/animation/menu.d.ts +21 -21
- package/dts/animation/modal.d.ts +1 -1
- package/dts/animation/overlay.d.ts +1 -1
- package/dts/animation/paddle.d.ts +1 -1
- package/dts/animation/progress.d.ts +1 -1
- package/dts/animation/rotate.d.ts +1 -1
- package/dts/animation/select.d.ts +1 -1
- package/dts/animation/sparkline.d.ts +3 -3
- package/dts/animation/tabs.d.ts +1 -1
- package/dts/animation/toast.d.ts +1 -1
- package/dts/animation/tooltip.d.ts +7 -4
- package/dts/cards/getCardBodySpacingProps.d.ts +16 -4
- package/dts/color/blendColors.d.ts +12 -9
- package/dts/color/colorToHex.d.ts +1 -1
- package/dts/color/darkenColor.d.ts +1 -1
- package/dts/color/getAccessibleForegroundGradient.d.ts +13 -8
- package/dts/color/getBlendedColor.d.ts +61 -54
- package/dts/color/getContrastRatio.d.ts +1 -1
- package/dts/color/getLuminance.d.ts +1 -1
- package/dts/color/isAccessibleColor.d.ts +11 -6
- package/dts/color/isLightOrDarkColor.d.ts +2 -2
- package/dts/color/overrideAlpha.d.ts +1 -1
- package/dts/core/theme.d.ts +251 -252
- package/dts/dates/DateInputValidationError.d.ts +3 -3
- package/dts/dates/IntlDateFormat.d.ts +29 -32
- package/dts/dates/generateCalendarMonth.d.ts +1 -1
- package/dts/dates/getISOStringLocal.d.ts +1 -1
- package/dts/dates/getMidnightDate.d.ts +1 -1
- package/dts/dates/getTimesFromDatesAndRanges.d.ts +4 -2
- package/dts/dates/useDateInput.d.ts +33 -17
- package/dts/dates/useDateInputValidation.d.ts +48 -39
- package/dts/hooks/useEventHandler.d.ts +12 -3
- package/dts/hooks/useFallbackShape.d.ts +10 -6
- package/dts/hooks/useGroupToggler.d.ts +9 -6
- package/dts/hooks/useHasMounted.d.ts +1 -1
- package/dts/hooks/useIndexCounter.d.ts +21 -14
- package/dts/hooks/useInputVariant.d.ts +1 -1
- package/dts/hooks/useLogo.d.ts +17 -17
- package/dts/hooks/useMergeRefs.d.ts +4 -2
- package/dts/hooks/usePrefixedId.d.ts +9 -3
- package/dts/hooks/usePreviousValue.d.ts +1 -1
- package/dts/hooks/usePreviousValues.d.ts +3 -3
- package/dts/hooks/useRefMap.d.ts +9 -7
- package/dts/hooks/useSort.d.ts +14 -14
- package/dts/hooks/useSubBrandLogo.d.ts +53 -45
- package/dts/hooks/useTimer.d.ts +5 -5
- package/dts/hooks/useToggler.d.ts +7 -7
- package/dts/hooks/useValueChanges.d.ts +6 -6
- package/dts/index.d.ts +1 -1
- package/dts/internal/data/accounts.d.ts +220 -210
- package/dts/internal/data/announcementCards.d.ts +7 -7
- package/dts/internal/data/asset.d.ts +162 -162
- package/dts/internal/data/assets.d.ts +73 -70
- package/dts/internal/data/avatars.d.ts +6 -3
- package/dts/internal/data/candles.d.ts +9 -0
- package/dts/internal/data/candles.d.ts.map +1 -0
- package/dts/internal/data/dataCards.d.ts +25 -21
- package/dts/internal/data/featureEntryCards.d.ts +19 -16
- package/dts/internal/data/feedImages.d.ts +1 -1
- package/dts/internal/data/iconData.d.ts +2 -2
- package/dts/internal/data/loremIpsum.d.ts +3 -2
- package/dts/internal/data/navigation.d.ts +5 -5
- package/dts/internal/data/prices.d.ts +3 -3
- package/dts/internal/data/product.d.ts +31 -23
- package/dts/internal/data/tabs.d.ts +16 -13
- package/dts/internal/data/users.d.ts +13 -10
- package/dts/internal/utils/storyBuilder.d.ts +136 -95
- package/dts/internal/visualizations/SparklineInteractiveData.d.ts +8 -8
- package/dts/jest/timeTravel.d.ts +1 -1
- package/dts/lottie/lottieUtils.d.ts +7 -4
- package/dts/lottie/useStatusAnimationPoller.d.ts +29 -6
- package/dts/media/getAvatarFallbackColor.d.ts +4 -2
- package/dts/media/remoteImageFallbackSrc.d.ts +5 -3
- package/dts/motion/animatedCaret.d.ts +1 -1
- package/dts/motion/checkbox.d.ts +85 -77
- package/dts/motion/dot.d.ts +85 -77
- package/dts/motion/hint.d.ts +46 -42
- package/dts/motion/switch.d.ts +1 -1
- package/dts/motion/tokens.d.ts +896 -414
- package/dts/motion/utils.d.ts +30 -12
- package/dts/numbers/IntlNumberFormat.d.ts +101 -103
- package/dts/numbers/subscript.d.ts +1 -1
- package/dts/overlays/ModalContext.d.ts +22 -22
- package/dts/overlays/OverlayContentContext.d.ts +10 -10
- package/dts/overlays/PortalContext.d.ts +5 -5
- package/dts/overlays/ToastProvider.d.ts +44 -35
- package/dts/overlays/useAlert.d.ts +3 -3
- package/dts/overlays/useModal.d.ts +3 -3
- package/dts/overlays/useOverlay.d.ts +3 -3
- package/dts/overlays/usePortal.d.ts +2 -2
- package/dts/overlays/usePortalState.d.ts +12 -12
- package/dts/overlays/useToastQueue.d.ts +8 -8
- package/dts/stepper/useStepper.d.ts +27 -23
- package/dts/stepper/utils.d.ts +15 -8
- package/dts/system/EventHandlerProvider.d.ts +13 -11
- package/dts/system/LocaleProvider.d.ts +8 -5
- package/dts/system/RefMapContext.d.ts +3 -3
- package/dts/tabs/TabsContext.d.ts +2 -2
- package/dts/tabs/useTabs.d.ts +27 -22
- package/dts/tokens/accordion.d.ts +4 -4
- package/dts/tokens/appSwitcher.d.ts +1 -1
- package/dts/tokens/avatar.d.ts +12 -12
- package/dts/tokens/banner.d.ts +8 -8
- package/dts/tokens/borderRadius.d.ts +1 -1
- package/dts/tokens/button.d.ts +61 -61
- package/dts/tokens/card.d.ts +16 -16
- package/dts/tokens/cell.d.ts +17 -14
- package/dts/tokens/chip.d.ts +1 -1
- package/dts/tokens/dot.d.ts +4 -4
- package/dts/tokens/drawer.d.ts +1 -1
- package/dts/tokens/illustrations.d.ts +21 -21
- package/dts/tokens/input.d.ts +1 -1
- package/dts/tokens/interactable.d.ts +1 -1
- package/dts/tokens/interactableHeight.d.ts +3 -3
- package/dts/tokens/menu.d.ts +1 -1
- package/dts/tokens/multiContentModule.d.ts +1 -1
- package/dts/tokens/navigation.d.ts +1 -1
- package/dts/tokens/overlays.d.ts +3 -2
- package/dts/tokens/page.d.ts +1 -1
- package/dts/tokens/select.d.ts +1 -1
- package/dts/tokens/sidebar.d.ts +1 -1
- package/dts/tokens/sizing.d.ts +1 -1
- package/dts/tokens/sparkline.d.ts +1 -1
- package/dts/tokens/tags.d.ts +11 -5
- package/dts/tokens/tile.d.ts +1 -1
- package/dts/tokens/toast.d.ts +1 -1
- package/dts/tokens/tooltip.d.ts +1 -1
- package/dts/tokens/zIndex.d.ts +12 -12
- package/dts/tour/TourContext.d.ts +1 -1
- package/dts/tour/TourContext.d.ts.map +1 -1
- package/dts/tour/useTour.d.ts +86 -77
- package/dts/tour/useTour.d.ts.map +1 -1
- package/dts/types/AvatarBaseProps.d.ts +1 -1
- package/dts/types/AvatarSize.d.ts +1 -1
- package/dts/types/BannerBaseProps.d.ts +1 -1
- package/dts/types/BoxBaseProps.d.ts +61 -48
- package/dts/types/ButtonBaseProps.d.ts +8 -2
- package/dts/types/CardHeaderProps.d.ts +9 -9
- package/dts/types/CardMediaProps.d.ts +28 -22
- package/dts/types/CardRemoteImageProps.d.ts +18 -14
- package/dts/types/CdsPlatform.d.ts +1 -1
- package/dts/types/CellBaseProps.d.ts +3 -3
- package/dts/types/Chart.d.ts +18 -16
- package/dts/types/CollapsibleBaseProps.d.ts +1 -1
- package/dts/types/Color.d.ts +3 -3
- package/dts/types/ComponentEventHandlerProps.d.ts +3 -3
- package/dts/types/DimensionStyles.d.ts +18 -18
- package/dts/types/Display.d.ts +9 -2
- package/dts/types/DotBaseProps.d.ts +1 -1
- package/dts/types/DotCountBaseProps.d.ts +1 -1
- package/dts/types/ElevationLevels.d.ts +3 -3
- package/dts/types/FallbackBaseProps.d.ts +8 -8
- package/dts/types/Grid.d.ts +1 -1
- package/dts/types/Helpers.d.ts +6 -2
- package/dts/types/IconButtonBaseProps.d.ts +1 -1
- package/dts/types/IconName.d.ts +1 -1
- package/dts/types/IconSize.d.ts +1 -1
- package/dts/types/IllustrationNames.d.ts +14 -3
- package/dts/types/IllustrationProps.d.ts +15 -3
- package/dts/types/InputBaseProps.d.ts +23 -17
- package/dts/types/LottiePlayer.d.ts +9 -6
- package/dts/types/LottieSource.d.ts +19 -19
- package/dts/types/LottieStatusAnimationProps.d.ts +21 -15
- package/dts/types/Motion.d.ts +58 -21
- package/dts/types/OverlayLifecycleProps.d.ts +17 -17
- package/dts/types/Palette.d.ts +1 -1
- package/dts/types/Placement.d.ts +1 -1
- package/dts/types/Position.d.ts +1 -1
- package/dts/types/ProgressContainerWithButtonsProps.d.ts +5 -5
- package/dts/types/PulseBaseProps.d.ts +1 -1
- package/dts/types/React.d.ts +1 -1
- package/dts/types/Rect.d.ts +5 -5
- package/dts/types/Responsive.d.ts +9 -2
- package/dts/types/ResponsiveProps.d.ts +13 -6
- package/dts/types/SectionHeaderProps.d.ts +15 -13
- package/dts/types/Shape.d.ts +1 -1
- package/dts/types/SharedAccessibilityProps.d.ts +32 -32
- package/dts/types/SharedProps.d.ts +7 -7
- package/dts/types/SpacingProps.d.ts +37 -37
- package/dts/types/SparklineInteractiveHeaderBaseProps.d.ts +7 -2
- package/dts/types/SpreadPropsSafely.d.ts +2 -2
- package/dts/types/StickyFooterProps.d.ts +17 -15
- package/dts/types/TagBaseProps.d.ts +5 -2
- package/dts/types/TextBaseProps.d.ts +7 -7
- package/dts/types/TooltipBaseProps.d.ts +1 -1
- package/dts/types/TypeOrNumber.d.ts +1 -1
- package/dts/types/Visibility.d.ts +2 -2
- package/dts/types/Weight.d.ts +1 -1
- package/dts/types/index.d.ts +1 -1
- package/dts/utils/cell.d.ts +5 -2
- package/dts/utils/chart.d.ts +1 -1
- package/dts/utils/circle.d.ts +1 -1
- package/dts/utils/convertDimensionToAspectRatio.d.ts +12 -2
- package/dts/utils/convertDimensionToSize.d.ts +3 -3
- package/dts/utils/convertSizeWithMultiplier.d.ts +8 -5
- package/dts/utils/debounce.d.ts +5 -2
- package/dts/utils/delay.d.ts +1 -1
- package/dts/utils/flattenNodes.d.ts +6 -2
- package/dts/utils/formatCount.d.ts +1 -1
- package/dts/utils/getAccessibleColor.d.ts +16 -11
- package/dts/utils/getButtonSpacingProps.d.ts +12 -9
- package/dts/utils/getDefaultAspectRatioForIllustration.d.ts +9 -2
- package/dts/utils/getDefaultSizeObjectForIllustration.d.ts +4 -2
- package/dts/utils/getRectWidthVariant.d.ts +5 -2
- package/dts/utils/getWidthInEm.d.ts +1 -1
- package/dts/utils/join.d.ts +5 -2
- package/dts/utils/mergeProps.d.ts +1 -1
- package/dts/utils/mockUtils.d.ts +1 -1
- package/dts/utils/modulate.d.ts +8 -5
- package/dts/utils/parseDotCountMaxOverflow.d.ts +1 -1
- package/dts/visualizations/getProgressCircleParams.d.ts +15 -11
- package/dts/visualizations/getSparklineRange.d.ts +11 -7
- package/dts/visualizations/getSparklineTransform.d.ts +7 -3
- package/dts/visualizations/largestTriangleThreeBucket.d.ts +1 -1
- package/dts/visualizations/useCounter.d.ts +9 -5
- package/dts/visualizations/useDateLookup.d.ts +9 -5
- package/dts/visualizations/useProgressSize.d.ts +1 -1
- package/dts/visualizations/useSparklineArea.d.ts +1 -1
- package/dts/visualizations/useSparklineAreaOpacity.d.ts +1 -1
- package/dts/visualizations/useSparklineCoordinates.d.ts +19 -12
- package/dts/visualizations/useSparklinePath.d.ts +1 -1
- package/dts/visualizations/useSparklinePathGenerator.d.ts +16 -10
- package/dts/visualizations/useTimeseriesPaths.d.ts +6 -6
- package/dts/visualizations/useVisualizationDimensions.d.ts +15 -10
- package/esm/internal/data/assets.js +1 -1
- package/esm/internal/data/candles.js +2101 -0
- package/esm/tour/useTour.js +5 -2
- package/package.json +7 -7
- package/dts/accordion/__tests__/AccordionProvider.test.d.ts +0 -2
- package/dts/accordion/__tests__/AccordionProvider.test.d.ts.map +0 -1
- package/dts/color/__tests__/blendColors.test.d.ts +0 -2
- package/dts/color/__tests__/blendColors.test.d.ts.map +0 -1
- package/dts/color/__tests__/isLightOrDarkColor.test.d.ts +0 -2
- package/dts/color/__tests__/isLightOrDarkColor.test.d.ts.map +0 -1
- package/dts/color/__tests__/overrideAlpha.test.d.ts +0 -2
- package/dts/color/__tests__/overrideAlpha.test.d.ts.map +0 -1
- package/dts/dates/__tests__/IntlDateFormat.test.d.ts +0 -2
- package/dts/dates/__tests__/IntlDateFormat.test.d.ts.map +0 -1
- package/dts/dates/__tests__/useDateInput.test.d.ts +0 -2
- package/dts/dates/__tests__/useDateInput.test.d.ts.map +0 -1
- package/dts/hooks/__tests__/useFallbackShape.test.d.ts +0 -2
- package/dts/hooks/__tests__/useFallbackShape.test.d.ts.map +0 -1
- package/dts/hooks/__tests__/usePrefixedId.test.d.ts +0 -2
- package/dts/hooks/__tests__/usePrefixedId.test.d.ts.map +0 -1
- package/dts/hooks/__tests__/usePreviousValue.test.d.ts +0 -2
- package/dts/hooks/__tests__/usePreviousValue.test.d.ts.map +0 -1
- package/dts/hooks/__tests__/useRefMap.test.d.ts +0 -2
- package/dts/hooks/__tests__/useRefMap.test.d.ts.map +0 -1
- package/dts/hooks/__tests__/useSort.test.d.ts +0 -2
- package/dts/hooks/__tests__/useSort.test.d.ts.map +0 -1
- package/dts/hooks/__tests__/useTimer.test.d.ts +0 -2
- package/dts/hooks/__tests__/useTimer.test.d.ts.map +0 -1
- package/dts/lottie/lottieUtils.test.d.ts +0 -2
- package/dts/lottie/lottieUtils.test.d.ts.map +0 -1
- package/dts/numbers/__tests__/formatToParts.test.d.ts +0 -2
- package/dts/numbers/__tests__/formatToParts.test.d.ts.map +0 -1
- package/dts/numbers/__tests__/subscript.test.d.ts +0 -2
- package/dts/numbers/__tests__/subscript.test.d.ts.map +0 -1
- package/dts/overlays/__tests__/useOverlay.test.d.ts +0 -2
- package/dts/overlays/__tests__/useOverlay.test.d.ts.map +0 -1
- package/dts/overlays/__tests__/useToastQueue.test.d.ts +0 -2
- package/dts/overlays/__tests__/useToastQueue.test.d.ts.map +0 -1
- package/dts/stepper/__tests__/useStepper.test.d.ts +0 -2
- package/dts/stepper/__tests__/useStepper.test.d.ts.map +0 -1
- package/dts/stepper/__tests__/utils.test.d.ts +0 -2
- package/dts/stepper/__tests__/utils.test.d.ts.map +0 -1
- package/dts/system/__tests__/EventHandlerProvider.test.d.ts +0 -2
- package/dts/system/__tests__/EventHandlerProvider.test.d.ts.map +0 -1
- package/dts/tabs/__tests__/TabsContext.test.d.ts +0 -2
- package/dts/tabs/__tests__/TabsContext.test.d.ts.map +0 -1
- package/dts/tabs/__tests__/useTabs.test.d.ts +0 -2
- package/dts/tabs/__tests__/useTabs.test.d.ts.map +0 -1
- package/dts/tour/__tests__/TourContext.test.d.ts +0 -2
- package/dts/tour/__tests__/TourContext.test.d.ts.map +0 -1
- package/dts/tour/__tests__/useTour.test.d.ts +0 -2
- package/dts/tour/__tests__/useTour.test.d.ts.map +0 -1
- package/dts/utils/__tests__/cell.test.d.ts +0 -2
- package/dts/utils/__tests__/cell.test.d.ts.map +0 -1
- package/dts/utils/__tests__/chart.test.d.ts +0 -2
- package/dts/utils/__tests__/chart.test.d.ts.map +0 -1
- package/dts/utils/__tests__/flattenNodes.test.d.ts +0 -2
- package/dts/utils/__tests__/flattenNodes.test.d.ts.map +0 -1
- package/dts/utils/__tests__/formatCount.test.d.ts +0 -2
- package/dts/utils/__tests__/formatCount.test.d.ts.map +0 -1
- package/dts/utils/__tests__/getRectWidthVariant.test.d.ts +0 -2
- package/dts/utils/__tests__/getRectWidthVariant.test.d.ts.map +0 -1
- package/dts/visualizations/__tests__/getSparklineRange.test.d.ts +0 -2
- package/dts/visualizations/__tests__/getSparklineRange.test.d.ts.map +0 -1
- package/dts/visualizations/__tests__/largestTriangleThreeBucket.test.d.ts +0 -2
- package/dts/visualizations/__tests__/largestTriangleThreeBucket.test.d.ts.map +0 -1
- package/dts/visualizations/__tests__/useCounter.test.d.ts +0 -2
- package/dts/visualizations/__tests__/useCounter.test.d.ts.map +0 -1
- package/dts/visualizations/__tests__/useSparklineArea.test.d.ts +0 -2
- package/dts/visualizations/__tests__/useSparklineArea.test.d.ts.map +0 -1
- package/dts/visualizations/__tests__/useSparklineCoordinates.test.d.ts +0 -2
- package/dts/visualizations/__tests__/useSparklineCoordinates.test.d.ts.map +0 -1
- package/dts/visualizations/__tests__/useSparklinePath.test.d.ts +0 -2
- package/dts/visualizations/__tests__/useSparklinePath.test.d.ts.map +0 -1
package/dts/motion/utils.d.ts
CHANGED
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
import type { MotionCurve, MotionProperty, MotionValue } from '../types';
|
|
2
2
|
type MotionValues = [MotionValue, MotionValue] | MotionValue;
|
|
3
|
-
export declare const generateAnimToken: (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
export declare const generateAnimToken: (
|
|
4
|
+
property: MotionProperty,
|
|
5
|
+
values: MotionValues,
|
|
6
|
+
easing: MotionCurve,
|
|
7
|
+
) =>
|
|
8
|
+
| {
|
|
9
|
+
property: MotionProperty;
|
|
10
|
+
fromValue: MotionValue;
|
|
11
|
+
toValue: MotionValue;
|
|
12
|
+
easing:
|
|
13
|
+
| 'global'
|
|
14
|
+
| 'enterExpressive'
|
|
15
|
+
| 'enterFunctional'
|
|
16
|
+
| 'exitExpressive'
|
|
17
|
+
| 'exitFunctional'
|
|
18
|
+
| 'linear';
|
|
19
|
+
}
|
|
20
|
+
| {
|
|
21
|
+
property: MotionProperty;
|
|
22
|
+
toValue: MotionValue;
|
|
23
|
+
easing:
|
|
24
|
+
| 'global'
|
|
25
|
+
| 'enterExpressive'
|
|
26
|
+
| 'enterFunctional'
|
|
27
|
+
| 'exitExpressive'
|
|
28
|
+
| 'exitFunctional'
|
|
29
|
+
| 'linear';
|
|
30
|
+
fromValue?: undefined;
|
|
31
|
+
};
|
|
14
32
|
export {};
|
|
15
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
33
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export type NumberPart = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type: string;
|
|
3
|
+
value: number | string;
|
|
4
4
|
};
|
|
5
5
|
export type KeyedNumberPart = {
|
|
6
|
-
|
|
6
|
+
key: string;
|
|
7
7
|
} & NumberPart;
|
|
8
8
|
export type IntlNumberParts = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
pre: KeyedNumberPart[];
|
|
10
|
+
integer: KeyedNumberPart[];
|
|
11
|
+
fraction: KeyedNumberPart[];
|
|
12
|
+
post: KeyedNumberPart[];
|
|
13
|
+
formatted: string;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* Lightweight wrapper around the built-in Intl.NumberFormat that standardizes
|
|
@@ -31,101 +31,99 @@ export type IntlNumberParts = {
|
|
|
31
31
|
* method will throw and callers should polyfill it.
|
|
32
32
|
*/
|
|
33
33
|
export declare class IntlNumberFormat {
|
|
34
|
+
value: number;
|
|
35
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
36
|
+
locale?: Intl.LocalesArgument;
|
|
37
|
+
formatter: Intl.NumberFormat;
|
|
38
|
+
constructor(props: {
|
|
34
39
|
value: number;
|
|
35
|
-
|
|
40
|
+
format?: Intl.NumberFormatOptions;
|
|
36
41
|
locale?: Intl.LocalesArgument;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
enableSubscriptNotation?: boolean;
|
|
124
|
-
}): {
|
|
125
|
-
pre: KeyedNumberPart[];
|
|
126
|
-
integer: KeyedNumberPart[];
|
|
127
|
-
fraction: KeyedNumberPart[];
|
|
128
|
-
post: KeyedNumberPart[];
|
|
129
|
-
};
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Returns the formatted string.
|
|
45
|
+
*/
|
|
46
|
+
format(): string;
|
|
47
|
+
/**
|
|
48
|
+
* Returns the number parts for RollingNumber with groupings and keys for animations
|
|
49
|
+
* Examples
|
|
50
|
+
*
|
|
51
|
+
* Example 1 — basic currency
|
|
52
|
+
* Input:
|
|
53
|
+
* ```json
|
|
54
|
+
* {
|
|
55
|
+
* "value": 98345.67,
|
|
56
|
+
* "format": {
|
|
57
|
+
* "style": "currency",
|
|
58
|
+
* "currency": "USD",
|
|
59
|
+
* "minimumFractionDigits": 2,
|
|
60
|
+
* "maximumFractionDigits": 5
|
|
61
|
+
* },
|
|
62
|
+
* "locale": "en-US",
|
|
63
|
+
* "prefix": "+",
|
|
64
|
+
* "suffix": " BTC"
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* Output:
|
|
69
|
+
* ```json
|
|
70
|
+
* {
|
|
71
|
+
* "pre": [
|
|
72
|
+
* { "type": "currency", "value": "$", "key": "currency:0" }
|
|
73
|
+
* ],
|
|
74
|
+
* "integer": [
|
|
75
|
+
* { "type": "integer", "value": 9, "key": "integer:4" },
|
|
76
|
+
* { "type": "integer", "value": 8, "key": "integer:3" },
|
|
77
|
+
* { "type": "group", "value": ",", "key": "group:0" },
|
|
78
|
+
* { "type": "integer", "value": 3, "key": "integer:2" },
|
|
79
|
+
* { "type": "integer", "value": 4, "key": "integer:1" },
|
|
80
|
+
* { "type": "integer", "value": 5, "key": "integer:0" }
|
|
81
|
+
* ],
|
|
82
|
+
* "fraction": [
|
|
83
|
+
* { "type": "decimal", "value": ".", "key": "decimal:0" },
|
|
84
|
+
* { "type": "fraction", "value": 6, "key": "fraction:0" },
|
|
85
|
+
* { "type": "fraction", "value": 7, "key": "fraction:1" }
|
|
86
|
+
* ],
|
|
87
|
+
* "post": [],
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* Example 2 — subscript notation enabled
|
|
92
|
+
* Input:
|
|
93
|
+
* ```json
|
|
94
|
+
* {
|
|
95
|
+
* "value": 1e-10,
|
|
96
|
+
* "format": {
|
|
97
|
+
* "minimumFractionDigits": 2,
|
|
98
|
+
* "maximumFractionDigits": 25
|
|
99
|
+
* },
|
|
100
|
+
* "locale": "en-US",
|
|
101
|
+
* "enableSubscriptNotation": true
|
|
102
|
+
* }
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* Output:
|
|
106
|
+
* ```json
|
|
107
|
+
* {
|
|
108
|
+
* "pre": [],
|
|
109
|
+
* "integer": [
|
|
110
|
+
* { "type": "integer", "value": 0, "key": "integer:0" }
|
|
111
|
+
* ],
|
|
112
|
+
* "fraction": [
|
|
113
|
+
* { "type": "decimal", "value": ".", "key": "decimal:0" },
|
|
114
|
+
* { "type": "fraction", "value": 0, "key": "fraction:0" },
|
|
115
|
+
* { "type": "subscript", "value": "₉", "key": "subscript:0" },
|
|
116
|
+
* { "type": "fraction", "value": 1, "key": "fraction:1" }
|
|
117
|
+
* ],
|
|
118
|
+
* "post": [],
|
|
119
|
+
* }
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
formatToParts({ enableSubscriptNotation }?: { enableSubscriptNotation?: boolean }): {
|
|
123
|
+
pre: KeyedNumberPart[];
|
|
124
|
+
integer: KeyedNumberPart[];
|
|
125
|
+
fraction: KeyedNumberPart[];
|
|
126
|
+
post: KeyedNumberPart[];
|
|
127
|
+
};
|
|
130
128
|
}
|
|
131
|
-
//# sourceMappingURL=IntlNumberFormat.d.ts.map
|
|
129
|
+
//# sourceMappingURL=IntlNumberFormat.d.ts.map
|
|
@@ -4,4 +4,4 @@ export declare const toSubscriptNumber: (n: number) => string;
|
|
|
4
4
|
* Builds parts for the fractional digits with subscript applied to leading zeros.
|
|
5
5
|
*/
|
|
6
6
|
export declare function buildFractionPartsWithSubscript(fractionDigits: string): NumberPart[];
|
|
7
|
-
//# sourceMappingURL=subscript.d.ts.map
|
|
7
|
+
//# sourceMappingURL=subscript.d.ts.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export type ModalContextValue = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Controls visibility of the Modal
|
|
4
|
+
* @default false
|
|
5
|
+
*/
|
|
6
|
+
visible: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Callback function fired when modal is closed.
|
|
9
|
+
*/
|
|
10
|
+
onRequestClose: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Hide top and bottom dividers inside Modal body
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
hideDividers?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Hide the close icon on the top right
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
hideCloseButton?: boolean;
|
|
21
|
+
accessibilityLabelledBy?: string;
|
|
22
22
|
};
|
|
23
|
-
export declare const ModalContext: import(
|
|
23
|
+
export declare const ModalContext: import('react').Context<ModalContextValue>;
|
|
24
24
|
export declare const useModalContext: () => ModalContextValue;
|
|
25
|
-
//# sourceMappingURL=ModalContext.d.ts.map
|
|
25
|
+
//# sourceMappingURL=ModalContext.d.ts.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export type OverlayContentContextValue = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
/** True if we are inside any overlay component like Overlay, Modal, Tray, or Drawer. */
|
|
3
|
+
isOverlay?: boolean;
|
|
4
|
+
/** True if we are inside a Modal component. */
|
|
5
|
+
isModal?: boolean;
|
|
6
|
+
/** True if we are inside a Drawer or Tray component. */
|
|
7
|
+
isDrawer?: boolean;
|
|
8
|
+
/** True if we are inside a Tour component. */
|
|
9
|
+
isTour?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare const OverlayContentContext: import(
|
|
11
|
+
export declare const OverlayContentContext: import('react').Context<OverlayContentContextValue>;
|
|
12
12
|
export declare const useOverlayContentContext: () => OverlayContentContextValue;
|
|
13
|
-
//# sourceMappingURL=OverlayContentContext.d.ts.map
|
|
13
|
+
//# sourceMappingURL=OverlayContentContext.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { PortalNode } from './usePortalState';
|
|
2
2
|
export type PortalProviderStates = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
addNode: (id: string, element: PortalNode['element']) => void;
|
|
4
|
+
removeNode: (id: string) => void;
|
|
5
|
+
nodes: PortalNode[];
|
|
6
6
|
};
|
|
7
|
-
export declare const PortalContext: import(
|
|
8
|
-
//# sourceMappingURL=PortalContext.d.ts.map
|
|
7
|
+
export declare const PortalContext: import('react').Context<PortalProviderStates>;
|
|
8
|
+
//# sourceMappingURL=PortalContext.d.ts.map
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ThemeVars } from '../core/theme';
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
DimensionValue,
|
|
5
|
+
OverlayLifecycleProps,
|
|
6
|
+
SharedAccessibilityProps,
|
|
7
|
+
SharedProps,
|
|
8
|
+
} from '../types';
|
|
4
9
|
export type ToastRefHandle = {
|
|
5
|
-
|
|
10
|
+
hide: () => Promise<boolean>;
|
|
6
11
|
};
|
|
7
12
|
export type ToastDuration = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Duration in milliseconds.
|
|
15
|
+
* Duration is automatically calculated
|
|
16
|
+
* @danger This will override default calculated value.
|
|
17
|
+
*/
|
|
18
|
+
duration?: number;
|
|
14
19
|
};
|
|
15
20
|
export type ToastAction = SharedProps & {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Label for the action button
|
|
23
|
+
*/
|
|
24
|
+
label: string;
|
|
25
|
+
/**
|
|
26
|
+
* Callback function fired when the button is pressed
|
|
27
|
+
*/
|
|
28
|
+
onPress: () => void;
|
|
24
29
|
};
|
|
25
|
-
export type ToastBaseProps = SharedProps &
|
|
30
|
+
export type ToastBaseProps = SharedProps &
|
|
31
|
+
SharedAccessibilityProps &
|
|
32
|
+
Pick<OverlayLifecycleProps, 'onWillHide' | 'onDidHide'> & {
|
|
26
33
|
/**
|
|
27
34
|
* The message to be displayed in the toast
|
|
28
35
|
*/
|
|
@@ -40,34 +47,36 @@ export type ToastBaseProps = SharedProps & SharedAccessibilityProps & Pick<Overl
|
|
|
40
47
|
* @default primary
|
|
41
48
|
*/
|
|
42
49
|
variant?: ThemeVars.Color;
|
|
43
|
-
};
|
|
44
|
-
export type ToastElement = React.ReactElement<
|
|
50
|
+
};
|
|
51
|
+
export type ToastElement = React.ReactElement<
|
|
52
|
+
ToastBaseProps & {
|
|
45
53
|
ref?: React.Ref<ToastRefHandle>;
|
|
46
|
-
}
|
|
54
|
+
}
|
|
55
|
+
>;
|
|
47
56
|
/**
|
|
48
57
|
* The data structure managed by the ToastProvider.
|
|
49
58
|
* It composes together the Toast element requested to be rendered and the duration for which it should be displayed.
|
|
50
59
|
*/
|
|
51
60
|
export type ToastNode = {
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
duration: number;
|
|
62
|
+
element: ToastElement;
|
|
54
63
|
};
|
|
55
64
|
export type ToastProviderProps = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
/**
|
|
66
|
+
* An optional, global override to individual Toasts' bottomOffset prop.
|
|
67
|
+
* This value will be applied to all Toasts render via this Provider instance
|
|
68
|
+
*/
|
|
69
|
+
toastBottomOffset?: ToastBaseProps['bottomOffset'];
|
|
61
70
|
};
|
|
62
71
|
export type ToastProviderStates = {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
activeToast?: ToastNode;
|
|
73
|
+
addToast: (element: ToastNode['element'], duration: number) => void;
|
|
74
|
+
removeToast: () => void;
|
|
75
|
+
hideToast: () => void;
|
|
76
|
+
clearToastQueue: () => void;
|
|
77
|
+
pauseTimer: () => void;
|
|
78
|
+
resumeTimer: () => void;
|
|
70
79
|
};
|
|
71
80
|
export declare const ToastContext: React.Context<ToastProviderStates>;
|
|
72
81
|
export declare const ToastProvider: React.FC<React.PropsWithChildren<ToastProviderProps>>;
|
|
73
|
-
//# sourceMappingURL=ToastProvider.d.ts.map
|
|
82
|
+
//# sourceMappingURL=ToastProvider.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @deprecated Use the visible and onRequestClose props as outlined in the docs here https://cds.coinbase.com/components/modal#get-started
|
|
3
3
|
*/
|
|
4
4
|
export declare const useAlert: () => {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
open: (content: import('./usePortalState').PortalNode['element']) => string;
|
|
6
|
+
close: () => void;
|
|
7
7
|
};
|
|
8
|
-
//# sourceMappingURL=useAlert.d.ts.map
|
|
8
|
+
//# sourceMappingURL=useAlert.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @deprecated Use the visible and onRequestClose props as outlined in the docs here https://cds.coinbase.com/components/modal#get-started
|
|
3
3
|
*/
|
|
4
4
|
export declare const useModal: () => {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
openModal: (content: import('./usePortalState').PortalNode['element']) => string;
|
|
6
|
+
closeModal: () => void;
|
|
7
7
|
};
|
|
8
|
-
//# sourceMappingURL=useModal.d.ts.map
|
|
8
|
+
//# sourceMappingURL=useModal.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PortalNode } from './usePortalState';
|
|
2
2
|
export declare const useOverlay: (idPrefix?: string) => {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
open: (content: PortalNode['element']) => string;
|
|
4
|
+
close: () => void;
|
|
5
5
|
};
|
|
6
|
-
//# sourceMappingURL=useOverlay.d.ts.map
|
|
6
|
+
//# sourceMappingURL=useOverlay.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const usePortal: () => import(
|
|
2
|
-
//# sourceMappingURL=usePortal.d.ts.map
|
|
1
|
+
export declare const usePortal: () => import('./PortalContext').PortalProviderStates;
|
|
2
|
+
//# sourceMappingURL=usePortal.d.ts.map
|
|
@@ -3,22 +3,22 @@ import type React from 'react';
|
|
|
3
3
|
* This type defines the basic interface of a Component rendered through the PortalProvider.
|
|
4
4
|
*/
|
|
5
5
|
export type PortalNode = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}>;
|
|
6
|
+
id: string;
|
|
7
|
+
element: React.ReactElement<{
|
|
8
|
+
visible: boolean;
|
|
9
|
+
onDidClose: () => void;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
ref?: React.Ref<{
|
|
12
|
+
onRequestClose: () => void;
|
|
14
13
|
}>;
|
|
14
|
+
}>;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* This hook is used to manage the state of a set of nodes rendered through the PortalProvider.
|
|
18
18
|
*/
|
|
19
19
|
export declare const usePortalState: () => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
nodes: PortalNode[];
|
|
21
|
+
addNode: (id: string, element: PortalNode['element']) => void;
|
|
22
|
+
removeNode: (id: string) => void;
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=usePortalState.d.ts.map
|
|
24
|
+
//# sourceMappingURL=usePortalState.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ToastNode } from './ToastProvider';
|
|
2
2
|
export declare const useToastQueue: () => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
activeToast: ToastNode | undefined;
|
|
4
|
+
addToast: (element: ToastNode['element'], duration: number) => void;
|
|
5
|
+
removeToast: () => void;
|
|
6
|
+
hideToast: () => Promise<boolean | undefined>;
|
|
7
|
+
clearToastQueue: () => Promise<void>;
|
|
8
|
+
pauseTimer: () => number;
|
|
9
|
+
resumeTimer: () => void;
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=useToastQueue.d.ts.map
|
|
11
|
+
//# sourceMappingURL=useToastQueue.d.ts.map
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
export type BaseStepperValue = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
id: string;
|
|
3
|
+
subSteps?: BaseStepperValue[];
|
|
4
4
|
};
|
|
5
5
|
export type StepperOptions<StepType extends BaseStepperValue = BaseStepperValue> = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
/** The array of steps data. */
|
|
7
|
+
steps: StepType[];
|
|
8
|
+
/** The default active step ID. If not provided, the first step will be used. Pass null to indicate no active step initially. */
|
|
9
|
+
defaultActiveStepId?: string | null;
|
|
10
|
+
/** If true, steps containing sub-steps will never be made active.
|
|
11
|
+
* This is useful if you want the parent step to treated only as a visual grouping of steps rather than a step itself.
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
skipParentSteps?: boolean;
|
|
15
15
|
};
|
|
16
16
|
export type StepperState = {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/** React state for the currently active step ID. Can be null if no step is active. */
|
|
18
|
+
activeStepId: string | null;
|
|
19
19
|
};
|
|
20
20
|
export type StepperApi = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
/** Update the currently active step to the step with `stepId`. */
|
|
22
|
+
goToStep: (stepId: string) => void;
|
|
23
|
+
/** Update the currently active step to the next enabled step in the steps array. Does nothing if the last step is already active. */
|
|
24
|
+
goNextStep: () => void;
|
|
25
|
+
/** Update the currently active step to the previous enabled step in the steps array. Does nothing if the first step is already active. */
|
|
26
|
+
goPreviousStep: () => void;
|
|
27
|
+
/** Reset the active step to the original default active step. */
|
|
28
|
+
reset: () => void;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* A hook for managing StepperHorizontal or StepperVertical state.
|
|
@@ -37,5 +37,9 @@ export type StepperApi = {
|
|
|
37
37
|
* @param options.skipParentSteps - If true, steps containing sub-steps will never be made active.
|
|
38
38
|
* @returns A tuple where the first element is the stepper state and the second element is an API for manipulating the stepper state.
|
|
39
39
|
*/
|
|
40
|
-
export declare const useStepper: <StepType extends BaseStepperValue = BaseStepperValue>({
|
|
41
|
-
|
|
40
|
+
export declare const useStepper: <StepType extends BaseStepperValue = BaseStepperValue>({
|
|
41
|
+
steps,
|
|
42
|
+
defaultActiveStepId,
|
|
43
|
+
skipParentSteps,
|
|
44
|
+
}: StepperOptions<StepType>) => [StepperState, StepperApi];
|
|
45
|
+
//# sourceMappingURL=useStepper.d.ts.map
|