@occmundial/occ-atomic 3.0.0-beta.43 → 3.0.0-beta.44
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +7 -0
- package/build/Fab/__snapshots__/Fab.test.js.snap +3 -3
- package/build/Placeholder/Placeholder.js +29 -12
- package/build/Placeholder/__snapshots__/Placeholder.test.js.snap +81 -38
- package/build/Placeholder/styles.js +86 -42
- package/build/Text/Text.js +2 -1
- package/build/Toaster/__snapshots__/Toaster.test.js.snap +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [3.0.0-beta.44](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.43...v3.0.0-beta.44) (2024-08-09)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* Placeholder styles and documentation revamp ([1b66e82](https://github.com/occmundial/occ-atomic/commit/1b66e82cab64d8a23bd7dd336c9bb4666242846c))
|
7
|
+
|
1
8
|
# [3.0.0-beta.43](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.42...v3.0.0-beta.43) (2024-08-08)
|
2
9
|
|
3
10
|
|
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
exports[`FAB matches the snapshot 1`] = `
|
4
4
|
<button
|
5
|
-
className="Button-btn-0-1-
|
5
|
+
className="Button-btn-0-1-1 Button-tertiary-0-1-6 fab Button-iconOnly-0-1-18 Button-round-0-1-20"
|
6
6
|
disabled={false}
|
7
7
|
>
|
8
8
|
<span
|
9
|
-
className="Button-cont-0-1-
|
9
|
+
className="Button-cont-0-1-2"
|
10
10
|
>
|
11
11
|
<span
|
12
|
-
className="Icon-oldIcon-0-1-
|
12
|
+
className="Icon-oldIcon-0-1-24 Icon-oldIcon-0-1-26 Button-icon-0-1-16"
|
13
13
|
/>
|
14
14
|
|
15
15
|
</span>
|
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
11
11
|
|
12
|
-
var
|
12
|
+
var _Text = require("../Text/Text");
|
13
13
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
15
15
|
|
@@ -19,26 +19,43 @@ var Placeholder = function Placeholder(_ref) {
|
|
19
19
|
textSize = _ref.textSize,
|
20
20
|
round = _ref.round,
|
21
21
|
top = _ref.top,
|
22
|
-
bottom = _ref.bottom
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
bottom = _ref.bottom,
|
23
|
+
className = _ref.className,
|
24
|
+
style = _ref.style,
|
25
|
+
_ref$theme = _ref.theme,
|
26
|
+
theme = _ref$theme === void 0 ? 'light' : _ref$theme;
|
27
|
+
var textSizeClass = textSize ? classes[_Text.oldToNewClassMapper[textSize] || textSize] : '';
|
28
|
+
var marginTopClass = top ? " ".concat(classes["top".concat(top)]) : '';
|
29
|
+
var marginBottomClass = bottom ? " ".concat(classes["bottom".concat(bottom)]) : '';
|
30
|
+
var roundClass = round ? " ".concat(classes.round) : '';
|
31
|
+
var classNameClass = className ? className : '';
|
32
|
+
var containerBaseClasses = "".concat(classes.placeholder, " ").concat(classes[theme]);
|
33
|
+
var containerClasses = "".concat(roundClass, " ").concat(textSizeClass, " ").concat(marginTopClass, " ").concat(marginBottomClass, " ").concat(classNameClass).replace(/\s{2,}/, ' ');
|
34
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
35
|
+
className: "".concat(containerBaseClasses, " ").concat(containerClasses),
|
36
|
+
style: style
|
37
|
+
});
|
30
38
|
};
|
31
39
|
|
32
40
|
Placeholder.propTypes = {
|
33
41
|
classes: _propTypes["default"].object.isRequired,
|
34
42
|
|
43
|
+
/** Adds placeholder container classes. */
|
44
|
+
className: _propTypes["default"].string,
|
45
|
+
|
46
|
+
/** Adds placeholder container syles. */
|
47
|
+
style: _propTypes["default"].object,
|
48
|
+
|
49
|
+
/** Theme of the placeholder, whether light or dark. */
|
50
|
+
theme: _propTypes["default"].oneOf(['light', 'dark']),
|
51
|
+
|
35
52
|
/** Simulates a row of text. It has the same size and line-height as the Text component. */
|
36
|
-
textSize: _propTypes["default"].oneOf(['hero', 'headline', 'heading', 'subheading', 'large', 'standard', 'small', 'micro']),
|
53
|
+
textSize: _propTypes["default"].oneOf(['display', 'h1', 'h2', 'h3', 'h4', 'h5', 'tag', 'bodyXLarge', 'bodyLargeStrong', 'bodyLarge', 'bodyRegularStrong', 'bodyRegular', 'bodySmallStrong', 'bodySmall', 'bodyXSmall', 'hero', 'headline', 'heading', 'subheading', 'large', 'standard', 'small', 'micro']),
|
37
54
|
|
38
|
-
/** Spacing in the top of the placeholder. */
|
55
|
+
/** Spacing in the top of the placeholder. (deprecated) */
|
39
56
|
top: _propTypes["default"].oneOf(['xTiny', 'tiny', 'small', 'base', 'medium', 'large', 'xLarge']),
|
40
57
|
|
41
|
-
/** Spacing in the bottom of the placeholder. */
|
58
|
+
/** Spacing in the bottom of the placeholder. (deprecated) */
|
42
59
|
bottom: _propTypes["default"].oneOf(['xTiny', 'tiny', 'small', 'base', 'medium', 'large', 'xLarge']),
|
43
60
|
|
44
61
|
/** Width of the placeholder. You can use numbers or a string with a percentage. */
|
@@ -12,6 +12,38 @@ Object {
|
|
12
12
|
"transform": "translate3d(100%, 0, 0)",
|
13
13
|
},
|
14
14
|
},
|
15
|
+
"bodyLarge": Object {
|
16
|
+
"height": 18,
|
17
|
+
"margin": "4.5px 0",
|
18
|
+
},
|
19
|
+
"bodyLargeStrong": Object {
|
20
|
+
"height": 18,
|
21
|
+
"margin": "4.5px 0",
|
22
|
+
},
|
23
|
+
"bodyRegular": Object {
|
24
|
+
"height": 16,
|
25
|
+
"margin": "4px 0",
|
26
|
+
},
|
27
|
+
"bodyRegularStrong": Object {
|
28
|
+
"height": 16,
|
29
|
+
"margin": "4px 0",
|
30
|
+
},
|
31
|
+
"bodySmall": Object {
|
32
|
+
"height": 14,
|
33
|
+
"margin": "3.5px 0",
|
34
|
+
},
|
35
|
+
"bodySmallStrong": Object {
|
36
|
+
"height": 14,
|
37
|
+
"margin": "3.5px 0",
|
38
|
+
},
|
39
|
+
"bodyXLarge": Object {
|
40
|
+
"height": 20,
|
41
|
+
"margin": "5px 0",
|
42
|
+
},
|
43
|
+
"bodyXSmall": Object {
|
44
|
+
"height": 12,
|
45
|
+
"margin": "3px 0",
|
46
|
+
},
|
15
47
|
"bottombase": Object {
|
16
48
|
"marginBottom": 24,
|
17
49
|
},
|
@@ -33,40 +65,67 @@ Object {
|
|
33
65
|
"bottomxTiny": Object {
|
34
66
|
"marginBottom": 4,
|
35
67
|
},
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
68
|
+
"dark": Object {
|
69
|
+
"&:after": Object {
|
70
|
+
"background": "linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.1) , rgba(255,255,255,0) )",
|
39
71
|
},
|
40
|
-
"
|
72
|
+
"background": "rgba(255,255,255,0.1)",
|
73
|
+
"overflow": "hidden",
|
41
74
|
},
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"height":
|
75
|
+
"display": Object {
|
76
|
+
"@media screen and (min-width:768px)": Object {
|
77
|
+
"height": 72,
|
78
|
+
"margin": "3.6px 0",
|
45
79
|
},
|
46
80
|
"height": 48,
|
81
|
+
"margin": "2.4px 0",
|
82
|
+
},
|
83
|
+
"h1": Object {
|
84
|
+
"@media screen and (min-width:768px)": Object {
|
85
|
+
"height": 48,
|
86
|
+
"margin": "2.4px 0",
|
87
|
+
},
|
88
|
+
"height": 32,
|
89
|
+
"margin": "1.6px 0",
|
47
90
|
},
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"height":
|
91
|
+
"h2": Object {
|
92
|
+
"@media screen and (min-width:768px)": Object {
|
93
|
+
"height": 40,
|
94
|
+
"margin": "2px 0",
|
51
95
|
},
|
52
|
-
"height":
|
96
|
+
"height": 28,
|
97
|
+
"margin": "1.4px 0",
|
53
98
|
},
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"height":
|
99
|
+
"h3": Object {
|
100
|
+
"@media screen and (min-width:768px)": Object {
|
101
|
+
"height": 30.8,
|
102
|
+
"margin": "1.4px 0",
|
57
103
|
},
|
58
104
|
"height": 24,
|
105
|
+
"margin": "1.2px 0",
|
59
106
|
},
|
60
|
-
"
|
61
|
-
"
|
62
|
-
"height":
|
107
|
+
"h4": Object {
|
108
|
+
"@media screen and (min-width:768px)": Object {
|
109
|
+
"height": 24,
|
110
|
+
"padding": "1.2px 0",
|
63
111
|
},
|
64
|
-
"height":
|
112
|
+
"height": 20,
|
113
|
+
"margin": "1px 0",
|
114
|
+
},
|
115
|
+
"h5": Object {
|
116
|
+
"height": 18,
|
117
|
+
"margin": "0.9px 0",
|
118
|
+
},
|
119
|
+
"light": Object {
|
120
|
+
"&:after": Object {
|
121
|
+
"background": "linear-gradient(90deg, rgba(0,0,0,0.0) , rgba(0,0,0,0.05) , rgba(0,0,0,0.0) )",
|
122
|
+
},
|
123
|
+
"background": "rgba(0,0,0,0.05)",
|
124
|
+
"overflow": "hidden",
|
65
125
|
},
|
66
126
|
"placeholder": Object {
|
67
127
|
"&:after": Object {
|
68
128
|
"animation": "progress 2s ease-in-out infinite",
|
69
|
-
"background": "linear-gradient(90deg, rgba(204, 204, 204, 0), rgba(204, 204, 204, 0.7), rgba(204, 204, 204, 0))",
|
70
129
|
"content": "\\"\\"",
|
71
130
|
"height": "100%",
|
72
131
|
"left": 0,
|
@@ -74,10 +133,8 @@ Object {
|
|
74
133
|
"top": 0,
|
75
134
|
"width": "100%",
|
76
135
|
},
|
77
|
-
"background": "#f2f2f2",
|
78
136
|
"borderRadius": 4,
|
79
137
|
"height": [Function],
|
80
|
-
"mixBlendMode": "multiply",
|
81
138
|
"overflow": "hidden",
|
82
139
|
"position": "relative",
|
83
140
|
"width": [Function],
|
@@ -85,23 +142,9 @@ Object {
|
|
85
142
|
"round": Object {
|
86
143
|
"borderRadius": "50%",
|
87
144
|
},
|
88
|
-
"
|
89
|
-
"
|
90
|
-
|
91
|
-
},
|
92
|
-
"height": 16,
|
93
|
-
},
|
94
|
-
"standard": Object {
|
95
|
-
"& $placeholder": Object {
|
96
|
-
"height": 15,
|
97
|
-
},
|
98
|
-
"height": 24,
|
99
|
-
},
|
100
|
-
"subheading": Object {
|
101
|
-
"& $placeholder": Object {
|
102
|
-
"height": 17,
|
103
|
-
},
|
104
|
-
"height": 24,
|
145
|
+
"tag": Object {
|
146
|
+
"height": 10,
|
147
|
+
"margin": "2.5px 0",
|
105
148
|
},
|
106
149
|
"topbase": Object {
|
107
150
|
"marginTop": 24,
|
@@ -7,8 +7,14 @@ exports["default"] = void 0;
|
|
7
7
|
|
8
8
|
var _spacing = _interopRequireDefault(require("../subatomic/spacing"));
|
9
9
|
|
10
|
+
var _grid = _interopRequireDefault(require("../subatomic/grid"));
|
11
|
+
|
12
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
13
|
+
|
10
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
11
15
|
|
16
|
+
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; }
|
17
|
+
|
12
18
|
var _default = {
|
13
19
|
'@keyframes progress': {
|
14
20
|
'0%': {
|
@@ -20,16 +26,14 @@ var _default = {
|
|
20
26
|
},
|
21
27
|
placeholder: {
|
22
28
|
width: function width(props) {
|
23
|
-
return props.width ? props.width :
|
29
|
+
return props.width ? props.width : null;
|
24
30
|
},
|
25
31
|
height: function height(props) {
|
26
|
-
return props.height ? props.height : 14;
|
32
|
+
return props.height ? props.height : !props.textSize ? 14 : null;
|
27
33
|
},
|
28
34
|
borderRadius: _spacing["default"].xTiny,
|
29
35
|
position: 'relative',
|
30
36
|
overflow: 'hidden',
|
31
|
-
background: '#f2f2f2',
|
32
|
-
mixBlendMode: 'multiply',
|
33
37
|
'&:after': {
|
34
38
|
content: '""',
|
35
39
|
position: 'absolute',
|
@@ -37,60 +41,100 @@ var _default = {
|
|
37
41
|
left: 0,
|
38
42
|
width: '100%',
|
39
43
|
height: '100%',
|
40
|
-
background: "linear-gradient(90deg, rgba(204, 204, 204, 0), rgba(204, 204, 204, 0.7), rgba(204, 204, 204, 0))",
|
41
44
|
animation: 'progress 2s ease-in-out infinite'
|
42
45
|
}
|
43
46
|
},
|
47
|
+
light: {
|
48
|
+
background: _colors["default"].skeleton.bg["default"]["default"],
|
49
|
+
overflow: 'hidden',
|
50
|
+
'&:after': {
|
51
|
+
background: _colors["default"].skeleton.bg["default"].gradient
|
52
|
+
}
|
53
|
+
},
|
54
|
+
dark: {
|
55
|
+
background: _colors["default"].skeleton.bg.inverse["default"],
|
56
|
+
overflow: 'hidden',
|
57
|
+
'&:after': {
|
58
|
+
background: _colors["default"].skeleton.bg.inverse.gradient
|
59
|
+
}
|
60
|
+
},
|
44
61
|
round: {
|
45
62
|
borderRadius: '50%'
|
46
63
|
},
|
47
|
-
|
64
|
+
display: _defineProperty({
|
65
|
+
height: 48,
|
66
|
+
margin: '2.4px 0'
|
67
|
+
}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
48
68
|
height: 72,
|
49
|
-
'
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
69
|
+
margin: '3.6px 0'
|
70
|
+
}),
|
71
|
+
h1: _defineProperty({
|
72
|
+
height: 32,
|
73
|
+
margin: '1.6px 0'
|
74
|
+
}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
54
75
|
height: 48,
|
55
|
-
'
|
56
|
-
|
57
|
-
|
76
|
+
margin: '2.4px 0'
|
77
|
+
}),
|
78
|
+
h2: _defineProperty({
|
79
|
+
height: 28,
|
80
|
+
margin: '1.4px 0'
|
81
|
+
}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
82
|
+
height: 40,
|
83
|
+
margin: '2px 0'
|
84
|
+
}),
|
85
|
+
h3: _defineProperty({
|
86
|
+
height: 24,
|
87
|
+
margin: '1.2px 0'
|
88
|
+
}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
89
|
+
height: 30.8,
|
90
|
+
margin: '1.4px 0'
|
91
|
+
}),
|
92
|
+
h4: _defineProperty({
|
93
|
+
height: 20,
|
94
|
+
margin: '1px 0'
|
95
|
+
}, "@media screen and (min-width:".concat(_grid["default"].sm, "px)"), {
|
96
|
+
height: 24,
|
97
|
+
padding: '1.2px 0'
|
98
|
+
}),
|
99
|
+
h5: {
|
100
|
+
height: 18,
|
101
|
+
margin: '0.9px 0'
|
58
102
|
},
|
59
|
-
|
60
|
-
height:
|
61
|
-
'
|
62
|
-
height: 22
|
63
|
-
}
|
103
|
+
tag: {
|
104
|
+
height: 10,
|
105
|
+
margin: '2.5px 0'
|
64
106
|
},
|
65
|
-
|
66
|
-
height:
|
67
|
-
'
|
68
|
-
height: 17
|
69
|
-
}
|
107
|
+
bodyXLarge: {
|
108
|
+
height: 20,
|
109
|
+
margin: '5px 0'
|
70
110
|
},
|
71
|
-
|
72
|
-
height:
|
73
|
-
'
|
74
|
-
height: 17
|
75
|
-
}
|
111
|
+
bodyLargeStrong: {
|
112
|
+
height: 18,
|
113
|
+
margin: '4.5px 0'
|
76
114
|
},
|
77
|
-
|
78
|
-
height:
|
79
|
-
'
|
80
|
-
height: 15
|
81
|
-
}
|
115
|
+
bodyLarge: {
|
116
|
+
height: 18,
|
117
|
+
margin: '4.5px 0'
|
82
118
|
},
|
83
|
-
|
119
|
+
bodyRegularStrong: {
|
84
120
|
height: 16,
|
85
|
-
'
|
86
|
-
height: 13
|
87
|
-
}
|
121
|
+
margin: '4px 0'
|
88
122
|
},
|
89
|
-
|
123
|
+
bodyRegular: {
|
90
124
|
height: 16,
|
91
|
-
'
|
92
|
-
|
93
|
-
|
125
|
+
margin: '4px 0'
|
126
|
+
},
|
127
|
+
bodySmallStrong: {
|
128
|
+
height: 14,
|
129
|
+
margin: '3.5px 0'
|
130
|
+
},
|
131
|
+
bodySmall: {
|
132
|
+
height: 14,
|
133
|
+
margin: '3.5px 0'
|
134
|
+
},
|
135
|
+
bodyXSmall: {
|
136
|
+
height: 12,
|
137
|
+
margin: '3px 0'
|
94
138
|
},
|
95
139
|
topxTiny: {
|
96
140
|
marginTop: _spacing["default"].xTiny
|
package/build/Text/Text.js
CHANGED
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
-
exports["default"] = void 0;
|
8
|
+
exports["default"] = exports.oldToNewClassMapper = void 0;
|
9
9
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
11
11
|
|
@@ -77,6 +77,7 @@ var oldToNewClassMapper = {
|
|
77
77
|
bottomLarge: 'bottom8',
|
78
78
|
bottomXLarge: 'bottom9'
|
79
79
|
};
|
80
|
+
exports.oldToNewClassMapper = oldToNewClassMapper;
|
80
81
|
|
81
82
|
var getActiveKey = function getActiveKey(array) {
|
82
83
|
var _iterator = _createForOfIteratorHelper(array),
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
2
|
|
3
|
-
exports[`Toaster launches a toast 1`] = `"<div class=\\"container\\"><div class=\\"Toast-toast-0-1-1 Toast-success-0-1-3\\"><div class=\\"Flexbox-flex-0-1-25 Flexbox-jbetween-0-1-37\\"><div class=\\"Flexbox-flex-0-1-25 Flexbox-acenter-0-1-42 Flexbox-scenter-0-1-54\\" style=\\"flex: 1;\\"><svg class=\\"Icon-icon-0-1-
|
3
|
+
exports[`Toaster launches a toast 1`] = `"<div class=\\"container\\"><div class=\\"Toast-toast-0-1-1 Toast-success-0-1-3\\"><div class=\\"Flexbox-flex-0-1-25 Flexbox-jbetween-0-1-37\\"><div class=\\"Flexbox-flex-0-1-25 Flexbox-acenter-0-1-42 Flexbox-scenter-0-1-54\\" style=\\"flex: 1;\\"><svg class=\\"Icon-icon-0-1-57 Icon-icon-0-1-60 undefined__check-circle Toast-icon-0-1-21\\" width=\\"24\\" height=\\"24\\" fill=\\"#38d373\\" style=\\"transition: 0.3s all;\\"><use xlink:href=\\"undefined#undefined__check-circle\\"></use></svg><div class=\\"Flexbox-flex-0-1-25 Flexbox-jbetween-0-1-37 Flexbox-scenter-0-1-54 Toast-content-0-1-20\\" style=\\"flex: 1;\\"><div class=\\"Flexbox-flex-0-1-25 Flexbox-col-0-1-29\\"><p class=\\"Toast-title-0-1-18 Toast-textSuccess-0-1-10\\">Title</p></div></div></div></div></div></div>"`;
|
4
4
|
|
5
5
|
exports[`Toaster matches the snapshot 1`] = `"<div class=\\"container\\"></div>"`;
|
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.44",
|
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",
|