{"version":3,"file":"PromoCardIndicator.mjs","sources":["../../src/promoCard/PromoCardIndicator.tsx"],"sourcesContent":["import { ArrowRight, Check, Download } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ReactElement, ReactNode } from 'react';\n\nimport Body from '../body';\nimport { Typography } from '../common';\nimport AvatarView from '../avatarView';\n\nexport type PromoCardIndicatorProps = {\n  /** Optional class name(s) to add to the indicator container. */\n  className?: string;\n\n  /** Optional label to display next to the indicator. */\n  label?: string;\n\n  /** Optional icon to display in the indicator. */\n  icon?: 'check' | 'arrow' | 'download' | ReactElement;\n\n  /** Optional prop to specify whether the indicator is sized small or not. */\n  isSmall?: boolean;\n\n  /** Optional ID to add to the indicator container for testing purposes. */\n  testid?: string;\n\n  /** Optional children to display inside the indicator. */\n  children?: ReactNode;\n};\n\n/**\n * PromoCardIndicator component.\n *\n * A PromoCardIndicator is a small component that can be used to display\n * additional information or actions related to a PromoCard. It can be\n * customized with various props to suit different use cases.\n *\n * @param {string} className - Optional class name(s) to add to the indicator container.\n * @param {string} label - Optional label to display next to the indicator.\n * @param {string | ReactElement} icon - Optional icon to display in the indicator.\n * @param {string} testid - Optional ID to add to the indicator container for testing purposes.\n * @param {ReactNode} children - Optional children to display inside the indicator.\n * @returns {React.JSX.Element} - The PromoCardIndicator component.\n * @example\n * <PromoCardIndicator label=\"Download\" icon=\"download\" />\n */\nconst PromoCardIndicator: React.FC<PromoCardIndicatorProps> = ({\n  className,\n  children,\n  label,\n  icon,\n  isSmall = false,\n  testid,\n  ...rest\n}) => {\n  const isIconString = icon && typeof icon === 'string';\n\n  const IconComponent =\n    isIconString &&\n    {\n      check: Check,\n      arrow: ArrowRight,\n      download: Download,\n    }[icon];\n\n  return (\n    <div className={clsx('np-Card-indicator', className)} data-testid={testid} {...rest}>\n      {label && (\n        <Body as=\"span\" type={Typography.BODY_LARGE_BOLD} className=\"np-Card-indicatorText\">\n          {label}\n        </Body>\n      )}\n      {icon && (\n        <AvatarView\n          interactive\n          size={isSmall ? 40 : 56}\n          style={{ backgroundColor: 'var(--Card-indicator-icon-background-color)' }}\n          className=\"np-Card-indicatorIcon\"\n        >\n          {IconComponent ? <IconComponent size={24} aria-hidden=\"true\" /> : icon}\n        </AvatarView>\n      )}\n      {children}\n    </div>\n  );\n};\n\nexport default PromoCardIndicator;\n"],"names":["PromoCardIndicator","className","children","label","icon","isSmall","testid","rest","isIconString","IconComponent","check","Check","arrow","ArrowRight","download","Download","_jsxs","clsx","_jsx","Body","as","type","Typography","BODY_LARGE_BOLD","AvatarView","interactive","size","style","backgroundColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAMA,kBAAkB,GAAsCA,CAAC;EAC7DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,IAAI;AACJC,EAAAA,OAAO,GAAG,KAAK;EACfC,MAAM;EACN,GAAGC;AAAI,CACR,KAAI;AACH,EAAA,MAAMC,YAAY,GAAGJ,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ;EAErD,MAAMK,aAAa,GACjBD,YAAY,IACZ;AACEE,IAAAA,KAAK,EAAEC,KAAK;AACZC,IAAAA,KAAK,EAAEC,UAAU;AACjBC,IAAAA,QAAQ,EAAEC;GACX,CAACX,IAAI,CAAC;AAET,EAAA,oBACEY,IAAA,CAAA,KAAA,EAAA;AAAKf,IAAAA,SAAS,EAAEgB,IAAI,CAAC,mBAAmB,EAAEhB,SAAS,CAAE;AAAC,IAAA,aAAA,EAAaK,MAAO;AAAA,IAAA,GAAKC,IAAI;AAAAL,IAAAA,QAAA,EAAA,CAChFC,KAAK,iBACJe,GAAA,CAACC,IAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;MAACC,IAAI,EAAEC,UAAU,CAACC,eAAgB;AAACtB,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAChFC;AAAK,KACF,CACP,EACAC,IAAI,iBACHc,GAAA,CAACM,UAAU,EAAA;MACTC,WAAW,EAAA,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