@altinn/altinn-components 0.51.4 → 0.51.5
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/components/Dialog/DialogLayout.js +9 -9
- package/dist/components/Dialog/DialogListItem.js +40 -38
- package/dist/components/Modal/ModalHeader.js +33 -24
- 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 +1 -1
|
@@ -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
|
] }) });
|
|
@@ -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;
|