@ntragas/pouncejstest
Version:
A collection of UI components from Panther labs
31 lines (28 loc) • 852 B
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
import React from 'react';
import Icon from '../Icon';
import Text from '../Text';
/**
* Extends Box
*
* A utility component that quickly allows you to add error messages to form fields
*/
var FormError = function FormError(_ref) {
var children = _ref.children,
rest = _objectWithoutPropertiesLoose(_ref, ["children"]);
return /*#__PURE__*/React.createElement(Text, _extends({
display: "flex",
alignItems: "center",
color: "red-300",
fontSize: "small",
fontStyle: "italic",
role: "alert"
}, rest), /*#__PURE__*/React.createElement(Icon, {
size: "medium",
type: "warning",
mr: 1,
flex: "0 0 auto"
}), children);
};
export default FormError;