@helsenorge/designsystem-react 3.1.4 → 3.2.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/CHANGELOG.md +551 -590
  2. package/Checkbox.js +1 -1
  3. package/Checkbox.js.map +1 -1
  4. package/Input.js +1 -1
  5. package/Input.js.map +1 -1
  6. package/Label.js +2 -0
  7. package/Label.js.map +1 -0
  8. package/Panel.js +1 -1
  9. package/Panel.js.map +1 -1
  10. package/README.md +0 -8
  11. package/RadioButton.js +1 -1
  12. package/RadioButton.js.map +1 -1
  13. package/Select.js +1 -1
  14. package/Select.js.map +1 -1
  15. package/StatusDot.js +1 -1
  16. package/StatusDot.js.map +1 -1
  17. package/Textarea.js +1 -1
  18. package/Textarea.js.map +1 -1
  19. package/components/Button/componentdata.json +1 -1
  20. package/components/Checkbox/Checkbox.d.ts +3 -3
  21. package/components/Checkbox/Checkbox.d.ts.map +1 -1
  22. package/components/Checkbox/componentdata.json +1 -1
  23. package/components/Checkbox/index.js +1 -1
  24. package/components/Checkbox/styles.module.scss +223 -59
  25. package/components/Checkbox/styles.module.scss.d.ts +25 -3
  26. package/components/Dropdown/componentdata.json +1 -1
  27. package/components/ErrorWrapper/componentdata.json +1 -1
  28. package/components/Expander/componentdata.json +1 -1
  29. package/components/FormExample/FormExample.d.ts.map +1 -1
  30. package/components/FormExample/index.js +3 -3
  31. package/components/FormExample/index.js.map +1 -1
  32. package/components/FormGroup/index.js +1 -1
  33. package/components/HelpBubbleExample/componentdata.json +1 -1
  34. package/components/HighlightBox/componentdata.json +1 -1
  35. package/components/Input/Input.d.ts +2 -8
  36. package/components/Input/Input.d.ts.map +1 -1
  37. package/components/Input/componentdata.json +1 -1
  38. package/components/Input/index.js +1 -1
  39. package/components/Input/styles.module.scss.d.ts +0 -3
  40. package/components/Label/Label.d.ts +41 -0
  41. package/components/Label/Label.d.ts.map +1 -0
  42. package/components/Label/SubLabel.d.ts +17 -0
  43. package/components/Label/SubLabel.d.ts.map +1 -0
  44. package/components/Label/componentdata.json +1 -0
  45. package/components/Label/index.d.ts +5 -0
  46. package/components/Label/index.d.ts.map +1 -0
  47. package/components/Label/index.js +2 -0
  48. package/components/Label/index.js.map +1 -0
  49. package/components/Label/styles.module.scss +66 -0
  50. package/components/Label/styles.module.scss.d.ts +17 -0
  51. package/components/Panel/Panel.d.ts +2 -0
  52. package/components/Panel/Panel.d.ts.map +1 -1
  53. package/components/Panel/componentdata.json +1 -1
  54. package/components/Panel/styles.module.scss +65 -2
  55. package/components/Panel/styles.module.scss.d.ts +7 -0
  56. package/components/PopMenu/componentdata.json +1 -1
  57. package/components/RadioButton/RadioButton.d.ts +3 -3
  58. package/components/RadioButton/RadioButton.d.ts.map +1 -1
  59. package/components/RadioButton/componentdata.json +1 -1
  60. package/components/RadioButton/index.js +1 -1
  61. package/components/RadioButton/styles.module.scss +228 -52
  62. package/components/RadioButton/styles.module.scss.d.ts +15 -3
  63. package/components/Select/Select.d.ts +2 -2
  64. package/components/Select/Select.d.ts.map +1 -1
  65. package/components/Select/componentdata.json +1 -1
  66. package/components/Select/index.js +1 -1
  67. package/components/Select/styles.module.scss +0 -22
  68. package/components/Select/styles.module.scss.d.ts +0 -3
  69. package/components/ServiceMessage/ServiceMessage.d.ts.map +1 -1
  70. package/components/ServiceMessage/index.js +1 -1
  71. package/components/ServiceMessage/index.js.map +1 -1
  72. package/components/ServiceMessage/styles.module.scss +18 -0
  73. package/components/ServiceMessage/styles.module.scss.d.ts +4 -0
  74. package/components/StatusDot/StatusDot.d.ts +9 -0
  75. package/components/StatusDot/StatusDot.d.ts.map +1 -1
  76. package/components/StatusDot/componentdata.json +1 -1
  77. package/components/StatusDot/index.js +1 -1
  78. package/components/StatusDot/styles.module.scss +14 -3
  79. package/components/StatusDot/styles.module.scss.d.ts +1 -0
  80. package/components/Step/componentdata.json +1 -1
  81. package/components/Table/Table.d.ts.map +1 -1
  82. package/components/Table/TableBody/TableBody.d.ts +1 -1
  83. package/components/Table/TableBody/TableBody.d.ts.map +1 -1
  84. package/components/Table/TableCell/TableCell.d.ts +1 -1
  85. package/components/Table/TableCell/TableCell.d.ts.map +1 -1
  86. package/components/Table/TableExpandedRow/TableExpandedRow.d.ts +1 -1
  87. package/components/Table/TableExpandedRow/TableExpandedRow.d.ts.map +1 -1
  88. package/components/Table/TableExpanderCell/TableExpanderCell.d.ts +2 -2
  89. package/components/Table/TableExpanderCell/TableExpanderCell.d.ts.map +1 -1
  90. package/components/Table/TableHead/TableHead.d.ts +1 -1
  91. package/components/Table/TableHead/TableHead.d.ts.map +1 -1
  92. package/components/Table/TableHeadCell/TableHeadCell.d.ts +1 -1
  93. package/components/Table/TableHeadCell/TableHeadCell.d.ts.map +1 -1
  94. package/components/Table/TableRow/componentdata.json +1 -1
  95. package/components/Table/index.js +1 -1
  96. package/components/Table/index.js.map +1 -1
  97. package/components/Table/styles.module.scss +0 -2
  98. package/components/Table/utils.d.ts +8 -0
  99. package/components/Table/utils.d.ts.map +1 -1
  100. package/components/Tag/componentdata.json +1 -1
  101. package/components/Textarea/Textarea.d.ts +2 -6
  102. package/components/Textarea/Textarea.d.ts.map +1 -1
  103. package/components/Textarea/componentdata.json +1 -1
  104. package/components/Textarea/index.js +1 -1
  105. package/components/Textarea/styles.module.scss.d.ts +0 -3
  106. package/components/Tooltip/TooltipWord/styles.module.scss +4 -1
  107. package/components/Tooltip/componentdata.json +1 -1
  108. package/components/TooltipExample/componentdata.json +1 -1
  109. package/components/Validation/index.js +1 -1
  110. package/constants.d.ts +2 -0
  111. package/constants.d.ts.map +1 -1
  112. package/constants.js +1 -1
  113. package/constants.js.map +1 -1
  114. package/hooks/usePseudoClasses.d.ts +12 -0
  115. package/hooks/usePseudoClasses.d.ts.map +1 -0
  116. package/hooks/usePseudoClasses.js +2 -0
  117. package/hooks/usePseudoClasses.js.map +1 -0
  118. package/package.json +1 -1
  119. package/scss/_input.scss +6 -28
  120. package/scss/_spacers.scss +1 -1
@@ -26,12 +26,27 @@
26
26
  }
27
27
  }
28
28
 
29
- &--with-error#{&}--bigform {
29
+ &--with-error#{&}__bigform {
30
30
  padding: getSpacer(m) getSpacer(m);
31
31
  }
32
32
 
