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

Alert Transform

Converts a v6 Alert component to a v7 ComponentLevelNotification component.

Automatic Changes

  • Renames the import and usages of Alert to ComponentLevelNotification.
  • Renames the showStateIcon prop to showIcon.
  • Attempts to transform the deprecated theme prop to the className prop. If it cannot, deletes the theme prop.

For example:

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

export default function Page() {

return (

<Alert showStateIcon={false} {...otherProps}>

Text

</Alert>

);

}

Transforms into:

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

export default function Page() {

return (

<ComponentLevelNotification showIcon={false} {...otherProps}>

Text

</ComponentLevelNotification>

);

}

Manual Changes

Aria Role

In v6, role gets its value based on the aria-live value. If aria-live is assertive, then role is alert. Otherwise, it has no role. In v7, the role is a prop, and the role is derived from the role prop, if available. Otherwise, it derives the role from the aria-live.

Questions?

Connect with the DLS Team on Slack or by email.

Resources

Check out additional resources.