@altinn/altinn-components 0.24.0 → 0.24.1
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/assets/Header.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._drawer_1vzjh_1[data-expanded=true]{display:block}._dropdown_1vzjh_5[data-expanded=true]{display:none}@media (min-width: 1024px){._dropdown_1vzjh_5[data-expanded=true]{width:320px;display:block}._drawer_1vzjh_1[data-expanded=true]{display:none}}._relative_1vzjh_19{position:relative}
|
|
@@ -4,58 +4,59 @@ import { DropdownBase as p } from "../Dropdown/DropdownBase.js";
|
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import { DrawerBase as m } from "../Dropdown/DrawerBase.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import { useRootContext as
|
|
7
|
+
import { useRootContext as C } from "../RootProvider/RootProvider.js";
|
|
8
8
|
import { GlobalMenu as c } from "../GlobalMenu/GlobalMenu.js";
|
|
9
|
-
import { HeaderBase as
|
|
10
|
-
import { HeaderLogo as
|
|
11
|
-
import { HeaderButton as
|
|
12
|
-
import { LocaleButton as
|
|
9
|
+
import { HeaderBase as u } from "./HeaderBase.js";
|
|
10
|
+
import { HeaderLogo as N } from "./HeaderLogo.js";
|
|
11
|
+
import { HeaderButton as b } from "./HeaderButton.js";
|
|
12
|
+
import { LocaleButton as H } from "./LocaleButton.js";
|
|
13
13
|
import { LocaleSwitcher as h } from "./LocaleSwitcher.js";
|
|
14
|
-
import { Searchbar as
|
|
14
|
+
import { Searchbar as j } from "../Search/Searchbar.js";
|
|
15
15
|
import "../Search/AutocompleteBase.js";
|
|
16
16
|
import "../Snackbar/useSnackbar.js";
|
|
17
|
-
import { HeaderGroup as
|
|
18
|
-
import { HeaderSearch as
|
|
19
|
-
import '../../assets/Header.css';const k = "
|
|
20
|
-
drawer:
|
|
21
|
-
dropdown:
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
import { HeaderGroup as B } from "./HeaderGroup.js";
|
|
18
|
+
import { HeaderSearch as L } from "./HeaderSearch.js";
|
|
19
|
+
import '../../assets/Header.css';const S = "_drawer_1vzjh_1", k = "_dropdown_1vzjh_5", z = "_relative_1vzjh_19", a = {
|
|
20
|
+
drawer: S,
|
|
21
|
+
dropdown: k,
|
|
22
|
+
relative: z
|
|
23
|
+
}, X = ({ menu: r, locale: l, search: i, currentAccount: t, logo: f = {}, badge: w }) => {
|
|
24
|
+
const { currentId: e, toggleId: n, openId: g, closeAll: d } = C(), v = () => {
|
|
24
25
|
g("search");
|
|
25
|
-
},
|
|
26
|
-
|
|
26
|
+
}, _ = () => {
|
|
27
|
+
n("search");
|
|
27
28
|
}, x = () => {
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
29
|
+
n("menu");
|
|
30
|
+
}, y = () => {
|
|
31
|
+
n("locale");
|
|
31
32
|
};
|
|
32
33
|
return /* @__PURE__ */ s(
|
|
33
|
-
|
|
34
|
+
u,
|
|
34
35
|
{
|
|
35
36
|
currentId: e,
|
|
36
37
|
open: e === "search" || e === "menu" || e === "locale",
|
|
37
38
|
onClose: d,
|
|
38
39
|
children: [
|
|
39
|
-
/* @__PURE__ */ o(
|
|
40
|
-
/* @__PURE__ */ s(
|
|
41
|
-
/* @__PURE__ */ o("div", {
|
|
42
|
-
/* @__PURE__ */ s("div", {
|
|
40
|
+
/* @__PURE__ */ o(N, { ...f, className: a.logo }),
|
|
41
|
+
/* @__PURE__ */ s(B, { children: [
|
|
42
|
+
l && /* @__PURE__ */ o("div", { className: a.relative, children: /* @__PURE__ */ o(H, { onClick: y, expanded: e === "locale" }) }),
|
|
43
|
+
/* @__PURE__ */ s("div", { className: a.relative, children: [
|
|
43
44
|
/* @__PURE__ */ o(
|
|
44
|
-
|
|
45
|
+
b,
|
|
45
46
|
{
|
|
46
47
|
color: "company",
|
|
47
48
|
variant: "solid",
|
|
48
49
|
badge: w,
|
|
49
|
-
avatar:
|
|
50
|
-
type:
|
|
51
|
-
name:
|
|
50
|
+
avatar: t && {
|
|
51
|
+
type: t.type,
|
|
52
|
+
name: t.name
|
|
52
53
|
},
|
|
53
54
|
onClick: x,
|
|
54
55
|
expanded: e === "menu",
|
|
55
56
|
label: r == null ? void 0 : r.menuLabel
|
|
56
57
|
}
|
|
57
58
|
),
|
|
58
|
-
|
|
59
|
+
l && /* @__PURE__ */ o(
|
|
59
60
|
p,
|
|
60
61
|
{
|
|
61
62
|
layout: "desktop",
|
|
@@ -63,7 +64,7 @@ import '../../assets/Header.css';const k = "_drawer_d2s9o_1", I = "_dropdown_d2s
|
|
|
63
64
|
placement: "right",
|
|
64
65
|
open: e === "locale",
|
|
65
66
|
className: a.dropdown,
|
|
66
|
-
children: /* @__PURE__ */ o(h, { ...
|
|
67
|
+
children: /* @__PURE__ */ o(h, { ...l })
|
|
67
68
|
}
|
|
68
69
|
),
|
|
69
70
|
r && /* @__PURE__ */ o(
|
|
@@ -74,18 +75,18 @@ import '../../assets/Header.css';const k = "_drawer_d2s9o_1", I = "_dropdown_d2s
|
|
|
74
75
|
placement: "right",
|
|
75
76
|
open: e === "menu",
|
|
76
77
|
className: a.dropdown,
|
|
77
|
-
children: /* @__PURE__ */ o(c, { ...r, currentAccount:
|
|
78
|
+
children: /* @__PURE__ */ o(c, { ...r, currentAccount: t, onClose: d })
|
|
78
79
|
}
|
|
79
80
|
)
|
|
80
81
|
] })
|
|
81
82
|
] }),
|
|
82
|
-
i && /* @__PURE__ */ o(
|
|
83
|
-
|
|
84
|
-
r && /* @__PURE__ */ o(m, { layout: "mobile", open: e === "menu", className: a.drawer, children: /* @__PURE__ */ o(c, { ...r, currentAccount:
|
|
83
|
+
i && /* @__PURE__ */ o(L, { expanded: e === "search", children: /* @__PURE__ */ o(j, { ...i, expanded: e === "search", onClose: _, onFocus: v }) }),
|
|
84
|
+
l && /* @__PURE__ */ o(m, { layout: "mobile", open: e === "locale", className: a.drawer, children: /* @__PURE__ */ o(h, { ...l }) }),
|
|
85
|
+
r && /* @__PURE__ */ o(m, { layout: "mobile", open: e === "menu", className: a.drawer, children: /* @__PURE__ */ o(c, { ...r, currentAccount: t, onClose: d }) })
|
|
85
86
|
]
|
|
86
87
|
}
|
|
87
88
|
);
|
|
88
89
|
};
|
|
89
90
|
export {
|
|
90
|
-
|
|
91
|
+
X as Header
|
|
91
92
|
};
|
|
@@ -7,25 +7,25 @@ import "../RootProvider/RootProvider.js";
|
|
|
7
7
|
import "../Search/AutocompleteBase.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
9
|
import { S as l } from "../../MagnifyingGlass-DWIcpwS4.js";
|
|
10
|
-
import { S as
|
|
11
|
-
import '../../assets/ToolbarSearch.css';const
|
|
12
|
-
field:
|
|
10
|
+
import { S as _ } from "../../XMark-Bv1I87Ev.js";
|
|
11
|
+
import '../../assets/ToolbarSearch.css';const u = "_field_3uyps_1", f = "_icon_3uyps_5", d = "_input_3uyps_14", y = "_clear_3uyps_31", o = {
|
|
12
|
+
field: u,
|
|
13
13
|
icon: f,
|
|
14
14
|
input: d,
|
|
15
15
|
clear: y
|
|
16
16
|
}, T = ({
|
|
17
|
-
value:
|
|
17
|
+
value: s,
|
|
18
18
|
name: r,
|
|
19
19
|
placeholder: c = "Search",
|
|
20
20
|
clearButtonAltText: n = "Clear search",
|
|
21
21
|
onChange: e,
|
|
22
|
-
onClear:
|
|
22
|
+
onClear: t
|
|
23
23
|
}) => /* @__PURE__ */ a("div", { className: o.field, children: [
|
|
24
24
|
/* @__PURE__ */ i(
|
|
25
25
|
"input",
|
|
26
26
|
{
|
|
27
27
|
type: "search",
|
|
28
|
-
value:
|
|
28
|
+
value: s,
|
|
29
29
|
name: r,
|
|
30
30
|
placeholder: c,
|
|
31
31
|
className: o.input,
|
|
@@ -33,14 +33,14 @@ import '../../assets/ToolbarSearch.css';const _ = "_field_3uyps_1", f = "_icon_3
|
|
|
33
33
|
}
|
|
34
34
|
),
|
|
35
35
|
/* @__PURE__ */ i(m, { svgElement: l, className: o.icon }),
|
|
36
|
-
s && /* @__PURE__ */ i(
|
|
36
|
+
t && !!s && /* @__PURE__ */ i(
|
|
37
37
|
p,
|
|
38
38
|
{
|
|
39
|
-
icon:
|
|
39
|
+
icon: _,
|
|
40
40
|
variant: "solid",
|
|
41
41
|
size: "custom",
|
|
42
42
|
className: o.clear,
|
|
43
|
-
onClick:
|
|
43
|
+
onClick: t,
|
|
44
44
|
iconAltText: n
|
|
45
45
|
}
|
|
46
46
|
)
|
|
@@ -20,3 +20,4 @@ declare const meta: {
|
|
|
20
20
|
export default meta;
|
|
21
21
|
export declare const CurrentAccount: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export declare const Login: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const ChangeLocale: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|