Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/mobile/src/buttons/DefaultSlideButtonHandle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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<SlideButtonBaseProps, 'variant' | 'compact'> & {
label?: React.ReactNode;
end?: React.ReactNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
16 changes: 16 additions & 0 deletions packages/mobile/src/stepper/Stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -214,6 +215,11 @@ export type StepperBaseProps<Metadata extends Record<string, unknown> = Record<s
StepperHeaderComponent?: StepperHeaderComponent<Metadata> | 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
*/
Expand Down Expand Up @@ -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 = <Metadata extends Record<string, unknown> = Record<string, unknown>>(
props: StepperProps<Metadata> & { ref?: React.Ref<View> },
) => React.ReactElement;
Expand Down
16 changes: 16 additions & 0 deletions packages/web/src/stepper/Stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -228,6 +229,11 @@ export type StepperBaseProps<Metadata extends Record<string, unknown> = Record<s
StepperHeaderComponent?: StepperHeaderComponent<Metadata> | 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
*/
Expand Down Expand Up @@ -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 = <Metadata extends Record<string, unknown> = Record<string, unknown>>(
props: StepperProps<Metadata> & { ref?: React.Ref<HTMLDivElement> },
) => React.ReactElement;
Expand Down
Loading