dibk-design 7.2.2 → 7.3.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 (34) hide show
  1. package/dist/components/Accordion.js +2 -2
  2. package/dist/components/Button.js +19 -12
  3. package/dist/components/CheckBoxIcon.js +1 -1
  4. package/dist/components/CheckBoxInput.js +1 -1
  5. package/dist/components/CheckBoxList.js +4 -3
  6. package/dist/components/Container.js +2 -1
  7. package/dist/components/ContentBox.js +2 -1
  8. package/dist/components/DescriptionList.js +1 -1
  9. package/dist/components/Dialog.js +4 -3
  10. package/dist/components/DragAndDropFileInput.js +5 -4
  11. package/dist/components/ErrorMessage.js +4 -2
  12. package/dist/components/Header.js +6 -5
  13. package/dist/components/InputField.js +16 -11
  14. package/dist/components/Label.js +11 -8
  15. package/dist/components/List.js +2 -2
  16. package/dist/components/NavigationBar.js +8 -7
  17. package/dist/components/PDF.scss +119 -0
  18. package/dist/components/Paper.js +1 -1
  19. package/dist/components/ProgressBar.js +1 -1
  20. package/dist/components/RadioButtonIcon.js +1 -1
  21. package/dist/components/RadioButtonInput.js +1 -1
  22. package/dist/components/RadioButtonList.js +4 -3
  23. package/dist/components/Select.js +18 -16
  24. package/dist/components/Table.js +2 -2
  25. package/dist/components/Textarea.js +15 -12
  26. package/dist/components/Theme.js +1 -1
  27. package/dist/components/ThemeProvider.js +1 -1
  28. package/dist/components/ToggleNavigationButton.js +7 -3
  29. package/dist/components/WizardNavigation.js +4 -3
  30. package/dist/functions/helpers.js +22 -18
  31. package/dist/functions/theme.js +3 -3
  32. package/dist/style/pdf.css +112 -0
  33. package/dist/style/pdf.css.map +1 -1
  34. package/package.json +1 -1
@@ -33,14 +33,14 @@ const Accordion = props => {
33
33
  }), _react.default.createElement("span", {
34
34
  className: _AccordionModule.default.panelText
35
35
  }, props.title), _react.default.createElement("span", {
36
- className: `${_AccordionModule.default.panelChevron} ${expanded ? _AccordionModule.default.expanded : ""}`
36
+ className: "".concat(_AccordionModule.default.panelChevron, " ").concat(expanded ? _AccordionModule.default.expanded : "")
37
37
  }));
38
38
  };
39
39
  const className = (0, _helpers.classNameArrayToClassNameString)([_AccordionModule.default.accordion, props.color && _AccordionModule.default[props.color], !props.noMargin && _AccordionModule.default.margin]);
40
40
  return _react.default.createElement("div", {
41
41
  className: className
42
42
  }, renderPanel(), _react.default.createElement("div", {
43
- className: `${_AccordionModule.default.content} ${initialized ? _AccordionModule.default.initialized : ""} ${expanded ? _AccordionModule.default.expanded : ""}`
43
+ className: "".concat(_AccordionModule.default.content, " ").concat(initialized ? _AccordionModule.default.initialized : "", " ").concat(expanded ? _AccordionModule.default.expanded : "")
44
44
  }, props.children));
45
45
  };
