@atlaskit/navigation-system
Version:
The latest navigation system for Atlassian apps.
52 lines • 1.63 kB
JavaScript
/* 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';
const localSlotLayersStatic = {
chatPanelOverlay: 5,
ribbon: 4,
topBar: 4,
banner: 4,
sideNav: 2,
panelSmallViewports: 1
};
const styles = {
root: "_nd5l1c99 _1reo15vq _18m915vq _4t3i1osq _152tidpf _kqsw1if8 _vchhusvi _1pbyegat _1e0cglyw _dm2518uv"
};
export function UNSAFE_Ribbon({
children,
testId,
id: providedId,
width = '0px'
}) {
const id = useLayoutId({
providedId
});
const dangerouslyHoistSlotSizes = useContext(DangerouslyHoistSlotSizes);
return /*#__PURE__*/React.createElement("div", {
id: id,
"data-layout-slot": true,
style: {
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);
}