dibk-design 7.7.1 → 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 -142
- 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
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
// Mixins
|
|
2
|
-
@use "../style/abstracts/mixins/animation";
|
|
3
|
-
@use "../style/abstracts/mixins/appearance";
|
|
4
|
-
@use "../style/abstracts/mixins/border-radius";
|
|
5
|
-
@use "../style/abstracts/mixins/box-shadow";
|
|
6
|
-
@use "../style/abstracts/mixins/keyframes";
|
|
7
|
-
@use "../style/abstracts/mixins/transform";
|
|
8
|
-
@use "../style/abstracts/mixins/transition";
|
|
9
|
-
|
|
10
|
-
// Variables
|
|
11
|
-
@use "../style/abstracts/variables/colors";
|
|
12
|
-
@use "../style/abstracts/variables/transitions";
|
|
13
|
-
@use "../style/abstracts/variables/typography";
|
|
14
|
-
@use "../style/abstracts/variables/viewports";
|
|
15
|
-
|
|
16
|
-
@include keyframes.keyframes(pushnext) {
|
|
17
|
-
0% {
|
|
18
|
-
@include transform.transform(rotate(45deg) translate3d(0, 0, 0));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
50% {
|
|
22
|
-
@include transform.transform(rotate(45deg) translate3d(2px, -2px, 0));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
100% {
|
|
26
|
-
@include transform.transform(rotate(45deg) translate3d(0, 0, 0));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
@include keyframes.keyframes(pushprev) {
|
|
30
|
-
0% {
|
|
31
|
-
@include transform.transform(rotate(-135deg) translate3d(0, 0, 0));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
50% {
|
|
35
|
-
@include transform.transform(rotate(-135deg) translate3d(-2px, 2px, 0));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
100% {
|
|
39
|
-
@include transform.transform(rotate(-135deg) translate3d(0, 0, 0));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.button {
|
|
44
|
-
@include appearance.appearance(none);
|
|
45
|
-
@include border-radius.border-radius(0);
|
|
46
|
-
@include transition.transition(
|
|
47
|
-
filter transitions.$default-transition,
|
|
48
|
-
background-color transitions.$default-transition,
|
|
49
|
-
color transitions.$default-transition,
|
|
50
|
-
border-color transitions.$default-transition
|
|
51
|
-
);
|
|
52
|
-
font-family: typography.$default-font;
|
|
53
|
-
border-style: solid;
|
|
54
|
-
border-width: 1px;
|
|
55
|
-
border-color: var(--color-primary, colors.$color-primary);
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
line-height: 1;
|
|
58
|
-
position: relative;
|
|
59
|
-
text-align: center;
|
|
60
|
-
text-decoration: none;
|
|
61
|
-
display: inline-block;
|
|
62
|
-
|
|
63
|
-
font-size: 17px;
|
|
64
|
-
font-weight: 500;
|
|
65
|
-
@media only screen and (min-width: viewports.$screen-sm) {
|
|
66
|
-
font-size: 20px;
|
|
67
|
-
}
|
|
68
|
-
&:not(.noMargin) {
|
|
69
|
-
margin-right: 5px;
|
|
70
|
-
margin-bottom: 8px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&:focus {
|
|
74
|
-
outline-offset: 3px;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&:focus-visible,
|
|
78
|
-
&:focus-within {
|
|
79
|
-
outline-color: var(--color-primary, colors.$color-primary);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
&.regular {
|
|
83
|
-
padding: 16px 24px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&.small {
|
|
87
|
-
padding: 6px 24px;
|
|
88
|
-
min-width: 80px;
|
|
89
|
-
line-height: 18px;
|
|
90
|
-
@media only screen and (min-width: viewports.$screen-sm) {
|
|
91
|
-
line-height: 21px;
|
|
92
|
-
padding: 6px 32px;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
&.primary {
|
|
97
|
-
background-color: var(--color-primary, colors.$color-primary);
|
|
98
|
-
color: var(--color-primary-contrast, colors.$color-primary-contrast);
|
|
99
|
-
&:hover:not(.noHover),
|
|
100
|
-
&:focus-visible {
|
|
101
|
-
background-color: var(--color-primary-light, colors.$color-primary-light);
|
|
102
|
-
border-color: var(--color-primary-light, colors.$color-primary-light);
|
|
103
|
-
color: var(--color-primary-contrast, colors.$color-primary-contrast);
|
|
104
|
-
&:after,
|
|
105
|
-
&:before {
|
|
106
|
-
border-color: var(--color-primary-light, colors.$color-primary-light);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
&:active:not(.noHover),
|
|
110
|
-
&:active:hover:not(.noHover) {
|
|
111
|
-
background-color: var(--color-primary-x-light, colors.$color-primary-x-light);
|
|
112
|
-
border-color: var(--color-primary-x-light, colors.$color-primary-x-light);
|
|
113
|
-
color: var(--color-primary-contrast, colors.$color-primary-contrast);
|
|
114
|
-
&:after,
|
|
115
|
-
&:before {
|
|
116
|
-
border-color: var(--color-primary-x-light, colors.$color-primary-x-light);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
&.secondary {
|
|
122
|
-
background-color: var(--color-secondary, colors.$color-secondary);
|
|
123
|
-
color: var(--color-secondary-contrast, colors.$color-secondary-contrast);
|
|
124
|
-
border-color: var(--color-secondary-x-light, colors.$color-secondary-x-light);
|
|
125
|
-
&:hover:not(.noHover),
|
|
126
|
-
&:focus-visible {
|
|
127
|
-
background-color: var(--color-secondary-light, colors.$color-secondary-x-light);
|
|
128
|
-
color: var(--color-secondary-contrast, colors.$color-secondary-contrast);
|
|
129
|
-
&:after,
|
|
130
|
-
&:before {
|
|
131
|
-
border-color: var(--color-secondary-light, colors.$color-secondary-x-light);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
&:active:not(.noHover),
|
|
135
|
-
&:active:hover:not(.noHover) {
|
|
136
|
-
background-color: var(--color-secondary-x-light, colors.$color-secondary-light);
|
|
137
|
-
color: var(--color-secondary-contrast, colors.$color-secondary-contrast);
|
|
138
|
-
&:after,
|
|
139
|
-
&:before {
|
|
140
|
-
border-color: var(--color-secondary-x-light, colors.$color-secondary-light);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
&:disabled,
|
|
146
|
-
&.disabled {
|
|
147
|
-
&.primary,
|
|
148
|
-
&.secondary {
|
|
149
|
-
background-color: var(--color-primary, colors.$color-primary);
|
|
150
|
-
cursor: default;
|
|
151
|
-
color: var(--color-primary-contrast, colors.$color-primary-contrast);
|
|
152
|
-
border: 1px solid var(--color-primary, colors.$color-primary);
|
|
153
|
-
opacity: 0.2;
|
|
154
|
-
filter: saturate(3);
|
|
155
|
-
&:hover:not(.noHover),
|
|
156
|
-
&:focus-visible,
|
|
157
|
-
&:active:not(.noHover),
|
|
158
|
-
&:active:hover:not(.noHover) {
|
|
159
|
-
background-color: var(--color-primary, colors.$color-primary);
|
|
160
|
-
cursor: default;
|
|
161
|
-
color: var(--color-primary-contrast, colors.$color-primary-contrast);
|
|
162
|
-
border: 1px solid var(--color-primary, colors.$color-primary);
|
|
163
|
-
&:before,
|
|
164
|
-
&:after {
|
|
165
|
-
border-color: var(--color-primary-contrast, colors.$color-primary-contrast);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
&:before,
|
|
169
|
-
&:after {
|
|
170
|
-
border-color: var(--color-primary-contrast, colors.$color-primary-contrast);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
&.hasErrors {
|
|
176
|
-
@include box-shadow.box-shadow(0 0 2px 1px var(--color-error, colors.$color-error));
|
|
177
|
-
border-color: var(--color-error, colors.$color-error);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
&.rounded {
|
|
181
|
-
@include border-radius.border-radius(20px);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
&.hasArrowLeft {
|
|
185
|
-
&:before {
|
|
186
|
-
@include transform.transform(rotate(-135deg));
|
|
187
|
-
content: " ";
|
|
188
|
-
display: inline-block;
|
|
189
|
-
margin-right: 1em;
|
|
190
|
-
width: 0.5rem;
|
|
191
|
-
height: 0.5rem;
|
|
192
|
-
vertical-align: middle;
|
|
193
|
-
border-style: solid;
|
|
194
|
-
border-width: 2px 2px 0 0;
|
|
195
|
-
margin-right: 1em;
|
|
196
|
-
@media only screen and (min-width: viewports.$screen-sm) {
|
|
197
|
-
left: 1em;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
&:not(:disabled),
|
|
201
|
-
&:not(.disabled) {
|
|
202
|
-
&.primary {
|
|
203
|
-
&:before {
|
|
204
|
-
border-color: var(--color-primary-contrast, colors.$color-primary-contrast);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
&.secondary {
|
|
208
|
-
&:before {
|
|
209
|
-
border-color: var(--color-secondary-contrast, colors.$color-secondary-contrast);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
&:hover:not(.noHover),
|
|
213
|
-
&:focus-visible,
|
|
214
|
-
&:active:not(.noHover),
|
|
215
|
-
&:active:hover:not(.noHover) {
|
|
216
|
-
&:before {
|
|
217
|
-
@include animation.animation(pushprev 0.8s linear infinite);
|
|
218
|
-
}
|
|
219
|
-
&.primary {
|
|
220
|
-
&:before {
|
|
221
|
-
border-color: var(--color-primary-contrast, colors.$color-primary-contrast);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
&.secondary {
|
|
225
|
-
&:before {
|
|
226
|
-
border-color: var(--color-secondary-contrast, colors.$color-secondary-contrast);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
&.hasArrowRight {
|
|
234
|
-
&:after {
|
|
235
|
-
@include transform.transform(rotate(45deg));
|
|
236
|
-
content: " ";
|
|
237
|
-
display: inline-block;
|
|
238
|
-
margin-left: 1em;
|
|
239
|
-
width: 0.5rem;
|
|
240
|
-
height: 0.5rem;
|
|
241
|
-
vertical-align: middle;
|
|
242
|
-
border-style: solid;
|
|
243
|
-
border-width: 2px 2px 0 0;
|
|
244
|
-
margin-left: 1em;
|
|
245
|
-
@media only screen and (min-width: viewports.$screen-sm) {
|
|
246
|
-
right: 1em;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
&:not(:disabled),
|
|
251
|
-
&:not(.disabled) {
|
|
252
|
-
&.primary {
|
|
253
|
-
&:after {
|
|
254
|
-
border-color: var(--color-primary-contrast, colors.$color-primary-contrast);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
&.secondary {
|
|
258
|
-
&:after {
|
|
259
|
-
border-color: var(--color-secondary-contrast, colors.$color-secondary-contrast);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
&:hover:not(.noHover),
|
|
264
|
-
&:focus-visible,
|
|
265
|
-
&:active:not(.noHover),
|
|
266
|
-
&:active:hover:not(.noHover) {
|
|
267
|
-
&:after {
|
|
268
|
-
@include animation.animation(pushnext 0.8s linear infinite);
|
|
269
|
-
}
|
|
270
|
-
&.primary {
|
|
271
|
-
&:after {
|
|
272
|
-
border-color: var(--color-primary-contrast, colors.$color-primary-contrast);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
&.secondary {
|
|
276
|
-
&:after {
|
|
277
|
-
border-color: var(--color-secondary-contrast, colors.$color-secondary-contrast);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
label.button {
|
|
286
|
-
input[type="radio"] {
|
|
287
|
-
@include appearance.appearance(none);
|
|
288
|
-
margin: 0;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
@@ -1,42 +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 _CheckBoxIconModule = _interopRequireDefault(require("./CheckBoxIcon.module.scss"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const CheckBoxIcon = props => {
|
|
12
|
-
let inlineStyle = {
|
|
13
|
-
height: props.size,
|
|
14
|
-
width: props.size,
|
|
15
|
-
fontSize: props.size
|
|
16
|
-
};
|
|
17
|
-
const checkBoxIconProps = {
|
|
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
|
-
style: inlineStyle
|
|
20
|
-
};
|
|
21
|
-
return _react.default.createElement("span", checkBoxIconProps, _react.default.createElement("span", {
|
|
22
|
-
"aria-hidden": true,
|
|
23
|
-
className: _CheckBoxIconModule.default.checkmark
|
|
24
|
-
}, props.checked ? props.checkmarkCharacter : ""));
|
|
25
|
-
};
|
|
26
|
-
CheckBoxIcon.propTypes = {
|
|
27
|
-
size: _propTypes.default.string,
|
|
28
|
-
checked: _propTypes.default.bool,
|
|
29
|
-
disabled: _propTypes.default.bool,
|
|
30
|
-
showBox: _propTypes.default.bool,
|
|
31
|
-
hasErrors: _propTypes.default.bool,
|
|
32
|
-
checkmarkCharacter: _propTypes.default.string
|
|
33
|
-
};
|
|
34
|
-
CheckBoxIcon.defaultProps = {
|
|
35
|
-
size: "20px",
|
|
36
|
-
checked: false,
|
|
37
|
-
disabled: false,
|
|
38
|
-
showBox: true,
|
|
39
|
-
hasErrors: false,
|
|
40
|
-
checkmarkCharacter: "✔"
|
|
41
|
-
};
|
|
42
|
-
var _default = exports.default = CheckBoxIcon;
|
|
@@ -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;
|