@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,9 +1,9 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
@
|
|
2
|
+
@use '../../scss/spacers' as spacers;
|
|
3
|
+
@use '../../scss/palette' as palette;
|
|
4
|
+
@use '../../scss/font-settings' as font-settings;
|
|
5
|
+
@use '../../scss/screen-reader' as *;
|
|
6
|
+
@use '../../scss/breakpoints' as *;
|
|
7
7
|
|
|
8
8
|
$status-dot-size: 0.937rem;
|
|
9
9
|
|
|
@@ -11,17 +11,17 @@ $status-dot-size: 0.937rem;
|
|
|
11
11
|
position: relative;
|
|
12
12
|
display: inline-flex;
|
|
13
13
|
align-items: flex-start;
|
|
14
|
-
font-size:
|
|
14
|
+
font-size: font-settings.$font-size-xs;
|
|
15
15
|
line-height: 1.4rem;
|
|
16
16
|
font-weight: 400;
|
|
17
17
|
|
|
18
18
|
@media (min-width: map.get($grid-breakpoints, sm)) {
|
|
19
|
-
font-size:
|
|
19
|
+
font-size: font-settings.$font-size-sm;
|
|
20
20
|
line-height: 1.6rem;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
&--cancelled {
|
|
24
|
-
color:
|
|
24
|
+
color: palette.$cherry600;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&__dot {
|
|
@@ -29,8 +29,8 @@ $status-dot-size: 0.937rem;
|
|
|
29
29
|
align-items: center;
|
|
30
30
|
justify-content: center;
|
|
31
31
|
position: relative;
|
|
32
|
-
top: getSpacer(4xs);
|
|
33
|
-
margin-right: getSpacer(2xs);
|
|
32
|
+
top: spacers.getSpacer(4xs);
|
|
33
|
+
margin-right: spacers.getSpacer(2xs);
|
|
34
34
|
border-radius: 10rem;
|
|
35
35
|
width: $status-dot-size;
|
|
36
36
|
height: $status-dot-size;
|
|
@@ -38,44 +38,44 @@ $status-dot-size: 0.937rem;
|
|
|
38
38
|
min-height: $status-dot-size;
|
|
39
39
|
|
|
40
40
|
@media (min-width: map.get($grid-breakpoints, sm)) {
|
|
41
|
-
top: getSpacer(3xs);
|
|
41
|
+
top: spacers.getSpacer(3xs);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
&--info {
|
|
45
|
-
background:
|
|
45
|
+
background: palette.$kiwi900;
|
|
46
46
|
}
|
|
47
47
|
&--info#{&}--on-dark {
|
|
48
|
-
background:
|
|
48
|
+
background: palette.$kiwi400;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
&--warning {
|
|
52
|
-
background:
|
|
52
|
+
background: palette.$banana400;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
&--alert,
|
|
56
56
|
&--cancelled {
|
|
57
|
-
background:
|
|
57
|
+
background: palette.$cherry500;
|
|
58
58
|
}
|
|
59
59
|
&--alert#{&}--on-dark {
|
|
60
|
-
background:
|
|
60
|
+
background: palette.$cherry300;
|
|
61
61
|
}
|
|
62
62
|
&--cancelled#{&}--on-dark {
|
|
63
|
-
outline: 2px solid
|
|
63
|
+
outline: 2px solid palette.$white;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
&--active {
|
|
67
|
-
background:
|
|
67
|
+
background: palette.$blueberry500;
|
|
68
68
|
}
|
|
69
69
|
&--active#{&}--on-dark {
|
|
70
|
-
background:
|
|
70
|
+
background: palette.$blueberry300;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
&--transparent {
|
|
74
|
-
border: 2px solid
|
|
74
|
+
border: 2px solid palette.$neutral600;
|
|
75
75
|
}
|
|
76
76
|
&--transparent#{&}--on-dark {
|
|
77
77
|
border: none;
|
|
78
|
-
background:
|
|
78
|
+
background: palette.$white;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
svg {
|
|
@@ -85,7 +85,7 @@ $status-dot-size: 0.937rem;
|
|
|
85
85
|
|
|
86
86
|
&__label {
|
|
87
87
|
&--on-dark {
|
|
88
|
-
color:
|
|
88
|
+
color: palette.$white;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@
|
|
2
|
+
@use '../../scss/spacers' as spacers;
|
|
3
3
|
|
|
4
4
|
.step {
|
|
5
5
|
&__stepper {
|
|
6
|
-
margin-bottom: getSpacer(m);
|
|
6
|
+
margin-bottom: spacers.getSpacer(m);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
&__content {
|
|
10
|
-
margin-bottom: getSpacer(s);
|
|
10
|
+
margin-bottom: spacers.getSpacer(s);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@
|
|
2
|
+
@use '../../scss/spacers' as spacers;
|
|
3
|
+
@use '../../scss/palette' as palette;
|
|
4
|
+
@use '../../scss/screen-reader' as *;
|
|
5
|
+
@use '../../scss/breakpoints' as *;
|
|
6
6
|
|
|
7
7
|
.stepbuttons {
|
|
8
|
-
margin-top: getSpacer(m);
|
|
9
|
-
margin-bottom: getSpacer(s);
|
|
8
|
+
margin-top: spacers.getSpacer(m);
|
|
9
|
+
margin-bottom: spacers.getSpacer(s);
|
|
10
10
|
display: flex;
|
|
11
11
|
flex-wrap: wrap;
|
|
12
|
-
gap: getSpacer(m) getSpacer(l);
|
|
12
|
+
gap: spacers.getSpacer(m) spacers.getSpacer(l);
|
|
13
13
|
|
|
14
14
|
&--has-sticky-buttons {
|
|
15
|
-
background-color:
|
|
15
|
+
background-color: palette.$white;
|
|
16
16
|
position: sticky;
|
|
17
17
|
bottom: 0;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
&__buttons {
|
|
21
21
|
display: flex;
|
|
22
|
-
gap: getSpacer(s);
|
|
22
|
+
gap: spacers.getSpacer(s);
|
|
23
23
|
|
|
24
24
|
@media (max-width: map.get($grid-max-breakpoints, xs)) {
|
|
25
25
|
width: 100%;
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
.stepper-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
10
|
-
min-height: getSpacer(l);
|
|
10
|
+
min-height: spacers.getSpacer(l);
|
|
11
11
|
|
|
12
12
|
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
13
|
-
min-height: getSpacer(xl);
|
|
13
|
+
min-height: spacers.getSpacer(xl);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -47,7 +47,15 @@ $dot-offset: calc($stepper-padding-x + $dot-size / 2);
|
|
|
47
47
|
display: block;
|
|
48
48
|
height: $stepper-height;
|
|
49
49
|
border-radius: 4px;
|
|
50
|
-
background:
|
|
50
|
+
background:
|
|
51
|
+
linear-gradient(
|
|
52
|
+
to right,
|
|
53
|
+
palette.$blueberry600,
|
|
54
|
+
palette.$blueberry600 $dot-offset,
|
|
55
|
+
palette.$blueberry50 $dot-offset,
|
|
56
|
+
palette.$blueberry50
|
|
57
|
+
),
|
|
58
|
+
palette.$blueberry600;
|
|
51
59
|
background-repeat: no-repeat;
|
|
52
60
|
|
|
53
61
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -59,8 +67,8 @@ $dot-offset: calc($stepper-padding-x + $dot-size / 2);
|
|
|
59
67
|
width: $marker-size;
|
|
60
68
|
height: $marker-size;
|
|
61
69
|
top: calc(($stepper-height - $marker-size) / 2);
|
|
62
|
-
background-color:
|
|
63
|
-
border: 6px solid
|
|
70
|
+
background-color: palette.$white;
|
|
71
|
+
border: 6px solid palette.$blueberry600;
|
|
64
72
|
border-radius: 50%;
|
|
65
73
|
|
|
66
74
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -71,11 +79,11 @@ $dot-offset: calc($stepper-padding-x + $dot-size / 2);
|
|
|
71
79
|
&__number {
|
|
72
80
|
min-width: 2.5rem;
|
|
73
81
|
text-align: right;
|
|
74
|
-
margin-left: getSpacer(xs);
|
|
75
|
-
font-size:
|
|
76
|
-
line-height:
|
|
82
|
+
margin-left: spacers.getSpacer(xs);
|
|
83
|
+
font-size: font-settings.$font-size-xs;
|
|
84
|
+
line-height: font-settings.$lineheight-size-xs;
|
|
77
85
|
font-weight: 700;
|
|
78
|
-
color:
|
|
86
|
+
color: palette.$blueberry700;
|
|
79
87
|
}
|
|
80
88
|
|
|
81
89
|
&__dot {
|
|
@@ -83,7 +91,7 @@ $dot-offset: calc($stepper-padding-x + $dot-size / 2);
|
|
|
83
91
|
top: calc(($stepper-height - $dot-size) / 2);
|
|
84
92
|
width: $dot-size;
|
|
85
93
|
height: $dot-size;
|
|
86
|
-
background-color:
|
|
94
|
+
background-color: palette.$blueberry600;
|
|
87
95
|
border-radius: 50%;
|
|
88
96
|
|
|
89
97
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -91,7 +99,7 @@ $dot-offset: calc($stepper-padding-x + $dot-size / 2);
|
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
&--completed {
|
|
94
|
-
background-color:
|
|
102
|
+
background-color: palette.$blueberry50;
|
|
95
103
|
}
|
|
96
104
|
|
|
97
105
|
&--left {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@use '../../scss/
|
|
2
|
-
@
|
|
1
|
+
@use '../../scss/font-settings' as font-settings;
|
|
2
|
+
@import '../../scss/supernova/styles/colors';
|
|
3
3
|
|
|
4
4
|
.sticky-note {
|
|
5
5
|
position: relative;
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
&__error-text {
|
|
96
96
|
color: var(--color-notification-status-error);
|
|
97
97
|
line-height: 1.875rem;
|
|
98
|
-
font-size:
|
|
98
|
+
font-size: font-settings.$font-size-sm;
|
|
99
99
|
margin-top: 0.75rem;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Kan fjernes når konvensjonen for BEM er tillatt.
|
|
2
2
|
/* stylelint-disable selector-class-pattern */
|
|
3
3
|
@use 'sass:map';
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
@
|
|
7
|
-
@
|
|
4
|
+
@use '../../scss/spacers' as spacers;
|
|
5
|
+
@use '../../scss/palette' as palette;
|
|
6
|
+
@use '../../scss/font-settings' as font-settings;
|
|
7
|
+
@use '../../scss/breakpoints' as *;
|
|
8
8
|
@import '../../scss/grid';
|
|
9
9
|
|
|
10
10
|
/* fix outline for Safari */
|
|
@@ -72,7 +72,7 @@ table .table-body .table-row {
|
|
|
72
72
|
top: 0;
|
|
73
73
|
left: 0;
|
|
74
74
|
width: 60%;
|
|
75
|
-
padding-right:
|
|
75
|
+
padding-right: spacers.$spacer;
|
|
76
76
|
white-space: normal;
|
|
77
77
|
display: block;
|
|
78
78
|
float: left;
|
|
@@ -85,7 +85,7 @@ table .table-body .table-row {
|
|
|
85
85
|
|
|
86
86
|
.table__expander-cell-mobile {
|
|
87
87
|
padding-left: 0.75rem;
|
|
88
|
-
border-bottom: 1px solid
|
|
88
|
+
border-bottom: 1px solid palette.$neutral500;
|
|
89
89
|
|
|
90
90
|
&--expanded {
|
|
91
91
|
border-bottom: 0;
|
|
@@ -99,7 +99,7 @@ table .table-body .table-row {
|
|
|
99
99
|
|
|
100
100
|
.table__cell:first-child {
|
|
101
101
|
border-collapse: collapse;
|
|
102
|
-
border-top: 1px solid
|
|
102
|
+
border-top: 1px solid palette.$neutral500;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
.table__expanded-row {
|
|
@@ -117,7 +117,7 @@ table .table-body .table-row {
|
|
|
117
117
|
.table__row--expandable {
|
|
118
118
|
.table__cell:nth-child(2) {
|
|
119
119
|
border-collapse: collapse;
|
|
120
|
-
border-top: 1px solid
|
|
120
|
+
border-top: 1px solid palette.$neutral500;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
&:focus-within {
|
|
@@ -126,7 +126,7 @@ table .table-body .table-row {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
.table-row:last-child .table__cell:last-child {
|
|
129
|
-
border-bottom: 1px solid
|
|
129
|
+
border-bottom: 1px solid palette.$neutral500;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -153,10 +153,10 @@ table .table-body .table-row {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
.table__head {
|
|
156
|
-
background:
|
|
156
|
+
background: palette.$blueberry50;
|
|
157
157
|
|
|
158
158
|
&--normal {
|
|
159
|
-
background:
|
|
159
|
+
background: palette.$neutral50;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
&--transparent {
|
|
@@ -164,7 +164,7 @@ table .table-body .table-row {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
&--sortable {
|
|
167
|
-
background:
|
|
167
|
+
background: palette.$blueberry50;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
@@ -184,46 +184,46 @@ table .table-body .table-row {
|
|
|
184
184
|
// Fix for firefox hover feil
|
|
185
185
|
background-clip: padding-box;
|
|
186
186
|
height: 3.625rem;
|
|
187
|
-
font-size:
|
|
188
|
-
line-height:
|
|
187
|
+
font-size: font-settings.$font-size-sm;
|
|
188
|
+
line-height: font-settings.$lineheight-size-xs;
|
|
189
189
|
text-align: left;
|
|
190
190
|
vertical-align: bottom;
|
|
191
191
|
font-weight: 700;
|
|
192
192
|
padding: 0.5rem 0.75rem;
|
|
193
|
-
border: 1px solid
|
|
193
|
+
border: 1px solid palette.$neutral500;
|
|
194
194
|
|
|
195
195
|
&--sortable {
|
|
196
196
|
position: relative;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
&--sortable:hover {
|
|
200
|
-
background-color:
|
|
200
|
+
background-color: palette.$blueberry100;
|
|
201
201
|
cursor: pointer;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
&--sortable:focus-within {
|
|
205
|
-
outline: 3px solid
|
|
205
|
+
outline: 3px solid palette.$black;
|
|
206
206
|
outline-offset: -3px;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
210
210
|
padding: 1rem;
|
|
211
211
|
height: 5.5rem;
|
|
212
|
-
font-size:
|
|
213
|
-
line-height:
|
|
212
|
+
font-size: font-settings.$font-size-md;
|
|
213
|
+
line-height: font-settings.$lineheight-size-sm;
|
|
214
214
|
font-weight: 700;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
&--compact {
|
|
218
|
-
padding: getSpacer(2xs) getSpacer(3xs) getSpacer(4xs);
|
|
218
|
+
padding: spacers.getSpacer(2xs) spacers.getSpacer(3xs) spacers.getSpacer(4xs);
|
|
219
219
|
line-height: 18px;
|
|
220
220
|
font-size: 14px;
|
|
221
221
|
height: unset;
|
|
222
222
|
|
|
223
223
|
@media (min-width: map.get($grid-breakpoints, sm)) {
|
|
224
|
-
padding: getSpacer(s) getSpacer(3xs) getSpacer(3xs);
|
|
224
|
+
padding: spacers.getSpacer(s) spacers.getSpacer(3xs) spacers.getSpacer(3xs);
|
|
225
225
|
line-height: 20px;
|
|
226
|
-
font-size:
|
|
226
|
+
font-size: font-settings.$font-size-xs;
|
|
227
227
|
height: unset;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
@@ -235,11 +235,11 @@ table .table-body .table-row {
|
|
|
235
235
|
|
|
236
236
|
.table__cell {
|
|
237
237
|
height: 2, 375;
|
|
238
|
-
font-size:
|
|
238
|
+
font-size: font-settings.$font-size-xs;
|
|
239
239
|
line-height: 1.5rem;
|
|
240
240
|
padding: 0.5rem 0.75rem;
|
|
241
241
|
text-align: left;
|
|
242
|
-
border: 1px solid
|
|
242
|
+
border: 1px solid palette.$neutral500;
|
|
243
243
|
|
|
244
244
|
&--center {
|
|
245
245
|
text-align: center;
|
|
@@ -256,17 +256,17 @@ table .table-body .table-row {
|
|
|
256
256
|
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
257
257
|
padding: 1rem;
|
|
258
258
|
height: 3.625rem;
|
|
259
|
-
font-size:
|
|
259
|
+
font-size: font-settings.$font-size-sm;
|
|
260
260
|
line-height: 1.75rem;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
&--compact {
|
|
264
|
-
padding: getSpacer(4xs) getSpacer(3xs);
|
|
264
|
+
padding: spacers.getSpacer(4xs) spacers.getSpacer(3xs);
|
|
265
265
|
font-size: 14px;
|
|
266
266
|
|
|
267
267
|
@media (min-width: map.get($grid-breakpoints, sm)) {
|
|
268
|
-
padding: getSpacer(3xs);
|
|
269
|
-
font-size:
|
|
268
|
+
padding: spacers.getSpacer(3xs);
|
|
269
|
+
font-size: font-settings.$font-size-xs;
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
}
|
|
@@ -274,18 +274,18 @@ table .table-body .table-row {
|
|
|
274
274
|
.table__cell-expander {
|
|
275
275
|
text-align: center;
|
|
276
276
|
width: min-content;
|
|
277
|
-
padding: 0 getSpacer(3xs);
|
|
277
|
+
padding: 0 spacers.getSpacer(3xs);
|
|
278
278
|
vertical-align: middle;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
.table__row--expandable {
|
|
282
282
|
&--selected {
|
|
283
|
-
background:
|
|
283
|
+
background: palette.$neutral100;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
&:hover {
|
|
287
287
|
cursor: pointer;
|
|
288
|
-
background:
|
|
288
|
+
background: palette.$blueberry50;
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
|
|
@@ -301,7 +301,7 @@ table .table-body .table-row {
|
|
|
301
301
|
|
|
302
302
|
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
303
303
|
&--open {
|
|
304
|
-
border-bottom: 1px solid
|
|
304
|
+
border-bottom: 1px solid palette.$neutral100;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
}
|
|
@@ -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
|
@import '../../../scss/supernova/styles/colors';
|
|
6
6
|
|
|
7
7
|
.tab-panel {
|
|
8
8
|
$tab-panel: &;
|
|
9
9
|
$colors: 'blueberry', 'neutral', 'white';
|
|
10
10
|
|
|
11
|
-
padding: getSpacer(l) getSpacer(s) getSpacer(xl);
|
|
11
|
+
padding: spacers.getSpacer(l) spacers.getSpacer(s) spacers.getSpacer(xl);
|
|
12
12
|
width: 100%;
|
|
13
13
|
border-bottom: 1px solid var(--color-action-border-onlight-focus);
|
|
14
14
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
border-radius: 0 0 0.5rem 0.5rem;
|
|
23
23
|
border: 1px solid var(--color-action-border-onlight-focus);
|
|
24
24
|
border-top: 0;
|
|
25
|
-
padding: getSpacer(xl) getSpacer(m) getSpacer(2xl);
|
|
25
|
+
padding: spacers.getSpacer(xl) spacers.getSpacer(m) spacers.getSpacer(2xl);
|
|
26
26
|
|
|
27
27
|
&#{$tab-panel}--first {
|
|
28
28
|
border-radius: 0;
|
package/components/Tabs/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useState, useRef } from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
-
import {
|
|
4
|
+
import { T as TabList, a as Tab } from "../../TabList.js";
|
|
5
5
|
import { T as TabPanel } from "../../TabPanel.js";
|
|
6
6
|
import designsystemlayout from "../../scss/layout.module.scss";
|
|
7
7
|
import styles from "./styles.module.scss";
|
|
@@ -61,7 +61,7 @@ const TabsRoot = ({
|
|
|
61
61
|
]
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
/* @__PURE__ */ jsx("div", { ref: tabsRef, style: { marginTop: "-50px" }, children: /* @__PURE__ */ jsx(TabPanel, { ref: tabPanelRef, color, isFirst: activeTabIndex == 0, children:
|
|
64
|
+
/* @__PURE__ */ jsx("div", { ref: tabsRef, style: { marginTop: "-50px" }, children: /* @__PURE__ */ jsx(TabPanel, { ref: tabPanelRef, color, isFirst: activeTabIndex == 0, children: React__default.Children.toArray(children)[activeTabIndex] }) })
|
|
65
65
|
] });
|
|
66
66
|
};
|
|
67
67
|
const Tabs = TabsRoot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import React, { useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport Tab from './Tab';\nimport TabList from './TabList';\nimport TabPanel from './TabPanel';\nimport designsystemlayout from '../../scss/layout.module.scss';\nimport { PaletteNames } from '../../theme/palette';\n\nimport styles from './styles.module.scss';\n\nexport type { TabProps } from './Tab';\nexport type TabsColors = Extract<PaletteNames, 'blueberry' | 'neutral' | 'white'>;\nexport type TabsOnColor = 'onblueberry' | 'onneutral' | 'onwhite';\n\nexport interface TabsProps {\n children?: React.ReactNode;\n /** Controlled state for Tabs component */\n activeTab?: number;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the color of the tabs. Default: white */\n color?: TabsColors;\n /** Sets wether the component should use the container-breakout class. Default: true */\n containerBreakout?: boolean;\n /** Sets the background color of the tabs. Can only be used when the color is set to white. Default: onwhite */\n onColor?: TabsOnColor;\n /** Whether the tab list should be sticky */\n sticky?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets aria label on the \"scroll to the right\" button in TabList */\n ariaLabelRightButton?: string;\n /** Sets aria label on the \"scroll to the left\" button in TabList */\n ariaLabelLeftButton?: string;\n /** Overrides the default z-index of the tabs header */\n zIndex?: number;\n}\n\nconst TabsRoot: React.FC<TabsProps> = ({\n activeTab,\n children,\n className,\n color = 'white',\n containerBreakout = true,\n onColor = 'onwhite',\n sticky = true,\n testId,\n ariaLabelRightButton,\n ariaLabelLeftButton,\n zIndex,\n}) => {\n const isControlled = activeTab !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(0);\n const tabsRef = useRef<HTMLDivElement>(null);\n const tabPanelRef = useRef<HTMLDivElement>(null);\n const tabListRef = useRef<HTMLDivElement>(null);\n\n let onColorUsed: TabsOnColor = 'onwhite';\n if (color === 'white') {\n onColorUsed = onColor;\n }\n\n const onValueChange = (newValue: number): void => {\n if (!isControlled) {\n setUncontrolledValue(newValue);\n }\n };\n\n const activeTabIndex = isControlled ? activeTab : uncontrolledValue;\n\n return (\n <div className={classNames(className, containerBreakout && designsystemlayout['container-breakout'])} data-testid={testId}>\n <div\n ref={tabListRef}\n className={classNames(styles['tab-list-wrapper'], {\n [styles['tab-list-wrapper--sticky']]: sticky,\n })}\n style={{\n zIndex: zIndex,\n }}\n >\n <TabList\n onTabListClick={(index: number) => onValueChange(index)}\n selectedTab={activeTabIndex}\n color={color}\n onColor={onColorUsed}\n ariaLabelLeftButton={ariaLabelLeftButton}\n ariaLabelRightButton={ariaLabelRightButton}\n >\n {children}\n </TabList>\n <div className={classNames(styles['panel-wrapper'], styles[`panel-wrapper--${color}`])}></div>\n </div>\n <div ref={tabsRef} style={{ marginTop: '-50px' }}>\n <TabPanel ref={tabPanelRef} color={color} isFirst={activeTabIndex == 0}>\n {React.Children.toArray(children)[activeTabIndex]}\n </TabPanel>\n </div>\n </div>\n );\n};\n\ntype TabsComponent = typeof TabsRoot & {\n Tab: typeof Tab;\n};\nconst Tabs = TabsRoot as TabsComponent;\nTabs.displayName = 'Tabs';\nTabs.Tab = Tab;\nTabs.Tab.displayName = 'Tabs.Tab';\n\nexport default Tabs;\n"],"names":[],"mappings":";;;;;;;AAwCA,MAAM,WAAgC,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,cAAc;AACnC,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,SAAS,CAAC;AACtD,QAAA,UAAU,OAAuB,IAAI;AACrC,QAAA,cAAc,OAAuB,IAAI;AACzC,QAAA,aAAa,OAAuB,IAAI;AAE9C,MAAI,cAA2B;AAC/B,MAAI,UAAU,SAAS;AACP,kBAAA;AAAA,EAAA;AAGV,QAAA,gBAAgB,CAAC,aAA2B;AAChD,QAAI,CAAC,cAAc;AACjB,2BAAqB,QAAQ;AAAA,IAAA;AAAA,EAEjC;AAEM,QAAA,iBAAiB,eAAe,YAAY;AAGhD,SAAA,qBAAC,OAAI,EAAA,WAAW,WAAW,WAAW,qBAAqB,mBAAmB,oBAAoB,CAAC,GAAG,eAAa,QACjH,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAK;AAAA,QACL,WAAW,WAAW,OAAO,kBAAkB,GAAG;AAAA,UAChD,CAAC,OAAO,0BAA0B,CAAC,GAAG;AAAA,QAAA,CACvC;AAAA,QACD,OAAO;AAAA,UACL;AAAA,QACF;AAAA,QAEA,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,gBAAgB,CAAC,UAAkB,cAAc,KAAK;AAAA,cACtD,aAAa;AAAA,cACb;AAAA,cACA,SAAS;AAAA,cACT;AAAA,cACA;AAAA,cAEC;AAAA,YAAA;AAAA,UACH;AAAA,UACC,oBAAA,OAAA,EAAI,WAAW,WAAW,OAAO,eAAe,GAAG,OAAO,kBAAkB,KAAK,EAAE,CAAC,EAAG,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC1F;AAAA,IACA,oBAAC,OAAI,EAAA,KAAK,SAAS,OAAO,EAAE,WAAW,QAAA,GACrC,UAAA,oBAAC,UAAS,EAAA,KAAK,aAAa,OAAc,SAAS,kBAAkB,GAClE,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import React, { useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport Tab from './Tab';\nimport TabList from './TabList';\nimport TabPanel from './TabPanel';\nimport designsystemlayout from '../../scss/layout.module.scss';\nimport { PaletteNames } from '../../theme/palette';\n\nimport styles from './styles.module.scss';\n\nexport type { TabProps } from './Tab';\nexport type TabsColors = Extract<PaletteNames, 'blueberry' | 'neutral' | 'white'>;\nexport type TabsOnColor = 'onblueberry' | 'onneutral' | 'onwhite';\n\nexport interface TabsProps {\n children?: React.ReactNode;\n /** Controlled state for Tabs component */\n activeTab?: number;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the color of the tabs. Default: white */\n color?: TabsColors;\n /** Sets wether the component should use the container-breakout class. Default: true */\n containerBreakout?: boolean;\n /** Sets the background color of the tabs. Can only be used when the color is set to white. Default: onwhite */\n onColor?: TabsOnColor;\n /** Whether the tab list should be sticky */\n sticky?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets aria label on the \"scroll to the right\" button in TabList */\n ariaLabelRightButton?: string;\n /** Sets aria label on the \"scroll to the left\" button in TabList */\n ariaLabelLeftButton?: string;\n /** Overrides the default z-index of the tabs header */\n zIndex?: number;\n}\n\nconst TabsRoot: React.FC<TabsProps> = ({\n activeTab,\n children,\n className,\n color = 'white',\n containerBreakout = true,\n onColor = 'onwhite',\n sticky = true,\n testId,\n ariaLabelRightButton,\n ariaLabelLeftButton,\n zIndex,\n}) => {\n const isControlled = activeTab !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(0);\n const tabsRef = useRef<HTMLDivElement>(null);\n const tabPanelRef = useRef<HTMLDivElement>(null);\n const tabListRef = useRef<HTMLDivElement>(null);\n\n let onColorUsed: TabsOnColor = 'onwhite';\n if (color === 'white') {\n onColorUsed = onColor;\n }\n\n const onValueChange = (newValue: number): void => {\n if (!isControlled) {\n setUncontrolledValue(newValue);\n }\n };\n\n const activeTabIndex = isControlled ? activeTab : uncontrolledValue;\n\n return (\n <div className={classNames(className, containerBreakout && designsystemlayout['container-breakout'])} data-testid={testId}>\n <div\n ref={tabListRef}\n className={classNames(styles['tab-list-wrapper'], {\n [styles['tab-list-wrapper--sticky']]: sticky,\n })}\n style={{\n zIndex: zIndex,\n }}\n >\n <TabList\n onTabListClick={(index: number) => onValueChange(index)}\n selectedTab={activeTabIndex}\n color={color}\n onColor={onColorUsed}\n ariaLabelLeftButton={ariaLabelLeftButton}\n ariaLabelRightButton={ariaLabelRightButton}\n >\n {children}\n </TabList>\n <div className={classNames(styles['panel-wrapper'], styles[`panel-wrapper--${color}`])}></div>\n </div>\n <div ref={tabsRef} style={{ marginTop: '-50px' }}>\n <TabPanel ref={tabPanelRef} color={color} isFirst={activeTabIndex == 0}>\n {React.Children.toArray(children)[activeTabIndex]}\n </TabPanel>\n </div>\n </div>\n );\n};\n\ntype TabsComponent = typeof TabsRoot & {\n Tab: typeof Tab;\n};\nconst Tabs = TabsRoot as TabsComponent;\nTabs.displayName = 'Tabs';\nTabs.Tab = Tab;\nTabs.Tab.displayName = 'Tabs.Tab';\n\nexport default Tabs;\n"],"names":["React"],"mappings":";;;;;;;AAwCA,MAAM,WAAgC,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,cAAc;AACnC,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,SAAS,CAAC;AACtD,QAAA,UAAU,OAAuB,IAAI;AACrC,QAAA,cAAc,OAAuB,IAAI;AACzC,QAAA,aAAa,OAAuB,IAAI;AAE9C,MAAI,cAA2B;AAC/B,MAAI,UAAU,SAAS;AACP,kBAAA;AAAA,EAAA;AAGV,QAAA,gBAAgB,CAAC,aAA2B;AAChD,QAAI,CAAC,cAAc;AACjB,2BAAqB,QAAQ;AAAA,IAAA;AAAA,EAEjC;AAEM,QAAA,iBAAiB,eAAe,YAAY;AAGhD,SAAA,qBAAC,OAAI,EAAA,WAAW,WAAW,WAAW,qBAAqB,mBAAmB,oBAAoB,CAAC,GAAG,eAAa,QACjH,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAK;AAAA,QACL,WAAW,WAAW,OAAO,kBAAkB,GAAG;AAAA,UAChD,CAAC,OAAO,0BAA0B,CAAC,GAAG;AAAA,QAAA,CACvC;AAAA,QACD,OAAO;AAAA,UACL;AAAA,QACF;AAAA,QAEA,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,gBAAgB,CAAC,UAAkB,cAAc,KAAK;AAAA,cACtD,aAAa;AAAA,cACb;AAAA,cACA,SAAS;AAAA,cACT;AAAA,cACA;AAAA,cAEC;AAAA,YAAA;AAAA,UACH;AAAA,UACC,oBAAA,OAAA,EAAI,WAAW,WAAW,OAAO,eAAe,GAAG,OAAO,kBAAkB,KAAK,EAAE,CAAC,EAAG,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC1F;AAAA,IACA,oBAAC,OAAI,EAAA,KAAK,SAAS,OAAO,EAAE,WAAW,QAAA,GACrC,UAAA,oBAAC,UAAS,EAAA,KAAK,aAAa,OAAc,SAAS,kBAAkB,GAClE,UAAMA,eAAA,SAAS,QAAQ,QAAQ,EAAE,cAAc,EAClD,CAAA,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;AAKA,MAAM,OAAO;AACb,KAAK,cAAc;AACnB,KAAK,MAAM;AACX,KAAK,IAAI,cAAc;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
.tag {
|
|
7
7
|
$tag: &;
|
|
@@ -28,45 +28,45 @@
|
|
|
28
28
|
&--#{$color}[type='button'] {
|
|
29
29
|
// banana og kiwi har unntak fra hovedregelen
|
|
30
30
|
@if $color == 'banana' {
|
|
31
|
-
color: map.get(
|
|
32
|
-
border-color: map.get(
|
|
31
|
+
color: map.get(palette.$palette-map, #{$color}900);
|
|
32
|
+
border-color: map.get(palette.$palette-map, #{$color}300);
|
|
33
33
|
} @else if $color == 'kiwi' {
|
|
34
|
-
color: map.get(
|
|
35
|
-
border-color: map.get(
|
|
34
|
+
color: map.get(palette.$palette-map, #{$color}900);
|
|
35
|
+
border-color: map.get(palette.$palette-map, #{$color}200);
|
|
36
36
|
} @else {
|
|
37
|
-
color: map.get(
|
|
38
|
-
border-color: map.get(
|
|
37
|
+
color: map.get(palette.$palette-map, #{$color}800);
|
|
38
|
+
border-color: map.get(palette.$palette-map, #{$color}200);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
&#{$tag}--emphasised {
|
|
42
|
-
background-color: map.get(
|
|
42
|
+
background-color: map.get(palette.$palette-map, #{$color}50);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
&--medium {
|
|
48
|
-
padding: 0 getSpacer(xs);
|
|
48
|
+
padding: 0 spacers.getSpacer(xs);
|
|
49
49
|
min-height: 1.625rem;
|
|
50
50
|
|
|
51
51
|
&#{$tag}--has-icon {
|
|
52
|
-
padding: 0 getSpacer(xs) 0 0.375rem;
|
|
52
|
+
padding: 0 spacers.getSpacer(xs) 0 0.375rem;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
#{$tag}__icon {
|
|
56
|
-
margin-right: getSpacer(4xs);
|
|
56
|
+
margin-right: spacers.getSpacer(4xs);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
&--large {
|
|
61
|
-
padding: 0 getSpacer(xs);
|
|
61
|
+
padding: 0 spacers.getSpacer(xs);
|
|
62
62
|
min-height: 1.875rem;
|
|
63
63
|
|
|
64
64
|
&#{$tag}--has-icon {
|
|
65
|
-
padding: getSpacer(4xs) getSpacer(xs) getSpacer(4xs) 0.375rem;
|
|
65
|
+
padding: spacers.getSpacer(4xs) spacers.getSpacer(xs) spacers.getSpacer(4xs) 0.375rem;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
#{$tag}__icon {
|
|
69
|
-
margin-right: getSpacer(4xs);
|
|
69
|
+
margin-right: spacers.getSpacer(4xs);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default from "react";
|
|
3
3
|
import { AnalyticsId } from "../../constants.js";
|
|
4
4
|
import styles from "./styles.module.scss";
|
|
5
5
|
const TagList = ({ children, testId }) => {
|
|
6
|
-
return /* @__PURE__ */ jsx("ul", { className: styles["tag-list"], "data-testid": testId, "data-analyticsid": AnalyticsId.TagList, children:
|
|
6
|
+
return /* @__PURE__ */ jsx("ul", { className: styles["tag-list"], "data-testid": testId, "data-analyticsid": AnalyticsId.TagList, children: React__default.Children.map(children, (child) => /* @__PURE__ */ jsx("li", { className: styles["tag-list__item"], children: child })) });
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
TagList as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/TagList/TagList.tsx"],"sourcesContent":["import React from 'react';\n\nimport { AnalyticsId } from '../../constants';\n\nimport styles from './styles.module.scss';\n\nexport interface TagListPropsProps {\n children?: React.ReactNode;\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n}\n\nconst TagList: React.FC<TagListPropsProps> = ({ children, testId }) => {\n return (\n <ul className={styles['tag-list']} data-testid={testId} data-analyticsid={AnalyticsId.TagList}>\n {React.Children.map(children, child => (\n <li className={styles['tag-list__item']}>{child}</li>\n ))}\n </ul>\n );\n};\n\nexport default TagList;\n"],"names":[],"mappings":";;;;AAYA,MAAM,UAAuC,CAAC,EAAE,UAAU,aAAa;AAEnE,SAAA,oBAAC,MAAG,EAAA,WAAW,OAAO,UAAU,GAAG,eAAa,QAAQ,oBAAkB,YAAY,SACnF,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/TagList/TagList.tsx"],"sourcesContent":["import React from 'react';\n\nimport { AnalyticsId } from '../../constants';\n\nimport styles from './styles.module.scss';\n\nexport interface TagListPropsProps {\n children?: React.ReactNode;\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n}\n\nconst TagList: React.FC<TagListPropsProps> = ({ children, testId }) => {\n return (\n <ul className={styles['tag-list']} data-testid={testId} data-analyticsid={AnalyticsId.TagList}>\n {React.Children.map(children, child => (\n <li className={styles['tag-list__item']}>{child}</li>\n ))}\n </ul>\n );\n};\n\nexport default TagList;\n"],"names":["React"],"mappings":";;;;AAYA,MAAM,UAAuC,CAAC,EAAE,UAAU,aAAa;AAEnE,SAAA,oBAAC,MAAG,EAAA,WAAW,OAAO,UAAU,GAAG,eAAa,QAAQ,oBAAkB,YAAY,SACnF,UAAAA,eAAM,SAAS,IAAI,UAAU,CAC5B,UAAA,oBAAC,MAAG,EAAA,WAAW,OAAO,gBAAgB,GAAI,UAAM,MAAA,CAAA,CACjD,EACH,CAAA;AAEJ;"}
|