@helsenorge/designsystem-react 4.3.0 → 4.4.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/CHANGELOG.md +28 -3
- package/Close.js +1 -1
- package/Close.js.map +1 -1
- package/ListHeader.js +1 -1
- package/ListHeader.js.map +1 -1
- package/Panel.js +1 -1
- package/Panel.js.map +1 -1
- package/Table.js +1 -1
- package/Table.js.map +1 -1
- package/TableBody.js +1 -1
- package/TableBody.js.map +1 -1
- package/TableExpandedRow.js +1 -1
- package/TableExpandedRow.js.map +1 -1
- package/TableHead.js +1 -1
- package/TableHead.js.map +1 -1
- package/TableRow.js +1 -1
- package/TableRow.js.map +1 -1
- package/Textarea.js +1 -1
- package/Textarea.js.map +1 -1
- package/Trigger.js +2 -0
- package/Trigger.js.map +1 -0
- package/components/AnchorLink/index.js +1 -1
- package/components/Button/index.js +1 -1
- package/components/ButtonWithModal/index.js +1 -1
- package/components/ButtonWithModal/index.js.map +1 -1
- package/components/Checkbox/styles.module.scss +13 -0
- package/components/Close/Close.d.ts +0 -2
- package/components/Close/Close.d.ts.map +1 -1
- package/components/Close/componentdata.json +1 -1
- package/components/Close/index.js +1 -1
- package/components/Dropdown/index.js +1 -1
- package/components/Dropdown/index.js.map +1 -1
- package/components/Dropdown/styles.module.scss +1 -0
- package/components/Expander/index.js +1 -1
- package/components/Expander/index.js.map +1 -1
- package/components/ExpanderHierarchy/ExpanderButton.d.ts.map +1 -1
- package/components/ExpanderHierarchy/expander.module.scss +14 -7
- package/components/ExpanderHierarchy/expander.module.scss.d.ts +2 -0
- package/components/ExpanderHierarchy/index.js +1 -1
- package/components/ExpanderHierarchy/index.js.map +1 -1
- package/components/ExpanderList/index.js +1 -1
- package/components/ExpanderList/index.js.map +1 -1
- package/components/FormExample/index.js +1 -1
- package/components/HelpBubble/index.js +1 -1
- package/components/HelpBubbleExample/index.js +1 -1
- package/components/HelpBubbleExample/index.js.map +1 -1
- package/components/HelpQuestion/HelpQuestion.d.ts +22 -0
- package/components/HelpQuestion/HelpQuestion.d.ts.map +1 -0
- package/components/HelpQuestion/componentdata.json +1 -0
- package/components/HelpQuestion/index.d.ts +4 -0
- package/components/HelpQuestion/index.d.ts.map +1 -0
- package/components/HelpQuestion/index.js +2 -0
- package/components/HelpQuestion/index.js.map +1 -0
- package/components/HelpQuestion/styles.module.scss +49 -0
- package/components/HelpQuestion/styles.module.scss.d.ts +10 -0
- package/components/Label/componentdata.json +1 -1
- package/components/LinkList/index.js +1 -1
- package/components/Logo/Logo.d.ts +2 -2
- package/components/Logo/Logo.d.ts.map +1 -1
- package/components/Logo/componentdata.json +1 -1
- package/components/Logo/index.js +1 -1
- package/components/Logo/index.js.map +1 -1
- package/components/Modal/index.js +1 -1
- package/components/Modal/styles.module.scss +1 -0
- package/components/NotificationPanel/index.js +1 -1
- package/components/NotificationPanel/index.js.map +1 -1
- package/components/Panel/Panel.d.ts +2 -2
- package/components/Panel/Panel.d.ts.map +1 -1
- package/components/Panel/componentdata.json +1 -1
- package/components/Panel/index.js +1 -1
- package/components/Panel/styles.module.scss +1 -0
- package/components/PanelList/index.js +1 -1
- package/components/PanelList/index.js.map +1 -1
- package/components/PopMenu/PopMenu.d.ts.map +1 -1
- package/components/PopMenu/index.js +1 -1
- package/components/PopMenu/index.js.map +1 -1
- package/components/RadioButton/styles.module.scss +13 -0
- package/components/ServiceMessage/ServiceMessage.d.ts +6 -3
- package/components/ServiceMessage/ServiceMessage.d.ts.map +1 -1
- package/components/ServiceMessage/componentdata.json +1 -1
- package/components/ServiceMessage/index.js +1 -1
- package/components/ServiceMessage/index.js.map +1 -1
- package/components/ServiceMessage/styles.module.scss +139 -238
- package/components/ServiceMessage/styles.module.scss.d.ts +17 -34
- package/components/Step/Step.d.ts +2 -0
- package/components/Step/Step.d.ts.map +1 -1
- package/components/Step/componentdata.json +1 -1
- package/components/Step/index.js +1 -1
- package/components/Step/index.js.map +1 -1
- package/components/Step/styles.module.scss +23 -1
- package/components/Step/styles.module.scss.d.ts +5 -1
- package/components/Table/TableExpandedRow/TableExpandedRow.d.ts +3 -1
- package/components/Table/TableExpandedRow/TableExpandedRow.d.ts.map +1 -1
- package/components/Table/TableExpandedRow/componentdata.json +1 -1
- package/components/Table/TableExpandedRow/index.js +1 -1
- package/components/Table/TableExpanderCell/index.js +1 -1
- package/components/Table/TableRow/index.js +1 -1
- package/components/Table/index.js +1 -1
- package/components/Tag/index.js +1 -1
- package/components/Tag/index.js.map +1 -1
- package/components/Tile/index.js +1 -1
- package/components/Tile/index.js.map +1 -1
- package/components/Tooltip/index.js +1 -1
- package/components/TooltipExample/index.js +1 -1
- package/components/TooltipExample/index.js.map +1 -1
- package/components/Trigger/Trigger.d.ts +9 -0
- package/components/Trigger/Trigger.d.ts.map +1 -1
- package/components/Trigger/componentdata.json +1 -1
- package/components/Trigger/index.js +1 -1
- package/components/Trigger/index.js.map +1 -1
- package/components/Trigger/styles.module.scss +23 -20
- package/components/Trigger/styles.module.scss.d.ts +2 -0
- package/constants.d.ts +4 -3
- package/constants.d.ts.map +1 -1
- package/constants.js +1 -1
- package/constants.js.map +1 -1
- package/hooks/useHover.d.ts.map +1 -1
- package/hooks/useHover.js +1 -1
- package/hooks/useHover.js.map +1 -1
- package/hooks/useSticky.d.ts +5 -4
- package/hooks/useSticky.d.ts.map +1 -1
- package/hooks/useSticky.js +1 -1
- package/hooks/useSticky.js.map +1 -1
- package/index.js +1 -1
- package/package.json +4 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
1
2
|
@import '../../scss/spacers';
|
|
2
3
|
@import '../../scss/palette';
|
|
3
4
|
@import '../../scss/breakpoints';
|
|
@@ -5,322 +6,222 @@
|
|
|
5
6
|
@import '../../scss/grid';
|
|
6
7
|
|
|
7
8
|
.service-message {
|
|
8
|
-
|
|
9
|
+
$servicemessage: &;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
background-color: $kiwi50;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&--info {
|
|
16
|
-
background-color: $blueberry50;
|
|
17
|
-
}
|
|
11
|
+
border-width: 1px;
|
|
12
|
+
border-bottom-style: solid;
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&--alert {
|
|
24
|
-
background-color: $cherry50;
|
|
25
|
-
}
|
|
14
|
+
&:first-of-type {
|
|
15
|
+
border-top-style: solid;
|
|
26
16
|
}
|
|
27
17
|
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
&--success {
|
|
19
|
+
background-color: $kiwi50;
|
|
30
20
|
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
&:hover {
|
|
22
|
+
background-color: rgba-to-rgb(rgba($kiwi500, 0.1), $kiwi50);
|
|
33
23
|
}
|
|
34
24
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
@include make-container-max-widths;
|
|
39
|
-
}
|
|
25
|
+
&#{$servicemessage},
|
|
26
|
+
&#{$servicemessage}__label-container {
|
|
27
|
+
border-color: $kiwi900;
|
|
40
28
|
}
|
|
29
|
+
}
|
|
41
30
|
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
&--info {
|
|
32
|
+
background-color: $blueberry50;
|
|
44
33
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&--expanded {
|
|
50
|
-
border-bottom: 0.0625rem solid $kiwi900;
|
|
51
|
-
}
|
|
34
|
+
&:hover {
|
|
35
|
+
background-color: rgba-to-rgb(rgba($blueberry500, 0.1), $blueberry50);
|
|
52
36
|
}
|
|
53
37
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
&:hover {
|
|
58
|
-
background-color: rgb(24 128 151 / 10%);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&--expanded {
|
|
62
|
-
border-bottom: 0.0625rem solid $blueberry700;
|
|
63
|
-
}
|
|
38
|
+
&#{$servicemessage},
|
|
39
|
+
&#{$servicemessage}__label-container {
|
|
40
|
+
border-color: $blueberry700;
|
|
64
41
|
}
|
|
42
|
+
}
|
|
65
43
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
&:hover {
|
|
70
|
-
background-color: rgb(221 171 6 / 10%);
|
|
71
|
-
}
|
|
44
|
+
&--warn {
|
|
45
|
+
background-color: $banana50;
|
|
72
46
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
47
|
+
&:hover {
|
|
48
|
+
background-color: rgba-to-rgb(rgba($banana500, 0.1), $banana50);
|
|
76
49
|
}
|
|
77
50
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
&:hover {
|
|
82
|
-
background-color: rgb(200 53 33 / 10%);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&--expanded {
|
|
86
|
-
border-bottom: 0.0625rem solid $cherry700;
|
|
87
|
-
}
|
|
51
|
+
&#{$servicemessage},
|
|
52
|
+
&#{$servicemessage}__label-container {
|
|
53
|
+
border-color: $banana700;
|
|
88
54
|
}
|
|
55
|
+
}
|
|
89
56
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
border: 0.0625rem solid $kiwi900;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&--info {
|
|
96
|
-
border: 0.0625rem solid $blueberry700;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
&--warn {
|
|
100
|
-
border: 0.0625rem solid $banana700;
|
|
101
|
-
}
|
|
57
|
+
&--alert {
|
|
58
|
+
background-color: $cherry50;
|
|
102
59
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
60
|
+
&:hover {
|
|
61
|
+
background-color: rgba-to-rgb(rgba($cherry500, 0.1), $cherry50);
|
|
106
62
|
}
|
|
107
63
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
&--width {
|
|
115
|
-
width: 100%;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
&--not-first {
|
|
119
|
-
border-top-color: transparent;
|
|
120
|
-
border-right-color: transparent;
|
|
121
|
-
border-left-color: transparent;
|
|
122
|
-
}
|
|
64
|
+
&#{$servicemessage},
|
|
65
|
+
&#{$servicemessage}__label-container {
|
|
66
|
+
border-color: $cherry700;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
123
69
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
70
|
+
&__container {
|
|
71
|
+
@include make-container;
|
|
72
|
+
@include make-container-max-widths;
|
|
73
|
+
}
|
|
128
74
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
padding-bottom: 0.3125rem;
|
|
75
|
+
&__row {
|
|
76
|
+
@include make-row;
|
|
77
|
+
}
|
|
133
78
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
79
|
+
&__col {
|
|
80
|
+
@include make-col-ready;
|
|
81
|
+
@include make-col(12);
|
|
82
|
+
}
|
|
139
83
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
84
|
+
&__label-container {
|
|
85
|
+
position: relative;
|
|
86
|
+
padding-top: getSpacer(3xs);
|
|
87
|
+
padding-bottom: getSpacer(3xs);
|
|
143
88
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
89
|
+
@media (min-width: map-get($grid-breakpoints, lg)) {
|
|
90
|
+
padding-top: getSpacer(2xs);
|
|
91
|
+
padding-bottom: getSpacer(2xs);
|
|
92
|
+
}
|
|
147
93
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
94
|
+
&--has-expander:has(:focus-visible) {
|
|
95
|
+
box-shadow: inset 0 0 0 2px $black;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
152
98
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
99
|
+
&__label {
|
|
100
|
+
display: flex;
|
|
101
|
+
width: 100%;
|
|
102
|
+
align-items: center;
|
|
103
|
+
gap: getSpacer(2xs);
|
|
159
104
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
105
|
+
@media (min-width: map-get($grid-breakpoints, md)) {
|
|
106
|
+
gap: getSpacer(m);
|
|
163
107
|
}
|
|
164
108
|
}
|
|
165
109
|
|
|
166
|
-
&
|
|
167
|
-
|
|
168
|
-
|
|
110
|
+
&__title {
|
|
111
|
+
width: 100%;
|
|
112
|
+
font-weight: 700;
|
|
169
113
|
font-size: $font-size-xs;
|
|
170
114
|
line-height: 1.25rem;
|
|
171
|
-
padding: getSpacer(3xs) 0 getSpacer(xs) 0;
|
|
172
115
|
|
|
173
116
|
@media (min-width: map-get($grid-breakpoints, md)) {
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
@media (min-width: map-get($grid-breakpoints, lg)) {
|
|
178
|
-
padding: getSpacer(2xs) 0 getSpacer(s) 0;
|
|
179
|
-
margin: 0 4.5625rem;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
&__info {
|
|
183
|
-
display: block;
|
|
184
|
-
font-size: $font-size-xs;
|
|
185
|
-
line-height: 1.25rem;
|
|
186
|
-
|
|
187
|
-
@media (min-width: map-get($grid-breakpoints, lg)) {
|
|
188
|
-
padding-top: getSpacer(xs);
|
|
189
|
-
line-height: 1.625rem;
|
|
190
|
-
font-size: $font-size-sm;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
&--smaller {
|
|
194
|
-
display: block;
|
|
195
|
-
font-size: 0.875rem;
|
|
196
|
-
padding-top: getSpacer(2xs);
|
|
197
|
-
line-height: 1.25rem;
|
|
198
|
-
|
|
199
|
-
@media (min-width: map-get($grid-breakpoints, lg)) {
|
|
200
|
-
padding-top: getSpacer(xs);
|
|
201
|
-
font-size: $font-size-xs;
|
|
202
|
-
line-height: $lineheight-size-xs;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
117
|
+
font-size: $font-size-sm;
|
|
205
118
|
}
|
|
119
|
+
}
|
|
206
120
|
|
|
207
|
-
|
|
208
|
-
|
|
121
|
+
&__toggle {
|
|
122
|
+
all: unset;
|
|
209
123
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
124
|
+
// Triks for at hele labelen skal trigge klikk på knappen
|
|
125
|
+
&::after {
|
|
126
|
+
inset: 0;
|
|
127
|
+
content: '';
|
|
128
|
+
position: absolute;
|
|
214
129
|
}
|
|
215
130
|
}
|
|
216
131
|
|
|
217
|
-
&
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
132
|
+
&__content {
|
|
133
|
+
margin-left: calc(38px + getSpacer(2xs));
|
|
134
|
+
margin-right: calc(38px + getSpacer(2xs));
|
|
135
|
+
padding-top: getSpacer(xs);
|
|
136
|
+
padding-bottom: getSpacer(xs);
|
|
222
137
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
138
|
+
@media (min-width: map-get($grid-breakpoints, md)) {
|
|
139
|
+
margin-left: calc(38px + getSpacer(m));
|
|
140
|
+
margin-right: calc(38px + getSpacer(m));
|
|
226
141
|
}
|
|
227
142
|
|
|
228
|
-
|
|
229
|
-
margin-left:
|
|
230
|
-
|
|
231
|
-
|
|
143
|
+
@media (min-width: map-get($grid-breakpoints, lg)) {
|
|
144
|
+
margin-left: calc(48px + getSpacer(m));
|
|
145
|
+
margin-right: calc(48px + getSpacer(m));
|
|
146
|
+
padding-top: getSpacer(2xs);
|
|
147
|
+
padding-bottom: getSpacer(s);
|
|
232
148
|
}
|
|
233
149
|
}
|
|
234
150
|
|
|
235
|
-
&
|
|
236
|
-
text-align: left;
|
|
237
|
-
font-weight: 700;
|
|
151
|
+
&__info {
|
|
238
152
|
font-size: $font-size-xs;
|
|
239
153
|
line-height: 1.25rem;
|
|
154
|
+
margin: 0;
|
|
240
155
|
|
|
241
|
-
@media (min-width: map-get($grid-breakpoints,
|
|
156
|
+
@media (min-width: map-get($grid-breakpoints, lg)) {
|
|
157
|
+
margin-top: getSpacer(xs);
|
|
158
|
+
line-height: 1.625rem;
|
|
242
159
|
font-size: $font-size-sm;
|
|
243
160
|
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
&__top-row {
|
|
247
|
-
line-height: $lineheight-size-xs;
|
|
248
|
-
align-items: center;
|
|
249
161
|
|
|
250
|
-
|
|
251
|
-
font-size:
|
|
252
|
-
|
|
253
|
-
}
|
|
162
|
+
&--extra {
|
|
163
|
+
font-size: 0.875rem;
|
|
164
|
+
margin-top: getSpacer(2xs);
|
|
254
165
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
166
|
+
@media (min-width: map-get($grid-breakpoints, lg)) {
|
|
167
|
+
margin-top: getSpacer(xs);
|
|
168
|
+
font-size: $font-size-xs;
|
|
169
|
+
line-height: $lineheight-size-xs;
|
|
170
|
+
}
|
|
259
171
|
}
|
|
260
172
|
}
|
|
261
173
|
|
|
262
|
-
&
|
|
174
|
+
&__actions {
|
|
263
175
|
display: flex;
|
|
264
176
|
justify-content: space-between;
|
|
265
177
|
flex-flow: column wrap;
|
|
266
|
-
padding: getSpacer(2xs) 0 0 0;
|
|
267
178
|
gap: getSpacer(2xs);
|
|
179
|
+
margin-top: getSpacer(2xs);
|
|
268
180
|
|
|
269
181
|
@media (min-width: map-get($grid-breakpoints, sm)) {
|
|
270
182
|
flex-direction: row;
|
|
271
183
|
}
|
|
272
184
|
|
|
273
185
|
@media (min-width: map-get($grid-breakpoints, lg)) {
|
|
274
|
-
|
|
186
|
+
margin-top: getSpacer(s);
|
|
275
187
|
}
|
|
188
|
+
}
|
|
276
189
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
190
|
+
&__action {
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
border: none;
|
|
194
|
+
width: fit-content;
|
|
195
|
+
color: $blueberry700;
|
|
196
|
+
font-weight: 600;
|
|
197
|
+
font-size: $font-size-xs;
|
|
198
|
+
line-height: 1.25rem;
|
|
199
|
+
background-color: transparent;
|
|
200
|
+
text-decoration: none;
|
|
201
|
+
padding: 0.5rem;
|
|
202
|
+
margin-left: -0.5rem;
|
|
203
|
+
gap: getSpacer(xs);
|
|
204
|
+
|
|
205
|
+
&:hover,
|
|
206
|
+
&:active {
|
|
207
|
+
background-color: rgb(88 170 187 / 10%);
|
|
281
208
|
}
|
|
282
209
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
align-items: center;
|
|
286
|
-
border: none;
|
|
287
|
-
width: fit-content;
|
|
288
|
-
color: $blueberry700;
|
|
289
|
-
font-weight: 600;
|
|
290
|
-
font-size: $font-size-xs;
|
|
291
|
-
line-height: 1.25rem;
|
|
210
|
+
&:focus-visible {
|
|
211
|
+
box-shadow: 0 0 0 2px $black;
|
|
292
212
|
background-color: transparent;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
margin-left: -0.5rem;
|
|
296
|
-
|
|
297
|
-
&:hover,
|
|
298
|
-
&:active {
|
|
299
|
-
background-color: rgb(88 170 187 / 10%);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
&:focus {
|
|
303
|
-
box-shadow: 0 0 0 2px $black;
|
|
304
|
-
background-color: transparent;
|
|
305
|
-
border-radius: 0;
|
|
306
|
-
border: 0;
|
|
307
|
-
outline: none;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
svg {
|
|
311
|
-
margin-left: getSpacer(xs);
|
|
312
|
-
}
|
|
213
|
+
border: 0;
|
|
214
|
+
outline: none;
|
|
313
215
|
}
|
|
314
216
|
|
|
315
|
-
|
|
316
|
-
|
|
217
|
+
&--close {
|
|
218
|
+
@media (min-width: map-get($grid-breakpoints, lg)) {
|
|
317
219
|
margin-left: auto;
|
|
318
|
-
padding: 0;
|
|
319
|
-
|
|
320
|
-
svg {
|
|
321
|
-
margin-left: 0;
|
|
322
|
-
}
|
|
323
220
|
}
|
|
324
221
|
}
|
|
325
222
|
}
|
|
223
|
+
|
|
224
|
+
&__close {
|
|
225
|
+
z-index: 1;
|
|
226
|
+
}
|
|
326
227
|
}
|
|
@@ -1,41 +1,24 @@
|
|
|
1
1
|
export type Styles = {
|
|
2
2
|
'service-message': string;
|
|
3
|
-
'service-
|
|
4
|
-
'service-
|
|
5
|
-
'service-
|
|
6
|
-
'service-
|
|
3
|
+
'service-message__action': string;
|
|
4
|
+
'service-message__action--close': string;
|
|
5
|
+
'service-message__actions': string;
|
|
6
|
+
'service-message__close': string;
|
|
7
|
+
'service-message__col': string;
|
|
8
|
+
'service-message__container': string;
|
|
7
9
|
'service-message__content': string;
|
|
8
|
-
'service-
|
|
9
|
-
'service-
|
|
10
|
-
'service-message__content--spacing': string;
|
|
11
|
-
'service-message__icon--expander': string;
|
|
12
|
-
'service-message__icon--signal': string;
|
|
10
|
+
'service-message__info': string;
|
|
11
|
+
'service-message__info--extra': string;
|
|
13
12
|
'service-message__label': string;
|
|
14
|
-
'service-
|
|
15
|
-
'service-
|
|
16
|
-
'service-
|
|
17
|
-
'service-
|
|
18
|
-
'service-
|
|
19
|
-
'service-
|
|
20
|
-
'service-
|
|
21
|
-
'service-
|
|
22
|
-
'service-
|
|
23
|
-
'service-message__wrapper__border--success': string;
|
|
24
|
-
'service-message__wrapper__border--warn': string;
|
|
25
|
-
'service-message__wrapper__btn': string;
|
|
26
|
-
'service-message__wrapper__btn--expanded': string;
|
|
27
|
-
'service-message__wrapper__btn--first': string;
|
|
28
|
-
'service-message__wrapper__btn--not-first': string;
|
|
29
|
-
'service-message__wrapper__btn--width': string;
|
|
30
|
-
'service-message__wrapper--alert': string;
|
|
31
|
-
'service-message__wrapper--alert--expanded': string;
|
|
32
|
-
'service-message__wrapper--info': string;
|
|
33
|
-
'service-message__wrapper--info--expanded': string;
|
|
34
|
-
'service-message__wrapper--inner': string;
|
|
35
|
-
'service-message__wrapper--success': string;
|
|
36
|
-
'service-message__wrapper--success--expanded': string;
|
|
37
|
-
'service-message__wrapper--warn': string;
|
|
38
|
-
'service-message__wrapper--warn--expanded': string;
|
|
13
|
+
'service-message__label-container': string;
|
|
14
|
+
'service-message__label-container--has-expander': string;
|
|
15
|
+
'service-message__row': string;
|
|
16
|
+
'service-message__title': string;
|
|
17
|
+
'service-message__toggle': string;
|
|
18
|
+
'service-message--alert': string;
|
|
19
|
+
'service-message--info': string;
|
|
20
|
+
'service-message--success': string;
|
|
21
|
+
'service-message--warn': string;
|
|
39
22
|
};
|
|
40
23
|
|
|
41
24
|
export type ClassNames = keyof Styles;
|
|
@@ -14,6 +14,8 @@ interface StepProps {
|
|
|
14
14
|
additionalButtons?: React.ReactElement<ButtonProps>[];
|
|
15
15
|
/** Knapp for å avbryte eller fortsette senere. Vises med "borderless" variant. */
|
|
16
16
|
cancelButton?: React.ReactElement<ButtonProps>;
|
|
17
|
+
/** Knappene vil vises sticky nederst på skjermen dersom innholdet i Step tar mer plass enn vinduet. Default: false */
|
|
18
|
+
stickyButtons?: boolean;
|
|
17
19
|
}
|
|
18
20
|
declare const Step: React.FC<StepProps>;
|
|
19
21
|
export default Step;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../../src/components/Step/Step.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../../src/components/Step/Step.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAKtC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI1C,UAAU,SAAS;IACjB,gCAAgC;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAC3C,uBAAuB;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAC7C,uDAAuD;IACvD,aAAa,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAChD,0CAA0C;IAC1C,iBAAiB,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC;IACtD,kFAAkF;IAClF,YAAY,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAC/C,uHAAuH;IACvH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAoE7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"props":{"stepper":{"defaultValue":null,"description":"Stepper viser fremdriften","name":"stepper","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"}],"required":false,"type":{"name":"ReactElement<StepperProps, string | JSXElementConstructor<any>>"}},"children":{"defaultValue":null,"description":"Innhold i steget","name":"children","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"ReactNode"}},"backButton":{"defaultValue":null,"description":"Knapp for å gå tilbake. Vises med \"outline\" variant.","name":"backButton","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"}],"required":false,"type":{"name":"ReactElement<ButtonProps, string | JSXElementConstructor<any>>"}},"forwardButton":{"defaultValue":null,"description":"Knapp for å gå videre. Vises med \"fill\" variant.","name":"forwardButton","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"}],"required":false,"type":{"name":"ReactElement<ButtonProps, string | JSXElementConstructor<any>>"}},"additionalButtons":{"defaultValue":null,"description":"Ekstra knapper. Valgfritt utseende.","name":"additionalButtons","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"}],"required":false,"type":{"name":"ReactElement<ButtonProps, string | JSXElementConstructor<any>>[]"}},"cancelButton":{"defaultValue":null,"description":"Knapp for å avbryte eller fortsette senere. Vises med \"borderless\" variant.","name":"cancelButton","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"}],"required":false,"type":{"name":"ReactElement<ButtonProps, string | JSXElementConstructor<any>>"}}}}
|
|
1
|
+
{"props":{"stepper":{"defaultValue":null,"description":"Stepper viser fremdriften","name":"stepper","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"}],"required":false,"type":{"name":"ReactElement<StepperProps, string | JSXElementConstructor<any>>"}},"children":{"defaultValue":null,"description":"Innhold i steget","name":"children","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"ReactNode"}},"backButton":{"defaultValue":null,"description":"Knapp for å gå tilbake. Vises med \"outline\" variant.","name":"backButton","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"}],"required":false,"type":{"name":"ReactElement<ButtonProps, string | JSXElementConstructor<any>>"}},"forwardButton":{"defaultValue":null,"description":"Knapp for å gå videre. Vises med \"fill\" variant.","name":"forwardButton","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"}],"required":false,"type":{"name":"ReactElement<ButtonProps, string | JSXElementConstructor<any>>"}},"additionalButtons":{"defaultValue":null,"description":"Ekstra knapper. Valgfritt utseende.","name":"additionalButtons","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"}],"required":false,"type":{"name":"ReactElement<ButtonProps, string | JSXElementConstructor<any>>[]"}},"cancelButton":{"defaultValue":null,"description":"Knapp for å avbryte eller fortsette senere. Vises med \"borderless\" variant.","name":"cancelButton","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"}],"required":false,"type":{"name":"ReactElement<ButtonProps, string | JSXElementConstructor<any>>"}},"stickyButtons":{"defaultValue":{"value":"false"},"description":"Knappene vil vises sticky nederst på skjermen dersom innholdet i Step tar mer plass enn vinduet. Default: false","name":"stickyButtons","parent":{"fileName":"src/components/Step/Step.tsx","name":"StepProps"},"declarations":[{"fileName":"src/components/Step/Step.tsx","name":"StepProps"}],"required":false,"type":{"name":"boolean"}}}}
|
package/components/Step/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t,{useRef as d}from"react";import s from"classnames";import{useSticky as h}from"../../hooks/useSticky.js";import e from"./styles.module.scss";import"../../hooks/useLayoutEvent.js";import"../../utils/debounce.js";const y=({stepper:m,children:f,backButton:n,forwardButton:i,additionalButtons:o,cancelButton:l,stickyButtons:a=!1})=>{const p=d(null),c=d(null),{isOutsideWindow:g,offsetHeight:r,contentWidth:_}=h(p,c,"bottom"),N=a&&g,v=n||i||o||l,E=s(!v&&e["step__content--no-navigation"]),b=s(e.step__navigation,!v&&e["step__navigation--hidden"],a&&e["step__navigation--has-sticky-buttons"],N&&e["step__navigation--is-sticky"]);return t.createElement("div",{className:s(a&&e["step--has-sticky-buttons"])},m&&t.createElement("div",{className:e.step__stepper},m),t.createElement("div",{className:E,ref:p,style:{paddingBottom:a&&r?`${r}px`:void 0}},f),t.createElement("div",{className:b,ref:c,style:{width:a&&_?`${_}px`:void 0}},(n||i)&&t.createElement("div",{className:s(e.step__buttons,e["step__buttons--navigation"])},n&&t.cloneElement(n,{variant:"outline",wrapperClassName:s(e["step__button--back"])}),i&&t.cloneElement(i,{variant:"fill",wrapperClassName:s(e["step__button--forward"])})),o&&t.createElement("div",{className:s(e.step__buttons,e["step__buttons--additional"])},o),l&&t.createElement("div",{className:e.step__buttons},t.cloneElement(l,{variant:"borderless"}))))},w=y;export{w as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Step/Step.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { ButtonProps } from '../Button';\nimport { StepperProps } from '../Stepper';\n\nimport styles from './styles.module.scss';\n\ninterface StepProps {\n /** Stepper viser fremdriften */\n stepper?: React.ReactElement<StepperProps>;\n /** Innhold i steget */\n children: React.ReactNode;\n /** Knapp for å gå tilbake. Vises med \"outline\" variant. */\n backButton?: React.ReactElement<ButtonProps>;\n /** Knapp for å gå videre. Vises med \"fill\" variant. */\n forwardButton?: React.ReactElement<ButtonProps>;\n /** Ekstra knapper. Valgfritt utseende. */\n additionalButtons?: React.ReactElement<ButtonProps>[];\n /** Knapp for å avbryte eller fortsette senere. Vises med \"borderless\" variant. */\n cancelButton?: React.ReactElement<ButtonProps>;\n}\n\nconst Step: React.FC<StepProps> = ({
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Step/Step.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useSticky } from '../../hooks/useSticky';\nimport { ButtonProps } from '../Button';\nimport { StepperProps } from '../Stepper';\n\nimport styles from './styles.module.scss';\n\ninterface StepProps {\n /** Stepper viser fremdriften */\n stepper?: React.ReactElement<StepperProps>;\n /** Innhold i steget */\n children: React.ReactNode;\n /** Knapp for å gå tilbake. Vises med \"outline\" variant. */\n backButton?: React.ReactElement<ButtonProps>;\n /** Knapp for å gå videre. Vises med \"fill\" variant. */\n forwardButton?: React.ReactElement<ButtonProps>;\n /** Ekstra knapper. Valgfritt utseende. */\n additionalButtons?: React.ReactElement<ButtonProps>[];\n /** Knapp for å avbryte eller fortsette senere. Vises med \"borderless\" variant. */\n cancelButton?: React.ReactElement<ButtonProps>;\n /** Knappene vil vises sticky nederst på skjermen dersom innholdet i Step tar mer plass enn vinduet. Default: false */\n stickyButtons?: boolean;\n}\n\nconst Step: React.FC<StepProps> = ({\n stepper,\n children,\n backButton,\n forwardButton,\n additionalButtons,\n cancelButton,\n stickyButtons = false,\n}) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const navigationRef = useRef<HTMLDivElement>(null);\n const { isOutsideWindow, offsetHeight, contentWidth } = useSticky(contentRef, navigationRef, 'bottom');\n\n const isSticky = stickyButtons && isOutsideWindow;\n const hasNavigation = backButton || forwardButton || additionalButtons || cancelButton;\n\n const contentClasses = classNames(!hasNavigation && styles['step__content--no-navigation']);\n const navigationClasses = classNames(\n styles.step__navigation,\n !hasNavigation && styles['step__navigation--hidden'],\n stickyButtons && styles['step__navigation--has-sticky-buttons'],\n isSticky && styles['step__navigation--is-sticky']\n );\n\n return (\n <div className={classNames(stickyButtons && styles['step--has-sticky-buttons'])}>\n {stepper && <div className={styles.step__stepper}>{stepper}</div>}\n <div\n className={contentClasses}\n ref={contentRef}\n style={{ paddingBottom: stickyButtons && offsetHeight ? `${offsetHeight}px` : undefined }}\n >\n {children}\n </div>\n <div\n className={navigationClasses}\n ref={navigationRef}\n style={{\n width: stickyButtons && contentWidth ? `${contentWidth}px` : undefined,\n }}\n >\n {(backButton || forwardButton) && (\n <div className={classNames(styles.step__buttons, styles['step__buttons--navigation'])}>\n {backButton &&\n React.cloneElement(backButton, {\n variant: 'outline',\n wrapperClassName: classNames(styles['step__button--back']),\n })}\n {forwardButton &&\n React.cloneElement(forwardButton, {\n variant: 'fill',\n wrapperClassName: classNames(styles['step__button--forward']),\n })}\n </div>\n )}\n {additionalButtons && (\n <div className={classNames(styles.step__buttons, styles['step__buttons--additional'])}>{additionalButtons}</div>\n )}\n {cancelButton && (\n <div className={styles.step__buttons}>\n {React.cloneElement(cancelButton, {\n variant: 'borderless',\n })}\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default Step;\n"],"names":["Step","stepper","children","backButton","forwardButton","additionalButtons","cancelButton","stickyButtons","contentRef","useRef","navigationRef","isOutsideWindow","offsetHeight","contentWidth","useSticky","isSticky","hasNavigation","contentClasses","classNames","styles","navigationClasses","React","Step$1"],"mappings":"2NA2BA,MAAMA,EAA4B,CAAC,CACjC,QAAAC,EACA,SAAAC,EACA,WAAAC,EACA,cAAAC,EACA,kBAAAC,EACA,aAAAC,EACA,cAAAC,EAAgB,EAClB,IAAM,CACE,MAAAC,EAAaC,EAAuB,IAAI,EACxCC,EAAgBD,EAAuB,IAAI,EAC3C,CAAE,gBAAAE,EAAiB,aAAAC,EAAc,aAAAC,CAAA,EAAiBC,EAAUN,EAAYE,EAAe,QAAQ,EAE/FK,EAAWR,GAAiBI,EAC5BK,EAAgBb,GAAcC,GAAiBC,GAAqBC,EAEpEW,EAAiBC,EAAW,CAACF,GAAiBG,EAAO,8BAA8B,CAAC,EACpFC,EAAoBF,EACxBC,EAAO,iBACP,CAACH,GAAiBG,EAAO,0BAA0B,EACnDZ,GAAiBY,EAAO,sCAAsC,EAC9DJ,GAAYI,EAAO,6BAA6B,CAAA,EAGlD,uBACG,MAAI,CAAA,UAAWD,EAAWX,GAAiBY,EAAO,0BAA0B,CAAC,CAC3E,EAAAlB,mBAAY,MAAI,CAAA,UAAWkB,EAAO,eAAgBlB,CAAQ,EAC3DoB,EAAA,cAAC,MAAA,CACC,UAAWJ,EACX,IAAKT,EACL,MAAO,CAAE,cAAeD,GAAiBK,EAAe,GAAGA,MAAmB,MAAU,CAAA,EAEvFV,CAEH,EAAAmB,EAAA,cAAC,MAAA,CACC,UAAWD,EACX,IAAKV,EACL,MAAO,CACL,MAAOH,GAAiBM,EAAe,GAAGA,MAAmB,MAC/D,CAAA,GAEEV,GAAcC,IACbiB,EAAA,cAAA,MAAA,CAAI,UAAWH,EAAWC,EAAO,cAAeA,EAAO,2BAA2B,CAAC,CAAA,EACjFhB,GACCkB,EAAM,aAAalB,EAAY,CAC7B,QAAS,UACT,iBAAkBe,EAAWC,EAAO,oBAAoB,CAAC,CAC1D,CAAA,EACFf,GACCiB,EAAM,aAAajB,EAAe,CAChC,QAAS,OACT,iBAAkBc,EAAWC,EAAO,uBAAuB,CAAC,CAAA,CAC7D,CACL,EAEDd,GACEgB,EAAA,cAAA,MAAA,CAAI,UAAWH,EAAWC,EAAO,cAAeA,EAAO,2BAA2B,CAAC,CAAA,EAAId,CAAkB,EAE3GC,mBACE,MAAI,CAAA,UAAWa,EAAO,aACpB,EAAAE,EAAM,aAAaf,EAAc,CAChC,QAAS,YAAA,CACV,CACH,CAAA,CAGN,CAEJ,EAEAgB,EAAetB"}
|
|
@@ -6,19 +6,41 @@
|
|
|
6
6
|
@import '../../scss/screen-reader';
|
|
7
7
|
|
|
8
8
|
.step {
|
|
9
|
+
&--has-sticky-buttons {
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
&__stepper {
|
|
10
14
|
margin-bottom: getSpacer(m);
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
&__content {
|
|
14
|
-
|
|
18
|
+
&--no-navigation {
|
|
19
|
+
margin-bottom: getSpacer(m);
|
|
20
|
+
}
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
&__navigation {
|
|
24
|
+
padding-top: getSpacer(m);
|
|
25
|
+
padding-bottom: getSpacer(s);
|
|
18
26
|
display: flex;
|
|
19
27
|
flex-wrap: wrap;
|
|
20
28
|
column-gap: getSpacer(l);
|
|
21
29
|
row-gap: getSpacer(m);
|
|
30
|
+
|
|
31
|
+
&--hidden {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&--has-sticky-buttons {
|
|
36
|
+
position: absolute;
|
|
37
|
+
bottom: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&--is-sticky {
|
|
41
|
+
background-color: $white;
|
|
42
|
+
position: fixed;
|
|
43
|
+
}
|
|
22
44
|
}
|
|
23
45
|
|
|
24
46
|
&__buttons {
|
|
@@ -3,9 +3,13 @@ export type Styles = {
|
|
|
3
3
|
'step__button--forward': string;
|
|
4
4
|
step__buttons: string;
|
|
5
5
|
'step__buttons--additional': string;
|
|
6
|
-
step__content: string;
|
|
6
|
+
'step__content--no-navigation': string;
|
|
7
7
|
step__navigation: string;
|
|
8
|
+
'step__navigation--has-sticky-buttons': string;
|
|
9
|
+
'step__navigation--hidden': string;
|
|
10
|
+
'step__navigation--is-sticky': string;
|
|
8
11
|
step__stepper: string;
|
|
12
|
+
'step--has-sticky-buttons': string;
|
|
9
13
|
};
|
|
10
14
|
|
|
11
15
|
export type ClassNames = keyof Styles;
|