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.
Files changed (90) hide show
  1. package/dist/assets/svg/arbeidstilsynet-logo.svg +1 -0
  2. package/dist/components/Accordion.module.scss +6 -6
  3. package/dist/components/Button.js +7 -24
  4. package/dist/components/Button.module.scss +92 -98
  5. package/dist/components/CheckBoxIcon.js +0 -9
  6. package/dist/components/CheckBoxIcon.module.scss +6 -6
  7. package/dist/components/CheckBoxInput.js +0 -2
  8. package/dist/components/CheckBoxInput.module.scss +3 -3
  9. package/dist/components/CheckBoxListItem.js +1 -3
  10. package/dist/components/CheckBoxListItem.module.scss +4 -4
  11. package/dist/components/ContentBox.module.scss +6 -6
  12. package/dist/components/Dialog.module.scss +1 -1
  13. package/dist/components/DragAndDropFileInput.js +3 -5
  14. package/dist/components/DragAndDropFileInput.module.scss +3 -3
  15. package/dist/components/ErrorBox.js +1 -9
  16. package/dist/components/ErrorBox.module.scss +4 -4
  17. package/dist/components/ErrorMessage.js +2 -10
  18. package/dist/components/Footer.module.scss +1 -1
  19. package/dist/components/Header.js +1 -3
  20. package/dist/components/Header.module.scss +1 -3
  21. package/dist/components/InfoBox.js +1 -12
  22. package/dist/components/InfoBox.module.scss +3 -3
  23. package/dist/components/InputField.js +3 -14
  24. package/dist/components/InputField.module.scss +7 -7
  25. package/dist/components/NavigationBar.js +6 -30
  26. package/dist/components/NavigationBar.module.scss +25 -27
  27. package/dist/components/NavigationBarListItem.js +3 -15
  28. package/dist/components/PDF.scss +9 -5
  29. package/dist/components/ProgressBar.module.scss +2 -2
  30. package/dist/components/RadioButtonIcon.js +0 -9
  31. package/dist/components/RadioButtonIcon.module.scss +6 -6
  32. package/dist/components/RadioButtonInput.js +0 -2
  33. package/dist/components/RadioButtonInput.module.scss +3 -3
  34. package/dist/components/RadioButtonListItem.js +2 -4
  35. package/dist/components/RadioButtonListItem.module.scss +6 -6
  36. package/dist/components/Select.js +4 -21
  37. package/dist/components/Select.module.scss +6 -6
  38. package/dist/components/Table.module.scss +5 -5
  39. package/dist/components/Textarea.js +2 -12
  40. package/dist/components/Textarea.module.scss +5 -5
  41. package/dist/components/Theme.js +97 -51
  42. package/dist/components/Theme.module.scss +86 -21
  43. package/dist/components/ThemeProvider.js +24 -0
  44. package/dist/components/ThemeProvider.module.scss +22 -0
  45. package/dist/components/WizardNavigation/Step.module.scss +8 -8
  46. package/dist/functions/helpers.js +49 -1
  47. package/dist/functions/theme.js +2 -37
  48. package/dist/index.js +7 -0
  49. package/dist/style/abstracts/variables/_colors.scss +12 -16
  50. package/dist/style/base/_fonts.scss +0 -106
  51. package/dist/style/pdf.css +6 -5
  52. package/dist/style/pdf.css.map +1 -1
  53. package/package.json +2 -1
  54. package/dist/assets/fonts/Altis-Light.eot +0 -0
  55. package/dist/assets/fonts/Altis-Light.svg +0 -326
  56. package/dist/assets/fonts/Altis-Light.ttf +0 -0
  57. package/dist/assets/fonts/Altis-Light.woff +0 -0
  58. package/dist/assets/fonts/Altis.eot +0 -0
  59. package/dist/assets/fonts/Altis.svg +0 -327
  60. package/dist/assets/fonts/Altis.ttf +0 -0
  61. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300.eot +0 -0
  62. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300.svg +0 -346
  63. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300.ttf +0 -0
  64. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300.woff +0 -0
  65. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300.woff2 +0 -0
  66. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300italic.eot +0 -0
  67. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300italic.svg +0 -377
  68. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300italic.ttf +0 -0
  69. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300italic.woff +0 -0
  70. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-300italic.woff2 +0 -0
  71. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700.eot +0 -0
  72. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700.svg +0 -349
  73. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700.ttf +0 -0
  74. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700.woff +0 -0
  75. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700.woff2 +0 -0
  76. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700italic.eot +0 -0
  77. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700italic.svg +0 -379
  78. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700italic.ttf +0 -0
  79. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700italic.woff +0 -0
  80. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-700italic.woff2 +0 -0
  81. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-italic.eot +0 -0
  82. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-italic.svg +0 -379
  83. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-italic.ttf +0 -0
  84. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-italic.woff +0 -0
  85. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-italic.woff2 +0 -0
  86. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-regular.eot +0 -0
  87. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-regular.svg +0 -349
  88. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-regular.ttf +0 -0
  89. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-regular.woff +0 -0
  90. package/dist/assets/fonts/open-sans-v27-latin-ext_latin-regular.woff2 +0 -0
