@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.
Files changed (92) hide show
  1. package/dist/assets/AutocompleteBase.css +1 -1
  2. package/dist/assets/AutocompleteGroup.css +1 -1
  3. package/dist/assets/DialogBorder.css +1 -1
  4. package/dist/assets/DialogHeaderBase.css +1 -1
  5. package/dist/assets/DialogHeadings.css +1 -1
  6. package/dist/assets/DialogListItem.css +1 -1
  7. package/dist/assets/DialogTitle.css +1 -1
  8. package/dist/assets/ListItemBase.css +1 -1
  9. package/dist/assets/ListItemControls.css +1 -0
  10. package/dist/assets/ListItemHeader.css +1 -0
  11. package/dist/assets/ListItemLabel.css +1 -1
  12. package/dist/assets/ListItemMedia.css +1 -1
  13. package/dist/assets/ListItemSelect.css +1 -0
  14. package/dist/assets/MetaItemBase.css +1 -0
  15. package/dist/assets/MetaItemLabel.css +1 -0
  16. package/dist/assets/MetaItemMedia.css +1 -0
  17. package/dist/components/Bookmarks/BookmarksList.d.ts +1 -1
  18. package/dist/components/Bookmarks/BookmarksListItem.d.ts +2 -13
  19. package/dist/components/Bookmarks/BookmarksListItem.js +5 -10
  20. package/dist/components/Button/Button.js +2 -2
  21. package/dist/components/Button/Buttons.stories.js +2 -2
  22. package/dist/components/ContextMenu/ContextMenu.d.ts +2 -1
  23. package/dist/components/ContextMenu/ContextMenu.js +19 -8
  24. package/dist/components/ContextMenu/ContextMenuBase.d.ts +2 -1
  25. package/dist/components/ContextMenu/ContextMenuBase.js +19 -18
  26. package/dist/components/Dialog/Dialog.stories.js +30 -20
  27. package/dist/components/Dialog/DialogBase.d.ts +2 -0
  28. package/dist/components/Dialog/DialogBorder.d.ts +1 -1
  29. package/dist/components/Dialog/DialogBorder.js +5 -5
  30. package/dist/components/Dialog/DialogContent.stories.js +1 -1
  31. package/dist/components/Dialog/DialogGroup.js +5 -5
  32. package/dist/components/Dialog/DialogHeader.d.ts +1 -1
  33. package/dist/components/Dialog/DialogHeader.js +6 -6
  34. package/dist/components/Dialog/DialogHeaderBase.d.ts +3 -1
  35. package/dist/components/Dialog/DialogHeaderBase.js +3 -3
  36. package/dist/components/Dialog/DialogHeadings.d.ts +2 -3
  37. package/dist/components/Dialog/DialogHeadings.js +24 -26
  38. package/dist/components/Dialog/DialogLabel.d.ts +13 -0
  39. package/dist/components/Dialog/DialogLabel.js +17 -0
  40. package/dist/components/Dialog/DialogListItem.d.ts +17 -5
  41. package/dist/components/Dialog/DialogListItem.js +86 -70
  42. package/dist/components/Dialog/DialogListItem.stories.js +117 -68
  43. package/dist/components/Dialog/DialogMetadata.d.ts +9 -1
  44. package/dist/components/Dialog/DialogMetadata.js +25 -21
  45. package/dist/components/Dialog/DialogNav.js +16 -16
  46. package/dist/components/Dialog/DialogTitle.d.ts +7 -9
  47. package/dist/components/Dialog/DialogTitle.js +9 -10
  48. package/dist/components/Dialog/Examples.stories.js +31 -0
  49. package/dist/components/Dialog/index.d.ts +1 -1
  50. package/dist/components/Dialog/index.js +41 -41
  51. package/dist/components/List/ListItem.d.ts +5 -25
  52. package/dist/components/List/ListItem.js +41 -20
  53. package/dist/components/List/ListItem.stories.js +79 -45
  54. package/dist/components/List/ListItemBase.d.ts +8 -10
  55. package/dist/components/List/ListItemBase.js +52 -46
  56. package/dist/components/List/{ListItemAction.d.ts → ListItemControls.d.ts} +3 -3
  57. package/dist/components/List/ListItemControls.js +19 -0
  58. package/dist/components/List/ListItemHeader.d.ts +8 -0
  59. package/dist/components/List/ListItemHeader.js +8 -0
  60. package/dist/components/List/ListItemLabel.js +7 -7
  61. package/dist/components/List/ListItemMedia.js +7 -7
  62. package/dist/components/List/ListItemSelect.d.ts +12 -0
  63. package/dist/components/List/ListItemSelect.js +15 -0
  64. package/dist/components/List/index.d.ts +5 -3
  65. package/dist/components/List/index.js +16 -12
  66. package/dist/components/Meta/MetaItemBase.d.ts +1 -1
  67. package/dist/components/Meta/MetaItemBase.js +21 -20
  68. package/dist/components/Meta/MetaItemLabel.js +5 -4
  69. package/dist/components/Meta/MetaItemMedia.js +9 -8
  70. package/dist/components/Page/PageNav.js +7 -7
  71. package/dist/components/Searchbar/Autocomplete.stories.js +241 -13
  72. package/dist/components/Searchbar/AutocompleteBase.js +5 -5
  73. package/dist/components/Searchbar/AutocompleteGroup.js +9 -12
  74. package/dist/components/Searchbar/AutocompleteItem.d.ts +23 -11
  75. package/dist/components/Searchbar/AutocompleteItem.js +21 -8
  76. package/dist/components/Searchbar/ScopeListItem.d.ts +12 -0
  77. package/dist/components/Searchbar/ScopeListItem.js +12 -0
  78. package/dist/components/Toolbar/ToolbarButton.js +2 -1
  79. package/dist/components/index.js +153 -149
  80. package/dist/hooks/useMenu.js +19 -19
  81. package/dist/index.js +163 -159
  82. package/package.json +1 -1
  83. package/dist/assets/DialogListItemBase.css +0 -1
  84. package/dist/assets/ListItemAction.css +0 -1
  85. package/dist/assets/metaItem.css +0 -1
  86. package/dist/components/Dialog/DialogListItemBase.d.ts +0 -28
  87. package/dist/components/Dialog/DialogListItemBase.js +0 -24
  88. package/dist/components/Dialog/DialogTitle.stories.js +0 -26
  89. package/dist/components/List/ListItemAction.js +0 -19
  90. package/dist/components/List/ListItemAction.stories.js +0 -45
  91. package/dist/metaItem.module-CfNiX769.js +0 -8
  92. /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
