-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathControlledField.tsx
More file actions
31 lines (26 loc) · 1.15 KB
/
ControlledField.tsx
File metadata and controls
31 lines (26 loc) · 1.15 KB
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
import React, { PropsWithChildren } from 'react'
import { ControlledCheckbox } from './ControlledCheckbox'
import { ControlledCheckboxGroup } from './ControlledCheckboxGroup'
import { ControlledDatePicker } from './ControlledDatePicker'
import { ControlledInput } from './ControlledInput'
import { ControlledRadioGroup } from './ControlledRadioGroup'
import { ControlledSelect } from './ControlledSelect'
type ControlledFieldComposition = React.FC<PropsWithChildren> & {
Input: typeof ControlledInput
CheckboxGroup: typeof ControlledCheckboxGroup
RadioGroup: typeof ControlledRadioGroup
Checkbox: typeof ControlledCheckbox
Select: typeof ControlledSelect
DatePicker: typeof ControlledDatePicker
}
const ControlledField: ControlledFieldComposition = ({ children }) => {
return <React.Fragment>{children}</React.Fragment>
}
ControlledField.Input = ControlledInput
ControlledField.CheckboxGroup = ControlledCheckboxGroup
ControlledField.Checkbox = ControlledCheckbox
ControlledField.RadioGroup = ControlledRadioGroup
ControlledField.Select = ControlledSelect
ControlledField.DatePicker = ControlledDatePicker
export { ControlledField }
export * from './types'