@altinn/altinn-components 0.16.0 → 0.17.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/README.md +23 -19
- package/dist/ListItemBase-BVx5MDhO.js +83 -0
- package/dist/assets/Flex.css +1 -1
- package/dist/assets/ListItemBase.css +1 -1
- package/dist/assets/ListItemIcon.css +1 -1
- package/dist/components/Bookmarks/BookmarksSection.js +19 -19
- package/dist/components/Dialog/DialogListItem.js +12 -13
- package/dist/components/Dialog/SeenByLog.js +0 -1
- package/dist/components/List/List.js +3 -3
- package/dist/components/List/ListBase.js +2 -2
- package/dist/components/List/ListItem.js +62 -62
- package/dist/components/List/ListItemBase.js +4 -78
- package/dist/components/List/ListItemHeader.js +43 -43
- package/dist/components/List/ListItemIcon.js +6 -6
- package/dist/components/List/index.js +1 -1
- package/dist/components/Page/Flex.js +7 -7
- package/dist/components/Search/Autocomplete.js +27 -24
- package/dist/components/Transmission/TransmissionItem.js +55 -58
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/lib/components/Dialog/DialogListItem.stories.d.ts +4 -3
- package/dist/types/lib/components/List/ListBase.stories.d.ts +3 -4
- package/dist/types/lib/components/List/ListItem.d.ts +2 -0
- package/dist/types/lib/components/List/ListItemBase.d.ts +24 -2
- package/dist/types/lib/components/List/ListItemHeader.d.ts +6 -5
- package/dist/types/lib/components/List/Patterns.stories.d.ts +0 -1
- package/dist/types/lib/components/List/Specimens.stories.d.ts +2 -2
- package/dist/types/lib/components/Page/Flex.d.ts +1 -1
- package/dist/types/lib/components/Transmission/TransmissionItem.stories.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { isValidElement as
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { c as g } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import { isValidElement as y } from "react";
|
|
4
4
|
import { Icon as d } from "../Icon/Icon.js";
|
|
5
|
-
import { Badge as
|
|
5
|
+
import { Badge as B } from "../Badge/Badge.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
|
-
import { ListItemLink as
|
|
8
|
-
import { ListItemLabel as
|
|
7
|
+
import { ListItemLink as M } from "./ListItemLink.js";
|
|
8
|
+
import { ListItemLabel as v } from "./ListItemLabel.js";
|
|
9
9
|
import { ListItemIcon as C } from "./ListItemIcon.js";
|
|
10
10
|
import { ListItemControls as F } from "./ListItemControls.js";
|
|
11
11
|
import { ListItemSelect as H } from "./ListItemSelect.js";
|
|
12
12
|
import "../Search/AutocompleteBase.js";
|
|
13
13
|
import "../Snackbar/useSnackbar.js";
|
|
14
|
-
import '../../assets/ListItemHeader.css';const V = "_header_13dzg_1", b = "_link_13dzg_39",
|
|
14
|
+
import '../../assets/ListItemHeader.css';const V = "_header_13dzg_1", b = "_link_13dzg_39", r = {
|
|
15
15
|
header: V,
|
|
16
16
|
link: b
|
|
17
17
|
}, X = ({
|
|
18
18
|
as: f,
|
|
19
|
-
loading:
|
|
20
|
-
disabled:
|
|
19
|
+
loading: m,
|
|
20
|
+
disabled: I,
|
|
21
21
|
select: c,
|
|
22
|
-
href:
|
|
23
|
-
onClick:
|
|
24
|
-
onKeyPress:
|
|
25
|
-
tabIndex:
|
|
22
|
+
href: h,
|
|
23
|
+
onClick: L,
|
|
24
|
+
onKeyPress: x,
|
|
25
|
+
tabIndex: z,
|
|
26
26
|
size: s = "sm",
|
|
27
|
-
title:
|
|
28
|
-
description:
|
|
29
|
-
icon:
|
|
30
|
-
avatar:
|
|
27
|
+
title: k,
|
|
28
|
+
description: _,
|
|
29
|
+
icon: u,
|
|
30
|
+
avatar: N,
|
|
31
31
|
avatarGroup: S,
|
|
32
|
-
|
|
33
|
-
badge:
|
|
34
|
-
controls:
|
|
32
|
+
chevron: l,
|
|
33
|
+
badge: t,
|
|
34
|
+
controls: o,
|
|
35
35
|
className: j,
|
|
36
|
-
children:
|
|
36
|
+
children: E
|
|
37
37
|
}) => {
|
|
38
38
|
const n = {
|
|
39
39
|
xs: "sm",
|
|
@@ -41,46 +41,46 @@ import '../../assets/ListItemHeader.css';const V = "_header_13dzg_1", b = "_link
|
|
|
41
41
|
md: "lg",
|
|
42
42
|
lg: "lg",
|
|
43
43
|
xl: "xl"
|
|
44
|
-
}[s], a = () =>
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
c && /* @__PURE__ */ e(H, { ...c, className:
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
44
|
+
}[s], a = () => t && typeof t == "object" && "label" in t ? /* @__PURE__ */ e(B, { ...t }) : y(t) ? t : null;
|
|
45
|
+
return /* @__PURE__ */ i("header", { className: r.header, "data-size": s, children: [
|
|
46
|
+
/* @__PURE__ */ i("div", { className: r.link, children: [
|
|
47
|
+
c && /* @__PURE__ */ e(H, { ...c, className: r.select, size: n }),
|
|
48
|
+
/* @__PURE__ */ i(
|
|
49
|
+
M,
|
|
50
50
|
{
|
|
51
|
-
interactive: !!
|
|
52
|
-
className:
|
|
51
|
+
interactive: !!o,
|
|
52
|
+
className: g(r.link, j),
|
|
53
53
|
as: f,
|
|
54
|
-
href:
|
|
55
|
-
onClick:
|
|
56
|
-
onKeyPress:
|
|
57
|
-
tabIndex:
|
|
58
|
-
loading:
|
|
59
|
-
disabled:
|
|
54
|
+
href: h,
|
|
55
|
+
onClick: L,
|
|
56
|
+
onKeyPress: x,
|
|
57
|
+
tabIndex: z,
|
|
58
|
+
loading: m,
|
|
59
|
+
disabled: I || m,
|
|
60
60
|
size: s,
|
|
61
61
|
children: [
|
|
62
62
|
/* @__PURE__ */ e(
|
|
63
63
|
C,
|
|
64
64
|
{
|
|
65
|
-
loading:
|
|
65
|
+
loading: m,
|
|
66
66
|
size: n,
|
|
67
|
-
icon:
|
|
68
|
-
avatar:
|
|
67
|
+
icon: u,
|
|
68
|
+
avatar: N,
|
|
69
69
|
avatarGroup: S
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
|
-
/* @__PURE__ */ e(
|
|
73
|
-
|
|
72
|
+
/* @__PURE__ */ e(v, { size: s, loading: m, title: k, description: _, children: E }),
|
|
73
|
+
o && /* @__PURE__ */ i(p, { children: [
|
|
74
74
|
a(),
|
|
75
|
-
|
|
75
|
+
l && /* @__PURE__ */ e(d, { svgElement: l, size: n })
|
|
76
76
|
] })
|
|
77
77
|
]
|
|
78
78
|
}
|
|
79
79
|
)
|
|
80
80
|
] }),
|
|
81
|
-
/* @__PURE__ */ e(F, { className:
|
|
81
|
+
/* @__PURE__ */ e(F, { className: r.controls, children: o || /* @__PURE__ */ i(p, { children: [
|
|
82
82
|
a(),
|
|
83
|
-
|
|
83
|
+
l && /* @__PURE__ */ e(d, { svgElement: l, size: n })
|
|
84
84
|
] }) })
|
|
85
85
|
] });
|
|
86
86
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Icon as c } from "../Icon/Icon.js";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import { IconOrAvatar as
|
|
4
|
+
import { IconOrAvatar as l } from "../Icon/IconOrAvatar.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Search/AutocompleteBase.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import { S as
|
|
10
|
-
import '../../assets/ListItemIcon.css';const
|
|
11
|
-
|
|
12
|
-
},
|
|
9
|
+
import { S as p } from "../../XMark-Bv1I87Ev.js";
|
|
10
|
+
import '../../assets/ListItemIcon.css';const e = "_listIcon_ghios_1", I = {
|
|
11
|
+
listIcon: e
|
|
12
|
+
}, j = ({ loading: n, size: t = "sm", icon: r, avatar: m, avatarGroup: s, children: i }) => !r && !m && !s && !i ? null : n ? /* @__PURE__ */ o(c, { svgElement: p, size: t, loading: !0 }) : /* @__PURE__ */ o("span", { className: I.listIcon, children: i || /* @__PURE__ */ o(l, { size: t, icon: r, avatar: m, avatarGroup: s }) });
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
j as ListItemIcon
|
|
15
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as o } from "../../ListItemBase-BVx5MDhO.js";
|
|
2
2
|
import { ListItemLink as m } from "./ListItemLink.js";
|
|
3
3
|
import { ListItemHeader as L } from "./ListItemHeader.js";
|
|
4
4
|
import { ListItemLabel as f } from "./ListItemLabel.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
2
|
import { c as _ } from "../../index-L8X2o7IH.js";
|
|
3
|
-
import '../../assets/Flex.css';const h = "
|
|
3
|
+
import '../../assets/Flex.css';const h = "_flex_vvg9d_1", j = {
|
|
4
4
|
flex: h
|
|
5
5
|
}, C = ({
|
|
6
6
|
as: a = "div",
|
|
@@ -16,14 +16,14 @@ import '../../assets/Flex.css';const h = "_flex_8w6x1_1", j = {
|
|
|
16
16
|
margin: c,
|
|
17
17
|
bleed: f = !1,
|
|
18
18
|
className: m,
|
|
19
|
-
style:
|
|
20
|
-
children:
|
|
19
|
+
style: p,
|
|
20
|
+
children: x,
|
|
21
21
|
...g
|
|
22
|
-
}) => /* @__PURE__ */
|
|
22
|
+
}) => /* @__PURE__ */ v(
|
|
23
23
|
a,
|
|
24
24
|
{
|
|
25
25
|
className: _(j.flex, m),
|
|
26
|
-
style:
|
|
26
|
+
style: p,
|
|
27
27
|
"data-color": t,
|
|
28
28
|
"data-theme": e,
|
|
29
29
|
"data-shadow": n,
|
|
@@ -36,7 +36,7 @@ import '../../assets/Flex.css';const h = "_flex_8w6x1_1", j = {
|
|
|
36
36
|
"data-margin": c,
|
|
37
37
|
"data-bleed": f,
|
|
38
38
|
...g,
|
|
39
|
-
children:
|
|
39
|
+
children: x
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
42
|
export {
|
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as v, createElement as x } from "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import { useMenu as
|
|
4
|
+
import { useMenu as A } from "../../hooks/useMenu.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { AutocompleteBase as
|
|
7
|
-
import { AutocompleteGroup as
|
|
6
|
+
import { AutocompleteBase as I } from "./AutocompleteBase.js";
|
|
7
|
+
import { AutocompleteGroup as l } from "./AutocompleteGroup.js";
|
|
8
8
|
import { AutocompleteItem as h } from "./AutocompleteItem.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
10
|
import { useEnterKey as k } from "../../hooks/useEnterKey.js";
|
|
11
|
-
const C = ({ className: u, items:
|
|
12
|
-
const p =
|
|
11
|
+
const C = ({ className: u, items: s, groups: i = {}, expanded: n, onSelect: r }) => {
|
|
12
|
+
const p = v(null);
|
|
13
13
|
k(() => {
|
|
14
|
-
var
|
|
15
|
-
const
|
|
16
|
-
|
|
14
|
+
var e;
|
|
15
|
+
const t = (e = p.current) == null ? void 0 : e.querySelector('[data-active="true"]');
|
|
16
|
+
t == null || t.dispatchEvent(new MouseEvent("click", { bubbles: !0 })), r == null || r();
|
|
17
17
|
});
|
|
18
|
-
const { menu:
|
|
19
|
-
items:
|
|
20
|
-
groups:
|
|
18
|
+
const { menu: a, setActiveIndex: c } = A({
|
|
19
|
+
items: s,
|
|
20
|
+
groups: i,
|
|
21
21
|
groupByKey: "groupId",
|
|
22
22
|
keyboardEvents: !0
|
|
23
23
|
});
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ m(I, { className: u, expanded: n, ref: p, children: a.map((t, e) => /* @__PURE__ */ x(l, { ...t.props, key: e }, /* @__PURE__ */ m("ul", { children: t.items.map((d, f) => {
|
|
25
25
|
const {
|
|
26
|
-
active:
|
|
27
|
-
menuIndex:
|
|
28
|
-
props: { groupId: M, onClick:
|
|
29
|
-
} =
|
|
30
|
-
return /* @__PURE__ */
|
|
26
|
+
active: y,
|
|
27
|
+
menuIndex: E,
|
|
28
|
+
props: { groupId: M, onClick: o, ...b }
|
|
29
|
+
} = d;
|
|
30
|
+
return /* @__PURE__ */ m(
|
|
31
31
|
h,
|
|
32
32
|
{
|
|
33
|
-
|
|
33
|
+
tabIndex: -1,
|
|
34
|
+
onMouseEnter: () => c(E),
|
|
35
|
+
...b,
|
|
34
36
|
onClick: () => {
|
|
35
|
-
|
|
37
|
+
o == null || o(), r == null || r();
|
|
36
38
|
},
|
|
37
|
-
active:
|
|
38
|
-
}
|
|
39
|
-
|
|
39
|
+
active: y
|
|
40
|
+
},
|
|
41
|
+
f
|
|
42
|
+
);
|
|
40
43
|
}) }))) });
|
|
41
44
|
};
|
|
42
45
|
export {
|
|
@@ -1,96 +1,93 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import * as c from "react";
|
|
4
4
|
import { forwardRef as h, useState as w } from "react";
|
|
5
5
|
import "../../index-L8X2o7IH.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Search/AutocompleteBase.js";
|
|
8
|
-
import { ListItem as
|
|
8
|
+
import { ListItem as s } from "../List/ListItem.js";
|
|
9
9
|
import { MetaTimestamp as x } from "../Meta/MetaTimestamp.js";
|
|
10
10
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import { Typography as
|
|
12
|
-
import { DialogAttachments as
|
|
13
|
-
import { u as
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
for (var i = 0, t = Object.getOwnPropertySymbols(l); i < t.length; i++)
|
|
22
|
-
o.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(l, t[i]) && (r[t[i]] = l[t[i]]);
|
|
23
|
-
return r;
|
|
11
|
+
import { Typography as O } from "../Typography/Typography.js";
|
|
12
|
+
import { DialogAttachments as I } from "../Dialog/DialogAttachments.js";
|
|
13
|
+
import { u as j } from "../../useId-CsCRkvK3.js";
|
|
14
|
+
import '../../assets/TransmissionItem.css';var _ = function(o, l) {
|
|
15
|
+
var e = {};
|
|
16
|
+
for (var t in o) Object.prototype.hasOwnProperty.call(o, t) && l.indexOf(t) < 0 && (e[t] = o[t]);
|
|
17
|
+
if (o != null && typeof Object.getOwnPropertySymbols == "function")
|
|
18
|
+
for (var i = 0, t = Object.getOwnPropertySymbols(o); i < t.length; i++)
|
|
19
|
+
l.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(o, t[i]) && (e[t[i]] = o[t[i]]);
|
|
20
|
+
return e;
|
|
24
21
|
};
|
|
25
|
-
const
|
|
26
|
-
var { title:
|
|
27
|
-
let a =
|
|
28
|
-
return a =
|
|
22
|
+
const z = h((o, l) => {
|
|
23
|
+
var { title: e, titleId: t } = o, i = _(o, ["title", "titleId"]);
|
|
24
|
+
let a = j();
|
|
25
|
+
return a = e ? t || "title-" + a : void 0, c.createElement(
|
|
29
26
|
"svg",
|
|
30
|
-
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:
|
|
31
|
-
|
|
32
|
-
|
|
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 }, i),
|
|
28
|
+
e ? c.createElement("title", { id: a }, e) : null,
|
|
29
|
+
c.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M19.638 4.417a3.25 3.25 0 0 0-4.608-.008l-9.378 9.379a.75.75 0 0 0-.191.324l-1.414 4.95a.75.75 0 0 0 .925.927l4.94-1.398a.75.75 0 0 0 .327-.191l9.39-9.391a3.25 3.25 0 0 0 .01-4.592M16.091 5.47a1.752 1.752 0 1 1 2.478 2.478l-.23.23-2.477-2.479zM14.8 6.76 6.85 14.71l-.991 3.47 3.457-.979 7.963-7.963z", clipRule: "evenodd" })
|
|
33
30
|
);
|
|
34
|
-
}),
|
|
35
|
-
body:
|
|
36
|
-
},
|
|
37
|
-
theme:
|
|
38
|
-
type:
|
|
39
|
-
loading:
|
|
31
|
+
}), y = "_body_1m345_1", E = {
|
|
32
|
+
body: y
|
|
33
|
+
}, N = ({
|
|
34
|
+
theme: o,
|
|
35
|
+
type: l,
|
|
36
|
+
loading: e,
|
|
40
37
|
sender: t,
|
|
41
38
|
createdAt: i,
|
|
42
39
|
createdAtLabel: a,
|
|
43
|
-
title:
|
|
44
|
-
description:
|
|
45
|
-
summary:
|
|
46
|
-
attachments:
|
|
40
|
+
title: f,
|
|
41
|
+
description: u,
|
|
42
|
+
summary: d,
|
|
43
|
+
attachments: b
|
|
47
44
|
}) => {
|
|
48
|
-
const [m,
|
|
49
|
-
|
|
45
|
+
const [m, p] = w(!1), g = () => {
|
|
46
|
+
p((v) => !v);
|
|
50
47
|
};
|
|
51
|
-
return (
|
|
52
|
-
|
|
48
|
+
return (l == null ? void 0 : l.value) === "draft" ? /* @__PURE__ */ r(
|
|
49
|
+
s,
|
|
53
50
|
{
|
|
54
51
|
as: "button",
|
|
55
|
-
theme:
|
|
52
|
+
theme: o,
|
|
56
53
|
variant: "dotted",
|
|
57
54
|
size: "sm",
|
|
58
|
-
icon:
|
|
59
|
-
title:
|
|
60
|
-
description:
|
|
61
|
-
badge: { label:
|
|
62
|
-
linkIcon:
|
|
55
|
+
icon: z,
|
|
56
|
+
title: f,
|
|
57
|
+
description: u,
|
|
58
|
+
badge: { label: l == null ? void 0 : l.label },
|
|
59
|
+
linkIcon: !0
|
|
63
60
|
}
|
|
64
|
-
) : /* @__PURE__ */
|
|
65
|
-
|
|
61
|
+
) : /* @__PURE__ */ r(
|
|
62
|
+
s,
|
|
66
63
|
{
|
|
67
64
|
as: "button",
|
|
68
|
-
theme:
|
|
65
|
+
theme: o,
|
|
69
66
|
expanded: m,
|
|
70
|
-
|
|
67
|
+
collapsible: !0,
|
|
68
|
+
onClick: g,
|
|
71
69
|
size: "sm",
|
|
72
70
|
avatar: {
|
|
73
71
|
type: t == null ? void 0 : t.type,
|
|
74
72
|
imageUrl: t == null ? void 0 : t.imageUrl,
|
|
75
73
|
name: t == null ? void 0 : t.name
|
|
76
74
|
},
|
|
77
|
-
title:
|
|
78
|
-
description: m ? "" :
|
|
79
|
-
badge: { label:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
t && /* @__PURE__ */ e("strong", { children: (t == null ? void 0 : t.name) + ", " }),
|
|
75
|
+
title: f,
|
|
76
|
+
description: m ? "" : u,
|
|
77
|
+
badge: { label: l == null ? void 0 : l.label },
|
|
78
|
+
children: m && /* @__PURE__ */ n("div", { className: E.body, children: [
|
|
79
|
+
i && /* @__PURE__ */ n(x, { loading: e, datetime: i, size: "xs", children: [
|
|
80
|
+
t && /* @__PURE__ */ r("strong", { children: (t == null ? void 0 : t.name) + ", " }),
|
|
84
81
|
a
|
|
85
82
|
] }),
|
|
86
|
-
/* @__PURE__ */ n(
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
83
|
+
/* @__PURE__ */ n(O, { size: "lg", children: [
|
|
84
|
+
/* @__PURE__ */ r("p", { children: d }),
|
|
85
|
+
b && /* @__PURE__ */ r(I, { ...b })
|
|
89
86
|
] })
|
|
90
87
|
] })
|
|
91
88
|
}
|
|
92
89
|
);
|
|
93
90
|
};
|
|
94
91
|
export {
|
|
95
|
-
|
|
92
|
+
N as TransmissionItem
|
|
96
93
|
};
|
package/dist/components/index.js
CHANGED
|
@@ -72,7 +72,7 @@ import { Layout as Rr } from "./Layout/Layout.js";
|
|
|
72
72
|
import { ActionHeader as Or } from "./LayoutAction/ActionHeader.js";
|
|
73
73
|
import { ActionFooter as zr } from "./LayoutAction/ActionFooter.js";
|
|
74
74
|
import { LayoutAction as jr } from "./LayoutAction/LayoutAction.js";
|
|
75
|
-
import {
|
|
75
|
+
import { L as Jr } from "../ListItemBase-BVx5MDhO.js";
|
|
76
76
|
import { ListItemLink as Ur } from "./List/ListItemLink.js";
|
|
77
77
|
import { ListItemHeader as Wr } from "./List/ListItemHeader.js";
|
|
78
78
|
import { ListItemLabel as Yr } from "./List/ListItemLabel.js";
|
package/dist/index.js
CHANGED
|
@@ -72,7 +72,7 @@ import { Layout as Gr } from "./components/Layout/Layout.js";
|
|
|
72
72
|
import { ActionHeader as Or } from "./components/LayoutAction/ActionHeader.js";
|
|
73
73
|
import { ActionFooter as zr } from "./components/LayoutAction/ActionFooter.js";
|
|
74
74
|
import { LayoutAction as Nr } from "./components/LayoutAction/LayoutAction.js";
|
|
75
|
-
import {
|
|
75
|
+
import { L as qr } from "./ListItemBase-BVx5MDhO.js";
|
|
76
76
|
import { ListItemLink as Ur } from "./components/List/ListItemLink.js";
|
|
77
77
|
import { ListItemHeader as Wr } from "./components/List/ListItemHeader.js";
|
|
78
78
|
import { ListItemLabel as Yr } from "./components/List/ListItemLabel.js";
|
|
@@ -3,6 +3,7 @@ import { DialogListItem, DialogListItemProps } from './DialogListItem';
|
|
|
3
3
|
declare const meta: Meta<typeof DialogListItem>;
|
|
4
4
|
export default meta;
|
|
5
5
|
export declare const Default: {
|
|
6
|
+
render: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
args: {};
|
|
7
8
|
};
|
|
8
9
|
export declare const GroupedAvatars: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,7 +12,7 @@ export declare const SeenBy: (args: DialogListItemProps) => import("react/jsx-ru
|
|
|
11
12
|
export declare const InboxStatuses: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export declare const DraftAndSent: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export declare const ArchivedAndTrashed: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare const Statuses: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const Statuses: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element[];
|
|
15
16
|
declare const Loading: {
|
|
16
17
|
(args: DialogListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
parameters: {
|
|
@@ -24,5 +25,5 @@ export declare const DueAt: (args: DialogListItemProps) => import("react/jsx-run
|
|
|
24
25
|
export declare const Attachments: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
26
|
export declare const TouchedBy: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
27
|
export declare const TextLength: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export declare const Selectable: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export declare const Sizes: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const Selectable: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element[];
|
|
29
|
+
export declare const Sizes: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element[];
|
|
@@ -4,10 +4,9 @@ declare const meta: {
|
|
|
4
4
|
component: ({ spacing, children, ...rest }: import('./ListBase').ListBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {};
|
|
7
|
-
args: {
|
|
8
|
-
children: import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
};
|
|
7
|
+
args: {};
|
|
10
8
|
};
|
|
11
9
|
export default meta;
|
|
12
10
|
type Story = StoryObj<typeof meta>;
|
|
13
|
-
export declare const
|
|
11
|
+
export declare const Interactive: Story;
|
|
12
|
+
export declare const NonIteractive: Story;
|
|
@@ -25,6 +25,8 @@ export interface ListItemProps extends ListItemBaseProps, ListItemHeaderProps {
|
|
|
25
25
|
label?: ReactNode | (() => ReactElement);
|
|
26
26
|
/** Optional badge */
|
|
27
27
|
badge?: BadgeProps | ReactNode | undefined;
|
|
28
|
+
/** Whether to display the item with a link icon */
|
|
29
|
+
linkIcon?: boolean;
|
|
28
30
|
}
|
|
29
31
|
export interface ListItemInputProps extends ListItemProps {
|
|
30
32
|
id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementType, KeyboardEventHandler, ReactNode } from 'react';
|
|
1
|
+
import { ElementType, HTMLProps, KeyboardEventHandler, ReactNode } from 'react';
|
|
2
2
|
import { Color } from '..';
|
|
3
3
|
export type ListItemSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
4
|
export type ListItemVariant = 'solid' | 'dotted';
|
|
@@ -6,25 +6,47 @@ export type ListItemShadow = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
|
6
6
|
export type ListItemColor = Color;
|
|
7
7
|
export type ListItemTheme = 'transparent' | 'default' | 'subtle' | 'surface' | 'base';
|
|
8
8
|
export interface ListItemBaseProps {
|
|
9
|
+
/** The title of the list item. */
|
|
9
10
|
title?: string;
|
|
11
|
+
/** If true, the list item is interactive and has a hover state. */
|
|
10
12
|
interactive?: boolean;
|
|
13
|
+
/** The element type to render as. */
|
|
11
14
|
as?: ElementType;
|
|
15
|
+
/** The URL to link to if the list item is a link. */
|
|
12
16
|
href?: string;
|
|
17
|
+
/** Click event handler. */
|
|
13
18
|
onClick?: () => void;
|
|
19
|
+
/** Key press event handler. */
|
|
14
20
|
onKeyPress?: KeyboardEventHandler;
|
|
21
|
+
/** The tab index of the list item. */
|
|
15
22
|
tabIndex?: number;
|
|
23
|
+
/** The color of the list item. */
|
|
16
24
|
color?: ListItemColor;
|
|
25
|
+
/** The theme of the list item. */
|
|
17
26
|
theme?: ListItemTheme;
|
|
27
|
+
/** The variant of the list item. */
|
|
18
28
|
variant?: ListItemVariant;
|
|
29
|
+
/** The size of the list item. */
|
|
19
30
|
size?: ListItemSize;
|
|
31
|
+
/** The shadow style of the list item. */
|
|
20
32
|
shadow?: ListItemShadow;
|
|
33
|
+
/** Additional class names for the list item. */
|
|
21
34
|
className?: string;
|
|
35
|
+
/** If true, the list item shows a loading state. */
|
|
22
36
|
loading?: boolean;
|
|
37
|
+
/** If true, the list item is disabled. */
|
|
23
38
|
disabled?: boolean;
|
|
39
|
+
/** If true, the list item is hidden. */
|
|
24
40
|
hidden?: boolean;
|
|
41
|
+
/** If true, the list item is active. */
|
|
25
42
|
active?: boolean;
|
|
43
|
+
/** If true, the list item is selected. */
|
|
26
44
|
selected?: boolean;
|
|
45
|
+
/** If true, the list item is expanded. */
|
|
27
46
|
expanded?: boolean;
|
|
47
|
+
/** Mouse enter event handler. */
|
|
48
|
+
onMouseEnter?: HTMLProps<HTMLDivElement>['onMouseEnter'];
|
|
49
|
+
/** The children elements of the list item. */
|
|
28
50
|
children?: ReactNode;
|
|
29
51
|
}
|
|
30
|
-
export declare const ListItemBase: ({ title, interactive, as, href, onClick, onKeyPress, tabIndex, size, variant, color, theme, shadow, loading, disabled, hidden, active, selected, className, children, }: ListItemBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare const ListItemBase: ({ title, interactive, as, href, onClick, onKeyPress, tabIndex, size, variant, color, theme, shadow, loading, disabled, hidden, active, selected, className, onMouseEnter, children, }: ListItemBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChevronDownIcon } from '@navikt/aksel-icons';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
import { AvatarGroupProps, AvatarProps, BadgeProps, IconProps, ListItemLinkProps, ListItemSelectProps, ListItemSize, SvgElement } from '..';
|
|
3
4
|
export interface ListItemHeaderProps extends ListItemLinkProps {
|
|
@@ -9,9 +10,9 @@ export interface ListItemHeaderProps extends ListItemLinkProps {
|
|
|
9
10
|
className?: string;
|
|
10
11
|
/** Select controls */
|
|
11
12
|
select?: ListItemSelectProps;
|
|
12
|
-
/** Collapsible item
|
|
13
|
+
/** Collapsible item */
|
|
13
14
|
collapsible?: boolean;
|
|
14
|
-
/** Item is expanded
|
|
15
|
+
/** Item is expanded */
|
|
15
16
|
expanded?: boolean;
|
|
16
17
|
/** Title */
|
|
17
18
|
title?: string;
|
|
@@ -23,8 +24,8 @@ export interface ListItemHeaderProps extends ListItemLinkProps {
|
|
|
23
24
|
avatar?: AvatarProps;
|
|
24
25
|
/** List item avatarGroup */
|
|
25
26
|
avatarGroup?: AvatarGroupProps;
|
|
26
|
-
/** Optional icon indicating behaviour */
|
|
27
|
-
|
|
27
|
+
/** Optional chevron icon indicating behaviour */
|
|
28
|
+
chevron?: typeof ChevronDownIcon;
|
|
28
29
|
/** Optional badge */
|
|
29
30
|
badge?: BadgeProps | ReactNode | undefined;
|
|
30
31
|
/** Custom controls */
|
|
@@ -32,4 +33,4 @@ export interface ListItemHeaderProps extends ListItemLinkProps {
|
|
|
32
33
|
/** Custom label */
|
|
33
34
|
children?: ReactNode;
|
|
34
35
|
}
|
|
35
|
-
export declare const ListItemHeader: ({ as, loading, disabled, select, href, onClick, onKeyPress, tabIndex, size, title, description, icon, avatar, avatarGroup,
|
|
36
|
+
export declare const ListItemHeader: ({ as, loading, disabled, select, href, onClick, onKeyPress, tabIndex, size, title, description, icon, avatar, avatarGroup, chevron, badge, controls, className, children, }: ListItemHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,5 +5,4 @@ export default meta;
|
|
|
5
5
|
export declare const ListOfPeople: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const ListOfServices: () => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare const ListOfCategories: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare const CategoryGrid: () => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export declare const MultilevelList: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,5 +9,5 @@ declare const meta: {
|
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
export default meta;
|
|
12
|
-
export declare const Theme: (args: ListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare const Size: (args: ListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const Theme: (args: ListItemProps) => import("react/jsx-runtime").JSX.Element[];
|
|
13
|
+
export declare const Size: (args: ListItemProps) => import("react/jsx-runtime").JSX.Element[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { Color, Range, Shadow, Theme } from '..';
|
|
3
|
-
export type FlexElement = 'div' | 'section' | 'article' | 'header' | 'footer' | 'nav';
|
|
3
|
+
export type FlexElement = 'div' | 'section' | 'article' | 'header' | 'footer' | 'nav' | 'ul';
|
|
4
4
|
export type FlexDirection = 'col' | 'row';
|
|
5
5
|
export type FlexAlign = 'initial' | 'start' | 'end' | 'center' | 'stretch';
|
|
6
6
|
export type FlexJustify = 'initial' | 'start' | 'end' | 'center' | 'between';
|