@altinn/altinn-components 0.42.1 → 0.42.2
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/dist/components/Header/Header.js +19 -20
- package/package.json +1 -1
|
@@ -5,14 +5,14 @@ import "react";
|
|
|
5
5
|
import { useRootContext as H } from "../RootProvider/RootProvider.js";
|
|
6
6
|
import { DropdownBase as S } from "../Dropdown/DropdownBase.js";
|
|
7
7
|
import { DrawerBase as k } from "../Dropdown/DrawerBase.js";
|
|
8
|
-
import { GlobalMenu as
|
|
8
|
+
import { GlobalMenu as f } from "../GlobalMenu/GlobalMenu.js";
|
|
9
9
|
import { GlobalMenuButton as B } from "../GlobalMenu/GlobalMenuButton.js";
|
|
10
10
|
import { HeaderBase as D } from "./HeaderBase.js";
|
|
11
11
|
import { HeaderLogo as I } from "./HeaderLogo.js";
|
|
12
12
|
import { HeaderGroup as N } from "./HeaderGroup.js";
|
|
13
|
-
import { HeaderSearch as
|
|
13
|
+
import { HeaderSearch as w } from "./HeaderSearch.js";
|
|
14
14
|
import { LocaleSwitcher as F } from "./LocaleSwitcher.js";
|
|
15
|
-
import { Searchbar as
|
|
15
|
+
import { Searchbar as x } from "../Searchbar/Searchbar.js";
|
|
16
16
|
import "../Snackbar/useSnackbar.js";
|
|
17
17
|
import { useIsDesktop as G } from "../../hooks/useIsDesktop.js";
|
|
18
18
|
import '../../assets/Header.css';const L = "_drawer_afyu3_1", j = "_dropdown_afyu3_6", z = "_relative_afyu3_19", t = {
|
|
@@ -21,21 +21,21 @@ import '../../assets/Header.css';const L = "_drawer_afyu3_1", j = "_dropdown_afy
|
|
|
21
21
|
relative: z
|
|
22
22
|
}, A = ({
|
|
23
23
|
globalMenu: e,
|
|
24
|
-
desktopMenu:
|
|
25
|
-
mobileMenu:
|
|
24
|
+
desktopMenu: _,
|
|
25
|
+
mobileMenu: C,
|
|
26
26
|
locale: p,
|
|
27
27
|
search: s,
|
|
28
28
|
currentAccount: m,
|
|
29
|
-
logo:
|
|
30
|
-
badge:
|
|
29
|
+
logo: u = {},
|
|
30
|
+
badge: l
|
|
31
31
|
}) => {
|
|
32
|
-
const { currentId: r, toggleId:
|
|
32
|
+
const { currentId: r, toggleId: i, openId: v, closeAll: d } = H(), c = () => {
|
|
33
33
|
v("search");
|
|
34
|
-
},
|
|
35
|
-
|
|
34
|
+
}, a = () => {
|
|
35
|
+
i("search");
|
|
36
36
|
}, y = () => {
|
|
37
|
-
|
|
38
|
-
},
|
|
37
|
+
i("menu");
|
|
38
|
+
}, h = G();
|
|
39
39
|
return /* @__PURE__ */ n(
|
|
40
40
|
D,
|
|
41
41
|
{
|
|
@@ -43,15 +43,14 @@ import '../../assets/Header.css';const L = "_drawer_afyu3_1", j = "_dropdown_afy
|
|
|
43
43
|
open: r === "search" || r === "menu" || r === "locale",
|
|
44
44
|
onClose: d,
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */ o(I, { ...
|
|
47
|
-
s &&
|
|
46
|
+
/* @__PURE__ */ o(I, { ...u, badge: l, className: t.logo }),
|
|
47
|
+
s && h && /* @__PURE__ */ o(w, { expanded: r === "search", children: /* @__PURE__ */ o(x, { ...s, expanded: r === "search", onClose: a, onFocus: c }) }),
|
|
48
48
|
/* @__PURE__ */ n(N, { children: [
|
|
49
49
|
p && /* @__PURE__ */ o(F, { ...p }),
|
|
50
50
|
/* @__PURE__ */ n("div", { className: t.relative, children: [
|
|
51
51
|
/* @__PURE__ */ o(
|
|
52
52
|
B,
|
|
53
53
|
{
|
|
54
|
-
badge: i,
|
|
55
54
|
currentAccount: m,
|
|
56
55
|
onClick: y,
|
|
57
56
|
expanded: r === "menu",
|
|
@@ -68,10 +67,10 @@ import '../../assets/Header.css';const L = "_drawer_afyu3_1", j = "_dropdown_afy
|
|
|
68
67
|
open: r === "menu",
|
|
69
68
|
className: t.dropdown,
|
|
70
69
|
children: /* @__PURE__ */ o(
|
|
71
|
-
|
|
70
|
+
f,
|
|
72
71
|
{
|
|
73
72
|
...e,
|
|
74
|
-
menu:
|
|
73
|
+
menu: _ || (e == null ? void 0 : e.menu),
|
|
75
74
|
currentAccount: m,
|
|
76
75
|
onClose: d
|
|
77
76
|
}
|
|
@@ -80,12 +79,12 @@ import '../../assets/Header.css';const L = "_drawer_afyu3_1", j = "_dropdown_afy
|
|
|
80
79
|
)
|
|
81
80
|
] })
|
|
82
81
|
] }),
|
|
83
|
-
s && !
|
|
82
|
+
s && !h && /* @__PURE__ */ o(w, { expanded: r === "search", children: /* @__PURE__ */ o(x, { ...s, expanded: r === "search", onClose: a, onFocus: c }) }),
|
|
84
83
|
e && /* @__PURE__ */ o(k, { open: r === "menu", className: t.drawer, children: /* @__PURE__ */ o(
|
|
85
|
-
|
|
84
|
+
f,
|
|
86
85
|
{
|
|
87
86
|
...e,
|
|
88
|
-
menu:
|
|
87
|
+
menu: C || (e == null ? void 0 : e.menu),
|
|
89
88
|
currentAccount: m,
|
|
90
89
|
onClose: d
|
|
91
90
|
}
|