@occmundial/occ-atomic 3.0.0-beta.43 → 3.0.0-beta.45
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +19 -0
- package/build/Placeholder/Placeholder.js +29 -12
- package/build/Placeholder/Placeholder.test.js +4 -4
- package/build/Placeholder/__snapshots__/Placeholder.test.js.snap +81 -38
- package/build/Placeholder/styles.js +86 -42
- package/build/SlideDown/SlideDown.js +35 -13
- package/build/SlideDown/__snapshots__/SlideDown.test.js.snap +3 -0
- package/build/SlideDown/styles.js +3 -0
- package/build/Text/Text.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
# [3.0.0-beta.45](https://github.com/occmundial/occ-atomic/compare/v3.0.0-beta.44...v3.0.0-beta.45) (2024-08-15)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Resolve conflicts ([c52608d](https://github.com/occmundial/occ-atomic/commit/c52608d63b00072280a8731515276bd477ca41fd))
|
7
|
+
|
8
|
+
|
9
|
+
### Features
|
10
|
+
|
11
|
+
* Add disabled state ([717d1cc](https://github.com/occmundial/occ-atomic/commit/717d1cc4c9a2fd3becb2d03b7663729778c59ec2))
|
12
|
+
|
13
|
+
# [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)
|
14
|
+
|
15
|
+
|
16
|
+
### Features
|
17
|
+
|
18
|
+
* Placeholder styles and documentation revamp ([1b66e82](https://github.com/occmundial/occ-atomic/commit/1b66e82cab64d8a23bd7dd336c9bb4666242846c))
|
19
|
+
|
1
20
|
# [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
21
|
|
3
22
|
|
@@ -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. */
|
@@ -30,19 +30,19 @@ describe('Placeholder', function () {
|
|
30
30
|
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Placeholder["default"], {
|
31
31
|
classes: classes
|
32
32
|
}));
|
33
|
-
expect(wrapper.prop('className')).toBe('');
|
33
|
+
expect(wrapper.prop('className')).toBe('placeholder light ');
|
34
34
|
wrapper.setProps({
|
35
35
|
textSize: 'headline'
|
36
36
|
});
|
37
|
-
expect(wrapper.prop('className')).toBe('
|
37
|
+
expect(wrapper.prop('className')).toBe('placeholder light h2 ');
|
38
38
|
wrapper.setProps({
|
39
39
|
top: 'tiny'
|
40
40
|
});
|
41
|
-
expect(wrapper.prop('className')).toBe('
|
41
|
+
expect(wrapper.prop('className')).toBe('placeholder light h2 toptiny ');
|
42
42
|
wrapper.setProps({
|
43
43
|
bottom: 'small'
|
44
44
|
});
|
45
|
-
expect(wrapper.prop('className')).toBe('
|
45
|
+
expect(wrapper.prop('className')).toBe('placeholder light h2 toptiny bottomsmall ');
|
46
46
|
});
|
47
47
|
});
|
48
48
|
describe("PlaceholderJSS", function () {
|
@@ -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
|
@@ -65,15 +65,31 @@ var textSizes = {
|
|
65
65
|
};
|
66
66
|
var _themeColors = {
|
67
67
|
blue: {
|
68
|
-
icon:
|
68
|
+
icon: {
|
69
|
+
"default": _colors["default"].icon.brand["default"],
|
70
|
+
disabled: _colors["default"].icon.brand.disabled
|
71
|
+
},
|
69
72
|
text: {
|
70
|
-
|
73
|
+
"default": {
|
74
|
+
primary: true
|
75
|
+
},
|
76
|
+
disabled: {
|
77
|
+
indigoSecondary: true
|
78
|
+
}
|
71
79
|
}
|
72
80
|
},
|
73
81
|
"default": {
|
74
|
-
icon:
|
82
|
+
icon: {
|
83
|
+
"default": _colors["default"].icon["default"].bold,
|
84
|
+
disabled: _colors["default"].icon["default"].disabled
|
85
|
+
},
|
75
86
|
text: {
|
76
|
-
|
87
|
+
"default": {
|
88
|
+
highEmphasis: true
|
89
|
+
},
|
90
|
+
disabled: {
|
91
|
+
disabled: true
|
92
|
+
}
|
77
93
|
}
|
78
94
|
}
|
79
95
|
};
|
@@ -94,6 +110,7 @@ function SlideDown(_ref) {
|
|
94
110
|
icon = _ref.icon,
|
95
111
|
divider = _ref.divider,
|
96
112
|
noPadding = _ref.noPadding,
|
113
|
+
disabled = _ref.disabled,
|
97
114
|
testId = _ref.testId;
|
98
115
|
|
99
116
|
var _useState = (0, _react.useState)(!!expanded),
|
@@ -111,7 +128,7 @@ function SlideDown(_ref) {
|
|
111
128
|
};
|
112
129
|
|
113
130
|
var getTextProps = function getTextProps() {
|
114
|
-
return _objectSpread(_objectSpread({}, textSizes[textSize] || textSizes["default"]), themeColors.text);
|
131
|
+
return _objectSpread(_objectSpread({}, textSizes[textSize] || textSizes["default"]), disabled ? themeColors.text.disabled : themeColors.text["default"]);
|
115
132
|
};
|
116
133
|
|
117
134
|
(0, _react.useEffect)(function () {
|
@@ -121,12 +138,14 @@ function SlideDown(_ref) {
|
|
121
138
|
}, [prevExpanded, expanded]);
|
122
139
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
123
140
|
className: "".concat(classes.wrapper).concat(divider ? " ".concat(classes.divider) : '')
|
124
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
125
|
-
className: "".concat(classes.button, " ").concat(textSize === 'lg' ? classes.largePadding : classes.normalPadding).concat(!noPadding ? " ".concat(classes.buttonPadding) : ''),
|
126
|
-
role: "button"
|
127
|
-
|
141
|
+
}, /*#__PURE__*/_react["default"].createElement("div", _extends({
|
142
|
+
className: "".concat(classes.button, " ").concat(textSize === 'lg' ? classes.largePadding : classes.normalPadding).concat(!noPadding ? " ".concat(classes.buttonPadding) : '').concat(disabled ? " ".concat(classes.disabled) : ''),
|
143
|
+
role: "button"
|
144
|
+
}, !disabled && {
|
145
|
+
onClick: toggleContent
|
146
|
+
}, {
|
128
147
|
"data-testid": testId
|
129
|
-
}, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
148
|
+
}), /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
130
149
|
display: "flex",
|
131
150
|
justifyContent: !noJustified ? 'between' : null,
|
132
151
|
alignItems: "center",
|
@@ -139,18 +158,18 @@ function SlideDown(_ref) {
|
|
139
158
|
iconName: icon,
|
140
159
|
width: 16,
|
141
160
|
height: 16,
|
142
|
-
colors: [themeColors.icon],
|
161
|
+
colors: [!disabled ? themeColors.icon["default"] : themeColors.icon.disabled],
|
143
162
|
className: classes.leftIcon
|
144
163
|
}) : '', customTitle || /*#__PURE__*/_react["default"].createElement(_Text["default"], _extends({}, getTextProps(), {
|
145
164
|
strong: strong,
|
146
165
|
tag: "label",
|
147
|
-
className: classes.text
|
166
|
+
className: "".concat(classes.text).concat(disabled ? " ".concat(classes.disabled) : '')
|
148
167
|
}), title), tag && /*#__PURE__*/_react["default"].createElement(_Tag["default"], {
|
149
168
|
theme: "info",
|
150
169
|
className: classes.tag
|
151
170
|
}, tag)), /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
152
171
|
iconName: "arrowDown",
|
153
|
-
colors: [themeColors.icon],
|
172
|
+
colors: [!disabled ? themeColors.icon["default"] : themeColors.icon.disabled],
|
154
173
|
className: "".concat(classes.icon).concat(_expanded ? " ".concat(classes.rotateIcon) : ''),
|
155
174
|
width: 16,
|
156
175
|
height: 16,
|
@@ -211,6 +230,9 @@ SlideDown.propTypes = {
|
|
211
230
|
/** The container has by default a side padding. Use this property if you need to remove it. */
|
212
231
|
noPadding: _propTypes["default"].bool,
|
213
232
|
|
233
|
+
/** It disables the component and shows it with the proper theme. */
|
234
|
+
disabled: _propTypes["default"].bool,
|
235
|
+
|
214
236
|
/** The testId property adds the data attribute data-testid to the main element and should be used for testing only. */
|
215
237
|
testId: _propTypes["default"].string
|
216
238
|
};
|
@@ -22,6 +22,9 @@ Object {
|
|
22
22
|
"opacity": 0,
|
23
23
|
"transition": "grid-template-rows cubic-bezier(0.25,0.46,0.45,0.94) 0.2s 0.05s, opacity cubic-bezier(0.25,0.46,0.45,0.94) 0.2s",
|
24
24
|
},
|
25
|
+
"disabled": Object {
|
26
|
+
"cursor": "not-allowed",
|
27
|
+
},
|
25
28
|
"divider": Object {
|
26
29
|
"boxShadow": "inset 0 -1px 0px 0px #EDEDF1",
|
27
30
|
},
|
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),
|
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.45",
|
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",
|