UNPKG

@atlaskit/navigation-system

Version:

The latest navigation system for Atlassian apps.

56 lines (54 loc) • 3.26 kB
/* main.tsx generated by @compiled/babel-plugin v3.0.2 */ "use strict"; var _typeof = require("@babel/runtime/helpers/typeof"); Object.defineProperty(exports, "__esModule", { value: true }); exports.Main = Main; require("./main.compiled.css"); var _react = _interopRequireWildcard(require("react")); var React = _react; var _runtime = require("@compiled/react/runtime"); var _fg = require("@atlaskit/platform-feature-flags/fg"); var _useSkipLink = require("../../../context/skip-links/use-skip-link"); var _constants = require("../constants"); var _mainMinWidthContext = require("../main-min-width-context"); var _root = require("../root"); var _useLayoutId = require("../use-layout-id"); var _useLayoutMainSizing = require("../use-layout-main-sizing"); function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } var contentInsetBlockStartStatic = "calc(var(--n_bnrM, 0px) + var(--n_tNvM, 0px))"; var contentHeightWhenFixedStatic = "calc(100vh - var(--n_bnrM, 0px) - var(--n_tNvM, 0px))"; var mainElementStyles = { root: "_nd5l1gzg _1reo1wug _18m91wug _19121cl4 _152timx3 _4t3ieqxy _8rrs1wug _qwfh1wug _13wn1if8" }; /** * Use the Main area for the main page content. It has a fluid width and will expand to fill available space. */ function Main(_ref) { var children = _ref.children, xcss = _ref.xcss, _ref$skipLinkLabel = _ref.skipLinkLabel, skipLinkLabel = _ref$skipLinkLabel === void 0 ? (0, _fg.fg)('platform_dst_nav4_skip_link_a11y_1') ? 'Main content' : 'Main Content' : _ref$skipLinkLabel, testId = _ref.testId, providedId = _ref.id, _ref$minWidth = _ref.minWidth, minWidth = _ref$minWidth === void 0 ? _constants.defaultMainMinWidth : _ref$minWidth; var id = (0, _useLayoutId.useLayoutId)({ providedId: providedId }); (0, _useLayoutMainSizing.useLayoutMainSizing)(minWidth); (0, _useSkipLink.useSkipLink)(id, skipLinkLabel); return /*#__PURE__*/React.createElement(_react.Fragment, null, (0, _fg.fg)('platform-dst-chat-panel-layout') && /*#__PURE__*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles React.createElement("style", null, "#".concat(_root.gridRootId, ", #").concat(_root.gridRootFitId, " { ").concat(_constants.mainMinimumWidthVar, ": ").concat(minWidth, "px; }")), /*#__PURE__*/React.createElement("div", { id: id, "data-layout-slot": true, className: (0, _runtime.ax)([mainElementStyles.root, xcss]), role: "main", "data-testid": testId }, /*#__PURE__*/React.createElement(_mainMinWidthContext.MainMinWidthContext.Provider, { value: (0, _fg.fg)('platform-dst-chat-panel-layout') ? minWidth : _constants.defaultMainMinWidth }, children))); }