diff --git a/docs/src/pages/component-api/Progress/CircularProgress.md b/docs/src/pages/component-api/Progress/CircularProgress.md
index e4ddc264813aee..e9cf8b9ce30593 100644
--- a/docs/src/pages/component-api/Progress/CircularProgress.md
+++ b/docs/src/pages/component-api/Progress/CircularProgress.md
@@ -8,6 +8,7 @@
| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| classes | object | | Useful to extend the style applied to components. |
+| color | enum: 'primary'
'accent'
| 'primary' | The color of the component. It's using the theme palette when that makes sense. |
| max | number | 100 | The max value of progress in determinate mode. |
| min | number | 0 | The min value of progress in determinate mode. |
| mode | enum: 'determinate'
'indeterminate'
| 'indeterminate' | The mode of show your progress. Indeterminate for when there is no value for progress. Determinate for controlled progress value. |
@@ -21,6 +22,8 @@ Any other properties supplied will be spread to the root element.
You can overrides all the class names injected by Material-UI thanks to the `classes` property.
This property accepts the following keys:
- `root`
+- `primaryColor`
+- `accentColor`
- `svg`
- `indeterminateSvg`
- `circle`
diff --git a/docs/src/pages/component-api/Progress/LinearProgress.md b/docs/src/pages/component-api/Progress/LinearProgress.md
index db725d45b1e8d0..3325ad59b9aade 100644
--- a/docs/src/pages/component-api/Progress/LinearProgress.md
+++ b/docs/src/pages/component-api/Progress/LinearProgress.md
@@ -8,6 +8,7 @@
| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| classes | object | | Useful to extend the style applied to components. |
+| color | enum: 'primary'
'accent'
| 'primary' | The color of the component. It's using the theme palette when that makes sense. |
| mode | enum: 'determinate'
'indeterminate'
'buffer'
'query'
| 'indeterminate' | The mode of show your progress, indeterminate for when there is no value for progress. |
| value | number | 0 | The value of progress, only works in determinate and buffer mode. Value between 0 and 100. |
| valueBuffer | number | | The value of buffer, only works in buffer mode. Value between 0 and 100. |
@@ -19,15 +20,22 @@ Any other properties supplied will be spread to the root element.
You can overrides all the class names injected by Material-UI thanks to the `classes` property.
This property accepts the following keys:
- `root`
+- `primaryColor`
+- `accentColor`
+- `primaryBar`
+- `primaryDashed`
+- `primaryBufferBar2`
+- `accentBar`
+- `accentDashed`
+- `accentBufferBar2`
- `rootBuffer`
- `rootQuery`
-- `bar`
-- `dashed`
- `indeterminateBar1`
- `indeterminateBar2`
- `determinateBar1`
- `bufferBar1`
-- `bufferBar2`
+- `bufferBar2Primary`
+- `bufferBar2Accent`
- `@keyframes mui-indeterminate1`
- `@keyframes mui-indeterminate2`
- `@keyframes buffer`
diff --git a/docs/src/pages/component-demos/progress/CircularDeterminate.js b/docs/src/pages/component-demos/progress/CircularDeterminate.js
index bcd853631af838..3bc83212c27a65 100644
--- a/docs/src/pages/component-demos/progress/CircularDeterminate.js
+++ b/docs/src/pages/component-demos/progress/CircularDeterminate.js
@@ -24,6 +24,16 @@ function CircularDeterminate(props) {
min={0}
max={50}
/>
+
+
);
}
diff --git a/docs/src/pages/component-demos/progress/CircularIndeterminate.js b/docs/src/pages/component-demos/progress/CircularIndeterminate.js
index 8af2adc516925a..f82cd375a5f6d8 100644
--- a/docs/src/pages/component-demos/progress/CircularIndeterminate.js
+++ b/docs/src/pages/component-demos/progress/CircularIndeterminate.js
@@ -17,6 +17,8 @@ function CircularIndeterminate(props) {
- {mode === 'buffer' ?
: null}
+ {mode === 'buffer' ?
: null}
{mode === 'determinate'
? null
@@ -155,6 +194,10 @@ LinearProgress.propTypes = {
* @ignore
*/
className: PropTypes.string,
+ /**
+ * The color of the component. It's using the theme palette when that makes sense.
+ */
+ color: PropTypes.oneOf(['primary', 'accent']),
/**
* The mode of show your progress, indeterminate
* for when there is no value for progress.
@@ -173,6 +216,7 @@ LinearProgress.propTypes = {
};
LinearProgress.defaultProps = {
+ color: 'primary',
mode: 'indeterminate',
value: 0,
};
diff --git a/src/Progress/LinearProgress.spec.js b/src/Progress/LinearProgress.spec.js
index 7bf4382cf417fc..07ba89d312d63d 100644
--- a/src/Progress/LinearProgress.spec.js
+++ b/src/Progress/LinearProgress.spec.js
@@ -28,14 +28,22 @@ describe('
', () => {
it('should render intermediate mode by default', () => {
const wrapper = shallow(
);
- assert.strictEqual(wrapper.hasClass(classes.root), true);
- assert.strictEqual(wrapper.childAt(0).hasClass(classes.bar), true, 'should have the bar class');
+ assert.strictEqual(wrapper.hasClass(classes.root), true, 'should have the root class');
+ assert.strictEqual(
+ wrapper.childAt(0).hasClass(classes.primaryColorBar),
+ true,
+ 'should have the primaryColorBar class',
+ );
assert.strictEqual(
wrapper.childAt(0).hasClass(classes.indeterminateBar1),
true,
'should have the indeterminateBar1 class',
);
- assert.strictEqual(wrapper.childAt(1).hasClass(classes.bar), true, 'should have the bar class');
+ assert.strictEqual(
+ wrapper.childAt(1).hasClass(classes.primaryColorBar),
+ true,
+ 'should have the primaryColorBar class',
+ );
assert.strictEqual(
wrapper.childAt(1).hasClass(classes.indeterminateBar2),
true,
@@ -43,10 +51,74 @@ describe('
', () => {
);
});
- it('should render with determinate classes', () => {
+ it('should render for the primary color', () => {
+ const wrapper = shallow(
);
+ assert.strictEqual(wrapper.hasClass(classes.root), true, 'should have the root class');
+ assert.strictEqual(
+ wrapper.childAt(0).hasClass(classes.primaryColorBar),
+ true,
+ 'should have the primaryColorBar class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(1).hasClass(classes.primaryColorBar),
+ true,
+ 'should have the primaryColorBar class',
+ );
+ });
+
+ it('should render for the accent color', () => {
+ const wrapper = shallow(
);
+ assert.strictEqual(wrapper.hasClass(classes.root), true, 'should have the root class');
+ assert.strictEqual(
+ wrapper.childAt(0).hasClass(classes.accentColorBar),
+ true,
+ 'should have the accentColorBar class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(1).hasClass(classes.accentColorBar),
+ true,
+ 'should have the accentColorBar class',
+ );
+ });
+
+ it('should render with determinate classes for the primary color by default', () => {
const wrapper = shallow(
);
- assert.strictEqual(wrapper.hasClass(classes.root), true);
- assert.strictEqual(wrapper.childAt(0).hasClass(classes.bar), true, 'should have the bar class');
+ assert.strictEqual(wrapper.hasClass(classes.root), true, 'should have the root class');
+ assert.strictEqual(
+ wrapper.childAt(0).hasClass(classes.primaryColorBar),
+ true,
+ 'should have the primaryColorBar class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(0).hasClass(classes.determinateBar1),
+ true,
+ 'should have the determinateBar1 class',
+ );
+ });
+
+ it('should render with determinate classes for the primary color', () => {
+ const wrapper = shallow(
);
+ assert.strictEqual(wrapper.hasClass(classes.root), true, 'should have the root class');
+ assert.strictEqual(
+ wrapper.childAt(0).hasClass(classes.primaryColorBar),
+ true,
+ 'should have the primaryColorBar class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(0).hasClass(classes.determinateBar1),
+ true,
+ 'should have the determinateBar1 class',
+ );
+ });
+
+ it('should render with determinate classes for the accent color', () => {
+ const wrapper = shallow(
);
+ assert.strictEqual(wrapper.hasClass(classes.root), true, 'should have the root class');
+ assert.strictEqual(
+ wrapper.childAt(0).hasClass(classes.accentColorBar),
+ true,
+ 'should have the accentColorBar class',
+ );
assert.strictEqual(
wrapper.childAt(0).hasClass(classes.determinateBar1),
true,
@@ -61,21 +133,89 @@ describe('
', () => {
assert.strictEqual(wrapper.props()['aria-valuenow'], 77);
});
- it('should render with buffer classes', () => {
+ it('should render with buffer classes for the primary color by default', () => {
const wrapper = shallow(
);
assert.strictEqual(wrapper.hasClass(classes.root), true);
assert.strictEqual(
- wrapper.childAt(0).hasClass(classes.dashed),
+ wrapper.childAt(0).hasClass(classes.primaryDashed),
+ true,
+ 'should have the primaryDashed class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(1).hasClass(classes.primaryColorBar),
true,
- 'should have the dashed class',
+ 'should have the primaryColorBar class',
);
- assert.strictEqual(wrapper.childAt(1).hasClass(classes.bar), true, 'should have the bar class');
assert.strictEqual(
wrapper.childAt(1).hasClass(classes.bufferBar1),
true,
'should have the bufferBar1 class',
);
- assert.strictEqual(wrapper.childAt(2).hasClass(classes.bar), true, 'should have the bar class');
+ assert.strictEqual(
+ wrapper.childAt(2).hasClass(classes.primaryColor),
+ true,
+ 'should have the primaryColor class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(2).hasClass(classes.bufferBar2),
+ true,
+ 'should have the bufferBar2 class',
+ );
+ });
+
+ it('should render with buffer classes for the primary color', () => {
+ const wrapper = shallow(
);
+ assert.strictEqual(wrapper.hasClass(classes.root), true, 'should have the root class');
+ assert.strictEqual(
+ wrapper.childAt(0).hasClass(classes.primaryDashed),
+ true,
+ 'should have the primaryDashed class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(1).hasClass(classes.primaryColorBar),
+ true,
+ 'should have the primaryColorBar class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(1).hasClass(classes.bufferBar1),
+ true,
+ 'should have the bufferBar1 class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(2).hasClass(classes.primaryColor),
+ true,
+ 'should have the primaryColor class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(2).hasClass(classes.bufferBar2),
+ true,
+ 'should have the bufferBar2 class',
+ );
+ });
+
+ it('should render with buffer classes for the accent color', () => {
+ const wrapper = shallow(
);
+ assert.strictEqual(wrapper.hasClass(classes.root), true, 'should have the root class');
+ assert.strictEqual(
+ wrapper.childAt(0).hasClass(classes.accentDashed),
+ true,
+ 'should have the accentDashed class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(1).hasClass(classes.accentColorBar),
+ true,
+ 'should have the accentColorBar class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(1).hasClass(classes.bufferBar1),
+ true,
+ 'should have the bufferBar1 class',
+ );
+ assert.strictEqual(
+ wrapper.childAt(2).hasClass(classes.accentColor),
+ true,
+ 'should have the accentColor class',
+ );
assert.strictEqual(
wrapper.childAt(2).hasClass(classes.bufferBar2),
true,
@@ -98,13 +238,21 @@ describe('
', () => {
true,
'should have the rootQuery class',
);
- assert.strictEqual(wrapper.childAt(0).hasClass(classes.bar), true, 'should have the bar class');
+ assert.strictEqual(
+ wrapper.childAt(0).hasClass(classes.primaryColorBar),
+ true,
+ 'should have the primaryColorBar class',
+ );
assert.strictEqual(
wrapper.childAt(0).hasClass(classes.indeterminateBar1),
true,
'should have the indeterminateBar1 class',
);
- assert.strictEqual(wrapper.childAt(1).hasClass(classes.bar), true, 'should have the bar class');
+ assert.strictEqual(
+ wrapper.childAt(1).hasClass(classes.primaryColorBar),
+ true,
+ 'should have the primaryColorBar class',
+ );
assert.strictEqual(
wrapper.childAt(1).hasClass(classes.indeterminateBar2),
true,