{"version":3,"file":"Field.cjs","sourceRoot":"","sources":["../../../../src/jsx/components/form/Field.ts"],"names":[],"mappings":";;;AAWA,mDAAsD;AA6BtD,MAAM,IAAI,GAAG,OAAO,CAAC;AAErB;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,KAAK,GAAG,IAAA,+BAAmB,EAA0B,IAAI,CAAC,CAAC","sourcesContent":["import type { AccountSelectorElement } from './AccountSelector';\nimport type { AddressInputElement } from './AddressInput';\nimport type { AssetSelectorElement } from './AssetSelector';\nimport type { CheckboxElement } from './Checkbox';\nimport type { DateTimePickerElement } from './DateTimePicker';\nimport type { DropdownElement } from './Dropdown';\nimport type { FileInputElement } from './FileInput';\nimport type { InputElement } from './Input';\nimport type { RadioGroupElement } from './RadioGroup';\nimport type { SelectorElement } from './Selector';\nimport type { GenericSnapChildren } from '../../component';\nimport { createSnapComponent } from '../../component';\n\n/**\n * The props of the {@link Field} component.\n *\n * @property label - The label of the field.\n * @property error - The error message of the field.\n * @property children - The input field and the submit button.\n * @category Component Props\n */\nexport type FieldProps = {\n  label?: string | undefined;\n  error?: string | undefined;\n  children:\n    | [InputElement, GenericSnapChildren]\n    | [GenericSnapChildren, InputElement]\n    | [GenericSnapChildren, InputElement, GenericSnapChildren]\n    | DropdownElement\n    | DateTimePickerElement\n    | RadioGroupElement\n    | FileInputElement\n    | InputElement\n    | CheckboxElement\n    | SelectorElement\n    | AssetSelectorElement\n    | AddressInputElement\n    | AccountSelectorElement;\n};\n\nconst TYPE = 'Field';\n\n/**\n * A field component, which is used to create a form field.\n *\n * @param props - The props of the component.\n * @param props.label - The label of the field.\n * @param props.error - The error message of the field.\n * @param props.children - The input field and the submit button.\n * @returns A field element.\n * @example\n * <Field label=\"Username\">\n *   <Input name=\"username\" type=\"text\" />\n *   <Button type=\"submit\">Submit</Button>\n * </Field>\n * @example\n * <Field label=\"Upload file\">\n *   <FileInput name=\"file\" accept={['image/*']} multiple />\n * </Field>\n * @category Components\n */\nexport const Field = createSnapComponent<FieldProps, typeof TYPE>(TYPE);\n\n/**\n * A field element.\n *\n * @see {@link Field}\n * @category Elements\n */\nexport type FieldElement = ReturnType<typeof Field>;\n"]}