dibk-design 0.4.43 → 0.4.46

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.
@@ -47,8 +47,11 @@
47
47
  display: inline-block;
48
48
  margin-right: 5px;
49
49
  margin-bottom: 5px;
50
- font-size: 20px;
50
+ font-size: 17px;
51
51
  font-weight: 500;
52
+ @media only screen and (min-width: $screen-sm) {
53
+ font-size: 20px;
54
+ }
52
55
 
53
56
  &:local(.hasTheme) {
54
57
  &:hover,
@@ -62,13 +65,20 @@
62
65
  }
63
66
 
64
67
  &:local(.regular) {
65
- padding: 17px 32px;
68
+ padding: 14px 24px;
69
+ @media only screen and (min-width: $screen-sm) {
70
+ padding: 17px 32px;
71
+ }
66
72
  }
67
73
 
68
74
  &:local(.small) {
69
- padding: 6px 32px;
75
+ padding: 6px 24px;
70
76
  min-width: 80px;
71
- line-height: 21px;;
77
+ line-height: 18px;
78
+ @media only screen and (min-width: $screen-sm) {
79
+ line-height: 21px;
80
+ padding: 6px 32px;
81
+ }
72
82
  }
73
83
 
74
84
  &:local(.default) {
@@ -157,25 +167,28 @@
157
167
  }
158
168
  }
159
169
 
