{"version":3,"file":"Input.mjs","sources":["../../../../../../../../web/src/adminPortal/components/Input.tsx"],"sourcesContent":["import { outlinedInputClasses, SxProps, Theme } from '@mui/material';\nimport React from 'react';\n\nimport { InputCore, InputCoreProps } from '../shared/components/Input';\nimport { Button } from './Button';\nimport { CopyableText } from './CopyableText';\nimport { Label, LabelProps } from './Label';\nimport { Typography } from './Typography';\n\nexport interface InputProps extends InputCoreProps {\n  labelVariant?: 'body1' | 'body2';\n}\n\nconst LabelBody1 = (props: LabelProps) => <Label variant=\"body1\" {...props} />;\n\nconst inputSx: SxProps<Theme> = {\n  color: (theme) => theme.styleConfig.inputs.textColor,\n  fontSize: (theme) => theme.typography.body2.fontSize,\n  borderRadius: (theme) => theme.styleConfig.inputs.borderRadius,\n  borderColor: (theme) => theme.styleConfig.inputs.borderColor,\n  backgroundColor: (theme) => theme.styleConfig.inputs.backgroundColor,\n  [`& .${outlinedInputClasses.notchedOutline}`]: {\n    borderRadius: (theme) => theme.styleConfig.inputs.borderRadius,\n    borderColor: (theme) => theme.styleConfig.inputs.borderColor,\n  },\n  [`& .${outlinedInputClasses.input}`]: {\n    '&::placeholder': {\n      color: (theme) => theme.styleConfig.inputs.placeholderColor,\n    },\n  },\n  [`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]: {\n    borderColor: (theme) => theme.styleConfig.inputs.borderColor,\n  },\n  [`&:hover .${outlinedInputClasses.notchedOutline}, &.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]:\n    {\n      borderColor: (theme) => theme.styleConfig.inputs.textColor,\n    },\n  [`&.${outlinedInputClasses.error}`]: {\n    color: (theme) => theme.styleConfig.colors.error,\n  },\n};\n\nexport const Input = ({ labelVariant, ...props }: InputProps): JSX.Element => {\n  return (\n    <InputCore\n      {...props}\n      ButtonComponent={Button}\n      CopyableTextComponent={CopyableText}\n      LabelComponent={labelVariant === 'body1' ? LabelBody1 : Label}\n      TypographyComponent={Typography}\n      inputSx={inputSx}\n    />\n  );\n};\n"],"names":["LabelBody1","props","React","Label","variant","inputSx","color","theme","styleConfig","inputs","textColor","fontSize","typography","body2","borderRadius","borderColor","backgroundColor","outlinedInputClasses","notchedOutline","input","placeholderColor","disabled","focused","error","colors","Input","labelVariant","InputCore","ButtonComponent","Button","CopyableTextComponent","CopyableText","LabelComponent","TypographyComponent","Typography"],"mappings":";;;;;;;;AAaA,MAAMA,UAAAA,GAAa,CAACC,KAAAA,iBAAsBC,EAAA,CAAA,aAAA,CAACC,KAAAA,EAAAA;QAAMC,OAAAA,EAAQ,OAAA;AAAS,QAAA,GAAGH;;AAErE,MAAMI,OAAAA,GAA0B;AAC9BC,IAAAA,KAAAA,EAAO,CAACC,KAAAA,GAAUA,KAAAA,CAAMC,WAAW,CAACC,MAAM,CAACC,SAAS;AACpDC,IAAAA,QAAAA,EAAU,CAACJ,KAAAA,GAAUA,KAAAA,CAAMK,UAAU,CAACC,KAAK,CAACF,QAAQ;AACpDG,IAAAA,YAAAA,EAAc,CAACP,KAAAA,GAAUA,KAAAA,CAAMC,WAAW,CAACC,MAAM,CAACK,YAAY;AAC9DC,IAAAA,WAAAA,EAAa,CAACR,KAAAA,GAAUA,KAAAA,CAAMC,WAAW,CAACC,MAAM,CAACM,WAAW;AAC5DC,IAAAA,eAAAA,EAAiB,CAACT,KAAAA,GAAUA,KAAAA,CAAMC,WAAW,CAACC,MAAM,CAACO,eAAe;AACpE,IAAA,CAAC,CAAC,GAAG,EAAEC,qBAAqBC,cAAc,CAAA,CAAE,GAAG;AAC7CJ,QAAAA,YAAAA,EAAc,CAACP,KAAAA,GAAUA,KAAAA,CAAMC,WAAW,CAACC,MAAM,CAACK,YAAY;AAC9DC,QAAAA,WAAAA,EAAa,CAACR,KAAAA,GAAUA,KAAAA,CAAMC,WAAW,CAACC,MAAM,CAACM;AACnD,KAAA;AACA,IAAA,CAAC,CAAC,GAAG,EAAEE,qBAAqBE,KAAK,CAAA,CAAE,GAAG;QACpC,gBAAA,EAAkB;AAChB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