{"version":3,"file":"Label.cjs","sources":["../../../../src/components/input-group/Label.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { type FC } from \"react\";\nimport type { LabelProps } from \"./types.js\";\n\nexport const Label: FC<LabelProps> = ({\n    variant = \"small\",\n    srOnly,\n    children,\n    standAlone,\n    htmlFor,\n    className = \"\",\n    ...rest\n}) => {\n    const labelClassNames = clsx(\"jkl-label\", className, {\n        [`jkl-label--${variant}`]: variant,\n        \"jkl-label--sr-only\": srOnly,\n    });\n\n    const C = standAlone ? \"label\" : \"span\";\n\n    if (!standAlone && htmlFor) {\n        htmlFor = undefined;\n        if (process.env.NODE_ENV !== \"production\") {\n            console.warn(\n                \"WARNING: The standard Label component renders as a <span> element, which does not take a htmlFor prop. If you want the Label to belong to a specific input, use the standAlone prop, which renders as a <label> element instead. In most cases the Label component should not be used directly, as it is part of all our input components.\",\n            );\n        }\n    }\n\n    return (\n        <C {...rest} className={labelClassNames} htmlFor={htmlFor}>\n            {children}\n        </C>\n    );\n};\n"],"names":["variant","srOnly","children","standAlone","htmlFor","className","rest","labelClassNames","clsx","C","process","env","NODE_ENV","console","warn"],"mappings":"4LAIqC,EACjCA,QAAAA,EAAU,QACVC,OAAAA,EACAC,SAAAA,EACAC,WAAAA,EACAC,QAAAA,EACAC,UAAAA,EAAY,MACTC,MAEH,MAAMC,EAAkBC,EAAAA,KAAK,YAAaH,EAAW,CACjD,CAAC,cAAcL,KAAYA,EAC3B,qBAAsBC,IAGpBQ,EAAIN,EAAa,QAAU,OAEjC,OAAKA,GAAcC,IACfA,OAAU,EACmB,eAAzBM,QAAQC,IAAIC,UACZC,QAAQC,KACJ,qVAMPL,EAAA,IAAMH,EAAMD,UAAWE,EAAiBH,QAAAA,EACpCF,SAAAA"}