160
- &:local(.rounded){
170
+ &:local(.rounded) {
161
171
  border-radius: 20px;
162
172
  }
163
173
 
164
174
  &:local(.hasArrowLeft) {
165
175
  &:before {
166
176
  @include transform(rotate(-135deg));
167
- @include calc("top", "50% - 0.3rem");
177
+ @include calc("top", "50% - 0.4rem");
168
178
  content: " ";
169
179
  display: inline-block;
170
180
  position: absolute;
171
- left: 1em;
172
181
  right: auto;
182
+ left: 0.55em;
173
183
  width: 0.5rem;
174
184
  height: 0.5rem;
175
185
  vertical-align: middle;
176
186
  border: 2px solid white;
177
187
  border-width: 2px 2px 0 0;
178
188
  margin-right: 1em;
189
+ @media only screen and (min-width: $screen-sm) {
190
+ left: 1em;
191
+ }
179
192
  }
180
193
 
181
194
  &:hover {
@@ -193,18 +206,21 @@
193
206
  &:local(.hasArrowRight) {
194
207
  &:after {
195
208
  @include transform(rotate(45deg));
196
- @include calc("top", "50% - 0.3rem");
209
+ @include calc("top", "50% - 0.4rem");
197
210
  content: " ";
198
211
  display: inline-block;
199
212
  position: absolute;
200
213
  left: auto;
201
- right: 1em;
214
+ right: 0.55em;
202
215
  width: 0.5rem;
203
216
  height: 0.5rem;
204
217
  vertical-align: middle;
205
218
  border: 2px solid white;
206
219
  border-width: 2px 2px 0 0;
207
220
  margin-left: 1em;
221
+ @media only screen and (min-width: $screen-sm) {
222
+ right: 1em;
223
+ }
208
224
  }
209
225
 
210
226
  &:hover {
@@ -71,10 +71,14 @@ var CheckBoxIcon = /*#__PURE__*/function (_React$Component) {
71
71
  });
72
72
  }
73
73
 
74
- return /*#__PURE__*/_react.default.createElement("span", {
74
+ var ariaExpandedIndex = "aria-expanded";
75
+
76
+ var props = _defineProperty({
75
77
  className: "".concat(_CheckBoxIconModule.default.checkBoxIcon, " ").concat(this.props.checked ? _CheckBoxIconModule.default.checked : '', " ").concat(this.props.disabled ? _CheckBoxIconModule.default.disabled : '', " ").concat(this.props.showBox ? _CheckBoxIconModule.default.showBox : '', " ").concat(this.props.hasErrors ? _CheckBoxIconModule.default.hasErrors : ''),
76
78
  style: inlineStyle
77
- }, /*#__PURE__*/_react.default.createElement("span", {
79
+ }, ariaExpandedIndex, this.props.expandable ? this.props.checked.toString() : null);
80
+
81
+ return /*#__PURE__*/_react.default.createElement("span", props, /*#__PURE__*/_react.default.createElement("span", {
78
82
  className: _CheckBoxIconModule.default.checkmark
79
83
  }, this.props.checked ? this.props.checkmarkCharacter : ''));
80
84
  }
@@ -90,7 +94,8 @@ CheckBoxIcon.propTypes = {
90
94
  showBox: _propTypes.default.bool,
91
95
  theme: _propTypes.default.object,
92
96
  hasErrors: _propTypes.default.bool,
93
- checkmarkCharacter: _propTypes.default.string
97
+ checkmarkCharacter: _propTypes.default.string,
98
+ expandable: _propTypes.default.bool
94
99
  };
95
100
  CheckBoxIcon.defaultProps = {
96
101
  size: '20px',
@@ -98,7 +103,8 @@ CheckBoxIcon.defaultProps = {
98
103
  disabled: false,
99
104
  showBox: true,
100
105
  hasErrors: false,
101
- checkmarkCharacter: '✔'
106
+ checkmarkCharacter: '✔',
107
+ expandable: false
102
108
  };
103
109
  var _default = CheckBoxIcon;
104
110
  exports.default = _default;
@@ -59,7 +59,8 @@ var CheckBoxInput = /*#__PURE__*/function (_React$Component) {
59
59
  disabled: this.props.disabled,
60
60
  theme: this.props.theme,
61
61
  hasErrors: this.props.hasErrors,
62
- checkmarkCharacter: this.props.checkmarkCharacter
62
+ checkmarkCharacter: this.props.checkmarkCharacter,
63
+ expandable: this.props.expandable
63
64
  }), /*#__PURE__*/_react.default.createElement("input", {
64
65
  onChange: this.props.onChange,
65
66
  type: "checkbox",
@@ -88,7 +89,8 @@ CheckBoxInput.propTypes = {
88
89
  contentOnly: _propTypes.default.bool,
89
90
  hasErrors: _propTypes.default.bool,
90
91
  theme: _propTypes.default.object,
91
- checkmarkCharacter: _propTypes.default.string
92
+ checkmarkCharacter: _propTypes.default.string,
93
+ expandable: _propTypes.default.bool
92
94
  };
93
95
  CheckBoxInput.defaultProps = {
94
96
  checked: false,
@@ -96,7 +98,8 @@ CheckBoxInput.defaultProps = {
96
98
  name: '',
97
99
  contentOnly: false,
98
100
  hasErrors: false,
99
- checkmarkCharacter: '✔'
101
+ checkmarkCharacter: '✔',
102
+ expandable: false
100
103
  };
101
104
  var _default = CheckBoxInput;
102
105
  exports.default = _default;
@@ -20,6 +20,13 @@ Checkbox input example:
20
20
  <CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-6" checked={true} checkmarkCharacter="✕">
21
21
  <span>Label for checked checkbox with custom checkmark</span>
22
22
  </CheckBoxInput>
23
+ <CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-7" checked={true} checkmarkCharacter="✕" expandable={true}>
24
+ <span>Label for checkbox with aria-expanded true</span>
25
+ </CheckBoxInput>
26
+ <CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-8" checked={false} checkmarkCharacter="✕" expandable={true}>
27
+ <span>Label for checkbox with aria-expanded false</span>
28
+ </CheckBoxInput>
29
+
23
30
  </div>
24
31
  ```
25
32
 
@@ -37,8 +37,11 @@
37
37
  background-color: #fff;
38
38
  overflow: auto;
39
39
  position: relative;
40
- &:not(:local(.noPadding)){
41
- padding: 60px 40px;
40
+ &:not(:local(.noPadding)) {
41
+ padding: 30px 15px;
42
+ @media only screen and (min-width: $screen-sm) {
43
+ padding: 60px 40px;
44
+ }
42
45
  }
43
46
  @media (min-width: $screen-md) {
44
47
  @include calc("width", "100% - 128px");
@@ -50,12 +53,16 @@
50
53
  color: $color-primary;
51
54
  display: inline-block;
52
55
  position: absolute;
53
- right: 15px;
54
- top: 10px;
56
+ right: 7px;
57
+ top: 4px;
55
58
  text-decoration: underline;
56
59
  font-size: 19px;
57
60
  cursor: pointer;
58
- &:hover{
61
+ @media only screen and (min-width: $screen-sm) {
62
+ right: 15px;
63
+ top: 10px;
64
+ }
65
+ &:hover {
59
66
  text-decoration: none;
60
67
  }
61
68
  &::after {
@@ -13,6 +13,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
14
14
  var _Button = _interopRequireDefault(require("./Button"));
15
15
 
16
+ var _ErrorMessage = _interopRequireDefault(require("./ErrorMessage"));
17
+
16
18
  var _DragAndDropFileInputModule = _interopRequireDefault(require("./DragAndDropFileInput.module.scss"));
17
19
 
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -167,9 +169,10 @@ var DragAndDropFileInput = /*#__PURE__*/function (_React$Component) {
167
169
  return _this2.handleAddButtonOnClick();
168
170
  },
169
171
  content: buttonContent
170
- })) : '') : ''), this.props.contentOnly ? /*#__PURE__*/_react.default.createElement("span", null, this.renderValueAsText(this.props.selectedFileName, this.props.defaultContent)) : '', /*#__PURE__*/_react.default.createElement("span", {
171
- className: _DragAndDropFileInputModule.default.errorMessage
172
- }, this.props.errorMessage ? this.props.errorMessage : ''));
172
+ })) : '') : ''), this.props.contentOnly ? /*#__PURE__*/_react.default.createElement("span", null, this.renderValueAsText(this.props.selectedFileName, this.props.defaultContent)) : '', /*#__PURE__*/_react.default.createElement(_ErrorMessage.default, {
173
+ content: this.props.errorMessage,
174
+ theme: this.props.theme
175
+ }));
173
176
  }
174
177
  }]);
175
178
 
@@ -190,7 +193,8 @@ DragAndDropFileInput.propTypes = {
190
193
  defaultContent: _propTypes.default.string,
191
194
  hasErrors: _propTypes.default.bool,
192
195
  errorMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))]),
193
- mandatory: _propTypes.default.bool
196
+ mandatory: _propTypes.default.bool,
197
+ theme: _propTypes.default.object
194
198
  };
195
199
  DragAndDropFileInput.defaultProps = {
196
200
  label: '',
@@ -33,13 +33,4 @@
33
33
  border-color: $color-dark-blue;
34
34
  }
35
35
  }
36
- :local(.errorMessage) {
37
- color: $color-error-text;
38
- font-size: 19px;
39
- font-weight: 400;
40
- line-height: 1.6;
41
- font-family: "Open Sans", sans-serif;
42
- font-style: italic;
43
- overflow-wrap: break-word;
44
- }
45
36
  }
@@ -0,0 +1,80 @@
1
+ "use strict";
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
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
14
+ var _theme = require("../functions/theme");
15
+
16
+ var _ErrorMessageModule = _interopRequireDefault(require("./ErrorMessage.module.scss"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
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); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
27
+
28
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
+
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); }; }
31
+
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); }
33
+
34
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
+
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; } }
37
+
38
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
+
40
+ var ErrorMessage = /*#__PURE__*/function (_React$Component) {
41
+ _inherits(ErrorMessage, _React$Component);
42
+
43
+ var _super = _createSuper(ErrorMessage);
44
+
45
+ function ErrorMessage() {
46
+ _classCallCheck(this, ErrorMessage);
47
+
48
+ return _super.apply(this, arguments);
49
+ }
50
+
51
+ _createClass(ErrorMessage, [{
52
+ key: "getThemeErrorMessageStyle",
53
+ value: function getThemeErrorMessageStyle(theme) {
54
+ return {
55
+ color: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
56
+ };
57
+ }
58
+ }, {
59
+ key: "render",
60
+ value: function render() {
61
+ return /*#__PURE__*/_react.default.createElement("span", {
62
+ className: _ErrorMessageModule.default.errorMessage,
63
+ style: this.getThemeErrorMessageStyle(this.props.theme)
64
+ }, this.props.content ? this.props.content : '');
65
+ }
66
+ }]);
67
+
68
+ return ErrorMessage;
69
+ }(_react.default.Component);
70
+
71
+ ErrorMessage.propTypes = {
72
+ /** Text content inside error message */
73
+ content: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))]),
74
+ theme: _propTypes.default.object
75
+ };
76
+ ErrorMessage.defaultProps = {
77
+ content: ''
78
+ };
79
+ var _default = ErrorMessage;
80
+ exports.default = _default;
@@ -0,0 +1,15 @@
1
+ Error message example:
2
+
3
+ ```js
4
+ <ErrorMessage content="Wrong value" />
5
+ ```
6
+
7
+
8
+ Themed error message example:
9
+
10
+ ```js
11
+ import customTheme from 'data/customTheme';
12
+ <React.Fragment>
13
+ <ErrorMessage content="Wrong value" theme={customTheme} />
14
+ </React.Fragment>
15
+ ```
@@ -0,0 +1,16 @@
1
+ @import "../style/global.scss";
2
+
3
+ :local(.errorMessage) {
4
+ display: block;
5
+ color: $color-error-text;
6
+ font-size: 16px;
7
+ font-weight: 400;
8
+ line-height: 1.2;
9
+ margin: 4px 0;
10
+ font-family: "Open Sans", sans-serif;
11
+ font-style: italic;
12
+ overflow-wrap: break-word;
13
+ @media only screen and (min-width: $screen-sm) {
14
+ font-size: 19px;
15
+ }
16
+ }
@@ -21,6 +21,8 @@ var _Button = _interopRequireDefault(require("./Button"));
21
21
 
22
22
  var _Label = _interopRequireDefault(require("./Label"));
23
23
 
24
+ var _ErrorMessage = _interopRequireDefault(require("./ErrorMessage"));
25
+
24
26
  var _theme = require("../functions/theme");
25
27
 
26
28
  var _generators = require("../functions/generators");
@@ -82,13 +84,6 @@ var InputField = /*#__PURE__*/function (_React$Component) {
82
84
  borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
83
85
  };
84
86
  }
85
- }, {
86
- key: "getThemeErrorMessageStyle",
87
- value: function getThemeErrorMessageStyle(theme) {
88
- return {
89
- color: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
90
- };
91
- }
92
87
  }, {
93
88
  key: "convertDateToString",
94
89
  value: function convertDateToString(date) {
@@ -177,10 +172,10 @@ var InputField = /*#__PURE__*/function (_React$Component) {
177
172
  theme: this.props.theme
178
173
  }) : '') : ''), !this.props.contentOnly ? this.props.type === 'date' ? /*#__PURE__*/_react.default.createElement("div", {
179
174
  style: styleRules
180
- }, /*#__PURE__*/_react.default.createElement(_reactDatepicker.default, this.getDatePickerElementProps(defaultValue, defaultKey))) : /*#__PURE__*/_react.default.createElement("input", this.getInputElementProps(defaultValue, defaultKey, styleRules)) : /*#__PURE__*/_react.default.createElement("span", null, this.renderValueAsText(this.props.value || this.props.defaultValue, this.props.defaultContent)), /*#__PURE__*/_react.default.createElement("span", {
181
- className: _InputFieldModule.default.errorMessage,
182
- style: this.getThemeErrorMessageStyle(this.props.theme)
183
- }, this.props.errorMessage ? this.props.errorMessage : ''));
175
+ }, /*#__PURE__*/_react.default.createElement(_reactDatepicker.default, this.getDatePickerElementProps(defaultValue, defaultKey))) : /*#__PURE__*/_react.default.createElement("input", this.getInputElementProps(defaultValue, defaultKey, styleRules)) : /*#__PURE__*/_react.default.createElement("span", null, this.renderValueAsText(this.props.value || this.props.defaultValue, this.props.defaultContent)), /*#__PURE__*/_react.default.createElement(_ErrorMessage.default, {
176
+ content: this.props.errorMessage,
177
+ theme: this.props.theme
178
+ }));
184
179
  }
185
180
  }]);
186
181
 
@@ -1,7 +1,10 @@
1
1
  @import "../style/global.scss";
2
2
 
3
3
  :local(.inputField) {
4
- font-size: 19px;
4
+ font-size: 16px;
5
+ @media only screen and (min-width: $screen-sm) {
6
+ font-size: 19px;
7
+ }
5
8
  > div {
6
9
  display: block;
7
10
  }
@@ -11,7 +14,7 @@
11
14
  @include transition(border-color 0.15s linear, background 0.15s linear);
12
15
  @include border-radius(0);
13
16
  @include box-shadow(none);
14
- height: 56px;
17
+ height: 47px;
15
18
  width: 100%;
16
19
  display: block;
17
20
  padding: 10px;
@@ -21,9 +24,13 @@
21
24
  box-shadow: none;
22
25
  color: rgba(0, 0, 0, 0.75);
23
26
  font-family: inherit;
24
- font-size: 19px;
27
+ font-size: 16px;
25
28
  box-sizing: border-box;
26
29
  border: 1px solid #afaba8;
30
+ @media only screen and (min-width: $screen-sm) {
31
+ font-size: 19px;
32
+ height: 56px;
33
+ }
27
34
 
28
35
  &:hover {
29
36
  border-color: $color-dark-blue;
@@ -71,13 +78,4 @@
71
78
  margin: 0 8px;
72
79
  }
73
80
  }
74
- :local(.errorMessage) {
75
- color: $color-error-text;
76
- font-size: 19px;
77
- font-weight: 400;
78
- line-height: 1.6;
79
- font-family: "Open Sans", sans-serif;
80
- font-style: italic;
81
- overflow-wrap: break-word;
82
- }
83
81
  }
@@ -3,8 +3,8 @@
3
3
  display: block;
4
4
  font-size: 1rem;
5
5
  font-weight: bold;
6
- line-height: 1.5;
7
- margin-bottom: 0;
6
+ line-height: 1.2;
7
+ margin-bottom: 2px;
8
8
  font-family: "Open Sans", sans-serif;
9
9
  overflow-wrap: break-word;
10
10
  &:local(.inline) {
@@ -69,10 +69,14 @@ var RadioButtonIcon = /*#__PURE__*/function (_React$Component) {
69
69
  });
70
70
  }
71
71
 
72
- return /*#__PURE__*/_react.default.createElement("span", {
72
+ var ariaExpandedIndex = "aria-expanded";
73
+
74
+ var props = _defineProperty({
73
75
  className: "".concat(_RadioButtonIconModule.default.radioButtonIcon, " ").concat(this.props.checked ? _RadioButtonIconModule.default.checked : '', " ").concat(this.props.disabled ? _RadioButtonIconModule.default.disabled : '', " ").concat(this.props.hasErrors ? _RadioButtonIconModule.default.hasErrors : ''),
74
76
  style: inlineStyle
75
- });
77
+ }, ariaExpandedIndex, this.props.expandable ? this.props.checked.toString() : null);
78
+
79
+ return /*#__PURE__*/_react.default.createElement("span", props);
76
80
  }
77
81
  }]);
78
82
 
@@ -84,13 +88,15 @@ RadioButtonIcon.propTypes = {
84
88
  checked: _propTypes.default.bool,
85
89
  disabled: _propTypes.default.bool,
86
90
  theme: _propTypes.default.object,
87
- hasErrors: _propTypes.default.bool
91
+ hasErrors: _propTypes.default.bool,
92
+ expandable: _propTypes.default.bool
88
93
  };
89
94
  RadioButtonIcon.defaultProps = {
90
95
  size: '10px',
91
96
  checked: false,
92
97
  disabled: false,
93
- hasErrors: false
98
+ hasErrors: false,
99
+ expandable: false
94
100
  };
95
101
  var _default = RadioButtonIcon;
96
102
  exports.default = _default;
@@ -58,7 +58,8 @@ var RadioButtonInput = /*#__PURE__*/function (_React$Component) {
58
58
  checked: this.props.checked,
59
59
  disabled: this.props.disabled,
60
60
  theme: this.props.theme,
61
- hasErrors: this.props.hasErrors
61
+ hasErrors: this.props.hasErrors,
62
+ expandable: this.props.expandable
62
63
  }), /*#__PURE__*/_react.default.createElement("input", {
63
64
  type: "radio",
64
65
  onChange: this.props.onChange,
@@ -82,14 +83,16 @@ RadioButtonInput.propTypes = {
82
83
  onChange: _propTypes.default.func,
83
84
  contentOnly: _propTypes.default.bool,
84
85
  theme: _propTypes.default.object,
85
- hasErrors: _propTypes.default.bool
86
+ hasErrors: _propTypes.default.bool,
87
+ expandable: _propTypes.default.bool
86
88
  };
87
89
  RadioButtonInput.defaultProps = {
88
90
  name: '',
89
91
  checked: false,
90
92
  disabled: false,
91
93
  contentOnly: false,
92
- hasErrors: false
94
+ hasErrors: false,
95
+ expandable: false
93
96
  };
94
97
  var _default = RadioButtonInput;
95
98
  exports.default = _default;
@@ -6,6 +6,8 @@ Radio button input example:
6
6
  <RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 2" name="radio-button-input" id="radio-button-input-2"><span>Unchecked radio button</span></RadioButtonInput>
7
7
  <RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 1" name="radio-button-input" id="radio-button-input-3" checked={true} disabled={true}><span>Checked disabled radio button</span></RadioButtonInput>
8
8
  <RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 2" name="radio-button-input" id="radio-button-input-4" disabled={true}><span>Unchecked disabled radio button</span></RadioButtonInput>
9
+ <RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 2" name="radio-button-input" id="radio-button-input-4" checked={false} expandable={true}><span>Unchecked expandable radio button </span></RadioButtonInput>
10
+ <RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 2" name="radio-button-input" id="radio-button-input-4" checked={true} expandable={true}><span>Checked expandable radio button </span></RadioButtonInput>
9
11
  </div>
10
12
  ```
11
13
 
@@ -11,6 +11,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _Label = _interopRequireDefault(require("./Label"));
13
13
 
14
+ var _ErrorMessage = _interopRequireDefault(require("./ErrorMessage"));
15
+
14
16
  var _theme = require("../functions/theme");
15
17
 
16
18
  var _generators = require("../functions/generators");
@@ -66,13 +68,6 @@ var Select = /*#__PURE__*/function (_React$Component) {
66
68
  borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
67
69
  };
68
70
  }
69
- }, {
70
- key: "getThemeErrorMessageStyle",
71
- value: function getThemeErrorMessageStyle(theme) {
72
- return {
73
- color: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
74
- };
75
- }
76
71
  }, {
77
72
  key: "getThemeArrowStyle",
78
73
  value: function getThemeArrowStyle(theme) {
@@ -166,10 +161,10 @@ var Select = /*#__PURE__*/function (_React$Component) {
166
161
  }, /*#__PURE__*/_react.default.createElement("span", {
167
162
  className: _SelectModule.default.selectListArrow,
168
163
  style: this.getThemeArrowStyle(this.props.theme)
169
- }), /*#__PURE__*/_react.default.createElement("select", props, this.renderPlaceholderOption(this.props.placeholder, this.props.placeholderValue), this.renderOptionElements(this.props.options))), /*#__PURE__*/_react.default.createElement("span", {
170
- className: _SelectModule.default.errorMessage,
171
- style: this.getThemeErrorMessageStyle(this.props.theme)
172
- }, this.props.errorMessage ? this.props.errorMessage : ''));
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
+ }));
173
168
  }
174
169
  }
175
170
  }]);
