Codemods

The American Express Design System provides a unified language for designing American Express websites and experiences. The design system provides design resources that match our coded components and are aligned with the American Express brand. Included are colors, components, icons and glyphs, type styles, and graphic assets to get you up and running quickly.

On this page

Back to All Codemods

Step Transform

Converts a v6 Step component to a v7 Step component.

Automatic Changes

  • Removes the current prop as it is a deprecated internal prop.
  • Removes the active prop as it is a deprecated internal prop.
  • Removes the last prop as it is a deprecated internal prop.
  • Removes the onlyShowLabel prop as it is a deprecated internal prop.
  • Removes the currentSubStep prop. See currentSubStep and subStepLabels manual changes below.
  • Removes the isInProgress prop. See currentSubStep and subStepLabels manual changes below.
  • Removes the gatewayIcon prop. See securityConfig manual changes below.
  • Removes the gatewayLabel prop. See securityConfig manual changes below.
  • Removes the gatewayCompleteLabel prop. See securityConfig manual changes below.
  • Attempts to transform the deprecated theme prop to the className prop. If it cannot, deletes the theme prop.

For example:

import { Step } from '@americanexpress/dls-react6';

export default function Page() {

return (

<Step

label="Step 1"

current={false}

active={false}

last={false}

onlyShowLabel={false}

currentSubStep={1}

isInProgress={isInProgress}

gatewayIcon={gatewayIcon}

gatewayLabel={gatewayLabel}

gatewayCompleteLabel={gatewayCompleteLabel}

theme={{ color: 'red' }}

{...otherProps}

/>

);

}

Transforms into:

import { Step } from '@americanexpress/dls-react';

export default function Page() {

return <Step label="Step 1" {...otherProps} />;

}

Manual Changes

currentSubStep and subStepLabels

In order to have sub-steps in v7, supply the currentSubStep prop to the MultiStepTracker and the subStepLabels prop to each Step which has sub-steps. For example:

import { MultiStepTracker, Step } from '@americanexpress/dls-react';

export default function Page() {

return (

<MultiStepTracker currentStep={1} currentSubStep={1}>

<Step label="Step 1" subStepLabels={['Substep 1', 'Substep 2']} />

<Step label="Step 2" />

</MultiStepTracker>

);

}

securityConfig

In order to have a <IconLock /> associated with a given Step, supply the securityConfig: { isLocked: boolean, label: string} prop. For example:

import { MultiStepTracker, Step } from '@americanexpress/dls-react';

export default function Page() {

return (

<MultiStepTracker currentStep={1}>

<Step

label="Step 1"

securityConfig={{ isLocked: true, label: 'Verify Card Number' }}

/>

<Step label="Step 2" />

</MultiStepTracker>

);

}

Questions?

Connect with the DLS Team on Slack or by email.

Resources

Check out additional resources.