@altinn/altinn-components 0.66.0 → 0.66.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._header_17ppp_1{z-index:1;background-color:#fff;width:100%}._container_17ppp_7{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem;padding:.625rem;width:100%;max-width:1512px;margin:0 auto}._backdrop_17ppp_19{display:none}._header_17ppp_1[data-current-id=menu],._header_17ppp_1[data-current-id=locale]{background-color:#fff}@media(min-width:1024px){._header_17ppp_1[data-current-id=menu] ._backdrop_17ppp_19,._header_17ppp_1[data-current-id=locale] ._backdrop_17ppp_19{display:block}}@media(max-width:1023px){._header_17ppp_1{gap:0}}._header_17ppp_1{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}._nav_17ppp_53{position:relative;display:flex;align-items:center;justify-content:end;column-gap:1rem;width:100%}._logo_17ppp_62{margin-right:auto}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
const
|
|
1
|
+
import { jsxs as e, jsx as C } from "react/jsx-runtime";
|
|
2
|
+
const t = ({ className: r, title: i = "Digdir logo" }) => /* @__PURE__ */ e(
|
|
3
3
|
"svg",
|
|
4
4
|
{
|
|
5
5
|
width: "1em",
|
|
@@ -8,6 +8,7 @@ const e = ({ className: r, title: i = "Digdir logo" }) => /* @__PURE__ */ o(
|
|
|
8
8
|
fill: "none",
|
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
10
|
className: r,
|
|
11
|
+
"aria-hidden": "true",
|
|
11
12
|
children: [
|
|
12
13
|
/* @__PURE__ */ C("title", { children: i }),
|
|
13
14
|
/* @__PURE__ */ C(
|
|
@@ -21,5 +22,5 @@ const e = ({ className: r, title: i = "Digdir logo" }) => /* @__PURE__ */ o(
|
|
|
21
22
|
}
|
|
22
23
|
);
|
|
23
24
|
export {
|
|
24
|
-
|
|
25
|
+
t as DigdirLogomark
|
|
25
26
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as n, jsxs as i, Fragment as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsx as n, jsxs as i, Fragment as O } from "react/jsx-runtime";
|
|
3
|
+
import { useState as v } from "react";
|
|
4
4
|
import { useIsDesktop as F } from "../../hooks/useIsDesktop.js";
|
|
5
5
|
import { AccountSelector as b } from "../AccountSelector/AccountSelector.js";
|
|
6
6
|
import { GlobalMenu as w } from "../GlobalMenu/GlobalMenu.js";
|
|
@@ -14,85 +14,84 @@ import { GlobalMenuButton as D } from "./GlobalMenuButton.js";
|
|
|
14
14
|
import { GlobalAccountButton as M } from "./GlobalAccountButton.js";
|
|
15
15
|
import "../Snackbar/useSnackbar.js";
|
|
16
16
|
import { HeaderDrawer as N } from "./HeaderDrawer.js";
|
|
17
|
-
import { HeaderDropdown as
|
|
18
|
-
import { HeaderLogo as
|
|
19
|
-
import '../../assets/GlobalHeader.css';const
|
|
20
|
-
header:
|
|
21
|
-
container:
|
|
22
|
-
nav:
|
|
23
|
-
|
|
17
|
+
import { HeaderDropdown as E } from "./HeaderDropdown.js";
|
|
18
|
+
import { HeaderLogo as I } from "./HeaderLogo.js";
|
|
19
|
+
import '../../assets/GlobalHeader.css';const T = "_header_17ppp_1", k = "_container_17ppp_7", B = "_nav_17ppp_53", G = "_logo_17ppp_62", t = {
|
|
20
|
+
header: T,
|
|
21
|
+
container: k,
|
|
22
|
+
nav: B,
|
|
23
|
+
logo: G
|
|
24
|
+
}, H = 5, $ = ({
|
|
24
25
|
globalMenu: r,
|
|
25
|
-
desktopMenu:
|
|
26
|
-
mobileMenu:
|
|
27
|
-
locale:
|
|
26
|
+
desktopMenu: s,
|
|
27
|
+
mobileMenu: d,
|
|
28
|
+
locale: m,
|
|
28
29
|
accountSelector: e,
|
|
29
30
|
logo: u = {},
|
|
30
31
|
badge: f,
|
|
31
|
-
onLoginClick:
|
|
32
|
+
onLoginClick: g
|
|
32
33
|
}) => {
|
|
33
|
-
const { currentId: o, toggleId:
|
|
34
|
-
o !== "account" && window.scrollTo({ top: 0, behavior: "instant" }),
|
|
34
|
+
const { currentId: o, toggleId: l, closeAll: a } = C(), h = () => {
|
|
35
|
+
o !== "account" && window.scrollTo({ top: 0, behavior: "instant" }), l("account");
|
|
35
36
|
}, _ = () => {
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
return /* @__PURE__ */ n("header", { className: t.header, "data-current-id": o, children: /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */ n(
|
|
40
|
-
/* @__PURE__ */ i(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
l("menu");
|
|
38
|
+
}, c = o === "account" || e?.forceOpenFullScreen || !1, [p, x] = v(!1), A = F();
|
|
39
|
+
return /* @__PURE__ */ n("header", { className: t.header, "data-current-id": o, children: /* @__PURE__ */ n("div", { className: t.container, children: /* @__PURE__ */ i("nav", { className: t.nav, "aria-label": "hovednavigasjon", children: [
|
|
40
|
+
/* @__PURE__ */ n(I, { ...u, badge: f, className: t.logo }),
|
|
41
|
+
e && /* @__PURE__ */ i(O, { children: [
|
|
42
|
+
/* @__PURE__ */ n(
|
|
43
|
+
M,
|
|
44
|
+
{
|
|
45
|
+
currentAccount: e.accountMenu?.currentAccount,
|
|
46
|
+
onClick: e.accountMenu?.currentAccount ? h : g,
|
|
47
|
+
expanded: c,
|
|
48
|
+
loading: e.loading,
|
|
49
|
+
disabled: e.forceOpenFullScreen
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ n(
|
|
53
|
+
N,
|
|
54
|
+
{
|
|
55
|
+
id: "header-account",
|
|
56
|
+
open: c,
|
|
57
|
+
onClose: a,
|
|
58
|
+
closedBy: e?.forceOpenFullScreen ? "none" : "any",
|
|
59
|
+
expanded: e?.forceOpenFullScreen || p,
|
|
60
|
+
onToggle: () => x(!p),
|
|
61
|
+
expandable: e.accountMenu.items.length > H,
|
|
62
|
+
children: /* @__PURE__ */ n(b, { ...e, forceOpenFullScreen: e.forceOpenFullScreen })
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ n(
|
|
67
|
+
E,
|
|
68
|
+
{
|
|
69
|
+
id: "header-menu",
|
|
70
|
+
open: o === "menu",
|
|
71
|
+
onClose: a,
|
|
72
|
+
trigger: /* @__PURE__ */ n(
|
|
73
|
+
D,
|
|
44
74
|
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
disabled: e.forceOpenFullScreen
|
|
75
|
+
onClick: _,
|
|
76
|
+
expanded: o === "menu",
|
|
77
|
+
disabled: e?.forceOpenFullScreen,
|
|
78
|
+
label: r?.menuLabel
|
|
50
79
|
}
|
|
51
80
|
),
|
|
52
|
-
/* @__PURE__ */ n(
|
|
53
|
-
|
|
81
|
+
children: /* @__PURE__ */ n(
|
|
82
|
+
w,
|
|
54
83
|
{
|
|
55
|
-
|
|
56
|
-
|
|
84
|
+
...r,
|
|
85
|
+
menu: A ? s || r?.menu : d || r?.menu,
|
|
57
86
|
onClose: a,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onToggle: () => v(!s),
|
|
61
|
-
expandable: e.accountMenu.items.length > B,
|
|
62
|
-
children: /* @__PURE__ */ n(b, { ...e, forceOpenFullScreen: e.forceOpenFullScreen })
|
|
87
|
+
localeSwitcher: m,
|
|
88
|
+
isOpen: o === "menu"
|
|
63
89
|
}
|
|
64
90
|
)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
{
|
|
69
|
-
id: "header-menu",
|
|
70
|
-
open: o === "menu",
|
|
71
|
-
onClose: a,
|
|
72
|
-
trigger: /* @__PURE__ */ n(
|
|
73
|
-
D,
|
|
74
|
-
{
|
|
75
|
-
onClick: _,
|
|
76
|
-
expanded: o === "menu",
|
|
77
|
-
disabled: e?.forceOpenFullScreen,
|
|
78
|
-
label: r?.menuLabel
|
|
79
|
-
}
|
|
80
|
-
),
|
|
81
|
-
children: /* @__PURE__ */ n(
|
|
82
|
-
w,
|
|
83
|
-
{
|
|
84
|
-
...r,
|
|
85
|
-
menu: x ? d || r?.menu : m || r?.menu,
|
|
86
|
-
onClose: a,
|
|
87
|
-
localeSwitcher: p,
|
|
88
|
-
isOpen: o === "menu"
|
|
89
|
-
}
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
)
|
|
93
|
-
] })
|
|
94
|
-
] }) });
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
] }) }) });
|
|
95
94
|
};
|
|
96
95
|
export {
|
|
97
|
-
|
|
96
|
+
$ as GlobalHeader
|
|
98
97
|
};
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
4
|
-
import { Button as
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "../../index-p1eeF8LQ.js";
|
|
3
|
+
import { B as l } from "../../ToolbarSearch-DFYx6gIb.js";
|
|
4
|
+
import { Button as e } from "../Button/Button.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "../../tooltip-Ct39-719.js";
|
|
7
7
|
import "../Typography/Link.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
import "../GlobalMenu/GlobalMenuBase.js";
|
|
10
10
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import { DigdirLogomark as
|
|
12
|
-
import '../../assets/HeaderLogo.css';const
|
|
13
|
-
logo:
|
|
14
|
-
logomark:
|
|
15
|
-
text:
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return /* @__PURE__ */ i(p, { variant: "ghost", as: m, className: l(t.logo, s), href: n, title: e, children: [
|
|
22
|
-
/* @__PURE__ */ o(x, { className: t.logomark }),
|
|
23
|
-
/* @__PURE__ */ o("span", { className: t.text, children: "Altinn" }),
|
|
24
|
-
r && /* @__PURE__ */ o(g, { ...r })
|
|
25
|
-
] });
|
|
26
|
-
};
|
|
11
|
+
import { DigdirLogomark as g } from "./DigdirLogomark.js";
|
|
12
|
+
import '../../assets/HeaderLogo.css';const p = "_logo_1yxnd_1", x = "_logomark_1yxnd_16", c = "_text_1yxnd_23", o = {
|
|
13
|
+
logo: p,
|
|
14
|
+
logomark: x,
|
|
15
|
+
text: c
|
|
16
|
+
}, v = ({ className: m, as: s = "a", href: i = "/", badge: t }) => /* @__PURE__ */ a(e, { variant: "ghost", as: s, className: n(o.logo, o.text, m), href: i, children: [
|
|
17
|
+
/* @__PURE__ */ r(g, { className: o.logomark }),
|
|
18
|
+
"Altinn",
|
|
19
|
+
t && /* @__PURE__ */ r(l, { ...t })
|
|
20
|
+
] });
|
|
27
21
|
export {
|
|
28
22
|
v as HeaderLogo
|
|
29
23
|
};
|