33
- &--bigform {
33
+ &__bigform {
34
34
  margin: getSpacer(2xs) 0 getSpacer(2xs) 0;
35
+
36
+ &--focused {
37
+ box-shadow: 0 0 0 getSpacer(3xs);
38
+ color: $neutral500;
39
+ }
40
+ &--focused#{&}--on-blueberry {
41
+ color: $blueberry500;
42
+ }
43
+
44
+ &--focused#{&}--selected {
45
+ color: $blueberry900;
46
+ }
47
+ &--focused#{&}--invalid {
48
+ color: $cherry400;
49
+ }
35
50
  }
36
51
  }
37
52
 
@@ -47,12 +62,8 @@
47
62
  display: flex;
48
63
  align-items: flex-start;
49
64
  cursor: pointer;
50
- font-size: $font-size-sm;
51
65
  line-height: $lineheight-size-sm;
52
-
53
- @media (min-width: map.get($grid-breakpoints, md)) {
54
- font-size: $font-size-md;
55
- }
66
+ color: $black;
56
67
 
57
68
  &--on-dark {
58
69
  color: $white;
@@ -64,28 +75,107 @@
64
75
 
65
76
  &--disabled {
66
77
  cursor: default;
67
- color: $neutral400;
78
+ color: $neutral700;
68
79
  }
69
80
 
70
- &--bigform {
81
+ &__bigform {
71
82
  padding: getSpacer(s);
72
83
  background-color: $neutral50;
73
- }
74
84
 
75
- &--bigform#{&}--on-blueberry {
76
- background-color: $blueberry50;
85
+ &:hover {
86
+ background-color: $neutral100;
87
+ }
88
+
89
+ &--on-blueberry {
90
+ background-color: $white;
91
+
92
+ &:focus {
93
+ background-color: $white;
94
+ }
95
+
96
+ &:hover {
97
+ background-color: $blueberry100;
98
+ }
99
+ }
100
+
101
+ &--on-grey {
102
+ background-color: $white;
103
+
104
+ &:hover {
105
+ background-color: $neutral100;
106
+ }
107
+
108
+ &:focus {
109
+ background-color: $white;
110
+ }
111
+ }
77
112
  }
78
113
 
79
- &--bigform#{&}--on-dark {
114
+ &__bigform#{&}--on-dark {
80
115
  background-color: $blueberry800;
81
116
  }
117
+ &__bigform#{&}--invalid {
118
+ background-color: $white;
119
+
120
+ &:hover {
121
+ background-color: $cherry100;
122
+ }
123
+ }
124
+ &__bigform#{&}__bigform--selected-invalid {
125
+ background-color: $cherry100;
126
+ color: $black;
127
+
128
+ &:hover {
129
+ background-color: $cherry200;
130
+ }
131
+ }
132
+
133
+ &__bigform#{&}__bigform--disabled {
134
+ background-color: $neutral50;
82
135
 
83
- &--bigform#{&}--invalid {
136
+ &:hover {
137
+ background-color: $neutral50;
138
+ }
139
+
140
+ &:focus {
141
+ background-color: $neutral50;
142
+ }
143
+ }
144
+ &__bigform#{&}__bigform--on-grey {
84
145
  background-color: $white;
146
+
147
+ &:hover {
148
+ background-color: $neutral100;
149
+ }
150
+
151
+ &:focus {
152
+ background-color: $white;
153
+ }
154
+ }
155
+
156
+ &__bigform#{&}__bigform--on-blueberry {
157
+ background-color: $white;
158
+
159
+ &:hover {
160
+ background-color: $blueberry100;
161
+ }
162
+
163
+ &:focus {
164
+ background-color: $white;
165
+ }
166
+ }
167
+
168
+ &__bigform--selected {
169
+ background-color: $blueberry500;
170
+ color: $white;
171
+
172
+ &:hover {
173
+ background-color: $blueberry600;
174
+ }
85
175
  }
86
176
 
87
177
  @media (min-width: map.get($grid-breakpoints, md)) {
88
- &--bigform {
178
+ &__bigform {
89
179
  padding: 1.68rem getSpacer(l);
90
180
  }
91
181
  }
@@ -105,14 +195,7 @@
105
195
  min-width: 1.5rem;
106
196
  color: $neutral700;
107
197
  box-shadow: 0 0 0 getSpacer(4xs);
108
-
109
- &:checked {
110
- color: $blueberry500;
111
-
112
- &:hover {
113
- background-color: $blueberry50;
114
- }
115
- }
198
+ outline: none;
116
199
 
117
200
  &:focus {
118
201
  box-shadow: 0 0 0 getSpacer(3xs);
@@ -129,6 +212,20 @@
129
212
  color: $black;
130
213
  }
131
214
 
215
+ &:checked {
216
+ color: $blueberry500;
217
+
218
+ &:hover {
219
+ box-shadow: 0 0 0 getSpacer(4xs);
220
+ background-color: $blueberry50;
221
+ }
222
+
223
+ &:focus {
224
+ box-shadow: 0 0 0 getSpacer(3xs);
225
+ color: $black;
226
+ }
227
+ }
228
+
132
229
  &--on-blueberry {
133
230
  color: $blueberry500;
134
231
 
@@ -145,12 +242,8 @@
145
242
  box-shadow: 0 0 0 getSpacer(3xs);
146
243
  }
147
244
 
148
- &:checked {
149
- color: $blueberry200;
150
-
151
- &:hover {
152
- background-color: $inverted-hover;
153
- }
245
+ &:focus {
246
+ color: $white;
154
247
  }
155
248
 
156
249
  :active > & {
@@ -158,8 +251,16 @@
158
251
  color: $white;
159
252
  }
160
253
 
161
- &:focus {
162
- color: $white;
254
+ &:checked {
255
+ color: $blueberry200;
256
+
257
+ &:hover {
258
+ background-color: $inverted-hover;
259
+ }
260
+
261
+ &:focus {
262
+ color: $white;
263
+ }
163
264
  }
164
265
  }
165
266
 
@@ -170,14 +271,6 @@
170
271
  background-color: $cherry100;
171
272
  }
172
273
 
173
- &:checked {
174
- color: $cherry600;
175
-
176
- &:hover {
177
- background-color: $cherry100;
178
- }
179
- }
180
-
181
274
  &:active {
182
275
  color: $black;
183
276
  }
@@ -185,28 +278,41 @@
185
278
  &:focus {
186
279
  color: $black;
187
280
  }
188
- }
189
-
190
- &--disabled {
191
- cursor: default;
192
- color: $neutral400;
193
281
 
194
282
  &:checked {
195
- color: $neutral400;
283
+ color: $cherry600;
196
284
 
197
285
  &:hover {
198
- box-shadow: 0 0 0 getSpacer(4xs);
199
- background-color: transparent;
286
+ background-color: $cherry100;
200
287
  }
201
288
  }
289
+ }
290
+
291
+ &--disabled {
292
+ cursor: default;
293
+ color: $neutral600;
294
+ background-color: $neutral50;
202
295
 
203
296
  &:hover {
204
297
  box-shadow: 0 0 0 getSpacer(4xs);
205
- background-color: transparent;
298
+ background-color: $neutral50;
299
+ }
300
+
301
+ :hover > & {
302
+ background-color: $neutral50;
206
303
  }
207
304
 
208
305
  &:active {
209
- color: $neutral400;
306
+ color: $neutral600;
307
+ }
308
+
309
+ &:checked {
310
+ color: $neutral600;
311
+
312
+ &:hover {
313
+ box-shadow: 0 0 0 getSpacer(4xs);
314
+ background-color: $neutral50;
315
+ }
210
316
  }
211
317
  }
212
318
 
@@ -215,8 +321,8 @@
215
321
  content: '';
216
322
  display: flex;
217
323
  background-color: $blueberry500;
218
- width: 0.75rem;
219
- height: 0.75rem;
324
+ width: 0.875rem;
325
+ height: 0.875rem;
220
326
  border-radius: 10rem;
