@bigbinary/neetoui
Version:
neetoUI drives the experience at all neeto products
41 lines (38 loc) • 1.64 kB
JavaScript
import _extends from '@babel/runtime/helpers/extends';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
import React__default, { forwardRef } from 'react';
import classnames from 'classnames';
var _excluded = ["icon", "style", "className", "children"];
var STYLES = {
info: "info",
warning: "warning",
danger: "danger",
success: "success"
};
var Callout = /*#__PURE__*/forwardRef(function (_ref, ref) {
var _ref$icon = _ref.icon,
icon = _ref$icon === void 0 ? null : _ref$icon,
_ref$style = _ref.style,
style = _ref$style === void 0 ? STYLES.info : _ref$style,
_ref$className = _ref.className,
className = _ref$className === void 0 ? "" : _ref$className,
children = _ref.children,
otherProps = _objectWithoutProperties(_ref, _excluded);
var Icon = icon;
return /*#__PURE__*/React__default.createElement("div", _extends({
ref: ref,
className: classnames("neeto-ui-callout", _defineProperty({
"neeto-ui-callout--info": style === STYLES.info,
"neeto-ui-callout--warning": style === STYLES.warning,
"neeto-ui-callout--danger": style === STYLES.danger,
"neeto-ui-callout--success": style === STYLES.success
}, className, className))
}, otherProps), icon && /*#__PURE__*/React__default.createElement("div", {
className: "neeto-ui-callout__icon",
"data-testid": "callout-icon"
}, /*#__PURE__*/React__default.createElement(Icon, null)), children);
});
Callout.displayName = "Callout";
export { Callout as default };
//# sourceMappingURL=Callout.js.map