dibk-design 7.7.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/dibk-design.css +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.es.js +2386 -0
- package/dist/index.html +38 -0
- package/dist/index.umd.js +20 -0
- package/dist/manifest.json +15 -0
- package/dist/robots.txt +3 -0
- package/package.json +19 -27
- package/dist/assets/fonts/PPMori-Bold.otf +0 -0
- package/dist/assets/fonts/PPMori-Book.otf +0 -0
- package/dist/assets/fonts/PPMori-ExtraBold.otf +0 -0
- package/dist/assets/fonts/PPMori-Light.otf +0 -0
- package/dist/assets/fonts/PPMori-Medium.otf +0 -0
- package/dist/assets/fonts/PPMori-Regular.otf +0 -0
- package/dist/assets/fonts/PPMori-RegularItalic.otf +0 -0
- package/dist/assets/fonts/PPMori-SemiBold.otf +0 -0
- package/dist/assets/png/dibk-logo.png +0 -0
- package/dist/assets/svg/arbeidstilsynet-logo.svg +0 -1
- package/dist/assets/svg/asterisk.svg +0 -1
- package/dist/assets/svg/checkmark-symbol.svg +0 -8
- package/dist/assets/svg/dibk-logo-base64.js +0 -7
- package/dist/assets/svg/dibk-logo-mobile.svg +0 -91
- package/dist/assets/svg/dibk-logo.svg +0 -52
- package/dist/assets/svg/error-sign.svg +0 -15
- package/dist/assets/svg/info-sign.svg +0 -1
- package/dist/assets/svg/spinner.svg +0 -57
- package/dist/assets/svg/x-symbol.svg +0 -1
- package/dist/components/Accordion.js +0 -64
- package/dist/components/Accordion.module.scss +0 -190
- package/dist/components/Button.js +0 -118
- package/dist/components/Button.module.scss +0 -290
- package/dist/components/CheckBoxIcon.js +0 -42
- package/dist/components/CheckBoxIcon.module.scss +0 -69
- package/dist/components/CheckBoxInput.js +0 -70
- package/dist/components/CheckBoxInput.module.scss +0 -53
- package/dist/components/CheckBoxList.js +0 -55
- package/dist/components/CheckBoxList.module.scss +0 -25
- package/dist/components/CheckBoxListItem.js +0 -61
- package/dist/components/CheckBoxListItem.module.scss +0 -84
- package/dist/components/Container.js +0 -24
- package/dist/components/Container.module.scss +0 -15
- package/dist/components/ContentBox.js +0 -56
- package/dist/components/ContentBox.module.scss +0 -60
- package/dist/components/DescriptionDetails.js +0 -32
- package/dist/components/DescriptionDetails.module.scss +0 -22
- package/dist/components/DescriptionList.js +0 -47
- package/dist/components/DescriptionList.module.scss +0 -15
- package/dist/components/DescriptionTerm.js +0 -32
- package/dist/components/DescriptionTerm.module.scss +0 -30
- package/dist/components/Dialog.js +0 -86
- package/dist/components/Dialog.module.scss +0 -178
- package/dist/components/DragAndDropFileInput.js +0 -131
- package/dist/components/DragAndDropFileInput.module.scss +0 -38
- package/dist/components/ErrorBox.js +0 -33
- package/dist/components/ErrorBox.module.scss +0 -68
- package/dist/components/ErrorMessage.js +0 -37
- package/dist/components/ErrorMessage.module.scss +0 -30
- package/dist/components/Footer.js +0 -16
- package/dist/components/Footer.module.scss +0 -21
- package/dist/components/Header.js +0 -42
- package/dist/components/Header.module.scss +0 -79
- package/dist/components/InfoBox.js +0 -23
- package/dist/components/InfoBox.module.scss +0 -44
- package/dist/components/InputField.js +0 -137
- package/dist/components/InputField.module.scss +0 -88
- package/dist/components/Label.js +0 -40
- package/dist/components/Label.module.scss +0 -19
- package/dist/components/Lead.js +0 -31
- package/dist/components/Lead.module.scss +0 -13
- package/dist/components/List.js +0 -46
- package/dist/components/List.module.scss +0 -12
- package/dist/components/ListItem.js +0 -27
- package/dist/components/ListItem.module.scss +0 -10
- package/dist/components/LoadingAnimation.js +0 -26
- package/dist/components/LoadingAnimation.module.scss +0 -28
- package/dist/components/NavigationBar.js +0 -146
- package/dist/components/NavigationBar.module.scss +0 -474
- package/dist/components/NavigationBarListItem.js +0 -24
- package/dist/components/PDF.js +0 -14
- package/dist/components/PDF.scss +0 -765
- package/dist/components/Paper.js +0 -24
- package/dist/components/Paper.module.scss +0 -17
- package/dist/components/ProgressBar.js +0 -32
- package/dist/components/ProgressBar.module.scss +0 -30
- package/dist/components/RadioButtonIcon.js +0 -34
- package/dist/components/RadioButtonIcon.module.scss +0 -49
- package/dist/components/RadioButtonInput.js +0 -68
- package/dist/components/RadioButtonInput.module.scss +0 -53
- package/dist/components/RadioButtonList.js +0 -55
- package/dist/components/RadioButtonList.module.scss +0 -25
- package/dist/components/RadioButtonListItem.js +0 -59
- package/dist/components/RadioButtonListItem.module.scss +0 -84
- package/dist/components/Select.js +0 -224
- package/dist/components/Select.module.scss +0 -118
- package/dist/components/Table.js +0 -31
- package/dist/components/Table.module.scss +0 -65
- package/dist/components/Textarea.js +0 -105
- package/dist/components/Textarea.module.scss +0 -73
- package/dist/components/Theme.js +0 -138
- package/dist/components/Theme.module.scss +0 -103
- package/dist/components/ThemeProvider.js +0 -24
- package/dist/components/ThemeProvider.module.scss +0 -24
- package/dist/components/ToggleNavigationButton.js +0 -44
- package/dist/components/ToggleNavigationButton.module.scss +0 -34
- package/dist/components/WizardNavigation/Step.js +0 -66
- package/dist/components/WizardNavigation/Step.module.scss +0 -175
- package/dist/components/WizardNavigation.js +0 -56
- package/dist/components/WizardNavigation.module.scss +0 -25
- package/dist/functions/generators.js +0 -16
- package/dist/functions/helpers.js +0 -112
- package/dist/functions/theme.js +0 -18
- package/dist/index.js +0 -279
- package/dist/style/abstracts/mixins/_animation.scss +0 -6
- package/dist/style/abstracts/mixins/_appearance.scss +0 -5
- package/dist/style/abstracts/mixins/_border-radius.scss +0 -31
- package/dist/style/abstracts/mixins/_box-shadow.scss +0 -5
- package/dist/style/abstracts/mixins/_box-sizing.scss +0 -5
- package/dist/style/abstracts/mixins/_calc.scss +0 -5
- package/dist/style/abstracts/mixins/_keyframes.scss +0 -14
- package/dist/style/abstracts/mixins/_opacity.scss +0 -5
- package/dist/style/abstracts/mixins/_placeholder.scss +0 -17
- package/dist/style/abstracts/mixins/_scrollbar.scss +0 -26
- package/dist/style/abstracts/mixins/_transform.scss +0 -6
- package/dist/style/abstracts/mixins/_transition.scss +0 -34
- package/dist/style/abstracts/variables/_colors.scss +0 -33
- package/dist/style/abstracts/variables/_sizes.scss +0 -1
- package/dist/style/abstracts/variables/_transitions.scss +0 -2
- package/dist/style/abstracts/variables/_typography.scss +0 -1
- package/dist/style/abstracts/variables/_viewports.scss +0 -14
- package/dist/style/base/_fonts.scss +0 -57
- package/dist/style/base/_reset.scss +0 -15
- package/dist/style/base/_typography.scss +0 -10
- package/dist/style/layout/_containers.scss +0 -11
- package/dist/style/pdf.css +0 -637
- package/dist/style/pdf.css.map +0 -1
package/dist/components/Paper.js
DELETED
|
@@ -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 _PaperModule = _interopRequireDefault(require("./Paper.module.scss"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const Paper = props => {
|
|
12
|
-
return _react.default.createElement("div", {
|
|
13
|
-
className: "".concat(_PaperModule.default.paper, " ").concat(props.noMargin ? _PaperModule.default.noMargin : "", " ").concat(props.noPadding ? _PaperModule.default.noPadding : "")
|
|
14
|
-
}, props.children);
|
|
15
|
-
};
|
|
16
|
-
Paper.propTypes = {
|
|
17
|
-
noMargin: _propTypes.default.bool,
|
|
18
|
-
noPadding: _propTypes.default.bool
|
|
19
|
-
};
|
|
20
|
-
Paper.defaultProps = {
|
|
21
|
-
noMargin: false,
|
|
22
|
-
noPadding: false
|
|
23
|
-
};
|
|
24
|
-
var _default = exports.default = Paper;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Variables
|
|
2
|
-
@use "../style/abstracts/variables/viewports";
|
|
3
|
-
|
|
4
|
-
.paper {
|
|
5
|
-
position: relative;
|
|
6
|
-
width: 100%;
|
|
7
|
-
background: white;
|
|
8
|
-
&:not(.noMargin) {
|
|
9
|
-
margin: 0 0 20px;
|
|
10
|
-
}
|
|
11
|
-
&:not(.noPadding) {
|
|
12
|
-
padding: 48px 20px;
|
|
13
|
-
@media only screen and (min-width: viewports.$screen-sm) {
|
|
14
|
-
padding: 48px;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -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 _ProgressBarModule = _interopRequireDefault(require("./ProgressBar.module.scss"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const ProgressBar = props => {
|
|
12
|
-
const scssValueProperty = "--value";
|
|
13
|
-
return _react.default.createElement("div", {
|
|
14
|
-
className: "".concat(_ProgressBarModule.default.progressBar, " ").concat(props.hasErrors ? _ProgressBarModule.default.hasErrors : ""),
|
|
15
|
-
role: "progressbar",
|
|
16
|
-
"aria-valuenow": props.progress || 0,
|
|
17
|
-
"aria-valuemin": "0",
|
|
18
|
-
"aria-valuemax": "100",
|
|
19
|
-
style: {
|
|
20
|
-
[scssValueProperty]: props.progress || 0
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
ProgressBar.propTypes = {
|
|
25
|
-
progress: _propTypes.default.number,
|
|
26
|
-
hasErrors: _propTypes.default.bool
|
|
27
|
-
};
|
|
28
|
-
ProgressBar.defaultProps = {
|
|
29
|
-
progress: 0,
|
|
30
|
-
hasErrors: false
|
|
31
|
-
};
|
|
32
|
-
var _default = exports.default = ProgressBar;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Mixins
|
|
2
|
-
@use "../style/abstracts/mixins/calc";
|
|
3
|
-
|
|
4
|
-
// Variables
|
|
5
|
-
@use "../style/abstracts/variables/colors";
|
|
6
|
-
|
|
7
|
-
.progressBar {
|
|
8
|
-
--size: 4rem;
|
|
9
|
-
--fg: #{var(--color-primary, colors.$color-primary)};
|
|
10
|
-
--bg: #e2e1e0;
|
|
11
|
-
--pgPercentage: var(--value);
|
|
12
|
-
width: var(--size);
|
|
13
|
-
height: var(--size);
|
|
14
|
-
border-radius: 50%;
|
|
15
|
-
display: grid;
|
|
16
|
-
place-items: center;
|
|
17
|
-
background: radial-gradient(closest-side, white 80%, transparent 0 99.9%, white 0),
|
|
18
|
-
conic-gradient(var(--fg) calc(var(--pgPercentage) * 1%), var(--bg) 0);
|
|
19
|
-
font-family: Helvetica, Arial, sans-serif;
|
|
20
|
-
@include calc.calc("font-size", var(--size) / 4);
|
|
21
|
-
color: var(--fg);
|
|
22
|
-
flex-shrink: 0;
|
|
23
|
-
&::before {
|
|
24
|
-
counter-reset: percentage var(--value);
|
|
25
|
-
content: counter(percentage) "%";
|
|
26
|
-
}
|
|
27
|
-
&.hasErrors {
|
|
28
|
-
--fg: #{var(--color-error, colors.$color-error)};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,34 +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 _RadioButtonIconModule = _interopRequireDefault(require("./RadioButtonIcon.module.scss"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const RadioButtonIcon = props => {
|
|
12
|
-
let inlineStyle = {
|
|
13
|
-
height: props.size,
|
|
14
|
-
width: props.size
|
|
15
|
-
};
|
|
16
|
-
const radioButtonIconProps = {
|
|
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
|
-
style: inlineStyle
|
|
19
|
-
};
|
|
20
|
-
return _react.default.createElement("span", radioButtonIconProps);
|
|
21
|
-
};
|
|
22
|
-
RadioButtonIcon.propTypes = {
|
|
23
|
-
size: _propTypes.default.string,
|
|
24
|
-
checked: _propTypes.default.bool,
|
|
25
|
-
disabled: _propTypes.default.bool,
|
|
26
|
-
hasErrors: _propTypes.default.bool
|
|
27
|
-
};
|
|
28
|
-
RadioButtonIcon.defaultProps = {
|
|
29
|
-
size: "10px",
|
|
30
|
-
checked: false,
|
|
31
|
-
disabled: false,
|
|
32
|
-
hasErrors: false
|
|
33
|
-
};
|
|
34
|
-
var _default = exports.default = RadioButtonIcon;
|
|
@@ -1,49 +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
|
-
@use "../style/abstracts/variables/transitions";
|
|
10
|
-
|
|
11
|
-
.radioButtonIcon {
|
|
12
|
-
@include border-radius.border-radius(50%);
|
|
13
|
-
@include transition.transition(all transitions.$default-transition);
|
|
14
|
-
@include box-sizing.box-sizing(content-box);
|
|
15
|
-
display: inline-block;
|
|
16
|
-
vertical-align: middle;
|
|
17
|
-
min-width: 10px;
|
|
18
|
-
width: 10px;
|
|
19
|
-
height: 10px;
|
|
20
|
-
background: white;
|
|
21
|
-
margin-right: 0.4em;
|
|
22
|
-
margin-top: 2px;
|
|
23
|
-
border: 0.3em solid white;
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
|
|
26
|
-
&:not(.hasErrors) {
|
|
27
|
-
@include box-shadow.box-shadow(0 0 0 1px var(--color-form-element, colors.$color-form-element));
|
|
28
|
-
}
|
|
29
|
-
&.hasErrors {
|
|
30
|
-
@include box-shadow.box-shadow(0 0 0 1px var(--color-error, colors.$color-error));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&.checked {
|
|
34
|
-
background: var(--color-primary, colors.$color-primary);
|
|
35
|
-
&.hasErrors {
|
|
36
|
-
background: var(--color-error, colors.$color-error);
|
|
37
|
-
}
|
|
38
|
-
&:not(.hasErrors) {
|
|
39
|
-
@include box-shadow.box-shadow(0 0 0 1px var(--color-form-element, colors.$color-form-element));
|
|
40
|
-
}
|
|
41
|
-
&.hasErrors {
|
|
42
|
-
@include box-shadow.box-shadow(0 0 0 1px var(--color-error, colors.$color-error));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
&.disabled {
|
|
46
|
-
border-color: #fff;
|
|
47
|
-
opacity: 0.4;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,68 +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 _RadioButtonIcon = _interopRequireDefault(require("./RadioButtonIcon"));
|
|
10
|
-
var _asterisk = _interopRequireDefault(require("../assets/svg/asterisk.svg?url"));
|
|
11
|
-
var _RadioButtonInputModule = _interopRequireDefault(require("./RadioButtonInput.module.scss"));
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
const RadioButtonInput = props => {
|
|
14
|
-
const labelProps = {
|
|
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
|
-
htmlFor: props.id
|
|
17
|
-
};
|
|
18
|
-
const iconProps = {
|
|
19
|
-
checked: props.checked,
|
|
20
|
-
disabled: props.disabled,
|
|
21
|
-
hasErrors: !props.contentOnly && props.hasErrors
|
|
22
|
-
};
|
|
23
|
-
const inputProps = {
|
|
24
|
-
id: props.id,
|
|
25
|
-
name: props.name || null,
|
|
26
|
-
type: "radio",
|
|
27
|
-
value: props.inputValue,
|
|
28
|
-
checked: props.checked,
|
|
29
|
-
disabled: props.disabled,
|
|
30
|
-
required: props.required || props.requiredGroup,
|
|
31
|
-
onChange: props.onChange,
|
|
32
|
-
tabIndex: props.tabIndex || null,
|
|
33
|
-
"aria-controls": props["aria-controls"],
|
|
34
|
-
"aria-invalid": props.hasErrors ? "true" : null,
|
|
35
|
-
"aria-describedby": props["aria-describedby"]
|
|
36
|
-
};
|
|
37
|
-
return _react.default.createElement("label", labelProps, !props.contentOnly ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_RadioButtonIcon.default, iconProps), _react.default.createElement("input", inputProps)) : null, _react.default.createElement("span", {
|
|
38
|
-
className: _RadioButtonInputModule.default.labelText
|
|
39
|
-
}, props.children, props.required && _react.default.createElement("img", {
|
|
40
|
-
src: _asterisk.default,
|
|
41
|
-
alt: "",
|
|
42
|
-
className: _RadioButtonInputModule.default.requiredSymbol
|
|
43
|
-
})));
|
|
44
|
-
};
|
|
45
|
-
RadioButtonInput.propTypes = {
|
|
46
|
-
checked: _propTypes.default.bool,
|
|
47
|
-
disabled: _propTypes.default.bool,
|
|
48
|
-
required: _propTypes.default.bool,
|
|
49
|
-
requiredGroup: _propTypes.default.bool,
|
|
50
|
-
id: _propTypes.default.string.isRequired,
|
|
51
|
-
name: _propTypes.default.string,
|
|
52
|
-
onChange: _propTypes.default.func,
|
|
53
|
-
contentOnly: _propTypes.default.bool,
|
|
54
|
-
hasErrors: _propTypes.default.bool,
|
|
55
|
-
inputValue: _propTypes.default.string.isRequired,
|
|
56
|
-
"aria-controls": _propTypes.default.string,
|
|
57
|
-
"aria-describedby": _propTypes.default.string
|
|
58
|
-
};
|
|
59
|
-
RadioButtonInput.defaultProps = {
|
|
60
|
-
name: "",
|
|
61
|
-
checked: false,
|
|
62
|
-
disabled: false,
|
|
63
|
-
required: false,
|
|
64
|
-
requiredGroup: false,
|
|
65
|
-
contentOnly: false,
|
|
66
|
-
hasErrors: false
|
|
67
|
-
};
|
|
68
|
-
var _default = exports.default = RadioButtonInput;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// Variables
|
|
2
|
-
@use "../style/abstracts/variables/colors";
|
|
3
|
-
|
|
4
|
-
.radioButtonInput {
|
|
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="radio"] {
|
|
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 _RadioButtonListModule = _interopRequireDefault(require("./RadioButtonList.module.scss"));
|
|
12
|
-
var _Header = _interopRequireDefault(require("./Header"));
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
const RadioButtonList = _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 isRadioButtonListItem = (childElement === null || childElement === void 0 || (_childElement$props = childElement.props) === null || _childElement$props === void 0 ? void 0 : _childElement$props.type) === "RadioButtonListItem";
|
|
27
|
-
if (isRadioButtonListItem) {
|
|
28
|
-
const childElementCopy = _react.default.cloneElement(childElement, {
|
|
29
|
-
requiredGroup: required,
|
|
30
|
-
compact: compact,
|
|
31
|
-
key: "radioButtonListItem-".concat(index)
|
|
32
|
-
});
|
|
33
|
-
return childElementCopy;
|
|
34
|
-
} else {
|
|
35
|
-
return childElement;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
return _react.default.createElement("fieldset", {
|
|
40
|
-
className: _RadioButtonListModule.default.radioButtonList
|
|
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: _RadioButtonListModule.default.requiredSymbol
|
|
47
|
-
})) : null, renderChildElements(_react.default.Children.toArray(children)));
|
|
48
|
-
};
|
|
49
|
-
RadioButtonList.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 = RadioButtonList;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Variables
|
|
2
|
-
@use "../style/abstracts/variables/typography";
|
|
3
|
-
|
|
4
|
-
fieldset.radioButtonList {
|
|
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,59 +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 _RadioButtonInput = _interopRequireDefault(require("./RadioButtonInput"));
|
|
10
|
-
var _helpers = require("../functions/helpers");
|
|
11
|
-
var _RadioButtonListItemModule = _interopRequireDefault(require("./RadioButtonListItem.module.scss"));
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
const RadioButtonListItem = props => {
|
|
14
|
-
const listItemClassNameArray = [_RadioButtonListItemModule.default.radioButtonListItem, props.checked ? _RadioButtonListItemModule.default.checked : null, props.disabled ? _RadioButtonListItemModule.default.disabled : null, props.compact ? _RadioButtonListItemModule.default.compact : null, props.contentOnly ? _RadioButtonListItemModule.default.contentOnly : null, props.hasErrors ? _RadioButtonListItemModule.default.hasErrors : null];
|
|
15
|
-
const listItemClassNameString = (0, _helpers.classNameArrayToClassNameString)(listItemClassNameArray);
|
|
16
|
-
const inputProps = {
|
|
17
|
-
onChange: props.onChange,
|
|
18
|
-
inputValue: props.inputValue,
|
|
19
|
-
checked: props.checked,
|
|
20
|
-
disabled: props.disabled,
|
|
21
|
-
required: props.required,
|
|
22
|
-
requiredGroup: props.requiredGroup,
|
|
23
|
-
contentOnly: props.contentOnly,
|
|
24
|
-
hasErrors: props.hasErrors,
|
|
25
|
-
"aria-controls": props["aria-controls"],
|
|
26
|
-
"aria-describedby": props["aria-describedby"],
|
|
27
|
-
id: props.id,
|
|
28
|
-
name: props.name
|
|
29
|
-
};
|
|
30
|
-
return _react.default.createElement("div", {
|
|
31
|
-
className: listItemClassNameString
|
|
32
|
-
}, _react.default.createElement(_RadioButtonInput.default, inputProps, props.children));
|
|
33
|
-
};
|
|
34
|
-
RadioButtonListItem.propTypes = {
|
|
35
|
-
inputValue: _propTypes.default.string.isRequired,
|
|
36
|
-
checked: _propTypes.default.bool,
|
|
37
|
-
disabled: _propTypes.default.bool,
|
|
38
|
-
required: _propTypes.default.bool,
|
|
39
|
-
requiredGroup: _propTypes.default.bool,
|
|
40
|
-
name: _propTypes.default.string,
|
|
41
|
-
id: _propTypes.default.string.isRequired,
|
|
42
|
-
onChange: _propTypes.default.func,
|
|
43
|
-
contentOnly: _propTypes.default.bool,
|
|
44
|
-
compact: _propTypes.default.bool,
|
|
45
|
-
hasErrors: _propTypes.default.bool,
|
|
46
|
-
"aria-controls": _propTypes.default.string,
|
|
47
|
-
"aria-describedby": _propTypes.default.string
|
|
48
|
-
};
|
|
49
|
-
RadioButtonListItem.defaultProps = {
|
|
50
|
-
name: "",
|
|
51
|
-
checked: false,
|
|
52
|
-
required: false,
|
|
53
|
-
requiredGroup: false,
|
|
54
|
-
disabled: false,
|
|
55
|
-
contentOnly: false,
|
|
56
|
-
hasErrors: false,
|
|
57
|
-
type: "RadioButtonListItem"
|
|
58
|
-
};
|
|
59
|
-
var _default = exports.default = RadioButtonListItem;
|
|
@@ -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
|
-
.radioButtonListItem {
|
|
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="radio"] {
|
|
81
|
-
opacity: 0;
|
|
82
|
-
position: absolute;
|
|
83
|
-
}
|
|
84
|
-
}
|