dibk-design 0.4.22 → 0.4.26

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.
Files changed (33) hide show
  1. package/dist/components/Accordion.js +39 -77
  2. package/dist/components/Button.js +31 -75
  3. package/dist/components/Button.module.scss +25 -2
  4. package/dist/components/CheckBoxIcon.js +24 -64
  5. package/dist/components/CheckBoxIcon.md +6 -0
  6. package/dist/components/CheckBoxInput.js +26 -59
  7. package/dist/components/CheckBoxInput.md +6 -0
  8. package/dist/components/CheckBoxListItem.js +18 -51
  9. package/dist/components/CheckBoxListItem.md +9 -0
  10. package/dist/components/ContentBox.js +30 -67
  11. package/dist/components/Dialog.js +57 -98
  12. package/dist/components/DragAndDropFileInput.js +91 -132
  13. package/dist/components/DragAndDropFileInput.md +5 -1
  14. package/dist/components/Footer.js +8 -44
  15. package/dist/components/Header.js +11 -47
  16. package/dist/components/InputField.js +92 -141
  17. package/dist/components/Label.js +11 -53
  18. package/dist/components/List.js +21 -72
  19. package/dist/components/LoadingAnimation.js +6 -42
  20. package/dist/components/NavigationBar.js +126 -179
  21. package/dist/components/NavigationBarListItem.js +22 -59
  22. package/dist/components/Paper.js +6 -42
  23. package/dist/components/RadioButtonIcon.js +18 -60
  24. package/dist/components/RadioButtonInput.js +17 -53
  25. package/dist/components/RadioButtonListItem.js +13 -49
  26. package/dist/components/Select.js +100 -142
  27. package/dist/components/Textarea.js +52 -91
  28. package/dist/components/Theme.js +55 -98
  29. package/dist/components/WizardNavigation/Step.js +35 -72
  30. package/dist/components/WizardNavigation.js +25 -59
  31. package/dist/functions/theme.js +10 -10
  32. package/dist/index.js +24 -24
  33. package/package.json +1 -1
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -17,156 +15,116 @@ var _DragAndDropFileInputModule = _interopRequireDefault(require("./DragAndDropF
17
15
 
18
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
17
 
20
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
-
22
- 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); } }
23
-
24
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
18
+ class DragAndDropFileInput extends _react.default.Component {
19
+ constructor(props) {
20
+ super(props);
21
+ this.state = {
22
+ highlight: false
23
+ };
24
+ this.setWrapperRef = this.setWrapperRef.bind(this);
25
+ this.setFileInputElementRef = this.setFileInputElementRef.bind(this);
26
+ this.highlight = this.highlight.bind(this);
27
+ this.unhighlight = this.unhighlight.bind(this);
28
+ this.handleDrop = this.handleDrop.bind(this);
29
+ }
25
30
 
26
- 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); }
31
+ componentDidMount() {
32
+ const containerElement = this.containerElement;
27
33
 
28
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
34
+ if (containerElement) {
35
+ // Prevent defaults
36
+ containerElement.addEventListener('dragenter', this.preventDefaults, false);
37
+ containerElement.addEventListener('dragover', this.preventDefaults, false);
38
+ containerElement.addEventListener('dragleave', this.preventDefaults, false);
39
+ containerElement.addEventListener('drop', this.preventDefaults, false); // Highlight
29
40
 
30
- 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); }; }
41
+ containerElement.addEventListener('dragenter', this.highlight, false);
42
+ containerElement.addEventListener('dragover', this.highlight, false); // Unhighlight
31
43
 
32
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
44
+ containerElement.addEventListener('dragleave', this.unhighlight, false);
45
+ containerElement.addEventListener('drop', this.unhighlight, false); // Hande drop
33
46
 
34
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
47
+ containerElement.addEventListener('drop', this.handleDrop, false);
48
+ }
49
+ }
35
50
 
36
- 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; } }
51
+ setWrapperRef(node) {
52
+ this.containerElement = node;
53
+ }
37
54
 
38
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
55
+ setFileInputElementRef(node) {
56
+ this.fileInputElement = node;
57
+ }
39
58
 
