UNPKG

@atlaskit/navigation-system

Version:

The latest navigation system for Atlassian apps.

52 lines • 1.75 kB
/* ribbon.tsx generated by @compiled/babel-plugin v3.0.2 */ import "./ribbon.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import { useContext } from 'react'; import { UNSAFE_ribbonVar } from './constants'; import { DangerouslyHoistCssVarToDocumentRoot } from './dangerously-hoist-css-var-to-document-root'; import { DangerouslyHoistSlotSizes } from './hoist-slot-sizes-context'; import { useLayoutId } from './use-layout-id'; 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" }; export 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 = useLayoutId({ providedId: providedId }); var dangerouslyHoistSlotSizes = useContext(DangerouslyHoistSlotSizes); return /*#__PURE__*/React.createElement("div", { id: id, "data-layout-slot": true, style: { width: width }, "data-testid": testId, className: 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, { variableName: UNSAFE_ribbonVar, mediaQuery: '@media (min-width: 64rem)', value: "0px", responsiveValue: width }) // ------ END UNSAFE STYLES ------ , children); }