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

Glyphs Transform

Glyph components are deprecated in v7. Therefore, this transform converts a v6 Glyph component to its equivalent v7 Icon component.

Automatic Changes

  • Updates the value of the size prop if possible:
    • "sm" => "xs"
    • "md" => "sm"
    • "lg" => "md"
  • Attempts to transform the deprecated theme prop to the color prop. If it cannot, deletes the theme prop.
  • Updates component name for all Glyph components:
    • Glyph -> Icon
    • GlyphAccount -> IconAccount
    • GlyphCancelCircle -> IconCancelCircle
    • GlyphCheck -> IconCheck
    • GlyphClose -> IconClose
    • GlyphDoubleLeft -> IconChevronDoubleLeft
    • GlyphDoubleRight -> IconChevronDoubleRight
    • GlyphDown -> IconArrowDown
    • GlyphEqual -> IconEqual
    • GlyphFavorite -> IconStar
    • GlyphInfo -> IconInfo
    • GlyphLeft -> IconArrowLeft
    • GlyphLinkOut -> IconLinkOut
    • GlyphMinus -> IconMinus
    • GlyphNav -> IconMenu
    • GlyphPlusCircle -> IconPlusCircle
    • GlyphPlus -> IconPlus
    • GlyphRight -> IconArrowRight
    • GlyphSortDown -> IconSortDown
    • GlyphSortUp -> IconSortUp
    • GlyphUp -> IconArrowUp
  • Updates import source to @americanexpress/dls-icons. Icon components are no longer available in @americanexpress/dls-react as of v7.0.0.

For example:

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

import { GlyphCheck } from '@americanexpress/dls-icons6';

export default function Page() {

return (

<>

<GlyphAccount

title="Account"

titleId="account-glyph-id"

size="sm"

theme={dlsBrightBlue}

/>

<GlyphCheck

title="Check"

titleId="check-glyph-id"

size="sm"

theme={dlsBrightBlue}

/>

</>

);

}

Transforms into:

import { IconAccount, IconCheck } from '@americanexpress/dls-icons';

export default function Page() {

return (

<>

<IconAccount

title="Account"

titleId="account-glyph-id"

size="xs"

color="brand"

/>

<IconCheck

title="Check"

titleId="check-glyph-id"

size="xs"

color="brand"

/>

</>

);

}

Questions?

Connect with the DLS Team on Slack or by email.

Resources

Check out additional resources.