@altinn/altinn-components 0.56.29 → 0.56.31

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
- ._accountSelector_139de_1{display:flex;flex-direction:column;align-items:center;padding:1rem 0;max-width:1000px;margin:0 auto;--horizontal-padding: .7rem}._heading_139de_11{margin-bottom:1rem;width:100%;padding:.3rem var(--horizontal-padding)}._searchSection_139de_17{width:100%;padding:0 var(--horizontal-padding);display:flex;align-items:center;gap:1rem;margin-bottom:.75rem}._searchField_139de_26{width:50%}._accountMenu_139de_30{height:fit-content;width:100%;overflow-y:auto;margin-bottom:1rem;padding:0 var(--horizontal-padding)}._accountMenu_139de_30._virtualized_139de_38{overflow-y:hidden}._btnIcon_139de_43{font-size:1.5rem}._spinner_139de_47{margin:auto;width:100%;overflow:hidden}@media(max-width:1023px){._accountSelector_139de_1{--horizontal-padding: .1rem}._searchField_139de_26{width:100%}._searchSection_139de_17{flex-direction:column;align-items:stretch;gap:.5rem}}
1
+ ._accountSelector_829wd_1{display:flex;flex-direction:column;align-items:center;padding:1rem 0;max-width:1000px;margin:0 auto;--horizontal-padding: .7rem}._heading_829wd_11{margin-bottom:1rem;width:100%;padding:.3rem var(--horizontal-padding)}._searchSection_829wd_17{position:sticky;z-index:2;top:1rem;width:100%;padding:.5rem var(--horizontal-padding);display:flex;align-items:center;gap:1rem;margin-bottom:.75rem;background-color:#fff}._searchField_829wd_30{width:50%}._accountMenu_829wd_34{height:fit-content;width:100%;overflow-y:auto;margin-bottom:1rem;padding:0 var(--horizontal-padding)}._accountMenu_829wd_34._virtualized_829wd_43{overflow-y:hidden}._btnIcon_829wd_48{font-size:1.5rem}._spinner_829wd_58{margin:auto;width:100%;overflow:hidden}@media(max-width:1023px){._accountSelector_829wd_1{--horizontal-padding: .1rem}._searchField_829wd_30{width:100%}._searchSection_829wd_17{flex-direction:column;align-items:stretch;gap:.5rem}}
@@ -1 +1 @@
1
- ._header_1urgv_1{z-index:1;background-color:#fff;width:100%}._container_1urgv_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_1urgv_19{display:none}._header_1urgv_1[data-current-id=menu],._header_1urgv_1[data-current-id=locale]{background-color:#fff}@media(min-width:1024px){._header_1urgv_1[data-current-id=menu] ._backdrop_1urgv_19,._header_1urgv_1[data-current-id=locale] ._backdrop_1urgv_19{display:block}}@media(max-width:1023px){._header_1urgv_1{gap:0}}._header_1urgv_1{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}._nav_1urgv_53{position:relative;display:flex;align-items:center;justify-content:end;column-gap:.5rem}._dropdown_1urgv_63 header{display:none}._dropdown_1urgv_63[data-variant=drawer],._dropdown_1urgv_63[data-variant=drawer-dropdown]{margin-top:4.5rem}@media(min-width:1024px){._dropdown_1urgv_63[data-variant=drawer-dropdown]{margin-top:.5rem}}
1
+ ._header_57464_1{z-index:1;background-color:#fff;width:100%}._container_57464_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_57464_19{display:none}._header_57464_1[data-current-id=menu],._header_57464_1[data-current-id=locale]{background-color:#fff}@media(min-width:1024px){._header_57464_1[data-current-id=menu] ._backdrop_57464_19,._header_57464_1[data-current-id=locale] ._backdrop_57464_19{display:block}}@media(max-width:1023px){._header_57464_1{gap:0}}._header_57464_1{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}._nav_57464_53{position:relative;display:flex;align-items:center;justify-content:end;column-gap:.5rem}
@@ -0,0 +1 @@
1
+ html:has(dialog[open]){overflow:hidden;scrollbar-gutter:stable}._backdrop_1f6gf_11{display:block;z-index:1;background-color:#111d4640;position:fixed;top:4.5rem;right:0;bottom:0;left:0;width:100%;height:100%}._backdrop_1f6gf_11[aria-hidden=true]{display:none}._drawer_1f6gf_28{position:fixed;z-index:2;background-color:#fff;width:100%;max-width:100vw;height:auto;max-height:auto;box-sizing:border-box;padding:0;margin:0;border:0;top:4.5rem;bottom:0;display:flex;flex-direction:column;overflow-y:scroll}._drawer_1f6gf_28::backdrop{background-color:transparent}._drawer_1f6gf_28:not([data-open=true]){display:none}._footer_1f6gf_60{display:none}._body_1f6gf_64{padding:0 .5rem}@media(min-width:1024px){._body_1f6gf_64{padding:0 1rem}._drawer_1f6gf_28{top:4.5rem;bottom:4.5rem}._drawer_1f6gf_28[data-expanded=true]{bottom:0}._footer_1f6gf_60{position:sticky;z-index:2000;display:flex;bottom:0;left:0;right:0;justify-content:center;align-items:center;background-color:#fff}._toggleButton_1f6gf_94{margin:1rem 0}}
@@ -0,0 +1 @@
1
+ ._dropdown_cdjbb_3[data-variant=drawer-dropdown] header{display:none}@media(max-width:1023px){._dropdown_cdjbb_3[data-variant=drawer-dropdown]{margin-top:4.5rem;box-shadow:none}}
@@ -1,19 +1,19 @@
1
- import { jsxs as x, jsx as a, Fragment as W } from "react/jsx-runtime";
2
- import { c as M } from "../../index-p1eeF8LQ.js";
3
- import { useRef as R, useEffect as D, useState as O, useCallback as $, useLayoutEffect as G } from "react";
4
- import { createPortal as J } from "react-dom";
1
+ import { jsxs as x, jsx as a, Fragment as M } from "react/jsx-runtime";
2
+ import { c as O } from "../../index-p1eeF8LQ.js";
3
+ import { useRef as R, useEffect as D, useState as $, useCallback as G, useLayoutEffect as J } from "react";
4
+ import { createPortal as Q } from "react-dom";
5
5
  import { Button as H } from "../Button/Button.js";
6
6
  import "../RootProvider/RootProvider.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
- import { S as Q } from "../../XMark-tKk6aExO.js";
9
- import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_1mtdm_17", P = "_backdrop_1mtdm_47", tt = "_header_1mtdm_76", et = "_footer_1mtdm_77", rt = "_title_1mtdm_148", m = {
10
- dropdown: V,
11
- content: Z,
12
- backdrop: P,
13
- header: tt,
14
- footer: et,
15
- title: rt
16
- }, nt = "data-focus-guard", z = (h) => {
8
+ import { S as V } from "../../XMark-tKk6aExO.js";
9
+ import '../../assets/Dropdown.css';const Z = "_dropdown_1mtdm_1", P = "_content_1mtdm_17", tt = "_backdrop_1mtdm_47", et = "_header_1mtdm_76", rt = "_footer_1mtdm_77", nt = "_title_1mtdm_148", m = {
10
+ dropdown: Z,
11
+ content: P,
12
+ backdrop: tt,
13
+ header: et,
14
+ footer: rt,
15
+ title: nt
16
+ }, ot = "data-focus-guard", z = (h) => {
17
17
  const v = [
18
18
  "a[href]",
19
19
  "button:not([disabled])",
@@ -23,13 +23,13 @@ import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_
23
23
  '[tabindex]:not([tabindex="-1"])',
24
24
  '[contenteditable="true"]'
25
25
  ].join(",");
26
- return Array.from(h.querySelectorAll(v)).filter((c) => !c.hasAttribute(nt)).filter((c) => !c.hasAttribute("disabled")).filter((c) => c.getAttribute("aria-hidden") !== "true").filter((c) => c.tabIndex !== -1).filter((c) => {
26
+ return Array.from(h.querySelectorAll(v)).filter((c) => !c.hasAttribute(ot)).filter((c) => !c.hasAttribute("disabled")).filter((c) => c.getAttribute("aria-hidden") !== "true").filter((c) => c.tabIndex !== -1).filter((c) => {
27
27
  const p = c.getClientRects();
28
28
  return p.length > 0 && p[0].width > 0 && p[0].height > 0;
29
29
  });
30
- }, ot = (h) => {
30
+ }, it = (h) => {
31
31
  z(h)[0]?.focus({ preventScroll: !0 });
32
- }, ht = ({
32
+ }, pt = ({
33
33
  id: h = "dropdown",
34
34
  size: v = "sm",
35
35
  className: c,
@@ -45,36 +45,37 @@ import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_
45
45
  onClose: g,
46
46
  onSubmit: I,
47
47
  activeDescendantId: T,
48
- useFixedPosition: l = !1
48
+ useFixedPosition: l = !1,
49
+ expanded: X = !1
49
50
  }) => {
50
51
  const b = R(null), u = R(null), S = R(r);
51
52
  D(() => {
52
53
  S.current = r;
53
54
  }, [r]);
54
- const [n, X] = O({
55
+ const [n, Y] = $({
55
56
  yDir: _.includes("top") ? "top" : "bottom",
56
57
  xDir: _.includes("right") ? "right" : "left",
57
58
  maxHeight: 300
58
- }), f = $(() => {
59
+ }), f = G(() => {
59
60
  if (r && b.current && u.current) {
60
- const t = b.current.getBoundingClientRect(), s = u.current.getBoundingClientRect(), o = window.innerHeight, e = window.innerWidth, i = 16, d = o - t.bottom, w = t.top, y = e - t.right - s.width, A = d < 250 && w > d, j = A ? "top" : "bottom", q = (A ? w : d) - i, K = y < i ? "right" : "left";
61
- X((U) => ({
62
- ...U,
63
- yDir: j,
64
- maxHeight: q,
65
- xDir: K,
61
+ const t = b.current.getBoundingClientRect(), d = u.current.getBoundingClientRect(), o = window.innerHeight, e = window.innerWidth, i = 16, s = o - t.bottom, w = t.top, y = e - t.right - d.width, A = s < 250 && w > s, q = A ? "top" : "bottom", K = (A ? w : s) - i, U = y < i ? "right" : "left";
62
+ Y((W) => ({
63
+ ...W,
64
+ yDir: q,
65
+ maxHeight: K,
66
+ xDir: U,
66
67
  triggerRect: l ? t : void 0
67
68
  }));
68
69
  }
69
70
  }, [r, l]);
70
- G(() => (f(), window.addEventListener("resize", f), l && window.addEventListener("scroll", f, !0), () => {
71
+ J(() => (f(), window.addEventListener("resize", f), l && window.addEventListener("scroll", f, !0), () => {
71
72
  window.removeEventListener("resize", f), l && window.removeEventListener("scroll", f, !0);
72
73
  }), [f, l]), D(() => {
73
74
  if (!r) return;
74
75
  const t = requestAnimationFrame(() => {
75
- const s = u.current;
76
- if (!s) return;
77
- const o = s.querySelector(
76
+ const d = u.current;
77
+ if (!d) return;
78
+ const o = d.querySelector(
78
79
  'input[type="search"]:not([disabled]), input[role="searchbox"]:not([disabled]), input[data-dropdown-search]:not([disabled])'
79
80
  );
80
81
  if (o) {
@@ -86,28 +87,28 @@ import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_
86
87
  }
87
88
  return;
88
89
  }
89
- s.focus?.({ preventScroll: !0 });
90
+ d.focus?.({ preventScroll: !0 });
90
91
  });
91
92
  return () => cancelAnimationFrame(t);
92
93
  }, [r]), D(() => {
93
94
  const t = (o) => {
94
95
  o.key === "Escape" && g();
95
- }, s = (o) => {
96
- const e = o.target, i = b.current?.contains(e), d = u.current?.contains(e);
97
- !i && !d && g();
96
+ }, d = (o) => {
97
+ const e = o.target, i = b.current?.contains(e), s = u.current?.contains(e);
98
+ !i && !s && g();
98
99
  };
99
- return r && (document.addEventListener("mousedown", s), document.addEventListener("keydown", t)), () => {
100
- document.removeEventListener("mousedown", s), document.removeEventListener("keydown", t);
100
+ return r && (document.addEventListener("mousedown", d), document.addEventListener("keydown", t)), () => {
101
+ document.removeEventListener("mousedown", d), document.removeEventListener("keydown", t);
101
102
  };
102
103
  }, [r, g]), D(() => {
103
104
  if (!r) return;
104
105
  const t = u.current;
105
106
  if (!t) return;
106
- const s = (e) => {
107
+ const d = (e) => {
107
108
  if (!S.current)
108
109
  return;
109
110
  const i = e.target;
110
- i && !t.contains(i) && ot(t);
111
+ i && !t.contains(i) && it(t);
111
112
  }, o = (e) => {
112
113
  if (e.key !== "Tab") return;
113
114
  const i = z(t);
@@ -115,14 +116,14 @@ import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_
115
116
  e.preventDefault(), t.focus?.({ preventScroll: !0 });
116
117
  return;
117
118
  }
118
- const d = i[0], w = i[i.length - 1], y = document.activeElement;
119
- e.shiftKey ? y === d && (e.preventDefault(), w.focus({ preventScroll: !0 })) : y === w && (e.preventDefault(), d.focus({ preventScroll: !0 }));
119
+ const s = i[0], w = i[i.length - 1], y = document.activeElement;
120
+ e.shiftKey ? y === s && (e.preventDefault(), w.focus({ preventScroll: !0 })) : y === w && (e.preventDefault(), s.focus({ preventScroll: !0 }));
120
121
  };
121
- return document.addEventListener("focusin", s), document.addEventListener("keydown", o), () => {
122
- document.removeEventListener("focusin", s), document.removeEventListener("keydown", o);
122
+ return document.addEventListener("focusin", d), document.addEventListener("keydown", o), () => {
123
+ document.removeEventListener("focusin", d), document.removeEventListener("keydown", o);
123
124
  };
124
125
  }, [r]);
125
- const Y = l && n.triggerRect ? {
126
+ const j = l && n.triggerRect ? {
126
127
  position: "fixed",
127
128
  zIndex: 1e3,
128
129
  width: "max-content",
@@ -142,10 +143,11 @@ import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_
142
143
  "div",
143
144
  {
144
145
  ref: u,
145
- className: M(m.dropdown, c),
146
- style: Y,
146
+ className: O(m.dropdown, c),
147
+ style: j,
147
148
  "aria-hidden": !r,
148
149
  "data-variant": E,
150
+ "data-expanded": X,
149
151
  "data-size": v,
150
152
  tabIndex: -1,
151
153
  role: "menu",
@@ -154,21 +156,21 @@ import '../../assets/Dropdown.css';const V = "_dropdown_1mtdm_1", Z = "_content_
154
156
  children: [
155
157
  /* @__PURE__ */ x("header", { className: m.header, children: [
156
158
  /* @__PURE__ */ a("h2", { className: m.title, children: C }),
157
- /* @__PURE__ */ a(H, { size: "sm", variant: "outline", onClick: g, "aria-label": F, children: /* @__PURE__ */ a(Q, {}) })
159
+ /* @__PURE__ */ a(H, { size: "sm", variant: "outline", onClick: g, "aria-label": F, children: /* @__PURE__ */ a(V, {}) })
158
160
  ] }),
159
161
  /* @__PURE__ */ a("div", { className: m.content, children: B }),
160
162
  k && /* @__PURE__ */ a("footer", { className: m.footer, children: /* @__PURE__ */ a(H, { size: "lg", variant: "solid", onClick: I || g, rounded: !0, children: /* @__PURE__ */ a("span", { "data-size": "md", children: k }) }) })
161
163
  ]
162
164
  }
163
165
  );
164
- return /* @__PURE__ */ x(W, { children: [
166
+ return /* @__PURE__ */ x(M, { children: [
165
167
  p && /* @__PURE__ */ a("div", { className: m.backdrop, "aria-hidden": !r }),
166
168
  /* @__PURE__ */ x("div", { id: h + "-root", ref: b, style: { position: "relative", display: "inline-block" }, children: [
167
169
  N,
168
- l ? J(L, document.body) : L
170
+ l ? Q(L, document.body) : L
169
171
  ] })
170
172
  ] });
171
173
  };
172
174
  export {
173
- ht as Dropdown
175
+ pt as Dropdown
174
176
  };
@@ -1,20 +1,20 @@
1
1
  import { A as o } from "../../alert-BzifOfXl.js";
2
- import { B as e, C as r, a as t, b as i, D as n, L as p, c as x, d as f, P as m, e as g, S as d, f as S, g as l, T as P, u as b } from "../../textfield-CNXt-27J.js";
3
- import { B as c, S as B } from "../../button-BB5sYVKY.js";
4
- import { H as L, S as k } from "../../switch-Cemfhx0H.js";
5
- import { D as T } from "../../index-Q0EA2XB0.js";
2
+ import { B as e, C as r, a as t, b as i, D as n, L as p, c as x, d as f, P as m, e as g, f as d, g as h, S as l, h as P, T as S, u as b } from "../../textfield-DP1SL4Wr.js";
3
+ import { B, S as C } from "../../button-BB5sYVKY.js";
4
+ import { D as k } from "../../index-Q0EA2XB0.js";
5
+ import { H as T } from "../../heading-C_XYsUfi.js";
6
6
  import { P as H } from "../../paragraph-BRiIBpbY.js";
7
7
  import { V as v } from "../../index-z82sbSVU.js";
8
8
  export {
9
9
  o as DsAlert,
10
10
  e as DsBadge,
11
- c as DsButton,
11
+ B as DsButton,
12
12
  r as DsCheckbox,
13
13
  t as DsChip,
14
14
  i as DsCombobox,
15
- T as DsDetails,
15
+ k as DsDetails,
16
16
  n as DsDialog,
17
- L as DsHeading,
17
+ T as DsHeading,
18
18
  p as DsLink,
19
19
  x as DsListItem,
20
20
  f as DsListUnordered,
@@ -22,11 +22,11 @@ export {
22
22
  H as DsParagraph,
23
23
  g as DsPopover,
24
24
  d as DsSearch,
25
- S as DsSkeleton,
26
- B as DsSpinner,
27
- k as DsSwitch,
28
- l as DsTabs,
29
- P as DsTextfield,
25
+ h as DsSkeleton,
26
+ C as DsSpinner,
27
+ l as DsSwitch,
28
+ P as DsTabs,
29
+ S as DsTextfield,
30
30
  v as DsValidationMessage,
31
31
  b as useDsPagination
32
32
  };
@@ -1,112 +1,115 @@
1
- import { jsx as c, jsxs as S } from "react/jsx-runtime";
2
- import { c as p } from "../../index-p1eeF8LQ.js";
3
- import { useState as _, useEffect as g } from "react";
4
- import { useLockBodyScroll as L } from "../../hooks/useLockBodyScroll.js";
5
- import { AccountMenu as A } from "../Account/AccountMenu.js";
1
+ import { jsx as a, jsxs as S } from "react/jsx-runtime";
2
+ import { c as f } from "../../index-p1eeF8LQ.js";
3
+ import { useState as g, useEffect as z } from "react";
4
+ import { AccountMenu as N } from "../Account/AccountMenu.js";
6
5
  import "../Button/Button.js";
7
6
  import "react-dom";
8
- import { useRootContext as M } from "../RootProvider/RootProvider.js";
7
+ import { useRootContext as k } from "../RootProvider/RootProvider.js";
9
8
  import "../Snackbar/useSnackbar.js";
10
- import { S as F } from "../../SearchField-QTfebYdU.js";
11
- import { S as T } from "../../button-BB5sYVKY.js";
12
- import { H as j, S as y } from "../../switch-Cemfhx0H.js";
13
- import '../../assets/AccountSelector.css';const C = "_accountSelector_139de_1", H = "_heading_139de_11", V = "_searchSection_139de_17", I = "_searchField_139de_26", E = "_accountMenu_139de_30", R = "_virtualized_139de_38", $ = "_spinner_139de_47", n = {
14
- accountSelector: C,
15
- heading: H,
16
- searchSection: V,
17
- searchField: I,
18
- accountMenu: E,
19
- virtualized: R,
20
- spinner: $
21
- }, ee = ({
9
+ import { Switch as A } from "../Forms/Switch.js";
10
+ import { S as L } from "../../SearchField-QTfebYdU.js";
11
+ import { S as H } from "../../button-BB5sYVKY.js";
12
+ import { H as T } from "../../heading-C_XYsUfi.js";
13
+ import '../../assets/AccountSelector.css';const y = "_accountSelector_829wd_1", C = "_heading_829wd_11", F = "_searchSection_829wd_17", R = "_searchField_829wd_30", j = "_accountMenu_829wd_34", E = "_virtualized_829wd_43", M = "_spinner_829wd_58", t = {
14
+ accountSelector: y,
15
+ heading: C,
16
+ searchSection: F,
17
+ searchField: R,
18
+ accountMenu: j,
19
+ virtualized: E,
20
+ spinner: M
21
+ }, D = ({
22
22
  accountMenu: e,
23
- forceOpenFullScreen: t,
24
- className: i,
25
- loading: v,
23
+ forceOpenFullScreen: r,
24
+ className: n,
25
+ loading: p,
26
26
  showDeletedUnits: s,
27
- onShowDeletedUnitsChange: k,
28
- scrollLock: x
27
+ onShowDeletedUnitsChange: v,
28
+ isFullScreen: i
29
29
  }) => {
30
- const { openId: o, closeAll: l, languageCode: d, currentId: z } = M();
31
- L(x ? z === "account" : !1);
32
- const [u, h] = _(""), [a, m] = _(t);
33
- g(() => {
34
- !t && a && l(), m(t);
35
- }, [t]), g(() => {
36
- a === !0 && o("account");
37
- }, [a, o]);
38
- const { searchText: f, heading: b, switchLabel: w } = B(d), N = (r) => {
39
- e.onSelectAccount?.(r), l(), m(!1);
30
+ const { closeAll: o, languageCode: l } = k(), [d, h] = g(""), [_, u] = g(r);
31
+ z(() => {
32
+ !r && _ && o(), u(r);
33
+ }, [r]);
34
+ const { searchText: m, heading: w, switchLabel: x } = V(l), b = (c) => {
35
+ e.onSelectAccount?.(c), o(), u(!1);
40
36
  };
41
- return v ? /* @__PURE__ */ c(T, { "aria-hidden": !0, "data-color": "neutral", className: n.spinner }) : /* @__PURE__ */ S("div", { className: p(i, n.accountSelector), children: [
42
- /* @__PURE__ */ c(j, { "data-size": "sm", level: 2, className: n.heading, children: b }),
43
- /* @__PURE__ */ S("div", { className: n.searchSection, children: [
44
- /* @__PURE__ */ c(
45
- F,
37
+ return p ? /* @__PURE__ */ a(H, { "aria-hidden": !0, "data-color": "neutral", className: t.spinner }) : /* @__PURE__ */ S("div", { className: f(n, t.accountSelector), children: [
38
+ /* @__PURE__ */ a(T, { "data-size": "sm", level: 2, className: t.heading, children: w }),
39
+ /* @__PURE__ */ S("div", { className: t.searchSection, children: [
40
+ /* @__PURE__ */ a(
41
+ L,
46
42
  {
47
- name: f,
48
- placeholder: f,
49
- value: u,
50
- onChange: (r) => h(r.target.value),
43
+ size: "sm",
44
+ name: m,
45
+ placeholder: m,
46
+ value: d,
47
+ onChange: (c) => h(c.target.value),
51
48
  onClear: () => h(""),
52
- className: n.searchField
49
+ className: t.searchField
53
50
  }
54
51
  ),
55
- s !== void 0 && /* @__PURE__ */ c(
56
- y,
52
+ s !== void 0 && /* @__PURE__ */ a(
53
+ A,
57
54
  {
55
+ size: "sm",
58
56
  checked: s,
59
- onChange: (r) => k?.(r.target.checked),
60
- label: w
57
+ onChange: (c) => v?.(c.target.checked),
58
+ label: x
61
59
  }
62
60
  )
63
61
  ] }),
64
- /* @__PURE__ */ c("div", { className: p(n.accountMenu, e.virtualized && n.virtualized), children: /* @__PURE__ */ c(
65
- A,
62
+ /* @__PURE__ */ a(
63
+ "div",
66
64
  {
67
- ...e,
68
- onSelectAccount: N,
69
- keyboardEvents: !1,
70
- search: {
71
- hidden: !0,
72
- name: "",
73
- value: u,
74
- getResultsLabel: (r) => K(r, d)
75
- }
65
+ className: f(
66
+ t.accountMenu,
67
+ i && t.fullScreen,
68
+ e.virtualized && t.virtualized
69
+ ),
70
+ children: /* @__PURE__ */ a(
71
+ N,
72
+ {
73
+ ...e,
74
+ onSelectAccount: b,
75
+ keyboardEvents: !1,
76
+ search: {
77
+ hidden: !0,
78
+ name: "",
79
+ value: d,
80
+ getResultsLabel: (c) => $(c, l)
81
+ },
82
+ scrollRefStyles: !i && e.virtualized ? { maxHeight: "calc(40vh)" } : void 0
83
+ }
84
+ )
76
85
  }
77
- ) })
86
+ )
78
87
  ] });
79
- }, B = (e) => {
88
+ }, V = (e) => {
80
89
  switch (e) {
81
90
  case "nn":
82
91
  return {
83
- minimize: "Minimer",
84
- fullscreen: "Vis i fullskjerm",
85
92
  searchText: "Søk i aktørar",
86
93
  heading: "Kven vil du representere?",
87
94
  switchLabel: "Vis slettede"
88
95
  };
89
96
  case "en":
90
97
  return {
91
- minimize: "Minimize",
92
- fullscreen: "Show in fullscreen",
93
98
  searchText: "Search in actors",
94
99
  heading: "Who do you want to represent?",
95
100
  switchLabel: "Show deleted"
96
101
  };
97
102
  default:
98
103
  return {
99
- minimize: "Minimer",
100
- fullscreen: "Vis i fullskjerm",
101
104
  searchText: "Søk i aktører",
102
105
  heading: "Hvem vil du representere?",
103
106
  switchLabel: "Vis slettede"
104
107
  };
105
108
  }
106
- }, K = (e, t) => {
107
- const i = t === "nb" || t === "nn";
108
- return e === 0 ? i ? "Ingen treff" : "No hits" : i ? `${e} treff` : e === 1 ? "1 hit" : `${e} hits`;
109
+ }, $ = (e, r) => {
110
+ const n = r === "nb" || r === "nn";
111
+ return e === 0 ? n ? "Ingen treff" : "No hits" : n ? `${e} treff` : e === 1 ? "1 hit" : `${e} hits`;
109
112
  };
110
113
  export {
111
- ee as AccountSelector
114
+ D as AccountSelector
112
115
  };
@@ -1,91 +1,89 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as s } from "react/jsx-runtime";
3
- import { useIsDesktop as w } from "../../hooks/useIsDesktop.js";
2
+ import { jsx as n, jsxs as a, Fragment as F } from "react/jsx-runtime";
3
+ import { useState as A } from "react";
4
+ import { useIsDesktop as v } from "../../hooks/useIsDesktop.js";
5
+ import { GlobalMenu as C } from "../GlobalMenu/GlobalMenu.js";
4
6
  import "../../index-p1eeF8LQ.js";
5
- import "react";
6
7
  import "../Button/Button.js";
7
- import { useRootContext as A } from "../RootProvider/RootProvider.js";
8
- import { GlobalMenuButton as O } from "./GlobalMenuButton.js";
8
+ import "react-dom";
9
+ import { useRootContext as b } from "../RootProvider/RootProvider.js";
10
+ import { GlobalMenuButton as k } from "./GlobalMenuButton.js";
9
11
  import "../Snackbar/useSnackbar.js";
10
- import { Dropdown as l } from "../Dropdown/Dropdown.js";
11
- import { GlobalMenu as x } from "../GlobalMenu/GlobalMenu.js";
12
- import { AccountSelector as C } from "./AccountSelector.js";
13
- import { AccountSelectorButton as N } from "./AccountSelectorButton.js";
14
- import { HeaderLogo as b } from "./HeaderLogo.js";
15
- import '../../assets/GlobalHeader.css';const k = "_header_1urgv_1", F = "_container_1urgv_7", D = "_nav_1urgv_53", G = "_dropdown_1urgv_63", o = {
16
- header: k,
17
- container: F,
18
- nav: D,
19
- dropdown: G
20
- }, J = ({
21
- globalMenu: t,
12
+ import { AccountSelector as D } from "./AccountSelector.js";
13
+ import { AccountSelectorButton as H } from "./AccountSelectorButton.js";
14
+ import { HeaderDrawer as N } from "./HeaderDrawer.js";
15
+ import { HeaderDropdown as w } from "./HeaderDropdown.js";
16
+ import { HeaderLogo as y } from "./HeaderLogo.js";
17
+ import '../../assets/GlobalHeader.css';const B = "_header_57464_1", G = "_container_57464_7", I = "_nav_57464_53", t = {
18
+ header: B,
19
+ container: G,
20
+ nav: I
21
+ }, W = ({
22
+ globalMenu: r,
22
23
  desktopMenu: m,
23
24
  mobileMenu: p,
24
25
  locale: u,
25
26
  accountSelector: e,
26
- logo: g = {},
27
- badge: f,
28
- onLoginClick: h
27
+ logo: f = {},
28
+ badge: h,
29
+ onLoginClick: g
29
30
  }) => {
30
- const { currentId: r, toggleId: a, closeAll: c } = A(), v = () => {
31
- a("account");
32
- }, _ = () => {
33
- a("menu");
34
- }, d = r === "account" || e?.forceOpenFullScreen || !1, i = w();
35
- return /* @__PURE__ */ n("header", { className: o.header, "data-current-id": r, children: /* @__PURE__ */ s("div", { className: o.container, children: [
36
- /* @__PURE__ */ n(b, { ...g, badge: f, className: o.logo }),
37
- /* @__PURE__ */ s("nav", { className: o.nav, children: [
38
- e && /* @__PURE__ */ n(
39
- l,
40
- {
41
- className: o.dropdown,
42
- backdrop: !1,
43
- id: "header-account",
44
- open: d,
45
- variant: "drawer",
46
- placement: "right",
47
- onClose: c,
48
- trigger: /* @__PURE__ */ n(
49
- N,
50
- {
51
- currentAccount: e.accountMenu?.currentAccount,
52
- minimized: !i,
53
- onClick: e.accountMenu?.currentAccount ? v : h,
54
- expanded: d,
55
- loading: e.loading,
56
- disabled: e.forceOpenFullScreen
57
- }
58
- ),
59
- children: /* @__PURE__ */ n(C, { ...e, forceOpenFullScreen: e.forceOpenFullScreen })
60
- }
61
- ),
31
+ const { currentId: o, toggleId: i, closeAll: c } = b(), x = () => {
32
+ i("account");
33
+ }, O = () => {
34
+ i("menu");
35
+ }, l = o === "account" || e?.forceOpenFullScreen || !1, [d, _] = A(!1), s = v();
36
+ return /* @__PURE__ */ n("header", { className: t.header, "data-current-id": o, children: /* @__PURE__ */ a("div", { className: t.container, children: [
37
+ /* @__PURE__ */ n(y, { ...f, badge: h, className: t.logo }),
38
+ /* @__PURE__ */ a("nav", { className: t.nav, children: [
39
+ e && /* @__PURE__ */ a(F, { children: [
40
+ /* @__PURE__ */ n(
41
+ H,
42
+ {
43
+ currentAccount: e.accountMenu?.currentAccount,
44
+ minimized: !s,
45
+ onClick: e.accountMenu?.currentAccount ? x : g,
46
+ expanded: l,
47
+ loading: e.loading,
48
+ disabled: e.forceOpenFullScreen
49
+ }
50
+ ),
51
+ /* @__PURE__ */ n(
52
+ N,
53
+ {
54
+ id: "header-account",
55
+ open: l,
56
+ onClose: c,
57
+ closedBy: e?.forceOpenFullScreen ? "none" : "any",
58
+ expanded: e?.forceOpenFullScreen || d,
59
+ onToggle: () => _(!d),
60
+ children: /* @__PURE__ */ n(D, { ...e, forceOpenFullScreen: e.forceOpenFullScreen })
61
+ }
62
+ )
63
+ ] }),
62
64
  /* @__PURE__ */ n(
63
- l,
65
+ w,
64
66
  {
65
- className: o.dropdown,
66
67
  id: "header-menu",
67
- open: r === "menu",
68
- variant: "drawer-dropdown",
69
- placement: "right",
70
- size: "md",
68
+ open: o === "menu",
71
69
  onClose: c,
72
70
  trigger: /* @__PURE__ */ n(
73
- O,
71
+ k,
74
72
  {
75
- onClick: _,
76
- expanded: r === "menu",
73
+ onClick: O,
74
+ expanded: o === "menu",
77
75
  disabled: e?.forceOpenFullScreen,
78
- label: t?.menuLabel
76
+ label: r?.menuLabel
79
77
  }
80
78
  ),
81
79
  children: /* @__PURE__ */ n(
82
- x,
80
+ C,
83
81
  {
84
- ...t,
85
- menu: i ? m || t?.menu : p || t?.menu,
82
+ ...r,
83
+ menu: s ? m || r?.menu : p || r?.menu,
86
84
  onClose: c,
87
85
  localeSwitcher: u,
88
- isOpen: r === "menu"
86
+ isOpen: o === "menu"
89
87
  }
90
88
  )
91
89
  }
@@ -94,5 +92,5 @@ import '../../assets/GlobalHeader.css';const k = "_header_1urgv_1", F = "_contai
94
92
  ] }) });
95
93
  };
96
94
  export {
97
- J as GlobalHeader
95
+ W as GlobalHeader
98
96
  };