@altinn/altinn-components 0.24.1 → 0.24.4
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/Checkmark-RgzvRNxP.js +25 -0
- package/dist/altinn-ds-overrides.css +5 -0
- package/dist/assets/MenuBase.css +1 -1
- package/dist/assets/MenuItemsVirtual.css +1 -1
- package/dist/components/Dialog/DialogListGroup.js +13 -32
- package/dist/components/DsComponents/index.js +23 -0
- package/dist/components/GlobalMenu/AccountMenu.js +24 -24
- package/dist/components/List/ListItem.js +50 -49
- package/dist/components/Menu/MenuBase.js +10 -10
- package/dist/components/Menu/MenuItemsVirtual.js +66 -605
- package/dist/components/index.js +162 -141
- package/dist/global.css +3 -0
- package/dist/index-DyDqjche.js +541 -0
- package/dist/index.js +179 -158
- package/dist/types/lib/components/Avatar/Examples.stories.d.ts +1 -1
- package/dist/types/lib/components/Avatar/avatar.stories.d.ts +1 -1
- package/dist/types/lib/components/DsComponents/DsComponents.stories.d.ts +23 -0
- package/dist/types/lib/components/DsComponents/index.d.ts +1 -0
- package/dist/types/lib/components/GlobalMenu/AccountMenu.d.ts +2 -2
- package/dist/types/lib/components/Header/LocaleSwitcher.stories.d.ts +1 -1
- package/dist/types/lib/components/Icon/IconOrAvatar.d.ts +1 -1
- package/dist/types/lib/components/Search/AutocompleteBase.d.ts +1 -1
- package/dist/types/lib/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/types/lib/components/Transmission/Transmission.stories.d.ts +9 -9
- package/dist/types/lib/components/index.d.ts +1 -0
- package/dist/usePagination-CBMPUKt_.js +4073 -0
- package/package.json +4 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
4
|
+
import { u as f } from "./useId-CsCRkvK3.js";
|
|
5
|
+
var d = function(t, n) {
|
|
6
|
+
var r = {};
|
|
7
|
+
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (r[e] = t[e]);
|
|
8
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
9
|
+
for (var l = 0, e = Object.getOwnPropertySymbols(t); l < e.length; l++)
|
|
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 p = a((t, n) => {
|
|
14
|
+
var { title: r, titleId: e } = t, l = d(t, ["title", "titleId"]);
|
|
15
|
+
let o = f();
|
|
16
|
+
return o = r ? e || "title-" + o : void 0, i.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 ? i.createElement("title", { id: o }, r) : null,
|
|
20
|
+
i.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M18.998 6.94a.75.75 0 0 1 .063 1.058l-8 9a.75.75 0 0 1-1.091.032l-5-5a.75.75 0 1 1 1.06-1.06l4.438 4.437 7.471-8.405A.75.75 0 0 1 19 6.939", clipRule: "evenodd" })
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
p as S
|
|
25
|
+
};
|
|
@@ -36,4 +36,9 @@
|
|
|
36
36
|
--ds-color-accent-text-default: var(--ds-color-company-text-default);
|
|
37
37
|
--ds-color-accent-contrast-default: var(--ds-color-company-contrast-default);
|
|
38
38
|
--ds-color-accent-contrast-subtle: var(--ds-color-company-contrast-subtle);
|
|
39
|
+
|
|
40
|
+
/* Override tokens from designSystem & altinn-components */
|
|
41
|
+
--ds-color-neutral-surface-default: #fff;
|
|
42
|
+
--ds-body-md-font-size: 1rem;
|
|
43
|
+
--ds-color-text-subtle: #10204a;
|
|
39
44
|
}
|
package/dist/assets/MenuBase.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._menu_twp4i_1{list-style:none;padding:0;margin:0;text-indent:0;display:flex;flex-direction:column;width:100%}._list_twp4i_12,._item_twp4i_18{list-style:none;padding:0;margin:0}._item_twp4i_18[role=separator]{border-top:1px solid var(--ds-color-border-subtle)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._virtualScrollRef_12fdc_1{max-height:400px;overflow:auto}._virtualMenuListItem_12fdc_6{position:absolute;top:0;left:0;width:100%}._virtualMenuListItem_12fdc_6>*{margin:0}
|
|
@@ -1,41 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsxs as a, jsx as l } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
3
2
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { Button as p } from "../Button/Button.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Button as e } from "../Button/Button.js";
|
|
7
5
|
import "../RootProvider/RootProvider.js";
|
|
8
|
-
import { ListBase as
|
|
9
|
-
import { Heading as
|
|
6
|
+
import { ListBase as n } from "../List/ListBase.js";
|
|
7
|
+
import { Heading as p } from "../Typography/Heading.js";
|
|
10
8
|
import "../Search/AutocompleteBase.js";
|
|
11
9
|
import "../Snackbar/useSnackbar.js";
|
|
12
10
|
import { Flex as s } from "../Page/Flex.js";
|
|
13
|
-
import { Section as
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
|
|
20
|
-
i.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (r[t[o]] = e[t[o]]);
|
|
21
|
-
return r;
|
|
22
|
-
};
|
|
23
|
-
const w = f((e, i) => {
|
|
24
|
-
var { title: r, titleId: t } = e, o = v(e, ["title", "titleId"]);
|
|
25
|
-
let n = g();
|
|
26
|
-
return n = r ? t || "title-" + n : void 0, m.createElement(
|
|
27
|
-
"svg",
|
|
28
|
-
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: i, "aria-labelledby": n }, o),
|
|
29
|
-
r ? m.createElement("title", { id: n }, r) : null,
|
|
30
|
-
m.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M18.998 6.94a.75.75 0 0 1 .063 1.058l-8 9a.75.75 0 0 1-1.091.032l-5-5a.75.75 0 1 1 1.06-1.06l4.438 4.437 7.471-8.405A.75.75 0 0 1 19 6.939", clipRule: "evenodd" })
|
|
31
|
-
);
|
|
32
|
-
}), P = ({ title: e, children: i, checkAllLabel: r }) => /* @__PURE__ */ a(u, { spacing: 3, children: [
|
|
33
|
-
e && /* @__PURE__ */ a(s, { direction: "row", align: "center", justify: "between", children: [
|
|
34
|
-
/* @__PURE__ */ l(d, { size: "lg", children: e }),
|
|
35
|
-
r && /* @__PURE__ */ l(p, { variant: "text", icon: w, size: "sm", children: r })
|
|
11
|
+
import { Section as c } from "../Page/Section.js";
|
|
12
|
+
import { S as a } from "../../Checkmark-RgzvRNxP.js";
|
|
13
|
+
const B = ({ title: i, children: m, checkAllLabel: o }) => /* @__PURE__ */ t(c, { spacing: 3, children: [
|
|
14
|
+
i && /* @__PURE__ */ t(s, { direction: "row", align: "center", justify: "between", children: [
|
|
15
|
+
/* @__PURE__ */ r(p, { size: "lg", children: i }),
|
|
16
|
+
o && /* @__PURE__ */ r(e, { variant: "text", icon: a, size: "sm", children: o })
|
|
36
17
|
] }),
|
|
37
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ r(n, { spacing: 3, children: m })
|
|
38
19
|
] });
|
|
39
20
|
export {
|
|
40
|
-
|
|
21
|
+
B as DialogListGroup
|
|
41
22
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { A as D, B as e, a as o, C as i, b as n, c as t, D as r, d as g, H as b, L as d, e as h, f as p, P, g as l, h as C, S as L, i as S, j as c, T as k, u as m } from "../../usePagination-CBMPUKt_.js";
|
|
2
|
+
export {
|
|
3
|
+
D as DsAlert,
|
|
4
|
+
e as DsBadge,
|
|
5
|
+
o as DsButton,
|
|
6
|
+
i as DsCheckbox,
|
|
7
|
+
n as DsChip,
|
|
8
|
+
t as DsCombobox,
|
|
9
|
+
r as DsDetails,
|
|
10
|
+
g as DsDialog,
|
|
11
|
+
b as DsHeading,
|
|
12
|
+
d as DsLink,
|
|
13
|
+
h as DsListItem,
|
|
14
|
+
p as DsListUnordered,
|
|
15
|
+
P as DsPagination,
|
|
16
|
+
l as DsParagraph,
|
|
17
|
+
C as DsPopover,
|
|
18
|
+
L as DsSearch,
|
|
19
|
+
S as DsSkeleton,
|
|
20
|
+
c as DsSpinner,
|
|
21
|
+
k as DsTabs,
|
|
22
|
+
m as useDsPagination
|
|
23
|
+
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
3
3
|
import { useState as L } from "react";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
6
|
import "../Search/AutocompleteBase.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
8
|
import { Menu as M } from "../Menu/Menu.js";
|
|
9
|
-
const
|
|
9
|
+
const w = (d) => `${d} hits`, k = ({
|
|
10
10
|
accounts: d = [],
|
|
11
|
-
accountGroups:
|
|
11
|
+
accountGroups: y = {},
|
|
12
12
|
accountSearch: s,
|
|
13
13
|
onSelectAccount: m,
|
|
14
14
|
currentAccount: p,
|
|
15
|
-
isVirtualized:
|
|
15
|
+
isVirtualized: C
|
|
16
16
|
}) => {
|
|
17
17
|
var f;
|
|
18
18
|
const t = d.map((e) => ({
|
|
@@ -20,16 +20,16 @@ const a = (d) => `${d} hits`, R = ({
|
|
|
20
20
|
groupId: e.groupId || "search",
|
|
21
21
|
selected: e.selected ?? (p == null ? void 0 : p.id) === e.id,
|
|
22
22
|
title: e.name,
|
|
23
|
-
...(e == null ? void 0 : e.
|
|
23
|
+
...(e == null ? void 0 : e.items) && {
|
|
24
24
|
avatarGroup: {
|
|
25
25
|
size: "sm",
|
|
26
|
-
items: e.
|
|
27
|
-
name:
|
|
28
|
-
type: e.type
|
|
26
|
+
items: e.items.map((i) => ({
|
|
27
|
+
name: i.name,
|
|
28
|
+
type: i.type || e.type
|
|
29
29
|
}))
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
-
...!(e != null && e.
|
|
32
|
+
...!(e != null && e.items) && {
|
|
33
33
|
avatar: {
|
|
34
34
|
size: "md",
|
|
35
35
|
type: e.type,
|
|
@@ -39,36 +39,36 @@ const a = (d) => `${d} hits`, R = ({
|
|
|
39
39
|
badge: e.badge,
|
|
40
40
|
alertBadge: e.alertBadge,
|
|
41
41
|
onClick: () => m == null ? void 0 : m(e.id || e.name)
|
|
42
|
-
})), [
|
|
43
|
-
var
|
|
44
|
-
return (
|
|
42
|
+
})), [l, g] = L(""), r = l ? t.filter((e) => {
|
|
43
|
+
var i;
|
|
44
|
+
return (i = e == null ? void 0 : e.title) == null ? void 0 : i.toLowerCase().includes(l.toLowerCase());
|
|
45
45
|
}).map((e) => ({
|
|
46
46
|
...e,
|
|
47
47
|
groupId: "search"
|
|
48
|
-
})) : t,
|
|
48
|
+
})) : t, I = l ? {
|
|
49
49
|
search: {
|
|
50
|
-
title: ((f = s == null ? void 0 : s.getResultsLabel) == null ? void 0 : f.call(s,
|
|
50
|
+
title: ((f = s == null ? void 0 : s.getResultsLabel) == null ? void 0 : f.call(s, r.length)) ?? w(r.length)
|
|
51
51
|
}
|
|
52
|
-
} :
|
|
52
|
+
} : y, b = {
|
|
53
53
|
name: "account-search",
|
|
54
|
-
value:
|
|
54
|
+
value: l,
|
|
55
55
|
placeholder: (s == null ? void 0 : s.placeholder) ?? "Find account",
|
|
56
56
|
onChange: (e) => g(e.target.value),
|
|
57
57
|
onClear: () => g("")
|
|
58
|
-
},
|
|
59
|
-
...
|
|
58
|
+
}, h = [
|
|
59
|
+
...r.length > 0 ? r : [{ id: "search", groupId: "search", hidden: !0 }]
|
|
60
60
|
];
|
|
61
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ v(
|
|
62
62
|
M,
|
|
63
63
|
{
|
|
64
64
|
theme: "default",
|
|
65
|
-
search: s &&
|
|
66
|
-
groups:
|
|
67
|
-
items:
|
|
68
|
-
isVirtualized:
|
|
65
|
+
search: s && b,
|
|
66
|
+
groups: I,
|
|
67
|
+
items: h,
|
|
68
|
+
isVirtualized: C
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
};
|
|
72
72
|
export {
|
|
73
|
-
|
|
73
|
+
k as AccountMenu
|
|
74
74
|
};
|
|
@@ -1,75 +1,76 @@
|
|
|
1
|
-
import { jsxs as q, jsx as
|
|
2
|
-
import { ListItemBase as
|
|
3
|
-
import { ListItemHeader as
|
|
4
|
-
const
|
|
5
|
-
className:
|
|
6
|
-
variant:
|
|
1
|
+
import { jsxs as q, jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import { ListItemBase as z } from "./ListItemBase.js";
|
|
3
|
+
import { ListItemHeader as A } from "./ListItemHeader.js";
|
|
4
|
+
const F = ({
|
|
5
|
+
className: p,
|
|
6
|
+
variant: c = "solid",
|
|
7
7
|
color: r,
|
|
8
|
-
theme:
|
|
9
|
-
shadow:
|
|
10
|
-
loading:
|
|
8
|
+
theme: m = "default",
|
|
9
|
+
shadow: e = "xs",
|
|
10
|
+
loading: o,
|
|
11
11
|
collapsible: n,
|
|
12
12
|
expanded: s,
|
|
13
|
-
size:
|
|
14
|
-
icon:
|
|
15
|
-
avatar:
|
|
16
|
-
avatarGroup:
|
|
17
|
-
title:
|
|
18
|
-
titleAs:
|
|
19
|
-
description:
|
|
20
|
-
badge:
|
|
21
|
-
linkIcon:
|
|
13
|
+
size: u = "sm",
|
|
14
|
+
icon: L,
|
|
15
|
+
avatar: l,
|
|
16
|
+
avatarGroup: I,
|
|
17
|
+
title: f,
|
|
18
|
+
titleAs: j,
|
|
19
|
+
description: x,
|
|
20
|
+
badge: a,
|
|
21
|
+
linkIcon: h = !1,
|
|
22
22
|
label: t,
|
|
23
|
-
select:
|
|
24
|
-
selected:
|
|
25
|
-
controls:
|
|
26
|
-
children:
|
|
27
|
-
interactive:
|
|
23
|
+
select: y,
|
|
24
|
+
selected: B,
|
|
25
|
+
controls: H,
|
|
26
|
+
children: b,
|
|
27
|
+
interactive: i,
|
|
28
28
|
...d
|
|
29
29
|
}) => {
|
|
30
30
|
const k = typeof t == "function" ? t() : t;
|
|
31
31
|
return /* @__PURE__ */ q(
|
|
32
|
-
|
|
32
|
+
z,
|
|
33
33
|
{
|
|
34
|
-
variant:
|
|
34
|
+
variant: c,
|
|
35
35
|
color: r,
|
|
36
|
-
theme:
|
|
37
|
-
shadow:
|
|
38
|
-
selected:
|
|
36
|
+
theme: m,
|
|
37
|
+
shadow: e,
|
|
38
|
+
selected: B,
|
|
39
39
|
expanded: s,
|
|
40
|
-
title:
|
|
41
|
-
loading:
|
|
42
|
-
interactive:
|
|
40
|
+
title: f,
|
|
41
|
+
loading: o,
|
|
42
|
+
interactive: i,
|
|
43
43
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
44
|
+
/* @__PURE__ */ w(
|
|
45
|
+
A,
|
|
46
46
|
{
|
|
47
|
-
className:
|
|
47
|
+
className: p,
|
|
48
48
|
color: r,
|
|
49
|
-
theme:
|
|
50
|
-
loading:
|
|
51
|
-
linkIcon:
|
|
49
|
+
theme: m,
|
|
50
|
+
loading: o,
|
|
51
|
+
linkIcon: h,
|
|
52
52
|
collapsible: n,
|
|
53
53
|
expanded: s,
|
|
54
|
-
select:
|
|
55
|
-
size:
|
|
56
|
-
title:
|
|
57
|
-
description:
|
|
58
|
-
icon:
|
|
59
|
-
avatar:
|
|
60
|
-
avatarGroup:
|
|
61
|
-
badge:
|
|
62
|
-
controls:
|
|
63
|
-
titleAs:
|
|
54
|
+
select: y,
|
|
55
|
+
size: u,
|
|
56
|
+
title: f,
|
|
57
|
+
description: x,
|
|
58
|
+
icon: L,
|
|
59
|
+
avatar: l,
|
|
60
|
+
avatarGroup: I,
|
|
61
|
+
badge: a,
|
|
62
|
+
controls: H,
|
|
63
|
+
titleAs: j,
|
|
64
|
+
interactive: i,
|
|
64
65
|
...d,
|
|
65
66
|
children: k
|
|
66
67
|
}
|
|
67
68
|
),
|
|
68
|
-
s ?
|
|
69
|
+
s ? b : null
|
|
69
70
|
]
|
|
70
71
|
}
|
|
71
72
|
);
|
|
72
73
|
};
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
F as ListItem
|
|
75
76
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import '../../assets/MenuBase.css';const
|
|
4
|
-
menu:
|
|
5
|
-
list:
|
|
6
|
-
item:
|
|
7
|
-
}, d = ({ as: t = "nav", color: n, theme: e, className: o, children: s }) => /* @__PURE__ */ m(t, { className: a
|
|
2
|
+
import { c as i } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/MenuBase.css';const p = "_menu_twp4i_1", r = "_list_twp4i_12", u = "_item_twp4i_18", a = {
|
|
4
|
+
menu: p,
|
|
5
|
+
list: r,
|
|
6
|
+
item: u
|
|
7
|
+
}, d = ({ as: t = "nav", color: n, theme: e, className: o, children: s }) => /* @__PURE__ */ m(t, { className: i(a.menu, o), "data-color": n, "data-theme": e, children: s }), x = ({ as: t = "ul", role: n = "group", className: e, children: o }) => /* @__PURE__ */ m(t, { className: i(a.list, e), role: n, children: o }), w = ({
|
|
8
8
|
as: t = "li",
|
|
9
9
|
role: n = "presentation",
|
|
10
10
|
className: e,
|
|
11
11
|
children: o,
|
|
12
12
|
style: s,
|
|
13
|
-
dataIndex:
|
|
14
|
-
}) => /* @__PURE__ */ m(t, { className: a
|
|
13
|
+
dataIndex: c
|
|
14
|
+
}) => /* @__PURE__ */ m(t, { className: i(a.item, e), role: n, style: s, "data-index": c, children: o });
|
|
15
15
|
export {
|
|
16
16
|
d as MenuBase,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
x as MenuList,
|
|
18
|
+
w as MenuListItem
|
|
19
19
|
};
|