@altinn/altinn-components 0.46.4 → 0.46.6
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/GlobalMenuButton2.css +1 -1
- package/dist/components/Account/AccountMenu.js +22 -20
- package/dist/components/Footer/FooterLogo.js +8 -8
- package/dist/components/GlobalHeader/AccountSelector.js +26 -25
- package/dist/components/GlobalHeader/DigdirLogomark.js +10 -9
- package/dist/components/GlobalHeader/GlobalSearch.js +29 -25
- package/dist/components/GlobalHeader/GlobalSearchButton.js +5 -5
- package/dist/components/GlobalHeader/HeaderLogo.js +19 -13
- package/dist/components/GlobalMenu/GlobalMenuButton.js +64 -45
- package/dist/components/Menu/Menu.js +19 -16
- package/dist/components/Menu/MenuItemsVirtual.js +59 -55
- package/dist/types/lib/components/Account/AccountMenu.d.ts +1 -1
- package/dist/types/lib/components/Account/AccountMenu.stories.d.ts +1 -1
- package/dist/types/lib/components/GlobalHeader/DigdirLogomark.d.ts +2 -1
- package/dist/types/lib/components/GlobalHeader/GlobalHeader.stories.d.ts +1 -0
- package/dist/types/lib/components/GlobalHeader/HeaderLogo.d.ts +1 -1
- package/dist/types/lib/components/Header/Header.d.ts +1 -1
- package/dist/types/lib/components/Menu/Menu.d.ts +1 -1
- package/dist/types/lib/components/Menu/Menu.stories.d.ts +1 -1
- package/dist/types/lib/components/Menu/MenuItems.d.ts +1 -0
- package/dist/types/lib/components/Menu/MenuItemsVirtual.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._button_rhdbs_1{flex-shrink:0;position:relative;z-index:2;display:inline-flex;align-items:center;column-gap:.625rem;padding:.625rem;border:none;border-radius:4px}._label_rhdbs_13{font-size:1.125rem;font-weight:500;padding:.25rem}._avatar_rhdbs_19{font-size:2.25rem;width:2.25rem;height:2.25rem}._icon_rhdbs_25{font-size:1.5rem;width:1.5rem;height:1.5rem}._iconMobile_rhdbs_31{font-size:1.5rem;width:3.55rem;height:1.5rem}._badge_rhdbs_37{position:absolute;top:0;right:0;margin-top:-.75rem;margin-right:-.75rem}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
3
|
+
import { useState as R, useEffect as S } from "react";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { Menu as
|
|
6
|
+
import { Menu as j } from "../Menu/Menu.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
const
|
|
8
|
+
const k = (d) => `${d} hits`, D = ({
|
|
9
9
|
items: d = [],
|
|
10
10
|
groups: v = {},
|
|
11
11
|
search: t,
|
|
@@ -13,7 +13,8 @@ const j = (d) => `${d} hits`, B = ({
|
|
|
13
13
|
onSelectAccount: u,
|
|
14
14
|
currentAccount: e,
|
|
15
15
|
isVirtualized: L,
|
|
16
|
-
keyboardEvents: w
|
|
16
|
+
keyboardEvents: w,
|
|
17
|
+
scrollRefStyles: F
|
|
17
18
|
}) => {
|
|
18
19
|
var r;
|
|
19
20
|
const p = d.map((o) => ({
|
|
@@ -24,43 +25,44 @@ const j = (d) => `${d} hits`, B = ({
|
|
|
24
25
|
onClick: () => {
|
|
25
26
|
!o.disabled && (u == null || u(o.id));
|
|
26
27
|
}
|
|
27
|
-
})), [l, i] =
|
|
28
|
-
|
|
28
|
+
})), [l, i] = R("");
|
|
29
|
+
S(() => {
|
|
29
30
|
(t == null ? void 0 : t.value) !== void 0 && i(t.value);
|
|
30
31
|
}, [t == null ? void 0 : t.value]);
|
|
31
|
-
const
|
|
32
|
+
const b = C || ((o, a) => {
|
|
32
33
|
var g, f, s;
|
|
33
34
|
return ((g = o == null ? void 0 : o.name) == null ? void 0 : g.toLowerCase().includes(a.toLowerCase())) || ((s = (f = o == null ? void 0 : o.description) == null ? void 0 : f.toString()) == null ? void 0 : s.toLowerCase().includes(a.toLowerCase()));
|
|
34
|
-
}), n = l ? p.filter((o) =>
|
|
35
|
+
}), n = l ? p.filter((o) => b(o, l)).map((o) => ({
|
|
35
36
|
...o,
|
|
36
37
|
groupId: "search",
|
|
37
38
|
title: (o == null ? void 0 : o.title) || o.name,
|
|
38
39
|
highlightWords: [l]
|
|
39
|
-
})) : p,
|
|
40
|
+
})) : p, I = l ? {
|
|
40
41
|
search: {
|
|
41
|
-
title: ((r = t == null ? void 0 : t.getResultsLabel) == null ? void 0 : r.call(t, n.length)) ??
|
|
42
|
+
title: ((r = t == null ? void 0 : t.getResultsLabel) == null ? void 0 : r.call(t, n.length)) ?? k(n.length)
|
|
42
43
|
}
|
|
43
|
-
} : v,
|
|
44
|
+
} : v, M = {
|
|
44
45
|
name: "account-search",
|
|
45
46
|
value: l,
|
|
46
47
|
placeholder: (t == null ? void 0 : t.placeholder) ?? "Find account",
|
|
47
48
|
onChange: (o) => i(o.target.value),
|
|
48
49
|
onClear: () => i("")
|
|
49
|
-
},
|
|
50
|
+
}, c = [
|
|
50
51
|
...n.length > 0 ? n : [{ id: "search", groupId: "search", hidden: !0 }]
|
|
51
52
|
];
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
|
|
53
|
+
return /* @__PURE__ */ x(
|
|
54
|
+
j,
|
|
54
55
|
{
|
|
55
56
|
variant: "default",
|
|
56
|
-
search: t && !t.hidden ?
|
|
57
|
-
groups:
|
|
58
|
-
items:
|
|
57
|
+
search: t && !t.hidden ? M : void 0,
|
|
58
|
+
groups: I,
|
|
59
|
+
items: c,
|
|
59
60
|
isVirtualized: L,
|
|
60
|
-
keyboardEvents: w
|
|
61
|
+
keyboardEvents: w,
|
|
62
|
+
scrollRefStyles: F
|
|
61
63
|
}
|
|
62
64
|
);
|
|
63
65
|
};
|
|
64
66
|
export {
|
|
65
|
-
|
|
67
|
+
D as AccountMenu
|
|
66
68
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import { DigdirLogomark as
|
|
4
|
-
import '../../assets/FooterLogo.css';const
|
|
5
|
-
logo:
|
|
6
|
-
symbol:
|
|
7
|
-
},
|
|
8
|
-
/* @__PURE__ */ o(
|
|
2
|
+
import { c as i } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import { DigdirLogomark as t } from "../Header/DigdirLogomark.js";
|
|
4
|
+
import '../../assets/FooterLogo.css';const c = "_logo_127g0_1", e = "_symbol_127g0_9", s = {
|
|
5
|
+
logo: c,
|
|
6
|
+
symbol: e
|
|
7
|
+
}, d = ({ className: r, title: l = "Digdir" }) => /* @__PURE__ */ m("div", { className: i(s.logo, r), children: [
|
|
8
|
+
/* @__PURE__ */ o(t, { className: s.symbol, "aria-hidden": !0 }),
|
|
9
9
|
/* @__PURE__ */ o("span", { children: l })
|
|
10
10
|
] });
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
d as FooterLogo
|
|
13
13
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as a, jsxs as O } from "react/jsx-runtime";
|
|
3
3
|
import { c as g } from "../../index-L8X2o7IH.js";
|
|
4
|
-
import s, { forwardRef as v, useState as
|
|
4
|
+
import s, { forwardRef as v, useState as z, useEffect as j } from "react";
|
|
5
5
|
import { AccountMenu as C } from "../Account/AccountMenu.js";
|
|
6
6
|
import { Button as E } from "../Button/Button.js";
|
|
7
7
|
import { useRootContext as k } from "../RootProvider/RootProvider.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
9
|
import { SearchField as F } from "../Forms/SearchField.js";
|
|
10
10
|
import { S as N } from "../../Spinner-BDXfwXIh.js";
|
|
11
|
-
import { H as
|
|
11
|
+
import { H as R } from "../../Heading-By5DKz2H.js";
|
|
12
12
|
import { u as _ } from "../../useId-BVFxCjkq.js";
|
|
13
|
-
import '../../assets/AccountSelector.css';var
|
|
13
|
+
import '../../assets/AccountSelector.css';var M = function(e, i) {
|
|
14
14
|
var r = {};
|
|
15
15
|
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && i.indexOf(t) < 0 && (r[t] = e[t]);
|
|
16
16
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -19,7 +19,7 @@ import '../../assets/AccountSelector.css';var R = function(e, i) {
|
|
|
19
19
|
return r;
|
|
20
20
|
};
|
|
21
21
|
const P = v((e, i) => {
|
|
22
|
-
var { title: r, titleId: t } = e, n =
|
|
22
|
+
var { title: r, titleId: t } = e, n = M(e, ["title", "titleId"]);
|
|
23
23
|
let l = _();
|
|
24
24
|
return l = r ? t || "title-" + l : void 0, s.createElement(
|
|
25
25
|
"svg",
|
|
@@ -45,10 +45,10 @@ const T = v((e, i) => {
|
|
|
45
45
|
r ? s.createElement("title", { id: l }, r) : null,
|
|
46
46
|
s.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M3.75 12a8.25 8.25 0 1 1 16.5 0 8.25 8.25 0 0 1-16.5 0M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25m.53 6.72a.75.75 0 0 0-1.06 0l-3.5 3.5a.75.75 0 0 0 .53 1.28h7a.75.75 0 0 0 .53-1.28zM12 10.56l1.69 1.69h-3.38z", clipRule: "evenodd" })
|
|
47
47
|
);
|
|
48
|
-
}),
|
|
49
|
-
accountSelector:
|
|
50
|
-
heading:
|
|
51
|
-
searchSection:
|
|
48
|
+
}), H = "_accountSelector_1f74n_1", V = "_heading_1f74n_11", B = "_searchSection_1f74n_17", D = "_searchField_1f74n_22", K = "_accountMenu_1f74n_26", L = "_fullScreen_1f74n_34", U = "_virtualized_1f74n_38", W = "_btnIcon_1f74n_42", $ = "_spinner_1f74n_46", c = {
|
|
49
|
+
accountSelector: H,
|
|
50
|
+
heading: V,
|
|
51
|
+
searchSection: B,
|
|
52
52
|
searchField: D,
|
|
53
53
|
accountMenu: K,
|
|
54
54
|
fullScreen: L,
|
|
@@ -56,19 +56,19 @@ const T = v((e, i) => {
|
|
|
56
56
|
btnIcon: W,
|
|
57
57
|
spinner: $
|
|
58
58
|
}, ie = ({ accountMenu: e, forceOpenFullScreen: i, className: r, loading: t }) => {
|
|
59
|
-
const { currentId: n, openId: l, toggleId: u, languageCode: S } = k(),
|
|
60
|
-
|
|
61
|
-
i === !0 && !
|
|
62
|
-
}, [i,
|
|
59
|
+
const { currentId: n, openId: l, toggleId: u, languageCode: S } = k(), o = n === "accountFullscreen", [f, m] = z(""), { minimize: b, fullscreen: y, searchText: h, heading: w } = q(S);
|
|
60
|
+
j(() => {
|
|
61
|
+
i === !0 && !o && l("accountFullscreen");
|
|
62
|
+
}, [i, o, l]);
|
|
63
63
|
const x = () => {
|
|
64
|
-
l(
|
|
64
|
+
l(o ? "account" : "accountFullscreen");
|
|
65
65
|
}, I = (d) => {
|
|
66
66
|
var p;
|
|
67
|
-
(p = e.onSelectAccount) == null || p.call(e, d), u(
|
|
67
|
+
(p = e.onSelectAccount) == null || p.call(e, d), u(o ? "accountFullscreen" : "account");
|
|
68
68
|
};
|
|
69
|
-
return t ? /* @__PURE__ */
|
|
70
|
-
|
|
71
|
-
/* @__PURE__ */
|
|
69
|
+
return t ? /* @__PURE__ */ a(N, { "aria-hidden": !0, "data-color": "neutral", className: c.spinner }) : /* @__PURE__ */ O("div", { className: g(r, c.accountSelector), children: [
|
|
70
|
+
o && /* @__PURE__ */ a(R, { "data-size": "md", level: 2, className: c.heading, children: w }),
|
|
71
|
+
/* @__PURE__ */ a("div", { className: c.searchSection, children: /* @__PURE__ */ a(
|
|
72
72
|
F,
|
|
73
73
|
{
|
|
74
74
|
name: h,
|
|
@@ -79,32 +79,33 @@ const T = v((e, i) => {
|
|
|
79
79
|
className: c.searchField
|
|
80
80
|
}
|
|
81
81
|
) }),
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ a(
|
|
83
83
|
"div",
|
|
84
84
|
{
|
|
85
85
|
className: g(
|
|
86
86
|
c.accountMenu,
|
|
87
|
-
|
|
87
|
+
o && c.fullScreen,
|
|
88
88
|
e.isVirtualized && c.virtualized
|
|
89
89
|
),
|
|
90
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ a(
|
|
91
91
|
C,
|
|
92
92
|
{
|
|
93
93
|
...e,
|
|
94
94
|
onSelectAccount: I,
|
|
95
95
|
keyboardEvents: !1,
|
|
96
|
-
search: { hidden: !0, name: "", value: f }
|
|
96
|
+
search: { hidden: !0, name: "", value: f },
|
|
97
|
+
scrollRefStyles: !o && e.isVirtualized ? { maxHeight: "calc(40vh)" } : void 0
|
|
97
98
|
}
|
|
98
99
|
)
|
|
99
100
|
}
|
|
100
101
|
),
|
|
101
|
-
i !== !0 && /* @__PURE__ */
|
|
102
|
+
i !== !0 && /* @__PURE__ */ a(
|
|
102
103
|
E,
|
|
103
104
|
{
|
|
104
|
-
icon:
|
|
105
|
+
icon: o ? /* @__PURE__ */ a(T, { className: c.btnIcon, "aria-hidden": "true" }) : /* @__PURE__ */ a(P, { className: c.btnIcon, "aria-hidden": "true" }),
|
|
105
106
|
variant: "text",
|
|
106
107
|
onClick: x,
|
|
107
|
-
children:
|
|
108
|
+
children: o ? b : y
|
|
108
109
|
}
|
|
109
110
|
)
|
|
110
111
|
] });
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useIsDesktop as
|
|
3
|
-
const p = ({ className:
|
|
4
|
-
const l =
|
|
5
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsxs as e, jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { useIsDesktop as r } from "../../hooks/useIsDesktop.js";
|
|
3
|
+
const p = ({ className: L, title: i = "Digdir logomark", "aria-hidden": o }) => {
|
|
4
|
+
const l = r() ? 8.5 : 7, { width: t, height: n } = { width: `${l}em`, height: `${l * 0.34}em` };
|
|
5
|
+
return /* @__PURE__ */ e(
|
|
6
6
|
"svg",
|
|
7
7
|
{
|
|
8
8
|
fill: "none",
|
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
width:
|
|
11
|
-
height:
|
|
10
|
+
width: t,
|
|
11
|
+
height: n,
|
|
12
12
|
viewBox: "0 0 113.779 38.8565",
|
|
13
13
|
version: "1.1",
|
|
14
|
-
className:
|
|
14
|
+
className: L,
|
|
15
|
+
"aria-hidden": o,
|
|
15
16
|
children: [
|
|
16
17
|
/* @__PURE__ */ C("title", { children: i }),
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ e("g", { id: "surface1", children: [
|
|
18
19
|
/* @__PURE__ */ C(
|
|
19
20
|
"path",
|
|
20
21
|
{
|
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as r, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d, useRef as g, useEffect as b } from "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import { useIsDesktop as
|
|
5
|
-
import { useRootContext as
|
|
4
|
+
import { useIsDesktop as k } from "../../hooks/useIsDesktop.js";
|
|
5
|
+
import { useRootContext as v } from "../RootProvider/RootProvider.js";
|
|
6
6
|
import { s as o } from "../../globalSearch.module-Ejp7X0dO.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
import { S as
|
|
9
|
-
import { S as
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
return
|
|
8
|
+
import { S as a } from "../../index-B6sKSsN9.js";
|
|
9
|
+
import { S as x } from "../../MagnifyingGlass-bwVhw07z.js";
|
|
10
|
+
const q = ({ onSearch: t }) => {
|
|
11
|
+
const u = k(), [s, i] = d(""), { languageCode: h, closeAll: m, currentId: n } = v(), { search: p, placeholder: c } = y(h), f = () => {
|
|
12
|
+
t(s), m();
|
|
13
|
+
}, l = g(null);
|
|
14
|
+
return b(() => {
|
|
15
|
+
var e;
|
|
16
|
+
n === "search" && ((e = l.current) == null || e.focus());
|
|
17
|
+
}, [n]), /* @__PURE__ */ r(
|
|
15
18
|
"form",
|
|
16
19
|
{
|
|
17
|
-
onSubmit: (
|
|
18
|
-
|
|
20
|
+
onSubmit: (e) => {
|
|
21
|
+
e.preventDefault(), f();
|
|
19
22
|
},
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
|
|
23
|
+
children: /* @__PURE__ */ S(a, { className: o.globalSearch, "data-size": u ? "lg" : "md", children: [
|
|
24
|
+
/* @__PURE__ */ r(
|
|
25
|
+
a.Input,
|
|
23
26
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
ref: l,
|
|
28
|
+
placeholder: c,
|
|
29
|
+
onChange: (e) => i(e.target.value),
|
|
30
|
+
value: s,
|
|
31
|
+
"aria-label": c,
|
|
28
32
|
className: o.searchInput
|
|
29
33
|
}
|
|
30
34
|
),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ r(a.Clear, {}),
|
|
36
|
+
/* @__PURE__ */ r(a.Button, { variant: "secondary", icon: !0, "aria-label": p, className: o.searchInputButton, children: /* @__PURE__ */ r(x, {}) })
|
|
33
37
|
] })
|
|
34
38
|
}
|
|
35
39
|
);
|
|
36
|
-
},
|
|
37
|
-
switch (
|
|
40
|
+
}, y = (t) => {
|
|
41
|
+
switch (t) {
|
|
38
42
|
case "nn":
|
|
39
43
|
return {
|
|
40
44
|
search: "Søk",
|
|
@@ -53,5 +57,5 @@ const B = ({ onSearch: a }) => {
|
|
|
53
57
|
}
|
|
54
58
|
};
|
|
55
59
|
export {
|
|
56
|
-
|
|
60
|
+
q as GlobalSearch
|
|
57
61
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as c, jsx as
|
|
2
|
+
import { jsxs as c, jsx as s } from "react/jsx-runtime";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { useIsDesktop as i } from "../../hooks/useIsDesktop.js";
|
|
@@ -13,19 +13,19 @@ const v = ({
|
|
|
13
13
|
onClick: t,
|
|
14
14
|
expanded: o
|
|
15
15
|
}) => {
|
|
16
|
-
const { languageCode:
|
|
16
|
+
const { languageCode: a } = l(), { search: r, close: n } = f(a), e = i();
|
|
17
17
|
return /* @__PURE__ */ c(
|
|
18
18
|
m,
|
|
19
19
|
{
|
|
20
20
|
type: "button",
|
|
21
21
|
icon: !e,
|
|
22
|
-
title: o ?
|
|
22
|
+
title: o ? n : r,
|
|
23
23
|
onClick: t,
|
|
24
24
|
"data-color": "neutral",
|
|
25
25
|
className: u.searchButton,
|
|
26
26
|
children: [
|
|
27
|
-
o ? /* @__PURE__ */
|
|
28
|
-
e ?
|
|
27
|
+
o ? /* @__PURE__ */ s(p, { "aria-hidden": "true" }) : /* @__PURE__ */ s(h, { "aria-hidden": "true" }),
|
|
28
|
+
e ? r : null
|
|
29
29
|
]
|
|
30
30
|
}
|
|
31
31
|
);
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { Badge as
|
|
4
|
-
import { ButtonBase as
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import { Badge as g } from "../Badge/Badge.js";
|
|
4
|
+
import { ButtonBase as l } from "../Button/ButtonBase.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import "../RootProvider/RootProvider.js";
|
|
6
|
+
import { useRootContext as c } from "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
import { DigdirLogomark as
|
|
9
|
-
import '../../assets/HeaderLogo2.css';const
|
|
10
|
-
logo:
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
import { DigdirLogomark as p } from "./DigdirLogomark.js";
|
|
9
|
+
import '../../assets/HeaderLogo2.css';const f = "_logo_1d6ig_1", d = {
|
|
10
|
+
logo: f
|
|
11
|
+
}, x = {
|
|
12
|
+
nn: "Gå til framsida",
|
|
13
|
+
en: "Go to homepage"
|
|
14
|
+
}, C = ({ className: r, as: m = "a", href: s = "/", badge: o }) => {
|
|
15
|
+
const { languageCode: e } = c(), i = x[e ?? ""] ?? "Gå til forsiden";
|
|
16
|
+
return /* @__PURE__ */ a(l, { as: m, className: n(d.logo, r), href: s, ariaLabel: i, children: [
|
|
17
|
+
/* @__PURE__ */ t(p, {}),
|
|
18
|
+
o && /* @__PURE__ */ t(g, { ...o })
|
|
19
|
+
] });
|
|
20
|
+
};
|
|
15
21
|
export {
|
|
16
|
-
|
|
22
|
+
C as HeaderLogo
|
|
17
23
|
};
|
|
@@ -1,80 +1,99 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { c as
|
|
4
|
-
import
|
|
5
|
-
import { useIsDesktop as
|
|
6
|
-
import { Badge as
|
|
7
|
-
import { ButtonBase as
|
|
8
|
-
import { ButtonLabel as
|
|
9
|
-
import { ButtonIcon as
|
|
10
|
-
import "../RootProvider/RootProvider.js";
|
|
2
|
+
import { jsxs as u, jsx as r, Fragment as w } from "react/jsx-runtime";
|
|
3
|
+
import { c as p } from "../../index-L8X2o7IH.js";
|
|
4
|
+
import m, { forwardRef as x } from "react";
|
|
5
|
+
import { useIsDesktop as M } from "../../hooks/useIsDesktop.js";
|
|
6
|
+
import { Badge as h } from "../Badge/Badge.js";
|
|
7
|
+
import { ButtonBase as g } from "../Button/ButtonBase.js";
|
|
8
|
+
import { ButtonLabel as _ } from "../Button/ButtonLabel.js";
|
|
9
|
+
import { ButtonIcon as d } from "../Button/ButtonIcon.js";
|
|
10
|
+
import { useRootContext as O } from "../RootProvider/RootProvider.js";
|
|
11
11
|
import "../Snackbar/useSnackbar.js";
|
|
12
|
-
import { S as
|
|
13
|
-
import { u as
|
|
14
|
-
import '../../assets/GlobalMenuButton2.css';var
|
|
12
|
+
import { S as y } from "../../XMark-tKk6aExO.js";
|
|
13
|
+
import { u as I } from "../../useId-BVFxCjkq.js";
|
|
14
|
+
import '../../assets/GlobalMenuButton2.css';var j = function(t, l) {
|
|
15
15
|
var o = {};
|
|
16
16
|
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && l.indexOf(e) < 0 && (o[e] = t[e]);
|
|
17
17
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
18
|
-
for (var
|
|
19
|
-
l.indexOf(e[
|
|
18
|
+
for (var n = 0, e = Object.getOwnPropertySymbols(t); n < e.length; n++)
|
|
19
|
+
l.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[n]) && (o[e[n]] = t[e[n]]);
|
|
20
20
|
return o;
|
|
21
21
|
};
|
|
22
|
-
const
|
|
23
|
-
var { title: o, titleId: e } = t,
|
|
24
|
-
let
|
|
25
|
-
return
|
|
22
|
+
const k = x((t, l) => {
|
|
23
|
+
var { title: o, titleId: e } = t, n = j(t, ["title", "titleId"]);
|
|
24
|
+
let i = I();
|
|
25
|
+
return i = o ? e || "title-" + i : void 0, m.createElement(
|
|
26
26
|
"svg",
|
|
27
|
-
Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: l, "aria-labelledby":
|
|
28
|
-
o ?
|
|
29
|
-
|
|
27
|
+
Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: l, "aria-labelledby": i }, n),
|
|
28
|
+
o ? m.createElement("title", { id: i }, o) : null,
|
|
29
|
+
m.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2.75 6a.75.75 0 0 1 .75-.75h17a.75.75 0 0 1 0 1.5h-17A.75.75 0 0 1 2.75 6m0 6a.75.75 0 0 1 .75-.75h17a.75.75 0 0 1 0 1.5h-17a.75.75 0 0 1-.75-.75m.75 5.25a.75.75 0 0 0 0 1.5h17a.75.75 0 0 0 0-1.5z", clipRule: "evenodd" })
|
|
30
30
|
);
|
|
31
|
-
}),
|
|
32
|
-
button:
|
|
33
|
-
icon:
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
}), B = "_button_rhdbs_1", N = "_icon_rhdbs_25", R = "_iconMobile_rhdbs_31", S = "_badge_rhdbs_37", a = {
|
|
32
|
+
button: B,
|
|
33
|
+
icon: N,
|
|
34
|
+
iconMobile: R,
|
|
35
|
+
badge: S
|
|
36
|
+
}, C = (t) => {
|
|
37
|
+
switch (t) {
|
|
38
|
+
case "nn":
|
|
39
|
+
return {
|
|
40
|
+
close: "Lukk meny"
|
|
41
|
+
};
|
|
42
|
+
case "en":
|
|
43
|
+
return {
|
|
44
|
+
close: "Close menu"
|
|
45
|
+
};
|
|
46
|
+
default:
|
|
47
|
+
return {
|
|
48
|
+
close: "Lukk Meny"
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}, J = ({
|
|
36
52
|
className: t,
|
|
37
53
|
as: l = "button",
|
|
38
54
|
color: o = "accent",
|
|
39
55
|
variant: e = "solid",
|
|
40
|
-
expanded:
|
|
41
|
-
label:
|
|
56
|
+
expanded: n,
|
|
57
|
+
label: i = "Menu",
|
|
42
58
|
badge: c,
|
|
43
|
-
...
|
|
59
|
+
...f
|
|
44
60
|
}) => {
|
|
45
|
-
const
|
|
46
|
-
return
|
|
47
|
-
|
|
61
|
+
const s = M(), { languageCode: v } = O(), { close: b } = C(v);
|
|
62
|
+
return n ? /* @__PURE__ */ u(
|
|
63
|
+
g,
|
|
48
64
|
{
|
|
49
|
-
...
|
|
65
|
+
...f,
|
|
50
66
|
as: l,
|
|
51
67
|
type: "button",
|
|
52
68
|
variant: e,
|
|
53
69
|
color: o,
|
|
54
|
-
className:
|
|
70
|
+
className: p(a.button, t),
|
|
55
71
|
children: [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
72
|
+
s && /* @__PURE__ */ u(w, { children: [
|
|
73
|
+
/* @__PURE__ */ r(d, { icon: /* @__PURE__ */ r(y, { className: a.icon, "aria-label": b }) }),
|
|
74
|
+
/* @__PURE__ */ r(_, { children: i })
|
|
75
|
+
] }),
|
|
76
|
+
!s && /* @__PURE__ */ r(d, { icon: /* @__PURE__ */ r(y, { className: a.iconMobile, "aria-label": b }) }),
|
|
77
|
+
c && /* @__PURE__ */ r(h, { ...c, className: a.badge })
|
|
59
78
|
]
|
|
60
79
|
}
|
|
61
|
-
) : /* @__PURE__ */
|
|
62
|
-
|
|
80
|
+
) : /* @__PURE__ */ u(
|
|
81
|
+
g,
|
|
63
82
|
{
|
|
64
|
-
...
|
|
83
|
+
...f,
|
|
65
84
|
as: l,
|
|
66
85
|
type: "button",
|
|
67
86
|
variant: e,
|
|
68
87
|
color: o,
|
|
69
|
-
className:
|
|
88
|
+
className: p(a.button, t),
|
|
70
89
|
children: [
|
|
71
|
-
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
c && /* @__PURE__ */
|
|
90
|
+
s && /* @__PURE__ */ r(d, { icon: /* @__PURE__ */ r(k, { className: a.icon, "aria-hidden": !0 }) }),
|
|
91
|
+
/* @__PURE__ */ r(_, { children: i }),
|
|
92
|
+
c && /* @__PURE__ */ r(h, { ...c, className: a.badge })
|
|
74
93
|
]
|
|
75
94
|
}
|
|
76
95
|
);
|
|
77
96
|
};
|
|
78
97
|
export {
|
|
79
|
-
|
|
98
|
+
J as GlobalMenuButton
|
|
80
99
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { MenuBase as
|
|
3
|
-
import { MenuItems as
|
|
4
|
-
import { MenuItemsVirtual as
|
|
5
|
-
const
|
|
2
|
+
import { MenuBase as h } from "./MenuBase.js";
|
|
3
|
+
import { MenuItems as w } from "./MenuItems.js";
|
|
4
|
+
import { MenuItemsVirtual as A } from "./MenuItemsVirtual.js";
|
|
5
|
+
const J = ({
|
|
6
6
|
color: m,
|
|
7
7
|
variant: n,
|
|
8
8
|
defaultItemColor: i,
|
|
@@ -11,34 +11,37 @@ const D = ({
|
|
|
11
11
|
defaultIconTheme: o,
|
|
12
12
|
groups: u,
|
|
13
13
|
items: x = [],
|
|
14
|
-
search:
|
|
15
|
-
isVirtualized:
|
|
16
|
-
keyboardEvents:
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
search: j,
|
|
15
|
+
isVirtualized: q,
|
|
16
|
+
keyboardEvents: B,
|
|
17
|
+
scrollRefStyles: f
|
|
18
|
+
}) => q ? /* @__PURE__ */ r(h, { color: m, variant: n, children: /* @__PURE__ */ r(
|
|
19
|
+
A,
|
|
19
20
|
{
|
|
20
|
-
search:
|
|
21
|
+
search: j,
|
|
21
22
|
items: x,
|
|
22
23
|
groups: u,
|
|
23
24
|
defaultItemSize: M,
|
|
24
25
|
defaultItemColor: i,
|
|
25
26
|
defaultItemVariant: p,
|
|
26
27
|
defaultIconTheme: o,
|
|
27
|
-
keyboardEvents:
|
|
28
|
+
keyboardEvents: B,
|
|
29
|
+
scrollRefStyles: f
|
|
28
30
|
}
|
|
29
|
-
) }) : /* @__PURE__ */ r(
|
|
30
|
-
|
|
31
|
+
) }) : /* @__PURE__ */ r(h, { color: m, variant: n, children: /* @__PURE__ */ r(
|
|
32
|
+
w,
|
|
31
33
|
{
|
|
32
|
-
search:
|
|
34
|
+
search: j,
|
|
33
35
|
items: x,
|
|
34
36
|
groups: u,
|
|
35
37
|
defaultItemSize: M,
|
|
36
38
|
defaultItemColor: i,
|
|
37
39
|
defaultItemVariant: p,
|
|
38
40
|
defaultIconTheme: o,
|
|
39
|
-
keyboardEvents:
|
|
41
|
+
keyboardEvents: B,
|
|
42
|
+
scrollRefStyles: f
|
|
40
43
|
}
|
|
41
44
|
) });
|
|
42
45
|
export {
|
|
43
|
-
|
|
46
|
+
J as Menu
|
|
44
47
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { u as
|
|
4
|
-
import { useRef as
|
|
2
|
+
import { jsx as m, jsxs as L } from "react/jsx-runtime";
|
|
3
|
+
import { u as k } from "../../index-D-VWMqlv.js";
|
|
4
|
+
import { useRef as R, useState as A, useEffect as y, useMemo as D } from "react";
|
|
5
5
|
import "../../index-L8X2o7IH.js";
|
|
6
|
-
import { useMenu as
|
|
6
|
+
import { useMenu as K } from "../../hooks/useMenu.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
|
-
import { MenuItem as
|
|
9
|
-
import { MenuSearch as
|
|
10
|
-
import { MenuHeader as
|
|
11
|
-
import { MenuList as
|
|
8
|
+
import { MenuItem as V } from "./MenuItem.js";
|
|
9
|
+
import { MenuSearch as W } from "./MenuSearch.js";
|
|
10
|
+
import { MenuHeader as j } from "./MenuHeader.js";
|
|
11
|
+
import { MenuList as N, MenuListItem as U } from "./MenuBase.js";
|
|
12
12
|
import "../Snackbar/useSnackbar.js";
|
|
13
|
-
import '../../assets/MenuItemsVirtual.css';const
|
|
14
|
-
virtualScrollRef:
|
|
15
|
-
virtualMenuListItem:
|
|
16
|
-
},
|
|
17
|
-
level:
|
|
13
|
+
import '../../assets/MenuItemsVirtual.css';const Y = "_virtualScrollRef_nmoqo_1", F = "_virtualMenuListItem_nmoqo_8", M = {
|
|
14
|
+
virtualScrollRef: Y,
|
|
15
|
+
virtualMenuListItem: F
|
|
16
|
+
}, se = ({
|
|
17
|
+
level: E = 0,
|
|
18
18
|
search: g,
|
|
19
19
|
items: z,
|
|
20
20
|
groups: T = {},
|
|
@@ -22,83 +22,87 @@ import '../../assets/MenuItemsVirtual.css';const U = "_virtualScrollRef_nmoqo_1"
|
|
|
22
22
|
defaultItemColor: b,
|
|
23
23
|
defaultItemVariant: q,
|
|
24
24
|
defaultIconTheme: $,
|
|
25
|
-
keyboardEvents: f
|
|
25
|
+
keyboardEvents: f,
|
|
26
|
+
scrollRefStyles: H
|
|
26
27
|
}) => {
|
|
27
|
-
var
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
var w;
|
|
29
|
+
const c = R(null), x = (w = c.current) == null ? void 0 : w.getBoundingClientRect().top, [S, B] = A(window.innerHeight);
|
|
30
|
+
y(() => {
|
|
30
31
|
const n = () => {
|
|
31
|
-
|
|
32
|
+
B(window.innerHeight);
|
|
32
33
|
};
|
|
33
34
|
return window.addEventListener("resize", n), () => {
|
|
34
35
|
window.removeEventListener("resize", n);
|
|
35
36
|
};
|
|
36
37
|
}, []);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const I = D(() => x && S - x - 8 || 400, [S, x]), C = {
|
|
39
|
+
...{
|
|
40
|
+
maxHeight: I <= 300 ? 300 : I
|
|
41
|
+
},
|
|
42
|
+
...H
|
|
43
|
+
}, { menu: _ } = K({
|
|
40
44
|
items: z,
|
|
41
45
|
groups: T,
|
|
42
46
|
groupByKey: "groupId",
|
|
43
47
|
keyboardEvents: f,
|
|
44
|
-
ref:
|
|
45
|
-
}), v =
|
|
48
|
+
ref: c
|
|
49
|
+
}), v = _.flatMap((n, t) => {
|
|
46
50
|
var i;
|
|
47
|
-
const e = (n == null ? void 0 : n.props) || {}, { title: r } = e,
|
|
48
|
-
var
|
|
49
|
-
return !((
|
|
51
|
+
const e = (n == null ? void 0 : n.props) || {}, { title: r } = e, a = ((i = n == null ? void 0 : n.items) == null ? void 0 : i.filter((s) => {
|
|
52
|
+
var l;
|
|
53
|
+
return !((l = s.props) != null && l.hidden);
|
|
50
54
|
})) || [];
|
|
51
55
|
return [
|
|
52
|
-
...t > 0 ||
|
|
56
|
+
...t > 0 || E > 0 ? [{ type: "separator" }] : [],
|
|
53
57
|
...r ? [{ type: "title", title: r }] : [],
|
|
54
|
-
...
|
|
58
|
+
...a.map((s, l) => {
|
|
55
59
|
var p, o;
|
|
56
60
|
return {
|
|
57
61
|
type: "item",
|
|
58
62
|
itemProps: s.props || {},
|
|
59
63
|
active: s.active,
|
|
60
64
|
hasChildren: ((p = s.props) == null ? void 0 : p.expanded) && ((o = s.props) == null ? void 0 : o.items),
|
|
61
|
-
isLastItem:
|
|
65
|
+
isLastItem: l === a.length - 1
|
|
62
66
|
};
|
|
63
67
|
})
|
|
64
68
|
];
|
|
65
|
-
}), d =
|
|
69
|
+
}), d = k({
|
|
66
70
|
count: v.length,
|
|
67
71
|
gap: 8,
|
|
68
72
|
estimateSize: () => 44,
|
|
69
|
-
getScrollElement: () =>
|
|
73
|
+
getScrollElement: () => c.current
|
|
70
74
|
}), h = d.getVirtualItems();
|
|
71
|
-
|
|
75
|
+
y(() => {
|
|
72
76
|
var n, t, e;
|
|
73
77
|
for (const r of h) {
|
|
74
|
-
const
|
|
75
|
-
|
|
78
|
+
const a = ((n = c.current) == null ? void 0 : n.querySelector(`[data-index="${r.index}"]`)) ?? ((t = c.current) == null ? void 0 : t.querySelector(`[dataindex="${r.index}"]`)) ?? ((e = c.current) == null ? void 0 : e.querySelector(`[dataIndex="${r.index}"]`));
|
|
79
|
+
a && d.measureElement(a);
|
|
76
80
|
}
|
|
77
81
|
}, [h]);
|
|
78
|
-
const u =
|
|
79
|
-
return
|
|
82
|
+
const u = R(!1);
|
|
83
|
+
return y(() => {
|
|
80
84
|
const n = (r) => {
|
|
81
85
|
(r.key === "ArrowDown" || r.key === "ArrowUp") && (u.current = !0);
|
|
82
86
|
}, t = () => {
|
|
83
87
|
u.current = !1;
|
|
84
88
|
};
|
|
85
89
|
document.addEventListener("keydown", n, !0);
|
|
86
|
-
const e =
|
|
90
|
+
const e = c.current;
|
|
87
91
|
return e == null || e.addEventListener("wheel", t, { passive: !0 }), e == null || e.addEventListener("mousedown", t, !0), e == null || e.addEventListener("mousemove", t, !0), e == null || e.addEventListener("touchstart", t, { passive: !0 }), () => {
|
|
88
92
|
document.removeEventListener("keydown", n, !0), e == null || e.removeEventListener("wheel", t), e == null || e.removeEventListener("mousedown", t), e == null || e.removeEventListener("mousemove", t), e == null || e.removeEventListener("touchstart", t);
|
|
89
93
|
};
|
|
90
|
-
}, []),
|
|
94
|
+
}, []), y(() => {
|
|
91
95
|
if (!f || !u.current) return;
|
|
92
|
-
const n =
|
|
96
|
+
const n = c.current;
|
|
93
97
|
if (!n) return;
|
|
94
98
|
const t = 6, e = v.findIndex((o) => o.type === "item" && o.active);
|
|
95
99
|
if (e < 0) return;
|
|
96
|
-
const r = (o) => (n.querySelector(`[data-index="${o}"]`) || n.querySelector(`[dataindex="${o}"]`) || n.querySelector(`[dataIndex="${o}"]`)) ?? null,
|
|
97
|
-
if (!
|
|
100
|
+
const r = (o) => (n.querySelector(`[data-index="${o}"]`) || n.querySelector(`[dataindex="${o}"]`) || n.querySelector(`[dataIndex="${o}"]`)) ?? null, a = r(e);
|
|
101
|
+
if (!a) {
|
|
98
102
|
d.scrollToIndex(e, { align: "auto" }), u.current = !1;
|
|
99
103
|
return;
|
|
100
104
|
}
|
|
101
|
-
const i = n.getBoundingClientRect(), s =
|
|
105
|
+
const i = n.getBoundingClientRect(), s = a.getBoundingClientRect(), l = r(e - 1), p = r(e + 1);
|
|
102
106
|
if (p) {
|
|
103
107
|
const o = p.getBoundingClientRect();
|
|
104
108
|
if (o.bottom > i.bottom) {
|
|
@@ -106,16 +110,16 @@ import '../../assets/MenuItemsVirtual.css';const U = "_virtualScrollRef_nmoqo_1"
|
|
|
106
110
|
return;
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
|
-
if (
|
|
110
|
-
const o =
|
|
113
|
+
if (l) {
|
|
114
|
+
const o = l.getBoundingClientRect();
|
|
111
115
|
if (o.top < i.top) {
|
|
112
116
|
n.scrollTop -= i.top - o.top + t, u.current = !1;
|
|
113
117
|
return;
|
|
114
118
|
}
|
|
115
119
|
}
|
|
116
120
|
s.top < i.top + t ? n.scrollTop -= i.top + t - s.top : s.bottom > i.bottom - t && (n.scrollTop += s.bottom - (i.bottom - t)), u.current = !1;
|
|
117
|
-
}, [v, f, d]), /* @__PURE__ */
|
|
118
|
-
g && /* @__PURE__ */
|
|
121
|
+
}, [v, f, d]), /* @__PURE__ */ m(N, { children: /* @__PURE__ */ L("div", { ref: c, className: M.virtualScrollRef, style: C, children: [
|
|
122
|
+
g && /* @__PURE__ */ m(
|
|
119
123
|
"div",
|
|
120
124
|
{
|
|
121
125
|
style: {
|
|
@@ -124,10 +128,10 @@ import '../../assets/MenuItemsVirtual.css';const U = "_virtualScrollRef_nmoqo_1"
|
|
|
124
128
|
zIndex: 10,
|
|
125
129
|
marginTop: "-0.5rem"
|
|
126
130
|
},
|
|
127
|
-
children: /* @__PURE__ */
|
|
131
|
+
children: /* @__PURE__ */ m(W, { ...g })
|
|
128
132
|
}
|
|
129
133
|
),
|
|
130
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ m(
|
|
131
135
|
"div",
|
|
132
136
|
{
|
|
133
137
|
style: {
|
|
@@ -136,17 +140,17 @@ import '../../assets/MenuItemsVirtual.css';const U = "_virtualScrollRef_nmoqo_1"
|
|
|
136
140
|
},
|
|
137
141
|
children: h.map((n) => {
|
|
138
142
|
const t = v[n.index];
|
|
139
|
-
return t ? /* @__PURE__ */
|
|
140
|
-
|
|
143
|
+
return t ? /* @__PURE__ */ L(
|
|
144
|
+
U,
|
|
141
145
|
{
|
|
142
146
|
dataIndex: n.index,
|
|
143
|
-
className:
|
|
147
|
+
className: M.virtualMenuListItem,
|
|
144
148
|
style: { transform: `translateY(${n.start}px)` },
|
|
145
149
|
role: t.type === "separator" ? "separator" : void 0,
|
|
146
150
|
children: [
|
|
147
|
-
t.type === "title" && /* @__PURE__ */
|
|
148
|
-
t.type === "item" && /* @__PURE__ */
|
|
149
|
-
|
|
151
|
+
t.type === "title" && /* @__PURE__ */ m(j, { title: t.title }),
|
|
152
|
+
t.type === "item" && /* @__PURE__ */ m(
|
|
153
|
+
V,
|
|
150
154
|
{
|
|
151
155
|
...t.itemProps,
|
|
152
156
|
size: t.itemProps.size || P,
|
|
@@ -167,5 +171,5 @@ import '../../assets/MenuItemsVirtual.css';const U = "_virtualScrollRef_nmoqo_1"
|
|
|
167
171
|
] }) });
|
|
168
172
|
};
|
|
169
173
|
export {
|
|
170
|
-
|
|
174
|
+
se as MenuItemsVirtual
|
|
171
175
|
};
|
|
@@ -18,4 +18,4 @@ export interface AccountMenuProps extends MenuProps {
|
|
|
18
18
|
scrollRefStyles?: CSSProperties;
|
|
19
19
|
keyboardEvents?: boolean;
|
|
20
20
|
}
|
|
21
|
-
export declare const AccountMenu: ({ items, groups, search, filterAccount, onSelectAccount, currentAccount, isVirtualized, keyboardEvents, }: AccountMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const AccountMenu: ({ items, groups, search, filterAccount, onSelectAccount, currentAccount, isVirtualized, keyboardEvents, scrollRefStyles, }: AccountMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AccountMenuProps } from '..';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ items, groups, search, filterAccount, onSelectAccount, currentAccount, isVirtualized, keyboardEvents, }: AccountMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: ({ items, groups, search, filterAccount, onSelectAccount, currentAccount, isVirtualized, keyboardEvents, scrollRefStyles, }: AccountMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {};
|
|
7
7
|
args: AccountMenuProps;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export interface SymbolProps {
|
|
2
2
|
className?: string;
|
|
3
3
|
title?: string;
|
|
4
|
+
'aria-hidden'?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare const DigdirLogomark: ({ className, title }: SymbolProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const DigdirLogomark: ({ className, title, "aria-hidden": ariaHidden }: SymbolProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -25,3 +25,4 @@ export declare const ForcedFullScreenAccountSelection: () => import("react/jsx-r
|
|
|
25
25
|
export declare const WithCustomBadge: () => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
export declare const Loading: () => import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
export declare const LoadingWithForcedFullScreenAccountSelection: () => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const WithVirtualizationEnabled: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HeaderLogoProps, MenuProps } from '../';
|
|
2
2
|
import { BadgeProps } from '../Badge';
|
|
3
|
-
import { GlobalMenuProps_old, Account } from '../GlobalMenu_old
|
|
3
|
+
import { GlobalMenuProps_old, Account } from '../GlobalMenu_old';
|
|
4
4
|
import { SearchbarProps } from '../Searchbar';
|
|
5
5
|
import { LocaleSwitcherProps } from './';
|
|
6
6
|
export interface HeaderProps {
|
|
@@ -7,4 +7,4 @@ export interface MenuProps extends MenuItemsProps {
|
|
|
7
7
|
isVirtualized?: boolean;
|
|
8
8
|
keyboardEvents?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare const Menu: ({ color, variant, defaultItemColor, defaultItemVariant, defaultItemSize, defaultIconTheme, groups, items, search, isVirtualized, keyboardEvents, }: MenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const Menu: ({ color, variant, defaultItemColor, defaultItemVariant, defaultItemSize, defaultIconTheme, groups, items, search, isVirtualized, keyboardEvents, scrollRefStyles, }: MenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ color, variant, defaultItemColor, defaultItemVariant, defaultItemSize, defaultIconTheme, groups, items, search, isVirtualized, keyboardEvents, }: import('./Menu').MenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: ({ color, variant, defaultItemColor, defaultItemVariant, defaultItemSize, defaultIconTheme, groups, items, search, isVirtualized, keyboardEvents, scrollRefStyles, }: import('./Menu').MenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
parameters: {};
|
|
6
6
|
args: {};
|
|
7
7
|
};
|
|
@@ -23,5 +23,6 @@ export interface MenuItemsProps {
|
|
|
23
23
|
as?: ElementType;
|
|
24
24
|
keyboardEvents?: boolean;
|
|
25
25
|
onSelect?: () => void;
|
|
26
|
+
scrollRefStyles?: React.CSSProperties;
|
|
26
27
|
}
|
|
27
28
|
export declare const MenuItems: ({ level, expanded, search, items, groups, defaultItemSize, defaultItemColor, defaultItemVariant, defaultIconTheme, as, keyboardEvents, onSelect, }: MenuItemsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MenuItemsProps } from './MenuItems';
|
|
2
|
-
export declare const MenuItemsVirtual: ({ level, search, items, groups, defaultItemSize, defaultItemColor, defaultItemVariant, defaultIconTheme, keyboardEvents, }: MenuItemsProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const MenuItemsVirtual: ({ level, search, items, groups, defaultItemSize, defaultItemColor, defaultItemVariant, defaultIconTheme, keyboardEvents, scrollRefStyles: externalScrollRefStyles, }: MenuItemsProps) => import("react/jsx-runtime").JSX.Element;
|