@smart-react-components/ui 2.0.0-alpha-56 → 2.0.0-alpha-58
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/index.js
CHANGED
|
@@ -29,12 +29,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
const element_props_1 = __importDefault(require("@smart-react-components/core/element-props"));
|
|
30
30
|
const click_events_1 = __importDefault(require("@smart-react-components/core/element-props/click-events"));
|
|
31
31
|
const intrinsic_styled_props_1 = __importDefault(require("@smart-react-components/core/element-props/intrinsic-styled-props"));
|
|
32
|
-
const useChangeEffect_1 = __importDefault(require("@smart-react-components/core/hooks/useChangeEffect"));
|
|
33
32
|
const react_1 = __importDefault(require("react"));
|
|
34
33
|
const AlertElement_1 = __importStar(require("../components/Alert/AlertElement"));
|
|
35
34
|
const types_1 = require("../types");
|
|
36
35
|
const Alert = props => {
|
|
37
|
-
const
|
|
36
|
+
const { children, hasIconLeft, hasIconRight, hasThickBorder } = react_1.default.useMemo(() => {
|
|
38
37
|
var _a, _b;
|
|
39
38
|
const children = !Array.isArray(props.children) ? [props.children] : props.children;
|
|
40
39
|
const content = [];
|
|
@@ -73,10 +72,6 @@ const Alert = props => {
|
|
|
73
72
|
hasIconRight: !!iconRight,
|
|
74
73
|
hasThickBorder: !(iconLeft && (iconLeft.props.hasBackground !== false || (iconLeft.props.palette && iconLeft.props.palette !== props.palette))),
|
|
75
74
|
};
|
|
76
|
-
};
|
|
77
|
-
const [{ children, hasIconLeft, hasIconRight, hasThickBorder }, setContent] = react_1.default.useState(() => getContent());
|
|
78
|
-
(0, useChangeEffect_1.default)(() => {
|
|
79
|
-
setContent(getContent());
|
|
80
75
|
}, [props.children]);
|
|
81
76
|
return (react_1.default.createElement(AlertElement_1.default, Object.assign({ alertSize: props.size, alertSizeSm: props.sizeSm, alertSizeMd: props.sizeMd, alertSizeLg: props.sizeLg, alertSizeXl: props.sizeXl, hasIconLeft: hasIconLeft, hasIconRight: hasIconRight, hasThickBorder: hasThickBorder, isOutline: props.isOutline, isSoft: props.isSoft, palette: props.palette, shape: props.shape }, (0, element_props_1.default)(props, [click_events_1.default, intrinsic_styled_props_1.default]), props.elementProps), children));
|
|
82
77
|
};
|
|
@@ -39,17 +39,17 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasBa
|
|
|
39
39
|
color: ${!isSoft ? theme.$.palette[alertPalette].font : theme.$.palette[alertPalette].softFont};
|
|
40
40
|
`
|
|
41
41
|
: `
|
|
42
|
-
color: ${!isSoft ? theme.$.palette[
|
|
42
|
+
color: ${!isSoft ? theme.$.palette[palette].main : theme.$.palette[palette].soft};
|
|
43
43
|
`}
|
|
44
44
|
|
|
45
45
|
${hasBackground
|
|
46
46
|
? `
|
|
47
47
|
${!isSoft
|
|
48
48
|
? `
|
|
49
|
-
background: ${(palette !== alertPalette || isOutline) ? theme.$.palette[
|
|
49
|
+
background: ${(palette !== alertPalette || isOutline) ? theme.$.palette[palette].main : theme.$.palette[alertPalette].darkest};
|
|
50
50
|
`
|
|
51
51
|
: `
|
|
52
|
-
background: ${(palette !== alertPalette || isOutline) ? theme.$.palette[
|
|
52
|
+
background: ${(palette !== alertPalette || isOutline) ? theme.$.palette[palette].soft : theme.$.palette[alertPalette].softDarkest};
|
|
53
53
|
`}
|
|
54
54
|
`
|
|
55
55
|
: ''}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart-react-components/ui",
|
|
3
|
-
"version": "2.0.0-alpha-
|
|
3
|
+
"version": "2.0.0-alpha-58",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"description": "SRC UI includes React and Styled components.",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@smart-react-components/core": "2.0.0-alpha-26",
|
|
68
|
-
"@smart-react-components/router": "2.0.0-alpha-
|
|
68
|
+
"@smart-react-components/router": "2.0.0-alpha-23",
|
|
69
69
|
"@smart-react-components/transition": "2.0.0-alpha-21",
|
|
70
70
|
"@testing-library/react": "13.4.0",
|
|
71
71
|
"@types/jest": "29.0.1",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"@smart-react-components/core": "^2.0.0-alpha-26",
|
|
87
|
-
"@smart-react-components/router": "^2.0.0-alpha-
|
|
87
|
+
"@smart-react-components/router": "^2.0.0-alpha-23",
|
|
88
88
|
"@smart-react-components/transition": "^2.0.0-alpha-21",
|
|
89
89
|
"react": "^18.2.0",
|
|
90
90
|
"react-dom": "^18.2.0",
|