carbon-react 98.0.1 → 99.0.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.
@@ -23,88 +23,30 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
23
23
 
24
24
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25
25
 
26
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
-
28
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
29
-
30
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
31
-
32
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
33
-
34
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
35
-
36
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
37
-
38
- function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
39
-
40
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
41
-
42
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
43
-
44
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
45
-
46
- 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; }
47
-
48
26
  const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default);
49
27
 
50
- let Detail = /*#__PURE__*/function (_React$Component) {
51
- _inherits(Detail, _React$Component);
52
-
53
- var _super = _createSuper(Detail);
54
-
55
- function Detail(...args) {
56
- var _this;
57
-
58
- _classCallCheck(this, Detail);
59
-
60
- _this = _super.call(this, ...args);
61
-
62
- _defineProperty(_assertThisInitialized(_this), "icon", () => {
63
- if (!_this.props.icon) {
64
- return null;
65
- }
66
-
67
- return /*#__PURE__*/_react.default.createElement(_detail.StyledDetailIcon, {
68
- type: _this.props.icon,
69
- "data-element": "icon"
70
- });
71
- });
72
-
73
- _defineProperty(_assertThisInitialized(_this), "footnote", () => {
74
- if (!_this.props.footnote) {
75
- return null;
76
- }
77
-
78
- return /*#__PURE__*/_react.default.createElement(_detail.StyledDetailFootnote, {
79
- "data-element": "footnote",
80
- hasIcon: _this.props.icon
81
- }, _this.props.footnote);
82
- });
83
-
84
- return _this;
85
- }
86
-
87
- _createClass(Detail, [{
88
- key: "render",
89
- value:
90
- /**
91
- * @method render
92
- * @return {Object} JSX
93
- */
94
- function render() {
95
- const marginProps = (0, _utils.filterStyledSystemMarginProps)(this.props);
96
- return /*#__PURE__*/_react.default.createElement(_detail.StyledDetail, _extends({
97
- className: (0, _classnames.default)("carbon-detail", this.props.className),
98
- hasIcon: this.props.icon
99
- }, (0, _tags.default)("detail", this.props), marginProps), this.icon(), /*#__PURE__*/_react.default.createElement(_detail.StyledDetailContent, {
100
- "data-element": "detail-content",
101
- hasIcon: this.props.icon
102
- }, this.props.children), this.footnote());
103
- }
104
- }]);
105
-
106
- return Detail;
107
- }(_react.default.Component);
28
+ const Detail = ({
29
+ className,
30
+ icon,
31
+ footnote,
32
+ children,
33
+ ...rest
34
+ }) => {
35
+ const marginProps = (0, _utils.filterStyledSystemMarginProps)(rest);
36
+ return /*#__PURE__*/_react.default.createElement(_detail.StyledDetail, _extends({
37
+ className: (0, _classnames.default)("carbon-detail", className),
38
+ hasIcon: icon
39
+ }, (0, _tags.default)("detail", rest), marginProps), icon && /*#__PURE__*/_react.default.createElement(_detail.StyledDetailIcon, {
40
+ type: icon,
41
+ "data-element": "icon"
42
+ }), /*#__PURE__*/_react.default.createElement(_detail.StyledDetailContent, {
43
+ "data-element": "detail-content",
44
+ hasIcon: icon
45
+ }, children), footnote && /*#__PURE__*/_react.default.createElement(_detail.StyledDetailFootnote, {
46
+ "data-element": "footnote",
47
+ hasIcon: icon
48
+ }, footnote));
49
+ };
108
50
 
109
51
  Detail.propTypes = { ...marginPropTypes,
110
52
 
@@ -114,7 +56,7 @@ Detail.propTypes = { ...marginPropTypes,
114
56
  className: _propTypes.default.string,
115
57
 
116
58
  /**
117
- * <a href="https://brand.sage.com/d/NdbrveWvNheA/foundations#/icons/icons" target="_blank">List of supported icons</a>
59
+ * <a href="https://carbon.sage.com/?path=/docs/icon--list-of-icons#list-of-icons" target="_blank">List of supported icons</a>
118
60
  *
119
61
  * The type of icon to use.
120
62
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "98.0.1",
3
+ "version": "99.0.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {