@occmundial/occ-atomic 3.0.0-beta.44 → 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 +12 -0
- package/build/Fab/__snapshots__/Fab.test.js.snap +3 -3
- package/build/Placeholder/Placeholder.test.js +4 -4
- 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/Toaster/__snapshots__/Toaster.test.js.snap +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
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
|
+
|
1
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)
|
2
14
|
|
3
15
|
|
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
exports[`FAB matches the snapshot 1`] = `
|
4
4
|
<button
|
5
|
-
className="Button-btn-0-1-1 Button-tertiary-0-1-6 fab Button-iconOnly-0-1-18 Button-round-0-1-20"
|
5
|
+
className="Button-btn-0-1-22 Button-btn-0-1-1 Button-tertiary-0-1-27 Button-tertiary-0-1-6 fab Button-iconOnly-0-1-38 Button-iconOnly-0-1-18 Button-round-0-1-40 Button-round-0-1-20"
|
6
6
|
disabled={false}
|
7
7
|
>
|
8
8
|
<span
|
9
|
-
className="Button-cont-0-1-2"
|
9
|
+
className="Button-cont-0-1-23 Button-cont-0-1-2"
|
10
10
|
>
|
11
11
|
<span
|
12
|
-
className="Icon-oldIcon-0-1-
|
12
|
+
className="Icon-oldIcon-0-1-45 Icon-oldIcon-0-1-43 Button-icon-0-1-36 Button-icon-0-1-16"
|
13
13
|
/>
|
14
14
|
|
15
15
|
</span>
|
@@ -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 () {
|
@@ -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
|
},
|
@@ -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-60 Icon-icon-0-1-57 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.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",
|