@occmundial/occ-atomic 1.25.0 → 1.27.0

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.27.0](https://github.com/occmundial/occ-atomic/compare/v1.26.0...v1.27.0) (2023-02-16)
2
+
3
+
4
+ ### Features
5
+
6
+ * Add missing ids ([2f20288](https://github.com/occmundial/occ-atomic/commit/2f20288510da0018027f2d332e05cb85588bd313))
7
+ * pill data-testid has been added ([bbd3bc2](https://github.com/occmundial/occ-atomic/commit/bbd3bc212c0fa83a373959a3f306e30b395c45e1))
8
+
9
+ # [1.26.0](https://github.com/occmundial/occ-atomic/compare/v1.25.0...v1.26.0) (2023-02-10)
10
+
11
+
12
+ ### Features
13
+
14
+ * Add testId to text component ([029f501](https://github.com/occmundial/occ-atomic/commit/029f50148ffce324dc696707c73219ce8d16ebd7))
15
+
1
16
  # [1.25.0](https://github.com/occmundial/occ-atomic/compare/v1.24.0...v1.25.0) (2023-02-09)
2
17
 
3
18
 
@@ -73,6 +73,7 @@ var Choice = /*#__PURE__*/function (_React$Component) {
73
73
  selected = _this$props2.selected,
74
74
  disabled = _this$props2.disabled,
75
75
  idPrefix = _this$props2.idPrefix,
76
+ testId = _this$props2.testId,
76
77
  leftIcon = _this$props2.leftIcon,
77
78
  rightIcon = _this$props2.rightIcon,
78
79
  id = _this$props2.id;
@@ -80,7 +81,8 @@ var Choice = /*#__PURE__*/function (_React$Component) {
80
81
  return /*#__PURE__*/_react["default"].createElement("button", {
81
82
  className: "".concat(classes.pill).concat(selected ? " ".concat(classes.selected) : disabled ? " ".concat(classes.disabled) : ''),
82
83
  onClick: this.handleOnClick,
83
- id: idPrefix ? "".concat(idPrefix).concat(id) : null
84
+ id: idPrefix ? "".concat(idPrefix).concat(id) : null,
85
+ "data-testid": testId ? "".concat(testId).concat(id) : null
84
86
  }, leftIcon && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
85
87
  iconName: leftIcon,
86
88
  colors: [iconColor],
@@ -112,7 +114,8 @@ Choice.propTypes = {
112
114
  disabled: _propTypes["default"].bool,
113
115
  leftIcon: _propTypes["default"].string,
114
116
  rightIcon: _propTypes["default"].string,
115
- idPrefix: _propTypes["default"].string
117
+ idPrefix: _propTypes["default"].string,
118
+ testId: _propTypes["default"].string
116
119
  };
117
120
  var _default = Choice;
118
121
  exports["default"] = _default;
@@ -16,13 +16,15 @@ var Group = function Group(_ref) {
16
16
  items = _ref.items,
17
17
  selected = _ref.selected,
18
18
  onSelect = _ref.onSelect,
19
- idPrefix = _ref.idPrefix;
19
+ idPrefix = _ref.idPrefix,
20
+ testId = _ref.testId;
20
21
  return /*#__PURE__*/_react["default"].createElement("div", {
21
22
  className: classes.pillGroup
22
23
  }, items.map(function (item, index) {
23
24
  return /*#__PURE__*/_react["default"].createElement("button", {
24
25
  key: item.id,
25
26
  id: idPrefix ? "".concat(idPrefix).concat(item.id) : null,
27
+ "data-testid": testId ? "".concat(testId).concat(item.id) : null,
26
28
  className: "".concat(classes.pill).concat(selected == item.id ? " ".concat(classes.selected) : item.disabled ? " ".concat(classes.disabled) : ''),
27
29
  onClick: selected != item.id ? function () {
28
30
  onSelect(item.id, index);
@@ -36,7 +38,8 @@ Group.propTypes = {
36
38
  items: _propTypes["default"].array,
37
39
  onSelect: _propTypes["default"].func,
38
40
  selected: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
39
- idPrefix: _propTypes["default"].string
41
+ idPrefix: _propTypes["default"].string,
42
+ testId: _propTypes["default"].string
40
43
  };
41
44
  var _default = Group;
42
45
  exports["default"] = _default;
@@ -134,6 +134,7 @@ var Pill = /*#__PURE__*/function (_Component) {
134
134
  disabled = _this$props.disabled,
135
135
  lockHeight = _this$props.lockHeight,
136
136
  idPrefix = _this$props.idPrefix,
137
+ testId = _this$props.testId,
137
138
  onClick = _this$props.onClick,
138
139
  onClose = _this$props.onClose,
139
140
  id = _this$props.id,
@@ -154,7 +155,8 @@ var Pill = /*#__PURE__*/function (_Component) {
154
155
  items: group,
155
156
  onSelect: this.handleGroupOnSelect,
156
157
  selected: selected,
157
- idPrefix: idPrefix
158
+ idPrefix: idPrefix,
159
+ testId: testId
158
160
  }) : stack ? /*#__PURE__*/_react["default"].createElement("div", {
159
161
  className: classes.stackGroup
160
162
  }, stack.map(function (pill) {
@@ -162,6 +164,7 @@ var Pill = /*#__PURE__*/function (_Component) {
162
164
  key: pill.id,
163
165
  idPrefix: idPrefix,
164
166
  id: pill.id,
167
+ testId: testId,
165
168
  disabled: pill.disabled,
166
169
  onClick: onClick ? _this2.handleStackItemOnClick : null,
167
170
  onClose: onClose ? _this2.handleStackItemOnClose : null
@@ -173,6 +176,7 @@ var Pill = /*#__PURE__*/function (_Component) {
173
176
  key: pill.id,
174
177
  idPrefix: idPrefix,
175
178
  id: pill.id,
179
+ testId: testId,
176
180
  disabled: pill.disabled,
177
181
  selected: pill.selected,
178
182
  onClick: _this2.handleChoiceOnSelect,
@@ -260,6 +264,9 @@ Pill.propTypes = {
260
264
 
261
265
  /** Prefix for the id of every pill. If you don't specify a prefix they will not have an id. */
262
266
  idPrefix: _propTypes["default"].string,
267
+
268
+ /** Data test id used for automated testing. */
269
+ testId: _propTypes["default"].string,
263
270
  id: _propTypes["default"].string,
264
271
  className: _propTypes["default"].string,
265
272
  style: _propTypes["default"].object
@@ -35,13 +35,15 @@ var Stack = function Stack(_ref) {
35
35
  disabled = _ref.disabled,
36
36
  _onClick = _ref.onClick,
37
37
  onClose = _ref.onClose,
38
- idPrefix = _ref.idPrefix;
38
+ idPrefix = _ref.idPrefix,
39
+ testId = _ref.testId;
39
40
  return /*#__PURE__*/_react["default"].createElement("button", {
40
41
  className: "".concat(classes.pill).concat(disabled ? " ".concat(classes.disabled) : ''),
41
42
  onClick: function onClick() {
42
43
  handleOnClick(id, _onClick);
43
44
  },
44
- id: idPrefix ? "".concat(idPrefix).concat(id) : null
45
+ id: idPrefix ? "".concat(idPrefix).concat(id) : null,
46
+ "data-testid": testId ? "".concat(testId).concat(id) : null
45
47
  }, children && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
46
48
  className: classes.text,
47
49
  tag: "span",
@@ -67,7 +69,8 @@ Stack.propTypes = {
67
69
  disabled: _propTypes["default"].bool,
68
70
  onClick: _propTypes["default"].func,
69
71
  onClose: _propTypes["default"].func,
70
- idPrefix: _propTypes["default"].string
72
+ idPrefix: _propTypes["default"].string,
73
+ testId: _propTypes["default"].string
71
74
  };
72
75
  var _default = Stack;
73
76
  exports["default"] = _default;
@@ -275,7 +275,8 @@ var Text = /*#__PURE__*/function (_Component) {
275
275
  tag = _this$props8.tag,
276
276
  className = _this$props8.className,
277
277
  style = _this$props8.style,
278
- id = _this$props8.id;
278
+ id = _this$props8.id,
279
+ testId = _this$props8.testId;
279
280
  var TextType = tag;
280
281
  var size = this.getSize();
281
282
  var color = this.getColor();
@@ -287,7 +288,8 @@ var Text = /*#__PURE__*/function (_Component) {
287
288
  return /*#__PURE__*/_react["default"].createElement(TextType, {
288
289
  className: "".concat(classes.text, " ").concat(size, " ").concat(color ? color : emphasis).concat(topSpacing).concat(bottomSpacing).concat(align ? " ".concat(align) : '').concat(strong ? " ".concat(strong) : '').concat(className ? " ".concat(className) : ''),
289
290
  style: style,
290
- id: id
291
+ id: id,
292
+ "data-testid": testId
291
293
  }, children);
292
294
  }
293
295
  }]);
@@ -417,7 +419,8 @@ Text.propTypes = {
417
419
  tag: _propTypes["default"].string.isRequired,
418
420
  className: _propTypes["default"].string,
419
421
  style: _propTypes["default"].object,
420
- id: _propTypes["default"].string
422
+ id: _propTypes["default"].string,
423
+ testId: _propTypes["default"].string
421
424
  };
422
425
  Text.defaultProps = {
423
426
  tag: 'p'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@occmundial/occ-atomic",
3
- "version": "1.25.0",
3
+ "version": "1.27.0",
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",