@@ -99,8 +99,7 @@ const DragAndDropFileInput = props => {
99
99
  "data-transaction-name": props["data-transaction-name"]
100
100
  })) : null) : null, props.contentOnly ? _react.default.createElement("span", null, renderValueAsText(props.selectedFileName, props.defaultContent)) : "", _react.default.createElement(_ErrorMessage.default, {
101
101
  id: getErrorElementId(),
102
- content: props.errorMessage,
103
- theme: props.theme
102
+ content: props.errorMessage
104
103
  }));
105
104
  };
106
105
  DragAndDropFileInput.propTypes = {
@@ -118,13 +117,12 @@ DragAndDropFileInput.propTypes = {
118
117
  hasErrors: _propTypes.default.bool,
119
118
  errorMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))]),
120
119
  required: _propTypes.default.bool,
121
- "data-transaction-name": _propTypes.default.string,
122
- theme: _propTypes.default.object
120
+ "data-transaction-name": _propTypes.default.string
123
121
  };
124
122
  DragAndDropFileInput.defaultProps = {
125
123
  label: "",
126
124
  contentOnly: false,
127
- buttonColor: "default",
125
+ buttonColor: "primary",
128
126
  defaultContent: "",
129
127
  hasErrors: false,
130
128
  errorMessage: "",
@@ -11,7 +11,7 @@
11
11
 
12
12
  .dragAndDropContainer {
13
13
  @include transition(all 0.1s ease-in-out);
14
- border: 2px dashed $color-secondary-light;
14
+ border: 2px dashed var(--color-secondary-light, $color-secondary-light);
15
15
  border-radius: 20px;
16
16
  width: 100%;
17
17
  padding: 20px;
@@ -27,8 +27,8 @@
27
27
  }
28
28
 
29
29
  &.highlighted {
30
- background: $color-secondary-x-light;
31
- border-color: $color-primary;
30
+ background: var(--color-secondary-x-light, $color-secondary-x-light);
31
+ border-color: var(--color-primary, $color-primary);
32
32
  }
33
33
  }
34
34
  }
@@ -6,20 +6,13 @@ 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 _helpers = require("../functions/helpers");
11
10
  var _ErrorBoxModule = _interopRequireDefault(require("./ErrorBox.module.scss"));
12
11
  var _infoSign = _interopRequireDefault(require("../assets/svg/info-sign.svg?url"));
