UNPKG

@atlaskit/navigation-system

Version:

Page layout and navigation components for Atlassian apps.

28 lines (27 loc) • 2.41 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.ChatPanelResponsiveStyles = ChatPanelResponsiveStyles; var _react = _interopRequireDefault(require("react")); /** * Size queries cannot use a CSS variable for their threshold in supported browsers. * Keep this exception limited to the configured breakpoint and SSR layout inputs; * Root and ChatPanel own the static layout, appearance and motion styles. */ function ChatPanelResponsiveStyles(_ref) { var gridRootId = _ref.gridRootId, gridRootFitId = _ref.gridRootFitId, compactDefaultWidth = _ref.compactDefaultWidth, defaultWidth = _ref.defaultWidth, compactPreferredWidth = _ref.compactPreferredWidth, preferredWidth = _ref.preferredWidth, minWidth = _ref.minWidth, hasBorder = _ref.hasBorder; return ( /*#__PURE__*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Runtime size-query threshold and SSR inputs cannot be expressed in static Compiled styles. _react.default.createElement("style", null, "\n#".concat(gridRootFitId, " { --n_chatDefaultW: ").concat(compactDefaultWidth, "px; --n_chatPreferredW: ").concat(compactPreferredWidth, "; --n_clearanceChatMin: ").concat(minWidth, "; --n_clearanceChatTarget: var(--n_chatPreferredW); }\n@media (min-width: 64rem) {\n #").concat(gridRootFitId, " { --n_chatDefaultW: ").concat(defaultWidth, "px; --n_chatPreferredW: ").concat(preferredWidth, "; }\n}\n@media (min-width: 40rem) {\n @container navigation-chat-space (min-width: ").concat(minWidth, ") {\n #").concat(gridRootId, " { --n_chatResponsiveTrack: min(100cqw, var(--n_cPnlRsz, var(--n_chatPreferredW))); }\n #").concat(gridRootId, " [data-layout-chat-panel] {\n grid-area: chat-panel;\n width: min(100cqw, var(--n_cPnlRsz, var(--n_chatPreferredW)));\n max-width: 100%;\n z-index: auto;\n background-color: ", "var(--ds-surface, #FFFFFF)", ";\n ").concat(hasBorder ? "box-shadow: initial; border-inline-start: ".concat("var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #0B120E24)", ";") : '', "\n }\n @media (prefers-reduced-motion: no-preference) {\n #").concat(gridRootId, " [data-layout-chat-motion=\"entering\"] { animation-name: var(--n-chat-inline-keyframe); }\n }\n }\n}\n")) ); }