-
Notifications
You must be signed in to change notification settings - Fork 381
Expand file tree
/
Copy pathBasicSearchInput.figma.tsx
More file actions
52 lines (50 loc) · 1.87 KB
/
BasicSearchInput.figma.tsx
File metadata and controls
52 lines (50 loc) · 1.87 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
import figma from '@figma/code-connect';
import { SearchInput } from '@patternfly/react-core';
// Documentation for SearchInput can be found at https://www.patternfly.org/components/search-input
figma.connect(
SearchInput,
'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=8065-140137',
{
props: {
placeholder: figma.string('✏️ Placeholder text'),
value: figma.string('✏️ Searched text'),
resultsCount: figma.boolean('Show count', {
true: '3',
false: undefined
}),
showNavigableOptions: figma.boolean('Show navigable options', {
true: {
isNextNavigationButtonDisabled: `currentResult === 3`,
isPreviousNavigationButtonDisabled: `currentResult === 1`,
resultsCount: `${currentResult} / ${resultsCount}`,
onNextClick: () => {},
onPreviousClick: () => {}
},
false: undefined
}),
submitSearchButtonLabel: figma.boolean('Show submit button', {
true: {
label: 'Search',
onSearch: () => {}
},
false: undefined
})
},
example: (props) => (
<SearchInput
aria-label="Search basic example"
isNextNavigationButtonDisabled={props.showNavigableOptions.isNextNavigationButtonDisabled}
isPreviousNavigationButtonDisabled={props.showNavigableOptions.isPreviousNavigationButtonDisabled}
onChange={() => {}}
onClear={() => {}}
onNextClick={props.showNavigableOptions.onNextClick}
onPreviousClick={props.showNavigableOptions.onPreviousClick}
onSearch={props.submitSearchButtonLabel.onSearch}
placeholder={props.placeholder}
resultsCount={props.showNavigableOptions.resultsCount}
submitSearchButtonLabel={props.submitSearchButtonLabel.label}
value={props.value}
/>
)
}
);