@altinn/altinn-components 0.56.11 → 0.56.12

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
- ._virtualScrollRef_6cuj6_1{height:100vh;overflow-y:auto;overflow-x:hidden;padding:0 .5rem;margin:0 -.5rem}._virtualList_6cuj6_9{list-style-type:none;padding:0;margin:0}._virtualListItem_6cuj6_15{position:absolute;top:0;left:0;width:100%}._virtualListItem_6cuj6_15:focus-within,._virtualListItem_6cuj6_15:has([aria-expanded=true]){z-index:20}._virtualListItem_6cuj6_15>*{margin:0}._lastChild_6cuj6_31{padding-bottom:1rem}._virtualTitleItem_6cuj6_35{position:absolute;top:0;left:0;width:100%;padding-top:1rem;padding-bottom:1rem}._virtualTitleItem_6cuj6_35:first-child{padding-top:0}
1
+ ._virtualScrollRef_1ahkg_1{height:100vh;overflow-y:auto;overflow-x:hidden;padding:0 .5rem;margin:0 -.5rem}._virtualList_1ahkg_9{list-style-type:none;padding:0;margin:0;isolation:isolate}._virtualListItem_1ahkg_16{position:absolute;top:0;left:0;width:100%}._virtualListItem_1ahkg_16:focus-within,._virtualListItem_1ahkg_16:has([aria-expanded=true]){z-index:20}._virtualListItem_1ahkg_16>*{margin:0}._lastChild_1ahkg_32{padding-bottom:1rem}._virtualTitleItem_1ahkg_36{position:absolute;top:0;left:0;width:100%;padding-top:1rem;padding-bottom:1rem}._virtualTitleItem_1ahkg_36:first-child{padding-top:0}
@@ -1,39 +1,39 @@
1
1
  "use client";
2
2
  import { jsx as i } from "react/jsx-runtime";
3
3
  import { u as y } from "../../useMenuVirtualization-Cs426RCN.js";
4
- import { useRef as I, useEffect as h } from "react";
4
+ import { useRef as h, useEffect as I } from "react";
5
5
  import "../../index-p1eeF8LQ.js";
6
6
  import { AccountListItem as v } from "./AccountListItem.js";
7
7
  import { useMenu as x } from "../../hooks/useMenu.js";
8
- import { Heading as _ } from "../Typography/Heading.js";
8
+ import { Heading as g } from "../Typography/Heading.js";
9
9
  import "../Button/Button.js";
10
10
  import "react-dom";
11
11
  import "../RootProvider/RootProvider.js";
12
12
  import "../Snackbar/useSnackbar.js";
