{"version":3,"file":"types.mjs","sources":["../../../packages/input/types.ts"],"sourcesContent":["import { ChangeEventHandler, ReactNode, RefObject } from 'react'\nimport { LidoComponentProps } from '../utils/index.js'\nexport type { Theme } from '../theme/index.js'\n\nexport enum InputMessageVariant {\n  error,\n  warning,\n  success,\n}\nexport type InputMessageVariants = keyof typeof InputMessageVariant\n\nexport enum InputType {\n  text,\n  password,\n  number,\n  email,\n  search,\n  tel,\n  url,\n}\nexport type InputTypes = keyof typeof InputType\n\nexport enum InputVariant {\n  small,\n  default,\n}\nexport type InputVariants = keyof typeof InputVariant\n\nexport enum InputColor {\n  default,\n  accent,\n}\nexport type InputColors = keyof typeof InputColor\n\ntype CommonProps = {\n  label?: ReactNode\n  error?: ReactNode | boolean\n  warning?: ReactNode | boolean\n  success?: ReactNode | boolean\n  variant?: InputVariants\n  color?: InputColors\n  active?: boolean\n  fullwidth?: boolean\n  wrapperRef?: RefObject<HTMLLabelElement>\n  as?: never\n}\n\nexport type InputProps = LidoComponentProps<\n  'input',\n  CommonProps & {\n    type?: InputTypes\n    leftDecorator?: ReactNode\n    rightDecorator?: ReactNode\n  }\n>\n\nexport type TextareaProps = LidoComponentProps<'textarea', CommonProps>\n\nexport type InputGroupProps = LidoComponentProps<\n  'span',\n  {\n    fullwidth?: boolean\n    error?: ReactNode\n    success?: ReactNode\n    warning?: ReactNode\n  }\n>\n\ninterface ValueLabel {\n  value: number\n  label: ReactNode\n}\n\ntype SliderProps = {\n  value: number\n  onChange?: ChangeEventHandler<HTMLInputElement>\n  min?: number\n  max?: number\n  minLabel?: ReactNode\n  maxLabel?: ReactNode\n  step?: number\n  getLabel?: (value: number) => ReactNode\n  borderNone?: boolean\n  labels?: ValueLabel[]\n  onLabelClick?: (value: number) => unknown\n}\n\nexport type SliderInputProps = LidoComponentProps<'input', SliderProps>\n\ntype SliderOptionValue = string | number\n\ninterface SliderOption {\n  value: SliderOptionValue\n  label: ReactNode\n}\n\ninterface OptionsSliderProps {\n  options: [SliderOption, SliderOption, ...SliderOption[]] // this is declaration like T[] but with \"at least 2 elements\" constraint\n  value?: SliderOptionValue // if value is not provided, component should act isolated; initial value should be first option\n  onChange: (value: SliderOptionValue, valueIndex: number) => unknown\n}\n\nexport type OptionsSliderInputProps = Omit<\n  SliderInputProps,\n  'value' | 'onChange'\n> &\n  OptionsSliderProps\n"],"names":["InputMessageVariant","InputType","InputVariant","InputColor"],"mappings":"AAIYA,IAAAA,mBAAmB,0BAAnBA,mBAAmB,EAAA;AAAnBA,EAAAA,mBAAmB,CAAnBA,mBAAmB,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA,CAAA;AAAnBA,EAAAA,mBAAmB,CAAnBA,mBAAmB,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA,CAAA;AAAnBA,EAAAA,mBAAmB,CAAnBA,mBAAmB,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA,CAAA;AAAA,EAAA,OAAnBA,mBAAmB,CAAA;AAAA,CAAA,CAAA,EAAA,EAAA;AAOnBC,IAAAA,SAAS,0BAATA,SAAS,EAAA;AAATA,EAAAA,SAAS,CAATA,SAAS,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAA,CAAA;AAATA,EAAAA,SAAS,CAATA,SAAS,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAA,CAAA;AAATA,EAAAA,SAAS,CAATA,SAAS,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAA,CAAA;AAATA,EAAAA,SAAS,CAATA,SAAS,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA,CAAA;AAATA,EAAAA,SAAS,CAATA,SAAS,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAA,CAAA;AAATA,EAAAA,SAAS,CAATA,SAAS,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,GAAA,KAAA,CAAA;AAATA,EAAAA,SAAS,CAATA,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