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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
import React from 'react';
import { Helmet } from 'react-helmet';
import brand from 'ba-api/brand';
import { withStyles } from '@material-ui/core/styles';
import PropTypes from 'prop-types';
import { SourceReader, PapperBlock } from 'ba-components';
import { Grid } from '@material-ui/core';
import {
SimpleTabs,
LongTextTabs,
FixedTabs,
CenteredTabs,
IconTabs,
ScrollTabs,
ScrollIconTabs,
DisabledTab,
CustomTabs,
BottomNav
} from './demos';
const styles = ({
root: {
flexGrow: 1,
}
});
class Tabs extends React.Component {
render() {
const title = brand.name + ' - UI Elements';
const description = brand.desc;
const { classes } = this.props;
const docSrc = 'containers/UiElements/demos/Tabs/';
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}>
<PapperBlock title="Simple Tabs" desc="A simple example with no frills.">
<div>
<SimpleTabs />
<SourceReader componentName={docSrc + 'SimpleTabs.js'} />
</div>
</PapperBlock>
<PapperBlock title="Wrapped Labels" desc="Long labels will automatically wrap on tabs. If the label is too long for the tab, it will overflow and the text will not be visible.">
<div>
<LongTextTabs />
<SourceReader componentName={docSrc + 'LongTextTabs.js'} />
</div>
</PapperBlock>
<PapperBlock title="Fixed Tabs" desc="Fixed tabs should be used with a limited number of tabs and when consistent placement will aid muscle memory.">
<div>
<FixedTabs />
<SourceReader componentName={docSrc + 'FixedTabs.js'} />
</div>
</PapperBlock>
<PapperBlock title="Centered" desc="The centered property should be used for larger views.">
<div>
<CenteredTabs />
<SourceReader componentName={docSrc + 'CenteredTabs.js'} />
</div>
</PapperBlock>
<PapperBlock title="Icon Tabs" desc="Tab labels may be either all icons or all text.">
<div>
<IconTabs />
<SourceReader componentName={docSrc + 'IconTabs.js'} />
</div>
</PapperBlock>
<PapperBlock title="Scrollable Tabs" desc="Left and right scroll buttons will automatically be presented on desktop and hidden on mobile. (based on viewport width)">
<div>
<ScrollTabs />
<SourceReader componentName={docSrc + 'ScrollTabs.js'} />
</div>
</PapperBlock>
<PapperBlock title="Scrollable Icon Tabs" desc="">
<div>
<ScrollIconTabs />
<SourceReader componentName={docSrc + 'ScrollIconTabs.js'} />
</div>
</PapperBlock>
<Grid container spacing={3}>
<Grid item md={6}>
<PapperBlock title="Disabled Tab" desc="Tab may be disabled by setting disabled property.">
<div>
<DisabledTab />
<SourceReader componentName={docSrc + 'DisabledTab.js'} />
</div>
</PapperBlock>
</Grid>
<Grid item md={6}>
<PapperBlock title="Customized Tabs" desc="If you have been reading the overrides documentation page but you are not confident jumping in, here's an example of how you can change the main color of the Tabs.">
<div>
<CustomTabs />
<SourceReader componentName={docSrc + 'CustomTabs.js'} />
</div>
</PapperBlock>
</Grid>
</Grid>
<PapperBlock title="Bottom Navigation" desc="Bottom navigation bars make it easy to explore and switch between top-level views in a single tap.">
<div>
<BottomNav />
<SourceReader componentName={docSrc + 'BottomNav.js'} />
</div>
</PapperBlock>
</div>
</div>
);
}
}
Tabs.propTypes = {
classes: PropTypes.object.isRequired,
};
export default withStyles(styles)(Tabs);
|