46
46
  Accordion.propTypes = {
@@ -13,7 +13,13 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
16
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
19
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
20
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
16
21
  const Button = props => {
22
+ var _props$href, _props$href2, _props$children;
17
23
  const getArrowClass = arrow => {
18
24
  switch (arrow) {
19
25
  case "left":
@@ -24,11 +30,10 @@ const Button = props => {
24
30
  return "";
25
31
  }
26
32
  };
27
- let buttonProps = {
28
- ...props,
33
+ let buttonProps = _objectSpread(_objectSpread({}, props), {}, {
29
34
  "aria-invalid": props.hasErrors || null,
30
- href: !props.disabled && props.href?.length ? props.href : null
31
- };
35
+ href: !props.disabled && (_props$href = props.href) !== null && _props$href !== void 0 && _props$href.length ? props.href : null
36
+ });
32
37
  delete buttonProps.noHover;
33
38
  delete buttonProps.hasErrors;
34
39
  delete buttonProps.rounded;
@@ -37,21 +42,23 @@ const Button = props => {
37
42
  delete buttonProps.content;
38
43
  delete buttonProps.arrow;
39
44
  delete buttonProps.noMargin;
40
- const buttonColor = props?.inputType === "radio" ? props.defaultChecked ? "primary" : "secondary" : props.color;
41
- const className = (0, _helpers.classNameArrayToClassNameString)([_ButtonModule.default.button, _ButtonModule.default[buttonColor], _ButtonModule.default[props.size], getArrowClass(props.arrow), props.noHover || props?.inputType === "radio" ? _ButtonModule.default.noHover : null, props.rounded && _ButtonModule.default.rounded, props.hasErrors && _ButtonModule.default.hasErrors, props.disabled && _ButtonModule.default.disabled, props.noMargin && _ButtonModule.default.noMargin]);
45
+ const buttonColor = (props === null || props === void 0 ? void 0 : props.inputType) === "radio" ? props.defaultChecked ? "primary" : "secondary" : props.color;
46
+ const className = (0, _helpers.classNameArrayToClassNameString)([_ButtonModule.default.button, _ButtonModule.default[buttonColor], _ButtonModule.default[props.size], getArrowClass(props.arrow), props.noHover || (props === null || props === void 0 ? void 0 : props.inputType) === "radio" ? _ButtonModule.default.noHover : null, props.rounded && _ButtonModule.default.rounded, props.hasErrors && _ButtonModule.default.hasErrors, props.disabled && _ButtonModule.default.disabled, props.noMargin && _ButtonModule.default.noMargin]);
42
47
  const renderReactLinkElements = childElements => {
43
48
  const childElementsthroughFragments = (0, _helpers.cloneThroughFragments)(childElements);
44
49
  return childElementsthroughFragments.map((childElement, index) => {
45
- if (!buttonProps.disabled && !!childElement?.props?.to) {
50
+ var _childElement$props;
51
+ if (!buttonProps.disabled && !!(childElement !== null && childElement !== void 0 && (_childElement$props = childElement.props) !== null && _childElement$props !== void 0 && _childElement$props.to)) {
52
+ var _childElement$props2, _childElement$props3;
46
53
  const childElementCopy = _react.default.cloneElement(childElement, {
47
54
  className: className,
48
- key: `button-${index}`,
49
- to: !buttonProps.disabled && childElement?.props?.to ? childElement?.props?.to : null
55
+ key: "button-".concat(index),
56
+ to: !buttonProps.disabled && childElement !== null && childElement !== void 0 && (_childElement$props2 = childElement.props) !== null && _childElement$props2 !== void 0 && _childElement$props2.to ? childElement === null || childElement === void 0 || (_childElement$props3 = childElement.props) === null || _childElement$props3 === void 0 ? void 0 : _childElement$props3.to : null
50
57
  });
51
58
  return childElementCopy;
52
59
  } else {
53
60
  return _react.default.createElement("button", _extends({}, buttonProps, {
54
- key: `button-${index}`,
61
+ key: "button-".concat(index),
55
62
  className: className
56
63
  }), props.content || childElement.props.children);
57
64
  }
@@ -69,11 +76,11 @@ const Button = props => {
69
76
  }, _react.default.createElement("input", _extends({}, buttonProps, {
70
77
  type: "radio"
71
78
  })), props.content);
72
- } else if (props.href?.length && !props.disabled) {
79
+ } else if ((_props$href2 = props.href) !== null && _props$href2 !== void 0 && _props$href2.length && !props.disabled) {
73
80
  return _react.default.createElement("a", _extends({}, buttonProps, {
74
81
  className: className
75
82
  }), props.content || props.children);
76
- } else if (props?.children?.type === _reactRouterDom.Link) {
83
+ } else if ((props === null || props === void 0 || (_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === _reactRouterDom.Link) {
77
84
  return _react.default.createElement(_react.Fragment, null, renderReactLinkElements(_react.default.Children.toArray(props.children)));
78
85
  } else {
79
86
  return _react.default.createElement("button", _extends({}, buttonProps, {
@@ -15,7 +15,7 @@ const CheckBoxIcon = props => {
15
15
  fontSize: props.size
16
16
  };
17
17
  const checkBoxIconProps = {
18
- className: `${_CheckBoxIconModule.default.checkBoxIcon} ${props.checked ? _CheckBoxIconModule.default.checked : ""} ${props.disabled ? _CheckBoxIconModule.default.disabled : ""} ${props.showBox ? _CheckBoxIconModule.default.showBox : ""} ${props.hasErrors ? _CheckBoxIconModule.default.hasErrors : ""}`,
18
+ className: "".concat(_CheckBoxIconModule.default.checkBoxIcon, " ").concat(props.checked ? _CheckBoxIconModule.default.checked : "", " ").concat(props.disabled ? _CheckBoxIconModule.default.disabled : "", " ").concat(props.showBox ? _CheckBoxIconModule.default.showBox : "", " ").concat(props.hasErrors ? _CheckBoxIconModule.default.hasErrors : ""),
19
19
  style: inlineStyle
20
20
  };
21
21
  return _react.default.createElement("span", checkBoxIconProps, _react.default.createElement("span", {
@@ -12,7 +12,7 @@ var _CheckBoxInputModule = _interopRequireDefault(require("./CheckBoxInput.modul
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
13
  const CheckBoxInput = props => {
14
14
  const labelProps = {
15
- className: `${_CheckBoxInputModule.default.checkBoxInput} ${props.contentOnly ? _CheckBoxInputModule.default.contentOnly : ""} ${props.disabled ? _CheckBoxInputModule.default.disabled : ""} ${props.hasErrors ? _CheckBoxInputModule.default.hasErrors : ""}`,
15
+ className: "".concat(_CheckBoxInputModule.default.checkBoxInput, " ").concat(props.contentOnly ? _CheckBoxInputModule.default.contentOnly : "", " ").concat(props.disabled ? _CheckBoxInputModule.default.disabled : "", " ").concat(props.hasErrors ? _CheckBoxInputModule.default.hasErrors : ""),
16
16
  htmlFor: props.id
17
17
  };
18
18
  const iconProps = {
@@ -22,12 +22,13 @@ const CheckBoxList = _ref => {
22
22
  const renderChildElements = childElements => {
23
23
  const childElementsthroughFragments = (0, _helpers.cloneThroughFragments)(childElements);
24
24
  return childElementsthroughFragments.map((childElement, index) => {
25
- const isCheckBoxListItem = childElement?.props?.type === "CheckBoxListItem";
25
+ var _childElement$props;
26
+ const isCheckBoxListItem = (childElement === null || childElement === void 0 || (_childElement$props = childElement.props) === null || _childElement$props === void 0 ? void 0 : _childElement$props.type) === "CheckBoxListItem";
26
27
  if (isCheckBoxListItem) {
27
28
  const childElementCopy = _react.default.cloneElement(childElement, {
28
29
  requiredGroup: required,
29
30
  compact: compact,
30
- key: `checkboxListItem-${index}`
31
+ key: "checkboxListItem-".concat(index)
31
32
  });
32
33
  return childElementCopy;
33
34
  } else {
@@ -37,7 +38,7 @@ const CheckBoxList = _ref => {
37
38
  };
38
39
  return _react.default.createElement("fieldset", {
39
40
  className: _CheckBoxListModule.default.checkBoxList
40
- }, !!legend?.length ? _react.default.createElement("legend", null, legendSize ? _react.default.createElement(_Header.default, {
41
+ }, !!(legend !== null && legend !== void 0 && legend.length) ? _react.default.createElement("legend", null, legendSize ? _react.default.createElement(_Header.default, {
41
42
  size: legendSize
42
43
  }, legend) : legend, required && _react.default.createElement("img", {
43
44
  src: _asterisk.default,
@@ -9,8 +9,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _ContainerModule = _interopRequireDefault(require("./Container.module.scss"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const Container = props => {
12
+ var _props$maxWidth;
12
13
  const styleProps = {
13
- "--max-width": props?.maxWidth?.length && props.maxWidth
14
+ "--max-width": (props === null || props === void 0 || (_props$maxWidth = props.maxWidth) === null || _props$maxWidth === void 0 ? void 0 : _props$maxWidth.length) && props.maxWidth
14
15
  };
15
16
  return _react.default.createElement("div", {
16
17
  className: _ContainerModule.default.container,
@@ -9,6 +9,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _ContentBoxModule = _interopRequireDefault(require("./ContentBox.module.scss"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const ContentBox = props => {
12
+ var _props$content;
12
13
  const renderTitle = () => {
13
14
  let className = _ContentBoxModule.default.title + " " + _ContentBoxModule.default[props.titleSize];
14
15
  if (props.title) {
@@ -22,7 +23,7 @@ const ContentBox = props => {
22
23
  let colorClass = " " + _ContentBoxModule.default[props.color];
23
24
  let linkClass = props.href ? " " + _ContentBoxModule.default.link : "";
24
25
  let className = _ContentBoxModule.default.contentBox + colorClass + linkClass;
25
- const bodyContent = props.content?.length ? props.content : props.children;
26
+ const bodyContent = (_props$content = props.content) !== null && _props$content !== void 0 && _props$content.length ? props.content : props.children;
26
27
  if (props.href) {
27
28
  return _react.default.createElement("a", {
28
29
  href: props.href,
@@ -21,7 +21,7 @@ const DescriptionList = _ref => {
21
21
  const childElementCopy = _react.default.cloneElement(childElement, {
22
22
  compact: compact,
23
23
  titleWidth: titleWidth,
24
- key: `descriptionListItem-${index}`
24
+ key: "descriptionListItem-".concat(index)
25
25
  });
26
26
  return childElementCopy;
27
27
  });
@@ -13,6 +13,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  const Dialog = props => {
16
+ var _props$attachTo, _props$maxWidth;
16
17
  const dialogRef = (0, _react.useRef)();
17
18
  const dialogContainerRef = (0, _react.useRef)();
18
19
  const dialogContentRef = (0, _react.useCallback)(element => {
@@ -32,7 +33,7 @@ const Dialog = props => {
32
33
  }
33
34
  };
34
35
  const handleClickOutside = event => {
35
- if (dialogContainerRef?.current && !dialogContainerRef.current.contains(event.target)) {
36
+ if (dialogContainerRef !== null && dialogContainerRef !== void 0 && dialogContainerRef.current && !dialogContainerRef.current.contains(event.target)) {
36
37
  props.onClickOutside();
37
38
  }
38
39
  };
@@ -45,9 +46,9 @@ const Dialog = props => {
45
46
  props.modal ? dialogRef.current.showModal() : dialogRef.current.show();
46
47
  }
47
48
  }, [dialogRef, props.hidden, props.modal]);
48
- const sideBarClassNames = props.attachTo?.length && (0, _helpers.classNameArrayToClassNameString)([_DialogModule.default.isSidebar, _DialogModule.default[props.attachTo]]);
49
+ const sideBarClassNames = ((_props$attachTo = props.attachTo) === null || _props$attachTo === void 0 ? void 0 : _props$attachTo.length) && (0, _helpers.classNameArrayToClassNameString)([_DialogModule.default.isSidebar, _DialogModule.default[props.attachTo]]);
49
50
  const dialogContentStyleProps = {
50
- "--max-width": props?.maxWidth?.length && props.maxWidth
51
+ "--max-width": (props === null || props === void 0 || (_props$maxWidth = props.maxWidth) === null || _props$maxWidth === void 0 ? void 0 : _props$maxWidth.length) && props.maxWidth
51
52
  };
52
53
  return _react.default.createElement("dialog", {
53
54
  className: (0, _helpers.classNameArrayToClassNameString)([_DialogModule.default.dialog, sideBarClassNames]),
@@ -16,6 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
18
18
  const DragAndDropFileInput = props => {
19
+ var _props$errorMessage, _props$ariaDescribed;
19
20
  const [highlight, setHighlight] = (0, _react.useState)(false);
20
21
  const containerElementRef = (0, _react.useRef)();
21
22
  const fileInputElementRef = (0, _react.useRef)();
@@ -30,11 +31,11 @@ const DragAndDropFileInput = props => {
30
31
  fileInputElementRef.current.click();
31
32
  };
32
33
  const getErrorElementId = () => {
33
- return `${props.id}-errorMessage`;
34
+ return "".concat(props.id, "-errorMessage");
34
35
  };
35
36
  const inputElementProps = {
36
37
  id: props.id,
37
- "aria-describedby": props.hasErrors && !!props.errorMessage?.length ? getErrorElementId() : !!props["aria-describedby"]?.length ? props["aria-describedby"] : null,
38
+ "aria-describedby": props.hasErrors && !!((_props$errorMessage = props.errorMessage) !== null && _props$errorMessage !== void 0 && _props$errorMessage.length) ? getErrorElementId() : !!((_props$ariaDescribed = props["aria-describedby"]) !== null && _props$ariaDescribed !== void 0 && _props$ariaDescribed.length) ? props["aria-describedby"] : null,
38
39
  "aria-invalid": props.hasErrors ? "true" : null,
39
40
  name: props.name,
40
41
  required: props.required
@@ -53,7 +54,7 @@ const DragAndDropFileInput = props => {
53
54
  const files = e.dataTransfer.files;
54
55
  handleFiles(files);
55
56
  };
56
- if (containerElementRef?.current) {
57
+ if (containerElementRef !== null && containerElementRef !== void 0 && containerElementRef.current) {
57
58
  containerElementRef.current.addEventListener("dragenter", preventDefaults, false);
58
59
  containerElementRef.current.addEventListener("dragover", preventDefaults, false);
59
60
  containerElementRef.current.addEventListener("dragleave", preventDefaults, false);
@@ -83,7 +84,7 @@ const DragAndDropFileInput = props => {
83
84
  className: _DragAndDropFileInputModule.default.requiredSymbol
84
85
  })), _react.default.createElement("div", null, props.children), !props.contentOnly ? _react.default.createElement("div", {
85
86
  ref: containerElementRef,
86
- className: `${_DragAndDropFileInputModule.default.dragAndDropContainer} ${highlight ? _DragAndDropFileInputModule.default.highlighted : ""}`
87
+ className: "".concat(_DragAndDropFileInputModule.default.dragAndDropContainer, " ").concat(highlight ? _DragAndDropFileInputModule.default.highlighted : "")
87
88
  }, props.selectedFileName ? _react.default.createElement("div", null, _react.default.createElement("span", null, _react.default.createElement("b", null, "Valgt fil:"), " ", props.selectedFileName)) : _react.default.createElement("div", null, "Slipp fil her"), _react.default.createElement("input", _extends({}, inputElementProps, {
88
89
  ref: fileInputElementRef,
89
90
  type: "file",
@@ -11,13 +11,15 @@ var _errorSign = _interopRequireDefault(require("../assets/svg/error-sign.svg?ur
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
13
13
  const ErrorMessage = props => {
14
+ var _props$content;
14
15
  const getErrorElementProps = () => {
16
+ var _props$id;
15
17
  return {
16
- id: !!props.id?.length ? props.id : null,
18
+ id: !!((_props$id = props.id) !== null && _props$id !== void 0 && _props$id.length) ? props.id : null,
17
19
  className: _ErrorMessageModule.default.errorMessage
18
20
  };
19
21
  };
20
- return props?.content?.length ? _react.default.createElement("span", _extends({
22
+ return props !== null && props !== void 0 && (_props$content = props.content) !== null && _props$content !== void 0 && _props$content.length ? _react.default.createElement("span", _extends({
21
23
  "aria-live": "polite"
22
24
  }, getErrorElementProps()), _react.default.createElement("img", {
23
25
  src: _errorSign.default,
@@ -10,18 +10,19 @@ var _HeaderModule = _interopRequireDefault(require("./Header.module.scss"));
10
10
  var _helpers = require("../functions/helpers");
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  const Header = props => {
13
+ var _props$htmlTag, _props$label, _props$content;
13
14
  const bigClass = props.big ? _HeaderModule.default.bigHeader : "";
14
- const htmlTag = props.htmlTag?.length ? props.htmlTag : `h${props.size}`;
15
+ const htmlTag = (_props$htmlTag = props.htmlTag) !== null && _props$htmlTag !== void 0 && _props$htmlTag.length ? props.htmlTag : "h".concat(props.size);
15
16
  const headerClass = _HeaderModule.default.header;
16
- const headerSizeClass = _HeaderModule.default[`size-${props.size}`];
17
+ const headerSizeClass = _HeaderModule.default["size-".concat(props.size)];
17
18
  let headerElement = _react.default.createElement(htmlTag, {
18
19
  className: (0, _helpers.classNameArrayToClassNameString)([headerClass, headerSizeClass, bigClass]),
19
20
  id: props.id || null,
20
21
  htmlFor: props.htmlFor || null,
21
- style: props?.label?.length ? {
22
- "--label": `"${props.label}"`
22
+ style: props !== null && props !== void 0 && (_props$label = props.label) !== null && _props$label !== void 0 && _props$label.length ? {
23
+ "--label": "\"".concat(props.label, "\"")
23
24
  } : null
24
- }, !!props.content?.length ? props.content : props.children);
25
+ }, !!((_props$content = props.content) !== null && _props$content !== void 0 && _props$content.length) ? props.content : props.children);
25
26
  return _react.default.createElement("div", {
26
27
  className: _HeaderModule.default.headerContainer
27
28
  }, " ", headerElement, " ");
@@ -14,24 +14,31 @@ var _helpers = require("../functions/helpers");
14
14
  var _asterisk = _interopRequireDefault(require("../assets/svg/asterisk.svg?url"));
15
15
  var _InputFieldModule = _interopRequireDefault(require("./InputField.module.scss"));
16
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
20
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
21
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
22
  const InputField = props => {
23
+ var _props$width;
18
24
  const formatDate = inputDate => {
19
25
  if (!inputDate) {
20
26
  return null;
21
27
  }
22
28
  const date = new Date(inputDate);
23
29
  const year = date.getFullYear();
24
- const month = date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1;
25
- const day = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate();
26
- return `${day}.${month}.${year}`;
30
+ const month = date.getMonth() + 1 < 10 ? "0".concat(date.getMonth() + 1) : date.getMonth() + 1;
31
+ const day = date.getDate() < 10 ? "0".concat(date.getDate()) : date.getDate();
32
+ return "".concat(day, ".").concat(month, ".").concat(year);
27
33
  };
28
34
  const renderValueAsText = (value, defaultContent) => {
29
35
  return props.type === "date" ? value ? formatDate(value) : defaultContent : value ? value : defaultContent;
30
36
  };
31
37
  const getErrorElementId = () => {
32
- return `${props.id}-errorMessage`;
38
+ return "".concat(props.id, "-errorMessage");
33
39
  };
34
40
  const getInputElementProps = (defaultValue, defaultKey, styleRules) => {
41
+ var _props$errorMessage, _props$ariaDescribed;
35
42
  return {
36
43
  name: props.name,
37
44
  readOnly: props.readOnly,
@@ -40,7 +47,7 @@ const InputField = props => {
40
47
  type: props.type,
41
48
  role: props.role,
42
49
  id: props.id,
43
- key: defaultKey || `${props.id}-${(0, _generators.generateRandomString)(6)}`,
50
+ key: defaultKey || "".concat(props.id, "-").concat((0, _generators.generateRandomString)(6)),
44
51
  min: props.min || null,
45
52
  max: props.max || null,
46
53
  onChange: props.onChange,
@@ -48,7 +55,7 @@ const InputField = props => {
48
55
  [defaultValue ? "defaultValue" : "value"]: defaultValue || props.value,
49
56
  placeholder: props.placeholder || null,
50
57
  className: props.hasErrors ? _InputFieldModule.default.hasErrors : null,
51
- "aria-describedby": props.hasErrors && !!props.errorMessage?.length ? getErrorElementId() : !!props["aria-describedby"]?.length ? props["aria-describedby"] : null,
58
+ "aria-describedby": props.hasErrors && !!((_props$errorMessage = props.errorMessage) !== null && _props$errorMessage !== void 0 && _props$errorMessage.length) ? getErrorElementId() : !!((_props$ariaDescribed = props["aria-describedby"]) !== null && _props$ariaDescribed !== void 0 && _props$ariaDescribed.length) ? props["aria-describedby"] : null,
52
59
  "aria-invalid": props.hasErrors ? "true" : null,
53
60
  "aria-autocomplete": props["aria-autocomplete"] || null,
54
61
  style: styleRules
@@ -56,11 +63,9 @@ const InputField = props => {
56
63
  };
57
64
  const defaultValue = props.defaultValue ? props.defaultValue : props.value || null;
58
65
  const defaultKey = props.elementKey || null;
59
- const styleRules = {
60
- ...(props.width?.length && {
61
- maxWidth: props.width
62
- })
63
- };
66
+ const styleRules = _objectSpread({}, ((_props$width = props.width) === null || _props$width === void 0 ? void 0 : _props$width.length) && {
67
+ maxWidth: props.width
68
+ });
64
69
  return _react.default.createElement("div", {
65
70
  className: (0, _helpers.classNameArrayToClassNameString)([_InputFieldModule.default.inputField, _InputFieldModule.default[props.type], props.noMargin && _InputFieldModule.default.noMargin])
66
71
  }, _react.default.createElement(_Label.default, {
@@ -8,20 +8,23 @@ var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _LabelModule = _interopRequireDefault(require("./Label.module.scss"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
15
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
16
  const Label = props => {
12
- let labelProps = {
13
- ...props
14
- };
15
- const htmlTag = props.htmlTag?.length ? props.htmlTag : "label";
17
+ var _props$htmlTag;
18
+ let labelProps = _objectSpread({}, props);
19
+ const htmlTag = (_props$htmlTag = props.htmlTag) !== null && _props$htmlTag !== void 0 && _props$htmlTag.length ? props.htmlTag : "label";
16
20
  delete labelProps.inline;
17
21
  delete labelProps.normalCursor;
18
22
  delete labelProps.htmlTag;
19
- const className = `${_LabelModule.default.label} ${props.inline ? _LabelModule.default.inline : ""} ${props.normalCursor ? _LabelModule.default.normalCursor : ""}`;
20
- const labelElement = _react.default.createElement(htmlTag, {
21
- ...labelProps,
23
+ const className = "".concat(_LabelModule.default.label, " ").concat(props.inline ? _LabelModule.default.inline : "", " ").concat(props.normalCursor ? _LabelModule.default.normalCursor : "");
24
+ const labelElement = _react.default.createElement(htmlTag, _objectSpread(_objectSpread({}, labelProps), {}, {
22
25
  className,
23
26
  id: props.id || null
24
- }, props.children);
27
+ }), props.children);
25
28
  return labelElement;
26
29
  };
27
30
  Label.propTypes = {
@@ -15,7 +15,7 @@ const List = props => {
15
15
  return childElementsthroughFragments.map((childElement, index) => {
16
16
  const childElementCopy = _react.default.cloneElement(childElement, {
17
17
  compact: props.compact,
18
- key: `listItem-${index}`
18
+ key: "listItem-".concat(index)
19
19
  });
20
20
  return childElementCopy;
21
21
  });
@@ -25,7 +25,7 @@ const List = props => {
25
25
  const defaultListStyle = props.ordered ? "decimal" : "disc";
26
26
  const scssValueProperty = "--listStyle";
27
27
  let listElement = _react.default.createElement(listType, {
28
- className: `${_ListModule.default.list} ${!!props.compact ? _ListModule.default.compact : ""}`,
28
+ className: "".concat(_ListModule.default.list, " ").concat(!!props.compact ? _ListModule.default.compact : ""),
29
29
  style: {
30
30
  [scssValueProperty]: props.listStyle || defaultListStyle
31
31
  }
@@ -17,6 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
19
19
  const NavigationBar = props => {
20
+ var _props$primaryListIte, _props$secondaryListI, _props$mainContentId;
20
21
  const [active, setActive] = (0, _react.useState)(false);
21
22
  const toggleList = () => {
22
23
  setActive(!active);
@@ -43,7 +44,7 @@ const NavigationBar = props => {
43
44
  });
44
45
  }
45
46
  });
46
- return !!listItems?.length && _react.default.createElement("ul", {
47
+ return !!(listItems !== null && listItems !== void 0 && listItems.length) && _react.default.createElement("ul", {
47
48
  className: _NavigationBarModule.default.primaryList
48
49
  }, listItems);
49
50
  };
@@ -55,7 +56,7 @@ const NavigationBar = props => {
55
56
  theme: props.theme
56
57
  });
57
58
  });
58
- return !!listItems?.length && _react.default.createElement("ul", {
59
+ return !!(listItems !== null && listItems !== void 0 && listItems.length) && _react.default.createElement("ul", {
59
60
  className: _NavigationBarModule.default.secondaryList
60
61
  }, listItems);
61
62
  };
@@ -66,7 +67,7 @@ const NavigationBar = props => {
66
67
  if (logoLink && logoLinkTitle) {
67
68
  return "";
68
69
  } else if (themeLogo && themeAppName) {
69
- return `${themeAppName} logo`;
70
+ return "".concat(themeAppName, " logo");
70
71
  } else {
71
72
  return "DIBK logo";
72
73
  }
@@ -91,12 +92,12 @@ const NavigationBar = props => {
91
92
  title: logoLinkTitle
92
93
  }), renderLogoElement()) : renderLogoElement();
93
94
  };
94
- const hasListItems = !!props.primaryListItems?.length || !!props.secondaryListItems?.length;
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);
95
96
  return _react.default.createElement("div", {
96
97
  className: (0, _helpers.classNameArrayToClassNameString)([props.compact && _NavigationBarModule.default.compact, _NavigationBarModule.default.navigationBarContainer])
97
- }, props.mainContentId?.length && _react.default.createElement("a", {
98
+ }, ((_props$mainContentId = props.mainContentId) === null || _props$mainContentId === void 0 ? void 0 : _props$mainContentId.length) && _react.default.createElement("a", {
98
99
  id: "main-content-link",
99
- href: `#${props.mainContentId}`,
100
+ href: "#".concat(props.mainContentId),
100
101
  className: _NavigationBarModule.default.mainContentLink
101
102
  }, _react.default.createElement("span", {
102
103
  id: "main-content-link-text"
@@ -108,7 +109,7 @@ const NavigationBar = props => {
108
109
  className: _NavigationBarModule.default.childElements
109
110
  }, props.children), hasListItems && _react.default.createElement("button", {
110
111
  type: "button",
111
- className: `${_NavigationBarModule.default.menuToggle} ${active ? _NavigationBarModule.default.active : ""}`,
112
+ className: "".concat(_NavigationBarModule.default.menuToggle, " ").concat(active ? _NavigationBarModule.default.active : ""),
112
113
  onClick: () => toggleList(),
113
114
  "aria-expanded": active ? "true" : "false",
114
115
  "aria-controls": "main-menu-dropdown"
@@ -24,6 +24,10 @@ $width-checkbox: 22px;
24
24
  $heading-logo-width: 100px;
25
25
  $heading-logo-margin-left: 15px;
26
26
 
27
+ $margin-sm: 12px;
28
+ $margin-md: 24px;
29
+ $margin-lg: 36px;
30
+
27
31
  $margin-top-h1: 5px;
28
32
  $margin-top-h2: 22px;
29
33
  $margin-bottom-h2: 2px;
@@ -442,6 +446,72 @@ body {
442
446
  line-height: 1.2em;
443
447
  flex: none;
444
448
  }
449
+
450
+ //Margins
451
+ *[style*="--mt:none"],
452
+ *[style*="--mt: none"] {
453
+ margin-top: 0;
454
+ }
455
+ *[style*="--mb:none"],
456
+ *[style*="--mb: none"] {
457
+ margin-bottom: 0;
458
+ }
459
+ *[style*="--ml:none"],
460
+ *[style*="--ml: none"] {
461
+ margin-left: 0;
462
+ }
463
+ *[style*="--mr:none"],
464
+ *[style*="--mr: none"] {
465
+ margin-right: 0;
466
+ }
467
+ *[style*="--mt:sm"],
468
+ *[style*="--mt: sm"] {
469
+ margin-top: $margin-sm;
470
+ }
471
+ *[style*="--mb:sm"],
472
+ *[style*="--mb: sm"] {
473
+ margin-bottom: $margin-sm;
474
+ }
475
+ *[style*="--ml:sm"],
476
+ *[style*="--ml: sm"] {
477
+ margin-left: $margin-sm;
478
+ }
479
+ *[style*="--mr:sm"],
480
+ *[style*="--mr: sm"] {
481
+ margin-right: $margin-sm;
482
+ }
483
+ *[style*="--mt:md"],
484
+ *[style*="--mt: md"] {
485
+ margin-top: $margin-md;
486
+ }
487
+ *[style*="--mb:md"],
488
+ *[style*="--mb: md"] {
489
+ margin-bottom: $margin-md;
490
+ }
491
+ *[style*="--ml:md"],
492
+ *[style*="--ml: md"] {
493
+ margin-left: $margin-md;
494
+ }
495
+ *[style*="--mr:md"],
496
+ *[style*="--mr: md"] {
497
+ margin-right: $margin-md;
498
+ }
499
+ *[style*="--mt:lg"],
500
+ *[style*="--mt: lg"] {
501
+ margin-top: $margin-lg;
502
+ }
503
+ *[style*="--mb:lg"],
504
+ *[style*="--mb: lg"] {
505
+ margin-bottom: $margin-lg;
506
+ }
507
+ *[style*="--ml:lg"],
508
+ *[style*="--ml: lg"] {
509
+ margin-left: $margin-lg;
510
+ }
511
+ *[style*="--mr:lg"],
512
+ *[style*="--mr: lg"] {
513
+ margin-right: $margin-lg;
514
+ }
445
515
  }
446
516
 
447
517
  // For signed documents
@@ -605,6 +675,55 @@ body {
605
675
  }
606
676
  }
607
677
  }
678
+ //Margins
679
+ *[style*="--mt:sm"],
680
+ *[style*="--mt: sm"] {
681
+ margin-top: calc($margin-sm * $scaling-for-signed-documents);
682
+ }
683
+ *[style*="--mb:sm"],
684
+ *[style*="--mb: sm"] {
685
+ margin-bottom: calc($margin-sm * $scaling-for-signed-documents);
686
+ }
687
+ *[style*="--ml:sm"],
688
+ *[style*="--ml: sm"] {
689
+ margin-left: calc($margin-sm * $scaling-for-signed-documents);
690
+ }
691
+ *[style*="--mr:sm"],
692
+ *[style*="--mr: sm"] {
693
+ margin-right: calc($margin-sm * $scaling-for-signed-documents);
694
+ }
695
+ *[style*="--mt:md"],
696
+ *[style*="--mt: md"] {
697
+ margin-top: calc($margin-md * $scaling-for-signed-documents);
698
+ }
699
+ *[style*="--mb:md"],
700
+ *[style*="--mb: md"] {
701
+ margin-bottom: calc($margin-md * $scaling-for-signed-documents);
702
+ }
703
+ *[style*="--ml:md"],
704
+ *[style*="--ml: md"] {
705
+ margin-left: calc($margin-md * $scaling-for-signed-documents);
706
+ }
707
+ *[style*="--mr:md"],
708
+ *[style*="--mr: md"] {
709
+ margin-right: calc($margin-md * $scaling-for-signed-documents);
710
+ }
711
+ *[style*="--mt:lg"],
712
+ *[style*="--mt: lg"] {
713
+ margin-top: calc($margin-lg * $scaling-for-signed-documents);
714
+ }
715
+ *[style*="--mb:lg"],
716
+ *[style*="--mb: lg"] {
717
+ margin-bottom: calc($margin-lg * $scaling-for-signed-documents);
718
+ }
719
+ *[style*="--ml:lg"],
720
+ *[style*="--ml: lg"] {
721
+ margin-left: calc($margin-lg * $scaling-for-signed-documents);
722
+ }
723
+ *[style*="--mr:lg"],
724
+ *[style*="--mr: lg"] {
725
+ margin-right: calc($margin-lg * $scaling-for-signed-documents);
726
+ }
608
727
  }
609
728
  @media print {
610
729
  .page.signed-document {
@@ -10,7 +10,7 @@ var _PaperModule = _interopRequireDefault(require("./Paper.module.scss"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const Paper = props => {
12
12
  return _react.default.createElement("div", {
13
- className: `${_PaperModule.default.paper} ${props.noMargin ? _PaperModule.default.noMargin : ""} ${props.noPadding ? _PaperModule.default.noPadding : ""}`
13
+ className: "".concat(_PaperModule.default.paper, " ").concat(props.noMargin ? _PaperModule.default.noMargin : "", " ").concat(props.noPadding ? _PaperModule.default.noPadding : "")
14
14
  }, props.children);
15
15
  };
16
16
  Paper.propTypes = {
@@ -11,7 +11,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
11
11
  const ProgressBar = props => {
12
12
  const scssValueProperty = "--value";
13
13
  return _react.default.createElement("div", {
14
- className: `${_ProgressBarModule.default.progressBar} ${props.hasErrors ? _ProgressBarModule.default.hasErrors : ""}`,
14
+ className: "".concat(_ProgressBarModule.default.progressBar, " ").concat(props.hasErrors ? _ProgressBarModule.default.hasErrors : ""),
15
15
  role: "progressbar",
16
16
  "aria-valuenow": props.progress || 0,
17
17
  "aria-valuemin": "0",
@@ -14,7 +14,7 @@ const RadioButtonIcon = props => {
14
14
  width: props.size
15
15
  };
16
16
  const radioButtonIconProps = {
17
- className: `${_RadioButtonIconModule.default.radioButtonIcon} ${props.checked ? _RadioButtonIconModule.default.checked : ""} ${props.disabled ? _RadioButtonIconModule.default.disabled : ""} ${props.hasErrors ? _RadioButtonIconModule.default.hasErrors : ""}`,
17
+ className: "".concat(_RadioButtonIconModule.default.radioButtonIcon, " ").concat(props.checked ? _RadioButtonIconModule.default.checked : "", " ").concat(props.disabled ? _RadioButtonIconModule.default.disabled : "", " ").concat(props.hasErrors ? _RadioButtonIconModule.default.hasErrors : ""),
18
18
  style: inlineStyle
19
19
  };
20
20
  return _react.default.createElement("span", radioButtonIconProps);
@@ -12,7 +12,7 @@ var _RadioButtonInputModule = _interopRequireDefault(require("./RadioButtonInput
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
13
  const RadioButtonInput = props => {
14
14
  const labelProps = {
15
- className: `${_RadioButtonInputModule.default.radioButtonInput} ${props.checked ? _RadioButtonInputModule.default.checked : ""} ${props.disabled ? _RadioButtonInputModule.default.disabled : ""} ${props.hasErrors ? _RadioButtonInputModule.default.hasErrors : ""}`,
15
+ className: "".concat(_RadioButtonInputModule.default.radioButtonInput, " ").concat(props.checked ? _RadioButtonInputModule.default.checked : "", " ").concat(props.disabled ? _RadioButtonInputModule.default.disabled : "", " ").concat(props.hasErrors ? _RadioButtonInputModule.default.hasErrors : ""),
16
16
  htmlFor: props.id
17
17
  };
18
18
  const iconProps = {
@@ -22,12 +22,13 @@ const RadioButtonList = _ref => {
22
22
  const renderChildElements = childElements => {
23
23
  const childElementsthroughFragments = (0, _helpers.cloneThroughFragments)(childElements);
24
24
  return childElementsthroughFragments.map((childElement, index) => {
25
- const isRadioButtonListItem = childElement?.props?.type === "RadioButtonListItem";
25
+ var _childElement$props;
26
+ const isRadioButtonListItem = (childElement === null || childElement === void 0 || (_childElement$props = childElement.props) === null || _childElement$props === void 0 ? void 0 : _childElement$props.type) === "RadioButtonListItem";
26
27
  if (isRadioButtonListItem) {
27
28
  const childElementCopy = _react.default.cloneElement(childElement, {
28
29
  requiredGroup: required,
29
30
  compact: compact,
30
- key: `radioButtonListItem-${index}`
31
+ key: "radioButtonListItem-".concat(index)
31
32
  });
32
33
  return childElementCopy;
33
34
  } else {
@@ -37,7 +38,7 @@ const RadioButtonList = _ref => {
37
38
  };
38
39
  return _react.default.createElement("fieldset", {
39
40
  className: _RadioButtonListModule.default.radioButtonList
40
- }, !!legend?.length ? _react.default.createElement("legend", null, legendSize ? _react.default.createElement(_Header.default, {
41
+ }, !!(legend !== null && legend !== void 0 && legend.length) ? _react.default.createElement("legend", null, legendSize ? _react.default.createElement(_Header.default, {
41
42
  size: legendSize
42
43
  }, legend) : legend, required && _react.default.createElement("img", {
43
44
  src: _asterisk.default,
@@ -17,6 +17,11 @@ var _SelectModule = _interopRequireDefault(require("./Select.module.scss"));
17
17
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
18
  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); }
19
19
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
23
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
24
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
25
  const Select = props => {
21
26
  const [showDropdownList, setShowDropdownList] = (0, _react.useState)(false);
22
27
  const dropdownRef = (0, _react.useRef)();
@@ -39,7 +44,7 @@ const Select = props => {
39
44
  }
40
45
  };
41
46
  const handleClickOutside = event => {
42
- if (dropdownRef?.current && !dropdownRef.current.contains(event.target)) {
47
+ if (dropdownRef !== null && dropdownRef !== void 0 && dropdownRef.current && !dropdownRef.current.contains(event.target)) {
43
48
  hideDropdownList();
44
49
  }
45
50
  };
@@ -77,7 +82,7 @@ const Select = props => {
77
82
  };
78
83
  const renderSelectedValues = (options, selectElementProps) => {
79
84
  const selectedValues = selectElementProps.defaultValue || selectElementProps.value;
80
- return selectedValues?.length ? selectedValues.map(value => {
85
+ return selectedValues !== null && selectedValues !== void 0 && selectedValues.length ? selectedValues.map(value => {
81
86
  const keyForValue = getKeyByValue(value, options);
82
87
  return keyForValue;
83
88
  }).join(", ") : null;
@@ -89,7 +94,7 @@ const Select = props => {
89
94
  const isSelected = selectedValues && selectedValues.length && selectedValues.includes(optionObject.value);
90
95
  return _react.default.createElement(_CheckBoxListItem.default, {
91
96
  key: index,
92
- id: `${props.id}-${index}`,
97
+ id: "".concat(props.id, "-").concat(index),
93
98
  value: optionObject.value,
94
99
  checked: isSelected,
95
100
  onChange: () => selectElementProps.onChange(optionObject.value)
@@ -112,7 +117,7 @@ const Select = props => {
112
117
  }, placeholder) : "";
113
118
  };
114
119
  const getErrorElementId = () => {
115
- return `${props.id}-errorMessage`;
120
+ return "".concat(props.id, "-errorMessage");
116
121
  };
117
122
  if (props.contentOnly) {
118
123
  const value = props.defaultValue ? props.defaultValue : props.value || null;
@@ -122,12 +127,11 @@ const Select = props => {
122
127
  htmlFor: props.id
123
128
  }, props.label), _react.default.createElement("span", null, value ? props.keyAsContent ? getKeyByValue(value, props.options) : value : props.defaultContent));
124
129
  } else {
130
+ var _props$width, _props$errorMessage, _props$ariaDescribed, _props$width2;
125
131
  const defaultValue = !props.value && props.defaultValue ? props.defaultValue : false;
126
- const styleRules = {
127
- ...(props.width?.length && {
128
- maxWidth: props.width
129
- })
130
- };
132
+ const styleRules = _objectSpread({}, ((_props$width = props.width) === null || _props$width === void 0 ? void 0 : _props$width.length) && {
133
+ maxWidth: props.width
134
+ });
131
135
  const className = (0, _helpers.classNameArrayToClassNameString)([props.hasErrors && _SelectModule.default.hasErrors, props.multiple && _SelectModule.default.multiple]);
132
136
  const selectElementProps = {
133
137
  name: props.name,
@@ -138,9 +142,9 @@ const Select = props => {
138
142
  onChange: props.onChange,
139
143
  id: props.id,
140
144
  role: props.role,
141
- key: `${props.id}-${(0, _generators.generateRandomString)(6)}`,
145
+ key: "".concat(props.id, "-").concat((0, _generators.generateRandomString)(6)),
142
146
  className,
143
- "aria-describedby": props.hasErrors && !!props.errorMessage?.length ? getErrorElementId() : !!props["aria-describedby"]?.length ? props["aria-describedby"] : null,
147
+ "aria-describedby": props.hasErrors && !!((_props$errorMessage = props.errorMessage) !== null && _props$errorMessage !== void 0 && _props$errorMessage.length) ? getErrorElementId() : !!((_props$ariaDescribed = props["aria-describedby"]) !== null && _props$ariaDescribed !== void 0 && _props$ariaDescribed.length) ? props["aria-describedby"] : null,
144
148
  "aria-invalid": props.hasErrors ? "true" : null,
145
149
  style: styleRules
146
150
  };
@@ -154,11 +158,9 @@ const Select = props => {
154
158
  className: _SelectModule.default.requiredSymbol
155
159
  })), _react.default.createElement("div", {
156
160
  className: _SelectModule.default.selectContainer,
157
- style: {
158
- ...(props.width?.length && {
159
- maxWidth: props.width
160
- })
161
- }
161
+ style: _objectSpread({}, ((_props$width2 = props.width) === null || _props$width2 === void 0 ? void 0 : _props$width2.length) && {
162
+ maxWidth: props.width
163
+ })
162
164
  }, _react.default.createElement("span", {
163
165
  className: _SelectModule.default.selectListArrow
164
166
  }), props.multiple ? _react.default.createElement("div", {
@@ -12,12 +12,12 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
12
12
  const getCaptionAlignClass = captionAlign => {
13
13
  const defaultValue = "left";
14
14
  const availableValues = ["left", "center", "right"];
15
- return captionAlign?.length && availableValues.includes(captionAlign) ? _TableModule.default[`captionAlign-${captionAlign}`] : _TableModule.default[`captionAlign-${defaultValue}`];
15
+ return captionAlign !== null && captionAlign !== void 0 && captionAlign.length && availableValues.includes(captionAlign) ? _TableModule.default["captionAlign-".concat(captionAlign)] : _TableModule.default["captionAlign-".concat(defaultValue)];
16
16
  };
17
17
  const getCaptionSideClass = captionSide => {
18
18
  const defaultValue = "top";
19
19
  const availableValues = ["top", "bottom"];
20
- return captionSide?.length && availableValues.includes(captionSide) ? _TableModule.default[`captionSide-${captionSide}`] : _TableModule.default[`captionSide-${defaultValue}`];
20
+ return captionSide !== null && captionSide !== void 0 && captionSide.length && availableValues.includes(captionSide) ? _TableModule.default["captionSide-".concat(captionSide)] : _TableModule.default["captionSide-".concat(defaultValue)];
21
21
  };
22
22
  const Table = props => {
23
23
  return _react.default.createElement("table", {
@@ -12,24 +12,27 @@ var _generators = require("../functions/generators");
12
12
  var _asterisk = _interopRequireDefault(require("../assets/svg/asterisk.svg?url"));
13
13
  var _TextareaModule = _interopRequireDefault(require("./Textarea.module.scss"));
14
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
19
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
20
  const Textarea = props => {
16
21
  const renderValueAsText = (value, defaultContent) => {
17
22
  return value ? value : defaultContent;
18
23
  };
19
24
  const getErrorElementId = () => {
20
- return `${props.id}-errorMessage`;
25
+ return "".concat(props.id, "-errorMessage");
21
26
  };
22
27
  const renderInputField = () => {
23
- const defaultValue = !props.value?.length && props.defaultValue?.length ? props.defaultValue : false;
28
+ var _props$value, _props$defaultValue, _props$width, _props$resize, _props$errorMessage, _props$ariaDescribed;
29
+ 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;
24
30
  const defaultKey = props.elementKey || null;
25
- const styleRules = {
26
- ...(props.width?.length && {
27
- maxWidth: props.width
28
- }),
29
- ...(props.resize?.length && {
30
- resize: props.resize
31
- })
32
- };
31
+ const styleRules = _objectSpread(_objectSpread({}, ((_props$width = props.width) === null || _props$width === void 0 ? void 0 : _props$width.length) && {
32
+ maxWidth: props.width
33
+ }), ((_props$resize = props.resize) === null || _props$resize === void 0 ? void 0 : _props$resize.length) && {
34
+ resize: props.resize
35
+ });
33
36
  const textareaElementProps = {
34
37
  name: props.name,
35
38
  readOnly: props.readOnly,
@@ -37,14 +40,14 @@ const Textarea = props => {
37
40
  required: props.required,
38
41
  type: props.type,
39
42
  id: props.id,
40
- key: defaultKey || `${props.id}-${(0, _generators.generateRandomString)(6)}`,
43
+ key: defaultKey || "".concat(props.id, "-").concat((0, _generators.generateRandomString)(6)),
41
44
  onChange: props.onChange,
42
45
  onBlur: props.onBlur,
43
46
  [defaultValue ? "defaultValue" : "value"]: defaultValue || props.value,
44
47
  placeholder: props.placeholder,
45
48
  rows: props.rows,
46
49
  className: props.hasErrors ? _TextareaModule.default.hasErrors : "",
47
- "aria-describedby": props.hasErrors && !!props.errorMessage?.length ? getErrorElementId() : !!props["aria-describedby"]?.length ? props["aria-describedby"] : null,
50
+ "aria-describedby": props.hasErrors && !!((_props$errorMessage = props.errorMessage) !== null && _props$errorMessage !== void 0 && _props$errorMessage.length) ? getErrorElementId() : !!((_props$ariaDescribed = props["aria-describedby"]) !== null && _props$ariaDescribed !== void 0 && _props$ariaDescribed.length) ? props["aria-describedby"] : null,
48
51
  "aria-invalid": props.hasErrors ? "true" : null,
49
52
  style: styleRules
50
53
  };
@@ -35,7 +35,7 @@ const Theme = _ref => {
35
35
  return _react.default.createElement(_react.Fragment, {
36
36
  key: color
37
37
  }, _react.default.createElement("div", null, color), _react.default.createElement("div", {
38
- className: `${_ThemeModule.default.color} ${colorClassName}`
38
+ className: "".concat(_ThemeModule.default.color, " ").concat(colorClassName)
39
39
  }));
40
40
  });
41
41
  };
@@ -15,7 +15,7 @@ const ThemeProvider = _ref => {
15
15
  } = _ref;
16
16
  const cssVariablesFromTheme = (0, _helpers.getCssVariablesFromTheme)(theme);
17
17
  const cssColorVariablesString = (0, _helpers.stringifyCssColorVariables)(cssVariablesFromTheme);
18
- (0, _helpers.addGlobalStylesheet)("theme-provider", `:root {${cssColorVariablesString}} ${_ThemeProviderModule.default}`);
18
+ (0, _helpers.addGlobalStylesheet)("theme-provider", ":root {".concat(cssColorVariablesString, "} ").concat(_ThemeProviderModule.default));
19
19
  return children;
20
20
  };
21
21
  ThemeProvider.propTypes = {
@@ -8,6 +8,11 @@ var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _ToggleNavigationButtonModule = _interopRequireDefault(require("./ToggleNavigationButton.module.scss"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
15
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
16
  const ToggleNavigationButton = _ref => {
12
17
  let {
13
18
  id,
@@ -18,11 +23,10 @@ const ToggleNavigationButton = _ref => {
18
23
  isOpen
19
24
  } = _ref;
20
25
  const elementClass = _ToggleNavigationButtonModule.default.toggleNavigationButton;
21
- let element = _react.default.createElement(htmlTag, {
22
- ...buttonProps,
26
+ let element = _react.default.createElement(htmlTag, _objectSpread(_objectSpread({}, buttonProps), {}, {
23
27
  className: elementClass,
24
28
  id: id || null
25
- }, isOpen ? hideText : showText);
29
+ }), isOpen ? hideText : showText);
26
30
  return element;
27
31
  };
28
32
  ToggleNavigationButton.propTypes = {
@@ -11,6 +11,7 @@ var _helpers = require("../functions/helpers");
11
11
  var _WizardNavigationModule = _interopRequireDefault(require("./WizardNavigation.module.scss"));
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
13
  const WizardNavigation = props => {
14
+ var _Object$keys, _props$ariaLabel;
14
15
  const renderSteps = (steps, activeStepId) => {
15
16
  const hasSteps = steps && Object.keys(steps).length;
16
17
  return hasSteps ? Object.keys(steps).map((stepKey, stepIndex) => {
@@ -24,9 +25,9 @@ const WizardNavigation = props => {
24
25
  });
25
26
  }) : null;
26
27
  };
27
- const amountOfSteps = props.steps && Object.keys(props.steps)?.length ? Object.keys(props.steps).length : 0;
28
- const defaultAriaLabel = `I dette skjemaet er det totalt ${amountOfSteps} steg som du skal igjennom`;
29
- const ariaLabel = props["aria-label"]?.length ? props["aria-label"] : defaultAriaLabel;
28
+ const amountOfSteps = props.steps && (_Object$keys = Object.keys(props.steps)) !== null && _Object$keys !== void 0 && _Object$keys.length ? Object.keys(props.steps).length : 0;
29
+ const defaultAriaLabel = "I dette skjemaet er det totalt ".concat(amountOfSteps, " steg som du skal g\xE5 igjennom");
30
+ const ariaLabel = (_props$ariaLabel = props["aria-label"]) !== null && _props$ariaLabel !== void 0 && _props$ariaLabel.length ? props["aria-label"] : defaultAriaLabel;
30
31
  return _react.default.createElement("nav", {
31
32
  "aria-label": ariaLabel,
32
33
  className: (0, _helpers.classNameArrayToClassNameString)([_WizardNavigationModule.default.wizardTopnavContainer, _WizardNavigationModule.default[props.direction]])
@@ -5,8 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.stringifyCssColorVariables = exports.setFocusToElement = exports.getFocusableElementsInsideElement = exports.getCssVariablesFromTheme = exports.getCssSizeVariablesFromTheme = exports.getCssColorVariablesFromTheme = exports.cloneThroughFragments = exports.classNameArrayToClassNameString = exports.camelCaseToKebabCase = exports.addGlobalStylesheet = exports.addFocusTrapInsideElement = void 0;
7
7
  var _react = require("react");
8
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
12
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
13
  const classNameArrayToClassNameString = classNameArray => {
9
- return classNameArray?.filter(className => className)?.join(" ") || "";
14
+ var _classNameArray$filte;
15
+ return (classNameArray === null || classNameArray === void 0 || (_classNameArray$filte = classNameArray.filter(className => className)) === null || _classNameArray$filte === void 0 ? void 0 : _classNameArray$filte.join(" ")) || "";
10
16
  };
11
17
  exports.classNameArrayToClassNameString = classNameArrayToClassNameString;
12
18
  const camelCaseToKebabCase = string => {
@@ -14,43 +20,43 @@ const camelCaseToKebabCase = string => {
14
20
  };
15
21
  exports.camelCaseToKebabCase = camelCaseToKebabCase;
16
22
  const getCssColorVariablesFromTheme = theme => {
17
- return !!theme?.colors && !!Object.entries(theme?.colors)?.length && Object.entries(theme?.colors).reduce((acc, _ref) => {
23
+ var _Object$entries;
24
+ return !!(theme !== null && theme !== void 0 && theme.colors) && !!((_Object$entries = Object.entries(theme === null || theme === void 0 ? void 0 : theme.colors)) !== null && _Object$entries !== void 0 && _Object$entries.length) && Object.entries(theme === null || theme === void 0 ? void 0 : theme.colors).reduce((acc, _ref) => {
18
25
  let [key, value] = _ref;
19
- if (key?.length && value?.length) {
20
- acc[`--color-${camelCaseToKebabCase(key)}`] = value;
26
+ if (key !== null && key !== void 0 && key.length && value !== null && value !== void 0 && value.length) {
27
+ acc["--color-".concat(camelCaseToKebabCase(key))] = value;
21
28
  }
22
29
  return acc;
23
30
  }, {});
24
31
  };
25
32
  exports.getCssColorVariablesFromTheme = getCssColorVariablesFromTheme;
26
33
  const getCssSizeVariablesFromTheme = theme => {
27
- return !!theme?.sizes && !!Object.entries(theme?.sizes)?.length && Object.entries(theme?.sizes).reduce((acc, _ref2) => {
34
+ var _Object$entries2;
35
+ return !!(theme !== null && theme !== void 0 && theme.sizes) && !!((_Object$entries2 = Object.entries(theme === null || theme === void 0 ? void 0 : theme.sizes)) !== null && _Object$entries2 !== void 0 && _Object$entries2.length) && Object.entries(theme === null || theme === void 0 ? void 0 : theme.sizes).reduce((acc, _ref2) => {
28
36
  let [key, value] = _ref2;
29
- if (key?.length && value?.length) {
30
- acc[`--size-${camelCaseToKebabCase(key)}`] = value;
37
+ if (key !== null && key !== void 0 && key.length && value !== null && value !== void 0 && value.length) {
38
+ acc["--size-".concat(camelCaseToKebabCase(key))] = value;
31
39
  }
32
40
  return acc;
33
41
  }, {});
34
42
  };
35
43
  exports.getCssSizeVariablesFromTheme = getCssSizeVariablesFromTheme;
36
44
  const getCssVariablesFromTheme = theme => {
37
- return {
38
- ...getCssColorVariablesFromTheme(theme),
39
- ...getCssSizeVariablesFromTheme(theme)
40
- };
45
+ return _objectSpread(_objectSpread({}, getCssColorVariablesFromTheme(theme)), getCssSizeVariablesFromTheme(theme));
41
46
  };
42
47
  exports.getCssVariablesFromTheme = getCssVariablesFromTheme;
43
48
  const addGlobalStylesheet = (styleElementId, styles) => {
49
+ var _document$getElementB;
44
50
  const style = document.createElement("style");
45
51
  style.setAttribute("id", styleElementId);
46
52
  style.textContent = styles;
47
- document.getElementById(styleElementId)?.remove();
53
+ (_document$getElementB = document.getElementById(styleElementId)) === null || _document$getElementB === void 0 || _document$getElementB.remove();
48
54
  document.head.appendChild(style);
49
55
  };
50
56
  exports.addGlobalStylesheet = addGlobalStylesheet;
51
57
  const stringifyCssColorVariables = colorVariables => {
52
58
  return Object.keys(colorVariables).reduce((css, key) => {
53
- return `${css}${key}: ${colorVariables[key]};`;
59
+ return "".concat(css).concat(key, ": ").concat(colorVariables[key], ";");
54
60
  }, "");
55
61
  };
56
62
  exports.stringifyCssColorVariables = stringifyCssColorVariables;
@@ -60,9 +66,7 @@ const cloneThroughFragments = children => {
60
66
  if (c.type === _react.Fragment) {
61
67
  return cloneThroughFragments(c.props.children);
62
68
  }
63
- return (0, _react.cloneElement)(c, {
64
- ...c.props
65
- });
69
+ return (0, _react.cloneElement)(c, _objectSpread({}, c.props));
66
70
  }
67
71
  return c;
68
72
  });
@@ -84,8 +88,8 @@ exports.getFocusableElementsInsideElement = getFocusableElementsInsideElement;
84
88
  const addFocusTrapInsideElement = element => {
85
89
  setFocusToElement(element);
86
90
  const focusableElements = getFocusableElementsInsideElement(element);
87
- const firstFocusableElement = focusableElements?.length ? focusableElements[0] : null;
88
- const lastFocusableElement = focusableElements?.length > 1 ? focusableElements[focusableElements.length - 1] : firstFocusableElement;
91
+ const firstFocusableElement = focusableElements !== null && focusableElements !== void 0 && focusableElements.length ? focusableElements[0] : null;
92
+ const lastFocusableElement = (focusableElements === null || focusableElements === void 0 ? void 0 : focusableElements.length) > 1 ? focusableElements[focusableElements.length - 1] : firstFocusableElement;
89
93
  if (firstFocusableElement) {
90
94
  firstFocusableElement.onkeydown = event => {
91
95
  if (event.keyCode === 9 && event.shiftKey) {
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getThemeLogoPadding = exports.getThemeLogo = exports.getThemeAppName = void 0;
7
7
  const getThemeLogo = theme => {
8
- return theme?.logo || null;
8
+ return (theme === null || theme === void 0 ? void 0 : theme.logo) || null;
9
9
  };
10
10
  exports.getThemeLogo = getThemeLogo;
11
11
  const getThemeLogoPadding = theme => {
12
- return theme?.logoPadding || null;
12
+ return (theme === null || theme === void 0 ? void 0 : theme.logoPadding) || null;
13
13
  };
14
14
  exports.getThemeLogoPadding = getThemeLogoPadding;
15
15
  const getThemeAppName = theme => {
16
- return theme?.appName || null;
16
+ return (theme === null || theme === void 0 ? void 0 : theme.appName) || null;
17
17
  };
18
18
  exports.getThemeAppName = getThemeAppName;
@@ -343,6 +343,70 @@ body {
343
343
  line-height: 1.2em;
344
344
  flex: none;
345
345
  }
346
+ .page *[style*="--mt:none"],
347
+ .page *[style*="--mt: none"] {
348
+ margin-top: 0;
349
+ }
350
+ .page *[style*="--mb:none"],
351
+ .page *[style*="--mb: none"] {
352
+ margin-bottom: 0;
353
+ }
354
+ .page *[style*="--ml:none"],
355
+ .page *[style*="--ml: none"] {
356
+ margin-left: 0;
357
+ }
358
+ .page *[style*="--mr:none"],
359
+ .page *[style*="--mr: none"] {
360
+ margin-right: 0;
361
+ }
362
+ .page *[style*="--mt:sm"],
363
+ .page *[style*="--mt: sm"] {
364
+ margin-top: 12px;
365
+ }
366
+ .page *[style*="--mb:sm"],
367
+ .page *[style*="--mb: sm"] {
368
+ margin-bottom: 12px;
369
+ }
370
+ .page *[style*="--ml:sm"],
371
+ .page *[style*="--ml: sm"] {
372
+ margin-left: 12px;
373
+ }
374
+ .page *[style*="--mr:sm"],
375
+ .page *[style*="--mr: sm"] {
376
+ margin-right: 12px;
377
+ }
378
+ .page *[style*="--mt:md"],
379
+ .page *[style*="--mt: md"] {
380
+ margin-top: 24px;
381
+ }
382
+ .page *[style*="--mb:md"],
383
+ .page *[style*="--mb: md"] {
384
+ margin-bottom: 24px;
385
+ }
386
+ .page *[style*="--ml:md"],
387
+ .page *[style*="--ml: md"] {
388
+ margin-left: 24px;
389
+ }
390
+ .page *[style*="--mr:md"],
391
+ .page *[style*="--mr: md"] {
392
+ margin-right: 24px;
393
+ }
394
+ .page *[style*="--mt:lg"],
395
+ .page *[style*="--mt: lg"] {
396
+ margin-top: 36px;
397
+ }
398
+ .page *[style*="--mb:lg"],
399
+ .page *[style*="--mb: lg"] {
400
+ margin-bottom: 36px;
401
+ }
402
+ .page *[style*="--ml:lg"],
403
+ .page *[style*="--ml: lg"] {
404
+ margin-left: 36px;
405
+ }
406
+ .page *[style*="--mr:lg"],
407
+ .page *[style*="--mr: lg"] {
408
+ margin-right: 36px;
409
+ }
346
410
 
347
411
  .page.signed-document {
348
412
  padding-top: 0.75cm;
@@ -486,6 +550,54 @@ body {
486
550
  border-width: 1.10802px;
487
551
  margin-right: 8.86416px;
488
552
  }
553
+ .page.signed-document *[style*="--mt:sm"],
554
+ .page.signed-document *[style*="--mt: sm"] {
555
+ margin-top: 13.29624px;
556
+ }
557
+ .page.signed-document *[style*="--mb:sm"],
558
+ .page.signed-document *[style*="--mb: sm"] {
559
+ margin-bottom: 13.29624px;
560
+ }
561
+ .page.signed-document *[style*="--ml:sm"],
562
+ .page.signed-document *[style*="--ml: sm"] {
563
+ margin-left: 13.29624px;
564
+ }
565
+ .page.signed-document *[style*="--mr:sm"],
566
+ .page.signed-document *[style*="--mr: sm"] {
567
+ margin-right: 13.29624px;
568
+ }
569
+ .page.signed-document *[style*="--mt:md"],
570
+ .page.signed-document *[style*="--mt: md"] {
571
+ margin-top: 26.59248px;
572
+ }
573
+ .page.signed-document *[style*="--mb:md"],
574
+ .page.signed-document *[style*="--mb: md"] {
575
+ margin-bottom: 26.59248px;
576
+ }
577
+ .page.signed-document *[style*="--ml:md"],
578
+ .page.signed-document *[style*="--ml: md"] {
579
+ margin-left: 26.59248px;
580
+ }
581
+ .page.signed-document *[style*="--mr:md"],
582
+ .page.signed-document *[style*="--mr: md"] {
583
+ margin-right: 26.59248px;
584
+ }
585
+ .page.signed-document *[style*="--mt:lg"],
586
+ .page.signed-document *[style*="--mt: lg"] {
587
+ margin-top: 39.88872px;
588
+ }
589
+ .page.signed-document *[style*="--mb:lg"],
590
+ .page.signed-document *[style*="--mb: lg"] {
591
+ margin-bottom: 39.88872px;
592
+ }
593
+ .page.signed-document *[style*="--ml:lg"],
594
+ .page.signed-document *[style*="--ml: lg"] {
595
+ margin-left: 39.88872px;
596
+ }
597
+ .page.signed-document *[style*="--mr:lg"],
598
+ .page.signed-document *[style*="--mr: lg"] {
599
+ margin-right: 39.88872px;
600
+ }
489
601
 
490
602
  @media print {
491
603
  .page.signed-document {
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../src/stories/PDF.scss","../../src/style/abstracts/mixins/_box-sizing.scss"],"names":[],"mappings":"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","file":"pdf.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../src/stories/PDF.scss","../../src/style/abstracts/mixins/_box-sizing.scss"],"names":[],"mappings":"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","file":"pdf.css"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dibk-design",
3
- "version": "7.2.2",
3
+ "version": "7.3.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "files": [