dibk-design 7.7.1 → 8.0.1

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 (138) hide show
  1. package/README.md +66 -0
  2. package/dist/dibk-design.css +1 -0
  3. package/dist/favicon.ico +0 -0
  4. package/dist/index.cjs.js +21 -0
  5. package/dist/index.cjs.js.map +1 -0
  6. package/dist/index.es.js +2421 -0
  7. package/dist/index.es.js.map +1 -0
  8. package/dist/index.html +38 -0
  9. package/dist/manifest.json +15 -0
  10. package/dist/robots.txt +3 -0
  11. package/package.json +23 -27
  12. package/dist/assets/fonts/PPMori-Bold.otf +0 -0
  13. package/dist/assets/fonts/PPMori-Book.otf +0 -0
  14. package/dist/assets/fonts/PPMori-ExtraBold.otf +0 -0
  15. package/dist/assets/fonts/PPMori-Light.otf +0 -0
  16. package/dist/assets/fonts/PPMori-Medium.otf +0 -0
  17. package/dist/assets/fonts/PPMori-Regular.otf +0 -0
  18. package/dist/assets/fonts/PPMori-RegularItalic.otf +0 -0
  19. package/dist/assets/fonts/PPMori-SemiBold.otf +0 -0
  20. package/dist/assets/png/dibk-logo.png +0 -0
  21. package/dist/assets/svg/arbeidstilsynet-logo.svg +0 -1
  22. package/dist/assets/svg/asterisk.svg +0 -1
  23. package/dist/assets/svg/checkmark-symbol.svg +0 -8
  24. package/dist/assets/svg/dibk-logo-base64.js +0 -7
  25. package/dist/assets/svg/dibk-logo-mobile.svg +0 -91
  26. package/dist/assets/svg/dibk-logo.svg +0 -52
  27. package/dist/assets/svg/error-sign.svg +0 -15
  28. package/dist/assets/svg/info-sign.svg +0 -1
  29. package/dist/assets/svg/spinner.svg +0 -57
  30. package/dist/assets/svg/x-symbol.svg +0 -1
  31. package/dist/components/Accordion.js +0 -64
  32. package/dist/components/Accordion.module.scss +0 -190
  33. package/dist/components/Button.js +0 -118
  34. package/dist/components/Button.module.scss +0 -290
  35. package/dist/components/CheckBoxIcon.js +0 -42
  36. package/dist/components/CheckBoxIcon.module.scss +0 -69
  37. package/dist/components/CheckBoxInput.js +0 -70
  38. package/dist/components/CheckBoxInput.module.scss +0 -53
  39. package/dist/components/CheckBoxList.js +0 -55
  40. package/dist/components/CheckBoxList.module.scss +0 -25
  41. package/dist/components/CheckBoxListItem.js +0 -61
  42. package/dist/components/CheckBoxListItem.module.scss +0 -84
  43. package/dist/components/Container.js +0 -24
  44. package/dist/components/Container.module.scss +0 -15
  45. package/dist/components/ContentBox.js +0 -56
  46. package/dist/components/ContentBox.module.scss +0 -60
  47. package/dist/components/DescriptionDetails.js +0 -32
  48. package/dist/components/DescriptionDetails.module.scss +0 -22
  49. package/dist/components/DescriptionList.js +0 -47
  50. package/dist/components/DescriptionList.module.scss +0 -15
  51. package/dist/components/DescriptionTerm.js +0 -32
  52. package/dist/components/DescriptionTerm.module.scss +0 -30
  53. package/dist/components/Dialog.js +0 -86
  54. package/dist/components/Dialog.module.scss +0 -178
  55. package/dist/components/DragAndDropFileInput.js +0 -142
  56. package/dist/components/DragAndDropFileInput.module.scss +0 -38
  57. package/dist/components/ErrorBox.js +0 -33
  58. package/dist/components/ErrorBox.module.scss +0 -68
  59. package/dist/components/ErrorMessage.js +0 -37
  60. package/dist/components/ErrorMessage.module.scss +0 -30
  61. package/dist/components/Footer.js +0 -16
  62. package/dist/components/Footer.module.scss +0 -21
  63. package/dist/components/Header.js +0 -42
  64. package/dist/components/Header.module.scss +0 -79
  65. package/dist/components/InfoBox.js +0 -23
  66. package/dist/components/InfoBox.module.scss +0 -44
  67. package/dist/components/InputField.js +0 -137
  68. package/dist/components/InputField.module.scss +0 -88
  69. package/dist/components/Label.js +0 -40
  70. package/dist/components/Label.module.scss +0 -19
  71. package/dist/components/Lead.js +0 -31
  72. package/dist/components/Lead.module.scss +0 -13
  73. package/dist/components/List.js +0 -46
  74. package/dist/components/List.module.scss +0 -12
  75. package/dist/components/ListItem.js +0 -27
  76. package/dist/components/ListItem.module.scss +0 -10
  77. package/dist/components/LoadingAnimation.js +0 -26
  78. package/dist/components/LoadingAnimation.module.scss +0 -28
  79. package/dist/components/NavigationBar.js +0 -146
  80. package/dist/components/NavigationBar.module.scss +0 -474
  81. package/dist/components/NavigationBarListItem.js +0 -24
  82. package/dist/components/PDF.js +0 -14
  83. package/dist/components/PDF.scss +0 -765
  84. package/dist/components/Paper.js +0 -24
  85. package/dist/components/Paper.module.scss +0 -17
  86. package/dist/components/ProgressBar.js +0 -32
  87. package/dist/components/ProgressBar.module.scss +0 -30
  88. package/dist/components/RadioButtonIcon.js +0 -34
  89. package/dist/components/RadioButtonIcon.module.scss +0 -49
  90. package/dist/components/RadioButtonInput.js +0 -68
  91. package/dist/components/RadioButtonInput.module.scss +0 -53
  92. package/dist/components/RadioButtonList.js +0 -55
  93. package/dist/components/RadioButtonList.module.scss +0 -25
  94. package/dist/components/RadioButtonListItem.js +0 -59
  95. package/dist/components/RadioButtonListItem.module.scss +0 -84
  96. package/dist/components/Select.js +0 -224
  97. package/dist/components/Select.module.scss +0 -118
  98. package/dist/components/Table.js +0 -31
  99. package/dist/components/Table.module.scss +0 -65
  100. package/dist/components/Textarea.js +0 -105
  101. package/dist/components/Textarea.module.scss +0 -73
  102. package/dist/components/Theme.js +0 -138
  103. package/dist/components/Theme.module.scss +0 -103
  104. package/dist/components/ThemeProvider.js +0 -24
  105. package/dist/components/ThemeProvider.module.scss +0 -24
  106. package/dist/components/ToggleNavigationButton.js +0 -44
  107. package/dist/components/ToggleNavigationButton.module.scss +0 -34
  108. package/dist/components/WizardNavigation/Step.js +0 -66
  109. package/dist/components/WizardNavigation/Step.module.scss +0 -175
  110. package/dist/components/WizardNavigation.js +0 -56
  111. package/dist/components/WizardNavigation.module.scss +0 -25
  112. package/dist/functions/generators.js +0 -16
  113. package/dist/functions/helpers.js +0 -112
  114. package/dist/functions/theme.js +0 -18
  115. package/dist/index.js +0 -279
  116. package/dist/style/abstracts/mixins/_animation.scss +0 -6
  117. package/dist/style/abstracts/mixins/_appearance.scss +0 -5
  118. package/dist/style/abstracts/mixins/_border-radius.scss +0 -31
  119. package/dist/style/abstracts/mixins/_box-shadow.scss +0 -5
  120. package/dist/style/abstracts/mixins/_box-sizing.scss +0 -5
  121. package/dist/style/abstracts/mixins/_calc.scss +0 -5
  122. package/dist/style/abstracts/mixins/_keyframes.scss +0 -14
  123. package/dist/style/abstracts/mixins/_opacity.scss +0 -5
  124. package/dist/style/abstracts/mixins/_placeholder.scss +0 -17
  125. package/dist/style/abstracts/mixins/_scrollbar.scss +0 -26
  126. package/dist/style/abstracts/mixins/_transform.scss +0 -6
  127. package/dist/style/abstracts/mixins/_transition.scss +0 -34
  128. package/dist/style/abstracts/variables/_colors.scss +0 -33
  129. package/dist/style/abstracts/variables/_sizes.scss +0 -1
  130. package/dist/style/abstracts/variables/_transitions.scss +0 -2
  131. package/dist/style/abstracts/variables/_typography.scss +0 -1
  132. package/dist/style/abstracts/variables/_viewports.scss +0 -14
  133. package/dist/style/base/_fonts.scss +0 -57
  134. package/dist/style/base/_reset.scss +0 -15
  135. package/dist/style/base/_typography.scss +0 -10
  136. package/dist/style/layout/_containers.scss +0 -11
  137. package/dist/style/pdf.css +0 -637
  138. package/dist/style/pdf.css.map +0 -1
