@occmundial/occ-atomic 1.22.0 → 1.22.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [1.22.2](https://github.com/occmundial/occ-atomic/compare/v1.22.1...v1.22.2) (2022-11-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Moves testid to icon component ([09170b8](https://github.com/occmundial/occ-atomic/commit/09170b83c864a054da1e385077e3945b96573ef8))
7
+
8
+ ## [1.22.1](https://github.com/occmundial/occ-atomic/compare/v1.22.0...v1.22.1) (2022-11-10)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Add testid in render props ([d55d31e](https://github.com/occmundial/occ-atomic/commit/d55d31e737799916afe9705239fb48b9a840654b))
14
+ * Indentation navicon ([0d98ca6](https://github.com/occmundial/occ-atomic/commit/0d98ca68b4ca7c67155a04acaf8f80f8318954a2))
15
+
1
16
  # [1.22.0](https://github.com/occmundial/occ-atomic/compare/v1.21.3...v1.22.0) (2022-11-09)
2
17
 
3
18
 
@@ -55,7 +55,8 @@ var Icon = /*#__PURE__*/function (_React$Component) {
55
55
  id = _this$props.id,
56
56
  ariaLabel = _this$props.ariaLabel,
57
57
  onClick = _this$props.onClick,
58
- alt = _this$props.alt;
58
+ alt = _this$props.alt,
59
+ testId = _this$props.testId;
59
60
  var IconType = onClick ? 'button' : 'span';
60
61
  return /*#__PURE__*/_react["default"].createElement(IconType, {
61
62
  id: id,
@@ -63,7 +64,8 @@ var Icon = /*#__PURE__*/function (_React$Component) {
63
64
  "aria-label": ariaLabel,
64
65
  style: style,
65
66
  onClick: onClick,
66
- alt: alt
67
+ alt: alt,
68
+ "data-testid": testId
67
69
  });
68
70
  }
69
71
  }]);
@@ -106,7 +108,10 @@ Icon.propTypes = {
106
108
  id: _propTypes["default"].string,
107
109
  ariaLabel: _propTypes["default"].string,
108
110
  className: _propTypes["default"].string,
109
- style: _propTypes["default"].object
111
+ style: _propTypes["default"].object,
112
+
113
+ /** The testId property adds the data attribute data-testid to the main element and should be used for testing only. */
114
+ testId: _propTypes["default"].string
110
115
  };
111
116
  var _default = Icon;
112
117
  exports["default"] = _default;
@@ -123,17 +123,17 @@ var Modal = /*#__PURE__*/function (_React$Component) {
123
123
  fullSize = _this$props.fullSize,
124
124
  testId = _this$props.testId;
125
125
 
126
- var closeButton = /*#__PURE__*/_react["default"].createElement("div", _extends({
126
+ var closeButton = /*#__PURE__*/_react["default"].createElement("div", {
127
127
  className: classes.closeIcon
128
- }, testId && {
129
- 'data-testid': "".concat(testId, "__container-close-icon")
130
- }), /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
128
+ }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], _extends({
131
129
  iconName: "close",
132
130
  width: 24,
133
131
  height: 24,
134
132
  colors: [_colors["default"].grey900],
135
133
  onClick: onClose
136
- }));
134
+ }, testId && {
135
+ testId: "".concat(testId, "__close-icon")
136
+ })));
137
137
 
138
138
  return /*#__PURE__*/_react["default"].createElement("div", {
139
139
  className: "".concat(classes.overlay, " ").concat(show ? classes.overlayShow : classes.overlayHide).concat(!onClose ? " ".concat(classes.noClose) : ''),
@@ -188,7 +188,7 @@ var Modal = /*#__PURE__*/function (_React$Component) {
188
188
  disabled: secBtn.disabled,
189
189
  id: secBtn.id
190
190
  }, testId && {
191
- 'data-testid': "".concat(testId, "__button_secondary")
191
+ testId: "".concat(testId, "__button_secondary")
192
192
  }), secBtn.text), /*#__PURE__*/_react["default"].createElement(_Button["default"], _extends({
193
193
  className: classes.mainBtn,
194
194
  onClick: mainBtn.onClick,
@@ -198,7 +198,7 @@ var Modal = /*#__PURE__*/function (_React$Component) {
198
198
  disabled: mainBtn.disabled,
199
199
  id: mainBtn.id
200
200
  }, testId && {
201
- 'data-testid': "".concat(testId, "__button_main")
201
+ testId: "".concat(testId, "__button_main")
202
202
  }), mainBtn.text))))))));
203
203
  }
204
204
  }]);
@@ -57,7 +57,8 @@ var NavIcon = /*#__PURE__*/function (_React$Component) {
57
57
  label = _this$props.label,
58
58
  onClick = _this$props.onClick,
59
59
  direction = _this$props.direction,
60
- className = _this$props.className;
60
+ className = _this$props.className,
61
+ testId = _this$props.testId;
61
62
  return /*#__PURE__*/_react["default"].createElement("div", {
62
63
  className: "".concat(classes.cont).concat(selected ? " ".concat(classes.selected) : '').concat(className ? " ".concat(className) : ''),
63
64
  onClick: onClick,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@occmundial/occ-atomic",
3
- "version": "1.22.0",
3
+ "version": "1.22.2",
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",