{"version":3,"file":"otpInput.types.mjs","names":[],"sources":["../../../../package/common/otpInput/otpInput.types.ts"],"sourcesContent":["import type React from 'react';\nimport type { FormValidator } from 'services/formValidation';\nimport type { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';\n\nexport type OtpInputSlots = 'root' | 'label' | 'inputs' | 'input' | 'separator';\n\nexport enum OtpInputCharset {\n  /** Digits only (0-9). Shows a numeric mobile keyboard. */\n  Numeric = 'numeric',\n  /** Letters and digits. */\n  Alphanumeric = 'alphanumeric',\n}\n\n/** Text OtpInput renders of its own, for translating it. */\nexport interface OtpInputLabels {\n  /** The group of boxes, used when no `label` is given. */\n  field?: string;\n  /** One box, given its 1-based position and how many there are. */\n  digit?: (position: number, length: number) => string;\n}\n\nexport interface OtpInputProps extends Omit<HtmlProps, 'onChange'> {\n  /** Number of character boxes. Default 6. */\n  length?: number;\n  /** Current code as a plain string, e.g. \"123456\". */\n  value?: string;\n  /** Fired on every change with the full current code (may be shorter than `length`). */\n  onChange?: ((value: string) => void) | null;\n  /** Fired once, when the code reaches `length` characters. */\n  onComplete?: ((value: string) => void) | null;\n  formValidator?: FormValidator | null;\n\n  /** Restricts which characters can be typed and picks the mobile keyboard. Default `numeric`. */\n  charset?: OtpInputCharset;\n  /** Render each box's value as a dot, like a password field. */\n  masked?: boolean;\n  /** Draw a small gap after these 1-based box indices, e.g. `[3]` to split 6 boxes into 3+3. */\n  groupAfter?: number[];\n\n  label?: string;\n  isValid?: boolean;\n  /** Shown in an error Tooltip on focus/hover once `isValid` is `false` (or, with a\n   * `formValidator`, once its `shouldShowError` is true). Persists until the value changes\n   * `isValid`/`formValidator`'s error state itself — see `clearOnError` to auto-dismiss it. */\n  errorMessage?: string;\n  isRequired?: boolean;\n  /** When an error newly appears (`isValid`/`formValidator` turning invalid), clear every box and\n   * refocus the first one after `clearErrorDelay`, so the next attempt starts clean instead of the\n   * user editing individual wrong digits (and re-triggering `onComplete` on every keystroke while\n   * the code stays at full length). Default `false`. */\n  clearOnError?: boolean;\n  /** Delay in ms before `clearOnError` clears the boxes, so the wrong code and error message are\n   * still visible for a moment first. Default `900`. */\n  clearErrorDelay?: number;\n  disabled?: boolean;\n  /** Focuses the first empty box (or the first box) on mount. */\n  autoFocus?: boolean;\n\n  className?: string;\n  style?: React.CSSProperties;\n  /** Ref to the root element. */\n  ref?: React.Ref<HTMLDivElement>;\n  classNames?: SlotClassNames<OtpInputSlots>;\n  styles?: SlotStyles<OtpInputSlots>;\n  /** Overrides the text OtpInput renders of its own. Merged per key. */\n  labels?: OtpInputLabels;\n}\n"],"mappings":"aAMA,IAAY,EAAL,SAAA,EAAA,OAEL,GAAA,QAAA,UAEA,EAAA,aAAA,gBACF,EAAA,CAAA,CAAA"}