wix-style-react
Version:
wix-style-react
43 lines • 1.87 kB
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import { st, classes } from './LinearProgressBar.st.css';
import LinearProgressBarCore from './LinearProgressBarCore';
import { ToggleOn } from '@wix/wix-ui-icons-common/system';
import StatusIndicator from '../StatusIndicator';
import { dataHooks } from './constants';
/**
* This component is used for indicating a progress along a process.*/
class LinearProgressBar extends React.PureComponent {
render() {
const { errorMessage, skin, light, dataHook, error, shouldLoadAsync, ...otherProps } = this.props;
return (React.createElement(LinearProgressBarCore, { "data-hook": dataHook, className: st(classes.root, { light, skin }), "data-skin": skin, ...otherProps, error: error, successIcon: React.createElement(ToggleOn, null), errorIcon: React.createElement(StatusIndicator, { dataHook: dataHooks.errorIcon, status: "error", message: errorMessage }) }));
}
}
LinearProgressBar.displayName = 'LinearProgressBar';
LinearProgressBar.propTypes = {
/** Hook for testing purposes. */
dataHook: PropTypes.string,
/** Use to apply error styles */
error: PropTypes.bool,
/** Message to display when an error happens */
errorMessage: PropTypes.string,
/** Use light theme instead of dark theme */
light: PropTypes.bool,
/** Use to display a percentage progress.*/
showProgressIndication: PropTypes.bool,
/** The number of the percentage progress */
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
/** Sets the skin of the Linear Progress Bar. */
skin: PropTypes.oneOf([
'standard',
'success',
'warning',
'premium',
'neutral',
]),
};
LinearProgressBar.defaultProps = {
skin: 'standard',
};
export default LinearProgressBar;
//# sourceMappingURL=LinearProgressBar.js.map