blob: 23c6a13617b86e47780e797656fd5329de904283 (
plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
import React from 'react';
import { Helmet } from 'react-helmet';
import brand from 'ba-api/brand';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import { SourceReader, PapperBlock } from 'ba-components';
import { Grid } from '@material-ui/core';
import {
AutoSuggest,
TagSuggestions,
SelectSuggestions,
SelectSuggestionTags,
HighlightSuggest
} from './demos';
const styles = ({
root: {
flexGrow: 1,
}
});
class Textbox extends React.Component {
render() {
const { classes } = this.props;
const title = brand.name + ' - Form';
const description = brand.desc;
const docSrc = 'containers/Forms/demos/';
return (
<div>
<Helmet>
<title>{title}</title>
<meta name="description" content={description} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="twitter:title" content={title} />
<meta property="twitter:description" content={description} />
</Helmet>
<div className={classes.root}>
<Grid container spacing={3}>
<Grid item md={12}>
<PapperBlock title="Highlight Suggestion" desc="In the following example, we demonstrate how to use react-autosuggest. It's also using autosuggest-highlight for the highlighting logic.">
<div>
<HighlightSuggest />
<SourceReader componentName={docSrc + 'HighlightSuggest.js'} />
</div>
</PapperBlock>
</Grid>
<Grid item md={6}>
<PapperBlock title="Auto Suggestion" desc="The autocomplete is a normal text input enhanced by a panel of suggested options.">
<div>
<AutoSuggest />
<SourceReader componentName={docSrc + 'AutoSuggest.js'} />
</div>
</PapperBlock>
</Grid>
<Grid item md={6}>
<PapperBlock title="Tag Suggestion" desc="In the following example, we demonstrate with tag input and how to use downshift. It mean press Shift + down to show autocomplete">
<div>
<TagSuggestions />
<SourceReader componentName={docSrc + 'TagSuggestions.js'} />
</div>
</PapperBlock>
</Grid>
<Grid item md={6}>
<PapperBlock title="Select Suggestion" desc="In the following example, we demonstrate how to use react-select.">
<div>
<SelectSuggestions />
<SourceReader componentName={docSrc + 'SelectSuggestions.js'} />
</div>
</PapperBlock>
</Grid>
<Grid item md={6}>
<PapperBlock title="Select Tag Suggestion" desc="In the following example, we demonstrate how to combine tag input and react-select.">
<div>
<SelectSuggestionTags />
<SourceReader componentName={docSrc + 'SelectSuggestionTags.js'} />
</div>
</PapperBlock>
</Grid>
</Grid>
</div>
</div>
);
}
}
Textbox.propTypes = {
classes: PropTypes.object.isRequired,
};
export default withStyles(styles)(Textbox);
|