dibk-design 0.3.24
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 -0
- package/README.md +3 -0
- package/dist/components/Accordion.js +120 -0
- package/dist/components/Accordion.md +15 -0
- package/dist/components/Accordion.module.scss +180 -0
- package/dist/components/Button.js +104 -0
- package/dist/components/Button.md +48 -0
- package/dist/components/Button.module.scss +141 -0
- package/dist/components/CheckBoxIcon.js +97 -0
- package/dist/components/CheckBoxIcon.md +23 -0
- package/dist/components/CheckBoxIcon.module.scss +39 -0
- package/dist/components/CheckBoxInput.js +91 -0
- package/dist/components/CheckBoxInput.md +39 -0
- package/dist/components/CheckBoxInput.module.scss +18 -0
- package/dist/components/CheckBoxListItem.js +85 -0
- package/dist/components/CheckBoxListItem.md +35 -0
- package/dist/components/CheckBoxListItem.module.scss +59 -0
- package/dist/components/ContentBox.js +106 -0
- package/dist/components/ContentBox.md +46 -0
- package/dist/components/ContentBox.module.scss +105 -0
- package/dist/components/DragAndDropFileInput.js +196 -0
- package/dist/components/DragAndDropFileInput.md +7 -0
- package/dist/components/DragAndDropFileInput.module.scss +36 -0
- package/dist/components/Footer.js +62 -0
- package/dist/components/Footer.md +7 -0
- package/dist/components/Footer.module.scss +11 -0
- package/dist/components/Header.js +75 -0
- package/dist/components/Header.md +7 -0
- package/dist/components/Header.module.scss +30 -0
- package/dist/components/InputField.js +201 -0
- package/dist/components/InputField.md +36 -0
- package/dist/components/InputField.module.scss +91 -0
- package/dist/components/List.js +106 -0
- package/dist/components/List.md +10 -0
- package/dist/components/List.module.scss +19 -0
- package/dist/components/LoadingAnimation.js +74 -0
- package/dist/components/LoadingAnimation.md +5 -0
- package/dist/components/LoadingAnimation.module.scss +26 -0
- package/dist/components/NavigationBar.js +229 -0
- package/dist/components/NavigationBar.md +31 -0
- package/dist/components/NavigationBar.module.scss +176 -0
- package/dist/components/NavigationBarListItem.js +85 -0
- package/dist/components/NavigationBarListItem.md +16 -0
- package/dist/components/Paper.js +71 -0
- package/dist/components/Paper.md +9 -0
- package/dist/components/Paper.module.scss +17 -0
- package/dist/components/RadioButtonIcon.js +92 -0
- package/dist/components/RadioButtonIcon.md +23 -0
- package/dist/components/RadioButtonIcon.module.scss +21 -0
- package/dist/components/RadioButtonInput.js +89 -0
- package/dist/components/RadioButtonInput.md +22 -0
- package/dist/components/RadioButtonInput.module.scss +15 -0
- package/dist/components/RadioButtonListItem.js +86 -0
- package/dist/components/RadioButtonListItem.md +24 -0
- package/dist/components/RadioButtonListItem.module.scss +59 -0
- package/dist/components/Select.js +188 -0
- package/dist/components/Select.md +26 -0
- package/dist/components/Select.module.scss +84 -0
- package/dist/components/Theme.js +131 -0
- package/dist/components/Theme.md +12 -0
- package/dist/components/Theme.module.scss +76 -0
- package/dist/components/WizardNavigation/Step.js +104 -0
- package/dist/components/WizardNavigation/Step.module.scss +75 -0
- package/dist/components/WizardNavigation.js +95 -0
- package/dist/components/WizardNavigation.md +84 -0
- package/dist/components/WizardNavigation.module.scss +4 -0
- package/dist/fonts/Altis-Light.eot +0 -0
- package/dist/fonts/Altis-Light.svg +326 -0
- package/dist/fonts/Altis-Light.ttf +0 -0
- package/dist/fonts/Altis-Light.woff +0 -0
- package/dist/functions/theme.js +60 -0
- package/dist/images/dibk-logo-mobile.svg +91 -0
- package/dist/images/dibk-logo.svg +991 -0
- package/dist/images/spinner.svg +57 -0
- package/dist/index.js +185 -0
- package/dist/style/abstracts/_all.scss +2 -0
- package/dist/style/abstracts/mixins/_all.scss +12 -0
- package/dist/style/abstracts/mixins/_animation.scss +6 -0
- package/dist/style/abstracts/mixins/_appearance.scss +5 -0
- package/dist/style/abstracts/mixins/_border-radius.scss +31 -0
- package/dist/style/abstracts/mixins/_box-shadow.scss +5 -0
- package/dist/style/abstracts/mixins/_box-sizing.scss +5 -0
- package/dist/style/abstracts/mixins/_calc.scss +5 -0
- package/dist/style/abstracts/mixins/_keyframes.scss +14 -0
- package/dist/style/abstracts/mixins/_opacity.scss +5 -0
- package/dist/style/abstracts/mixins/_placeholder.scss +17 -0
- package/dist/style/abstracts/mixins/_scrollbar.scss +26 -0
- package/dist/style/abstracts/mixins/_transform.scss +6 -0
- package/dist/style/abstracts/mixins/_transition.scss +34 -0
- package/dist/style/abstracts/variables/_all.scss +3 -0
- package/dist/style/abstracts/variables/_colors.scss +35 -0
- package/dist/style/abstracts/variables/_typography.scss +1 -0
- package/dist/style/abstracts/variables/_viewports.scss +11 -0
- package/dist/style/base/_all.scss +2 -0
- package/dist/style/base/_reset.scss +15 -0
- package/dist/style/base/_typography.scss +6 -0
- package/dist/style/base/fonts.css +6 -0
- package/dist/style/global.scss +3 -0
- package/dist/style/layout/_all.scss +1 -0
- package/dist/style/layout/_containers.scss +9 -0
- package/package.json +43 -0
|
@@ -0,0 +1,36 @@
|
|
|
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')}} value="InputField with label and value" label="InputField with label and value" />
|
|
7
|
+
<InputField id="textInput4" onChange={()=>{console.log('onchange')}} value="InputField with link in label" label={['InputField with ', <a key="labelLink" href="#">link</a>, ' in label']} />
|
|
8
|
+
<InputField id="textInput5" 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" />
|
|
9
|
+
|
|
10
|
+
<InputField id="textInput6" onChange={()=>{console.log('onchange')}} readOnly value="Read only InputField with label and value" label="Read only InputField with label and value" />
|
|
11
|
+
<InputField id="textInput7" onChange={()=>{console.log('onchange')}} disabled value="Disabled InputField with label and value" label="Disabled InputField with label and value" />
|
|
12
|
+
<InputField id="numberInput1" onChange={()=>{console.log('onchange')}} value="3" label="Number InputField with label and value" type="number" />
|
|
13
|
+
<InputField id="textInput7" onChange={()=>{console.log('onchange')}} value="Value for inputField" label="InputField with label, value and contentOnly set to true" contentOnly={true} />
|
|
14
|
+
<InputField id="textInput8" onChange={() => {console.log('onChange')}} label="InputField without value, contentOnly set to true and defaultContent" contentOnly={true} defaultContent="Please insert a value" />
|
|
15
|
+
<InputField id="fileInput1" onChange={()=>{console.log('onchange')}} type="file" label="InputField with label, value and type set to file" />
|
|
16
|
+
<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" />
|
|
17
|
+
<InputField id="dateInput1" onChange={(date) => console.log("date", date)} type="date" label="Datepicker without value" value="" />
|
|
18
|
+
<InputField id="dateInput2" onChange={(date) => console.log("date", date)} type="date" label="Datepicker with value" value="2020-05-10T13:12:04" />
|
|
19
|
+
<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" />
|
|
20
|
+
<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} />
|
|
21
|
+
<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" />
|
|
22
|
+
<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" />
|
|
23
|
+
<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" />
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Themed Input field example:
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import customTheme from 'data/customTheme';
|
|
30
|
+
<React.Fragment>
|
|
31
|
+
<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} />
|
|
32
|
+
<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} />
|
|
33
|
+
<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} />
|
|
34
|
+
<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} />
|
|
35
|
+
</React.Fragment>
|
|
36
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
@import "../style/global.scss";
|
|
2
|
+
|
|
3
|
+
:local(.inputField) {
|
|
4
|
+
> div {
|
|
5
|
+
display: block;
|
|
6
|
+
}
|
|
7
|
+
label {
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
font-size: 18px;
|
|
10
|
+
margin: 0 0 4px;
|
|
11
|
+
font-family: "Open Sans", arial, sans-serif;
|
|
12
|
+
line-height: 1.3;
|
|
13
|
+
font-weight: bold;
|
|
14
|
+
font-style: normal;
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
input,
|
|
19
|
+
&:local(.file) :local(span.input) {
|
|
20
|
+
@include appearance(none);
|
|
21
|
+
@include transition(border-color 0.15s linear, background 0.15s linear);
|
|
22
|
+
@include border-radius(0);
|
|
23
|
+
@include box-shadow(none);
|
|
24
|
+
height: 46px;
|
|
25
|
+
width: 100%;
|
|
26
|
+
display: block;
|
|
27
|
+
padding: 10px;
|
|
28
|
+
margin-bottom: 0;
|
|
29
|
+
font-weight: 300;
|
|
30
|
+
background-color: #fff;
|
|
31
|
+
box-shadow: none;
|
|
32
|
+
color: rgba(0, 0, 0, 0.75);
|
|
33
|
+
font-family: inherit;
|
|
34
|
+
font-size: 1.125rem;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
min-width: 40%;
|
|
37
|
+
border: 1px solid #afaba8;
|
|
38
|
+
|
|
39
|
+
&:hover {
|
|
40
|
+
border-color: $color-dark-blue;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:focus {
|
|
44
|
+
border-color: $color-dark-blue;
|
|
45
|
+
outline-color: #54acb8;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&[disabled],
|
|
49
|
+
&[readonly] {
|
|
50
|
+
background-color: #ddd;
|
|
51
|
+
cursor: default;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:local(.hasErrors) {
|
|
55
|
+
border-color: $color-warning;
|
|
56
|
+
@include box-shadow(0 0 3px $color-warning);
|
|
57
|
+
&:focus {
|
|
58
|
+
border-color: $color-warning-hover;
|
|
59
|
+
outline-color: #b8565d;
|
|
60
|
+
}
|
|
61
|
+
&[disabled],
|
|
62
|
+
&[readonly] {
|
|
63
|
+
background-color: #ddd;
|
|
64
|
+
cursor: default;
|
|
65
|
+
border-color: #afaba8;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
&:local(.file) {
|
|
70
|
+
label {
|
|
71
|
+
:local(.fileInputContainer) {
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
input {
|
|
77
|
+
display: none;
|
|
78
|
+
}
|
|
79
|
+
:local(span.input) {
|
|
80
|
+
flex: 1;
|
|
81
|
+
}
|
|
82
|
+
button {
|
|
83
|
+
margin: 0 8px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
:local(.errorMessage) {
|
|
87
|
+
color: $color-warning;
|
|
88
|
+
font-weight: 300;
|
|
89
|
+
font-style: italic;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
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 _ListModule = _interopRequireDefault(require("./List.module.scss"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
+
|
|
20
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
21
|
+
|
|
22
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
23
|
+
|
|
24
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
25
|
+
|
|
26
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
+
|
|
28
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
29
|
+
|
|
30
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
31
|
+
|
|
32
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
|
+
|
|
34
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
|
+
|
|
36
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
|
+
|
|
38
|
+
var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
39
|
+
_inherits(ListItem, _React$Component);
|
|
40
|
+
|
|
41
|
+
var _super = _createSuper(ListItem);
|
|
42
|
+
|
|
43
|
+
function ListItem() {
|
|
44
|
+
_classCallCheck(this, ListItem);
|
|
45
|
+
|
|
46
|
+
return _super.apply(this, arguments);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
_createClass(ListItem, [{
|
|
50
|
+
key: "render",
|
|
51
|
+
value: function render() {
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement("li", null, this.props.listItem);
|
|
53
|
+
}
|
|
54
|
+
}]);
|
|
55
|
+
|
|
56
|
+
return ListItem;
|
|
57
|
+
}(_react.default.Component);
|
|
58
|
+
|
|
59
|
+
var List = /*#__PURE__*/function (_React$Component2) {
|
|
60
|
+
_inherits(List, _React$Component2);
|
|
61
|
+
|
|
62
|
+
var _super2 = _createSuper(List);
|
|
63
|
+
|
|
64
|
+
function List() {
|
|
65
|
+
_classCallCheck(this, List);
|
|
66
|
+
|
|
67
|
+
return _super2.apply(this, arguments);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
_createClass(List, [{
|
|
71
|
+
key: "renderList",
|
|
72
|
+
value: function renderList() {
|
|
73
|
+
var listItems = this.props.listItems.map(function (listItem, i) {
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement(ListItem, {
|
|
75
|
+
listItem: listItem,
|
|
76
|
+
key: i
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
var listType = this.props.ordered ? 'ol' : 'ul';
|
|
80
|
+
|
|
81
|
+
var listElement = /*#__PURE__*/_react.default.createElement(listType, {
|
|
82
|
+
className: _ListModule.default.list
|
|
83
|
+
}, listItems);
|
|
84
|
+
|
|
85
|
+
return listElement;
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
key: "render",
|
|
89
|
+
value: function render() {
|
|
90
|
+
return /*#__PURE__*/_react.default.createElement("div", null, this.renderList());
|
|
91
|
+
}
|
|
92
|
+
}]);
|
|
93
|
+
|
|
94
|
+
return List;
|
|
95
|
+
}(_react.default.Component);
|
|
96
|
+
|
|
97
|
+
List.propTypes = {
|
|
98
|
+
listItems: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
99
|
+
ordered: _propTypes.default.bool
|
|
100
|
+
};
|
|
101
|
+
List.defaultProps = {
|
|
102
|
+
listItems: [],
|
|
103
|
+
ordered: false
|
|
104
|
+
};
|
|
105
|
+
var _default = List;
|
|
106
|
+
exports.default = _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
:local(.list) {
|
|
2
|
+
margin: 0;
|
|
3
|
+
margin-left: 20px;
|
|
4
|
+
padding: 0;
|
|
5
|
+
margin-bottom: 20px;
|
|
6
|
+
list-style-position: outside;
|
|
7
|
+
font-size: 16px;
|
|
8
|
+
li {
|
|
9
|
+
line-height: 1.6;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:local(ul.list) {
|
|
14
|
+
list-style: disc;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:local(ol.list) {
|
|
18
|
+
list-style: decimal;
|
|
19
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
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 _LoadingAnimationModule = _interopRequireDefault(require("./LoadingAnimation.module.scss"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
+
|
|
20
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
21
|
+
|
|
22
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
23
|
+
|
|
24
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
25
|
+
|
|
26
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
+
|
|
28
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
29
|
+
|
|
30
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
31
|
+
|
|
32
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
|
+
|
|
34
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
|
+
|
|
36
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
|
+
|
|
38
|
+
var LoadingAnimation = /*#__PURE__*/function (_React$Component) {
|
|
39
|
+
_inherits(LoadingAnimation, _React$Component);
|
|
40
|
+
|
|
41
|
+
var _super = _createSuper(LoadingAnimation);
|
|
42
|
+
|
|
43
|
+
function LoadingAnimation() {
|
|
44
|
+
_classCallCheck(this, LoadingAnimation);
|
|
45
|
+
|
|
46
|
+
return _super.apply(this, arguments);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
_createClass(LoadingAnimation, [{
|
|
50
|
+
key: "render",
|
|
51
|
+
value: function render() {
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
53
|
+
className: this.props.fixed ? _LoadingAnimationModule.default.loadingAnimation + ' ' + _LoadingAnimationModule.default.fixed : _LoadingAnimationModule.default.loadingAnimation
|
|
54
|
+
}, this.props.message);
|
|
55
|
+
}
|
|
56
|
+
}]);
|
|
57
|
+
|
|
58
|
+
return LoadingAnimation;
|
|
59
|
+
}(_react.default.Component);
|
|
60
|
+
|
|
61
|
+
LoadingAnimation.propTypes = {
|
|
62
|
+
fixed: _propTypes.default.bool,
|
|
63
|
+
active: _propTypes.default.bool,
|
|
64
|
+
|
|
65
|
+
/** Text content inside button */
|
|
66
|
+
message: _propTypes.default.string
|
|
67
|
+
};
|
|
68
|
+
LoadingAnimation.defaultProps = {
|
|
69
|
+
fixed: false,
|
|
70
|
+
active: true,
|
|
71
|
+
message: ''
|
|
72
|
+
};
|
|
73
|
+
var _default = LoadingAnimation;
|
|
74
|
+
exports.default = _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@import "../style/global.scss";
|
|
2
|
+
|
|
3
|
+
:local(.loadingAnimation){
|
|
4
|
+
@include box-shadow(0 8px 17px 0 rgba(0,0,0,.2));
|
|
5
|
+
z-index: 6;
|
|
6
|
+
background-repeat: no-repeat;
|
|
7
|
+
background-position: 50% 15px;
|
|
8
|
+
background-color: #fff;
|
|
9
|
+
height: auto;
|
|
10
|
+
width: 200px;
|
|
11
|
+
border: 1px solid #ddd;
|
|
12
|
+
padding: 15px;
|
|
13
|
+
color: #666;
|
|
14
|
+
display: block;
|
|
15
|
+
text-align: center;
|
|
16
|
+
&:local(.fixed) {
|
|
17
|
+
@include calc(left, '50% - 100px');
|
|
18
|
+
top: 40%;
|
|
19
|
+
margin: auto;
|
|
20
|
+
position: fixed;
|
|
21
|
+
}
|
|
22
|
+
&:before {
|
|
23
|
+
content: url(../images/spinner.svg);
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
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 _dibkLogoMobile = _interopRequireDefault(require("../images/dibk-logo-mobile.svg"));
|
|
17
|
+
|
|
18
|
+
var _NavigationBarListItem = _interopRequireDefault(require("./NavigationBarListItem"));
|
|
19
|
+
|
|
20
|
+
var _NavigationBarModule = _interopRequireDefault(require("./NavigationBar.module.scss"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
+
|
|
26
|
+
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); } }
|
|
27
|
+
|
|
28
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
29
|
+
|
|
30
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
31
|
+
|
|
32
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
+
|
|
34
|
+
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); }; }
|
|
35
|
+
|
|
36
|
+
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); }
|
|
37
|
+
|
|
38
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
|
+
|
|
40
|
+
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; } }
|
|
41
|
+
|
|
42
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
|
+
|
|
44
|
+
var NavigationBar = /*#__PURE__*/function (_React$Component) {
|
|
45
|
+
_inherits(NavigationBar, _React$Component);
|
|
46
|
+
|
|
47
|
+
var _super = _createSuper(NavigationBar);
|
|
48
|
+
|
|
49
|
+
function NavigationBar(props) {
|
|
50
|
+
var _this;
|
|
51
|
+
|
|
52
|
+
_classCallCheck(this, NavigationBar);
|
|
53
|
+
|
|
54
|
+
_this = _super.call(this, props);
|
|
55
|
+
_this.state = {
|
|
56
|
+
active: false
|
|
57
|
+
};
|
|
58
|
+
return _this;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
_createClass(NavigationBar, [{
|
|
62
|
+
key: "handleClickOutside",
|
|
63
|
+
value: function handleClickOutside() {
|
|
64
|
+
this.setState({
|
|
65
|
+
active: false
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "toggleList",
|
|
70
|
+
value: function toggleList() {
|
|
71
|
+
this.setState(function (prevState) {
|
|
72
|
+
return {
|
|
73
|
+
active: !prevState.active
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}, {
|
|
78
|
+
key: "getNavigationBarThemeStyle",
|
|
79
|
+
value: function getNavigationBarThemeStyle(theme) {
|
|
80
|
+
return {
|
|
81
|
+
backgroundColor: (0, _theme.getThemeNavigationBarBackgroundColor)(theme),
|
|
82
|
+
color: (0, _theme.getThemeNavigationBarTextColor)(theme)
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "getListItemThemeStyle",
|
|
87
|
+
value: function getListItemThemeStyle(theme) {
|
|
88
|
+
return {
|
|
89
|
+
color: (0, _theme.getThemeNavigationBarTextColor)(theme),
|
|
90
|
+
borderBottomColor: (0, _theme.getThemeNavigationBarTextColor)(theme)
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
key: "getLogoThemeStyle",
|
|
95
|
+
value: function getLogoThemeStyle(theme) {
|
|
96
|
+
return {
|
|
97
|
+
padding: (0, _theme.getThemeLogoPadding)(theme)
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "renderPrimaryList",
|
|
102
|
+
value: function renderPrimaryList() {
|
|
103
|
+
var _this2 = this;
|
|
104
|
+
|
|
105
|
+
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.primaryListItems;
|
|
106
|
+
var iteration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
107
|
+
var listItemThemeStyle = this.getListItemThemeStyle(this.props.theme);
|
|
108
|
+
var listItems = items.map(function (listItem, i) {
|
|
109
|
+
var key = iteration + '-' + i;
|
|
110
|
+
|
|
111
|
+
if (listItem.listItems !== undefined) {
|
|
112
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
113
|
+
key: key
|
|
114
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
115
|
+
style: listItemThemeStyle
|
|
116
|
+
}, listItem.name), _this2.renderPrimaryList(listItem.listItems, iteration + 1));
|
|
117
|
+
} else {
|
|
118
|
+
return /*#__PURE__*/_react.default.createElement(_NavigationBarListItem.default, {
|
|
119
|
+
listItem: listItem,
|
|
120
|
+
key: key,
|
|
121
|
+
theme: _this2.props.theme
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
126
|
+
className: _NavigationBarModule.default.primaryList
|
|
127
|
+
}, listItems);
|
|
128
|
+
}
|
|
129
|
+
}, {
|
|
130
|
+
key: "renderSecondaryList",
|
|
131
|
+
value: function renderSecondaryList() {
|
|
132
|
+
var _this3 = this;
|
|
133
|
+
|
|
134
|
+
var listItems = this.props.secondaryListItems.map(function (listItem, i) {
|
|
135
|
+
return /*#__PURE__*/_react.default.createElement(_NavigationBarListItem.default, {
|
|
136
|
+
listItem: listItem,
|
|
137
|
+
key: i,
|
|
138
|
+
theme: _this3.props.theme
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
142
|
+
className: _NavigationBarModule.default.secondaryList
|
|
143
|
+
}, listItems);
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "renderLogo",
|
|
147
|
+
value: function renderLogo(logoLink) {
|
|
148
|
+
var themeLogo = (0, _theme.getThemeLogo)(this.props.theme);
|
|
149
|
+
var themeAppName = (0, _theme.getThemeAppName)(this.props.theme);
|
|
150
|
+
var logoElement = themeLogo && themeAppName ? /*#__PURE__*/_react.default.createElement("img", {
|
|
151
|
+
alt: "".concat(themeAppName, " logo"),
|
|
152
|
+
src: themeLogo,
|
|
153
|
+
style: this.getLogoThemeStyle(this.props.theme)
|
|
154
|
+
}) : /*#__PURE__*/_react.default.createElement("img", {
|
|
155
|
+
alt: "DIBK logo",
|
|
156
|
+
src: _dibkLogoMobile.default
|
|
157
|
+
});
|
|
158
|
+
return logoLink && logoLink.length ? /*#__PURE__*/_react.default.createElement("a", {
|
|
159
|
+
href: logoLink
|
|
160
|
+
}, logoElement) : logoElement;
|
|
161
|
+
}
|
|
162
|
+
}, {
|
|
163
|
+
key: "render",
|
|
164
|
+
value: function render() {
|
|
165
|
+
var _this4 = this;
|
|
166
|
+
|
|
167
|
+
var navigationBarThemeStyle = this.getNavigationBarThemeStyle(this.props.theme);
|
|
168
|
+
var hamburgerIconLineStyle = {
|
|
169
|
+
backgroundColor: (0, _theme.getThemeNavigationBarTextColor)(this.props.theme)
|
|
170
|
+
};
|
|
171
|
+
return /*#__PURE__*/_react.default.createElement("header", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
172
|
+
className: _NavigationBarModule.default.isPresent
|
|
173
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
174
|
+
className: _NavigationBarModule.default.navigationBar,
|
|
175
|
+
style: navigationBarThemeStyle
|
|
176
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
177
|
+
className: _NavigationBarModule.default.logoContainer
|
|
178
|
+
}, this.renderLogo(this.props.logoLink)), this.props.children ? /*#__PURE__*/_react.default.createElement("div", {
|
|
179
|
+
className: _NavigationBarModule.default.childElements
|
|
180
|
+
}, this.props.children) : '', this.props.primaryListItems && this.props.primaryListItems.length || this.props.secondaryListItems && this.props.secondaryListItems.length ? /*#__PURE__*/_react.default.createElement("button", {
|
|
181
|
+
className: "".concat(_NavigationBarModule.default.menuToggle, " ").concat(this.state.active ? _NavigationBarModule.default.active : ''),
|
|
182
|
+
onClick: function onClick() {
|
|
183
|
+
return _this4.toggleList();
|
|
184
|
+
}
|
|
185
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
186
|
+
className: _NavigationBarModule.default.hamburgerIcon
|
|
187
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
188
|
+
className: _NavigationBarModule.default.line,
|
|
189
|
+
style: hamburgerIconLineStyle
|
|
190
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
191
|
+
className: _NavigationBarModule.default.line,
|
|
192
|
+
style: hamburgerIconLineStyle
|
|
193
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
194
|
+
className: _NavigationBarModule.default.line,
|
|
195
|
+
style: hamburgerIconLineStyle
|
|
196
|
+
}))) : ''), /*#__PURE__*/_react.default.createElement("div", {
|
|
197
|
+
className: "".concat(_NavigationBarModule.default.dropdownContainer, " ").concat(this.state.active ? _NavigationBarModule.default.active : '')
|
|
198
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
199
|
+
className: _NavigationBarModule.default.dropdown,
|
|
200
|
+
style: navigationBarThemeStyle
|
|
201
|
+
}, this.renderPrimaryList(), this.renderSecondaryList(), this.props.children)), /*#__PURE__*/_react.default.createElement("div", {
|
|
202
|
+
className: "".concat(_NavigationBarModule.default.dropdownOverlay, " ").concat(this.state.active ? _NavigationBarModule.default.active : '')
|
|
203
|
+
})));
|
|
204
|
+
}
|
|
205
|
+
}]);
|
|
206
|
+
|
|
207
|
+
return NavigationBar;
|
|
208
|
+
}(_react.default.Component);
|
|
209
|
+
|
|
210
|
+
NavigationBar.propTypes = {
|
|
211
|
+
/** Main links in navigation bar */
|
|
212
|
+
primaryListItems: _propTypes.default.array,
|
|
213
|
+
|
|
214
|
+
/** Secondary links in navigation bar */
|
|
215
|
+
secondaryListItems: _propTypes.default.array,
|
|
216
|
+
|
|
217
|
+
/** Link for logo */
|
|
218
|
+
logoLink: _propTypes.default.string,
|
|
219
|
+
|
|
220
|
+
/** Theme for navigation bar */
|
|
221
|
+
theme: _propTypes.default.object
|
|
222
|
+
};
|
|
223
|
+
NavigationBar.defaultProps = {
|
|
224
|
+
primaryListItems: [],
|
|
225
|
+
secondaryListItems: [],
|
|
226
|
+
logoLink: null
|
|
227
|
+
};
|
|
228
|
+
var _default = NavigationBar;
|
|
229
|
+
exports.default = _default;
|