@helsenorge/designsystem-react 1.0.0-beta122 → 1.0.0-beta125
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/{Badge-2d8d73dd.js → Badge-f1986705.js} +2 -2
- package/Badge-f1986705.js.map +1 -0
- package/{Button-19ee3464.js → Button-a7ae5afb.js} +2 -2
- package/Button-a7ae5afb.js.map +1 -0
- package/Checkbox-b0271e50.js +2 -0
- package/Checkbox-b0271e50.js.map +1 -0
- package/{Close-476c50c6.js → Close-58f848f6.js} +2 -2
- package/Close-58f848f6.js.map +1 -0
- package/{FormGroup-a776b535.js → FormGroup-9d4dc1ed.js} +2 -2
- package/FormGroup-9d4dc1ed.js.map +1 -0
- package/FormLayout-6bb303ac.js +2 -0
- package/FormLayout-6bb303ac.js.map +1 -0
- package/{Input-cd941f2f.js → Input-b5f362b8.js} +2 -2
- package/Input-b5f362b8.js.map +1 -0
- package/{Loader-2f304e4f.js → Loader-a7566e5f.js} +2 -2
- package/Loader-a7566e5f.js.map +1 -0
- package/{Modal-d0213453.js → Modal-3702a0b8.js} +2 -2
- package/Modal-3702a0b8.js.map +1 -0
- package/{Panel-33611d84.js → Panel-8a6a740c.js} +2 -2
- package/Panel-8a6a740c.js.map +1 -0
- package/{RadioButton-6a868eb3.js → RadioButton-403681d9.js} +2 -2
- package/RadioButton-403681d9.js.map +1 -0
- package/{Textarea-1c857a8a.js → Textarea-47398150.js} +2 -2
- package/Textarea-47398150.js.map +1 -0
- package/Title-53c8b68d.js +2 -0
- package/Title-53c8b68d.js.map +1 -0
- package/{Validation-fa8b28c3.js → Validation-0c27dd5b.js} +2 -2
- package/Validation-0c27dd5b.js.map +1 -0
- package/__mocks__/ResizeObserver.d.ts +6 -0
- package/__mocks__/ResizeObserver.d.ts.map +1 -0
- package/__mocks__/ResizeObserver.js +2 -0
- package/__mocks__/ResizeObserver.js.map +1 -0
- package/__mocks__/useLayoutEvent.d.ts +1 -0
- package/__mocks__/useLayoutEvent.d.ts.map +1 -0
- package/__mocks__/useLayoutEvent.js +2 -0
- package/__mocks__/useLayoutEvent.js.map +1 -0
- package/__mocks__/uuid.d.ts +2 -0
- package/__mocks__/uuid.d.ts.map +1 -0
- package/__mocks__/uuid.js +2 -0
- package/__mocks__/uuid.js.map +1 -0
- package/components/AnchorLink/index.js +1 -1
- package/components/Avatar/index.js +1 -1
- package/components/Badge/index.js +1 -1
- package/components/Button/index.js +1 -1
- package/components/Button/styles.module.scss +29 -6
- package/components/ButtonWithModal/index.js +1 -1
- package/components/Checkbox/index.js +1 -1
- package/components/Close/index.js +1 -1
- package/components/Dropdown/Dropdown.d.ts +36 -0
- package/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/components/Dropdown/componentdata.json +254 -0
- package/components/Dropdown/index.d.ts +4 -0
- package/components/Dropdown/index.d.ts.map +1 -0
- package/components/Dropdown/index.js +2 -0
- package/components/Dropdown/index.js.map +1 -0
- package/components/Dropdown/styles.module.scss +197 -0
- package/components/Expander/index.js +1 -1
- package/components/ExpanderList/ExpanderList.d.ts.map +1 -1
- package/components/ExpanderList/index.js +1 -1
- package/components/FormExample/index.js +1 -1
- package/components/FormGroup/index.js +1 -1
- package/components/FormLayout/FormLayout.d.ts.map +1 -1
- package/components/FormLayout/index.js +1 -1
- package/components/FormLayout/styles.module.scss +16 -11
- package/components/FormLayout/styles.module.scss.d.ts +5 -4
- package/components/HighlightBox/index.js +1 -1
- package/components/Icons/AcupunctureBack.js +1 -1
- package/components/Icons/AlarmClock.js +1 -1
- package/components/Icons/AlertSignFill.js +1 -1
- package/components/Icons/AlertSignStroke.js +1 -1
- package/components/Icons/Archive.js +1 -1
- package/components/Icons/ArrowLeft.js +1 -1
- package/components/Icons/ArrowRight.js +1 -1
- package/components/Icons/ArrowUpRight.js +1 -1
- package/components/Icons/Attachment.js +1 -1
- package/components/Icons/Avatar.js +1 -1
- package/components/Icons/Bus.js +1 -1
- package/components/Icons/Calendar.js +1 -1
- package/components/Icons/CalendarChange.js +1 -1
- package/components/Icons/CalendarCheck.js +1 -1
- package/components/Icons/CalendarSave.js +1 -1
- package/components/Icons/Change.js +1 -1
- package/components/Icons/Check.js +1 -1
- package/components/Icons/CheckFill.js +1 -1
- package/components/Icons/ChevronDown.js +1 -1
- package/components/Icons/ChevronLeft.js +1 -1
- package/components/Icons/ChevronRight.js +1 -1
- package/components/Icons/ChevronUp.js +1 -1
- package/components/Icons/ChevronsDown.js +1 -1
- package/components/Icons/ChevronsUp.js +1 -1
- package/components/Icons/Contacts.js +1 -1
- package/components/Icons/Copy.js +1 -1
- package/components/Icons/Download.js +1 -1
- package/components/Icons/EChat.js +1 -1
- package/components/Icons/EnterFullScreen.js +1 -1
- package/components/Icons/Envelope.js +1 -1
- package/components/Icons/Eraser.js +1 -1
- package/components/Icons/ErrorSignFill.js +1 -1
- package/components/Icons/ErrorSignStroke.js +1 -1
- package/components/Icons/ExitFullScreen.js +1 -1
- package/components/Icons/Eye.js +1 -1
- package/components/Icons/Form.js +1 -1
- package/components/Icons/Forward.js +1 -1
- package/components/Icons/Gallery.js +1 -1
- package/components/Icons/Globe.js +1 -1
- package/components/Icons/Group.js +1 -1
- package/components/Icons/Heart.js +1 -1
- package/components/Icons/HelpSign.js +1 -1
- package/components/Icons/History.js +1 -1
- package/components/Icons/Home.js +1 -1
- package/components/Icons/Hospital.js +1 -1
- package/components/Icons/Hourglass.js +1 -1
- package/components/Icons/Icon.js +1 -1
- package/components/Icons/InfoSignFill.js +1 -1
- package/components/Icons/InfoSignStroke.js +1 -1
- package/components/Icons/Journal.js +1 -1
- package/components/Icons/List.js +1 -1
- package/components/Icons/Location.js +1 -1
- package/components/Icons/Lock.js +1 -1
- package/components/Icons/Medicine.js +1 -1
- package/components/Icons/Menu.js +1 -1
- package/components/Icons/Minus.js +1 -1
- package/components/Icons/MobilePhone.js +1 -1
- package/components/Icons/NoEye.js +1 -1
- package/components/Icons/NoFilter.js +1 -1
- package/components/Icons/PaperPlane.js +1 -1
- package/components/Icons/Pause.js +1 -1
- package/components/Icons/Pencil.js +1 -1
- package/components/Icons/Play.js +1 -1
- package/components/Icons/PlusLarge.js +1 -1
- package/components/Icons/PlusSmall.js +1 -1
- package/components/Icons/Printer.js +1 -1
- package/components/Icons/QrCode.js +1 -1
- package/components/Icons/Receptionist.js +1 -1
- package/components/Icons/Referral.js +1 -1
- package/components/Icons/Refresh.js +1 -1
- package/components/Icons/Reply.js +1 -1
- package/components/Icons/Save.js +1 -1
- package/components/Icons/Search.js +1 -1
- package/components/Icons/SectionSign.js +1 -1
- package/components/Icons/Settings.js +1 -1
- package/components/Icons/Share.js +1 -1
- package/components/Icons/SpeechBubble.js +1 -1
- package/components/Icons/Stopwatch.js +1 -1
- package/components/Icons/SupportingPerson.js +1 -1
- package/components/Icons/Syringe.js +1 -1
- package/components/Icons/TimePassing.js +1 -1
- package/components/Icons/Toolbox.js +1 -1
- package/components/Icons/TrashCan.js +1 -1
- package/components/Icons/Undo.js +1 -1
- package/components/Icons/Upload.js +1 -1
- package/components/Icons/Vaccine.js +1 -1
- package/components/Icons/VerticalDots.js +1 -1
- package/components/Icons/VideoCamera.js +1 -1
- package/components/Icons/VideoChat.js +1 -1
- package/components/Icons/Wallet.js +1 -1
- package/components/Icons/Watch.js +1 -1
- package/components/Icons/X.js +1 -1
- package/components/Icons/Zoom.js +1 -1
- package/components/Icons/index.js +1 -1
- package/components/Input/index.js +1 -1
- package/components/LinkList/index.js +1 -1
- package/components/List/index.js +1 -1
- package/components/Loader/index.js +1 -1
- package/components/Logo/index.js +1 -1
- package/components/Modal/index.js +1 -1
- package/components/NotificationPanel/index.js +1 -1
- package/components/Panel/index.js +1 -1
- package/components/PanelList/index.js +1 -1
- package/components/Portal/index.js +1 -1
- package/components/RadioButton/index.js +1 -1
- package/components/Slider/index.js +1 -1
- package/components/Spacer/index.js +1 -1
- package/components/StatusDot/index.js +1 -1
- package/components/Tag/Tag.d.ts +35 -0
- package/components/Tag/Tag.d.ts.map +1 -0
- package/components/Tag/componentdata.json +223 -0
- package/components/Tag/index.d.ts +4 -0
- package/components/Tag/index.d.ts.map +1 -0
- package/components/Tag/index.js +2 -0
- package/components/Tag/index.js.map +1 -0
- package/components/Tag/styles.module.scss +174 -0
- package/components/Tag/styles.module.scss.d.ts +24 -0
- package/components/TagList/TagList.d.ts +8 -0
- package/components/TagList/TagList.d.ts.map +1 -0
- package/components/TagList/componentdata.json +23 -0
- package/components/TagList/index.d.ts +4 -0
- package/components/TagList/index.d.ts.map +1 -0
- package/components/TagList/index.js +2 -0
- package/components/TagList/index.js.map +1 -0
- package/components/TagList/styles.module.scss +10 -0
- package/components/TagList/styles.module.scss.d.ts +9 -0
- package/components/Textarea/index.js +1 -1
- package/components/Tile/index.js +1 -1
- package/components/Title/index.js +1 -1
- package/components/Validation/index.js +1 -1
- package/constants-088e1d4a.js +2 -0
- package/constants-088e1d4a.js.map +1 -0
- package/constants.d.ts +11 -0
- package/constants.d.ts.map +1 -1
- package/hooks/useKeyboardEvent.d.ts +3 -0
- package/hooks/useKeyboardEvent.d.ts.map +1 -0
- package/hooks/useOutsideEvent.d.ts +9 -0
- package/hooks/useOutsideEvent.d.ts.map +1 -0
- package/hooks/useResizeObserver.d.ts +9 -0
- package/hooks/useResizeObserver.d.ts.map +1 -0
- package/hooks/useToggle.d.ts +12 -0
- package/hooks/useToggle.d.ts.map +1 -0
- package/hooks/useUuid.d.ts +7 -0
- package/hooks/useUuid.d.ts.map +1 -0
- package/index.d.ts +5 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/scss/typography.module.scss.d.ts +25 -25
- package/useOutsideEvent-342977b9.js +2 -0
- package/useOutsideEvent-342977b9.js.map +1 -0
- package/useUuid-24176312.js +2 -0
- package/useUuid-24176312.js.map +1 -0
- package/uuid-11037462.js +2 -0
- package/uuid-11037462.js.map +1 -0
- package/Badge-2d8d73dd.js.map +0 -1
- package/Button-19ee3464.js.map +0 -1
- package/Checkbox-ca6c635d.js +0 -2
- package/Checkbox-ca6c635d.js.map +0 -1
- package/Close-476c50c6.js.map +0 -1
- package/FormGroup-a776b535.js.map +0 -1
- package/FormLayout-8d6d4552.js +0 -2
- package/FormLayout-8d6d4552.js.map +0 -1
- package/Input-cd941f2f.js.map +0 -1
- package/Loader-2f304e4f.js.map +0 -1
- package/Modal-d0213453.js.map +0 -1
- package/Panel-33611d84.js.map +0 -1
- package/RadioButton-6a868eb3.js.map +0 -1
- package/Textarea-1c857a8a.js.map +0 -1
- package/Title-2522b5b9.js +0 -2
- package/Title-2522b5b9.js.map +0 -1
- package/Validation-fa8b28c3.js.map +0 -1
- package/constants-4fe8c7ff.js +0 -2
- package/constants-4fe8c7ff.js.map +0 -1
- package/uuid-fe7442b7.js +0 -2
- package/uuid-fe7442b7.js.map +0 -1
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
{
|
|
2
|
+
"props": {
|
|
3
|
+
"label": {
|
|
4
|
+
"defaultValue": null,
|
|
5
|
+
"description": "Label for dropdown. Synlig for skjermlesere.",
|
|
6
|
+
"name": "label",
|
|
7
|
+
"parent": {
|
|
8
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
9
|
+
"name": "DropdownProps"
|
|
10
|
+
},
|
|
11
|
+
"declarations": [
|
|
12
|
+
{
|
|
13
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
14
|
+
"name": "DropdownProps"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"required": true,
|
|
18
|
+
"type": {
|
|
19
|
+
"name": "string"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"placeholder": {
|
|
23
|
+
"defaultValue": null,
|
|
24
|
+
"description": "Tekst på knappen som åpner dropdownen",
|
|
25
|
+
"name": "placeholder",
|
|
26
|
+
"parent": {
|
|
27
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
28
|
+
"name": "DropdownProps"
|
|
29
|
+
},
|
|
30
|
+
"declarations": [
|
|
31
|
+
{
|
|
32
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
33
|
+
"name": "DropdownProps"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"required": true,
|
|
37
|
+
"type": {
|
|
38
|
+
"name": "string"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"children": {
|
|
42
|
+
"defaultValue": null,
|
|
43
|
+
"description": "Sets the dropdown content",
|
|
44
|
+
"name": "children",
|
|
45
|
+
"parent": {
|
|
46
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
47
|
+
"name": "DropdownProps"
|
|
48
|
+
},
|
|
49
|
+
"declarations": [
|
|
50
|
+
{
|
|
51
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
52
|
+
"name": "DropdownProps"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"fileName": "designsystem/node_modules/@types/react/index.d.ts",
|
|
56
|
+
"name": "TypeLiteral"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"required": false,
|
|
60
|
+
"type": {
|
|
61
|
+
"name": "ReactNode"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"closeText": {
|
|
65
|
+
"defaultValue": null,
|
|
66
|
+
"description": "Close button text",
|
|
67
|
+
"name": "closeText",
|
|
68
|
+
"parent": {
|
|
69
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
70
|
+
"name": "DropdownProps"
|
|
71
|
+
},
|
|
72
|
+
"declarations": [
|
|
73
|
+
{
|
|
74
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
75
|
+
"name": "DropdownProps"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"required": false,
|
|
79
|
+
"type": {
|
|
80
|
+
"name": "string"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"noCloseButton": {
|
|
84
|
+
"defaultValue": null,
|
|
85
|
+
"description": "No close button",
|
|
86
|
+
"name": "noCloseButton",
|
|
87
|
+
"parent": {
|
|
88
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
89
|
+
"name": "DropdownProps"
|
|
90
|
+
},
|
|
91
|
+
"declarations": [
|
|
92
|
+
{
|
|
93
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
94
|
+
"name": "DropdownProps"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"required": false,
|
|
98
|
+
"type": {
|
|
99
|
+
"name": "boolean"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"onToggle": {
|
|
103
|
+
"defaultValue": null,
|
|
104
|
+
"description": "Called when dropdown is open/closed.",
|
|
105
|
+
"name": "onToggle",
|
|
106
|
+
"parent": {
|
|
107
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
108
|
+
"name": "DropdownProps"
|
|
109
|
+
},
|
|
110
|
+
"declarations": [
|
|
111
|
+
{
|
|
112
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
113
|
+
"name": "DropdownProps"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"required": false,
|
|
117
|
+
"type": {
|
|
118
|
+
"name": "((isOpen: boolean) => void)"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"open": {
|
|
122
|
+
"defaultValue": null,
|
|
123
|
+
"description": "Om dropdown er åpen",
|
|
124
|
+
"name": "open",
|
|
125
|
+
"parent": {
|
|
126
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
127
|
+
"name": "DropdownProps"
|
|
128
|
+
},
|
|
129
|
+
"declarations": [
|
|
130
|
+
{
|
|
131
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
132
|
+
"name": "DropdownProps"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"required": false,
|
|
136
|
+
"type": {
|
|
137
|
+
"name": "boolean"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"mode": {
|
|
141
|
+
"defaultValue": null,
|
|
142
|
+
"description": "Changes the visuals of the dropdown",
|
|
143
|
+
"name": "mode",
|
|
144
|
+
"parent": {
|
|
145
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
146
|
+
"name": "DropdownProps"
|
|
147
|
+
},
|
|
148
|
+
"declarations": [
|
|
149
|
+
{
|
|
150
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
151
|
+
"name": "DropdownProps"
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
"required": false,
|
|
155
|
+
"type": {
|
|
156
|
+
"name": "enum",
|
|
157
|
+
"raw": "\"onwhite\" | \"ongrey\" | \"onblueberry\" | \"oncherry\" | undefined",
|
|
158
|
+
"value": [
|
|
159
|
+
{
|
|
160
|
+
"value": "undefined"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"value": "\"onwhite\""
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"value": "\"ongrey\""
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"value": "\"onblueberry\""
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"value": "\"oncherry\""
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"transparent": {
|
|
178
|
+
"defaultValue": null,
|
|
179
|
+
"description": "Makes the background transparent",
|
|
180
|
+
"name": "transparent",
|
|
181
|
+
"parent": {
|
|
182
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
183
|
+
"name": "DropdownProps"
|
|
184
|
+
},
|
|
185
|
+
"declarations": [
|
|
186
|
+
{
|
|
187
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
188
|
+
"name": "DropdownProps"
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"required": false,
|
|
192
|
+
"type": {
|
|
193
|
+
"name": "boolean"
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"fluid": {
|
|
197
|
+
"defaultValue": null,
|
|
198
|
+
"description": "Makes the background transparent",
|
|
199
|
+
"name": "fluid",
|
|
200
|
+
"parent": {
|
|
201
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
202
|
+
"name": "DropdownProps"
|
|
203
|
+
},
|
|
204
|
+
"declarations": [
|
|
205
|
+
{
|
|
206
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
207
|
+
"name": "DropdownProps"
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
"required": false,
|
|
211
|
+
"type": {
|
|
212
|
+
"name": "boolean"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"disabled": {
|
|
216
|
+
"defaultValue": null,
|
|
217
|
+
"description": "Makes the dropdown disabled",
|
|
218
|
+
"name": "disabled",
|
|
219
|
+
"parent": {
|
|
220
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
221
|
+
"name": "DropdownProps"
|
|
222
|
+
},
|
|
223
|
+
"declarations": [
|
|
224
|
+
{
|
|
225
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
226
|
+
"name": "DropdownProps"
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
"required": false,
|
|
230
|
+
"type": {
|
|
231
|
+
"name": "boolean"
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"testId": {
|
|
235
|
+
"defaultValue": null,
|
|
236
|
+
"description": "Sets the data-testid attribute on the dropdown button.",
|
|
237
|
+
"name": "testId",
|
|
238
|
+
"parent": {
|
|
239
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
240
|
+
"name": "DropdownProps"
|
|
241
|
+
},
|
|
242
|
+
"declarations": [
|
|
243
|
+
{
|
|
244
|
+
"fileName": "src/components/Dropdown/Dropdown.tsx",
|
|
245
|
+
"name": "DropdownProps"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
"required": false,
|
|
249
|
+
"type": {
|
|
250
|
+
"name": "string"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as e,d as o}from"../../_rollupPluginBabelHelpers-4f206abf.js";import r,{useRef as t,useState as n}from"react";import{c as a}from"../../index-9b84fabc.js";import{Icon as l}from"../Icons/Icon.js";import{K as d,A as s,I as i}from"../../constants-088e1d4a.js";import c from"./styles.module.scss";import u from"../Icons/PlusSmall.js";import{B as p}from"../../Button-a7ae5afb.js";import{u as m}from"../../useHover-026f72c1.js";import{a as f,u as _,b as v,c as b}from"../../useOutsideEvent-342977b9.js";import{u as w}from"../../useUuid-24176312.js";import{t as g}from"../../index-d1c9177a.js";import"../../_tslib-51c8a283.js";import"../../color-e7d082c1.js";import"../../Loader-a7566e5f.js";import"../../uuid-11037462.js";import"../Loader/styles.module.scss";import"../../useWindowSize-5cc481da.js";import"../../grid-c105cad1.js";import"../Button/styles.module.scss";import"../../usePrevious-ae293b10.js";import"../../palette-f206f488.js";var y;!function(e){e.onwhite="onwhite",e.ongrey="ongrey",e.onblueberry="onblueberry",e.oncherry="oncherry"}(y||(y={}));export default function(h){var j,E=h.label,x=h.placeholder,k=h.closeText,N=void 0===k?"Lukk":k,I=h.noCloseButton,H=void 0!==I&&I,A=h.onToggle,B=h.open,C=void 0!==B&&B,D=h.children,L=h.mode,P=void 0===L?y.onwhite:L,S=h.transparent,U=void 0!==S&&S,z=h.fluid,R=void 0!==z&&z,T=h.testId,K=h.disabled,O=t(null),V=t(null),W=m(),X=W.hoverRef,q=W.isHovered,F=f(!K&&C,A),G=F.value,J=F.toggleValue,M=t(r.Children.map(D,(function(){return r.createRef()}))),Q=n(),Y=e(Q,2),Z=Y[0],$=Y[1],ee=(_(X)||{}).width,oe=w(),re=w(),te=w(),ne=function(){var e;J(),null===(e=V.current)||void 0===e||e.focus()},ae=function(){var e;J(),null===(e=X.current)||void 0===e||e.focus()};v("keydown",O,[d.ArrowDown,d.ArrowUp,d.End,d.Enter,d.Escape,d.Home],(function(e){var o;if(e.preventDefault(),M.current)if(G)if(e.key===d.Escape&&G)ae();else{var r=M.current.findIndex((function(o){return o.current===e.target})),t=r;e.key===d.Home?t=0:e.key===d.End?t=M.current.length-1:e.key===d.ArrowDown&&r<M.current.length-1?t=r+1:e.key===d.ArrowUp&&r>0?t=r-1:e.key===d.Enter&&-1!==r&&(t=r),-1!==t&&(null===(o=M.current[t].current)||void 0===o||o.focus(),$(t))}else ne()})),b(O,(function(){return G&&ae()}));var le=a(c.dropdown__toggle,!K&&(o(j={},c["dropdown__toggle--on-white"],P===y.onwhite),o(j,c["dropdown__toggle--on-grey"],P===y.ongrey),o(j,c["dropdown__toggle--on-blueberry"],P===y.onblueberry),o(j,c["dropdown__toggle--on-cherry"],P===y.oncherry),o(j,c["dropdown__toggle--transparent"],U),o(j,c["dropdown__toggle--fluid"],R),o(j,c["dropdown__toggle--open"],G),j)),de=a(c.dropdown__content,G&&c["dropdown__content--open"]);return r.createElement("div",{className:c.dropdown,ref:O},r.createElement("span",{id:oe,className:c.dropdown__label},E),r.createElement("button",{type:"button",onClick:function(){return!G&&ne()},className:le,ref:X,"data-testid":T,"data-analyticsid":s.Dropdown,disabled:K,"aria-labelledby":re,"aria-haspopup":"listbox","aria-expanded":G},r.createElement("span",{id:re,className:c.dropdown__toggle__label},x),r.createElement(l,{color:K?g.palette.neutral500:g.palette.blueberry600,svgIcon:u,className:c.dropdown__icon,isHovered:q,size:i.XSmall})),r.createElement("div",{className:de,style:{width:R?"100%":"".concat(ee,"px")}},r.createElement("ul",{className:c.dropdown__options,role:"listbox","aria-labelledby":oe,tabIndex:-1,"aria-activedescendant":void 0!==Z?"".concat(te,"-").concat(Z):void 0,ref:V},r.Children.map(D,(function(e,o){var t;return r.createElement("li",{className:c.dropdown__input,role:"option",id:"".concat(te,"-").concat(o)},r.cloneElement(e,{ref:null===(t=M.current)||void 0===t?void 0:t[o]}))}))),!H&&r.createElement("div",{className:c.dropdown__close},r.createElement(p,{onClick:ae,fluid:!0,"aria-expanded":G},N))))}export{y as DropdownMode};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
@import '../../scss/_spacers.scss';
|
|
2
|
+
@import '../../scss/_breakpoints.scss';
|
|
3
|
+
@import '../../scss/_palette.scss';
|
|
4
|
+
@import '../../scss/_font-settings.scss';
|
|
5
|
+
@import 'bootstrap/scss/mixins/_screen-reader.scss';
|
|
6
|
+
|
|
7
|
+
.dropdown {
|
|
8
|
+
position: relative;
|
|
9
|
+
|
|
10
|
+
&__label {
|
|
11
|
+
@include sr-only();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&__toggle {
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
align-items: center;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
border-radius: 0;
|
|
20
|
+
border-width: 2px;
|
|
21
|
+
border-style: solid;
|
|
22
|
+
padding: 0 getSpacer(3xs) 0 getSpacer(s);
|
|
23
|
+
font-family: inherit;
|
|
24
|
+
font-size: $font-size-sm;
|
|
25
|
+
line-height: 1.3rem; // Custom fordi teksten skal henge bedre sammen om den går over to linjer
|
|
26
|
+
|
|
27
|
+
@media (min-width: map-get($grid-breakpoints, md)) {
|
|
28
|
+
padding: getSpacer(3xs) getSpacer(3xs) getSpacer(3xs) getSpacer(s);
|
|
29
|
+
font-size: $font-size-md;
|
|
30
|
+
line-height: 1.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:focus {
|
|
34
|
+
outline: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:disabled {
|
|
38
|
+
background-color: $neutral50;
|
|
39
|
+
border-color: $neutral500;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&--on-white,
|
|
43
|
+
&--on-grey {
|
|
44
|
+
border-color: $neutral700;
|
|
45
|
+
background-color: $white;
|
|
46
|
+
&:hover {
|
|
47
|
+
background-color: $neutral50;
|
|
48
|
+
box-shadow: 0 0 0 1px $neutral700;
|
|
49
|
+
}
|
|
50
|
+
&:focus {
|
|
51
|
+
border-color: $black;
|
|
52
|
+
box-shadow: 0 0 0 1px $black;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&--on-blueberry {
|
|
57
|
+
border-color: $blueberry500;
|
|
58
|
+
background-color: $white;
|
|
59
|
+
&:hover {
|
|
60
|
+
background-color: $blueberry50;
|
|
61
|
+
box-shadow: 0 0 0 1px $blueberry500;
|
|
62
|
+
}
|
|
63
|
+
&:focus {
|
|
64
|
+
border-color: $black;
|
|
65
|
+
box-shadow: 0 0 0 1px $black;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&--on-cherry {
|
|
70
|
+
border-color: $cherry500;
|
|
71
|
+
background-color: $white;
|
|
72
|
+
&:hover {
|
|
73
|
+
background-color: $cherry50;
|
|
74
|
+
box-shadow: 0 0 0 1px $cherry500;
|
|
75
|
+
}
|
|
76
|
+
&:focus {
|
|
77
|
+
border-color: $black;
|
|
78
|
+
box-shadow: 0 0 0 1px $black;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&--open#{&}--on-white,
|
|
83
|
+
&--open#{&}--on-grey {
|
|
84
|
+
background-color: $neutral50;
|
|
85
|
+
&:hover {
|
|
86
|
+
background-color: $white;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&--open#{&}--on-blueberry {
|
|
91
|
+
background-color: $blueberry50;
|
|
92
|
+
&:hover {
|
|
93
|
+
background-color: $white;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&--open#{&}--on-cherry {
|
|
98
|
+
background-color: $cherry50;
|
|
99
|
+
&:hover {
|
|
100
|
+
background-color: $white;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&--transparent {
|
|
105
|
+
background-color: transparent;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&--transparent#{&}--on-grey {
|
|
109
|
+
&:hover {
|
|
110
|
+
background-color: $neutral100;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&--transparent#{&}--on-blueberry {
|
|
115
|
+
&:hover {
|
|
116
|
+
background-color: $blueberry100;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&--transparent#{&}--on-cherry {
|
|
121
|
+
&:hover {
|
|
122
|
+
background-color: $cherry100;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&--transparent#{&}--open#{&}--on-grey {
|
|
127
|
+
background-color: $neutral100;
|
|
128
|
+
&:hover {
|
|
129
|
+
background-color: transparent;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&--transparent#{&}--open#{&}--on-blueberry {
|
|
134
|
+
background-color: $blueberry100;
|
|
135
|
+
&:hover {
|
|
136
|
+
background-color: transparent;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&--transparent#{&}--open#{&}--on-cherry {
|
|
141
|
+
background-color: $cherry100;
|
|
142
|
+
&:hover {
|
|
143
|
+
background-color: transparent;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&--fluid {
|
|
148
|
+
width: 100%;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&__label {
|
|
152
|
+
padding: getSpacer(3xs) 0;
|
|
153
|
+
@media (min-width: map-get($grid-breakpoints, md)) {
|
|
154
|
+
padding: getSpacer(2xs) 0;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&__icon {
|
|
160
|
+
margin-left: getSpacer(2xs);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&__content {
|
|
164
|
+
display: none;
|
|
165
|
+
position: absolute;
|
|
166
|
+
background-color: $white;
|
|
167
|
+
margin-top: getSpacer(2xs);
|
|
168
|
+
box-shadow: 0 0 0 2px $blueberry500;
|
|
169
|
+
&--open {
|
|
170
|
+
display: block;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
&__options {
|
|
174
|
+
overflow-x: hidden;
|
|
175
|
+
overflow-y: auto;
|
|
176
|
+
max-height: 384px;
|
|
177
|
+
list-style: none;
|
|
178
|
+
padding: 0;
|
|
179
|
+
margin: 0;
|
|
180
|
+
@media (min-width: map-get($grid-breakpoints, md)) {
|
|
181
|
+
max-height: 464px;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
&__close {
|
|
185
|
+
padding: getSpacer(s);
|
|
186
|
+
}
|
|
187
|
+
&__input {
|
|
188
|
+
border-bottom: 1px solid $neutral300;
|
|
189
|
+
padding: getSpacer(2xs) getSpacer(s) getSpacer(2xs) getSpacer(s);
|
|
190
|
+
@media (min-width: map-get($grid-breakpoints, md)) {
|
|
191
|
+
padding: getSpacer(s);
|
|
192
|
+
}
|
|
193
|
+
&:last-child {
|
|
194
|
+
border-bottom: none;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e}from"../../_rollupPluginBabelHelpers-4f206abf.js";import t,{useState as n,useRef as r,useEffect as a}from"react";import{Icon as o}from"../Icons/Icon.js";import{Z as s,A as i,I as d}from"../../constants-
|
|
1
|
+
import{_ as e}from"../../_rollupPluginBabelHelpers-4f206abf.js";import t,{useState as n,useRef as r,useEffect as a}from"react";import{Icon as o}from"../Icons/Icon.js";import{Z as s,A as i,I as d}from"../../constants-088e1d4a.js";import{u as c}from"../../useHover-026f72c1.js";import{u as l}from"../../usePrevious-ae293b10.js";import p from"./styles.module.scss";import{c as m}from"../../index-9b84fabc.js";import _ from"../Icons/ChevronDown.js";import u from"../Icons/ChevronUp.js";import{B as x}from"../../Button-a7ae5afb.js";import{u as f}from"../../useSticky-807e5dde.js";import"../../_tslib-51c8a283.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../Loader-a7566e5f.js";import"../../uuid-11037462.js";import"../Loader/styles.module.scss";import"../../useWindowSize-5cc481da.js";import"../Button/styles.module.scss";var g;!function(e){e.small="small",e.large="large"}(g||(g={}));export default function(v){var j=v.title,b=v.children,E=v.size,I=void 0===E?g.small:E,y=v.color,h=v.svgIcon,N=v.expanded,k=void 0!==N&&N,z=v.noNestedLine,H=void 0!==z&&z,w=v.sticky,S=void 0!==w&&w,B=v.testId,C=v.onExpand,L=n(k),W=e(L,2),X=W[0],P=W[1],T=l(X),A=r(null),D=r(null),O=r(null),U=c(D).isHovered,Z=f(A,D),q=Z.isOutsideWindow,F=Z.isLeavingWindow,G=Z.offsetHeight,J=Z.contentWidth,K=S&&X&&q;a((function(){k!==X&&P(k)}),[k]),a((function(){C&&X!==!!T&&C(X)}),[X,C]);var M=function(e){return t.createElement("span",{className:m(p.expander__icon,p["expander__icon--".concat(e)])},t.createElement(o,{svgIcon:X?u:_,size:d.XSmall,isHovered:U}))},Q=m(p.expander__trigger,p["expander__trigger--".concat(I)],I===g.large&&p["expander__trigger--".concat(y||"neutral")],I===g.large&&h&&p["expander__trigger--icon"],X&&p["expander__trigger--expanded"],K&&!F&&p["expander__trigger--sticky"],K&&F&&p["expander__trigger--absolute"]),R=m(p.expander__button,X&&p["expander__button--expanded"],K&&!F&&p["expander__button--sticky"],K&&F&&p["expander__button--absolute"]),V=m(p.expander__content,p["expander__content--".concat(I)],I===g.large&&p["expander__content--".concat(y||"neutral")],I===g.large&&h&&p["expander__content--icon"],X&&p["expander__content--expanded"],I===g.small&&!H&&p["expander__content--nested-line"]);return t.createElement("div",{className:p.expander,ref:A,style:{paddingTop:K&&G?"".concat(G,"px"):void 0}},I===g.large?t.createElement("button",{className:Q,style:{zIndex:U||K?s.ExpanderTrigger:void 0,width:K&&J?"".concat(J,"px"):void 0},"aria-expanded":X,ref:D,onClick:function(){return P(!X)},"data-testid":B,"data-analyticsid":i.Expander},I===g.small&&M("left"),h&&t.createElement("span",{className:m(p.expander__icon,p["expander__icon--left"])},t.createElement(o,{svgIcon:h,size:d.XSmall,isHovered:U})),j,I===g.large&&M("right")):t.createElement(x,{variant:"borderless",className:R,"aria-expanded":X,ref:D,onClick:function(){return P(!X)},testId:B,"data-analyticsid":i.Expander},t.createElement(o,{svgIcon:X?u:_,size:d.XSmall}),j),t.createElement("div",{className:V,ref:O},b))}export{g as ExpanderSize};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpanderList.d.ts","sourceRoot":"","sources":["../../../src/components/ExpanderList/ExpanderList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpanderList.d.ts","sourceRoot":"","sources":["../../../src/components/ExpanderList/ExpanderList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAenD,oBAAY,kBAAkB,GAAG,YAAY,CAAC;AAC9C,oBAAY,YAAY,GAAG,KAAK,CAAC,yBAAyB,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;AAE/G,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,yBAAyB,CAAC,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACtI,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,UAAU,iBAAiB;IACzB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gCAAgC;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wCAAwC;IACxC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,6BAA6B;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,aAAK,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;AAEzC,aAAK,aAAa,GAAG,MAAM,CACzB,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,EACvC;IACE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACjF,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,CACF,CAAC;AAyEF,eAAO,MAAM,YAAY,sBAqEC,CAAC;AAK3B,eAAe,YAAY,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,d as n}from"../../_rollupPluginBabelHelpers-4f206abf.js";import t,{useState as a,useEffect as i}from"react";import{Icon as r}from"../Icons/Icon.js";import{A as o,I as
|
|
1
|
+
import{_ as e,d as n}from"../../_rollupPluginBabelHelpers-4f206abf.js";import t,{useState as a,useEffect as i}from"react";import{Icon as r}from"../Icons/Icon.js";import{A as o,I as s}from"../../constants-088e1d4a.js";import d from"../Icons/ChevronUp.js";import c from"../Icons/ChevronDown.js";import{u as l}from"../../useHover-026f72c1.js";import{u as m}from"../../usePrevious-ae293b10.js";import{u as p,B as u}from"../../useBreakpoint-6eb418f7.js";import{c as f}from"../../index-9b84fabc.js";import x from"./styles.module.scss";import{u as v}from"../../useUuid-24176312.js";import"../../_tslib-51c8a283.js";import"../../grid-c105cad1.js";import"../../uuid-11037462.js";var g=t.forwardRef((function(v,g){var E,_=v.id,j=v.children,h=v.padding,b=void 0===h||h,k=v.color,N=void 0===k?"neutral":k,I=v.className,w=void 0===I?"":I,C=v.icon,H=v.large,y=void 0!==H&&H,B=v.title,O=v.expanded,R=void 0!==O&&O,L=v.testId,P=v.handleExpanderClick,S=v.onExpand,z=a(R),U=e(z,2),W=U[0],X=U[1],A=m(W),D=l(),T=D.hoverRef,V=D.isHovered,q=p(),F=f(x["expander-list-link"],x["expander-list-link--".concat(N)],(n(E={},x["expander-list-link--closed"],!W),n(E,x["expander-list-link--large"],y),E)),G=f(x["expander-list-link__main-content"],W&&x["expander-list-link__main-content--expanded"],b?x["expander-list-link__main-content--padding"]:"");return i((function(){R!==W&&X(R)}),[R]),i((function(){S&&W!==!!A&&S(W)}),[W,S]),t.createElement("li",{className:w,ref:g},t.createElement("button",{id:_,onClick:P,"data-testid":L,"data-analyticsid":o.ExpanderListExpander,className:F,ref:T,"aria-expanded":W},C&&t.createElement("span",{className:x["expander-list-link__icon"]},t.cloneElement(C,{size:q===u.xs?s.XSmall:s.Small,isHovered:V})),t.createElement("span",{className:x["expander-list-link__title"]},B),t.createElement("span",{className:x["expander-list-link__chevron"]},t.createElement(r,{size:s.XSmall,svgIcon:W?d:c,isHovered:V}))),t.createElement("div",{className:G},j))})),E=t.forwardRef((function(r,s){var d=r.children,c=r.childPadding,l=void 0===c||c,m=r.large,p=r.isOpen,u=void 0!==p&&p,E=r.color,_=r.className,j=void 0===_?"":_,h=r.accordion,b=void 0!==h&&h,k=r.topBorder,N=void 0===k||k,I=r.bottomBorder,w=void 0===I||I,C=r.testId,H=a({}),y=e(H,2),B=y[0],O=y[1],R=a(),L=e(R,2),P=L[0],S=L[1],z=v(),U=t.Children.count(d),W=f(x["expander-list"],j);return i((function(){var e,n,t,a,i;!b||!P||(e=P.getBoundingClientRect(),n=e.top,t=e.left,a=e.bottom,i=e.right,n>=0&&t>=0&&a<=(window.innerHeight||document.documentElement.clientHeight)&&i<=(window.innerWidth||document.documentElement.clientWidth))||P.scrollIntoView()}),[b,P]),i((function(){if(u){var e="".concat(z,"-0");O((function(t){return b?n({},e,!t[e]):Object.assign(Object.assign({},t),n({},e,!t[e]))}))}}),[u]),t.createElement("ul",{className:W,ref:s,"data-testid":C,"data-analyticsid":o.ExpanderList},t.Children.map(d,(function(e,a){if(e.type===g){var i=B["".concat(z,"-").concat(a)],r=function(e){var t;return f(x["expander-list__item"],(n(t={},x["expander-list__item--top"],0===e&&N),n(t,x["expander-list__item--no-bottom"],e===U-1&&!w),t))}(a);return t.cloneElement(e,{id:"".concat(z,"-").concat(a),key:a,expanded:i,padding:l,color:E,large:m,"aria-expanded":i,className:r,handleExpanderClick:function(e){return function(e,t){O((function(e){return b?n({},t,!e[t]):Object.assign(Object.assign({},e),n({},t,!e[t]))})),S(e.currentTarget)}(e,"".concat(z,"-").concat(a))}})}return e})))}));E.Expander=g,g.displayName="ExpanderList.Expander";export default E;export{E as ExpanderList};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|