@altinn/altinn-components 0.6.12 → 0.7.1
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/AutocompleteBase.css +1 -1
- package/dist/assets/AutocompleteGroup.css +1 -1
- package/dist/assets/DialogBorder.css +1 -1
- package/dist/assets/DialogHeaderBase.css +1 -1
- package/dist/assets/DialogHeadings.css +1 -1
- package/dist/assets/DialogListItem.css +1 -1
- package/dist/assets/DialogTitle.css +1 -1
- package/dist/assets/ListItemBase.css +1 -1
- package/dist/assets/ListItemControls.css +1 -0
- package/dist/assets/ListItemHeader.css +1 -0
- package/dist/assets/ListItemLabel.css +1 -1
- package/dist/assets/ListItemMedia.css +1 -1
- package/dist/assets/ListItemSelect.css +1 -0
- package/dist/assets/MetaItemBase.css +1 -0
- package/dist/assets/MetaItemLabel.css +1 -0
- package/dist/assets/MetaItemMedia.css +1 -0
- package/dist/components/Bookmarks/BookmarksList.d.ts +1 -1
- package/dist/components/Bookmarks/BookmarksListItem.d.ts +2 -13
- package/dist/components/Bookmarks/BookmarksListItem.js +5 -10
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Button/Buttons.stories.js +2 -2
- package/dist/components/ContextMenu/ContextMenu.d.ts +2 -1
- package/dist/components/ContextMenu/ContextMenu.js +19 -8
- package/dist/components/ContextMenu/ContextMenuBase.d.ts +2 -1
- package/dist/components/ContextMenu/ContextMenuBase.js +19 -18
- package/dist/components/Dialog/Dialog.stories.js +30 -20
- package/dist/components/Dialog/DialogBase.d.ts +2 -0
- package/dist/components/Dialog/DialogBorder.d.ts +1 -1
- package/dist/components/Dialog/DialogBorder.js +5 -5
- package/dist/components/Dialog/DialogContent.stories.js +1 -1
- package/dist/components/Dialog/DialogGroup.js +5 -5
- package/dist/components/Dialog/DialogHeader.d.ts +1 -1
- package/dist/components/Dialog/DialogHeader.js +6 -6
- package/dist/components/Dialog/DialogHeaderBase.d.ts +3 -1
- package/dist/components/Dialog/DialogHeaderBase.js +3 -3
- package/dist/components/Dialog/DialogHeadings.d.ts +2 -3
- package/dist/components/Dialog/DialogHeadings.js +24 -26
- package/dist/components/Dialog/DialogLabel.d.ts +13 -0
- package/dist/components/Dialog/DialogLabel.js +17 -0
- package/dist/components/Dialog/DialogListItem.d.ts +17 -5
- package/dist/components/Dialog/DialogListItem.js +86 -70
- package/dist/components/Dialog/DialogListItem.stories.js +117 -68
- package/dist/components/Dialog/DialogMetadata.d.ts +9 -1
- package/dist/components/Dialog/DialogMetadata.js +25 -21
- package/dist/components/Dialog/DialogNav.js +16 -16
- package/dist/components/Dialog/DialogTitle.d.ts +7 -9
- package/dist/components/Dialog/DialogTitle.js +9 -10
- package/dist/components/Dialog/Examples.stories.js +31 -0
- package/dist/components/Dialog/index.d.ts +1 -1
- package/dist/components/Dialog/index.js +41 -41
- package/dist/components/List/ListItem.d.ts +5 -25
- package/dist/components/List/ListItem.js +41 -20
- package/dist/components/List/ListItem.stories.js +79 -45
- package/dist/components/List/ListItemBase.d.ts +8 -10
- package/dist/components/List/ListItemBase.js +52 -46
- package/dist/components/List/{ListItemAction.d.ts → ListItemControls.d.ts} +3 -3
- package/dist/components/List/ListItemControls.js +19 -0
- package/dist/components/List/ListItemHeader.d.ts +8 -0
- package/dist/components/List/ListItemHeader.js +8 -0
- package/dist/components/List/ListItemLabel.js +7 -7
- package/dist/components/List/ListItemMedia.js +7 -7
- package/dist/components/List/ListItemSelect.d.ts +12 -0
- package/dist/components/List/ListItemSelect.js +15 -0
- package/dist/components/List/index.d.ts +5 -3
- package/dist/components/List/index.js +16 -12
- package/dist/components/Meta/MetaItemBase.d.ts +1 -1
- package/dist/components/Meta/MetaItemBase.js +21 -20
- package/dist/components/Meta/MetaItemLabel.js +5 -4
- package/dist/components/Meta/MetaItemMedia.js +9 -8
- package/dist/components/Page/PageNav.js +7 -7
- package/dist/components/Searchbar/Autocomplete.stories.js +241 -13
- package/dist/components/Searchbar/AutocompleteBase.js +5 -5
- package/dist/components/Searchbar/AutocompleteGroup.js +9 -12
- package/dist/components/Searchbar/AutocompleteItem.d.ts +23 -11
- package/dist/components/Searchbar/AutocompleteItem.js +21 -8
- package/dist/components/Searchbar/ScopeListItem.d.ts +12 -0
- package/dist/components/Searchbar/ScopeListItem.js +12 -0
- package/dist/components/Toolbar/ToolbarButton.js +2 -1
- package/dist/components/index.js +153 -149
- package/dist/hooks/useMenu.js +19 -19
- package/dist/index.js +163 -159
- package/package.json +1 -1
- package/dist/assets/DialogListItemBase.css +0 -1
- package/dist/assets/ListItemAction.css +0 -1
- package/dist/assets/metaItem.css +0 -1
- package/dist/components/Dialog/DialogListItemBase.d.ts +0 -28
- package/dist/components/Dialog/DialogListItemBase.js +0 -24
- package/dist/components/Dialog/DialogTitle.stories.js +0 -26
- package/dist/components/List/ListItemAction.js +0 -19
- package/dist/components/List/ListItemAction.stories.js +0 -45
- package/dist/metaItem.module-CfNiX769.js +0 -8
- /package/dist/assets/{AutocompleteItem.css → ScopeListItem.css} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { MetaItem as e } from "../Meta/MetaItem.js";
|
|
3
|
+
import "../../index-L8X2o7IH.js";
|
|
4
|
+
import "../Icon/SvgIcon.js";
|
|
5
|
+
const u = ({ size: r = "xs", variant: n, label: t, children: a }) => {
|
|
6
|
+
switch (n) {
|
|
7
|
+
case "trashed":
|
|
8
|
+
return /* @__PURE__ */ o(e, { size: r, icon: "trash", variant: "rounded", children: a || t });
|
|
9
|
+
case "archived":
|
|
10
|
+
return /* @__PURE__ */ o(e, { size: r, icon: "archive", variant: "rounded", children: a || t });
|
|
11
|
+
default:
|
|
12
|
+
return /* @__PURE__ */ o(e, { size: r, variant: "rounded", children: a || t });
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
u as DialogLabel
|
|
17
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
|
+
import { ListItemBaseProps } from '../List';
|
|
2
3
|
import { DialogRecipientProps, DialogSenderProps } from './DialogHeadings';
|
|
4
|
+
import { DialogSeenByProps } from './DialogSeenBy';
|
|
3
5
|
import { DialogSelectProps } from './DialogSelect';
|
|
4
6
|
import { DialogStatusProps } from './DialogStatus';
|
|
5
7
|
import { DialogTouchedByActor } from './DialogTouchedBy';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
8
|
+
export type DialogListItemSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
export type DialogListItemVariant = 'neutral' | 'draft' | 'trashed' | 'archived';
|
|
10
|
+
export interface DialogListItemProps extends ListItemBaseProps {
|
|
9
11
|
/** Dialog title */
|
|
10
12
|
title: string;
|
|
11
13
|
/** Render as */
|
|
@@ -38,6 +40,16 @@ export type DialogListItemProps = {
|
|
|
38
40
|
dueAt?: string;
|
|
39
41
|
/** Dialog due date label */
|
|
40
42
|
dueAtLabel?: string;
|
|
43
|
+
/** Archived date time */
|
|
44
|
+
archivedAt?: string;
|
|
45
|
+
/** Archived label */
|
|
46
|
+
archivedAtLabel?: string;
|
|
47
|
+
/** Deleted at date time */
|
|
48
|
+
trashedAt?: string;
|
|
49
|
+
/** Deleted label */
|
|
50
|
+
trashedAtLabel?: string;
|
|
51
|
+
/** Custom label */
|
|
52
|
+
label?: string;
|
|
41
53
|
/** Dialog has been seen */
|
|
42
54
|
seen?: boolean;
|
|
43
55
|
/** Dialog is seen by the user */
|
|
@@ -50,10 +62,10 @@ export type DialogListItemProps = {
|
|
|
50
62
|
onClick?: () => void;
|
|
51
63
|
/** Group id */
|
|
52
64
|
groupId?: string;
|
|
53
|
-
}
|
|
65
|
+
}
|
|
54
66
|
/**
|
|
55
67
|
* Represents a dialog in list view, displaying information such as the title,
|
|
56
68
|
* summary, sender, and receiver.
|
|
57
69
|
* to mark the item as checked/unchecked and can visually indicate if it is unread.
|
|
58
70
|
*/
|
|
59
|
-
export declare const DialogListItem: ({
|
|
71
|
+
export declare const DialogListItem: ({ size, variant, select, status, sender, recipient, grouped, updatedAt, updatedAtLabel, archivedAt, archivedAtLabel, trashedAt, trashedAtLabel, label, dueAt, dueAtLabel, seen, seenBy, touchedBy, attachmentsCount, title, summary, ...rest }: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,73 +1,89 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
L,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { ListItemBase as p } from "../List/ListItemBase.js";
|
|
3
|
+
import "../../index-L8X2o7IH.js";
|
|
4
|
+
import { ListItemLabel as M } from "../List/ListItemLabel.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "../Icon/SvgIcon.js";
|
|
7
|
+
import { DialogBorder as h } from "./DialogBorder.js";
|
|
8
|
+
import { DialogMetadata as g } from "./DialogMetadata.js";
|
|
9
|
+
import { DialogHeaderBase as S } from "./DialogHeaderBase.js";
|
|
10
|
+
import { DialogHeadings as V } from "./DialogHeadings.js";
|
|
11
|
+
import { DialogTitle as k } from "./DialogTitle.js";
|
|
12
|
+
import { DialogTouchedBy as q } from "./DialogTouchedBy.js";
|
|
13
|
+
import { DialogSelect as w } from "./DialogSelect.js";
|
|
14
|
+
import "../RootProvider/RootProvider.js";
|
|
15
|
+
import '../../assets/DialogListItem.css';const C = "_item_vo44o_1", E = "_select_vo44o_20", F = "_summary_vo44o_27", G = "_footer_vo44o_48", J = "_touchedBy_vo44o_56", K = "_border_vo44o_65", t = {
|
|
16
|
+
item: C,
|
|
17
|
+
select: E,
|
|
18
|
+
summary: F,
|
|
19
|
+
footer: G,
|
|
20
|
+
touchedBy: J,
|
|
21
|
+
border: K
|
|
22
|
+
}, to = ({
|
|
23
|
+
size: o = "lg",
|
|
24
|
+
variant: u = "neutral",
|
|
25
|
+
select: a,
|
|
26
|
+
status: y,
|
|
27
|
+
sender: D,
|
|
28
|
+
recipient: N,
|
|
29
|
+
grouped: v,
|
|
30
|
+
updatedAt: i,
|
|
31
|
+
updatedAtLabel: s,
|
|
32
|
+
archivedAt: c,
|
|
33
|
+
archivedAtLabel: B,
|
|
34
|
+
trashedAt: l,
|
|
35
|
+
trashedAtLabel: b,
|
|
36
|
+
label: x,
|
|
37
|
+
dueAt: I,
|
|
38
|
+
dueAtLabel: L,
|
|
39
|
+
seen: e = !1,
|
|
40
|
+
seenBy: j,
|
|
41
|
+
touchedBy: n,
|
|
42
|
+
attachmentsCount: H,
|
|
43
|
+
title: d,
|
|
44
|
+
summary: _,
|
|
45
|
+
...f
|
|
46
|
+
}) => {
|
|
47
|
+
const T = l ? "trashed" : c ? "archived" : u;
|
|
48
|
+
return o === "xs" || o === "sm" ? /* @__PURE__ */ r(p, { ...f, size: o, className: t.item, children: /* @__PURE__ */ m(h, { className: t.border, size: o, seen: e, children: [
|
|
49
|
+
/* @__PURE__ */ r(M, { size: o, title: d, description: _ }),
|
|
50
|
+
/* @__PURE__ */ r(g, { updatedAt: i, updatedAtLabel: s })
|
|
51
|
+
] }) }) : /* @__PURE__ */ r(
|
|
52
|
+
p,
|
|
53
|
+
{
|
|
54
|
+
...f,
|
|
55
|
+
size: o,
|
|
56
|
+
className: t.item,
|
|
57
|
+
controls: a && /* @__PURE__ */ r(w, { className: t.select, ...a }),
|
|
58
|
+
children: /* @__PURE__ */ m(h, { className: t.border, size: o, seen: e, children: [
|
|
59
|
+
/* @__PURE__ */ m(S, { size: o, children: [
|
|
60
|
+
/* @__PURE__ */ r(k, { size: o, variant: T, label: x, seen: e, children: d }),
|
|
61
|
+
/* @__PURE__ */ r(V, { size: o, grouped: v, sender: D, recipient: N })
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ r("p", { "data-size": o, className: t.summary, children: _ }),
|
|
64
|
+
/* @__PURE__ */ m("footer", { "data-size": o, className: t.footer, children: [
|
|
65
|
+
/* @__PURE__ */ r(
|
|
66
|
+
g,
|
|
67
|
+
{
|
|
68
|
+
status: y,
|
|
69
|
+
updatedAt: i,
|
|
70
|
+
updatedAtLabel: s,
|
|
71
|
+
archivedAt: c,
|
|
72
|
+
archivedAtLabel: B,
|
|
73
|
+
trashedAt: l,
|
|
74
|
+
trashedAtLabel: b,
|
|
75
|
+
dueAt: I,
|
|
76
|
+
dueAtLabel: L,
|
|
77
|
+
seenBy: j,
|
|
78
|
+
attachmentsCount: H
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
n && /* @__PURE__ */ r(q, { size: "xs", touchedBy: n, className: t.touchedBy })
|
|
82
|
+
] })
|
|
67
83
|
] })
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
};
|
|
71
87
|
export {
|
|
72
|
-
|
|
88
|
+
to as DialogListItem
|
|
73
89
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { withThemeByDataAttribute as y } from "@storybook/addon-themes";
|
|
3
|
+
import { Fragment as u, useState as v } from "react";
|
|
4
|
+
import { DialogListItem as n } from "./DialogListItem.js";
|
|
4
5
|
import { DialogStatusEnum as g } from "./DialogStatus.js";
|
|
5
6
|
import "../../index-L8X2o7IH.js";
|
|
6
7
|
import "../Icon/SvgIcon.js";
|
|
7
|
-
import { MetaItem as
|
|
8
|
+
import { MetaItem as r } from "../Meta/MetaItem.js";
|
|
8
9
|
import "../RootProvider/RootProvider.js";
|
|
9
10
|
import { ListBase as s } from "../List/ListBase.js";
|
|
10
11
|
const f = (t) => {
|
|
@@ -22,18 +23,24 @@ const f = (t) => {
|
|
|
22
23
|
default:
|
|
23
24
|
return "";
|
|
24
25
|
}
|
|
25
|
-
},
|
|
26
|
-
var
|
|
27
|
-
const
|
|
26
|
+
}, o = ["lg", "md", "sm", "xs"];
|
|
27
|
+
var b;
|
|
28
|
+
const c = (b = Object.keys(g)) == null ? void 0 : b.map((t) => ({
|
|
28
29
|
value: t,
|
|
29
30
|
label: f(t)
|
|
30
|
-
})),
|
|
31
|
+
})), j = {
|
|
31
32
|
title: "Dialog/DialogListItem",
|
|
32
|
-
component:
|
|
33
|
+
component: n,
|
|
33
34
|
tags: ["autodocs"],
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
decorators: [
|
|
36
|
+
y({
|
|
37
|
+
themes: {
|
|
38
|
+
company: "company",
|
|
39
|
+
person: "person"
|
|
40
|
+
},
|
|
41
|
+
defaultTheme: "company"
|
|
42
|
+
})
|
|
43
|
+
],
|
|
37
44
|
argTypes: {},
|
|
38
45
|
args: {
|
|
39
46
|
title: "Title",
|
|
@@ -50,12 +57,53 @@ const o = (p = Object.keys(g)) == null ? void 0 : p.map((t) => ({
|
|
|
50
57
|
updatedAtLabel: "25. november 2024 kl 15.30",
|
|
51
58
|
status: {}
|
|
52
59
|
}
|
|
53
|
-
},
|
|
54
|
-
/* @__PURE__ */ e(
|
|
55
|
-
/* @__PURE__ */ e(
|
|
56
|
-
] },
|
|
60
|
+
}, C = (t) => /* @__PURE__ */ e(s, { children: c == null ? void 0 : c.map((l) => /* @__PURE__ */ i(u, { children: [
|
|
61
|
+
/* @__PURE__ */ e(n, { ...t, status: l }),
|
|
62
|
+
/* @__PURE__ */ e(r, { children: l == null ? void 0 : l.value })
|
|
63
|
+
] }, l == null ? void 0 : l.value)) }), E = (t) => /* @__PURE__ */ i(s, { children: [
|
|
64
|
+
/* @__PURE__ */ e(n, { ...t, label: "Ulest", status: { value: "requires-attention", label: "Krever handling" } }),
|
|
65
|
+
/* @__PURE__ */ e(r, { children: "Dialog is new and has not been seen by anybody" }),
|
|
57
66
|
/* @__PURE__ */ e(
|
|
58
|
-
|
|
67
|
+
n,
|
|
68
|
+
{
|
|
69
|
+
...t,
|
|
70
|
+
seen: !0,
|
|
71
|
+
seenBy: { seenByEndUser: !0, label: "Sett av deg" },
|
|
72
|
+
status: { value: "requires-attention", label: "Krever handling" }
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ e(r, { children: "Dialog has been seen" }),
|
|
76
|
+
/* @__PURE__ */ e(
|
|
77
|
+
n,
|
|
78
|
+
{
|
|
79
|
+
...t,
|
|
80
|
+
size: "md",
|
|
81
|
+
label: "Arkivert",
|
|
82
|
+
status: { value: "completed", label: "Avsluttet" },
|
|
83
|
+
seen: !0,
|
|
84
|
+
seenBy: { seenByEndUser: !0, label: "Sett av deg" },
|
|
85
|
+
archivedAt: "2024-11-27",
|
|
86
|
+
archivedAtLabel: "Arkivert av Kjell Olsen, 27. nov 2024"
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ e(r, { children: "Dialog has been moved to archive" }),
|
|
90
|
+
/* @__PURE__ */ e(
|
|
91
|
+
n,
|
|
92
|
+
{
|
|
93
|
+
...t,
|
|
94
|
+
size: "md",
|
|
95
|
+
label: "Papirkurv",
|
|
96
|
+
status: { value: "completed", label: "Avsluttet" },
|
|
97
|
+
seen: !0,
|
|
98
|
+
seenBy: { seenByEndUser: !0, label: "Sett av deg" },
|
|
99
|
+
trashedAt: "2024-11-27",
|
|
100
|
+
trashedAtLabel: "Slettet av Kjell Olsen, 27. nov 2024"
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ e(r, { children: "Dialog has been moved to trash" })
|
|
104
|
+
] }), I = (t) => /* @__PURE__ */ i(s, { children: [
|
|
105
|
+
/* @__PURE__ */ e(
|
|
106
|
+
n,
|
|
59
107
|
{
|
|
60
108
|
...t,
|
|
61
109
|
status: { label: "Krever handling", value: "requires-attention" },
|
|
@@ -63,57 +111,57 @@ const o = (p = Object.keys(g)) == null ? void 0 : p.map((t) => ({
|
|
|
63
111
|
dueAtLabel: "Frist: 1. januar 2025"
|
|
64
112
|
}
|
|
65
113
|
),
|
|
66
|
-
/* @__PURE__ */ e(
|
|
67
|
-
] }),
|
|
68
|
-
/* @__PURE__ */ e(
|
|
69
|
-
/* @__PURE__ */ e(
|
|
70
|
-
] }),
|
|
71
|
-
/* @__PURE__ */ e(
|
|
72
|
-
/* @__PURE__ */ e(
|
|
73
|
-
/* @__PURE__ */ e(
|
|
74
|
-
/* @__PURE__ */ e(
|
|
114
|
+
/* @__PURE__ */ e(r, { children: "Dialog requires action wihtin a spesific due date." })
|
|
115
|
+
] }), q = (t) => /* @__PURE__ */ i(s, { children: [
|
|
116
|
+
/* @__PURE__ */ e(n, { ...t, attachmentsCount: 2 }),
|
|
117
|
+
/* @__PURE__ */ e(r, { children: "Dialog has attachments." })
|
|
118
|
+
] }), T = (t) => /* @__PURE__ */ i(s, { children: [
|
|
119
|
+
/* @__PURE__ */ e(n, { ...t, seen: !0, seenBy: { seenByEndUser: !0, label: "Sett av deg" } }),
|
|
120
|
+
/* @__PURE__ */ e(r, { children: "Seen by end user. Dialog is marked as seen." }),
|
|
121
|
+
/* @__PURE__ */ e(n, { ...t, seenBy: { seenByOthersCount: 4, label: "Sett av 4" } }),
|
|
122
|
+
/* @__PURE__ */ e(r, { children: "Seen by others. Dialog is not marked as seen." }),
|
|
75
123
|
/* @__PURE__ */ e(
|
|
76
|
-
|
|
124
|
+
n,
|
|
77
125
|
{
|
|
78
126
|
...t,
|
|
79
127
|
seen: !0,
|
|
80
128
|
seenBy: { seenByOthersCount: 4, seenByEndUser: !0, label: "Sett av deg + 4" }
|
|
81
129
|
}
|
|
82
130
|
),
|
|
83
|
-
/* @__PURE__ */ e(
|
|
84
|
-
] }),
|
|
85
|
-
/* @__PURE__ */ e(
|
|
86
|
-
/* @__PURE__ */ e(
|
|
87
|
-
/* @__PURE__ */ e(
|
|
88
|
-
/* @__PURE__ */ e(
|
|
131
|
+
/* @__PURE__ */ e(r, { children: "Seen by end user and others. Dialog is marked as seen." })
|
|
132
|
+
] }), w = (t) => /* @__PURE__ */ i(s, { children: [
|
|
133
|
+
/* @__PURE__ */ e(n, { ...t, touchedBy: [{ name: "Kari Nordmann" }] }),
|
|
134
|
+
/* @__PURE__ */ e(r, { children: "Dialog has been touched by a single actor." }),
|
|
135
|
+
/* @__PURE__ */ e(n, { ...t, touchedBy: [{ name: "Kari Nordmann" }, { name: "Ola Nordmann" }] }),
|
|
136
|
+
/* @__PURE__ */ e(r, { children: "Dialog has been touched by two actors." }),
|
|
89
137
|
/* @__PURE__ */ e(
|
|
90
|
-
|
|
138
|
+
n,
|
|
91
139
|
{
|
|
92
140
|
...t,
|
|
93
141
|
touchedBy: [{ name: "Kari Nordmann" }, { name: "Ola Nordmann" }, { name: "Per Nordmann" }]
|
|
94
142
|
}
|
|
95
143
|
),
|
|
96
|
-
/* @__PURE__ */ e(
|
|
97
|
-
] }),
|
|
144
|
+
/* @__PURE__ */ e(r, { children: "Dialog has been touched by a multiple actors." })
|
|
145
|
+
] }), x = (t) => /* @__PURE__ */ i(s, { children: [
|
|
98
146
|
/* @__PURE__ */ e(
|
|
99
|
-
|
|
147
|
+
n,
|
|
100
148
|
{
|
|
101
149
|
...t,
|
|
102
150
|
title: "Cras mattis consectetur purus sit amet fermentum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean lacinia bibendum nulla sed consectetur. Maecenas faucibus mollis interdum. Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam id dolor id nibh ultricies vehicula ut id elit."
|
|
103
151
|
}
|
|
104
152
|
),
|
|
105
|
-
/* @__PURE__ */ e(
|
|
153
|
+
/* @__PURE__ */ e(r, { children: "Long title" }),
|
|
106
154
|
/* @__PURE__ */ e(
|
|
107
|
-
|
|
155
|
+
n,
|
|
108
156
|
{
|
|
109
157
|
...t,
|
|
110
158
|
summary: "Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Maecenas faucibus mollis interdum. Nullam id dolor id nibh ultricies vehicula ut id elit.\\n\\nCras mattis consectetur purus sit amet fermentum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean lacinia bibendum nulla sed consectetur. Maecenas faucibus mollis interdum. Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam id dolor id nibh ultricies vehicula ut id elit."
|
|
111
159
|
}
|
|
112
160
|
),
|
|
113
|
-
/* @__PURE__ */ e(
|
|
161
|
+
/* @__PURE__ */ e(r, { children: "Long summary" })
|
|
114
162
|
] }), M = (t) => {
|
|
115
163
|
var h;
|
|
116
|
-
const [
|
|
164
|
+
const [l, p] = v({
|
|
117
165
|
1: {
|
|
118
166
|
id: "1",
|
|
119
167
|
title: "Item 1",
|
|
@@ -129,43 +177,44 @@ const o = (p = Object.keys(g)) == null ? void 0 : p.map((t) => ({
|
|
|
129
177
|
title: "Item 2",
|
|
130
178
|
selected: !1
|
|
131
179
|
}
|
|
132
|
-
}), m = ({ id:
|
|
133
|
-
|
|
134
|
-
...
|
|
135
|
-
[
|
|
136
|
-
...
|
|
137
|
-
selected: !
|
|
180
|
+
}), m = ({ id: a }) => {
|
|
181
|
+
p((d) => ({
|
|
182
|
+
...d,
|
|
183
|
+
[a]: {
|
|
184
|
+
...d[a],
|
|
185
|
+
selected: !d[a].selected
|
|
138
186
|
}
|
|
139
187
|
}));
|
|
140
188
|
};
|
|
141
|
-
return /* @__PURE__ */ e(s, { children: (h = Object.values(
|
|
189
|
+
return /* @__PURE__ */ e(s, { children: (h = Object.values(l)) == null ? void 0 : h.map((a) => /* @__PURE__ */ i(u, { children: [
|
|
142
190
|
/* @__PURE__ */ e(
|
|
143
|
-
|
|
191
|
+
n,
|
|
144
192
|
{
|
|
145
193
|
...t,
|
|
146
|
-
title:
|
|
147
|
-
onClick:
|
|
148
|
-
selected:
|
|
149
|
-
select: { checked:
|
|
194
|
+
title: a.title,
|
|
195
|
+
onClick: a.selected ? () => m(a) : null,
|
|
196
|
+
selected: a.selected,
|
|
197
|
+
select: { checked: a == null ? void 0 : a.selected, onChange: () => m(a) }
|
|
150
198
|
}
|
|
151
199
|
),
|
|
152
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ i(r, { children: [
|
|
153
201
|
"selected:",
|
|
154
|
-
|
|
202
|
+
a.selected ? "true" : "false"
|
|
155
203
|
] })
|
|
156
|
-
] },
|
|
157
|
-
},
|
|
158
|
-
/* @__PURE__ */ e(
|
|
159
|
-
/* @__PURE__ */ e(
|
|
160
|
-
] },
|
|
204
|
+
] }, a == null ? void 0 : a.id)) });
|
|
205
|
+
}, P = (t) => /* @__PURE__ */ e(s, { children: o == null ? void 0 : o.map((l) => /* @__PURE__ */ i(u, { children: [
|
|
206
|
+
/* @__PURE__ */ e(n, { ...t, size: l, status: { value: "in-progress", label: "Under arbeid" } }),
|
|
207
|
+
/* @__PURE__ */ e(r, { children: l })
|
|
208
|
+
] }, l)) });
|
|
161
209
|
export {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
210
|
+
q as Attachments,
|
|
211
|
+
I as DueAt,
|
|
212
|
+
T as SeenBy,
|
|
165
213
|
M as Selectable,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
214
|
+
P as Sizes,
|
|
215
|
+
C as Statuses,
|
|
216
|
+
x as TextLength,
|
|
217
|
+
w as TouchedBy,
|
|
218
|
+
E as Variants,
|
|
219
|
+
j as default
|
|
171
220
|
};
|
|
@@ -11,6 +11,14 @@ export type DialogMetadataProps = {
|
|
|
11
11
|
dueAt?: string;
|
|
12
12
|
/** Due date label */
|
|
13
13
|
dueAtLabel?: string;
|
|
14
|
+
/** Archived date time */
|
|
15
|
+
archivedAt?: string;
|
|
16
|
+
/** Archived label */
|
|
17
|
+
archivedAtLabel?: string;
|
|
18
|
+
/** Deleted at date time */
|
|
19
|
+
trashedAt?: string;
|
|
20
|
+
/** Deleted label */
|
|
21
|
+
trashedAtLabel?: string;
|
|
14
22
|
/** Who have seen the dialog after latest update */
|
|
15
23
|
seenBy?: DialogSeenByProps;
|
|
16
24
|
/** Number of attachments */
|
|
@@ -19,4 +27,4 @@ export type DialogMetadataProps = {
|
|
|
19
27
|
/**
|
|
20
28
|
* Metadata for a dialog in list view.
|
|
21
29
|
*/
|
|
22
|
-
export declare const DialogMetadata: ({ status, updatedAt, updatedAtLabel, dueAt, dueAtLabel, seenBy, attachmentsCount, }: DialogMetadataProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare const DialogMetadata: ({ status, updatedAt, updatedAtLabel, dueAt, dueAtLabel, trashedAt, trashedAtLabel, archivedAt, archivedAtLabel, seenBy, attachmentsCount, }: DialogMetadataProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { MetaBase as
|
|
3
|
-
import { MetaItem as
|
|
1
|
+
import { jsxs as z, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { MetaBase as f } from "../Meta/MetaBase.js";
|
|
3
|
+
import { MetaItem as d } from "../Meta/MetaItem.js";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import "../Icon/SvgIcon.js";
|
|
6
|
-
import { MetaTimestamp as
|
|
7
|
-
import { DialogSeenBy as
|
|
8
|
-
import { DialogStatus as
|
|
9
|
-
const
|
|
10
|
-
status:
|
|
11
|
-
updatedAt:
|
|
12
|
-
updatedAtLabel:
|
|
13
|
-
dueAt:
|
|
14
|
-
dueAtLabel:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
import { MetaTimestamp as e } from "../Meta/MetaTimestamp.js";
|
|
7
|
+
import { DialogSeenBy as h } from "./DialogSeenBy.js";
|
|
8
|
+
import { DialogStatus as M } from "./DialogStatus.js";
|
|
9
|
+
const q = ({
|
|
10
|
+
status: o,
|
|
11
|
+
updatedAt: r,
|
|
12
|
+
updatedAtLabel: l,
|
|
13
|
+
dueAt: m,
|
|
14
|
+
dueAtLabel: s,
|
|
15
|
+
trashedAt: t,
|
|
16
|
+
trashedAtLabel: c,
|
|
17
|
+
archivedAt: p,
|
|
18
|
+
archivedAtLabel: x,
|
|
19
|
+
seenBy: n,
|
|
20
|
+
attachmentsCount: a = 0
|
|
21
|
+
}) => /* @__PURE__ */ z(f, { size: "xs", children: [
|
|
22
|
+
o && /* @__PURE__ */ i(M, { size: "xs", ...o }),
|
|
23
|
+
r && /* @__PURE__ */ i(e, { datetime: r, size: "xs", children: l }),
|
|
24
|
+
m && s && /* @__PURE__ */ i(e, { datetime: m, size: "xs", icon: "clock-dashed", children: s }),
|
|
25
|
+
a > 0 && /* @__PURE__ */ i(d, { size: "xs", icon: "paperclip", children: a }),
|
|
26
|
+
t && c && /* @__PURE__ */ i(e, { datetime: t, size: "xs", icon: "trash", children: c }) || p && x && /* @__PURE__ */ i(e, { datetime: p, size: "xs", icon: "archive", children: x }) || n && /* @__PURE__ */ i(h, { size: "xs", ...n })
|
|
23
27
|
] });
|
|
24
28
|
export {
|
|
25
|
-
|
|
29
|
+
q as DialogMetadata
|
|
26
30
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "../Icon/SvgIcon.js";
|
|
5
5
|
import { Button as c } from "../Button/Button.js";
|
|
6
6
|
import { ContextMenu as l } from "../ContextMenu/ContextMenu.js";
|
|
7
7
|
import { MetaTimestamp as p } from "../Meta/MetaTimestamp.js";
|
|
8
|
-
import { DialogStatus as
|
|
9
|
-
import { DialogTouchedBy as
|
|
10
|
-
import '../../assets/DialogNav.css';const f = "_nav_678a5_1", x = "_action_678a5_8",
|
|
8
|
+
import { DialogStatus as d } from "./DialogStatus.js";
|
|
9
|
+
import { DialogTouchedBy as v } from "./DialogTouchedBy.js";
|
|
10
|
+
import '../../assets/DialogNav.css';const f = "_nav_678a5_1", x = "_action_678a5_8", t = {
|
|
11
11
|
nav: f,
|
|
12
12
|
action: x
|
|
13
13
|
}, M = ({
|
|
14
|
-
backButton:
|
|
14
|
+
backButton: i = {
|
|
15
15
|
as: "a",
|
|
16
16
|
label: "Back"
|
|
17
17
|
},
|
|
18
|
-
status:
|
|
19
|
-
dueAt:
|
|
18
|
+
status: a,
|
|
19
|
+
dueAt: r,
|
|
20
20
|
dueAtLabel: e,
|
|
21
|
-
touchedBy:
|
|
22
|
-
menu:
|
|
23
|
-
}) => /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */ o(c, { ...
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
touchedBy: n,
|
|
22
|
+
menu: s
|
|
23
|
+
}) => /* @__PURE__ */ m("nav", { className: t.nav, children: [
|
|
24
|
+
/* @__PURE__ */ o(c, { ...i, variant: "text", color: "secondary", icon: "arrow-left", children: (i == null ? void 0 : i.label) || "Back" }),
|
|
25
|
+
/* @__PURE__ */ m("div", { className: t.action, children: [
|
|
26
|
+
r && e && /* @__PURE__ */ o(p, { datetime: r, icon: "clock-dashed", size: "xs", children: e }),
|
|
27
|
+
a && /* @__PURE__ */ o(d, { ...a }),
|
|
28
|
+
n && /* @__PURE__ */ o(v, { touchedBy: n }),
|
|
29
|
+
s && /* @__PURE__ */ o(l, { ...s, size: "md" })
|
|
30
30
|
] })
|
|
31
31
|
] });
|
|
32
32
|
export {
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { DialogListItemVariant } from './DialogListItemBase';
|
|
4
|
-
export type DialogTitleSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
|
+
import { DialogSize, DialogVariant } from './DialogBase';
|
|
5
3
|
export type DialogTitleProps = {
|
|
6
|
-
/** Variant */
|
|
7
|
-
variant: DialogListItemVariant;
|
|
8
4
|
/** Size */
|
|
9
|
-
size?:
|
|
5
|
+
size?: DialogSize;
|
|
6
|
+
/** Variant */
|
|
7
|
+
variant?: DialogVariant;
|
|
8
|
+
/** Label */
|
|
9
|
+
label?: string;
|
|
10
10
|
/** Variant */
|
|
11
11
|
seen?: boolean;
|
|
12
|
-
/** Display an icon next to title */
|
|
13
|
-
icon?: IconName;
|
|
14
12
|
/** Dialog title */
|
|
15
13
|
children?: ReactNode;
|
|
16
14
|
};
|
|
17
15
|
/**
|
|
18
16
|
* Dialog title
|
|
19
17
|
*/
|
|
20
|
-
export declare const DialogTitle: ({ size, seen, variant,
|
|
18
|
+
export declare const DialogTitle: ({ size, seen, variant, label, children }: DialogTitleProps) => import("react/jsx-runtime").JSX.Element;
|