dibk-design 0.4.45 → 0.4.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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.md +7 -7
- package/dist/components/Footer.module.scss +11 -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/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 +8 -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 +29 -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
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
@import "../style/global.scss";
|
|
2
|
-
|
|
3
|
-
:local(.contentBox) {
|
|
4
|
-
font-family: $default-font;
|
|
5
|
-
text-decoration: none;
|
|
6
|
-
padding: 20px;
|
|
7
|
-
width: 100%;
|
|
8
|
-
display: block;
|
|
9
|
-
&:local(.link) {
|
|
10
|
-
color: $color-primary;
|
|
11
|
-
@include transition(filter 0.3s);
|
|
12
|
-
&:hover,
|
|
13
|
-
&:focus {
|
|
14
|
-
filter: brightness(90%);
|
|
15
|
-
}
|
|
16
|
-
&:active {
|
|
17
|
-
filter: brightness(85%);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
&:local(.default) {
|
|
21
|
-
background-color: $color-default;
|
|
22
|
-
:local(.content),
|
|
23
|
-
:local(.title) {
|
|
24
|
-
color: #000;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
&:local(.primary) {
|
|
28
|
-
background-color: $color-primary;
|
|
29
|
-
color: #fff;
|
|
30
|
-
:local(.content),
|
|
31
|
-
:local(.title) {
|
|
32
|
-
color: #fff;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
&:local(.success) {
|
|
36
|
-
background-color: $color-success;
|
|
37
|
-
color: #fff;
|
|
38
|
-
:local(.content),
|
|
39
|
-
:local(.title) {
|
|
40
|
-
color: #fff;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
&:local(.warning) {
|
|
44
|
-
background-color: $color-warning;
|
|
45
|
-
color: #fff;
|
|
46
|
-
:local(.content),
|
|
47
|
-
:local(.title) {
|
|
48
|
-
color: #fff;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&:local(.info) {
|
|
53
|
-
background-color: $color-info;
|
|
54
|
-
:local(.content),
|
|
55
|
-
:local(.title) {
|
|
56
|
-
color: #000;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
&:local(.lightCyan) {
|
|
60
|
-
background-color: $color-light-cyan;
|
|
61
|
-
:local(.content),
|
|
62
|
-
:local(.title) {
|
|
63
|
-
color: #000;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
&:local(.orange) {
|
|
67
|
-
background-color: $color-orange;
|
|
68
|
-
color: #fff;
|
|
69
|
-
:local(.content),
|
|
70
|
-
:local(.title) {
|
|
71
|
-
color: #fff;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
&:local(.lightOrange) {
|
|
75
|
-
background-color: $color-light-orange;
|
|
76
|
-
:local(.content),
|
|
77
|
-
:local(.title) {
|
|
78
|
-
color: #000;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
&:local(.lime) {
|
|
82
|
-
background-color: $color-lime;
|
|
83
|
-
color: #fff;
|
|
84
|
-
:local(.content),
|
|
85
|
-
:local(.title) {
|
|
86
|
-
color: #fff;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
&:local(.lightLime) {
|
|
90
|
-
background-color: $color-light-lime;
|
|
91
|
-
:local(.content),
|
|
92
|
-
:local(.title) {
|
|
93
|
-
color: #000;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
:local(.title) {
|
|
98
|
-
&:local(.regular) {
|
|
99
|
-
font-family: "Open Sans";
|
|
100
|
-
font-weight: bold;
|
|
101
|
-
font-size: 21px;
|
|
102
|
-
font-style: normal;
|
|
103
|
-
line-height: 1.4;
|
|
104
|
-
padding-bottom: 10px;
|
|
105
|
-
border-bottom: 1px solid #e5e3e1;
|
|
106
|
-
}
|
|
107
|
-
&:local(.large) {
|
|
108
|
-
font-family: "Open Sans";
|
|
109
|
-
font-weight: normal;
|
|
110
|
-
font-size: 24px;
|
|
111
|
-
margin: 0;
|
|
112
|
-
margin-bottom: 20px;
|
|
113
|
-
font-style: normal;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
1
|
+
@import "../style/global.scss";
|
|
2
|
+
|
|
3
|
+
:local(.contentBox) {
|
|
4
|
+
font-family: $default-font;
|
|
5
|
+
text-decoration: none;
|
|
6
|
+
padding: 20px;
|
|
7
|
+
width: 100%;
|
|
8
|
+
display: block;
|
|
9
|
+
&:local(.link) {
|
|
10
|
+
color: $color-primary;
|
|
11
|
+
@include transition(filter 0.3s);
|
|
12
|
+
&:hover,
|
|
13
|
+
&:focus {
|
|
14
|
+
filter: brightness(90%);
|
|
15
|
+
}
|
|
16
|
+
&:active {
|
|
17
|
+
filter: brightness(85%);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
&:local(.default) {
|
|
21
|
+
background-color: $color-default;
|
|
22
|
+
:local(.content),
|
|
23
|
+
:local(.title) {
|
|
24
|
+
color: #000;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
&:local(.primary) {
|
|
28
|
+
background-color: $color-primary;
|
|
29
|
+
color: #fff;
|
|
30
|
+
:local(.content),
|
|
31
|
+
:local(.title) {
|
|
32
|
+
color: #fff;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
&:local(.success) {
|
|
36
|
+
background-color: $color-success;
|
|
37
|
+
color: #fff;
|
|
38
|
+
:local(.content),
|
|
39
|
+
:local(.title) {
|
|
40
|
+
color: #fff;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
&:local(.warning) {
|
|
44
|
+
background-color: $color-warning;
|
|
45
|
+
color: #fff;
|
|
46
|
+
:local(.content),
|
|
47
|
+
:local(.title) {
|
|
48
|
+
color: #fff;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:local(.info) {
|
|
53
|
+
background-color: $color-info;
|
|
54
|
+
:local(.content),
|
|
55
|
+
:local(.title) {
|
|
56
|
+
color: #000;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
&:local(.lightCyan) {
|
|
60
|
+
background-color: $color-light-cyan;
|
|
61
|
+
:local(.content),
|
|
62
|
+
:local(.title) {
|
|
63
|
+
color: #000;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
&:local(.orange) {
|
|
67
|
+
background-color: $color-orange;
|
|
68
|
+
color: #fff;
|
|
69
|
+
:local(.content),
|
|
70
|
+
:local(.title) {
|
|
71
|
+
color: #fff;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
&:local(.lightOrange) {
|
|
75
|
+
background-color: $color-light-orange;
|
|
76
|
+
:local(.content),
|
|
77
|
+
:local(.title) {
|
|
78
|
+
color: #000;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
&:local(.lime) {
|
|
82
|
+
background-color: $color-lime;
|
|
83
|
+
color: #fff;
|
|
84
|
+
:local(.content),
|
|
85
|
+
:local(.title) {
|
|
86
|
+
color: #fff;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
&:local(.lightLime) {
|
|
90
|
+
background-color: $color-light-lime;
|
|
91
|
+
:local(.content),
|
|
92
|
+
:local(.title) {
|
|
93
|
+
color: #000;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:local(.title) {
|
|
98
|
+
&:local(.regular) {
|
|
99
|
+
font-family: "Open Sans";
|
|
100
|
+
font-weight: bold;
|
|
101
|
+
font-size: 21px;
|
|
102
|
+
font-style: normal;
|
|
103
|
+
line-height: 1.4;
|
|
104
|
+
padding-bottom: 10px;
|
|
105
|
+
border-bottom: 1px solid #e5e3e1;
|
|
106
|
+
}
|
|
107
|
+
&:local(.large) {
|
|
108
|
+
font-family: "Open Sans";
|
|
109
|
+
font-weight: normal;
|
|
110
|
+
font-size: 24px;
|
|
111
|
+
margin: 0;
|
|
112
|
+
margin-bottom: 20px;
|
|
113
|
+
font-style: normal;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Dialog example:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
```html
|
|
5
|
-
<Dialog onClickOutside={() => {console.log('clicked outside')}} closeButton>Dialog title<p>dialog paragraph</p></Dialog>
|
|
1
|
+
Dialog example:
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
```html
|
|
5
|
+
<Dialog onClickOutside={() => {console.log('clicked outside')}} closeButton>Dialog title<p>dialog paragraph</p></Dialog>
|
|
6
6
|
```
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
@import "../style/global.scss";
|
|
2
|
-
|
|
3
|
-
:local(.hidden) {
|
|
4
|
-
width: 0;
|
|
5
|
-
height: 0;
|
|
6
|
-
border: none;
|
|
7
|
-
position: absolute;
|
|
8
|
-
padding: 0;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
:local(.dialogOverlay) {
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-wrap: wrap;
|
|
14
|
-
position: fixed;
|
|
15
|
-
width: 100%;
|
|
16
|
-
background: rgba(0, 0, 0, 0.25);
|
|
17
|
-
height: 100%;
|
|
18
|
-
top: 0;
|
|
19
|
-
left: 0;
|
|
20
|
-
align-content: center;
|
|
21
|
-
padding: 8px 28px;
|
|
22
|
-
z-index: 2;
|
|
23
|
-
justify-content: center;
|
|
24
|
-
@media (min-width: $screen-md) {
|
|
25
|
-
padding: 36px;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
:local(.dialogContent) {
|
|
29
|
-
@include calc("max-height", "100% - 128px");
|
|
30
|
-
@include box-shadow(
|
|
31
|
-
0 11px 15px -7px rgba(0, 0, 0, 0.2),
|
|
32
|
-
0 24px 38px 3px rgba(0, 0, 0, 0.14),
|
|
33
|
-
0 9px 46px 8px rgba(0, 0, 0, 0.12)
|
|
34
|
-
);
|
|
35
|
-
max-width: 540px;
|
|
36
|
-
width: 100%;
|
|
37
|
-
background-color: #fff;
|
|
38
|
-
overflow: auto;
|
|
39
|
-
position: relative;
|
|
40
|
-
&:not(:local(.noPadding)) {
|
|
41
|
-
padding: 30px 15px;
|
|
42
|
-
@media only screen and (min-width: $screen-sm) {
|
|
43
|
-
padding: 60px 40px;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
@media (min-width: $screen-md) {
|
|
47
|
-
@include calc("width", "100% - 128px");
|
|
48
|
-
max-height: 100%;
|
|
49
|
-
}
|
|
50
|
-
:local(.closeButton) {
|
|
51
|
-
background: none;
|
|
52
|
-
border: none;
|
|
53
|
-
color: $color-primary;
|
|
54
|
-
display: inline-block;
|
|
55
|
-
position: absolute;
|
|
56
|
-
right: 7px;
|
|
57
|
-
top: 4px;
|
|
58
|
-
text-decoration: underline;
|
|
59
|
-
font-size: 19px;
|
|
60
|
-
cursor: pointer;
|
|
61
|
-
@media only screen and (min-width: $screen-sm) {
|
|
62
|
-
right: 15px;
|
|
63
|
-
top: 10px;
|
|
64
|
-
}
|
|
65
|
-
&:hover {
|
|
66
|
-
text-decoration: none;
|
|
67
|
-
}
|
|
68
|
-
&::after {
|
|
69
|
-
font-family: "Helvetica", "Arial", sans-serif;
|
|
70
|
-
display: inline-block;
|
|
71
|
-
content: "\00d7";
|
|
72
|
-
font-size: 30px;
|
|
73
|
-
line-height: 20px;
|
|
74
|
-
margin-left: 5px;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
1
|
+
@import "../style/global.scss";
|
|
2
|
+
|
|
3
|
+
:local(.hidden) {
|
|
4
|
+
width: 0;
|
|
5
|
+
height: 0;
|
|
6
|
+
border: none;
|
|
7
|
+
position: absolute;
|
|
8
|
+
padding: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:local(.dialogOverlay) {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-wrap: wrap;
|
|
14
|
+
position: fixed;
|
|
15
|
+
width: 100%;
|
|
16
|
+
background: rgba(0, 0, 0, 0.25);
|
|
17
|
+
height: 100%;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
align-content: center;
|
|
21
|
+
padding: 8px 28px;
|
|
22
|
+
z-index: 2;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
@media (min-width: $screen-md) {
|
|
25
|
+
padding: 36px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:local(.dialogContent) {
|
|
29
|
+
@include calc("max-height", "100% - 128px");
|
|
30
|
+
@include box-shadow(
|
|
31
|
+
0 11px 15px -7px rgba(0, 0, 0, 0.2),
|
|
32
|
+
0 24px 38px 3px rgba(0, 0, 0, 0.14),
|
|
33
|
+
0 9px 46px 8px rgba(0, 0, 0, 0.12)
|
|
34
|
+
);
|
|
35
|
+
max-width: 540px;
|
|
36
|
+
width: 100%;
|
|
37
|
+
background-color: #fff;
|
|
38
|
+
overflow: auto;
|
|
39
|
+
position: relative;
|
|
40
|
+
&:not(:local(.noPadding)) {
|
|
41
|
+
padding: 30px 15px;
|
|
42
|
+
@media only screen and (min-width: $screen-sm) {
|
|
43
|
+
padding: 60px 40px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
@media (min-width: $screen-md) {
|
|
47
|
+
@include calc("width", "100% - 128px");
|
|
48
|
+
max-height: 100%;
|
|
49
|
+
}
|
|
50
|
+
:local(.closeButton) {
|
|
51
|
+
background: none;
|
|
52
|
+
border: none;
|
|
53
|
+
color: $color-primary;
|
|
54
|
+
display: inline-block;
|
|
55
|
+
position: absolute;
|
|
56
|
+
right: 7px;
|
|
57
|
+
top: 4px;
|
|
58
|
+
text-decoration: underline;
|
|
59
|
+
font-size: 19px;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
@media only screen and (min-width: $screen-sm) {
|
|
62
|
+
right: 15px;
|
|
63
|
+
top: 10px;
|
|
64
|
+
}
|
|
65
|
+
&:hover {
|
|
66
|
+
text-decoration: none;
|
|
67
|
+
}
|
|
68
|
+
&::after {
|
|
69
|
+
font-family: "Helvetica", "Arial", sans-serif;
|
|
70
|
+
display: inline-block;
|
|
71
|
+
content: "\00d7";
|
|
72
|
+
font-size: 30px;
|
|
73
|
+
line-height: 20px;
|
|
74
|
+
margin-left: 5px;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -13,6 +13,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
|
|
14
14
|
var _Button = _interopRequireDefault(require("./Button"));
|
|
15
15
|
|
|
16
|
+
var _ErrorMessage = _interopRequireDefault(require("./ErrorMessage"));
|
|
17
|
+
|
|
16
18
|
var _DragAndDropFileInputModule = _interopRequireDefault(require("./DragAndDropFileInput.module.scss"));
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -167,9 +169,10 @@ var DragAndDropFileInput = /*#__PURE__*/function (_React$Component) {
|
|
|
167
169
|
return _this2.handleAddButtonOnClick();
|
|
168
170
|
},
|
|
169
171
|
content: buttonContent
|
|
170
|
-
})) : '') : ''), this.props.contentOnly ? /*#__PURE__*/_react.default.createElement("span", null, this.renderValueAsText(this.props.selectedFileName, this.props.defaultContent)) : '', /*#__PURE__*/_react.default.createElement(
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
})) : '') : ''), this.props.contentOnly ? /*#__PURE__*/_react.default.createElement("span", null, this.renderValueAsText(this.props.selectedFileName, this.props.defaultContent)) : '', /*#__PURE__*/_react.default.createElement(_ErrorMessage.default, {
|
|
173
|
+
content: this.props.errorMessage,
|
|
174
|
+
theme: this.props.theme
|
|
175
|
+
}));
|
|
173
176
|
}
|
|
174
177
|
}]);
|
|
175
178
|
|
|
@@ -190,7 +193,8 @@ DragAndDropFileInput.propTypes = {
|
|
|
190
193
|
defaultContent: _propTypes.default.string,
|
|
191
194
|
hasErrors: _propTypes.default.bool,
|
|
192
195
|
errorMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))]),
|
|
193
|
-
mandatory: _propTypes.default.bool
|
|
196
|
+
mandatory: _propTypes.default.bool,
|
|
197
|
+
theme: _propTypes.default.object
|
|
194
198
|
};
|
|
195
199
|
DragAndDropFileInput.defaultProps = {
|
|
196
200
|
label: '',
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
Drag and drop file input examples:
|
|
2
|
-
|
|
3
|
-
```js
|
|
4
|
-
<DragAndDropFileInput id="dragAndDropInput-1" label="Input without selected file" buttonContent="Velg fil" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} />
|
|
5
|
-
|
|
6
|
-
<DragAndDropFileInput id="dragAndDropInput-2" label="Input with selected file" buttonContent="Velg fil" selectedFileName="important-file.xml" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} />
|
|
7
|
-
|
|
8
|
-
<DragAndDropFileInput id="dragAndDropInput-3" label="Input with selected file and buttonContentWhenSelectedFile" buttonContent="Velg fil" buttonContentWhenSelectedFile="Velg annen fil" selectedFileName="important-file.xml" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} />
|
|
9
|
-
|
|
10
|
-
<DragAndDropFileInput id="dragAndDropInput-4" label="Input with selected file and error message" buttonContent="Velg fil" buttonContentWhenSelectedFile="Velg annen fil" selectedFileName="wrong-file.xml" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} hasErrors errorMessage="Filen må være midre enn 15MB" />
|
|
11
|
-
|
|
12
|
-
<DragAndDropFileInput id="dragAndDropInput-5" label="Input with selected file and contentOnly" buttonContent="Velg fil" selectedFileName="important-file2.xml" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} contentOnly={true} />
|
|
13
|
-
```
|
|
1
|
+
Drag and drop file input examples:
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
<DragAndDropFileInput id="dragAndDropInput-1" label="Input without selected file" buttonContent="Velg fil" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} />
|
|
5
|
+
|
|
6
|
+
<DragAndDropFileInput id="dragAndDropInput-2" label="Input with selected file" buttonContent="Velg fil" selectedFileName="important-file.xml" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} />
|
|
7
|
+
|
|
8
|
+
<DragAndDropFileInput id="dragAndDropInput-3" label="Input with selected file and buttonContentWhenSelectedFile" buttonContent="Velg fil" buttonContentWhenSelectedFile="Velg annen fil" selectedFileName="important-file.xml" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} />
|
|
9
|
+
|
|
10
|
+
<DragAndDropFileInput id="dragAndDropInput-4" label="Input with selected file and error message" buttonContent="Velg fil" buttonContentWhenSelectedFile="Velg annen fil" selectedFileName="wrong-file.xml" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} hasErrors errorMessage="Filen må være midre enn 15MB" />
|
|
11
|
+
|
|
12
|
+
<DragAndDropFileInput id="dragAndDropInput-5" label="Input with selected file and contentOnly" buttonContent="Velg fil" selectedFileName="important-file2.xml" onSelectChange={() => console.log('Select change')} onDragAndDropChange={() => console.log('Drag and drop change')} contentOnly={true} />
|
|
13
|
+
```
|
|
@@ -1,45 +1,36 @@
|
|
|
1
|
-
@import "../style/global.scss";
|
|
2
|
-
|
|
3
|
-
:local(.dragAndDropFileInput) {
|
|
4
|
-
label {
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
font-size: 18px;
|
|
7
|
-
margin: 0 0 4px;
|
|
8
|
-
font-family: "Open Sans", arial, sans-serif;
|
|
9
|
-
line-height: 1.3;
|
|
10
|
-
font-weight: bold;
|
|
11
|
-
font-style: normal;
|
|
12
|
-
display: block;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
:local(.dragAndDropContainer) {
|
|
16
|
-
@include transition(all 0.1s ease-in-out);
|
|
17
|
-
border: 2px dashed #ccc;
|
|
18
|
-
border-radius: 20px;
|
|
19
|
-
width: 100%;
|
|
20
|
-
padding: 20px;
|
|
21
|
-
text-align: center;
|
|
22
|
-
|
|
23
|
-
input {
|
|
24
|
-
display: none;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
button {
|
|
28
|
-
margin: 14px 0 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&:local(.highlighted) {
|
|
32
|
-
background: $color-default;
|
|
33
|
-
border-color: $color-dark-blue;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
color: $color-error-text;
|
|
38
|
-
font-size: 19px;
|
|
39
|
-
font-weight: 400;
|
|
40
|
-
line-height: 1.6;
|
|
41
|
-
font-family: "Open Sans", sans-serif;
|
|
42
|
-
font-style: italic;
|
|
43
|
-
overflow-wrap: break-word;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
@import "../style/global.scss";
|
|
2
|
+
|
|
3
|
+
:local(.dragAndDropFileInput) {
|
|
4
|
+
label {
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
font-size: 18px;
|
|
7
|
+
margin: 0 0 4px;
|
|
8
|
+
font-family: "Open Sans", arial, sans-serif;
|
|
9
|
+
line-height: 1.3;
|
|
10
|
+
font-weight: bold;
|
|
11
|
+
font-style: normal;
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:local(.dragAndDropContainer) {
|
|
16
|
+
@include transition(all 0.1s ease-in-out);
|
|
17
|
+
border: 2px dashed #ccc;
|
|
18
|
+
border-radius: 20px;
|
|
19
|
+
width: 100%;
|
|
20
|
+
padding: 20px;
|
|
21
|
+
text-align: center;
|
|
22
|
+
|
|
23
|
+
input {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
button {
|
|
28
|
+
margin: 14px 0 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:local(.highlighted) {
|
|
32
|
+
background: $color-default;
|
|
33
|
+
border-color: $color-dark-blue;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _theme = require("../functions/theme");
|
|
15
|
+
|
|
16
|
+
var _ErrorMessageModule = _interopRequireDefault(require("./ErrorMessage.module.scss"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
+
|
|
22
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23
|
+
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
+
|
|
26
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
+
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
|
|
30
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
+
|
|
32
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
|
+
|
|
34
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
+
|
|
36
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
+
|
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
+
|
|
40
|
+
var ErrorMessage = /*#__PURE__*/function (_React$Component) {
|
|
41
|
+
_inherits(ErrorMessage, _React$Component);
|
|
42
|
+
|
|
43
|
+
var _super = _createSuper(ErrorMessage);
|
|
44
|
+
|
|
45
|
+
function ErrorMessage() {
|
|
46
|
+
_classCallCheck(this, ErrorMessage);
|
|
47
|
+
|
|
48
|
+
return _super.apply(this, arguments);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
_createClass(ErrorMessage, [{
|
|
52
|
+
key: "getThemeErrorMessageStyle",
|
|
53
|
+
value: function getThemeErrorMessageStyle(theme) {
|
|
54
|
+
return {
|
|
55
|
+
color: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "render",
|
|
60
|
+
value: function render() {
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
62
|
+
className: _ErrorMessageModule.default.errorMessage,
|
|
63
|
+
style: this.getThemeErrorMessageStyle(this.props.theme)
|
|
64
|
+
}, this.props.content ? this.props.content : '');
|
|
65
|
+
}
|
|
66
|
+
}]);
|
|
67
|
+
|
|
68
|
+
return ErrorMessage;
|
|
69
|
+
}(_react.default.Component);
|
|
70
|
+
|
|
71
|
+
ErrorMessage.propTypes = {
|
|
72
|
+
/** Text content inside error message */
|
|
73
|
+
content: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))]),
|
|
74
|
+
theme: _propTypes.default.object
|
|
75
|
+
};
|
|
76
|
+
ErrorMessage.defaultProps = {
|
|
77
|
+
content: ''
|
|
78
|
+
};
|
|
79
|
+
var _default = ErrorMessage;
|
|
80
|
+
exports.default = _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Error message example:
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
<ErrorMessage content="Wrong value" />
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Themed error message example:
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
import customTheme from 'data/customTheme';
|
|
12
|
+
<React.Fragment>
|
|
13
|
+
<ErrorMessage content="Wrong value" theme={customTheme} />
|
|
14
|
+
</React.Fragment>
|
|
15
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@import "../style/global.scss";
|
|
2
|
+
|
|
3
|
+
:local(.errorMessage) {
|
|
4
|
+
display: block;
|
|
5
|
+
color: $color-error-text;
|
|
6
|
+
font-size: 16px;
|
|
7
|
+
font-weight: 400;
|
|
8
|
+
line-height: 1.2;
|
|
9
|
+
margin: 4px 0;
|
|
10
|
+
font-family: "Open Sans", sans-serif;
|
|
11
|
+
font-style: italic;
|
|
12
|
+
overflow-wrap: break-word;
|
|
13
|
+
@media only screen and (min-width: $screen-sm) {
|
|
14
|
+
font-size: 19px;
|
|
15
|
+
}
|
|
16
|
+
}
|