dibk-design 1.1.10 → 2.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.
Files changed (142) hide show
  1. package/dist/{fonts → assets/fonts}/Altis-Light.eot +0 -0
  2. package/dist/{fonts → assets/fonts}/Altis-Light.svg +0 -0
  3. package/dist/{fonts → assets/fonts}/Altis-Light.ttf +0 -0
  4. package/dist/{fonts → assets/fonts}/Altis-Light.woff +0 -0
  5. package/dist/{fonts → assets/fonts}/Altis.eot +0 -0
  6. package/dist/{fonts → assets/fonts}/Altis.svg +0 -0
  7. package/dist/{fonts → assets/fonts}/Altis.ttf +0 -0
  8. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-300.eot +0 -0
  9. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-300.svg +0 -0
  10. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-300.ttf +0 -0
  11. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-300.woff +0 -0
  12. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-300.woff2 +0 -0
  13. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-300italic.eot +0 -0
  14. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-300italic.svg +0 -0
  15. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-300italic.ttf +0 -0
  16. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-300italic.woff +0 -0
  17. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-300italic.woff2 +0 -0
  18. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-700.eot +0 -0
  19. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-700.svg +0 -0
  20. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-700.ttf +0 -0
  21. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-700.woff +0 -0
  22. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-700.woff2 +0 -0
  23. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-700italic.eot +0 -0
  24. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-700italic.svg +0 -0
  25. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-700italic.ttf +0 -0
  26. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-700italic.woff +0 -0
  27. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-700italic.woff2 +0 -0
  28. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-italic.eot +0 -0
  29. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-italic.svg +0 -0
  30. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-italic.ttf +0 -0
  31. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-italic.woff +0 -0
  32. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-italic.woff2 +0 -0
  33. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-regular.eot +0 -0
  34. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-regular.svg +0 -0
  35. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-regular.ttf +0 -0
  36. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-regular.woff +0 -0
  37. package/dist/{fonts → assets/fonts}/open-sans-v27-latin-ext_latin-regular.woff2 +0 -0
  38. package/dist/assets/png/dibk-logo.png +0 -0
  39. package/dist/{images → assets/svg}/dibk-logo-mobile.svg +0 -0
  40. package/dist/{images → assets/svg}/dibk-logo.svg +0 -0
  41. package/dist/{images → assets/svg}/spinner.svg +0 -0
  42. package/dist/components/Accordion.js +61 -92
  43. package/dist/components/Accordion.module.scss +40 -39
  44. package/dist/components/Button.js +44 -84
  45. package/dist/components/Button.module.scss +24 -18
  46. package/dist/components/CheckBoxIcon.js +20 -61
  47. package/dist/components/CheckBoxIcon.module.scss +52 -52
  48. package/dist/components/CheckBoxInput.js +25 -64
  49. package/dist/components/CheckBoxInput.module.scss +23 -23
  50. package/dist/components/CheckBoxList.js +2 -4
  51. package/dist/components/CheckBoxList.module.scss +2 -2
  52. package/dist/components/CheckBoxListItem.js +2 -6
  53. package/dist/components/CheckBoxListItem.module.scss +53 -53
  54. package/dist/components/Container.js +6 -49
  55. package/dist/components/Container.module.scss +1 -1
  56. package/dist/components/ContentBox.js +38 -77
  57. package/dist/components/ContentBox.module.scss +35 -35
  58. package/dist/components/Dialog.js +38 -106
  59. package/dist/components/Dialog.module.scss +14 -12
  60. package/dist/components/DragAndDropFileInput.js +86 -147
  61. package/dist/components/DragAndDropFileInput.module.scss +28 -28
  62. package/dist/components/ErrorBox.js +5 -11
  63. package/dist/components/ErrorBox.module.scss +1 -1
  64. package/dist/components/ErrorMessage.js +13 -54
  65. package/dist/components/ErrorMessage.module.scss +1 -1
  66. package/dist/components/Footer.js +5 -44
  67. package/dist/components/Footer.module.scss +1 -1
  68. package/dist/components/Header.js +3 -5
  69. package/dist/components/Header.module.scss +9 -9
  70. package/dist/components/InputField.js +69 -120
  71. package/dist/components/InputField.module.scss +69 -69
  72. package/dist/components/Label.js +9 -48
  73. package/dist/components/Label.module.scss +3 -3
  74. package/dist/components/List.js +1 -1
  75. package/dist/components/List.module.scss +17 -17
  76. package/dist/components/ListItem.js +1 -1
  77. package/dist/components/LoadingAnimation.js +6 -47
  78. package/dist/components/LoadingAnimation.module.scss +23 -23
  79. package/dist/components/NavigationBar.js +137 -190
  80. package/dist/components/NavigationBar.module.scss +165 -165
  81. package/dist/components/NavigationBarListItem.js +22 -60
  82. package/dist/components/Paper.js +5 -45
  83. package/dist/components/Paper.module.scss +14 -14
  84. package/dist/components/ProgressBar.js +16 -8
  85. package/dist/components/ProgressBar.module.scss +2 -2
  86. package/dist/components/RadioButtonIcon.js +15 -55
  87. package/dist/components/RadioButtonIcon.module.scss +36 -36
  88. package/dist/components/RadioButtonInput.js +24 -63
  89. package/dist/components/RadioButtonInput.module.scss +23 -25
  90. package/dist/components/RadioButtonList.js +2 -4
  91. package/dist/components/RadioButtonList.module.scss +2 -2
  92. package/dist/components/RadioButtonListItem.js +3 -6
  93. package/dist/components/RadioButtonListItem.module.scss +7 -7
  94. package/dist/components/Select.js +98 -140
  95. package/dist/components/Select.module.scss +76 -76
  96. package/dist/components/Table.js +1 -3
  97. package/dist/components/Table.module.scss +1 -1
  98. package/dist/components/Textarea.js +54 -96
  99. package/dist/components/Textarea.module.scss +2 -2
  100. package/dist/components/Theme.js +60 -106
  101. package/dist/components/Theme.module.scss +12 -12
  102. package/dist/components/WizardNavigation/Step.js +34 -80
  103. package/dist/components/WizardNavigation/Step.module.scss +12 -12
  104. package/dist/components/WizardNavigation.js +19 -63
  105. package/dist/components/WizardNavigation.module.scss +1 -1
  106. package/dist/functions/theme.js +24 -10
  107. package/dist/index.js +0 -2
  108. package/dist/style/base/_all.scss +1 -0
  109. package/dist/style/base/_fonts.scss +97 -0
  110. package/package.json +63 -28
  111. package/dist/components/Accordion.md +0 -15
  112. package/dist/components/Button.md +0 -78
  113. package/dist/components/CheckBoxIcon.md +0 -38
  114. package/dist/components/CheckBoxInput.md +0 -51
  115. package/dist/components/CheckBoxList.md +0 -54
  116. package/dist/components/CheckBoxListItem.md +0 -82
  117. package/dist/components/Container.md +0 -7
  118. package/dist/components/ContentBox.md +0 -46
  119. package/dist/components/Dialog.md +0 -6
  120. package/dist/components/DragAndDropFileInput.md +0 -13
  121. package/dist/components/ErrorBox.md +0 -27
  122. package/dist/components/ErrorMessage.md +0 -15
  123. package/dist/components/Footer.md +0 -7
  124. package/dist/components/Header.md +0 -12
  125. package/dist/components/InputField.md +0 -40
  126. package/dist/components/Label.md +0 -9
  127. package/dist/components/List.md +0 -71
  128. package/dist/components/LoadingAnimation.md +0 -5
  129. package/dist/components/NavigationBar.md +0 -42
  130. package/dist/components/NavigationBarListItem.md +0 -16
  131. package/dist/components/Paper.md +0 -9
  132. package/dist/components/ProgressBar.md +0 -13
  133. package/dist/components/RadioButtonIcon.md +0 -41
  134. package/dist/components/RadioButtonInput.md +0 -30
  135. package/dist/components/RadioButtonList.md +0 -57
  136. package/dist/components/RadioButtonListItem.md +0 -70
  137. package/dist/components/Select.md +0 -28
  138. package/dist/components/Table.md +0 -26
  139. package/dist/components/Textarea.md +0 -27
  140. package/dist/components/Theme.md +0 -12
  141. package/dist/components/WizardNavigation.md +0 -84
  142. package/dist/style/base/fonts.css +0 -95
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
Binary file
File without changes
File without changes
File without changes
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
 
