@helsenorge/designsystem-react 15.7.1 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Button.js +2 -2
- package/lib/Button.js.map +1 -1
- package/lib/CHANGELOG.md +2657 -996
- package/lib/Close.js +1 -1
- package/lib/Close.js.map +1 -1
- package/lib/Drawer.js +2 -4
- package/lib/Drawer.js.map +1 -1
- package/lib/DrawerNavigation.js +1 -0
- package/lib/DrawerNavigation.js.map +1 -1
- package/lib/Duolist.js +5 -1
- package/lib/Duolist.js.map +1 -1
- package/lib/ElementHeader.js.map +1 -1
- package/lib/FilterLinkList.js +1 -1
- package/lib/FilterLinkList.js.map +1 -1
- package/lib/FormGroup.js +3 -3
- package/lib/FormGroup.js.map +1 -1
- package/lib/HelpDetails.js +1 -1
- package/lib/HelpTriggerIcon.js +2 -2
- package/lib/HelpTriggerIcon.js.map +1 -1
- package/lib/HelpTriggerStandalone.js +1 -1
- package/lib/HelpTriggerStandalone.js.map +1 -1
- package/lib/LazyIcon.js +1 -0
- package/lib/LazyIcon.js.map +1 -1
- package/lib/LazyIllustration.js +2 -0
- package/lib/LazyIllustration.js.map +1 -1
- package/lib/LinkList.js +10 -10
- package/lib/LinkList.js.map +1 -1
- package/lib/ListEditMode.js +1 -1
- package/lib/ListEditMode.js.map +1 -1
- package/lib/PopOver.js +2 -2
- package/lib/PopOver.js.map +1 -1
- package/lib/Radio.js +65 -55
- package/lib/Radio.js.map +1 -1
- package/lib/Radio2.js +74 -0
- package/lib/Radio2.js.map +1 -0
- package/lib/RadioMarker.js +2 -2
- package/lib/RadioMarker.js.map +1 -1
- package/lib/TabList.js +5 -5
- package/lib/TabList.js.map +1 -1
- package/lib/Toggle.js +2 -2
- package/lib/Toggle.js.map +1 -1
- package/lib/VisualRadio.js +1 -1
- package/lib/VisualRadio.js.map +1 -1
- package/lib/components/AnchorLink/styles.module.scss +3 -4
- package/lib/components/ArticleTeaser/styles.module.scss +12 -12
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/Button/styles.module.scss +111 -60
- package/lib/components/Button/styles.module.scss.d.ts +1 -1
- package/lib/components/Checkbox/CheckboxMarker/styles.module.scss +6 -6
- package/lib/components/Chip/styles.module.scss +2 -3
- package/lib/components/Close/styles.module.scss +2 -3
- package/lib/components/DictionaryTrigger/index.js +26 -1
- package/lib/{DictionaryTrigger.js.map → components/DictionaryTrigger/index.js.map} +1 -1
- package/lib/components/DictionaryTrigger/styles.module.scss +6 -8
- package/lib/components/Drawer/Drawer.d.ts +0 -4
- package/lib/components/Drawer/DrawerBackButton.module.scss +1 -2
- package/lib/components/Drawer/styles.module.scss +6 -3
- package/lib/components/Dropdown/SingleSelect/styles.module.scss +0 -2
- package/lib/components/Dropdown/index.js +9 -17
- package/lib/components/Dropdown/index.js.map +1 -1
- package/lib/components/Dropdown/styles.module.scss +12 -14
- package/lib/components/Duolist/Duolist.d.ts +14 -2
- package/lib/components/Duolist/styles.module.scss +32 -8
- package/lib/components/Duolist/styles.module.scss.d.ts +3 -0
- package/lib/components/ElementHeader/ElementHeader.d.ts +1 -1
- package/lib/components/ElementHeader/styles.module.scss +1 -1
- package/lib/components/EmptyState/styles.module.scss +1 -2
- package/lib/components/ErrorWrapper/styles.module.scss +3 -3
- package/lib/components/Expander/styles.module.scss +0 -2
- package/lib/components/Expander/styles.module.scss.d.ts +1 -1
- package/lib/components/ExpanderList/index.js +20 -19
- package/lib/components/ExpanderList/index.js.map +1 -1
- package/lib/components/ExpanderList/styles.module.scss +10 -11
- package/lib/components/FavoriteButton/index.js +3 -3
- package/lib/components/FavoriteButton/index.js.map +1 -1
- package/lib/components/FavoriteButton/styles.module.scss +0 -1
- package/lib/components/Filter/FilterButton/styles.module.scss +5 -6
- package/lib/components/Filter/FilterButtonAndChipsWrapper/styles.module.scss +0 -1
- package/lib/components/Filter/FilterDrawer/styles.module.scss +0 -1
- package/lib/components/Filter/FilterLinkList/FilterLinkList.module.scss +5 -6
- package/lib/components/Filter/FilterOverviewSearch/styles.module.scss +1 -4
- package/lib/components/Filter/FilterSearch/styles.module.scss +14 -15
- package/lib/components/Filter/FilterSort/styles.module.scss +1 -2
- package/lib/components/Filter/FilterStateWrapper/styles.module.scss +0 -2
- package/lib/components/Filter/LoaderSpinner/styles.module.scss +2 -4
- package/lib/components/FormFieldTag/styles.module.scss +0 -1
- package/lib/components/FormGroup/styles.module.scss +0 -1
- package/lib/components/HelpBubble/styles.module.scss +0 -1
- package/lib/components/HelpDetails/styles.module.scss +2 -4
- package/lib/components/HelpDrawer/styles.module.scss +1 -2
- package/lib/components/HelpPanel/HelpPanel.d.ts +2 -2
- package/lib/components/HelpPanel/index.js +1 -17
- package/lib/components/HelpPanel/index.js.map +1 -1
- package/lib/components/HelpPanel/styles.module.scss +2 -22
- package/lib/components/HelpPanel/styles.module.scss.d.ts +0 -4
- package/lib/components/HelpTeaser/styles.module.scss +7 -9
- package/lib/components/HelpTriggerIcon/HelpTriggerIcon.d.ts +2 -2
- package/lib/components/HelpTriggerIcon/styles.module.scss +20 -22
- package/lib/components/HelpTriggerIcon/styles.module.scss.d.ts +1 -1
- package/lib/components/HelpTriggerInline/styles.module.scss +3 -5
- package/lib/components/HelpTriggerStandalone/styles.module.scss +3 -5
- package/lib/components/HighlightPanel/styles.module.scss +2 -3
- package/lib/components/Icons/AdditionalIconInformation.d.ts +4 -0
- package/lib/components/Icons/AdditionalIconInformation.js +14 -10
- package/lib/components/Icons/AdditionalIconInformation.js.map +1 -1
- package/lib/components/Icons/HealthcarePersonnelSecurity.js +4 -4
- package/lib/components/Icons/HealthcarePersonnelSecurity.js.map +1 -1
- package/lib/components/Icons/HistoryDocument.js +6 -7
- package/lib/components/Icons/HistoryDocument.js.map +1 -1
- package/lib/components/Icons/IconNames.d.ts +1 -1
- package/lib/components/Icons/IconNames.js +1 -0
- package/lib/components/Icons/IconNames.js.map +1 -1
- package/lib/components/Icons/YesNo.d.ts +3 -0
- package/lib/components/Icons/YesNo.js +53 -0
- package/lib/components/Icons/YesNo.js.map +1 -0
- package/lib/components/Illustrations/IllustrationNames.d.ts +1 -1
- package/lib/components/Illustrations/IllustrationNames.js +2 -0
- package/lib/components/Illustrations/IllustrationNames.js.map +1 -1
- package/lib/components/Illustrations/MoveAway.d.ts +11 -0
- package/lib/components/Illustrations/MoveAway.js +18 -0
- package/lib/components/Illustrations/MoveAway.js.map +1 -0
- package/lib/components/Illustrations/MoveAwayMedium.d.ts +3 -0
- package/lib/components/Illustrations/MoveAwayMedium.js +114 -0
- package/lib/components/Illustrations/MoveAwayMedium.js.map +1 -0
- package/lib/components/InfoTeaser/styles.module.scss +6 -8
- package/lib/components/Label/styles.module.scss +1 -1
- package/lib/components/LinkList/LinkList.d.ts +1 -1
- package/lib/components/LinkList/styles.module.scss +9 -11
- package/lib/components/LinkList/styles.module.scss.d.ts +1 -1
- package/lib/components/ListEditMode/styles.module.scss +5 -7
- package/lib/components/Loader/Loader.d.ts +1 -1
- package/lib/components/Loader/index.js +4 -4
- package/lib/components/Loader/index.js.map +1 -1
- package/lib/components/Loader/styles.module.scss +7 -7
- package/lib/components/Loader/styles.module.scss.d.ts +3 -3
- package/lib/components/Modal/constants.d.ts +1 -1
- package/lib/components/Modal/index.js +2 -2
- package/lib/components/Modal/index.js.map +1 -1
- package/lib/components/Modal/styles.module.scss +14 -19
- package/lib/components/Modal/styles.module.scss.d.ts +2 -3
- package/lib/components/Panel/index.js +1 -1
- package/lib/components/Panel/index.js.map +1 -1
- package/lib/components/Panel/styles.module.scss +15 -16
- package/lib/components/Panel/styles.module.scss.d.ts +1 -1
- package/lib/components/PopMenu/index.js +7 -4
- package/lib/components/PopMenu/index.js.map +1 -1
- package/lib/components/PopOver/styles.module.scss +1 -3
- package/lib/components/Progressbar/Progressbar.d.ts +1 -1
- package/lib/components/Progressbar/constants.d.ts +1 -1
- package/lib/components/Progressbar/index.js +4 -4
- package/lib/components/Progressbar/index.js.map +1 -1
- package/lib/components/Radio/Radio.d.ts +28 -0
- package/lib/components/Radio/index.d.ts +3 -0
- package/lib/components/Radio/index.js +7 -0
- package/lib/components/Radio/index.js.map +1 -0
- package/lib/components/{RadioButton → Radio}/styles.module.scss +8 -9
- package/lib/components/Radio/styles.module.scss.d.ts +26 -0
- package/lib/components/ServiceMessage/styles.module.scss +20 -22
- package/lib/components/Slider/styles.module.scss +1 -2
- package/lib/components/StatusDot/styles.module.scss +4 -5
- package/lib/components/StickyNote/index.js +2 -2
- package/lib/components/StickyNote/index.js.map +1 -1
- package/lib/components/StickyNote/styles.module.scss +9 -10
- package/lib/components/Tabs/TabList/styles.module.scss +20 -18
- package/lib/components/Tabs/TabPanel/styles.module.scss +2 -3
- package/lib/components/Tabs/styles.module.scss +0 -1
- package/lib/components/Tag/styles.module.scss +0 -1
- package/lib/components/Tile/styles.module.scss +5 -7
- package/lib/components/Toast/styles.module.scss +0 -1
- package/lib/components/Toggle/styles.module.scss +9 -10
- package/lib/components/Validation/index.js +2 -2
- package/lib/components/Validation/index.js.map +1 -1
- package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss +0 -2
- package/lib/components/VisualCheckboxCloud/styles.module.scss +0 -1
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss +0 -2
- package/lib/components/VisualCheckboxGroup/styles.module.scss +0 -1
- package/lib/components/VisualContentgroupWithImage/styles.module.scss +0 -1
- package/lib/components/VisualRadioCloud/Radio/index.js +1 -1
- package/lib/components/VisualRadioCloud/Radio/styles.module.scss +0 -2
- package/lib/components/VisualRadioCloud/index.js +1 -1
- package/lib/components/VisualRadioCloud/styles.module.scss +0 -1
- package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss +0 -2
- package/lib/components/VisualRadioGroup/styles.module.scss +0 -1
- package/lib/constants.d.ts +2 -3
- package/lib/constants.js +2 -3
- package/lib/constants.js.map +1 -1
- package/lib/floating-ui.react.js +1 -458
- package/lib/floating-ui.react.js.map +1 -1
- package/lib/hooks/useDismissablePopover.d.ts +20 -0
- package/lib/hooks/useDismissablePopover.js +66 -0
- package/lib/hooks/useDismissablePopover.js.map +1 -0
- package/lib/hooks/useOutsideEvent.d.ts +3 -0
- package/lib/hooks/useOutsideEvent.js +24 -3
- package/lib/hooks/useOutsideEvent.js.map +1 -1
- package/lib/hooks/useReturnFocusOnClose.d.ts +7 -0
- package/lib/hooks/useReturnFocusOnClose.js +22 -0
- package/lib/hooks/useReturnFocusOnClose.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lib/scss/_visual-form.scss +47 -47
- package/lib/scss/helsenorge.scss +1 -0
- package/lib/scss/supernova/styles/colors.css +177 -122
- package/lib/scss/supernova/styles/typography.css +58 -51
- package/lib/scss/supernova-legacy/index.css +2 -0
- package/lib/scss/supernova-legacy/styles/legacy-colors.css +111 -0
- package/lib/utils/formSpacing.js +3 -3
- package/lib/utils/formSpacing.js.map +1 -1
- package/package.json +8 -14
- package/scss/_visual-form.scss +47 -47
- package/scss/helsenorge.scss +1 -0
- package/scss/supernova/styles/colors.css +177 -122
- package/scss/supernova/styles/typography.css +58 -51
- package/scss/supernova-legacy/index.css +2 -0
- package/scss/supernova-legacy/styles/legacy-colors.css +111 -0
- package/lib/DictionaryTrigger.js +0 -27
- package/lib/RadioButton.js +0 -84
- package/lib/RadioButton.js.map +0 -1
- package/lib/components/HelpTooltip/HelpTooltip.d.ts +0 -12
- package/lib/components/HelpTooltip/index.d.ts +0 -3
- package/lib/components/HelpTooltip/index.js +0 -48
- package/lib/components/HelpTooltip/index.js.map +0 -1
- package/lib/components/RadioButton/RadioButton.d.ts +0 -28
- package/lib/components/RadioButton/index.d.ts +0 -3
- package/lib/components/RadioButton/index.js +0 -7
- package/lib/components/RadioButton/index.js.map +0 -1
- package/lib/components/RadioButton/styles.module.scss.d.ts +0 -26
- package/lib/designsystem-react.css +0 -273
- /package/lib/components/{RadioButton → Radio}/RadioMarker/RadioMarker.d.ts +0 -0
- /package/lib/components/{RadioButton → Radio}/RadioMarker/styles.module.scss +0 -0
- /package/lib/components/{RadioButton → Radio}/RadioMarker/styles.module.scss.d.ts +0 -0
|
@@ -3,19 +3,18 @@
|
|
|
3
3
|
@use '../../scss/font-settings' as font-settings;
|
|
4
4
|
@use '../../scss/breakpoints' as breakpoints;
|
|
5
5
|
@use '../../scss/screen-reader' as *;
|
|
6
|
-
@import '../../scss/supernova/styles/spacers';
|
|
7
6
|
|
|
8
7
|
$padding-clickable-area-top-bottom: 8px;
|
|
9
8
|
$padding-clickable-area-left: 8px;
|
|
10
9
|
|
|
11
|
-
.radio-
|
|
10
|
+
.radio-errors {
|
|
12
11
|
font-size: font-settings.$font-size-sm;
|
|
13
12
|
font-weight: 600;
|
|
14
13
|
color: palette.$cherry600;
|
|
15
14
|
margin-top: 0;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
.radio-
|
|
17
|
+
.radio-wrapper {
|
|
19
18
|
margin-left: -$padding-clickable-area-left;
|
|
20
19
|
|
|
21
20
|
&__large {
|
|
@@ -40,7 +39,7 @@ $padding-clickable-area-left: 8px;
|
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
.radio-
|
|
42
|
+
.radio-label {
|
|
44
43
|
display: flex;
|
|
45
44
|
align-items: flex-start;
|
|
46
45
|
cursor: pointer;
|
|
@@ -71,7 +70,7 @@ $padding-clickable-area-left: 8px;
|
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
&:has(input:focus-visible) {
|
|
74
|
-
border: 1px solid var(--color-action-border-
|
|
73
|
+
border: 1px solid var(--color-action-border-light-focus);
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
&--on-blueberry {
|
|
@@ -173,19 +172,19 @@ $padding-clickable-area-left: 8px;
|
|
|
173
172
|
}
|
|
174
173
|
}
|
|
175
174
|
|
|
176
|
-
.radio
|
|
175
|
+
.radio {
|
|
177
176
|
@include sr-only;
|
|
178
177
|
}
|
|
179
178
|
|
|
180
|
-
.
|
|
179
|
+
.radio__marker-wrapper {
|
|
181
180
|
margin-right: var(--core-space-s);
|
|
182
181
|
}
|
|
183
182
|
|
|
184
|
-
.
|
|
183
|
+
.radio-sublabel-wrapper {
|
|
185
184
|
margin-top: -$padding-clickable-area-top-bottom;
|
|
186
185
|
padding-left: calc(2.8rem + $padding-clickable-area-left);
|
|
187
186
|
}
|
|
188
187
|
|
|
189
|
-
.
|
|
188
|
+
.radio-afterlabelchildren-wrapper {
|
|
190
189
|
padding-top: $padding-clickable-area-top-bottom;
|
|
191
190
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type Styles = {
|
|
2
|
+
radio: string;
|
|
3
|
+
'radio__marker-wrapper': string;
|
|
4
|
+
'radio-afterlabelchildren-wrapper': string;
|
|
5
|
+
'radio-errors': string;
|
|
6
|
+
'radio-label': string;
|
|
7
|
+
'radio-label__large': string;
|
|
8
|
+
'radio-label__large--disabled': string;
|
|
9
|
+
'radio-label__large--invalid': string;
|
|
10
|
+
'radio-label__large--on-blueberry': string;
|
|
11
|
+
'radio-label__large--on-grey': string;
|
|
12
|
+
'radio-label--disabled': string;
|
|
13
|
+
'radio-label--invalid': string;
|
|
14
|
+
'radio-label--on-dark': string;
|
|
15
|
+
'radio-sublabel-wrapper': string;
|
|
16
|
+
'radio-wrapper': string;
|
|
17
|
+
'radio-wrapper__large': string;
|
|
18
|
+
'radio-wrapper__large--invalid': string;
|
|
19
|
+
'radio-wrapper__large--on-blueberry': string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type ClassNames = keyof Styles;
|
|
23
|
+
|
|
24
|
+
declare const styles: Styles;
|
|
25
|
+
|
|
26
|
+
export default styles;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '../../scss/font-settings' as font-settings;
|
|
3
|
-
@import '../../scss/supernova/styles/colors.css';
|
|
4
|
-
@import '../../scss/supernova/styles/spacers.css';
|
|
5
3
|
@import '../../scss/breakpoints';
|
|
6
4
|
@import '../../scss/grid';
|
|
7
5
|
|
|
@@ -16,43 +14,43 @@
|
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
&--success {
|
|
19
|
-
background-color: var(--color-notification-background
|
|
17
|
+
background-color: var(--color-notification-success-background);
|
|
20
18
|
|
|
21
19
|
&#{$servicemessage},
|
|
22
20
|
&#{$servicemessage}__label-container {
|
|
23
|
-
border-color: var(--color-notification-border
|
|
21
|
+
border-color: var(--color-notification-success-border);
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
&--info {
|
|
28
|
-
background-color: var(--color-notification-background
|
|
26
|
+
background-color: var(--color-notification-info-background);
|
|
29
27
|
|
|
30
28
|
&#{$servicemessage},
|
|
31
29
|
&#{$servicemessage}__label-container {
|
|
32
|
-
border-color: var(--color-notification-border
|
|
30
|
+
border-color: var(--color-notification-info-border);
|
|
33
31
|
}
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
&--warn {
|
|
37
|
-
background-color: var(--color-notification-background
|
|
35
|
+
background-color: var(--color-notification-warning-background);
|
|
38
36
|
|
|
39
37
|
&#{$servicemessage},
|
|
40
38
|
&#{$servicemessage}__label-container {
|
|
41
|
-
border-color: var(--color-notification-border
|
|
39
|
+
border-color: var(--color-notification-warning-border);
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
&--error {
|
|
46
|
-
background-color: var(--color-notification-background
|
|
44
|
+
background-color: var(--color-notification-error-background);
|
|
47
45
|
|
|
48
46
|
&#{$servicemessage},
|
|
49
47
|
&#{$servicemessage}__label-container {
|
|
50
|
-
border-color: var(--color-notification-border
|
|
48
|
+
border-color: var(--color-notification-error-border);
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
&__icon {
|
|
55
|
-
fill: var(--color-action-graphics-
|
|
53
|
+
fill: var(--color-action-graphics-dark-normal);
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
&__container {
|
|
@@ -77,46 +75,46 @@
|
|
|
77
75
|
}
|
|
78
76
|
|
|
79
77
|
&--has-expander:has(:focus-visible) {
|
|
80
|
-
box-shadow: inset 0 0 0 4px var(--color-action-border-
|
|
78
|
+
box-shadow: inset 0 0 0 4px var(--color-action-border-dark-focus);
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
&--info#{&}--has-expander {
|
|
84
82
|
&:hover {
|
|
85
|
-
background-color: var(--color-notification-background-
|
|
83
|
+
background-color: var(--color-notification-info-background-hover);
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
&:active {
|
|
89
|
-
background-color: var(--color-notification-background-
|
|
87
|
+
background-color: var(--color-notification-info-background-active);
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
&--success#{&}--has-expander {
|
|
94
92
|
&:hover {
|
|
95
|
-
background-color: var(--color-notification-background-
|
|
93
|
+
background-color: var(--color-notification-success-background-hover);
|
|
96
94
|
}
|
|
97
95
|
|
|
98
96
|
&:active {
|
|
99
|
-
background-color: var(--color-notification-background-
|
|
97
|
+
background-color: var(--color-notification-success-background-active);
|
|
100
98
|
}
|
|
101
99
|
}
|
|
102
100
|
|
|
103
101
|
&--warn#{&}--has-expander {
|
|
104
102
|
&:hover {
|
|
105
|
-
background-color: var(--color-notification-background-
|
|
103
|
+
background-color: var(--color-notification-warning-background-hover);
|
|
106
104
|
}
|
|
107
105
|
|
|
108
106
|
&:active {
|
|
109
|
-
background-color: var(--color-notification-background-
|
|
107
|
+
background-color: var(--color-notification-warning-background-active);
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
|
|
113
111
|
&--error#{&}--has-expander {
|
|
114
112
|
&:hover {
|
|
115
|
-
background-color: var(--color-notification-background-
|
|
113
|
+
background-color: var(--color-notification-error-background-hover);
|
|
116
114
|
}
|
|
117
115
|
|
|
118
116
|
&:active {
|
|
119
|
-
background-color: var(--color-notification-background-
|
|
117
|
+
background-color: var(--color-notification-error-background-active);
|
|
120
118
|
}
|
|
121
119
|
}
|
|
122
120
|
}
|
|
@@ -223,7 +221,7 @@
|
|
|
223
221
|
align-items: center;
|
|
224
222
|
border: none;
|
|
225
223
|
width: fit-content;
|
|
226
|
-
color: var(--color-action-text-
|
|
224
|
+
color: var(--color-action-text-dark-normal);
|
|
227
225
|
font-weight: 600;
|
|
228
226
|
font-size: font-settings.$font-size-xs;
|
|
229
227
|
line-height: 1.25rem;
|
|
@@ -239,7 +237,7 @@
|
|
|
239
237
|
}
|
|
240
238
|
|
|
241
239
|
&:focus-visible {
|
|
242
|
-
box-shadow: 0 0 0 4px var(--color-action-border-
|
|
240
|
+
box-shadow: 0 0 0 4px var(--color-action-border-dark-focus);
|
|
243
241
|
background-color: transparent;
|
|
244
242
|
border: 0;
|
|
245
243
|
outline: none;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@use '../../scss/palette' as palette;
|
|
3
3
|
@use '../../scss/screen-reader' as *;
|
|
4
4
|
@use '../../scss/breakpoints' as breakpoints;
|
|
5
|
-
@import '../../scss/supernova/styles/colors.css';
|
|
6
5
|
|
|
7
6
|
$track-height-offset: 1rem;
|
|
8
7
|
$mark-size: spacers.getSpacer(l);
|
|
@@ -118,7 +117,7 @@ $mark-size: spacers.getSpacer(l);
|
|
|
118
117
|
}
|
|
119
118
|
|
|
120
119
|
&--invalid {
|
|
121
|
-
border-color: var(--color-notification-border
|
|
120
|
+
border-color: var(--color-notification-error-border);
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
&--disabled {
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
@use '../../scss/font-mixins' as fonts;
|
|
6
6
|
@use '../../scss/screen-reader' as *;
|
|
7
7
|
@use '../../scss/breakpoints' as breakpoints;
|
|
8
|
-
@import '../../scss/supernova/styles/colors.css';
|
|
9
8
|
|
|
10
9
|
$status-dot-size: 1rem;
|
|
11
10
|
|
|
@@ -75,7 +74,7 @@ $status-dot-size: 1rem;
|
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
&--transparent {
|
|
78
|
-
fill: var(--color-disabled-border);
|
|
77
|
+
fill: var(--color-disabled-border-dark);
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
&--transparent#{&}--on-dark,
|
|
@@ -86,7 +85,7 @@ $status-dot-size: 1rem;
|
|
|
86
85
|
&--hidden#{&}--on-dark,
|
|
87
86
|
&--login#{&}--on-dark,
|
|
88
87
|
&--attachment#{&}--on-dark {
|
|
89
|
-
fill: var(--color-base-graphics-
|
|
88
|
+
fill: var(--color-base-graphics-light);
|
|
90
89
|
}
|
|
91
90
|
|
|
92
91
|
svg {
|
|
@@ -95,12 +94,12 @@ $status-dot-size: 1rem;
|
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
&__label {
|
|
98
|
-
color: var(--color-base-text-
|
|
97
|
+
color: var(--color-base-subdued-text-dark);
|
|
99
98
|
|
|
100
99
|
@include fonts.sublabel-subdued;
|
|
101
100
|
|
|
102
101
|
&--on-dark {
|
|
103
|
-
color: var(--color-base-text-
|
|
102
|
+
color: var(--color-base-text-light);
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
105
|
}
|
|
@@ -47,7 +47,7 @@ var Triangle = ({ isHover, isFocus, isActive, isError }) => {
|
|
|
47
47
|
if (!isError) {
|
|
48
48
|
if (isHover) colors.background = "var(--component-stickynote-background-fold-normal-medium)";
|
|
49
49
|
if (isFocus) {
|
|
50
|
-
colors.border = "var(--color-action-border-
|
|
50
|
+
colors.border = "var(--color-action-border-dark-focus)";
|
|
51
51
|
colors.background = "var(--component-stickynote-background-fold-normal-medium)";
|
|
52
52
|
}
|
|
53
53
|
if (isActive) colors.background = "var(--component-stickynote-background-fold-normal-dark)";
|
|
@@ -56,7 +56,7 @@ var Triangle = ({ isHover, isFocus, isActive, isError }) => {
|
|
|
56
56
|
colors.background = "var(--component-stickynote-background-fold-error-light)";
|
|
57
57
|
if (isHover) colors.background = "var(--component-stickynote-background-fold-error-medium)";
|
|
58
58
|
if (isFocus) {
|
|
59
|
-
colors.border = "var(--color-action-border-
|
|
59
|
+
colors.border = "var(--color-action-border-dark-focus)";
|
|
60
60
|
colors.background = "var(--component-stickynote-background-fold-error-medium)";
|
|
61
61
|
}
|
|
62
62
|
if (isActive) colors.background = "var(--component-stickynote-background-fold-error-dark)";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/StickyNote/Close.tsx","../../../src/components/StickyNote/Triangle.tsx","../../../src/components/StickyNote/StickyNote.tsx","../../../src/components/StickyNote/index.ts"],"sourcesContent":["import classNames from 'classnames';\n\nimport { useIsMobileBreakpoint } from '../../hooks/useIsMobileBreakpoint';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { mergeRefs } from '../../utils/refs';\nimport Icon from '../Icon';\nimport X from '../Icons/X';\n\nimport styles from './styles.module.scss';\n\nexport interface CloseProps {\n /** Function is called when user clicks the button */\n onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n /** Sets the aria-label of the button */\n ariaLabel?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the button element */\n ref?: React.Ref<HTMLButtonElement | null>;\n}\n\n/*\n Denne er kopiert fra Close-komponent. \n Det er for å kunne ha en egen lokal variant for StickyNote. \n Likt som i Figma.\n */\n\nconst Close: React.FC<CloseProps> = (props: CloseProps) => {\n const { testId, ariaLabel = 'Lukk', onClick, ref } = props;\n const { refObject, isHovered } = usePseudoClasses();\n\n const iconSize = useIsMobileBreakpoint() ? 38 : 48;\n\n const closeClasses = classNames(styles.close);\n\n return (\n <button\n ref={mergeRefs([ref, refObject])}\n data-testid={testId}\n className={closeClasses}\n aria-label={ariaLabel}\n onClick={onClick}\n type=\"button\"\n >\n <span className={classNames(styles['close__inner-container'])}>\n <Icon svgIcon={X} color=\"black\" size={iconSize} isHovered={isHovered} />\n </span>\n </button>\n );\n};\n\nexport default Close;\n","import { useId } from 'react';\n\ninterface TriangleProps {\n isHover: boolean;\n isFocus: boolean;\n isActive: boolean;\n isError: boolean;\n}\n\nexport interface Palette {\n border: string;\n background: string;\n}\n\nconst Triangle: React.FC<TriangleProps> = ({ isHover, isFocus, isActive, isError }) => {\n const uniqueId = useId();\n const maskIdFocus = `${uniqueId}-mask-focus`;\n const maskIdNormal = `${uniqueId}-mask-normal`;\n const palette = ((): Palette => {\n const colors: Palette = {\n border: 'var(--component-stickynote-border-normal)',\n background: 'var(--component-stickynote-background-fold-normal-light)',\n };\n\n if (!isError) {\n if (isHover) {\n colors.background = 'var(--component-stickynote-background-fold-normal-medium)';\n }\n if (isFocus) {\n colors.border = 'var(--color-action-border-onlight-focus)';\n colors.background = 'var(--component-stickynote-background-fold-normal-medium)';\n }\n if (isActive) {\n colors.background = 'var(--component-stickynote-background-fold-normal-dark)';\n }\n } else {\n colors.border = 'var(--component-stickynote-border-error)';\n colors.background = 'var(--component-stickynote-background-fold-error-light)';\n if (isHover) {\n colors.background = 'var(--component-stickynote-background-fold-error-medium)';\n }\n if (isFocus) {\n colors.border = 'var(--color-action-border-onlight-focus)';\n colors.background = 'var(--component-stickynote-background-fold-error-medium)';\n }\n if (isActive) {\n colors.background = 'var(--component-stickynote-background-fold-error-dark)';\n }\n }\n return colors;\n })();\n\n let svg: React.ReactNode;\n\n if (isFocus) {\n svg = (\n <svg width=\"21\" height=\"21\" viewBox=\"0 0 21 21\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <mask id={maskIdFocus} fill=\"white\">\n <path d=\"M0.493163 20.9211L0.276366 20.9211L0.276367 0.921142L20.2764 0.921143L20.2764 1.13794L0.493163 20.9211Z\" />\n </mask>\n <path\n d=\"M0.493163 20.9211L0.276366 20.9211L0.276367 0.921142L20.2764 0.921143L20.2764 1.13794L0.493163 20.9211Z\"\n fill={palette.background}\n />\n <path\n d=\"M0.493163 20.9211L0.493163 22.9211L1.32159 22.9211L1.90738 22.3354L0.493163 20.9211ZM0.276366 20.9211L-1.72363 20.9211L-1.72363 22.9211L0.276366 22.9211L0.276366 20.9211ZM0.276367 0.921142L0.276367 -1.07886L-1.72363 -1.07886L-1.72363 0.921142L0.276367 0.921142ZM20.2764 0.921143L22.2764 0.921143L22.2764 -1.07886L20.2764 -1.07886L20.2764 0.921143ZM20.2764 1.13794L21.6906 2.55215L22.2764 1.96637L22.2764 1.13794L20.2764 1.13794ZM0.493163 20.9211L0.493163 18.9211L0.276366 18.9211L0.276366 20.9211L0.276366 22.9211L0.493163 22.9211L0.493163 20.9211ZM0.276366 20.9211L2.27637 20.9211L2.27637 0.921142L0.276367 0.921142L-1.72363 0.921142L-1.72363 20.9211L0.276366 20.9211ZM0.276367 0.921142L0.276367 2.92114L20.2764 2.92114L20.2764 0.921143L20.2764 -1.07886L0.276367 -1.07886L0.276367 0.921142ZM20.2764 0.921143L18.2764 0.921142L18.2764 1.13794L20.2764 1.13794L22.2764 1.13794L22.2764 0.921143L20.2764 0.921143ZM20.2764 1.13794L18.8622 -0.276274L-0.92105 19.5069L0.493163 20.9211L1.90738 22.3354L21.6906 2.55215L20.2764 1.13794Z\"\n fill={palette.border}\n mask={`url(#${maskIdFocus})`}\n />\n </svg>\n );\n } else {\n svg = (\n <svg width=\"21\" height=\"21\" viewBox=\"0 0 21 21\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <mask id={maskIdNormal} fill=\"white\">\n <path d=\"M0.923827 20.9211L0.70703 20.9211L0.707031 0.921142L20.707 0.921143L20.707 1.13794L0.923827 20.9211Z\" />\n </mask>\n <path\n d=\"M0.923827 20.9211L0.70703 20.9211L0.707031 0.921142L20.707 0.921143L20.707 1.13794L0.923827 20.9211Z\"\n fill={palette.background}\n />\n <path\n d=\"M0.923827 20.9211L0.923827 21.9211L1.33804 21.9211L1.63093 21.6282L0.923827 20.9211ZM0.70703 20.9211L-0.29297 20.9211L-0.29297 21.9211L0.70703 21.9211L0.70703 20.9211ZM0.707031 0.921142L0.707031 -0.0788582L-0.292969 -0.0788583L-0.292969 0.921142L0.707031 0.921142ZM20.707 0.921143L21.707 0.921143L21.707 -0.0788574L20.707 -0.0788574L20.707 0.921143ZM20.707 1.13794L21.4141 1.84505L21.707 1.55215L21.707 1.13794L20.707 1.13794ZM0.923827 20.9211L0.923827 19.9211L0.70703 19.9211L0.70703 20.9211L0.70703 21.9211L0.923827 21.9211L0.923827 20.9211ZM0.70703 20.9211L1.70703 20.9211L1.70703 0.921142L0.707031 0.921142L-0.292969 0.921142L-0.29297 20.9211L0.70703 20.9211ZM0.707031 0.921142L0.707031 1.92114L20.707 1.92114L20.707 0.921143L20.707 -0.0788574L0.707031 -0.0788582L0.707031 0.921142ZM20.707 0.921143L19.707 0.921143L19.707 1.13794L20.707 1.13794L21.707 1.13794L21.707 0.921143L20.707 0.921143ZM20.707 1.13794L19.9999 0.430833L0.21672 20.214L0.923827 20.9211L1.63093 21.6282L21.4141 1.84505L20.707 1.13794Z\"\n fill={palette.border}\n mask={`url(#${maskIdNormal})`}\n />\n </svg>\n );\n }\n\n return <>{svg}</>;\n};\n\nexport default Triangle;\n","import { useLayoutEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport Close from './Close';\nimport Triangle from './Triangle';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\n\nimport styles from './styles.module.scss';\n\nexport interface StickyNoteProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** Aria label for the delete/close button */\n arialabelXButton: string;\n /** Activates the error styling */\n error?: boolean;\n /** Error text to show below the note */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Text shown under the textarea */\n footerText?: string;\n /** Function run when clicking the delete/close button */\n onXButtonClick?: () => void;\n /** Function run if user clicks the component while it is disabled */\n onClickWhileDisabled?: () => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Timestamp shown over the textarea */\n timestamp: string;\n /** Classname for the outer wrapper */\n wrapperClassName?: string;\n}\n\nconst StickyNote: React.FC<StickyNoteProps> = (props: StickyNoteProps) => {\n const {\n wrapperClassName,\n timestamp,\n onXButtonClick,\n arialabelXButton,\n footerText,\n error,\n errorText,\n errorTextId: errorTextIdProp,\n onClickWhileDisabled,\n testId,\n ...textareaProps\n } = props;\n const errorTextId = useIdWithFallback(errorTextIdProp);\n const showErrorStyling = error || !!errorText;\n const stickynoteRef = useRef<HTMLDivElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const { isFocused: isTextareaFocused } = usePseudoClasses<HTMLTextAreaElement | null>(textareaRef);\n const { isHovered, isActive } = usePseudoClasses<HTMLDivElement | null>(stickynoteRef);\n\n const handleWrapperClick = (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>): void => {\n if ((event.target as HTMLElement).closest('button')) {\n return;\n }\n if (textareaProps.disabled) {\n if (onClickWhileDisabled) onClickWhileDisabled();\n return;\n }\n textareaRef.current?.focus();\n };\n\n const resizeTextarea = (): void => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n resizeTarget(textarea);\n };\n\n const resizeTarget = (target: HTMLTextAreaElement): void => {\n // Reset field height\n target.style.height = 'inherit';\n // Set new height\n target.style.height = `${target.scrollHeight}px`;\n };\n\n useLayoutEffect(() => {\n resizeTextarea();\n // Must run after the shadow DOM has been set up to work on microweb\n setTimeout(() => resizeTextarea(), 1000);\n }, []);\n\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\n const textarea = e.target as HTMLTextAreaElement;\n resizeTarget(textarea);\n if (textareaProps.onChange) textareaProps.onChange(e);\n };\n\n return (\n <div>\n <div\n data-testid={testId}\n ref={stickynoteRef}\n className={classNames(styles['sticky-note'], wrapperClassName, {\n [styles['sticky-note--focused']]: isTextareaFocused,\n [styles['sticky-note--active']]: isActive,\n [styles['sticky-note--hovered']]: isHovered && !isTextareaFocused && !textareaProps.disabled,\n [styles['sticky-note--error']]: showErrorStyling,\n })}\n onClick={handleWrapperClick}\n role=\"textbox\"\n tabIndex={-1}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n handleWrapperClick(e as React.KeyboardEvent<HTMLDivElement>);\n }\n }}\n >\n <div className={classNames(styles['sticky-note__header'])}>\n {timestamp && <span className={styles['sticky-note__header__timestamp']}>{timestamp}</span>}\n </div>\n <textarea\n ref={textareaRef}\n data-testid={`${testId}-textarea`}\n className={classNames(styles['sticky-note__textarea'], textareaProps.className)}\n {...textareaProps}\n onChange={handleChange}\n aria-describedby={getAriaDescribedBy(props, errorTextId)}\n />\n <Close onClick={onXButtonClick} ariaLabel={arialabelXButton} testId=\"closeButton\" />\n <div className={classNames(styles['sticky-note__footer'])}>{footerText && <span>{footerText}</span>}</div>\n <div className={classNames(styles['sticky-note__triangle'])}>\n <Triangle isHover={isHovered} isActive={isActive} isFocus={isTextareaFocused} isError={showErrorStyling} />\n </div>\n </div>\n {errorText && (\n <p className={styles['sticky-note__error-text']} id={errorTextId}>\n {errorText}\n </p>\n )}\n </div>\n );\n};\n\nexport default StickyNote;\n","import StickyNote from './StickyNote';\nexport * from './StickyNote';\nexport default StickyNote;\n"],"mappings":";;;;;;;;;;;;AA2BA,IAAM,SAA+B,UAAsB;CACzD,MAAM,EAAE,QAAQ,YAAY,QAAQ,SAAS,QAAQ;CACrD,MAAM,EAAE,WAAW,cAAc,iBAAiB;CAElD,MAAM,WAAW,sBAAsB,IAAI,KAAK;CAEhD,MAAM,eAAe,WAAW,OAAO,KAAK;CAE5C,OACE,oBAAC,UAAD;EACE,KAAK,UAAU,CAAC,KAAK,SAAS,CAAC;EAC/B,eAAa;EACb,WAAW;EACX,cAAY;EACH;EACT,MAAK;EAEL,UAAA,oBAAC,QAAD;GAAM,WAAW,WAAW,OAAO,yBAAyB;GAC1D,UAAA,oBAAC,cAAD;IAAM,SAAS;IAAG,OAAM;IAAQ,MAAM;IAAqB;GAAY,CAAA;EACnE,CAAA;CACA,CAAA;AAEZ;;;ACnCA,IAAM,YAAqC,EAAE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C;EACD,SAAS;EACT,MAAK;EACL,UAAU;EACV,YAAW,MAAK;GACd,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KACjC,mBAAmB,CAAwC;EAE/D;EAhBF,UAAA;GAkBE,oBAAC,OAAD;IAAK,WAAW,WAAW,OAAO,sBAAsB;IACrD,UAAA,aAAa,oBAAC,QAAD;KAAM,WAAW,OAAO;KAAoC,UAAA;IAAgB,CAAA;GACvF,CAAA;GACL,oBAAC,YAAD;IACE,KAAK;IACL,eAAa,GAAG,OAAO;IACvB,WAAW,WAAW,OAAO,0BAA0B,cAAc,SAAS;IAC9E,GAAI;IACJ,UAAU;IACV,oBAAkB,mBAAmB,OAAO,WAAW;GACxD,CAAA;GACD,oBAAC,OAAD;IAAO,SAAS;IAAgB,WAAW;IAAkB,QAAO;GAAe,CAAA;GACnF,oBAAC,OAAD;IAAK,WAAW,WAAW,OAAO,sBAAsB;IAAI,UAAA,cAAc,oBAAC,QAAD,EAAA,UAAO,WAAiB,CAAA;GAAO,CAAA;GACzG,oBAAC,OAAD;IAAK,WAAW,WAAW,OAAO,wBAAwB;IACxD,UAAA,oBAAC,UAAD;KAAU,SAAS;KAAqB;KAAU,SAAS;KAAmB,SAAS;IAAmB,CAAA;GACvG,CAAA;EACF;CACJ,CAAA,GAAA,aACC,oBAAC,KAAD;EAAG,WAAW,OAAO;EAA4B,IAAI;EAClD,UAAA;CACA,CAAA,CAEF,EAAA,CAAA;AAET;;;ACtIA,IAAA,qBAAe"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/StickyNote/Close.tsx","../../../src/components/StickyNote/Triangle.tsx","../../../src/components/StickyNote/StickyNote.tsx","../../../src/components/StickyNote/index.ts"],"sourcesContent":["import classNames from 'classnames';\n\nimport { useIsMobileBreakpoint } from '../../hooks/useIsMobileBreakpoint';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { mergeRefs } from '../../utils/refs';\nimport Icon from '../Icon';\nimport X from '../Icons/X';\n\nimport styles from './styles.module.scss';\n\nexport interface CloseProps {\n /** Function is called when user clicks the button */\n onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n /** Sets the aria-label of the button */\n ariaLabel?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Ref passed to the button element */\n ref?: React.Ref<HTMLButtonElement | null>;\n}\n\n/*\n Denne er kopiert fra Close-komponent. \n Det er for å kunne ha en egen lokal variant for StickyNote. \n Likt som i Figma.\n */\n\nconst Close: React.FC<CloseProps> = (props: CloseProps) => {\n const { testId, ariaLabel = 'Lukk', onClick, ref } = props;\n const { refObject, isHovered } = usePseudoClasses();\n\n const iconSize = useIsMobileBreakpoint() ? 38 : 48;\n\n const closeClasses = classNames(styles.close);\n\n return (\n <button\n ref={mergeRefs([ref, refObject])}\n data-testid={testId}\n className={closeClasses}\n aria-label={ariaLabel}\n onClick={onClick}\n type=\"button\"\n >\n <span className={classNames(styles['close__inner-container'])}>\n <Icon svgIcon={X} color=\"black\" size={iconSize} isHovered={isHovered} />\n </span>\n </button>\n );\n};\n\nexport default Close;\n","import { useId } from 'react';\n\ninterface TriangleProps {\n isHover: boolean;\n isFocus: boolean;\n isActive: boolean;\n isError: boolean;\n}\n\nexport interface Palette {\n border: string;\n background: string;\n}\n\nconst Triangle: React.FC<TriangleProps> = ({ isHover, isFocus, isActive, isError }) => {\n const uniqueId = useId();\n const maskIdFocus = `${uniqueId}-mask-focus`;\n const maskIdNormal = `${uniqueId}-mask-normal`;\n const palette = ((): Palette => {\n const colors: Palette = {\n border: 'var(--component-stickynote-border-normal)',\n background: 'var(--component-stickynote-background-fold-normal-light)',\n };\n\n if (!isError) {\n if (isHover) {\n colors.background = 'var(--component-stickynote-background-fold-normal-medium)';\n }\n if (isFocus) {\n colors.border = 'var(--color-action-border-dark-focus)';\n colors.background = 'var(--component-stickynote-background-fold-normal-medium)';\n }\n if (isActive) {\n colors.background = 'var(--component-stickynote-background-fold-normal-dark)';\n }\n } else {\n colors.border = 'var(--component-stickynote-border-error)';\n colors.background = 'var(--component-stickynote-background-fold-error-light)';\n if (isHover) {\n colors.background = 'var(--component-stickynote-background-fold-error-medium)';\n }\n if (isFocus) {\n colors.border = 'var(--color-action-border-dark-focus)';\n colors.background = 'var(--component-stickynote-background-fold-error-medium)';\n }\n if (isActive) {\n colors.background = 'var(--component-stickynote-background-fold-error-dark)';\n }\n }\n return colors;\n })();\n\n let svg: React.ReactNode;\n\n if (isFocus) {\n svg = (\n <svg width=\"21\" height=\"21\" viewBox=\"0 0 21 21\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <mask id={maskIdFocus} fill=\"white\">\n <path d=\"M0.493163 20.9211L0.276366 20.9211L0.276367 0.921142L20.2764 0.921143L20.2764 1.13794L0.493163 20.9211Z\" />\n </mask>\n <path\n d=\"M0.493163 20.9211L0.276366 20.9211L0.276367 0.921142L20.2764 0.921143L20.2764 1.13794L0.493163 20.9211Z\"\n fill={palette.background}\n />\n <path\n d=\"M0.493163 20.9211L0.493163 22.9211L1.32159 22.9211L1.90738 22.3354L0.493163 20.9211ZM0.276366 20.9211L-1.72363 20.9211L-1.72363 22.9211L0.276366 22.9211L0.276366 20.9211ZM0.276367 0.921142L0.276367 -1.07886L-1.72363 -1.07886L-1.72363 0.921142L0.276367 0.921142ZM20.2764 0.921143L22.2764 0.921143L22.2764 -1.07886L20.2764 -1.07886L20.2764 0.921143ZM20.2764 1.13794L21.6906 2.55215L22.2764 1.96637L22.2764 1.13794L20.2764 1.13794ZM0.493163 20.9211L0.493163 18.9211L0.276366 18.9211L0.276366 20.9211L0.276366 22.9211L0.493163 22.9211L0.493163 20.9211ZM0.276366 20.9211L2.27637 20.9211L2.27637 0.921142L0.276367 0.921142L-1.72363 0.921142L-1.72363 20.9211L0.276366 20.9211ZM0.276367 0.921142L0.276367 2.92114L20.2764 2.92114L20.2764 0.921143L20.2764 -1.07886L0.276367 -1.07886L0.276367 0.921142ZM20.2764 0.921143L18.2764 0.921142L18.2764 1.13794L20.2764 1.13794L22.2764 1.13794L22.2764 0.921143L20.2764 0.921143ZM20.2764 1.13794L18.8622 -0.276274L-0.92105 19.5069L0.493163 20.9211L1.90738 22.3354L21.6906 2.55215L20.2764 1.13794Z\"\n fill={palette.border}\n mask={`url(#${maskIdFocus})`}\n />\n </svg>\n );\n } else {\n svg = (\n <svg width=\"21\" height=\"21\" viewBox=\"0 0 21 21\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <mask id={maskIdNormal} fill=\"white\">\n <path d=\"M0.923827 20.9211L0.70703 20.9211L0.707031 0.921142L20.707 0.921143L20.707 1.13794L0.923827 20.9211Z\" />\n </mask>\n <path\n d=\"M0.923827 20.9211L0.70703 20.9211L0.707031 0.921142L20.707 0.921143L20.707 1.13794L0.923827 20.9211Z\"\n fill={palette.background}\n />\n <path\n d=\"M0.923827 20.9211L0.923827 21.9211L1.33804 21.9211L1.63093 21.6282L0.923827 20.9211ZM0.70703 20.9211L-0.29297 20.9211L-0.29297 21.9211L0.70703 21.9211L0.70703 20.9211ZM0.707031 0.921142L0.707031 -0.0788582L-0.292969 -0.0788583L-0.292969 0.921142L0.707031 0.921142ZM20.707 0.921143L21.707 0.921143L21.707 -0.0788574L20.707 -0.0788574L20.707 0.921143ZM20.707 1.13794L21.4141 1.84505L21.707 1.55215L21.707 1.13794L20.707 1.13794ZM0.923827 20.9211L0.923827 19.9211L0.70703 19.9211L0.70703 20.9211L0.70703 21.9211L0.923827 21.9211L0.923827 20.9211ZM0.70703 20.9211L1.70703 20.9211L1.70703 0.921142L0.707031 0.921142L-0.292969 0.921142L-0.29297 20.9211L0.70703 20.9211ZM0.707031 0.921142L0.707031 1.92114L20.707 1.92114L20.707 0.921143L20.707 -0.0788574L0.707031 -0.0788582L0.707031 0.921142ZM20.707 0.921143L19.707 0.921143L19.707 1.13794L20.707 1.13794L21.707 1.13794L21.707 0.921143L20.707 0.921143ZM20.707 1.13794L19.9999 0.430833L0.21672 20.214L0.923827 20.9211L1.63093 21.6282L21.4141 1.84505L20.707 1.13794Z\"\n fill={palette.border}\n mask={`url(#${maskIdNormal})`}\n />\n </svg>\n );\n }\n\n return <>{svg}</>;\n};\n\nexport default Triangle;\n","import { useLayoutEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport Close from './Close';\nimport Triangle from './Triangle';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { getAriaDescribedBy } from '../../utils/accessibility';\n\nimport styles from './styles.module.scss';\n\nexport interface StickyNoteProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** Aria label for the delete/close button */\n arialabelXButton: string;\n /** Activates the error styling */\n error?: boolean;\n /** Error text to show below the note */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Text shown under the textarea */\n footerText?: string;\n /** Function run when clicking the delete/close button */\n onXButtonClick?: () => void;\n /** Function run if user clicks the component while it is disabled */\n onClickWhileDisabled?: () => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Timestamp shown over the textarea */\n timestamp: string;\n /** Classname for the outer wrapper */\n wrapperClassName?: string;\n}\n\nconst StickyNote: React.FC<StickyNoteProps> = (props: StickyNoteProps) => {\n const {\n wrapperClassName,\n timestamp,\n onXButtonClick,\n arialabelXButton,\n footerText,\n error,\n errorText,\n errorTextId: errorTextIdProp,\n onClickWhileDisabled,\n testId,\n ...textareaProps\n } = props;\n const errorTextId = useIdWithFallback(errorTextIdProp);\n const showErrorStyling = error || !!errorText;\n const stickynoteRef = useRef<HTMLDivElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const { isFocused: isTextareaFocused } = usePseudoClasses<HTMLTextAreaElement | null>(textareaRef);\n const { isHovered, isActive } = usePseudoClasses<HTMLDivElement | null>(stickynoteRef);\n\n const handleWrapperClick = (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>): void => {\n if ((event.target as HTMLElement).closest('button')) {\n return;\n }\n if (textareaProps.disabled) {\n if (onClickWhileDisabled) onClickWhileDisabled();\n return;\n }\n textareaRef.current?.focus();\n };\n\n const resizeTextarea = (): void => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n resizeTarget(textarea);\n };\n\n const resizeTarget = (target: HTMLTextAreaElement): void => {\n // Reset field height\n target.style.height = 'inherit';\n // Set new height\n target.style.height = `${target.scrollHeight}px`;\n };\n\n useLayoutEffect(() => {\n resizeTextarea();\n // Must run after the shadow DOM has been set up to work on microweb\n setTimeout(() => resizeTextarea(), 1000);\n }, []);\n\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\n const textarea = e.target as HTMLTextAreaElement;\n resizeTarget(textarea);\n if (textareaProps.onChange) textareaProps.onChange(e);\n };\n\n return (\n <div>\n <div\n data-testid={testId}\n ref={stickynoteRef}\n className={classNames(styles['sticky-note'], wrapperClassName, {\n [styles['sticky-note--focused']]: isTextareaFocused,\n [styles['sticky-note--active']]: isActive,\n [styles['sticky-note--hovered']]: isHovered && !isTextareaFocused && !textareaProps.disabled,\n [styles['sticky-note--error']]: showErrorStyling,\n })}\n onClick={handleWrapperClick}\n role=\"textbox\"\n tabIndex={-1}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n handleWrapperClick(e as React.KeyboardEvent<HTMLDivElement>);\n }\n }}\n >\n <div className={classNames(styles['sticky-note__header'])}>\n {timestamp && <span className={styles['sticky-note__header__timestamp']}>{timestamp}</span>}\n </div>\n <textarea\n ref={textareaRef}\n data-testid={`${testId}-textarea`}\n className={classNames(styles['sticky-note__textarea'], textareaProps.className)}\n {...textareaProps}\n onChange={handleChange}\n aria-describedby={getAriaDescribedBy(props, errorTextId)}\n />\n <Close onClick={onXButtonClick} ariaLabel={arialabelXButton} testId=\"closeButton\" />\n <div className={classNames(styles['sticky-note__footer'])}>{footerText && <span>{footerText}</span>}</div>\n <div className={classNames(styles['sticky-note__triangle'])}>\n <Triangle isHover={isHovered} isActive={isActive} isFocus={isTextareaFocused} isError={showErrorStyling} />\n </div>\n </div>\n {errorText && (\n <p className={styles['sticky-note__error-text']} id={errorTextId}>\n {errorText}\n </p>\n )}\n </div>\n );\n};\n\nexport default StickyNote;\n","import StickyNote from './StickyNote';\nexport * from './StickyNote';\nexport default StickyNote;\n"],"mappings":";;;;;;;;;;;;AA2BA,IAAM,SAA+B,UAAsB;CACzD,MAAM,EAAE,QAAQ,YAAY,QAAQ,SAAS,QAAQ;CACrD,MAAM,EAAE,WAAW,cAAc,iBAAiB;CAElD,MAAM,WAAW,sBAAsB,IAAI,KAAK;CAEhD,MAAM,eAAe,WAAW,OAAO,KAAK;CAE5C,OACE,oBAAC,UAAD;EACE,KAAK,UAAU,CAAC,KAAK,SAAS,CAAC;EAC/B,eAAa;EACb,WAAW;EACX,cAAY;EACH;EACT,MAAK;EAEL,UAAA,oBAAC,QAAD;GAAM,WAAW,WAAW,OAAO,yBAAyB;GAC1D,UAAA,oBAAC,cAAD;IAAM,SAAS;IAAG,OAAM;IAAQ,MAAM;IAAqB;GAAY,CAAA;EACnE,CAAA;CACA,CAAA;AAEZ;;;ACnCA,IAAM,YAAqC,EAAE,SAAS,SAAS,UAAU,cAAc;CACrF,MAAM,WAAW,MAAM;CACvB,MAAM,cAAc,GAAG,SAAS;CAChC,MAAM,eAAe,GAAG,SAAS;CACjC,MAAM,iBAA0B;EAC9B,MAAM,SAAkB;GACtB,QAAQ;GACR,YAAY;EACd;EAEA,IAAI,CAAC,SAAS;GACZ,IAAI,SACF,OAAO,aAAa;GAEtB,IAAI,SAAS;IACX,OAAO,SAAS;IAChB,OAAO,aAAa;GACtB;GACA,IAAI,UACF,OAAO,aAAa;EAExB,OAAO;GACL,OAAO,SAAS;GAChB,OAAO,aAAa;GACpB,IAAI,SACF,OAAO,aAAa;GAEtB,IAAI,SAAS;IACX,OAAO,SAAS;IAChB,OAAO,aAAa;GACtB;GACA,IAAI,UACF,OAAO,aAAa;EAExB;EACA,OAAO;CACT,EAAA,CAA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ACnF,oBAAC,OAAD;IAAK,WAAW,WAAW,OAAO,sBAAsB;IAAI,UAAA,cAAc,oBAAC,QAAD,EAAA,UAAO,WAAiB,CAAA;GAAO,CAAA;GACzG,oBAAC,OAAD;IAAK,WAAW,WAAW,OAAO,wBAAwB;IACxD,UAAA,oBAAC,UAAD;KAAU,SAAS;KAAqB;KAAU,SAAS;KAAmB,SAAS;IAAmB,CAAA;GACvG,CAAA;EACF;CACJ,CAAA,GAAA,aACC,oBAAC,KAAD;EAAG,WAAW,OAAO;EAA4B,IAAI;EAClD,UAAA;CACA,CAAA,CAEF,EAAA,CAAA;AAET;;;ACtIA,IAAA,qBAAe"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@use '../../scss/font-settings' as font-settings;
|
|
3
3
|
@use '../../scss/font-mixins' as fonts;
|
|
4
4
|
@use '../../scss/breakpoints' as breakpoints;
|
|
5
|
-
@import '../../scss/supernova/styles/colors.css';
|
|
6
5
|
|
|
7
6
|
.sticky-note {
|
|
8
7
|
$sticky-note: &;
|
|
@@ -17,8 +16,8 @@
|
|
|
17
16
|
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
|
|
18
17
|
|
|
19
18
|
&--focused {
|
|
20
|
-
box-shadow: inset 0 0 0 1px var(--color-action-border-
|
|
21
|
-
border-color: var(--color-action-border-
|
|
19
|
+
box-shadow: inset 0 0 0 1px var(--color-action-border-dark-focus);
|
|
20
|
+
border-color: var(--color-action-border-dark-focus);
|
|
22
21
|
background-color: var(--component-stickynote-background-normal-medium);
|
|
23
22
|
}
|
|
24
23
|
|
|
@@ -39,8 +38,8 @@
|
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
&#{$sticky-note}--focused {
|
|
42
|
-
box-shadow: inset 0 0 0 1px var(--color-action-border-
|
|
43
|
-
border-color: var(--color-action-border-
|
|
41
|
+
box-shadow: inset 0 0 0 1px var(--color-action-border-dark-focus);
|
|
42
|
+
border-color: var(--color-action-border-dark-focus);
|
|
44
43
|
background-color: var(--component-stickynote-background-error-medium);
|
|
45
44
|
}
|
|
46
45
|
|
|
@@ -58,7 +57,7 @@
|
|
|
58
57
|
&__timestamp {
|
|
59
58
|
@include fonts.compact-data;
|
|
60
59
|
|
|
61
|
-
color: var(--color-placeholder-text-
|
|
60
|
+
color: var(--color-placeholder-text-dark);
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
|
|
@@ -73,7 +72,7 @@
|
|
|
73
72
|
|
|
74
73
|
&:disabled {
|
|
75
74
|
// Dette er for å unngå at disabled tekst ikke validerer på iOS
|
|
76
|
-
-webkit-text-fill-color: var(--color-base-text-
|
|
75
|
+
-webkit-text-fill-color: var(--color-base-text-dark);
|
|
77
76
|
opacity: 1;
|
|
78
77
|
}
|
|
79
78
|
}
|
|
@@ -81,7 +80,7 @@
|
|
|
81
80
|
&__footer {
|
|
82
81
|
@include fonts.image-credit;
|
|
83
82
|
|
|
84
|
-
color: var(--color-placeholder-text-
|
|
83
|
+
color: var(--color-placeholder-text-dark);
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
&__triangle {
|
|
@@ -95,7 +94,7 @@
|
|
|
95
94
|
&__error-text {
|
|
96
95
|
@include fonts.sublabel-subdued;
|
|
97
96
|
|
|
98
|
-
color: var(--color-notification-
|
|
97
|
+
color: var(--color-notification-error);
|
|
99
98
|
margin-top: 0.5rem;
|
|
100
99
|
}
|
|
101
100
|
}
|
|
@@ -155,7 +154,7 @@ $mobile-outer-size: 2.75rem;
|
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
:focus-visible > & {
|
|
158
|
-
outline: 3px solid var(--color-action-border-
|
|
157
|
+
outline: 3px solid var(--color-action-border-dark-focus);
|
|
159
158
|
border-radius: 0;
|
|
160
159
|
border: 0;
|
|
161
160
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '../../../scss/breakpoints' as breakpoints;
|
|
3
|
-
@import '../../../scss/supernova/styles/colors';
|
|
4
3
|
|
|
5
4
|
.tab-list-wrapper {
|
|
6
5
|
position: relative;
|
|
@@ -19,14 +18,16 @@
|
|
|
19
18
|
overflow: auto hidden;
|
|
20
19
|
height: 3rem;
|
|
21
20
|
margin: 0;
|
|
22
|
-
background-color: var(--color-base-background-
|
|
21
|
+
background-color: var(--color-base-background-light);
|
|
23
22
|
padding-left: 0.5rem;
|
|
24
23
|
padding-right: 0.5rem;
|
|
25
24
|
margin-bottom: -1px;
|
|
26
25
|
scrollbar-width: none;
|
|
27
26
|
|
|
28
27
|
&::-webkit-scrollbar {
|
|
29
|
-
display: none;
|
|
28
|
+
display: none;
|
|
29
|
+
|
|
30
|
+
/* Safari */
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
@@ -47,40 +48,41 @@
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
&--onwhite {
|
|
50
|
-
background-color: var(--color-base-background-
|
|
51
|
+
background-color: var(--color-base-background-light);
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
&--onblueberry {
|
|
54
|
-
background-color: var(--color-base-background-
|
|
55
|
+
background-color: var(--color-base-blueberry-background-light);
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
&--onneutral {
|
|
58
|
-
background-color: var(--color-base-background-
|
|
59
|
+
background-color: var(--color-base-neutral-background-light);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
&__tab {
|
|
62
63
|
display: flex;
|
|
63
64
|
align-items: start;
|
|
64
|
-
background-color: var(--color-base-background-
|
|
65
|
+
background-color: var(--color-base-background-light);
|
|
65
66
|
height: 3rem;
|
|
66
67
|
text-align: start;
|
|
67
68
|
font-size: 1.25rem;
|
|
68
69
|
text-decoration: none;
|
|
69
70
|
padding: 0.5rem 1.5rem;
|
|
70
|
-
color: var(--color-action-text-
|
|
71
|
-
border: 1px solid var(--color-action-border-
|
|
71
|
+
color: var(--color-action-text-dark-normal);
|
|
72
|
+
border: 1px solid var(--color-action-border-dark-normal);
|
|
72
73
|
border-bottom: 0;
|
|
73
74
|
border-radius: 0.5rem 0.5rem 0 0;
|
|
74
75
|
position: relative;
|
|
76
|
+
cursor: pointer;
|
|
75
77
|
|
|
76
78
|
// Z-index brukes til å flytte tab bak/foran bottom border til tab-list__border
|
|
77
79
|
z-index: 0;
|
|
78
80
|
|
|
79
81
|
&--selected {
|
|
80
82
|
overflow: visible;
|
|
81
|
-
border-color: var(--color-action-border-
|
|
82
|
-
color: var(--color-base-text-
|
|
83
|
-
background-color: var(--color-base-background-
|
|
83
|
+
border-color: var(--color-action-border-dark-focus);
|
|
84
|
+
color: var(--color-base-text-dark);
|
|
85
|
+
background-color: var(--color-base-background-light);
|
|
84
86
|
z-index: 2;
|
|
85
87
|
}
|
|
86
88
|
|
|
@@ -95,22 +97,22 @@
|
|
|
95
97
|
|
|
96
98
|
.tab-list__tab {
|
|
97
99
|
&:focus-visible {
|
|
98
|
-
outline: 4px solid var(--color-action-border-
|
|
100
|
+
outline: 4px solid var(--color-action-border-dark-focus);
|
|
99
101
|
outline-offset: -4px;
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
.tab-list__tab--not-selected {
|
|
104
106
|
&:hover {
|
|
105
|
-
background-color: var(--color-action-background-
|
|
107
|
+
background-color: var(--color-action-background-light-hover);
|
|
106
108
|
|
|
107
109
|
&#{$tab-list}__tab--blueberry {
|
|
108
|
-
background-color: var(--color-action-background-
|
|
110
|
+
background-color: var(--color-action-background-light-selected);
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
&:active {
|
|
113
|
-
background-color: var(--color-action-background-
|
|
115
|
+
background-color: var(--color-action-background-light-selected);
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
|
|
@@ -137,7 +139,7 @@
|
|
|
137
139
|
align-items: center;
|
|
138
140
|
|
|
139
141
|
&:focus-visible {
|
|
140
|
-
outline: 4px solid var(--color-action-border-
|
|
142
|
+
outline: 4px solid var(--color-action-border-dark-focus);
|
|
141
143
|
outline-offset: -4px;
|
|
142
144
|
}
|
|
143
145
|
}
|
|
@@ -164,6 +166,6 @@
|
|
|
164
166
|
top: 0;
|
|
165
167
|
width: 100%;
|
|
166
168
|
height: 100%;
|
|
167
|
-
border-bottom: 1px solid var(--color-action-border-
|
|
169
|
+
border-bottom: 1px solid var(--color-action-border-dark-focus);
|
|
168
170
|
}
|
|
169
171
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@use '../../../scss/spacers' as spacers;
|
|
3
3
|
@use '../../../scss/palette' as palette;
|
|
4
4
|
@use '../../../scss/breakpoints' as breakpoints;
|
|
5
|
-
@import '../../../scss/supernova/styles/colors';
|
|
6
5
|
|
|
7
6
|
.tab-panel {
|
|
8
7
|
$tab-panel: &;
|
|
@@ -10,7 +9,7 @@
|
|
|
10
9
|
|
|
11
10
|
padding: spacers.getSpacer(l) spacers.getSpacer(s) spacers.getSpacer(xl);
|
|
12
11
|
width: 100%;
|
|
13
|
-
border-bottom: 1px solid var(--color-action-border-
|
|
12
|
+
border-bottom: 1px solid var(--color-action-border-dark-focus);
|
|
14
13
|
|
|
15
14
|
@each $color in $colors {
|
|
16
15
|
&#{$tab-panel}--#{$color} {
|
|
@@ -20,7 +19,7 @@
|
|
|
20
19
|
|
|
21
20
|
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
22
21
|
border-radius: 0 0 0.5rem 0.5rem;
|
|
23
|
-
border: 1px solid var(--color-action-border-
|
|
22
|
+
border: 1px solid var(--color-action-border-dark-focus);
|
|
24
23
|
border-top: 0;
|
|
25
24
|
padding: spacers.getSpacer(xl) spacers.getSpacer(m) spacers.getSpacer(2xl);
|
|
26
25
|
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
@use '../../scss/palette' as palette;
|
|
4
4
|
@use '../../scss/screen-reader' as *;
|
|
5
5
|
@use '../../scss/breakpoints' as breakpoints;
|
|
6
|
-
@import '../../scss/supernova/styles/colors.css';
|
|
7
|
-
@import '../../scss/supernova/styles/spacers.css';
|
|
8
6
|
|
|
9
7
|
.tile {
|
|
10
8
|
// Referanse for grandparent selection i underklassene lenger nede
|
|
@@ -19,7 +17,7 @@
|
|
|
19
17
|
color: var(--core-color-black);
|
|
20
18
|
text-decoration: none;
|
|
21
19
|
cursor: pointer;
|
|
22
|
-
border: 1px solid var(--color-action-border-
|
|
20
|
+
border: 1px solid var(--color-action-border-dark-normal);
|
|
23
21
|
outline: none;
|
|
24
22
|
|
|
25
23
|
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
@@ -50,12 +48,12 @@
|
|
|
50
48
|
|
|
51
49
|
&:hover,
|
|
52
50
|
&:active {
|
|
53
|
-
background-color: var(--color-action-background-
|
|
51
|
+
background-color: var(--color-action-background-light-selected);
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
&:focus-visible {
|
|
57
|
-
box-shadow: 0 0 0 3px var(--color-action-border-
|
|
58
|
-
border-color: var(--color-action-border-
|
|
55
|
+
box-shadow: 0 0 0 3px var(--color-action-border-dark-focus);
|
|
56
|
+
border-color: var(--color-action-border-dark-focus);
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
&--highlighted {
|
|
@@ -70,7 +68,7 @@
|
|
|
70
68
|
}
|
|
71
69
|
|
|
72
70
|
&:focus-visible {
|
|
73
|
-
border-color: var(--color-action-border-
|
|
71
|
+
border-color: var(--color-action-border-dark-focus);
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
74
|
|