@altinn/altinn-components 0.46.4 → 0.46.5

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,11 +1,11 @@
1
1
  "use client";
2
- import { jsx as c } from "react/jsx-runtime";
3
- import { useState as x, useEffect as R } from "react";
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 S } from "../Menu/Menu.js";
6
+ import { Menu as j } from "../Menu/Menu.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
- const j = (d) => `${d} hits`, B = ({
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] = x("");
28
- R(() => {
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 F = C || ((o, a) => {
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) => F(o, l)).map((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, b = l ? {
40
+ })) : p, I = l ? {
40
41
  search: {
41
- title: ((r = t == null ? void 0 : t.getResultsLabel) == null ? void 0 : r.call(t, n.length)) ?? j(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, I = {
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
- }, M = [
50
+ }, c = [
50
51
  ...n.length > 0 ? n : [{ id: "search", groupId: "search", hidden: !0 }]
51
52
  ];
52
- return /* @__PURE__ */ c(
53
- S,
53
+ return /* @__PURE__ */ x(
54
+ j,
54
55
  {
55
56
  variant: "default",
56
- search: t && !t.hidden ? I : void 0,
57
- groups: b,
58
- items: M,
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
- B as AccountMenu
67
+ D as AccountMenu
66
68
  };
@@ -1,16 +1,16 @@
1
1
  "use client";
2
- import { jsx as o, jsxs as O } from "react/jsx-runtime";
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 j, useEffect as z } from "react";
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 M } from "../../Heading-By5DKz2H.js";
11
+ import { H as R } from "../../Heading-By5DKz2H.js";
12
12
  import { u as _ } from "../../useId-BVFxCjkq.js";
13
- import '../../assets/AccountSelector.css';var R = function(e, i) {
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 = R(e, ["title", "titleId"]);
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
- }), B = "_accountSelector_1f74n_1", H = "_heading_1f74n_11", V = "_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: B,
50
- heading: H,
51
- searchSection: V,
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(), a = n === "accountFullscreen", [f, m] = j(""), { minimize: b, fullscreen: w, searchText: h, heading: y } = q(S);
60
- z(() => {
61
- i === !0 && !a && l("accountFullscreen");
62
- }, [i, a, l]);
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(a ? "account" : "accountFullscreen");
64
+ l(o ? "account" : "accountFullscreen");
65
65
  }, I = (d) => {
66
66
  var p;
67
- (p = e.onSelectAccount) == null || p.call(e, d), u(a ? "accountFullscreen" : "account");
67
+ (p = e.onSelectAccount) == null || p.call(e, d), u(o ? "accountFullscreen" : "account");
68
68
  };
69
- return t ? /* @__PURE__ */ o(N, { "aria-hidden": !0, "data-color": "neutral", className: c.spinner }) : /* @__PURE__ */ O("div", { className: g(r, c.accountSelector), children: [
70
- a && /* @__PURE__ */ o(M, { "data-size": "md", level: 2, className: c.heading, children: y }),
71
- /* @__PURE__ */ o("div", { className: c.searchSection, children: /* @__PURE__ */ o(
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__ */ o(
82
+ /* @__PURE__ */ a(
83
83
  "div",
84
84
  {
85
85
  className: g(
86
86
  c.accountMenu,
87
- a && c.fullScreen,
87
+ o && c.fullScreen,
88
88
  e.isVirtualized && c.virtualized
89
89
  ),
90
- children: /* @__PURE__ */ o(
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__ */ o(
102
+ i !== !0 && /* @__PURE__ */ a(
102
103
  E,
103
104
  {
104
- icon: a ? /* @__PURE__ */ o(T, { className: c.btnIcon, "aria-hidden": "true" }) : /* @__PURE__ */ o(P, { className: c.btnIcon, "aria-hidden": "true" }),
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: a ? b : w
108
+ children: o ? b : y
108
109
  }
109
110
  )
110
111
  ] });
@@ -1,8 +1,8 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { MenuBase as s } from "./MenuBase.js";
3
- import { MenuItems as c } from "./MenuItems.js";
4
- import { MenuItemsVirtual as h } from "./MenuItemsVirtual.js";
5
- const D = ({
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: f,
15
- isVirtualized: B,
16
- keyboardEvents: j
17
- }) => B ? /* @__PURE__ */ r(s, { color: m, variant: n, children: /* @__PURE__ */ r(
18
- h,
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: f,
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: j
28
+ keyboardEvents: B,
29
+ scrollRefStyles: f
28
30
  }
29
- ) }) : /* @__PURE__ */ r(s, { color: m, variant: n, children: /* @__PURE__ */ r(
30
- c,
31
+ ) }) : /* @__PURE__ */ r(h, { color: m, variant: n, children: /* @__PURE__ */ r(
32
+ w,
31
33
  {
32
- search: f,
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: j
41
+ keyboardEvents: B,
42
+ scrollRefStyles: f
40
43
  }
41
44
  ) });
42
45
  export {
43
- D as Menu
46
+ J as Menu
44
47
  };
@@ -1,20 +1,20 @@
1
1
  "use client";
2
- import { jsx as l, jsxs as S } from "react/jsx-runtime";
3
- import { u as _ } from "../../index-D-VWMqlv.js";
4
- import { useRef as M, useState as k, useEffect as x, useMemo as A } from "react";
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 D } from "../../hooks/useMenu.js";
6
+ import { useMenu as K } from "../../hooks/useMenu.js";
7
7
  import "../RootProvider/RootProvider.js";
8
- import { MenuItem as K } from "./MenuItem.js";
9
- import { MenuSearch as V } from "./MenuSearch.js";
10
- import { MenuHeader as W } from "./MenuHeader.js";
11
- import { MenuList as j, MenuListItem as N } from "./MenuBase.js";
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 U = "_virtualScrollRef_nmoqo_1", Y = "_virtualMenuListItem_nmoqo_8", E = {
14
- virtualScrollRef: U,
15
- virtualMenuListItem: Y
16
- }, re = ({
17
- level: R = 0,
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 L;
28
- const a = M(null), y = (L = a.current) == null ? void 0 : L.getBoundingClientRect().top, [I, H] = k(window.innerHeight);
29
- x(() => {
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
- H(window.innerHeight);
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 w = A(() => y && I - y - 8 || 400, [I, y]), B = {
38
- maxHeight: w <= 300 ? 300 : w
39
- }, { menu: C } = D({
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: a
45
- }), v = C.flatMap((n, t) => {
48
+ ref: c
49
+ }), v = _.flatMap((n, t) => {
46
50
  var i;
47
- const e = (n == null ? void 0 : n.props) || {}, { title: r } = e, c = ((i = n == null ? void 0 : n.items) == null ? void 0 : i.filter((s) => {
48
- var m;
49
- return !((m = s.props) != null && m.hidden);
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 || R > 0 ? [{ type: "separator" }] : [],
56
+ ...t > 0 || E > 0 ? [{ type: "separator" }] : [],
53
57
  ...r ? [{ type: "title", title: r }] : [],
54
- ...c.map((s, m) => {
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: m === c.length - 1
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: () => a.current
73
+ getScrollElement: () => c.current
70
74
  }), h = d.getVirtualItems();
71
- x(() => {
75
+ y(() => {
72
76
  var n, t, e;
73
77
  for (const r of h) {
74
- const c = ((n = a.current) == null ? void 0 : n.querySelector(`[data-index="${r.index}"]`)) ?? ((t = a.current) == null ? void 0 : t.querySelector(`[dataindex="${r.index}"]`)) ?? ((e = a.current) == null ? void 0 : e.querySelector(`[dataIndex="${r.index}"]`));
75
- c && d.measureElement(c);
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 = M(!1);
79
- return x(() => {
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 = a.current;
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
- }, []), x(() => {
94
+ }, []), y(() => {
91
95
  if (!f || !u.current) return;
92
- const n = a.current;
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, c = r(e);
97
- if (!c) {
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 = c.getBoundingClientRect(), m = r(e - 1), p = r(e + 1);
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 (m) {
110
- const o = m.getBoundingClientRect();
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__ */ l(j, { children: /* @__PURE__ */ S("div", { ref: a, className: E.virtualScrollRef, style: B, children: [
118
- g && /* @__PURE__ */ l(
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__ */ l(V, { ...g })
131
+ children: /* @__PURE__ */ m(W, { ...g })
128
132
  }
129
133
  ),
130
- /* @__PURE__ */ l(
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__ */ S(
140
- N,
143
+ return t ? /* @__PURE__ */ L(
144
+ U,
141
145
  {
142
146
  dataIndex: n.index,
143
- className: E.virtualMenuListItem,
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__ */ l(W, { title: t.title }),
148
- t.type === "item" && /* @__PURE__ */ l(
149
- K,
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
- re as MenuItemsVirtual
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;
@@ -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;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.46.4",
3
+ "version": "0.46.5",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",