{"version":3,"names":[],"sources":["otp-field-root-types.ts"],"sourcesContent":["import type {\n\tBaseUIChangeEventDetails,\n\tBaseUIGenericEventDetails,\n\tREASONS,\n} from \"../../internals/change-event-details\";\nimport type { FieldRootState } from \"../../internals/field-constants\";\nimport type { OTPValidationType } from \"../utils/otp.ts\";\n\nexport type OTPFieldValidationType = OTPValidationType;\n\n/**\n * `reason` strings the root's change-event details can carry. Matches React's\n * `OTPFieldRootChangeEventReason`.\n */\nexport type OTPFieldRootChangeEventReason =\n\t| (typeof REASONS)[\"inputChange\"]\n\t| (typeof REASONS)[\"inputClear\"]\n\t| (typeof REASONS)[\"inputPaste\"]\n\t| (typeof REASONS)[\"keyboard\"];\n\nexport type OTPFieldRootChangeEventDetails =\n\tBaseUIChangeEventDetails<OTPFieldRootChangeEventReason>;\n\nexport type OTPFieldRootInvalidEventReason =\n\t| (typeof REASONS)[\"inputChange\"]\n\t| (typeof REASONS)[\"inputPaste\"];\n\nexport type OTPFieldRootInvalidEventDetails =\n\tBaseUIGenericEventDetails<OTPFieldRootInvalidEventReason>;\n\nexport type OTPFieldRootCompleteEventReason =\n\t| (typeof REASONS)[\"inputChange\"]\n\t| (typeof REASONS)[\"inputPaste\"];\n\nexport type OTPFieldRootCompleteEventDetails =\n\tBaseUIGenericEventDetails<OTPFieldRootCompleteEventReason>;\n\n/**\n * Public state emitted by the root to `class` / `style` / `render` callbacks\n * and `data-*` attribute projection. Extends the field-root state (valid,\n * touched, dirty, filled, focused, disabled) with OTP-specific slots.\n */\nexport interface OTPFieldRootState extends FieldRootState {\n\t/** Whether all slots are filled. */\n\tcomplete: boolean;\n\t/** Total slot count. */\n\tlength: number;\n\t/** Read-only flag mirrored from props. */\n\treadOnly: boolean;\n\t/** Required flag mirrored from props. */\n\trequired: boolean;\n\t/** Concatenated OTP value. */\n\tvalue: string;\n}\n\n/**\n * Per-slot state emitted by `<OTPField.Input>`. Swaps `filled` / `value` for\n * the slot-local values and adds the slot `index`.\n */\nexport interface OTPFieldInputState\n\textends Omit<OTPFieldRootState, \"filled\" | \"value\"> {\n\t/** Whether this slot has a character. */\n\tfilled: boolean;\n\t/** Index of this slot (DOM order). */\n\tindex: number;\n\t/** Character rendered in this slot (or empty string). */\n\tvalue: string;\n}\n"],"mappings":"","ignoreList":[]}