@altinn/altinn-components 0.51.4 → 0.52.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/assets/Avatar.css +1 -1
- package/dist/components/Avatar/Avatar.js +79 -55
- package/dist/components/Dialog/DialogLayout.js +9 -9
- package/dist/components/Dialog/DialogListItem.js +40 -38
- package/dist/components/Modal/ModalHeader.js +33 -24
- package/dist/components/Page/Breadcrumbs.js +1 -1
- package/dist/types/lib/components/Avatar/Avatar.d.ts +1 -1
- package/dist/types/lib/components/Avatar/Avatar.stories.d.ts +1 -0
- package/dist/types/lib/components/Button/IconButton.d.ts +1 -0
- package/dist/types/lib/components/Dialog/DialogLayout.d.ts +4 -2
- package/dist/types/lib/components/Dialog/DialogLayout.stories.d.ts +1 -1
- package/dist/types/lib/components/Dialog/DialogList.stories.d.ts +1 -0
- package/dist/types/lib/components/Modal/ModalHeader.d.ts +1 -0
- package/dist/types/lib/stories/Dialog/Dialog.stories.d.ts +2 -1
- package/package.json +2 -2
package/dist/assets/Avatar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._avatar_bmli3_1{position:relative;overflow:hidden;box-sizing:border-box}._avatar_bmli3_1[data-shape=circle]{border-radius:50%}._avatar_bmli3_1[data-shape=square]{border-radius:5%}._avatar_bmli3_1{outline:1px solid #ffffff;box-sizing:border-box}._shape_bmli3_20{display:block;font-size:1em;width:1em;height:1em}._shape_bmli3_20[data-variant=outline]{border:1px solid}._label_bmli3_31{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;overflow:hidden;font-size:.575em}._icon_bmli3_41{width:100%;height:100%;display:flex;justify-content:center;align-items:center}._svg_bmli3_49{width:75%;height:75%}._image_bmli3_54{display:block;width:100%;height:100%}._deletedIcon_bmli3_60{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}@supports (-webkit-hyphens: none){._avatar_bmli3_1[data-size=lg] ._label_bmli3_31{font-size:1.58rem}._avatar_bmli3_1[data-size=md] ._label_bmli3_31{font-size:1.15rem}._avatar_bmli3_1[data-size=sm] ._label_bmli3_31{font-size:.85rem}}
|
|
@@ -1,62 +1,86 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useState as A } from "react";
|
|
5
|
-
import { Skeleton as
|
|
6
|
-
import { fromStringToColor as
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import { jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
3
|
+
import { c as H } from "../../index-L8X2o7IH.js";
|
|
4
|
+
import m, { forwardRef as N, useState as A } from "react";
|
|
5
|
+
import { Skeleton as k } from "../Skeleton/Skeleton.js";
|
|
6
|
+
import { fromStringToColor as M } from "./color.js";
|
|
7
|
+
import { u as R } from "../../useId-BVFxCjkq.js";
|
|
8
|
+
import '../../assets/Avatar.css';var z = function(e, o) {
|
|
9
|
+
var l = {};
|
|
10
|
+
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (l[t] = e[t]);
|
|
11
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
12
|
+
for (var a = 0, t = Object.getOwnPropertySymbols(e); a < t.length; a++)
|
|
13
|
+
o.indexOf(t[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[a]) && (l[t[a]] = e[t[a]]);
|
|
14
|
+
return l;
|
|
15
|
+
};
|
|
16
|
+
const q = N((e, o) => {
|
|
17
|
+
var { title: l, titleId: t } = e, a = z(e, ["title", "titleId"]);
|
|
18
|
+
let s = R();
|
|
19
|
+
return s = l ? t || "title-" + s : void 0, m.createElement(
|
|
20
|
+
"svg",
|
|
21
|
+
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": s }, a),
|
|
22
|
+
l ? m.createElement("title", { id: s }, l) : null,
|
|
23
|
+
m.createElement("path", { fill: "currentColor", d: "M8.22 13.72a.75.75 0 0 1 1.06 0l.029.025q.041.039.132.111c.122.097.308.23.548.364a4.14 4.14 0 0 0 2.011.53 4.14 4.14 0 0 0 2.01-.53 4 4 0 0 0 .681-.475l.028-.025.057-.052a.751.751 0 0 1 1.056 1.056l-.052.056-.01.011-.018.017-.059.054a5.647 5.647 0 0 1-.954.668c-.642.357-1.58.72-2.739.72a5.64 5.64 0 0 1-2.74-.72 5.7 5.7 0 0 1-.748-.496 4 4 0 0 1-.205-.172q-.037-.032-.059-.054l-.018-.017-.01-.01a.75.75 0 0 1 0-1.061M9.5 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M14.5 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3" }),
|
|
24
|
+
m.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M12 .5a1.5 1.5 0 0 1 .75 2.798V5h5.5a.75.75 0 0 1 .75.75v3.5h2.24a.75.75 0 0 1 .75.75v4a.75.75 0 0 1-.75.75H19v3.5a.75.75 0 0 1-.75.75H5.75a.75.75 0 0 1-.75-.75v-3.5H2.75A.75.75 0 0 1 2 14v-4a.75.75 0 0 1 .75-.75H5v-3.5A.75.75 0 0 1 5.75 5h5.5V3.298A1.498 1.498 0 0 1 12 .5m-5.5 17h11v-11h-11zm-3-4.25H5v-2.5H3.5zm15.5 0h1.49v-2.5H19z", clipRule: "evenodd" })
|
|
25
|
+
);
|
|
26
|
+
}), P = "_avatar_bmli3_1", V = "_shape_bmli3_20", B = "_label_bmli3_31", L = "_icon_bmli3_41", T = "_svg_bmli3_49", D = "_image_bmli3_54", F = "_deletedIcon_bmli3_60", r = {
|
|
27
|
+
avatar: P,
|
|
28
|
+
shape: V,
|
|
29
|
+
label: B,
|
|
30
|
+
icon: L,
|
|
31
|
+
svg: T,
|
|
32
|
+
image: D,
|
|
33
|
+
deletedIcon: F
|
|
34
|
+
}, X = (e) => typeof e == "object" && e !== null && "name" in e, Y = ({
|
|
14
35
|
type: e = "person",
|
|
15
|
-
isParent:
|
|
16
|
-
isDeleted:
|
|
17
|
-
size:
|
|
18
|
-
name:
|
|
19
|
-
shape:
|
|
20
|
-
color:
|
|
21
|
-
variant:
|
|
22
|
-
imageUrl:
|
|
23
|
-
imageUrlAlt:
|
|
24
|
-
customLabel:
|
|
25
|
-
loading:
|
|
26
|
-
className:
|
|
27
|
-
colorKey:
|
|
28
|
-
style:
|
|
36
|
+
isParent: o,
|
|
37
|
+
isDeleted: l = !1,
|
|
38
|
+
size: t,
|
|
39
|
+
name: a = "Avatar",
|
|
40
|
+
shape: s,
|
|
41
|
+
color: b,
|
|
42
|
+
variant: g,
|
|
43
|
+
imageUrl: d,
|
|
44
|
+
imageUrlAlt: _,
|
|
45
|
+
customLabel: w,
|
|
46
|
+
loading: p,
|
|
47
|
+
className: y,
|
|
48
|
+
colorKey: I,
|
|
49
|
+
style: f = {}
|
|
29
50
|
}) => {
|
|
30
|
-
const [
|
|
31
|
-
let
|
|
32
|
-
e === "company" && typeof
|
|
33
|
-
const { backgroundColor:
|
|
34
|
-
...
|
|
35
|
-
backgroundColor:
|
|
36
|
-
color:
|
|
37
|
-
} :
|
|
38
|
-
return /* @__PURE__ */
|
|
51
|
+
const [x, O] = A(!1), C = s || e === "person" ? "circle" : "square", S = b || e === "person" ? "light" : "dark";
|
|
52
|
+
let i = g;
|
|
53
|
+
e === "company" && typeof o == "boolean" && (i = o ? "solid" : "outline");
|
|
54
|
+
const { backgroundColor: v, foregroundColor: h } = M(I ?? a, S), j = (a[0] ?? "").toUpperCase(), c = d && !x, E = !p && !c ? {
|
|
55
|
+
...f,
|
|
56
|
+
backgroundColor: i === "outline" ? h : v,
|
|
57
|
+
color: i === "outline" ? v : h
|
|
58
|
+
} : f;
|
|
59
|
+
return /* @__PURE__ */ n(
|
|
39
60
|
"div",
|
|
40
61
|
{
|
|
41
|
-
className:
|
|
42
|
-
style:
|
|
43
|
-
"data-shape":
|
|
44
|
-
"data-size":
|
|
62
|
+
className: H(r.avatar, y),
|
|
63
|
+
style: E,
|
|
64
|
+
"data-shape": C,
|
|
65
|
+
"data-size": t,
|
|
45
66
|
"aria-hidden": !0,
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
67
|
+
children: /* @__PURE__ */ u(k, { loading: p, className: r.shape, variant: "circle", children: [
|
|
68
|
+
/* @__PURE__ */ u("div", { className: r.shape, "data-variant": i, children: [
|
|
69
|
+
e !== "system" && c && /* @__PURE__ */ n(
|
|
70
|
+
"img",
|
|
71
|
+
{
|
|
72
|
+
src: d,
|
|
73
|
+
className: r.image,
|
|
74
|
+
alt: _ || d,
|
|
75
|
+
onError: () => {
|
|
76
|
+
O(!0);
|
|
77
|
+
}
|
|
55
78
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
79
|
+
),
|
|
80
|
+
e === "system" && !c && /* @__PURE__ */ n("span", { className: r.icon, children: /* @__PURE__ */ n(q, { className: r.svg }) })
|
|
81
|
+
] }),
|
|
82
|
+
!c && e !== "system" && /* @__PURE__ */ n("span", { className: r.label, children: w || j }),
|
|
83
|
+
l && /* @__PURE__ */ n(
|
|
60
84
|
"svg",
|
|
61
85
|
{
|
|
62
86
|
"aria-hidden": "true",
|
|
@@ -66,7 +90,7 @@ import '../../assets/Avatar.css';const z = "_avatar_1en7r_1", B = "_shape_1en7r_
|
|
|
66
90
|
viewBox: "0 0 24 24",
|
|
67
91
|
fill: "none",
|
|
68
92
|
xmlns: "http://www.w3.org/2000/svg",
|
|
69
|
-
children: /* @__PURE__ */
|
|
93
|
+
children: /* @__PURE__ */ n("path", { d: "M0 24L24 -1.20156e-06", stroke: "currentColor" })
|
|
70
94
|
}
|
|
71
95
|
)
|
|
72
96
|
] })
|
|
@@ -74,6 +98,6 @@ import '../../assets/Avatar.css';const z = "_avatar_1en7r_1", B = "_shape_1en7r_
|
|
|
74
98
|
);
|
|
75
99
|
};
|
|
76
100
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
101
|
+
Y as Avatar,
|
|
102
|
+
X as isAvatarProps
|
|
79
103
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { ContextMenu as
|
|
4
|
+
import { ContextMenu as p } from "../ContextMenu/ContextMenu.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
6
|
import "../Snackbar/useSnackbar.js";
|
|
7
|
-
import { PageBase as
|
|
8
|
-
import { PageNav as
|
|
9
|
-
import { PageMenu as
|
|
7
|
+
import { PageBase as l } from "../Page/PageBase.js";
|
|
8
|
+
import { PageNav as d } from "../Page/PageNav.js";
|
|
9
|
+
import { PageMenu as c } from "../Page/PageMenu.js";
|
|
10
10
|
import { Section as m } from "../Page/Section.js";
|
|
11
|
-
const
|
|
11
|
+
const w = ({ backButton: e, contextMenu: t, pageMenu: r, children: s, color: a }) => /* @__PURE__ */ i(l, { theme: "subtle", spacing: 0, color: a, bleed: !0, children: [
|
|
12
12
|
/* @__PURE__ */ i(m, { theme: "default", shadow: "xs", children: [
|
|
13
13
|
/* @__PURE__ */ o(
|
|
14
|
-
|
|
14
|
+
d,
|
|
15
15
|
{
|
|
16
16
|
color: "neutral",
|
|
17
17
|
padding: 2,
|
|
18
18
|
backButton: e,
|
|
19
|
-
controls: t && /* @__PURE__ */ o(
|
|
19
|
+
controls: t && /* @__PURE__ */ o(p, { ...t })
|
|
20
20
|
}
|
|
21
21
|
),
|
|
22
22
|
/* @__PURE__ */ o(m, { as: "article", padding: "page", spacing: 6, children: s })
|
|
23
23
|
] }),
|
|
24
|
-
/* @__PURE__ */ o(
|
|
24
|
+
/* @__PURE__ */ o(c, { items: r == null ? void 0 : r.items })
|
|
25
25
|
] });
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
w as DialogLayout
|
|
28
28
|
};
|
|
@@ -2,12 +2,12 @@ import { jsx as a, jsxs as c } from "react/jsx-runtime";
|
|
|
2
2
|
import { Badge as K } from "../Badge/Badge.js";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { Heading as
|
|
5
|
+
import { Heading as u } from "../Typography/Heading.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import { DialogMetadata as O } from "./DialogMetadata.js";
|
|
8
8
|
import { DialogByline as P } from "./DialogByline.js";
|
|
9
9
|
import { MetaItem as Q } from "../Metadata/MetaItem.js";
|
|
10
|
-
import { ListItem as
|
|
10
|
+
import { ListItem as b } from "../List/ListItem.js";
|
|
11
11
|
import "../Snackbar/useSnackbar.js";
|
|
12
12
|
import '../../assets/DialogListItem.css';const S = "_border_jg0tu_1", T = "_title_jg0tu_27", U = "_controls_jg0tu_58", X = "_header_jg0tu_65", Y = "_summary_jg0tu_82", Z = "_footer_jg0tu_96", $ = "_seenBy_jg0tu_101", z = "_heading_jg0tu_108", t = {
|
|
13
13
|
border: S,
|
|
@@ -19,16 +19,16 @@ import '../../assets/DialogListItem.css';const S = "_border_jg0tu_1", T = "_titl
|
|
|
19
19
|
seenBy: $,
|
|
20
20
|
heading: z
|
|
21
21
|
}, _a = ({
|
|
22
|
-
size:
|
|
22
|
+
size: r = "xl",
|
|
23
23
|
state: W = "normal",
|
|
24
|
-
loading:
|
|
24
|
+
loading: e,
|
|
25
25
|
controls: x,
|
|
26
26
|
select: aa,
|
|
27
27
|
selected: o,
|
|
28
28
|
status: s,
|
|
29
|
-
extendedStatusLabel:
|
|
29
|
+
extendedStatusLabel: g,
|
|
30
30
|
sender: l,
|
|
31
|
-
recipient:
|
|
31
|
+
recipient: N,
|
|
32
32
|
recipientLabel: v = "to",
|
|
33
33
|
grouped: y = !1,
|
|
34
34
|
updatedAt: B,
|
|
@@ -49,63 +49,65 @@ import '../../assets/DialogListItem.css';const S = "_border_jg0tu_1", T = "_titl
|
|
|
49
49
|
receivedCount: C,
|
|
50
50
|
attachmentsCount: E,
|
|
51
51
|
attachmentsLabel: F,
|
|
52
|
-
title:
|
|
52
|
+
title: m,
|
|
53
53
|
description: G,
|
|
54
|
-
summary:
|
|
55
|
-
highlightWords:
|
|
54
|
+
summary: i,
|
|
55
|
+
highlightWords: n,
|
|
56
56
|
variant: J = "default",
|
|
57
57
|
id: h,
|
|
58
58
|
...f
|
|
59
59
|
}) => {
|
|
60
|
-
const
|
|
61
|
-
return
|
|
62
|
-
|
|
60
|
+
const j = o ? "tinted" : J;
|
|
61
|
+
return r === "xs" || r === "sm" ? /* @__PURE__ */ a(
|
|
62
|
+
b,
|
|
63
63
|
{
|
|
64
64
|
...f,
|
|
65
65
|
id: h,
|
|
66
|
-
size:
|
|
66
|
+
size: r,
|
|
67
67
|
selected: o,
|
|
68
|
-
variant:
|
|
69
|
-
ariaLabel:
|
|
68
|
+
variant: j,
|
|
69
|
+
ariaLabel: m,
|
|
70
|
+
disabled: e,
|
|
70
71
|
icon: l,
|
|
71
|
-
title:
|
|
72
|
-
description:
|
|
73
|
-
highlightWords:
|
|
72
|
+
title: m,
|
|
73
|
+
description: i || G,
|
|
74
|
+
highlightWords: n
|
|
74
75
|
}
|
|
75
76
|
) : /* @__PURE__ */ a(
|
|
76
|
-
|
|
77
|
+
b,
|
|
77
78
|
{
|
|
78
79
|
...f,
|
|
79
80
|
id: h,
|
|
80
|
-
size:
|
|
81
|
+
size: r,
|
|
81
82
|
selected: o,
|
|
82
|
-
variant:
|
|
83
|
+
variant: j,
|
|
83
84
|
controls: /* @__PURE__ */ a("div", { className: t.controls, children: x }),
|
|
84
|
-
title:
|
|
85
|
+
title: m,
|
|
86
|
+
disabled: e,
|
|
85
87
|
label: /* @__PURE__ */ c(
|
|
86
88
|
"div",
|
|
87
89
|
{
|
|
88
90
|
className: t.border,
|
|
89
91
|
"data-selected": o,
|
|
90
92
|
"data-status": s == null ? void 0 : s.value,
|
|
91
|
-
"data-size":
|
|
93
|
+
"data-size": r,
|
|
92
94
|
"data-unread": _,
|
|
93
95
|
"data-archived": D,
|
|
94
96
|
"data-trashed": M,
|
|
95
|
-
"data-loading":
|
|
97
|
+
"data-loading": e,
|
|
96
98
|
children: [
|
|
97
|
-
/* @__PURE__ */ c("header", { className: t.header, "data-size":
|
|
99
|
+
/* @__PURE__ */ c("header", { className: t.header, "data-size": r, children: [
|
|
98
100
|
/* @__PURE__ */ c("span", { className: t.heading, children: [
|
|
99
101
|
/* @__PURE__ */ a(
|
|
100
|
-
|
|
102
|
+
u,
|
|
101
103
|
{
|
|
102
104
|
as: "h2",
|
|
103
|
-
highlightWords:
|
|
105
|
+
highlightWords: n,
|
|
104
106
|
weight: _ ? "bold" : "normal",
|
|
105
|
-
loading:
|
|
107
|
+
loading: e,
|
|
106
108
|
maxRows: 2,
|
|
107
109
|
className: t.title,
|
|
108
|
-
children:
|
|
110
|
+
children: m
|
|
109
111
|
}
|
|
110
112
|
),
|
|
111
113
|
d && /* @__PURE__ */ a(K, { variant: "tinted", size: "xs", ...d })
|
|
@@ -114,23 +116,23 @@ import '../../assets/DialogListItem.css';const S = "_border_jg0tu_1", T = "_titl
|
|
|
114
116
|
P,
|
|
115
117
|
{
|
|
116
118
|
size: "xs",
|
|
117
|
-
loading:
|
|
119
|
+
loading: e,
|
|
118
120
|
sender: l,
|
|
119
|
-
recipient:
|
|
121
|
+
recipient: N,
|
|
120
122
|
recipientLabel: v,
|
|
121
123
|
grouped: y
|
|
122
124
|
}
|
|
123
125
|
),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
i && /* @__PURE__ */ a(
|
|
127
|
+
u,
|
|
126
128
|
{
|
|
127
129
|
as: "h3",
|
|
128
|
-
highlightWords:
|
|
130
|
+
highlightWords: n,
|
|
129
131
|
weight: "normal",
|
|
130
132
|
className: t.summary,
|
|
131
|
-
loading:
|
|
133
|
+
loading: e,
|
|
132
134
|
maxRows: 2,
|
|
133
|
-
children:
|
|
135
|
+
children: i
|
|
134
136
|
}
|
|
135
137
|
)
|
|
136
138
|
] }),
|
|
@@ -138,9 +140,9 @@ import '../../assets/DialogListItem.css';const S = "_border_jg0tu_1", T = "_titl
|
|
|
138
140
|
O,
|
|
139
141
|
{
|
|
140
142
|
className: t.footer,
|
|
141
|
-
loading:
|
|
143
|
+
loading: e,
|
|
142
144
|
status: s,
|
|
143
|
-
extendedStatusLabel:
|
|
145
|
+
extendedStatusLabel: g,
|
|
144
146
|
draftsLabel: q,
|
|
145
147
|
sentCount: A,
|
|
146
148
|
receivedCount: C,
|
|
@@ -1,41 +1,50 @@
|
|
|
1
1
|
import { jsx as r, jsxs as e } from "react/jsx-runtime";
|
|
2
2
|
import { c as p } from "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { Heading as
|
|
5
|
-
import { IconButton as
|
|
4
|
+
import { Heading as m } from "../Typography/Heading.js";
|
|
5
|
+
import { IconButton as l } from "../Button/IconButton.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
8
|
import { Flex as o } from "../Page/Flex.js";
|
|
9
|
-
import { Section as
|
|
10
|
-
import { ModalIcon as
|
|
9
|
+
import { Section as g } from "../Page/Section.js";
|
|
10
|
+
import { ModalIcon as f } from "./ModalIcon.js";
|
|
11
11
|
import { S as y } from "../../XMark-tKk6aExO.js";
|
|
12
|
-
import '../../assets/ModalHeader.css';const
|
|
13
|
-
header:
|
|
14
|
-
sticky:
|
|
12
|
+
import '../../assets/ModalHeader.css';const u = "_header_7ty99_1", x = "_sticky_7ty99_6", s = {
|
|
13
|
+
header: u,
|
|
14
|
+
sticky: x
|
|
15
15
|
}, A = ({
|
|
16
|
-
title:
|
|
17
|
-
description:
|
|
18
|
-
icon:
|
|
19
|
-
onClose:
|
|
20
|
-
closeTitle:
|
|
16
|
+
title: c,
|
|
17
|
+
description: t,
|
|
18
|
+
icon: a,
|
|
19
|
+
onClose: i,
|
|
20
|
+
closeTitle: n,
|
|
21
21
|
children: d,
|
|
22
|
-
sticky:
|
|
23
|
-
}) => /* @__PURE__ */ r(
|
|
22
|
+
sticky: h = !0
|
|
23
|
+
}) => /* @__PURE__ */ r(g, { as: "header", spacing: 2, padding: 4, className: p(s.header, h && s.sticky), children: /* @__PURE__ */ e(o, { direction: "row", justify: "between", align: "center", spacing: 8, children: [
|
|
24
24
|
d || /* @__PURE__ */ e(o, { direction: "row", align: "center", spacing: 3, children: [
|
|
25
|
-
|
|
25
|
+
a && /* @__PURE__ */ r(f, { icon: a }),
|
|
26
26
|
/* @__PURE__ */ e(o, { direction: "col", spacing: 0, children: [
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
c && /* @__PURE__ */ r(m, { as: "h2", size: t ? "md" : "lg", children: c }),
|
|
28
|
+
t && /* @__PURE__ */ r(m, { as: "h3", size: "xs", weight: "normal", children: t })
|
|
29
29
|
] })
|
|
30
30
|
] }),
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
(i || n) && /* @__PURE__ */ r(
|
|
32
|
+
"form",
|
|
33
33
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
method: "dialog",
|
|
35
|
+
onSubmit: () => {
|
|
36
|
+
i == null || i();
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ r(
|
|
39
|
+
l,
|
|
40
|
+
{
|
|
41
|
+
type: "submit",
|
|
42
|
+
icon: y,
|
|
43
|
+
variant: "outline",
|
|
44
|
+
iconAltText: n ?? "Close",
|
|
45
|
+
size: "sm"
|
|
46
|
+
}
|
|
47
|
+
)
|
|
39
48
|
}
|
|
40
49
|
)
|
|
41
50
|
] }) });
|
|
@@ -22,7 +22,7 @@ const h = d((e, n) => {
|
|
|
22
22
|
"svg",
|
|
23
23
|
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": i }, l),
|
|
24
24
|
r ? c.createElement("title", { id: i }, r) : null,
|
|
25
|
-
c.createElement("path", { fill: "currentColor", d: "M14.
|
|
25
|
+
c.createElement("path", { fill: "currentColor", d: "M14.088 6.873a.75.75 0 0 1 .942.097l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 0 1-1.06-1.06l3.22-3.22H5a.75.75 0 0 1-.75-.74V12a.75.75 0 0 1 .75-.75h12.19l-3.22-3.22a.75.75 0 0 1 .118-1.157" })
|
|
26
26
|
);
|
|
27
27
|
}), _ = "_list_tknjf_1", b = "_item_tknjf_12", g = "_icon_tknjf_18", a = {
|
|
28
28
|
list: _,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, ReactElement } from 'react';
|
|
2
|
-
export type AvatarType = 'company' | 'person' | 'custom';
|
|
2
|
+
export type AvatarType = 'company' | 'person' | 'system' | 'custom';
|
|
3
3
|
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
4
|
export type AvatarShape = 'square' | 'circle';
|
|
5
5
|
export type AvatarColor = 'dark' | 'light';
|
|
@@ -44,5 +44,6 @@ export declare const Logo: Story;
|
|
|
44
44
|
export declare const Loading: Story;
|
|
45
45
|
export declare const Sizes: ({ type, name, imageUrl }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
46
|
export declare const People: () => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare const SystemUsers: () => import("react/jsx-runtime").JSX.Element;
|
|
47
48
|
export declare const Companies: () => import("react/jsx-runtime").JSX.Element;
|
|
48
49
|
export declare const Logos: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,5 +13,6 @@ export interface IconButtonProps {
|
|
|
13
13
|
onClick?: MouseEventHandler;
|
|
14
14
|
dataTestId?: string;
|
|
15
15
|
onBlurCapture?: React.FocusEventHandler<HTMLButtonElement>;
|
|
16
|
+
type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
16
17
|
}
|
|
17
18
|
export declare const IconButton: ({ variant, rounded, size, icon, iconSize, iconAltText, color, className, selected, onClick, dataTestId, onBlurCapture, }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { BackButtonProps, ContextMenuProps, PageMenuProps } from '..';
|
|
2
|
+
import { BackButtonProps, Color, ContextMenuProps, PageMenuProps } from '..';
|
|
3
3
|
export interface DialogLayoutProps {
|
|
4
4
|
/** Back button */
|
|
5
5
|
backButton?: BackButtonProps;
|
|
@@ -9,8 +9,10 @@ export interface DialogLayoutProps {
|
|
|
9
9
|
pageMenu?: PageMenuProps;
|
|
10
10
|
/** Children */
|
|
11
11
|
children?: ReactNode;
|
|
12
|
+
/** Color for override **/
|
|
13
|
+
color?: Color | undefined;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* Dialog layout with navigation,
|
|
15
17
|
*/
|
|
16
|
-
export declare const DialogLayout: ({ backButton, contextMenu, pageMenu, children }: DialogLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const DialogLayout: ({ backButton, contextMenu, pageMenu, children, color }: DialogLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ backButton, contextMenu, pageMenu, children }: import('./DialogLayout').DialogLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: ({ backButton, contextMenu, pageMenu, children, color }: import('./DialogLayout').DialogLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {};
|
|
7
7
|
};
|
|
@@ -5,6 +5,7 @@ export interface ModalHeaderProps {
|
|
|
5
5
|
description?: string;
|
|
6
6
|
icon?: ModalIconProps['icon'];
|
|
7
7
|
closeTitle?: string;
|
|
8
|
+
/** Optional: still useful for side effects; dialog close itself is handled by form submit */
|
|
8
9
|
onClose?: () => void;
|
|
9
10
|
children?: ReactNode;
|
|
10
11
|
sticky?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const meta: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: ({ backButton, contextMenu, pageMenu, children }: import('../../components').DialogLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
component: ({ backButton, contextMenu, pageMenu, children, color }: import('../../components').DialogLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
tags: string[];
|
|
5
5
|
parameters: {};
|
|
6
6
|
args: {
|
|
@@ -8,6 +8,7 @@ declare const meta: {
|
|
|
8
8
|
contextMenu?: import('../../components').ContextMenuProps;
|
|
9
9
|
pageMenu?: import('../../components').PageMenuProps;
|
|
10
10
|
children?: React.ReactNode;
|
|
11
|
+
color?: import('../../types').Color | undefined;
|
|
11
12
|
};
|
|
12
13
|
};
|
|
13
14
|
export default meta;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altinn/altinn-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@digdir/designsystemet-css": "^1.0.6",
|
|
24
24
|
"@digdir/designsystemet-react": "^1.0.6",
|
|
25
25
|
"@digdir/designsystemet-theme": "^1.0.6",
|
|
26
|
-
"@navikt/aksel-icons": "^7.
|
|
26
|
+
"@navikt/aksel-icons": "^7.37.0",
|
|
27
27
|
"@tanstack/react-virtual": "^3.13.9",
|
|
28
28
|
"classnames": "^2.5.1",
|
|
29
29
|
"react": "^19.1.0",
|