File tree 3 files changed +15
-1
lines changed
packages/fields-document/src/DocumentEditor/component-blocks
3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import {
23
23
Checkbox ,
24
24
Text ,
25
25
TextField ,
26
+ TextArea ,
26
27
} from '#fields-ui'
27
28
28
29
export * from './api-shared'
@@ -37,13 +38,25 @@ export const fields = {
37
38
text ( {
38
39
label,
39
40
defaultValue = '' ,
41
+ displayMode,
40
42
} : {
41
43
label : string
42
44
defaultValue ?: string
45
+ displayMode ?: 'input' | 'textarea'
43
46
} ) : FormField < string , undefined > {
44
47
return {
45
48
kind : 'form' as const ,
46
49
Input ( { value, onChange, autoFocus } : InputArgs < string > ) {
50
+ if ( displayMode === 'textarea' ) {
51
+ return (
52
+ < TextArea
53
+ autoFocus = { autoFocus }
54
+ label = { label }
55
+ onChange = { x => onChange ?.( x ) }
56
+ value = { value }
57
+ />
58
+ )
59
+ }
47
60
return (
48
61
< TextField
49
62
autoFocus = { autoFocus }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ function throwAlways(): never {
5
5
}
6
6
7
7
export const TextField = throwAlways ,
8
+ TextArea = throwAlways ,
8
9
Checkbox = throwAlways ,
9
10
Text = throwAlways ,
10
11
makeIntegerFieldInput = ( ) => throwAlways ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import { VStack } from '@keystar/ui/layout'
12
12
import { TagGroup } from '@keystar/ui/tag'
13
13
import { Text } from '@keystar/ui/typography'
14
14
15
- export { TextField } from '@keystar/ui/text-field'
15
+ export { TextField , TextArea } from '@keystar/ui/text-field'
16
16
export { Text } from '@keystar/ui/typography'
17
17
export { Checkbox } from '@keystar/ui/checkbox'
18
18
You can’t perform that action at this time.
0 commit comments