@helsenorge/designsystem-react 10.1.0 → 10.3.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/AnchorLink.js +2 -2
- package/AnchorLink.js.map +1 -1
- package/Avatar.js +2 -2
- package/Avatar.js.map +1 -1
- package/Badge.js +3 -3
- package/Badge.js.map +1 -1
- package/Button.js +4 -4
- package/Button.js.map +1 -1
- package/CHANGELOG.md +1392 -801
- package/Checkbox.js +2 -2
- package/Checkbox.js.map +1 -1
- package/Close.js +2 -2
- package/Close.js.map +1 -1
- package/ErrorBoundary.js +2 -2
- package/ErrorBoundary.js.map +1 -1
- package/FormGroup.js +12 -12
- package/FormGroup.js.map +1 -1
- package/FormLayout.js +3 -3
- package/FormLayout.js.map +1 -1
- package/HelpBubble.js +2 -2
- package/HelpBubble.js.map +1 -1
- package/HighlightPanel.js +2 -2
- package/HighlightPanel.js.map +1 -1
- package/Icon.js +3 -3
- package/Icon.js.map +1 -1
- package/Illustration.js +3 -3
- package/Illustration.js.map +1 -1
- package/Input.js +2 -2
- package/Input.js.map +1 -1
- package/Label.js +8 -8
- package/Label.js.map +1 -1
- package/LazyIcon.js +1 -1
- package/LazyIllustration.js +3 -3
- package/LazyIllustration.js.map +1 -1
- package/LinkList.js +6 -6
- package/LinkList.js.map +1 -1
- package/ListHeader.js +7 -7
- package/ListHeader.js.map +1 -1
- package/Panel.js +2 -2
- package/Panel.js.map +1 -1
- package/PopOver.js +2 -2
- package/PopOver.js.map +1 -1
- package/RadioButton.js +2 -2
- package/RadioButton.js.map +1 -1
- package/Select.js +2 -2
- package/Select.js.map +1 -1
- package/Slider.js +3 -3
- package/Slider.js.map +1 -1
- package/Spacer.js +2 -2
- package/Spacer.js.map +1 -1
- package/StatusDot.js +1 -1
- package/StepButtons.js +4 -4
- package/StepButtons.js.map +1 -1
- package/TabList.js +4 -4
- package/TabList.js.map +1 -1
- package/Table.js +2 -2
- package/Table.js.map +1 -1
- package/TableBody.js +2 -2
- package/TableBody.js.map +1 -1
- package/TableExpandedRow.js +2 -2
- package/TableExpandedRow.js.map +1 -1
- package/TableHead.js +2 -2
- package/TableHead.js.map +1 -1
- package/TableRow.js +2 -2
- package/TableRow.js.map +1 -1
- package/Textarea.js +2 -2
- package/Textarea.js.map +1 -1
- package/Title.js +2 -2
- package/Title.js.map +1 -1
- package/TooltipWord.js +2 -2
- package/TooltipWord.js.map +1 -1
- package/Trigger.js +3 -3
- package/Trigger.js.map +1 -1
- package/components/AnchorLink/styles.module.scss +8 -9
- package/components/Avatar/styles.module.scss +9 -9
- package/components/Badge/styles.module.scss +9 -9
- package/components/Button/styles.module.scss +68 -57
- package/components/Checkbox/styles.module.scss +103 -103
- package/components/Chip/styles.module.scss +22 -22
- package/components/Close/styles.module.scss +4 -4
- package/components/DictionaryTrigger/index.js +2 -2
- package/components/DictionaryTrigger/index.js.map +1 -1
- package/components/DictionaryTrigger/styles.module.scss +5 -5
- package/components/Drawer/Drawer.d.ts +41 -0
- package/components/Drawer/Drawer.test.d.ts +1 -0
- package/components/Drawer/index.d.ts +3 -0
- package/components/Drawer/index.js +350 -0
- package/components/Drawer/index.js.map +1 -0
- package/components/Drawer/styles.module.scss +127 -0
- package/components/Drawer/styles.module.scss.d.ts +16 -0
- package/components/Dropdown/index.js +3 -3
- package/components/Dropdown/index.js.map +1 -1
- package/components/Dropdown/styles.module.scss +51 -51
- package/components/Duolist/index.js +6 -5
- package/components/Duolist/index.js.map +1 -1
- package/components/Duolist/styles.module.scss +57 -35
- package/components/Duolist/styles.module.scss.d.ts +1 -0
- package/components/EmptyState/styles.module.scss +12 -12
- package/components/ErrorWrapper/styles.module.scss +11 -21
- package/components/ErrorWrapper/styles.module.scss.d.ts +0 -1
- package/components/Expander/styles.module.scss +46 -46
- package/components/ExpanderHierarchy/expander.module.scss +29 -29
- package/components/ExpanderHierarchy/index.js +5 -5
- package/components/ExpanderHierarchy/index.js.map +1 -1
- package/components/ExpanderHierarchy/styles.module.scss +4 -5
- package/components/ExpanderList/index.js +8 -8
- package/components/ExpanderList/index.js.map +1 -1
- package/components/ExpanderList/styles.module.scss +30 -30
- package/components/EyebrowHeader/styles.module.scss +0 -2
- package/components/FormGroup/styles.module.scss +9 -9
- package/components/FormLayout/styles.module.scss +4 -5
- package/components/HelpBubble/styles.module.scss +13 -13
- package/components/HelpPanel/styles.module.scss +2 -2
- package/components/HelpQuestion/index.js +2 -2
- package/components/HelpQuestion/index.js.map +1 -1
- package/components/HelpQuestion/styles.module.scss +19 -19
- package/components/HighlightPanel/styles.module.scss +22 -54
- package/components/HighlightPanel/styles.module.scss.d.ts +1 -2
- package/components/HorizontalScroll/styles.module.scss +4 -3
- package/components/Icons/EuropeanHealthCard.js +1 -1
- package/components/Icons/GroupTwins.js +1 -1
- package/components/Icons/Inbox.js +1 -1
- package/components/Icons/LawBook.js +1 -1
- package/components/Icons/PersonCancel.js +1 -1
- package/components/Icons/PersonWithBrain.js +1 -1
- package/components/Icons/Puzzle.js +1 -1
- package/components/Icons/Snapchat.js +1 -1
- package/components/Illustrations/IllustrationNames.d.ts +1 -1
- package/components/Illustrations/IllustrationNames.js +4 -2
- package/components/Illustrations/IllustrationNames.js.map +1 -1
- package/components/Illustrations/ReadLetters.d.ts +9 -0
- package/components/Illustrations/ReadLetters.js +11 -0
- package/components/Illustrations/ReadLetters.js.map +1 -0
- package/components/Illustrations/ReadLettersMedium.d.ts +4 -0
- package/components/Illustrations/ReadLettersMedium.js +110 -0
- package/components/Illustrations/ReadLettersMedium.js.map +1 -0
- package/components/Illustrations/Support2.d.ts +9 -0
- package/components/Illustrations/Support2.js +11 -0
- package/components/Illustrations/Support2.js.map +1 -0
- package/components/Illustrations/Support2Medium.d.ts +4 -0
- package/components/Illustrations/Support2Medium.js +232 -0
- package/components/Illustrations/Support2Medium.js.map +1 -0
- package/components/Input/styles.module.scss +12 -12
- package/components/Label/styles.module.scss +28 -24
- package/components/Label/styles.module.scss.d.ts +3 -1
- package/components/LinkList/styles.module.scss +33 -33
- package/components/List/styles.module.scss +7 -7
- package/components/ListHeader/styles.module.scss +8 -8
- package/components/Loader/styles.module.scss +14 -14
- package/components/MaxCharacters/styles.module.scss +11 -11
- package/components/Modal/index.js +71 -82
- package/components/Modal/index.js.map +1 -1
- package/components/Modal/styles.module.scss +45 -39
- package/components/NotificationPanel/index.js +3 -3
- package/components/NotificationPanel/index.js.map +1 -1
- package/components/NotificationPanel/styles.module.scss +33 -33
- package/components/Panel/styles.module.scss +45 -45
- package/components/PanelList/index.js +5 -5
- package/components/PanelList/index.js.map +1 -1
- package/components/PanelList/styles.module.scss +5 -5
- package/components/PopMenu/index.js +5 -5
- package/components/PopMenu/index.js.map +1 -1
- package/components/PopMenu/styles.module.scss +15 -15
- package/components/PopOver/styles.module.scss +13 -14
- package/components/PopOver/styles.module.scss.d.ts +0 -3
- package/components/Portal/index.js +3 -3
- package/components/Portal/index.js.map +1 -1
- package/components/Progressbar/styles.module.scss +4 -4
- package/components/PromoPanel/index.js +2 -2
- package/components/PromoPanel/index.js.map +1 -1
- package/components/PromoPanel/styles.module.scss +22 -22
- package/components/RadioButton/styles.module.scss +99 -99
- package/components/Select/styles.module.scss +21 -21
- package/components/ServiceMessage/styles.module.scss +49 -49
- package/components/SharingStatus/styles.module.scss +13 -13
- package/components/Slider/styles.module.scss +24 -24
- package/components/Spacer/styles.module.scss +14 -14
- package/components/StatusDot/styles.module.scss +22 -22
- package/components/Step/styles.module.scss +3 -3
- package/components/StepButtons/styles.module.scss +9 -9
- package/components/Stepper/styles.module.scss +23 -15
- package/components/StickyNote/styles.module.scss +3 -3
- package/components/Table/styles.module.scss +32 -32
- package/components/Tabs/TabList/styles.module.scss +1 -1
- package/components/Tabs/TabPanel/styles.module.scss +5 -5
- package/components/Tabs/index.js +3 -3
- package/components/Tabs/index.js.map +1 -1
- package/components/Tabs/styles.module.scss +1 -1
- package/components/Tag/styles.module.scss +16 -16
- package/components/TagList/index.js +2 -2
- package/components/TagList/index.js.map +1 -1
- package/components/TagList/styles.module.scss +4 -4
- package/components/Textarea/styles.module.scss +9 -9
- package/components/Tile/index.js +6 -6
- package/components/Tile/index.js.map +1 -1
- package/components/Tile/styles.module.scss +25 -25
- package/components/Title/styles.module.scss +8 -8
- package/components/Toggle/index.js +3 -3910
- package/components/Toggle/index.js.map +1 -1
- package/components/Toggle/styles.module.scss +14 -14
- package/components/Tooltip/TooltipWord/styles.module.scss +4 -4
- package/components/Tooltip/index.js +2 -2
- package/components/Tooltip/index.js.map +1 -1
- package/components/Trigger/styles.module.scss +21 -21
- package/components/Validation/index.js +6 -6
- package/components/Validation/index.js.map +1 -1
- package/components/Validation/styles.module.scss +10 -10
- package/constants.d.ts +1 -0
- package/constants.js +1 -0
- package/constants.js.map +1 -1
- package/hoc/withBreakpoint/withBreakpoint.js +2 -2
- package/hoc/withBreakpoint/withBreakpoint.js.map +1 -1
- package/hooks/useBreakpoint.d.ts +0 -4
- package/hooks/useBreakpoint.js +23 -18
- package/hooks/useBreakpoint.js.map +1 -1
- package/hooks/useEventListenerState.js +3 -3
- package/hooks/useEventListenerState.js.map +1 -1
- package/hooks/useReturnFocusOnUnmount.d.ts +5 -0
- package/hooks/useReturnFocusOnUnmount.js +20 -0
- package/hooks/useReturnFocusOnUnmount.js.map +1 -0
- package/package.json +1 -1
- package/scss/_body.scss +5 -6
- package/scss/_breakpoints.scss +8 -2
- package/scss/_font-mixins.scss +57 -2
- package/scss/_fonts.scss +0 -2
- package/scss/_input.scss +53 -50
- package/scss/_print.scss +2 -2
- package/scss/layout.module.scss +2 -2
- package/scss/typography.module.scss +62 -37
- package/scss/typography.module.scss.d.ts +6 -0
- package/scss/typography.stories.tsx +24 -0
- package/theme/index.js +2 -2
- package/use-animate.js +3952 -0
- package/use-animate.js.map +1 -0
- package/utils/accessibility.d.ts +1 -0
- package/utils/accessibility.js +6 -1
- package/utils/accessibility.js.map +1 -1
- package/utils/component.js +4 -4
- package/utils/component.js.map +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@
|
|
2
|
+
@use '../../scss/spacers' as spacers;
|
|
3
|
+
@use '../../scss/palette' as palette;
|
|
4
|
+
@use '../../scss/font-settings' as font-settings;
|
|
5
|
+
@use '../../scss/breakpoints' as *;
|
|
6
6
|
|
|
7
7
|
@mixin panel-padding {
|
|
8
|
-
padding: getSpacer(s);
|
|
8
|
+
padding: spacers.getSpacer(s);
|
|
9
9
|
|
|
10
10
|
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
11
|
-
padding: getSpacer(l) getSpacer(m) getSpacer(l) getSpacer(l);
|
|
11
|
+
padding: spacers.getSpacer(l) spacers.getSpacer(m) spacers.getSpacer(l) spacers.getSpacer(l);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
@mixin panel-padding-icon {
|
|
16
|
-
padding: getSpacer(m) getSpacer(s) getSpacer(l);
|
|
16
|
+
padding: spacers.getSpacer(m) spacers.getSpacer(s) spacers.getSpacer(l);
|
|
17
17
|
|
|
18
18
|
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
19
|
-
padding: getSpacer(m) getSpacer(m) getSpacer(l);
|
|
19
|
+
padding: spacers.getSpacer(m) spacers.getSpacer(m) spacers.getSpacer(l);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
$layout-sm-gap: getSpacer(s);
|
|
34
|
-
$layout-md-col-gap: getSpacer(m);
|
|
33
|
+
$layout-sm-gap: spacers.getSpacer(s);
|
|
34
|
+
$layout-md-col-gap: spacers.getSpacer(m);
|
|
35
35
|
|
|
36
36
|
.panel-wrapper {
|
|
37
37
|
width: 100%;
|
|
@@ -173,13 +173,13 @@ $layout-md-col-gap: getSpacer(m);
|
|
|
173
173
|
&--layout-2 {
|
|
174
174
|
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
175
175
|
grid-row: span 2;
|
|
176
|
-
padding-right: getSpacer(2xs);
|
|
176
|
+
padding-right: spacers.getSpacer(2xs);
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
181
181
|
grid-row: span 2;
|
|
182
|
-
padding-right: getSpacer(2xs);
|
|
182
|
+
padding-right: spacers.getSpacer(2xs);
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
&--layout-3 {
|
|
@@ -234,63 +234,63 @@ $layout-md-col-gap: getSpacer(m);
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
&--fill {
|
|
237
|
-
background-color:
|
|
237
|
+
background-color: palette.$neutral50;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
&--fill#{&}--selected {
|
|
241
|
-
background-color:
|
|
241
|
+
background-color: palette.$neutral100;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
&--fill#{&}--selected#{&}--clickable {
|
|
245
245
|
&:hover {
|
|
246
|
-
background-color:
|
|
246
|
+
background-color: palette.$neutral200;
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
&--white {
|
|
251
|
-
background-color:
|
|
251
|
+
background-color: palette.$white;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
&--fill#{&}--clickable,
|
|
255
255
|
&--white#{&}--clickable {
|
|
256
|
-
@include hover-and-focus-effects(
|
|
256
|
+
@include hover-and-focus-effects(palette.$neutral100, palette.$neutral600);
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
&--white#{&}--selected {
|
|
260
|
-
box-shadow: inset 0 0 0 6px
|
|
260
|
+
box-shadow: inset 0 0 0 6px palette.$neutral100;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
&--stroke {
|
|
264
|
-
border: 6px solid
|
|
264
|
+
border: 6px solid palette.$neutral100;
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
&--stroke#{&}--clickable {
|
|
268
|
-
@include hover-and-focus-effects(
|
|
268
|
+
@include hover-and-focus-effects(palette.$neutral50, palette.$neutral100);
|
|
269
269
|
|
|
270
270
|
&:focus {
|
|
271
|
-
border-color:
|
|
271
|
+
border-color: palette.$neutral600;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
&--line {
|
|
276
|
-
background-color:
|
|
277
|
-
border-color:
|
|
276
|
+
background-color: palette.$white;
|
|
277
|
+
border-color: palette.$neutral500;
|
|
278
278
|
border-top: 1px solid;
|
|
279
279
|
border-bottom: 1px solid;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
&--line#{&}--clickable {
|
|
283
|
-
@include hover-and-focus-effects(
|
|
283
|
+
@include hover-and-focus-effects(palette.$neutral50, palette.$neutral600);
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
&--line#{&}--selected {
|
|
287
|
-
background-color:
|
|
287
|
+
background-color: palette.$neutral50;
|
|
288
288
|
border-bottom: 0;
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
&--line#{&}--selected#{&}--clickable {
|
|
292
292
|
&:hover {
|
|
293
|
-
background-color:
|
|
293
|
+
background-color: palette.$neutral100;
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
|
|
@@ -316,26 +316,26 @@ $layout-md-col-gap: getSpacer(m);
|
|
|
316
316
|
|
|
317
317
|
&--new {
|
|
318
318
|
&::before {
|
|
319
|
-
border-left-color:
|
|
319
|
+
border-left-color: palette.$blueberry600;
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
&--draft {
|
|
324
324
|
&::before {
|
|
325
325
|
border-left-style: dashed;
|
|
326
|
-
border-left-color:
|
|
326
|
+
border-left-color: palette.$neutral500;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
&--error {
|
|
331
331
|
&::before {
|
|
332
|
-
border-left-color:
|
|
332
|
+
border-left-color: palette.$cherry500;
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
.title-container {
|
|
338
|
-
padding-bottom: getSpacer(s);
|
|
338
|
+
padding-bottom: spacers.getSpacer(s);
|
|
339
339
|
|
|
340
340
|
&--no-content-a {
|
|
341
341
|
padding-bottom: 0;
|
|
@@ -346,7 +346,7 @@ $layout-md-col-gap: getSpacer(m);
|
|
|
346
346
|
display: inline;
|
|
347
347
|
|
|
348
348
|
&--badge {
|
|
349
|
-
padding-right: getSpacer(2xs);
|
|
349
|
+
padding-right: spacers.getSpacer(2xs);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
|
|
@@ -358,7 +358,7 @@ $layout-md-col-gap: getSpacer(m);
|
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
.panel-details {
|
|
361
|
-
background-color:
|
|
361
|
+
background-color: palette.$neutral50;
|
|
362
362
|
display: none;
|
|
363
363
|
|
|
364
364
|
@include panel-padding;
|
|
@@ -374,30 +374,30 @@ $layout-md-col-gap: getSpacer(m);
|
|
|
374
374
|
}
|
|
375
375
|
|
|
376
376
|
&--line {
|
|
377
|
-
background:
|
|
378
|
-
border-bottom: 1px solid
|
|
377
|
+
background: palette.$white;
|
|
378
|
+
border-bottom: 1px solid palette.$neutral500;
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
&--white {
|
|
382
|
-
background:
|
|
382
|
+
background: palette.$white;
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
.status-message {
|
|
387
|
-
font-size:
|
|
388
|
-
color:
|
|
387
|
+
font-size: font-settings.$font-size-sm;
|
|
388
|
+
color: palette.$cherry500;
|
|
389
389
|
display: flex;
|
|
390
|
-
margin-bottom: getSpacer(2xs) * -1;
|
|
390
|
+
margin-bottom: spacers.getSpacer(2xs) * -1;
|
|
391
391
|
grid-column: 1 / -1;
|
|
392
392
|
|
|
393
393
|
span {
|
|
394
394
|
padding-left: 5px;
|
|
395
395
|
align-self: center;
|
|
396
|
-
font-size:
|
|
396
|
+
font-size: font-settings.$font-size-sm;
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
&--new {
|
|
400
|
-
color:
|
|
400
|
+
color: palette.$blueberry800;
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
|
|
@@ -410,24 +410,24 @@ $layout-md-col-gap: getSpacer(m);
|
|
|
410
410
|
flex-direction: column;
|
|
411
411
|
|
|
412
412
|
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
413
|
-
padding-top: getSpacer(xs);
|
|
413
|
+
padding-top: spacers.getSpacer(xs);
|
|
414
414
|
flex-direction: row;
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
&__icon {
|
|
418
418
|
display: flex;
|
|
419
419
|
align-items: center;
|
|
420
|
-
padding-bottom: getSpacer(2xs);
|
|
420
|
+
padding-bottom: spacers.getSpacer(2xs);
|
|
421
421
|
|
|
422
422
|
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
423
423
|
padding-top: 0;
|
|
424
|
-
padding-right: getSpacer(m);
|
|
424
|
+
padding-right: spacers.getSpacer(m);
|
|
425
425
|
padding-bottom: 0;
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
span {
|
|
429
|
-
padding-left: getSpacer(2xs);
|
|
430
|
-
font-size:
|
|
429
|
+
padding-left: spacers.getSpacer(2xs);
|
|
430
|
+
font-size: font-settings.$font-size-sm;
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
433
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { AnalyticsId } from "../../constants.js";
|
|
5
5
|
import { b as PanelVariant, P as Panel } from "../../Panel.js";
|
|
6
6
|
import styles from "./styles.module.scss";
|
|
7
|
-
const isPanelComponent = (element) =>
|
|
8
|
-
const PanelList =
|
|
7
|
+
const isPanelComponent = (element) => React__default.isValidElement(element) && element.type === Panel;
|
|
8
|
+
const PanelList = React__default.forwardRef(function BadgeForwardedRef(props, ref) {
|
|
9
9
|
const { testId, children, variant = PanelVariant.fill } = props;
|
|
10
|
-
const renderPanel = (panel, firstChild) =>
|
|
10
|
+
const renderPanel = (panel, firstChild) => React__default.cloneElement(panel, {
|
|
11
11
|
variant,
|
|
12
12
|
noTopBorder: variant === PanelVariant.line && !firstChild,
|
|
13
13
|
className: classNames(panel.props.className, variant !== PanelVariant.line && styles["panel-list__panel"])
|
|
14
14
|
});
|
|
15
|
-
return /* @__PURE__ */ jsx("div", { ref, "data-testid": testId, "data-analyticsid": AnalyticsId.PanelList, children:
|
|
15
|
+
return /* @__PURE__ */ jsx("div", { ref, "data-testid": testId, "data-analyticsid": AnalyticsId.PanelList, children: React__default.Children.map(children, (child, index) => isPanelComponent(child) ? renderPanel(child, index === 0) : child) });
|
|
16
16
|
});
|
|
17
17
|
export {
|
|
18
18
|
PanelList as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/PanelList/PanelList.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport Panel, { PanelProps, PanelVariant } from '../Panel';\n\nimport styles from './styles.module.scss';\n\nexport interface PanelListProps {\n /** Panels to render inside the PanelList */\n children?: React.ReactNode;\n /** Changes the visual representation of the panel. Default: fill */\n variant?: keyof typeof PanelVariant;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst isPanelComponent = (element: {} | null | undefined): element is React.ReactElement<PanelProps> =>\n React.isValidElement<PanelProps>(element) && (element as React.ReactElement).type === Panel;\n\nconst PanelList = React.forwardRef(function BadgeForwardedRef(props: PanelListProps, ref: React.ForwardedRef<HTMLDivElement>) {\n const { testId, children, variant = PanelVariant.fill } = props;\n\n const renderPanel = (panel: React.ReactElement<PanelProps>, firstChild: boolean) =>\n React.cloneElement(panel, {\n variant: variant,\n noTopBorder: variant === PanelVariant.line && !firstChild,\n className: classNames(panel.props.className, variant !== PanelVariant.line && styles['panel-list__panel']),\n });\n\n return (\n <div ref={ref} data-testid={testId} data-analyticsid={AnalyticsId.PanelList}>\n {React.Children.map(children, (child, index) => (isPanelComponent(child) ? renderPanel(child, index === 0) : child))}\n </div>\n );\n});\n\nexport default PanelList;\n"],"names":[],"mappings":";;;;;;AAkBA,MAAM,mBAAmB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/PanelList/PanelList.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport Panel, { PanelProps, PanelVariant } from '../Panel';\n\nimport styles from './styles.module.scss';\n\nexport interface PanelListProps {\n /** Panels to render inside the PanelList */\n children?: React.ReactNode;\n /** Changes the visual representation of the panel. Default: fill */\n variant?: keyof typeof PanelVariant;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst isPanelComponent = (element: {} | null | undefined): element is React.ReactElement<PanelProps> =>\n React.isValidElement<PanelProps>(element) && (element as React.ReactElement).type === Panel;\n\nconst PanelList = React.forwardRef(function BadgeForwardedRef(props: PanelListProps, ref: React.ForwardedRef<HTMLDivElement>) {\n const { testId, children, variant = PanelVariant.fill } = props;\n\n const renderPanel = (panel: React.ReactElement<PanelProps>, firstChild: boolean) =>\n React.cloneElement(panel, {\n variant: variant,\n noTopBorder: variant === PanelVariant.line && !firstChild,\n className: classNames(panel.props.className, variant !== PanelVariant.line && styles['panel-list__panel']),\n });\n\n return (\n <div ref={ref} data-testid={testId} data-analyticsid={AnalyticsId.PanelList}>\n {React.Children.map(children, (child, index) => (isPanelComponent(child) ? renderPanel(child, index === 0) : child))}\n </div>\n );\n});\n\nexport default PanelList;\n"],"names":["React"],"mappings":";;;;;;AAkBA,MAAM,mBAAmB,CAAC,YACxBA,eAAM,eAA2B,OAAO,KAAM,QAA+B,SAAS;AAExF,MAAM,YAAYA,eAAM,WAAW,SAAS,kBAAkB,OAAuB,KAAyC;AAC5H,QAAM,EAAE,QAAQ,UAAU,UAAU,aAAa,SAAS;AAE1D,QAAM,cAAc,CAAC,OAAuC,eAC1DA,eAAM,aAAa,OAAO;AAAA,IACxB;AAAA,IACA,aAAa,YAAY,aAAa,QAAQ,CAAC;AAAA,IAC/C,WAAW,WAAW,MAAM,MAAM,WAAW,YAAY,aAAa,QAAQ,OAAO,mBAAmB,CAAC;AAAA,EAAA,CAC1G;AAGD,SAAA,oBAAC,OAAI,EAAA,KAAU,eAAa,QAAQ,oBAAkB,YAAY,WAC/D,UAAMA,eAAA,SAAS,IAAI,UAAU,CAAC,OAAO,UAAW,iBAAiB,KAAK,IAAI,YAAY,OAAO,UAAU,CAAC,IAAI,KAAM,EACrH,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
2
|
+
@use '../../scss/spacers' as spacers;
|
|
3
|
+
@use '../../scss/palette' as palette;
|
|
4
|
+
@use '../../scss/breakpoints' as *;
|
|
5
5
|
|
|
6
6
|
.panel-list {
|
|
7
7
|
&__panel:not(:last-child) {
|
|
8
|
-
margin-bottom: getSpacer(2xs);
|
|
8
|
+
margin-bottom: spacers.getSpacer(2xs);
|
|
9
9
|
|
|
10
10
|
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
11
|
-
margin-bottom: getSpacer(s);
|
|
11
|
+
margin-bottom: spacers.getSpacer(s);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useRef, useState } from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { IconSize, AnalyticsId } from "../../constants.js";
|
|
5
5
|
import { useBreakpoint } from "../../hooks/useBreakpoint.js";
|
|
@@ -71,12 +71,12 @@ const PopMenu = (props) => {
|
|
|
71
71
|
arrowClassName: styles["pop-menu__pop-over-arrow"],
|
|
72
72
|
controllerRef: iconRef,
|
|
73
73
|
popOverRef,
|
|
74
|
-
children:
|
|
74
|
+
children: React__default.Children.map(
|
|
75
75
|
children,
|
|
76
|
-
(child) =>
|
|
77
|
-
children:
|
|
76
|
+
(child) => React__default.cloneElement(child, {
|
|
77
|
+
children: React__default.Children.map(
|
|
78
78
|
child.props.children,
|
|
79
|
-
(child2) => isComponent(child2, LinkList.Link) ?
|
|
79
|
+
(child2) => isComponent(child2, LinkList.Link) ? React__default.cloneElement(child2, {
|
|
80
80
|
onClick: (event) => handleClick(() => child2.props.onClick && child2.props.onClick(event))
|
|
81
81
|
}) : child2
|
|
82
82
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/PopMenu/PopMenu.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { useOutsideEvent } from '../../hooks/useOutsideEvent';\nimport { getColor } from '../../theme/currys';\nimport { breakpoints } from '../../theme/grid';\nimport { isComponent } from '../../utils/component';\nimport Icon, { SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport VerticalDots from '../Icons/VerticalDots';\nimport X from '../Icons/X';\nimport LazyIcon from '../LazyIcon';\nimport LinkList, { LinkListProps, LinkProps } from '../LinkList';\nimport PopOver from '../PopOver';\n\nimport styles from './styles.module.scss';\n\nexport enum PopMenuVariant {\n onWhite = 'on-white',\n onGray = 'on-gray',\n onBlueberry = 'on-blueberry',\n}\n\nexport enum PopMenuLabelPosition {\n right = 'right',\n left = 'left',\n}\n\nexport interface PopMenuProps {\n /** Content shown inside PopOver. Can only be a LinkList */\n children: React.ReactElement<LinkListProps>;\n /** Adds custom classes to the popover element. */\n popOverClassName?: string;\n /** Adds custom classes to the element. */\n popMenuClassName?: string;\n /** Changes responsive design for the trigger buttons. */\n popMenuVariant?: PopMenuVariant;\n /** Sets the data-testid attribute for the button that opens. */\n openButtonTestId?: string;\n /** Sets the data-testid attribute for the button that closes. */\n closeButtonTestId?: string;\n /** Sets the data-testid attribute for the popover. */\n popOverTestId?: string;\n /** Sets the arial-label attribute for the openButton. */\n openButtonAriaLabel?: string;\n /** Sets the arial-label attribute for the closeButton. */\n closeButtonAriaLabel?: string;\n /** Sets the icon on the trigger button. */\n svgIcon?: SvgIcon | IconName;\n /** Optional text next to the trigger button. */\n labelText?: string;\n /** Placement of the label text relative to the trigger button. */\n labelTextPosition?: PopMenuLabelPosition;\n}\n\nexport const PopMenu: React.FC<PopMenuProps> = (props: PopMenuProps) => {\n const triggerButtonRef = useRef<HTMLButtonElement>(null);\n const iconRef = useRef<HTMLDivElement>(null);\n const popOverRef = useRef<HTMLDivElement>(null);\n const outerRef = useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const {\n children,\n popOverClassName,\n popMenuClassName,\n openButtonTestId,\n closeButtonTestId,\n popOverTestId,\n popMenuVariant = PopMenuVariant.onWhite,\n openButtonAriaLabel,\n closeButtonAriaLabel,\n svgIcon,\n labelText,\n labelTextPosition = PopMenuLabelPosition.right,\n } = props;\n const buttonClasses = classNames(styles['pop-menu-button'], {\n [styles[`pop-menu-button--${popMenuVariant}`]]: popMenuVariant,\n });\n const breakpoint = useBreakpoint();\n const mobile = breakpoint < breakpoints.md;\n\n useOutsideEvent(outerRef, () => {\n setIsOpen(false);\n });\n\n const { isHovered: triggerButtonIsHovered } = useHover(triggerButtonRef);\n const mobileIconSize = mobile ? IconSize.XSmall : IconSize.Small;\n\n const handleClick = (cb?: () => void): void => {\n setIsOpen(false);\n cb && cb();\n };\n\n const renderChildren = () => {\n if (isComponent<LinkListProps>(children, LinkList)) {\n return (\n <PopOver\n testId={popOverTestId}\n className={classNames(styles['pop-menu__pop-over'], popOverClassName)}\n arrowClassName={styles['pop-menu__pop-over-arrow']}\n controllerRef={iconRef}\n popOverRef={popOverRef}\n >\n {React.Children.map(children, child =>\n React.cloneElement(child, {\n children: React.Children.map(child.props.children, child =>\n isComponent<LinkProps>(child, LinkList.Link)\n ? React.cloneElement(child, {\n onClick: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) =>\n handleClick(() => child.props.onClick && child.props.onClick(event)),\n })\n : child\n ),\n })\n )}\n </PopOver>\n );\n }\n };\n\n const toggleOpenOnClick = (e?: React.MouseEvent<HTMLElement, MouseEvent>): void => {\n e && e.stopPropagation();\n setIsOpen(!isOpen);\n };\n\n const iconComponent =\n svgIcon && typeof svgIcon === 'string' ? (\n <LazyIcon iconName={svgIcon} size={IconSize.XSmall} isHovered={triggerButtonIsHovered} />\n ) : (\n svgIcon && <Icon svgIcon={svgIcon} size={IconSize.XSmall} isHovered={triggerButtonIsHovered} />\n );\n\n const openIcon = svgIcon ? (\n iconComponent\n ) : (\n <Icon svgIcon={svgIcon ?? VerticalDots} color={getColor('black')} size={mobileIconSize} isHovered={triggerButtonIsHovered} />\n );\n\n const closeIcon = <Icon svgIcon={X} color={getColor('black')} size={mobileIconSize} isHovered={triggerButtonIsHovered} />;\n\n const triggerButton = (\n <button\n ref={triggerButtonRef}\n data-testid={isOpen ? closeButtonTestId : openButtonTestId}\n className={buttonClasses}\n aria-label={isOpen ? closeButtonAriaLabel : openButtonAriaLabel}\n aria-expanded={isOpen}\n onClick={toggleOpenOnClick}\n type=\"button\"\n >\n {labelText && labelTextPosition == PopMenuLabelPosition.left && <span>{labelText}</span>}\n {<div ref={iconRef}>{isOpen ? closeIcon : openIcon}</div>}\n {labelText && labelTextPosition == PopMenuLabelPosition.right && <span>{labelText}</span>}\n </button>\n );\n\n return (\n <div ref={outerRef} className={classNames(styles['pop-menu-button'], popMenuClassName)} data-analyticsid={AnalyticsId.PopMenu}>\n {triggerButton}\n {isOpen && renderChildren()}\n </div>\n );\n};\n\nexport default PopMenu;\n"],"names":["PopMenuVariant","PopMenuLabelPosition","child"],"mappings":";;;;;;;;;;;;;;;;;AAqBY,IAAA,mCAAAA,oBAAL;AACLA,kBAAA,SAAU,IAAA;AACVA,kBAAA,QAAS,IAAA;AACTA,kBAAA,aAAc,IAAA;AAHJA,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAMA,IAAA,yCAAAC,0BAAL;AACLA,wBAAA,OAAQ,IAAA;AACRA,wBAAA,MAAO,IAAA;AAFGA,SAAAA;AAAA,GAAA,wBAAA,CAAA,CAAA;AAgCC,MAAA,UAAkC,CAAC,UAAwB;AAChE,QAAA,mBAAmB,OAA0B,IAAI;AACjD,QAAA,UAAU,OAAuB,IAAI;AACrC,QAAA,aAAa,OAAuB,IAAI;AACxC,QAAA,WAAW,OAAuB,IAAI;AAC5C,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AACpC,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,oBAAoB;AAAA;AAAA,EAAA,IAClB;AACJ,QAAM,gBAAgB,WAAW,OAAO,iBAAiB,GAAG;AAAA,IAC1D,CAAC,OAAO,oBAAoB,cAAc,EAAE,CAAC,GAAG;AAAA,EAAA,CACjD;AACD,QAAM,aAAa,cAAc;AAC3B,QAAA,SAAS,aAAa,YAAY;AAExC,kBAAgB,UAAU,MAAM;AAC9B,cAAU,KAAK;AAAA,EAAA,CAChB;AAED,QAAM,EAAE,WAAW,2BAA2B,SAAS,gBAAgB;AACvE,QAAM,iBAAiB,SAAS,SAAS,SAAS,SAAS;AAErD,QAAA,cAAc,CAAC,OAA0B;AAC7C,cAAU,KAAK;AACf,UAAM,GAAG;AAAA,EACX;AAEA,QAAM,iBAAiB,MAAM;AACvB,QAAA,YAA2B,UAAU,QAAQ,GAAG;AAEhD,aAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,QAAQ;AAAA,UACR,WAAW,WAAW,OAAO,oBAAoB,GAAG,gBAAgB;AAAA,UACpE,gBAAgB,OAAO,0BAA0B;AAAA,UACjD,eAAe;AAAA,UACf;AAAA,UAEC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/PopMenu/PopMenu.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { useOutsideEvent } from '../../hooks/useOutsideEvent';\nimport { getColor } from '../../theme/currys';\nimport { breakpoints } from '../../theme/grid';\nimport { isComponent } from '../../utils/component';\nimport Icon, { SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport VerticalDots from '../Icons/VerticalDots';\nimport X from '../Icons/X';\nimport LazyIcon from '../LazyIcon';\nimport LinkList, { LinkListProps, LinkProps } from '../LinkList';\nimport PopOver from '../PopOver';\n\nimport styles from './styles.module.scss';\n\nexport enum PopMenuVariant {\n onWhite = 'on-white',\n onGray = 'on-gray',\n onBlueberry = 'on-blueberry',\n}\n\nexport enum PopMenuLabelPosition {\n right = 'right',\n left = 'left',\n}\n\nexport interface PopMenuProps {\n /** Content shown inside PopOver. Can only be a LinkList */\n children: React.ReactElement<LinkListProps>;\n /** Adds custom classes to the popover element. */\n popOverClassName?: string;\n /** Adds custom classes to the element. */\n popMenuClassName?: string;\n /** Changes responsive design for the trigger buttons. */\n popMenuVariant?: PopMenuVariant;\n /** Sets the data-testid attribute for the button that opens. */\n openButtonTestId?: string;\n /** Sets the data-testid attribute for the button that closes. */\n closeButtonTestId?: string;\n /** Sets the data-testid attribute for the popover. */\n popOverTestId?: string;\n /** Sets the arial-label attribute for the openButton. */\n openButtonAriaLabel?: string;\n /** Sets the arial-label attribute for the closeButton. */\n closeButtonAriaLabel?: string;\n /** Sets the icon on the trigger button. */\n svgIcon?: SvgIcon | IconName;\n /** Optional text next to the trigger button. */\n labelText?: string;\n /** Placement of the label text relative to the trigger button. */\n labelTextPosition?: PopMenuLabelPosition;\n}\n\nexport const PopMenu: React.FC<PopMenuProps> = (props: PopMenuProps) => {\n const triggerButtonRef = useRef<HTMLButtonElement>(null);\n const iconRef = useRef<HTMLDivElement>(null);\n const popOverRef = useRef<HTMLDivElement>(null);\n const outerRef = useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const {\n children,\n popOverClassName,\n popMenuClassName,\n openButtonTestId,\n closeButtonTestId,\n popOverTestId,\n popMenuVariant = PopMenuVariant.onWhite,\n openButtonAriaLabel,\n closeButtonAriaLabel,\n svgIcon,\n labelText,\n labelTextPosition = PopMenuLabelPosition.right,\n } = props;\n const buttonClasses = classNames(styles['pop-menu-button'], {\n [styles[`pop-menu-button--${popMenuVariant}`]]: popMenuVariant,\n });\n const breakpoint = useBreakpoint();\n const mobile = breakpoint < breakpoints.md;\n\n useOutsideEvent(outerRef, () => {\n setIsOpen(false);\n });\n\n const { isHovered: triggerButtonIsHovered } = useHover(triggerButtonRef);\n const mobileIconSize = mobile ? IconSize.XSmall : IconSize.Small;\n\n const handleClick = (cb?: () => void): void => {\n setIsOpen(false);\n cb && cb();\n };\n\n const renderChildren = () => {\n if (isComponent<LinkListProps>(children, LinkList)) {\n return (\n <PopOver\n testId={popOverTestId}\n className={classNames(styles['pop-menu__pop-over'], popOverClassName)}\n arrowClassName={styles['pop-menu__pop-over-arrow']}\n controllerRef={iconRef}\n popOverRef={popOverRef}\n >\n {React.Children.map(children, child =>\n React.cloneElement(child, {\n children: React.Children.map(child.props.children, child =>\n isComponent<LinkProps>(child, LinkList.Link)\n ? React.cloneElement(child, {\n onClick: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) =>\n handleClick(() => child.props.onClick && child.props.onClick(event)),\n })\n : child\n ),\n })\n )}\n </PopOver>\n );\n }\n };\n\n const toggleOpenOnClick = (e?: React.MouseEvent<HTMLElement, MouseEvent>): void => {\n e && e.stopPropagation();\n setIsOpen(!isOpen);\n };\n\n const iconComponent =\n svgIcon && typeof svgIcon === 'string' ? (\n <LazyIcon iconName={svgIcon} size={IconSize.XSmall} isHovered={triggerButtonIsHovered} />\n ) : (\n svgIcon && <Icon svgIcon={svgIcon} size={IconSize.XSmall} isHovered={triggerButtonIsHovered} />\n );\n\n const openIcon = svgIcon ? (\n iconComponent\n ) : (\n <Icon svgIcon={svgIcon ?? VerticalDots} color={getColor('black')} size={mobileIconSize} isHovered={triggerButtonIsHovered} />\n );\n\n const closeIcon = <Icon svgIcon={X} color={getColor('black')} size={mobileIconSize} isHovered={triggerButtonIsHovered} />;\n\n const triggerButton = (\n <button\n ref={triggerButtonRef}\n data-testid={isOpen ? closeButtonTestId : openButtonTestId}\n className={buttonClasses}\n aria-label={isOpen ? closeButtonAriaLabel : openButtonAriaLabel}\n aria-expanded={isOpen}\n onClick={toggleOpenOnClick}\n type=\"button\"\n >\n {labelText && labelTextPosition == PopMenuLabelPosition.left && <span>{labelText}</span>}\n {<div ref={iconRef}>{isOpen ? closeIcon : openIcon}</div>}\n {labelText && labelTextPosition == PopMenuLabelPosition.right && <span>{labelText}</span>}\n </button>\n );\n\n return (\n <div ref={outerRef} className={classNames(styles['pop-menu-button'], popMenuClassName)} data-analyticsid={AnalyticsId.PopMenu}>\n {triggerButton}\n {isOpen && renderChildren()}\n </div>\n );\n};\n\nexport default PopMenu;\n"],"names":["PopMenuVariant","PopMenuLabelPosition","React","child"],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@
|
|
3
|
-
@
|
|
2
|
+
@use '../../scss/palette' as palette;
|
|
3
|
+
@use '../../scss/breakpoints' as *;
|
|
4
4
|
|
|
5
5
|
.pop-menu-button {
|
|
6
6
|
padding: 0;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
min-width: 3rem;
|
|
15
15
|
|
|
16
16
|
&:focus {
|
|
17
|
-
border: 0.1875rem solid
|
|
17
|
+
border: 0.1875rem solid palette.$black;
|
|
18
18
|
box-shadow: none;
|
|
19
19
|
outline: none;
|
|
20
20
|
}
|
|
@@ -40,12 +40,12 @@ html :focus > .pop-menu-button {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
&:active {
|
|
43
|
-
background-color:
|
|
43
|
+
background-color: palette.$neutral50;
|
|
44
44
|
border: none;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
&:hover {
|
|
48
|
-
background-color:
|
|
48
|
+
background-color: palette.$neutral50;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
&:active:hover {
|
|
@@ -53,8 +53,8 @@ html :focus > .pop-menu-button {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
&:active:focus {
|
|
56
|
-
background-color:
|
|
57
|
-
border: 0.1875rem solid
|
|
56
|
+
background-color: palette.$neutral50;
|
|
57
|
+
border: 0.1875rem solid palette.$black;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -64,12 +64,12 @@ html :focus > .pop-menu-button {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
&:active {
|
|
67
|
-
background-color:
|
|
67
|
+
background-color: palette.$neutral100;
|
|
68
68
|
border: none;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
&:hover {
|
|
72
|
-
background-color:
|
|
72
|
+
background-color: palette.$neutral100;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
&:active:hover {
|
|
@@ -77,8 +77,8 @@ html :focus > .pop-menu-button {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
&:active:focus {
|
|
80
|
-
background-color:
|
|
81
|
-
border: 0.1875rem solid
|
|
80
|
+
background-color: palette.$neutral100;
|
|
81
|
+
border: 0.1875rem solid palette.$black;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -88,12 +88,12 @@ html :focus > .pop-menu-button {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
&:active {
|
|
91
|
-
background-color:
|
|
91
|
+
background-color: palette.$blueberry100;
|
|
92
92
|
border: none;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
&:hover {
|
|
96
|
-
background-color:
|
|
96
|
+
background-color: palette.$blueberry100;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
&:active:hover {
|
|
@@ -101,8 +101,8 @@ html :focus > .pop-menu-button {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
&:active:focus {
|
|
104
|
-
background-color:
|
|
105
|
-
border: 0.1875rem solid
|
|
104
|
+
background-color: palette.$blueberry100;
|
|
105
|
+
border: 0.1875rem solid palette.$black;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
@import '../AnchorLink/styles.module';
|
|
2
|
+
@use '../../scss/spacers' as spacers;
|
|
3
|
+
@use '../../scss/palette' as palette;
|
|
4
|
+
@use '../../scss/font-settings' as font-settings;
|
|
5
|
+
@use '../../scss/breakpoints' as *;
|
|
7
6
|
|
|
8
7
|
.popover {
|
|
9
8
|
$popover: &;
|
|
@@ -14,18 +13,18 @@
|
|
|
14
13
|
max-width: 23.3125rem;
|
|
15
14
|
text-align: start;
|
|
16
15
|
font-family: inherit;
|
|
17
|
-
font-size:
|
|
18
|
-
line-height:
|
|
19
|
-
background-color:
|
|
16
|
+
font-size: font-settings.$font-size-sm;
|
|
17
|
+
line-height: font-settings.$lineheight-size-sm;
|
|
18
|
+
background-color: palette.$white;
|
|
20
19
|
z-index: 3;
|
|
21
20
|
visibility: hidden;
|
|
22
|
-
border: getSpacer(4xs) solid
|
|
21
|
+
border: spacers.getSpacer(4xs) solid palette.$plum600;
|
|
23
22
|
border-radius: 0.5625rem;
|
|
24
23
|
box-shadow: 0 0.125rem 1.125rem 0 rgb(0 0 0 / 15%);
|
|
25
24
|
|
|
26
25
|
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
27
|
-
font-size:
|
|
28
|
-
line-height:
|
|
26
|
+
font-size: font-settings.$font-size-md;
|
|
27
|
+
line-height: font-settings.$lineheight-size-md;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
&--visible {
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
&__arrow {
|
|
36
|
-
--drop-shadow-color: #{
|
|
35
|
+
--drop-shadow-color: #{palette.$plum600};
|
|
37
36
|
|
|
38
37
|
width: 0;
|
|
39
38
|
height: 0;
|
|
@@ -45,14 +44,14 @@
|
|
|
45
44
|
|
|
46
45
|
&--over {
|
|
47
46
|
border-width: 0.625rem;
|
|
48
|
-
border-bottom-color:
|
|
47
|
+
border-bottom-color: palette.$white;
|
|
49
48
|
filter: drop-shadow(var(--drop-shadow-color) 0 0.125rem 0.375rem 0.125rem);
|
|
50
49
|
filter: drop-shadow(0 -0.185rem 0 var(--drop-shadow-color));
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
&--under {
|
|
54
53
|
border-width: 0.625rem;
|
|
55
|
-
border-top-color:
|
|
54
|
+
border-top-color: palette.$white;
|
|
56
55
|
filter: drop-shadow(var(--drop-shadow-color) 0 0.125rem 0.375rem 0.125rem);
|
|
57
56
|
filter: drop-shadow(0 0.2rem 0 var(--drop-shadow-color));
|
|
58
57
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from "react";
|
|
2
2
|
import { createPortal } from "react-dom";
|
|
3
3
|
import { AnalyticsId } from "../../constants.js";
|
|
4
4
|
function Portal({ children, parent, className, testId }) {
|
|
5
|
-
const el =
|
|
5
|
+
const el = React__default.useMemo(() => document.createElement("div"), []);
|
|
6
6
|
el.setAttribute("data-analyticsid", AnalyticsId.Portal);
|
|
7
7
|
if (testId) {
|
|
8
8
|
el.setAttribute("data-testid", testId);
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
React__default.useEffect(() => {
|
|
11
11
|
const target = parent && !!parent.appendChild ? parent : document.body;
|
|
12
12
|
const classList = ["portal-container"];
|
|
13
13
|
if (className) className.split(" ").forEach((item) => classList.push(item));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Portal/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { createPortal } from 'react-dom';\n\nimport { AnalyticsId } from '../../constants';\n\nexport interface PortalProps {\n /** Add custom class to portal, default class is portal-container */\n className?: string;\n /** Content to be displayed in Portal */\n children?: React.ReactNode;\n /** Default is document.body */\n parent?: HTMLElement;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport default function Portal({ children, parent, className, testId }: PortalProps): React.ReactPortal {\n // Create div to contain everything\n const el = React.useMemo(() => document.createElement('div'), []);\n el.setAttribute('data-analyticsid', AnalyticsId.Portal);\n if (testId) {\n el.setAttribute('data-testid', testId);\n }\n // On mount function\n React.useEffect(() => {\n // work out target in the DOM based on parent prop\n const target = parent && !!parent.appendChild ? parent : document.body;\n // Default classes\n const classList = ['portal-container'];\n // If className prop is present add each class the classList\n if (className) className.split(' ').forEach(item => classList.push(item));\n classList.forEach(item => el.classList.add(item));\n\n target.appendChild(el);\n // On unmount function\n return (): void => {\n // Remove element from dom\n target.removeChild(el);\n };\n }, [el, parent, className]);\n\n return createPortal(children, el);\n}\n"],"names":[],"mappings":";;;AAiBA,SAAwB,OAAO,EAAE,UAAU,QAAQ,WAAW,UAA0C;AAEhG,QAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Portal/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { createPortal } from 'react-dom';\n\nimport { AnalyticsId } from '../../constants';\n\nexport interface PortalProps {\n /** Add custom class to portal, default class is portal-container */\n className?: string;\n /** Content to be displayed in Portal */\n children?: React.ReactNode;\n /** Default is document.body */\n parent?: HTMLElement;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport default function Portal({ children, parent, className, testId }: PortalProps): React.ReactPortal {\n // Create div to contain everything\n const el = React.useMemo(() => document.createElement('div'), []);\n el.setAttribute('data-analyticsid', AnalyticsId.Portal);\n if (testId) {\n el.setAttribute('data-testid', testId);\n }\n // On mount function\n React.useEffect(() => {\n // work out target in the DOM based on parent prop\n const target = parent && !!parent.appendChild ? parent : document.body;\n // Default classes\n const classList = ['portal-container'];\n // If className prop is present add each class the classList\n if (className) className.split(' ').forEach(item => classList.push(item));\n classList.forEach(item => el.classList.add(item));\n\n target.appendChild(el);\n // On unmount function\n return (): void => {\n // Remove element from dom\n target.removeChild(el);\n };\n }, [el, parent, className]);\n\n return createPortal(children, el);\n}\n"],"names":["React"],"mappings":";;;AAiBA,SAAwB,OAAO,EAAE,UAAU,QAAQ,WAAW,UAA0C;AAEhG,QAAA,KAAKA,eAAM,QAAQ,MAAM,SAAS,cAAc,KAAK,GAAG,EAAE;AAC7D,KAAA,aAAa,oBAAoB,YAAY,MAAM;AACtD,MAAI,QAAQ;AACP,OAAA,aAAa,eAAe,MAAM;AAAA,EAAA;AAGvCA,iBAAM,UAAU,MAAM;AAEpB,UAAM,SAAS,UAAU,CAAC,CAAC,OAAO,cAAc,SAAS,SAAS;AAE5D,UAAA,YAAY,CAAC,kBAAkB;AAEjC,QAAA,UAAqB,WAAA,MAAM,GAAG,EAAE,QAAQ,CAAQ,SAAA,UAAU,KAAK,IAAI,CAAC;AACxE,cAAU,QAAQ,CAAQ,SAAA,GAAG,UAAU,IAAI,IAAI,CAAC;AAEhD,WAAO,YAAY,EAAE;AAErB,WAAO,MAAY;AAEjB,aAAO,YAAY,EAAE;AAAA,IACvB;AAAA,EACC,GAAA,CAAC,IAAI,QAAQ,SAAS,CAAC;AAEnB,SAAA,aAAa,UAAU,EAAE;AAClC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@use '../../scss/palette' as palette;
|
|
2
|
+
@use '../../scss/screen-reader' as *;
|
|
3
3
|
|
|
4
4
|
.progressbar {
|
|
5
5
|
&__svg {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
&--overlay-screen {
|
|
23
|
-
background:
|
|
23
|
+
background: palette.$transparent-grey;
|
|
24
24
|
position: fixed;
|
|
25
25
|
inset: 0;
|
|
26
26
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
position: absolute;
|
|
30
30
|
top: 0;
|
|
31
31
|
left: 0;
|
|
32
|
-
background:
|
|
32
|
+
background: palette.$transparent-grey;
|
|
33
33
|
height: 100%;
|
|
34
34
|
width: 100%;
|
|
35
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { AnalyticsId, IconSize } from "../../constants.js";
|
|
5
5
|
import { useBreakpoint, Breakpoint } from "../../hooks/useBreakpoint.js";
|
|
@@ -13,7 +13,7 @@ import { T as Title } from "../../Title.js";
|
|
|
13
13
|
import styles from "./styles.module.scss";
|
|
14
14
|
const PromoPanelLink = (props) => {
|
|
15
15
|
if (props.linkComponent) {
|
|
16
|
-
return
|
|
16
|
+
return React__default.cloneElement(props.linkComponent, { children: props.children });
|
|
17
17
|
}
|
|
18
18
|
if (props.linkHtmlMarkup === "button") {
|
|
19
19
|
return /* @__PURE__ */ jsx("button", { type: "button", onClick: props.linkOnClick, children: props.children });
|