{"version":3,"file":"InputGroup.mjs","sources":["../../../packages/input/InputGroup.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef } from 'react'\nimport { InputMessageStyle } from './InputStyles.js'\nimport { InputGroupStyle, InputGroupContentStyle } from './InputGroupStyles.js'\nimport { InputGroupProps } from './types.js'\n\nexport const InputGroup = forwardRef(\n  (\n    {\n      fullwidth = false,\n      error,\n      success,\n      warning,\n      children,\n      ...rest\n    }: InputGroupProps,\n    ref?: ForwardedRef<HTMLSpanElement>,\n  ) => {\n    const hasError = !!error\n    const hasSuccess = !!success && !error\n    const hasWarning = !hasError && !!warning // `error` overrides `warning`\n\n    return (\n      <InputGroupStyle $fullwidth={fullwidth} {...rest} ref={ref}>\n        <InputGroupContentStyle>{children}</InputGroupContentStyle>\n        {hasError && (\n          <InputMessageStyle $variant='error'>{error}</InputMessageStyle>\n        )}\n        {hasSuccess && (\n          <InputMessageStyle $variant='success'>{success}</InputMessageStyle>\n        )}\n        {hasWarning && (\n          <InputMessageStyle $variant='warning'>{warning}</InputMessageStyle>\n        )}\n      </InputGroupStyle>\n    )\n  },\n)\nInputGroup.displayName = 'InputGroup'\n"],"names":["InputGroup","forwardRef","_ref","ref","fullwidth","error","success","warning","children","rest","hasError","hasSuccess","hasWarning","_jsxs","InputGroupStyle","$fullwidth","_jsx","InputGroupContentStyle","InputMessageStyle","$variant","displayName"],"mappings":";;;;;AAKO,MAAMA,UAAU,gBAAGC,UAAU,CAClC,CAAAC,IAAA,EASEC,GAAmC,KAChC;EAAA,IATH;AACEC,IAAAA,SAAS,GAAG,KAAK;IACjBC,KAAK;IACLC,OAAO;IACPC,OAAO;IACPC,QAAQ;IACR,GAAGC,IAAAA;AACY,GAAC,GAAAP,IAAA,CAAA;AAGlB,EAAA,MAAMQ,QAAQ,GAAG,CAAC,CAACL,KAAK,CAAA;AACxB,EAAA,MAAMM,UAAU,GAAG,CAAC,CAACL,OAAO,IAAI,CAACD,KAAK,CAAA;EACtC,MAAMO,UAAU,GAAG,CAACF,QAAQ,IAAI,CAAC,CAACH,OAAO,CAAC;;EAE1C,oBACEM,IAAA,CAACC,eAAe,EAAA;AAACC,IAAAA,UAAU,EAAEX,SAAU;AAAA,IAAA,GAAKK,IAAI;AAAEN,IAAAA,GAAG,EAAEA,GAAI;IAAAK,QAAA,EAAA,cACzDQ,GAAA,CAACC,sBAAsB,EAAA;AAAAT,MAAAA,QAAA,EAAEA,QAAAA;AAAQ,KAAyB,CAAC,EAC1DE,QAAQ,iBACPM,GAAA,CAACE,iBAAiB,EAAA;AAACC,MAAAA,QAAQ,EAAC,OAAO;AAAAX,MAAAA,QAAA,EAAEH,KAAAA;AAAK,KAAoB,CAC/D,EACAM,UAAU,iBACTK,GAAA,CAACE,iBAAiB,EAAA;AAACC,MAAAA,QAAQ,EAAC,SAAS;AAAAX,MAAAA,QAAA,EAAEF,OAAAA;AAAO,KAAoB,CACnE,EACAM,UAAU,iBACTI,GAAA,CAACE,iBAAiB,EAAA;AAACC,MAAAA,QAAQ,EAAC,SAAS;AAAAX,MAAAA,QAAA,EAAED,OAAAA;AAAO,KAAoB,CACnE,CAAA;AAAA,GACc,CAAC,CAAA;AAEtB,CACF,EAAC;AACDP,UAAU,CAACoB,WAAW,GAAG,YAAY;;;;"}