{"version":3,"file":"SingleInput.cjs","sources":["../../../../lib/components/Input/SingleInput.tsx"],"sourcesContent":["import styled, { type DataAttributes } from 'styled-components';\nimport { forwardRef } from 'react';\nimport type { InputLineProps } from '@admiral-ds/react-ui';\nimport { InputLine } from '@admiral-ds/react-ui';\nimport type { DimensionInterface, InputDimension } from './types';\n\nfunction getInputWidth(dimension: InputDimension, width?: string | number) {\n  if (width) {\n    return width;\n  }\n  switch (dimension) {\n    case 's':\n      return '73px';\n    case 'xl':\n    case 'm':\n    default:\n      return '83px';\n  }\n}\n\nconst Wrapper = styled.div<{ $dimension: InputDimension; $width?: string | number }>`\n  width: ${(p) => getInputWidth(p.$dimension, p.$width)};\n`;\n\nexport interface SingleInputProps extends InputLineProps, DimensionInterface, DataAttributes {}\n\nexport const SingleInput = forwardRef<HTMLInputElement, SingleInputProps>(\n  ({ dimension = 'm', width, ...props }, ref) => {\n    return (\n      <Wrapper $width={width} $dimension={dimension}>\n        <InputLine ref={ref} {...props} />\n      </Wrapper>\n    );\n  },\n);\n"],"names":["getInputWidth","dimension","width","Wrapper","styled","div","withConfig","displayName","componentId","p","$dimension","$width","SingleInput","forwardRef","props","ref","jsx","InputLine"],"mappings":";;;;;;;;AAMA,SAASA,cAAcC,WAA2BC,OAAyB;AACzE,MAAIA,OAAO;AACT,WAAOA;AAAAA,EACT;AACA,UAAQD,WAAAA;AAAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL;AACE,aAAO;AAAA,EAAA;AAEb;AAEA,MAAME,UAAUC,gBAAAA,QAAOC,IAAGC,WAAA;AAAA,EAAAC,aAAA;AAAA,EAAAC,aAAA;AAAA,CAAA,EAAA,CAAA,UAAA,GAAA,GACdC,CAAAA,MAAMT,cAAcS,EAAEC,YAAYD,EAAEE,MAAM,CAAC;AAKhD,MAAMC,cAAcC,MAAAA,WACzB,CAAC;AAAA,EAAEZ,YAAY;AAAA,EAAKC;AAAAA,EAAO,GAAGY;AAAM,GAAGC,QAAQ;AAC7C,SACEC,2BAAAA,IAAC,SAAA,EAAQ,QAAQd,OAAO,YAAYD,WAClC,UAAAe,2BAAAA,IAACC,QAAAA,WAAA,EAAU,KAAU,GAAIH,MAAAA,CAAM,EAAA,CACjC;AAEJ,CACF;;"}