UNPKG

@awsui/components-react

Version:

On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en

27 lines 2.02 kB
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import React from 'react'; import clsx from 'clsx'; import customCssProps from '../../internal/generated/custom-css-properties'; import * as tokens from '../../internal/generated/styles/tokens'; import { getStickyOffsetVars } from '../utils/sticky-offsets'; import { useAppLayoutInternals } from './context'; import testutilStyles from '../test-classes/styles.css.js'; import styles from './styles.css.js'; export default function Main() { const { content, disableBodyScroll, disableContentPaddings, footerHeight, hasDrawerViewportOverlay, navigationOpen, placement, isMobile, isSplitPanelOpen, isToolsOpen, mainElement, notificationsHeight, stickyNotifications, offsetBottom, splitPanelDisplayed, splitPanelPosition, activeDrawerId, } = useAppLayoutInternals(); const splitPanelHeight = offsetBottom - footerHeight; return (React.createElement("div", { className: clsx(styles.container, styles[`split-panel-position-${splitPanelPosition !== null && splitPanelPosition !== void 0 ? splitPanelPosition : 'bottom'}`], { [styles['disable-content-paddings']]: disableContentPaddings, [styles['has-split-panel']]: splitPanelDisplayed, [styles['is-navigation-open']]: navigationOpen, [styles['is-tools-open']]: isToolsOpen, [styles['has-active-drawer']]: !!activeDrawerId, [styles['is-split-panel-open']]: isSplitPanelOpen, [styles.unfocusable]: hasDrawerViewportOverlay, }, testutilStyles.content), ref: mainElement, style: { [customCssProps.splitPanelHeight]: `${splitPanelHeight}px`, ...getStickyOffsetVars(placement.insetBlockStart, offsetBottom, stickyNotifications && notificationsHeight > 0 ? `${tokens.spaceXs} + ${notificationsHeight}px` : '0px', `var(${customCssProps.mobileBarHeight})`, !!disableBodyScroll, isMobile), } }, content)); } //# sourceMappingURL=main.js.map