@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
49 lines • 4.62 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 getButtonStyles(style) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
if (SYSTEM !== 'core' || !(style === null || style === void 0 ? void 0 : style.root)) {
return undefined;
}
return {
borderRadius: (_a = style === null || style === void 0 ? void 0 : style.root) === null || _a === void 0 ? void 0 : _a.borderRadius,
borderWidth: (_b = style === null || style === void 0 ? void 0 : style.root) === null || _b === void 0 ? void 0 : _b.borderWidth,
paddingBlock: (_c = style === null || style === void 0 ? void 0 : style.root) === null || _c === void 0 ? void 0 : _c.paddingBlock,
paddingInline: (_d = style === null || style === void 0 ? void 0 : style.root) === null || _d === void 0 ? void 0 : _d.paddingInline,
...(((_e = style === null || style === void 0 ? void 0 : style.root) === null || _e === void 0 ? void 0 : _e.background) && {
[customCssProps.styleBackgroundActive]: (_f = style.root.background) === null || _f === void 0 ? void 0 : _f.active,
[customCssProps.styleBackgroundDefault]: (_g = style.root.background) === null || _g === void 0 ? void 0 : _g.default,
[customCssProps.styleBackgroundDisabled]: (_h = style.root.background) === null || _h === void 0 ? void 0 : _h.disabled,
[customCssProps.styleBackgroundHover]: (_j = style.root.background) === null || _j === void 0 ? void 0 : _j.hover,
}),
...(((_k = style === null || style === void 0 ? void 0 : style.root) === null || _k === void 0 ? void 0 : _k.borderColor) && {
[customCssProps.styleBorderColorActive]: (_l = style.root.borderColor) === null || _l === void 0 ? void 0 : _l.active,
[customCssProps.styleBorderColorDefault]: (_m = style.root.borderColor) === null || _m === void 0 ? void 0 : _m.default,
[customCssProps.styleBorderColorDisabled]: (_o = style.root.borderColor) === null || _o === void 0 ? void 0 : _o.disabled,
[customCssProps.styleBorderColorHover]: (_p = style.root.borderColor) === null || _p === void 0 ? void 0 : _p.hover,
}),
...(((_q = style === null || style === void 0 ? void 0 : style.root) === null || _q === void 0 ? void 0 : _q.boxShadow) && {
[customCssProps.styleBoxShadowActive]: (_r = style.root.boxShadow) === null || _r === void 0 ? void 0 : _r.active,
[customCssProps.styleBoxShadowDefault]: (_s = style.root.boxShadow) === null || _s === void 0 ? void 0 : _s.default,
[customCssProps.styleBoxShadowDisabled]: (_t = style.root.boxShadow) === null || _t === void 0 ? void 0 : _t.disabled,
[customCssProps.styleBoxShadowHover]: (_u = style.root.boxShadow) === null || _u === void 0 ? void 0 : _u.hover,
}),
...(((_v = style === null || style === void 0 ? void 0 : style.root) === null || _v === void 0 ? void 0 : _v.color) && {
[customCssProps.styleColorActive]: (_w = style.root.color) === null || _w === void 0 ? void 0 : _w.active,
[customCssProps.styleColorDefault]: (_x = style.root.color) === null || _x === void 0 ? void 0 : _x.default,
[customCssProps.styleColorDisabled]: (_y = style.root.color) === null || _y === void 0 ? void 0 : _y.disabled,
[customCssProps.styleColorHover]: (_z = style.root.color) === null || _z === void 0 ? void 0 : _z.hover,
}),
...(((_0 = style === null || style === void 0 ? void 0 : style.root) === null || _0 === void 0 ? void 0 : _0.focusRing) && {
[customCssProps.styleFocusRingBorderColor]: (_1 = style.root.focusRing) === null || _1 === void 0 ? void 0 : _1.borderColor,
[customCssProps.styleFocusRingBorderRadius]: (_2 = style.root.focusRing) === null || _2 === void 0 ? void 0 : _2.borderRadius,
[customCssProps.styleFocusRingBorderWidth]: (_3 = style.root.focusRing) === null || _3 === void 0 ? void 0 : _3.borderWidth,
}),
...(((_5 = (_4 = style === null || style === void 0 ? void 0 : style.root) === null || _4 === void 0 ? void 0 : _4.focusRing) === null || _5 === void 0 ? void 0 : _5.borderRadius) && {
[customCssProps.styleFocusRingBorderRadius]: style.root.focusRing.borderRadius,
}),
};
}
//# sourceMappingURL=style.js.map