10
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
@@ -15,106 +15,75 @@ var _AccordionModule = _interopRequireDefault(require("./Accordion.module.scss")
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
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); Object.defineProperty(Constructor, "prototype", { writable: false }); 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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
25
-
26
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : 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; }
33
-
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; } }
35
-
36
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
37
-
38
- var Accordion = /*#__PURE__*/function (_React$Component) {
39
- _inherits(Accordion, _React$Component);
40
-
41
- var _super = _createSuper(Accordion);
42
-
43
- function Accordion(props) {
44
- var _this;
45
-
46
- _classCallCheck(this, Accordion);
47
-
48
- _this = _super.call(this, props);
49
- _this.state = {
50
- expanded: _this.props.expanded,
51
- initialized: _this.props.expanded
52
- };
53
- _this.handleToggleExpand = _this.handleToggleExpand.bind(_assertThisInitialized(_this));
54
- return _this;
55
- }
56
-
57
- _createClass(Accordion, [{
58
- key: "handleToggleExpand",
59
- value: function handleToggleExpand() {
60
- this.setState({
61
- expanded: !this.state.expanded,
62
- initialized: true
63
- });
64
- }
65
- }, {
66
- key: "componentDidUpdate",
67
- value: function componentDidUpdate(prevProps) {
68
- if (this.props.expanded !== prevProps.expanded) {
69
- this.setState({
70
- expanded: this.props.expanded
71
- });
72
- }
73
- }
74
- }, {
75
- key: "renderPanel",
76
- value: function renderPanel() {
77
- return /*#__PURE__*/_react.default.createElement("button", {
78
- className: _AccordionModule.default.panel,
79
- onClick: this.handleToggleExpand,
80
- "aria-expanded": this.state.expanded ? 'true' : 'false'
81
- }, /*#__PURE__*/_react.default.createElement("span", {
82
- className: _AccordionModule.default.panelText
83
- }, this.props.title), /*#__PURE__*/_react.default.createElement("span", {
84
- className: "".concat(_AccordionModule.default.panelChevron, " ").concat(this.state.expanded ? _AccordionModule.default.expanded : '')
85
- }));
86
- }
87
- }, {
88
- key: "render",
89
- value: function render() {
90
- var className = "".concat(_AccordionModule.default.accordion, " ").concat(this.props.color ? _AccordionModule.default[this.props.color] : '');
91
- return /*#__PURE__*/_react.default.createElement("div", {
92
- className: className
93
- }, this.renderPanel(), /*#__PURE__*/_react.default.createElement("div", {
94
- className: "".concat(_AccordionModule.default.content, " ").concat(this.state.initialized ? _AccordionModule.default.initialized : '', " ").concat(this.state.expanded ? _AccordionModule.default.expanded : '')
95
- }, this.props.children));
96
- }
97
- }]);
98
-
99
- return Accordion;
100
- }(_react.default.Component);
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
23
+
24
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
25
+
26
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
27
+
28
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
29
+
30
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
31
+
32
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
33
+
34
+ var Accordion = function Accordion(props) {
35
+ var _useState = (0, _react.useState)(props.expanded),
36
+ _useState2 = _slicedToArray(_useState, 2),
37
+ expanded = _useState2[0],
38
+ setExpanded = _useState2[1];
39
+
40
+ var _useState3 = (0, _react.useState)(props.initialized),
41
+ _useState4 = _slicedToArray(_useState3, 2),
42
+ initialized = _useState4[0],
43
+ setInitialized = _useState4[1];
44
+
45
+ var handleToggleExpand = function handleToggleExpand() {
46
+ setExpanded(!expanded);
47
+ setInitialized(true);
48
+ };
49
+
50
+ (0, _react.useEffect)(function () {
51
+ setExpanded(props.expanded);
52
+ }, [props.expanded]);
53
+
54
+ var renderPanel = function renderPanel() {
55
+ return _react.default.createElement("button", {
56
+ className: _AccordionModule.default.panel,
57
+ onClick: handleToggleExpand,
58
+ "aria-expanded": expanded ? "true" : "false"
59
+ }, _react.default.createElement("span", {
60
+ className: _AccordionModule.default.panelText
61
+ }, props.title), _react.default.createElement("span", {
62
+ className: "".concat(_AccordionModule.default.panelChevron, " ").concat(expanded ? _AccordionModule.default.expanded : "")
63
+ }));
64
+ };
65
+
66
+ var className = "".concat(_AccordionModule.default.accordion, " ").concat(props.color ? _AccordionModule.default[props.color] : "");
67
+ return _react.default.createElement("div", {
68
+ className: className
69
+ }, renderPanel(), _react.default.createElement("div", {
70
+ className: "".concat(_AccordionModule.default.content, " ").concat(initialized ? _AccordionModule.default.initialized : "", " ").concat(expanded ? _AccordionModule.default.expanded : "")
71
+ }, props.children));
72
+ };
101
73
 
