UNPKG

@wix/design-system

Version:

@wix/design-system

20 lines 994 B
import React, { forwardRef } from 'react'; import PropTypes from 'prop-types'; import { ReadOnlyStarsRatingBar } from './components/ReadOnlyStarsRatingBar'; import InteractiveStarsRatingBar from './components/InteractiveStarsRatingBar'; const StarsRatingBar = forwardRef((props, ref) => { return props.readOnly ? (React.createElement(ReadOnlyStarsRatingBar, { ...props })) : (React.createElement(InteractiveStarsRatingBar, { ref: ref, ...props })); }); StarsRatingBar.displayName = 'StarsRatingBar'; StarsRatingBar.propTypes = { dataHook: PropTypes.string, className: PropTypes.string, size: PropTypes.oneOf(['tiny', 'small', 'medium', 'large']), readOnly: PropTypes.bool, labelValues: PropTypes.arrayOf(PropTypes.string.isRequired), descriptionValues: PropTypes.arrayOf(PropTypes.string.isRequired), value: PropTypes.oneOf([0, 1, 2, 3, 4, 5]).isRequired, onChange: PropTypes.func, }; export default StarsRatingBar; //# sourceMappingURL=StarsRatingBar.js.map