@smart-react-components/ui 2.0.0-alpha-115 → 2.0.0-alpha-117
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 +3 -25
- package/Badge/index.js +3 -25
- package/components/Alert/AlertContent.d.ts +4 -0
- package/components/Alert/AlertContent.js +12 -0
- package/components/Alert/AlertElement.d.ts +0 -1
- package/components/Alert/AlertElement.js +2 -8
- package/components/Badge/BadgeContent.d.ts +4 -0
- package/components/Badge/BadgeContent.js +12 -0
- package/components/Badge/BadgeElement.d.ts +0 -1
- package/components/Badge/BadgeElement.js +14 -20
- package/components/Badge/BadgeIconElement.js +3 -1
- package/package.json +1 -1
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,
|
package/Badge/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
|
};
|
|
@@ -33,7 +10,8 @@ const intrinsic_styled_position_props_1 = __importDefault(require("@smart-react-
|
|
|
33
10
|
const useChangeEffect_1 = __importDefault(require("@smart-react-components/core/hooks/useChangeEffect"));
|
|
34
11
|
const react_1 = __importDefault(require("react"));
|
|
35
12
|
const types_1 = require("../types");
|
|
36
|
-
const
|
|
13
|
+
const BadgeContent_1 = __importDefault(require("../components/Badge/BadgeContent"));
|
|
14
|
+
const BadgeElement_1 = __importDefault(require("../components/Badge/BadgeElement"));
|
|
37
15
|
const props_1 = require("../util/props");
|
|
38
16
|
const Badge = props => {
|
|
39
17
|
const getContent = () => {
|
|
@@ -65,7 +43,7 @@ const Badge = props => {
|
|
|
65
43
|
return {
|
|
66
44
|
children: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
67
45
|
iconLeft && iconLeft,
|
|
68
|
-
react_1.default.createElement(
|
|
46
|
+
react_1.default.createElement(BadgeContent_1.default, null, content),
|
|
69
47
|
iconRight && iconRight)),
|
|
70
48
|
hasIconLeft: !!iconLeft,
|
|
71
49
|
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;
|
|
@@ -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-badge-content',
|
|
9
|
+
}) `
|
|
10
|
+
border: solid 1px;
|
|
11
|
+
flex: 0 1 auto;
|
|
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<'badgeSize', SizeProp> {
|
|
5
4
|
hasIconLeft: boolean;
|
|
6
5
|
hasIconRight: boolean;
|
|
@@ -3,15 +3,9 @@ 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
|
-
const BadgeIconElement_1 = __importDefault(require("./BadgeIconElement"));
|
|
11
|
-
exports.Content = styled_components_1.default.div `
|
|
12
|
-
border: solid 1px;
|
|
13
|
-
flex: 0 1 auto;
|
|
14
|
-
`;
|
|
15
9
|
exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasIconLeft, hasIconRight, hasSpace, isFixedSize }) => ({
|
|
16
10
|
getBadgeSize: (v, t) => `
|
|
17
11
|
${hasSpace
|
|
@@ -20,7 +14,7 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasIc
|
|
|
20
14
|
`
|
|
21
15
|
: ''}
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
.src-badge-content {
|
|
24
18
|
font-size: ${t.$.size.badge[v].fontSize};
|
|
25
19
|
|
|
26
20
|
${!isFixedSize
|
|
@@ -45,7 +39,7 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasIc
|
|
|
45
39
|
`}
|
|
46
40
|
}
|
|
47
41
|
|
|
48
|
-
|
|
42
|
+
.src-badge-icon {
|
|
49
43
|
padding: 0 ${(0, css_1.toCSSValue)(t.$.size.badge[v].padding.x)(value => value / 2)};
|
|
50
44
|
}
|
|
51
45
|
|
|
@@ -64,7 +58,7 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasIc
|
|
|
64
58
|
word-break: break-word;
|
|
65
59
|
word-wrap: break-word;
|
|
66
60
|
|
|
67
|
-
|
|
61
|
+
.src-badge-content {
|
|
68
62
|
border-color: ${!isSoft ? theme.$.palette[palette].main : theme.$.palette[palette].soft};
|
|
69
63
|
border-radius: ${(isFixedSize && shape === 'rounded') ? '100%' : theme.$.radius.badge[shape]};
|
|
70
64
|
}
|
|
@@ -77,7 +71,7 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasIc
|
|
|
77
71
|
|
|
78
72
|
${!isOutline
|
|
79
73
|
? `
|
|
80
|
-
|
|
74
|
+
.src-badge-content {
|
|
81
75
|
${!isSoft
|
|
82
76
|
? `
|
|
83
77
|
background: ${theme.$.palette[palette].main};
|
|
@@ -98,23 +92,23 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasIc
|
|
|
98
92
|
&:active {
|
|
99
93
|
${!isSoft
|
|
100
94
|
? `
|
|
101
|
-
|
|
95
|
+
.src-badge-content {
|
|
102
96
|
background: ${theme.$.palette[palette].dynamicer};
|
|
103
97
|
border-color: ${theme.$.palette[palette].dynamicer};
|
|
104
98
|
}
|
|
105
99
|
|
|
106
|
-
|
|
100
|
+
.src-badge-icon {
|
|
107
101
|
background: ${theme.$.palette[palette].dynamicest};
|
|
108
102
|
border-color: ${theme.$.palette[palette].dynamicest};
|
|
109
103
|
}
|
|
110
104
|
`
|
|
111
105
|
: `
|
|
112
|
-
|
|
106
|
+
.src-badge-content {
|
|
113
107
|
background: ${theme.$.palette[palette].softDarker};
|
|
114
108
|
border-color: ${theme.$.palette[palette].softDarker};
|
|
115
109
|
}
|
|
116
110
|
|
|
117
|
-
|
|
111
|
+
.src-badge-icon {
|
|
118
112
|
background: ${theme.$.palette[palette].softDarkest};
|
|
119
113
|
border-color: ${theme.$.palette[palette].softDarkest};
|
|
120
114
|
}
|
|
@@ -124,7 +118,7 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasIc
|
|
|
124
118
|
: ''}
|
|
125
119
|
`
|
|
126
120
|
: `
|
|
127
|
-
|
|
121
|
+
.src-badge-content {
|
|
128
122
|
${!isSoft
|
|
129
123
|
? `
|
|
130
124
|
color: ${theme.$.palette[palette].main};
|
|
@@ -141,26 +135,26 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasIc
|
|
|
141
135
|
&:active {
|
|
142
136
|
${!isSoft
|
|
143
137
|
? `
|
|
144
|
-
|
|
138
|
+
.src-badge-content {
|
|
145
139
|
background: ${theme.$.palette[palette].main};
|
|
146
140
|
color: ${theme.$.palette[palette].font};
|
|
147
141
|
fill: ${theme.$.palette[palette].font};
|
|
148
142
|
}
|
|
149
143
|
|
|
150
|
-
|
|
144
|
+
.src-badge-icon {
|
|
151
145
|
background: ${theme.$.palette[palette].dynamicer};
|
|
152
146
|
color: ${theme.$.palette[palette].font};
|
|
153
147
|
fill: ${theme.$.palette[palette].font};
|
|
154
148
|
}
|
|
155
149
|
`
|
|
156
150
|
: `
|
|
157
|
-
|
|
151
|
+
.src-badge-content {
|
|
158
152
|
background: ${theme.$.palette[palette].soft};
|
|
159
153
|
color: ${theme.$.palette[palette].softFont};
|
|
160
154
|
fill: ${theme.$.palette[palette].softFont};
|
|
161
155
|
}
|
|
162
156
|
|
|
163
|
-
|
|
157
|
+
.src-badge-icon {
|
|
164
158
|
background: ${theme.$.palette[palette].softDarker};
|
|
165
159
|
color: ${theme.$.palette[palette].softFont};
|
|
166
160
|
fill: ${theme.$.palette[palette].softFont};
|
|
@@ -171,7 +165,7 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasIc
|
|
|
171
165
|
: ''}
|
|
172
166
|
`}
|
|
173
167
|
|
|
174
|
-
|
|
168
|
+
.src-badge-content {
|
|
175
169
|
${isFixedSize
|
|
176
170
|
? `
|
|
177
171
|
align-items: center;
|
|
@@ -7,7 +7,9 @@ const Div_1 = __importDefault(require("@smart-react-components/core/Element/Div"
|
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
8
|
const types_1 = require("../../types");
|
|
9
9
|
const props_1 = require("../../util/props");
|
|
10
|
-
exports.default = (0, styled_components_1.default)(Div_1.default)(
|
|
10
|
+
exports.default = (0, styled_components_1.default)(Div_1.default).attrs({
|
|
11
|
+
className: 'src-badge-icon',
|
|
12
|
+
})(({ theme, iconPosition, isClickable, isOutline, isSoft, palette, shape }) => `
|
|
11
13
|
align-items: center;
|
|
12
14
|
align-self: stretch;
|
|
13
15
|
border: solid 1px;
|