40
- var DragAndDropFileInput = /*#__PURE__*/function (_React$Component) {
41
- _inherits(DragAndDropFileInput, _React$Component);
59
+ preventDefaults(e) {
60
+ e.preventDefault();
61
+ e.stopPropagation();
62
+ }
42
63
 
43
- var _super = _createSuper(DragAndDropFileInput);
64
+ highlight(e) {
65
+ this.setState({
66
+ highlight: true
67
+ });
68
+ }
44
69
 
45
- function DragAndDropFileInput(props) {
46
- var _this;
70
+ unhighlight(e) {
71
+ this.setState({
72
+ highlight: false
73
+ });
74
+ }
47
75
 
48
- _classCallCheck(this, DragAndDropFileInput);
76
+ handleDrop(e) {
77
+ const files = e.dataTransfer.files;
78
+ this.handleFiles(files);
79
+ }
49
80
 
50
- _this = _super.call(this, props);
51
- _this.state = {
52
- highlight: false
53
- };
54
- _this.setWrapperRef = _this.setWrapperRef.bind(_assertThisInitialized(_this));
55
- _this.setFileInputElementRef = _this.setFileInputElementRef.bind(_assertThisInitialized(_this));
56
- _this.highlight = _this.highlight.bind(_assertThisInitialized(_this));
57
- _this.unhighlight = _this.unhighlight.bind(_assertThisInitialized(_this));
58
- _this.handleDrop = _this.handleDrop.bind(_assertThisInitialized(_this));
59
- return _this;
81
+ handleFiles(files) {
82
+ this.props.onDragAndDropChange(files);
60
83
  }
61
84
 
62
- _createClass(DragAndDropFileInput, [{
63
- key: "componentDidMount",
64
- value: function componentDidMount() {
65
- var containerElement = this.containerElement;
85
+ renderValueAsText(value, defaultContent) {
86
+ return value ? value : defaultContent;
87
+ }
66
88
 
67
- if (containerElement) {
68
- // Prevent defaults
69
- containerElement.addEventListener('dragenter', this.preventDefaults, false);
70
- containerElement.addEventListener('dragover', this.preventDefaults, false);
71
- containerElement.addEventListener('dragleave', this.preventDefaults, false);
72
- containerElement.addEventListener('drop', this.preventDefaults, false); // Highlight
89
+ handleAddButtonOnClick() {
90
+ this.fileInputElement.click();
91
+ }
73
92
 
74
- containerElement.addEventListener('dragenter', this.highlight, false);
75
- containerElement.addEventListener('dragover', this.highlight, false); // Unhighlight
93
+ handeFileInputElementOnChange(files) {
94
+ this.props.onSelectChange(files);
95
+ }
76
96
 
77
- containerElement.addEventListener('dragleave', this.unhighlight, false);
78
- containerElement.addEventListener('drop', this.unhighlight, false); // Hande drop
97
+ render() {
98
+ let buttonContent;
79
99
 
80
- containerElement.addEventListener('drop', this.handleDrop, false);
81
- }
82
- }
83
- }, {
84
- key: "setWrapperRef",
85
- value: function setWrapperRef(node) {
86
- this.containerElement = node;
87
- }
88
- }, {
89
- key: "setFileInputElementRef",
90
- value: function setFileInputElementRef(node) {
91
- this.fileInputElement = node;
92
- }
93
- }, {
94
- key: "preventDefaults",
95
- value: function preventDefaults(e) {
96
- e.preventDefault();
97
- e.stopPropagation();
98
- }
99
- }, {
100
- key: "highlight",
101
- value: function highlight(e) {
102
- this.setState({
103
- highlight: true
104
- });
105
- }
106
- }, {
107
- key: "unhighlight",
108
- value: function unhighlight(e) {
109
- this.setState({
110
- highlight: false
111
- });
100
+ if (this.props.selectedFileName) {
101
+ buttonContent = this.props.buttonContentWhenSelectedFile ? this.props.buttonContentWhenSelectedFile : this.props.buttonContent;
102
+ } else {
103
+ buttonContent = this.props.buttonContent;
112
104
  }
113
- }, {
114
- key: "handleDrop",
115
- value: function handleDrop(e) {
116
- var files = e.dataTransfer.files;
117
- this.handleFiles(files);
118
- }
119
- }, {
120
- key: "handleFiles",
121
- value: function handleFiles(files) {
122
- this.props.onDragAndDropChange(files);
123
- }
124
- }, {
125
- key: "renderValueAsText",
126
- value: function renderValueAsText(value, defaultContent) {
127
- return value ? value : defaultContent;
128
- }
129
- }, {
130
- key: "handleAddButtonOnClick",
131
- value: function handleAddButtonOnClick() {
132
- this.fileInputElement.click();
133
- }
134
- }, {
135
- key: "handeFileInputElementOnChange",
136
- value: function handeFileInputElementOnChange(files) {
137
- this.props.onSelectChange(files);
138
- }
139
- }, {
140
- key: "render",
141
- value: function render() {
142
- var _this2 = this;
143
-
144
- return /*#__PURE__*/_react.default.createElement("div", {
145
- className: _DragAndDropFileInputModule.default.dragAndDropFileInput
146
- }, /*#__PURE__*/_react.default.createElement("label", {
147
- htmlFor: this.props.id
148
- }, this.props.label, !this.props.contentOnly ? /*#__PURE__*/_react.default.createElement("div", {
149
- ref: this.setWrapperRef,
150
- className: "".concat(_DragAndDropFileInputModule.default.dragAndDropContainer, " ").concat(this.state.highlight ? _DragAndDropFileInputModule.default.highlighted : '')
151
- }, this.props.selectedFileName ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("b", null, "Valgt fil:"), " ", this.props.selectedFileName)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, "Slipp fil her"), /*#__PURE__*/_react.default.createElement("input", {
152
- ref: this.setFileInputElementRef,
153
- type: "file",
154
- onChange: this.props.onSelectChange
155
- }), this.props.buttonContent ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, "eller klikk p\xE5 knappen for \xE5 velge fil"), /*#__PURE__*/_react.default.createElement(_Button.default, {
156
- size: "small",
157
- color: this.props.buttonColor,
158
- onClick: function onClick() {
159
- return _this2.handleAddButtonOnClick();
160
- },
161
- content: this.props.buttonContent
162
- })) : '')) : ''), this.props.contentOnly ? /*#__PURE__*/_react.default.createElement("span", null, this.renderValueAsText(this.props.selectedFileName, this.props.defaultContent)) : '', /*#__PURE__*/_react.default.createElement("span", {
163
- className: _DragAndDropFileInputModule.default.errorMessage
164
- }, this.props.errorMessage ? this.props.errorMessage : ''));
165
- }
166
- }]);
167
105
 
