dibk-design 1.1.9 → 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 +9 -2
  51. package/dist/components/CheckBoxList.module.scss +14 -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 +9 -2
  91. package/dist/components/RadioButtonList.module.scss +14 -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 -26
  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 -28
  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
@@ -29,148 +29,106 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
29
29
 
30
30
  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); }
31
31
 
32
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
-
34
- 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); } }
35
-
36
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
37
-
38
- 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); }
39
-
40
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
41
-
42
- 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); }; }
43
-
44
- 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); }
45
-
46
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
47
-
48
- 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; } }
49
-
50
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
51
-
52
- var Select = /*#__PURE__*/function (_React$Component) {
53
- _inherits(Select, _React$Component);
54
-
55
- var _super = _createSuper(Select);
56
-
57
- function Select() {
58
- _classCallCheck(this, Select);
59
-
60
- return _super.apply(this, arguments);
61
- }
62
-
63
- _createClass(Select, [{
64
- key: "getThemeErrorInputStyle",
65
- value: function getThemeErrorInputStyle(theme) {
66
- return {
67
- boxShadow: "0 0 3px ".concat((0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')),
68
- borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
69
- };
70
- }
71
- }, {
72
- key: "getThemeArrowStyle",
73
- value: function getThemeArrowStyle(theme) {
74
- return {
75
- borderTopColor: (0, _theme.getThemePaletteBackgroundColor)(theme, 'primary')
76
- };
77
- }
78
- }, {
79
- key: "getKeyByValue",
80
- value: function getKeyByValue(value, options) {
81
- var selectedOption = options && options.length ? options.find(function (option) {
82
- if (_typeof(option) === 'object') {
83
- return option.value === value;
84
- } else {
85
- return option === value;
86
- }
87
- }) : null;
88
-
89
- if (selectedOption && selectedOption.key) {
90
- return selectedOption.key;
91
- } else if (selectedOption && selectedOption.value) {
92
- return selectedOption.value;
32
+ var Select = function Select(props) {
33
+ var getThemeErrorInputStyle = function getThemeErrorInputStyle(theme) {
34
+ return {
35
+ boxShadow: "0 0 3px ".concat((0, _theme.getThemePaletteBackgroundColor)(theme, "warning")),
36
+ borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, "warning")
37
+ };
38
+ };
39
+
40
+ var getThemeArrowStyle = function getThemeArrowStyle(theme) {
41
+ return {
42
+ borderTopColor: (0, _theme.getThemePaletteBackgroundColor)(theme, "primary")
43
+ };
44
+ };
45
+
46
+ var getKeyByValue = function getKeyByValue(value, options) {
47
+ var selectedOption = options && options.length ? options.find(function (option) {
48
+ if (_typeof(option) === "object") {
49
+ return option.value === value;
93
50
  } else {
94
- return selectedOption;
51
+ return option === value;
95
52
  }
53
+ }) : null;
54
+
55
+ if (selectedOption && selectedOption.key) {
56
+ return selectedOption.key;
57
+ } else if (selectedOption && selectedOption.value) {
58
+ return selectedOption.value;
59
+ } else {
60
+ return selectedOption;
96
61
  }
97
- }, {
98
- key: "renderOptionElements",
99
- value: function renderOptionElements(options) {
100
- return options.map(function (option, key) {
101
- var optionObject = null;
102
-
103
- if (_typeof(option) === 'object') {
104
- optionObject = {
105
- key: option.key ? option.key : '',
106
- value: option.value ? option.value : ''
107
- };
108
- } else {
109
- optionObject = {
110
- key: option,
111
- value: option
112
- };
113
- }
114
-
115
- return /*#__PURE__*/_react.default.createElement("option", {
116
- value: optionObject.value,
117
- key: key
118
- }, optionObject.key);
119
- });
120
- }
121
- }, {
122
- key: "renderPlaceholderOption",
123
- value: function renderPlaceholderOption(placeholder, placeholderValue) {
124
- return placeholder ? /*#__PURE__*/_react.default.createElement("option", {
125
- value: placeholderValue,
126
- disabled: true
127
- }, placeholder) : '';
128
- }
129
- }, {
130
- key: "render",
131
- value: function render() {
132
- if (this.props.contentOnly) {
133
- var value = this.props.defaultValue ? this.props.defaultValue : this.props.value || null;
134
- return /*#__PURE__*/_react.default.createElement("div", {
135
- className: _SelectModule.default.select
136
- }, /*#__PURE__*/_react.default.createElement(_Label.default, {
137
- htmlFor: this.props.id
138
- }, this.props.label), /*#__PURE__*/_react.default.createElement("span", null, value ? this.props.keyAsContent ? this.getKeyByValue(value, this.props.options) : value : this.props.defaultContent));
62
+ };
63
+
64
+ var renderOptionElements = function renderOptionElements(options) {
65
+ return options.map(function (option, key) {
66
+ var optionObject = null;
67
+
68
+ if (_typeof(option) === "object") {
69
+ optionObject = {
70
+ key: option.key ? option.key : "",
71
+ value: option.value ? option.value : ""
72
+ };
139
73
  } else {
140
- var _this$props$width, _props, _this$props$width2;
141
-
142
- var defaultValue = !this.props.value && this.props.defaultValue ? this.props.defaultValue : false;
143
-
144
- var styleRules = _objectSpread(_objectSpread({}, this.props.hasErrors ? this.getThemeErrorInputStyle(this.props.theme) : null), ((_this$props$width = this.props.width) === null || _this$props$width === void 0 ? void 0 : _this$props$width.length) && {
145
- maxWidth: this.props.width
146
- });
147
-
148
- var props = (_props = {
149
- name: this.props.name,
150
- multiple: this.props.multiple
151
- }, _defineProperty(_props, defaultValue ? 'defaultValue' : 'value', defaultValue || this.props.value), _defineProperty(_props, "onChange", this.props.onChange), _defineProperty(_props, "id", this.props.id), _defineProperty(_props, "role", this.props.role), _defineProperty(_props, "key", "".concat(this.props.id, "-").concat((0, _generators.generateRandomString)(6))), _defineProperty(_props, "className", this.props.hasErrors ? _SelectModule.default.hasErrors : ''), _defineProperty(_props, "style", styleRules), _props);
152
- return /*#__PURE__*/_react.default.createElement("div", {
153
- className: _SelectModule.default.select
154
- }, /*#__PURE__*/_react.default.createElement(_Label.default, {
155
- htmlFor: this.props.id
156
- }, this.props.label), /*#__PURE__*/_react.default.createElement("div", {
157
- className: _SelectModule.default.selectContainer,
158
- style: _objectSpread({}, ((_this$props$width2 = this.props.width) === null || _this$props$width2 === void 0 ? void 0 : _this$props$width2.length) && {
159
- maxWidth: this.props.width
160
- })
161
- }, /*#__PURE__*/_react.default.createElement("span", {
162
- className: _SelectModule.default.selectListArrow,
163
- style: this.getThemeArrowStyle(this.props.theme)
164
- }), /*#__PURE__*/_react.default.createElement("select", props, this.renderPlaceholderOption(this.props.placeholder, this.props.placeholderValue), this.renderOptionElements(this.props.options))), /*#__PURE__*/_react.default.createElement(_ErrorMessage.default, {
165
- content: this.props.errorMessage,
166
- theme: this.props.theme
167
- }));
74
+ optionObject = {
75
+ key: option,
76
+ value: option
77
+ };
168
78
  }
169
- }
170
- }]);
171
79
 
172
- return Select;
173
- }(_react.default.Component);
80
+ return _react.default.createElement("option", {
81
+ value: optionObject.value,
82
+ key: key
83
+ }, optionObject.key);
84
+ });
85
+ };
86
+
87
+ var renderPlaceholderOption = function renderPlaceholderOption(placeholder, placeholderValue) {
88
+ return placeholder ? _react.default.createElement("option", {
89
+ value: placeholderValue,
90
+ disabled: true
91
+ }, placeholder) : "";
92
+ };
93
+
94
+ if (props.contentOnly) {
95
+ var value = props.defaultValue ? props.defaultValue : props.value || null;
96
+ return _react.default.createElement("div", {
97
+ className: _SelectModule.default.select
98
+ }, _react.default.createElement(_Label.default, {
99
+ htmlFor: props.id
100
+ }, props.label), _react.default.createElement("span", null, value ? props.keyAsContent ? getKeyByValue(value, props.options) : value : props.defaultContent));
101
+ } else {
102
+ var _props$width, _selectElementProps, _props$width2;
103
+
104
+ var defaultValue = !props.value && props.defaultValue ? props.defaultValue : false;
105
+
106
+ var styleRules = _objectSpread(_objectSpread({}, props.hasErrors ? getThemeErrorInputStyle(props.theme) : null), ((_props$width = props.width) === null || _props$width === void 0 ? void 0 : _props$width.length) && {
107
+ maxWidth: props.width
108
+ });
109
+
110
+ var selectElementProps = (_selectElementProps = {
111
+ name: props.name,
112
+ multiple: props.multiple
113
+ }, _defineProperty(_selectElementProps, defaultValue ? "defaultValue" : "value", defaultValue || props.value), _defineProperty(_selectElementProps, "onChange", props.onChange), _defineProperty(_selectElementProps, "id", props.id), _defineProperty(_selectElementProps, "role", props.role), _defineProperty(_selectElementProps, "key", "".concat(props.id, "-").concat((0, _generators.generateRandomString)(6))), _defineProperty(_selectElementProps, "className", props.hasErrors ? _SelectModule.default.hasErrors : ""), _defineProperty(_selectElementProps, "style", styleRules), _selectElementProps);
114
+ return _react.default.createElement("div", {
115
+ className: _SelectModule.default.select
116
+ }, _react.default.createElement(_Label.default, {
117
+ htmlFor: props.id
118
+ }, props.label), _react.default.createElement("div", {
119
+ className: _SelectModule.default.selectContainer,
120
+ style: _objectSpread({}, ((_props$width2 = props.width) === null || _props$width2 === void 0 ? void 0 : _props$width2.length) && {
121
+ maxWidth: props.width
122
+ })
123
+ }, _react.default.createElement("span", {
124
+ className: _SelectModule.default.selectListArrow,
125
+ style: getThemeArrowStyle(props.theme)
126
+ }), _react.default.createElement("select", selectElementProps, renderPlaceholderOption(props.placeholder, props.placeholderValue), renderOptionElements(props.options))), _react.default.createElement(_ErrorMessage.default, {
127
+ content: props.errorMessage,
128
+ theme: props.theme
129
+ }));
130
+ }
131
+ };
174
132
 
175
133
  Select.propTypes = {
176
134
  id: _propTypes.default.string.isRequired,
@@ -195,16 +153,16 @@ Select.propTypes = {
195
153
  theme: _propTypes.default.object
196
154
  };
197
155
  Select.defaultProps = {
198
- name: '',
156
+ name: "",
199
157
  options: [],
200
- label: '',
158
+ label: "",
201
159
  contentOnly: false,
202
160
  keyAsContent: false,
203
161
  placeholder: null,
204
- placeholderValue: '',
162
+ placeholderValue: "",
205
163
  defaultContent: null,
206
164
  hasErrors: false,
207
- errorMessage: '',
165
+ errorMessage: "",
208
166
  onChange: function onChange() {
209
167
  return false;
210
168
  }
@@ -1,86 +1,86 @@
1
1
  @import "../style/global.scss";
2
2
 
3
- :local(.select) {
4
- :local(.selectContainer) {
5
- position: relative;
3
+ .select {
4
+ .selectContainer {
5
+ position: relative;
6
6
 
7
- :local(.selectListArrow) {
8
- box-sizing: border-box;
9
- position: absolute;
10
- top: 15px;
11
- right: 15px;
12
- display: block;
13
- width: 12px;
14
- height: 12px;
15
- border-radius: 100px;
16
- @media only screen and (min-width: $screen-sm) {
17
- top: 20px;
18
- right: 20px;
19
- }
7
+ .selectListArrow {
8
+ box-sizing: border-box;
9
+ position: absolute;
10
+ top: 15px;
11
+ right: 15px;
12
+ display: block;
13
+ width: 12px;
14
+ height: 12px;
15
+ border-radius: 100px;
16
+ @media only screen and (min-width: $screen-sm) {
17
+ top: 20px;
18
+ right: 20px;
19
+ }
20
20
 
21
- &::after {
22
- content: "";
23
- display: block;
24
- box-sizing: border-box;
25
- position: absolute;
26
- width: 12px;
27
- height: 12px;
28
- border-bottom: 2px solid;
29
- border-right: 2px solid;
30
- transform: translateY(-30%) rotate(45deg);
31
- transition: transform 0.3s ease-in-out;
32
- }
33
- }
21
+ &::after {
22
+ content: "";
23
+ display: block;
24
+ box-sizing: border-box;
25
+ position: absolute;
26
+ width: 12px;
27
+ height: 12px;
28
+ border-bottom: 2px solid;
29
+ border-right: 2px solid;
30
+ transform: translateY(-30%) rotate(45deg);
31
+ transition: transform 0.3s ease-in-out;
32
+ }
33
+ }
34
34
 
35
- select {
36
- @include border-radius(0);
37
- @include transition(border-color 0.15s linear);
38
- @include appearance(none);
39
- @include box-shadow(none);
40
- height: 47px;
41
- color: rgba(0, 0, 0, 0.75);
42
- width: 100%;
43
- font-family: inherit;
44
- font-size: 16px;
45
- padding: 10px 40px 10px 10px;
46
- border: 1px solid #afaba8;
47
- border-radius: 0;
48
- line-height: normal;
49
- background: white;
50
- cursor: pointer;
51
- @media only screen and (min-width: $screen-sm) {
52
- font-size: 19px;
53
- height: 56px;
54
- }
35
+ select {
36
+ @include border-radius(0);
37
+ @include transition(border-color 0.15s linear);
38
+ @include appearance(none);
39
+ @include box-shadow(none);
40
+ height: 47px;
41
+ color: rgba(0, 0, 0, 0.75);
42
+ width: 100%;
43
+ font-family: inherit;
44
+ font-size: 16px;
45
+ padding: 10px 40px 10px 10px;
46
+ border: 1px solid #afaba8;
47
+ border-radius: 0;
48
+ line-height: normal;
49
+ background: white;
50
+ cursor: pointer;
51
+ @media only screen and (min-width: $screen-sm) {
52
+ font-size: 19px;
53
+ height: 56px;
54
+ }
55
55
 
56
- &:hover {
57
- border-color: $color-dark-blue;
58
- }
56
+ &:hover {
57
+ border-color: $color-dark-blue;
58
+ }
59
59
 
60
- &:focus {
61
- border-color: $color-dark-blue;
62
- outline-color: #54acb8;
63
- }
60
+ &:focus {
61
+ border-color: $color-dark-blue;
62
+ outline-color: #54acb8;
63
+ }
64
64
 
65
- &[disabled],
66
- &[readonly] {
67
- background-color: #ddd;
68
- cursor: default;
69
- }
65
+ &[disabled],
66
+ &[readonly] {
67
+ background-color: #ddd;
68
+ cursor: default;
69
+ }
70
70
 
71
- &:local(.hasErrors) {
72
- border-color: $color-error;
73
- &:focus {
74
- border-color: $color-error;
75
- outline-color: #b8565d;
76
- }
77
- &[disabled],
78
- &[readonly] {
79
- background-color: #ddd;
80
- cursor: default;
81
- border-color: #afaba8;
82
- }
83
- }
84
- }
85
- }
71
+ &.hasErrors {
72
+ border-color: $color-error;
73
+ &:focus {
74
+ border-color: $color-error;
75
+ outline-color: #b8565d;
76
+ }
77
+ &[disabled],
78
+ &[readonly] {
79
+ background-color: #ddd;
80
+ cursor: default;
81
+ border-color: #afaba8;
82
+ }
83
+ }
84
+ }
85
+ }
86
86
  }
@@ -11,10 +11,8 @@ var _TableModule = _interopRequireDefault(require("./Table.module.scss"));
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- // Dependencies
15
- // Stylesheets
16
14
  var Table = function Table(props) {
17
- return /*#__PURE__*/_react.default.createElement("table", {
15
+ return _react.default.createElement("table", {
18
16
  className: _TableModule.default.table
19
17
  }, props.children);
20
18
  };
@@ -1,6 +1,6 @@
1
1
  @import "../style/global.scss";
2
2
 
3
- :local(.table) {
3
+ .table {
4
4
  font-family: $default-font;
5
5
  border-collapse: collapse;
6
6
  width: 100%;
@@ -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
  });
@@ -29,102 +27,61 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
29
27
 
30
28
  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; }
31
29
 
32
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
-
34
- 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); } }
35
-
36
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
37
-
38
- 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); }
39
-
40
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
41
-
42
- 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); }; }
43
-
44
- 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); }
45
-
46
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
47
-
48
- 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; } }
49
-
50
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
51
-
52
- var Textarea = /*#__PURE__*/function (_React$Component) {
53
- _inherits(Textarea, _React$Component);
54
-
55
- var _super = _createSuper(Textarea);
56
-
57
- function Textarea() {
58
- _classCallCheck(this, Textarea);
59
-
60
- return _super.apply(this, arguments);
61
- }
62
-
63
- _createClass(Textarea, [{
64
- key: "getThemeErrorInputStyle",
65
- value: function getThemeErrorInputStyle(theme) {
66
- return {
67
- boxShadow: "0 0 3px ".concat((0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')),
68
- borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
69
- };
70
- }
71
- }, {
72
- key: "renderValueAsText",
73
- value: function renderValueAsText(value, defaultContent) {
74
- return value ? value : defaultContent;
75
- }
76
- }, {
77
- key: "renderInputField",
78
- value: function renderInputField() {
79
- var _this$props$width, _this$props$resize, _props;
80
-
81
- var defaultValue = !this.props.value && this.props.defaultValue ? this.props.defaultValue : false;
82
- var defaultKey = this.props.elementKey || null;
83
-
84
- var styleRules = _objectSpread(_objectSpread(_objectSpread({}, this.props.hasErrors ? this.getThemeErrorInputStyle(this.props.theme) : null), ((_this$props$width = this.props.width) === null || _this$props$width === void 0 ? void 0 : _this$props$width.length) && {
85
- maxWidth: this.props.width
86
- }), ((_this$props$resize = this.props.resize) === null || _this$props$resize === void 0 ? void 0 : _this$props$resize.length) && {
87
- resize: this.props.resize
88
- });
89
-
90
- var props = (_props = {
91
- name: this.props.name,
92
- readOnly: this.props.readOnly,
93
- disabled: this.props.disabled,
94
- type: this.props.type,
95
- id: this.props.id,
96
- key: defaultKey || "".concat(this.props.id, "-").concat((0, _generators.generateRandomString)(6)),
97
- onChange: this.props.onChange,
98
- onBlur: this.props.onBlur
99
- }, _defineProperty(_props, defaultValue ? 'defaultValue' : 'value', defaultValue || this.props.value), _defineProperty(_props, "placeholder", this.props.placeholder), _defineProperty(_props, "rows", this.props.rows), _defineProperty(_props, "className", this.props.hasErrors ? _TextareaModule.default.hasErrors : ''), _defineProperty(_props, 'aria-required', this.props.mandatory), _defineProperty(_props, "style", styleRules), _props);
100
- return /*#__PURE__*/_react.default.createElement("textarea", props);
101
- }
102
- }, {
103
- key: "render",
104
- value: function render() {
105
- return /*#__PURE__*/_react.default.createElement("div", {
106
- className: _TextareaModule.default.textarea
107
- }, /*#__PURE__*/_react.default.createElement(_Label.default, {
108
- htmlFor: this.props.id
109
- }, this.props.label), !this.props.contentOnly ? this.renderInputField() : /*#__PURE__*/_react.default.createElement("span", null, this.renderValueAsText(this.props.value || this.props.defaultValue, this.props.defaultContent)), /*#__PURE__*/_react.default.createElement(_ErrorMessage.default, {
110
- content: this.props.errorMessage,
111
- theme: this.props.theme
112
- }));
113
- }
114
- }]);
115
-
116
- return Textarea;
117
- }(_react.default.Component);
30
+ var Textarea = function Textarea(props) {
31
+ var getThemeErrorInputStyle = function getThemeErrorInputStyle(theme) {
32
+ return {
33
+ boxShadow: "0 0 3px ".concat((0, _theme.getThemePaletteBackgroundColor)(theme, "warning")),
34
+ borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, "warning")
35
+ };
36
+ };
37
+
38
+ var renderValueAsText = function renderValueAsText(value, defaultContent) {
39
+ return value ? value : defaultContent;
40
+ };
41
+
42
+ var renderInputField = function renderInputField() {
43
+ var _props$value, _props$defaultValue, _props$width, _props$resize, _textareaElementProps;
44
+
45
+ var defaultValue = !((_props$value = props.value) !== null && _props$value !== void 0 && _props$value.length) && (_props$defaultValue = props.defaultValue) !== null && _props$defaultValue !== void 0 && _props$defaultValue.length ? props.defaultValue : false;
46
+ var defaultKey = props.elementKey || null;
47
+
48
+ var styleRules = _objectSpread(_objectSpread(_objectSpread({}, props.hasErrors ? getThemeErrorInputStyle(props.theme) : null), ((_props$width = props.width) === null || _props$width === void 0 ? void 0 : _props$width.length) && {
49
+ maxWidth: props.width
50
+ }), ((_props$resize = props.resize) === null || _props$resize === void 0 ? void 0 : _props$resize.length) && {
51
+ resize: props.resize
52
+ });
53
+
54
+ var textareaElementProps = (_textareaElementProps = {
55
+ name: props.name,
56
+ readOnly: props.readOnly,
57
+ disabled: props.disabled,
58
+ type: props.type,
59
+ id: props.id,
60
+ key: defaultKey || "".concat(props.id, "-").concat((0, _generators.generateRandomString)(6)),
61
+ onChange: props.onChange,
62
+ onBlur: props.onBlur
63
+ }, _defineProperty(_textareaElementProps, defaultValue ? "defaultValue" : "value", defaultValue || props.value), _defineProperty(_textareaElementProps, "placeholder", props.placeholder), _defineProperty(_textareaElementProps, "rows", props.rows), _defineProperty(_textareaElementProps, "className", props.hasErrors ? _TextareaModule.default.hasErrors : ""), _defineProperty(_textareaElementProps, "aria-required", props.mandatory), _defineProperty(_textareaElementProps, "style", styleRules), _textareaElementProps);
64
+ return _react.default.createElement("textarea", textareaElementProps);
65
+ };
66
+
67
+ return _react.default.createElement("div", {
68
+ className: _TextareaModule.default.textarea
69
+ }, _react.default.createElement(_Label.default, {
70
+ htmlFor: props.id
71
+ }, props.label), !props.contentOnly ? renderInputField() : _react.default.createElement("span", null, renderValueAsText(props.value || props.defaultValue, props.defaultContent)), _react.default.createElement(_ErrorMessage.default, {
72
+ content: props.errorMessage,
73
+ theme: props.theme
74
+ }));
75
+ };
118
76
 
119
77
  Textarea.propTypes = {
120
- /** Text content inside list item */
121
78
  id: _propTypes.default.string.isRequired,
122
79
  onChange: _propTypes.default.func.isRequired,
123
80
  onBlur: _propTypes.default.func,
124
81
  name: _propTypes.default.string,
125
82
  type: _propTypes.default.string,
126
83
  width: _propTypes.default.string,
127
- resize: _propTypes.default.string,
84
+ resize: _propTypes.default.oneOf(['both', 'horizontal', 'vertical', 'none']),
128
85
  value: _propTypes.default.string,
129
86
  defaultValue: _propTypes.default.string,
130
87
  elementKey: _propTypes.default.string,
@@ -139,14 +96,15 @@ Textarea.propTypes = {
139
96
  theme: _propTypes.default.object
140
97
  };
141
98
  Textarea.defaultProps = {
142
- name: '',
143
- type: 'text',
144
- label: '',
99
+ name: "",
100
+ type: "text",
101
+ label: "",
145
102
  contentOnly: false,
146
- placeholder: '',
147
- defaultContent: '',
103
+ resize: 'both',
104
+ placeholder: "",
105
+ defaultContent: "",
148
106
  hasErrors: false,
149
- errorMessage: '',
107
+ errorMessage: "",
150
108
  mandatory: false,
151
109
  onChange: function onChange() {
152
110
  return false;
@@ -1,6 +1,6 @@
1
1
  @import "../style/global.scss";
2
2
 
3
- :local(.textarea) {
3
+ .textarea {
4
4
  > div {
5
5
  display: block;
6
6
  }
@@ -41,7 +41,7 @@
41
41
  cursor: default;
42
42
  }
43
43
 
44
- &:local(.hasErrors) {
44
+ &.hasErrors {
45
45
  border-color: $color-error;
46
46
  &:focus {
47
47
  border-color: $color-error;