-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Form.d.ts
74 lines (56 loc) · 1.92 KB
/
Form.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import * as React from 'react'
import FormField from './FormField'
import FormButton from './FormButton'
import FormCheckbox from './FormCheckbox'
import FormDropdown from './FormDropdown'
import FormGroup from './FormGroup'
import FormInput from './FormInput'
import FormRadio from './FormRadio'
import FormSelect from './FormSelect'
import FormTextArea from './FormTextArea'
import { ForwardRefComponent } from '../../generic'
export interface FormProps extends StrictFormProps {
[key: string]: any
}
export interface StrictFormProps {
/** An element type to render as (string or function). */
as?: any
/** The HTML form action */
action?: string
/** Primary content. */
children?: React.ReactNode
/** Additional classes. */
className?: string
/** Automatically show any error Message children. */
error?: boolean
/** A form can have its color inverted for contrast. */
inverted?: boolean
/** Automatically show a loading indicator. */
loading?: boolean
/** The HTML form submit handler. */
onSubmit?: (event: React.FormEvent<HTMLFormElement>, data: FormProps) => void
/** A comment can contain a form to reply to a comment. This may have arbitrary content. */
reply?: boolean
/** A form can vary in size. */
size?: string
/** Automatically show any success Message children. */
success?: boolean
/** A form can prevent itself from stacking on mobile. */
unstackable?: boolean
/** Automatically show any warning Message children. */
warning?: boolean
/** Forms can automatically divide fields to be equal width. */
widths?: 'equal'
}
declare const Form: ForwardRefComponent<FormProps, HTMLFormElement> & {
Field: typeof FormField
Button: typeof FormButton
Checkbox: typeof FormCheckbox
Dropdown: typeof FormDropdown
Group: typeof FormGroup
Input: typeof FormInput
Radio: typeof FormRadio
Select: typeof FormSelect
TextArea: typeof FormTextArea
}
export default Form