/
ProgressPage.js
149 lines (140 loc) · 4.45 KB
/
ProgressPage.js
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/* eslint react/no-multi-comp: 0, react/prop-types: 0 */
import React from 'react';
import { PrismCode } from 'react-prism';
import PageTitle from '../UI/PageTitle';
import { Card, CardText } from 'reactstrap';
import SectionTitle from '../UI/SectionTitle';
import ProgressExample from '../examples/Progress';
const ProgressExampleSource = require('!!raw-loader!../examples/Progress');
import ProgressColorExample from '../examples/ProgressColor';
const ProgressColorExampleSource = require('!!raw-loader!../examples/ProgressColor');
import ProgressLabelsExample from '../examples/ProgressLabels';
const ProgressLabelsExampleSource = require('!!raw-loader!../examples/ProgressLabels');
import ProgressAnimatedExample from '../examples/ProgressAnimated';
const ProgressAnimatedExampleSource = require('!!raw-loader!../examples/ProgressAnimated');
import ProgressStripedExample from '../examples/ProgressStriped';
const ProgressStripedExampleSource = require('!!raw-loader!../examples/ProgressStriped');
import ProgressMultiExample from '../examples/ProgressMulti';
const ProgressMultiExampleSource = require('!!raw-loader!../examples/ProgressMulti');
import ProgressMaxExample from '../examples/ProgressMax';
const ProgressMaxExampleSource = require('!!raw-loader!../examples/ProgressMax');
export default class ProgressPage extends React.Component {
render() {
return (
<div>
<PageTitle title="Progress" />
<div className="docs-example">
<ProgressExample />
</div>
<pre>
<PrismCode className="language-jsx">
{ProgressExampleSource}
</PrismCode>
</pre>
<h4>Properties</h4>
<pre>
<PrismCode className="language-jsx">
{`Progress.propTypes = {
multi: PropTypes.bool,
bar: PropTypes.bool, // used in combination with multi
tag: PropTypes.string,
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
]),
min: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
]),
max: PropTypes.oneOf([
PropTypes.string,
PropTypes.number,
]),
animated: PropTypes.bool,
striped: PropTypes.bool,
color: PropTypes.string,
className: PropTypes.string,
barClassName: PropTypes.string, // used to add class to the inner progress-bar element
barAriaValueText: PropTypes.string,
barAriaLabelledBy: PropTypes.string,
};
Progress.defaultProps = {
tag: 'progress',
value: 0,
max: 100,
};`}
</PrismCode>
</pre>
<SectionTitle>Color Variants</SectionTitle>
<div className="docs-example">
<div>
<ProgressColorExample />
</div>
</div>
<pre>
<PrismCode className="language-jsx">
{ProgressColorExampleSource}
</PrismCode>
</pre>
<SectionTitle>Labels</SectionTitle>
<div className="docs-example">
<div>
<ProgressLabelsExample />
</div>
</div>
<pre>
<PrismCode className="language-jsx">
{ProgressLabelsExampleSource}
</PrismCode>
</pre>
<SectionTitle>Striped</SectionTitle>
<div className="docs-example">
<div>
<ProgressStripedExample />
</div>
</div>
<pre>
<PrismCode className="language-jsx">
{ProgressStripedExampleSource}
</PrismCode>
</pre>
<SectionTitle>Animated</SectionTitle>
<p>
The <code>animated</code> prop also adds the <code>striped</code> prop; there is no need to pass both.
</p>
<div className="docs-example">
<div>
<ProgressAnimatedExample />
</div>
</div>
<pre>
<PrismCode className="language-jsx">
{ProgressAnimatedExampleSource}
</PrismCode>
</pre>
<SectionTitle>Multiple bars / Stacked</SectionTitle>
<div className="docs-example">
<div>
<ProgressMultiExample />
</div>
</div>
<pre>
<PrismCode className="language-jsx">
{ProgressMultiExampleSource}
</PrismCode>
</pre>
<SectionTitle>Max value</SectionTitle>
<div className="docs-example">
<div>
<ProgressMaxExample />
</div>
</div>
<pre>
<PrismCode className="language-jsx">
{ProgressMaxExampleSource}
</PrismCode>
</pre>
</div>
);
}
}