From 8fca00b564a398e5a1c3e159e7170e979f8e660f Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sat, 4 Aug 2018 00:11:53 +0200 Subject: [PATCH] [MobileStepper] Add a LinearProgressProps property --- packages/material-ui/src/MobileStepper/MobileStepper.d.ts | 2 ++ packages/material-ui/src/MobileStepper/MobileStepper.js | 6 ++++++ pages/api/mobile-stepper.md | 1 + 3 files changed, 9 insertions(+) diff --git a/packages/material-ui/src/MobileStepper/MobileStepper.d.ts b/packages/material-ui/src/MobileStepper/MobileStepper.d.ts index a6391594a91a3d..05fffc95166b94 100644 --- a/packages/material-ui/src/MobileStepper/MobileStepper.d.ts +++ b/packages/material-ui/src/MobileStepper/MobileStepper.d.ts @@ -2,10 +2,12 @@ import * as React from 'react'; import { StandardProps } from '..'; import { PaperProps } from '../Paper'; import { ButtonProps } from '../Button'; +import { LinearProgressProps } from '../LinearProgress'; export interface MobileStepperProps extends StandardProps { activeStep?: number; backButton: React.ReactElement; + LinearProgressProps?: Partial; nextButton: React.ReactElement; position?: 'bottom' | 'top' | 'static'; steps: number; diff --git a/packages/material-ui/src/MobileStepper/MobileStepper.js b/packages/material-ui/src/MobileStepper/MobileStepper.js index cdb7cb0382ef8a..f8cc3209ce274a 100644 --- a/packages/material-ui/src/MobileStepper/MobileStepper.js +++ b/packages/material-ui/src/MobileStepper/MobileStepper.js @@ -65,6 +65,7 @@ function MobileStepper(props) { backButton, classes, className: classNameProp, + LinearProgressProps, nextButton, position, steps, @@ -97,6 +98,7 @@ function MobileStepper(props) { className={classes.progress} variant="determinate" value={Math.ceil((activeStep / (steps - 1)) * 100)} + {...LinearProgressProps} /> )} {nextButton} @@ -123,6 +125,10 @@ MobileStepper.propTypes = { * @ignore */ className: PropTypes.string, + /** + * Properties applied to the `LinearProgress` element. + */ + LinearProgressProps: PropTypes.object, /** * A next button element. For instance, it can be be a `Button` or a `IconButton`. */ diff --git a/pages/api/mobile-stepper.md b/pages/api/mobile-stepper.md index b079aaba6d5eca..5d05b8837858d7 100644 --- a/pages/api/mobile-stepper.md +++ b/pages/api/mobile-stepper.md @@ -18,6 +18,7 @@ title: MobileStepper API | activeStep | number | 0 | Set the active step (zero based index). Defines which dot is highlighted when the variant is 'dots'. | | backButton | node |   | A back button element. For instance, it can be be a `Button` or a `IconButton`. | | classes | object |   | Override or extend the styles applied to the component. See [CSS API](#css-api) below for more details. | +| LinearProgressProps | object |   | Properties applied to the `LinearProgress` element. | | nextButton | node |   | A next button element. For instance, it can be be a `Button` or a `IconButton`. | | position | enum: 'bottom' |
 'top' |
 'static'
| 'bottom' | Set the positioning type. | | steps * | number |   | The total steps. |