@@ -4,29 +4,19 @@
4
4
  :local(.selectContainer) {
5
5
  position: relative;
6
6
 
7
- :local(.selectListArrow_old) {
8
- position: absolute;
9
- display: block;
10
- content: "";
11
- top: 14px;
12
- right: 14px;
13
- height: 0;
14
- width: 0;
15
- border-left: 6px solid transparent;
16
- border-right: 6px solid transparent;
17
- border-top: 12px solid $color-primary;
18
- pointer-events: none;
19
- }
20
-
21
7
  :local(.selectListArrow) {
22
8
  box-sizing: border-box;
23
9
  position: absolute;
24
- top: 20px;
25
- right: 20px;
10
+ top: 15px;
11
+ right: 15px;
26
12
  display: block;
27
13
  width: 12px;
28
14
  height: 12px;
29
15
  border-radius: 100px;
16
+ @media only screen and (min-width: $screen-sm) {
17
+ top: 20px;
18
+ right: 20px;
19
+ }
30
20
 
31
21
  &::after {
32
22
  content: "";
@@ -47,17 +37,21 @@
47
37
  @include transition(border-color 0.15s linear);
48
38
  @include appearance(none);
49
39
  @include box-shadow(none);
50
- height: 56px;
40
+ height: 47px;
51
41
  color: rgba(0, 0, 0, 0.75);
52
42
  width: 100%;
53
43
  font-family: inherit;
54
- font-size: 19px;
44
+ font-size: 16px;
55
45
  padding: 10px 40px 10px 10px;
56
46
  border: 1px solid #afaba8;
57
47
  border-radius: 0;
58
48
  line-height: normal;
59
49
  background: white;
60
50
  cursor: pointer;
51
+ @media only screen and (min-width: $screen-sm) {
52
+ font-size: 19px;
53
+ height: 56px;
54
+ }
61
55
 
62
56
  &:hover {
63
57
  border-color: $color-dark-blue;
@@ -89,13 +83,4 @@
89
83
  }
90
84
  }
91
85
  }
92
- :local(.errorMessage) {
93
- color: $color-error-text;
94
- font-size: 19px;
95
- font-weight: 400;
96
- line-height: 1.6;
97
- font-family: "Open Sans", sans-serif;
98
- font-style: italic;
99
- overflow-wrap: break-word;
100
- }
101
86
  }
