dibk-design 0.4.45 → 0.4.48
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.
- package/LICENSE +674 -674
- package/README.md +3 -3
- package/dist/components/Accordion.md +15 -15
- package/dist/components/Accordion.module.scss +205 -205
- package/dist/components/Button.md +75 -75
- package/dist/components/Button.module.scss +232 -232
- package/dist/components/CheckBoxIcon.md +38 -38
- package/dist/components/CheckBoxIcon.module.scss +62 -62
- package/dist/components/CheckBoxInput.md +58 -58
- package/dist/components/CheckBoxInput.module.scss +24 -24
- package/dist/components/CheckBoxListItem.md +82 -82
- package/dist/components/CheckBoxListItem.module.scss +71 -71
- package/dist/components/Container.js +64 -0
- package/dist/components/Container.md +7 -0
- package/dist/components/Container.module.scss +10 -0
- package/dist/components/ContentBox.md +46 -46
- package/dist/components/ContentBox.module.scss +116 -116
- package/dist/components/Dialog.md +5 -5
- package/dist/components/Dialog.module.scss +78 -78
- package/dist/components/DragAndDropFileInput.js +8 -4
- package/dist/components/DragAndDropFileInput.md +13 -13
- package/dist/components/DragAndDropFileInput.module.scss +36 -45
- package/dist/components/ErrorMessage.js +80 -0
- package/dist/components/ErrorMessage.md +15 -0
- package/dist/components/ErrorMessage.module.scss +16 -0
- package/dist/components/Footer.js +3 -3
- package/dist/components/Footer.md +7 -7
- package/dist/components/Footer.module.scss +20 -11
- package/dist/components/Header.md +11 -11
- package/dist/components/Header.module.scss +64 -64
- package/dist/components/InputField.js +6 -11
- package/dist/components/InputField.md +41 -41
- package/dist/components/InputField.module.scss +81 -95
- package/dist/components/Label.md +9 -9
- package/dist/components/Label.module.scss +16 -16
- package/dist/components/List.md +10 -10
- package/dist/components/List.module.scss +18 -18
- package/dist/components/LoadingAnimation.md +5 -5
- package/dist/components/LoadingAnimation.module.scss +26 -26
- package/dist/components/NavigationBar.md +42 -42
- package/dist/components/NavigationBar.module.scss +176 -176
- package/dist/components/NavigationBarListItem.md +15 -15
- package/dist/components/Paper.md +9 -9
- package/dist/components/Paper.module.scss +18 -18
- package/dist/components/ProgressBar.js +31 -0
- package/dist/components/ProgressBar.md +13 -0
- package/dist/components/ProgressBar.module.scss +37 -0
- package/dist/components/RadioButtonIcon.js +101 -101
- package/dist/components/RadioButtonIcon.md +41 -41
- package/dist/components/RadioButtonIcon.module.scss +44 -44
- package/dist/components/RadioButtonInput.js +97 -97
- package/dist/components/RadioButtonInput.md +32 -32
- package/dist/components/RadioButtonInput.module.scss +26 -26
- package/dist/components/RadioButtonListItem.md +70 -70
- package/dist/components/RadioButtonListItem.module.scss +71 -71
- package/dist/components/Select.js +6 -11
- package/dist/components/Select.md +28 -28
- package/dist/components/Select.module.scss +86 -100
- package/dist/components/Textarea.js +6 -11
- package/dist/components/Textarea.md +27 -27
- package/dist/components/Textarea.module.scss +58 -72
- package/dist/components/Theme.md +12 -12
- package/dist/components/Theme.module.scss +76 -76
- package/dist/components/WizardNavigation/Step.module.scss +75 -75
- package/dist/components/WizardNavigation.md +84 -84
- package/dist/components/WizardNavigation.module.scss +3 -3
- package/dist/fonts/Altis-Light.svg +326 -326
- package/dist/fonts/open-sans-v27-latin-ext_latin-300.svg +346 -346
- package/dist/fonts/open-sans-v27-latin-ext_latin-300italic.svg +377 -377
- package/dist/fonts/open-sans-v27-latin-ext_latin-700.svg +349 -349
- package/dist/fonts/open-sans-v27-latin-ext_latin-700italic.svg +379 -379
- package/dist/fonts/open-sans-v27-latin-ext_latin-italic.svg +379 -379
- package/dist/fonts/open-sans-v27-latin-ext_latin-regular.svg +349 -349
- package/dist/images/dibk-logo-mobile.svg +91 -91
- package/dist/images/dibk-logo.svg +991 -991
- package/dist/images/spinner.svg +56 -56
- package/dist/index.js +24 -0
- package/dist/style/abstracts/_all.scss +1 -1
- package/dist/style/abstracts/mixins/_all.scss +12 -12
- package/dist/style/abstracts/mixins/_animation.scss +6 -6
- package/dist/style/abstracts/mixins/_appearance.scss +5 -5
- package/dist/style/abstracts/mixins/_border-radius.scss +31 -31
- package/dist/style/abstracts/mixins/_box-shadow.scss +5 -5
- package/dist/style/abstracts/mixins/_box-sizing.scss +5 -5
- package/dist/style/abstracts/mixins/_calc.scss +5 -5
- package/dist/style/abstracts/mixins/_keyframes.scss +14 -14
- package/dist/style/abstracts/mixins/_opacity.scss +5 -5
- package/dist/style/abstracts/mixins/_placeholder.scss +17 -17
- package/dist/style/abstracts/mixins/_scrollbar.scss +26 -26
- package/dist/style/abstracts/mixins/_transform.scss +6 -6
- package/dist/style/abstracts/mixins/_transition.scss +34 -34
- package/dist/style/abstracts/variables/_all.scss +2 -2
- package/dist/style/abstracts/variables/_colors.scss +28 -29
- package/dist/style/abstracts/variables/_typography.scss +1 -1
- package/dist/style/abstracts/variables/_viewports.scss +14 -14
- package/dist/style/base/_all.scss +1 -1
- package/dist/style/base/_reset.scss +15 -15
- package/dist/style/base/_typography.scss +6 -6
- package/dist/style/base/fonts.css +95 -95
- package/dist/style/global.scss +3 -3
- package/dist/style/layout/_containers.scss +9 -9
- package/package.json +43 -43
|
@@ -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;
|
|
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
|
+
}
|
|
@@ -9,6 +9,8 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
+
var _Container = _interopRequireDefault(require("./Container"));
|
|
13
|
+
|
|
12
14
|
var _FooterModule = _interopRequireDefault(require("./Footer.module.scss"));
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -49,9 +51,7 @@ var Footer = /*#__PURE__*/function (_React$Component) {
|
|
|
49
51
|
value: function render() {
|
|
50
52
|
return /*#__PURE__*/_react.default.createElement("footer", {
|
|
51
53
|
className: _FooterModule.default.footer
|
|
52
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
53
|
-
className: _FooterModule.default.footerContainer
|
|
54
|
-
}, this.props.children));
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_Container.default, null, this.props.children));
|
|
55
55
|
}
|
|
56
56
|
}]);
|
|
57
57
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Footer example:
|
|
2
|
-
|
|
3
|
-
```js
|
|
4
|
-
<Footer>
|
|
5
|
-
Footer content here
|
|
6
|
-
</Footer>
|
|
7
|
-
```
|
|
1
|
+
Footer example:
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
<Footer>
|
|
5
|
+
Footer content here
|
|
6
|
+
</Footer>
|
|
7
|
+
```
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
@import "../style/global.scss";
|
|
2
|
-
|
|
3
|
-
:local(.footer) {
|
|
4
|
-
background-color: $color-
|
|
5
|
-
padding
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
@import "../style/global.scss";
|
|
2
|
+
|
|
3
|
+
:local(.footer) {
|
|
4
|
+
background-color: $color-primary;
|
|
5
|
+
padding: 16px 0;
|
|
6
|
+
text-align: right;
|
|
7
|
+
* {
|
|
8
|
+
color: #fff;
|
|
9
|
+
}
|
|
10
|
+
a,
|
|
11
|
+
.link {
|
|
12
|
+
color: #fff;
|
|
13
|
+
text-decoration: underline;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
display: block;
|
|
16
|
+
&:hover {
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
Title examples:
|
|
2
|
-
|
|
3
|
-
```js
|
|
4
|
-
<Header content="Title with size 1"/>
|
|
5
|
-
<Header content="Title with size 2" size={2}/>
|
|
6
|
-
<Header content="Title with size 3" size={3}/>
|
|
7
|
-
<Header content="Title with size 4" size={4}/>
|
|
8
|
-
<Header content="Big title with size 1" big/>
|
|
9
|
-
<Header content="Title with size 2 and htmlTag h1" size={2} htmlTag="h1"/>
|
|
10
|
-
|
|
11
|
-
```
|
|
1
|
+
Title examples:
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
<Header content="Title with size 1"/>
|
|
5
|
+
<Header content="Title with size 2" size={2}/>
|
|
6
|
+
<Header content="Title with size 3" size={3}/>
|
|
7
|
+
<Header content="Title with size 4" size={4}/>
|
|
8
|
+
<Header content="Big title with size 1" big/>
|
|
9
|
+
<Header content="Title with size 2 and htmlTag h1" size={2} htmlTag="h1"/>
|
|
10
|
+
|
|
11
|
+
```
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
@import "../style/global.scss";
|
|
2
|
-
|
|
3
|
-
:local(.headerContainer) {
|
|
4
|
-
padding: 5px 0;
|
|
5
|
-
:local(.header) {
|
|
6
|
-
margin: 0;
|
|
7
|
-
font-weight: normal;
|
|
8
|
-
line-height: 1.4;
|
|
9
|
-
font-style: normal;
|
|
10
|
-
&:not(:local(.hasTheme)) {
|
|
11
|
-
color: $color-primary;
|
|
12
|
-
}
|
|
13
|
-
&:local(.size-1) {
|
|
14
|
-
font-family: "Altis", sans-serif;
|
|
15
|
-
font-size: 32px;
|
|
16
|
-
font-style: normal;
|
|
17
|
-
font-weight: 500;
|
|
18
|
-
line-height: 1.43;
|
|
19
|
-
@media only screen and (min-width: $screen-sm) {
|
|
20
|
-
font-size: 38px;
|
|
21
|
-
}
|
|
22
|
-
&:local(.bigHeader) {
|
|
23
|
-
font-family: "Altis-Light", "Open Sans", arial, sans-serif;
|
|
24
|
-
font-size: 40px;
|
|
25
|
-
line-height: 1.2;
|
|
26
|
-
overflow: hidden;
|
|
27
|
-
text-overflow: ellipsis;
|
|
28
|
-
@media only screen and (min-width: $screen-sm) {
|
|
29
|
-
font-size: 50px;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
&:local(.size-2) {
|
|
34
|
-
font-family: "Altis", sans-serif;
|
|
35
|
-
font-size: 25px;
|
|
36
|
-
font-style: normal;
|
|
37
|
-
font-weight: 500;
|
|
38
|
-
line-height: 1.42;
|
|
39
|
-
@media only screen and (min-width: $screen-sm) {
|
|
40
|
-
font-size: 30px;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
&:local(.size-3) {
|
|
44
|
-
font-family: "Open Sans", arial, sans-serif;
|
|
45
|
-
font-size: 19px;
|
|
46
|
-
font-style: normal;
|
|
47
|
-
font-weight: bold;
|
|
48
|
-
line-height: 1;
|
|
49
|
-
@media only screen and (min-width: $screen-sm) {
|
|
50
|
-
font-size: 22px;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
&:local(.size-4) {
|
|
54
|
-
font-family: "Open Sans", arial, sans-serif;
|
|
55
|
-
font-size: 17px;
|
|
56
|
-
font-style: italic;
|
|
57
|
-
font-weight: normal;
|
|
58
|
-
line-height: 1;
|
|
59
|
-
@media only screen and (min-width: $screen-sm) {
|
|
60
|
-
font-size: 21px;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
1
|
+
@import "../style/global.scss";
|
|
2
|
+
|
|
3
|
+
:local(.headerContainer) {
|
|
4
|
+
padding: 5px 0;
|
|
5
|
+
:local(.header) {
|
|
6
|
+
margin: 0;
|
|
7
|
+
font-weight: normal;
|
|
8
|
+
line-height: 1.4;
|
|
9
|
+
font-style: normal;
|
|
10
|
+
&:not(:local(.hasTheme)) {
|
|
11
|
+
color: $color-primary;
|
|
12
|
+
}
|
|
13
|
+
&:local(.size-1) {
|
|
14
|
+
font-family: "Altis", sans-serif;
|
|
15
|
+
font-size: 32px;
|
|
16
|
+
font-style: normal;
|
|
17
|
+
font-weight: 500;
|
|
18
|
+
line-height: 1.43;
|
|
19
|
+
@media only screen and (min-width: $screen-sm) {
|
|
20
|
+
font-size: 38px;
|
|
21
|
+
}
|
|
22
|
+
&:local(.bigHeader) {
|
|
23
|
+
font-family: "Altis-Light", "Open Sans", arial, sans-serif;
|
|
24
|
+
font-size: 40px;
|
|
25
|
+
line-height: 1.2;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
text-overflow: ellipsis;
|
|
28
|
+
@media only screen and (min-width: $screen-sm) {
|
|
29
|
+
font-size: 50px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
&:local(.size-2) {
|
|
34
|
+
font-family: "Altis", sans-serif;
|
|
35
|
+
font-size: 25px;
|
|
36
|
+
font-style: normal;
|
|
37
|
+
font-weight: 500;
|
|
38
|
+
line-height: 1.42;
|
|
39
|
+
@media only screen and (min-width: $screen-sm) {
|
|
40
|
+
font-size: 30px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
&:local(.size-3) {
|
|
44
|
+
font-family: "Open Sans", arial, sans-serif;
|
|
45
|
+
font-size: 19px;
|
|
46
|
+
font-style: normal;
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
line-height: 1;
|
|
49
|
+
@media only screen and (min-width: $screen-sm) {
|
|
50
|
+
font-size: 22px;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
&:local(.size-4) {
|
|
54
|
+
font-family: "Open Sans", arial, sans-serif;
|
|
55
|
+
font-size: 17px;
|
|
56
|
+
font-style: italic;
|
|
57
|
+
font-weight: normal;
|
|
58
|
+
line-height: 1;
|
|
59
|
+
@media only screen and (min-width: $screen-sm) {
|
|
60
|
+
font-size: 21px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -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(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
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,41 +1,41 @@
|
|
|
1
|
-
Input field example:
|
|
2
|
-
|
|
3
|
-
```js
|
|
4
|
-
<InputField id="textInput1" onChange={()=>{console.log('onchange')}} mandatory={true} />
|
|
5
|
-
<InputField id="textInput2" onChange={()=>{console.log('onchange')}} value="InputField with value" />
|
|
6
|
-
<InputField id="textInput3" onChange={()=>{console.log('onchange')}} defaultValue="InputField with defaultValue" />
|
|
7
|
-
<InputField id="textInput4" onChange={()=>{console.log('onchange')}} value="InputField with label and value" label="InputField with label and value" />
|
|
8
|
-
<InputField id="textInput5" onChange={()=>{console.log('onchange')}} value="InputField with link in label" label={['InputField with ', <a key="labelLink" href="#">link</a>, ' in label']} />
|
|
9
|
-
<InputField id="textInput6" onChange={()=>{console.log('onchange')}} value="InputField with label, value, errors and error message" label="InputField with label, value, errors and error message" hasErrors={true} errorMessage="Wrong value" />
|
|
10
|
-
|
|
11
|
-
<InputField id="textInput7" onChange={()=>{console.log('onchange')}} readOnly value="Read only InputField with label and value" label="Read only InputField with label and value" />
|
|
12
|
-
<InputField id="textInput8" onChange={()=>{console.log('onchange')}} disabled value="Disabled InputField with label and value" label="Disabled InputField with label and value" />
|
|
13
|
-
<InputField id="numberInput1" onChange={()=>{console.log('onchange')}} value="3" label="Number InputField with label and value" type="number" />
|
|
14
|
-
<InputField id="textInput9" onChange={()=>{console.log('onchange')}} value="Value for inputField" label="InputField with label, value and contentOnly set to true" contentOnly={true} />
|
|
15
|
-
<InputField id="textInput10" onChange={() => {console.log('onChange')}} label="InputField without value, contentOnly set to true and defaultContent" contentOnly={true} defaultContent="Please insert a value" />
|
|
16
|
-
<InputField id="fileInput1" onChange={()=>{console.log('onchange')}} type="file" label="InputField with label, value and type set to file" />
|
|
17
|
-
<InputField id="fileInput1" onChange={()=>{console.log('onchange')}} type="file" label="InputField with label, value, fileName, buttonContent and type set to file" selectedFileName="file.txt" buttonContent="Legg til fil" />
|
|
18
|
-
<InputField id="dateInput1" onChange={(date) => console.log("date", date)} type="date" label="Datepicker without value" value="" />
|
|
19
|
-
<InputField id="dateInput2" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value" value="2020-05-10T13:12:04" />
|
|
20
|
-
<InputField id="dateInput3" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value, errors and error message" value="2020-05-10T13:12:04" hasErrors={true} errorMessage="Wrong date value" />
|
|
21
|
-
<InputField id="dateInput4" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value and contentOnly set to true" value="2020-05-10T13:12:04" contentOnly={true} />
|
|
22
|
-
<InputField id="dateInput5" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value for start date" value="2020-05-10T13:12:04" selectsStart startDate="2020-05-10T13:12:04" endDate="2020-05-19T13:12:04" />
|
|
23
|
-
<InputField id="dateInput6" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value for end date" value="2020-05-19T13:12:04" selectsEnd startDate="2020-05-10T13:12:04" endDate="2020-05-19T13:12:04" />
|
|
24
|
-
<InputField id="dateInput7" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with defaultContent and contentOnly set to true" contentOnly={true} defaultContent="Please insert a value" />
|
|
25
|
-
<InputField id="textInput9" value="InputField with value and custom width" width="400px" />
|
|
26
|
-
<InputField id="textInput10" value="InputField with a not auto generated key" elementKey="inputKeyHere" />
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Themed Input field example:
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
import customTheme from 'data/customTheme';
|
|
33
|
-
<React.Fragment>
|
|
34
|
-
<InputField id="themedTextInput4" onChange={()=>{console.log('onchange')}} value="InputField with link in label" label={['InputField with ', <a key="labelLink" href="#">link</a>, ' in label']} theme={customTheme} />
|
|
35
|
-
<InputField id="themedTextInput5" onChange={()=>{console.log('onchange')}} value="InputField with label, value, errors and error message" label="InputField with label, value, errors and error message" hasErrors={true} errorMessage="Wrong value" theme={customTheme} />
|
|
36
|
-
<InputField id="themedFileInput1" onChange={()=>{console.log('onchange')}} type="file" label="InputField with label, value, fileName, buttonContent and type set to file" selectedFileName="file.txt" buttonContent="Legg til fil" theme={customTheme} />
|
|
37
|
-
<InputField id="themedDateInput3" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value, errors and error message" value="2020-05-10T13:12:04" hasErrors={true} errorMessage="Wrong date value" theme={customTheme} />
|
|
38
|
-
<InputField id="themedDateInput4" value="InputField with value, error and custom width" width="420px" hasErrors={true} theme={customTheme} errorMessage="Wrong value" />
|
|
39
|
-
|
|
40
|
-
</React.Fragment>
|
|
41
|
-
```
|
|
1
|
+
Input field example:
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
<InputField id="textInput1" onChange={()=>{console.log('onchange')}} mandatory={true} />
|
|
5
|
+
<InputField id="textInput2" onChange={()=>{console.log('onchange')}} value="InputField with value" />
|
|
6
|
+
<InputField id="textInput3" onChange={()=>{console.log('onchange')}} defaultValue="InputField with defaultValue" />
|
|
7
|
+
<InputField id="textInput4" onChange={()=>{console.log('onchange')}} value="InputField with label and value" label="InputField with label and value" />
|
|
8
|
+
<InputField id="textInput5" onChange={()=>{console.log('onchange')}} value="InputField with link in label" label={['InputField with ', <a key="labelLink" href="#">link</a>, ' in label']} />
|
|
9
|
+
<InputField id="textInput6" onChange={()=>{console.log('onchange')}} value="InputField with label, value, errors and error message" label="InputField with label, value, errors and error message" hasErrors={true} errorMessage="Wrong value" />
|
|
10
|
+
|
|
11
|
+
<InputField id="textInput7" onChange={()=>{console.log('onchange')}} readOnly value="Read only InputField with label and value" label="Read only InputField with label and value" />
|
|
12
|
+
<InputField id="textInput8" onChange={()=>{console.log('onchange')}} disabled value="Disabled InputField with label and value" label="Disabled InputField with label and value" />
|
|
13
|
+
<InputField id="numberInput1" onChange={()=>{console.log('onchange')}} value="3" label="Number InputField with label and value" type="number" />
|
|
14
|
+
<InputField id="textInput9" onChange={()=>{console.log('onchange')}} value="Value for inputField" label="InputField with label, value and contentOnly set to true" contentOnly={true} />
|
|
15
|
+
<InputField id="textInput10" onChange={() => {console.log('onChange')}} label="InputField without value, contentOnly set to true and defaultContent" contentOnly={true} defaultContent="Please insert a value" />
|
|
16
|
+
<InputField id="fileInput1" onChange={()=>{console.log('onchange')}} type="file" label="InputField with label, value and type set to file" />
|
|
17
|
+
<InputField id="fileInput1" onChange={()=>{console.log('onchange')}} type="file" label="InputField with label, value, fileName, buttonContent and type set to file" selectedFileName="file.txt" buttonContent="Legg til fil" />
|
|
18
|
+
<InputField id="dateInput1" onChange={(date) => console.log("date", date)} type="date" label="Datepicker without value" value="" />
|
|
19
|
+
<InputField id="dateInput2" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value" value="2020-05-10T13:12:04" />
|
|
20
|
+
<InputField id="dateInput3" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value, errors and error message" value="2020-05-10T13:12:04" hasErrors={true} errorMessage="Wrong date value" />
|
|
21
|
+
<InputField id="dateInput4" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value and contentOnly set to true" value="2020-05-10T13:12:04" contentOnly={true} />
|
|
22
|
+
<InputField id="dateInput5" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value for start date" value="2020-05-10T13:12:04" selectsStart startDate="2020-05-10T13:12:04" endDate="2020-05-19T13:12:04" />
|
|
23
|
+
<InputField id="dateInput6" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value for end date" value="2020-05-19T13:12:04" selectsEnd startDate="2020-05-10T13:12:04" endDate="2020-05-19T13:12:04" />
|
|
24
|
+
<InputField id="dateInput7" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with defaultContent and contentOnly set to true" contentOnly={true} defaultContent="Please insert a value" />
|
|
25
|
+
<InputField id="textInput9" value="InputField with value and custom width" width="400px" />
|
|
26
|
+
<InputField id="textInput10" value="InputField with a not auto generated key" elementKey="inputKeyHere" />
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Themed Input field example:
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import customTheme from 'data/customTheme';
|
|
33
|
+
<React.Fragment>
|
|
34
|
+
<InputField id="themedTextInput4" onChange={()=>{console.log('onchange')}} value="InputField with link in label" label={['InputField with ', <a key="labelLink" href="#">link</a>, ' in label']} theme={customTheme} />
|
|
35
|
+
<InputField id="themedTextInput5" onChange={()=>{console.log('onchange')}} value="InputField with label, value, errors and error message" label="InputField with label, value, errors and error message" hasErrors={true} errorMessage="Wrong value" theme={customTheme} />
|
|
36
|
+
<InputField id="themedFileInput1" onChange={()=>{console.log('onchange')}} type="file" label="InputField with label, value, fileName, buttonContent and type set to file" selectedFileName="file.txt" buttonContent="Legg til fil" theme={customTheme} />
|
|
37
|
+
<InputField id="themedDateInput3" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value, errors and error message" value="2020-05-10T13:12:04" hasErrors={true} errorMessage="Wrong date value" theme={customTheme} />
|
|
38
|
+
<InputField id="themedDateInput4" value="InputField with value, error and custom width" width="420px" hasErrors={true} theme={customTheme} errorMessage="Wrong value" />
|
|
39
|
+
|
|
40
|
+
</React.Fragment>
|
|
41
|
+
```
|
|
@@ -1,95 +1,81 @@
|
|
|
1
|
-
@import "../style/global.scss";
|
|
2
|
-
|
|
3
|
-
:local(.inputField) {
|
|
4
|
-
font-size: 16px;
|
|
5
|
-
@media only screen and (min-width: $screen-sm) {
|
|
6
|
-
font-size: 19px;
|
|
7
|
-
}
|
|
8
|
-
> div {
|
|
9
|
-
display: block;
|
|
10
|
-
}
|
|
11
|
-
input,
|
|
12
|
-
&:local(.file) :local(span.input) {
|
|
13
|
-
@include appearance(none);
|
|
14
|
-
@include transition(border-color 0.15s linear, background 0.15s linear);
|
|
15
|
-
@include border-radius(0);
|
|
16
|
-
@include box-shadow(none);
|
|
17
|
-
height: 47px;
|
|
18
|
-
width: 100%;
|
|
19
|
-
display: block;
|
|
20
|
-
padding: 10px;
|
|
21
|
-
margin-bottom: 0;
|
|
22
|
-
font-weight: 300;
|
|
23
|
-
background-color: #fff;
|
|
24
|
-
box-shadow: none;
|
|
25
|
-
color: rgba(0, 0, 0, 0.75);
|
|
26
|
-
font-family: inherit;
|
|
27
|
-
font-size: 16px;
|
|
28
|
-
box-sizing: border-box;
|
|
29
|
-
border: 1px solid #afaba8;
|
|
30
|
-
@media only screen and (min-width: $screen-sm) {
|
|
31
|
-
font-size: 19px;
|
|
32
|
-
height: 56px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&:hover {
|
|
36
|
-
border-color: $color-dark-blue;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&:focus {
|
|
40
|
-
border-color: $color-dark-blue;
|
|
41
|
-
outline-color: #54acb8;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&[disabled],
|
|
45
|
-
&[readonly] {
|
|
46
|
-
background-color: #ddd;
|
|
47
|
-
cursor: default;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&:local(.hasErrors) {
|
|
51
|
-
border-color: $color-error;
|
|
52
|
-
&:focus {
|
|
53
|
-
border-color: $color-error;
|
|
54
|
-
outline-color: #b8565d;
|
|
55
|
-
}
|
|
56
|
-
&[disabled],
|
|
57
|
-
&[readonly] {
|
|
58
|
-
background-color: #ddd;
|
|
59
|
-
cursor: default;
|
|
60
|
-
border-color: #afaba8;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
&:local(.file) {
|
|
65
|
-
label {
|
|
66
|
-
:local(.fileInputContainer) {
|
|
67
|
-
display: flex;
|
|
68
|
-
align-items: center;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
input {
|
|
72
|
-
display: none;
|
|
73
|
-
}
|
|
74
|
-
:local(span.input) {
|
|
75
|
-
flex: 1;
|
|
76
|
-
}
|
|
77
|
-
button {
|
|
78
|
-
margin: 0 8px;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
display: block;
|
|
83
|
-
color: $color-error-text;
|
|
84
|
-
font-size: 16px;
|
|
85
|
-
font-weight: 400;
|
|
86
|
-
line-height: 1.2;
|
|
87
|
-
margin: 4px 0;
|
|
88
|
-
font-family: "Open Sans", sans-serif;
|
|
89
|
-
font-style: italic;
|
|
90
|
-
overflow-wrap: break-word;
|
|
91
|
-
@media only screen and (min-width: $screen-sm) {
|
|
92
|
-
font-size: 19px;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
1
|
+
@import "../style/global.scss";
|
|
2
|
+
|
|
3
|
+
:local(.inputField) {
|
|
4
|
+
font-size: 16px;
|
|
5
|
+
@media only screen and (min-width: $screen-sm) {
|
|
6
|
+
font-size: 19px;
|
|
7
|
+
}
|
|
8
|
+
> div {
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
input,
|
|
12
|
+
&:local(.file) :local(span.input) {
|
|
13
|
+
@include appearance(none);
|
|
14
|
+
@include transition(border-color 0.15s linear, background 0.15s linear);
|
|
15
|
+
@include border-radius(0);
|
|
16
|
+
@include box-shadow(none);
|
|
17
|
+
height: 47px;
|
|
18
|
+
width: 100%;
|
|
19
|
+
display: block;
|
|
20
|
+
padding: 10px;
|
|
21
|
+
margin-bottom: 0;
|
|
22
|
+
font-weight: 300;
|
|
23
|
+
background-color: #fff;
|
|
24
|
+
box-shadow: none;
|
|
25
|
+
color: rgba(0, 0, 0, 0.75);
|
|
26
|
+
font-family: inherit;
|
|
27
|
+
font-size: 16px;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
border: 1px solid #afaba8;
|
|
30
|
+
@media only screen and (min-width: $screen-sm) {
|
|
31
|
+
font-size: 19px;
|
|
32
|
+
height: 56px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:hover {
|
|
36
|
+
border-color: $color-dark-blue;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:focus {
|
|
40
|
+
border-color: $color-dark-blue;
|
|
41
|
+
outline-color: #54acb8;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&[disabled],
|
|
45
|
+
&[readonly] {
|
|
46
|
+
background-color: #ddd;
|
|
47
|
+
cursor: default;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:local(.hasErrors) {
|
|
51
|
+
border-color: $color-error;
|
|
52
|
+
&:focus {
|
|
53
|
+
border-color: $color-error;
|
|
54
|
+
outline-color: #b8565d;
|
|
55
|
+
}
|
|
56
|
+
&[disabled],
|
|
57
|
+
&[readonly] {
|
|
58
|
+
background-color: #ddd;
|
|
59
|
+
cursor: default;
|
|
60
|
+
border-color: #afaba8;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
&:local(.file) {
|
|
65
|
+
label {
|
|
66
|
+
:local(.fileInputContainer) {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
input {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
74
|
+
:local(span.input) {
|
|
75
|
+
flex: 1;
|
|
76
|
+
}
|
|
77
|
+
button {
|
|
78
|
+
margin: 0 8px;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|