@aarhus-university/au-lib-react-components 11.5.1 → 11.6.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.
Files changed (100) hide show
  1. package/.eslintrc.js +34 -34
  2. package/.storybook/main.js +20 -20
  3. package/.storybook/preview.js +17 -17
  4. package/README.md +19 -19
  5. package/__tests__/jest/AUButtonComponent.test.tsx +165 -165
  6. package/__tests__/jest/AUErrorComponent.test.tsx +142 -142
  7. package/__tests__/jest/AUModalComponent.test.tsx +186 -186
  8. package/__tests__/jest/AUNotificationComponent.test.tsx +115 -115
  9. package/__tests__/jest/AUSpinnerComponent.test.tsx +57 -57
  10. package/__tests__/jest/AUToolbarComponent.test.tsx +46 -46
  11. package/__tests__/jest/context.test.ts +25 -25
  12. package/__tests__/jest/helpers.test.ts +15 -15
  13. package/__tests__/jest/setupTests.ts +2 -2
  14. package/babel.config.js +8 -8
  15. package/build/umd/all.css +2 -2
  16. package/build/umd/all.js +1 -1
  17. package/build/umd/alphabox.js +1 -1
  18. package/build/umd/databox.js +1 -1
  19. package/build/umd/diagramme.js +1 -1
  20. package/build/umd/flowbox.js +1 -1
  21. package/build/umd/universe.js +1 -1
  22. package/build-storybook.log +367 -367
  23. package/package.json +114 -114
  24. package/src/components/AUAlertComponent.tsx +113 -113
  25. package/src/components/AUAutoSuggestComponent.js +158 -158
  26. package/src/components/AUButtonComponent.tsx +87 -87
  27. package/src/components/AUCalendarComponent.tsx +493 -493
  28. package/src/components/AUContentToggleComponent.tsx +47 -47
  29. package/src/components/AUDatepickerComponent.tsx +121 -121
  30. package/src/components/AUEditFilterComponent.tsx +24 -67
  31. package/src/components/AUErrorComponent.tsx +78 -78
  32. package/src/components/AUMobilePrefixComponent.tsx +15 -15
  33. package/src/components/AUModalComponent.tsx +68 -68
  34. package/src/components/AUNotificationComponent.tsx +43 -43
  35. package/src/components/AUReceiptComponent.tsx +33 -33
  36. package/src/components/AUSpinnerComponent.tsx +36 -36
  37. package/src/components/AUStepComponent.tsx +47 -47
  38. package/src/components/AUSubNavComponent.tsx +48 -48
  39. package/src/components/AUSubmitButtonContainerComponent.tsx +29 -29
  40. package/src/components/AUTabbedContentComponent.tsx +145 -145
  41. package/src/components/AUTableComponent.tsx +24 -24
  42. package/src/components/AUToastComponent.tsx +104 -104
  43. package/src/components/AUToolbarComponent.tsx +101 -106
  44. package/src/components/AUTruncatorComponent.tsx +124 -124
  45. package/src/components/wrapping/AUEmbedComponent.js +47 -47
  46. package/src/layout-2016/components/alphabox/AlphaBoxComponent.js +143 -143
  47. package/src/layout-2016/components/alphabox/AlphaBoxContentComponent.js +136 -136
  48. package/src/layout-2016/components/common/AUCollapsibleComponent.js +152 -152
  49. package/src/layout-2016/components/common/AUSpinnerComponent.js +103 -103
  50. package/src/layout-2016/components/databox/DataBoxAlphabetComponent.js +144 -144
  51. package/src/layout-2016/components/databox/DataBoxAssociationComponent.js +122 -122
  52. package/src/layout-2016/components/databox/DataBoxButtonComponent.js +157 -157
  53. package/src/layout-2016/components/databox/DataBoxComponent.js +297 -297
  54. package/src/layout-2016/components/databox/DataBoxGroupingComponent.js +64 -64
  55. package/src/layout-2016/components/databox/DataBoxSearchResultComponent.js +36 -36
  56. package/src/layout-2016/components/databox/DataBoxStackedAssociationComponent.js +54 -54
  57. package/src/layout-2016/components/databox/DataBoxSuggestionComponent.js +39 -39
  58. package/src/layout-2016/components/diagramme/AUDiagrammeComponent.js +309 -309
  59. package/src/layout-2016/components/flowbox/FlowBoxComponent.js +126 -126
  60. package/src/layout-2016/components/flowbox/FlowBoxPhoneComponent.js +104 -104
  61. package/src/layout-2016/components/profile/AUProfileAvatar2016Component.js +103 -103
  62. package/src/layout-2016/components/universe/StaffTopComponent.js +363 -363
  63. package/src/layout-2016/components/universe/StudentTopComponent.js +137 -137
  64. package/src/layout-2016/components/universe/UniverseContainerComponent.js +65 -65
  65. package/src/layout-2016/lib/all.js +3 -3
  66. package/src/layout-2016/lib/au-alphabox.js +100 -100
  67. package/src/layout-2016/lib/au-databox.js +400 -400
  68. package/src/layout-2016/lib/au-diagramme.js +85 -85
  69. package/src/layout-2016/lib/au-flowbox.js +93 -93
  70. package/src/layout-2016/lib/universe.js +9 -9
  71. package/src/lib/context.tsx +51 -51
  72. package/src/lib/dates.ts +50 -50
  73. package/src/lib/helpers.ts +208 -208
  74. package/src/lib/hooks.ts +75 -75
  75. package/src/lib/i18n.ts +600 -600
  76. package/src/lib/portals.tsx +145 -119
  77. package/src/lib/tracking.ts +69 -69
  78. package/src/lib/wrapping.ts +21 -21
  79. package/src/styles/_settings.scss +10 -10
  80. package/src/styles/alphabox.scss +222 -222
  81. package/src/styles/app.scss +7 -7
  82. package/src/styles/autosuggest.scss +57 -57
  83. package/src/styles/databox.scss +563 -563
  84. package/src/styles/diagramme.scss +119 -119
  85. package/src/styles/flowbox.scss +72 -72
  86. package/src/styles/maps.scss +395 -395
  87. package/stories/AUAlertComponent.stories.tsx +120 -120
  88. package/stories/AUButtonComponent.stories.tsx +127 -127
  89. package/stories/AUContentToggleComponent.stories.tsx +63 -63
  90. package/stories/AUEditFilterComponent.stories.tsx +29 -29
  91. package/stories/AUErrorComponent.stories.tsx +98 -98
  92. package/stories/AUModalComponent.stories.tsx +84 -84
  93. package/stories/AUNotificationComponent.stories.tsx +116 -116
  94. package/stories/AUSpinnerComponent.stories.tsx +41 -41
  95. package/stories/AUStepComponent.stories.tsx +40 -40
  96. package/stories/AUToolbarComponent.stories.tsx +326 -327
  97. package/stories/AUTruncatorComponent.stories.tsx +101 -101
  98. package/stories/lib/helpers.tsx +128 -128
  99. package/tsconfig.json +46 -46
  100. package/webpack.config.js +89 -89
