UNPKG

@atlaskit/navigation-system

Version:

The latest navigation system for Atlassian apps.

60 lines (59 loc) • 2.68 kB
/* ribbon.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.UNSAFE_Ribbon = UNSAFE_Ribbon; require("./ribbon.compiled.css"); var _react = _interopRequireWildcard(require("react")); var React = _react; var _runtime = require("@compiled/react/runtime"); var _constants = require("./constants"); var _dangerouslyHoistCssVarToDocumentRoot = require("./dangerously-hoist-css-var-to-document-root"); var _hoistSlotSizesContext = require("./hoist-slot-sizes-context"); var _useLayoutId = require("./use-layout-id"); 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 localSlotLayersStatic = { chatPanelOverlay: 5, ribbon: 4, topBar: 4, banner: 4, sideNav: 2, panelSmallViewports: 1 }; var styles = { root: "_nd5l1c99 _1reo15vq _18m915vq _4t3i1osq _152tidpf _kqsw1if8 _vchhusvi _1pbyegat _1e0cglyw _dm2518uv" }; function UNSAFE_Ribbon(_ref) { var children = _ref.children, testId = _ref.testId, providedId = _ref.id, _ref$width = _ref.width, width = _ref$width === void 0 ? '0px' : _ref$width; var id = (0, _useLayoutId.useLayoutId)({ providedId: providedId }); var dangerouslyHoistSlotSizes = (0, _react.useContext)(_hoistSlotSizesContext.DangerouslyHoistSlotSizes); return /*#__PURE__*/React.createElement("div", { id: id, "data-layout-slot": true, style: { width: width }, "data-testid": testId, className: (0, _runtime.ax)([styles.root]) }, dangerouslyHoistSlotSizes && /*#__PURE__*/ // ------ START UNSAFE STYLES ------ // These styles are needed for the UNSAFE legacy use case for Jira + Confluence. // But also for the panel resizing constraint to work correctly. React.createElement(_dangerouslyHoistCssVarToDocumentRoot.DangerouslyHoistCssVarToDocumentRoot, { variableName: _constants.UNSAFE_ribbonVar, mediaQuery: '@media (min-width: 64rem)', value: "0px", responsiveValue: width }) // ------ END UNSAFE STYLES ------ , children); }