13
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
13
  const ErrorBox = props => {
15
- const getThemeErrorBoxStyle = () => {
16
- return {
17
- borderColor: props.type === "error" ? (0, _theme.getThemePaletteBackgroundColor)(props.theme, "error") : (0, _theme.getThemePaletteBackgroundColor)(props.theme, "warning")
18
- };
19
- };
20
14
  return _react.default.createElement("div", {
21
- className: (0, _helpers.classNameArrayToClassNameString)([_ErrorBoxModule.default.errorBoxContainer, _ErrorBoxModule.default[props.type], props.fullScreen && _ErrorBoxModule.default.fullScreen]),
22
- style: getThemeErrorBoxStyle()
15
+ className: (0, _helpers.classNameArrayToClassNameString)([_ErrorBoxModule.default.errorBoxContainer, _ErrorBoxModule.default[props.type], props.fullScreen && _ErrorBoxModule.default.fullScreen])
23
16
  }, _react.default.createElement("div", {
24
17
  className: (0, _helpers.classNameArrayToClassNameString)([_ErrorBoxModule.default.errorBox, props.fullScreen && _ErrorBoxModule.default.fullScreen])
25
18
  }, _react.default.createElement("img", {
@@ -29,7 +22,6 @@ const ErrorBox = props => {
29
22
  }), props.children));
30
23
  };
31
24
  ErrorBox.propTypes = {
32
- theme: _propTypes.default.object,
33
25
  type: _propTypes.default.oneOf(["warning", "error"]),
34
26
  fullScreen: _propTypes.default.bool
35
27
  };
@@ -14,12 +14,12 @@
14
14
  position: relative;
15
15
  line-height: 24px;
16
16
  &.warning {
17
- background-color: $color-warning-x-light;
18
- border-color: $color-warning;
17
+ background-color: var(--color-warning-x-light, $color-warning-x-light);
18
+ border-color: var(--color-warning, $color-warning);
19
19
  }
20
20
  &.error {
21
- background-color: $color-error-x-light;
22
- border-color: $color-error;
21
+ background-color: var(--color-error-x-light, $color-error-x-light);
22
+ border-color: var(--color-error, $color-error);
23
23
  }
24
24
  &.fullScreen {
25
25
  border-bottom-width: 4px;
@@ -6,24 +6,17 @@ 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 _ErrorMessageModule = _interopRequireDefault(require("./ErrorMessage.module.scss"));
11
10
  var _errorSign = _interopRequireDefault(require("../assets/svg/error-sign.svg?url"));
12
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
12
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
14
13
  const ErrorMessage = props => {
15
14
  var _props$content;
16
- const getThemeErrorMessageStyle = theme => {
17
- return {
18
- color: (0, _theme.getThemePaletteBackgroundColor)(theme, "warning")
19
- };
20
- };
21
15
  const getErrorElementProps = () => {
22
16
  var _props$id;
23
17
  return {
24
18
  id: !!((_props$id = props.id) !== null && _props$id !== void 0 && _props$id.length) ? props.id : null,
25
- className: _ErrorMessageModule.default.errorMessage,
26
- style: getThemeErrorMessageStyle(props.theme)
19
+ className: _ErrorMessageModule.default.errorMessage
27
20
  };
28
21
  };
29
22
  return props !== null && props !== void 0 && (_props$content = props.content) !== null && _props$content !== void 0 && _props$content.length ? _react.default.createElement("span", _extends({
@@ -36,8 +29,7 @@ const ErrorMessage = props => {
36
29
  };
37
30
  ErrorMessage.propTypes = {
38
31
  id: _propTypes.default.string,
39
- content: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))]),
40
- theme: _propTypes.default.object
32
+ content: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))])
41
33
  };
