@altinn/altinn-components 0.44.4 → 0.45.0

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.
Files changed (156) hide show
  1. package/dist/ArrowUndo-hge1gMu8.js +24 -0
  2. package/dist/Button-B0t0vz2h.js +23 -0
  3. package/dist/Globe-BcPkcH4E.js +24 -0
  4. package/dist/Heading-By5DKz2H.js +12 -0
  5. package/dist/HeartFill-CYSrJ_xK.js +43 -0
  6. package/dist/PersonCircle-DlX_3kRO.js +24 -0
  7. package/dist/Spinner-BDXfwXIh.js +26 -0
  8. package/dist/assets/AccountMenuButton.css +1 -0
  9. package/dist/assets/AccountSelector.css +1 -0
  10. package/dist/assets/GlobalHeader.css +1 -0
  11. package/dist/assets/GlobalHeaderBase.css +1 -0
  12. package/dist/assets/GlobalMenuButton2.css +1 -0
  13. package/dist/assets/HeaderGroup2.css +1 -0
  14. package/dist/assets/HeaderLogo2.css +1 -0
  15. package/dist/assets/LayoutBody.css +1 -1
  16. package/dist/assets/NotificationItemBase.css +1 -0
  17. package/dist/assets/NotificationItemIcon.css +1 -0
  18. package/dist/assets/globalSearch.css +1 -0
  19. package/dist/components/Account/AccountListItemControls.js +22 -58
  20. package/dist/components/Account/AccountMenu.js +40 -36
  21. package/dist/components/Account/AccountMenuButton.js +131 -0
  22. package/dist/components/Account/AccountNotificationSettings.js +1 -1
  23. package/dist/components/Avatar/Avatar.js +23 -22
  24. package/dist/components/Bookmarks/EditableBookmark.js +1 -1
  25. package/dist/components/Dashboard/DashboardHeader.js +1 -1
  26. package/dist/components/Dropdown/DrawerBase.js +17 -15
  27. package/dist/components/Dropdown/DropdownBase.js +14 -12
  28. package/dist/components/Dropdown/FloatingDropdown.js +6 -6
  29. package/dist/components/DsComponents/index.js +26 -22
  30. package/dist/components/Forms/Checkbox.js +1 -1
  31. package/dist/components/Forms/CheckboxOptions.js +1 -1
  32. package/dist/components/Forms/FieldBase.js +1 -1
  33. package/dist/components/Forms/FieldsetBase.js +1 -1
  34. package/dist/components/Forms/Radio.js +1 -1
  35. package/dist/components/Forms/RadioOptions.js +1 -1
  36. package/dist/components/Forms/SearchField.js +1 -1
  37. package/dist/components/Forms/SelectField.js +1 -1
  38. package/dist/components/Forms/Switch.js +1 -1
  39. package/dist/components/Forms/SwitchOptions.js +1 -1
  40. package/dist/components/Forms/TextField.js +1 -1
  41. package/dist/components/Forms/TextareaField.js +1 -1
  42. package/dist/components/GlobalHeader/AccountSelector.js +138 -0
  43. package/dist/components/GlobalHeader/DigdirLogomark.js +109 -0
  44. package/dist/components/GlobalHeader/GlobalHeader.js +117 -0
  45. package/dist/components/GlobalHeader/GlobalHeaderBase.js +22 -0
  46. package/dist/components/GlobalHeader/GlobalSearch.js +57 -0
  47. package/dist/components/GlobalHeader/GlobalSearchButton.js +53 -0
  48. package/dist/components/GlobalHeader/HeaderGroup.js +8 -0
  49. package/dist/components/GlobalHeader/HeaderLogo.js +17 -0
  50. package/dist/components/GlobalHeader/index.js +6 -0
  51. package/dist/components/GlobalMenu/BackButton.js +6 -24
  52. package/dist/components/GlobalMenu/EndUserLabel.js +10 -29
  53. package/dist/components/GlobalMenu/GlobalMenu.js +38 -61
  54. package/dist/components/GlobalMenu/GlobalMenuButton.js +69 -47
  55. package/dist/components/GlobalMenu/LocaleButton.js +12 -0
  56. package/dist/components/GlobalMenu/LocaleSwitcher.js +34 -0
  57. package/dist/components/GlobalMenu/index.js +6 -12
  58. package/dist/components/GlobalMenu_old/BackButton.js +11 -0
  59. package/dist/components/GlobalMenu_old/EndUserLabel.js +13 -0
  60. package/dist/components/GlobalMenu_old/GlobalMenu.js +75 -0
  61. package/dist/components/GlobalMenu_old/GlobalMenuBase.js +10 -0
  62. package/dist/components/GlobalMenu_old/GlobalMenuButton.js +58 -0
  63. package/dist/components/GlobalMenu_old/LogoutButton.js +14 -0
  64. package/dist/components/GlobalMenu_old/index.js +14 -0
  65. package/dist/components/Header/Header.js +25 -25
  66. package/dist/components/Header/LocaleButton.js +13 -30
  67. package/dist/components/Layout/Layout.js +25 -23
  68. package/dist/components/Layout/LayoutBody.js +1 -1
  69. package/dist/components/List/ListItemSelect.js +1 -1
  70. package/dist/components/Menu/MenuItem.js +1 -1
  71. package/dist/components/Menu/MenuSearch.js +2 -2
  72. package/dist/components/Notifications/NotificationItem.js +17 -0
  73. package/dist/components/Notifications/NotificationItemBase.js +86 -0
  74. package/dist/components/Notifications/NotificationItemControls.js +33 -0
  75. package/dist/components/Notifications/NotificationItemIcon.js +33 -0
  76. package/dist/components/Notifications/index.js +10 -0
  77. package/dist/components/RootProvider/RootProvider.js +42 -30
  78. package/dist/components/Searchbar/Searchbar.js +3 -3
  79. package/dist/components/Settings/BookmarksSettingsItem.js +1 -1
  80. package/dist/components/Settings/SettingsItem.js +22 -11
  81. package/dist/components/Toolbar/ToolbarAccountMenu.js +5 -5
  82. package/dist/components/Toolbar/ToolbarAdd.js +5 -5
  83. package/dist/components/Toolbar/ToolbarFilter.js +5 -5
  84. package/dist/components/Toolbar/ToolbarOptions.js +1 -1
  85. package/dist/components/Toolbar/ToolbarSearch.js +1 -1
  86. package/dist/components/index.js +305 -293
  87. package/dist/functions/date/date.js +16 -0
  88. package/dist/functions/date/date.spec.js +15 -0
  89. package/dist/functions/date/index.js +4 -0
  90. package/dist/functions/index.js +4 -2
  91. package/dist/globalSearch.module-Ejp7X0dO.js +9 -0
  92. package/dist/hooks/index.js +4 -2
  93. package/dist/hooks/useAccountSelector.js +214 -0
  94. package/dist/index-B6sKSsN9.js +2951 -0
  95. package/dist/index.js +304 -288
  96. package/dist/types/languageCode.js +1 -0
  97. package/dist/types/lib/components/Account/AccountMenu.d.ts +1 -1
  98. package/dist/types/lib/components/Account/AccountMenuButton.d.ts +11 -0
  99. package/dist/types/lib/components/Account/AccountMenuButton.stories.d.ts +31 -0
  100. package/dist/types/lib/components/Avatar/Avatar.d.ts +3 -1
  101. package/dist/types/lib/components/Avatar/Avatar.stories.d.ts +16 -1
  102. package/dist/types/lib/components/Dialog/SeenByLogItem.stories.d.ts +1 -0
  103. package/dist/types/lib/components/Dropdown/DrawerBase.d.ts +2 -1
  104. package/dist/types/lib/components/GlobalHeader/AccountSector.stories.d.ts +29 -0
  105. package/dist/types/lib/components/GlobalHeader/AccountSelector.d.ts +11 -0
  106. package/dist/types/lib/components/GlobalHeader/DigdirLogomark.d.ts +5 -0
  107. package/dist/types/lib/components/GlobalHeader/GlobalHeader.d.ts +20 -0
  108. package/dist/types/lib/components/GlobalHeader/GlobalHeader.stories.d.ts +27 -0
  109. package/dist/types/lib/components/GlobalHeader/GlobalHeaderBase.d.ts +9 -0
  110. package/dist/types/lib/components/GlobalHeader/GlobalSearch.d.ts +4 -0
  111. package/dist/types/lib/components/GlobalHeader/GlobalSearchButton.d.ts +4 -0
  112. package/dist/types/lib/components/GlobalHeader/HeaderGroup.d.ts +6 -0
  113. package/dist/types/lib/components/GlobalHeader/HeaderLogo.d.ts +10 -0
  114. package/dist/types/lib/components/GlobalHeader/index.d.ts +2 -0
  115. package/dist/types/lib/components/GlobalMenu/GlobalMenu.d.ts +3 -5
  116. package/dist/types/lib/components/GlobalMenu/GlobalMenu.stories.d.ts +6 -8
  117. package/dist/types/lib/components/GlobalMenu/GlobalMenuButton.d.ts +2 -3
  118. package/dist/types/lib/components/GlobalMenu/GlobalMenuButton.stories.d.ts +5 -9
  119. package/dist/types/lib/components/GlobalMenu/LocaleButton.d.ts +3 -0
  120. package/dist/types/lib/components/GlobalMenu/LocaleSwitcher.d.ts +7 -0
  121. package/dist/types/lib/components/GlobalMenu/index.d.ts +1 -4
  122. package/dist/types/lib/components/GlobalMenu_old/BackButton.d.ts +7 -0
  123. package/dist/types/lib/components/{GlobalMenu → GlobalMenu_old}/CurrentAccount.d.ts +1 -1
  124. package/dist/types/lib/components/GlobalMenu_old/EndUserLabel.d.ts +5 -0
  125. package/dist/types/lib/components/GlobalMenu_old/GlobalMenu.d.ts +18 -0
  126. package/dist/types/lib/components/GlobalMenu_old/GlobalMenu.stories.d.ts +30 -0
  127. package/dist/types/lib/components/GlobalMenu_old/GlobalMenuBase.d.ts +15 -0
  128. package/dist/types/lib/components/GlobalMenu_old/GlobalMenuButton.d.ts +13 -0
  129. package/dist/types/lib/components/GlobalMenu_old/GlobalMenuButton.stories.d.ts +19 -0
  130. package/dist/types/lib/components/GlobalMenu_old/LogoutButton.d.ts +7 -0
  131. package/dist/types/lib/components/GlobalMenu_old/index.d.ts +6 -0
  132. package/dist/types/lib/components/Header/Header.d.ts +2 -2
  133. package/dist/types/lib/components/Header/Header.stories.d.ts +2 -2
  134. package/dist/types/lib/components/Layout/Layout.d.ts +4 -2
  135. package/dist/types/lib/components/Layout/Layout.stories.d.ts +29 -5
  136. package/dist/types/lib/components/Notifications/NotificationItem.d.ts +7 -0
  137. package/dist/types/lib/components/Notifications/NotificationItemBase.d.ts +15 -0
  138. package/dist/types/lib/components/Notifications/NotificationItemControls.d.ts +10 -0
  139. package/dist/types/lib/components/Notifications/NotificationItemIcon.d.ts +11 -0
  140. package/dist/types/lib/components/Notifications/Notifications.stories.d.ts +10 -0
  141. package/dist/types/lib/components/Notifications/index.d.ts +4 -0
  142. package/dist/types/lib/components/RootProvider/RootProvider.d.ts +9 -4
  143. package/dist/types/lib/components/Settings/SettingsItem.d.ts +1 -1
  144. package/dist/types/lib/components/index.d.ts +2 -1
  145. package/dist/types/lib/functions/date/date.d.ts +6 -0
  146. package/dist/types/lib/functions/date/date.spec.d.ts +1 -0
  147. package/dist/types/lib/functions/date/index.d.ts +1 -0
  148. package/dist/types/lib/functions/index.d.ts +1 -0
  149. package/dist/types/lib/hooks/index.d.ts +1 -0
  150. package/dist/types/lib/hooks/useAccountSelector.d.ts +62 -0
  151. package/dist/types/lib/types/index.d.ts +1 -0
  152. package/dist/types/lib/types/languageCode.d.ts +1 -0
  153. package/dist/usePagination-cq1YWZkE.js +889 -0
  154. package/package.json +1 -1
  155. package/dist/usePagination-B24SmI8E.js +0 -3835
  156. /package/dist/components/{GlobalMenu → GlobalMenu_old}/CurrentAccount.js +0 -0