@@ -13,6 +13,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
14
14
  var _Label = _interopRequireDefault(require("./Label"));
15
15
 
16
+ var _ErrorMessage = _interopRequireDefault(require("./ErrorMessage"));
17
+
16
18
  var _theme = require("../functions/theme");
17
19
 
18
20
  var _generators = require("../functions/generators");
@@ -66,13 +68,6 @@ var Textarea = /*#__PURE__*/function (_React$Component) {
66
68
  borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
67
69
  };
68
70
  }
69
- }, {
70
- key: "getThemeErrorMessageStyle",
71
- value: function getThemeErrorMessageStyle(theme) {
72
- return {
73
- color: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
74
- };
75
- }
76
71
  }, {
77
72
  key: "renderValueAsText",
78
73
  value: function renderValueAsText(value, defaultContent) {
@@ -111,10 +106,10 @@ var Textarea = /*#__PURE__*/function (_React$Component) {
111
106
  className: _TextareaModule.default.textarea
112
107
  }, /*#__PURE__*/_react.default.createElement(_Label.default, {
113
108
  htmlFor: this.props.id
114
- }, 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("span", {
115
- className: _TextareaModule.default.errorMessage,
116
- style: this.getThemeErrorMessageStyle(this.props.theme)
117
- }, this.props.errorMessage ? this.props.errorMessage : ''));
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
+ }));
118
113
  }
