@altinn/altinn-components 0.61.1 → 0.61.3

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 (92) hide show
  1. package/dist/assets/HeaderLogo.css +1 -1
  2. package/dist/assets/ItemLink.css +1 -1
  3. package/dist/assets/LayoutBase.css +1 -1
  4. package/dist/assets/SettingsItemBase.css +1 -1
  5. package/dist/assets/SettingsSection.css +1 -1
  6. package/dist/assets/settlingsList.css +1 -0
  7. package/dist/components/Bookmarks/BookmarkSettingsList.js +32 -38
  8. package/dist/components/Footer/FooterLogo.js +1 -1
  9. package/dist/components/GlobalHeader/HeaderLogo.js +1 -1
  10. package/dist/components/GlobalMenu/GlobalMenu.js +57 -40
  11. package/dist/components/Item/ItemLink.js +26 -26
  12. package/dist/components/Layout/Layout.js +27 -29
  13. package/dist/components/Layout/LayoutBase.js +3 -3
  14. package/dist/components/Logo/index.js +4 -0
  15. package/dist/components/Settings/SettingsItem.js +59 -36
  16. package/dist/components/Settings/SettingsItemBase.js +72 -61
  17. package/dist/components/Settings/SettingsList.js +28 -25
  18. package/dist/components/Settings/SettingsSection.js +5 -5
  19. package/dist/components/index.js +355 -377
  20. package/dist/index.js +365 -387
  21. package/dist/settlingsList.module-So3_AYgj.js +8 -0
  22. package/dist/types/lib/components/Account/Account.stories.d.ts +0 -3
  23. package/dist/types/lib/components/Account/AccountList.stories.d.ts +14 -6
  24. package/dist/types/lib/components/ActivityLog/ActivityLog.stories.d.ts +4 -1
  25. package/dist/types/lib/components/Dialog/DialogLayout.d.ts +7 -2
  26. package/dist/types/lib/components/GlobalHeader/GlobalHeader.stories.d.ts +5 -4
  27. package/dist/types/lib/components/GlobalMenu/GlobalMenu.stories.d.ts +9 -12
  28. package/dist/types/lib/components/Item/ItemBase.d.ts +4 -4
  29. package/dist/types/lib/components/Layout/Layout.d.ts +2 -4
  30. package/dist/types/lib/components/Layout/Layout.stories.d.ts +2 -8
  31. package/dist/types/lib/components/Layout/LayoutBase.d.ts +1 -1
  32. package/dist/types/lib/components/Logo/index.d.ts +1 -0
  33. package/dist/types/lib/components/Page/PageNav.d.ts +5 -2
  34. package/dist/types/lib/components/Settings/SettingsItem.d.ts +2 -2
  35. package/dist/types/lib/components/Settings/SettingsItem.stories.d.ts +65 -0
  36. package/dist/types/lib/components/Settings/SettingsItemBase.d.ts +5 -1
  37. package/dist/types/lib/components/Settings/SettingsList.d.ts +2 -1
  38. package/dist/types/lib/components/Settings/VerifySettingsModal.stories.d.ts +2 -0
  39. package/dist/types/lib/components/index.d.ts +2 -2
  40. package/dist/types/lib/stories/Inbox.stories.d.ts +0 -4
  41. package/dist/types/lib/stories/Profile.stories.d.ts +1 -1
  42. package/package.json +1 -1
  43. package/dist/Globe-BcPkcH4E.js +0 -24
  44. package/dist/PadlockLocked-XL1IB5Ae.js +0 -24
  45. package/dist/assets/EndUserLabel.css +0 -1
  46. package/dist/assets/GlobalMenuButton2.css +0 -1
  47. package/dist/assets/Header.css +0 -1
  48. package/dist/assets/HeaderBase.css +0 -1
  49. package/dist/assets/HeaderButton.css +0 -1
  50. package/dist/assets/HeaderGroup.css +0 -1
  51. package/dist/assets/HeaderLogo2.css +0 -1
  52. package/dist/assets/HeaderSearch.css +0 -1
  53. package/dist/assets/LocaleButton.css +0 -1
  54. package/dist/components/GlobalMenu_old/BackButton.js +0 -13
  55. package/dist/components/GlobalMenu_old/CurrentAccount.js +0 -24
  56. package/dist/components/GlobalMenu_old/EndUserLabel.js +0 -32
  57. package/dist/components/GlobalMenu_old/GlobalMenu.js +0 -81
  58. package/dist/components/GlobalMenu_old/GlobalMenuBase.js +0 -10
  59. package/dist/components/GlobalMenu_old/GlobalMenuButton.js +0 -58
  60. package/dist/components/GlobalMenu_old/LogoutButton.js +0 -14
  61. package/dist/components/GlobalMenu_old/index.js +0 -14
  62. package/dist/components/Header/Header.js +0 -101
  63. package/dist/components/Header/HeaderBase.js +0 -19
  64. package/dist/components/Header/HeaderButton.js +0 -51
  65. package/dist/components/Header/HeaderGroup.js +0 -8
  66. package/dist/components/Header/HeaderLogo.js +0 -17
  67. package/dist/components/Header/HeaderSearch.js +0 -12
  68. package/dist/components/Header/LocaleButton.js +0 -29
  69. package/dist/components/Header/LocaleSwitcher.js +0 -44
  70. package/dist/components/Header/index.js +0 -18
  71. package/dist/types/lib/components/GlobalMenu_old/BackButton.d.ts +0 -7
  72. package/dist/types/lib/components/GlobalMenu_old/CurrentAccount.d.ts +0 -16
  73. package/dist/types/lib/components/GlobalMenu_old/EndUserLabel.d.ts +0 -5
  74. package/dist/types/lib/components/GlobalMenu_old/GlobalMenu.d.ts +0 -18
  75. package/dist/types/lib/components/GlobalMenu_old/GlobalMenuBase.d.ts +0 -15
  76. package/dist/types/lib/components/GlobalMenu_old/GlobalMenuButton.d.ts +0 -13
  77. package/dist/types/lib/components/GlobalMenu_old/LogoutButton.d.ts +0 -7
  78. package/dist/types/lib/components/GlobalMenu_old/index.d.ts +0 -6
  79. package/dist/types/lib/components/Header/Header.d.ts +0 -18
  80. package/dist/types/lib/components/Header/Header.stories.d.ts +0 -29
  81. package/dist/types/lib/components/Header/HeaderBase.d.ts +0 -9
  82. package/dist/types/lib/components/Header/HeaderButton.d.ts +0 -11
  83. package/dist/types/lib/components/Header/HeaderButton.stories.d.ts +0 -17
  84. package/dist/types/lib/components/Header/HeaderGroup.d.ts +0 -7
  85. package/dist/types/lib/components/Header/HeaderLogo.d.ts +0 -11
  86. package/dist/types/lib/components/Header/HeaderSearch.d.ts +0 -7
  87. package/dist/types/lib/components/Header/LocaleButton.d.ts +0 -8
  88. package/dist/types/lib/components/Header/LocaleSwitcher.d.ts +0 -7
  89. package/dist/types/lib/components/Header/index.d.ts +0 -8
  90. package/dist/types/lib/stories/Beta/Beta.stories.d.ts +0 -15
  91. /package/dist/components/{Header → Logo}/DigdirLogomark.js +0 -0
  92. /package/dist/types/lib/components/{Header → Logo}/DigdirLogomark.d.ts +0 -0
