{"version":3,"file":"Label.cjs","sources":["../src/Form/Label.tsx"],"sourcesContent":["import type { LabelHTMLAttributes } from 'react';\n\nimport { useFieldContext } from '../Form/useFieldContext.ts';\n\nexport function FieldSetLabel(props: React.PropsWithChildren) {\n  return (\n    <legend className={'tw-h-0 tw-w-0 tw-overflow-hidden'}>\n      {props.children}\n    </legend>\n  );\n}\n\nexport function Label(props: LabelHTMLAttributes<HTMLLabelElement>) {\n  const { id } = useFieldContext();\n  if (Object.hasOwn(props, 'htmlFor') && !props.htmlFor) {\n    return (\n      <>\n        <legend className={'tw-h-0 tw-w-0 tw-overflow-hidden'}>\n          {props.children}\n        </legend>\n        {id && <span {...props} />}\n      </>\n    );\n  }\n  return (\n    <>\n      <legend className={'tw-h-0 tw-w-0 tw-overflow-hidden'}>\n        {props.children}\n      </legend>\n      {id && <label htmlFor={id} {...props} />}\n    </>\n  );\n}\n"],"names":["FieldSetLabel","props","jsx","Label","id","useFieldContext","jsxs","Fragment"],"mappings":"+jBAIO,SAASA,EAAcC,EAAgC,CAC5D,OACGC,EAAA,kBAAA,IAAA,SAAA,CAAO,UAAW,mCAChB,WAAM,QACT,CAAA,CAEJ,CAEO,SAASC,EAAMF,EAA8C,CAC5D,KAAA,CAAE,GAAAG,GAAOC,EAAAA,kBACf,OAAI,OAAO,OAAOJ,EAAO,SAAS,GAAK,CAACA,EAAM,QAGxCK,EAAA,kBAAA,KAAAC,6BAAA,CAAA,SAAA,CAAAL,EAAA,kBAAA,IAAC,SAAO,CAAA,UAAW,mCAChB,SAAAD,EAAM,SACT,EACCG,GAAMF,EAAAA,kBAAAA,IAAC,OAAM,CAAA,GAAGD,CAAO,CAAA,CAC1B,CAAA,CAAA,EAKAK,EAAA,kBAAA,KAAAC,6BAAA,CAAA,SAAA,CAAAL,EAAA,kBAAA,IAAC,SAAO,CAAA,UAAW,mCAChB,SAAAD,EAAM,SACT,EACCG,GAAOF,EAAA,kBAAA,IAAA,QAAA,CAAM,QAASE,EAAK,GAAGH,EAAO,CACxC,CAAA,CAAA,CAEJ"}