dibk-design 4.5.0 → 5.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/assets/svg/arbeidstilsynet-logo.svg +1 -0
- package/dist/components/Accordion.module.scss +6 -6
- package/dist/components/Button.js +7 -24
- package/dist/components/Button.module.scss +92 -98
- package/dist/components/CheckBoxIcon.js +0 -9
- package/dist/components/CheckBoxIcon.module.scss +6 -6
- package/dist/components/CheckBoxInput.js +0 -2
- package/dist/components/CheckBoxInput.module.scss +3 -3
- package/dist/components/CheckBoxListItem.js +1 -3
- package/dist/components/CheckBoxListItem.module.scss +4 -4
- package/dist/components/ContentBox.module.scss +6 -6
- package/dist/components/Dialog.module.scss +1 -1
- package/dist/components/DragAndDropFileInput.js +3 -5
- package/dist/components/DragAndDropFileInput.module.scss +3 -3
- package/dist/components/ErrorBox.js +1 -9
- package/dist/components/ErrorBox.module.scss +4 -4
- package/dist/components/ErrorMessage.js +2 -10
- package/dist/components/Footer.module.scss +1 -1
- package/dist/components/Header.js +1 -3
- package/dist/components/Header.module.scss +1 -3
- package/dist/components/InfoBox.js +1 -12
- package/dist/components/InfoBox.module.scss +3 -3
- package/dist/components/InputField.js +3 -14
- package/dist/components/InputField.module.scss +7 -7
- package/dist/components/NavigationBar.js +6 -30
- package/dist/components/NavigationBar.module.scss +25 -27
- package/dist/components/NavigationBarListItem.js +3 -15
- package/dist/components/PDF.scss +9 -5
- package/dist/components/ProgressBar.module.scss +2 -2
- package/dist/components/RadioButtonIcon.js +0 -9
- package/dist/components/RadioButtonIcon.module.scss +6 -6
- package/dist/components/RadioButtonInput.js +0 -2
- package/dist/components/RadioButtonInput.module.scss +3 -3
- package/dist/components/RadioButtonListItem.js +2 -4
- package/dist/components/RadioButtonListItem.module.scss +6 -6
- package/dist/components/Select.js +4 -21
- package/dist/components/Select.module.scss +6 -6
- package/dist/components/Table.module.scss +5 -5
- package/dist/components/Textarea.js +2 -12
- package/dist/components/Textarea.module.scss +5 -5
- package/dist/components/Theme.js +97 -51
- package/dist/components/Theme.module.scss +86 -21
- package/dist/components/ThemeProvider.js +24 -0
- package/dist/components/ThemeProvider.module.scss +22 -0
- package/dist/components/WizardNavigation/Step.module.scss +8 -8
- package/dist/functions/helpers.js +49 -1
- package/dist/functions/theme.js +2 -37
- package/dist/index.js +7 -0
- package/dist/style/abstracts/variables/_colors.scss +12 -16
- package/dist/style/base/_fonts.scss +0 -106
- package/dist/style/pdf.css +6 -5
- package/dist/style/pdf.css.map +1 -1
- package/package.json +2 -1
- package/dist/assets/fonts/Altis-Light.eot +0 -0
- package/dist/assets/fonts/Altis-Light.svg +0 -326
- package/dist/assets/fonts/Altis-Light.ttf +0 -0
- package/dist/assets/fonts/Altis-Light.woff +0 -0
- package/dist/assets/fonts/Altis.eot +0 -0
- package/dist/assets/fonts/Altis.svg +0 -327
- package/dist/assets/fonts/Altis.ttf +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300.eot +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300.svg +0 -346
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300.ttf +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300.woff +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300.woff2 +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300italic.eot +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300italic.svg +0 -377
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300italic.ttf +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300italic.woff +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300italic.woff2 +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700.eot +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700.svg +0 -349
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700.ttf +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700.woff +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700.woff2 +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700italic.eot +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700italic.svg +0 -379
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700italic.ttf +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700italic.woff +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700italic.woff2 +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-italic.eot +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-italic.svg +0 -379
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-italic.ttf +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-italic.woff +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-italic.woff2 +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-regular.eot +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-regular.svg +0 -349
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-regular.ttf +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-regular.woff +0 -0
- package/dist/assets/fonts/open-sans-v27-latin-ext_latin-regular.woff2 +0 -0
package/dist/components/PDF.scss
CHANGED
|
@@ -12,6 +12,8 @@ $font-size-table-header: 15px;
|
|
|
12
12
|
$font-size-table-data: 16px;
|
|
13
13
|
$font-size-checkbox: 20px;
|
|
14
14
|
|
|
15
|
+
$line-height-default: 22.5px;
|
|
16
|
+
|
|
15
17
|
$height-checkbox: 22px;
|
|
16
18
|
$width-checkbox: 22px;
|
|
17
19
|
|
|
@@ -62,7 +64,6 @@ body {
|
|
|
62
64
|
font-family: Carlito, sans-serif;
|
|
63
65
|
color: #000;
|
|
64
66
|
font-size: $font-size-body;
|
|
65
|
-
line-height: 1.25em;
|
|
66
67
|
font-weight: normal;
|
|
67
68
|
font-style: normal;
|
|
68
69
|
}
|
|
@@ -79,6 +80,7 @@ body {
|
|
|
79
80
|
font-family: Carlito, sans-serif;
|
|
80
81
|
color: #000;
|
|
81
82
|
font-size: $font-size-body;
|
|
83
|
+
line-height: $line-height-default;
|
|
82
84
|
}
|
|
83
85
|
@page {
|
|
84
86
|
size: A4 portrait;
|
|
@@ -324,8 +326,8 @@ body {
|
|
|
324
326
|
}
|
|
325
327
|
|
|
326
328
|
blockquote {
|
|
327
|
-
background: $color-secondary-x-light;
|
|
328
|
-
border-left: $border-left-width-blockquote solid $color-secondary;
|
|
329
|
+
background: var(--color-secondary-x-light, $color-secondary-x-light);
|
|
330
|
+
border-left: $border-left-width-blockquote solid var(--color-secondary-text, $color-secondary-text);
|
|
329
331
|
margin: $margin-vertical-blockquote $margin-horizontal-blockquote;
|
|
330
332
|
padding: 0.5em $padding-horizontal-blockquote;
|
|
331
333
|
min-height: $min-height-blockquote;
|
|
@@ -405,6 +407,7 @@ body {
|
|
|
405
407
|
padding-left: 0.2cm;
|
|
406
408
|
padding-right: 0.2cm;
|
|
407
409
|
font-size: calc($font-size-body * $scaling-for-signed-documents);
|
|
410
|
+
line-height: calc($line-height-default * $scaling-for-signed-documents);
|
|
408
411
|
div.content-container {
|
|
409
412
|
.heading-logo {
|
|
410
413
|
width: calc($heading-logo-width * $scaling-for-signed-documents);
|
|
@@ -510,8 +513,9 @@ body {
|
|
|
510
513
|
}
|
|
511
514
|
|
|
512
515
|
blockquote {
|
|
513
|
-
background: $color-secondary-x-light;
|
|
514
|
-
border-left: calc($border-left-width-blockquote * $scaling-for-signed-documents) solid
|
|
516
|
+
background: var(--color-secondary-x-light, $color-secondary-x-light);
|
|
517
|
+
border-left: calc($border-left-width-blockquote * $scaling-for-signed-documents) solid
|
|
518
|
+
var(--color-secondary-text, $color-secondary-text);
|
|
515
519
|
margin: calc($margin-vertical-blockquote * $scaling-for-signed-documents)
|
|
516
520
|
calc($margin-horizontal-blockquote * $scaling-for-signed-documents);
|
|
517
521
|
padding: 0.5em calc($padding-horizontal-blockquote * $scaling-for-signed-documents);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
.progressBar {
|
|
4
4
|
--size: 4rem;
|
|
5
|
-
--fg: #{$color-primary};
|
|
5
|
+
--fg: #{var(--color-primary, $color-primary)};
|
|
6
6
|
--bg: #e2e1e0;
|
|
7
7
|
--pgPercentage: var(--value);
|
|
8
8
|
width: var(--size);
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
content: counter(percentage) "%";
|
|
22
22
|
}
|
|
23
23
|
&.hasErrors {
|
|
24
|
-
--fg: #{$color-error};
|
|
24
|
+
--fg: #{var(--color-error, $color-error)};
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _theme = require("../functions/theme");
|
|
10
9
|
var _RadioButtonIconModule = _interopRequireDefault(require("./RadioButtonIcon.module.scss"));
|
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
11
|
const RadioButtonIcon = props => {
|
|
@@ -14,13 +13,6 @@ const RadioButtonIcon = props => {
|
|
|
14
13
|
height: props.size,
|
|
15
14
|
width: props.size
|
|
16
15
|
};
|
|
17
|
-
if (props.theme && props.checked) {
|
|
18
|
-
inlineStyle = {
|
|
19
|
-
...inlineStyle,
|
|
20
|
-
[!props.hasErrors && "background"]: (0, _theme.getThemePaletteBackgroundColor)(props.theme, "primary"),
|
|
21
|
-
[!props.hasErrors && "boxShadow"]: "0 0 0 1px ".concat((0, _theme.getThemePaletteBackgroundColor)(props.theme, "primary"))
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
16
|
const radioButtonIconProps = {
|
|
25
17
|
className: "".concat(_RadioButtonIconModule.default.radioButtonIcon, " ").concat(props.checked ? _RadioButtonIconModule.default.checked : "", " ").concat(props.disabled ? _RadioButtonIconModule.default.disabled : "", " ").concat(props.hasErrors ? _RadioButtonIconModule.default.hasErrors : ""),
|
|
26
18
|
style: inlineStyle
|
|
@@ -31,7 +23,6 @@ RadioButtonIcon.propTypes = {
|
|
|
31
23
|
size: _propTypes.default.string,
|
|
32
24
|
checked: _propTypes.default.bool,
|
|
33
25
|
disabled: _propTypes.default.bool,
|
|
34
|
-
theme: _propTypes.default.object,
|
|
35
26
|
hasErrors: _propTypes.default.bool
|
|
36
27
|
};
|
|
37
28
|
RadioButtonIcon.defaultProps = {
|
|
@@ -16,22 +16,22 @@
|
|
|
16
16
|
cursor: pointer;
|
|
17
17
|
|
|
18
18
|
&:not(.hasErrors) {
|
|
19
|
-
@include box-shadow(0 0 0 1px $color-primary);
|
|
19
|
+
@include box-shadow(0 0 0 1px var(--color-primary, $color-primary));
|
|
20
20
|
}
|
|
21
21
|
&.hasErrors {
|
|
22
|
-
@include box-shadow(0 0 0 1px $color-error);
|
|
22
|
+
@include box-shadow(0 0 0 1px var(--color-error, $color-error));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
&.checked {
|
|
26
|
-
background: $color-primary;
|
|
26
|
+
background: var(--color-primary, $color-primary);
|
|
27
27
|
&.hasErrors {
|
|
28
|
-
background: $color-error;
|
|
28
|
+
background: var(--color-error, $color-error);
|
|
29
29
|
}
|
|
30
30
|
&:not(.hasErrors) {
|
|
31
|
-
@include box-shadow(0 0 0 1px $color-primary);
|
|
31
|
+
@include box-shadow(0 0 0 1px var(--color-primary, $color-primary));
|
|
32
32
|
}
|
|
33
33
|
&.hasErrors {
|
|
34
|
-
@include box-shadow(0 0 0 1px $color-error);
|
|
34
|
+
@include box-shadow(0 0 0 1px var(--color-error, $color-error));
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
&.disabled {
|
|
@@ -18,7 +18,6 @@ const RadioButtonInput = props => {
|
|
|
18
18
|
const iconProps = {
|
|
19
19
|
checked: props.checked,
|
|
20
20
|
disabled: props.disabled,
|
|
21
|
-
theme: props.theme,
|
|
22
21
|
hasErrors: !props.contentOnly && props.hasErrors
|
|
23
22
|
};
|
|
24
23
|
const inputProps = {
|
|
@@ -53,7 +52,6 @@ RadioButtonInput.propTypes = {
|
|
|
53
52
|
onChange: _propTypes.default.func,
|
|
54
53
|
contentOnly: _propTypes.default.bool,
|
|
55
54
|
hasErrors: _propTypes.default.bool,
|
|
56
|
-
theme: _propTypes.default.object,
|
|
57
55
|
inputValue: _propTypes.default.string.isRequired,
|
|
58
56
|
"aria-controls": _propTypes.default.string,
|
|
59
57
|
"aria-describedby": _propTypes.default.string
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
.labelText {
|
|
24
24
|
font-size: 16px;
|
|
25
25
|
line-height: 24px;
|
|
26
|
-
color: $color-primary;
|
|
26
|
+
color: var(--color-primary, $color-primary);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
&.disabled {
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
|
|
35
35
|
&.hasErrors {
|
|
36
36
|
span {
|
|
37
|
-
color: $color-error;
|
|
37
|
+
color: var(--color-error, $color-error);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
&:focus-within {
|
|
42
42
|
outline-width: 2px;
|
|
43
|
-
outline-color: $color-primary;
|
|
43
|
+
outline-color: var(--color-primary, $color-primary);
|
|
44
44
|
outline-style: auto;
|
|
45
45
|
outline-offset: 1px;
|
|
46
46
|
}
|
|
@@ -11,7 +11,7 @@ var _helpers = require("../functions/helpers");
|
|
|
11
11
|
var _RadioButtonListItemModule = _interopRequireDefault(require("./RadioButtonListItem.module.scss"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
const RadioButtonListItem = props => {
|
|
14
|
-
const listItemClassNameArray = [_RadioButtonListItemModule.default.radioButtonListItem, props.checked ? _RadioButtonListItemModule.default.checked : null, props.disabled ? _RadioButtonListItemModule.default.disabled : null, props.compact ? _RadioButtonListItemModule.default.compact : null, props.contentOnly ? _RadioButtonListItemModule.default.contentOnly : null, props.hasErrors ? _RadioButtonListItemModule.default.hasErrors : null
|
|
14
|
+
const listItemClassNameArray = [_RadioButtonListItemModule.default.radioButtonListItem, props.checked ? _RadioButtonListItemModule.default.checked : null, props.disabled ? _RadioButtonListItemModule.default.disabled : null, props.compact ? _RadioButtonListItemModule.default.compact : null, props.contentOnly ? _RadioButtonListItemModule.default.contentOnly : null, props.hasErrors ? _RadioButtonListItemModule.default.hasErrors : null];
|
|
15
15
|
const listItemClassNameString = (0, _helpers.classNameArrayToClassNameString)(listItemClassNameArray);
|
|
16
16
|
const inputProps = {
|
|
17
17
|
onChange: props.onChange,
|
|
@@ -25,8 +25,7 @@ const RadioButtonListItem = props => {
|
|
|
25
25
|
"aria-controls": props["aria-controls"],
|
|
26
26
|
"aria-describedby": props["aria-describedby"],
|
|
27
27
|
id: props.id,
|
|
28
|
-
name: props.name
|
|
29
|
-
theme: props.theme
|
|
28
|
+
name: props.name
|
|
30
29
|
};
|
|
31
30
|
return _react.default.createElement("div", {
|
|
32
31
|
className: listItemClassNameString
|
|
@@ -43,7 +42,6 @@ RadioButtonListItem.propTypes = {
|
|
|
43
42
|
onChange: _propTypes.default.func,
|
|
44
43
|
contentOnly: _propTypes.default.bool,
|
|
45
44
|
compact: _propTypes.default.bool,
|
|
46
|
-
theme: _propTypes.default.object,
|
|
47
45
|
hasErrors: _propTypes.default.bool,
|
|
48
46
|
"aria-controls": _propTypes.default.string,
|
|
49
47
|
"aria-describedby": _propTypes.default.string
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
color: #000;
|
|
21
21
|
|
|
22
22
|
&:not(.contentOnly):not(.compact) {
|
|
23
|
-
border: 1px solid $color-secondary-light;
|
|
23
|
+
border: 1px solid var(--color-secondary-light, $color-secondary-light);
|
|
24
24
|
background: white;
|
|
25
25
|
margin-bottom: 8px;
|
|
26
26
|
label {
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
&.checked:not(.contentOnly):not(.compact):not(.disabled)
|
|
46
|
-
background-color: $color-secondary-light;
|
|
45
|
+
&.checked:not(.contentOnly):not(.compact):not(.disabled) {
|
|
46
|
+
background-color: var(--color-secondary-light, $color-secondary-light);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
&:not(.checked):not(.contentOnly):not(.compact):not(.disabled):
|
|
49
|
+
&:not(.checked):not(.contentOnly):not(.compact):not(.disabled):hover {
|
|
50
50
|
&:hover {
|
|
51
|
-
background-color: $color-secondary-x-light;
|
|
51
|
+
background-color: var(--color-secondary-x-light, $color-secondary-x-light);
|
|
52
52
|
}
|
|
53
53
|
&:focus-within {
|
|
54
|
-
background-color: $color-secondary-x-light;
|
|
54
|
+
background-color: var(--color-secondary-x-light, $color-secondary-x-light);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -10,7 +10,6 @@ var _Label = _interopRequireDefault(require("./Label"));
|
|
|
10
10
|
var _ErrorMessage = _interopRequireDefault(require("./ErrorMessage"));
|
|
11
11
|
var _CheckBoxList = _interopRequireDefault(require("./CheckBoxList"));
|
|
12
12
|
var _CheckBoxListItem = _interopRequireDefault(require("./CheckBoxListItem"));
|
|
13
|
-
var _theme = require("../functions/theme");
|
|
14
13
|
var _generators = require("../functions/generators");
|
|
15
14
|
var _helpers = require("../functions/helpers");
|
|
16
15
|
var _asterisk = _interopRequireDefault(require("../assets/svg/asterisk.svg?url"));
|
|
@@ -47,17 +46,6 @@ const Select = props => {
|
|
|
47
46
|
document.addEventListener("mousedown", handleClickOutside);
|
|
48
47
|
document.addEventListener("keydown", keyDownFunction, false);
|
|
49
48
|
}, [props, wrapperRef]);
|
|
50
|
-
const getThemeErrorInputStyle = theme => {
|
|
51
|
-
return {
|
|
52
|
-
boxShadow: "0 0 3px ".concat((0, _theme.getThemePaletteBackgroundColor)(theme, "warning")),
|
|
53
|
-
borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, "warning")
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
const getThemeArrowStyle = theme => {
|
|
57
|
-
return {
|
|
58
|
-
borderTopColor: (0, _theme.getThemePaletteBackgroundColor)(theme, "primary")
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
49
|
const getKeyByValue = (value, options) => {
|
|
62
50
|
const selectedOption = options && options.length ? options.find(option => {
|
|
63
51
|
if (typeof option === "object") {
|
|
@@ -104,8 +92,7 @@ const Select = props => {
|
|
|
104
92
|
id: "".concat(props.id, "-").concat(index),
|
|
105
93
|
value: optionObject.value,
|
|
106
94
|
checked: isSelected,
|
|
107
|
-
onChange: () => selectElementProps.onChange(optionObject.value)
|
|
108
|
-
theme: props.theme
|
|
95
|
+
onChange: () => selectElementProps.onChange(optionObject.value)
|
|
109
96
|
}, optionObject.key);
|
|
110
97
|
});
|
|
111
98
|
};
|
|
@@ -138,7 +125,6 @@ const Select = props => {
|
|
|
138
125
|
var _props$width, _props$errorMessage, _props$ariaDescribed, _props$width2;
|
|
139
126
|
const defaultValue = !props.value && props.defaultValue ? props.defaultValue : false;
|
|
140
127
|
const styleRules = {
|
|
141
|
-
...(props.hasErrors ? getThemeErrorInputStyle(props.theme) : null),
|
|
142
128
|
...(((_props$width = props.width) === null || _props$width === void 0 ? void 0 : _props$width.length) && {
|
|
143
129
|
maxWidth: props.width
|
|
144
130
|
})
|
|
@@ -175,8 +161,7 @@ const Select = props => {
|
|
|
175
161
|
})
|
|
176
162
|
}
|
|
177
163
|
}, _react.default.createElement("span", {
|
|
178
|
-
className: _SelectModule.default.selectListArrow
|
|
179
|
-
style: getThemeArrowStyle(props.theme)
|
|
164
|
+
className: _SelectModule.default.selectListArrow
|
|
180
165
|
}), props.multiple ? _react.default.createElement("div", {
|
|
181
166
|
ref: dropdownRef
|
|
182
167
|
}, _react.default.createElement("div", {
|
|
@@ -190,8 +175,7 @@ const Select = props => {
|
|
|
190
175
|
compact: true
|
|
191
176
|
}, renderCheckBoxElements(props.options, selectElementProps))) : null) : _react.default.createElement("select", selectElementProps, renderPlaceholderOption(props.placeholder, props.placeholderValue), renderOptionElements(props.options))), _react.default.createElement(_ErrorMessage.default, {
|
|
192
177
|
id: getErrorElementId(),
|
|
193
|
-
content: props.errorMessage
|
|
194
|
-
theme: props.theme
|
|
178
|
+
content: props.errorMessage
|
|
195
179
|
}));
|
|
196
180
|
}
|
|
197
181
|
};
|
|
@@ -217,8 +201,7 @@ Select.propTypes = {
|
|
|
217
201
|
defaultContent: _propTypes.default.string,
|
|
218
202
|
"aria-describedby": _propTypes.default.string,
|
|
219
203
|
hasErrors: _propTypes.default.bool,
|
|
220
|
-
errorMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))])
|
|
221
|
-
theme: _propTypes.default.object
|
|
204
|
+
errorMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))])
|
|
222
205
|
};
|
|
223
206
|
Select.defaultProps = {
|
|
224
207
|
onChange: () => {
|
|
@@ -63,19 +63,19 @@
|
|
|
63
63
|
font-family: inherit;
|
|
64
64
|
font-size: 18px;
|
|
65
65
|
padding: 10px 40px 10px 10px;
|
|
66
|
-
border: 1px solid $color-primary;
|
|
66
|
+
border: 1px solid var(--color-primary, $color-primary);
|
|
67
67
|
border-radius: 0;
|
|
68
68
|
line-height: 1.7;
|
|
69
69
|
background: white;
|
|
70
70
|
cursor: pointer;
|
|
71
71
|
|
|
72
72
|
&:hover {
|
|
73
|
-
border-color: $color-primary;
|
|
74
|
-
background-color: $color-secondary-x-light;
|
|
73
|
+
border-color: var(--color-primary, $color-primary);
|
|
74
|
+
background-color: var(--color-secondary-x-light, $color-secondary-x-light);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
&:focus {
|
|
78
|
-
outline-color: $color-primary;
|
|
78
|
+
outline-color: var(--color-primary, $color-primary);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
&[disabled],
|
|
@@ -93,9 +93,9 @@
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
&.hasErrors {
|
|
96
|
-
border-color: $color-error;
|
|
96
|
+
border-color: var(--color-error, $color-error);
|
|
97
97
|
&:focus {
|
|
98
|
-
border-color: $color-error;
|
|
98
|
+
border-color: var(--color-error, $color-error);
|
|
99
99
|
outline-color: #b8565d;
|
|
100
100
|
}
|
|
101
101
|
&[disabled],
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
font-style: italic;
|
|
11
11
|
line-height: 1;
|
|
12
12
|
font-size: 17px;
|
|
13
|
-
color: $color-primary;
|
|
13
|
+
color: var(--color-primary, $color-primary);
|
|
14
14
|
}
|
|
15
15
|
&.captionSide-top {
|
|
16
16
|
caption {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
}
|
|
42
42
|
thead {
|
|
43
43
|
tr {
|
|
44
|
-
background-color: $color-default-background;
|
|
45
|
-
border: 1px solid $color-secondary;
|
|
44
|
+
background-color: var(--color-default-background, $color-default-background);
|
|
45
|
+
border: 1px solid var(--color-secondary-text, $color-secondary-text);
|
|
46
46
|
th {
|
|
47
47
|
text-align: left;
|
|
48
48
|
font-size: 16px;
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
}
|
|
53
53
|
tbody {
|
|
54
54
|
tr {
|
|
55
|
-
background-color: $color-default-background;
|
|
56
|
-
border: 1px solid $color-secondary;
|
|
55
|
+
background-color: var(--color-default-background, $color-default-background);
|
|
56
|
+
border: 1px solid var(--color-secondary-text, $color-secondary-text);
|
|
57
57
|
td {
|
|
58
58
|
padding: 10px;
|
|
59
59
|
font-size: 16px;
|
|
@@ -8,18 +8,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _Label = _interopRequireDefault(require("./Label"));
|
|
10
10
|
var _ErrorMessage = _interopRequireDefault(require("./ErrorMessage"));
|
|
11
|
-
var _theme = require("../functions/theme");
|
|
12
11
|
var _generators = require("../functions/generators");
|
|
13
12
|
var _asterisk = _interopRequireDefault(require("../assets/svg/asterisk.svg?url"));
|
|
14
13
|
var _TextareaModule = _interopRequireDefault(require("./Textarea.module.scss"));
|
|
15
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
15
|
const Textarea = props => {
|
|
17
|
-
const getThemeErrorInputStyle = theme => {
|
|
18
|
-
return {
|
|
19
|
-
boxShadow: "0 0 3px ".concat((0, _theme.getThemePaletteBackgroundColor)(theme, "warning")),
|
|
20
|
-
borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, "warning")
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
16
|
const renderValueAsText = (value, defaultContent) => {
|
|
24
17
|
return value ? value : defaultContent;
|
|
25
18
|
};
|
|
@@ -31,7 +24,6 @@ const Textarea = props => {
|
|
|
31
24
|
const defaultValue = !((_props$value = props.value) !== null && _props$value !== void 0 && _props$value.length) && (_props$defaultValue = props.defaultValue) !== null && _props$defaultValue !== void 0 && _props$defaultValue.length ? props.defaultValue : false;
|
|
32
25
|
const defaultKey = props.elementKey || null;
|
|
33
26
|
const styleRules = {
|
|
34
|
-
...(props.hasErrors ? getThemeErrorInputStyle(props.theme) : null),
|
|
35
27
|
...(((_props$width = props.width) === null || _props$width === void 0 ? void 0 : _props$width.length) && {
|
|
36
28
|
maxWidth: props.width
|
|
37
29
|
}),
|
|
@@ -69,8 +61,7 @@ const Textarea = props => {
|
|
|
69
61
|
className: _TextareaModule.default.requiredSymbol
|
|
70
62
|
})), !props.contentOnly ? renderInputField() : _react.default.createElement("span", null, renderValueAsText(props.value || props.defaultValue, props.defaultContent)), _react.default.createElement(_ErrorMessage.default, {
|
|
71
63
|
id: getErrorElementId(),
|
|
72
|
-
content: props.errorMessage
|
|
73
|
-
theme: props.theme
|
|
64
|
+
content: props.errorMessage
|
|
74
65
|
}));
|
|
75
66
|
};
|
|
76
67
|
Textarea.propTypes = {
|
|
@@ -92,8 +83,7 @@ Textarea.propTypes = {
|
|
|
92
83
|
defaultContent: _propTypes.default.string,
|
|
93
84
|
"aria-describedby": _propTypes.default.string,
|
|
94
85
|
hasErrors: _propTypes.default.bool,
|
|
95
|
-
errorMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))])
|
|
96
|
-
theme: _propTypes.default.object
|
|
86
|
+
errorMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))])
|
|
97
87
|
};
|
|
98
88
|
Textarea.defaultProps = {
|
|
99
89
|
onChange: () => {
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
&:hover {
|
|
37
|
-
border-color: $color-primary;
|
|
37
|
+
border-color: var(--color-primary, $color-primary);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
&:focus {
|
|
41
|
-
border-color: $color-primary;
|
|
42
|
-
outline-color:
|
|
41
|
+
border-color: var(--color-primary, $color-primary);
|
|
42
|
+
outline-color: var(--color-focus, $color-focus);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
&[disabled],
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
&.hasErrors {
|
|
52
|
-
border-color: $color-error;
|
|
52
|
+
border-color: var(--color-error, $color-error);
|
|
53
53
|
&:focus {
|
|
54
|
-
border-color: $color-error;
|
|
54
|
+
border-color: var(--color-error, $color-error);
|
|
55
55
|
outline-color: #b8565d;
|
|
56
56
|
}
|
|
57
57
|
&[disabled],
|
package/dist/components/Theme.js
CHANGED
|
@@ -4,68 +4,114 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var _Button = _interopRequireDefault(require("./Button"));
|
|
10
|
+
var _Container = _interopRequireDefault(require("./Container"));
|
|
11
|
+
var _Header = _interopRequireDefault(require("./Header"));
|
|
12
|
+
var _Accordion = _interopRequireDefault(require("./Accordion"));
|
|
13
|
+
var _Paper = _interopRequireDefault(require("./Paper"));
|
|
14
|
+
var _NavigationBar = _interopRequireDefault(require("./NavigationBar"));
|
|
15
|
+
var _CheckBoxList = _interopRequireDefault(require("./CheckBoxList"));
|
|
16
|
+
var _CheckBoxListItem = _interopRequireDefault(require("./CheckBoxListItem"));
|
|
17
|
+
var _RadioButtonList = _interopRequireDefault(require("./RadioButtonList"));
|
|
18
|
+
var _RadioButtonListItem = _interopRequireDefault(require("./RadioButtonListItem"));
|
|
11
19
|
var _ThemeModule = _interopRequireDefault(require("./Theme.module.scss"));
|
|
12
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
const getThemeTextStyle = theme => {
|
|
21
|
-
return {
|
|
22
|
-
color: (0, _theme.getThemeTextColor)(theme)
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
const getThemeLinkStyle = theme => {
|
|
26
|
-
return {
|
|
27
|
-
color: (0, _theme.getThemeLinkColor)(theme)
|
|
28
|
-
};
|
|
29
|
-
};
|
|
21
|
+
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); }
|
|
22
|
+
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 && Object.prototype.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; }
|
|
23
|
+
const Theme = _ref => {
|
|
24
|
+
let {
|
|
25
|
+
theme
|
|
26
|
+
} = _ref;
|
|
30
27
|
const renderColors = theme => {
|
|
31
|
-
|
|
32
|
-
return colors.map(color => {
|
|
28
|
+
return Object.keys(theme.colors).map(color => {
|
|
33
29
|
const colorClassName = _ThemeModule.default[color];
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
className: "".concat(_ThemeModule.default.color, " ").concat(colorClassName)
|
|
38
|
-
|
|
39
|
-
}, color);
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
const renderLogo = logoLink => {
|
|
43
|
-
const themeLogo = (0, _theme.getThemeLogo)(props.theme);
|
|
44
|
-
const themeAppName = (0, _theme.getThemeAppName)(props.theme);
|
|
45
|
-
const logoElement = themeLogo && themeAppName ? _react.default.createElement("img", {
|
|
46
|
-
alt: "".concat(themeAppName, " logo"),
|
|
47
|
-
src: themeLogo
|
|
48
|
-
}) : _react.default.createElement("img", {
|
|
49
|
-
alt: "DIBK logo",
|
|
50
|
-
src: _dibkLogoMobile.default
|
|
30
|
+
return _react.default.createElement(_react.Fragment, {
|
|
31
|
+
key: color
|
|
32
|
+
}, _react.default.createElement("div", null, color), _react.default.createElement("div", {
|
|
33
|
+
className: "".concat(_ThemeModule.default.color, " ").concat(colorClassName)
|
|
34
|
+
}));
|
|
51
35
|
});
|
|
52
|
-
return logoLink && logoLink.length ? _react.default.createElement("a", {
|
|
53
|
-
href: logoLink
|
|
54
|
-
}, logoElement) : logoElement;
|
|
55
36
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
37
|
+
return theme ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_NavigationBar.default, {
|
|
38
|
+
theme: theme
|
|
39
|
+
}), _react.default.createElement(_Container.default, {
|
|
40
|
+
maxWidth: "916px"
|
|
41
|
+
}, _react.default.createElement(_Paper.default, {
|
|
42
|
+
noMargin: true
|
|
43
|
+
}, _react.default.createElement("section", null, _react.default.createElement(_Header.default, {
|
|
44
|
+
size: 2
|
|
45
|
+
}, "Colors"), _react.default.createElement("div", {
|
|
59
46
|
className: _ThemeModule.default.colorPalette
|
|
60
|
-
}, renderColors(
|
|
61
|
-
|
|
62
|
-
}, "
|
|
63
|
-
|
|
47
|
+
}, " ", renderColors(theme))), _react.default.createElement("section", null, _react.default.createElement(_Header.default, {
|
|
48
|
+
size: 2
|
|
49
|
+
}, "Typography"), _react.default.createElement(_Header.default, {
|
|
50
|
+
size: 1,
|
|
51
|
+
htmlTag: "p"
|
|
52
|
+
}, "Heading size 1"), _react.default.createElement(_Header.default, {
|
|
53
|
+
size: 2,
|
|
54
|
+
htmlTag: "p"
|
|
55
|
+
}, "Heading size 2"), _react.default.createElement(_Header.default, {
|
|
56
|
+
size: 3,
|
|
57
|
+
htmlTag: "p"
|
|
58
|
+
}, "Heading size 3"), _react.default.createElement(_Header.default, {
|
|
59
|
+
size: 4,
|
|
60
|
+
htmlTag: "p"
|
|
61
|
+
}, "Heading size 4"), _react.default.createElement(_Header.default, {
|
|
62
|
+
size: 5,
|
|
63
|
+
htmlTag: "p"
|
|
64
|
+
}, "Heading size 5"), _react.default.createElement("p", null, "Paragraph"), _react.default.createElement("p", null, _react.default.createElement("a", {
|
|
64
65
|
href: "#theme"
|
|
65
|
-
}, "
|
|
66
|
+
}, "Hyperlink"))), _react.default.createElement("section", null, _react.default.createElement(_Header.default, {
|
|
67
|
+
size: 2
|
|
68
|
+
}, "Accordions"), _react.default.createElement(_Accordion.default, {
|
|
69
|
+
title: "Accordion with default color"
|
|
70
|
+
}, _react.default.createElement("p", null, "Accordion content")), _react.default.createElement(_Accordion.default, {
|
|
71
|
+
title: "Accordion with secondary color",
|
|
72
|
+
color: "secondary"
|
|
73
|
+
}, _react.default.createElement("p", null, "Accordion content"))), _react.default.createElement("section", null, _react.default.createElement(_Header.default, {
|
|
74
|
+
size: 2
|
|
75
|
+
}, "Buttons"), _react.default.createElement(_Button.default, {
|
|
76
|
+
color: "primary",
|
|
77
|
+
content: "Primary button",
|
|
78
|
+
arrow: "left"
|
|
79
|
+
}), _react.default.createElement(_Button.default, {
|
|
80
|
+
color: "secondary",
|
|
81
|
+
content: "Secondary button",
|
|
82
|
+
arrow: "right"
|
|
83
|
+
})), _react.default.createElement("section", null, _react.default.createElement(_Header.default, {
|
|
84
|
+
size: 2
|
|
85
|
+
}, "Checkboxes"), _react.default.createElement(_CheckBoxList.default, {
|
|
86
|
+
legend: "Default checkbox list"
|
|
87
|
+
}, _react.default.createElement(_CheckBoxListItem.default, {
|
|
88
|
+
onChange: () => {},
|
|
89
|
+
checked: true,
|
|
90
|
+
name: "checkboxlist",
|
|
91
|
+
id: "checkboxList-listItem-1"
|
|
92
|
+
}, "Label for checked checkbox"), _react.default.createElement(_CheckBoxListItem.default, {
|
|
93
|
+
onChange: () => {},
|
|
94
|
+
name: "checkboxlist",
|
|
95
|
+
id: "checkboxList-listItem-2"
|
|
96
|
+
}, "Label for unchecked checkbox"))), _react.default.createElement("section", null, _react.default.createElement(_Header.default, {
|
|
97
|
+
size: 2
|
|
98
|
+
}, "Radio buttons"), _react.default.createElement(_RadioButtonList.default, {
|
|
99
|
+
legend: "Default radio button list"
|
|
100
|
+
}, _react.default.createElement(_RadioButtonListItem.default, {
|
|
101
|
+
onChange: () => {},
|
|
102
|
+
inputValue: "value 1",
|
|
103
|
+
name: "radio-button-list-list-item",
|
|
104
|
+
id: "radioButtonList-listItem-1",
|
|
105
|
+
checked: true
|
|
106
|
+
}, "Checked radio button"), _react.default.createElement(_RadioButtonListItem.default, {
|
|
107
|
+
onChange: () => {},
|
|
108
|
+
inputValue: "value 2",
|
|
109
|
+
name: "radio-button-list-list-item",
|
|
110
|
+
id: "radioButtonList-listItem-2"
|
|
111
|
+
}, "Unchecked radio button")))))) : "Select a theme";
|
|
66
112
|
};
|
|
67
113
|
Theme.propTypes = {
|
|
68
|
-
theme: _propTypes.default.object
|
|
114
|
+
theme: _propTypes.default.object.isRequired
|
|
69
115
|
};
|
|
70
116
|
Theme.defaultProps = {};
|
|
71
117
|
var _default = exports.default = Theme;
|