{"version":3,"file":"Anchor.cjs","sources":["../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import cx from 'clsx';\nimport { polymorphicFactory, PolymorphicFactory, useProps } from '../../core';\nimport { Text, TextCssVariables, TextProps, TextStylesNames, TextVariant } from '../Text';\nimport { AnchorRootStyle } from './Anchor.css';\n\nexport type AnchorStylesNames = TextStylesNames;\nexport type AnchorVariant = TextVariant;\nexport type AnchorCssVariables = TextCssVariables;\n\nexport interface AnchorProps extends Omit<TextProps, 'span'> {\n  /** Determines in which cases link should have `text-decoration: underline` styles, `hover` by default */\n  underline?: 'always' | 'hover' | 'never';\n}\n\nexport type AnchorFactory = PolymorphicFactory<{\n  props: AnchorProps;\n  defaultComponent: 'a';\n  defaultRef: HTMLAnchorElement;\n  stylesNames: AnchorStylesNames;\n  vars: AnchorCssVariables;\n  variant: AnchorVariant;\n}>;\n\nconst defaultProps: Partial<AnchorProps> = {\n  underline: 'hover',\n};\n\nexport const Anchor = polymorphicFactory<AnchorFactory>((props, ref) => {\n  const { underline, className, unstyled, mod, ...others } = useProps(\n    'Anchor',\n    defaultProps,\n    props\n  );\n  return (\n    <Text\n      component=\"a\"\n      ref={ref}\n      className={cx({ [AnchorRootStyle]: !unstyled }, className)}\n      {...others}\n      mod={[{ underline }, mod]}\n      __staticSelector=\"Anchor\"\n      unstyled={unstyled}\n    />\n  );\n});\n\nAnchor.displayName = '@raikou/core/Anchor';\n"],"names":["polymorphicFactory","useProps","jsx","Text","cx","AnchorRootStyle"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,MAAM,YAAqC,GAAA;AAAA,EACzC,SAAW,EAAA;AACb,CAAA;AAEO,MAAM,MAAS,GAAAA,qCAAA,CAAkC,CAAC,KAAA,EAAO,GAAQ,KAAA;AACtE,EAAA,MAAM,EAAE,SAAW,EAAA,SAAA,EAAW,UAAU,GAAK,EAAA,GAAG,QAAW,GAAAC,iBAAA;AAAA,IACzD,QAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA,GACF;AACA,EACE,uBAAAC,cAAA;AAAA,IAACC,SAAA;AAAA,IAAA;AAAA,MACC,SAAU,EAAA,GAAA;AAAA,MACV,GAAA;AAAA,MACA,SAAA,EAAWC,oBAAG,EAAE,CAACC,0BAAe,GAAG,CAAC,QAAS,EAAA,EAAG,SAAS,CAAA;AAAA,MACxD,GAAG,MAAA;AAAA,MACJ,GAAK,EAAA,CAAC,EAAE,SAAA,IAAa,GAAG,CAAA;AAAA,MACxB,gBAAiB,EAAA,QAAA;AAAA,MACjB;AAAA;AAAA,GACF;AAEJ,CAAC;AAED,MAAA,CAAO,WAAc,GAAA,qBAAA;;;;"}