1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
3 | import React from 'react';
|
4 | import PropTypes from 'prop-types';
|
5 | import classNames from 'classnames';
|
6 | import { mapToCssModules, tagPropType } from './utils';
|
7 | var propTypes = {
|
8 | children: PropTypes.node,
|
9 | inline: PropTypes.bool,
|
10 | tag: tagPropType,
|
11 | color: PropTypes.string,
|
12 | className: PropTypes.string,
|
13 | cssModule: PropTypes.object
|
14 | };
|
15 | var defaultProps = {
|
16 | tag: 'small',
|
17 | color: 'muted'
|
18 | };
|
19 |
|
20 | var FormText = function FormText(props) {
|
21 | var className = props.className,
|
22 | cssModule = props.cssModule,
|
23 | inline = props.inline,
|
24 | color = props.color,
|
25 | Tag = props.tag,
|
26 | attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "inline", "color", "tag"]);
|
27 |
|
28 | var classes = mapToCssModules(classNames(className, !inline ? 'form-text' : false, color ? "text-" + color : false), cssModule);
|
29 | return React.createElement(Tag, _extends({}, attributes, {
|
30 | className: classes
|
31 | }));
|
32 | };
|
33 |
|
34 | FormText.propTypes = propTypes;
|
35 | FormText.defaultProps = defaultProps;
|
36 | export default FormText; |
\ | No newline at end of file |