168
- return DragAndDropFileInput;
169
- }(_react.default.Component);
106
+ return /*#__PURE__*/_react.default.createElement("div", {
107
+ className: _DragAndDropFileInputModule.default.dragAndDropFileInput
108
+ }, /*#__PURE__*/_react.default.createElement("label", {
109
+ htmlFor: this.props.id
110
+ }, this.props.label, !this.props.contentOnly ? /*#__PURE__*/_react.default.createElement("div", {
111
+ ref: this.setWrapperRef,
112
+ className: "".concat(_DragAndDropFileInputModule.default.dragAndDropContainer, " ").concat(this.state.highlight ? _DragAndDropFileInputModule.default.highlighted : '')
113
+ }, this.props.selectedFileName ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("b", null, "Valgt fil:"), " ", this.props.selectedFileName)) : /*#__PURE__*/_react.default.createElement("div", null, "Slipp fil her"), /*#__PURE__*/_react.default.createElement("input", {
114
+ ref: this.setFileInputElementRef,
115
+ type: "file",
116
+ onChange: this.props.onSelectChange
117
+ }), this.props.buttonContent ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, this.props.selectedFileName ? '' : 'eller klikk på knappen for å velge fil'), /*#__PURE__*/_react.default.createElement(_Button.default, {
118
+ size: "small",
119
+ color: this.props.buttonColor,
120
+ onClick: () => this.handleAddButtonOnClick(),
121
+ content: buttonContent
122
+ })) : '') : ''), this.props.contentOnly ? /*#__PURE__*/_react.default.createElement("span", null, this.renderValueAsText(this.props.selectedFileName, this.props.defaultContent)) : '', /*#__PURE__*/_react.default.createElement("span", {
123
+ className: _DragAndDropFileInputModule.default.errorMessage
124
+ }, this.props.errorMessage ? this.props.errorMessage : ''));
125
+ }
126
+
127
+ }
170
128
 