221
327
  }
222
328
 
@@ -227,12 +333,82 @@
227
333
  &--disabled:checked::before {
228
334
  box-shadow: 0 0 0 0;
229
335
  background-color: $neutral400;
230
- color: $neutral400;
336
+ color: $neutral600;
231
337
  }
232
338
 
233
339
  &--invalid:checked::before {
234
340
  background-color: $cherry600;
235
341
  }
342
+
343
+ &__bigform {
344
+ &:checked {
345
+ outline: none;
346
+ color: $blueberry100;
347
+ }
348
+
349
+ &:hover {
350
+ box-shadow: 0 0 0 getSpacer(3xs);
351
+ }
352
+
353
+ &:focus {
354
+ box-shadow: 0 0 0 getSpacer(3xs);
355
+ color: $black;
356
+ }
357
+
358
+ &:focus:checked {
359
+ color: $white;
360
+ }
361
+
362
+ &:checked::before {
363
+ background-color: $blueberry100;
364
+ }
365
+
366
+ &:checked:hover {
367
+ box-shadow: 0 0 0 getSpacer(4xs);
368
+ background-color: unset;
369
+ }
370
+
371
+ &:checked:hover:focus {
372
+ box-shadow: 0 0 0 getSpacer(3xs);
373
+ color: $white;
374
+ }
375
+
376
+ &--invalid {
377
+ &:checked {
378
+ color: $cherry500;
379
+ }
380
+
381
+ &:checked::before {
382
+ background-color: $cherry500;
383
+ }
384
+
385
+ &:checked:hover {
386
+ background-color: transparent;
387
+ }
388
+
389
+ &:checked:focus {
390
+ color: $black;
391
+ }
392
+
393
+ &:checked:focus:hover {
394
+ color: $black;
395
+ }
396
+ }
397
+
398
+ &--disabled {
399
+ &:hover {
400
+ box-shadow: 0 0 0 getSpacer(4xs);
401
+ }
402
+
403
+ &:focus {
404
+ box-shadow: 0 0 0 getSpacer(4xs);
405
+ }
406
+ }
407
+ }
408
+ }
409
+
410
+ .radiobutton-sublabel-wrapper {
411
+ padding-left: 2.7rem;
236
412
  }
237
413
 
238
414
  /******** RESET *********/
@@ -1,19 +1,31 @@
1
1
  export type Styles = {
2
2
  'radio-button': string;
3
+ 'radio-button__bigform': string;
4
+ 'radio-button__bigform--disabled': string;
5
+ 'radio-button__bigform--invalid': string;
3
6
  'radio-button--disabled': string;
4
7
  'radio-button--invalid': string;
5
8
  'radio-button--on-blueberry': string;
6
9
  'radio-button--on-dark': string;
7
10
  'radio-button-errors': string;
8
11
  'radio-button-label': string;
9
- 'radio-button-label--bigform': string;
12
+ 'radio-button-label__bigform': string;
13
+ 'radio-button-label__bigform--disabled': string;
14
+ 'radio-button-label__bigform--on-blueberry': string;
15
+ 'radio-button-label__bigform--on-grey': string;
16
+ 'radio-button-label__bigform--selected': string;
17
+ 'radio-button-label__bigform--selected-invalid': string;
10
18
  'radio-button-label--disabled': string;
11
19
  'radio-button-label--invalid': string;
12
- 'radio-button-label--on-blueberry': string;
13
20
  'radio-button-label--on-dark': string;
14
21
  'radio-button-wrapper': string;
15
- 'radio-button-wrapper--bigform': string;
22
+ 'radio-button-wrapper__bigform': string;
23
+ 'radio-button-wrapper__bigform--focused': string;
24
+ 'radio-button-wrapper__bigform--invalid': string;
25
+ 'radio-button-wrapper__bigform--on-blueberry': string;
26
+ 'radio-button-wrapper__bigform--selected': string;
16
27
  'radio-button-wrapper--with-error': string;
28
+ 'radiobutton-sublabel-wrapper': string;
17
29
  };
18
30
 
19
31
  export type ClassNames = keyof Styles;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { FormMode } from '../../constants';
3
3
  type SelectConcept = 'normal' | 'transparent';