102
74
  Accordion.propTypes = {
103
- /** Content title inside box */
104
75
  title: _propTypes.default.string,
105
- titleSize: _propTypes.default.oneOf(['regular', 'large']),
106
-
107
- /** Text content inside box */
76
+ titleSize: _propTypes.default.oneOf(["regular", "large"]),
108
77
  content: _propTypes.default.string,
109
- color: _propTypes.default.oneOf(['default', 'primary', 'success', 'warning', 'info', 'lightCyan', 'orange', 'lightOrange', 'lime', 'lightLime']),
78
+ color: _propTypes.default.oneOf(["default", "primary", "success", "warning", "info", "lightCyan", "orange", "lightOrange", "lime", "lightLime"]),
110
79
  expanded: _propTypes.default.bool
111
80
  };
112
81
  Accordion.defaultProps = {
113
82
  title: null,
114
- titleSize: 'regular',
83
+ titleSize: "regular",
115
84
  href: null,
116
- content: '',
117
- color: 'default',
85
+ content: "",
86
+ color: "default",
118
87
  expanded: false
119
88
  };
120
89
  var _default = Accordion;
@@ -69,91 +69,92 @@
69
69
  }
70
70
  }
71
71
 
72
- :local(.accordion) {
72
+ .accordion {
73
73
  font-family: $default-font;
74
74
  text-decoration: none;
75
75
  width: 100%;
76
76
  display: block;
77
- &:local(.default) {
77
+ &.default {
78
78
  background-color: $color-default;
79
- :local(.panel) span,
80
- :local(.content) {
79
+ .panel span,
80
+ .content {
81
81
  color: #000;
82
82
  }
83
83
  }
84
- &:local(.primary) {
84
+ &.primary {
85
85
  background-color: $color-primary;
86
86
  color: #fff;
87
- :local(.panel) span,
88
- :local(.content) {
87
+ .panel span,
88
+ .content {
89
89
  color: #fff;
90
90
  }
91
91
  }
92
- &:local(.success) {
92
+ &.success {
93
93
  background-color: $color-success;
94
94
  color: #fff;
95
- :local(.panel) span,
96
- :local(.content) {
95
+ .panel span,
96
+ .content {
97
97
  color: #fff;
98
98
  }
99
99
  }
100
- &:local(.warning) {
100
+ &.warning {
101
101
  background-color: $color-warning;
102
102
  color: #fff;
103
- :local(.panel) span,
104
- :local(.content) {
103
+ .panel span,
104
+ .content {
105
105
  color: #fff;
106
106
  }
107
107
  }
108
108
 
109
- &:local(.info) {
109
+ &.info {
110
110
  background-color: $color-info;
111
- :local(.panel) span,
112
- :local(.content) {
111
+ .panel span,
112
+ .content {
113
113
  color: #000;
114
114
  }
115
115
  }
116
- &:local(.lightCyan) {
116
+ &.lightCyan {
117
117
  background-color: $color-light-cyan;
118
- :local(.panel) span,
119
- :local(.content) {
118
+ .panel span,
119
+ .content {
120
120
  color: #000;
121
121
  }
122
122
  }
123
- &:local(.orange) {
123
+ &.orange {
124
124
  background-color: $color-orange;
125
125
  color: #fff;
126
- :local(.panel) span,
127
- :local(.content) {
126
+ .panel span,
127
+ .content {
128
128
  color: #fff;
129
129
  }
130
130
  }
131
- &:local(.lightOrange) {
131
+ &.lightOrange {
132
132
  background-color: $color-light-orange;
133
- :local(.panel) span,
134
- :local(.content) {
133
+ .panel span,
134
+ .content {
135
135
  color: #000;
136
136
  }
137
137
  }
138
- &:local(.lime) {
138
+ &.lime {
139
139
  background-color: $color-lime;
140
140
  color: #fff;
141
- :local(.panel) span,
142
- :local(.content) {
141
+ .panel span,
142
+ .content {
143
143
  color: #fff;
144
144
  }
145
145
  }
146
- &:local(.lightLime) {
146
+ &.lightLime {
147
147
  background-color: $color-light-lime;
148
- :local(.panel) span,
149
- :local(.content) {
148
+ .panel span,
149
+ .content {
150
150
  color: #000;
151
151
  }
152
152
  }
153
153
 
154
- :local(.panel) {
154
+ .panel {
155
155
  @include appearance(none);
156
156
  @include border-radius(0);
157
+ font-family: $default-font;
157
158
  padding: 15px 15px;
158
159
  display: flex;
159
160
  align-items: center;
@@ -174,14 +175,14 @@
174
175
  outline-style: auto;
175
176
  outline-width: 2px;
176
177
  outline-offset: 0px;
177
- }
178
- :local(.panelText) {
178
+ }
179
+ .panelText {
179
180
  font-family: $heading-font;
180
181
  font-weight: bold;
181
182
  font-size: 18px;
182
183
  flex: 1;
183
184
  }
184
- :local(.panelChevron) {
185
+ .panelChevron {
185
186
  box-sizing: border-box;
186
187
  position: relative;
187
188
  display: block;
@@ -204,14 +205,14 @@
204
205
  transform: translateY(-30%) rotate(45deg);
205
206
  transition: transform 0.3s ease-in-out;
206
207
  }
207
- &:local(.expanded) {
208
+ &.expanded {
208
209
  &::after {
209
210
  transform: translateY(30%) rotate(225deg);
210
211
  }
211
212
  }
212
213
  }
213
214
  }
214
- :local(.content) {
215
+ .content {
215
216
  opacity: 0;
216
217
  margin-top: 0px;
217
218
  line-height: 0;
@@ -221,11 +222,11 @@
221
222
  @media only screen and (min-width: $screen-sm) {
222
223
  padding: 0 30px 0;
223
224
  }
224
- &:local(.initialized) {
225
+ &.initialized {
225
226
  animation: hide 0.3s ease-in-out;
226
227
  }
227
228
 
228
- &:local(.expanded) {
229
+ &.expanded {
229
230
  animation: show 0.3s ease-in-out;
230
231
  opacity: 1;
231
232
  margin-top: 0px;
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -25,102 +23,64 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
25
23
 
26
24
  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; }
27
25
 
28
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
29
-
30
- 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); } }
31
-
32
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
33
-
34
- 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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
35
-
36
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
37
-
38
- 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); }; }
39
-
40
- 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); }
41
-
42
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
43
-
44
- 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; } }
26
+ var Button = function Button(props) {
27
+ var _props$href;
45
28
 
46
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
29
+ var getArrowClass = function getArrowClass(arrow) {
30
+ switch (arrow) {
31
+ case "left":
32
+ return _ButtonModule.default.hasArrowLeft;
47
33
 
48
- var Button = /*#__PURE__*/function (_React$Component) {
49
- _inherits(Button, _React$Component);
34
+ case "right":
35
+ return _ButtonModule.default.hasArrowRight;
50
36
 
51
- var _super = _createSuper(Button);
52
-
53
- function Button() {
54
- _classCallCheck(this, Button);
55
-
56
- return _super.apply(this, arguments);
57
- }
58
-
59
- _createClass(Button, [{
60
- key: "getArrowClass",
61
- value: function getArrowClass() {
62
- switch (this.props.arrow) {
63
- case 'left':
64
- return _ButtonModule.default.hasArrowLeft;
65
-
66
- case 'right':
67
- return _ButtonModule.default.hasArrowRight;
68
-
69
- default:
70
- return '';
71
- }
37
+ default:
38
+ return "";
72
39
  }
73
- }, {
74
- key: "getThemeStyle",
75
- value: function getThemeStyle(theme, color) {
76
- return {
77
- backgroundColor: (0, _theme.getThemePaletteBackgroundColor)(theme, color),
78
- color: (0, _theme.getThemePaletteTextColor)(theme, color),
79
- borderColor: (0, _theme.getThemePaletteBorderColor)(theme, color),
80
- borderWidth: (0, _theme.getThemePaletteBorderColor)(theme, color) ? '1px' : '0'
81
- };
82
- }
83
- }, {
84
- key: "render",
85
- value: function render() {
86
- var _this$props$href;
87
-
88
- var buttonProps = _objectSpread({}, this.props);
89
-
90
- delete buttonProps.noHover;
91
- delete buttonProps.rounded;
92
- var themeStyle = this.props.theme ? this.getThemeStyle(this.props.theme, this.props.color) : null;
93
- var className = "".concat(_ButtonModule.default.button, " ").concat(_ButtonModule.default[this.props.color], " ").concat(_ButtonModule.default[this.props.size], " ").concat(this.getArrowClass(), " ").concat(this.props.theme ? _ButtonModule.default.hasTheme : '', " ").concat(this.props.noHover ? _ButtonModule.default.noHover : '', " ").concat(this.props.rounded ? _ButtonModule.default.rounded : '');
94
- return (_this$props$href = this.props.href) !== null && _this$props$href !== void 0 && _this$props$href.length ? /*#__PURE__*/_react.default.createElement("a", _extends({}, buttonProps, {
95
- className: className,
96
- style: themeStyle
97
- }), this.props.content || this.props.children) : /*#__PURE__*/_react.default.createElement("button", _extends({}, buttonProps, {
98
- className: className,
99
- style: themeStyle
100
- }), this.props.content || this.props.children);
101
- }
102
- }]);
103
-
104
- return Button;
105
- }(_react.default.Component);
40
+ };
41
+
42
+ var getThemeStyle = function getThemeStyle(theme, color) {
43
+ return {
44
+ backgroundColor: (0, _theme.getThemePaletteBackgroundColor)(theme, color),
45
+ color: (0, _theme.getThemePaletteTextColor)(theme, color),
46
+ borderColor: (0, _theme.getThemePaletteBorderColor)(theme, color),
47
+ borderWidth: (0, _theme.getThemePaletteBorderColor)(theme, color) ? "1px" : "0"
48
+ };
49
+ };
50
+
51
+ var buttonProps = _objectSpread({}, props);
52
+
53
+ delete buttonProps.noHover;
54
+ delete buttonProps.rounded;
55
+ var themeStyle = props.theme ? getThemeStyle(props.theme, props.color) : null;
56
+ var className = "".concat(_ButtonModule.default.button, " ").concat(_ButtonModule.default[props.color], " ").concat(_ButtonModule.default[props.size], " ").concat(getArrowClass(props.arrow), " ").concat(props.theme ? _ButtonModule.default.hasTheme : "", " ").concat(props.noHover ? _ButtonModule.default.noHover : "", " ").concat(props.rounded ? _ButtonModule.default.rounded : "");
57
+ return (_props$href = props.href) !== null && _props$href !== void 0 && _props$href.length ? _react.default.createElement("a", _extends({}, buttonProps, {
58
+ className: className,
59
+ style: themeStyle
60
+ }), props.content || props.children) : _react.default.createElement("button", _extends({}, buttonProps, {
61
+ className: className,
62
+ style: themeStyle
63
+ }), props.content || props.children);
64
+ };
106
65
 
107
66
  Button.propTypes = {
108
- /** Text content inside button */
109
67
  content: _propTypes.default.string,
110
- color: _propTypes.default.oneOf(['default', 'primary']),
111
- size: _propTypes.default.oneOf(['small', 'regular']),
112
- arrow: _propTypes.default.oneOf(['left', 'right']),
68
+ color: _propTypes.default.oneOf(["default", "primary"]),
69
+ size: _propTypes.default.oneOf(["small", "regular"]),
70
+ arrow: _propTypes.default.oneOf(["none", "left", "right"]),
113
71
  theme: _propTypes.default.object,
114
72
  disabled: _propTypes.default.bool,
115
73
  noHover: _propTypes.default.bool,
116
74
  rounded: _propTypes.default.bool,
117
- href: _propTypes.default.string
75
+ href: _propTypes.default.string,
76
+ onClick: _propTypes.default.func
118
77
  };
119
78
  Button.defaultProps = {
120
- color: 'default',
121
- size: 'regular',
79
+ color: "default",
80
+ size: "regular",
122
81
  disabled: false,
123
- noHover: false
82
+ noHover: false,
83
+ arrow: 'none'
124
84
  };
125
85
  var _default = Button;
126
86
  exports.default = _default;