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

FilterPersistent Transform

Converts a v6 FilterPersistent component to a v7 FilterPersistent component.

Automatic Changes

  • Attempts to transform the deprecated theme prop to the className prop. If it cannot, deletes the theme prop.
  • Renames the filtersLabel prop to labelOverrides.menuHeadingLabel.
  • Renames the resetButtonLabel prop to labelOverrides.resetButtonLabel.
  • Renames the applyButtonLabel prop to labelOverrides.applyButtonLabel.
  • Deletes the showCloseButton prop, since close button is never shown.
  • Deletes the closeButtonLabel prop, since close button is never shown.
  • Deletes the closeButtonProps prop, since close button is never shown.
  • Deletes the onCloseClick prop, since close button is never shown.

For example:

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

export default function Page() {

return (

<FilterPersistent

filtersLabel="Filters"

resetButtonLabel="Reset"

applyButtonLabel="Apply"

showCloseButton={true}

closeButtonLabel="Close"

closeButtonProps={{ ariaLabel: 'Close' }}

onCloseClick={() => {}}

theme={{ color: 'red' }}

{...otherProps}

>

{/** Children */}

</FilterPersistent>

);

}

Transforms into:

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

export default function Page() {

return (

<FilterPersistent

labelOverrides={{

menuHeadingLabel: 'Filters',

resetButtonLabel: 'Reset',

applyButtonLabel: 'Apply',

}}

{...otherProps}

>

{/** Children */}

</FilterPersistent>

);

}

Questions?

Connect with the DLS Team on Slack or by email.

Resources

Check out additional resources.