- import { DialogListItemSize, DialogListItemVariant } from './DialogListItemBase';
7
- import { DialogSeenByProps } from './DialogSeenBy';
8
- export type DialogListItemProps = {
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: ({ as, size, variant, href, onClick, select, selected, status, sender, recipient, grouped, updatedAt, updatedAtLabel, dueAt, dueAtLabel, seen, seenBy, touchedBy, attachmentsCount, title, summary, }: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
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 o, jsxs as a } from "react/jsx-runtime";
2
- import { DialogHeadings as k } from "./DialogHeadings.js";
3
- import { DialogTitle as j } from "./DialogTitle.js";
4
- import { DialogTouchedBy as I } from "./DialogTouchedBy.js";
5
- import { DialogListItemBase as L } from "./DialogListItemBase.js";
6
- import { DialogBorder as T } from "./DialogBorder.js";
7
- import { DialogMetadata as H } from "./DialogMetadata.js";
8
- import '../../assets/DialogListItem.css';const M = "_border_6r71i_1", q = "_header_6r71i_10", w = "_summary_6r71i_16", z = "_footer_6r71i_30", A = "_touchedBy_6r71i_34", C = "_link_6r71i_58", e = {
9
- border: M,
10
- header: q,
11
- summary: w,
12
- footer: z,
13
- touchedBy: A,
14
- link: C
15
- }, Q = ({
16
- as: m = "a",
17
- size: r = "lg",
18
- variant: t = "neutral",
19
- href: l,
20
- onClick: d,
21
- select: c,
22
- selected: n,
23
- status: _,
24
- sender: h,
25
- recipient: f,
26
- grouped: u,
27
- updatedAt: g,
28
- updatedAtLabel: p,
29
- dueAt: y,
30
- dueAtLabel: D,
31
- seen: s = !1,
32
- seenBy: B,
33
- touchedBy: i,
34
- attachmentsCount: x,
35
- title: N,
36
- summary: b
37
- }) => /* @__PURE__ */ o(
38
- L,
39
- {
40
- as: m,
41
- size: r,
42
- href: l,
43
- select: c,
44
- selected: n,
45
- variant: t,
46
- onClick: d,
47
- children: /* @__PURE__ */ a(T, { className: e.border, size: r, seen: s, children: [
48
- /* @__PURE__ */ a("header", { "data-size": r, className: e.header, children: [
49
- /* @__PURE__ */ o(j, { size: r, seen: s, variant: t, children: N }),
50
- /* @__PURE__ */ o(k, { size: "xs", grouped: u, sender: h, recipient: f })
51
- ] }),
52
- /* @__PURE__ */ o("p", { "data-size": r, className: e.summary, children: b }),
53
- /* @__PURE__ */ a("footer", { "data-size": r, className: e.footer, children: [
54
- /* @__PURE__ */ o(
55
- H,
56
- {
57
- status: _,
58
- updatedAt: g,
59
- updatedAtLabel: p,
60
- dueAt: y,
61
- dueAtLabel: D,
62
- seenBy: B,
63
- attachmentsCount: x
64
- }
65
- ),
66
- i && /* @__PURE__ */ o(I, { size: "xs", touchedBy: i, className: e.touchedBy })
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
- Q as DialogListItem
88
+ to as DialogListItem
73
89
  };
@@ -1,10 +1,11 @@
1
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { Fragment as u, useState as y } from "react";
3
- import { DialogListItem as r } from "./DialogListItem.js";
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 i } from "../Meta/MetaItem.js";
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
- }, d = ["lg", "md", "sm", "xs"];
26
- var p;
27
- const o = (p = Object.keys(g)) == null ? void 0 : p.map((t) => ({
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
- })), I = {
31
+ })), j = {
31
32
  title: "Dialog/DialogListItem",
32
- component: r,
33
+ component: n,
33
34
  tags: ["autodocs"],
34
- parameters: {
35
- theme: "company"
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
- }, O = (t) => /* @__PURE__ */ e(s, { children: o == null ? void 0 : o.map((a) => /* @__PURE__ */ l(u, { children: [
54
- /* @__PURE__ */ e(r, { ...t, status: a }),
55
- /* @__PURE__ */ e(i, { children: a == null ? void 0 : a.value })
56
- ] }, a == null ? void 0 : a.value)) }), j = (t) => /* @__PURE__ */ l(s, { children: [
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
- r,
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(i, { children: "Dialog requires action wihtin a spesific due date." })
67
- ] }), x = (t) => /* @__PURE__ */ l(s, { children: [
68
- /* @__PURE__ */ e(r, { ...t, attachmentsCount: 2 }),
69
- /* @__PURE__ */ e(i, { children: "Dialog has attachments." })
70
- ] }), K = (t) => /* @__PURE__ */ l(s, { children: [
71
- /* @__PURE__ */ e(r, { ...t, seen: !0, seenBy: { seenByEndUser: !0, label: "Sett av deg" } }),
72
- /* @__PURE__ */ e(i, { children: "Seen by end user. Dialog is marked as seen." }),
73
- /* @__PURE__ */ e(r, { ...t, seenBy: { seenByOthersCount: 4, label: "Sett av 4" } }),
74
- /* @__PURE__ */ e(i, { children: "Seen by others. Dialog is not marked as seen." }),
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
- r,
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(i, { children: "Seen by end user and others. Dialog is marked as seen." })
84
- ] }), q = (t) => /* @__PURE__ */ l(s, { children: [
85
- /* @__PURE__ */ e(r, { ...t, touchedBy: [{ name: "Kari Nordmann" }] }),
86
- /* @__PURE__ */ e(i, { children: "Dialog has been touched by a single actor." }),
87
- /* @__PURE__ */ e(r, { ...t, touchedBy: [{ name: "Kari Nordmann" }, { name: "Ola Nordmann" }] }),
88
- /* @__PURE__ */ e(i, { children: "Dialog has been touched by two actors." }),
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
- r,
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(i, { children: "Dialog has been touched by a multiple actors." })
97
- ] }), E = (t) => /* @__PURE__ */ l(s, { children: [
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
- r,
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(i, { children: "Long title" }),
153
+ /* @__PURE__ */ e(r, { children: "Long title" }),
106
154
  /* @__PURE__ */ e(
107
- r,
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(i, { children: "Long summary" })
161
+ /* @__PURE__ */ e(r, { children: "Long summary" })
114
162
  ] }), M = (t) => {
115
163
  var h;
116
- const [a, b] = y({
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: n }) => {
133
- b((c) => ({
134
- ...c,
135
- [n]: {
136
- ...c[n],
137
- selected: !c[n].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(a)) == null ? void 0 : h.map((n) => /* @__PURE__ */ l(u, { children: [
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
- r,
191
+ n,
144
192
  {
145
193
  ...t,
146
- title: n.title,
147
- onClick: n.selected ? () => m(n) : null,
148
- selected: n.selected,
149
- select: { checked: n == null ? void 0 : n.selected, onChange: () => m(n) }
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__ */ l(i, { children: [
200
+ /* @__PURE__ */ i(r, { children: [
153
201
  "selected:",
154
- n.selected ? "true" : "false"
202
+ a.selected ? "true" : "false"
155
203
  ] })
156
- ] }, n == null ? void 0 : n.id)) });
157
- }, T = (t) => /* @__PURE__ */ e(s, { children: d == null ? void 0 : d.map((a) => /* @__PURE__ */ l(u, { children: [
158
- /* @__PURE__ */ e(r, { ...t, size: a }),
159
- /* @__PURE__ */ e(i, { children: a })
160
- ] }, a)) });
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
- x as Attachments,
163
- j as DueAt,
164
- K as SeenBy,
210
+ q as Attachments,
211
+ I as DueAt,
212
+ T as SeenBy,
165
213
  M as Selectable,
166
- T as Sizes,
167
- O as Statuses,
168
- E as TextLength,
169
- q as TouchedBy,
170
- I as default
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 c, jsx as i } from "react/jsx-runtime";
2
- import { MetaBase as x } from "../Meta/MetaBase.js";
3
- import { MetaItem as l } from "../Meta/MetaItem.js";
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 p } from "../Meta/MetaTimestamp.js";
7
- import { DialogSeenBy as f } from "./DialogSeenBy.js";
8
- import { DialogStatus as n } from "./DialogStatus.js";
9
- const k = ({
10
- status: r,
11
- updatedAt: o,
12
- updatedAtLabel: a,
13
- dueAt: e,
14
- dueAtLabel: m,
15
- seenBy: s,
16
- attachmentsCount: t = 0
17
- }) => /* @__PURE__ */ c(x, { size: "xs", children: [
18
- r && /* @__PURE__ */ i(n, { size: "xs", ...r }),
19
- o && /* @__PURE__ */ i(p, { datetime: o, size: "xs", children: a }),
20
- e && m && /* @__PURE__ */ i(p, { datetime: e, size: "xs", icon: "clock-dashed", children: m }),
21
- s && /* @__PURE__ */ i(f, { size: "xs", ...s }),
22
- t > 0 && /* @__PURE__ */ i(l, { size: "xs", icon: "paperclip", children: t })
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
- k as DialogMetadata
29
+ q as DialogMetadata
26
30
  };
@@ -1,32 +1,32 @@
1
1
  "use client";
2
- import { jsxs as t, jsx as o } from "react/jsx-runtime";
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 v } from "./DialogStatus.js";
9
- import { DialogTouchedBy as d } from "./DialogTouchedBy.js";
10
- import '../../assets/DialogNav.css';const f = "_nav_678a5_1", x = "_action_678a5_8", m = {
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: r = {
14
+ backButton: i = {
15
15
  as: "a",
16
16
  label: "Back"
17
17
  },
18
- status: i,
19
- dueAt: a,
18
+ status: a,
19
+ dueAt: r,
20
20
  dueAtLabel: e,
21
- touchedBy: s,
22
- menu: n
23
- }) => /* @__PURE__ */ t("nav", { className: m.nav, children: [
24
- /* @__PURE__ */ o(c, { ...r, variant: "text", color: "secondary", icon: "arrow-left", reverse: !0, children: (r == null ? void 0 : r.label) || "Back" }),
25
- /* @__PURE__ */ t("div", { className: m.action, children: [
26
- a && e && /* @__PURE__ */ o(p, { datetime: a, icon: "clock-dashed", size: "xs", children: e }),
27
- i && /* @__PURE__ */ o(v, { ...i }),
28
- s && /* @__PURE__ */ o(d, { touchedBy: s }),
29
- n && /* @__PURE__ */ o(l, { ...n, size: "md" })
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 { IconName } from '../Icon';
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?: DialogTitleSize;
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, icon, children }: DialogTitleProps) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const DialogTitle: ({ size, seen, variant, label, children }: DialogTitleProps) => import("react/jsx-runtime").JSX.Element;