@@ -1,81 +0,0 @@
1
- "use client";
2
- import { jsxs as m, jsx as r, Fragment as C } from "react/jsx-runtime";
3
- import { useState as G, useMemo as S } from "react";
4
- import "../../index-p1eeF8LQ.js";
5
- import { AccountMenu as x } from "../Account/AccountMenu.js";
6
- import { M as f } from "../../ToolbarSearch-56Sm2j7P.js";
7
- import "../Typography/Link.js";
8
- import { MenuListItem as h } from "../Menu/MenuListItem.js";
9
- import "../Button/Button.js";
10
- import "react-dom";
11
- import { CurrentAccount as y } from "./CurrentAccount.js";
12
- import { BackButton as j } from "./BackButton.js";
13
- import { LogoutButton as k } from "./LogoutButton.js";
14
- import "../Snackbar/useSnackbar.js";
15
- import { GlobalMenuBase as a, GlobalMenuHeader as B, GlobalMenuFooter as M } from "./GlobalMenuBase.js";
16
- const N = ({
17
- accountMenu: t,
18
- menu: i,
19
- backLabel: b = "Back",
20
- currentAccount: e,
21
- onSelectAccount: g,
22
- onClose: l,
23
- logoutButton: s,
24
- ariaLabel: c = "Menu"
25
- }) => {
26
- const [A, v] = G(!1), n = () => {
27
- v((o) => !o);
28
- }, u = (o) => {
29
- n(), l?.(), g?.(o);
30
- }, p = S(() => (i?.items ?? []).map((o) => ({
31
- ...o,
32
- onClick: () => {
33
- o.onClick?.(), l?.();
34
- },
35
- items: Array.isArray(o.items) ? o.items.map((d) => ({
36
- ...d,
37
- onClick: () => {
38
- d.onClick?.(), l?.();
39
- }
40
- })) : void 0
41
- })), [i, l]);
42
- if (A)
43
- return /* @__PURE__ */ m(a, { "aria-label": c, children: [
44
- /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r(j, { onClick: n, label: b }) }),
45
- /* @__PURE__ */ r(h, { as: "div", role: "separator" }),
46
- t && /* @__PURE__ */ r(
47
- x,
48
- {
49
- ...t,
50
- currentAccount: e,
51
- onSelectAccount: u
52
- }
53
- )
54
- ] });
55
- if (e) {
56
- const o = t && t?.items?.length > 1;
57
- return /* @__PURE__ */ m(a, { "aria-label": c, color: e?.type, children: [
58
- e && /* @__PURE__ */ m(C, { children: [
59
- /* @__PURE__ */ r(
60
- y,
61
- {
62
- account: e,
63
- multipleAccounts: o,
64
- as: o ? "button" : "div",
65
- onClick: o ? n : void 0
66
- }
67
- ),
68
- /* @__PURE__ */ r(h, { as: "div", role: "separator" })
69
- ] }),
70
- i && /* @__PURE__ */ r(f, { ...i, items: p }),
71
- s && /* @__PURE__ */ r(M, { children: /* @__PURE__ */ r(k, { ...s }) })
72
- ] });
73
- }
74
- return /* @__PURE__ */ m(a, { "aria-label": c, children: [
75
- i && /* @__PURE__ */ r(f, { ...i, items: p }),
76
- s && /* @__PURE__ */ r(M, { children: /* @__PURE__ */ r(k, { ...s }) })
77
- ] });
78
- };
79
- export {
80
- N as GlobalMenu_old
81
- };
@@ -1,10 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import '../../assets/GlobalMenuBase.css';const n = "_nav_b7k4e_1", s = "_footer_b7k4e_6", a = {
3
- nav: n,
4
- footer: s
5
- }, c = ({ color: e, children: r, ...t }) => /* @__PURE__ */ o("nav", { className: a.nav, "data-color": e, ...t, children: r }), f = ({ children: e }) => /* @__PURE__ */ o("header", { className: a.header, children: e }), u = ({ children: e }) => /* @__PURE__ */ o("footer", { className: a.footer, children: e });
6
- export {
7
- c as GlobalMenuBase,
8
- u as GlobalMenuFooter,
9
- f as GlobalMenuHeader
10
- };
@@ -1,58 +0,0 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { c as l } from "../../index-p1eeF8LQ.js";
3
- import { s as f, B as _ } from "../../ToolbarSearch-56Sm2j7P.js";
4
- import { Avatar as N } from "../Avatar/Avatar.js";
5
- import "react";
6
- import "../Typography/Link.js";
7
- import { Button as u } from "../Button/Button.js";
8
- import { ButtonIcon as I } from "../Button/ButtonIcon.js";
9
- import { ButtonLabel as h } from "../Button/ButtonLabel.js";
10
- import "react-dom";
11
- import "../Snackbar/useSnackbar.js";
12
- import { S as g } from "../../PadlockLocked-XL1IB5Ae.js";
13
- import '../../assets/GlobalMenuButton2.css';const v = "_button_1uh95_1", b = "_avatarIcon_1uh95_19", B = "_loginIcon_1uh95_20", x = "_closeIcon_1uh95_21", k = "_avatar_1uh95_19", L = "_icon_1uh95_44", M = "_badge_1uh95_50", a = {
14
- button: v,
15
- avatarIcon: b,
16
- loginIcon: B,
17
- closeIcon: x,
18
- avatar: k,
19
- icon: L,
20
- badge: M
21
- }, F = ({
22
- className: c,
23
- as: t = "button",
24
- color: s = "company",
25
- variant: r = "solid",
26
- currentAccount: d,
27
- expanded: p,
28
- label: i = "Menu",
29
- badge: n,
30
- ...e
31
- }) => p ? /* @__PURE__ */ m(u, { ...e, as: t, variant: r, color: s, className: l(a.button, c), children: [
32
- /* @__PURE__ */ o(h, { children: i }),
33
- /* @__PURE__ */ o(I, { className: a.closeIcon, icon: /* @__PURE__ */ o(f, { className: a.icon, "aria-label": "Close Icon" }) }),
34
- n && /* @__PURE__ */ o(_, { ...n, className: a.badge })
35
- ] }) : d ? /* @__PURE__ */ m(u, { ...e, as: t, variant: r, color: s, className: l(a.button, c), children: [
36
- /* @__PURE__ */ o(h, { children: i }),
37
- /* @__PURE__ */ o(
38
- I,
39
- {
40
- className: a.avatarIcon,
41
- icon: /* @__PURE__ */ o(N, { ...d?.icon, className: a.avatar })
42
- }
43
- ),
44
- n && /* @__PURE__ */ o(_, { ...n, className: a.badge })
45
- ] }) : /* @__PURE__ */ m(u, { ...e, as: t, variant: r, color: s, className: l(a.button, c), children: [
46
- /* @__PURE__ */ o(h, { children: i }),
47
- /* @__PURE__ */ o(
48
- I,
49
- {
50
- className: a.loginIcon,
51
- icon: /* @__PURE__ */ o(g, { className: a.icon, "aria-label": "Login Icon" })
52
- }
53
- ),
54
- n && /* @__PURE__ */ o(_, { ...n, className: a.badge })
55
- ] });
56
- export {
57
- F as GlobalMenuButton_old
58
- };
@@ -1,14 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { Button as i } from "../Button/Button.js";
3
- import "../../index-p1eeF8LQ.js";
4
- import "react";
5
- import "../../ToolbarSearch-56Sm2j7P.js";
6
- import "../Typography/Link.js";
7
- import "react-dom";
8
- import "../Snackbar/useSnackbar.js";
9
- import '../../assets/LogoutButton.css';const m = "_button_1260s_1", s = {
10
- button: m
11
- }, _ = ({ label: t = "Logout", children: o, onClick: r }) => /* @__PURE__ */ n(i, { className: s.button, variant: "outline", size: "lg", onClick: r, children: o || t });
12
- export {
13
- _ as LogoutButton
14
- };
@@ -1,14 +0,0 @@
1
- import { CurrentAccount as t } from "./CurrentAccount.js";
2
- import { BackButton as n } from "./BackButton.js";
3
- import { LogoutButton as l } from "./LogoutButton.js";
4
- import { EndUserLabel as m } from "./EndUserLabel.js";
5
- import { GlobalMenu_old as x } from "./GlobalMenu.js";
6
- import { GlobalMenuButton_old as B } from "./GlobalMenuButton.js";
7
- export {
8
- n as BackButton,
9
- t as CurrentAccount,
10
- m as EndUserLabel,
11
- B as GlobalMenuButton_old,
12
- x as GlobalMenu_old,
13
- l as LogoutButton
14
- };
@@ -1,101 +0,0 @@
1
- "use client";
2
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
3
- import "../../index-p1eeF8LQ.js";
4
- import "react";
5
- import { useIsDesktop as H } from "../../hooks/useIsDesktop.js";
6
- import { u as S } from "../../ToolbarSearch-56Sm2j7P.js";
7
- import "../Typography/Link.js";
8
- import { DropdownBase as k } from "../Dropdown/DropdownBase.js";
9
- import "../Button/Button.js";
10
- import "react-dom";
11
- import { DrawerBase as B } from "../Dropdown/DrawerBase.js";
12
- import { GlobalMenu_old as u } from "../GlobalMenu_old/GlobalMenu.js";
13
- import { GlobalMenuButton_old as D } from "../GlobalMenu_old/GlobalMenuButton.js";
14
- import { HeaderBase as I } from "./HeaderBase.js";
15
- import { HeaderLogo as F } from "./HeaderLogo.js";
16
- import { HeaderGroup as G } from "./HeaderGroup.js";
17
- import { HeaderSearch as h } from "./HeaderSearch.js";
18
- import { LocaleSwitcher as L } from "./LocaleSwitcher.js";
19
- import { Searchbar as f } from "../Searchbar/Searchbar.js";
20
- import "../Snackbar/useSnackbar.js";
21
- import '../../assets/Header.css';const N = "_drawer_afyu3_1", g = "_dropdown_afyu3_6", j = "_relative_afyu3_19", d = {
22
- drawer: N,
23
- dropdown: g,
24
- relative: j
25
- }, M = ({
26
- globalMenu: r,
27
- desktopMenu: w,
28
- mobileMenu: _,
29
- locale: a,
30
- search: n,
31
- currentAccount: s,
32
- logo: x = {},
33
- badge: C
34
- }) => {
35
- const { currentId: e, toggleId: p, openId: v, closeAll: t } = S(), i = () => {
36
- v("search");
37
- }, c = () => {
38
- p("search");
39
- }, y = () => {
40
- p("menu");
41
- }, l = H();
42
- return /* @__PURE__ */ m(
43
- I,
44
- {
45
- currentId: e,
46
- open: e === "search" || e === "menu" || e === "locale",
47
- onClose: t,
48
- children: [
49
- /* @__PURE__ */ o(F, { ...x, badge: C }),
50
- n && l && /* @__PURE__ */ o(h, { expanded: e === "search", children: /* @__PURE__ */ o(f, { ...n, expanded: e === "search", onClose: c, onFocus: i }) }),
51
- /* @__PURE__ */ m(G, { children: [
52
- a && /* @__PURE__ */ o(L, { ...a }),
53
- /* @__PURE__ */ m("div", { className: d.relative, children: [
54
- /* @__PURE__ */ o(
55
- D,
56
- {
57
- currentAccount: s,
58
- onClick: y,
59
- expanded: e === "menu",
60
- label: r?.menuLabel
61
- }
62
- ),
63
- r && /* @__PURE__ */ o(
64
- k,
65
- {
66
- layout: "desktop",
67
- padding: !0,
68
- size: "lg",
69
- placement: "right",
70
- open: e === "menu",
71
- className: d.dropdown,
72
- children: /* @__PURE__ */ o(
73
- u,
74
- {
75
- ...r,
76
- menu: w || r?.menu,
77
- currentAccount: s,
78
- onClose: t
79
- }
80
- )
81
- }
82
- )
83
- ] })
84
- ] }),
85
- n && !l && /* @__PURE__ */ o(h, { expanded: e === "search", children: /* @__PURE__ */ o(f, { ...n, expanded: e === "search", onClose: c, onFocus: i }) }),
86
- r && /* @__PURE__ */ o(B, { open: e === "menu", className: d.drawer, children: /* @__PURE__ */ o(
87
- u,
88
- {
89
- ...r,
90
- menu: _ || r?.menu,
91
- currentAccount: s,
92
- onClose: t
93
- }
94
- ) })
95
- ]
96
- }
97
- );
98
- };
99
- export {
100
- M as Header
101
- };
@@ -1,19 +0,0 @@
1
- import { jsxs as d, jsx as p } from "react/jsx-runtime";
2
- import { c as s } from "../../index-p1eeF8LQ.js";
3
- import "react";
4
- import "../../ToolbarSearch-56Sm2j7P.js";
5
- import "../Typography/Link.js";
6
- import "../Button/Button.js";
7
- import "react-dom";
8
- import { Backdrop as m } from "../Dropdown/Backdrop.js";
9
- import "../Snackbar/useSnackbar.js";
10
- import '../../assets/HeaderBase.css';const i = "_header_dg4o1_1", n = "_backdrop_dg4o1_17", r = {
11
- header: i,
12
- backdrop: n
13
- }, u = ({ currentId: o, className: e, children: a, open: t, onClose: c }) => /* @__PURE__ */ d("header", { className: s(r.header, e), "data-current-id": o, children: [
14
- t && /* @__PURE__ */ p(m, { className: r.backdrop, onClick: c }),
15
- a
16
- ] });
17
- export {
18
- u as HeaderBase
19
- };
@@ -1,51 +0,0 @@
1
- import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
- import { c as s } from "../../index-p1eeF8LQ.js";
3
- import { Avatar as I } from "../Avatar/Avatar.js";
4
- import { AvatarGroup as b } from "../Avatar/AvatarGroup.js";
5
- import { I as N, s as g, B as p } from "../../ToolbarSearch-56Sm2j7P.js";
6
- import { Button as _ } from "../Button/Button.js";
7
- import "react";
8
- import "../Typography/Link.js";
9
- import "react-dom";
10
- import "../Snackbar/useSnackbar.js";
11
- import { S as q } from "../../PadlockLocked-XL1IB5Ae.js";
12
- import '../../assets/HeaderButton.css';const y = "_button_1p2eq_1", v = "_label_1p2eq_12", x = "_icon_1p2eq_18", B = "_avatarGroup_1p2eq_28", G = "_loginIcon_1p2eq_37", S = "_closeIcon_1p2eq_42", k = "_badge_1p2eq_46", e = {
13
- button: y,
14
- label: v,
15
- icon: x,
16
- avatarGroup: B,
17
- loginIcon: G,
18
- closeIcon: S,
19
- badge: k
20
- }, F = ({
21
- className: c,
22
- as: t = "button",
23
- color: a = "company",
24
- variant: l = "solid",
25
- avatar: u,
26
- avatarGroup: d,
27
- icon: f = q,
28
- expanded: h,
29
- label: r = "Menu",
30
- badge: o,
31
- ...m
32
- }) => h ? /* @__PURE__ */ i(_, { ...m, as: t, variant: l, color: a, className: s(e.button, c), children: [
33
- /* @__PURE__ */ n("span", { className: e.label, children: r }),
34
- /* @__PURE__ */ n("span", { className: s(e.icon, e.closeIcon), children: /* @__PURE__ */ n(N, { svgElement: g }) }),
35
- o && /* @__PURE__ */ n(p, { ...o, className: e.badge })
36
- ] }) : d ? /* @__PURE__ */ i(_, { ...m, as: t, variant: l, color: a, className: s(e.button, c), children: [
37
- /* @__PURE__ */ n("span", { className: e.label, children: r }),
38
- /* @__PURE__ */ n(b, { ...d, className: e.avatarGroup }),
39
- o && /* @__PURE__ */ n(p, { ...o, className: e.badge })
40
- ] }) : u ? /* @__PURE__ */ i(_, { ...m, as: t, variant: l, color: a, className: s(e.button, c), children: [
41
- /* @__PURE__ */ n("span", { className: e.label, children: r }),
42
- /* @__PURE__ */ n(I, { type: u?.type, name: u?.name, style: { fontSize: "2.25rem" } }),
43
- o && /* @__PURE__ */ n(p, { ...o, className: e.badge })
44
- ] }) : /* @__PURE__ */ i(_, { ...m, as: t, variant: l, color: a, className: s(e.button, c), children: [
45
- /* @__PURE__ */ n("span", { className: e.label, children: r }),
46
- /* @__PURE__ */ n("span", { className: s(e.icon, e.loginIcon), children: /* @__PURE__ */ n(N, { svgElement: f }) }),
47
- o && /* @__PURE__ */ n(p, { ...o, className: e.badge })
48
- ] });
49
- export {
50
- F as HeaderButton
51
- };
@@ -1,8 +0,0 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { c as p } from "../../index-p1eeF8LQ.js";
3
- import '../../assets/HeaderGroup.css';const t = "_group_oia4i_1", c = {
4
- group: t
5
- }, a = ({ className: o, children: r }) => /* @__PURE__ */ s("div", { className: p(c.group, o), children: r });
6
- export {
7
- a as HeaderGroup
8
- };
@@ -1,17 +0,0 @@
1
- import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
- import { c } from "../../index-p1eeF8LQ.js";
3
- import { B as i } from "../../ToolbarSearch-56Sm2j7P.js";
4
- import { DigdirLogomark as _ } from "./DigdirLogomark.js";
5
- import '../../assets/HeaderLogo.css';const g = "_logo_mt7vd_1", p = "_symbol_mt7vd_8", x = "_text_mt7vd_26", t = {
6
- logo: g,
7
- symbol: p,
8
- text: x
9
- }, h = ({ className: m, as: n = "a", title: r = "Altinn", href: e = "/", onClick: l, badge: s }) => /* @__PURE__ */ a(n, { variant: "ghost", className: c(t.logo, m), href: e, onClick: l, children: [
10
- /* @__PURE__ */ o(_, { className: t.symbol }),
11
- /* @__PURE__ */ o("span", { className: t.text, children: r }),
12
- " ",
13
- s && /* @__PURE__ */ o(i, { ...s })
14
- ] });
15
- export {
16
- h as HeaderLogo
17
- };
@@ -1,12 +0,0 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { c as h } from "../../index-p1eeF8LQ.js";
3
- import '../../assets/HeaderSearch.css';const t = "_search_1czaf_1", n = "_searchExpanded_1czaf_5", e = {
4
- search: t,
5
- searchExpanded: n
6
- }, x = ({ expanded: a = !1, className: s, children: c }) => {
7
- const r = h(e.search, s, a && e.searchExpanded);
8
- return /* @__PURE__ */ d("div", { className: r, children: c });
9
- };
10
- export {
11
- x as HeaderSearch
12
- };
@@ -1,29 +0,0 @@
1
- "use client";
2
- import { jsx as t } from "react/jsx-runtime";
3
- import { c as m } from "../../index-p1eeF8LQ.js";
4
- import "react";
5
- import "../../ToolbarSearch-56Sm2j7P.js";
6
- import "../Typography/Link.js";
7
- import { Button as i } from "../Button/Button.js";
8
- import "react-dom";
9
- import "../Snackbar/useSnackbar.js";
10
- import { S as p } from "../../Globe-BcPkcH4E.js";
11
- import '../../assets/LocaleButton.css';const s = "_button_mvy87_1", c = "_expanded_mvy87_13", o = {
12
- button: s,
13
- expanded: c
14
- }, h = ({ id: e = "language-switcher", expanded: r, onClick: n, onBlurCapture: a }) => /* @__PURE__ */ t(
15
- i,
16
- {
17
- className: m(o.button, r && o.expanded),
18
- rounded: !0,
19
- size: "lg",
20
- variant: "ghost",
21
- onClick: n,
22
- "aria-label": `Open ${e}`,
23
- onBlurCapture: a,
24
- children: /* @__PURE__ */ t(p, {})
25
- }
26
- );
27
- export {
28
- h as LocaleButton
29
- };
@@ -1,44 +0,0 @@
1
- "use client";
2
- import { jsx as r, jsxs as f } from "react/jsx-runtime";
3
- import { useRef as k, useMemo as h } from "react";
4
- import { useEnterKey as v } from "../../hooks/useEnterKey.js";
5
- import { useIsDesktop as b } from "../../hooks/useIsDesktop.js";
6
- import { DropdownBase as x } from "../Dropdown/DropdownBase.js";
7
- import "../../index-p1eeF8LQ.js";
8
- import "react-dom";
9
- import "../Button/Button.js";
10
- import { u as I, r as w, l as p } from "../../ToolbarSearch-56Sm2j7P.js";
11
- import "../Typography/Link.js";
12
- import { LocaleButton as C } from "./LocaleButton.js";
13
- import "../Snackbar/useSnackbar.js";
14
- import { DrawerBase as S } from "../Dropdown/DrawerBase.js";
15
- const z = ({ title: m = "Select language", options: s, onSelect: a }) => {
16
- const i = k(null), c = b(), { currentId: d, toggleId: g, closeAll: n } = I(), o = d === "locale", l = h(() => s.map((e) => ({
17
- ...e,
18
- id: String(e.value),
19
- tabIndex: 0,
20
- groupId: "locales",
21
- icon: e.checked ? w : /* @__PURE__ */ r("span", { "aria-hidden": "true" }),
22
- onClick: () => {
23
- a?.(String(e.value)), n();
24
- }
25
- })), [s, a]), u = {
26
- locales: { title: m || "Språk/language" }
27
- };
28
- return v((e) => {
29
- if (o) {
30
- e.preventDefault();
31
- const t = i.current?.querySelector('[data-active="true"]');
32
- t && (t.tagName === "A" && t.hasAttribute("href") ? t.click() : t.dispatchEvent(new MouseEvent("click", { bubbles: !0 }))), n();
33
- }
34
- }), /* @__PURE__ */ f("div", { ref: i, "data-testid": "locale-switcher", children: [
35
- /* @__PURE__ */ r(C, { onClick: () => g("locale"), expanded: o, onBlurCapture: (e) => {
36
- e?.relatedTarget?.closest('[data-testid="locale-switcher"]') || n();
37
- } }),
38
- o && c && /* @__PURE__ */ r(x, { layout: "desktop", padding: !0, placement: "right", open: !0, children: /* @__PURE__ */ r(p, { groups: u, items: l, keyboardEvents: !1 }) }),
39
- o && !c && /* @__PURE__ */ r(S, { open: !0, placement: "bottom", children: /* @__PURE__ */ r(p, { groups: u, items: l, keyboardEvents: !1 }) })
40
- ] });
41
- };
42
- export {
43
- z as LocaleSwitcher
44
- };
@@ -1,18 +0,0 @@
1
- import { Header as o } from "./Header.js";
2
- import { HeaderBase as a } from "./HeaderBase.js";
3
- import { HeaderLogo as f } from "./HeaderLogo.js";
4
- import { HeaderButton as x } from "./HeaderButton.js";
5
- import { HeaderGroup as H } from "./HeaderGroup.js";
6
- import { HeaderSearch as u } from "./HeaderSearch.js";
7
- import { LocaleButton as L } from "./LocaleButton.js";
8
- import { LocaleSwitcher as l } from "./LocaleSwitcher.js";
9
- export {
10
- o as Header,
11
- a as HeaderBase,
12
- x as HeaderButton,
13
- H as HeaderGroup,
14
- f as HeaderLogo,
15
- u as HeaderSearch,
16
- L as LocaleButton,
17
- l as LocaleSwitcher
18
- };
@@ -1,7 +0,0 @@
1
- import { ElementType } from 'react';
2
- export interface BackButtonProps {
3
- label: string;
4
- onClick?: () => void;
5
- as?: ElementType;
6
- }
7
- export declare const BackButton: ({ label, onClick, as }: BackButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,16 +0,0 @@
1
- import { AvatarProps } from '..';
2
- export type Account = {
3
- id: string;
4
- type: 'person' | 'company';
5
- icon?: AvatarProps;
6
- name: string;
7
- description?: string;
8
- };
9
- export type CurrentAccountProps = {
10
- account: Account;
11
- description?: string;
12
- as?: 'button' | 'div';
13
- onClick?: () => void;
14
- multipleAccounts?: boolean;
15
- };
16
- export declare const CurrentAccount: ({ account, multipleAccounts, as, onClick }: CurrentAccountProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface EndUserLabelProps {
3
- children: ReactNode;
4
- }
5
- export declare const EndUserLabel: ({ children }: EndUserLabelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,18 +0,0 @@
1
- import { Account, AccountMenuProps } from '..';
2
- import { MenuProps } from '../Menu';
3
- import { LogoutButtonProps } from './LogoutButton';
4
- export interface GlobalMenuProps_old {
5
- accountMenu?: AccountMenuProps;
6
- menu?: MenuProps;
7
- menuLabel?: string;
8
- backLabel?: string;
9
- logoutButton?: LogoutButtonProps;
10
- changeLabel?: string;
11
- className?: string;
12
- currentAccount?: Account;
13
- currentEndUserLabel?: string;
14
- onSelectAccount?: (id: string) => void;
15
- onClose?: () => void;
16
- ariaLabel?: string;
17
- }
18
- export declare const GlobalMenu_old: ({ accountMenu, menu, backLabel, currentAccount, onSelectAccount, onClose, logoutButton, ariaLabel, }: GlobalMenuProps_old) => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { Color } from '..';
3
- export type GlobalMenuBaseProps = {
4
- color?: Color;
5
- children: ReactNode;
6
- } & React.HTMLAttributes<HTMLElement>;
7
- export interface GlobalMenuHeaderProps {
8
- children: ReactNode;
9
- }
10
- export interface GlobalMenuFooterProps {
11
- children: ReactNode;
12
- }
13
- export declare const GlobalMenuBase: ({ color, children, ...rest }: GlobalMenuBaseProps) => import("react/jsx-runtime").JSX.Element;
14
- export declare const GlobalMenuHeader: ({ children }: GlobalMenuHeaderProps) => import("react/jsx-runtime").JSX.Element;
15
- export declare const GlobalMenuFooter: ({ children }: GlobalMenuFooterProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,13 +0,0 @@
1
- import { ElementType } from 'react';
2
- import { Account, ButtonProps } from '..';
3
- import { BadgeProps } from '../Badge';
4
- export interface GlobalMenuButtonProps_old extends ButtonProps {
5
- currentAccount?: Account;
6
- label?: string;
7
- as?: ElementType;
8
- className?: string;
9
- expanded?: boolean;
10
- badge?: BadgeProps | undefined;
11
- tabIndex?: number;
12
- }
13
- export declare const GlobalMenuButton_old: ({ className, as, color, variant, currentAccount, expanded, label, badge, ...buttonProps }: GlobalMenuButtonProps_old) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- import { MouseEventHandler, ReactNode } from 'react';
2
- export interface LogoutButtonProps {
3
- label?: string;
4
- children?: ReactNode;
5
- onClick?: MouseEventHandler;
6
- }
7
- export declare const LogoutButton: ({ label, children, onClick }: LogoutButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- export * from './CurrentAccount';
2
- export * from './BackButton';
3
- export * from './LogoutButton';
4
- export * from './EndUserLabel';
5
- export * from './GlobalMenu';
6
- export * from './GlobalMenuButton';
@@ -1,18 +0,0 @@
1
- import { HeaderLogoProps, MenuProps } from '../';
2
- import { BadgeProps } from '../Badge';
3
- import { GlobalMenuProps_old, Account } from '../GlobalMenu_old';
4
- import { SearchbarProps } from '../Searchbar';
5
- import { LocaleSwitcherProps } from './';
6
- export interface HeaderProps {
7
- globalMenu: GlobalMenuProps_old;
8
- /** Use to override globalMenu.menu on desktop */
9
- desktopMenu?: MenuProps;
10
- /** Use to override globalMenu.menu on mobile */
11
- mobileMenu?: MenuProps;
12
- locale?: LocaleSwitcherProps;
13
- search?: SearchbarProps;
14
- currentAccount?: Account;
15
- badge?: BadgeProps | undefined;
16
- logo?: HeaderLogoProps;
17
- }
18
- export declare const Header: ({ globalMenu, desktopMenu, mobileMenu, locale, search, currentAccount, logo, badge, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,29 +0,0 @@
1
- import { HeaderProps } from '../';
2
- declare const meta: {
3
- title: string;
4
- component: ({ globalMenu, desktopMenu, mobileMenu, locale, search, currentAccount, logo, badge, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
5
- tags: string[];
6
- parameters: {
7
- layout: string;
8
- };
9
- args: {
10
- search: {
11
- name: string;
12
- placeholder: string;
13
- };
14
- globalMenu: import('../GlobalMenu_old').GlobalMenuProps_old;
15
- desktopMenu?: import('../Menu').MenuProps;
16
- mobileMenu?: import('../Menu').MenuProps;
17
- locale?: import('./LocaleSwitcher').LocaleSwitcherProps;
18
- currentAccount?: import('../GlobalMenu_old').Account;
19
- badge?: import('../Badge').BadgeProps | undefined;
20
- logo?: import('./HeaderLogo').HeaderLogoProps;
21
- };
22
- };
23
- export default meta;
24
- export declare const Login: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
25
- export declare const CurrentAccount: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
26
- export declare const CompanyAccount: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
27
- export declare const SubcompanyAccount: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
28
- export declare const MobileMenu: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
29
- export declare const WithCustomBadge: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface HeaderBaseProps {
3
- currentId?: string;
4
- className?: string;
5
- children?: ReactNode;
6
- open?: boolean;
7
- onClose?: () => void;
8
- }
9
- export declare const HeaderBase: ({ currentId, className, children, open, onClose }: HeaderBaseProps) => import("react/jsx-runtime").JSX.Element;