{"version":3,"file":"Label.mjs","sourceRoot":"","sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,uCAAuC;AACzE,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAC7B,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACvD,oBAAC,IAAI,IACH,OAAO,EAAE,WAAW,CAAC,MAAM,EAC3B,UAAU,EAAE,UAAU,CAAC,MAAM,KACzB,SAAS,EACb,OAAO,QACP,SAAS,EAAE,OAAO,CAChB,0BAA0B;IAC1B,qEAAqE;IACrE,oEAAoE;IACpE,2DAA2D;IAC3D,OAAO,IAAI,gBAAgB,EAC3B,SAAS,CACV;IAED,+BAAO,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,IAC9B,QAAQ,CACH,CACH,CACR,CACF,CAAC;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["import { FontWeight, TextVariant } from '@metamask/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Text } from '../Text';\n\nimport type { LabelProps } from './Label.types';\n\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(\n  ({ htmlFor, className, children, ...textProps }, ref) => (\n    <Text\n      variant={TextVariant.BodyMd}\n      fontWeight={FontWeight.Medium}\n      {...textProps}\n      asChild\n      className={twMerge(\n        'inline-flex items-center',\n        // Mirror the legacy `mm-label--html-for` cursor affordance: when the\n        // label is associated with an input, clicking it focuses the input,\n        // so signal the interactive surface with a pointer cursor.\n        htmlFor && 'cursor-pointer',\n        className,\n      )}\n    >\n      <label ref={ref} htmlFor={htmlFor}>\n        {children}\n      </label>\n    </Text>\n  ),\n);\n\nLabel.displayName = 'Label';\n"]}