@occmundial/occ-atomic 3.0.0-beta.7 → 3.0.0-beta.8
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +20 -0
- package/build/Banner/Banner.js +24 -38
- package/build/Tip/Tip.js +42 -88
- package/build/Tip/Tip.test.js +0 -6
- package/build/Tip/TipText/index.js +41 -0
- package/build/Tip/__snapshots__/Tip.test.js.snap +79 -12
- package/build/Tip/styles.js +79 -26
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
# [3.0.0-beta.8](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2024-06-06)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Add border for promote alert ([5050f18](https://github.com/occmundial/occ-atomic/commit/5050f187b60f98118654ecbbe3e2cba7b29790ab))
|
7
|
+
* Add min height to tip container ([579d263](https://github.com/occmundial/occ-atomic/commit/579d26306d59ce73b5084f9cd632dd12ed162fc5))
|
8
|
+
* Resolve conflicts ([0a15dfa](https://github.com/occmundial/occ-atomic/commit/0a15dfa8d8da38a724d71622809f0e02c5bed0e9))
|
9
|
+
|
10
|
+
|
11
|
+
### Features
|
12
|
+
|
13
|
+
* Render tip in banner component ([239e2c8](https://github.com/occmundial/occ-atomic/commit/239e2c82c23d79698bd912931b314ceddf252fb4))
|
14
|
+
* Update tip component with new design tokens ([b2367fc](https://github.com/occmundial/occ-atomic/commit/b2367fcaade288609df4c841c91fb308841ae4b0))
|
15
|
+
|
16
|
+
|
17
|
+
### Performance Improvements
|
18
|
+
|
19
|
+
* Memoize text replace in tip text component ([69180ce](https://github.com/occmundial/occ-atomic/commit/69180ce9cb1e812769e31a837257d8c8e6f24199))
|
20
|
+
|
1
21
|
# [3.0.0-beta.7](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2024-06-06)
|
2
22
|
|
3
23
|
|
package/build/Banner/Banner.js
CHANGED
@@ -9,17 +9,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
11
11
|
|
12
|
-
var _Flexbox = _interopRequireDefault(require("../Flexbox"));
|
13
|
-
|
14
|
-
var _WindowSize = _interopRequireDefault(require("../WindowSize"));
|
15
|
-
|
16
|
-
var _Text = _interopRequireDefault(require("../Text"));
|
17
|
-
|
18
|
-
var _Icon = _interopRequireDefault(require("../Icon"));
|
19
|
-
|
20
12
|
var _grid = _interopRequireDefault(require("../subatomic/grid"));
|
21
13
|
|
22
|
-
var
|
14
|
+
var _Tip = _interopRequireDefault(require("../Tip"));
|
23
15
|
|
24
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
25
17
|
|
@@ -27,38 +19,27 @@ var Banner = function Banner(_ref) {
|
|
27
19
|
var id = _ref.id,
|
28
20
|
style = _ref.style,
|
29
21
|
className = _ref.className,
|
30
|
-
classes = _ref.classes,
|
31
22
|
children = _ref.children,
|
32
23
|
onClose = _ref.onClose,
|
33
|
-
winWidth = _ref.winWidth
|
34
|
-
|
35
|
-
|
24
|
+
winWidth = _ref.winWidth,
|
25
|
+
cta = _ref.cta,
|
26
|
+
_ref$theme = _ref.theme,
|
27
|
+
theme = _ref$theme === void 0 ? 'promote' : _ref$theme;
|
28
|
+
return /*#__PURE__*/_react["default"].createElement(_Tip["default"], {
|
36
29
|
id: id,
|
30
|
+
style: style,
|
37
31
|
className: className,
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
},
|
46
|
-
white: true,
|
47
|
-
small: isMobile,
|
48
|
-
tag: "div",
|
49
|
-
className: classes.textBanner
|
50
|
-
}, children)), /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
51
|
-
className: classes.iconFlex
|
52
|
-
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
53
|
-
iconName: "close",
|
54
|
-
colors: [_colors["default"].bgWhite],
|
55
|
-
onClick: onClose,
|
56
|
-
className: classes.icon
|
57
|
-
}))));
|
32
|
+
onClose: onClose,
|
33
|
+
size: winWidth < _grid["default"].xs ? 'small' : 'large',
|
34
|
+
center: true,
|
35
|
+
type: "banner",
|
36
|
+
cta: cta,
|
37
|
+
theme: theme,
|
38
|
+
icon: true
|
39
|
+
}, children);
|
58
40
|
};
|
59
41
|
|
60
42
|
Banner.propTypes = {
|
61
|
-
classes: _propTypes["default"].object.isRequired,
|
62
43
|
winWidth: _propTypes["default"].number,
|
63
44
|
|
64
45
|
/** Text of the tip. If you put text between two * characters that text will be displayed as bold. */
|
@@ -68,9 +49,14 @@ Banner.propTypes = {
|
|
68
49
|
id: _propTypes["default"].string,
|
69
50
|
className: _propTypes["default"].string,
|
70
51
|
style: _propTypes["default"].object,
|
71
|
-
onClose: _propTypes["default"].func
|
52
|
+
onClose: _propTypes["default"].func,
|
53
|
+
cta: _propTypes["default"].shape({
|
54
|
+
text: _propTypes["default"].string,
|
55
|
+
href: _propTypes["default"].string,
|
56
|
+
target: _propTypes["default"].string,
|
57
|
+
onClick: _propTypes["default"].func
|
58
|
+
}),
|
59
|
+
theme: _propTypes["default"].oneOf(['info', 'warning', 'success', 'error', 'promote'])
|
72
60
|
};
|
73
|
-
|
74
|
-
var _default = (0, _WindowSize["default"])(Banner);
|
75
|
-
|
61
|
+
var _default = Banner;
|
76
62
|
exports["default"] = _default;
|
package/build/Tip/Tip.js
CHANGED
@@ -1,39 +1,26 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
-
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
6
4
|
value: true
|
7
5
|
});
|
8
6
|
exports["default"] = void 0;
|
9
7
|
|
10
|
-
var _react =
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
11
9
|
|
12
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
13
11
|
|
14
|
-
var _isString = _interopRequireDefault(require("lodash/isString"));
|
15
|
-
|
16
|
-
var _flatten = _interopRequireDefault(require("lodash/flatten"));
|
17
|
-
|
18
12
|
var _Flexbox = _interopRequireDefault(require("../Flexbox"));
|
19
13
|
|
20
|
-
var _Text = _interopRequireDefault(require("../Text"));
|
21
|
-
|
22
14
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
23
15
|
|
24
|
-
var
|
25
|
-
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
16
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
27
17
|
|
28
|
-
|
18
|
+
var _TipText = _interopRequireDefault(require("./TipText"));
|
29
19
|
|
30
|
-
|
20
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
31
21
|
|
32
|
-
function
|
33
|
-
|
34
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
35
23
|
|
36
|
-
var boldRegex = /\*(.*?)\*/g;
|
37
24
|
var icons = {
|
38
25
|
info: 'info-circle',
|
39
26
|
warning: 'alert',
|
@@ -42,6 +29,13 @@ var icons = {
|
|
42
29
|
promote: null
|
43
30
|
};
|
44
31
|
var PROMOTE = 'promote';
|
32
|
+
var colorTextClasses = {
|
33
|
+
info: 'textInfo',
|
34
|
+
promote: 'textPromote',
|
35
|
+
warning: 'textWarning',
|
36
|
+
success: 'textSuccess',
|
37
|
+
error: 'textError'
|
38
|
+
};
|
45
39
|
/** Tip component with different themes (info, warning, success & error). You can pass a string or a react element as the children prop, but the bold regex will only work with strings. */
|
46
40
|
|
47
41
|
var Tip = function Tip(_ref) {
|
@@ -54,62 +48,12 @@ var Tip = function Tip(_ref) {
|
|
54
48
|
noBorderRadius = _ref.noBorderRadius,
|
55
49
|
center = _ref.center,
|
56
50
|
onClose = _ref.onClose,
|
57
|
-
spacedClose = _ref.spacedClose,
|
58
51
|
children = _ref.children,
|
59
|
-
cta = _ref.cta
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
if (result.length === 1) return children;
|
65
|
-
|
66
|
-
for (var i = 1, length = result.length; i < length; i += 2) {
|
67
|
-
result[i] = boldMatch(result[i], i, theme);
|
68
|
-
}
|
69
|
-
|
70
|
-
return result;
|
71
|
-
};
|
72
|
-
|
73
|
-
var getTheme = function getTheme() {
|
74
|
-
if (theme === PROMOTE) return {
|
75
|
-
white: true
|
76
|
-
};
|
77
|
-
return _defineProperty({}, theme, true);
|
78
|
-
};
|
79
|
-
|
80
|
-
var boldMatch = function boldMatch(match, i) {
|
81
|
-
return /*#__PURE__*/_react["default"].createElement(_Text["default"], _extends({
|
82
|
-
key: i,
|
83
|
-
strong: true,
|
84
|
-
tag: "b"
|
85
|
-
}, getTheme()), match);
|
86
|
-
};
|
87
|
-
|
88
|
-
var getIconName = function getIconName() {
|
89
|
-
return icons[theme];
|
90
|
-
};
|
91
|
-
|
92
|
-
var renderText = function renderText() {
|
93
|
-
var textArray;
|
94
|
-
if (!Array.isArray(children)) textArray = [children];
|
95
|
-
var text = (0, _flatten["default"])(textArray.map(function (x) {
|
96
|
-
return (0, _isString["default"])(x) ? replaceStringToBold(x, theme) : x;
|
97
|
-
}));
|
98
|
-
|
99
|
-
if (cta) {
|
100
|
-
text.push( /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, ' ', /*#__PURE__*/_react["default"].createElement("a", {
|
101
|
-
className: classes.cta,
|
102
|
-
href: cta.href,
|
103
|
-
target: cta.target,
|
104
|
-
onClick: cta.onClick
|
105
|
-
}, /*#__PURE__*/_react["default"].createElement(_Text["default"], _extends({
|
106
|
-
tag: "span"
|
107
|
-
}, getTheme()), cta.text))));
|
108
|
-
}
|
109
|
-
|
110
|
-
return text;
|
111
|
-
};
|
112
|
-
|
52
|
+
cta = _ref.cta,
|
53
|
+
_ref$size = _ref.size,
|
54
|
+
size = _ref$size === void 0 ? 'large' : _ref$size,
|
55
|
+
_ref$type = _ref.type,
|
56
|
+
type = _ref$type === void 0 ? 'alert' : _ref$type;
|
113
57
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
114
58
|
id: id,
|
115
59
|
className: className,
|
@@ -117,26 +61,34 @@ var Tip = function Tip(_ref) {
|
|
117
61
|
}, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
118
62
|
justifyContent: "start",
|
119
63
|
display: "flex",
|
120
|
-
className: "".concat(classes.container, " ").concat(classes[theme]).concat(noBorderRadius ? " ".concat(classes.noBorderRadius) : '')
|
64
|
+
className: "".concat(classes.container, " ").concat(classes[theme]).concat(noBorderRadius ? " ".concat(classes.noBorderRadius) : '').concat(size === 'small' ? " ".concat(classes.small) : '')
|
121
65
|
}, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
122
66
|
display: "flex",
|
123
67
|
flex: "1",
|
124
68
|
justifyContent: center ? 'center' : null,
|
125
|
-
alignItems: "
|
126
|
-
|
127
|
-
|
69
|
+
alignItems: "stretch",
|
70
|
+
className: type === 'banner' ? classes.bannerContent : ''
|
71
|
+
}, icon && theme !== PROMOTE && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
72
|
+
iconName: icons[theme],
|
128
73
|
className: classes.icon,
|
129
|
-
colors: [_colors["default"][""
|
130
|
-
}), /*#__PURE__*/_react["default"].createElement("
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
74
|
+
colors: [theme === 'info' ? _colors["default"].icon.brand["default"] : _colors["default"].icon[theme]]
|
75
|
+
}), /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
76
|
+
display: "flex",
|
77
|
+
direction: size === 'small' ? 'col' : 'row'
|
78
|
+
}, /*#__PURE__*/_react["default"].createElement(_TipText["default"], {
|
79
|
+
classes: "".concat(classes.normalText, " ").concat(classes[colorTextClasses[theme]]),
|
80
|
+
text: children
|
81
|
+
}), cta && /*#__PURE__*/_react["default"].createElement("a", {
|
82
|
+
className: "".concat(classes.cta, " ").concat(size === 'small' ? classes.ctaSmall : classes.ctaLarge, " ").concat(classes[colorTextClasses[theme]]),
|
83
|
+
href: cta.href,
|
84
|
+
target: cta.target,
|
85
|
+
onClick: cta.onClick
|
86
|
+
}, cta.text))), onClose && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
137
87
|
onClick: onClose,
|
138
|
-
|
139
|
-
|
88
|
+
className: classes.closeIcon,
|
89
|
+
size: type === 'banner' ? 'lg' : 'md',
|
90
|
+
icon: "x",
|
91
|
+
theme: theme === PROMOTE ? 'ghostWhite' : 'ghostGrey'
|
140
92
|
})));
|
141
93
|
};
|
142
94
|
|
@@ -151,6 +103,7 @@ Tip.propTypes = {
|
|
151
103
|
|
152
104
|
/** Text of the tip. If you put text between two * characters that text will be displayed as bold. */
|
153
105
|
children: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node]).isRequired,
|
106
|
+
size: _propTypes["default"].oneOf(['large', 'small']),
|
154
107
|
|
155
108
|
/** Call to action. Appended after the children's text. */
|
156
109
|
cta: _propTypes["default"].shape({
|
@@ -176,7 +129,8 @@ Tip.propTypes = {
|
|
176
129
|
spacedClose: _propTypes["default"].bool,
|
177
130
|
id: _propTypes["default"].string,
|
178
131
|
className: _propTypes["default"].string,
|
179
|
-
style: _propTypes["default"].object
|
132
|
+
style: _propTypes["default"].object,
|
133
|
+
type: _propTypes["default"].oneOf(['alert', 'banner'])
|
180
134
|
};
|
181
135
|
var _default = Tip;
|
182
136
|
exports["default"] = _default;
|
package/build/Tip/Tip.test.js
CHANGED
@@ -46,12 +46,6 @@ describe("Tip", function () {
|
|
46
46
|
}));
|
47
47
|
expect(wrapper.find('.icon').length).toBe(1);
|
48
48
|
});
|
49
|
-
it('has bold text', function () {
|
50
|
-
var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_Tip["default"], {
|
51
|
-
classes: classes
|
52
|
-
}, "Text with *bold* text"));
|
53
|
-
expect(wrapper.find('b').length).toBe(1);
|
54
|
-
});
|
55
49
|
});
|
56
50
|
describe("TipJSS", function () {
|
57
51
|
it('matches the snapshot', function () {
|
@@ -0,0 +1,41 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports["default"] = void 0;
|
9
|
+
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
11
|
+
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
13
|
+
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
15
|
+
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
17
|
+
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
19
|
+
|
20
|
+
var boldRegex = /\*(.*?)\*/g;
|
21
|
+
|
22
|
+
var TipText = function TipText(_ref) {
|
23
|
+
var classes = _ref.classes,
|
24
|
+
text = _ref.text;
|
25
|
+
if (text === '' || typeof text !== 'string') return text;
|
26
|
+
var result = (0, _react.useMemo)(function () {
|
27
|
+
return text.replace(boldRegex, function (_, txt) {
|
28
|
+
return txt;
|
29
|
+
});
|
30
|
+
}, [text]);
|
31
|
+
return /*#__PURE__*/_react["default"].createElement("p", {
|
32
|
+
className: classes
|
33
|
+
}, result);
|
34
|
+
};
|
35
|
+
|
36
|
+
TipText.propTypes = {
|
37
|
+
classes: _propTypes["default"].string.isRequired,
|
38
|
+
text: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node]).isRequired
|
39
|
+
};
|
40
|
+
var _default = TipText;
|
41
|
+
exports["default"] = _default;
|
@@ -4,44 +4,111 @@ exports[`Tip matches the snapshot 1`] = `ShallowWrapper {}`;
|
|
4
4
|
|
5
5
|
exports[`Tip styles matches the snapshot 1`] = `
|
6
6
|
Object {
|
7
|
+
"bannerContent": Object {
|
8
|
+
"margin": "auto",
|
9
|
+
"maxWidth": "1200px",
|
10
|
+
},
|
11
|
+
"closeIcon": Object {
|
12
|
+
"marginLeft": "16px",
|
13
|
+
},
|
7
14
|
"container": Object {
|
8
15
|
"alignItems": "center",
|
9
|
-
"borderRadius":
|
10
|
-
"
|
16
|
+
"borderRadius": "4px",
|
17
|
+
"minHeight": "56px",
|
18
|
+
"outlineOffset": "-1px",
|
19
|
+
"padding": Array [
|
20
|
+
"8px",
|
21
|
+
"16px",
|
22
|
+
],
|
11
23
|
},
|
12
24
|
"cta": Object {
|
13
25
|
"cursor": "pointer",
|
26
|
+
"font": "400 14px/1.5 'OccText', sans-serif",
|
14
27
|
"textDecoration": "underline",
|
28
|
+
"textWrap": "nowrap",
|
29
|
+
},
|
30
|
+
"ctaLarge": Object {
|
31
|
+
"alignSelf": "center",
|
32
|
+
"marginLeft": "16px",
|
33
|
+
},
|
34
|
+
"ctaSmall": Object {
|
35
|
+
"alignSelf": "start",
|
36
|
+
"margin": Array [
|
37
|
+
"8px",
|
38
|
+
0,
|
39
|
+
0,
|
40
|
+
],
|
15
41
|
},
|
16
42
|
"error": Object {
|
17
|
-
"backgroundColor": "#
|
43
|
+
"backgroundColor": "#fce8e8",
|
44
|
+
"outline": "1px solid #FBDFDF",
|
18
45
|
},
|
19
46
|
"icon": Object {
|
20
|
-
"
|
47
|
+
"flexShrink": 0,
|
48
|
+
"marginRight": "8px",
|
21
49
|
},
|
22
50
|
"info": Object {
|
23
|
-
"backgroundColor": "#
|
51
|
+
"backgroundColor": "#e3efff",
|
52
|
+
"outline": "1px solid #b9d7ff",
|
53
|
+
},
|
54
|
+
"largePadding": Object {
|
55
|
+
"padding": "12px",
|
24
56
|
},
|
25
57
|
"noBorderRadius": Object {
|
26
58
|
"borderRadius": 0,
|
27
59
|
},
|
60
|
+
"normalText": Object {
|
61
|
+
"display": "inline-block",
|
62
|
+
"font": "400 14px/1.5 'OccText', sans-serif",
|
63
|
+
"margin": 0,
|
64
|
+
},
|
28
65
|
"promote": Object {
|
29
|
-
"backgroundColor": "#
|
66
|
+
"backgroundColor": "#000",
|
67
|
+
"outline": "1px solid rgba(255,255,255,0.2)",
|
30
68
|
},
|
31
|
-
"
|
32
|
-
"
|
69
|
+
"small": Object {
|
70
|
+
"maxWidth": 360,
|
71
|
+
"padding": "12px",
|
72
|
+
},
|
73
|
+
"smallPadding": Object {
|
74
|
+
"padding": "8px",
|
33
75
|
},
|
34
76
|
"success": Object {
|
35
|
-
"backgroundColor": "#
|
77
|
+
"backgroundColor": "#ebfbf1",
|
78
|
+
"outline": "1px solid #d7f6e3",
|
36
79
|
},
|
37
80
|
"text": Object {
|
38
81
|
"maxWidth": "100%",
|
39
82
|
},
|
40
|
-
"
|
41
|
-
"
|
83
|
+
"textContainer": Object {
|
84
|
+
"padding": Array [
|
85
|
+
"12px",
|
86
|
+
0,
|
87
|
+
],
|
88
|
+
},
|
89
|
+
"textError": Object {
|
90
|
+
"color": "#8b1313",
|
91
|
+
"textDecorationColor": "#8b1313",
|
92
|
+
},
|
93
|
+
"textInfo": Object {
|
94
|
+
"color": "#083CAE",
|
95
|
+
"textDecorationColor": "#083CAE",
|
96
|
+
},
|
97
|
+
"textPromote": Object {
|
98
|
+
"color": "#fff",
|
99
|
+
"textDecorationColor": "#fff",
|
100
|
+
},
|
101
|
+
"textSuccess": Object {
|
102
|
+
"color": "#16542e",
|
103
|
+
"textDecorationColor": "#16542e",
|
104
|
+
},
|
105
|
+
"textWarning": Object {
|
106
|
+
"color": "#664a0e",
|
107
|
+
"textDecorationColor": "#664a0e",
|
42
108
|
},
|
43
109
|
"warning": Object {
|
44
|
-
"backgroundColor": "#
|
110
|
+
"backgroundColor": "#fff8e9",
|
111
|
+
"outline": "1px solid #fff1d3",
|
45
112
|
},
|
46
113
|
}
|
47
114
|
`;
|
package/build/Tip/styles.js
CHANGED
@@ -5,61 +5,114 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports["default"] = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _fonts = _interopRequireDefault(require("../tokens/fonts.json"));
|
11
|
+
|
12
|
+
var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
|
13
|
+
|
14
|
+
var _borderRadius = _interopRequireDefault(require("../tokens/borderRadius.json"));
|
15
|
+
|
16
|
+
var _styles = require("../Text/styles");
|
11
17
|
|
12
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
19
|
|
14
|
-
var infoLight = _colors["default"].infoLight,
|
15
|
-
warningLight = _colors["default"].warningLight,
|
16
|
-
successLight = _colors["default"].successLight,
|
17
|
-
errorLight = _colors["default"].errorLight,
|
18
|
-
grey900 = _colors["default"].grey900;
|
19
|
-
var radius = _spacing["default"].radius,
|
20
|
-
large = _spacing["default"].large,
|
21
|
-
medium = _spacing["default"].medium,
|
22
|
-
small = _spacing["default"].small,
|
23
|
-
tiny = _spacing["default"].tiny;
|
24
20
|
var _default = {
|
25
21
|
container: {
|
26
|
-
padding:
|
27
|
-
borderRadius:
|
28
|
-
|
22
|
+
padding: [_spacing["default"]['size-2'], _spacing["default"]['size-4']],
|
23
|
+
borderRadius: _borderRadius["default"]['br-xs'],
|
24
|
+
minHeight: '56px',
|
25
|
+
alignItems: 'center',
|
26
|
+
outlineOffset: '-1px'
|
29
27
|
},
|
30
28
|
noBorderRadius: {
|
31
29
|
borderRadius: 0
|
32
30
|
},
|
33
31
|
info: {
|
34
|
-
backgroundColor:
|
32
|
+
backgroundColor: _colors["default"].alert.info.bg,
|
33
|
+
outline: "1px solid ".concat(_colors["default"].alert.info.border)
|
35
34
|
},
|
36
35
|
warning: {
|
37
|
-
backgroundColor:
|
36
|
+
backgroundColor: _colors["default"].alert.warning.bg,
|
37
|
+
outline: "1px solid ".concat(_colors["default"].alert.warning.border)
|
38
38
|
},
|
39
39
|
success: {
|
40
|
-
backgroundColor:
|
40
|
+
backgroundColor: _colors["default"].alert.success.bg,
|
41
|
+
outline: "1px solid ".concat(_colors["default"].alert.success.border)
|
41
42
|
},
|
42
43
|
error: {
|
43
|
-
backgroundColor:
|
44
|
+
backgroundColor: _colors["default"].alert.error.bg,
|
45
|
+
outline: "1px solid ".concat(_colors["default"].alert.error.border)
|
44
46
|
},
|
45
47
|
promote: {
|
46
|
-
backgroundColor:
|
48
|
+
backgroundColor: _colors["default"].alert.neutral.bg,
|
49
|
+
outline: "1px solid ".concat(_colors["default"].alert.neutral.border)
|
50
|
+
},
|
51
|
+
textInfo: {
|
52
|
+
color: _colors["default"].text.indigo.primary,
|
53
|
+
textDecorationColor: _colors["default"].text.indigo.primary
|
54
|
+
},
|
55
|
+
textWarning: {
|
56
|
+
color: _colors["default"].text.warning,
|
57
|
+
textDecorationColor: _colors["default"].text.warning
|
58
|
+
},
|
59
|
+
textSuccess: {
|
60
|
+
color: _colors["default"].text.success,
|
61
|
+
textDecorationColor: _colors["default"].text.success
|
62
|
+
},
|
63
|
+
textError: {
|
64
|
+
color: _colors["default"].text.error,
|
65
|
+
textDecorationColor: _colors["default"].text.error
|
66
|
+
},
|
67
|
+
textPromote: {
|
68
|
+
color: _colors["default"].text.white.primary,
|
69
|
+
textDecorationColor: _colors["default"].text.white.primary
|
47
70
|
},
|
48
71
|
icon: {
|
49
|
-
marginRight:
|
72
|
+
marginRight: _spacing["default"]['size-2'],
|
73
|
+
flexShrink: 0
|
50
74
|
},
|
51
75
|
text: {
|
52
76
|
maxWidth: '100%'
|
53
77
|
},
|
54
|
-
|
55
|
-
|
78
|
+
closeIcon: {
|
79
|
+
marginLeft: _spacing["default"]['size-4']
|
56
80
|
},
|
57
|
-
|
58
|
-
|
81
|
+
smallPadding: {
|
82
|
+
padding: _spacing["default"]['size-2']
|
83
|
+
},
|
84
|
+
largePadding: {
|
85
|
+
padding: _spacing["default"]['size-3']
|
59
86
|
},
|
60
87
|
cta: {
|
61
88
|
textDecoration: 'underline',
|
62
|
-
|
89
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['alert-default']),
|
90
|
+
cursor: 'pointer',
|
91
|
+
textWrap: 'nowrap'
|
92
|
+
},
|
93
|
+
ctaLarge: {
|
94
|
+
marginLeft: _spacing["default"]['size-4'],
|
95
|
+
alignSelf: 'center'
|
96
|
+
},
|
97
|
+
ctaSmall: {
|
98
|
+
margin: [_spacing["default"]['size-2'], 0, 0],
|
99
|
+
alignSelf: 'start'
|
100
|
+
},
|
101
|
+
normalText: {
|
102
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['alert-default']),
|
103
|
+
display: 'inline-block',
|
104
|
+
margin: 0
|
105
|
+
},
|
106
|
+
textContainer: {
|
107
|
+
padding: [_spacing["default"]['size-3'], 0]
|
108
|
+
},
|
109
|
+
small: {
|
110
|
+
maxWidth: 360,
|
111
|
+
padding: _spacing["default"]['size-3']
|
112
|
+
},
|
113
|
+
bannerContent: {
|
114
|
+
maxWidth: '1200px',
|
115
|
+
margin: 'auto'
|
63
116
|
}
|
64
117
|
};
|
65
118
|
exports["default"] = _default;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@occmundial/occ-atomic",
|
3
|
-
"version": "3.0.0-beta.
|
3
|
+
"version": "3.0.0-beta.8",
|
4
4
|
"description": "Collection of shareable styled React components for OCC applications.",
|
5
5
|
"homepage": "http://occmundial.github.io/occ-atomic",
|
6
6
|
"main": "build/index.js",
|