@massds/mayflower-react
Version:
React versions of Mayflower design system UI components
37 lines (36 loc) • 1.6 kB
JavaScript
const _excluded = ["button"];
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
/**
* GenTeaserButton module.
* @module @massds/mayflower-react/GenTeaserButton
* @requires module:@massds/mayflower-assets/scss/03-organisms/gen-teaser
*/
import React from "react";
import PropTypes from "prop-types";
import IconExpand from "../Icon/IconExpand.mjs";
import ButtonWithIcon from "../ButtonWithIcon/index.mjs";
/**
* Expand Button
*/
const GenTeaserButton = props => {
const button = props.button,
rest = _objectWithoutPropertiesLoose(props, _excluded);
const icon = button.icon ? button.icon : /*#__PURE__*/React.createElement(IconExpand, {
width: 15,
height: 15
});
return /*#__PURE__*/React.createElement("div", _extends({
className: "ma__gen-teaser__button"
}, rest), /*#__PURE__*/React.createElement(ButtonWithIcon, _extends({
capitalized: true
}, button, {
icon: icon,
size: "small"
})));
};
GenTeaserButton.propTypes = process.env.NODE_ENV !== "production" ? {
/** Expects props from ButtonWithIcon (e.g. text, info, etc.) */
button: PropTypes.shape(ButtonWithIcon.propTypes).isRequired
} : {};
export default GenTeaserButton;