@@ -1,69 +0,0 @@
1
- // Mixins
2
- @use "../style/abstracts/mixins/border-radius";
3
- @use "../style/abstracts/mixins/box-shadow";
4
- @use "../style/abstracts/mixins/box-sizing";
5
- @use "../style/abstracts/mixins/transition";
6
-
7
- // Variables
8
- @use "../style/abstracts/variables/colors";
9
-
10
- .checkBoxIcon {
11
- @include border-radius.border-radius(0);
12
- @include transition.transition(all 0.1s ease-in-out);
13
- @include box-sizing.box-sizing(content-box);
14
- display: inline-block;
15
- vertical-align: middle;
16
- min-width: 10px;
17
- width: 10px;
18
- height: 10px;
19
- min-width: 20px;
20
- margin-right: 0.2em;
21
- line-height: 1;
22
- text-align: center;
23
- cursor: pointer;
24
-
25
- &.showBox {
26
- margin-right: 0.4em;
27
- margin-top: 2px;
28
- background: white;
29
- &:not(.hasErrors) {
30
- @include box-shadow.box-shadow(0 0 0 1px var(--color-form-element, colors.$color-form-element));
31
- }
32
- &.hasErrors {
33
- @include box-shadow.box-shadow(0 0 0 1px var(--color-error, colors.$color-error));
34
- }
35
- }
36
-
37
- &.checked {
38
- color: var(--color-primary, colors.$color-primary);
39
- &.hasErrors {
40
- span {
41
- color: var(--color-error, colors.$color-error);
42
- }
43
- }
44
- &.showBox {
45
- &:not(.hasErrors) {
46
- @include box-shadow.box-shadow(0 0 0 1px var(--color-form-element, colors.$color-form-element));
47
- }
48
- &.hasErrors {
49
- @include box-shadow.box-shadow(0 0 0 1px var(--color-error, colors.$color-error));
50
- }
51
- }
52
- }
53
-
54
- &.disabled {
55
- opacity: 0.4;
56
- background: rgba(0, 0, 0, 0.25);
57
- cursor: default;
58
- }
59
-
60
- .checkmark {
61
- font-size: 1em;
62
- line-height: 0.75em;
63
- }
64
- :not(.showBox) {
65
- &.checkmark {
66
- line-height: 1.05em;
67
- }
68
- }
69
- }
@@ -1,70 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _CheckBoxIcon = _interopRequireDefault(require("./CheckBoxIcon"));
10
- var _asterisk = _interopRequireDefault(require("../assets/svg/asterisk.svg?url"));
11
- var _CheckBoxInputModule = _interopRequireDefault(require("./CheckBoxInput.module.scss"));
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- const CheckBoxInput = props => {
14
- const labelProps = {
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
- htmlFor: props.id
17
- };
18
- const iconProps = {
19
- checked: props.checked,
20
- disabled: props.disabled,
21
- showBox: !props.contentOnly,
22
- hasErrors: props.contentOnly && props.hasErrors,
23
- checkmarkCharacter: props.checkmarkCharacter
24
- };
25
- const inputProps = {
26
- id: props.id,
27
- name: props.name || null,
28
- type: "checkbox",
29
- checked: props.checked,
30
- disabled: props.disabled,
31
- required: props.required || props.requiredGroup,
32
- onChange: props.onChange,
33
- tabIndex: props.tabIndex || null,
34
- "aria-controls": props["aria-controls"],
35
- "aria-invalid": props.hasErrors ? "true" : null,
36
- "aria-describedby": props["aria-describedby"]
37
- };
38
- return _react.default.createElement("label", labelProps, !props.contentOnly ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_CheckBoxIcon.default, iconProps), _react.default.createElement("input", inputProps)) : _react.default.createElement(_CheckBoxIcon.default, iconProps), _react.default.createElement("span", {
39
- className: _CheckBoxInputModule.default.labelText
40
- }, props.children, props.required && _react.default.createElement("img", {
41
- src: _asterisk.default,
42
- alt: "",
43
- className: _CheckBoxInputModule.default.requiredSymbol
44
- })));
45
- };
46
- CheckBoxInput.propTypes = {
47
- checked: _propTypes.default.bool,
48
- disabled: _propTypes.default.bool,
49
- required: _propTypes.default.bool,
50
- requiredGroup: _propTypes.default.bool,
51
- id: _propTypes.default.string.isRequired,
52
- name: _propTypes.default.string,
53
- onChange: _propTypes.default.func.isRequired,
54
- contentOnly: _propTypes.default.bool,
55
- hasErrors: _propTypes.default.bool,
56
- checkmarkCharacter: _propTypes.default.string,
57
- "aria-controls": _propTypes.default.string,
58
- "aria-describedby": _propTypes.default.string
59
- };
60
- CheckBoxInput.defaultProps = {
61
- checked: false,
62
- disabled: false,
63
- required: false,
64
- requiredGroup: false,
65
- name: "",
66
- contentOnly: false,
67
- hasErrors: false,
68
- checkmarkCharacter: "✔"
69
- };
70
- var _default = exports.default = CheckBoxInput;
@@ -1,53 +0,0 @@
1
- // Variables
2
- @use "../style/abstracts/variables/colors";
3
-
4
- .checkBoxInput {
5
- display: flex;
6
- margin-right: 1em;
7
- border: 1px solid transparent;
8
-
9
- .requiredSymbol {
10
- width: 1em;
11
- height: 1em;
12
- font-size: 0.4em;
13
- vertical-align: top;
14
- margin-top: 2px;
15
- }
16
-
17
- &:not(.contentOnly):not(.disabled) {
18
- cursor: pointer;
19
- input {
20
- cursor: pointer;
21
- }
22
- }
23
-
24
- .labelText {
25
- font-size: 16px;
26
- line-height: 24px;
27
- color: var(--color-form-element, colors.$color-form-element);
28
- }
29
-
30
- &.disabled {
31
- .labelText {
32
- opacity: 0.4;
33
- }
34
- }
35
-
36
- &.hasErrors {
37
- span {
38
- color: var(--color-error, colors.$color-error);
39
- }
40
- }
41
-
42
- &:focus-within {
43
- outline-width: 2px;
44
- outline-color: var(--color-focus, colors.$color-focus);
45
- outline-style: auto;
46
- outline-offset: 1px;
47
- }
48
-
49
- input[type="checkbox"] {
50
- opacity: 0;
51
- position: absolute;
52
- }
53
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _helpers = require("../functions/helpers");
10
- var _asterisk = _interopRequireDefault(require("../assets/svg/asterisk.svg?url"));
11
- var _CheckBoxListModule = _interopRequireDefault(require("./CheckBoxList.module.scss"));
12
- var _Header = _interopRequireDefault(require("./Header"));
13
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- const CheckBoxList = _ref => {
15
- let {
16
- required,
17
- compact,
18
- legend,
19
- legendSize,
20
- children
21
- } = _ref;
22
- const renderChildElements = childElements => {
23
- const childElementsthroughFragments = (0, _helpers.cloneThroughFragments)(childElements);
24
- return childElementsthroughFragments.map((childElement, index) => {
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";
27
- if (isCheckBoxListItem) {
28
- const childElementCopy = _react.default.cloneElement(childElement, {
29
- requiredGroup: required,
30
- compact: compact,
31
- key: "checkboxListItem-".concat(index)
32
- });
33
- return childElementCopy;
34
- } else {
35
- return childElement;
36
- }
37
- });
38
- };
39
- return _react.default.createElement("fieldset", {
40
- className: _CheckBoxListModule.default.checkBoxList
41
- }, !!(legend !== null && legend !== void 0 && legend.length) ? _react.default.createElement("legend", null, legendSize ? _react.default.createElement(_Header.default, {
42
- size: legendSize
43
- }, legend) : legend, required && _react.default.createElement("img", {
44
- src: _asterisk.default,
45
- alt: "",
46
- className: _CheckBoxListModule.default.requiredSymbol
47
- })) : null, renderChildElements(_react.default.Children.toArray(children)));
48
- };
49
- CheckBoxList.propTypes = {
50
- legend: _propTypes.default.string,
51
- legendSize: _propTypes.default.oneOf([1, 2, 3, 4, 5]),
52
- required: _propTypes.default.bool,
53
- compact: _propTypes.default.bool
54
- };
55
- var _default = exports.default = CheckBoxList;
@@ -1,25 +0,0 @@
1
- // Variables
2
- @use "../style/abstracts/variables/typography";
3
-
4
- fieldset.checkBoxList {
5
- margin: 0;
6
- padding: 0;
7
- border: none;
8
- legend {
9
- color: #000;
10
- display: block;
11
- font-size: 1rem;
12
- font-weight: bold;
13
- line-height: 1.2;
14
- margin-bottom: 2px;
15
- font-family: typography.$default-font;
16
- overflow-wrap: break-word;
17
- .requiredSymbol {
18
- width: 1em;
19
- height: 1em;
20
- font-size: 0.4em;
21
- vertical-align: top;
22
- margin-top: 2px;
23
- }
24
- }
25
- }
@@ -1,61 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _CheckBoxInput = _interopRequireDefault(require("./CheckBoxInput"));
10
- var _helpers = require("../functions/helpers");
11
- var _CheckBoxListItemModule = _interopRequireDefault(require("./CheckBoxListItem.module.scss"));
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- const CheckBoxListItem = props => {
14
- const listItemClassNameArray = [_CheckBoxListItemModule.default.checkBoxListItem, props.checked ? _CheckBoxListItemModule.default.checked : null, props.disabled ? _CheckBoxListItemModule.default.disabled : null, props.compact ? _CheckBoxListItemModule.default.compact : null, props.contentOnly ? _CheckBoxListItemModule.default.contentOnly : null, props.hasErrors ? _CheckBoxListItemModule.default.hasErrors : null];
15
- const listItemClassNameString = (0, _helpers.classNameArrayToClassNameString)(listItemClassNameArray);
16
- const inputProps = {
17
- onChange: props.onChange,
18
- checked: props.checked,
19
- disabled: props.disabled,
20
- required: props.required,
21
- requiredGroup: props.requiredGroup,
22
- contentOnly: props.contentOnly,
23
- hasErrors: props.hasErrors,
24
- "aria-controls": props["aria-controls"],
25
- "aria-describedby": props["aria-describedby"],
26
- id: props.id,
27
- name: props.name,
28
- checkmarkCharacter: props.checkmarkCharacter
29
- };
30
- return _react.default.createElement("div", {
31
- className: listItemClassNameString
32
- }, _react.default.createElement(_CheckBoxInput.default, inputProps, props.children));
33
- };
34
- CheckBoxListItem.propTypes = {
35
- checked: _propTypes.default.bool,
36
- disabled: _propTypes.default.bool,
37
- required: _propTypes.default.bool,
38
- requiredGroup: _propTypes.default.bool,
39
- id: _propTypes.default.string.isRequired,
40
- name: _propTypes.default.string,
41
- onChange: _propTypes.default.func.isRequired,
42
- contentOnly: _propTypes.default.bool,
43
- compact: _propTypes.default.bool,
44
- hasErrors: _propTypes.default.bool,
45
- checkmarkCharacter: _propTypes.default.string,
46
- "aria-controls": _propTypes.default.string,
47
- "aria-describedby": _propTypes.default.string
48
- };
49
- CheckBoxListItem.defaultProps = {
50
- checked: false,
51
- disabled: false,
52
- required: false,
53
- requiredGroup: false,
54
- id: "",
55
- name: "",
56
- contentOnly: false,
57
- hasErrors: false,
58
- checkmarkCharacter: "✔",
59
- type: "CheckBoxListItem"
60
- };
61
- var _default = exports.default = CheckBoxListItem;
@@ -1,84 +0,0 @@
1
- // Mixins
2
- @use "../style/abstracts/mixins/border-radius";
3
- @use "../style/abstracts/mixins/box-sizing";
4
- @use "../style/abstracts/mixins/transition";
5
-
6
- // Variables
7
- @use "../style/abstracts/variables/colors";
8
- @use "../style/abstracts/variables/transitions";
9
- @use "../style/abstracts/variables/typography";
10
-
11
- .checkBoxListItem {
12
- @include box-sizing.box-sizing(content-box);
13
- @include border-radius.border-radius(0);
14
- @include transition.transition(all transitions.$default-transition);
15
- display: -webkit-box;
16
- display: -webkit-flex;
17
- display: -ms-flexbox;
18
- display: flex;
19
- -webkit-align-items: flex-start;
20
- -webkit-box-align: flex-start;
21
- -ms-flex-align: flex-start;
22
- align-items: flex-start;
23
- cursor: pointer;
24
- font-family: typography.$default-font;
25
- position: relative;
26
- font-size: 16px;
27
- line-height: 24px;
28
- color: #000;
29
-
30
- &:not(.contentOnly):not(.compact) {
31
- border: 1px solid var(--color-secondary-light, colors.$color-secondary-light);
32
- background: white;
33
- margin-bottom: 8px;
34
- label {
35
- padding: 20px;
36
- }
37
- }
38
-
39
- &.contentOnly {
40
- cursor: auto;
41
- label {
42
- cursor: auto;
43
- padding: 5px 10px;
44
- }
45
- }
46
-
47
- &.disabled {
48
- label {
49
- cursor: auto;
50
- }
51
- }
52
-
53
- &.checked:not(.contentOnly):not(.compact):not(.disabled) {
54
- background-color: var(--color-secondary-light, colors.$color-secondary-light);
55
- }
56
-
57
- &:not(.checked):not(.contentOnly):not(.compact):not(.disabled) {
58
- &:hover {
59
- background-color: var(--color-secondary-x-light, colors.$color-secondary-x-light);
60
- }
61
- &:focus-within {
62
- background-color: var(--color-secondary-x-light, colors.$color-secondary-x-light);
63
- }
64
- }
65
-
66
- label {
67
- width: 100%;
68
- padding: 10px;
69
- margin: 0;
70
- cursor: pointer;
71
- }
72
-
73
- &.compact {
74
- display: table;
75
- label {
76
- padding: 6px 4px;
77
- }
78
- }
79
-
80
- input[type="checkbox"] {
81
- opacity: 0;
82
- position: absolute;
83
- }
84
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _ContainerModule = _interopRequireDefault(require("./Container.module.scss"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const Container = props => {
12
- var _props$maxWidth;
13
- const styleProps = {
14
- "--max-width": (props === null || props === void 0 || (_props$maxWidth = props.maxWidth) === null || _props$maxWidth === void 0 ? void 0 : _props$maxWidth.length) && props.maxWidth
15
- };
16
- return _react.default.createElement("div", {
17
- className: _ContainerModule.default.container,
18
- style: styleProps
19
- }, props.children);
20
- };
21
- Container.propTypes = {
22
- maxWidth: _propTypes.default.string
23
- };
24
- var _default = exports.default = Container;
@@ -1,15 +0,0 @@
1
- // Variables
2
- @use "../style/abstracts/variables/sizes";
3
- @use "../style/abstracts/variables/viewports";
4
-
5
- .container {
6
- margin: auto;
7
- padding: 8px;
8
- @media (min-width: viewports.$screen-sm) {
9
- padding: 20px;
10
- max-width: sizes.$content-width;
11
- &[style*="--max-width"] {
12
- max-width: var(--max-width);
13
- }
14
- }
15
- }
@@ -1,56 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _ContentBoxModule = _interopRequireDefault(require("./ContentBox.module.scss"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const ContentBox = props => {
12
- var _props$content;
13
- const renderTitle = () => {
14
- let className = _ContentBoxModule.default.title + " " + _ContentBoxModule.default[props.titleSize];
15
- if (props.title) {
16
- return _react.default.createElement("h2", {
17
- className: className
18
- }, props.title);
19
- } else {
20
- return;
21
- }
22
- };
23
- let colorClass = " " + _ContentBoxModule.default[props.color];
24
- let linkClass = props.href ? " " + _ContentBoxModule.default.link : "";
25
- let className = _ContentBoxModule.default.contentBox + colorClass + linkClass;
26
- const bodyContent = (_props$content = props.content) !== null && _props$content !== void 0 && _props$content.length ? props.content : props.children;
27
- if (props.href) {
28
- return _react.default.createElement("a", {
29
- href: props.href,
30
- className: className
31
- }, renderTitle(), _react.default.createElement("div", {
32
- className: _ContentBoxModule.default.content
33
- }, bodyContent));
34
- } else {
35
- return _react.default.createElement("div", {
36
- className: className
37
- }, renderTitle(), _react.default.createElement("div", {
38
- className: _ContentBoxModule.default.content
39
- }, bodyContent));
40
- }
41
- };
42
- ContentBox.propTypes = {
43
- title: _propTypes.default.string,
44
- titleSize: _propTypes.default.oneOf(["regular", "large"]),
45
- content: _propTypes.default.string,
46
- children: _propTypes.default.any,
47
- color: _propTypes.default.oneOf(["default", "secondary"])
48
- };
49
- ContentBox.defaultProps = {
50
- title: null,
51
- titleSize: "regular",
52
- href: null,
53
- content: "",
54
- color: "default"
55
- };
56
- var _default = exports.default = ContentBox;
@@ -1,60 +0,0 @@
1
- // Mixins
2
- @use "../style/abstracts/mixins/transition";
3
-
4
- // Variables
5
- @use "../style/abstracts/variables/colors";
6
- @use "../style/abstracts/variables/typography";
7
-
8
- .contentBox {
9
- font-family: typography.$default-font;
10
- text-decoration: none;
11
- padding: 20px;
12
- width: 100%;
13
- display: block;
14
- &.link {
15
- color: var(--color-primary, colors.$color-primary);
16
- @include transition.transition(filter 0.3s);
17
- &:hover,
18
- &:focus {
19
- filter: brightness(90%);
20
- }
21
- &:active {
22
- filter: brightness(85%);
23
- }
24
- }
25
- &.default {
26
- background-color: var(--color-default-background, colors.$color-default-background);
27
- .content,
28
- .title {
29
- color: colors.$color-default-text;
30
- }
31
- }
32
- &.secondary {
33
- background-color: var(--color-secondary-background, colors.$color-secondary-background);
34
- color: var(--color-default-text, colors.$color-default-text);
35
- .content,
36
- .title {
37
- color: var(--color-default-text, colors.$color-default-text);
38
- }
39
- }
40
-
41
- .title {
42
- &.regular {
43
- font-family: typography.$default-font;
44
- font-weight: bold;
45
- font-size: 21px;
46
- font-style: normal;
47
- line-height: 1.4;
48
- padding-bottom: 10px;
49
- border-bottom: 1px solid rgba(0, 0, 0, 0.075);
50
- }
51
- &.large {
52
- font-family: typography.$default-font;
53
- font-weight: normal;
54
- font-size: 24px;
55
- margin: 0;
56
- margin-bottom: 20px;
57
- font-style: normal;
58
- }
59
- }
60
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _helpers = require("../functions/helpers");
10
- var _DescriptionDetailsModule = _interopRequireDefault(require("./DescriptionDetails.module.scss"));
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- const DescriptionDetails = _ref => {
13
- let {
14
- compact,
15
- titleWidth,
16
- children
17
- } = _ref;
18
- return _react.default.createElement("dd", {
19
- className: (0, _helpers.classNameArrayToClassNameString)([_DescriptionDetailsModule.default.descriptionDetails, compact && _DescriptionDetailsModule.default.compact]),
20
- style: {
21
- "--title-width": titleWidth || null
22
- }
23
- }, children);
24
- };
25
- DescriptionDetails.propTypes = {
26
- compact: _propTypes.default.bool,
27
- titleWidth: _propTypes.default.string
28
- };
29
- DescriptionDetails.defaultProps = {
30
- compact: false
31
- };
32
- var _default = exports.default = DescriptionDetails;
@@ -1,22 +0,0 @@
1
- // Variables
2
- @use "../style/abstracts/variables/colors";
3
-
4
- .descriptionDetails {
5
- font-size: 16px;
6
- list-style: var(--listStyle);
7
- color: var(--color-primary, colors.$color-primary);
8
- margin: 0;
9
- &:not(.compact) {
10
- line-height: 1.6;
11
- }
12
- &.compact {
13
- line-height: 1.4;
14
- }
15
- &:not([style*="--title-width"]) {
16
- display: inline;
17
- }
18
- &[style*="--title-width"] {
19
- flex-basis: calc(100% - var(--title-width));
20
- flex-grow: 1;
21
- }
22
- }
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _DescriptionListModule = _interopRequireDefault(require("./DescriptionList.module.scss"));
10
- var _helpers = require("../functions/helpers");
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- const DescriptionList = _ref => {
13
- let {
14
- compact,
15
- titleWidth,
16
- children
17
- } = _ref;
18
- const renderChildElements = childElements => {
19
- const childElementsthroughFragments = (0, _helpers.cloneThroughFragments)(childElements);
20
- return childElementsthroughFragments.map((childElement, index) => {
21
- const childElementCopy = _react.default.cloneElement(childElement, {
22
- compact: compact,
23
- titleWidth: titleWidth,
24
- key: "descriptionListItem-".concat(index)
25
- });
26
- return childElementCopy;
27
- });
28
- };
29
- const renderList = children => {
30
- let listElement = _react.default.createElement("dl", {
31
- className: (0, _helpers.classNameArrayToClassNameString)([_DescriptionListModule.default.descriptionList, !!compact && _DescriptionListModule.default.compact]),
32
- style: {
33
- "--title-width": titleWidth || null
34
- }
35
- }, renderChildElements(_react.default.Children.toArray(children)));
36
- return listElement;
37
- };
38
- return renderList(children);
39
- };
40
- DescriptionList.propTypes = {
41
- compact: _propTypes.default.bool,
42
- titleWidth: _propTypes.default.string
43
- };
44
- DescriptionList.defaultProps = {
45
- compact: false
46
- };
47
- var _default = exports.default = DescriptionList;