-
Notifications
You must be signed in to change notification settings - Fork 382
Expand file tree
/
Copy pathInputField.figma.tsx
More file actions
68 lines (66 loc) · 2.11 KB
/
InputField.figma.tsx
File metadata and controls
68 lines (66 loc) · 2.11 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
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
import figma from '@figma/code-connect';
import { Button, FormGroup, FormGroupLabelHelp, Popover } from '@patternfly/react-core';
import MinusIcon from '@patternfly/react-icons/dist/esm/icons/minus-icon';
// Documentation for InputField can be found at https://www.patternfly.org/components/form
figma.connect(
FormGroup,
'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=157-788&m=dev',
{
props: {
// boolean
label: figma.boolean('Label', {
true: 'Input field',
false: undefined
}),
minusIcon: figma.boolean('Minus icon', {
true: <Button icon={<MinusIcon />} variant="plain" hasNoPadding aria-label="Delete field" />,
false: undefined
}),
textInput: figma.children('Text inputs'),
helperText: figma.children('HelperText')
},
example: (props) => (
<FormGroup
label={props.label}
labelHelp={
<Popover
triggerRef={labelHelpRef}
headerContent={
<div>
The{' '}
<a href="https://schema.org/name" target="_blank" rel="noreferrer">
name
</a>{' '}
of a{' '}
<a href="https://schema.org/Person" target="_blank" rel="noreferrer">
Person
</a>
</div>
}
bodyContent={
<div>
Often composed of{' '}
<a href="https://schema.org/givenName" target="_blank" rel="noreferrer">
givenName
</a>{' '}
and{' '}
<a href="https://schema.org/familyName" target="_blank" rel="noreferrer">
familyName
</a>
.
</div>
}
>
<FormGroupLabelHelp ref={labelHelpRef} aria-label="More info for name field" />
</Popover>
}
isRequired
fieldId="simple-form-name-01"
>
{props.textInput}
{props.minusIcon}
{props.helperText}
</FormGroup>
)
}
);