13
- import { Section as L } from "../Page/Section.js";
14
- import '../../assets/AccountListVirtual.css';const g = "_virtualScrollRef_6cuj6_1", S = "_virtualList_6cuj6_9", $ = "_virtualListItem_6cuj6_15", C = "_lastChild_6cuj6_31", P = "_virtualTitleItem_6cuj6_35", l = {
15
- virtualScrollRef: g,
13
+ import { Section as _ } from "../Page/Section.js";
14
+ import '../../assets/AccountListVirtual.css';const L = "_virtualScrollRef_1ahkg_1", S = "_virtualList_1ahkg_9", k = "_virtualListItem_1ahkg_16", $ = "_lastChild_1ahkg_32", C = "_virtualTitleItem_1ahkg_36", l = {
15
+ virtualScrollRef: L,
16
16
  virtualList: S,
17
- virtualListItem: $,
18
- lastChild: C,
19
- virtualTitleItem: P
17
+ virtualListItem: k,
18
+ lastChild: $,
19
+ virtualTitleItem: C
20
20
  }, B = ({ items: u, groups: p = {}, sortGroupBy: d }) => {
21
- const s = I(null), { menu: f } = x({
21
+ const s = h(null), { menu: f } = x({
22
22
  items: u,
23
23
  groups: p,
24
24
  groupByKey: "groupId",
25
25
  keyboardEvents: !1,
26
26
  sortGroupBy: d
27
27
  }), n = f.flatMap((t) => {
28
- const e = t?.props || {}, { title: r } = e, o = t?.items || [];
28
+ const e = t?.props || {}, { title: r } = e, a = t?.items || [];
29
29
  return [
30
30
  ...r ? [{ type: "title", title: r }] : [],
31
- ...o.map((m) => ({
31
+ ...a.map((c) => ({
32
32
  type: "item",
33
- itemProps: m.props || {}
33
+ itemProps: c.props || {}
34
34
  }))
35
35
  ];
36
- }), a = y({
36
+ }), o = y({
37
37
  count: n.length,
38
38
  useAnimationFrameWithResizeObserver: !0,
39
39
  gap: 8,
@@ -45,21 +45,21 @@ import '../../assets/AccountListVirtual.css';const g = "_virtualScrollRef_6cuj6_
45
45
  return e.itemProps?.parentId && (!r || r.type === "title" || r.type === "item" && !r.itemProps?.parentId) ? 96 : 80;
46
46
  },
47
47
  getScrollElement: () => s.current
48
- }), c = a.getVirtualItems();
49
- return h(() => {
50
- for (const t of c) {
48
+ }), m = o.getVirtualItems();
49
+ return I(() => {
50
+ for (const t of m) {
51
51
  const e = s.current?.querySelector(`[data-index="${t.index}"]`) ?? s.current?.querySelector(`[dataindex="${t.index}"]`) ?? s.current?.querySelector(`[dataIndex="${t.index}"]`);
52
- e && a.measureElement(e);
52
+ e && o.measureElement(e);
53
53
  }
54
- }, [c]), /* @__PURE__ */ i(L, { spacing: 6, children: /* @__PURE__ */ i("div", { ref: s, className: l.virtualScrollRef, children: /* @__PURE__ */ i(
54
+ }, [m]), /* @__PURE__ */ i(_, { spacing: 6, children: /* @__PURE__ */ i("div", { ref: s, className: l.virtualScrollRef, children: /* @__PURE__ */ i(
55
55
  "ul",
56
56
  {
57
57
  className: l.virtualList,
58
58
  style: {
59
59
  position: "relative",
60
- height: `${a.getTotalSize()}px`
60
+ height: `${o.getTotalSize()}px`
61
61
  },
62
- children: c.map((t) => {
62
+ children: m.map((t) => {
63
63
  const e = n[t.index];
64
64
  if (!e) return null;
65
65
  if (e.type === "title")
@@ -69,17 +69,17 @@ import '../../assets/AccountListVirtual.css';const g = "_virtualScrollRef_6cuj6_
69
69
  "data-index": t.index,
70
70
  className: l.virtualTitleItem,
71
71
  style: { transform: `translateY(${t.start}px)` },
72
- children: /* @__PURE__ */ i(_, { size: "lg", children: e.title })
72
+ children: /* @__PURE__ */ i(g, { size: "lg", children: e.title })
73
73
  },
74
74
  t.key
75
75
  );
76
76
  if (e.type === "item") {
77
- const r = n[t.index + 1], o = e.itemProps?.parentId && (!r || r.type === "title" || r.type === "item" && !r.itemProps?.parentId);
77
+ const r = n[t.index + 1], a = e.itemProps?.parentId && (!r || r.type === "title" || r.type === "item" && !r.itemProps?.parentId);
78
78
  return /* @__PURE__ */ i(
79
79
  "li",
80
80
  {
81
81
  "data-index": t.index,
82
- className: `${l.virtualListItem} ${o ? l.lastChild : ""}`,
82
+ className: `${l.virtualListItem} ${a ? l.lastChild : ""}`,
83
83
  style: { transform: `translateY(${t.start}px)` },
84
84
  children: /* @__PURE__ */ i(v, { ...e.itemProps, containerAs: "div" })
85
85
  },
@@ -1,69 +1,69 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { useRef as G, useEffect as H } from "react";
2
+ import { useRef as q, useEffect as G } from "react";
3
3
  import "../../index-p1eeF8LQ.js";
4
4
  import "../Button/Button.js";
5
- import { M as J } from "../../SearchField-CYYz0JvC.js";
6
- import { useDropdownMenuController as K } from "../Menu/useDropdownMenuController.js";
5
+ import { M as H } from "../../SearchField-CYYz0JvC.js";
6
+ import { useDropdownMenuController as J } from "../Menu/useDropdownMenuController.js";
7
7
  import "../RootProvider/RootProvider.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
- import { Dropdown as C } from "../Dropdown/Dropdown.js";
10
- import { ToolbarFilterButton as F } from "./ToolbarFilterButton.js";
9
+ import { Dropdown as F } from "../Dropdown/Dropdown.js";
10
+ import { ToolbarFilterButton as P } from "./ToolbarFilterButton.js";
11
11
  const S = ({
12
- as: P,
12
+ as: E,
13
13
  size: a,
14
14
  name: o,
15
15
  label: f = "",
16
- searchable: m,
16
+ searchable: d,
17
17
  groups: p,
18
18
  items: g,
19
- removable: E,
20
- removeLabel: V = "Fjern filter",
19
+ removable: j,
20
+ removeLabel: D = "Fjern filter",
21
21
  filterState: c,
22
22
  onFilterStateChange: v,
23
- onFilterChange: j,
23
+ onFilterChange: O,
24
24
  onRemove: h,
25
25
  open: t,
26
26
  onToggle: y,
27
- onClose: d,
27
+ onClose: m,
28
28
  submitLabel: b,
29
29
  search: k,
30
30
  virtualized: w,
31
31
  title: I,
32
- variant: D,
33
- dropdownSize: x = "sm"
32
+ variant: x,
33
+ dropdownSize: A = "sm"
34
34
  }) => {
35
- const M = G(t), e = K({ id: "toolbar-filter-menu" });
36
- H(() => {
35
+ const M = q(t), e = J({ id: "toolbar-filter-menu" });
36
+ G(() => {
37
37
  const r = M.current;
38
38
  M.current = t, r && !t && e?.triggerRef?.current?.focus();
39
39
  }, [t, e.triggerRef]);
40
- const O = (r) => {
41
- const i = r.target.type, l = r.target.name, q = r.target.value;
42
- j?.(i, l, q), i === "radio" && d();
43
- }, u = g?.map((r) => ({
40
+ const V = (r) => {
41
+ const i = r.target.type, u = r.target.name, T = r.target.value;
42
+ O?.(i, u, T), i === "radio" && m();
43
+ }, l = g?.map((r) => ({
44
44
  ...r,
45
- onChange: (i) => O(i)
46
- })), B = (g?.filter((r) => r.checked)?.map((r) => r.value || "true")).length > 0 || c?.[o]?.length, A = D || B ? "tinted" : "outline", R = P || J, s = m ? "combobox" : "menu", T = () => {
47
- d();
45
+ onChange: (i) => V(i)
46
+ })), R = (g?.filter((r) => r.checked)?.map((r) => r.value || "true")).length > 0 || c?.[o]?.length ? "tinted" : "outline", C = E || H, s = d ? "combobox" : "menu", B = () => {
47
+ m();
48
48
  const r = c?.[o]?.[0];
49
- u?.filter((l) => l.checked)?.length === 0 && !r && h?.();
49
+ l?.filter((u) => u.checked)?.length === 0 && !r && h?.();
50
50
  };
51
- return E ? /* @__PURE__ */ n(
52
- C,
51
+ return j ? /* @__PURE__ */ n(
52
+ F,
53
53
  {
54
54
  submitLabel: b,
55
55
  title: I,
56
56
  variant: "drawer-dropdown",
57
- size: x,
57
+ size: A,
58
58
  trigger: /* @__PURE__ */ n(
59
- F,
59
+ P,
60
60
  {
61
61
  name: o,
62
62
  onClick: y,
63
63
  onRemove: h,
64
64
  removable: !0,
65
- variant: A,
66
- removeLabel: V,
65
+ variant: x || R,
66
+ removeLabel: D,
67
67
  open: t,
68
68
  "aria-expanded": t,
69
69
  "aria-controls": e.menuId,
@@ -72,10 +72,10 @@ const S = ({
72
72
  }
73
73
  ),
74
74
  open: t,
75
- onClose: T,
75
+ onClose: B,
76
76
  ...e.dropdownA11yProps,
77
77
  children: /* @__PURE__ */ n(
78
- R,
78
+ C,
79
79
  {
80
80
  open: t,
81
81
  search: k,
@@ -83,9 +83,9 @@ const S = ({
83
83
  filterState: c,
84
84
  onFilterStateChange: v,
85
85
  size: a,
86
- searchable: m,
86
+ searchable: d,
87
87
  groups: p,
88
- items: u,
88
+ items: l,
89
89
  keyboardEvents: t,
90
90
  a11yMode: s,
91
91
  ...s === "combobox" ? { id: e.menuId } : e.menuA11yProps,
@@ -94,27 +94,27 @@ const S = ({
94
94
  )
95
95
  }
96
96
  ) : /* @__PURE__ */ n(
97
- C,
97
+ F,
98
98
  {
99
- size: x,
99
+ size: A,
100
100
  title: I,
101
101
  variant: "drawer-dropdown",
102
102
  submitLabel: b,
103
- trigger: /* @__PURE__ */ n(F, { name: o, onClick: y, variant: A, children: f }),
103
+ trigger: /* @__PURE__ */ n(P, { name: o, onClick: y, variant: x || R, children: f }),
104
104
  open: t,
105
- onClose: d,
105
+ onClose: m,
106
106
  ...e.dropdownA11yProps,
107
107
  children: /* @__PURE__ */ n(
108
- R,
108
+ C,
109
109
  {
110
110
  search: k,
111
111
  name: o,
112
112
  filterState: c,
113
113
  onFilterStateChange: v,
114
114
  size: a,
115
- searchable: m,
115
+ searchable: d,
116
116
  groups: p,
117
- items: u,
117
+ items: l,
118
118
  keyboardEvents: t,
119
119
  a11yMode: s,
120
120
  ...s === "combobox" ? { id: e.menuId } : e.menuA11yProps,
@@ -11,15 +11,15 @@ import { S as h } from "../../ChevronUpDown-DqGsU4MC.js";
11
11
  const D = ({
12
12
  title: a = "Title",
13
13
  label: i = "Label",
14
- items: p = [],
15
- dropdownSize: s = "sm",
16
- onSelectId: m,
14
+ items: s = [],
15
+ dropdownSize: l = "sm",
16
+ onSelectId: p,
17
17
  ...e
18
18
  }) => {
19
- const o = f({ id: "toolbar-menu", returnFocusOnClose: !0 }), n = e.searchable ? "combobox" : "menu", l = p.map((t) => ({
20
- ...t,
19
+ const o = f({ id: "toolbar-menu", returnFocusOnClose: !0 }), t = e.searchable ? "combobox" : "menu", m = s.map((n) => ({
20
+ ...n,
21
21
  onClick: () => {
22
- m?.(t?.id ?? ""), o.setOpen(!1);
22
+ p?.(n?.id ?? ""), n?.role !== "checkbox" && o.setOpen(!1);
23
23
  }
24
24
  }));
25
25
  return /* @__PURE__ */ r(
@@ -28,11 +28,11 @@ const D = ({
28
28
  id: "toolbar-menu",
29
29
  variant: "drawer-dropdown",
30
30
  title: a,
31
- size: s,
31
+ size: l,
32
32
  trigger: /* @__PURE__ */ d(
33
33
  u,
34
34
  {
35
- variant: "primary",
35
+ variant: "solid",
36
36
  onClick: o.toggleMenu,
37
37
  "aria-expanded": o.open,
38
38
  "aria-haspopup": "menu",
@@ -51,12 +51,12 @@ const D = ({
51
51
  b,
52
52
  {
53
53
  ...e,
54
- items: l,
54
+ items: m,
55
55
  keyboardEvents: o.open,
56
- a11yMode: n,
56
+ a11yMode: t,
57
57
  open: o.open,
58
58
  scrollToTopOnOpen: e.virtualized,
59
- ...n === "combobox" ? { id: o.menuId } : o.menuA11yProps
59
+ ...t === "combobox" ? { id: o.menuId } : o.menuA11yProps
60
60
  }
61
61
  )
62
62
  }
@@ -16,7 +16,7 @@ const h = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAA
16
16
  groupId: "3",
17
17
  name: "owner",
18
18
  icon: b,
19
- label: "Velg tjenesteeier",
19
+ title: "Tjenesteeier ...",
20
20
  groups: {
21
21
  1: {
22
22
  title: "Velg tjenesteier"
@@ -47,7 +47,7 @@ const h = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAA
47
47
  groupId: "1",
48
48
  name: "status",
49
49
  icon: u,
50
- label: "Velg status",
50
+ title: "Status ...",
51
51
  groups: {
52
52
  1: {
53
53
  title: "Velg status"
@@ -103,12 +103,12 @@ const h = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAA
103
103
  title: "Ingen status"
104
104
  }
105
105
  ]
106
- }, V = {
106
+ }, Q = {
107
107
  id: "2",
108
108
  groupId: "1",
109
109
  icon: o,
110
110
  name: "time",
111
- label: "Velg dato",
111
+ title: "Dato ...",
112
112
  groups: {
113
113
  1: {
114
114
  title: "Velg dato"
@@ -173,12 +173,12 @@ const h = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAA
173
173
  linkIcon: !0
174
174
  }
175
175
  ]
176
- }, Q = {
176
+ }, X = {
177
177
  id: "seenBy",
178
178
  groupId: "2",
179
179
  icon: v,
180
180
  name: "seenBy",
181
- label: "Sett av ...",
181
+ title: "Sett av ...",
182
182
  searchable: !0,
183
183
  search: {
184
184
  name: "seenBy",
@@ -227,12 +227,12 @@ const h = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAA
227
227
  title: "Kari Nordmann"
228
228
  }
229
229
  ]
230
- }, X = {
230
+ }, V = {
231
231
  id: "content",
232
232
  groupId: "2",
233
233
  icon: I,
234
234
  name: "content",
235
- label: "Inneholder ...",
235
+ title: "Inneholder ...",
236
236
  groups: {
237
237
  1: {
238
238
  title: "Inneholder ..."
@@ -272,7 +272,7 @@ const h = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAA
272
272
  title: "Mottatte meldinger"
273
273
  }
274
274
  ]
275
- }, R = [S, V, Q, X, M], U = R?.map((e) => ({
275
+ }, R = [S, Q, X, V, M], T = R?.map((e) => ({
276
276
  ...e,
277
277
  removable: !0
278
278
  })), a = [
@@ -358,16 +358,16 @@ const h = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAA
358
358
  icon: {
359
359
  type: "company",
360
360
  name: e.name,
361
- isParent: !!e?.parentId
361
+ isParent: !e?.parentId
362
362
  }
363
363
  };
364
- }), W = {
364
+ }), U = {
365
365
  label: a[0].title,
366
366
  items: a,
367
367
  searchable: !0,
368
368
  groups: {
369
369
  favourites: { title: "Favoritter" },
370
- aa: { title: "Alfa Bar & Brød" },
370
+ aa: { title: "Alle virksomheter" },
371
371
  search: { title: "{count} treff" }
372
372
  },
373
373
  size: "md"
@@ -409,21 +409,21 @@ const h = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAA
409
409
  icon: p,
410
410
  title: "Papirkurv"
411
411
  }
412
- ], T = {
412
+ ], W = {
413
413
  label: i[0].title,
414
414
  items: i,
415
415
  size: "sm"
416
416
  };
417
417
  export {
418
- W as accountMenu,
418
+ U as accountMenu,
419
419
  a as accountMenuItems,
420
- X as contentFilter,
420
+ V as contentFilter,
421
421
  R as inboxFilters,
422
- T as inboxMenu,
422
+ W as inboxMenu,
423
423
  i as inboxMenuItems,
424
424
  M as ownerFilter,
425
- U as removableInboxFilters,
426
- Q as seenByFilter,
425
+ T as removableInboxFilters,
426
+ X as seenByFilter,
427
427
  S as statusFilter,
428
- V as timeFilter
428
+ Q as timeFilter
429
429
  };
@@ -1,30 +1,30 @@
1
- import { useState as S } from "react";
2
- import { inboxFilters as v, accountMenu as l } from "./example.data.js";
3
- import { formatDateRange as h } from "./formatDateRange.js";
4
- const p = ({ filters: s = v, defaultFilterState: c = {} }) => {
5
- const [n, u] = S(c), d = () => {
1
+ import { useState as v } from "react";
2
+ import { inboxFilters as b, accountMenu as l } from "./example.data.js";
3
+ import { formatDateRange as S } from "./formatDateRange.js";
4
+ const p = ({ filters: o = b, defaultFilterState: c = {} }) => {
5
+ const [n, u] = v(c), d = () => {
6
6
  const t = n?.seenBy || [], e = t?.length;
7
7
  return e > 1 && t?.includes("you") && t?.includes("others") ? "Sett av deg + andre" : e > 1 && t?.includes("you") ? `Sett av deg + ${e - 1}` : t?.includes("user") ? "Sett av deg" : t?.includes("others") ? "Sett av andre" : e ? `Sett av ${e}` : "Sett av ...";
8
- }, o = () => {
8
+ }, g = () => {
9
9
  const t = (n?.drafts?.length ?? 0) > 0 ? "Utkast" : void 0, e = (n?.attachments?.length ?? 0) > 0 ? "Vedlegg" : void 0, i = (n?.sent?.length ?? 0) > 0 ? "Sendt" : void 0, r = (n?.received?.length ?? 0) > 0 ? "Mottatt" : void 0;
10
10
  return [t, e, i, r].filter(Boolean).join(" + ");
11
- }, b = () => {
11
+ }, s = () => {
12
12
  const t = n?.fromDate?.[0]?.toString(), e = n?.toDate?.[0]?.toString();
13
13
  if (t && e)
14
- return h(t, e);
14
+ return S(t, e);
15
15
  if (t)
16
- return h(t);
17
- const i = n?.time || [], r = i?.length, g = s?.find((a) => a.name === "time")?.items, m = i?.map((a) => g?.find((f) => f.value === a)?.title);
18
- return r === 1 ? m?.[0] : r > 1 ? `${r} tider` : "Tid";
16
+ return S(t);
17
+ const i = n?.time || [], r = i?.length, m = o?.find((a) => a.name === "time")?.items, f = i?.map((a) => m?.find((h) => h.value === a)?.title);
18
+ return r === 1 ? f?.[0] : r > 1 ? `${r} tider` : "Tid";
19
19
  }, L = () => {
20
- const t = n?.status || [], e = t?.length, i = s?.find((a) => a.name === "status")?.items, r = t?.map((a) => i?.find((f) => f.value === a)?.title), g = (n?.unread?.length ?? 0) > 0 ? "Ulest" : void 0, m = e === 1 ? r?.[0] : e > 1 ? `${e} statuser` : void 0;
21
- return [g, m].filter(Boolean).join(" + ");
20
+ const t = n?.status || [], e = t?.length, i = o?.find((a) => a.name === "status")?.items, r = t?.map((a) => i?.find((h) => h.value === a)?.title), m = (n?.unread?.length ?? 0) > 0 ? "Ulest" : void 0, f = e === 1 ? r?.[0] : e > 1 ? `${e} statuser` : void 0;
21
+ return [m, f].filter(Boolean).join(" + ");
22
22
  };
23
23
  return {
24
24
  addLabel: "Legg til filter",
25
25
  submitLabel: "Show results",
26
26
  addNextLabel: "Legg til",
27
- filters: s,
27
+ filters: o,
28
28
  filterState: n,
29
29
  onFilterStateChange: u,
30
30
  getFilterLabel: (t) => {
@@ -32,33 +32,33 @@ const p = ({ filters: s = v, defaultFilterState: c = {} }) => {
32
32
  case "status":
33
33
  return L() || "Status";
34
34
  case "time":
35
- return b() || "Tid";
35
+ return s() || "Tid";
36
36
  case "seenBy":
37
37
  return d() || "Sett av";
38
38
  case "content":
39
- return o() || "Innhold";
39
+ return g() || "Innhold";
40
40
  default:
41
41
  return t;
42
42
  }
43
43
  }
44
44
  };
45
- }, F = () => {
46
- const [s, c] = S(l.items[0].id), n = (o) => {
47
- c(o);
48
- }, u = l.items.find((o) => o.id === s)?.title?.toString() || "Account", d = l.items.map((o) => ({
49
- ...o,
50
- selected: o.id === s
45
+ }, F = (o) => {
46
+ const [c, n] = v(o || l.items[0].id), u = (s) => {
47
+ n(s);
48
+ }, d = l.items.find((s) => s.id === c)?.title?.toString() || "Account", g = l.items.map((s) => ({
49
+ ...s,
50
+ selected: s.id === c
51
51
  }));
52
- return { ...l, label: u, onSelectId: n, items: d, virtualized: !0 };
52
+ return { ...l, label: d, onSelectId: u, items: g, virtualized: !0 };
53
53
  }, A = () => {
54
- const s = p({ filters: v });
54
+ const o = p({ filters: b });
55
55
  return {
56
56
  menus: [F()],
57
57
  search: {
58
58
  name: "search",
59
59
  placeholder: "Søk"
60
60
  },
61
- filter: s
61
+ filter: o
62
62
  };
63
63
  };
64
64
  export {
@@ -1,17 +1,17 @@
1
- import { ToolbarFilterProps } from './';
1
+ import { ToolbarFilterProps, ToolbarMenuProps } from './';
2
2
  declare const meta: {
3
3
  title: string;
4
4
  component: ({ accountMenu, menus, search, filter, children }: import('./Toolbar').ToolbarProps) => import("react/jsx-runtime").JSX.Element;
5
5
  parameters: {};
6
6
  decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react-vite').ReactRenderer, {
7
- accountMenu?: import('./ToolbarMenu').ToolbarMenuProps | undefined;
8
- menus?: import('./ToolbarMenu').ToolbarMenuProps[] | undefined;
7
+ accountMenu?: ToolbarMenuProps | undefined;
8
+ menus?: ToolbarMenuProps[] | undefined;
9
9
  search?: import('./ToolbarSearch').ToolbarSearchProps | undefined;
10
10
  filter?: ToolbarFilterProps | undefined;
11
11
  children?: import('react').ReactNode;
12
12
  }>, _: import('storybook/internal/csf').StoryContext<import('@storybook/react-vite').ReactRenderer, {
13
- accountMenu?: import('./ToolbarMenu').ToolbarMenuProps | undefined;
14
- menus?: import('./ToolbarMenu').ToolbarMenuProps[] | undefined;
13
+ accountMenu?: ToolbarMenuProps | undefined;
14
+ menus?: ToolbarMenuProps[] | undefined;
15
15
  search?: import('./ToolbarSearch').ToolbarSearchProps | undefined;
16
16
  filter?: ToolbarFilterProps | undefined;
17
17
  children?: import('react').ReactNode;
@@ -26,5 +26,5 @@ export declare const StaticFilters: () => import("react/jsx-runtime").JSX.Elemen
26
26
  export declare const RemovableFilters: () => import("react/jsx-runtime").JSX.Element;
27
27
  export declare const AccountMenuAndFilters: () => import("react/jsx-runtime").JSX.Element;
28
28
  export declare const AccountMenuAndSearch: () => import("react/jsx-runtime").JSX.Element;
29
- export declare const AccountMenuAndSubmenu: () => import("react/jsx-runtime").JSX.Element;
30
29
  export declare const AccountMenuAndSearchAutocomplete: () => import("react/jsx-runtime").JSX.Element;
30
+ export declare const AccountMenuAndSubmenu: () => import("react/jsx-runtime").JSX.Element;
@@ -11,7 +11,7 @@ export declare const useInboxFilter: ({ filters, defaultFilterState }: {
11
11
  onFilterStateChange: import('react').Dispatch<import('react').SetStateAction<import('./useFilter').FilterState | undefined>>;
12
12
  getFilterLabel: ToolbarFilterProps["getFilterLabel"];
13
13
  };
14
- export declare const useAccountMenu: () => {
14
+ export declare const useAccountMenu: (selectedId?: string) => {
15
15
  label: string;
16
16
  onSelectId: (id: string) => void;
17
17
  items: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.56.11",
3
+ "version": "0.56.12",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",