{"version":3,"file":"UpwardLink.cjs","sources":["../../../../src/components/TextLink/UpwardLink/UpwardLink.tsx"],"sourcesContent":["'use client'\n\nimport { type ComponentProps, memo, useMemo } from 'react'\nimport { type VariantProps, tv } from 'tailwind-variants'\n\nimport { TextLink } from '..'\nimport { useEnvironment } from '../../../hooks/useEnvironment'\nimport { FaArrowLeftIcon } from '../../Icon'\n\nconst classNameGenerator = tv({\n  base: 'shr-leading-none',\n  variants: {\n    indent: {\n      true: '-shr-translate-x-1.25',\n      false: '',\n    },\n  },\n})\n\ntype Props = Omit<ComponentProps<typeof TextLink>, 'prefix' | 'suffix'> &\n  VariantProps<typeof classNameGenerator> & {\n    /** `TextLink`に渡す `elementAs` をオプションで指定 */\n    elementAs?: ComponentProps<typeof TextLink>['elementAs']\n  }\n\nexport const UpwardLink = memo<Props>(({ indent, className, ...rest }) => {\n  const { mobile } = useEnvironment()\n  const actualClassName = useMemo(\n    () => classNameGenerator({ indent: indent ?? !mobile, className }),\n    [indent, mobile, className],\n  )\n\n  return (\n    <div className={actualClassName}>\n      <TextLink {...rest} prefix={<FaArrowLeftIcon />} />\n    </div>\n  )\n})\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AASA;AACE;AACA;AACE;AACE;AACA;AACD;AACF;AACF;AAQM;AACL;AACA;AAKA;AAKF;;"}