@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
52 lines • 3.08 kB
JavaScript
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { SYSTEM } from '../internal/environment';
import customCssProps from '../internal/generated/custom-css-properties';
export function getAlertStyles(style) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
if (SYSTEM !== 'core' || !(style === null || style === void 0 ? void 0 : style.root)) {
return undefined;
}
return {
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,
color: (_e = style.root) === null || _e === void 0 ? void 0 : _e.color,
...(((_f = style.root) === null || _f === void 0 ? void 0 : _f.focusRing) && {
[customCssProps.alertFocusRingBorderColor]: (_g = style.root.focusRing) === null || _g === void 0 ? void 0 : _g.borderColor,
[customCssProps.alertFocusRingBorderRadius]: (_h = style.root.focusRing) === null || _h === void 0 ? void 0 : _h.borderRadius,
[customCssProps.alertFocusRingBorderWidth]: (_j = style.root.focusRing) === null || _j === void 0 ? void 0 : _j.borderWidth,
}),
};
}
export function getIconStyles(style) {
var _a;
if (SYSTEM !== 'core' || !((_a = style === null || style === void 0 ? void 0 : style.icon) === null || _a === void 0 ? void 0 : _a.color)) {
return undefined;
}
return {
[customCssProps.alertIconColor]: style.icon.color,
};
}
export function getDismissButtonStyles(style) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
if (SYSTEM !== 'core' || !(style === null || style === void 0 ? void 0 : style.dismissButton)) {
return undefined;
}
return {
root: {
color: {
active: (_b = (_a = style.dismissButton) === null || _a === void 0 ? void 0 : _a.color) === null || _b === void 0 ? void 0 : _b.active,
default: (_d = (_c = style.dismissButton) === null || _c === void 0 ? void 0 : _c.color) === null || _d === void 0 ? void 0 : _d.default,
hover: (_f = (_e = style.dismissButton) === null || _e === void 0 ? void 0 : _e.color) === null || _f === void 0 ? void 0 : _f.hover,
},
focusRing: {
borderColor: (_h = (_g = style.dismissButton) === null || _g === void 0 ? void 0 : _g.focusRing) === null || _h === void 0 ? void 0 : _h.borderColor,
borderRadius: (_k = (_j = style.dismissButton) === null || _j === void 0 ? void 0 : _j.focusRing) === null || _k === void 0 ? void 0 : _k.borderRadius,
borderWidth: (_m = (_l = style.dismissButton) === null || _l === void 0 ? void 0 : _l.focusRing) === null || _m === void 0 ? void 0 : _m.borderWidth,
},
},
};
}
//# sourceMappingURL=style.js.map