119
114
  }]);
120
115
 
@@ -19,9 +19,12 @@
19
19
  box-shadow: none;
20
20
  color: rgba(0, 0, 0, 0.75);
21
21
  font-family: inherit;
22
- font-size: 19px;
22
+ font-size: 16px;
23
23
  box-sizing: border-box;
24
24
  border: 1px solid #afaba8;
25
+ @media only screen and (min-width: $screen-sm) {
26
+ font-size: 19px;
27
+ }
25
28
 
26
29
  &:hover {
27
30
  border-color: $color-dark-blue;
@@ -52,13 +55,4 @@
52
55
  }
53
56
  }
54
57
  }
55
- :local(.errorMessage) {
56
- color: $color-error-text;
57
- font-size: 19px;
58
- font-weight: 400;
59
- line-height: 1.6;
60
- font-family: "Open Sans", sans-serif;
61
- font-style: italic;
62
- overflow-wrap: break-word;
63
- }
64
58
  }
package/dist/index.js CHANGED
@@ -51,6 +51,12 @@ Object.defineProperty(exports, "DragAndDropFileInput", {
51
51
  return _DragAndDropFileInput.default;
52
52
  }
53
53
  });
54
+ Object.defineProperty(exports, "ErrorMessage", {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _ErrorMessage.default;
58
+ }
59
+ });
54
60
  Object.defineProperty(exports, "Footer", {
55
61
  enumerable: true,
56
62
  get: function get() {
@@ -164,6 +170,8 @@ var _Dialog = _interopRequireDefault(require("./components/Dialog"));
164
170
 
165
171
  var _DragAndDropFileInput = _interopRequireDefault(require("./components/DragAndDropFileInput"));
166
172
 
173
+ var _ErrorMessage = _interopRequireDefault(require("./components/ErrorMessage"));
174
+
167
175
  var _Footer = _interopRequireDefault(require("./components/Footer"));
168
176
 
169
177
  var _Header = _interopRequireDefault(require("./components/Header"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dibk-design",
3
- "version": "0.4.43",
3
+ "version": "0.4.46",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -19,10 +19,11 @@
19
19
  "scripts": {
20
20
  "start": "react-scripts start",
21
21
  "build": "rm -rf dist && NODE_ENV=production babel src/lib --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,__snapshots__",
22
- "windows-build": "rm -rf dist && SET NODE_ENV=production&& babel src/lib --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,__snapshots__",
22
+ "windows-build": "rd /s dist && SET NODE_ENV=production&& babel src/lib --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,__snapshots__",
23
23
  "test": "react-scripts test",
24
24
  "eject": "react-scripts eject",
25
25
  "styleguide": "FAST_REFRESH=false styleguidist server",
26
+ "windows-styleguide": "SET FAST_REFRESH=false && styleguidist server",
26
27
  "styleguide:build": "styleguidist build"
27
28
  },
28
29
  "eslintConfig": {