UNPKG

@bigbinary/neetoui

Version:

neetoUI drives the experience at all neeto products

43 lines (39 loc) 1.62 kB
'use strict'; var _extends = require('@babel/runtime/helpers/extends'); var _defineProperty = require('@babel/runtime/helpers/defineProperty'); var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties'); var React = require('react'); var classnames = require('classnames'); var _excluded = ["icon", "style", "className", "children"]; var STYLES = { info: "info", warning: "warning", danger: "danger", success: "success" }; var Callout = /*#__PURE__*/React.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.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.createElement("div", { className: "neeto-ui-callout__icon", "data-testid": "callout-icon" }, /*#__PURE__*/React.createElement(Icon, null)), children); }); Callout.displayName = "Callout"; module.exports = Callout; //# sourceMappingURL=Callout.js.map