@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,16 +1,16 @@
|
|
|
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/font-mixins' as fonts;
|
|
6
|
+
@use '../../scss/breakpoints' as *;
|
|
7
7
|
|
|
8
8
|
.label-wrapper {
|
|
9
|
-
margin-bottom: getSpacer(2xs);
|
|
10
|
-
line-height:
|
|
9
|
+
margin-bottom: spacers.getSpacer(2xs);
|
|
10
|
+
line-height: font-settings.$lineheight-size-xs;
|
|
11
11
|
|
|
12
12
|
@media (min-width: map.get($grid-breakpoints, sm)) {
|
|
13
|
-
line-height:
|
|
13
|
+
line-height: font-settings.$lineheight-size-sm;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
&--no-bottom-margin {
|
|
@@ -29,26 +29,14 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.label {
|
|
32
|
-
@include label;
|
|
32
|
+
@include fonts.label;
|
|
33
33
|
|
|
34
34
|
&--subdued {
|
|
35
|
-
@include label-subdued;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&--sublabel {
|
|
39
|
-
display: block;
|
|
40
|
-
font-size: $font-size-xs;
|
|
41
|
-
line-height: 1.25rem;
|
|
42
|
-
color: $neutral800;
|
|
43
|
-
|
|
44
|
-
@media (min-width: map.get($grid-breakpoints, sm)) {
|
|
45
|
-
font-size: $font-size-sm;
|
|
46
|
-
line-height: $lineheight-size-xs;
|
|
47
|
-
}
|
|
35
|
+
@include fonts.label-subdued;
|
|
48
36
|
}
|
|
49
37
|
|
|
50
38
|
&--on-dark {
|
|
51
|
-
color:
|
|
39
|
+
color: palette.$white;
|
|
52
40
|
}
|
|
53
41
|
|
|
54
42
|
&::after {
|
|
@@ -60,6 +48,22 @@
|
|
|
60
48
|
}
|
|
61
49
|
}
|
|
62
50
|
|
|
51
|
+
.sublabel {
|
|
52
|
+
@include fonts.sublabel;
|
|
53
|
+
|
|
54
|
+
&--subdued {
|
|
55
|
+
@include fonts.sublabel-subdued;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&--on-dark {
|
|
59
|
+
color: palette.$white;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&::after {
|
|
63
|
+
content: ' ';
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
63
67
|
.after-label-children {
|
|
64
|
-
padding-left: getSpacer(xs);
|
|
68
|
+
padding-left: spacers.getSpacer(xs);
|
|
65
69
|
}
|
|
@@ -4,11 +4,13 @@ export type Styles = {
|
|
|
4
4
|
label__texts: string;
|
|
5
5
|
'label--on-dark': string;
|
|
6
6
|
'label--subdued': string;
|
|
7
|
-
'label--sublabel': string;
|
|
8
7
|
'label-content-wrapper': string;
|
|
9
8
|
'label-wrapper': string;
|
|
10
9
|
'label-wrapper--after-label-children': string;
|
|
11
10
|
'label-wrapper--no-bottom-margin': string;
|
|
11
|
+
sublabel: string;
|
|
12
|
+
'sublabel--on-dark': string;
|
|
13
|
+
'sublabel--subdued': string;
|
|
12
14
|
};
|
|
13
15
|
|
|
14
16
|
export type ClassNames = keyof Styles;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@
|
|
2
|
+
@use '../../scss/spacers' as spacers;
|
|
3
|
+
@use '../../scss/font-settings' as font-settings;
|
|
4
|
+
@use '../../scss/palette' as palette;
|
|
5
|
+
@use '../../scss/breakpoints' as *;
|
|
6
6
|
@import '../../scss/supernova/styles/colors';
|
|
7
7
|
|
|
8
8
|
.link-list {
|
|
@@ -22,42 +22,42 @@
|
|
|
22
22
|
|
|
23
23
|
&--outline {
|
|
24
24
|
&--white {
|
|
25
|
-
border-top: getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
26
|
-
border-left: getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
27
|
-
border-right: getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
25
|
+
border-top: spacers.getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
26
|
+
border-left: spacers.getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
27
|
+
border-right: spacers.getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
28
28
|
|
|
29
29
|
&:last-of-type {
|
|
30
|
-
border-bottom: getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
30
|
+
border-bottom: spacers.getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
&--blueberry {
|
|
35
|
-
border-top: getSpacer(2xs) var(--core-color-blueberry-100) solid;
|
|
36
|
-
border-left: getSpacer(2xs) var(--core-color-blueberry-100) solid;
|
|
37
|
-
border-right: getSpacer(2xs) var(--core-color-blueberry-100) solid;
|
|
35
|
+
border-top: spacers.getSpacer(2xs) var(--core-color-blueberry-100) solid;
|
|
36
|
+
border-left: spacers.getSpacer(2xs) var(--core-color-blueberry-100) solid;
|
|
37
|
+
border-right: spacers.getSpacer(2xs) var(--core-color-blueberry-100) solid;
|
|
38
38
|
|
|
39
39
|
&:last-of-type {
|
|
40
|
-
border-bottom: getSpacer(2xs) var(--core-color-blueberry-100) solid;
|
|
40
|
+
border-bottom: spacers.getSpacer(2xs) var(--core-color-blueberry-100) solid;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
&--cherry {
|
|
45
|
-
border-top: getSpacer(2xs) var(--core-color-cherry-100) solid;
|
|
46
|
-
border-left: getSpacer(2xs) var(--core-color-cherry-100) solid;
|
|
47
|
-
border-right: getSpacer(2xs) var(--core-color-cherry-100) solid;
|
|
45
|
+
border-top: spacers.getSpacer(2xs) var(--core-color-cherry-100) solid;
|
|
46
|
+
border-left: spacers.getSpacer(2xs) var(--core-color-cherry-100) solid;
|
|
47
|
+
border-right: spacers.getSpacer(2xs) var(--core-color-cherry-100) solid;
|
|
48
48
|
|
|
49
49
|
&:last-of-type {
|
|
50
|
-
border-bottom: getSpacer(2xs) var(--core-color-cherry-100) solid;
|
|
50
|
+
border-bottom: spacers.getSpacer(2xs) var(--core-color-cherry-100) solid;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
&--neutral {
|
|
55
|
-
border-top: getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
56
|
-
border-left: getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
57
|
-
border-right: getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
55
|
+
border-top: spacers.getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
56
|
+
border-left: spacers.getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
57
|
+
border-right: spacers.getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
58
58
|
|
|
59
59
|
&:last-of-type {
|
|
60
|
-
border-bottom: getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
60
|
+
border-bottom: spacers.getSpacer(2xs) var(--core-color-neutral-100) solid;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
|
|
101
101
|
&--fill,
|
|
102
102
|
&--fill-negative {
|
|
103
|
-
margin-top: getSpacer(s);
|
|
103
|
+
margin-top: spacers.getSpacer(s);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
&--fill-negative {
|
|
@@ -108,34 +108,34 @@
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
&--small {
|
|
111
|
-
font-size:
|
|
112
|
-
line-height:
|
|
111
|
+
font-size: font-settings.$font-size-xs;
|
|
112
|
+
line-height: font-settings.$lineheight-size-xs;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
&--medium {
|
|
116
|
-
font-size:
|
|
117
|
-
line-height:
|
|
116
|
+
font-size: font-settings.$font-size-sm;
|
|
117
|
+
line-height: font-settings.$lineheight-size-sm;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
&--large {
|
|
121
|
-
font-size:
|
|
122
|
-
line-height:
|
|
121
|
+
font-size: font-settings.$font-size-md;
|
|
122
|
+
line-height: font-settings.$lineheight-size-md;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
126
126
|
&--small {
|
|
127
|
-
font-size:
|
|
128
|
-
line-height:
|
|
127
|
+
font-size: font-settings.$font-size-sm;
|
|
128
|
+
line-height: font-settings.$lineheight-size-sm;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
&--medium {
|
|
132
|
-
font-size:
|
|
133
|
-
line-height:
|
|
132
|
+
font-size: font-settings.$font-size-md;
|
|
133
|
+
line-height: font-settings.$lineheight-size-md;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
&--large {
|
|
137
|
-
font-size:
|
|
138
|
-
line-height:
|
|
137
|
+
font-size: font-settings.$font-size-lg;
|
|
138
|
+
line-height: font-settings.$lineheight-size-lg;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../../scss/spacers' as spacers;
|
|
2
|
+
@use '../../scss/font-mixins' as fonts;
|
|
2
3
|
|
|
3
4
|
.list {
|
|
4
5
|
$list: &;
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
margin-bottom: 0;
|
|
7
|
+
@include fonts.text-list;
|
|
8
8
|
|
|
9
9
|
&--margin {
|
|
10
|
-
margin-top: getSpacer(s);
|
|
11
|
-
margin-bottom: getSpacer(s);
|
|
10
|
+
margin-top: spacers.getSpacer(s);
|
|
11
|
+
margin-bottom: spacers.getSpacer(s);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
&--bullet {
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
|
|
58
58
|
&__item {
|
|
59
59
|
> #{$list} {
|
|
60
|
-
margin-top: getSpacer(2xs);
|
|
60
|
+
margin-top: spacers.getSpacer(2xs);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
&__item:not(:last-child) {
|
|
65
|
-
margin-bottom: getSpacer(2xs);
|
|
65
|
+
margin-bottom: spacers.getSpacer(2xs);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
.list-header {
|
|
7
7
|
display: grid;
|
|
8
8
|
grid-template:
|
|
9
9
|
'icon text badge chevron' 4rem
|
|
10
10
|
'. text . .' auto / min-content auto min-content min-content;
|
|
11
|
-
column-gap: getSpacer(2xs);
|
|
12
|
-
margin-left: getSpacer(2xs);
|
|
13
|
-
margin-right: getSpacer(2xs);
|
|
11
|
+
column-gap: spacers.getSpacer(2xs);
|
|
12
|
+
margin-left: spacers.getSpacer(2xs);
|
|
13
|
+
margin-right: spacers.getSpacer(2xs);
|
|
14
14
|
width: 100%;
|
|
15
15
|
height: 100%;
|
|
16
16
|
text-align: left;
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
&--spacing {
|
|
41
|
-
margin-left: getSpacer(2xs);
|
|
41
|
+
margin-left: spacers.getSpacer(2xs);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
:focus > &,
|
|
45
45
|
:focus-visible > & {
|
|
46
|
-
border-color:
|
|
46
|
+
border-color: palette.$black;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@
|
|
1
|
+
@use '../../scss/spacers' as spacers;
|
|
2
|
+
@use '../../scss/palette' as palette;
|
|
3
|
+
@use '../../scss/screen-reader' as *;
|
|
4
4
|
|
|
5
5
|
@mixin keyframes($name) {
|
|
6
6
|
@keyframes #{$name} {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
|
|
49
49
|
&--inline {
|
|
50
50
|
align-self: center;
|
|
51
|
-
padding-left: getSpacer(2xs);
|
|
51
|
+
padding-left: spacers.getSpacer(2xs);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
&--overlay {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
&--overlay-screen {
|
|
61
|
-
background:
|
|
61
|
+
background: palette.$transparent-grey;
|
|
62
62
|
position: fixed;
|
|
63
63
|
inset: 0;
|
|
64
64
|
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
position: absolute;
|
|
68
68
|
top: 0;
|
|
69
69
|
left: 0;
|
|
70
|
-
background:
|
|
70
|
+
background: palette.$transparent-grey;
|
|
71
71
|
height: 100%;
|
|
72
72
|
width: 100%;
|
|
73
73
|
}
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
position: absolute;
|
|
103
103
|
width: 8px;
|
|
104
104
|
height: 8px;
|
|
105
|
-
background-color:
|
|
105
|
+
background-color: palette.$blueberry500;
|
|
106
106
|
border-radius: 50%;
|
|
107
107
|
|
|
108
108
|
// Sets a form of easing animation curve
|
|
@@ -124,31 +124,31 @@
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
&--banana {
|
|
127
|
-
background-color:
|
|
127
|
+
background-color: palette.$banana500;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
&--cherry {
|
|
131
|
-
background-color:
|
|
131
|
+
background-color: palette.$cherry500;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
&--kiwi {
|
|
135
|
-
background-color:
|
|
135
|
+
background-color: palette.$kiwi500;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
&--neutral {
|
|
139
|
-
background-color:
|
|
139
|
+
background-color: palette.$neutral500;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
&--plum {
|
|
143
|
-
background-color:
|
|
143
|
+
background-color: palette.$plum500;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
&--black {
|
|
147
|
-
background-color:
|
|
147
|
+
background-color: palette.$black;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
&--white {
|
|
151
|
-
background-color:
|
|
151
|
+
background-color: palette.$white;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
// Scales up the first dot
|
|
@@ -1,28 +1,28 @@
|
|
|
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
|
.max-characters {
|
|
8
8
|
display: flex;
|
|
9
9
|
justify-content: flex-end;
|
|
10
|
-
padding-top: getSpacer(2xs);
|
|
10
|
+
padding-top: spacers.getSpacer(2xs);
|
|
11
11
|
padding-right: 2px;
|
|
12
|
-
font-size:
|
|
13
|
-
line-height:
|
|
12
|
+
font-size: font-settings.$font-size-sm;
|
|
13
|
+
line-height: font-settings.$lineheight-size-sm;
|
|
14
14
|
|
|
15
15
|
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
16
|
-
line-height:
|
|
17
|
-
font-size:
|
|
16
|
+
line-height: font-settings.$lineheight-size-md;
|
|
17
|
+
font-size: font-settings.$font-size-md;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
&--on-dark {
|
|
21
|
-
color:
|
|
21
|
+
color: palette.$white;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
&--invalid {
|
|
25
|
-
color:
|
|
25
|
+
color: palette.$cherry600;
|
|
26
26
|
font-weight: 600;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useEffect } from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { ZIndex, AnalyticsId, IconSize } from "../../constants.js";
|
|
5
5
|
import { useFocusTrap } from "../../hooks/useFocusTrap.js";
|
|
6
6
|
import { useIsVisible } from "../../hooks/useIsVisible.js";
|
|
7
|
+
import { useReturnFocusOnUnmount } from "../../hooks/useReturnFocusOnUnmount.js";
|
|
7
8
|
import { palette } from "../../theme/palette.js";
|
|
9
|
+
import { getAriaLabelAttributes } from "../../utils/accessibility.js";
|
|
8
10
|
import { u as uuid } from "../../uuid.js";
|
|
9
11
|
import { B as Button } from "../../Button.js";
|
|
10
12
|
import { C as Close } from "../../Close.js";
|
|
@@ -44,7 +46,7 @@ const getIcon = (variant, icon) => {
|
|
|
44
46
|
return /* @__PURE__ */ jsx("div", { className: styles.modal__iconWrapper, children: variantIcon });
|
|
45
47
|
}
|
|
46
48
|
if (icon) {
|
|
47
|
-
return /* @__PURE__ */ jsx("div", { className: styles.modal__iconWrapper, children:
|
|
49
|
+
return /* @__PURE__ */ jsx("div", { className: styles.modal__iconWrapper, children: React__default.cloneElement(icon, {
|
|
48
50
|
size: IconSize.Small
|
|
49
51
|
}) });
|
|
50
52
|
}
|
|
@@ -60,14 +62,15 @@ const Modal = (props) => {
|
|
|
60
62
|
size = "large",
|
|
61
63
|
zIndex = ZIndex.Modal
|
|
62
64
|
} = props;
|
|
63
|
-
const topContent =
|
|
64
|
-
const modalContentRef =
|
|
65
|
-
const dialogRef =
|
|
65
|
+
const topContent = React__default.useRef(null);
|
|
66
|
+
const modalContentRef = React__default.useRef(null);
|
|
67
|
+
const dialogRef = React__default.useRef(null);
|
|
66
68
|
useFocusTrap(dialogRef, true);
|
|
67
69
|
const topContentVisible = useIsVisible(topContent);
|
|
68
|
-
const bottomContent =
|
|
70
|
+
const bottomContent = React__default.useRef(null);
|
|
69
71
|
const bottomContentVisible = useIsVisible(bottomContent);
|
|
70
72
|
const contentIsScrollable = modalContentRef.current && modalContentRef.current.scrollHeight > modalContentRef.current.clientHeight;
|
|
73
|
+
useReturnFocusOnUnmount(dialogRef);
|
|
71
74
|
function handleKeyboardEvent(e) {
|
|
72
75
|
if (e.key === "Escape" && props.onClose) {
|
|
73
76
|
e.stopPropagation();
|
|
@@ -87,10 +90,9 @@ const Modal = (props) => {
|
|
|
87
90
|
document.body.style.removeProperty("overflow");
|
|
88
91
|
}
|
|
89
92
|
const imageView = variant === "image";
|
|
90
|
-
const overlayRef =
|
|
93
|
+
const overlayRef = React__default.useRef(null);
|
|
91
94
|
const showActions = props.secondaryButtonText && ((_a = props.secondaryButtonText) == null ? void 0 : _a.length) > 0 || props.onSuccess;
|
|
92
|
-
const
|
|
93
|
-
const ariaLabelledBy = props.ariaLabelledBy ? props.ariaLabelledBy : !props.ariaLabel ? titleId : void 0;
|
|
95
|
+
const ariaLabelAttributes = getAriaLabelAttributes({ label: props.ariaLabel, id: props.ariaLabelledBy, fallbackId: titleId });
|
|
94
96
|
useEffect(() => {
|
|
95
97
|
const overlayElement = overlayRef.current;
|
|
96
98
|
disableBodyScroll();
|
|
@@ -130,79 +132,66 @@ const Modal = (props) => {
|
|
|
130
132
|
"data-testid": props.testId,
|
|
131
133
|
"data-analyticsid": AnalyticsId.Modal,
|
|
132
134
|
style: { zIndex },
|
|
133
|
-
children: /* @__PURE__ */ jsx("div", { className: styles.align, children: /* @__PURE__ */ jsxs(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
"div",
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
{
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
{
|
|
194
|
-
className: classNames(styles["modal__shadow"], styles["modal__shadow--bottom"], {
|
|
195
|
-
[styles["modal__shadow--show"]]: !bottomContentVisible && contentIsScrollable
|
|
196
|
-
})
|
|
197
|
-
}
|
|
198
|
-
),
|
|
199
|
-
showActions && /* @__PURE__ */ jsxs("div", { className: classNames(styles["modal__call-to-action"], size && styles[`modal__call-to-action--${size}`]), children: [
|
|
200
|
-
props.onSuccess && /* @__PURE__ */ jsx(Button, { onClick: props.onSuccess, children: primaryButtonText }),
|
|
201
|
-
props.secondaryButtonText && ((_b = props.secondaryButtonText) == null ? void 0 : _b.length) > 0 && /* @__PURE__ */ jsx(Button, { variant: "borderless", onClick: props.onClose, children: props.secondaryButtonText })
|
|
202
|
-
] })
|
|
203
|
-
]
|
|
204
|
-
}
|
|
205
|
-
) })
|
|
135
|
+
children: /* @__PURE__ */ jsx("div", { className: styles.align, children: /* @__PURE__ */ jsxs("div", { className: dialogClasses, role: "dialog", "aria-modal": "true", tabIndex: -1, ...ariaLabelAttributes, ref: dialogRef, children: [
|
|
136
|
+
/* @__PURE__ */ jsx(
|
|
137
|
+
"div",
|
|
138
|
+
{
|
|
139
|
+
className: classNames(styles["modal__shadow"], styles["modal__shadow--top"], {
|
|
140
|
+
[styles["modal__shadow--show"]]: !topContentVisible && contentIsScrollable
|
|
141
|
+
})
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
/* @__PURE__ */ jsxs(
|
|
145
|
+
"div",
|
|
146
|
+
{
|
|
147
|
+
className: classNames(styles.modal__contentWrapper, {
|
|
148
|
+
[styles["modal__contentWrapper--image"]]: imageView
|
|
149
|
+
}),
|
|
150
|
+
tabIndex: contentIsScrollable ? 0 : void 0,
|
|
151
|
+
role: contentIsScrollable ? "region" : void 0,
|
|
152
|
+
...contentIsScrollable ? ariaLabelAttributes : {},
|
|
153
|
+
ref: modalContentRef,
|
|
154
|
+
children: [
|
|
155
|
+
!props.noCloseButton && /* @__PURE__ */ jsx("div", { className: styles.modal__closeWrapper, children: /* @__PURE__ */ jsx("div", { className: classNames(styles.modal__closeWrapper__close), children: /* @__PURE__ */ jsx(Close, { onClick: props.onClose, ariaLabel: props.ariaLabelCloseBtn }) }) }),
|
|
156
|
+
/* @__PURE__ */ jsxs(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
className: classNames(size && styles[`modal__contentWrapper__scroll--${size}`], {
|
|
160
|
+
[styles["modal__contentWrapper__scroll--image"]]: imageView
|
|
161
|
+
}),
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ jsx("div", { ref: topContent }),
|
|
164
|
+
/* @__PURE__ */ jsxs("div", { className: styles.modal__contentWrapper__title, children: [
|
|
165
|
+
getIcon(variant, props.icon),
|
|
166
|
+
/* @__PURE__ */ jsx(Title, { id: ariaLabelAttributes == null ? void 0 : ariaLabelAttributes["aria-labelledby"], htmlMarkup: "h3", appearance: "title3", className: titleClasses, children: props.title }),
|
|
167
|
+
props.afterTitleChildren && /* @__PURE__ */ jsx("div", { className: styles["modal__afterTitleChildren"], children: props.afterTitleChildren })
|
|
168
|
+
] }),
|
|
169
|
+
imageView && /* @__PURE__ */ jsxs("div", { children: [
|
|
170
|
+
/* @__PURE__ */ jsx("div", { className: styles["modal__contentWrapper__imageWrapper"], children: props.children }),
|
|
171
|
+
/* @__PURE__ */ jsx("span", { className: styles["modal__contentWrapper__imageDescription"], children: props.description })
|
|
172
|
+
] }),
|
|
173
|
+
!imageView && props.children && /* @__PURE__ */ jsx("div", { children: props.children }),
|
|
174
|
+
!imageView && !props.children && /* @__PURE__ */ jsx("p", { className: styles.modal__description, children: props.description }),
|
|
175
|
+
/* @__PURE__ */ jsx("div", { ref: bottomContent })
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
/* @__PURE__ */ jsx(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
className: classNames(styles["modal__shadow"], styles["modal__shadow--bottom"], {
|
|
186
|
+
[styles["modal__shadow--show"]]: !bottomContentVisible && contentIsScrollable
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
showActions && /* @__PURE__ */ jsxs("div", { className: classNames(styles["modal__call-to-action"], size && styles[`modal__call-to-action--${size}`]), children: [
|
|
191
|
+
props.onSuccess && /* @__PURE__ */ jsx(Button, { onClick: props.onSuccess, children: primaryButtonText }),
|
|
192
|
+
props.secondaryButtonText && ((_b = props.secondaryButtonText) == null ? void 0 : _b.length) > 0 && /* @__PURE__ */ jsx(Button, { variant: "borderless", onClick: props.onClose, children: props.secondaryButtonText })
|
|
193
|
+
] })
|
|
194
|
+
] }) })
|
|
206
195
|
}
|
|
207
196
|
) });
|
|
208
197
|
if (props.printable) {
|