@fluentui/react-northstar
Version:
A themable React component library.
41 lines (39 loc) • 1.22 kB
JavaScript
import { compose } from '@fluentui/react-bindings';
import { commonPropTypes } from '../../utils';
import { Box } from '../Box/Box';
import * as PropTypes from 'prop-types';
export var inputLabelClassName = 'ui-input__label';
/**
* An InputLabel provides a slot for label in the Input.
*/
export var InputLabel = /*#__PURE__*/function () {
var InputLabel = compose(Box, {
className: inputLabelClassName,
displayName: 'InputLabel',
overrideStyles: true,
mapPropsToStylesProps: function mapPropsToStylesProps(_ref) {
var labelPosition = _ref.labelPosition,
required = _ref.required,
hasValue = _ref.hasValue;
return {
labelPosition: labelPosition,
required: required,
hasValue: hasValue
};
},
handledProps: ['required', 'labelPosition', 'hasValue'],
shorthandConfig: {
mappedProp: 'content'
}
});
InputLabel.defaultProps = {
as: 'label'
};
InputLabel.propTypes = Object.assign({}, commonPropTypes.createCommon(), {
labelPosition: PropTypes.oneOf(['inline', 'above', 'inside']),
required: PropTypes.bool,
hasValue: PropTypes.bool
});
return InputLabel;
}();
//# sourceMappingURL=InputLabel.js.map