42
34
  ErrorMessage.defaultProps = {
43
35
  content: ""
@@ -1,7 +1,7 @@
1
1
  @import "../style/global.scss";
2
2
 
3
3
  .footer {
4
- background-color: $color-primary;
4
+ background-color: var(--color-primary, $color-primary);
5
5
  padding: 16px 0;
6
6
  text-align: right;
7
7
  * {
@@ -12,12 +12,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
  const Header = props => {
13
13
  var _props$htmlTag, _props$content;
14
14
  const bigClass = props.big ? _HeaderModule.default.bigHeader : "";
15
- const themeClass = props.theme ? _HeaderModule.default.hasTheme : "";
16
15
  const htmlTag = (_props$htmlTag = props.htmlTag) !== null && _props$htmlTag !== void 0 && _props$htmlTag.length ? props.htmlTag : "h".concat(props.size);
17
16
  const headerClass = _HeaderModule.default.header;
18
17
  const headerSizeClass = _HeaderModule.default["size-".concat(props.size)];
19
18
  let headerElement = _react.default.createElement(htmlTag, {
20
- className: (0, _helpers.classNameArrayToClassNameString)([headerClass, headerSizeClass, bigClass, themeClass]),
19
+ className: (0, _helpers.classNameArrayToClassNameString)([headerClass, headerSizeClass, bigClass]),
21
20
  id: props.id || null,
22
21
  htmlFor: props.htmlFor || null
23
22
  }, !!((_props$content = props.content) !== null && _props$content !== void 0 && _props$content.length) ? props.content : props.children);
@@ -31,7 +30,6 @@ Header.propTypes = {
31
30
  size: _propTypes.default.oneOf([1, 2, 3, 4, 5]),
32
31
  big: _propTypes.default.bool,
33
32
  htmlTag: _propTypes.default.string,
34
- theme: _propTypes.default.object,
35
33
  htmlFor: _propTypes.default.string
36
34
  };
37
35
  Header.defaultProps = {
@@ -6,9 +6,7 @@
6
6
  font-weight: normal;
7
7
  line-height: 1.4;
8
8
  font-style: normal;
9
- &:not(.hasTheme) {
10
- color: $color-primary;
11
- }
9
+ color: var(--color-heading-text, $color-heading-text);
12
10
  &.size-1 {
13
11
  font-family: $default-font;
14
12
  font-style: normal;
@@ -5,29 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _theme = require("../functions/theme");
10
8
  var _InfoBoxModule = _interopRequireDefault(require("./InfoBox.module.scss"));
11
9
  var _infoSign = _interopRequireDefault(require("../assets/svg/info-sign.svg?url"));
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
11
  const InfoBox = props => {
14
- const getThemeInfoBoxStyle = () => {
15
- return {
16
- borderColor: (0, _theme.getThemePaletteBackgroundColor)(props.theme, "secondary-light")
17
- };
18
- };
19
12
  return _react.default.createElement("div", {
20
- className: _InfoBoxModule.default.infoBox,
21
- style: getThemeInfoBoxStyle()
13
+ className: _InfoBoxModule.default.infoBox
22
14
  }, _react.default.createElement("img", {
23
15
  src: _infoSign.default,
24
16
  alt: "",
25
17
  className: _InfoBoxModule.default.infoSign
26
18
  }), props.children);
27
19
  };
28
- InfoBox.propTypes = {
29
- theme: _propTypes.default.object
30
- };
31
20
  InfoBox.defaultProps = {
32
21
  children: ""
33
22
  };
@@ -9,7 +9,7 @@
9
9
 
10
10
  .infoBox {
11
11
  background-color: #fff;
12
- border: 1px solid $color-secondary-light;
12
+ border: 1px solid var(--color-secondary-light, $color-secondary-light);
13
13
  padding: 24px 24px 24px calc(1.2em + 48px);
14
14
  font-family: $default-font;
15
15
  animation: 1000ms cubic-bezier(0.22, 1, 0.36, 1) 0s 1 normal none running messageIn;
@@ -22,8 +22,8 @@
22
22
  height: 24px;
23
23
  display: inline-block;
24
24
  vertical-align: middle;
25
- background-color: $color-warning-x-light;
26
- border-left-color: $color-warning;
25
+ background-color: var(--color-warning-x-light, $color-warning-x-light);
26
+ border-left-color: var(--color-warning, $color-warning);
27
27
  }
28
28
  h1,
29
29
  h2,
@@ -9,7 +9,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _Button = _interopRequireDefault(require("./Button"));
10
10
  var _Label = _interopRequireDefault(require("./Label"));
11
11
  var _ErrorMessage = _interopRequireDefault(require("./ErrorMessage"));
12
- var _theme = require("../functions/theme");
13
12
  var _generators = require("../functions/generators");
14
13
  var _helpers = require("../functions/helpers");
15
14
  var _asterisk = _interopRequireDefault(require("../assets/svg/asterisk.svg?url"));
@@ -17,12 +16,6 @@ var _InputFieldModule = _interopRequireDefault(require("./InputField.module.scss
17
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
17
  const InputField = props => {
19
18
  var _props$width;
20
- const getThemeErrorInputStyle = theme => {
21
- return {
22
- boxShadow: "0 0 3px ".concat((0, _theme.getThemePaletteBackgroundColor)(theme, "warning")),
23
- borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, "warning")
24
- };
25
- };
26
19
  const formatDate = inputDate => {
27
20
  if (!inputDate) {
28
21
  return null;
@@ -66,7 +59,6 @@ const InputField = props => {
66
59
  const defaultValue = props.defaultValue ? props.defaultValue : props.value || null;
67
60
  const defaultKey = props.elementKey || null;
68
61
  const styleRules = {
69
- ...(props.hasErrors ? getThemeErrorInputStyle(props.theme) : null),
70
62
  ...(((_props$width = props.width) === null || _props$width === void 0 ? void 0 : _props$width.length) && {
71
63
  maxWidth: props.width
72
64
  })
@@ -89,12 +81,10 @@ const InputField = props => {
89
81
  document.getElementById(props.id).click();
90
82
  },
91
83
  content: props.buttonContent,
92
- type: "button",
93
- theme: props.theme
84
+ type: "button"
94
85
  }) : null) : null), !props.contentOnly ? _react.default.createElement("input", getInputElementProps(defaultValue, defaultKey, styleRules)) : _react.default.createElement("span", null, renderValueAsText(props.value || props.defaultValue, props.defaultContent)), _react.default.createElement(_ErrorMessage.default, {
95
86
  id: getErrorElementId(),
96
- content: props.errorMessage,
97
- theme: props.theme
87
+ content: props.errorMessage
98
88
  }));
99
89
  };
100
90
  InputField.propTypes = {
@@ -111,7 +101,7 @@ InputField.propTypes = {
111
101
  elementKey: _propTypes.default.string,
112
102
  label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))]),
113
103
  contentOnly: _propTypes.default.bool,
114
- buttonColor: _propTypes.default.oneOf(["default", "primary"]),
104
+ buttonColor: _propTypes.default.oneOf(["primary", "secondary"]),
115
105
  buttonContent: _propTypes.default.string,
116
106
  selectedFileName: _propTypes.default.string,
117
107
  dateFormat: _propTypes.default.string,
@@ -121,7 +111,6 @@ InputField.propTypes = {
121
111
  "aria-autocomplete": _propTypes.default.oneOf(["none", "inline", "list", "both"]),
122
112
  hasErrors: _propTypes.default.bool,
123
113
  errorMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))]),
124
- theme: _propTypes.default.object,
125
114
  noMargin: _propTypes.default.bool
126
115
  };
