@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
51 lines • 4.3 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 getButtonGroupStyles(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.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,
borderStyle: ((_c = style === null || style === void 0 ? void 0 : style.root) === null || _c === void 0 ? void 0 : _c.borderWidth) ? 'solid' : undefined,
boxShadow: (_d = style === null || style === void 0 ? void 0 : style.root) === null || _d === void 0 ? void 0 : _d.boxShadow,
paddingBlock: (_e = style === null || style === void 0 ? void 0 : style.root) === null || _e === void 0 ? void 0 : _e.paddingBlock,
paddingInline: (_f = style === null || style === void 0 ? void 0 : style.root) === null || _f === void 0 ? void 0 : _f.paddingInline,
background: (_g = style === null || style === void 0 ? void 0 : style.root) === null || _g === void 0 ? void 0 : _g.background,
borderColor: (_h = style === null || style === void 0 ? void 0 : style.root) === null || _h === void 0 ? void 0 : _h.borderColor,
...(((_j = style === null || style === void 0 ? void 0 : style.root) === null || _j === void 0 ? void 0 : _j.focusRing) && {
[customCssProps.styleFocusRingBorderColor]: (_k = style.root.focusRing) === null || _k === void 0 ? void 0 : _k.borderColor,
[customCssProps.styleFocusRingBorderRadius]: (_l = style.root.focusRing) === null || _l === void 0 ? void 0 : _l.borderRadius,
[customCssProps.styleFocusRingBorderWidth]: (_m = style.root.focusRing) === null || _m === void 0 ? void 0 : _m.borderWidth,
}),
};
}
export function getButtonGroupItemStyles(style) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
if (SYSTEM !== 'core' || !(style === null || style === void 0 ? void 0 : style.item)) {
return undefined;
}
return {
...(((_a = style === null || style === void 0 ? void 0 : style.item) === null || _a === void 0 ? void 0 : _a.color) && {
[customCssProps.styleColorActive]: (_b = style.item.color) === null || _b === void 0 ? void 0 : _b.active,
[customCssProps.styleColorDefault]: (_c = style.item.color) === null || _c === void 0 ? void 0 : _c.default,
[customCssProps.styleColorDisabled]: (_d = style.item.color) === null || _d === void 0 ? void 0 : _d.disabled,
[customCssProps.styleColorHover]: (_e = style.item.color) === null || _e === void 0 ? void 0 : _e.hover,
}),
...(((_f = style === null || style === void 0 ? void 0 : style.item) === null || _f === void 0 ? void 0 : _f.boxShadow) && {
[customCssProps.styleBoxShadowActive]: (_g = style.item.boxShadow) === null || _g === void 0 ? void 0 : _g.active,
[customCssProps.styleBoxShadowDefault]: (_h = style.item.boxShadow) === null || _h === void 0 ? void 0 : _h.default,
[customCssProps.styleBoxShadowDisabled]: (_j = style.item.boxShadow) === null || _j === void 0 ? void 0 : _j.disabled,
[customCssProps.styleBoxShadowHover]: (_k = style.item.boxShadow) === null || _k === void 0 ? void 0 : _k.hover,
}),
...(((_l = style === null || style === void 0 ? void 0 : style.item) === null || _l === void 0 ? void 0 : _l.focusRing) && {
[customCssProps.styleFocusRingBorderColor]: (_m = style.item.focusRing) === null || _m === void 0 ? void 0 : _m.borderColor,
[customCssProps.styleFocusRingBorderRadius]: (_o = style.item.focusRing) === null || _o === void 0 ? void 0 : _o.borderRadius,
[customCssProps.styleFocusRingBorderWidth]: (_p = style.item.focusRing) === null || _p === void 0 ? void 0 : _p.borderWidth,
}),
};
}
//# sourceMappingURL=style.js.map