@@ -2,9 +2,9 @@ import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
2
  import { c as r } from "../../index-L8X2o7IH.js";
3
3
  import "react";
4
4
  import "../RootProvider/RootProvider.js";
5
- import "../Snackbar/useSnackbar.js";
6
5
  import { Label as l } from "../Forms/Label.js";
7
6
  import { Input as n } from "../Forms/Input.js";
7
+ import "../Snackbar/useSnackbar.js";
8
8
  import '../../assets/ListItemSelect.css';const i = "_select_kfgnl_1", m = "_checkbox_kfgnl_19", t = {
9
9
  select: i,
10
10
  checkbox: m
@@ -60,8 +60,8 @@ import '../../assets/MenuItem.css';const R = "_controls_w98qm_46", U = "_linkIco
60
60
  }
61
61
  ),
62
62
  /* @__PURE__ */ i("span", { className: m.controls, children: [
63
- !r && k,
64
63
  !r && B(),
64
+ !r && k,
65
65
  s && /* @__PURE__ */ n("span", { className: m.linkIcon, children: /* @__PURE__ */ n(
66
66
  N,
67
67
  {
@@ -1,10 +1,10 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
- import "../RootProvider/RootProvider.js";
5
4
  import { useIsDesktop as a } from "../../hooks/useIsDesktop.js";
6
- import "../Snackbar/useSnackbar.js";
5
+ import "../RootProvider/RootProvider.js";
7
6
  import { SearchField as c } from "../Forms/SearchField.js";
7
+ import "../Snackbar/useSnackbar.js";
8
8
  import '../../assets/MenuSearch.css';const l = "_field_1w1s0_1", n = {
9
9
  field: l
10
10
  }, x = ({
@@ -0,0 +1,17 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import "../../index-L8X2o7IH.js";
3
+ import "react";
4
+ import "../RootProvider/RootProvider.js";
5
+ import { NotificationItemBase as r } from "./NotificationItemBase.js";
6
+ import "../Snackbar/useSnackbar.js";
7
+ const x = ({
8
+ loading: m,
9
+ id: e = "notification",
10
+ icon: t,
11
+ title: i,
12
+ description: n,
13
+ ...p
14
+ }) => m ? /* @__PURE__ */ o(r, { icon: t, title: i, loading: !0 }) : /* @__PURE__ */ o(r, { ...p, icon: t, title: i, description: n });
15
+ export {
16
+ x as NotificationItem
17
+ };
@@ -0,0 +1,86 @@
1
+ import { jsx as o, jsxs as r } from "react/jsx-runtime";
2
+ import "../../index-L8X2o7IH.js";
3
+ import "react";
4
+ import "../RootProvider/RootProvider.js";
5
+ import { getAriaLabelFromTitle as j } from "../Menu/MenuItemLabel.js";
6
+ import { ListItemBase as B } from "../List/ListItemBase.js";
7
+ import { ListItemLink as v } from "../List/ListItemLink.js";
8
+ import { ListItemLabel as y } from "../List/ListItemLabel.js";
9
+ import { NotificationItemControls as z } from "./NotificationItemControls.js";
10
+ import { NotificationItemIcon as A } from "./NotificationItemIcon.js";
11
+ import "../Snackbar/useSnackbar.js";
12
+ import '../../assets/NotificationItemBase.css';const C = "_item_w20tn_1", T = "_header_w20tn_24", g = "_link_w20tn_43", q = "_linkFocus_w20tn_47", D = "_controls_w20tn_56", t = {
13
+ item: C,
14
+ header: T,
15
+ link: g,
16
+ linkFocus: q,
17
+ controls: D
18
+ }, U = ({
19
+ as: s,
20
+ href: m,
21
+ ref: n,
22
+ disabled: a,
23
+ loading: e,
24
+ onClick: c,
25
+ onKeyPress: l,
26
+ tabIndex: _,
27
+ color: d,
28
+ variant: p,
29
+ icon: f,
30
+ iconBadge: h,
31
+ label: k,
32
+ title: i,
33
+ description: N,
34
+ highlightWords: L,
35
+ dismissable: b,
36
+ dismissLabel: I,
37
+ onDismiss: u,
38
+ contextMenu: w,
39
+ ...F
40
+ }) => {
41
+ const x = F.ariaLabel || j(i);
42
+ return /* @__PURE__ */ o(B, { ref: n, className: t.item, color: d, variant: p, size: "md", children: /* @__PURE__ */ r("header", { className: t.header, children: [
43
+ /* @__PURE__ */ o(A, { icon: f, badge: h }),
44
+ /* @__PURE__ */ r(
45
+ v,
46
+ {
47
+ as: s,
48
+ href: m,
49
+ onClick: c,
50
+ onKeyPress: l,
51
+ tabIndex: _,
52
+ loading: e,
53
+ disabled: a || e,
54
+ ariaLabel: x,
55
+ className: t.link,
56
+ children: [
57
+ /* @__PURE__ */ o("div", { className: t.linkFocus, "aria-hidden": "true" }),
58
+ /* @__PURE__ */ o(
59
+ y,
60
+ {
61
+ loading: e,
62
+ highlightWords: L,
63
+ className: t.label,
64
+ title: i,
65
+ description: N,
66
+ children: k
67
+ }
68
+ )
69
+ ]
70
+ }
71
+ ),
72
+ /* @__PURE__ */ o(
73
+ z,
74
+ {
75
+ className: t.controls,
76
+ contextMenu: w,
77
+ dismissable: b,
78
+ dismissLabel: I,
79
+ onDismiss: u
80
+ }
81
+ )
82
+ ] }) });
83
+ };
84
+ export {
85
+ U as NotificationItemBase
86
+ };
@@ -0,0 +1,33 @@
1
+ import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
+ import "../../index-L8X2o7IH.js";
3
+ import "react";
4
+ import { IconButton as p } from "../Button/IconButton.js";
5
+ import { ContextMenu as f } from "../ContextMenu/ContextMenu.js";
6
+ import "../RootProvider/RootProvider.js";
7
+ import { ListItemControls as l } from "../List/ListItemControls.js";
8
+ import "../Snackbar/useSnackbar.js";
9
+ import { S as c } from "../../XMark-tKk6aExO.js";
10
+ const S = ({
11
+ className: r,
12
+ loading: i,
13
+ dismissable: m,
14
+ dismissLabel: n,
15
+ onDismiss: s,
16
+ contextMenu: o
17
+ }) => i ? null : /* @__PURE__ */ e(l, { className: r, children: [
18
+ o && /* @__PURE__ */ t(f, { ...o }),
19
+ m && /* @__PURE__ */ t(
20
+ p,
21
+ {
22
+ rounded: !0,
23
+ variant: "text",
24
+ icon: c,
25
+ iconAltText: n || "Dismiss",
26
+ onClick: s,
27
+ size: "xs"
28
+ }
29
+ )
30
+ ] });
31
+ export {
32
+ S as NotificationItemControls
33
+ };
@@ -0,0 +1,33 @@
1
+ import { jsx as r, jsxs as o, Fragment as n } from "react/jsx-runtime";
2
+ import { isValidElement as p } from "react";
3
+ import { Icon as e, isIconProps as i } from "../Icon/Icon.js";
4
+ import "../../index-L8X2o7IH.js";
5
+ import { isAvatarProps as c, Avatar as l } from "../Avatar/Avatar.js";
6
+ import { isAvatarGroupProps as _, AvatarGroup as f } from "../Avatar/AvatarGroup.js";
7
+ import { Badge as v } from "../Badge/Badge.js";
8
+ import "../RootProvider/RootProvider.js";
9
+ import "../Snackbar/useSnackbar.js";
10
+ import { S as d } from "../../XMark-tKk6aExO.js";
11
+ import '../../assets/NotificationItemIcon.css';const u = "_icon_15rz1_1", g = "_shape_15rz1_11", h = "_avatar_15rz1_29", N = "_avatarGroup_15rz1_35", b = "_badge_15rz1_39", s = {
12
+ icon: u,
13
+ shape: g,
14
+ avatar: h,
15
+ avatarGroup: N,
16
+ badge: b
17
+ };
18
+ function z(t) {
19
+ return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null || p(t);
20
+ }
21
+ const B = ({ loading: t, icon: a, badge: m }) => a ? t ? /* @__PURE__ */ r("div", { className: s.icon, children: /* @__PURE__ */ r(e, { svgElement: d, loading: !0 }) }) : /* @__PURE__ */ o("div", { className: s.icon, children: [
22
+ c(a) && /* @__PURE__ */ r(l, { ...a, className: s.avatar }) || _(a) && /* @__PURE__ */ r(f, { ...a, className: s.avatarGroup }) || i(a) && /* @__PURE__ */ o(n, { children: [
23
+ /* @__PURE__ */ r("span", { className: s.shape }),
24
+ /* @__PURE__ */ r(e, { ...a })
25
+ ] }) || z(a) && a || /* @__PURE__ */ o(n, { children: [
26
+ /* @__PURE__ */ r("span", { className: s.shape }),
27
+ /* @__PURE__ */ r(e, { svgElement: a })
28
+ ] }),
29
+ m && /* @__PURE__ */ r(v, { ...m, size: "xs", variant: "base", className: s.badge })
30
+ ] }) : null;
31
+ export {
32
+ B as NotificationItemIcon
33
+ };
@@ -0,0 +1,10 @@
1
+ import { NotificationItem as i } from "./NotificationItem.js";
2
+ import { NotificationItemBase as r } from "./NotificationItemBase.js";
3
+ import { NotificationItemControls as m } from "./NotificationItemControls.js";
4
+ import { NotificationItemIcon as a } from "./NotificationItemIcon.js";
5
+ export {
6
+ i as NotificationItem,
7
+ r as NotificationItemBase,
8
+ m as NotificationItemControls,
9
+ a as NotificationItemIcon
10
+ };
@@ -1,47 +1,59 @@
1
1
  "use client";
2
- import { jsx as I } from "react/jsx-runtime";
3
- import { createContext as g, useState as p, useContext as C } from "react";
2
+ import { jsx as v } from "react/jsx-runtime";
3
+ import { createContext as p, useState as C, useContext as x } from "react";
4
4
  import { useEscapeKey as f } from "../../hooks/useEscapeKey.js";
5
5
  import "../../index-L8X2o7IH.js";
6
- import { SnackbarProvider as x } from "../Snackbar/useSnackbar.js";
7
- const b = {
6
+ import { SnackbarProvider as i } from "../Snackbar/useSnackbar.js";
7
+ const P = {
8
8
  currentId: "",
9
9
  previousId: "",
10
- debug: !1
11
- }, v = g(b), A = ({ children: t, initialValue: o, debug: r }) => {
12
- const [c, d] = p((o == null ? void 0 : o.currentId) || ""), [s, n] = p((o == null ? void 0 : o.previousId) || "");
13
- return /* @__PURE__ */ I(
14
- v.Provider,
10
+ debug: !1,
11
+ setCurrentId: () => {
12
+ console.warn("setCurrentId called outside of RootProvider context");
13
+ },
14
+ setPreviousId: () => {
15
+ console.warn("setPreviousId called outside of RootProvider context");
16
+ },
17
+ languageCode: "nb"
18
+ }, g = p(P), A = ({ children: s, initialValue: o, debug: n, languageCode: t }) => {
19
+ const [d, c] = C((o == null ? void 0 : o.currentId) || ""), [u, r] = C((o == null ? void 0 : o.previousId) || "");
20
+ return /* @__PURE__ */ v(
21
+ g.Provider,
15
22
  {
16
23
  value: {
17
- currentId: c,
18
- setCurrentId: d,
19
- setPreviousId: n,
20
- previousId: s,
21
- debug: r
24
+ currentId: d,
25
+ setCurrentId: c,
26
+ setPreviousId: r,
27
+ previousId: u,
28
+ debug: n,
29
+ languageCode: t
22
30
  },
23
- children: /* @__PURE__ */ I(x, { children: t })
31
+ children: /* @__PURE__ */ v(i, { children: s })
24
32
  }
25
33
  );
26
- }, S = () => {
27
- const { currentId: t, setCurrentId: o, debug: r, setPreviousId: c, previousId: d } = C(v), s = (e) => {
28
- t && c(t), o(e);
29
- }, n = (e) => {
30
- r && console.debug(`useRootContext: toggleId called with value: ${e}`), s(t === e ? "" : e);
31
- }, u = () => {
32
- r && console.debug("useRootContext: closeAll called"), s("");
34
+ }, E = () => {
35
+ const s = x(g);
36
+ if (!s)
37
+ throw new Error("useRootContext must be used within a RootProvider.");
38
+ const { currentId: o, setCurrentId: n, debug: t, setPreviousId: d, previousId: c, languageCode: u } = s, r = (e) => {
39
+ o && d(o), n(e);
40
+ }, l = (e) => {
41
+ t && console.debug(`useRootContext: toggleId called with value: ${e}`), r(o === e ? "" : e);
42
+ }, I = () => {
43
+ t && console.debug("useRootContext: closeAll called"), r("");
33
44
  };
34
- return f(u), {
35
- currentId: t,
36
- previousId: d,
37
- toggleId: n,
38
- closeAll: u,
45
+ return f(I), {
46
+ currentId: o,
47
+ previousId: c,
48
+ toggleId: l,
49
+ closeAll: I,
39
50
  openId: (e) => {
40
- r && console.debug(`useRootContext: openId called with value: ${e}`), s(e);
41
- }
51
+ t && console.debug(`useRootContext: openId called with value: ${e}`), r(e);
52
+ },
53
+ languageCode: u
42
54
  };
43
55
  };
44
56
  export {
45
57
  A as RootProvider,
46
- S as useRootContext
58
+ E as useRootContext
47
59
  };
@@ -1,8 +1,8 @@
1
1
  import { jsxs as S, jsx as g } from "react/jsx-runtime";
2
2
  import { useState as k } from "react";
3
3
  import "../../index-L8X2o7IH.js";
4
- import { useRootContext as v } from "../RootProvider/RootProvider.js";
5
- import { useIsDesktop as j } from "../../hooks/useIsDesktop.js";
4
+ import { useIsDesktop as v } from "../../hooks/useIsDesktop.js";
5
+ import { useRootContext as j } from "../RootProvider/RootProvider.js";
6
6
  import { SearchbarBase as x } from "./SearchbarBase.js";
7
7
  import { SearchbarField as D } from "./SearchbarField.js";
8
8
  import { Autocomplete as P } from "./Autocomplete.js";
@@ -15,7 +15,7 @@ const K = ({
15
15
  tabIndex: T,
16
16
  ...e
17
17
  }) => {
18
- const [i, l] = k(!1), { previousId: A, openId: B } = v(), F = j();
18
+ const [i, l] = k(!1), { previousId: A, openId: B } = j(), F = v();
19
19
  return /* @__PURE__ */ S(
20
20
  x,
21
21
  {
@@ -6,8 +6,8 @@ import { IconButton as z } from "../Button/IconButton.js";
6
6
  import { ButtonGroup as b } from "../Button/ButtonGroup.js";
7
7
  import "../RootProvider/RootProvider.js";
8
8
  import { QueryLabel as S } from "../Searchbar/QueryLabel.js";
9
- import "../Snackbar/useSnackbar.js";
10
9
  import { TextField as h } from "../Forms/TextField.js";
10
+ import "../Snackbar/useSnackbar.js";
11
11
  import { SettingsItemBase as G } from "./SettingsItemBase.js";
12
12
  import { SettingsModal as j } from "./SettingsModal.js";
13
13
  import { S as C } from "../../MagnifyingGlass-bwVhw07z.js";
@@ -2,25 +2,36 @@ import { jsx as i } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import { useState as b } from "react";
4
4
  import "../RootProvider/RootProvider.js";
5
- import "../Snackbar/useSnackbar.js";
6
5
  import { Input as w } from "../Forms/Input.js";
6
+ import "../Snackbar/useSnackbar.js";
7
7
  import { SettingsItemBase as n } from "./SettingsItemBase.js";
8
- import { SettingsModal as x } from "./SettingsModal.js";
8
+ import { SettingsModal as d } from "./SettingsModal.js";
9
9
  const M = ({
10
10
  loading: u,
11
- variant: f = "default",
11
+ variant: h = "default",
12
12
  id: c = "settings",
13
- name: h,
13
+ name: f,
14
14
  checked: m,
15
- onChange: g,
15
+ onChange: v,
16
16
  modalProps: e,
17
- children: v,
17
+ children: g,
18
18
  ...t
19
19
  }) => {
20
20
  const [l, a] = b(!1);
21
21
  if (u)
22
22
  return /* @__PURE__ */ i(n, { icon: t == null ? void 0 : t.icon, title: t == null ? void 0 : t.title, loading: !0 });
23
- switch (f) {
23
+ switch (h) {
24
+ case "link":
25
+ return /* @__PURE__ */ i(
26
+ n,
27
+ {
28
+ ...t,
29
+ title: {
30
+ children: t == null ? void 0 : t.title
31
+ },
32
+ value: void 0
33
+ }
34
+ );
24
35
  case "switch":
25
36
  return /* @__PURE__ */ i(
26
37
  n,
@@ -39,10 +50,10 @@ const M = ({
39
50
  type: "checkbox",
40
51
  role: "switch",
41
52
  "aria-labelledby": c,
42
- name: h,
53
+ name: f,
43
54
  value: t == null ? void 0 : t.value,
44
55
  checked: m,
45
- onChange: g,
56
+ onChange: v,
46
57
  style: { marginRight: "0.5em" }
47
58
  }
48
59
  )
@@ -63,14 +74,14 @@ const M = ({
63
74
  onClick: () => a(!0),
64
75
  expanded: l,
65
76
  children: l && /* @__PURE__ */ i(
66
- x,
77
+ d,
67
78
  {
68
79
  ...e,
69
80
  icon: (e == null ? void 0 : e.icon) || (t == null ? void 0 : t.icon),
70
81
  title: (e == null ? void 0 : e.title) || (t == null ? void 0 : t.title),
71
82
  open: l,
72
83
  onClose: () => a(!1),
73
- children: v
84
+ children: g
74
85
  }
75
86
  )
76
87
  }
@@ -2,9 +2,9 @@ import { jsxs as x, jsx as p } from "react/jsx-runtime";
2
2
  import { createElement as b } from "react";
3
3
  import "../../index-L8X2o7IH.js";
4
4
  import { AccountMenu as k } from "../Account/AccountMenu.js";
5
- import { useRootContext as I } from "../RootProvider/RootProvider.js";
6
- import { DrawerOrDropdown as h } from "../Dropdown/DrawerOrDropdown.js";
7
- import { useIsDesktop as w } from "../../hooks/useIsDesktop.js";
5
+ import { useIsDesktop as I } from "../../hooks/useIsDesktop.js";
6
+ import { useRootContext as h } from "../RootProvider/RootProvider.js";
7
+ import { DrawerOrDropdown as w } from "../Dropdown/DrawerOrDropdown.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
9
  import { ToolbarButton as B } from "./ToolbarButton.js";
10
10
  import { ToolbarFilterBase as C } from "./ToolbarFilterBase.js";
@@ -16,7 +16,7 @@ const q = ({
16
16
  title: l = "Endre aktør",
17
17
  ...n
18
18
  }) => {
19
- const { currentId: i, toggleId: f, closeAll: a } = I(), T = w(), g = () => f(s), r = i === s;
19
+ const { currentId: i, toggleId: f, closeAll: a } = h(), T = I(), g = () => f(s), r = i === s;
20
20
  return /* @__PURE__ */ x(C, { expanded: r, onBlurCapture: (e) => {
21
21
  const m = e.relatedTarget;
22
22
  (!m || !e.currentTarget.contains(m)) && a();
@@ -32,7 +32,7 @@ const q = ({
32
32
  children: o == null ? void 0 : o.name
33
33
  }
34
34
  ),
35
- /* @__PURE__ */ p(h, { open: r, size: "lg", drawerTitle: l, onClose: a, children: /* @__PURE__ */ b(
35
+ /* @__PURE__ */ p(w, { open: r, size: "lg", drawerTitle: l, onClose: a, children: /* @__PURE__ */ b(
36
36
  k,
37
37
  {
38
38
  ...n,
@@ -1,21 +1,21 @@
1
1
  import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
- import { useRootContext as u } from "../RootProvider/RootProvider.js";
5
- import { DrawerOrDropdown as f } from "../Dropdown/DrawerOrDropdown.js";
6
- import { useIsDesktop as g } from "../../hooks/useIsDesktop.js";
4
+ import { useIsDesktop as u } from "../../hooks/useIsDesktop.js";
5
+ import { useRootContext as f } from "../RootProvider/RootProvider.js";
6
+ import { DrawerOrDropdown as g } from "../Dropdown/DrawerOrDropdown.js";
7
7
  import { Menu as x } from "../Menu/Menu.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
9
  import { ToolbarButton as T } from "./ToolbarButton.js";
10
10
  import { ToolbarFilterBase as B } from "./ToolbarFilterBase.js";
11
11
  const v = ({ label: t = "Legg til", items: p, id: e }) => {
12
- const { currentId: i, closeAll: a, toggleId: d } = u(), o = i === e, l = () => d(e), m = g();
12
+ const { currentId: i, closeAll: a, toggleId: d } = f(), o = i === e, l = () => d(e), m = u();
13
13
  return /* @__PURE__ */ c(B, { expanded: o, onBlurCapture: (n) => {
14
14
  const s = n.relatedTarget;
15
15
  (!s || !n.currentTarget.contains(s)) && a();
16
16
  }, children: [
17
17
  /* @__PURE__ */ r(T, { type: "add", onToggle: l, "aria-expanded": o, children: t }),
18
- /* @__PURE__ */ r(f, { drawerTitle: t, open: o, children: /* @__PURE__ */ r(x, { color: "neutral", items: p, keyboardEvents: o && m }) })
18
+ /* @__PURE__ */ r(g, { drawerTitle: t, open: o, children: /* @__PURE__ */ r(x, { color: "neutral", items: p, keyboardEvents: o && m }) })
19
19
  ] });
20
20
  };
21
21
  export {
@@ -1,9 +1,9 @@
1
1
  import { jsxs as D, jsx as i } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
- import { useRootContext as g } from "../RootProvider/RootProvider.js";
5
- import { DrawerOrDropdown as j } from "../Dropdown/DrawerOrDropdown.js";
6
- import { useIsDesktop as F } from "../../hooks/useIsDesktop.js";
4
+ import { useIsDesktop as g } from "../../hooks/useIsDesktop.js";
5
+ import { useRootContext as j } from "../RootProvider/RootProvider.js";
6
+ import { DrawerOrDropdown as F } from "../Dropdown/DrawerOrDropdown.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
8
  import { ToolbarButton as O } from "./ToolbarButton.js";
9
9
  import { ToolbarFilterBase as R } from "./ToolbarFilterBase.js";
@@ -23,7 +23,7 @@ const G = (u, n) => Array.isArray(n) ? n.join(", ") : n, Q = ({
23
23
  optionType: f,
24
24
  id: e = `toolbar-filter-${o}`
25
25
  }) => {
26
- const { currentId: h, toggleId: v, closeAll: d } = g(), I = F(), k = (T ?? []).map((r) => {
26
+ const { currentId: h, toggleId: v, closeAll: d } = j(), I = g(), k = (T ?? []).map((r) => {
27
27
  const t = s == null ? void 0 : s[r.name || o];
28
28
  return {
29
29
  name: o,
@@ -51,7 +51,7 @@ const G = (u, n) => Array.isArray(n) ? n.join(", ") : n, Q = ({
51
51
  }
52
52
  ),
53
53
  /* @__PURE__ */ i(
54
- j,
54
+ F,
55
55
  {
56
56
  open: p,
57
57
  drawerTitle: n,
@@ -3,11 +3,11 @@ import { useRef as K, Fragment as N } from "react";
3
3
  import { useMenu as R } from "../../hooks/useMenu.js";
4
4
  import "../../index-L8X2o7IH.js";
5
5
  import "../RootProvider/RootProvider.js";
6
- import "../Snackbar/useSnackbar.js";
7
6
  import { MenuOption as S } from "../Menu/MenuOption.js";
8
7
  import { MenuSearch as q } from "../Menu/MenuSearch.js";
9
8
  import { MenuHeader as w } from "../Menu/MenuHeader.js";
10
9
  import { MenuBase as z, MenuList as D, MenuListItem as m } from "../Menu/MenuBase.js";
10
+ import "../Snackbar/useSnackbar.js";
11
11
  const G = ({
12
12
  name: k,
13
13
  search: c,
@@ -2,8 +2,8 @@ import { jsx as p } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
4
  import "../RootProvider/RootProvider.js";
5
- import "../Snackbar/useSnackbar.js";
6
5
  import { SearchField as a } from "../Forms/SearchField.js";
6
+ import "../Snackbar/useSnackbar.js";
7
7
  const f = ({
8
8
  value: r,
9
9
  name: o,