@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.
- 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/EditableBookmark.js +1 -1
- 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/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 +1 -1
- package/dist/usePagination-B24SmI8E.js +0 -3835
- /package/dist/components/{GlobalMenu → GlobalMenu_old}/CurrentAccount.js +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import a, { forwardRef as i } from "react";
|
|
3
|
+
import { u as f } from "./useId-BVFxCjkq.js";
|
|
4
|
+
var d = function(t, n) {
|
|
5
|
+
var l = {};
|
|
6
|
+
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (l[e] = t[e]);
|
|
7
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
8
|
+
for (var r = 0, e = Object.getOwnPropertySymbols(t); r < e.length; r++)
|
|
9
|
+
n.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[r]) && (l[e[r]] = t[e[r]]);
|
|
10
|
+
return l;
|
|
11
|
+
};
|
|
12
|
+
const p = i((t, n) => {
|
|
13
|
+
var { title: l, titleId: e } = t, r = d(t, ["title", "titleId"]);
|
|
14
|
+
let o = f();
|
|
15
|
+
return o = l ? e || "title-" + o : void 0, a.createElement(
|
|
16
|
+
"svg",
|
|
17
|
+
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 }, r),
|
|
18
|
+
l ? a.createElement("title", { id: o }, l) : null,
|
|
19
|
+
a.createElement("path", { fill: "currentColor", d: "M9.03 5.03a.75.75 0 1 0-1.06-1.06l-4.5 4.5a.75.75 0 0 0 0 1.06l4.5 4.5a.75.75 0 1 0 1.06-1.06L5.81 9.75H16a4.25 4.25 0 0 1 0 8.5h-1.5a.75.75 0 0 0 0 1.5H16a5.75 5.75 0 0 0 0-11.5H5.81z" })
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
p as S
|
|
24
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as u, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { S as d, a as m } from "./index-D8Pn8SCu.js";
|
|
4
|
+
import { c as p } from "./lite-1fxw3LjI.js";
|
|
5
|
+
import { forwardRef as c } from "react";
|
|
6
|
+
import { S as l } from "./Spinner-BDXfwXIh.js";
|
|
7
|
+
const v = c(function({ asChild: e, className: o, children: r, icon: a = !1, loading: t = !1, variant: i = "primary", ...s }, f) {
|
|
8
|
+
return u(e ? d : "button", {
|
|
9
|
+
"aria-busy": !!t || void 0,
|
|
10
|
+
"aria-disabled": !!t || void 0,
|
|
11
|
+
className: p("ds-button", o),
|
|
12
|
+
"data-icon": a || void 0,
|
|
13
|
+
"data-variant": i,
|
|
14
|
+
ref: f,
|
|
15
|
+
/* don't set type when we use `asChild` */
|
|
16
|
+
type: e ? void 0 : "button",
|
|
17
|
+
...s,
|
|
18
|
+
children: [t === !0 ? n(l, { "aria-hidden": "true" }) : t, n(m, { children: r })]
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
v as B
|
|
23
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import o, { forwardRef as i } from "react";
|
|
3
|
+
import { u as c } from "./useId-BVFxCjkq.js";
|
|
4
|
+
var f = function(t, a) {
|
|
5
|
+
var r = {};
|
|
6
|
+
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && a.indexOf(e) < 0 && (r[e] = t[e]);
|
|
7
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
8
|
+
for (var l = 0, e = Object.getOwnPropertySymbols(t); l < e.length; l++)
|
|
9
|
+
a.indexOf(e[l]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[l]) && (r[e[l]] = t[e[l]]);
|
|
10
|
+
return r;
|
|
11
|
+
};
|
|
12
|
+
const u = i((t, a) => {
|
|
13
|
+
var { title: r, titleId: e } = t, l = f(t, ["title", "titleId"]);
|
|
14
|
+
let n = c();
|
|
15
|
+
return n = r ? e || "title-" + n : void 0, o.createElement(
|
|
16
|
+
"svg",
|
|
17
|
+
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: a, "aria-labelledby": n }, l),
|
|
18
|
+
r ? o.createElement("title", { id: n }, r) : null,
|
|
19
|
+
o.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2.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 12m6.74-7.683A8.28 8.28 0 0 0 4.65 8.25h3.719a41 41 0 0 1 .62-3.934m1.63-.452a41 41 0 0 0-.742 4.385h4.245a41 41 0 0 0-.743-4.385 8.3 8.3 0 0 0-2.76 0M8.24 14.25a34.5 34.5 0 0 1 0-4.5H4.06A8.3 8.3 0 0 0 3.75 12c0 .78.108 1.535.31 2.25zm1.503 0a33 33 0 0 1 0-4.5h4.514c.103 1.51.103 2.997 0 4.5zm-.754 5.433a41 41 0 0 1-.62-3.933h-3.72a8.28 8.28 0 0 0 4.34 3.933m1.631.452a41 41 0 0 1-.743-4.385h4.246a41 41 0 0 1-.743 4.385 8.3 8.3 0 0 1-2.76 0m5.141-5.885c.098-1.502.098-2.99 0-4.5h4.179c.202.715.31 1.47.31 2.25a8.3 8.3 0 0 1-.31 2.25zm-.75-9.933a8.28 8.28 0 0 1 4.34 3.933h-3.72a41 41 0 0 0-.62-3.933m0 15.366c.276-1.344.483-2.648.62-3.933h3.72a8.28 8.28 0 0 1-4.34 3.933", clipRule: "evenodd" })
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
u as S
|
|
24
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { S as a } from "./index-D8Pn8SCu.js";
|
|
4
|
+
import { c as i } from "./lite-1fxw3LjI.js";
|
|
5
|
+
import { forwardRef as f } from "react";
|
|
6
|
+
const u = f(function({ level: o = 2, className: r, asChild: t, ...e }, n) {
|
|
7
|
+
const s = t ? a : `h${o}`;
|
|
8
|
+
return m(s, { className: i("ds-heading", r), ref: n, ...e });
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
u as H
|
|
12
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import i, { forwardRef as a } from "react";
|
|
3
|
+
import { u as f } from "./useId-BVFxCjkq.js";
|
|
4
|
+
var c = function(t, n) {
|
|
5
|
+
var r = {};
|
|
6
|
+
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (r[e] = t[e]);
|
|
7
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
8
|
+
for (var l = 0, e = Object.getOwnPropertySymbols(t); l < e.length; l++)
|
|
9
|
+
n.indexOf(e[l]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[l]) && (r[e[l]] = t[e[l]]);
|
|
10
|
+
return r;
|
|
11
|
+
};
|
|
12
|
+
const m = a((t, n) => {
|
|
13
|
+
var { title: r, titleId: e } = t, l = c(t, ["title", "titleId"]);
|
|
14
|
+
let o = f();
|
|
15
|
+
return o = r ? e || "title-" + o : void 0, i.createElement(
|
|
16
|
+
"svg",
|
|
17
|
+
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),
|
|
18
|
+
r ? i.createElement("title", { id: o }, r) : null,
|
|
19
|
+
i.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M12 4.969c1.399-1.242 2.776-1.844 4.125-1.844 1.519 0 2.823.763 3.905 1.845 2.373 2.372 2.207 6.354-1 9.56l-6.5 6.5-.53-.53-.53.53-6.5-6.5c-3.207-3.206-3.373-7.188-1-9.56C5.05 3.888 6.356 3.125 7.875 3.125c1.349 0 2.726.602 4.125 1.844M12 20.5l-.53.53a.75.75 0 0 0 1.06 0zm0-1.06 5.97-5.97c2.793-2.794 2.627-5.812 1-7.44-.919-.918-1.864-1.405-2.845-1.405s-2.177.487-3.595 1.905a.75.75 0 0 1-1.06 0C10.05 5.112 8.856 4.625 7.874 4.625S5.948 5.112 5.03 6.03c-1.627 1.628-1.793 4.646 1 7.44z", clipRule: "evenodd" })
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
var d = function(t, n) {
|
|
23
|
+
var r = {};
|
|
24
|
+
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (r[e] = t[e]);
|
|
25
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
26
|
+
for (var l = 0, e = Object.getOwnPropertySymbols(t); l < e.length; l++)
|
|
27
|
+
n.indexOf(e[l]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[l]) && (r[e[l]] = t[e[l]]);
|
|
28
|
+
return r;
|
|
29
|
+
};
|
|
30
|
+
const s = a((t, n) => {
|
|
31
|
+
var { title: r, titleId: e } = t, l = d(t, ["title", "titleId"]);
|
|
32
|
+
let o = f();
|
|
33
|
+
return o = r ? e || "title-" + o : void 0, i.createElement(
|
|
34
|
+
"svg",
|
|
35
|
+
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),
|
|
36
|
+
r ? i.createElement("title", { id: o }, r) : null,
|
|
37
|
+
i.createElement("path", { fill: "currentColor", d: "M12 4.969c1.399-1.242 2.776-1.844 4.125-1.844 1.519 0 2.823.763 3.905 1.845 2.373 2.372 2.206 6.354-1 9.56l-6.5 6.5a.75.75 0 0 1-1.06 0l-6.5-6.5c-3.207-3.206-3.373-7.188-1-9.56C5.05 3.888 6.355 3.125 7.874 3.125c1.349 0 2.726.602 4.125 1.844" })
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
s as S,
|
|
42
|
+
m as a
|
|
43
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import i, { forwardRef as a } from "react";
|
|
3
|
+
import { u as f } from "./useId-BVFxCjkq.js";
|
|
4
|
+
var d = function(t, n) {
|
|
5
|
+
var r = {};
|
|
6
|
+
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (r[e] = t[e]);
|
|
7
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
8
|
+
for (var l = 0, e = Object.getOwnPropertySymbols(t); l < e.length; l++)
|
|
9
|
+
n.indexOf(e[l]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[l]) && (r[e[l]] = t[e[l]]);
|
|
10
|
+
return r;
|
|
11
|
+
};
|
|
12
|
+
const p = a((t, n) => {
|
|
13
|
+
var { title: r, titleId: e } = t, l = d(t, ["title", "titleId"]);
|
|
14
|
+
let o = f();
|
|
15
|
+
return o = r ? e || "title-" + o : void 0, i.createElement(
|
|
16
|
+
"svg",
|
|
17
|
+
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),
|
|
18
|
+
r ? i.createElement("title", { id: o }, r) : null,
|
|
19
|
+
i.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" })
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
p as S
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as u, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { c } from "./lite-1fxw3LjI.js";
|
|
4
|
+
import { useLayoutEffect as l, useEffect as d, useRef as p, forwardRef as g } from "react";
|
|
5
|
+
import { u as x } from "./useMergeRefs-DOnoWyUH.js";
|
|
6
|
+
const R = typeof window < "u" ? l : d;
|
|
7
|
+
function m(i) {
|
|
8
|
+
const t = p(null);
|
|
9
|
+
return R(() => {
|
|
10
|
+
const s = document.getAnimations().filter((r) => "animationName" in r && r.animationName === i), e = s.find((r) => "animationName" in r && r.animationName === i), n = s.find((r) => {
|
|
11
|
+
var o;
|
|
12
|
+
return ((o = r.effect) == null ? void 0 : o.target) === t.current;
|
|
13
|
+
});
|
|
14
|
+
return n && n === e && (n.currentTime = 0), n && (e != null && e.currentTime) && n !== e && (n.currentTime = e.currentTime), () => {
|
|
15
|
+
n && (e != null && e.currentTime) && (n.currentTime = e.currentTime);
|
|
16
|
+
};
|
|
17
|
+
}, [i]), t;
|
|
18
|
+
}
|
|
19
|
+
const y = g(function({ "aria-label": t, className: s, ...e }, n) {
|
|
20
|
+
const r = m("ds-spinner-rotate-animation"), o = m("ds-spinner-stroke-animation"), f = x([r, n]);
|
|
21
|
+
return u("svg", { "aria-label": t, className: c("ds-spinner", s), ref: f, role: "img", viewBox: "0 0 50 50", ...e, children: [a("circle", { className: c("ds-spinner__background"), cx: "25", cy: "25", r: "20", fill: "none", strokeWidth: "5" }), a("circle", { className: c("ds-spinner__circle"), cx: "25", cy: "25", r: "20", fill: "none", strokeWidth: "5", ref: o })] });
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
y as S,
|
|
25
|
+
m as u
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._button_1r4wq_1{flex-shrink:0;position:relative;display:inline-flex;align-items:center;column-gap:.1rem;padding:.625rem;border:none;border-radius:4px}._label_1r4wq_12{font-size:1.125rem;font-weight:500;padding:.25rem}._avatarIcon_1r4wq_18,._loginIcon_1r4wq_19,._closeIcon_1r4wq_20{width:2.7em;height:2.7em;border-radius:2px;font-size:unset}._closeIcon_1r4wq_20{background-color:var(--ds-color-accent-base-default);border-radius:50%;color:#fff}._loginIcon_1r4wq_19{background-color:#e0e2e4;border-radius:50%;color:#000}._avatar_1r4wq_18{font-size:2.6em}._icon_1r4wq_43{font-size:1.2em}._badge_1r4wq_47{position:absolute;top:0;right:0;margin-top:-.75rem;margin-right:-.75rem}._labelContainer_1r4wq_55{display:flex;flex-direction:column;align-items:flex-end;line-height:1.2;color:var(--ds-color-article-text-default)}._description_1r4wq_63{font-size:.875rem;color:var(--ds-color-article-text-default)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._accountSelector_1f74n_1{display:flex;flex-direction:column;align-items:center;padding:1rem 0;max-width:1000px;margin:0 auto;--horizontal-padding: .7rem}._heading_1f74n_11{margin-bottom:1rem;width:100%;padding:.3rem var(--horizontal-padding)}._searchSection_1f74n_17{width:100%;padding:0 var(--horizontal-padding)}._searchField_1f74n_22{width:50%}._accountMenu_1f74n_26{height:40vh;width:100%;overflow-y:auto;margin-bottom:1rem;padding:0 var(--horizontal-padding)}._accountMenu_1f74n_26._fullScreen_1f74n_34{height:fit-content}._accountMenu_1f74n_26._virtualized_1f74n_38{overflow-y:hidden}._btnIcon_1f74n_42{font-size:1.5rem}._spinner_1f74n_46{margin:auto;width:100%;overflow:hidden}@media (max-width: 1023px){._accountSelector_1f74n_1{--horizontal-padding: .1rem}._searchField_1f74n_22{width:100%}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._drawer_1r5ak_1[data-expanded=true]{display:block;width:100%}._dropdown_1r5ak_6[data-expanded=true]{display:none}@media (min-width: 1024px){._dropdown_1r5ak_6[data-expanded=true][data-layout=desktop]{display:block}._drawer_1r5ak_1[data-expanded=true][data-layout=mobile]{display:none}}._relative_1r5ak_19{position:relative}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._header_t9h1f_1{z-index:1;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem;padding:.7rem;background-color:#fff;margin-bottom:1rem}._backdrop_t9h1f_13{display:none}._header_t9h1f_1[data-current-id=menu],._header_t9h1f_1[data-current-id=locale]{background-color:#fff}@media (min-width: 1024px){._header_t9h1f_1[data-current-id=menu] ._backdrop_t9h1f_13,._header_t9h1f_1[data-current-id=locale] ._backdrop_t9h1f_13{display:block}}@media (max-width: 1023px){._header_t9h1f_1{gap:0}}._header_t9h1f_1{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._button_1g9ar_1{flex-shrink:0;position:relative;z-index:2;display:inline-flex;align-items:center;column-gap:.625rem;padding:.625rem;border:none;border-radius:4px}._label_1g9ar_13{font-size:1.125rem;font-weight:500;padding:.25rem}._avatar_1g9ar_19{font-size:2.25rem;width:2.25rem;height:2.25rem}._icon_1g9ar_25{font-size:1.5rem;width:1.5rem;height:1.5rem}._badge_1g9ar_31{position:absolute;top:0;right:0;margin-top:-.75rem;margin-right:-.75rem}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._group_o0h92_1{position:relative;display:flex;align-items:center;column-gap:1rem}@media (max-width: 1023px){._group_o0h92_1{column-gap:.1rem}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._logo_1d6ig_1{display:flex;align-items:center;color:currentColor;text-decoration:none}._riksSymbol_1d6ig_8{width:2.5rem;height:2.5rem;margin:0}._text_1d6ig_14{font-size:1.5rem;font-weight:500;padding:4px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._body_1voih_1{flex-grow:1;width:100%;max-width:1280px;margin:0 auto;padding:0 1rem;display:flex;column-gap:2em}._body_1voih_1[data-current-id=accountFullscreen]{display:none}@media (min-width: 1024px){._body_1voih_1{padding:0 1rem}}@media (max-width: 1023px){._body_1voih_1[data-current-id=menu]{display:none}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._item_w20tn_1{--dsc-item-height: 3em;--dsc-item-px: .5em;--dsc-item-py: .25em;--dsc-item-my: .25em;--dsc-item-border-radius: var(--ds-border-radius-xl);--dsc-item-spacing: .5em;box-shadow:var(--ds-shadow-xs)}._item_w20tn_1[data-variant=default]{--dsc-item-background: var(--ds-color-surface-default);--dsc-item-background--active: var(--ds-color-surface-active);--dsc-item-border-color: var(--ds-color-border-subtle)}._item_w20tn_1[data-variant=tinted]{--dsc-item-background: var(--ds-color-surface-tinted);--dsc-item-background--active: var(--ds-color-surface-active);--dsc-item-background--hover: var(--ds-color-surface-hover);--dsc-item-border-color: var(--ds-color-border-subtle)}._header_w20tn_24{position:relative;width:100%;min-height:var(--dsc-item-height);display:flex;align-items:center;justify-content:start;column-gap:var(--dsc-item-spacing);padding-right:var(--dsc-item-px);padding-left:var(--dsc-item-px)}._header_w20tn_24 mark{background-color:transparent;text-decoration:underline}._link_w20tn_43{outline:none}._linkFocus_w20tn_47{position:absolute;top:0;left:0;right:0;bottom:0;border-radius:var(--dsc-item-border-radius)}._controls_w20tn_56 a,._controls_w20tn_56 button{position:relative}._link_w20tn_43:focus-visible ._linkFocus_w20tn_47{box-shadow:var(--_ds--focus, var(--dsc-focus-boxShadow));outline:var(--_ds--focus, var(--dsc-focus-outline))}._link_w20tn_43:focus-visible ._linkFocus_w20tn_47 *{--_ds--focus: }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._icon_15rz1_1{position:relative;min-width:2.25rem;min-height:2.25rem;display:flex;align-items:center;justify-content:center;box-sizing:border-box}._shape_15rz1_11{position:absolute;width:100%;height:100%;top:0;right:0;bottom:0;left:0;background-color:var(--ds-color-background-default);border-radius:5%}._icon_15rz1_1{font-size:1.5rem;width:1.5rem;height:1.5rem}._avatar_15rz1_29{font-size:2.25rem;width:2.25rem;height:2.25rem}._avatarGroup_15rz1_35{font-size:.625em}._badge_15rz1_39{position:absolute;top:0;right:0;margin-top:-.25em;margin-right:-.25em;outline:1px solid white}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._globalSearch_gfstq_1{max-width:700px;margin:1rem auto;padding-bottom:.8rem}._searchInput_gfstq_7{border:2px solid black}._searchInputButton_gfstq_11{border:2px solid black;border-left:none}._searchButton_gfstq_16{background-color:#e0e2e4;color:var(--ds-color-accent-text-default)}._searchButton_gfstq_16:hover{background-color:var(--ds-color-accent-surface-hover)}._searchButton_gfstq_16:active{background-color:var(--ds-color-accent-surface-active)}@media (max-width: 1023px){._searchButton_gfstq_16{margin-right:.5rem}}
|
|
@@ -1,74 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsxs as u, jsx as c } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
3
2
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import
|
|
5
|
-
import { Badge as
|
|
6
|
-
import { IconButton as
|
|
7
|
-
import { ContextMenu as
|
|
3
|
+
import { isValidElement as c } from "react";
|
|
4
|
+
import { Badge as u } from "../Badge/Badge.js";
|
|
5
|
+
import { IconButton as x } from "../Button/IconButton.js";
|
|
6
|
+
import { ContextMenu as a } from "../ContextMenu/ContextMenu.js";
|
|
8
7
|
import "../RootProvider/RootProvider.js";
|
|
9
|
-
import { ListItemControls as
|
|
8
|
+
import { ListItemControls as B } from "../List/ListItemControls.js";
|
|
10
9
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (r[e] = t[e]);
|
|
15
|
-
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
16
|
-
for (var l = 0, e = Object.getOwnPropertySymbols(t); l < e.length; l++)
|
|
17
|
-
n.indexOf(e[l]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[l]) && (r[e[l]] = t[e[l]]);
|
|
18
|
-
return r;
|
|
19
|
-
};
|
|
20
|
-
const h = d((t, n) => {
|
|
21
|
-
var { title: r, titleId: e } = t, l = v(t, ["title", "titleId"]);
|
|
22
|
-
let o = m();
|
|
23
|
-
return o = r ? e || "title-" + o : void 0, i.createElement(
|
|
24
|
-
"svg",
|
|
25
|
-
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),
|
|
26
|
-
r ? i.createElement("title", { id: o }, r) : null,
|
|
27
|
-
i.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M12 4.969c1.399-1.242 2.776-1.844 4.125-1.844 1.519 0 2.823.763 3.905 1.845 2.373 2.372 2.207 6.354-1 9.56l-6.5 6.5-.53-.53-.53.53-6.5-6.5c-3.207-3.206-3.373-7.188-1-9.56C5.05 3.888 6.356 3.125 7.875 3.125c1.349 0 2.726.602 4.125 1.844M12 20.5l-.53.53a.75.75 0 0 0 1.06 0zm0-1.06 5.97-5.97c2.793-2.794 2.627-5.812 1-7.44-.919-.918-1.864-1.405-2.845-1.405s-2.177.487-3.595 1.905a.75.75 0 0 1-1.06 0C10.05 5.112 8.856 4.625 7.874 4.625S5.948 5.112 5.03 6.03c-1.627 1.628-1.793 4.646 1 7.44z", clipRule: "evenodd" })
|
|
28
|
-
);
|
|
29
|
-
});
|
|
30
|
-
var x = function(t, n) {
|
|
31
|
-
var r = {};
|
|
32
|
-
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (r[e] = t[e]);
|
|
33
|
-
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
34
|
-
for (var l = 0, e = Object.getOwnPropertySymbols(t); l < e.length; l++)
|
|
35
|
-
n.indexOf(e[l]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[l]) && (r[e[l]] = t[e[l]]);
|
|
36
|
-
return r;
|
|
37
|
-
};
|
|
38
|
-
const I = d((t, n) => {
|
|
39
|
-
var { title: r, titleId: e } = t, l = x(t, ["title", "titleId"]);
|
|
40
|
-
let o = m();
|
|
41
|
-
return o = r ? e || "title-" + o : void 0, i.createElement(
|
|
42
|
-
"svg",
|
|
43
|
-
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),
|
|
44
|
-
r ? i.createElement("title", { id: o }, r) : null,
|
|
45
|
-
i.createElement("path", { fill: "currentColor", d: "M12 4.969c1.399-1.242 2.776-1.844 4.125-1.844 1.519 0 2.823.763 3.905 1.845 2.373 2.372 2.206 6.354-1 9.56l-6.5 6.5a.75.75 0 0 1-1.06 0l-6.5-6.5c-3.207-3.206-3.373-7.188-1-9.56C5.05 3.888 6.355 3.125 7.874 3.125c1.349 0 2.726.602 4.125 1.844" })
|
|
46
|
-
);
|
|
47
|
-
}), A = ({
|
|
48
|
-
id: t,
|
|
10
|
+
import { S as C, a as d } from "../../HeartFill-CYSrJ_xK.js";
|
|
11
|
+
const V = ({
|
|
12
|
+
id: m,
|
|
49
13
|
type: n,
|
|
50
14
|
badge: r,
|
|
51
15
|
isCurrentEndUser: e = !1,
|
|
52
|
-
favourite:
|
|
53
|
-
favouriteLabel:
|
|
54
|
-
onToggleFavourite:
|
|
55
|
-
contextMenu:
|
|
16
|
+
favourite: s = !1,
|
|
17
|
+
favouriteLabel: f,
|
|
18
|
+
onToggleFavourite: t,
|
|
19
|
+
contextMenu: i,
|
|
56
20
|
loading: p
|
|
57
|
-
}) => /* @__PURE__ */
|
|
58
|
-
r && (r && !p && typeof r == "object" && "label" in r ? /* @__PURE__ */
|
|
59
|
-
!e && n !== "group" && /* @__PURE__ */
|
|
60
|
-
|
|
21
|
+
}) => /* @__PURE__ */ l(B, { children: [
|
|
22
|
+
r && (r && !p && typeof r == "object" && "label" in r ? /* @__PURE__ */ o(u, { ...r }) : c(r) ? r : null),
|
|
23
|
+
!e && n !== "group" && /* @__PURE__ */ o(
|
|
24
|
+
x,
|
|
61
25
|
{
|
|
62
26
|
rounded: !0,
|
|
63
27
|
variant: "text",
|
|
64
|
-
icon:
|
|
65
|
-
iconAltText:
|
|
66
|
-
onClick: () =>
|
|
28
|
+
icon: s ? C : d,
|
|
29
|
+
iconAltText: f || "Toggle favourite",
|
|
30
|
+
onClick: () => t == null ? void 0 : t(m),
|
|
67
31
|
size: "xs"
|
|
68
32
|
}
|
|
69
33
|
),
|
|
70
|
-
|
|
34
|
+
i && /* @__PURE__ */ o(a, { ...i })
|
|
71
35
|
] });
|
|
72
36
|
export {
|
|
73
|
-
|
|
37
|
+
V as AccountListItemControls
|
|
74
38
|
};
|
|
@@ -1,62 +1,66 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
3
|
+
import { useState as R, useEffect as S } from "react";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { Menu as
|
|
6
|
+
import { Menu as j } from "../Menu/Menu.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
const
|
|
9
|
-
items:
|
|
10
|
-
groups:
|
|
11
|
-
search:
|
|
8
|
+
const k = (d) => `${d} hits`, D = ({
|
|
9
|
+
items: d = [],
|
|
10
|
+
groups: v = {},
|
|
11
|
+
search: l,
|
|
12
12
|
filterAccount: C,
|
|
13
|
-
onSelectAccount:
|
|
14
|
-
currentAccount:
|
|
15
|
-
isVirtualized:
|
|
16
|
-
keyboardEvents:
|
|
13
|
+
onSelectAccount: u,
|
|
14
|
+
currentAccount: e,
|
|
15
|
+
isVirtualized: L,
|
|
16
|
+
keyboardEvents: w
|
|
17
17
|
}) => {
|
|
18
|
-
var
|
|
19
|
-
const
|
|
18
|
+
var a;
|
|
19
|
+
const p = d.map((o) => ({
|
|
20
20
|
...o,
|
|
21
21
|
title: (o == null ? void 0 : o.title) || o.name,
|
|
22
22
|
groupId: o.groupId || "search",
|
|
23
|
-
selected: o.selected ?? (
|
|
23
|
+
selected: o.selected ?? (e == null ? void 0 : e.id) === o.id,
|
|
24
24
|
onClick: () => {
|
|
25
|
-
!o.disabled && (
|
|
25
|
+
!o.disabled && (u == null || u(o.id));
|
|
26
26
|
}
|
|
27
|
-
})), [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
27
|
+
})), [t, i] = R("");
|
|
28
|
+
S(() => {
|
|
29
|
+
(l == null ? void 0 : l.value) !== void 0 && i(l.value);
|
|
30
|
+
}, [l == null ? void 0 : l.value]);
|
|
31
|
+
const F = C || ((o, f) => {
|
|
32
|
+
var g, r, s;
|
|
33
|
+
return ((g = o == null ? void 0 : o.name) == null ? void 0 : g.toLowerCase().includes(f.toLowerCase())) || ((s = (r = o == null ? void 0 : o.description) == null ? void 0 : r.toString()) == null ? void 0 : s.toLowerCase().includes(f.toLowerCase()));
|
|
34
|
+
}), n = t ? p.filter((o) => F(o, t)).map((o) => ({
|
|
31
35
|
...o,
|
|
32
36
|
groupId: "search",
|
|
33
37
|
title: (o == null ? void 0 : o.title) || o.name,
|
|
34
|
-
highlightWords: [
|
|
35
|
-
})) :
|
|
38
|
+
highlightWords: [t]
|
|
39
|
+
})) : p, b = t ? {
|
|
36
40
|
search: {
|
|
37
|
-
title: ((
|
|
41
|
+
title: ((a = l == null ? void 0 : l.getResultsLabel) == null ? void 0 : a.call(l, n.length)) ?? k(n.length)
|
|
38
42
|
}
|
|
39
|
-
} :
|
|
43
|
+
} : v, I = {
|
|
40
44
|
name: "account-search",
|
|
41
|
-
value:
|
|
42
|
-
placeholder: (
|
|
43
|
-
onChange: (o) =>
|
|
44
|
-
onClear: () =>
|
|
45
|
-
},
|
|
45
|
+
value: t,
|
|
46
|
+
placeholder: (l == null ? void 0 : l.placeholder) ?? "Find account",
|
|
47
|
+
onChange: (o) => i(o.target.value),
|
|
48
|
+
onClear: () => i("")
|
|
49
|
+
}, M = [
|
|
46
50
|
...n.length > 0 ? n : [{ id: "search", groupId: "search", hidden: !0 }]
|
|
47
51
|
];
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
|
|
52
|
+
return /* @__PURE__ */ x(
|
|
53
|
+
j,
|
|
50
54
|
{
|
|
51
55
|
variant: "default",
|
|
52
|
-
search:
|
|
53
|
-
groups:
|
|
54
|
-
items:
|
|
55
|
-
isVirtualized:
|
|
56
|
-
keyboardEvents:
|
|
56
|
+
search: l && (l == null ? void 0 : l.hidden) === !1 ? I : void 0,
|
|
57
|
+
groups: b,
|
|
58
|
+
items: M,
|
|
59
|
+
isVirtualized: L,
|
|
60
|
+
keyboardEvents: w
|
|
57
61
|
}
|
|
58
62
|
);
|
|
59
63
|
};
|
|
60
64
|
export {
|
|
61
|
-
|
|
65
|
+
D as AccountMenu
|
|
62
66
|
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
3
|
+
import { c as m } from "../../index-L8X2o7IH.js";
|
|
4
|
+
import f, { forwardRef as _, isValidElement as v } from "react";
|
|
5
|
+
import { Avatar as b } from "../Avatar/Avatar.js";
|
|
6
|
+
import { ButtonBase as p } from "../Button/ButtonBase.js";
|
|
7
|
+
import { ButtonLabel as g } from "../Button/ButtonLabel.js";
|
|
8
|
+
import { ButtonIcon as u } from "../Button/ButtonIcon.js";
|
|
9
|
+
import "../RootProvider/RootProvider.js";
|
|
10
|
+
import "../Snackbar/useSnackbar.js";
|
|
11
|
+
import { S as h } from "../../XMark-tKk6aExO.js";
|
|
12
|
+
import { u as I } from "../../useId-BVFxCjkq.js";
|
|
13
|
+
import '../../assets/AccountMenuButton.css';var w = function(t, o) {
|
|
14
|
+
var i = {};
|
|
15
|
+
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && o.indexOf(e) < 0 && (i[e] = t[e]);
|
|
16
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
17
|
+
for (var l = 0, e = Object.getOwnPropertySymbols(t); l < e.length; l++)
|
|
18
|
+
o.indexOf(e[l]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[l]) && (i[e[l]] = t[e[l]]);
|
|
19
|
+
return i;
|
|
20
|
+
};
|
|
21
|
+
const y = _((t, o) => {
|
|
22
|
+
var { title: i, titleId: e } = t, l = w(t, ["title", "titleId"]);
|
|
23
|
+
let r = I();
|
|
24
|
+
return r = i ? e || "title-" + r : void 0, f.createElement(
|
|
25
|
+
"svg",
|
|
26
|
+
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: o, "aria-labelledby": r }, l),
|
|
27
|
+
i ? f.createElement("title", { id: r }, i) : null,
|
|
28
|
+
f.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M15.5 3.25a.75.75 0 0 0 0 1.5H19a.25.25 0 0 1 .25.25v14a.25.25 0 0 1-.25.25h-3.5a.75.75 0 0 0 0 1.5H19A1.75 1.75 0 0 0 20.75 19V5A1.75 1.75 0 0 0 19 3.25zM9.97 6.97a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 1 1-1.06-1.06l3.22-3.22H3.5a.75.75 0 0 1 0-1.5h9.69L9.97 8.03a.75.75 0 0 1 0-1.06", clipRule: "evenodd" })
|
|
29
|
+
);
|
|
30
|
+
}), N = "_button_1r4wq_1", x = "_avatarIcon_1r4wq_18", O = "_loginIcon_1r4wq_19", q = "_closeIcon_1r4wq_20", j = "_avatar_1r4wq_18", k = "_icon_1r4wq_43", L = "_labelContainer_1r4wq_55", B = "_description_1r4wq_63", n = {
|
|
31
|
+
button: N,
|
|
32
|
+
avatarIcon: x,
|
|
33
|
+
loginIcon: O,
|
|
34
|
+
closeIcon: q,
|
|
35
|
+
avatar: j,
|
|
36
|
+
icon: k,
|
|
37
|
+
labelContainer: L,
|
|
38
|
+
description: B
|
|
39
|
+
}, F = ({
|
|
40
|
+
className: t,
|
|
41
|
+
currentAccount: o,
|
|
42
|
+
expanded: i,
|
|
43
|
+
minimized: e = !1,
|
|
44
|
+
loading: l = !1,
|
|
45
|
+
...r
|
|
46
|
+
}) => {
|
|
47
|
+
const c = C(void 0);
|
|
48
|
+
if (l)
|
|
49
|
+
return /* @__PURE__ */ a(
|
|
50
|
+
p,
|
|
51
|
+
{
|
|
52
|
+
...r,
|
|
53
|
+
as: "button",
|
|
54
|
+
type: "button",
|
|
55
|
+
variant: "text",
|
|
56
|
+
color: "accent",
|
|
57
|
+
className: m(n.button, n.loading, t),
|
|
58
|
+
disabled: !0,
|
|
59
|
+
"aria-label": "loading",
|
|
60
|
+
children: /* @__PURE__ */ a(u, { className: n.avatarIcon, icon: /* @__PURE__ */ a(b, { name: "loading", loading: !0, className: n.avatar }) })
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
if (o) {
|
|
64
|
+
let s = o.description;
|
|
65
|
+
return o.type === "subunit" && typeof s == "string" && s && (s = `${s.split(",")[0]}, ${c.subunit}`), /* @__PURE__ */ d(
|
|
66
|
+
p,
|
|
67
|
+
{
|
|
68
|
+
...r,
|
|
69
|
+
as: "button",
|
|
70
|
+
type: "button",
|
|
71
|
+
variant: "text",
|
|
72
|
+
color: "accent",
|
|
73
|
+
className: m(n.button, t),
|
|
74
|
+
"aria-label": i ? c.close : o.name,
|
|
75
|
+
children: [
|
|
76
|
+
!e && /* @__PURE__ */ a(g, { children: /* @__PURE__ */ d("div", { className: n.labelContainer, children: [
|
|
77
|
+
o.name,
|
|
78
|
+
/* @__PURE__ */ a("span", { className: n.description, children: typeof s == "string" || v(s) ? s : null })
|
|
79
|
+
] }) }),
|
|
80
|
+
i ? /* @__PURE__ */ a(u, { className: n.closeIcon, icon: /* @__PURE__ */ a(h, { className: n.icon, "aria-hidden": !0 }) }) : /* @__PURE__ */ a(
|
|
81
|
+
u,
|
|
82
|
+
{
|
|
83
|
+
className: n.avatarIcon,
|
|
84
|
+
icon: /* @__PURE__ */ a(b, { ...o == null ? void 0 : o.icon, className: n.avatar })
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
return i ? null : /* @__PURE__ */ d(
|
|
92
|
+
p,
|
|
93
|
+
{
|
|
94
|
+
...r,
|
|
95
|
+
as: "button",
|
|
96
|
+
type: "button",
|
|
97
|
+
variant: "text",
|
|
98
|
+
color: "accent",
|
|
99
|
+
"aria-label": c.login,
|
|
100
|
+
className: m(n.button, t),
|
|
101
|
+
children: [
|
|
102
|
+
!e && /* @__PURE__ */ a(g, { children: c.login }),
|
|
103
|
+
/* @__PURE__ */ a(u, { className: n.loginIcon, icon: /* @__PURE__ */ a(y, { className: n.icon, "aria-hidden": !0 }) })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}, C = (t) => {
|
|
108
|
+
switch (t) {
|
|
109
|
+
case "nn":
|
|
110
|
+
return {
|
|
111
|
+
login: "Logg inn",
|
|
112
|
+
close: "Lukk kontomeny",
|
|
113
|
+
subunit: "undereining"
|
|
114
|
+
};
|
|
115
|
+
case "en":
|
|
116
|
+
return {
|
|
117
|
+
login: "Log in",
|
|
118
|
+
close: "Close Account Menu",
|
|
119
|
+
subunit: "subunit"
|
|
120
|
+
};
|
|
121
|
+
default:
|
|
122
|
+
return {
|
|
123
|
+
login: "Logg inn",
|
|
124
|
+
close: "Lukk kontomeny",
|
|
125
|
+
subunit: "underenhet"
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
export {
|
|
130
|
+
F as AccountMenuButton
|
|
131
|
+
};
|
|
@@ -2,10 +2,10 @@ import { jsxs as c, jsx as t } 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 { Fieldset as d } from "../Forms/Fieldset.js";
|
|
7
6
|
import { Switch as r } from "../Forms/Switch.js";
|
|
8
7
|
import { TextField as i } from "../Forms/TextField.js";
|
|
8
|
+
import "../Snackbar/useSnackbar.js";
|
|
9
9
|
const M = ({
|
|
10
10
|
phone: m,
|
|
11
11
|
phoneLabel: p = "Varsle på SMS",
|