dibk-design 6.5.2 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion.js +4 -4
- package/dist/components/Accordion.module.scss +25 -18
- package/dist/components/Button.js +11 -14
- package/dist/components/Button.module.scss +79 -66
- package/dist/components/CheckBoxIcon.js +2 -2
- package/dist/components/CheckBoxIcon.module.scss +17 -10
- package/dist/components/CheckBoxInput.js +2 -2
- package/dist/components/CheckBoxInput.module.scss +5 -4
- package/dist/components/CheckBoxList.js +4 -5
- package/dist/components/CheckBoxList.module.scss +3 -2
- package/dist/components/CheckBoxListItem.js +1 -1
- package/dist/components/CheckBoxListItem.module.scss +17 -9
- package/dist/components/Container.js +2 -3
- package/dist/components/Container.module.scss +5 -3
- package/dist/components/ContentBox.js +2 -3
- package/dist/components/ContentBox.module.scss +16 -11
- package/dist/components/DescriptionDetails.js +1 -1
- package/dist/components/DescriptionDetails.module.scss +3 -2
- package/dist/components/DescriptionList.js +2 -2
- package/dist/components/DescriptionList.module.scss +0 -2
- package/dist/components/DescriptionTerm.js +1 -1
- package/dist/components/DescriptionTerm.module.scss +3 -2
- package/dist/components/Dialog.js +4 -5
- package/dist/components/Dialog.module.scss +14 -9
- package/dist/components/DragAndDropFileInput.js +6 -7
- package/dist/components/DragAndDropFileInput.module.scss +9 -5
- package/dist/components/ErrorBox.js +1 -1
- package/dist/components/ErrorBox.module.scss +12 -8
- package/dist/components/ErrorMessage.js +4 -6
- package/dist/components/ErrorMessage.module.scss +5 -3
- package/dist/components/Footer.js +1 -1
- package/dist/components/Footer.module.scss +3 -2
- package/dist/components/Header.js +6 -7
- package/dist/components/Header.module.scss +14 -11
- package/dist/components/InfoBox.js +1 -1
- package/dist/components/InfoBox.module.scss +7 -4
- package/dist/components/InputField.js +8 -10
- package/dist/components/InputField.module.scss +19 -13
- package/dist/components/Label.js +3 -4
- package/dist/components/Label.module.scss +3 -2
- package/dist/components/Lead.js +1 -1
- package/dist/components/Lead.module.scss +5 -3
- package/dist/components/List.js +3 -3
- package/dist/components/List.module.scss +0 -2
- package/dist/components/ListItem.js +1 -1
- package/dist/components/ListItem.module.scss +3 -2
- package/dist/components/LoadingAnimation.js +1 -1
- package/dist/components/LoadingAnimation.module.scss +5 -3
- package/dist/components/NavigationBar.js +9 -10
- package/dist/components/NavigationBar.module.scss +66 -57
- package/dist/components/NavigationBarListItem.js +1 -1
- package/dist/components/PDF.scss +14 -6
- package/dist/components/Paper.js +2 -2
- package/dist/components/Paper.module.scss +3 -2
- package/dist/components/ProgressBar.js +2 -2
- package/dist/components/ProgressBar.module.scss +8 -4
- package/dist/components/RadioButtonIcon.js +2 -2
- package/dist/components/RadioButtonIcon.module.scss +18 -10
- package/dist/components/RadioButtonInput.js +2 -2
- package/dist/components/RadioButtonInput.module.scss +5 -4
- package/dist/components/RadioButtonList.js +4 -5
- package/dist/components/RadioButtonList.module.scss +3 -2
- package/dist/components/RadioButtonListItem.js +1 -1
- package/dist/components/RadioButtonListItem.module.scss +17 -9
- package/dist/components/Select.js +9 -10
- package/dist/components/Select.module.scss +24 -16
- package/dist/components/Table.js +3 -3
- package/dist/components/Table.module.scss +10 -8
- package/dist/components/Textarea.js +7 -8
- package/dist/components/Textarea.module.scss +21 -13
- package/dist/components/Theme.js +2 -2
- package/dist/components/Theme.module.scss +29 -27
- package/dist/components/ThemeProvider.js +2 -2
- package/dist/components/ThemeProvider.module.scss +7 -5
- package/dist/components/ToggleNavigationButton.js +1 -1
- package/dist/components/ToggleNavigationButton.module.scss +11 -8
- package/dist/components/WizardNavigation/Step.js +1 -1
- package/dist/components/WizardNavigation/Step.module.scss +27 -24
- package/dist/components/WizardNavigation.js +4 -5
- package/dist/components/WizardNavigation.module.scss +3 -2
- package/dist/functions/helpers.js +11 -15
- package/dist/functions/theme.js +3 -3
- package/dist/index.js +1 -1
- package/dist/style/base/_typography.scss +5 -2
- package/dist/style/layout/_containers.scss +3 -1
- package/dist/style/pdf.css +3 -0
- package/dist/style/pdf.css.map +1 -1
- package/package.json +16 -15
- package/dist/style/abstracts/_all.scss +0 -2
- package/dist/style/abstracts/mixins/_all.scss +0 -12
- package/dist/style/abstracts/variables/_all.scss +0 -5
- package/dist/style/base/_all.scss +0 -3
- package/dist/style/global.scss +0 -3
- package/dist/style/layout/_all.scss +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// Variables
|
|
2
|
+
@use "../style/abstracts/variables/colors";
|
|
2
3
|
|
|
3
4
|
.checkBoxInput {
|
|
4
5
|
display: flex;
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
.labelText {
|
|
24
25
|
font-size: 16px;
|
|
25
26
|
line-height: 24px;
|
|
26
|
-
color: var(--color-form-element,
|
|
27
|
+
color: var(--color-form-element, colors.$color-form-element);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
&.disabled {
|
|
@@ -34,13 +35,13 @@
|
|
|
34
35
|
|
|
35
36
|
&.hasErrors {
|
|
36
37
|
span {
|
|
37
|
-
color: var(--color-error,
|
|
38
|
+
color: var(--color-error, colors.$color-error);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
&:focus-within {
|
|
42
43
|
outline-width: 2px;
|
|
43
|
-
outline-color: var(--color-focus,
|
|
44
|
+
outline-color: var(--color-focus, colors.$color-focus);
|
|
44
45
|
outline-style: auto;
|
|
45
46
|
outline-offset: 1px;
|
|
46
47
|
}
|
|
@@ -10,7 +10,7 @@ var _helpers = require("../functions/helpers");
|
|
|
10
10
|
var _asterisk = _interopRequireDefault(require("../assets/svg/asterisk.svg?url"));
|
|
11
11
|
var _CheckBoxListModule = _interopRequireDefault(require("./CheckBoxList.module.scss"));
|
|
12
12
|
var _Header = _interopRequireDefault(require("./Header"));
|
|
13
|
-
function _interopRequireDefault(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
const CheckBoxList = _ref => {
|
|
15
15
|
let {
|
|
16
16
|
required,
|
|
@@ -22,13 +22,12 @@ const CheckBoxList = _ref => {
|
|
|
22
22
|
const renderChildElements = childElements => {
|
|
23
23
|
const childElementsthroughFragments = (0, _helpers.cloneThroughFragments)(childElements);
|
|
24
24
|
return childElementsthroughFragments.map((childElement, index) => {
|
|
25
|
-
|
|
26
|
-
const isCheckBoxListItem = (childElement === null || childElement === void 0 || (_childElement$props = childElement.props) === null || _childElement$props === void 0 ? void 0 : _childElement$props.type) === "CheckBoxListItem";
|
|
25
|
+
const isCheckBoxListItem = childElement?.props?.type === "CheckBoxListItem";
|
|
27
26
|
if (isCheckBoxListItem) {
|
|
28
27
|
const childElementCopy = _react.default.cloneElement(childElement, {
|
|
29
28
|
requiredGroup: required,
|
|
30
29
|
compact: compact,
|
|
31
|
-
key:
|
|
30
|
+
key: `checkboxListItem-${index}`
|
|
32
31
|
});
|
|
33
32
|
return childElementCopy;
|
|
34
33
|
} else {
|
|
@@ -38,7 +37,7 @@ const CheckBoxList = _ref => {
|
|
|
38
37
|
};
|
|
39
38
|
return _react.default.createElement("fieldset", {
|
|
40
39
|
className: _CheckBoxListModule.default.checkBoxList
|
|
41
|
-
}, !!
|
|
40
|
+
}, !!legend?.length ? _react.default.createElement("legend", null, legendSize ? _react.default.createElement(_Header.default, {
|
|
42
41
|
size: legendSize
|
|
43
42
|
}, legend) : legend, required && _react.default.createElement("img", {
|
|
44
43
|
src: _asterisk.default,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// Variables
|
|
2
|
+
@use "../style/abstracts/variables/typography";
|
|
2
3
|
|
|
3
4
|
fieldset.checkBoxList {
|
|
4
5
|
margin: 0;
|
|
@@ -11,7 +12,7 @@ fieldset.checkBoxList {
|
|
|
11
12
|
font-weight: bold;
|
|
12
13
|
line-height: 1.2;
|
|
13
14
|
margin-bottom: 2px;
|
|
14
|
-
font-family:
|
|
15
|
+
font-family: typography.$default-font;
|
|
15
16
|
overflow-wrap: break-word;
|
|
16
17
|
.requiredSymbol {
|
|
17
18
|
width: 1em;
|
|
@@ -9,7 +9,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
var _CheckBoxInput = _interopRequireDefault(require("./CheckBoxInput"));
|
|
10
10
|
var _helpers = require("../functions/helpers");
|
|
11
11
|
var _CheckBoxListItemModule = _interopRequireDefault(require("./CheckBoxListItem.module.scss"));
|
|
12
|
-
function _interopRequireDefault(
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
const CheckBoxListItem = props => {
|
|
14
14
|
const listItemClassNameArray = [_CheckBoxListItemModule.default.checkBoxListItem, props.checked ? _CheckBoxListItemModule.default.checked : null, props.disabled ? _CheckBoxListItemModule.default.disabled : null, props.compact ? _CheckBoxListItemModule.default.compact : null, props.contentOnly ? _CheckBoxListItemModule.default.contentOnly : null, props.hasErrors ? _CheckBoxListItemModule.default.hasErrors : null];
|
|
15
15
|
const listItemClassNameString = (0, _helpers.classNameArrayToClassNameString)(listItemClassNameArray);
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
// Mixins
|
|
2
|
+
@use "../style/abstracts/mixins/border-radius";
|
|
3
|
+
@use "../style/abstracts/mixins/box-sizing";
|
|
4
|
+
@use "../style/abstracts/mixins/transition";
|
|
5
|
+
|
|
6
|
+
// Variables
|
|
7
|
+
@use "../style/abstracts/variables/colors";
|
|
8
|
+
@use "../style/abstracts/variables/transitions";
|
|
9
|
+
@use "../style/abstracts/variables/typography";
|
|
2
10
|
|
|
3
11
|
.checkBoxListItem {
|
|
4
|
-
@include box-sizing(content-box);
|
|
5
|
-
@include border-radius(0);
|
|
6
|
-
@include transition(all
|
|
12
|
+
@include box-sizing.box-sizing(content-box);
|
|
13
|
+
@include border-radius.border-radius(0);
|
|
14
|
+
@include transition.transition(all transitions.$default-transition);
|
|
7
15
|
display: -webkit-box;
|
|
8
16
|
display: -webkit-flex;
|
|
9
17
|
display: -ms-flexbox;
|
|
@@ -13,14 +21,14 @@
|
|
|
13
21
|
-ms-flex-align: flex-start;
|
|
14
22
|
align-items: flex-start;
|
|
15
23
|
cursor: pointer;
|
|
16
|
-
font-family:
|
|
24
|
+
font-family: typography.$default-font;
|
|
17
25
|
position: relative;
|
|
18
26
|
font-size: 16px;
|
|
19
27
|
line-height: 24px;
|
|
20
28
|
color: #000;
|
|
21
29
|
|
|
22
30
|
&:not(.contentOnly):not(.compact) {
|
|
23
|
-
border: 1px solid var(--color-secondary-light,
|
|
31
|
+
border: 1px solid var(--color-secondary-light, colors.$color-secondary-light);
|
|
24
32
|
background: white;
|
|
25
33
|
margin-bottom: 8px;
|
|
26
34
|
label {
|
|
@@ -43,15 +51,15 @@
|
|
|
43
51
|
}
|
|
44
52
|
|
|
45
53
|
&.checked:not(.contentOnly):not(.compact):not(.disabled) {
|
|
46
|
-
background-color: var(--color-secondary-light,
|
|
54
|
+
background-color: var(--color-secondary-light, colors.$color-secondary-light);
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
&:not(.checked):not(.contentOnly):not(.compact):not(.disabled) {
|
|
50
58
|
&:hover {
|
|
51
|
-
background-color: var(--color-secondary-x-light,
|
|
59
|
+
background-color: var(--color-secondary-x-light, colors.$color-secondary-x-light);
|
|
52
60
|
}
|
|
53
61
|
&:focus-within {
|
|
54
|
-
background-color: var(--color-secondary-x-light,
|
|
62
|
+
background-color: var(--color-secondary-x-light, colors.$color-secondary-x-light);
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
65
|
|
|
@@ -7,11 +7,10 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _ContainerModule = _interopRequireDefault(require("./Container.module.scss"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
const Container = props => {
|
|
12
|
-
var _props$maxWidth;
|
|
13
12
|
const styleProps = {
|
|
14
|
-
"--max-width":
|
|
13
|
+
"--max-width": props?.maxWidth?.length && props.maxWidth
|
|
15
14
|
};
|
|
16
15
|
return _react.default.createElement("div", {
|
|
17
16
|
className: _ContainerModule.default.container,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
// Variables
|
|
2
|
+
@use "../style/abstracts/variables/sizes";
|
|
3
|
+
@use "../style/abstracts/variables/viewports";
|
|
2
4
|
|
|
3
5
|
.container {
|
|
4
6
|
margin: auto;
|
|
5
7
|
padding: 8px;
|
|
6
|
-
@media (min-width:
|
|
8
|
+
@media (min-width: viewports.$screen-sm) {
|
|
7
9
|
padding: 20px;
|
|
8
|
-
max-width:
|
|
10
|
+
max-width: sizes.$content-width;
|
|
9
11
|
&[style*="--max-width"] {
|
|
10
12
|
max-width: var(--max-width);
|
|
11
13
|
}
|
|
@@ -7,9 +7,8 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _ContentBoxModule = _interopRequireDefault(require("./ContentBox.module.scss"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
const ContentBox = props => {
|
|
12
|
-
var _props$content;
|
|
13
12
|
const renderTitle = () => {
|
|
14
13
|
let className = _ContentBoxModule.default.title + " " + _ContentBoxModule.default[props.titleSize];
|
|
15
14
|
if (props.title) {
|
|
@@ -23,7 +22,7 @@ const ContentBox = props => {
|
|
|
23
22
|
let colorClass = " " + _ContentBoxModule.default[props.color];
|
|
24
23
|
let linkClass = props.href ? " " + _ContentBoxModule.default.link : "";
|
|
25
24
|
let className = _ContentBoxModule.default.contentBox + colorClass + linkClass;
|
|
26
|
-
const bodyContent =
|
|
25
|
+
const bodyContent = props.content?.length ? props.content : props.children;
|
|
27
26
|
if (props.href) {
|
|
28
27
|
return _react.default.createElement("a", {
|
|
29
28
|
href: props.href,
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
// Mixins
|
|
2
|
+
@use "../style/abstracts/mixins/transition";
|
|
3
|
+
|
|
4
|
+
// Variables
|
|
5
|
+
@use "../style/abstracts/variables/colors";
|
|
6
|
+
@use "../style/abstracts/variables/typography";
|
|
2
7
|
|
|
3
8
|
.contentBox {
|
|
4
|
-
font-family:
|
|
9
|
+
font-family: typography.$default-font;
|
|
5
10
|
text-decoration: none;
|
|
6
11
|
padding: 20px;
|
|
7
12
|
width: 100%;
|
|
8
13
|
display: block;
|
|
9
14
|
&.link {
|
|
10
|
-
color: var(--color-primary,
|
|
11
|
-
@include transition(filter 0.3s);
|
|
15
|
+
color: var(--color-primary, colors.$color-primary);
|
|
16
|
+
@include transition.transition(filter 0.3s);
|
|
12
17
|
&:hover,
|
|
13
18
|
&:focus {
|
|
14
19
|
filter: brightness(90%);
|
|
@@ -18,24 +23,24 @@
|
|
|
18
23
|
}
|
|
19
24
|
}
|
|
20
25
|
&.default {
|
|
21
|
-
background-color: var(--color-default-background,
|
|
26
|
+
background-color: var(--color-default-background, colors.$color-default-background);
|
|
22
27
|
.content,
|
|
23
28
|
.title {
|
|
24
|
-
color:
|
|
29
|
+
color: colors.$color-default-text;
|
|
25
30
|
}
|
|
26
31
|
}
|
|
27
32
|
&.secondary {
|
|
28
|
-
background-color: var(--color-secondary-background,
|
|
29
|
-
color: var(--color-default-text,
|
|
33
|
+
background-color: var(--color-secondary-background, colors.$color-secondary-background);
|
|
34
|
+
color: var(--color-default-text, colors.$color-default-text);
|
|
30
35
|
.content,
|
|
31
36
|
.title {
|
|
32
|
-
color: var(--color-default-text,
|
|
37
|
+
color: var(--color-default-text, colors.$color-default-text);
|
|
33
38
|
}
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
.title {
|
|
37
42
|
&.regular {
|
|
38
|
-
font-family:
|
|
43
|
+
font-family: typography.$default-font;
|
|
39
44
|
font-weight: bold;
|
|
40
45
|
font-size: 21px;
|
|
41
46
|
font-style: normal;
|
|
@@ -44,7 +49,7 @@
|
|
|
44
49
|
border-bottom: 1px solid rgba(0, 0, 0, 0.075);
|
|
45
50
|
}
|
|
46
51
|
&.large {
|
|
47
|
-
font-family:
|
|
52
|
+
font-family: typography.$default-font;
|
|
48
53
|
font-weight: normal;
|
|
49
54
|
font-size: 24px;
|
|
50
55
|
margin: 0;
|
|
@@ -8,7 +8,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _helpers = require("../functions/helpers");
|
|
10
10
|
var _DescriptionDetailsModule = _interopRequireDefault(require("./DescriptionDetails.module.scss"));
|
|
11
|
-
function _interopRequireDefault(
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
const DescriptionDetails = _ref => {
|
|
13
13
|
let {
|
|
14
14
|
compact,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
// Variables
|
|
2
|
+
@use "../style/abstracts/variables/colors";
|
|
2
3
|
|
|
3
4
|
.descriptionDetails {
|
|
4
5
|
font-size: 16px;
|
|
5
6
|
list-style: var(--listStyle);
|
|
6
|
-
color: var(--color-primary,
|
|
7
|
+
color: var(--color-primary, colors.$color-primary);
|
|
7
8
|
margin: 0;
|
|
8
9
|
&:not(.compact) {
|
|
9
10
|
line-height: 1.6;
|
|
@@ -8,7 +8,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _DescriptionListModule = _interopRequireDefault(require("./DescriptionList.module.scss"));
|
|
10
10
|
var _helpers = require("../functions/helpers");
|
|
11
|
-
function _interopRequireDefault(
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
const DescriptionList = _ref => {
|
|
13
13
|
let {
|
|
14
14
|
compact,
|
|
@@ -21,7 +21,7 @@ const DescriptionList = _ref => {
|
|
|
21
21
|
const childElementCopy = _react.default.cloneElement(childElement, {
|
|
22
22
|
compact: compact,
|
|
23
23
|
titleWidth: titleWidth,
|
|
24
|
-
key:
|
|
24
|
+
key: `descriptionListItem-${index}`
|
|
25
25
|
});
|
|
26
26
|
return childElementCopy;
|
|
27
27
|
});
|
|
@@ -8,7 +8,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _helpers = require("../functions/helpers");
|
|
10
10
|
var _DescriptionTermModule = _interopRequireDefault(require("./DescriptionTerm.module.scss"));
|
|
11
|
-
function _interopRequireDefault(
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
const DescriptionTerm = _ref => {
|
|
13
13
|
let {
|
|
14
14
|
compact,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
// Variables
|
|
2
|
+
@use "../style/abstracts/variables/colors";
|
|
2
3
|
|
|
3
4
|
.descriptionTerm {
|
|
4
5
|
font-size: 16px;
|
|
5
6
|
list-style: var(--listStyle);
|
|
6
|
-
color: var(--color-primary,
|
|
7
|
+
color: var(--color-primary, colors.$color-primary);
|
|
7
8
|
margin: 0;
|
|
8
9
|
font-weight: bold;
|
|
9
10
|
&:not(.compact) {
|
|
@@ -9,11 +9,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
var _xSymbol = _interopRequireDefault(require("../assets/svg/x-symbol.svg?url"));
|
|
10
10
|
var _DialogModule = _interopRequireDefault(require("./Dialog.module.scss"));
|
|
11
11
|
var _helpers = require("../functions/helpers");
|
|
12
|
-
function _interopRequireDefault(
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
15
|
const Dialog = props => {
|
|
16
|
-
var _props$attachTo, _props$maxWidth;
|
|
17
16
|
const dialogRef = (0, _react.useRef)();
|
|
18
17
|
const dialogContainerRef = (0, _react.useRef)();
|
|
19
18
|
const dialogContentRef = (0, _react.useCallback)(element => {
|
|
@@ -33,7 +32,7 @@ const Dialog = props => {
|
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
34
|
const handleClickOutside = event => {
|
|
36
|
-
if (dialogContainerRef
|
|
35
|
+
if (dialogContainerRef?.current && !dialogContainerRef.current.contains(event.target)) {
|
|
37
36
|
props.onClickOutside();
|
|
38
37
|
}
|
|
39
38
|
};
|
|
@@ -46,9 +45,9 @@ const Dialog = props => {
|
|
|
46
45
|
props.modal ? dialogRef.current.showModal() : dialogRef.current.show();
|
|
47
46
|
}
|
|
48
47
|
}, [dialogRef, props.hidden, props.modal]);
|
|
49
|
-
const sideBarClassNames =
|
|
48
|
+
const sideBarClassNames = props.attachTo?.length && (0, _helpers.classNameArrayToClassNameString)([_DialogModule.default.isSidebar, _DialogModule.default[props.attachTo]]);
|
|
50
49
|
const dialogContentStyleProps = {
|
|
51
|
-
"--max-width":
|
|
50
|
+
"--max-width": props?.maxWidth?.length && props.maxWidth
|
|
52
51
|
};
|
|
53
52
|
return _react.default.createElement("dialog", {
|
|
54
53
|
className: (0, _helpers.classNameArrayToClassNameString)([_DialogModule.default.dialog, sideBarClassNames]),
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// Mixins
|
|
2
|
+
@use "../style/abstracts/mixins/calc";
|
|
3
|
+
|
|
4
|
+
// Variables
|
|
5
|
+
@use "../style/abstracts/variables/colors";
|
|
6
|
+
@use "../style/abstracts/variables/viewports";
|
|
2
7
|
|
|
3
8
|
@keyframes modalInVertical {
|
|
4
9
|
0% {
|
|
@@ -23,7 +28,7 @@
|
|
|
23
28
|
|
|
24
29
|
.dialog {
|
|
25
30
|
&::backdrop {
|
|
26
|
-
background: color-mix(in srgb, var(--color-primary,
|
|
31
|
+
background: color-mix(in srgb, var(--color-primary, colors.$color-primary), transparent 60%);
|
|
27
32
|
}
|
|
28
33
|
&[open] {
|
|
29
34
|
border: none;
|
|
@@ -49,7 +54,7 @@
|
|
|
49
54
|
.closeButton {
|
|
50
55
|
background: none;
|
|
51
56
|
border: none;
|
|
52
|
-
color: var(--color-primary,
|
|
57
|
+
color: var(--color-primary, colors.$color-primary);
|
|
53
58
|
display: inline-block;
|
|
54
59
|
position: absolute;
|
|
55
60
|
cursor: pointer;
|
|
@@ -66,7 +71,7 @@
|
|
|
66
71
|
align-items: center;
|
|
67
72
|
justify-content: center;
|
|
68
73
|
padding: 8px 28px;
|
|
69
|
-
@media (min-width:
|
|
74
|
+
@media (min-width: viewports.$screen-md) {
|
|
70
75
|
padding: 36px;
|
|
71
76
|
}
|
|
72
77
|
.dialogContainer {
|
|
@@ -75,7 +80,7 @@
|
|
|
75
80
|
.dialogContent {
|
|
76
81
|
&:not(.noPadding) {
|
|
77
82
|
padding: 30px 15px;
|
|
78
|
-
@media only screen and (min-width:
|
|
83
|
+
@media only screen and (min-width: viewports.$screen-sm) {
|
|
79
84
|
padding: 60px 40px;
|
|
80
85
|
}
|
|
81
86
|
}
|
|
@@ -85,7 +90,7 @@
|
|
|
85
90
|
&:not(.noPadding) {
|
|
86
91
|
right: 5px;
|
|
87
92
|
top: 8px;
|
|
88
|
-
@media only screen and (min-width:
|
|
93
|
+
@media only screen and (min-width: viewports.$screen-sm) {
|
|
89
94
|
right: 10px;
|
|
90
95
|
top: 13px;
|
|
91
96
|
}
|
|
@@ -154,7 +159,7 @@
|
|
|
154
159
|
justify-content: center;
|
|
155
160
|
|
|
156
161
|
.dialogContent {
|
|
157
|
-
@include calc("max-height", "100% - 128px");
|
|
162
|
+
@include calc.calc("max-height", "100% - 128px");
|
|
158
163
|
width: 100%;
|
|
159
164
|
max-width: var(--max-width, 540px);
|
|
160
165
|
}
|
|
@@ -165,8 +170,8 @@
|
|
|
165
170
|
overflow: auto;
|
|
166
171
|
position: relative;
|
|
167
172
|
|
|
168
|
-
@media (min-width:
|
|
169
|
-
@include calc("width", "100% - 128px");
|
|
173
|
+
@media (min-width: viewports.$screen-md) {
|
|
174
|
+
@include calc.calc("width", "100% - 128px");
|
|
170
175
|
max-height: 100%;
|
|
171
176
|
}
|
|
172
177
|
}
|
|
@@ -11,12 +11,11 @@ var _ErrorMessage = _interopRequireDefault(require("./ErrorMessage"));
|
|
|
11
11
|
var _Label = _interopRequireDefault(require("./Label"));
|
|
12
12
|
var _asterisk = _interopRequireDefault(require("../assets/svg/asterisk.svg?url"));
|
|
13
13
|
var _DragAndDropFileInputModule = _interopRequireDefault(require("./DragAndDropFileInput.module.scss"));
|
|
14
|
-
function _interopRequireDefault(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
17
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
18
18
|
const DragAndDropFileInput = props => {
|
|
19
|
-
var _props$errorMessage, _props$ariaDescribed;
|
|
20
19
|
const [highlight, setHighlight] = (0, _react.useState)(false);
|
|
21
20
|
const containerElementRef = (0, _react.useRef)();
|
|
22
21
|
const fileInputElementRef = (0, _react.useRef)();
|
|
@@ -31,11 +30,11 @@ const DragAndDropFileInput = props => {
|
|
|
31
30
|
fileInputElementRef.current.click();
|
|
32
31
|
};
|
|
33
32
|
const getErrorElementId = () => {
|
|
34
|
-
return
|
|
33
|
+
return `${props.id}-errorMessage`;
|
|
35
34
|
};
|
|
36
35
|
const inputElementProps = {
|
|
37
36
|
id: props.id,
|
|
38
|
-
"aria-describedby": props.hasErrors && !!
|
|
37
|
+
"aria-describedby": props.hasErrors && !!props.errorMessage?.length ? getErrorElementId() : !!props["aria-describedby"]?.length ? props["aria-describedby"] : null,
|
|
39
38
|
"aria-invalid": props.hasErrors ? "true" : null,
|
|
40
39
|
name: props.name,
|
|
41
40
|
required: props.required
|
|
@@ -54,7 +53,7 @@ const DragAndDropFileInput = props => {
|
|
|
54
53
|
const files = e.dataTransfer.files;
|
|
55
54
|
handleFiles(files);
|
|
56
55
|
};
|
|
57
|
-
if (containerElementRef
|
|
56
|
+
if (containerElementRef?.current) {
|
|
58
57
|
containerElementRef.current.addEventListener("dragenter", preventDefaults, false);
|
|
59
58
|
containerElementRef.current.addEventListener("dragover", preventDefaults, false);
|
|
60
59
|
containerElementRef.current.addEventListener("dragleave", preventDefaults, false);
|
|
@@ -84,7 +83,7 @@ const DragAndDropFileInput = props => {
|
|
|
84
83
|
className: _DragAndDropFileInputModule.default.requiredSymbol
|
|
85
84
|
})), _react.default.createElement("div", null, props.children), !props.contentOnly ? _react.default.createElement("div", {
|
|
86
85
|
ref: containerElementRef,
|
|
87
|
-
className:
|
|
86
|
+
className: `${_DragAndDropFileInputModule.default.dragAndDropContainer} ${highlight ? _DragAndDropFileInputModule.default.highlighted : ""}`
|
|
88
87
|
}, props.selectedFileName ? _react.default.createElement("div", null, _react.default.createElement("span", null, _react.default.createElement("b", null, "Valgt fil:"), " ", props.selectedFileName)) : _react.default.createElement("div", null, "Slipp fil her"), _react.default.createElement("input", _extends({}, inputElementProps, {
|
|
89
88
|
ref: fileInputElementRef,
|
|
90
89
|
type: "file",
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// Mixins
|
|
2
|
+
@use "../style/abstracts/mixins/transition";
|
|
3
|
+
|
|
4
|
+
// Variables
|
|
5
|
+
@use "../style/abstracts/variables/colors";
|
|
2
6
|
|
|
3
7
|
.dragAndDropFileInput {
|
|
4
8
|
.requiredSymbol {
|
|
@@ -10,8 +14,8 @@
|
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
.dragAndDropContainer {
|
|
13
|
-
@include transition(all 0.1s ease-in-out);
|
|
14
|
-
border: 2px dashed var(--color-secondary-light,
|
|
17
|
+
@include transition.transition(all 0.1s ease-in-out);
|
|
18
|
+
border: 2px dashed var(--color-secondary-light, colors.$color-secondary-light);
|
|
15
19
|
border-radius: 20px;
|
|
16
20
|
width: 100%;
|
|
17
21
|
padding: 20px;
|
|
@@ -27,8 +31,8 @@
|
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
&.highlighted {
|
|
30
|
-
background: var(--color-secondary-x-light,
|
|
31
|
-
border-color: var(--color-primary,
|
|
34
|
+
background: var(--color-secondary-x-light, colors.$color-secondary-x-light);
|
|
35
|
+
border-color: var(--color-primary, colors.$color-primary);
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
}
|
|
@@ -9,7 +9,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
var _helpers = require("../functions/helpers");
|
|
10
10
|
var _ErrorBoxModule = _interopRequireDefault(require("./ErrorBox.module.scss"));
|
|
11
11
|
var _infoSign = _interopRequireDefault(require("../assets/svg/info-sign.svg?url"));
|
|
12
|
-
function _interopRequireDefault(
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
const ErrorBox = props => {
|
|
14
14
|
return _react.default.createElement("div", {
|
|
15
15
|
className: (0, _helpers.classNameArrayToClassNameString)([_ErrorBoxModule.default.errorBoxContainer, _ErrorBoxModule.default[props.type], props.fullScreen && _ErrorBoxModule.default.fullScreen])
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// Variables
|
|
2
|
+
@use "../style/abstracts/variables/colors";
|
|
3
|
+
@use "../style/abstracts/variables/sizes";
|
|
4
|
+
@use "../style/abstracts/variables/typography";
|
|
5
|
+
@use "../style/abstracts/variables/viewports";
|
|
2
6
|
|
|
3
7
|
@keyframes messageIn {
|
|
4
8
|
0% {
|
|
@@ -8,18 +12,18 @@
|
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
.errorBoxContainer {
|
|
11
|
-
font-family:
|
|
15
|
+
font-family: typography.$default-font;
|
|
12
16
|
margin: 0;
|
|
13
17
|
animation: 1000ms cubic-bezier(0.22, 1, 0.36, 1) 0s 1 normal none running messageIn;
|
|
14
18
|
position: relative;
|
|
15
19
|
line-height: 24px;
|
|
16
20
|
&.warning {
|
|
17
|
-
background-color: var(--color-warning-x-light,
|
|
18
|
-
border-color: var(--color-warning,
|
|
21
|
+
background-color: var(--color-warning-x-light, colors.$color-warning-x-light);
|
|
22
|
+
border-color: var(--color-warning, colors.$color-warning);
|
|
19
23
|
}
|
|
20
24
|
&.error {
|
|
21
|
-
background-color: var(--color-error-x-light,
|
|
22
|
-
border-color: var(--color-error,
|
|
25
|
+
background-color: var(--color-error-x-light, colors.$color-error-x-light);
|
|
26
|
+
border-color: var(--color-error, colors.$color-error);
|
|
23
27
|
}
|
|
24
28
|
&.fullScreen {
|
|
25
29
|
border-bottom-width: 4px;
|
|
@@ -32,7 +36,7 @@
|
|
|
32
36
|
.errorBox {
|
|
33
37
|
padding: 24px 24px 24px calc(1.2em + 48px);
|
|
34
38
|
&.fullScreen {
|
|
35
|
-
max-width:
|
|
39
|
+
max-width: sizes.$content-width;
|
|
36
40
|
margin: auto;
|
|
37
41
|
position: relative;
|
|
38
42
|
}
|
|
@@ -53,7 +57,7 @@
|
|
|
53
57
|
font-weight: 500;
|
|
54
58
|
line-height: 1.3;
|
|
55
59
|
margin: 0;
|
|
56
|
-
@media only screen and (min-width:
|
|
60
|
+
@media only screen and (min-width: viewports.$screen-sm) {
|
|
57
61
|
font-size: 24px;
|
|
58
62
|
}
|
|
59
63
|
}
|
|
@@ -8,18 +8,16 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _ErrorMessageModule = _interopRequireDefault(require("./ErrorMessage.module.scss"));
|
|
10
10
|
var _errorSign = _interopRequireDefault(require("../assets/svg/error-sign.svg?url"));
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
13
|
const ErrorMessage = props => {
|
|
14
|
-
var _props$content;
|
|
15
14
|
const getErrorElementProps = () => {
|
|
16
|
-
var _props$id;
|
|
17
15
|
return {
|
|
18
|
-
id: !!
|
|
16
|
+
id: !!props.id?.length ? props.id : null,
|
|
19
17
|
className: _ErrorMessageModule.default.errorMessage
|
|
20
18
|
};
|
|
21
19
|
};
|
|
22
|
-
return props
|
|
20
|
+
return props?.content?.length ? _react.default.createElement("span", _extends({
|
|
23
21
|
"aria-live": "polite"
|
|
24
22
|
}, getErrorElementProps()), _react.default.createElement("img", {
|
|
25
23
|
src: _errorSign.default,
|