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.

Back to All Codemods

ContinuousLinearTracker Transform

Converts a v6 ContinuousLinearTracker component to a v7 ContinuousLinearTracker component.

Automatic Changes

  • Attempts to transform the label prop to labelOverrides.getScreenReaderLabel.
  • Deletes the label prop, which is deprecated. Use the labelOverrides.getScreenReaderLabel prop instead.
  • Deletes the getProgressBarLabel prop, which is deprecated. Use the labelOverrides.getScreenReaderLabel prop instead.
  • Deletes the text prop, which is deprecated. Use the labelOverrides.getScreenReaderValueText prop instead.
  • Deletes the glyph prop, which is deprecated.
  • Attempts to transform the deprecated theme prop to the className prop. If it cannot, deletes the theme prop.

For example:

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

export default function Page() {

return (

<ContinuousLinearTracker

label="Miles"

glyph={glyph}

text={text}

getProgressBarLabel={getProgressBarLabel}

theme={{ color: 'red' }}

{...otherProps}

/>

);

}

Transforms into:

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

export default function Page() {

return (

<ContinuousLinearTracker

{...otherProps}

labelOverrides={{

getScreenReaderLabel: (min, max) => {

return `Miles from ${min} to ${max}`;

},

}}

/>

);

}

Manual Changes

labelOverrides.getScreenReaderLabel

The label and getProgressBarLabel props have been removed in favor of labelOverrides.getScreenReaderLabel: (min: number, max: number) => string

labelOverrides.getScreenReaderValueText

The text prop has been removed in favor of labelOverrides.getScreenReaderValueText: (currentValue: number) => string

Questions?

Connect with the DLS Team on Slack or by email.

Resources

Check out additional resources.