@altinn/altinn-components 0.43.8 → 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.
- package/dist/ArrowUndo-hge1gMu8.js +24 -0
- package/dist/Button-B0t0vz2h.js +23 -0
- package/dist/Globe-BcPkcH4E.js +24 -0
- package/dist/Heading-By5DKz2H.js +12 -0
- package/dist/HeartFill-CYSrJ_xK.js +43 -0
- package/dist/PersonCircle-DlX_3kRO.js +24 -0
- package/dist/Spinner-BDXfwXIh.js +26 -0
- package/dist/assets/AccountMenuButton.css +1 -0
- package/dist/assets/AccountSelector.css +1 -0
- package/dist/assets/GlobalHeader.css +1 -0
- package/dist/assets/GlobalHeaderBase.css +1 -0
- package/dist/assets/GlobalMenuButton2.css +1 -0
- package/dist/assets/HeaderGroup2.css +1 -0
- package/dist/assets/HeaderLogo2.css +1 -0
- package/dist/assets/LayoutBody.css +1 -1
- package/dist/assets/NotificationItemBase.css +1 -0
- package/dist/assets/NotificationItemIcon.css +1 -0
- package/dist/assets/globalSearch.css +1 -0
- package/dist/components/Account/AccountListItemControls.js +22 -58
- package/dist/components/Account/AccountMenu.js +40 -36
- package/dist/components/Account/AccountMenuButton.js +131 -0
- package/dist/components/Account/AccountNotificationSettings.js +1 -1
- package/dist/components/Avatar/Avatar.js +23 -22
- package/dist/components/Bookmarks/BookmarksListItem.js +9 -7
- package/dist/components/Bookmarks/BookmarksSection.js +23 -27
- package/dist/components/Bookmarks/EditableBookmark.js +78 -63
- package/dist/components/Dashboard/DashboardHeader.js +1 -1
- package/dist/components/Dropdown/DrawerBase.js +17 -15
- package/dist/components/Dropdown/DropdownBase.js +14 -12
- package/dist/components/Dropdown/FloatingDropdown.js +6 -6
- package/dist/components/DsComponents/index.js +26 -22
- package/dist/components/Forms/Checkbox.js +1 -1
- package/dist/components/Forms/CheckboxOptions.js +1 -1
- package/dist/components/Forms/FieldBase.js +1 -1
- package/dist/components/Forms/FieldsetBase.js +1 -1
- package/dist/components/Forms/Radio.js +1 -1
- package/dist/components/Forms/RadioOptions.js +1 -1
- package/dist/components/Forms/SearchField.js +1 -1
- package/dist/components/Forms/SelectField.js +1 -1
- package/dist/components/Forms/Switch.js +1 -1
- package/dist/components/Forms/SwitchOptions.js +1 -1
- package/dist/components/Forms/TextField.js +1 -1
- package/dist/components/Forms/TextareaField.js +1 -1
- package/dist/components/GlobalHeader/AccountSelector.js +138 -0
- package/dist/components/GlobalHeader/DigdirLogomark.js +109 -0
- package/dist/components/GlobalHeader/GlobalHeader.js +117 -0
- package/dist/components/GlobalHeader/GlobalHeaderBase.js +22 -0
- package/dist/components/GlobalHeader/GlobalSearch.js +57 -0
- package/dist/components/GlobalHeader/GlobalSearchButton.js +53 -0
- package/dist/components/GlobalHeader/HeaderGroup.js +8 -0
- package/dist/components/GlobalHeader/HeaderLogo.js +17 -0
- package/dist/components/GlobalHeader/index.js +6 -0
- package/dist/components/GlobalMenu/BackButton.js +6 -24
- package/dist/components/GlobalMenu/EndUserLabel.js +10 -29
- package/dist/components/GlobalMenu/GlobalMenu.js +38 -61
- package/dist/components/GlobalMenu/GlobalMenuButton.js +69 -47
- package/dist/components/GlobalMenu/LocaleButton.js +12 -0
- package/dist/components/GlobalMenu/LocaleSwitcher.js +34 -0
- package/dist/components/GlobalMenu/index.js +6 -12
- package/dist/components/GlobalMenu_old/BackButton.js +11 -0
- package/dist/components/GlobalMenu_old/EndUserLabel.js +13 -0
- package/dist/components/GlobalMenu_old/GlobalMenu.js +75 -0
- package/dist/components/GlobalMenu_old/GlobalMenuBase.js +10 -0
- package/dist/components/GlobalMenu_old/GlobalMenuButton.js +58 -0
- package/dist/components/GlobalMenu_old/LogoutButton.js +14 -0
- package/dist/components/GlobalMenu_old/index.js +14 -0
- package/dist/components/Header/Header.js +25 -25
- package/dist/components/Header/LocaleButton.js +13 -30
- package/dist/components/Layout/Layout.js +25 -23
- package/dist/components/Layout/LayoutBody.js +1 -1
- package/dist/components/List/ListItemSelect.js +1 -1
- package/dist/components/Menu/MenuItem.js +1 -1
- package/dist/components/Menu/MenuSearch.js +2 -2
- package/dist/components/Notifications/NotificationItem.js +17 -0
- package/dist/components/Notifications/NotificationItemBase.js +86 -0
- package/dist/components/Notifications/NotificationItemControls.js +33 -0
- package/dist/components/Notifications/NotificationItemIcon.js +33 -0
- package/dist/components/Notifications/index.js +10 -0
- package/dist/components/RootProvider/RootProvider.js +42 -30
- package/dist/components/Searchbar/Searchbar.js +3 -3
- package/dist/components/Settings/BookmarksSettingsItem.js +1 -1
- package/dist/components/Settings/SettingsItem.js +22 -11
- package/dist/components/Toolbar/ToolbarAccountMenu.js +5 -5
- package/dist/components/Toolbar/ToolbarAdd.js +5 -5
- package/dist/components/Toolbar/ToolbarFilter.js +5 -5
- package/dist/components/Toolbar/ToolbarOptions.js +1 -1
- package/dist/components/Toolbar/ToolbarSearch.js +1 -1
- package/dist/components/index.js +305 -293
- package/dist/functions/date/date.js +16 -0
- package/dist/functions/date/date.spec.js +15 -0
- package/dist/functions/date/index.js +4 -0
- package/dist/functions/index.js +4 -2
- package/dist/globalSearch.module-Ejp7X0dO.js +9 -0
- package/dist/hooks/index.js +4 -2
- package/dist/hooks/useAccountSelector.js +214 -0
- package/dist/index-B6sKSsN9.js +2951 -0
- package/dist/index.js +304 -288
- package/dist/types/languageCode.js +1 -0
- package/dist/types/lib/components/Account/AccountMenu.d.ts +1 -1
- package/dist/types/lib/components/Account/AccountMenuButton.d.ts +11 -0
- package/dist/types/lib/components/Account/AccountMenuButton.stories.d.ts +31 -0
- package/dist/types/lib/components/Avatar/Avatar.d.ts +3 -1
- package/dist/types/lib/components/Avatar/Avatar.stories.d.ts +16 -1
- package/dist/types/lib/components/Bookmarks/BookmarksListItem.d.ts +2 -1
- package/dist/types/lib/components/Bookmarks/BookmarksListItem.stories.d.ts +1 -1
- package/dist/types/lib/components/Bookmarks/BookmarksSection.d.ts +1 -3
- package/dist/types/lib/components/Bookmarks/BookmarksSection.stories.d.ts +1 -19
- package/dist/types/lib/components/Bookmarks/EditableBookmark.d.ts +3 -7
- package/dist/types/lib/components/Dialog/SeenByLogItem.stories.d.ts +1 -0
- package/dist/types/lib/components/Dropdown/DrawerBase.d.ts +2 -1
- package/dist/types/lib/components/GlobalHeader/AccountSector.stories.d.ts +29 -0
- package/dist/types/lib/components/GlobalHeader/AccountSelector.d.ts +11 -0
- package/dist/types/lib/components/GlobalHeader/DigdirLogomark.d.ts +5 -0
- package/dist/types/lib/components/GlobalHeader/GlobalHeader.d.ts +20 -0
- package/dist/types/lib/components/GlobalHeader/GlobalHeader.stories.d.ts +27 -0
- package/dist/types/lib/components/GlobalHeader/GlobalHeaderBase.d.ts +9 -0
- package/dist/types/lib/components/GlobalHeader/GlobalSearch.d.ts +4 -0
- package/dist/types/lib/components/GlobalHeader/GlobalSearchButton.d.ts +4 -0
- package/dist/types/lib/components/GlobalHeader/HeaderGroup.d.ts +6 -0
- package/dist/types/lib/components/GlobalHeader/HeaderLogo.d.ts +10 -0
- package/dist/types/lib/components/GlobalHeader/index.d.ts +2 -0
- package/dist/types/lib/components/GlobalMenu/GlobalMenu.d.ts +3 -5
- package/dist/types/lib/components/GlobalMenu/GlobalMenu.stories.d.ts +6 -8
- package/dist/types/lib/components/GlobalMenu/GlobalMenuButton.d.ts +2 -3
- package/dist/types/lib/components/GlobalMenu/GlobalMenuButton.stories.d.ts +5 -9
- package/dist/types/lib/components/GlobalMenu/LocaleButton.d.ts +3 -0
- package/dist/types/lib/components/GlobalMenu/LocaleSwitcher.d.ts +7 -0
- package/dist/types/lib/components/GlobalMenu/index.d.ts +1 -4
- package/dist/types/lib/components/GlobalMenu_old/BackButton.d.ts +7 -0
- package/dist/types/lib/components/{GlobalMenu → GlobalMenu_old}/CurrentAccount.d.ts +1 -1
- package/dist/types/lib/components/GlobalMenu_old/EndUserLabel.d.ts +5 -0
- package/dist/types/lib/components/GlobalMenu_old/GlobalMenu.d.ts +18 -0
- package/dist/types/lib/components/GlobalMenu_old/GlobalMenu.stories.d.ts +30 -0
- package/dist/types/lib/components/GlobalMenu_old/GlobalMenuBase.d.ts +15 -0
- package/dist/types/lib/components/GlobalMenu_old/GlobalMenuButton.d.ts +13 -0
- package/dist/types/lib/components/GlobalMenu_old/GlobalMenuButton.stories.d.ts +19 -0
- package/dist/types/lib/components/GlobalMenu_old/LogoutButton.d.ts +7 -0
- package/dist/types/lib/components/GlobalMenu_old/index.d.ts +6 -0
- package/dist/types/lib/components/Header/Header.d.ts +2 -2
- package/dist/types/lib/components/Header/Header.stories.d.ts +2 -2
- package/dist/types/lib/components/Layout/Layout.d.ts +4 -2
- package/dist/types/lib/components/Layout/Layout.stories.d.ts +29 -5
- package/dist/types/lib/components/Notifications/NotificationItem.d.ts +7 -0
- package/dist/types/lib/components/Notifications/NotificationItemBase.d.ts +15 -0
- package/dist/types/lib/components/Notifications/NotificationItemControls.d.ts +10 -0
- package/dist/types/lib/components/Notifications/NotificationItemIcon.d.ts +11 -0
- package/dist/types/lib/components/Notifications/Notifications.stories.d.ts +10 -0
- package/dist/types/lib/components/Notifications/index.d.ts +4 -0
- package/dist/types/lib/components/RootProvider/RootProvider.d.ts +9 -4
- package/dist/types/lib/components/Settings/SettingsItem.d.ts +1 -1
- package/dist/types/lib/components/index.d.ts +2 -1
- package/dist/types/lib/functions/date/date.d.ts +6 -0
- package/dist/types/lib/functions/date/date.spec.d.ts +1 -0
- package/dist/types/lib/functions/date/index.d.ts +1 -0
- package/dist/types/lib/functions/index.d.ts +1 -0
- package/dist/types/lib/hooks/index.d.ts +1 -0
- package/dist/types/lib/hooks/useAccountSelector.d.ts +62 -0
- package/dist/types/lib/types/index.d.ts +1 -0
- package/dist/types/lib/types/languageCode.d.ts +1 -0
- package/dist/usePagination-cq1YWZkE.js +889 -0
- package/package.json +5 -1
- package/dist/usePagination-B24SmI8E.js +0 -3835
- /package/dist/components/{GlobalMenu → GlobalMenu_old}/CurrentAccount.js +0 -0
|
@@ -1,32 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
n.indexOf(e[l]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[l]) && (r[e[l]] = t[e[l]]);
|
|
11
|
-
return r;
|
|
12
|
-
};
|
|
13
|
-
const u = d((t, n) => {
|
|
14
|
-
var { title: r, titleId: e } = t, l = m(t, ["title", "titleId"]);
|
|
15
|
-
let o = f();
|
|
16
|
-
return o = r ? e || "title-" + o : void 0, a.createElement(
|
|
17
|
-
"svg",
|
|
18
|
-
Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: n, "aria-labelledby": o }, l),
|
|
19
|
-
r ? a.createElement("title", { id: o }, r) : null,
|
|
20
|
-
a.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M12 3.75a8.25 8.25 0 0 0-5.144 14.7 5.25 5.25 0 0 1 10.288 0A8.25 8.25 0 0 0 12 3.75m3.747 15.602a3.75 3.75 0 0 0-7.494 0A8.2 8.2 0 0 0 12 20.25c1.35 0 2.623-.324 3.747-.898M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12M12 7.25a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5M8.25 9.5a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0", clipRule: "evenodd" })
|
|
21
|
-
);
|
|
22
|
-
}), p = "_text_1tx3s_1", b = "_icon_1tx3s_11", _ = "_label_1tx3s_15", i = {
|
|
23
|
-
text: p,
|
|
24
|
-
icon: b,
|
|
25
|
-
label: _
|
|
26
|
-
}, g = ({ children: t }) => /* @__PURE__ */ c("p", { className: i.text, children: [
|
|
27
|
-
/* @__PURE__ */ s(u, { className: i.icon, "aria-hidden": !0 }),
|
|
28
|
-
/* @__PURE__ */ s("span", { className: i.label, children: t })
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { S as l } from "../../PersonCircle-DlX_3kRO.js";
|
|
3
|
+
import '../../assets/EndUserLabel.css';const n = "_text_1tx3s_1", o = "_icon_1tx3s_11", c = "_label_1tx3s_15", s = {
|
|
4
|
+
text: n,
|
|
5
|
+
icon: o,
|
|
6
|
+
label: c
|
|
7
|
+
}, x = ({ children: e }) => /* @__PURE__ */ a("p", { className: s.text, children: [
|
|
8
|
+
/* @__PURE__ */ t(l, { className: s.icon, "aria-hidden": !0 }),
|
|
9
|
+
/* @__PURE__ */ t("span", { className: s.label, children: e })
|
|
29
10
|
] });
|
|
30
11
|
export {
|
|
31
|
-
|
|
12
|
+
x as EndUserLabel
|
|
32
13
|
};
|
|
@@ -1,75 +1,52 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useState as g, useMemo as L } from "react";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
|
-
import { AccountMenu as q } from "../Account/AccountMenu.js";
|
|
6
5
|
import "../RootProvider/RootProvider.js";
|
|
7
|
-
import {
|
|
8
|
-
import { BackButton as z } from "./BackButton.js";
|
|
9
|
-
import { LogoutButton as G } from "./LogoutButton.js";
|
|
10
|
-
import { MenuListItem as x } from "../Menu/MenuBase.js";
|
|
11
|
-
import { Menu as y } from "../Menu/Menu.js";
|
|
6
|
+
import { LocaleSwitcher as B } from "./LocaleSwitcher.js";
|
|
12
7
|
import "../Snackbar/useSnackbar.js";
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
import { MenuListItem as h } from "../Menu/MenuBase.js";
|
|
9
|
+
import { Menu as G } from "../Menu/Menu.js";
|
|
10
|
+
import { BackButton as u } from "./BackButton.js";
|
|
11
|
+
import { GlobalMenuBase as f, GlobalMenuHeader as x, GlobalMenuFooter as j } from "./GlobalMenuBase.js";
|
|
12
|
+
import { LocaleButton as v } from "./LocaleButton.js";
|
|
13
|
+
import { LogoutButton as y } from "./LogoutButton.js";
|
|
14
|
+
const K = ({
|
|
15
|
+
menu: a,
|
|
16
|
+
backLabel: s = "Back",
|
|
17
|
+
onClose: i,
|
|
18
|
+
logoutButton: e,
|
|
19
|
+
ariaLabel: p = "Menu",
|
|
20
|
+
localeSwitcher: c
|
|
23
21
|
}) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
k(), a == null || a(), f == null || f(i);
|
|
29
|
-
}, o = W(() => ((l == null ? void 0 : l.items) ?? []).map((i) => ({
|
|
30
|
-
...i,
|
|
22
|
+
const [k, M] = g(!1), n = () => {
|
|
23
|
+
M((r) => !r);
|
|
24
|
+
}, d = L(() => ((a == null ? void 0 : a.items) ?? []).map((r) => ({
|
|
25
|
+
...r,
|
|
31
26
|
onClick: () => {
|
|
32
|
-
var
|
|
33
|
-
(
|
|
27
|
+
var o;
|
|
28
|
+
(o = r.onClick) == null || o.call(r), i == null || i();
|
|
34
29
|
},
|
|
35
|
-
items: Array.isArray(
|
|
36
|
-
...
|
|
30
|
+
items: Array.isArray(r.items) ? r.items.map((o) => ({
|
|
31
|
+
...o,
|
|
37
32
|
onClick: () => {
|
|
38
|
-
var
|
|
39
|
-
(
|
|
33
|
+
var m;
|
|
34
|
+
(m = o.onClick) == null || m.call(o), i == null || i();
|
|
40
35
|
}
|
|
41
36
|
})) : void 0
|
|
42
|
-
})), [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */ r(
|
|
54
|
-
w,
|
|
55
|
-
{
|
|
56
|
-
account: p,
|
|
57
|
-
multipleAccounts: i,
|
|
58
|
-
as: i ? "button" : "div",
|
|
59
|
-
onClick: i ? k : void 0
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
/* @__PURE__ */ r(x, { as: "div", role: "separator" })
|
|
63
|
-
] }),
|
|
64
|
-
l && /* @__PURE__ */ r(y, { ...l, items: o }),
|
|
65
|
-
t && /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(G, { ...t }) })
|
|
66
|
-
] });
|
|
67
|
-
}
|
|
68
|
-
return /* @__PURE__ */ s(g, { "aria-label": h, children: [
|
|
69
|
-
l && /* @__PURE__ */ r(y, { ...l, items: o }),
|
|
70
|
-
t && /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(G, { ...t }) })
|
|
37
|
+
})), [a, i]);
|
|
38
|
+
return k ? /* @__PURE__ */ l(f, { "aria-label": p, children: [
|
|
39
|
+
/* @__PURE__ */ l(x, { children: [
|
|
40
|
+
/* @__PURE__ */ t(u, { onClick: n, label: s }),
|
|
41
|
+
c && /* @__PURE__ */ t(B, { ...c })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ t(h, { as: "div", role: "separator" })
|
|
44
|
+
] }) : /* @__PURE__ */ l(f, { "aria-label": p, children: [
|
|
45
|
+
a && /* @__PURE__ */ t(G, { ...a, items: d }),
|
|
46
|
+
c && /* @__PURE__ */ t(v, { onClick: n }),
|
|
47
|
+
e && /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(y, { ...e }) })
|
|
71
48
|
] });
|
|
72
49
|
};
|
|
73
50
|
export {
|
|
74
|
-
|
|
51
|
+
K as GlobalMenu
|
|
75
52
|
};
|
|
@@ -1,58 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { c as f } from "../../index-L8X2o7IH.js";
|
|
4
|
+
import s, { forwardRef as _ } from "react";
|
|
5
|
+
import { useIsDesktop as y } from "../../hooks/useIsDesktop.js";
|
|
6
|
+
import { Badge as p } from "../Badge/Badge.js";
|
|
7
|
+
import { ButtonBase as b } from "../Button/ButtonBase.js";
|
|
8
|
+
import { ButtonLabel as g } from "../Button/ButtonLabel.js";
|
|
9
|
+
import { ButtonIcon as h } from "../Button/ButtonIcon.js";
|
|
9
10
|
import "../RootProvider/RootProvider.js";
|
|
10
11
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import { S as
|
|
12
|
-
import {
|
|
13
|
-
import '../../assets/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
import { S as v } from "../../XMark-tKk6aExO.js";
|
|
13
|
+
import { u as w } from "../../useId-BVFxCjkq.js";
|
|
14
|
+
import '../../assets/GlobalMenuButton2.css';var O = function(t, l) {
|
|
15
|
+
var o = {};
|
|
16
|
+
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && l.indexOf(e) < 0 && (o[e] = t[e]);
|
|
17
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
18
|
+
for (var r = 0, e = Object.getOwnPropertySymbols(t); r < e.length; r++)
|
|
19
|
+
l.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[r]) && (o[e[r]] = t[e[r]]);
|
|
20
|
+
return o;
|
|
21
|
+
};
|
|
22
|
+
const I = _((t, l) => {
|
|
23
|
+
var { title: o, titleId: e } = t, r = O(t, ["title", "titleId"]);
|
|
24
|
+
let a = w();
|
|
25
|
+
return a = o ? e || "title-" + a : void 0, s.createElement(
|
|
26
|
+
"svg",
|
|
27
|
+
Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: l, "aria-labelledby": a }, r),
|
|
28
|
+
o ? s.createElement("title", { id: a }, o) : null,
|
|
29
|
+
s.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2.75 6a.75.75 0 0 1 .75-.75h17a.75.75 0 0 1 0 1.5h-17A.75.75 0 0 1 2.75 6m0 6a.75.75 0 0 1 .75-.75h17a.75.75 0 0 1 0 1.5h-17a.75.75 0 0 1-.75-.75m.75 5.25a.75.75 0 0 0 0 1.5h17a.75.75 0 0 0 0-1.5z", clipRule: "evenodd" })
|
|
30
|
+
);
|
|
31
|
+
}), x = "_button_1g9ar_1", j = "_icon_1g9ar_25", B = "_badge_1g9ar_31", i = {
|
|
32
|
+
button: x,
|
|
33
|
+
icon: j,
|
|
34
|
+
badge: B
|
|
21
35
|
}, H = ({
|
|
22
36
|
className: t,
|
|
23
|
-
as:
|
|
24
|
-
color:
|
|
25
|
-
variant:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
34
|
-
n && /* @__PURE__ */ o(I, { ...n, className: a.badge })
|
|
35
|
-
] }) : c ? /* @__PURE__ */ l(h, { ...e, as: s, variant: m, color: i, className: _(a.button, t), children: [
|
|
36
|
-
/* @__PURE__ */ o(d, { children: r }),
|
|
37
|
-
/* @__PURE__ */ o(
|
|
38
|
-
f,
|
|
37
|
+
as: l = "button",
|
|
38
|
+
color: o = "accent",
|
|
39
|
+
variant: e = "solid",
|
|
40
|
+
expanded: r,
|
|
41
|
+
label: a = "Menu",
|
|
42
|
+
badge: c,
|
|
43
|
+
...m
|
|
44
|
+
}) => {
|
|
45
|
+
const u = y();
|
|
46
|
+
return r ? /* @__PURE__ */ d(
|
|
47
|
+
b,
|
|
39
48
|
{
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
...m,
|
|
50
|
+
as: l,
|
|
51
|
+
type: "button",
|
|
52
|
+
variant: e,
|
|
53
|
+
color: o,
|
|
54
|
+
className: f(i.button, t),
|
|
55
|
+
children: [
|
|
56
|
+
u && /* @__PURE__ */ n(h, { className: i.closeIcon, icon: /* @__PURE__ */ n(v, { className: i.icon, "aria-label": "Close" }) }),
|
|
57
|
+
/* @__PURE__ */ n(g, { children: a }),
|
|
58
|
+
c && /* @__PURE__ */ n(p, { ...c, className: i.badge })
|
|
59
|
+
]
|
|
42
60
|
}
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
] }) : /* @__PURE__ */ l(h, { ...e, as: s, variant: m, color: i, className: _(a.button, t), children: [
|
|
46
|
-
/* @__PURE__ */ o(d, { children: r }),
|
|
47
|
-
/* @__PURE__ */ o(
|
|
48
|
-
f,
|
|
61
|
+
) : /* @__PURE__ */ d(
|
|
62
|
+
b,
|
|
49
63
|
{
|
|
50
|
-
|
|
51
|
-
|
|
64
|
+
...m,
|
|
65
|
+
as: l,
|
|
66
|
+
type: "button",
|
|
67
|
+
variant: e,
|
|
68
|
+
color: o,
|
|
69
|
+
className: f(i.button, t),
|
|
70
|
+
children: [
|
|
71
|
+
u && /* @__PURE__ */ n(h, { icon: /* @__PURE__ */ n(I, { className: i.icon, "aria-hidden": !0 }) }),
|
|
72
|
+
/* @__PURE__ */ n(g, { children: a }),
|
|
73
|
+
c && /* @__PURE__ */ n(p, { ...c, className: i.badge })
|
|
74
|
+
]
|
|
52
75
|
}
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
] });
|
|
76
|
+
);
|
|
77
|
+
};
|
|
56
78
|
export {
|
|
57
79
|
H as GlobalMenuButton
|
|
58
80
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import "../../index-L8X2o7IH.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "../RootProvider/RootProvider.js";
|
|
6
|
+
import { MenuItem as r } from "../Menu/MenuItem.js";
|
|
7
|
+
import "../Snackbar/useSnackbar.js";
|
|
8
|
+
import { S as m } from "../../Globe-BcPkcH4E.js";
|
|
9
|
+
const a = ({ onClick: o }) => /* @__PURE__ */ t(r, { size: "sm", icon: m, title: "Språk/language", onClick: o });
|
|
10
|
+
export {
|
|
11
|
+
a as LocaleButton
|
|
12
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as d, useMemo as f } from "react";
|
|
4
|
+
import { useEnterKey as g } from "../../hooks/useEnterKey.js";
|
|
5
|
+
import "../../index-L8X2o7IH.js";
|
|
6
|
+
import { useRootContext as h } from "../RootProvider/RootProvider.js";
|
|
7
|
+
import "../Snackbar/useSnackbar.js";
|
|
8
|
+
import { MenuItems as k } from "../Menu/MenuItems.js";
|
|
9
|
+
import { S as v } from "../../Checkmark-Byz_C9x4.js";
|
|
10
|
+
const M = ({ title: c = "Select language", options: i, onSelect: r }) => {
|
|
11
|
+
const s = d(null), { currentId: u, closeAll: a } = h(), l = u === "locale", m = f(() => i.map((e) => ({
|
|
12
|
+
...e,
|
|
13
|
+
id: String(e.value),
|
|
14
|
+
tabIndex: -1,
|
|
15
|
+
groupId: "locales",
|
|
16
|
+
icon: e.checked ? v : /* @__PURE__ */ o("span", { "aria-hidden": "true" }),
|
|
17
|
+
onClick: () => {
|
|
18
|
+
r == null || r(String(e.value)), a();
|
|
19
|
+
}
|
|
20
|
+
})), [i, r]), p = {
|
|
21
|
+
locales: { title: c || "Språk/language" }
|
|
22
|
+
};
|
|
23
|
+
return g((e) => {
|
|
24
|
+
var n;
|
|
25
|
+
if (l) {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
const t = (n = s.current) == null ? void 0 : n.querySelector('[data-active="true"]');
|
|
28
|
+
t && (t.tagName === "A" && t.hasAttribute("href") ? t.click() : t.dispatchEvent(new MouseEvent("click", { bubbles: !0 }))), a();
|
|
29
|
+
}
|
|
30
|
+
}), /* @__PURE__ */ o("div", { ref: s, "data-testid": "locale-switcher", children: /* @__PURE__ */ o(k, { groups: p, items: m, keyboardEvents: !0 }) });
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
M as LocaleSwitcher
|
|
34
|
+
};
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { EndUserLabel as p } from "./EndUserLabel.js";
|
|
5
|
-
import { GlobalMenu as l } from "./GlobalMenu.js";
|
|
6
|
-
import { GlobalMenuButton as B } from "./GlobalMenuButton.js";
|
|
1
|
+
import { GlobalMenu as r } from "./GlobalMenu.js";
|
|
2
|
+
import { GlobalMenuButton as l } from "./GlobalMenuButton.js";
|
|
3
|
+
import { LocaleSwitcher as f } from "./LocaleSwitcher.js";
|
|
7
4
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
l as GlobalMenu,
|
|
12
|
-
B as GlobalMenuButton,
|
|
13
|
-
f as LogoutButton
|
|
5
|
+
r as GlobalMenu,
|
|
6
|
+
l as GlobalMenuButton,
|
|
7
|
+
f as LocaleSwitcher
|
|
14
8
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import "../../index-L8X2o7IH.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "../RootProvider/RootProvider.js";
|
|
5
|
+
import "../Snackbar/useSnackbar.js";
|
|
6
|
+
import { MenuItem as i } from "../Menu/MenuItem.js";
|
|
7
|
+
import { S as p } from "../../ArrowUndo-hge1gMu8.js";
|
|
8
|
+
const d = ({ label: o, onClick: r, as: t }) => /* @__PURE__ */ m(i, { size: "sm", id: "back", icon: p, title: o, onClick: r, as: t });
|
|
9
|
+
export {
|
|
10
|
+
d as BackButton
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { S as l } from "../../PersonCircle-DlX_3kRO.js";
|
|
3
|
+
import '../../assets/EndUserLabel.css';const n = "_text_1tx3s_1", o = "_icon_1tx3s_11", c = "_label_1tx3s_15", s = {
|
|
4
|
+
text: n,
|
|
5
|
+
icon: o,
|
|
6
|
+
label: c
|
|
7
|
+
}, x = ({ children: e }) => /* @__PURE__ */ a("p", { className: s.text, children: [
|
|
8
|
+
/* @__PURE__ */ t(l, { className: s.icon, "aria-hidden": !0 }),
|
|
9
|
+
/* @__PURE__ */ t("span", { className: s.label, children: e })
|
|
10
|
+
] });
|
|
11
|
+
export {
|
|
12
|
+
x as EndUserLabel
|
|
13
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as s, jsx as r, Fragment as T } from "react/jsx-runtime";
|
|
3
|
+
import { useState as H, useMemo as W } from "react";
|
|
4
|
+
import "../../index-L8X2o7IH.js";
|
|
5
|
+
import { AccountMenu as _ } from "../Account/AccountMenu.js";
|
|
6
|
+
import "../RootProvider/RootProvider.js";
|
|
7
|
+
import { CurrentAccount as q } from "./CurrentAccount.js";
|
|
8
|
+
import { BackButton as w } from "./BackButton.js";
|
|
9
|
+
import { LogoutButton as G } from "./LogoutButton.js";
|
|
10
|
+
import { MenuListItem as x } from "../Menu/MenuBase.js";
|
|
11
|
+
import { Menu as y } from "../Menu/Menu.js";
|
|
12
|
+
import "../Snackbar/useSnackbar.js";
|
|
13
|
+
import { GlobalMenuBase as g, GlobalMenuHeader as z, GlobalMenuFooter as b } from "./GlobalMenuBase.js";
|
|
14
|
+
const V = ({
|
|
15
|
+
accountMenu: m,
|
|
16
|
+
menu: l,
|
|
17
|
+
backLabel: j = "Back",
|
|
18
|
+
currentAccount: p,
|
|
19
|
+
onSelectAccount: f,
|
|
20
|
+
onClose: a,
|
|
21
|
+
logoutButton: t,
|
|
22
|
+
ariaLabel: h = "Menu"
|
|
23
|
+
}) => {
|
|
24
|
+
var v;
|
|
25
|
+
const [B, F] = H(!1), k = () => {
|
|
26
|
+
F((i) => !i);
|
|
27
|
+
}, M = (i) => {
|
|
28
|
+
k(), a == null || a(), f == null || f(i);
|
|
29
|
+
}, o = W(() => ((l == null ? void 0 : l.items) ?? []).map((i) => ({
|
|
30
|
+
...i,
|
|
31
|
+
onClick: () => {
|
|
32
|
+
var d;
|
|
33
|
+
(d = i.onClick) == null || d.call(i), a == null || a();
|
|
34
|
+
},
|
|
35
|
+
items: Array.isArray(i.items) ? i.items.map((d) => ({
|
|
36
|
+
...d,
|
|
37
|
+
onClick: () => {
|
|
38
|
+
var e;
|
|
39
|
+
(e = d.onClick) == null || e.call(d), a == null || a();
|
|
40
|
+
}
|
|
41
|
+
})) : void 0
|
|
42
|
+
})), [l, a]);
|
|
43
|
+
if (B)
|
|
44
|
+
return /* @__PURE__ */ s(g, { "aria-label": h, children: [
|
|
45
|
+
/* @__PURE__ */ r(z, { children: /* @__PURE__ */ r(w, { onClick: k, label: j }) }),
|
|
46
|
+
/* @__PURE__ */ r(x, { as: "div", role: "separator" }),
|
|
47
|
+
m && /* @__PURE__ */ r(_, { ...m, currentAccount: p, onSelectAccount: M })
|
|
48
|
+
] });
|
|
49
|
+
if (p) {
|
|
50
|
+
const i = m && ((v = m == null ? void 0 : m.items) == null ? void 0 : v.length) > 1;
|
|
51
|
+
return /* @__PURE__ */ s(g, { "aria-label": h, color: p == null ? void 0 : p.type, children: [
|
|
52
|
+
p && /* @__PURE__ */ s(T, { children: [
|
|
53
|
+
/* @__PURE__ */ r(
|
|
54
|
+
q,
|
|
55
|
+
{
|
|
56
|
+
account: p,
|
|
57
|
+
multipleAccounts: i,
|
|
58
|
+
as: i ? "button" : "div",
|
|
59
|
+
onClick: i ? k : void 0
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ r(x, { as: "div", role: "separator" })
|
|
63
|
+
] }),
|
|
64
|
+
l && /* @__PURE__ */ r(y, { ...l, items: o }),
|
|
65
|
+
t && /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(G, { ...t }) })
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
return /* @__PURE__ */ s(g, { "aria-label": h, children: [
|
|
69
|
+
l && /* @__PURE__ */ r(y, { ...l, items: o }),
|
|
70
|
+
t && /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(G, { ...t }) })
|
|
71
|
+
] });
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
V as GlobalMenu_old
|
|
75
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as _ } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Avatar as u } from "../Avatar/Avatar.js";
|
|
5
|
+
import { Badge as I } from "../Badge/Badge.js";
|
|
6
|
+
import { ButtonBase as h } from "../Button/ButtonBase.js";
|
|
7
|
+
import { ButtonLabel as d } from "../Button/ButtonLabel.js";
|
|
8
|
+
import { ButtonIcon as f } from "../Button/ButtonIcon.js";
|
|
9
|
+
import "../RootProvider/RootProvider.js";
|
|
10
|
+
import "../Snackbar/useSnackbar.js";
|
|
11
|
+
import { S as N } from "../../XMark-tKk6aExO.js";
|
|
12
|
+
import { S as g } from "../../PadlockLocked-XL1IB5Ae.js";
|
|
13
|
+
import '../../assets/GlobalMenuButton.css';const v = "_button_1uh95_1", b = "_avatarIcon_1uh95_19", B = "_loginIcon_1uh95_20", x = "_closeIcon_1uh95_21", S = "_avatar_1uh95_19", k = "_icon_1uh95_44", L = "_badge_1uh95_50", a = {
|
|
14
|
+
button: v,
|
|
15
|
+
avatarIcon: b,
|
|
16
|
+
loginIcon: B,
|
|
17
|
+
closeIcon: x,
|
|
18
|
+
avatar: S,
|
|
19
|
+
icon: k,
|
|
20
|
+
badge: L
|
|
21
|
+
}, H = ({
|
|
22
|
+
className: t,
|
|
23
|
+
as: s = "button",
|
|
24
|
+
color: i = "accent",
|
|
25
|
+
variant: m = "solid",
|
|
26
|
+
currentAccount: c,
|
|
27
|
+
expanded: p,
|
|
28
|
+
label: l = "Menu",
|
|
29
|
+
badge: n,
|
|
30
|
+
...r
|
|
31
|
+
}) => p ? /* @__PURE__ */ e(h, { ...r, as: s, variant: m, color: i, className: _(a.button, t), children: [
|
|
32
|
+
/* @__PURE__ */ o(d, { children: l }),
|
|
33
|
+
/* @__PURE__ */ o(f, { className: a.closeIcon, icon: /* @__PURE__ */ o(N, { className: a.icon, "aria-label": "Close Icon" }) }),
|
|
34
|
+
n && /* @__PURE__ */ o(I, { ...n, className: a.badge })
|
|
35
|
+
] }) : c ? /* @__PURE__ */ e(h, { ...r, as: s, variant: m, color: i, className: _(a.button, t), children: [
|
|
36
|
+
/* @__PURE__ */ o(d, { children: l }),
|
|
37
|
+
/* @__PURE__ */ o(
|
|
38
|
+
f,
|
|
39
|
+
{
|
|
40
|
+
className: a.avatarIcon,
|
|
41
|
+
icon: /* @__PURE__ */ o(u, { ...c == null ? void 0 : c.icon, className: a.avatar })
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
n && /* @__PURE__ */ o(I, { ...n, className: a.badge })
|
|
45
|
+
] }) : /* @__PURE__ */ e(h, { ...r, as: s, variant: m, color: i, className: _(a.button, t), children: [
|
|
46
|
+
/* @__PURE__ */ o(d, { children: l }),
|
|
47
|
+
/* @__PURE__ */ o(
|
|
48
|
+
f,
|
|
49
|
+
{
|
|
50
|
+
className: a.loginIcon,
|
|
51
|
+
icon: /* @__PURE__ */ o(g, { className: a.icon, "aria-label": "Login Icon" })
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
n && /* @__PURE__ */ o(I, { ...n, className: a.badge })
|
|
55
|
+
] });
|
|
56
|
+
export {
|
|
57
|
+
H as GlobalMenuButton_old
|
|
58
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { ButtonBase as r } from "../Button/ButtonBase.js";
|
|
3
|
+
import { ButtonLabel as s } from "../Button/ButtonLabel.js";
|
|
4
|
+
import "../../index-L8X2o7IH.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "../RootProvider/RootProvider.js";
|
|
7
|
+
import "../Snackbar/useSnackbar.js";
|
|
8
|
+
import '../../assets/LogoutButton.css';const i = "_button_1260s_1", a = "_label_1260s_5", o = {
|
|
9
|
+
button: i,
|
|
10
|
+
label: a
|
|
11
|
+
}, B = ({ label: l = "Logout", children: e, onClick: n }) => /* @__PURE__ */ t(r, { className: o.button, variant: "outline", size: "lg", onClick: n, children: /* @__PURE__ */ t(s, { className: o.label, size: "lg", children: e || l }) });
|
|
12
|
+
export {
|
|
13
|
+
B as LogoutButton
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
};
|