{"version":3,"file":"Label.cjs","sourceRoot":"","sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAAyE;AACzE,+CAA0C;AAE1C,uDAA+C;AAC/C,4CAA+B;AAIlB,QAAA,KAAK,GAAG,IAAA,kBAAU,EAC7B,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACvD,8BAAC,WAAI,IACH,OAAO,EAAE,kCAAW,CAAC,MAAM,EAC3B,UAAU,EAAE,iCAAU,CAAC,MAAM,KACzB,SAAS,EACb,OAAO,QACP,SAAS,EAAE,IAAA,kBAAO,EAChB,0BAA0B;IAC1B,qEAAqE;IACrE,oEAAoE;IACpE,2DAA2D;IAC3D,OAAO,IAAI,gBAAgB,EAC3B,SAAS,CACV;IAED,yCAAO,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,IAC9B,QAAQ,CACH,CACH,CACR,CACF,CAAC;AAEF,aAAK,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"]}