{"version":3,"file":"index.cjs","names":["getBrandedIconSrc","getWordmarkSrc"],"sources":["../src/branded-icon.tsx","../src/wordmark.tsx"],"sourcesContent":["import { cssMerge } from '@volvo-cars/css/utils';\nimport type React from 'react';\nimport { forwardRef } from 'react';\nimport { getBrandedIconSrc } from './config';\nimport type { BrandedIconName } from './icons.generated';\n\nexport type BrandedIconProps = {\n  /**\n   * The name of the icon.\n   */\n  icon: BrandedIconName;\n\n  /**\n   * The size of the icon in pixels.\n   */\n  size: 24 | 32 | 40;\n\n  /**\n   * Custom class name, merged with existing classes.\n   */\n  className?: string;\n\n  /**\n   * Alternate text.\n   *\n   * May be omitted if the alternate text is already present,\n   * such as in a button that already has a label.\n   */\n  alt?: string;\n\n  /**\n   * Indicates how the browser should load the image.\n   *\n   * Prefer `lazy` for images below the fold or not immediately visible.\n   */\n  loading?: 'eager' | 'lazy';\n\n  hidden?: boolean;\n  id?: string;\n  title?: string;\n  dir?: string;\n  lang?: string;\n  slot?: string;\n  style?: React.CSSProperties;\n\n  onAnimationEnd?: React.AnimationEventHandler<HTMLImageElement>;\n  onAnimationStart?: React.AnimationEventHandler<HTMLImageElement>;\n  onTransitionEnd?: React.TransitionEventHandler<HTMLImageElement>;\n};\n\n/**\n * BrandedIcon renders an `img` with a src on the volvocars.com CDN with icons\n * representing Partners and Services.\n */\nexport const BrandedIcon = forwardRef<HTMLImageElement, BrandedIconProps>(\n  function BrandedIcon({ alt, icon, size, loading = 'lazy', ...props }, ref) {\n    const src = getBrandedIconSrc(icon);\n    const className = cssMerge('icon-sprite', props.className);\n    return (\n      <img\n        {...props}\n        ref={ref}\n        className={className}\n        width={size}\n        height={size}\n        src={src}\n        loading={loading}\n        role={alt ? undefined : 'presentation'}\n        alt={alt || ''}\n        aria-hidden={alt ? undefined : 'true'}\n      />\n    );\n  },\n);\n","import { forwardRef } from 'react';\nimport { getWordmarkSrc } from './config';\n\nconst COLOR = ['inverted', 'primary'] as const;\n\nexport type LogoColor = (typeof COLOR)[number] | 'currentColor';\n\nexport type WordmarkProps = {\n  className?: string;\n  role?: React.ImgHTMLAttributes<HTMLImageElement>['role'];\n  /**\n   * Alternate text.\n   *\n   * @default Volvo\n   */\n  alt?: string;\n\n  /**\n   * Set the height of the wordmark (use multiples of 8). The width will be set to 13 times the height.\n   *\n   * @default 8\n   */\n  height?: number;\n};\n\ntype WordmarkStyle = React.CSSProperties & {\n  '--mask-url': string;\n};\n\n/**\n * Wordmark renders an `img` with a src on the volvocars.com CDN, automatically picking up the primary foreground color for the current color mode\n * and zooming with the browser font size.\n */\nexport const Wordmark = forwardRef<HTMLImageElement, WordmarkProps>(\n  function Wordmark({ alt = 'Volvo', height = 8, ...props }, ref) {\n    const style: WordmarkStyle = {\n      '--mask-url': `url('${getWordmarkSrc()}')`,\n    };\n    return (\n      <img\n        {...props}\n        ref={ref}\n        className={`wordmark text-primary ${props.className || ''}`.trim()}\n        width={height * 13}\n        height={height}\n        src={getWordmarkSrc()}\n        alt={alt}\n        style={style}\n      />\n    );\n  },\n);\n"],"mappings":"0MAsDA,MAAa,GAAA,EAAA,EAAA,WAAA,CACX,SAAqB,CAAE,MAAK,OAAM,OAAM,UAAU,OAAQ,GAAG,GAAS,EAAK,CACzE,IAAM,EAAMA,EAAAA,EAAkB,CAAI,EAC5B,GAAA,EAAA,EAAA,SAAA,CAAqB,cAAe,EAAM,SAAS,EACzD,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,GAAI,EACC,MACM,YACX,MAAO,EACP,OAAQ,EACH,MACI,UACT,KAAM,EAAM,IAAA,GAAY,eACxB,IAAK,GAAO,GACZ,cAAa,EAAM,IAAA,GAAY,MAChC,CAAA,CAEL,CACF,ECxCa,GAAA,EAAA,EAAA,WAAA,CACX,SAAkB,CAAE,MAAM,QAAS,SAAS,EAAG,GAAG,GAAS,EAAK,CAC9D,IAAM,EAAuB,CAC3B,aAAc,QAAQC,EAAAA,EAAe,EAAE,GACzC,EACA,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,GAAI,EACC,MACL,UAAW,yBAAyB,EAAM,WAAa,KAAK,KAAK,EACjE,MAAO,EAAS,GACR,SACR,IAAKA,EAAAA,EAAe,EACf,MACE,OACR,CAAA,CAEL,CACF"}