171
129
  DragAndDropFileInput.propTypes = {
172
130
  /** Text content inside list item */
@@ -177,6 +135,7 @@ DragAndDropFileInput.propTypes = {
177
135
  contentOnly: _propTypes.default.bool,
178
136
  buttonColor: _propTypes.default.string,
179
137
  buttonContent: _propTypes.default.string,
138
+ buttonContentWhenSelectedFile: _propTypes.default.string,
180
139
  selectedFileName: _propTypes.default.string,
181
140
  defaultContent: _propTypes.default.string,
182
141
  hasErrors: _propTypes.default.bool,
@@ -2,6 +2,10 @@ Drag and drop file input examples:
2
2
 
3
3
  ```js
4
4
  <DragAndDropFileInput id="dragAndDropInput-1" label="Input without selected file" buttonContent="Velg fil" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} />
5
+
5
6
  <DragAndDropFileInput id="dragAndDropInput-2" label="Input with selected file" buttonContent="Velg fil" selectedFileName="important-file.xml" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} />
6
- <DragAndDropFileInput id="dragAndDropInput-3" label="Input with selected file and contentOnly" buttonContent="Velg fil" selectedFileName="important-file2.xml" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} contentOnly={true} />
7
+
8
+ <DragAndDropFileInput id="dragAndDropInput-3" label="Input with selected file and buttonContentWhenSelectedFile" buttonContent="Velg fil" buttonContentWhenSelectedFile="Velg annen fil" selectedFileName="important-file.xml" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} />
9
+
10
+ <DragAndDropFileInput id="dragAndDropInput-4" label="Input with selected file and contentOnly" buttonContent="Velg fil" selectedFileName="important-file2.xml" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} contentOnly={true} />
7
11
  ```
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -13,50 +11,16 @@ var _FooterModule = _interopRequireDefault(require("./Footer.module.scss"));
13
11
 
14
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
13
 
16
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17
-
18
- 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); } }
19
-
20
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
21
-
22
- 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); }
23
-
24
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25
-
26
- 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); }; }
27
-
28
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
29
-
30
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
31
-
32
- 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; } }
33
-
34
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
35
-
36
- var Footer = /*#__PURE__*/function (_React$Component) {
37
- _inherits(Footer, _React$Component);
38
-
39
- var _super = _createSuper(Footer);
40
-
41
- function Footer() {
42
- _classCallCheck(this, Footer);
43
-
44
- return _super.apply(this, arguments);
14
+ class Footer extends _react.default.Component {
15
+ render() {
16
+ return /*#__PURE__*/_react.default.createElement("footer", {
17
+ className: _FooterModule.default.footer
18
+ }, /*#__PURE__*/_react.default.createElement("div", {
19
+ className: _FooterModule.default.footerContainer
20
+ }, this.props.children));
45
21
  }
46
22
 
47
- _createClass(Footer, [{
48
- key: "render",
49
- value: function render() {
50
- return /*#__PURE__*/_react.default.createElement("footer", {
51
- className: _FooterModule.default.footer
52
- }, /*#__PURE__*/_react.default.createElement("div", {
53
- className: _FooterModule.default.footerContainer
54
- }, this.props.children));
55
- }
56
- }]);
57
-
58
- return Footer;
59
- }(_react.default.Component);
23
+ }
60
24
 
61
25
  var _default = Footer;
62
26
  exports.default = _default;
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -15,55 +13,21 @@ var _HeaderModule = _interopRequireDefault(require("./Header.module.scss"));
15
13
 
16
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
15
 
18
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19
-
20
- 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); } }
21
-
22
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
23
-
24
- 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); }
25
-
26
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
27
-
28
- 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); }; }
29
-
30
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
31
-
32
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
16
+ class Header extends _react.default.Component {
17
+ render() {
18
+ const bigClass = this.props.big ? _HeaderModule.default.bigHeader : '';
19
+ const themeClass = this.props.theme ? _HeaderModule.default.hasTheme : '';
33
20
 
34
- 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; } }
21
+ let headerElement = /*#__PURE__*/_react.default.createElement('h' + this.props.size, {
22
+ className: "".concat(_HeaderModule.default.header, " ").concat(bigClass, " ").concat(themeClass)
23
+ }, this.props.content);
35
24
 
36
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
37
-
38
- var Header = /*#__PURE__*/function (_React$Component) {
39
- _inherits(Header, _React$Component);
40
-
41
- var _super = _createSuper(Header);
42
-
43
- function Header() {
44
- _classCallCheck(this, Header);
45
-
46
- return _super.apply(this, arguments);
25
+ return /*#__PURE__*/_react.default.createElement("div", {
26
+ className: _HeaderModule.default.headerContainer
27
+ }, " ", headerElement, " ");
47
28
  }
48
29
 
49
- _createClass(Header, [{
50
- key: "render",
51
- value: function render() {
52
- var bigClass = this.props.big ? _HeaderModule.default.bigHeader : '';
53
- var themeClass = this.props.theme ? _HeaderModule.default.hasTheme : '';
54
-
55
- var headerElement = /*#__PURE__*/_react.default.createElement('h' + this.props.size, {
56
- className: "".concat(_HeaderModule.default.header, " ").concat(bigClass, " ").concat(themeClass)
57
- }, this.props.content);
58
-
59
- return /*#__PURE__*/_react.default.createElement("div", {
60
- className: _HeaderModule.default.headerContainer
61
- }, " ", headerElement, " ");
62
- }
63
- }]);
64
-
65
- return Header;
66
- }(_react.default.Component);
30
+ }
67
31
 
68
32
  Header.propTypes = {
69
33
  /** Text content inside button */