@altinn/altinn-components 0.47.4 → 0.47.6
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/assets/UserListItem.css +1 -1
- package/dist/components/Account/AccountMenu.js +41 -34
- package/dist/components/Dropdown/DrawerBase.js +10 -11
- package/dist/components/UserListItem/UserListItem.js +37 -49
- package/dist/types/lib/components/Layout/Layout.stories.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._badges_hp9nk_1{display:flex;flex-direction:row;gap:.5rem;flex-wrap:wrap;justify-content:start;margin-bottom:auto;margin-top:calc(var(--dsc-item-my) * .85)}._label_hp9nk_11{display:flex;flex-direction:row;align-items:center;gap:.5rem}
|
|
@@ -1,64 +1,71 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as x } from "react/jsx-runtime";
|
|
3
|
-
import { useState as R, useEffect as S } from "react";
|
|
3
|
+
import { useState as R, useEffect as S, useMemo as j } from "react";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { Menu as
|
|
6
|
+
import { Menu as k } from "../Menu/Menu.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
const
|
|
9
|
-
items:
|
|
10
|
-
groups:
|
|
11
|
-
search:
|
|
12
|
-
filterAccount:
|
|
13
|
-
onSelectAccount:
|
|
8
|
+
const y = (u) => `${u} hits`, D = ({
|
|
9
|
+
items: u = [],
|
|
10
|
+
groups: C = {},
|
|
11
|
+
search: l,
|
|
12
|
+
filterAccount: w,
|
|
13
|
+
onSelectAccount: d,
|
|
14
14
|
currentAccount: e,
|
|
15
15
|
isVirtualized: L,
|
|
16
|
-
keyboardEvents:
|
|
16
|
+
keyboardEvents: M,
|
|
17
17
|
scrollRefStyles: F
|
|
18
18
|
}) => {
|
|
19
|
-
var
|
|
20
|
-
const
|
|
19
|
+
var p;
|
|
20
|
+
const r = u.map((o) => ({
|
|
21
21
|
...o,
|
|
22
22
|
title: (o == null ? void 0 : o.title) || o.name,
|
|
23
23
|
groupId: o.groupId || "search",
|
|
24
24
|
selected: o.selected ?? (e == null ? void 0 : e.id) === o.id,
|
|
25
25
|
onClick: () => {
|
|
26
|
-
!o.disabled && (
|
|
26
|
+
!o.disabled && (d == null || d(o.id));
|
|
27
27
|
}
|
|
28
|
-
})), [
|
|
28
|
+
})), [t, a] = R("");
|
|
29
29
|
S(() => {
|
|
30
|
-
(
|
|
31
|
-
}, [
|
|
32
|
-
const
|
|
33
|
-
var
|
|
34
|
-
return ((
|
|
35
|
-
}), n =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
(l == null ? void 0 : l.value) !== void 0 && a(l.value);
|
|
31
|
+
}, [l == null ? void 0 : l.value]);
|
|
32
|
+
const i = w || ((o, f) => {
|
|
33
|
+
var s, g, v;
|
|
34
|
+
return ((s = o == null ? void 0 : o.name) == null ? void 0 : s.toLowerCase().includes(f.toLowerCase())) || ((v = (g = o == null ? void 0 : o.description) == null ? void 0 : g.toString()) == null ? void 0 : v.toLowerCase().includes(f.toLowerCase()));
|
|
35
|
+
}), n = j(() => t ? Array.from(
|
|
36
|
+
new Map(
|
|
37
|
+
r.filter((o) => i(o, t)).map((o) => [
|
|
38
|
+
o.id,
|
|
39
|
+
{
|
|
40
|
+
...o,
|
|
41
|
+
groupId: "search",
|
|
42
|
+
title: (o == null ? void 0 : o.title) || o.name,
|
|
43
|
+
highlightWords: [t]
|
|
44
|
+
}
|
|
45
|
+
])
|
|
46
|
+
).values()
|
|
47
|
+
) : r, [r, t, i]), b = t ? {
|
|
41
48
|
search: {
|
|
42
|
-
title: ((
|
|
49
|
+
title: ((p = l == null ? void 0 : l.getResultsLabel) == null ? void 0 : p.call(l, n.length)) ?? y(n.length)
|
|
43
50
|
}
|
|
44
|
-
} :
|
|
51
|
+
} : C, I = {
|
|
45
52
|
name: "account-search",
|
|
46
|
-
value:
|
|
47
|
-
placeholder: (
|
|
48
|
-
onChange: (o) =>
|
|
49
|
-
onClear: () =>
|
|
53
|
+
value: t,
|
|
54
|
+
placeholder: (l == null ? void 0 : l.placeholder) ?? "Find account",
|
|
55
|
+
onChange: (o) => a(o.target.value),
|
|
56
|
+
onClear: () => a("")
|
|
50
57
|
}, c = [
|
|
51
58
|
...n.length > 0 ? n : [{ id: "search", groupId: "search", hidden: !0 }]
|
|
52
59
|
];
|
|
53
60
|
return /* @__PURE__ */ x(
|
|
54
|
-
|
|
61
|
+
k,
|
|
55
62
|
{
|
|
56
63
|
variant: "default",
|
|
57
|
-
search:
|
|
58
|
-
groups:
|
|
64
|
+
search: l && !l.hidden ? I : void 0,
|
|
65
|
+
groups: b,
|
|
59
66
|
items: c,
|
|
60
67
|
isVirtualized: L,
|
|
61
|
-
keyboardEvents:
|
|
68
|
+
keyboardEvents: M,
|
|
62
69
|
scrollRefStyles: F
|
|
63
70
|
}
|
|
64
71
|
);
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { c as s } from "../../index-L8X2o7IH.js";
|
|
3
|
-
import '../../assets/DrawerBase.css';const
|
|
4
|
-
drawer:
|
|
3
|
+
import '../../assets/DrawerBase.css';const m = "_drawer_tvpob_1", c = {
|
|
4
|
+
drawer: m
|
|
5
5
|
}, w = ({
|
|
6
6
|
placement: a = "inline",
|
|
7
|
-
open:
|
|
8
|
-
className:
|
|
9
|
-
children:
|
|
10
|
-
as:
|
|
7
|
+
open: e = !1,
|
|
8
|
+
className: t,
|
|
9
|
+
children: r,
|
|
10
|
+
as: o = "div",
|
|
11
11
|
dataLayout: n = "mobile"
|
|
12
12
|
}) => /* @__PURE__ */ d(
|
|
13
|
-
|
|
13
|
+
o,
|
|
14
14
|
{
|
|
15
|
-
className: s(
|
|
15
|
+
className: s(c.drawer, t),
|
|
16
16
|
"data-placement": a,
|
|
17
17
|
"data-variant": "default",
|
|
18
|
-
"data-
|
|
19
|
-
"data-expanded": t,
|
|
18
|
+
"data-expanded": e,
|
|
20
19
|
"data-layout": n,
|
|
21
|
-
children:
|
|
20
|
+
children: r
|
|
22
21
|
}
|
|
23
22
|
);
|
|
24
23
|
export {
|
|
@@ -1,83 +1,71 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as s, jsxs as
|
|
3
|
-
import {
|
|
2
|
+
import { jsx as s, jsxs as u } from "react/jsx-runtime";
|
|
3
|
+
import { Badge as y } from "../Badge/Badge.js";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
|
-
import
|
|
6
|
-
import { Badge as g } from "../Badge/Badge.js";
|
|
5
|
+
import m, { forwardRef as h } from "react";
|
|
7
6
|
import "../RootProvider/RootProvider.js";
|
|
8
7
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import { ListItemLabel as
|
|
10
|
-
import { ListItem as
|
|
11
|
-
import { u as
|
|
12
|
-
import '../../assets/UserListItem.css';var
|
|
13
|
-
var
|
|
14
|
-
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) &&
|
|
8
|
+
import { ListItemLabel as v } from "../List/ListItemLabel.js";
|
|
9
|
+
import { ListItem as g } from "../List/ListItem.js";
|
|
10
|
+
import { u as _ } from "../../useId-BVFxCjkq.js";
|
|
11
|
+
import '../../assets/UserListItem.css';var w = function(e, r) {
|
|
12
|
+
var l = {};
|
|
13
|
+
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && r.indexOf(t) < 0 && (l[t] = e[t]);
|
|
15
14
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
16
|
-
for (var
|
|
17
|
-
|
|
18
|
-
return
|
|
15
|
+
for (var a = 0, t = Object.getOwnPropertySymbols(e); a < t.length; a++)
|
|
16
|
+
r.indexOf(t[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[a]) && (l[t[a]] = e[t[a]]);
|
|
17
|
+
return l;
|
|
19
18
|
};
|
|
20
|
-
const
|
|
21
|
-
var { title:
|
|
22
|
-
let
|
|
23
|
-
return
|
|
19
|
+
const O = h((e, r) => {
|
|
20
|
+
var { title: l, titleId: t } = e, a = w(e, ["title", "titleId"]);
|
|
21
|
+
let o = _();
|
|
22
|
+
return o = l ? t || "title-" + o : void 0, m.createElement(
|
|
24
23
|
"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:
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
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: r, "aria-labelledby": o }, a),
|
|
25
|
+
l ? m.createElement("title", { id: o }, l) : null,
|
|
26
|
+
m.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M11.625 2.35a.75.75 0 0 1 .75 0l7.794 4.5a.75.75 0 0 1 .375.65v9a.75.75 0 0 1-.375.65l-7.779 4.49a.75.75 0 0 1-.39.11h-.006a.76.76 0 0 1-.373-.103L3.83 17.15a.75.75 0 0 1-.375-.65V7.494a.75.75 0 0 1 .382-.648zm-.375 17.351-6.294-3.634V8.799l3.486 2.013a3.751 3.751 0 0 0 2.808 4.863zM15.75 12a3.75 3.75 0 0 1-3 3.675v4.026l6.294-3.634V8.799l-3.486 2.013c.124.373.192.773.192 1.188m-1.79-1.105a2.25 2.25 0 1 1-3.919-.003l.01-.017.01-.016a2.249 2.249 0 0 1 3.9.036m.847-1.382L18.294 7.5 12 3.866 5.706 7.5l3.487 2.013A3.74 3.74 0 0 1 12 8.25a3.74 3.74 0 0 1 2.807 1.263", clipRule: "evenodd" })
|
|
28
27
|
);
|
|
29
|
-
}),
|
|
30
|
-
badges:
|
|
31
|
-
label:
|
|
32
|
-
|
|
33
|
-
}, N = ({
|
|
28
|
+
}), I = "_badges_hp9nk_1", j = "_label_hp9nk_11", f = {
|
|
29
|
+
badges: I,
|
|
30
|
+
label: j
|
|
31
|
+
}, B = ({
|
|
34
32
|
name: e,
|
|
35
|
-
type:
|
|
36
|
-
description:
|
|
33
|
+
type: r,
|
|
34
|
+
description: l,
|
|
37
35
|
roleNames: t,
|
|
38
|
-
titleAs:
|
|
39
|
-
subUnit:
|
|
36
|
+
titleAs: a = "h3",
|
|
37
|
+
subUnit: o = !1,
|
|
40
38
|
loading: c = !1,
|
|
41
39
|
...n
|
|
42
40
|
}) => {
|
|
43
41
|
let i;
|
|
44
|
-
switch (
|
|
42
|
+
switch (r) {
|
|
45
43
|
case "person":
|
|
46
44
|
i = { name: e, type: "person" };
|
|
47
45
|
break;
|
|
48
46
|
case "company":
|
|
49
|
-
i = { name: e, type: "company" };
|
|
47
|
+
i = { name: e, type: "company", isParent: !o };
|
|
50
48
|
break;
|
|
51
49
|
case "system":
|
|
52
|
-
i =
|
|
50
|
+
i = O;
|
|
53
51
|
break;
|
|
54
52
|
default:
|
|
55
53
|
i = { name: e, type: "person" };
|
|
56
54
|
}
|
|
57
|
-
const b =
|
|
55
|
+
const b = !c && t ? /* @__PURE__ */ s("div", { className: f.badges, children: t.map((d) => /* @__PURE__ */ s(y, { label: d, color: n.color, children: d }, d)) }) : void 0, p = /* @__PURE__ */ u("div", { className: f.label, "data-size": n.size, children: [
|
|
58
56
|
/* @__PURE__ */ s(
|
|
59
|
-
|
|
57
|
+
v,
|
|
60
58
|
{
|
|
61
|
-
title: { children: e, as:
|
|
62
|
-
description:
|
|
59
|
+
title: { children: e, as: a },
|
|
60
|
+
description: l,
|
|
63
61
|
size: n.size,
|
|
64
62
|
loading: c
|
|
65
63
|
}
|
|
66
64
|
),
|
|
67
|
-
|
|
65
|
+
b
|
|
68
66
|
] });
|
|
69
|
-
return /* @__PURE__ */ s(
|
|
70
|
-
w,
|
|
71
|
-
{
|
|
72
|
-
icon: r ? b : i,
|
|
73
|
-
ariaLabel: e,
|
|
74
|
-
label: u,
|
|
75
|
-
description: a,
|
|
76
|
-
loading: c,
|
|
77
|
-
...n
|
|
78
|
-
}
|
|
79
|
-
);
|
|
67
|
+
return /* @__PURE__ */ s(g, { icon: i, ariaLabel: e, label: p, description: l, loading: c, ...n });
|
|
80
68
|
};
|
|
81
69
|
export {
|
|
82
|
-
|
|
70
|
+
B as UserListItem
|
|
83
71
|
};
|
|
@@ -50,3 +50,4 @@ export declare const WithEnglishLanguage: (args: LayoutStoryArgs) => import("rea
|
|
|
50
50
|
export declare const StickySidebar: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
|
|
51
51
|
export declare const HiddenSidebar: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
|
|
52
52
|
export declare const Fullscreen: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export declare const Profile: (args: LayoutStoryArgs) => import("react/jsx-runtime").JSX.Element;
|