@smart-react-components/ui 2.0.0-alpha-28 → 2.0.0-alpha-30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Alert/AlertIcon.js
CHANGED
|
@@ -9,7 +9,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
9
9
|
const AlertIconElement_1 = __importDefault(require("../components/Alert/AlertIconElement"));
|
|
10
10
|
const AlertIcon = (props) => {
|
|
11
11
|
var _a;
|
|
12
|
-
return (react_1.default.createElement(AlertIconElement_1.default, Object.assign({ alertPalette: props.alertPalette, alertIconSize: props.size, alertIconSizeSm: props.sizeSm, alertIconSizeMd: props.sizeMd, alertIconSizeLg: props.sizeLg, alertIconSizeXl: props.sizeXl, hasBackground: props.hasBackground, hasHover: props.hasHover, isSoft: props.isSoft, palette: (_a = props.palette) !== null && _a !== void 0 ? _a : props.alertPalette }, (0, element_props_1.default)(props, [click_events_1.default])), props.children));
|
|
12
|
+
return (react_1.default.createElement(AlertIconElement_1.default, Object.assign({ alertPalette: props.alertPalette, alertIconSize: props.size, alertIconSizeSm: props.sizeSm, alertIconSizeMd: props.sizeMd, alertIconSizeLg: props.sizeLg, alertIconSizeXl: props.sizeXl, hasBackground: props.hasBackground, hasHover: props.hasHover, isOutline: props.isOutline, isSoft: props.isSoft, palette: (_a = props.palette) !== null && _a !== void 0 ? _a : props.alertPalette }, (0, element_props_1.default)(props, [click_events_1.default])), props.children));
|
|
13
13
|
};
|
|
14
14
|
AlertIcon.displayName = 'SRCAlertIcon';
|
|
15
15
|
exports.default = AlertIcon;
|
package/Alert/index.js
CHANGED
|
@@ -44,6 +44,7 @@ const Alert = props => {
|
|
|
44
44
|
if (((_a = item.type) === null || _a === void 0 ? void 0 : _a.displayName) === 'SRCAlertIcon') {
|
|
45
45
|
const iconEl = react_1.default.cloneElement(item, {
|
|
46
46
|
alertPalette: props.palette,
|
|
47
|
+
isOutline: props.isOutline,
|
|
47
48
|
isSoft: props.isSoft,
|
|
48
49
|
size: props.size,
|
|
49
50
|
sizeSm: props.sizeSm,
|
|
@@ -68,7 +69,7 @@ const Alert = props => {
|
|
|
68
69
|
iconRight && iconRight)),
|
|
69
70
|
hasIconLeft: !!iconLeft,
|
|
70
71
|
hasIconRight: !!iconRight,
|
|
71
|
-
hasThickBorder: !(iconLeft && (iconLeft.props.hasBackground || (iconLeft.props.palette && iconLeft.props.palette !== props.palette))),
|
|
72
|
+
hasThickBorder: !(iconLeft && (iconLeft.props.hasBackground !== false || (iconLeft.props.palette && iconLeft.props.palette !== props.palette))),
|
|
72
73
|
};
|
|
73
74
|
};
|
|
74
75
|
const [{ children, hasIconLeft, hasIconRight, hasThickBorder }, setContent] = react_1.default.useState(() => getContent());
|
|
@@ -19,29 +19,28 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs({
|
|
|
19
19
|
font-size: ${t.$.size.alert[v].iconSize};
|
|
20
20
|
}
|
|
21
21
|
`,
|
|
22
|
-
})(({ theme, alertPalette, hasBackground, hasHover, isSoft, palette }) => `
|
|
22
|
+
})(({ theme, alertPalette, hasBackground, hasHover, isOutline, isSoft, palette }) => `
|
|
23
23
|
align-items: center;
|
|
24
24
|
align-self: stretch;
|
|
25
25
|
display: flex;
|
|
26
|
+
fill: currentcolor;
|
|
26
27
|
flex: 0 0 auto;
|
|
27
28
|
justify-content: center;
|
|
28
29
|
|
|
29
30
|
${(palette === alertPalette || hasBackground)
|
|
30
31
|
? `
|
|
31
|
-
|
|
32
|
-
fill: ${!isSoft ? theme.$.palette[palette].font : theme.$.palette[palette].softFont};
|
|
33
|
-
|
|
34
|
-
${palette !== alertPalette
|
|
32
|
+
${!isSoft
|
|
35
33
|
? `
|
|
36
|
-
background: ${
|
|
34
|
+
background: ${(palette !== alertPalette || isOutline) ? theme.$.palette[palette].main : theme.$.palette[palette].darkest};
|
|
35
|
+
color: ${theme.$.palette[palette].font};
|
|
37
36
|
`
|
|
38
37
|
: `
|
|
39
|
-
background: ${
|
|
38
|
+
background: ${(palette !== alertPalette || isOutline) ? theme.$.palette[palette].soft : theme.$.palette[palette].softDarkest};
|
|
39
|
+
color: ${theme.$.palette[palette].softFont};
|
|
40
40
|
`}
|
|
41
41
|
`
|
|
42
42
|
: `
|
|
43
43
|
color: ${!isSoft ? theme.$.palette[palette].main : theme.$.palette[palette].soft};
|
|
44
|
-
fill: ${!isSoft ? theme.$.palette[palette].main : theme.$.palette[palette].soft};
|
|
45
44
|
`}
|
|
46
45
|
|
|
47
46
|
${hasHover
|