UNPKG

@helpscout/hsds-react

Version:

React component library for Help Scout's Design System

61 lines (43 loc) 1.82 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); exports.__esModule = true; exports.PageDecorator = exports.withAktiv = exports.WithAktiv = void 0; var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose")); var _react = _interopRequireDefault(require("react")); var _styledComponents = _interopRequireDefault(require("styled-components")); var _jsxRuntime = require("react/jsx-runtime"); /* istanbul ignore file */ var WithAktiv = /*#__PURE__*/function (_React$Component) { (0, _inheritsLoose2.default)(WithAktiv, _React$Component); function WithAktiv() { return _React$Component.apply(this, arguments) || this; } var _proto = WithAktiv.prototype; _proto.componentDidMount = function componentDidMount() { document.body.classList.add('with-aktiv'); }; _proto.componentWillUnmount = function componentWillUnmount() { document.body.classList.remove('with-aktiv'); }; _proto.render = function render() { return this.props.children; }; return WithAktiv; }(_react.default.Component); exports.WithAktiv = WithAktiv; var withAktiv = function withAktiv(storyFn) { return /*#__PURE__*/(0, _jsxRuntime.jsx)(WithAktiv, { children: storyFn() }); }; exports.withAktiv = withAktiv; var AppUI = (0, _styledComponents.default)('div').withConfig({ displayName: "storybook__AppUI", componentId: "sc-1idpiku-0" })(["align-items:center;background:#f9fafa;box-sizing:border-box;display:flex;justify-content:center;padding:20px;min-height:calc(100vh);width:100%;@media (min-width:1500px){padding:40px 20px;}"]); var PageDecorator = function PageDecorator(storyFn) { return /*#__PURE__*/(0, _jsxRuntime.jsx)(AppUI, { children: storyFn() }); }; exports.PageDecorator = PageDecorator;