@smart-react-components/ui 2.0.0-alpha-115 → 2.0.0-alpha-116
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
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -30,7 +7,8 @@ const element_props_1 = __importDefault(require("@smart-react-components/core/el
|
|
|
30
7
|
const click_events_1 = __importDefault(require("@smart-react-components/core/element-props/click-events"));
|
|
31
8
|
const intrinsic_styled_core_props_1 = __importDefault(require("@smart-react-components/core/element-props/intrinsic-styled-core-props"));
|
|
32
9
|
const react_1 = __importDefault(require("react"));
|
|
33
|
-
const
|
|
10
|
+
const AlertContent_1 = __importDefault(require("../components/Alert/AlertContent"));
|
|
11
|
+
const AlertElement_1 = __importDefault(require("../components/Alert/AlertElement"));
|
|
34
12
|
const types_1 = require("../types");
|
|
35
13
|
const Alert = props => {
|
|
36
14
|
const { children, hasIconLeft, hasIconRight, hasThickBorder } = react_1.default.useMemo(() => {
|
|
@@ -66,7 +44,7 @@ const Alert = props => {
|
|
|
66
44
|
return {
|
|
67
45
|
children: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
68
46
|
iconLeft && iconLeft,
|
|
69
|
-
react_1.default.createElement(
|
|
47
|
+
react_1.default.createElement(AlertContent_1.default, null, content),
|
|
70
48
|
iconRight && iconRight)),
|
|
71
49
|
hasIconLeft: !!iconLeft,
|
|
72
50
|
hasIconRight: !!iconRight,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
7
|
+
exports.default = styled_components_1.default.div.attrs({
|
|
8
|
+
className: 'src-alert-content',
|
|
9
|
+
}) `
|
|
10
|
+
flex: 1 1 auto;
|
|
11
|
+
min-width: 1px;
|
|
12
|
+
`;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { StyledProps } from '@smart-react-components/core/styled-props';
|
|
2
2
|
import { PaletteProp, ResponsiveProp, ShapeProp, SizeProp } from '@smart-react-components/core/types';
|
|
3
|
-
export declare const Content: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
3
|
interface Props extends StyledProps, ResponsiveProp<'alertSize', SizeProp> {
|
|
5
4
|
hasIconLeft: boolean;
|
|
6
5
|
hasIconRight: boolean;
|
|
@@ -3,19 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Content = void 0;
|
|
7
6
|
const Div_1 = __importDefault(require("@smart-react-components/core/Element/Div"));
|
|
8
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
8
|
const css_1 = require("../../util/css");
|
|
10
|
-
exports.Content = styled_components_1.default.div `
|
|
11
|
-
flex: 1 1 auto;
|
|
12
|
-
min-width: 1px;
|
|
13
|
-
`;
|
|
14
9
|
exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasIconLeft, hasIconRight }) => ({
|
|
15
10
|
getAlertSize: (v, t) => `
|
|
16
11
|
font-size: ${t.$.size.alert[v].fontSize};
|
|
17
12
|
|
|
18
|
-
|
|
13
|
+
.src-alert-content {
|
|
19
14
|
padding: ${t.$.size.alert[v].padding.y} ${t.$.size.alert[v].padding.x};
|
|
20
15
|
|
|
21
16
|
${hasIconLeft
|
|
@@ -29,7 +24,6 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasIc
|
|
|
29
24
|
padding-right: ${(0, css_1.toCSSValue)(t.$.size.alert[v].padding.x)(v => v / 2)};
|
|
30
25
|
`
|
|
31
26
|
: ''}
|
|
32
|
-
|
|
33
27
|
}
|
|
34
28
|
`,
|
|
35
29
|
}))(({ theme, hasThickBorder, isOutline, isSoft, palette, shape }) => `
|
|
@@ -78,7 +72,7 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasIc
|
|
|
78
72
|
border-left-width: 10px;
|
|
79
73
|
`}
|
|
80
74
|
|
|
81
|
-
|
|
75
|
+
.src-alert-content > {
|
|
82
76
|
header, h1, h2, h3, h4, h5, h6, p, hr {
|
|
83
77
|
margin-bottom: ${theme.$.length['3']};
|
|
84
78
|
margin-top: 0;
|