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

67 lines 3.9 kB
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { SYSTEM } from '../internal/environment'; export function getRootStyles(style) { var _a, _b, _c, _d, _e; let properties = {}; if (SYSTEM === 'core' && (style === null || style === void 0 ? void 0 : style.root)) { properties = { background: (_a = style.root) === null || _a === void 0 ? void 0 : _a.background, borderColor: (_b = style.root) === null || _b === void 0 ? void 0 : _b.borderColor, borderRadius: (_c = style.root) === null || _c === void 0 ? void 0 : _c.borderRadius, borderWidth: (_d = style.root) === null || _d === void 0 ? void 0 : _d.borderWidth, boxShadow: (_e = style.root) === null || _e === void 0 ? void 0 : _e.boxShadow, }; } return properties; } export function getContentStyles(style) { var _a, _b; let properties = {}; if (SYSTEM === 'core' && (style === null || style === void 0 ? void 0 : style.content)) { properties = { paddingBlock: (_a = style.content) === null || _a === void 0 ? void 0 : _a.paddingBlock, paddingInline: (_b = style.content) === null || _b === void 0 ? void 0 : _b.paddingInline, }; } return properties; } export function getHeaderStyles(style) { var _a, _b, _c, _d, _e, _f; let properties = {}; if (SYSTEM === 'core' && (style === null || style === void 0 ? void 0 : style.header)) { properties = { ...(((_a = style === null || style === void 0 ? void 0 : style.root) === null || _a === void 0 ? void 0 : _a.background) && { background: (_b = style === null || style === void 0 ? void 0 : style.root) === null || _b === void 0 ? void 0 : _b.background }), ...(((_c = style === null || style === void 0 ? void 0 : style.root) === null || _c === void 0 ? void 0 : _c.borderRadius) && { background: (_d = style === null || style === void 0 ? void 0 : style.root) === null || _d === void 0 ? void 0 : _d.borderRadius }), paddingBlock: (_e = style.header) === null || _e === void 0 ? void 0 : _e.paddingBlock, paddingInline: (_f = style.header) === null || _f === void 0 ? void 0 : _f.paddingInline, }; } return properties; } export function getFooterStyles(style) { var _a, _b, _c, _d, _e, _f, _g, _h; let properties = {}; if (SYSTEM === 'core' && (style === null || style === void 0 ? void 0 : style.footer)) { properties = { borderColor: (_b = (_a = style.footer) === null || _a === void 0 ? void 0 : _a.divider) === null || _b === void 0 ? void 0 : _b.borderColor, borderWidth: (_d = (_c = style.footer) === null || _c === void 0 ? void 0 : _c.divider) === null || _d === void 0 ? void 0 : _d.borderWidth, paddingBlock: (_f = (_e = style.footer) === null || _e === void 0 ? void 0 : _e.root) === null || _f === void 0 ? void 0 : _f.paddingBlock, paddingInline: (_h = (_g = style.footer) === null || _g === void 0 ? void 0 : _g.root) === null || _h === void 0 ? void 0 : _h.paddingInline, }; } return properties; } export function getMediaStyles(mediaPosition, style) { var _a, _b; let properties = {}; if (SYSTEM === 'core' && ((_a = style === null || style === void 0 ? void 0 : style.root) === null || _a === void 0 ? void 0 : _a.borderRadius)) { properties = { borderRadius: (_b = style === null || style === void 0 ? void 0 : style.root) === null || _b === void 0 ? void 0 : _b.borderRadius, ...(mediaPosition === 'top' && { borderEndStartRadius: '0px', borderEndEndRadius: '0px' }), ...(mediaPosition === 'side' && { borderStartEndRadius: '0px', borderEndEndRadius: '0px' }), }; } return properties; } //# sourceMappingURL=style.js.map