127
116
  InputField.defaultProps = {
@@ -31,32 +31,32 @@
31
31
  font-family: inherit;
32
32
  font-size: 18px;
33
33
  box-sizing: border-box;
34
- border: 1px solid $color-primary;
34
+ border: 1px solid var(--color-primary, $color-primary);
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;
41
+ border-color: var(--color-primary, $color-primary);
42
42
  outline: $color-focus solid 3px;
43
43
  }
44
44
 
45
45
  &[disabled],
46
46
  &[readonly] {
47
- background-color: $color-secondary-x-light;
47
+ background-color: var(--color-secondary-x-light, $color-secondary-x-light);
48
48
  cursor: default;
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],
58
58
  &[readonly] {
59
- background-color: $color-secondary-x-light;
59
+ background-color: var(--color-secondary-x-light, $color-secondary-x-light);
60
60
  cursor: default;
61
61
  border-color: #afaba8;
62
62
  }
@@ -22,18 +22,6 @@ const NavigationBar = props => {
22
22
  const toggleList = () => {
23
23
  setActive(!active);
24
24
  };
25
- const getNavigationBarThemeStyle = theme => {
26
- return {
27
- backgroundColor: (0, _theme.getThemeNavigationBarBackgroundColor)(theme),
28
- color: (0, _theme.getThemeNavigationBarTextColor)(theme)
29
- };
30
- };
31
- const getListItemThemeStyle = theme => {
32
- return {
33
- color: (0, _theme.getThemeNavigationBarTextColor)(theme),
34
- borderBottomColor: (0, _theme.getThemeNavigationBarTextColor)(theme)
35
- };
36
- };
37
25
  const getLogoThemeStyle = theme => {
38
26
  return {
39
27
  padding: (0, _theme.getThemeLogoPadding)(theme)
@@ -42,15 +30,12 @@ const NavigationBar = props => {
42
30
  const renderPrimaryList = function () {
43
31
  let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : props.primaryListItems;
44
32
  let iteration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
45
- const listItemThemeStyle = getListItemThemeStyle(props.theme);
46
33
  let listItems = items.map((listItem, i) => {
47
34
  let key = iteration + "-" + i;
48
35
  if (listItem.listItems !== undefined) {
49
36
  return _react.default.createElement("li", {
50
37
  key: key
51
- }, _react.default.createElement("span", {
52
- style: listItemThemeStyle
53
- }, listItem.name), renderPrimaryList(listItem.listItems, iteration + 1));
38
+ }, _react.default.createElement("span", null, listItem.name), renderPrimaryList(listItem.listItems, iteration + 1));
54
39
  } else {
55
40
  return _react.default.createElement(_NavigationBarListItem.default, {
56
41
  listItem: listItem,
@@ -107,10 +92,6 @@ const NavigationBar = props => {
107
92
  title: logoLinkTitle
108
93
  }), renderLogoElement()) : renderLogoElement();
109
94
  };
110
- const navigationBarThemeStyle = getNavigationBarThemeStyle(props.theme);
111
- const hamburgerIconLineStyle = {
112
- backgroundColor: (0, _theme.getThemeNavigationBarTextColor)(props.theme)
113
- };
114
95
  const hasListItems = !!((_props$primaryListIte = props.primaryListItems) !== null && _props$primaryListIte !== void 0 && _props$primaryListIte.length) || !!((_props$secondaryListI = props.secondaryListItems) !== null && _props$secondaryListI !== void 0 && _props$secondaryListI.length);
115
96
  return _react.default.createElement("div", {
116
97
  className: (0, _helpers.classNameArrayToClassNameString)([props.compact && _NavigationBarModule.default.compact, _NavigationBarModule.default.navigationBarContainer])
@@ -121,8 +102,7 @@ const NavigationBar = props => {
121
102
  }, _react.default.createElement("span", {
122
103
  id: "main-content-link-text"
123
104
  }, "Hopp til hovedinnhold")), _react.default.createElement("div", {
124
- className: _NavigationBarModule.default.navigationBar,
125
- style: navigationBarThemeStyle
105
+ className: _NavigationBarModule.default.navigationBar
126
106
  }, _react.default.createElement("div", {
127
107
  className: _NavigationBarModule.default.logoContainer
128
108
  }, renderLogo(props.logoLink, props.logoLinkTitle)), !!props.children && _react.default.createElement("div", {
@@ -136,20 +116,16 @@ const NavigationBar = props => {
136
116
  }, !props.compact && "Meny", _react.default.createElement("span", {
137
117
  className: _NavigationBarModule.default.hamburgerIcon
138
118
  }, _react.default.createElement("span", {
139
- className: _NavigationBarModule.default.line,
140
- style: hamburgerIconLineStyle
119
+ className: _NavigationBarModule.default.line
141
120
  }), _react.default.createElement("span", {
142
- className: _NavigationBarModule.default.line,
143
- style: hamburgerIconLineStyle
121
+ className: _NavigationBarModule.default.line
144
122
  }), _react.default.createElement("span", {
145
- className: _NavigationBarModule.default.line,
146
- style: hamburgerIconLineStyle
123
+ className: _NavigationBarModule.default.line
147
124
  })))), hasListItems && _react.default.createElement(_react.Fragment, null, _react.default.createElement("div", {
148
125
  className: "".concat(_NavigationBarModule.default.dropdownContainer, " ").concat(active ? _NavigationBarModule.default.active : "")
149
126
  }, _react.default.createElement("div", {
150
127
  id: "main-menu-dropdown",
151
- className: _NavigationBarModule.default.dropdown,
152
- style: navigationBarThemeStyle
128
+ className: _NavigationBarModule.default.dropdown
153
129
  }, renderPrimaryList(), renderSecondaryList()))));
154
130
  };
155
131
  NavigationBar.propTypes = {
@@ -33,7 +33,7 @@
33
33
  }
34
34
  &:not(.compact) {
35
35
  position: relative;
36
- background-color: $body-background;
36
+ background-color: var(--color-body-background, $color-body-background);
37
37
  padding: 5px;
38
38
  @media only screen and (min-width: $screen-sm) {
39
39
  padding: 20px;
@@ -42,12 +42,12 @@
42
42
  padding-bottom: 40px;
43
43
  }
44
44
  .mainContentLink {
45
- background-color: $body-background;
46
- color: $color-primary;
45
+ background-color: var(--color-body-background, $color-body-background);
46
+ color: var(--color-primary, $color-primary);
47
47
  &:focus,
48
48
  &:active {
49
49
  span {
50
- outline-color: $color-primary;
50
+ outline-color: var(--color-primary, $color-primary);
51
51
  }
52
52
  }
53
53
  }
@@ -72,10 +72,10 @@
72
72
  }
73
73
  }
74
74
  .logoContainer {
75
- width: 85px;
75
+ width: var(--size-logo-small-width, 85px);
76
76
  margin-bottom: 0;
77
77
  @media only screen and (min-width: $screen-sm) {
78
- width: 100px;
78
+ width: var(--size-logo-small-width, 100px);
79
79
  }
80
80
  }
81
81
  .childElements {
@@ -94,11 +94,11 @@
94
94
  right: 10px;
95
95
  height: auto;
96
96
  margin: auto;
97
- border: 1px solid $color-primary;
97
+ border: 1px solid var(--color-primary, $color-primary);
98
98
  padding: 10px 20px;
99
99
  padding-right: 54px;
100
100
  background-color: transparent;
101
- color: $color-primary;
101
+ color: var(--color-primary, $color-primary);
102
102
  font-size: 20px;
103
103
  font-weight: 400;
104
104
  cursor: pointer;
@@ -118,7 +118,7 @@
118
118
  height: 4px;
119
119
  width: 24px;
120
120
  border-radius: 3px;
121
- background-color: $color-primary;
121
+ background-color: var(--color-primary, $color-primary);
122
122
  &::before,
123
123
  &::after {
124
124
  content: "";
@@ -127,7 +127,7 @@
127
127
  left: 0;
128
128
  right: 0;
129
129
  border-radius: 3px;
130
- background-color: $color-primary;
130
+ background-color: var(--color-primary, $color-primary);
131
131
  transition: transform 0.3s ease-out;
132
132
  }
133
133
  &::before {
@@ -136,19 +136,17 @@
136
136
  &::after {
137
137
  bottom: -8px;
138
138
  }
139
- .line {
140
- }
141
139
  }
142
140
  &:hover,
143
141
  &:focus,
144
142
  &:active {
145
143
  color: #fff;
146
- background-color: $color-primary;
144
+ background-color: var(--color-primary, $color-primary);
147
145
  .hamburgerIcon {
148
- background-color: #fff;
146
+ background-color: var(--color-primary-contrast, $color-primary-contrast);
149
147
  &::before,
150
148
  &::after {
151
- background-color: #fff;
149
+ background-color: var(--color-primary-contrast, $color-primary-contrast);
152
150
  }
153
151
  }
154
152
  }
@@ -170,7 +168,7 @@
170
168
  width: 100%;
171
169
  overflow: hidden;
172
170
  transition: all $default-transition;
173
- background-color: $body-background;
171
+ background-color: var(--color-body-background, $color-body-background);
174
172
  &.active {
175
173
  display: block;
176
174
  }
@@ -213,7 +211,7 @@
213
211
  line-height: 1.56;
214
212
  font-weight: 600;
215
213
  text-decoration: underline;
216
- color: $color-primary;
214
+ color: var(--color-primary, $color-primary);
217
215
  cursor: pointer;
218
216
  &:hover {
219
217
  text-decoration: none;
@@ -299,18 +297,18 @@
299
297
  z-index: 1;
300
298
 
301
299
  .mainContentLink {
302
- background-color: $color-primary;
303
- color: #fff;
300
+ background-color: var(--color-primary, $color-primary);
301
+ color: var(--color-primary-contrast, $color-primary-contrast);
304
302
  &:focus,
305
303
  &:active {
306
304
  span {
307
- outline-color: #fff;
305
+ outline-color: var(--color-primary-contrast, $color-primary-contrast);
308
306
  }
309
307
  }
310
308
  }
311
309
 
312
310
  .navigationBar {
313
- background-color: $color-primary;
311
+ background-color: var(--color-primary, $color-primary);
314
312
  height: 54px;
315
313
  display: flex;
316
314
  justify-content: space-between;
@@ -339,7 +337,7 @@
339
337
 
340
338
  .childElements {
341
339
  display: block;
342
- color: #fff;
340
+ color: var(--color-primary-contrast, $color-primary-contrast);
343
341
  flex: 1;
344
342
  }
345
343
 
@@ -356,7 +354,7 @@
356
354
  width: 30px;
357
355
  display: block;
358
356
  .line {
359
- background-color: #fff;
357
+ background-color: var(--color-primary-contrast, $color-primary-contrast);
360
358
  height: 2px;
361
359
  margin: 6px 0;
362
360
  display: block;
@@ -379,7 +377,7 @@
379
377
 
380
378
  .dropdown {
381
379
  @include box-shadow(0 2px 4px -2px rgba(0, 0, 0, 0.2));
382
- background-color: $color-primary;
380
+ background-color: var(--color-primary, $color-primary);
383
381
  z-index: 2;
384
382
  > ul.primaryList {
385
383
  list-style: none;
@@ -388,13 +386,13 @@
388
386
  li {
389
387
  a,
390
388
  span {
391
- color: #fff;
389
+ color: var(--color-primary-contrast, $color-primary-contrast);
392
390
  text-transform: uppercase;
393
391
  text-decoration: none;
394
392
  font-family: $default-font;
395
393
  padding: 10px 0;
396
394
  display: block;
397
- border-bottom: 1px solid $color-primary;
395
+ border-bottom: 1px solid var(--color-primary, $color-primary);
398
396
  font-size: 14px;
399
397
  line-height: 1.6;
400
398
  }
@@ -404,7 +402,7 @@
404
402
  li {
405
403
  a,
406
404
  span {
407
- color: #fff;
405
+ color: var(--color-primary-contrast, $color-primary-contrast);
408
406
  text-transform: none;
409
407
  text-decoration: none;
410
408
  font-family: $default-font;
@@ -6,31 +6,19 @@ 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
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
10
  const NavigationBarListItem = props => {
12
- const getListItemThemeStyle = () => {
13
- return {
14
- color: (0, _theme.getThemeNavigationBarTextColor)(props.theme),
15
- borderBottomColor: (0, _theme.getThemeNavigationBarTextColor)(props.theme)
16
- };
17
- };
18
- const listItemThemeStyle = getListItemThemeStyle();
19
11
  if (typeof props.listItem === "string") {
20
- return _react.default.createElement("li", null, _react.default.createElement("span", {
21
- style: listItemThemeStyle
22
- }, props.listItem));
12
+ return _react.default.createElement("li", null, _react.default.createElement("span", null, props.listItem));
23
13
  } else if (typeof props.listItem === "object") {
24
14
  return _react.default.createElement("li", null, _react.default.createElement("a", {
25
- href: props.listItem.href,
26
- style: listItemThemeStyle
15
+ href: props.listItem.href
27
16
  }, props.listItem.name));
28
17
  } else {
29
18
  return null;
30
19
  }
31
20
  };
32
21
  NavigationBarListItem.propTypes = {
33
- listItem: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
34
- theme: _propTypes.default.object
22
+ listItem: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object])
35
23
  };
36
24
  var _default = exports.default = NavigationBarListItem;