From 185d59715522fdf04087808ee876b23fad5a3913 Mon Sep 17 00:00:00 2001 From: Adrien Zheng Date: Wed, 25 Mar 2026 16:18:02 -0400 Subject: [PATCH] fix: restore renamed props and constants. 1. restored and deprecated progressSpringConfig prop and defaultProgressSpringConfig; 2. restored and deprecated animationConfig. --- .../src/buttons/DefaultSlideButtonHandle.tsx | 7 +++++++ .../src/stepper/DefaultStepperStepHorizontal.tsx | 2 +- packages/mobile/src/stepper/Stepper.tsx | 16 ++++++++++++++++ packages/web/src/stepper/Stepper.tsx | 16 ++++++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/packages/mobile/src/buttons/DefaultSlideButtonHandle.tsx b/packages/mobile/src/buttons/DefaultSlideButtonHandle.tsx index 6054932c4..bfc97e488 100644 --- a/packages/mobile/src/buttons/DefaultSlideButtonHandle.tsx +++ b/packages/mobile/src/buttons/DefaultSlideButtonHandle.tsx @@ -9,6 +9,7 @@ import Animated, { type WithSpringConfig, } from 'react-native-reanimated'; import { variants } from '@coinbase/cds-common/tokens/button'; +import type { SpringConfig } from '@react-spring/core'; import { useTheme } from '../hooks/useTheme'; import { Icon } from '../icons/Icon'; @@ -26,6 +27,12 @@ export const slideButtonSpringConfig = { overshootClamping: true, } as const satisfies WithSpringConfig; +/** + * @deprecated SlideButton no longer uses react-spring; this value no longer used by {@link DefaultSlideButtonHandle} but retained for migration only. Use {@link slideButtonSpringConfig} with Reanimated `withSpring` instead. This will be removed in a future major release. + * @deprecationExpectedRemoval v10 + */ +export const animationConfig = { tension: 300, clamp: true } as const satisfies SpringConfig; + export type SlideButtonHandleCheckedProps = Pick & { label?: React.ReactNode; end?: React.ReactNode; diff --git a/packages/mobile/src/stepper/DefaultStepperStepHorizontal.tsx b/packages/mobile/src/stepper/DefaultStepperStepHorizontal.tsx index fdf3221c8..0609034e2 100644 --- a/packages/mobile/src/stepper/DefaultStepperStepHorizontal.tsx +++ b/packages/mobile/src/stepper/DefaultStepperStepHorizontal.tsx @@ -111,7 +111,7 @@ export const DefaultStepperStepHorizontal: StepperStepComponent = memo( style={styles?.substepContainer} visited={visited} > - {step.subSteps.map((subStep, index) => { + {step.subSteps.map((subStep) => { const RenderedStepComponent = subStep.Component ?? StepperStepComponent; const isDescendentActive = activeStepId ? containsStep({ diff --git a/packages/mobile/src/stepper/Stepper.tsx b/packages/mobile/src/stepper/Stepper.tsx index af97aa541..31cf1721e 100644 --- a/packages/mobile/src/stepper/Stepper.tsx +++ b/packages/mobile/src/stepper/Stepper.tsx @@ -5,6 +5,7 @@ import type { ThemeVars } from '@coinbase/cds-common/core/theme'; import { durations } from '@coinbase/cds-common/motion/tokens'; import { containsStep, flattenSteps, isStepVisited } from '@coinbase/cds-common/stepper/utils'; import type { IconName } from '@coinbase/cds-common/types'; +import type { SpringConfig } from '@react-spring/core'; import type { IconProps } from '../icons/Icon'; import { Box, type BoxBaseProps, type BoxProps } from '../layout/Box'; @@ -214,6 +215,11 @@ export type StepperBaseProps = Record | null; /** The timing config to use for the progress animation. */ progressTimingConfig?: WithTimingConfig; + /** + * @deprecated Stepper no longer uses react-spring for progress; this value is ignored but retained for migration only. Use {@link progressTimingConfig} instead. This will be removed in a future major release. + * @deprecationExpectedRemoval v10 + */ + progressSpringConfig?: SpringConfig; /** Whether to animate the progress bar. * @default true */ @@ -252,6 +258,16 @@ export const defaultProgressTimingConfig: WithTimingConfig = { easing: mobileCurves.global, }; +/** + * @deprecated Use {@link defaultProgressTimingConfig}. Retained for migration only; Stepper no longer uses react-spring for progress. This will be removed in a future major release. + * @deprecationExpectedRemoval v10 + */ +export const defaultProgressSpringConfig: SpringConfig = { + friction: 0, + tension: 100, + clamp: true, +}; + type StepperComponent = = Record>( props: StepperProps & { ref?: React.Ref }, ) => React.ReactElement; diff --git a/packages/web/src/stepper/Stepper.tsx b/packages/web/src/stepper/Stepper.tsx index 99c75f7f8..4345a5ce6 100644 --- a/packages/web/src/stepper/Stepper.tsx +++ b/packages/web/src/stepper/Stepper.tsx @@ -3,6 +3,7 @@ import type { ThemeVars } from '@coinbase/cds-common/core/theme'; import { curves, durations } from '@coinbase/cds-common/motion/tokens'; import { containsStep, flattenSteps, isStepVisited } from '@coinbase/cds-common/stepper/utils'; import type { IconName } from '@coinbase/cds-common/types'; +import type { SpringConfig } from '@react-spring/core'; import type { Transition } from 'framer-motion'; import { cx } from '../cx'; @@ -228,6 +229,11 @@ export type StepperBaseProps = Record | null; /** The Framer Motion transition config for progress bar animations (e.g. duration in seconds, ease). */ progressTimingConfig?: Transition; + /** + * @deprecated Stepper no longer uses react-spring for progress; this value is ignored but retained for migration only. Use {@link progressTimingConfig} instead. This will be removed in a future major release. + * @deprecationExpectedRemoval v10 + */ + progressSpringConfig?: SpringConfig; /** Whether to animate the progress bar. * @default true */ @@ -293,6 +299,16 @@ export const defaultProgressTimingConfig: Transition = { ease: curves.global, }; +/** + * @deprecated Use {@link defaultProgressTimingConfig}. Retained for migration only; Stepper no longer uses react-spring for progress. This will be removed in a future major release. + * @deprecationExpectedRemoval v10 + */ +export const defaultProgressSpringConfig: SpringConfig = { + friction: 0, + tension: 100, + clamp: true, +}; + type StepperComponent = = Record>( props: StepperProps & { ref?: React.Ref }, ) => React.ReactElement;