@storybook/design-system
Version:
Storybook design system
59 lines (48 loc) • 2.57 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.OutlineCTA = void 0;
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _theming = require("@storybook/theming");
var _styles = require("./shared/styles");
var _excluded = ["action", "badge", "children"];
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
var OutlineCTAWrapper = (0, _theming.styled)("div", process.env.NODE_ENV === "production" ? {
target: "ei2f23u2"
} : {
target: "ei2f23u2",
label: "OutlineCTAWrapper"
})("border-radius:", _styles.spacing.borderRadius.small, "px;box-shadow:", _styles.color.border, " 0 0 0 1px inset;padding:", _styles.spacing.padding.small, "px ", _styles.spacing.padding.small, "px;font-size:", _styles.typography.size.s2, "px;line-height:20px;@media (min-width: ", _styles.breakpoint, "px){flex-wrap:nowrap;justify-content:flex-start;padding:", _styles.spacing.padding.small, "px ", _styles.spacing.padding.medium, "px;}");
var MessageText = (0, _theming.styled)("span", process.env.NODE_ENV === "production" ? {
target: "ei2f23u1"
} : {
target: "ei2f23u1",
label: "MessageText"
})(process.env.NODE_ENV === "production" ? {
name: "l7eka7",
styles: "margin-left:2px;margin-right:2px"
} : {
name: "l7eka7",
styles: "margin-left:2px;margin-right:2px",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
});
var ActionWrapper = (0, _theming.styled)("span", process.env.NODE_ENV === "production" ? {
target: "ei2f23u0"
} : {
target: "ei2f23u0",
label: "ActionWrapper"
})("font-weight:", _styles.typography.weight.bold, ";white-space:nowrap;");
var OutlineCTA = function OutlineCTA(_ref) {
var action = _ref.action,
badge = _ref.badge,
children = _ref.children,
rest = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
return /*#__PURE__*/_react["default"].createElement(OutlineCTAWrapper, rest, badge, " ", /*#__PURE__*/_react["default"].createElement(MessageText, null, children), " ", /*#__PURE__*/_react["default"].createElement(ActionWrapper, null, action));
};
exports.OutlineCTA = OutlineCTA;
OutlineCTA.defaultProps = {
badge: null
};