4
- export interface SelectProps extends Pick<React.SelectHTMLAttributes<HTMLSelectElement>, 'name' | 'disabled' | 'required' | 'value'> {
4
+ export interface SelectProps extends Pick<React.SelectHTMLAttributes<HTMLSelectElement>, 'aria-describedby' | 'name' | 'disabled' | 'required' | 'value'> {
5
5
  /** Component shown after label */
6
6
  afterLabelChildren?: React.ReactNode;
7
7
  /** Sets the content of the select element. */
@@ -11,7 +11,7 @@ export interface SelectProps extends Pick<React.SelectHTMLAttributes<HTMLSelectE
11
11
  /** Changes the visuals of the component */
12
12
  concept?: SelectConcept;
13
13
  /** The label text above the select */
14
- label?: string;
14
+ label?: React.ReactNode;
15
15
  /** Changes the visuals of the component */
16
16
  mode?: keyof typeof FormMode;
17
17
  /** Activates Error style for the select component - This is can be true while errorText is empty, when in a FormGroup */
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAA2C,QAAQ,EAAY,MAAM,iBAAiB,CAAC;AAS9F,KAAK,aAAa,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE9C,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;IAClI,kCAAkC;IAClC,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,8CAA8C;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC;IAC7B,yHAAyH;IACzH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE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;IACf,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAaD,eAAO,MAAM,MAAM,uFAqEjB,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"props":{"afterLabelChildren":{"defaultValue":null,"description":"Component shown after label","name":"afterLabelChildren","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"ReactNode"}},"children":{"defaultValue":null,"description":"Sets the content of the select element.","name":"children","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":true,"type":{"name":"ReactNode"}},"className":{"defaultValue":null,"description":"Adds custom classes to the element.","name":"className","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"string"}},"concept":{"defaultValue":null,"description":"Changes the visuals of the component","name":"concept","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"enum","raw":"SelectConcept","value":[{"value":"\"normal\""},{"value":"\"transparent\""}]}},"label":{"defaultValue":null,"description":"The label text above the select","name":"label","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"string"}},"mode":{"defaultValue":null,"description":"Changes the visuals of the component","name":"mode","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"enum","raw":"\"onwhite\" | \"ongrey\" | \"onblueberry\" | \"ondark\" | \"oninvalid\"","value":[{"value":"\"onwhite\""},{"value":"\"ongrey\""},{"value":"\"onblueberry\""},{"value":"\"ondark\""},{"value":"\"oninvalid\""}]}},"error":{"defaultValue":null,"description":"Activates Error style for the select component - This is can be true while errorText is empty, when in a FormGroup","name":"error","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"boolean"}},"errorText":{"defaultValue":null,"description":"Error text to show above the component","name":"errorText","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"string"}},"testId":{"defaultValue":null,"description":"Sets the data-testid attribute.","name":"testId","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"string"}},"selectId":{"defaultValue":null,"description":"select id of the select element","name":"selectId","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"string"}},"width":{"defaultValue":null,"description":"Width of select in characters (approximate)","name":"width","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"number"}},"defaultValue":{"defaultValue":null,"description":"Gives defaultvalue to the comp. Preferred over selected prop on option by react","name":"defaultValue","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"string | number"}},"name":{"defaultValue":null,"description":"","name":"name","parent":{"fileName":"s/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"},"declarations":[{"fileName":"s/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"}],"required":false,"type":{"name":"string"}},"disabled":{"defaultValue":null,"description":"","name":"disabled","parent":{"fileName":"s/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"},"declarations":[{"fileName":"s/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"}],"required":false,"type":{"name":"boolean"}},"required":{"defaultValue":null,"description":"","name":"required","parent":{"fileName":"s/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"},"declarations":[{"fileName":"s/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"}],"required":false,"type":{"name":"boolean"}},"value":{"defaultValue":null,"description":"","name":"value","parent":{"fileName":"s/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"},"declarations":[{"fileName":"s/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"}],"required":false,"type":{"name":"string | number | readonly string[]"}}}}
1
+ {"props":{"afterLabelChildren":{"defaultValue":null,"description":"Component shown after label","name":"afterLabelChildren","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"ReactNode"}},"children":{"defaultValue":null,"description":"Sets the content of the select element.","name":"children","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":true,"type":{"name":"ReactNode"}},"className":{"defaultValue":null,"description":"Adds custom classes to the element.","name":"className","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"string"}},"concept":{"defaultValue":null,"description":"Changes the visuals of the component","name":"concept","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"enum","raw":"SelectConcept","value":[{"value":"\"normal\""},{"value":"\"transparent\""}]}},"label":{"defaultValue":null,"description":"The label text above the select","name":"label","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"ReactNode"}},"mode":{"defaultValue":null,"description":"Changes the visuals of the component","name":"mode","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"enum","raw":"\"onwhite\" | \"ongrey\" | \"onblueberry\" | \"ondark\" | \"oninvalid\"","value":[{"value":"\"onwhite\""},{"value":"\"ongrey\""},{"value":"\"onblueberry\""},{"value":"\"ondark\""},{"value":"\"oninvalid\""}]}},"error":{"defaultValue":null,"description":"Activates Error style for the select component - This is can be true while errorText is empty, when in a FormGroup","name":"error","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"boolean"}},"errorText":{"defaultValue":null,"description":"Error text to show above the component","name":"errorText","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"string"}},"testId":{"defaultValue":null,"description":"Sets the data-testid attribute.","name":"testId","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"string"}},"selectId":{"defaultValue":null,"description":"select id of the select element","name":"selectId","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"string"}},"width":{"defaultValue":null,"description":"Width of select in characters (approximate)","name":"width","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"number"}},"defaultValue":{"defaultValue":null,"description":"Gives defaultvalue to the comp. Preferred over selected prop on option by react","name":"defaultValue","parent":{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"},"declarations":[{"fileName":"src/components/Select/Select.tsx","name":"SelectProps"}],"required":false,"type":{"name":"string | number"}},"aria-describedby":{"defaultValue":null,"description":"Identifies the element (or elements) that describes the object.\n@see aria-labelledby","name":"aria-describedby","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"AriaAttributes"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"AriaAttributes"}],"required":false,"type":{"name":"string"}},"name":{"defaultValue":null,"description":"","name":"name","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"}],"required":false,"type":{"name":"string"}},"disabled":{"defaultValue":null,"description":"","name":"disabled","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"}],"required":false,"type":{"name":"boolean"}},"required":{"defaultValue":null,"description":"","name":"required","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"}],"required":false,"type":{"name":"boolean"}},"value":{"defaultValue":null,"description":"","name":"value","parent":{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"},"declarations":[{"fileName":"designsystem/node_modules/@types/react/index.d.ts","name":"SelectHTMLAttributes"}],"required":false,"type":{"name":"string | number | readonly string[]"}}}}
@@ -1,2 +1,2 @@
1
- import{S as o}from"../../Select.js";import{a as k}from"../../Select.js";import"react";import"classnames";import"../../constants.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../utils/environment.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/grid.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../ErrorWrapper.js";import"../ErrorWrapper/styles.module.scss";import"../Icons/Icon.js";import"../Icons/ChevronDown.js";import"./styles.module.scss";export{k as Select,o as default};
1
+ import{S as o}from"../../Select.js";import{a as F}from"../../Select.js";import"react";import"classnames";import"../../constants.js";import"../../hooks/useUuid.js";import"../../uuid.js";import"../../utils/environment.js";import"../../theme/currys/color.js";import"../../theme/index.js";import"../../theme/grid.js";import"../../theme/palette.js";import"../../theme/spacers.js";import"../../ErrorWrapper.js";import"../ErrorWrapper/styles.module.scss";import"../Icons/Icon.js";import"../Icons/ChevronDown.js";import"../../Label.js";import"../../Spacer.js";import"../Spacer/styles.module.scss";import"../Label/styles.module.scss";import"../../utils/component.js";import"../../StatusDot.js";import"../../hooks/useBreakpoint.js";import"../Icons/Attachment.js";import"../Icons/Group.js";import"../Icons/NoAccess.js";import"../Icons/Undo.js";import"../StatusDot/styles.module.scss";import"./styles.module.scss";export{F as Select,o as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -7,28 +7,6 @@
7
7
  .select-wrapper {
8
8
  display: flex;
9
9
  flex-direction: column;
10
-
11
- &__label-wrapper {
12
- display: inline-flex;
13
- align-items: center;
14
- line-height: getSpacer(m);
15
- font-size: $font-size-sm;
16
- font-weight: 600;
17
- padding-bottom: getSpacer(xs);
18
-
19
- @media (min-width: map.get($grid-breakpoints, md)) {
20
- line-height: getSpacer(l);
21
- font-size: $font-size-md;
22
- }
23
-
24
- &--on-dark {
25
- color: $white;
26
- }
27
- }
28
-
29
- &__after-label-children {
30
- padding-left: 0.75rem;
31
- }
32
10
  }
33
11
 
34
12
  .select-inner-wrapper {
@@ -9,9 +9,6 @@ export type Styles = {
9
9
  'select-inner-wrapper--on-blueberry': string;
10
10
  'select-inner-wrapper--transparent': string;
11
11
  'select-wrapper': string;
12
- 'select-wrapper__after-label-children': string;
13
- 'select-wrapper__label-wrapper': string;
14
- 'select-wrapper__label-wrapper--on-dark': string;
15
12
  };
16
13
 
17
14
  export type ClassNames = keyof Styles;
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceMessage.d.ts","sourceRoot":"","sources":["../../../src/components/ServiceMessage/ServiceMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAWhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAUlD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAIjE,MAAM,WAAW,mBAAmB;IAClC,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,6FAA6F;IAC7F,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AACD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAkIjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ServiceMessage.d.ts","sourceRoot":"","sources":["../../../src/components/ServiceMessage/ServiceMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAWhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAUlD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAIjE,MAAM,WAAW,mBAAmB;IAClC,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,6FAA6F;IAC7F,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AACD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAuIjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,2 +1,2 @@
1
- import e,{useState as Q,useRef as u}from"react";import o from"classnames";import{useBreakpoint as V}from"../../hooks/useBreakpoint.js";import{useHover as _}from"../../hooks/useHover.js";import{useUuid as Y}from"../../hooks/useUuid.js";import{getColor as w}from"../../theme/currys/color.js";import{breakpoints as Z}from"../../theme/grid.js";import{palette as t}from"../../theme/palette.js";import{getAriaLabelAttributes as ee}from"../../utils/accessibility.js";import{Icon as a}from"../Icons/Icon.js";import{IconSize as v}from"../../constants.js";import se from"../Icons/CheckFill.js";import re from"../Icons/ChevronDown.js";import oe from"../Icons/ChevronUp.js";import te from"../Icons/ErrorSignFill.js";import ae from"../Icons/Forward.js";import ne from"../Icons/InfoSignFill.js";import ce from"../Icons/TriangleX.js";import S from"../Icons/X.js";import s from"./styles.module.scss";import"../../uuid.js";import"../../utils/environment.js";import"../../theme/index.js";import"../../theme/spacers.js";const me=({label:E,dismissable:C=!0,onDismiss:h,info:g,extraInfo:b,urlTitle:N,url:k,target:z="_self",closeBtnText:d="fjern melding",first:I=!1,expanderOpenFromStart:y=!1,variant:r="alert",testId:x})=>{const n=!!g||!!b,F=n?"button":"span",c=V()<Z.lg?v.XSmall:v.Small,R=Y(),M=r==="alert"?"alert":"region",X=ee({label:E,id:R}),[m,$]=Q(y),A={info:e.createElement(a,{svgIcon:ne,color:t.blueberry700,hoverColor:t.blueberry700,size:c}),warn:e.createElement(a,{svgIcon:te,color:t.banana700,hoverColor:t.banana700,size:c}),alert:e.createElement(a,{svgIcon:ce,color:t.cherry700,hoverColor:t.cherry700,size:c}),success:e.createElement(a,{svgIcon:se,color:t.kiwi900,hoverColor:t.kiwi900,size:c})},T=o(s["service-message__top-row--container"],s["service-message__wrapper--inner"]),j=o(s["service-message__bottom-row__button"],s["service-message__bottom-row__close-button--top"]),B=()=>{const l=_(),{isHovered:f,hoverRef:i}=l,p=u(null),{isHovered:P}=_(p);return e.createElement("span",{className:T,ref:i},e.createElement("span",{className:s["service-message__icon--signal"]},A[r]),e.createElement("h1",{className:s["service-message__label"],id:R},E),n&&e.createElement("span",{className:s["service-message__icon--expander"]},e.createElement(a,{size:c,svgIcon:m?oe:re,isHovered:f})),!n&&C&&e.createElement("button",{ref:p,className:j,"aria-label":d,onClick:h},e.createElement(a,{size:c,svgIcon:S,color:w("blueberry",700),isHovered:P})))},L=()=>{n&&$(!m)},U=o(s["service-message__bottom-row__button"]),H=!!k&&!!N,O=o(s["service-message__bottom-row__button"]),W=o(s["service-message__bottom-row"],{[s["service-message__bottom-row--only-close-button"]]:!H}),q=()=>{const l=u(null),{isHovered:f}=_(l),i=u(null),{isHovered:p}=_(i);return e.createElement("div",{className:W},H&&e.createElement("a",{className:U,href:k,ref:l,target:z},N,e.createElement(a,{size:v.XSmall,svgIcon:ae,color:w("blueberry",700),isHovered:f})),C&&e.createElement("button",{ref:i,className:O,"aria-label":d,onClick:h},d,e.createElement(a,{size:v.XSmall,svgIcon:S,color:w("blueberry",700),isHovered:p})))},D=()=>e.createElement("span",{className:s["service-message__content"]},!!g&&e.createElement("span",{className:s["service-message__content__info"]},g),!!b&&e.createElement("span",{className:s["service-message__content__info--smaller"]},b),e.createElement(q,null)),G=o({[s[`service-message__wrapper--${r}`]]:r,[s[`service-message__wrapper--${r}--expanded`]]:m&&r}),J=o(s["service-message__wrapper--inner"],s["service-message__content__wrapper"]),K=o(s["service-message__wrapper"],s["service-message__wrapper__btn"],{[s["service-message__wrapper__btn--width"]]:n,[s[`service-message__wrapper__border--${r}`]]:r,[s["service-message__wrapper__btn--expanded"]]:m,[s["service-message__wrapper__btn--first"]]:I,[s["service-message__wrapper__btn--not-first"]]:!I});return e.createElement("div",{className:G,role:M,...X},e.createElement(F,{className:K,onClick:L,"aria-expanded":n&&m,"data-testid":x},e.createElement(B,null)),n&&m&&e.createElement("div",{className:s["service-message__content--spacing"]},e.createElement("div",{className:J},e.createElement(D,null))))},$e=me;export{$e as default};
1
+ import e,{useState as V,useRef as f}from"react";import o from"classnames";import{useBreakpoint as Y}from"../../hooks/useBreakpoint.js";import{useHover as _}from"../../hooks/useHover.js";import{useUuid as Z}from"../../hooks/useUuid.js";import{getColor as w}from"../../theme/currys/color.js";import{breakpoints as ee}from"../../theme/grid.js";import{palette as t}from"../../theme/palette.js";import{getAriaLabelAttributes as se}from"../../utils/accessibility.js";import{Icon as a}from"../Icons/Icon.js";import{IconSize as v}from"../../constants.js";import re from"../Icons/CheckFill.js";import oe from"../Icons/ChevronDown.js";import te from"../Icons/ChevronUp.js";import ae from"../Icons/ErrorSignFill.js";import ne from"../Icons/Forward.js";import ce from"../Icons/InfoSignFill.js";import me from"../Icons/TriangleX.js";import S from"../Icons/X.js";import s from"./styles.module.scss";import"../../uuid.js";import"../../utils/environment.js";import"../../theme/index.js";import"../../theme/spacers.js";const le=({label:E,dismissable:C=!0,onDismiss:N,info:g,extraInfo:d,urlTitle:h,url:k,target:z="_self",closeBtnText:b="fjern melding",first:I=!1,expanderOpenFromStart:y=!1,variant:r="alert",testId:x})=>{const n=!!g||!!d,F=n?"button":"span",c=Y()<ee.lg?v.XSmall:v.Small,R=Z(),M=r==="alert"?"alert":"region",X=se({label:E,id:R}),[m,$]=V(y),A={info:e.createElement(a,{svgIcon:ce,color:t.blueberry700,hoverColor:t.blueberry700,size:c}),warn:e.createElement(a,{svgIcon:ae,color:t.banana700,hoverColor:t.banana700,size:c}),alert:e.createElement(a,{svgIcon:me,color:t.cherry700,hoverColor:t.cherry700,size:c}),success:e.createElement(a,{svgIcon:re,color:t.kiwi900,hoverColor:t.kiwi900,size:c})},B=o(s["service-message__top-row--container"],s["service-message__wrapper--inner"]),T=o(s["service-message__bottom-row__button"],s["service-message__bottom-row__close-button--top"]),j=()=>{const l=_(),{isHovered:u,hoverRef:i}=l,p=f(null),{isHovered:Q}=_(p);return e.createElement("span",{className:B,ref:i},e.createElement("span",{className:s["service-message__icon--signal"]},A[r]),e.createElement("h1",{className:s["service-message__label"],id:R},E),n&&e.createElement("span",{className:s["service-message__icon--expander"]},e.createElement(a,{size:c,svgIcon:m?te:oe,isHovered:u})),!n&&C&&e.createElement("button",{ref:p,className:T,"aria-label":b,onClick:N},e.createElement(a,{size:c,svgIcon:S,color:w("blueberry",700),isHovered:Q})))},L=()=>{n&&$(!m)},U=o(s["service-message__bottom-row__button"]),H=!!k&&!!h,O=o(s["service-message__bottom-row__button"]),W=o(s["service-message__bottom-row"],{[s["service-message__bottom-row--only-close-button"]]:!H}),q=()=>{const l=f(null),{isHovered:u}=_(l),i=f(null),{isHovered:p}=_(i);return e.createElement("div",{className:W},H&&e.createElement("a",{className:U,href:k,ref:l,target:z},h,e.createElement(a,{size:v.XSmall,svgIcon:ne,color:w("blueberry",700),isHovered:u})),C&&e.createElement("button",{ref:i,className:O,"aria-label":b,onClick:N},b,e.createElement(a,{size:v.XSmall,svgIcon:S,color:w("blueberry",700),isHovered:p})))},D=()=>e.createElement("span",{className:s["service-message__content"]},!!g&&e.createElement("span",{className:s["service-message__content__info"]},g),!!d&&e.createElement("span",{className:s["service-message__content__info--smaller"]},d),e.createElement(q,null)),G=o({[s[`service-message__outer-wrapper--${r}`]]:r}),J=o({[s[`service-message__wrapper--${r}`]]:r,[s[`service-message__wrapper--${r}--expanded`]]:m&&r}),K=o(s["service-message__wrapper--inner"],s["service-message__content__wrapper"]),P=o(s["service-message__wrapper"],s["service-message__wrapper__btn"],{[s["service-message__wrapper__btn--width"]]:n,[s[`service-message__wrapper__border--${r}`]]:r,[s["service-message__wrapper__btn--expanded"]]:m,[s["service-message__wrapper__btn--first"]]:I,[s["service-message__wrapper__btn--not-first"]]:!I});return e.createElement("div",{className:G},e.createElement("div",{className:J,role:M,...X},e.createElement(F,{className:P,onClick:L,"aria-expanded":n&&m,"data-testid":x},e.createElement(j,null)),n&&m&&e.createElement("div",{className:s["service-message__content--spacing"]},e.createElement("div",{className:K},e.createElement(D,null)))))},Ae=le;export{Ae as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/ServiceMessage/ServiceMessage.tsx"],"sourcesContent":["import React, { useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getColor } from '../../theme/currys';\nimport { breakpoints } from '../../theme/grid';\nimport { palette } from '../../theme/palette';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { AnchorLinkTargets } from '../AnchorLink';\nimport Icon, { IconSize } from '../Icons';\nimport CheckFill from '../Icons/CheckFill';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\nimport ErrorSignFill from '../Icons/ErrorSignFill';\nimport Forward from '../Icons/Forward';\nimport InfoSignFill from '../Icons/InfoSignFill';\nimport TriangleX from '../Icons/TriangleX';\nimport X from '../Icons/X';\nimport { NotificationPanelVariants } from '../NotificationPanel';\n\nimport styles from './styles.module.scss';\n\nexport interface ServiceMessageProps {\n /** Sets a label for the notification panel. */\n label: string;\n /** String displayed in service-message when expended*/\n info?: string;\n /** String displayed in service-message when expended, with a smaller font*/\n extraInfo?: string;\n /** function that runs on dismiss */\n onDismiss?: () => void;\n /** Allows for dismiss to be an option, also for ServiceMessage with only label as content */\n dismissable?: boolean;\n /** Makes expander be open from start. */\n expanderOpenFromStart?: boolean;\n /** Name that describes a url-link for the user*/\n urlTitle?: string;\n /** Url for further information*/\n url?: string;\n /** Sets target for the anchorlink to the url*/\n target?: AnchorLinkTargets;\n /** Text on close-button in service messages. */\n closeBtnText?: string;\n /** Changes the visual representation. */\n variant?: NotificationPanelVariants;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** First of its type. Used to remove border-top */\n first?: boolean;\n}\nconst ServiceMessage: React.FC<ServiceMessageProps> = ({\n label,\n dismissable = true,\n onDismiss,\n info,\n extraInfo,\n urlTitle,\n url,\n target = '_self',\n closeBtnText = 'fjern melding',\n first = false,\n expanderOpenFromStart = false,\n variant = 'alert',\n testId,\n}: ServiceMessageProps) => {\n const hasExpander = !!info || !!extraInfo;\n\n const CustomTag = hasExpander ? 'button' : 'span';\n const breakpoint = useBreakpoint();\n const desktop = breakpoint < breakpoints.lg;\n const iconSize = desktop ? IconSize.XSmall : IconSize.Small;\n const uuid = useUuid();\n const ariaRole = variant === 'alert' ? 'alert' : 'region';\n const ariaLabelAttributes = getAriaLabelAttributes({ label, id: uuid });\n\n const [isExpanded, setIsExpanded] = useState<boolean>(expanderOpenFromStart);\n\n const variantToIconMap = {\n info: <Icon svgIcon={InfoSignFill} color={palette.blueberry700} hoverColor={palette.blueberry700} size={iconSize} />,\n warn: <Icon svgIcon={ErrorSignFill} color={palette.banana700} hoverColor={palette.banana700} size={iconSize} />,\n alert: <Icon svgIcon={TriangleX} color={palette.cherry700} hoverColor={palette.cherry700} size={iconSize} />,\n success: <Icon svgIcon={CheckFill} color={palette.kiwi900} hoverColor={palette.kiwi900} size={iconSize} />,\n };\n const topTowClasses = classNames(styles['service-message__top-row--container'], styles['service-message__wrapper--inner']);\n const topTowCloseButtonClasses = classNames(\n styles['service-message__bottom-row__button'],\n styles['service-message__bottom-row__close-button--top']\n );\n const TopRow = (): JSX.Element => {\n const hoverRefObject = useHover<HTMLButtonElement>();\n const { isHovered, hoverRef } = hoverRefObject;\n const xRef = useRef<HTMLButtonElement>(null);\n const { isHovered: xRefIsHovered } = useHover(xRef);\n return (\n <span className={topTowClasses} ref={hoverRef}>\n <span className={styles['service-message__icon--signal']}>{variantToIconMap[variant]}</span>\n <h1 className={styles['service-message__label']} id={uuid}>\n {label}\n </h1>\n {hasExpander && (\n <span className={styles['service-message__icon--expander']}>\n <Icon size={iconSize} svgIcon={isExpanded ? ChevronUp : ChevronDown} isHovered={isHovered} />\n </span>\n )}\n {!hasExpander && dismissable && (\n <button ref={xRef} className={topTowCloseButtonClasses} aria-label={closeBtnText} onClick={onDismiss}>\n <Icon size={iconSize} svgIcon={X} color={getColor('blueberry', 700)} isHovered={xRefIsHovered} />\n </button>\n )}\n </span>\n );\n };\n const tagClicked = (): void => {\n hasExpander && setIsExpanded(!isExpanded);\n };\n\n const anchorlinkClasses = classNames(styles['service-message__bottom-row__button']);\n const urlField = !!url && !!urlTitle;\n const closeButtonClasses = classNames(styles['service-message__bottom-row__button']);\n const bottomRowClasses = classNames(styles['service-message__bottom-row'], {\n [styles['service-message__bottom-row--only-close-button']]: !urlField,\n });\n const ButtonRow = (): JSX.Element => {\n const readMoreRef = useRef<HTMLAnchorElement>(null);\n const { isHovered: readMoreHoverRefIsHovered } = useHover(readMoreRef);\n const xRef = useRef<HTMLButtonElement>(null);\n const { isHovered: xRefIsHovered } = useHover(xRef);\n return (\n <div className={bottomRowClasses}>\n {urlField && (\n <a className={anchorlinkClasses} href={url} ref={readMoreRef} target={target}>\n {urlTitle}\n <Icon size={IconSize.XSmall} svgIcon={Forward} color={getColor('blueberry', 700)} isHovered={readMoreHoverRefIsHovered} />\n </a>\n )}\n\n {dismissable && (\n <button ref={xRef} className={closeButtonClasses} aria-label={closeBtnText} onClick={onDismiss}>\n {closeBtnText}\n <Icon size={IconSize.XSmall} svgIcon={X} color={getColor('blueberry', 700)} isHovered={xRefIsHovered} />\n </button>\n )}\n </div>\n );\n };\n const Content = (): JSX.Element => {\n return (\n <span className={styles['service-message__content']}>\n {!!info && <span className={styles['service-message__content__info']}>{info}</span>}\n {!!extraInfo && <span className={styles['service-message__content__info--smaller']}>{extraInfo}</span>}\n <ButtonRow />\n </span>\n );\n };\n const backgroundClass = classNames({\n [styles[`service-message__wrapper--${variant}`]]: variant,\n [styles[`service-message__wrapper--${variant}--expanded`]]: isExpanded && variant,\n });\n const contentWrapperClasses = classNames(styles['service-message__wrapper--inner'], styles['service-message__content__wrapper']);\n const wrapperClasses = classNames(styles['service-message__wrapper'], styles['service-message__wrapper__btn'], {\n [styles['service-message__wrapper__btn--width']]: hasExpander,\n [styles[`service-message__wrapper__border--${variant}`]]: variant,\n [styles['service-message__wrapper__btn--expanded']]: isExpanded,\n [styles['service-message__wrapper__btn--first']]: first,\n [styles['service-message__wrapper__btn--not-first']]: !first,\n });\n return (\n <div className={backgroundClass} role={ariaRole} {...ariaLabelAttributes}>\n <CustomTag className={wrapperClasses} onClick={tagClicked} aria-expanded={hasExpander && isExpanded} data-testid={testId}>\n <TopRow />\n </CustomTag>\n {hasExpander && isExpanded && (\n <div className={styles['service-message__content--spacing']}>\n <div className={contentWrapperClasses}>\n <Content />\n </div>\n </div>\n )}\n </div>\n );\n};\n\nexport default ServiceMessage;\n"],"names":["ServiceMessage","label","dismissable","onDismiss","info","extraInfo","urlTitle","url","target","closeBtnText","first","expanderOpenFromStart","variant","testId","hasExpander","CustomTag","iconSize","useBreakpoint","breakpoints","IconSize","uuid","useUuid","ariaRole","ariaLabelAttributes","getAriaLabelAttributes","isExpanded","setIsExpanded","useState","variantToIconMap","React","Icon","InfoSignFill","palette","ErrorSignFill","TriangleX","CheckFill","topTowClasses","classNames","styles","topTowCloseButtonClasses","TopRow","hoverRefObject","useHover","isHovered","hoverRef","xRef","useRef","xRefIsHovered","ChevronUp","ChevronDown","X","getColor","tagClicked","anchorlinkClasses","urlField","closeButtonClasses","bottomRowClasses","ButtonRow","readMoreRef","readMoreHoverRefIsHovered","Forward","Content","backgroundClass","contentWrapperClasses","wrapperClasses","ServiceMessage$1"],"mappings":"y+BAqDA,MAAMA,GAAgD,CAAC,CACrD,MAAAC,EACA,YAAAC,EAAc,GACd,UAAAC,EACA,KAAAC,EACA,UAAAC,EACA,SAAAC,EACA,IAAAC,EACA,OAAAC,EAAS,QACT,aAAAC,EAAe,gBACf,MAAAC,EAAQ,GACR,sBAAAC,EAAwB,GACxB,QAAAC,EAAU,QACV,OAAAC,CACF,IAA2B,CACzB,MAAMC,EAAc,CAAC,CAACV,GAAQ,CAAC,CAACC,EAE1BU,EAAYD,EAAc,SAAW,OAGrCE,EAFaC,IACUC,EAAY,GACdC,EAAS,OAASA,EAAS,MAChDC,EAAOC,IACPC,EAAWV,IAAY,QAAU,QAAU,SAC3CW,EAAsBC,GAAuB,CAAE,MAAAvB,EAAO,GAAImB,EAAM,EAEhE,CAACK,EAAYC,CAAa,EAAIC,EAAkBhB,CAAqB,EAErEiB,EAAmB,CACvB,KAAMC,EAAA,cAACC,EAAK,CAAA,QAASC,GAAc,MAAOC,EAAQ,aAAc,WAAYA,EAAQ,aAAc,KAAMhB,EAAU,EAClH,KAAMa,EAAA,cAACC,EAAK,CAAA,QAASG,GAAe,MAAOD,EAAQ,UAAW,WAAYA,EAAQ,UAAW,KAAMhB,EAAU,EAC7G,MAAOa,EAAA,cAACC,EAAK,CAAA,QAASI,GAAW,MAAOF,EAAQ,UAAW,WAAYA,EAAQ,UAAW,KAAMhB,EAAU,EAC1G,Q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,EAAO,iCAAiC,EAAGA,EAAO,mCAAmC,CAAC,EACzH0B,EAAiB3B,EAAWC,EAAO,0BAA0B,EAAGA,EAAO,+BAA+B,EAAG,CAC7G,CAACA,EAAO,sCAAsC,CAAC,EAAGxB,EAClD,CAACwB,EAAO,qCAAqC1B,GAAS,CAAC,EAAGA,EAC1D,CAAC0B,EAAO,yCAAyC,CAAC,EAAGb,EACrD,CAACa,EAAO,sCAAsC,CAAC,EAAG5B,EAClD,CAAC4B,EAAO,0CAA0C,CAAC,EAAG,CAAC5B,CAAA,CACxD,EACD,uBACG,MAAI,CAAA,UAAWoD,EAAiB,KAAMxC,EAAW,GAAGC,CAAA,EAClDM,EAAA,cAAAd,EAAA,CAAU,UAAWiD,EAAgB,QAASZ,EAAY,gBAAetC,GAAeW,EAAY,cAAaZ,CAAA,EAC/GgB,EAAA,cAAAW,EAAA,IAAO,CACV,EACC1B,GAAeW,GACbI,EAAA,cAAA,MAAA,CAAI,UAAWS,EAAO,mCAAmC,CACxD,EAAAT,EAAA,cAAC,OAAI,UAAWkC,CAAA,kBACbF,EAAQ,IAAA,CACX,CACF,CAEJ,CAEJ,EAEAI,GAAejE"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/ServiceMessage/ServiceMessage.tsx"],"sourcesContent":["import React, { useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getColor } from '../../theme/currys';\nimport { breakpoints } from '../../theme/grid';\nimport { palette } from '../../theme/palette';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { AnchorLinkTargets } from '../AnchorLink';\nimport Icon, { IconSize } from '../Icons';\nimport CheckFill from '../Icons/CheckFill';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\nimport ErrorSignFill from '../Icons/ErrorSignFill';\nimport Forward from '../Icons/Forward';\nimport InfoSignFill from '../Icons/InfoSignFill';\nimport TriangleX from '../Icons/TriangleX';\nimport X from '../Icons/X';\nimport { NotificationPanelVariants } from '../NotificationPanel';\n\nimport styles from './styles.module.scss';\n\nexport interface ServiceMessageProps {\n /** Sets a label for the notification panel. */\n label: string;\n /** String displayed in service-message when expended*/\n info?: string;\n /** String displayed in service-message when expended, with a smaller font*/\n extraInfo?: string;\n /** function that runs on dismiss */\n onDismiss?: () => void;\n /** Allows for dismiss to be an option, also for ServiceMessage with only label as content */\n dismissable?: boolean;\n /** Makes expander be open from start. */\n expanderOpenFromStart?: boolean;\n /** Name that describes a url-link for the user*/\n urlTitle?: string;\n /** Url for further information*/\n url?: string;\n /** Sets target for the anchorlink to the url*/\n target?: AnchorLinkTargets;\n /** Text on close-button in service messages. */\n closeBtnText?: string;\n /** Changes the visual representation. */\n variant?: NotificationPanelVariants;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** First of its type. Used to remove border-top */\n first?: boolean;\n}\nconst ServiceMessage: React.FC<ServiceMessageProps> = ({\n label,\n dismissable = true,\n onDismiss,\n info,\n extraInfo,\n urlTitle,\n url,\n target = '_self',\n closeBtnText = 'fjern melding',\n first = false,\n expanderOpenFromStart = false,\n variant = 'alert',\n testId,\n}: ServiceMessageProps) => {\n const hasExpander = !!info || !!extraInfo;\n\n const CustomTag = hasExpander ? 'button' : 'span';\n const breakpoint = useBreakpoint();\n const desktop = breakpoint < breakpoints.lg;\n const iconSize = desktop ? IconSize.XSmall : IconSize.Small;\n const uuid = useUuid();\n const ariaRole = variant === 'alert' ? 'alert' : 'region';\n const ariaLabelAttributes = getAriaLabelAttributes({ label, id: uuid });\n\n const [isExpanded, setIsExpanded] = useState<boolean>(expanderOpenFromStart);\n\n const variantToIconMap = {\n info: <Icon svgIcon={InfoSignFill} color={palette.blueberry700} hoverColor={palette.blueberry700} size={iconSize} />,\n warn: <Icon svgIcon={ErrorSignFill} color={palette.banana700} hoverColor={palette.banana700} size={iconSize} />,\n alert: <Icon svgIcon={TriangleX} color={palette.cherry700} hoverColor={palette.cherry700} size={iconSize} />,\n success: <Icon svgIcon={CheckFill} color={palette.kiwi900} hoverColor={palette.kiwi900} size={iconSize} />,\n };\n const topTowClasses = classNames(styles['service-message__top-row--container'], styles['service-message__wrapper--inner']);\n const topTowCloseButtonClasses = classNames(\n styles['service-message__bottom-row__button'],\n styles['service-message__bottom-row__close-button--top']\n );\n const TopRow = (): JSX.Element => {\n const hoverRefObject = useHover<HTMLButtonElement>();\n const { isHovered, hoverRef } = hoverRefObject;\n const xRef = useRef<HTMLButtonElement>(null);\n const { isHovered: xRefIsHovered } = useHover(xRef);\n return (\n <span className={topTowClasses} ref={hoverRef}>\n <span className={styles['service-message__icon--signal']}>{variantToIconMap[variant]}</span>\n <h1 className={styles['service-message__label']} id={uuid}>\n {label}\n </h1>\n {hasExpander && (\n <span className={styles['service-message__icon--expander']}>\n <Icon size={iconSize} svgIcon={isExpanded ? ChevronUp : ChevronDown} isHovered={isHovered} />\n </span>\n )}\n {!hasExpander && dismissable && (\n <button ref={xRef} className={topTowCloseButtonClasses} aria-label={closeBtnText} onClick={onDismiss}>\n <Icon size={iconSize} svgIcon={X} color={getColor('blueberry', 700)} isHovered={xRefIsHovered} />\n </button>\n )}\n </span>\n );\n };\n const tagClicked = (): void => {\n hasExpander && setIsExpanded(!isExpanded);\n };\n\n const anchorlinkClasses = classNames(styles['service-message__bottom-row__button']);\n const urlField = !!url && !!urlTitle;\n const closeButtonClasses = classNames(styles['service-message__bottom-row__button']);\n const bottomRowClasses = classNames(styles['service-message__bottom-row'], {\n [styles['service-message__bottom-row--only-close-button']]: !urlField,\n });\n const ButtonRow = (): JSX.Element => {\n const readMoreRef = useRef<HTMLAnchorElement>(null);\n const { isHovered: readMoreHoverRefIsHovered } = useHover(readMoreRef);\n const xRef = useRef<HTMLButtonElement>(null);\n const { isHovered: xRefIsHovered } = useHover(xRef);\n return (\n <div className={bottomRowClasses}>\n {urlField && (\n <a className={anchorlinkClasses} href={url} ref={readMoreRef} target={target}>\n {urlTitle}\n <Icon size={IconSize.XSmall} svgIcon={Forward} color={getColor('blueberry', 700)} isHovered={readMoreHoverRefIsHovered} />\n </a>\n )}\n\n {dismissable && (\n <button ref={xRef} className={closeButtonClasses} aria-label={closeBtnText} onClick={onDismiss}>\n {closeBtnText}\n <Icon size={IconSize.XSmall} svgIcon={X} color={getColor('blueberry', 700)} isHovered={xRefIsHovered} />\n </button>\n )}\n </div>\n );\n };\n const Content = (): JSX.Element => {\n return (\n <span className={styles['service-message__content']}>\n {!!info && <span className={styles['service-message__content__info']}>{info}</span>}\n {!!extraInfo && <span className={styles['service-message__content__info--smaller']}>{extraInfo}</span>}\n <ButtonRow />\n </span>\n );\n };\n const outerBackgroundClass = classNames({\n [styles[`service-message__outer-wrapper--${variant}`]]: variant,\n });\n const backgroundClass = classNames({\n [styles[`service-message__wrapper--${variant}`]]: variant,\n [styles[`service-message__wrapper--${variant}--expanded`]]: isExpanded && variant,\n });\n const contentWrapperClasses = classNames(styles['service-message__wrapper--inner'], styles['service-message__content__wrapper']);\n const wrapperClasses = classNames(styles['service-message__wrapper'], styles['service-message__wrapper__btn'], {\n [styles['service-message__wrapper__btn--width']]: hasExpander,\n [styles[`service-message__wrapper__border--${variant}`]]: variant,\n [styles['service-message__wrapper__btn--expanded']]: isExpanded,\n [styles['service-message__wrapper__btn--first']]: first,\n [styles['service-message__wrapper__btn--not-first']]: !first,\n });\n return (\n <div className={outerBackgroundClass}>\n <div className={backgroundClass} role={ariaRole} {...ariaLabelAttributes}>\n <CustomTag className={wrapperClasses} onClick={tagClicked} aria-expanded={hasExpander && isExpanded} data-testid={testId}>\n <TopRow />\n </CustomTag>\n {hasExpander && isExpanded && (\n <div className={styles['service-message__content--spacing']}>\n <div className={contentWrapperClasses}>\n <Content />\n </div>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default ServiceMessage;\n"],"names":["ServiceMessage","label","dismissable","onDismiss","info","extraInfo","urlTitle","url","target","closeBtnText","first","expanderOpenFromStart","variant","testId","hasExpander","CustomTag","iconSize","useBreakpoint","breakpoints","IconSize","uuid","useUuid","ariaRole","ariaLabelAttributes","getAriaLabelAttributes","isExpanded","setIsExpanded","useState","variantToIconMap","React","Icon","InfoSignFill","palette","ErrorSignFill","TriangleX","CheckFill","topTowClasses","classNames","styles","topTowCloseButtonClasses","TopRow","hoverRefObject","useHover","isHovered","hoverRef","xRef","useRef","xRefIsHovered","ChevronUp","ChevronDown","X","getColor","tagClicked","anchorlinkClasses","urlField","closeButtonClasses","bottomRowClasses","ButtonRow","readMoreRef","readMoreHoverRefIsHovered","Forward","Content","outerBackgroundClass","backgroundClass","contentWrapperClasses","wrapperClasses","ServiceMessage$1"],"mappings":"0+BAqDA,MAAMA,GAAgD,CAAC,CACrD,MAAAC,EACA,YAAAC,EAAc,GACd,UAAAC,EACA,KAAAC,EACA,UAAAC,EACA,SAAAC,EACA,IAAAC,EACA,OAAAC,EAAS,QACT,aAAAC,EAAe,gBACf,MAAAC,EAAQ,GACR,sBAAAC,EAAwB,GACxB,QAAAC,EAAU,QACV,OAAAC,CACF,IAA2B,CACzB,MAAMC,EAAc,CAAC,CAACV,GAAQ,CAAC,CAACC,EAE1BU,EAAYD,EAAc,SAAW,OAGrCE,EAFaC,IACUC,GAAY,GACdC,EAAS,OAASA,EAAS,MAChDC,EAAOC,IACPC,EAAWV,IAAY,QAAU,QAAU,SAC3CW,EAAsBC,GAAuB,CAAE,MAAAvB,EAAO,GAAImB,EAAM,EAEhE,CAACK,EAAYC,CAAa,EAAIC,EAAkBhB,CAAqB,EAErEiB,EAAmB,CACvB,KAAMC,EAAA,cAACC,EAAK,CAAA,QAASC,GAAc,MAAOC,EAAQ,aAAc,WAAYA,EAAQ,aAAc,KAAMhB,EAAU,EAClH,KAAMa,EAAA,cAACC,EAAK,CAAA,QAASG,GAAe,MAAOD,EAAQ,UAAW,WAAYA,EAAQ,UAAW,KAAMhB,EAAU,EAC7G,MAAOa,EAAA,cAACC,EA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