@helsenorge/designsystem-react 12.7.0 → 12.9.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/AsChildSlot.js +74 -0
- package/AsChildSlot.js.map +1 -0
- package/CHANGELOG.md +48 -5
- package/Drawer.js +58 -4
- package/Drawer.js.map +1 -1
- package/HN.Designsystem.Dropdown.nb-NO.js +13 -0
- package/HN.Designsystem.Dropdown.nb-NO.js.map +1 -0
- package/HelpDetails.js +1 -1
- package/LinkList.js +1 -0
- package/LinkList.js.map +1 -1
- package/Panel.js +0 -1
- package/Panel.js.map +1 -1
- package/SingleSelectItem.js +96 -0
- package/SingleSelectItem.js.map +1 -0
- package/clamp.js +11 -0
- package/clamp.js.map +1 -0
- package/components/ArticleTeaser/styles.module.scss +3 -5
- package/components/AsChildSlot/AsChildSlot.d.ts +23 -0
- package/components/AsChildSlot/AsChildSlot.test.d.ts +1 -0
- package/components/AsChildSlot/index.d.ts +3 -0
- package/components/AsChildSlot/index.js +6 -0
- package/components/AsChildSlot/index.js.map +1 -0
- package/components/AsChildSlot/styles.module.scss +13 -0
- package/components/AsChildSlot/styles.module.scss.d.ts +9 -0
- package/components/Drawer/styles.module.scss +45 -26
- package/components/Drawer/styles.module.scss.d.ts +5 -0
- package/components/Dropdown/Dropdown.d.ts +19 -21
- package/components/Dropdown/Dropdown.test.d.ts +1 -0
- package/components/Dropdown/SingleSelect/SingleSelect.d.ts +18 -0
- package/components/Dropdown/SingleSelect/SingleSelect.test.d.ts +1 -0
- package/components/Dropdown/SingleSelect/SingleSelectItem.d.ts +21 -0
- package/components/Dropdown/SingleSelect/index.d.ts +3 -0
- package/components/Dropdown/SingleSelect/index.js +6 -0
- package/components/Dropdown/SingleSelect/index.js.map +1 -0
- package/components/Dropdown/SingleSelect/styles.module.scss +54 -0
- package/components/Dropdown/SingleSelect/styles.module.scss.d.ts +14 -0
- package/components/Dropdown/index.js +143 -78
- package/components/Dropdown/index.js.map +1 -1
- package/components/Dropdown/styles.module.scss +90 -136
- package/components/Dropdown/styles.module.scss.d.ts +8 -9
- package/components/DropdownOld/DropdownOld.d.ts +42 -0
- package/components/DropdownOld/index.d.ts +3 -0
- package/components/DropdownOld/index.js +194 -0
- package/components/DropdownOld/index.js.map +1 -0
- package/components/DropdownOld/resourceHelper.d.ts +3 -0
- package/components/DropdownOld/styles.module.scss +230 -0
- package/components/DropdownOld/styles.module.scss.d.ts +25 -0
- package/components/Icons/EmoticonAnnoyed.js +8 -11
- package/components/Icons/EmoticonAnnoyed.js.map +1 -1
- package/components/Icons/EmoticonDelighted.js +8 -4
- package/components/Icons/EmoticonDelighted.js.map +1 -1
- package/components/Icons/EmoticonDisappointed.js +8 -4
- package/components/Icons/EmoticonDisappointed.js.map +1 -1
- package/components/Icons/EmoticonHappy.js +8 -4
- package/components/Icons/EmoticonHappy.js.map +1 -1
- package/components/Icons/EmoticonMeh.js +8 -4
- package/components/Icons/EmoticonMeh.js.map +1 -1
- package/components/LinkList/styles.module.scss +47 -61
- package/components/LinkList/styles.module.scss.d.ts +1 -0
- package/components/ListEditMode/styles.module.scss +1 -0
- package/components/NotificationPanel/index.js +3 -1
- package/components/NotificationPanel/index.js.map +1 -1
- package/components/NotificationPanel/styles.module.scss +10 -5
- package/components/Panel/Panel.d.ts +1 -1
- package/designsystem-react.css +10 -0
- package/index.d.ts +1 -0
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/scss/supernova/styles/colors.css +10 -0
- package/use-animate.js +1 -7
- package/use-animate.js.map +1 -1
- /package/{resources/index.d.ts → components/DropdownOld/DropdownOld.test.d.ts} +0 -0
|
@@ -1,189 +1,123 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '../../scss/spacers' as spacers;
|
|
3
|
-
@use '../../scss/palette' as palette;
|
|
4
2
|
@use '../../scss/font-settings' as font-settings;
|
|
5
|
-
@use '../../scss/screen-reader' as *;
|
|
6
3
|
@use '../../scss/breakpoints' as breakpoints;
|
|
4
|
+
@import '../../scss/supernova/styles/colors.css';
|
|
5
|
+
@import '../../scss/supernova/styles/spacers.css';
|
|
7
6
|
|
|
8
7
|
.dropdown {
|
|
9
8
|
position: relative;
|
|
10
|
-
width: fit-content;
|
|
11
|
-
|
|
12
|
-
&__label {
|
|
13
|
-
@include sr-only;
|
|
14
|
-
}
|
|
15
9
|
|
|
16
10
|
&__toggle {
|
|
17
11
|
display: flex;
|
|
18
12
|
justify-content: space-between;
|
|
19
13
|
align-items: center;
|
|
14
|
+
padding: 0.188rem var(--core-space-3xs) 0.188rem var(--core-space-s);
|
|
20
15
|
cursor: pointer;
|
|
21
16
|
border-radius: 0;
|
|
22
17
|
border-width: 2px;
|
|
23
18
|
border-style: solid;
|
|
24
|
-
padding: 0 spacers.getSpacer(3xs) 0 spacers.getSpacer(s);
|
|
25
19
|
font-family: inherit;
|
|
26
20
|
font-size: font-settings.$font-size-sm;
|
|
27
21
|
line-height: 1.3rem; // Custom fordi teksten skal henge bedre sammen om den går over to linjer
|
|
22
|
+
border-color: var(--color-base-border-onlight-emphasized);
|
|
23
|
+
background-color: var(--core-color-white);
|
|
24
|
+
|
|
25
|
+
&:hover {
|
|
26
|
+
background-color: var(--color-base-background-neutral);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:active {
|
|
30
|
+
background-color: var(--core-color-neutral-100);
|
|
31
|
+
}
|
|
28
32
|
|
|
29
33
|
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
30
|
-
padding:
|
|
34
|
+
padding: 0.313rem var(--core-space-3xs) 0.313rem var(--core-space-s);
|
|
31
35
|
font-size: font-settings.$font-size-md;
|
|
32
36
|
line-height: 1.5rem;
|
|
33
37
|
}
|
|
34
38
|
|
|
35
|
-
&:focus {
|
|
39
|
+
&:focus-visible {
|
|
36
40
|
outline: none;
|
|
41
|
+
border-color: var(--color-action-border-onlight-focus);
|
|
42
|
+
box-shadow: 0 0 0 1px var(--color-action-border-onlight-focus);
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
&:disabled {
|
|
40
46
|
cursor: initial;
|
|
41
|
-
color:
|
|
47
|
+
color: var(--color-disabled-text);
|
|
42
48
|
background-color: transparent;
|
|
43
|
-
border-color:
|
|
49
|
+
border-color: var(--color-disabled-border);
|
|
44
50
|
border-style: dashed;
|
|
45
51
|
}
|
|
46
52
|
|
|
47
|
-
&--
|
|
48
|
-
|
|
49
|
-
border-color: palette.$neutral700;
|
|
50
|
-
background-color: palette.$white;
|
|
51
|
-
|
|
52
|
-
&:hover {
|
|
53
|
-
background-color: palette.$neutral50;
|
|
54
|
-
box-shadow: 0 0 0 1px palette.$neutral700;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&:focus {
|
|
58
|
-
border-color: palette.$black;
|
|
59
|
-
box-shadow: 0 0 0 1px palette.$black;
|
|
60
|
-
}
|
|
53
|
+
&--with-icon {
|
|
54
|
+
padding-left: var(--core-space-2xs);
|
|
61
55
|
}
|
|
62
56
|
|
|
63
|
-
&--
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
&:hover {
|
|
68
|
-
background-color: palette.$blueberry50;
|
|
69
|
-
box-shadow: 0 0 0 1px palette.$blueberry500;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
&:focus {
|
|
73
|
-
border-color: palette.$black;
|
|
74
|
-
box-shadow: 0 0 0 1px palette.$black;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
&--on-cherry {
|
|
79
|
-
border-color: palette.$cherry500;
|
|
80
|
-
background-color: palette.$white;
|
|
81
|
-
|
|
82
|
-
&:hover {
|
|
83
|
-
background-color: palette.$cherry50;
|
|
84
|
-
box-shadow: 0 0 0 1px palette.$cherry500;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
&:focus {
|
|
88
|
-
border-color: palette.$black;
|
|
89
|
-
box-shadow: 0 0 0 1px palette.$black;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
&--open#{&}--on-white,
|
|
94
|
-
&--open#{&}--on-grey {
|
|
95
|
-
background-color: palette.$neutral50;
|
|
96
|
-
|
|
97
|
-
&:hover {
|
|
98
|
-
background-color: palette.$white;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
&--open#{&}--on-blueberry {
|
|
103
|
-
background-color: palette.$blueberry50;
|
|
104
|
-
|
|
105
|
-
&:hover {
|
|
106
|
-
background-color: palette.$white;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&--open#{&}--on-cherry {
|
|
111
|
-
background-color: palette.$cherry50;
|
|
112
|
-
|
|
113
|
-
&:hover {
|
|
114
|
-
background-color: palette.$white;
|
|
115
|
-
}
|
|
57
|
+
&--borderless {
|
|
58
|
+
min-width: none;
|
|
59
|
+
border-color: transparent;
|
|
116
60
|
}
|
|
117
61
|
|
|
118
|
-
&--transparent
|
|
62
|
+
&--transparent,
|
|
63
|
+
&--borderless {
|
|
119
64
|
background-color: transparent;
|
|
120
|
-
}
|
|
121
65
|
|
|
122
|
-
&--transparent#{&}--on-grey {
|
|
123
66
|
&:hover {
|
|
124
|
-
background-color:
|
|
67
|
+
background-color: var(--core-color-neutral-100);
|
|
125
68
|
}
|
|
126
|
-
}
|
|
127
69
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
background-color: palette.$blueberry100;
|
|
70
|
+
&:active {
|
|
71
|
+
background-color: var(--core-color-neutral-200);
|
|
131
72
|
}
|
|
132
73
|
}
|
|
133
74
|
|
|
134
|
-
&--
|
|
135
|
-
|
|
136
|
-
background-color: palette.$cherry100;
|
|
137
|
-
}
|
|
75
|
+
&--borderless:disabled {
|
|
76
|
+
border-color: transparent;
|
|
138
77
|
}
|
|
139
78
|
|
|
140
|
-
&--
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
&:hover {
|
|
144
|
-
background-color: transparent;
|
|
145
|
-
}
|
|
79
|
+
&--borderless#{&}--open {
|
|
80
|
+
border-color: var(--color-base-border-onlight-emphasized);
|
|
146
81
|
}
|
|
147
82
|
|
|
148
|
-
|
|
149
|
-
|
|
83
|
+
&__text {
|
|
84
|
+
padding: 0.34rem 0;
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
text-overflow: ellipsis;
|
|
150
88
|
|
|
151
|
-
|
|
152
|
-
|
|
89
|
+
@media (min-width: map.get(breakpoints.$grid-breakpoints, md)) {
|
|
90
|
+
padding: 0.375rem 0;
|
|
153
91
|
}
|
|
154
92
|
}
|
|
93
|
+
}
|
|
155
94
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
&:hover {
|
|
160
|
-
background-color: transparent;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
95
|
+
&__left-icon {
|
|
96
|
+
margin-right: var(--core-space-3xs);
|
|
97
|
+
}
|
|
163
98
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
99
|
+
&__right-icon {
|
|
100
|
+
margin-left: var(--core-space-3xs);
|
|
101
|
+
}
|
|
167
102
|
|
|
168
|
-
|
|
169
|
-
|
|
103
|
+
&__left-icon,
|
|
104
|
+
&__right-icon {
|
|
105
|
+
fill: var(--color-action-graphics-onlight);
|
|
170
106
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
107
|
+
:hover > & {
|
|
108
|
+
fill: var(--color-action-graphics-onlight-hover);
|
|
174
109
|
}
|
|
175
|
-
}
|
|
176
110
|
|
|
177
|
-
|
|
178
|
-
|
|
111
|
+
:disabled > & {
|
|
112
|
+
fill: var(--color-disabled-graphics);
|
|
113
|
+
}
|
|
179
114
|
}
|
|
180
115
|
|
|
181
116
|
&__content {
|
|
182
117
|
display: none;
|
|
183
|
-
|
|
184
|
-
background-color:
|
|
185
|
-
|
|
186
|
-
box-shadow: 0 0 0 2px palette.$blueberry500;
|
|
118
|
+
width: 100%;
|
|
119
|
+
background-color: var(--core-color-white);
|
|
120
|
+
border: 2px solid var(--core-color-blueberry-500);
|
|
187
121
|
z-index: 1;
|
|
188
122
|
|
|
189
123
|
&--open {
|
|
@@ -204,27 +138,47 @@
|
|
|
204
138
|
}
|
|
205
139
|
|
|
206
140
|
&__close {
|
|
207
|
-
padding:
|
|
141
|
+
padding: var(--core-space-s);
|
|
208
142
|
}
|
|
209
143
|
|
|
210
|
-
&
|
|
211
|
-
|
|
212
|
-
padding:
|
|
144
|
+
&__multiselect-item {
|
|
145
|
+
padding-left: var(--core-space-m);
|
|
146
|
+
padding-right: var(--core-space-m);
|
|
147
|
+
}
|
|
213
148
|
|
|
214
|
-
|
|
215
|
-
|
|
149
|
+
&__list-item {
|
|
150
|
+
min-height: 44px;
|
|
151
|
+
border-bottom: 1px solid var(--color-base-border-neutral-emphasized);
|
|
152
|
+
|
|
153
|
+
&:last-child {
|
|
154
|
+
border-bottom: none;
|
|
216
155
|
}
|
|
217
156
|
|
|
218
|
-
|
|
219
|
-
|
|
157
|
+
&:hover {
|
|
158
|
+
background-color: var(--core-color-neutral-50);
|
|
220
159
|
}
|
|
221
160
|
|
|
222
|
-
|
|
223
|
-
|
|
161
|
+
&:active {
|
|
162
|
+
background-color: var(--core-color-neutral-100);
|
|
224
163
|
}
|
|
225
164
|
|
|
226
|
-
&:
|
|
227
|
-
|
|
165
|
+
&:has(:checked),
|
|
166
|
+
&:has([aria-current='true']) {
|
|
167
|
+
background-color: var(--core-color-blueberry-50);
|
|
168
|
+
|
|
169
|
+
&:hover {
|
|
170
|
+
background-color: var(--core-color-blueberry-100);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&:active {
|
|
174
|
+
background-color: var(--core-color-blueberry-200);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&--single-select:has(:focus-visible) {
|
|
179
|
+
border-color: var(--color-action-border-onlight-focus);
|
|
180
|
+
outline: 4px solid var(--color-action-border-onlight-focus);
|
|
181
|
+
outline-offset: -4px;
|
|
228
182
|
}
|
|
229
183
|
}
|
|
230
184
|
}
|
|
@@ -3,19 +3,18 @@ export type Styles = {
|
|
|
3
3
|
dropdown__close: string;
|
|
4
4
|
dropdown__content: string;
|
|
5
5
|
'dropdown__content--open': string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
'dropdown__left-icon': string;
|
|
7
|
+
'dropdown__list-item': string;
|
|
8
|
+
'dropdown__list-item--single-select': string;
|
|
9
|
+
'dropdown__multiselect-item': string;
|
|
9
10
|
dropdown__options: string;
|
|
11
|
+
'dropdown__right-icon': string;
|
|
10
12
|
dropdown__toggle: string;
|
|
11
|
-
|
|
12
|
-
'dropdown__toggle--
|
|
13
|
-
'dropdown__toggle--on-blueberry': string;
|
|
14
|
-
'dropdown__toggle--on-cherry': string;
|
|
15
|
-
'dropdown__toggle--on-grey': string;
|
|
16
|
-
'dropdown__toggle--on-white': string;
|
|
13
|
+
dropdown__toggle__text: string;
|
|
14
|
+
'dropdown__toggle--borderless': string;
|
|
17
15
|
'dropdown__toggle--open': string;
|
|
18
16
|
'dropdown__toggle--transparent': string;
|
|
17
|
+
'dropdown__toggle--with-icon': string;
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
export type ClassNames = keyof Styles;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { HNDesignsystemDropdown } from '../../resources/Resources';
|
|
3
|
+
export declare enum DropdownOldOnColor {
|
|
4
|
+
onwhite = "onwhite",
|
|
5
|
+
ongrey = "ongrey",
|
|
6
|
+
onblueberry = "onblueberry",
|
|
7
|
+
oncherry = "oncherry"
|
|
8
|
+
}
|
|
9
|
+
export interface DropdownOldProps {
|
|
10
|
+
/** Label for dropdown. Visible for screen readers */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Text on the trigger button that opens the dropdown */
|
|
13
|
+
placeholder: string;
|
|
14
|
+
/** Sets the dropdown content */
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
/** @deprecated Close button text */
|
|
17
|
+
closeText?: string;
|
|
18
|
+
/** Minimum width for the dropdown in pixels. Does not affect trigger button */
|
|
19
|
+
dropdownMinWidth?: number;
|
|
20
|
+
/** No close button */
|
|
21
|
+
noCloseButton?: boolean;
|
|
22
|
+
/** Called when dropdown is open/closed */
|
|
23
|
+
onToggle?: (isOpen: boolean) => void;
|
|
24
|
+
/** Whether the dropdown is open or not */
|
|
25
|
+
open?: boolean;
|
|
26
|
+
/** Changes the visuals of the dropdown */
|
|
27
|
+
onColor?: keyof typeof DropdownOldOnColor;
|
|
28
|
+
/** Makes the background of the trigger transparent */
|
|
29
|
+
transparent?: boolean;
|
|
30
|
+
/** Makes the width of the full component adjust to its parent */
|
|
31
|
+
fluid?: boolean;
|
|
32
|
+
/** Makes the dropdown disabled */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** Sets the data-testid attribute on the dropdown button */
|
|
35
|
+
testId?: string;
|
|
36
|
+
/** Overrides the default z-index of the DropDownContent */
|
|
37
|
+
zIndex?: number;
|
|
38
|
+
/** Resources for component */
|
|
39
|
+
resources?: Partial<HNDesignsystemDropdown>;
|
|
40
|
+
}
|
|
41
|
+
declare const DropdownOld: React.FC<DropdownOldProps>;
|
|
42
|
+
export default DropdownOld;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React__default, { useRef, useId, useEffect } from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { theme } from "../../theme/index.js";
|
|
5
|
+
import "../../hooks/useBreakpoint.js";
|
|
6
|
+
import { useHover } from "../../hooks/useHover.js";
|
|
7
|
+
import { useToggle } from "../../hooks/useToggle.js";
|
|
8
|
+
import { useKeyboardEvent } from "../../hooks/useKeyboardEvent.js";
|
|
9
|
+
import { useOutsideEvent } from "../../hooks/useOutsideEvent.js";
|
|
10
|
+
import { LanguageLocales, ZIndex, KeyboardEventKey, AnalyticsId, IconSize } from "../../constants.js";
|
|
11
|
+
import { n as nbNO, e as enGB } from "../../HN.Designsystem.Dropdown.nb-NO.js";
|
|
12
|
+
import { useLanguage } from "../../utils/language.js";
|
|
13
|
+
import { mergeRefs } from "../../utils/refs.js";
|
|
14
|
+
import { B as Button } from "../../Button.js";
|
|
15
|
+
import { I as Icon } from "../../Icon.js";
|
|
16
|
+
import PlusSmall from "../Icons/PlusSmall.js";
|
|
17
|
+
import styles from "./styles.module.scss";
|
|
18
|
+
const getResources = (language) => {
|
|
19
|
+
switch (language) {
|
|
20
|
+
case LanguageLocales.ENGLISH:
|
|
21
|
+
return enGB;
|
|
22
|
+
case LanguageLocales.NORWEGIAN:
|
|
23
|
+
default:
|
|
24
|
+
return nbNO;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var DropdownOldOnColor = /* @__PURE__ */ ((DropdownOldOnColor2) => {
|
|
28
|
+
DropdownOldOnColor2["onwhite"] = "onwhite";
|
|
29
|
+
DropdownOldOnColor2["ongrey"] = "ongrey";
|
|
30
|
+
DropdownOldOnColor2["onblueberry"] = "onblueberry";
|
|
31
|
+
DropdownOldOnColor2["oncherry"] = "oncherry";
|
|
32
|
+
return DropdownOldOnColor2;
|
|
33
|
+
})(DropdownOldOnColor || {});
|
|
34
|
+
const DropdownOld = (props) => {
|
|
35
|
+
const {
|
|
36
|
+
label,
|
|
37
|
+
placeholder,
|
|
38
|
+
noCloseButton = false,
|
|
39
|
+
onToggle,
|
|
40
|
+
dropdownMinWidth,
|
|
41
|
+
open = false,
|
|
42
|
+
children,
|
|
43
|
+
onColor = "onwhite",
|
|
44
|
+
transparent = false,
|
|
45
|
+
fluid = false,
|
|
46
|
+
testId,
|
|
47
|
+
disabled,
|
|
48
|
+
zIndex = ZIndex.PopOver,
|
|
49
|
+
resources
|
|
50
|
+
} = props;
|
|
51
|
+
const dropdownRef = useRef(null);
|
|
52
|
+
const optionsRef = useRef(null);
|
|
53
|
+
const { hoverRef: buttonRef, isHovered } = useHover();
|
|
54
|
+
const openedByKeyboard = useRef(false);
|
|
55
|
+
const { value: isOpen, toggleValue: toggleIsOpen } = useToggle(!disabled && open, onToggle);
|
|
56
|
+
const inputRefList = useRef(React__default.Children.map(children, () => React__default.createRef()));
|
|
57
|
+
const labelId = useId();
|
|
58
|
+
const toggleLabelId = useId();
|
|
59
|
+
const optionIdPrefix = useId();
|
|
60
|
+
const contentId = useId();
|
|
61
|
+
const { language } = useLanguage(LanguageLocales.NORWEGIAN);
|
|
62
|
+
const defaultResources = getResources(language);
|
|
63
|
+
const mergedResources = {
|
|
64
|
+
...defaultResources,
|
|
65
|
+
...resources,
|
|
66
|
+
closeText: props.closeText ?? (resources == null ? void 0 : resources.closeText) ?? defaultResources.closeText
|
|
67
|
+
};
|
|
68
|
+
const handleOpen = (isKeyboard) => {
|
|
69
|
+
openedByKeyboard.current = isKeyboard;
|
|
70
|
+
toggleIsOpen();
|
|
71
|
+
};
|
|
72
|
+
const handleClose = () => {
|
|
73
|
+
var _a;
|
|
74
|
+
toggleIsOpen();
|
|
75
|
+
(_a = buttonRef.current) == null ? void 0 : _a.focus();
|
|
76
|
+
};
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
if (isOpen && openedByKeyboard.current) {
|
|
80
|
+
const firstEnabled = (_a = inputRefList.current) == null ? void 0 : _a.find((r) => r.current && !r.current.hasAttribute("disabled"));
|
|
81
|
+
(_b = firstEnabled == null ? void 0 : firstEnabled.current) == null ? void 0 : _b.focus();
|
|
82
|
+
openedByKeyboard.current = false;
|
|
83
|
+
}
|
|
84
|
+
}, [isOpen]);
|
|
85
|
+
const handleKeyboardNavigation = (event) => {
|
|
86
|
+
var _a;
|
|
87
|
+
if (!inputRefList.current) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (event.key === KeyboardEventKey.Escape) {
|
|
91
|
+
if (isOpen) handleClose();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (!isOpen) {
|
|
95
|
+
handleOpen(true);
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const index = inputRefList.current.findIndex((x) => x.current === event.target);
|
|
100
|
+
let nextIndex = index;
|
|
101
|
+
if (event.key === KeyboardEventKey.Home) {
|
|
102
|
+
nextIndex = 0;
|
|
103
|
+
} else if (event.key === KeyboardEventKey.End) {
|
|
104
|
+
nextIndex = inputRefList.current.length - 1;
|
|
105
|
+
} else if (event.key === KeyboardEventKey.ArrowDown && index < inputRefList.current.length - 1) {
|
|
106
|
+
nextIndex = index + 1;
|
|
107
|
+
} else if (event.key === KeyboardEventKey.ArrowUp && index > 0) {
|
|
108
|
+
nextIndex = index - 1;
|
|
109
|
+
} else if (event.key === KeyboardEventKey.Enter && index !== -1) {
|
|
110
|
+
nextIndex = index;
|
|
111
|
+
}
|
|
112
|
+
if (nextIndex !== -1 && event.key !== KeyboardEventKey.Space) {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
(_a = inputRefList.current[nextIndex].current) == null ? void 0 : _a.focus();
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
useKeyboardEvent(dropdownRef, handleKeyboardNavigation, [
|
|
118
|
+
KeyboardEventKey.ArrowDown,
|
|
119
|
+
KeyboardEventKey.ArrowUp,
|
|
120
|
+
KeyboardEventKey.End,
|
|
121
|
+
KeyboardEventKey.Enter,
|
|
122
|
+
KeyboardEventKey.Escape,
|
|
123
|
+
KeyboardEventKey.Home,
|
|
124
|
+
KeyboardEventKey.Space
|
|
125
|
+
]);
|
|
126
|
+
useOutsideEvent(dropdownRef, () => isOpen && handleClose());
|
|
127
|
+
const toggleClasses = classNames(
|
|
128
|
+
styles.dropdown__toggle,
|
|
129
|
+
!disabled && {
|
|
130
|
+
[styles["dropdown__toggle--on-white"]]: onColor === "onwhite",
|
|
131
|
+
[styles["dropdown__toggle--on-grey"]]: onColor === "ongrey",
|
|
132
|
+
[styles["dropdown__toggle--on-blueberry"]]: onColor === "onblueberry",
|
|
133
|
+
[styles["dropdown__toggle--on-cherry"]]: onColor === "oncherry",
|
|
134
|
+
[styles["dropdown__toggle--transparent"]]: transparent,
|
|
135
|
+
[styles["dropdown__toggle--fluid"]]: fluid,
|
|
136
|
+
[styles["dropdown__toggle--open"]]: isOpen
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
const contentClasses = classNames(styles.dropdown__content, isOpen && styles["dropdown__content--open"]);
|
|
140
|
+
const renderChildren = React__default.Children.map(children, (child, index) => {
|
|
141
|
+
return /* @__PURE__ */ jsx("li", { className: styles.dropdown__input, id: `${optionIdPrefix}-${index}`, children: React__default.isValidElement(child) && inputRefList.current && inputRefList.current[index] ? React__default.cloneElement(child, {
|
|
142
|
+
ref: mergeRefs([child.props.ref, inputRefList.current[index]])
|
|
143
|
+
}) : child });
|
|
144
|
+
});
|
|
145
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.dropdown, ref: dropdownRef, children: [
|
|
146
|
+
/* @__PURE__ */ jsx("span", { id: labelId, className: styles.dropdown__label, children: label }),
|
|
147
|
+
/* @__PURE__ */ jsxs(
|
|
148
|
+
"button",
|
|
149
|
+
{
|
|
150
|
+
type: "button",
|
|
151
|
+
onClick: () => handleOpen(false),
|
|
152
|
+
className: toggleClasses,
|
|
153
|
+
ref: buttonRef,
|
|
154
|
+
"data-testid": testId,
|
|
155
|
+
"data-analyticsid": AnalyticsId.Dropdown,
|
|
156
|
+
disabled,
|
|
157
|
+
"aria-labelledby": toggleLabelId,
|
|
158
|
+
"aria-haspopup": true,
|
|
159
|
+
"aria-controls": contentId,
|
|
160
|
+
"aria-expanded": isOpen,
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ jsx("span", { id: toggleLabelId, className: styles.dropdown__toggle__label, children: placeholder }),
|
|
163
|
+
/* @__PURE__ */ jsx(
|
|
164
|
+
Icon,
|
|
165
|
+
{
|
|
166
|
+
color: disabled ? theme.palette.neutral700 : theme.palette.blueberry600,
|
|
167
|
+
svgIcon: PlusSmall,
|
|
168
|
+
className: styles.dropdown__icon,
|
|
169
|
+
isHovered: !disabled && isHovered,
|
|
170
|
+
size: IconSize.XSmall
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ jsxs(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
id: contentId,
|
|
180
|
+
className: contentClasses,
|
|
181
|
+
style: { width: fluid ? "100%" : `auto`, minWidth: dropdownMinWidth ?? "auto", zIndex },
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ jsx("ul", { className: styles.dropdown__options, role: "group", "aria-labelledby": labelId, tabIndex: -1, ref: optionsRef, children: renderChildren }),
|
|
184
|
+
!noCloseButton && /* @__PURE__ */ jsx("div", { className: styles.dropdown__close, children: /* @__PURE__ */ jsx(Button, { onClick: handleClose, children: mergedResources.closeText }) })
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
] });
|
|
189
|
+
};
|
|
190
|
+
export {
|
|
191
|
+
DropdownOldOnColor,
|
|
192
|
+
DropdownOld as default
|
|
193
|
+
};
|
|
194
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/DropdownOld/resourceHelper.ts","../../../src/components/DropdownOld/DropdownOld.tsx"],"sourcesContent":["import { LanguageLocales } from '../../constants';\nimport enGB from '../../resources/HN.Designsystem.Dropdown.en-GB.json';\nimport nbNO from '../../resources/HN.Designsystem.Dropdown.nb-NO.json';\nimport { HNDesignsystemDropdown } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemDropdown => {\n switch (language) {\n case LanguageLocales.ENGLISH:\n return enGB;\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React, { useEffect, useRef, useId } from 'react';\n\nimport classNames from 'classnames';\n\nimport {\n AnalyticsId,\n IconSize,\n KeyboardEventKey,\n LanguageLocales,\n ZIndex,\n theme,\n useHover,\n useKeyboardEvent,\n useOutsideEvent,\n useToggle,\n} from '../..';\nimport { getResources } from './resourceHelper';\nimport { HNDesignsystemDropdown } from '../../resources/Resources';\nimport { useLanguage } from '../../utils/language';\nimport { mergeRefs } from '../../utils/refs';\nimport Button from '../Button';\nimport Icon from '../Icon';\nimport PlusSmall from '../Icons/PlusSmall';\n\nimport styles from './styles.module.scss';\n\nexport enum DropdownOldOnColor {\n onwhite = 'onwhite',\n ongrey = 'ongrey',\n onblueberry = 'onblueberry',\n oncherry = 'oncherry',\n}\n\nexport interface DropdownOldProps {\n /** Label for dropdown. Visible for screen readers */\n label: string;\n /** Text on the trigger button that opens the dropdown */\n placeholder: string;\n /** Sets the dropdown content */\n children: React.ReactNode;\n /** @deprecated Close button text */\n closeText?: string;\n /** Minimum width for the dropdown in pixels. Does not affect trigger button */\n dropdownMinWidth?: number;\n /** No close button */\n noCloseButton?: boolean;\n /** Called when dropdown is open/closed */\n onToggle?: (isOpen: boolean) => void;\n /** Whether the dropdown is open or not */\n open?: boolean;\n /** Changes the visuals of the dropdown */\n onColor?: keyof typeof DropdownOldOnColor;\n /** Makes the background of the trigger transparent */\n transparent?: boolean;\n /** Makes the width of the full component adjust to its parent */\n fluid?: boolean;\n /** Makes the dropdown disabled */\n disabled?: boolean;\n /** Sets the data-testid attribute on the dropdown button */\n testId?: string;\n /** Overrides the default z-index of the DropDownContent */\n zIndex?: number;\n /** Resources for component */\n resources?: Partial<HNDesignsystemDropdown>;\n}\n\nconst DropdownOld: React.FC<DropdownOldProps> = props => {\n const {\n label,\n placeholder,\n noCloseButton = false,\n onToggle,\n dropdownMinWidth,\n open = false,\n children,\n onColor = DropdownOldOnColor.onwhite,\n transparent = false,\n fluid = false,\n testId,\n disabled,\n zIndex = ZIndex.PopOver,\n resources,\n } = props;\n\n const dropdownRef = useRef<HTMLDivElement>(null);\n const optionsRef = useRef<HTMLUListElement>(null);\n const { hoverRef: buttonRef, isHovered } = useHover<HTMLButtonElement>();\n const openedByKeyboard = useRef<boolean>(false);\n const { value: isOpen, toggleValue: toggleIsOpen } = useToggle(!disabled && open, onToggle);\n const inputRefList = useRef(React.Children.map(children, () => React.createRef<HTMLElement>()));\n const labelId = useId();\n const toggleLabelId = useId();\n const optionIdPrefix = useId();\n const contentId = useId();\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemDropdown = {\n ...defaultResources,\n ...resources,\n closeText: props.closeText ?? resources?.closeText ?? defaultResources.closeText,\n };\n\n const handleOpen = (isKeyboard: boolean): void => {\n openedByKeyboard.current = isKeyboard;\n toggleIsOpen();\n };\n\n const handleClose = (): void => {\n toggleIsOpen();\n buttonRef.current?.focus();\n };\n\n useEffect(() => {\n if (isOpen && openedByKeyboard.current) {\n const firstEnabled = inputRefList.current?.find(r => r.current && !r.current.hasAttribute('disabled'));\n firstEnabled?.current?.focus();\n openedByKeyboard.current = false;\n }\n }, [isOpen]);\n\n const handleKeyboardNavigation = (event: KeyboardEvent): void => {\n if (!inputRefList.current) {\n return;\n }\n\n if (event.key === KeyboardEventKey.Escape) {\n if (isOpen) handleClose();\n return;\n }\n\n if (!isOpen) {\n handleOpen(true);\n event.preventDefault();\n return;\n }\n\n const index = inputRefList.current.findIndex(x => x.current === event.target);\n let nextIndex = index;\n\n if (event.key === KeyboardEventKey.Home) {\n nextIndex = 0;\n } else if (event.key === KeyboardEventKey.End) {\n nextIndex = inputRefList.current.length - 1;\n } else if (event.key === KeyboardEventKey.ArrowDown && index < inputRefList.current.length - 1) {\n nextIndex = index + 1;\n } else if (event.key === KeyboardEventKey.ArrowUp && index > 0) {\n nextIndex = index - 1;\n } else if (event.key === KeyboardEventKey.Enter && index !== -1) {\n nextIndex = index;\n }\n\n if (nextIndex !== -1 && event.key !== KeyboardEventKey.Space) {\n event.preventDefault();\n\n inputRefList.current[nextIndex].current?.focus();\n }\n };\n\n useKeyboardEvent(dropdownRef, handleKeyboardNavigation, [\n KeyboardEventKey.ArrowDown,\n KeyboardEventKey.ArrowUp,\n KeyboardEventKey.End,\n KeyboardEventKey.Enter,\n KeyboardEventKey.Escape,\n KeyboardEventKey.Home,\n KeyboardEventKey.Space,\n ]);\n\n useOutsideEvent(dropdownRef, () => isOpen && handleClose());\n\n const toggleClasses = classNames(\n styles.dropdown__toggle,\n !disabled && {\n [styles['dropdown__toggle--on-white']]: onColor === DropdownOldOnColor.onwhite,\n [styles['dropdown__toggle--on-grey']]: onColor === DropdownOldOnColor.ongrey,\n [styles['dropdown__toggle--on-blueberry']]: onColor === DropdownOldOnColor.onblueberry,\n [styles['dropdown__toggle--on-cherry']]: onColor === DropdownOldOnColor.oncherry,\n [styles['dropdown__toggle--transparent']]: transparent,\n [styles['dropdown__toggle--fluid']]: fluid,\n [styles['dropdown__toggle--open']]: isOpen,\n }\n );\n\n const contentClasses = classNames(styles.dropdown__content, isOpen && styles['dropdown__content--open']);\n\n const renderChildren = React.Children.map(children, (child, index) => {\n return (\n <li className={styles.dropdown__input} id={`${optionIdPrefix}-${index}`}>\n {React.isValidElement(child) && inputRefList.current && inputRefList.current[index]\n ? React.cloneElement(child as React.ReactElement, {\n ref: mergeRefs([child.props.ref, inputRefList.current[index]]),\n })\n : child}\n </li>\n );\n });\n\n return (\n <div className={styles.dropdown} ref={dropdownRef}>\n <span id={labelId} className={styles.dropdown__label}>\n {label}\n </span>\n <button\n type=\"button\"\n onClick={(): false | void => handleOpen(false)}\n className={toggleClasses}\n ref={buttonRef}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Dropdown}\n disabled={disabled}\n aria-labelledby={toggleLabelId}\n aria-haspopup={true}\n aria-controls={contentId}\n aria-expanded={isOpen}\n >\n <span id={toggleLabelId} className={styles.dropdown__toggle__label}>\n {placeholder}\n </span>\n <Icon\n color={disabled ? theme.palette.neutral700 : theme.palette.blueberry600}\n svgIcon={PlusSmall}\n className={styles.dropdown__icon}\n isHovered={!disabled && isHovered}\n size={IconSize.XSmall}\n />\n </button>\n <div\n id={contentId}\n className={contentClasses}\n style={{ width: fluid ? '100%' : `auto`, minWidth: dropdownMinWidth ?? 'auto', zIndex: zIndex }}\n >\n <ul className={styles.dropdown__options} role=\"group\" aria-labelledby={labelId} tabIndex={-1} ref={optionsRef}>\n {renderChildren}\n </ul>\n {!noCloseButton && (\n <div className={styles.dropdown__close}>\n <Button onClick={handleClose}>{mergedResources.closeText}</Button>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default DropdownOld;\n"],"names":["DropdownOldOnColor","React"],"mappings":";;;;;;;;;;;;;;;;;AAKO,MAAM,eAAe,CAAC,aAAsD;AACjF,UAAQ,UAAA;AAAA,IACN,KAAK,gBAAgB;AACnB,aAAO;AAAA,IACT,KAAK,gBAAgB;AAAA,IACrB;AACE,aAAO;AAAA,EAAA;AAEb;ACaO,IAAK,uCAAAA,wBAAL;AACLA,sBAAA,SAAA,IAAU;AACVA,sBAAA,QAAA,IAAS;AACTA,sBAAA,aAAA,IAAc;AACdA,sBAAA,UAAA,IAAW;AAJD,SAAAA;AAAA,GAAA,sBAAA,CAAA,CAAA;AAwCZ,MAAM,cAA0C,CAAA,UAAS;AACvD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA,UAAU;AAAA,IACV,cAAc;AAAA,IACd,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS,OAAO;AAAA,IAChB;AAAA,EAAA,IACE;AAEJ,QAAM,cAAc,OAAuB,IAAI;AAC/C,QAAM,aAAa,OAAyB,IAAI;AAChD,QAAM,EAAE,UAAU,WAAW,UAAA,IAAc,SAAA;AAC3C,QAAM,mBAAmB,OAAgB,KAAK;AAC9C,QAAM,EAAE,OAAO,QAAQ,aAAa,iBAAiB,UAAU,CAAC,YA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