@@ -1,327 +1,326 @@
1
- import React from 'react';
2
- import { ComponentStory, ComponentMeta } from '@storybook/react';
3
- import { closeAllContentTogglesInToolbar, contentToggleEdgeHandling, findToolbar, lockBodyScroll, unlockBodyScroll } from '@aarhus-university/au-designsystem-delphinus/source/js/components/toolbar';
4
- import AUToolbarComponent from '../src/components/AUToolbarComponent';
5
- import AUButtonComponent from '../src/components/AUButtonComponent';
6
- import AUContentToggleComponent from '../src/components/AUContentToggleComponent';
7
- import { ThemeWrapper } from './lib/helpers';
8
- import { isElementWithClassNameInEventPath } from '@aarhus-university/au-designsystem-delphinus/source/js/components/helpers';
9
-
10
- export default {
11
- title: 'Delphinus/Toolbar',
12
- component: AUToolbarComponent,
13
- argTypes: {
14
- lang: {
15
- control: {
16
- type: 'radio',
17
- },
18
- options: [
19
- 'da',
20
- 'en',
21
- ],
22
- },
23
- },
24
- decorators: [
25
- (Story, context) => (
26
- <ThemeWrapper theme={context.globals.theme}>
27
- {Story()}
28
- </ThemeWrapper>
29
- )
30
- ],
31
- } as ComponentMeta<typeof AUToolbarComponent>;
32
-
33
- const Template: ComponentStory<typeof AUToolbarComponent> = (args) => (
34
- <>
35
- <AUToolbarComponent {...args} />
36
- <div className="box theme--background-secondary"><p>Content goes here...</p></div>
37
- </>
38
- );
39
-
40
- export const Form_Field_and_Buttons_and_Link = Template.bind({});
41
- Form_Field_and_Buttons_and_Link.args = {
42
- lang: 'da',
43
- elements: [
44
- <form className="form">
45
- <div className="form__inline-submit">
46
- <div className="form__field form__field--inline-label">
47
- <label htmlFor="demo-search">Search</label>
48
- <input type="search" autoComplete="off" autoCorrect="off" autoCapitalize="off" id="demo-search" />
49
- </div>
50
- <input className="form__inline-submit__button" type="submit" value="Submit" />
51
- </div>
52
- </form>,
53
- <AUButtonComponent icon="confirm-circle" label="Mark as read" />,
54
- <AUButtonComponent icon="delete" hideLabel label="Delete" />,
55
- <AUButtonComponent type="text" label="Select all" />,
56
- <div className="toolbar__split" />,
57
- <div className="toolbar__text-item">
58
- <a className="a--text-link" href="#">Open in new tab</a>
59
- </div>,
60
- ]
61
- };
62
-
63
- export const Many_Actions = Template.bind({});
64
- Many_Actions.args = {
65
- lang: 'da',
66
- elements: Array(25).fill(null).map((_, i) => <AUButtonComponent label={`Action ${i + 1}`} />),
67
- };
68
-
69
- export const Groupings = Template.bind({});
70
- Groupings.args = {
71
- lang: 'da',
72
- elements: [
73
- <div className="toolbar__group">
74
- <div className="form__field form__field--horizontal">
75
- <label htmlFor="demo-all">All issues</label>
76
- <input type="radio" name="demo" value="all" id="demo-all" defaultChecked />
77
- </div>
78
- <div className="form__field form__field--horizontal">
79
- <label htmlFor="demo-open">Open</label>
80
- <input type="radio" name="demo" value="all" id="demo-open" />
81
- </div>
82
- <div className="form__field form__field--horizontal">
83
- <label htmlFor="demo-resolved">Resolved</label>
84
- <input type="radio" name="demo" value="all" id="demo-resolved" />
85
- </div>
86
- </div>,
87
- <div className="toolbar__split" />,
88
- <div className="toolbar__group">
89
- <div className="form__field form__field--horizontal">
90
- <label htmlFor="demo-epics">Epics</label>
91
- <input type="checkbox" id="demo-epics" defaultChecked />
92
- </div>
93
- <div className="form__field form__field--horizontal">
94
- <label htmlFor="demo-stories">Stories</label>
95
- <input type="checkbox" id="demo-stories" defaultChecked />
96
- </div>
97
- <div className="form__field form__field--horizontal">
98
- <label htmlFor="demo-tasks">Tasks</label>
99
- <input type="checkbox" id="demo-tasks" defaultChecked />
100
- </div>
101
- </div>,
102
- ],
103
- };
104
-
105
- export const Filter = Template.bind({});
106
- Filter.args = {
107
- lang: 'da',
108
- elements: [
109
- <AUContentToggleComponent
110
- toggled={false}
111
- onClick={(popout: HTMLElement) => {
112
- contentToggleEdgeHandling(popout);
113
- lockBodyScroll();
114
- }}
115
- beforeCallback={(content: HTMLElement) => closeAllContentTogglesInToolbar(findToolbar(content))}
116
- afterCallback={(content: HTMLElement, button: HTMLButtonElement) => {
117
- const ariaExpanded = button.getAttribute('aria-expanded');
118
- const toolbar = findToolbar(content);
119
- if (ariaExpanded === 'true') {
120
- toolbar?.classList.add('toolbar--has-popout');
121
- } else {
122
- toolbar?.classList.remove('toolbar--has-popout');
123
- }
124
-
125
- content.addEventListener('click', (event: MouseEvent) => {
126
- if ((event.target as HTMLElement).classList.contains('toolbar__popout')
127
- && !isElementWithClassNameInEventPath(event as MouseEvent, 'toolbar__filter__content')) {
128
- closeAllContentTogglesInToolbar(toolbar);
129
- unlockBodyScroll();
130
- }
131
- });
132
- }}
133
- >
134
- <div className="toolbar__filter">
135
- <button
136
- type="button"
137
- className="toolbar__filter__toggle content-toggle__toggle"
138
- aria-expanded={false}
139
- aria-label="Filter 1"
140
- >
141
- Filter 1
142
- </button>
143
- <div
144
- className="toolbar__popout content-toggle__content"
145
- hidden
146
- >
147
- <div className="toolbar__filter__content toolbar__popout__content theme--normal">
148
- <h3 className="toolbar__filter__content__title">
149
- Vælg Filter 1
150
- </h3>
151
-
152
- <form className="form toolbar__filter__content__search">
153
- <div className="form__inline-submit">
154
- <div className="form__field form__field--inline-label">
155
- <label htmlFor="search-filter-1">
156
- Søg
157
- </label>
158
- <input
159
- type="search"
160
- id="search-filter-1"
161
- />
162
- </div>
163
- <input className="form__inline-submit__button" type="submit" value="Søg" />
164
- </div>
165
- </form>
166
- <form
167
- className="toolbar__filter__content__options-and-actions"
168
- onSubmit={(event) => {
169
- event.preventDefault();
170
- unlockBodyScroll();
171
- }}
172
- >
173
- <div
174
- className="toolbar__filter__content__options"
175
- >
176
- <div className="toolbar__filter__content__options__scroll-container">
177
- <fieldset className="selection-list">
178
- <legend>
179
- 5 valgmuligheder
180
- </legend>
181
- <div className="selection-list__option">
182
- <input type="checkbox" id="option-1" />
183
- <label htmlFor="option-1">Valgmulighed 1</label>
184
- </div>
185
- <div className="selection-list__option">
186
- <input type="checkbox" id="option-2" />
187
- <label htmlFor="option-2">Valgmulighed 2</label>
188
- </div>
189
- <div className="selection-list__option">
190
- <input type="checkbox" id="option-3" />
191
- <label htmlFor="option-3">Valgmulighed 3</label>
192
- </div>
193
- <div className="selection-list__option">
194
- <input type="checkbox" id="option-4" />
195
- <label htmlFor="option-4">Valgmulighed 4</label>
196
- </div>
197
- <div className="selection-list__option">
198
- <input type="checkbox" id="option-5" />
199
- <label htmlFor="option-5">Valgmulighed 5</label>
200
- </div>
201
- </fieldset>
202
- </div>
203
- </div>
204
- <div className="toolbar__filter__content__actions">
205
- <div className="button-container">
206
- <input type="submit" className="content-toggle__close button button--small" value="Gem" />
207
- </div>
208
- </div>
209
- </form>
210
- </div>
211
- <button
212
- type="button"
213
- className="toolbar__popout__close content-toggle__close button button--icon button--icon--hide-label icon-close"
214
- onClick={() => unlockBodyScroll()}
215
- >
216
- Luk
217
- </button>
218
- </div>
219
- </div>
220
- </AUContentToggleComponent>,
221
- <AUContentToggleComponent
222
- toggled={false}
223
- onClick={(popout: HTMLElement) => {
224
- contentToggleEdgeHandling(popout);
225
- lockBodyScroll();
226
- }}
227
- beforeCallback={(content: HTMLElement) => closeAllContentTogglesInToolbar(findToolbar(content))}
228
- afterCallback={(content: HTMLElement, button: HTMLButtonElement) => {
229
- const ariaExpanded = button.getAttribute('aria-expanded');
230
- const toolbar = findToolbar(content);
231
- if (ariaExpanded === 'true') {
232
- toolbar?.classList.add('toolbar--has-popout');
233
- } else {
234
- toolbar?.classList.remove('toolbar--has-popout');
235
- }
236
-
237
- content.addEventListener('click', (event: MouseEvent) => {
238
- if ((event.target as HTMLElement).classList.contains('toolbar__popout')
239
- && !isElementWithClassNameInEventPath(event as MouseEvent, 'toolbar__filter__content')) {
240
- closeAllContentTogglesInToolbar(toolbar);
241
- unlockBodyScroll();
242
- }
243
- });
244
- }}
245
- >
246
- <div className="toolbar__filter">
247
- <button
248
- type="button"
249
- className="toolbar__filter__toggle content-toggle__toggle"
250
- aria-expanded={false}
251
- aria-label="Filter 1"
252
- >
253
- Filter 2
254
- </button>
255
- <div
256
- className="toolbar__popout content-toggle__content"
257
- hidden
258
- >
259
- <div className="toolbar__filter__content toolbar__popout__content theme--normal">
260
- <h3 className="toolbar__filter__content__title">
261
- Vælg Filter 2
262
- </h3>
263
-
264
- <form className="form toolbar__filter__content__search">
265
- <div className="form__inline-submit">
266
- <div className="form__field form__field--inline-label">
267
- <label htmlFor="search-filter-2">
268
- Søg
269
- </label>
270
- <input
271
- type="search"
272
- id="search-filter-2"
273
- />
274
- </div>
275
- <input className="form__inline-submit__button" type="submit" value="Søg" />
276
- </div>
277
- </form>
278
- <form
279
- className="toolbar__filter__content__options-and-actions"
280
- onSubmit={(event) => {
281
- event.preventDefault();
282
- unlockBodyScroll();
283
- }}
284
- >
285
- <div
286
- className="toolbar__filter__content__options"
287
- >
288
- <div className="toolbar__filter__content__options__scroll-container">
289
- <fieldset className="selection-list">
290
- <legend>
291
- 3 valgmuligheder
292
- </legend>
293
- <div className="selection-list__option">
294
- <input type="checkbox" id="option-10" />
295
- <label htmlFor="option-10">Valgmulighed 1</label>
296
- </div>
297
- <div className="selection-list__option">
298
- <input type="checkbox" id="option-20" />
299
- <label htmlFor="option-20">Valgmulighed 2</label>
300
- </div>
301
- <div className="selection-list__option">
302
- <input type="checkbox" id="option-30" />
303
- <label htmlFor="option-30">Valgmulighed 3</label>
304
- </div>
305
- </fieldset>
306
- </div>
307
- </div>
308
- <div className="toolbar__filter__content__actions">
309
- <div className="button-container">
310
- <input type="submit" className="content-toggle__close button button--small" value="Gem" />
311
- </div>
312
- </div>
313
- </form>
314
- </div>
315
- <button
316
- type="button"
317
- className="toolbar__popout__close content-toggle__close button button--icon button--icon--hide-label icon-close"
318
- onClick={() => unlockBodyScroll()}
319
- >
320
- Luk
321
- </button>
322
- </div>
323
- </div>
324
- </AUContentToggleComponent>
325
- ],
326
- onCloseContentToggles: () => console.log('luuuuuk?'),
327
- };
1
+ import React from 'react';
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+ import { closeAllContentTogglesInToolbar, contentToggleEdgeHandling, findToolbar, lockBodyScroll, unlockBodyScroll } from '@aarhus-university/au-designsystem-delphinus/source/js/components/toolbar';
4
+ import AUToolbarComponent from '../src/components/AUToolbarComponent';
5
+ import AUButtonComponent from '../src/components/AUButtonComponent';
6
+ import AUContentToggleComponent from '../src/components/AUContentToggleComponent';
7
+ import { ThemeWrapper } from './lib/helpers';
8
+ import { isElementWithClassNameInEventPath } from '@aarhus-university/au-designsystem-delphinus/source/js/components/helpers';
9
+
10
+ export default {
11
+ title: 'Delphinus/Toolbar',
12
+ component: AUToolbarComponent,
13
+ argTypes: {
14
+ lang: {
15
+ control: {
16
+ type: 'radio',
17
+ },
18
+ options: [
19
+ 'da',
20
+ 'en',
21
+ ],
22
+ },
23
+ },
24
+ decorators: [
25
+ (Story, context) => (
26
+ <ThemeWrapper theme={context.globals.theme}>
27
+ {Story()}
28
+ </ThemeWrapper>
29
+ )
30
+ ],
31
+ } as ComponentMeta<typeof AUToolbarComponent>;
32
+
33
+ const Template: ComponentStory<typeof AUToolbarComponent> = (args) => (
34
+ <>
35
+ <AUToolbarComponent {...args} />
36
+ <div className="box theme--background-secondary"><p>Content goes here...</p></div>
37
+ </>
38
+ );
39
+
40
+ export const Form_Field_and_Buttons_and_Link = Template.bind({});
41
+ Form_Field_and_Buttons_and_Link.args = {
42
+ lang: 'da',
43
+ elements: [
44
+ <form className="form">
45
+ <div className="form__inline-submit">
46
+ <div className="form__field form__field--inline-label">
47
+ <label htmlFor="demo-search">Search</label>
48
+ <input type="search" autoComplete="off" autoCorrect="off" autoCapitalize="off" id="demo-search" />
49
+ </div>
50
+ <input className="form__inline-submit__button" type="submit" value="Submit" />
51
+ </div>
52
+ </form>,
53
+ <AUButtonComponent icon="confirm-circle" label="Mark as read" />,
54
+ <AUButtonComponent icon="delete" hideLabel label="Delete" />,
55
+ <AUButtonComponent type="text" label="Select all" />,
56
+ <div className="toolbar__split" />,
57
+ <div className="toolbar__text-item">
58
+ <a className="a--text-link" href="#">Open in new tab</a>
59
+ </div>,
60
+ ]
61
+ };
62
+
63
+ export const Many_Actions = Template.bind({});
64
+ Many_Actions.args = {
65
+ lang: 'da',
66
+ elements: Array(25).fill(null).map((_, i) => <AUButtonComponent label={`Action ${i + 1}`} />),
67
+ };
68
+
69
+ export const Groupings = Template.bind({});
70
+ Groupings.args = {
71
+ lang: 'da',
72
+ elements: [
73
+ <div className="toolbar__group">
74
+ <div className="form__field form__field--horizontal">
75
+ <label htmlFor="demo-all">All issues</label>
76
+ <input type="radio" name="demo" value="all" id="demo-all" defaultChecked />
77
+ </div>
78
+ <div className="form__field form__field--horizontal">
79
+ <label htmlFor="demo-open">Open</label>
80
+ <input type="radio" name="demo" value="all" id="demo-open" />
81
+ </div>
82
+ <div className="form__field form__field--horizontal">
83
+ <label htmlFor="demo-resolved">Resolved</label>
84
+ <input type="radio" name="demo" value="all" id="demo-resolved" />
85
+ </div>
86
+ </div>,
87
+ <div className="toolbar__split" />,
88
+ <div className="toolbar__group">
89
+ <div className="form__field form__field--horizontal">
90
+ <label htmlFor="demo-epics">Epics</label>
91
+ <input type="checkbox" id="demo-epics" defaultChecked />
92
+ </div>
93
+ <div className="form__field form__field--horizontal">
94
+ <label htmlFor="demo-stories">Stories</label>
95
+ <input type="checkbox" id="demo-stories" defaultChecked />
96
+ </div>
97
+ <div className="form__field form__field--horizontal">
98
+ <label htmlFor="demo-tasks">Tasks</label>
99
+ <input type="checkbox" id="demo-tasks" defaultChecked />
100
+ </div>
101
+ </div>,
102
+ ],
103
+ };
104
+
105
+ export const Filter = Template.bind({});
106
+ Filter.args = {
107
+ lang: 'da',
108
+ elements: [
109
+ <AUContentToggleComponent
110
+ toggled={false}
111
+ onClick={(popout: HTMLElement) => {
112
+ contentToggleEdgeHandling(popout);
113
+ lockBodyScroll();
114
+ }}
115
+ beforeCallback={(content: HTMLElement) => closeAllContentTogglesInToolbar(findToolbar(content))}
116
+ afterCallback={(content: HTMLElement, button: HTMLButtonElement) => {
117
+ const ariaExpanded = button.getAttribute('aria-expanded');
118
+ const toolbar = findToolbar(content);
119
+ if (ariaExpanded === 'true') {
120
+ toolbar?.classList.add('toolbar--has-popout');
121
+ } else {
122
+ toolbar?.classList.remove('toolbar--has-popout');
123
+ }
124
+
125
+ content.addEventListener('click', (event: MouseEvent) => {
126
+ if ((event.target as HTMLElement).classList.contains('toolbar__popout')
127
+ && !isElementWithClassNameInEventPath(event as MouseEvent, 'toolbar__filter__content')) {
128
+ closeAllContentTogglesInToolbar(toolbar);
129
+ unlockBodyScroll();
130
+ }
131
+ });
132
+ }}
133
+ >
134
+ <div className="toolbar__filter">
135
+ <button
136
+ type="button"
137
+ className="toolbar__filter__toggle content-toggle__toggle"
138
+ aria-expanded={false}
139
+ aria-label="Filter 1"
140
+ >
141
+ Filter 1
142
+ </button>
143
+ <div
144
+ className="toolbar__popout content-toggle__content"
145
+ hidden
146
+ >
147
+ <div className="toolbar__filter__content toolbar__popout__content theme--normal">
148
+ <h3 className="toolbar__filter__content__title">
149
+ Vælg Filter 1
150
+ </h3>
151
+
152
+ <form className="form toolbar__filter__content__search">
153
+ <div className="form__inline-submit">
154
+ <div className="form__field form__field--inline-label">
155
+ <label htmlFor="search-filter-1">
156
+ Søg
157
+ </label>
158
+ <input
159
+ type="search"
160
+ id="search-filter-1"
161
+ />
162
+ </div>
163
+ <input className="form__inline-submit__button" type="submit" value="Søg" />
164
+ </div>
165
+ </form>
166
+ <form
167
+ className="toolbar__filter__content__options-and-actions"
168
+ onSubmit={(event) => {
169
+ event.preventDefault();
170
+ unlockBodyScroll();
171
+ }}
172
+ >
173
+ <div
174
+ className="toolbar__filter__content__options"
175
+ >
176
+ <div className="toolbar__filter__content__options__scroll-container">
177
+ <fieldset className="selection-list">
178
+ <legend>
179
+ 5 valgmuligheder
180
+ </legend>
181
+ <div className="selection-list__option">
182
+ <input type="checkbox" id="option-1" />
183
+ <label htmlFor="option-1">Valgmulighed 1</label>
184
+ </div>
185
+ <div className="selection-list__option">
186
+ <input type="checkbox" id="option-2" />
187
+ <label htmlFor="option-2">Valgmulighed 2</label>
188
+ </div>
189
+ <div className="selection-list__option">
190
+ <input type="checkbox" id="option-3" />
191
+ <label htmlFor="option-3">Valgmulighed 3</label>
192
+ </div>
193
+ <div className="selection-list__option">
194
+ <input type="checkbox" id="option-4" />
195
+ <label htmlFor="option-4">Valgmulighed 4</label>
196
+ </div>
197
+ <div className="selection-list__option">
198
+ <input type="checkbox" id="option-5" />
199
+ <label htmlFor="option-5">Valgmulighed 5</label>
200
+ </div>
201
+ </fieldset>
202
+ </div>
203
+ </div>
204
+ <div className="toolbar__filter__content__actions">
205
+ <div className="button-container">
206
+ <input type="submit" className="content-toggle__close button button--small" value="Gem" />
207
+ </div>
208
+ </div>
209
+ </form>
210
+ </div>
211
+ <button
212
+ type="button"
213
+ className="toolbar__popout__close content-toggle__close button button--icon button--icon--hide-label icon-close"
214
+ onClick={() => unlockBodyScroll()}
215
+ >
216
+ Luk
217
+ </button>
218
+ </div>
219
+ </div>
220
+ </AUContentToggleComponent>,
221
+ <AUContentToggleComponent
222
+ toggled={false}
223
+ onClick={(popout: HTMLElement) => {
224
+ contentToggleEdgeHandling(popout);
225
+ lockBodyScroll();
226
+ }}
227
+ beforeCallback={(content: HTMLElement) => closeAllContentTogglesInToolbar(findToolbar(content))}
228
+ afterCallback={(content: HTMLElement, button: HTMLButtonElement) => {
229
+ const ariaExpanded = button.getAttribute('aria-expanded');
230
+ const toolbar = findToolbar(content);
231
+ if (ariaExpanded === 'true') {
232
+ toolbar?.classList.add('toolbar--has-popout');
233
+ } else {
234
+ toolbar?.classList.remove('toolbar--has-popout');
235
+ }
236
+
237
+ content.addEventListener('click', (event: MouseEvent) => {
238
+ if ((event.target as HTMLElement).classList.contains('toolbar__popout')
239
+ && !isElementWithClassNameInEventPath(event as MouseEvent, 'toolbar__filter__content')) {
240
+ closeAllContentTogglesInToolbar(toolbar);
241
+ unlockBodyScroll();
242
+ }
243
+ });
244
+ }}
245
+ >
246
+ <div className="toolbar__filter">
247
+ <button
248
+ type="button"
249
+ className="toolbar__filter__toggle content-toggle__toggle"
250
+ aria-expanded={false}
251
+ aria-label="Filter 1"
252
+ >
253
+ Filter 2
254
+ </button>
255
+ <div
256
+ className="toolbar__popout content-toggle__content"
257
+ hidden
258
+ >
259
+ <div className="toolbar__filter__content toolbar__popout__content theme--normal">
260
+ <h3 className="toolbar__filter__content__title">
261
+ Vælg Filter 2
262
+ </h3>
263
+
264
+ <form className="form toolbar__filter__content__search">
265
+ <div className="form__inline-submit">
266
+ <div className="form__field form__field--inline-label">
267
+ <label htmlFor="search-filter-2">
268
+ Søg
269
+ </label>
270
+ <input
271
+ type="search"
272
+ id="search-filter-2"
273
+ />
274
+ </div>
275
+ <input className="form__inline-submit__button" type="submit" value="Søg" />
276
+ </div>
277
+ </form>
278
+ <form
279
+ className="toolbar__filter__content__options-and-actions"
280
+ onSubmit={(event) => {
281
+ event.preventDefault();
282
+ unlockBodyScroll();
283
+ }}
284
+ >
285
+ <div
286
+ className="toolbar__filter__content__options"
287
+ >
288
+ <div className="toolbar__filter__content__options__scroll-container">
289
+ <fieldset className="selection-list">
290
+ <legend>
291
+ 3 valgmuligheder
292
+ </legend>
293
+ <div className="selection-list__option">
294
+ <input type="checkbox" id="option-10" />
295
+ <label htmlFor="option-10">Valgmulighed 1</label>
296
+ </div>
297
+ <div className="selection-list__option">
298
+ <input type="checkbox" id="option-20" />
299
+ <label htmlFor="option-20">Valgmulighed 2</label>
300
+ </div>
301
+ <div className="selection-list__option">
302
+ <input type="checkbox" id="option-30" />
303
+ <label htmlFor="option-30">Valgmulighed 3</label>
304
+ </div>
305
+ </fieldset>
306
+ </div>
307
+ </div>
308
+ <div className="toolbar__filter__content__actions">
309
+ <div className="button-container">
310
+ <input type="submit" className="content-toggle__close button button--small" value="Gem" />
311
+ </div>
312
+ </div>
313
+ </form>
314
+ </div>
315
+ <button
316
+ type="button"
317
+ className="toolbar__popout__close content-toggle__close button button--icon button--icon--hide-label icon-close"
318
+ onClick={() => unlockBodyScroll()}
319
+ >
320
+ Luk
321
+ </button>
322
+ </div>
323
+ </div>
324
+ </AUContentToggleComponent>
325
+ ],
326
+ };