@altinn/altinn-components 0.24.2 → 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/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/Menu/MenuItemsVirtual.js +65 -602
- 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
|
}
|
|
@@ -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
|
};
|