@altinn/altinn-components 0.7.2 → 0.7.3

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.
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { DialogListItemSize } from './DialogListItem';
3
- export interface DialogSummaryProps {
3
+ export interface DialogDescriptionProps {
4
4
  size: DialogListItemSize;
5
5
  className?: string;
6
6
  loading?: boolean;
@@ -9,4 +9,4 @@ export interface DialogSummaryProps {
9
9
  /**
10
10
  * Dialog summary
11
11
  */
12
- export declare const DialogSummary: ({ size, loading, children }: DialogSummaryProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const DialogDescription: ({ size, loading, children }: DialogDescriptionProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { Skeleton as t } from "../Skeleton/Skeleton.js";
3
+ import '../../assets/DialogDescription.css';const a = "_summary_1sruo_1", e = {
4
+ summary: a
5
+ }, c = ({ size: r = "lg", loading: m, children: o }) => /* @__PURE__ */ s("p", { "data-size": r, className: e.summary, children: /* @__PURE__ */ s(t, { loading: m, children: o }) });
6
+ export {
7
+ c as DialogDescription
8
+ };
@@ -10,6 +10,8 @@ export type DialogListItemVariant = 'neutral' | 'draft' | 'trashed' | 'archived'
10
10
  export interface DialogListItemProps extends ListItemBaseProps {
11
11
  /** Dialog title */
12
12
  title: string;
13
+ /** Dialog description */
14
+ description?: string;
13
15
  /** Dialog is loading */
14
16
  loading?: boolean;
15
17
  /** Render as */
@@ -32,8 +34,6 @@ export interface DialogListItemProps extends ListItemBaseProps {
32
34
  recipient?: DialogRecipientProps;
33
35
  /** Group view, show avatar for recipient */
34
36
  grouped?: boolean;
35
- /** Dialog summary */
36
- summary?: string;
37
37
  /** Updated datetime */
38
38
  updatedAt?: string;
39
39
  /** Updated at label */
@@ -70,4 +70,4 @@ export interface DialogListItemProps extends ListItemBaseProps {
70
70
  * summary, sender, and receiver.
71
71
  * to mark the item as checked/unchecked and can visually indicate if it is unread.
72
72
  */
73
- export declare const DialogListItem: ({ size, variant, loading, 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;
73
+ export declare const DialogListItem: ({ size, variant, loading, select, status, sender, recipient, grouped, updatedAt, updatedAtLabel, archivedAt, archivedAtLabel, trashedAt, trashedAtLabel, label, dueAt, dueAtLabel, seen, seenBy, touchedBy, attachmentsCount, title, description, ...rest }: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,18 +1,18 @@
1
1
  import { jsx as t, jsxs as e } from "react/jsx-runtime";
2
- import { ListItemBase as h } from "../List/ListItemBase.js";
2
+ import { ListItemBase as n } from "../List/ListItemBase.js";
3
3
  import "../../index-L8X2o7IH.js";
4
4
  import "react";
5
5
  import "../Icon/SvgIcon.js";
6
- import { ListItemLabel as M } from "../List/ListItemLabel.js";
7
- import { DialogBorder as d } from "./DialogBorder.js";
8
- import { DialogMetadata as D } from "./DialogMetadata.js";
6
+ import { ListItemLabel as S } from "../List/ListItemLabel.js";
7
+ import { DialogBorder as D } from "./DialogBorder.js";
8
+ import { DialogMetadata as u } from "./DialogMetadata.js";
9
9
  import { DialogHeaderBase as V } from "./DialogHeaderBase.js";
10
10
  import { DialogHeadings as k } from "./DialogHeadings.js";
11
11
  import { DialogTitle as q } from "./DialogTitle.js";
12
12
  import { DialogTouchedBy as w } from "./DialogTouchedBy.js";
13
13
  import { DialogSelect as C } from "./DialogSelect.js";
14
14
  import "../RootProvider/RootProvider.js";
15
- import { DialogSummary as E } from "./DialogSummary.js";
15
+ import { DialogDescription as E } from "./DialogDescription.js";
16
16
  import '../../assets/DialogListItem.css';const F = "_item_v64fv_1", G = "_select_v64fv_16", J = "_summary_v64fv_23", K = "_footer_v64fv_44", O = "_touchedBy_v64fv_52", P = "_border_v64fv_61", m = {
17
17
  item: F,
18
18
  select: G,
@@ -22,10 +22,10 @@ import '../../assets/DialogListItem.css';const F = "_item_v64fv_1", G = "_select
22
22
  border: P
23
23
  }, cr = ({
24
24
  size: r = "lg",
25
- variant: u = "neutral",
25
+ variant: y = "neutral",
26
26
  loading: o,
27
27
  select: s,
28
- status: y,
28
+ status: d,
29
29
  sender: B,
30
30
  recipient: N,
31
31
  grouped: b,
@@ -39,37 +39,37 @@ import '../../assets/DialogListItem.css';const F = "_item_v64fv_1", G = "_select
39
39
  dueAt: j,
40
40
  dueAtLabel: H,
41
41
  seen: c = !1,
42
- seenBy: S,
42
+ seenBy: T,
43
43
  touchedBy: _,
44
- attachmentsCount: T,
44
+ attachmentsCount: g,
45
45
  title: p,
46
- summary: n,
47
- ...v
46
+ description: v,
47
+ ...h
48
48
  }) => {
49
- const g = f ? "trashed" : l ? "archived" : u;
50
- return r === "xs" || r === "sm" ? /* @__PURE__ */ t(h, { ...v, loading: o, size: r, className: m.item, children: /* @__PURE__ */ e(d, { className: m.border, size: r, seen: c, loading: o, children: [
51
- /* @__PURE__ */ t(M, { loading: o, size: r, title: p, description: n }),
52
- /* @__PURE__ */ t(D, { loading: o, updatedAt: a, updatedAtLabel: i })
49
+ const M = f ? "trashed" : l ? "archived" : y;
50
+ return r === "xs" || r === "sm" ? /* @__PURE__ */ t(n, { ...h, loading: o, size: r, className: m.item, children: /* @__PURE__ */ e(D, { className: m.border, size: r, seen: c, loading: o, children: [
51
+ /* @__PURE__ */ t(S, { loading: o, size: r, title: p, description: v }),
52
+ /* @__PURE__ */ t(u, { loading: o, updatedAt: a, updatedAtLabel: i })
53
53
  ] }) }) : /* @__PURE__ */ t(
54
- h,
54
+ n,
55
55
  {
56
- ...v,
56
+ ...h,
57
57
  loading: o,
58
58
  size: r,
59
59
  className: m.item,
60
60
  controls: s && /* @__PURE__ */ t(C, { className: m.select, ...s }),
61
- children: /* @__PURE__ */ e(d, { className: m.border, size: r, seen: c, loading: o, children: [
61
+ children: /* @__PURE__ */ e(D, { className: m.border, size: r, seen: c, loading: o, children: [
62
62
  /* @__PURE__ */ e(V, { size: r, children: [
63
- /* @__PURE__ */ t(q, { loading: o, size: r, variant: g, label: L, seen: c, children: p }),
63
+ /* @__PURE__ */ t(q, { loading: o, size: r, variant: M, label: L, seen: c, children: p }),
64
64
  /* @__PURE__ */ t(k, { loading: o, size: r, grouped: b, sender: B, recipient: N })
65
65
  ] }),
66
- /* @__PURE__ */ t(E, { loading: o, size: r, children: n }),
66
+ /* @__PURE__ */ t(E, { loading: o, size: r, children: v }),
67
67
  /* @__PURE__ */ e("footer", { "data-size": r, className: m.footer, children: [
68
68
  /* @__PURE__ */ t(
69
- D,
69
+ u,
70
70
  {
71
71
  loading: o,
72
- status: y,
72
+ status: d,
73
73
  updatedAt: a,
74
74
  updatedAtLabel: i,
75
75
  archivedAt: l,
@@ -78,8 +78,8 @@ import '../../assets/DialogListItem.css';const F = "_item_v64fv_1", G = "_select
78
78
  trashedAtLabel: I,
79
79
  dueAt: j,
80
80
  dueAtLabel: H,
81
- seenBy: S,
82
- attachmentsCount: T
81
+ seenBy: T,
82
+ attachmentsCount: g
83
83
  }
84
84
  ),
85
85
  _ && /* @__PURE__ */ t(w, { loading: o, size: "xs", touchedBy: _, className: m.touchedBy })
@@ -32,4 +32,4 @@ export interface ListItemProps extends ListItemBaseProps {
32
32
  /** Child items */
33
33
  items?: ListItemProps[];
34
34
  }
35
- export declare const ListItem: ({ as, color, loading, size, icon, avatar, avatarGroup, title, description, children, collapsible, expanded, badge, linkText, linkIcon, menu, select, controls, ...rest }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
35
+ export declare const ListItem: ({ as, color, loading, size, icon, avatar, avatarGroup, title, description, collapsible, expanded, badge, linkText, linkIcon, menu, select, controls, children, ...rest }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -13,15 +13,15 @@ const D = ({
13
13
  avatarGroup: p,
14
14
  title: s,
15
15
  description: I,
16
- children: L,
17
16
  collapsible: m,
18
- expanded: a,
19
- badge: f,
20
- linkText: l,
21
- linkIcon: h,
22
- menu: k,
23
- select: b,
24
- controls: d,
17
+ expanded: L,
18
+ badge: a,
19
+ linkText: f,
20
+ linkIcon: l,
21
+ menu: h,
22
+ select: k,
23
+ controls: b,
24
+ children: d,
25
25
  ...u
26
26
  }) => /* @__PURE__ */ t(
27
27
  v,
@@ -30,10 +30,10 @@ const D = ({
30
30
  size: r,
31
31
  color: n,
32
32
  loading: o,
33
- select: b,
34
- controls: d || /* @__PURE__ */ t(x, { linkIcon: m && a ? "chevron-up" : m ? "chevron-down" : h, linkText: l, menu: k, badge: f }),
33
+ select: k,
34
+ controls: b || /* @__PURE__ */ t(x, { linkIcon: m && L ? "chevron-up" : m ? "chevron-down" : l, linkText: f, menu: h, badge: a }),
35
35
  ...u,
36
- children: /* @__PURE__ */ t(j, { loading: o, size: r, icon: i, avatar: c, avatarGroup: p, children: /* @__PURE__ */ t(w, { loading: o, title: s, description: I, size: r, children: L }) })
36
+ children: /* @__PURE__ */ t(j, { loading: o, size: r, icon: i, avatar: c, avatarGroup: p, children: /* @__PURE__ */ t(w, { loading: o, title: s, description: I, size: r, children: d }) })
37
37
  }
38
38
  );
39
39
  export {
@@ -5,5 +5,6 @@ export interface AutocompleteProps {
5
5
  groups?: Record<string, AutocompleteGroupProps>;
6
6
  expanded?: boolean;
7
7
  className?: string;
8
+ onSelect?: () => void;
8
9
  }
9
10
  export declare const Autocomplete: ({ className, items, groups, expanded }: AutocompleteProps) => import("react/jsx-runtime").JSX.Element;
@@ -31,7 +31,10 @@ const o = {
31
31
  id: "1a",
32
32
  type: "scope",
33
33
  href: "#",
34
- label: "Skriv minst 3 tegn for søke i innboks"
34
+ label: () => /* @__PURE__ */ e("span", { children: [
35
+ /* @__PURE__ */ t("mark", { children: "sk" }),
36
+ " i innboks"
37
+ ] })
35
38
  },
36
39
  {
37
40
  id: "1b",
@@ -44,11 +47,11 @@ const o = {
44
47
  }
45
48
  ]
46
49
  }
47
- }, a = {
50
+ }, r = {
48
51
  args: {
49
52
  groups: {
50
53
  3: {
51
- title: "Mest relevante treff"
54
+ title: "Anbefalte treff"
52
55
  }
53
56
  },
54
57
  items: [
@@ -58,7 +61,7 @@ const o = {
58
61
  type: "scope",
59
62
  href: "#",
60
63
  badge: {
61
- label: "2 treff"
64
+ label: "24 treff"
62
65
  },
63
66
  label: () => /* @__PURE__ */ e("span", { children: [
64
67
  /* @__PURE__ */ t("mark", { children: "skatt" }),
@@ -81,7 +84,7 @@ const o = {
81
84
  type: "dialog",
82
85
  href: "#",
83
86
  title: "Skattemeldingen 2023",
84
- summary: "Skattemeldingen er klar for innsending."
87
+ description: "Skattemeldingen er klar for innsending."
85
88
  },
86
89
  {
87
90
  id: "2b",
@@ -89,15 +92,82 @@ const o = {
89
92
  type: "dialog",
90
93
  href: "#",
91
94
  title: "Skatteoppgjør 2022",
92
- summary: "Skatteoppgjøret ditt er klart."
95
+ description: "Skatteoppgjøret ditt er klart."
96
+ },
97
+ {
98
+ id: "2c",
99
+ groupId: "3",
100
+ type: "dialog",
101
+ href: "#",
102
+ title: "Skatteoppgjør 2020",
103
+ description: "Skatteoppgjøret ditt er ferdigstilt."
93
104
  }
94
105
  ]
95
106
  }
96
- }, r = {
107
+ }, g = {
97
108
  args: {
98
- ...a.args,
109
+ groups: {
110
+ 3: {
111
+ title: "Søker etter «skatt» ..."
112
+ }
113
+ },
114
+ items: r.args.items.map((a) => a.groupId === "3" ? {
115
+ ...a,
116
+ type: null,
117
+ icon: "inbox",
118
+ loading: !0
119
+ } : a)
120
+ }
121
+ }, k = {
122
+ args: {
123
+ ...r.args,
124
+ groups: {
125
+ noHits: {
126
+ title: "Ingen treff"
127
+ }
128
+ },
99
129
  items: [
100
- ...a.args.items,
130
+ {
131
+ id: "1a",
132
+ groupId: "1",
133
+ type: "scope",
134
+ href: "#",
135
+ disabled: !0,
136
+ badge: {
137
+ label: "Ingen treff"
138
+ },
139
+ label: () => /* @__PURE__ */ e("span", { children: [
140
+ /* @__PURE__ */ t("mark", { children: "skatt" }),
141
+ " i innboks"
142
+ ] })
143
+ },
144
+ {
145
+ id: "1b",
146
+ groupId: "1",
147
+ type: "scope",
148
+ href: "#",
149
+ label: () => /* @__PURE__ */ e("span", { children: [
150
+ /* @__PURE__ */ t("mark", { children: "skatt" }),
151
+ " i hele Altinn"
152
+ ] })
153
+ },
154
+ {
155
+ groupId: "noHits",
156
+ id: "2a",
157
+ type: "information",
158
+ label: () => /* @__PURE__ */ e("span", { children: [
159
+ "Søk etter ",
160
+ /* @__PURE__ */ t("mark", { children: "skatt" }),
161
+ " ga ingen treff."
162
+ ] })
163
+ }
164
+ ]
165
+ }
166
+ }, i = {
167
+ args: {
168
+ ...r.args,
169
+ items: [
170
+ ...r.args.items,
101
171
  {
102
172
  id: "2c",
103
173
  groupId: "4",
@@ -116,7 +186,7 @@ const o = {
116
186
  }
117
187
  ]
118
188
  }
119
- }, i = {
189
+ }, c = {
120
190
  args: {
121
191
  groups: {
122
192
  2: {
@@ -188,9 +258,9 @@ const o = {
188
258
  }
189
259
  ]
190
260
  }
191
- }, g = {
261
+ }, f = {
192
262
  args: {
193
- ...r.args,
263
+ ...i.args,
194
264
  groups: {
195
265
  2: {
196
266
  title: "Søkeforslag"
@@ -200,7 +270,7 @@ const o = {
200
270
  }
201
271
  },
202
272
  items: [
203
- ...r.args.items,
273
+ ...i.args.items,
204
274
  {
205
275
  id: "2a",
206
276
  groupId: "2",
@@ -242,59 +312,15 @@ const o = {
242
312
  }
243
313
  ]
244
314
  }
245
- }, k = {
246
- args: {
247
- ...i.args,
248
- groups: {
249
- noHits: {
250
- title: "Ingen treff"
251
- }
252
- },
253
- items: [
254
- {
255
- id: "1a",
256
- groupId: "1",
257
- type: "scope",
258
- href: "#",
259
- disabled: !0,
260
- badge: {
261
- label: "Ingen treff"
262
- },
263
- label: () => /* @__PURE__ */ e("span", { children: [
264
- /* @__PURE__ */ t("mark", { children: "skatt" }),
265
- " i innboks"
266
- ] })
267
- },
268
- {
269
- id: "1b",
270
- groupId: "1",
271
- type: "scope",
272
- href: "#",
273
- label: () => /* @__PURE__ */ e("span", { children: [
274
- /* @__PURE__ */ t("mark", { children: "skatt" }),
275
- " i hele Altinn"
276
- ] })
277
- },
278
- {
279
- groupId: "noHits",
280
- id: "2a",
281
- type: "information",
282
- label: () => /* @__PURE__ */ e("span", { children: [
283
- "Søk etter ",
284
- /* @__PURE__ */ t("mark", { children: "skatt" }),
285
- " ga ingen treff."
286
- ] })
287
- }
288
- ]
289
- }
290
315
  };
291
316
  export {
317
+ g as LoadingResults,
292
318
  k as NoHits,
293
319
  p as Scopes,
294
- r as ScopesAndMixedResults,
295
- a as ScopesAndResults,
296
- i as ScopesAndSuggestions,
297
- g as ScopesResultsAndSuggestions,
320
+ i as ScopesAndMixedResults,
321
+ r as ScopesAndResults,
322
+ c as ScopesAndSuggestions,
323
+ f as ScopesResultsAndSuggestions,
298
324
  d as TooFewWords,
299
325
  o as default
300
326
  };
@@ -1,24 +1,24 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as e } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../index-L8X2o7IH.js";
4
4
  import "../Icon/SvgIcon.js";
5
5
  import "../RootProvider/RootProvider.js";
6
6
  import { DialogListItem as r } from "../Dialog/DialogListItem.js";
7
- import { ListItem as n } from "../List/ListItem.js";
8
- import { BookmarksListItem as i } from "../Bookmarks/BookmarksListItem.js";
9
- import { ScopeListItem as e } from "./ScopeListItem.js";
7
+ import { ListItem as o } from "../List/ListItem.js";
8
+ import { BookmarksListItem as n } from "../Bookmarks/BookmarksListItem.js";
9
+ import { ScopeListItem as i } from "./ScopeListItem.js";
10
10
  const h = ({ type: m, ...t }) => {
11
11
  switch (m) {
12
12
  case "scope":
13
- return /* @__PURE__ */ o(e, { ...t, shadow: "none", tabIndex: -1 });
14
- case "information":
15
- return /* @__PURE__ */ o(e, { ...t, shadow: "none", tabIndex: -1 });
13
+ return /* @__PURE__ */ e(i, { ...t, shadow: "none", tabIndex: -1 });
16
14
  case "bookmark":
17
- return /* @__PURE__ */ o(i, { ...t, shadow: "none", size: "sm", tabIndex: -1 });
15
+ return /* @__PURE__ */ e(n, { ...t, shadow: "none", size: "sm", tabIndex: -1 });
18
16
  case "dialog":
19
- return /* @__PURE__ */ o(r, { ...t, shadow: "none", size: "sm", tabIndex: -1 });
17
+ return /* @__PURE__ */ e(r, { ...t, shadow: "none", size: "sm", tabIndex: -1 });
18
+ case "information":
19
+ return /* @__PURE__ */ e(o, { ...t, shadow: "none", tabIndex: -1, disabled: !0 });
20
20
  default:
21
- return /* @__PURE__ */ o(n, { ...t, shadow: "none", size: "sm", tabIndex: -1 });
21
+ return /* @__PURE__ */ e(o, { ...t, shadow: "none", size: "sm", tabIndex: -1 });
22
22
  }
23
23
  };
24
24
  export {
@@ -6,4 +6,4 @@ export interface SearchbarProps extends SearchFieldProps {
6
6
  expanded: boolean;
7
7
  tabIndex?: number;
8
8
  }
9
- export declare const Searchbar: ({ className, autocomplete, expanded, onClose, tabIndex, ...search }: SearchbarProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const Searchbar: ({ className, autocomplete, expanded, onClose, onEnter, tabIndex, ...search }: SearchbarProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,18 +1,19 @@
1
- import { jsxs as e, jsx as m } from "react/jsx-runtime";
2
- import { Autocomplete as f } from "./Autocomplete.js";
3
- import { SearchField as a } from "./SearchField.js";
4
- import { SearchbarBase as h } from "./SearchbarBase.js";
5
- const j = ({
1
+ import { jsxs as f, jsx as m } from "react/jsx-runtime";
2
+ import { Autocomplete as a } from "./Autocomplete.js";
3
+ import { SearchField as h } from "./SearchField.js";
4
+ import { SearchbarBase as l } from "./SearchbarBase.js";
5
+ const n = ({
6
6
  className: t,
7
7
  autocomplete: r,
8
8
  expanded: o = !1,
9
9
  onClose: i,
10
- tabIndex: s,
11
- ...c
12
- }) => /* @__PURE__ */ e(h, { className: t, expanded: o, autocomplete: !!r, children: [
13
- /* @__PURE__ */ m(a, { ...c, expanded: o, onClose: i, tabIndex: s }),
14
- r && /* @__PURE__ */ m(f, { ...r, expanded: o })
10
+ onEnter: s,
11
+ tabIndex: c,
12
+ ...e
13
+ }) => /* @__PURE__ */ f(l, { className: t, expanded: o, autocomplete: !!r, children: [
14
+ /* @__PURE__ */ m(h, { ...e, expanded: o, onClose: i, onEnter: s, tabIndex: c }),
15
+ r && /* @__PURE__ */ m(a, { ...r, expanded: o })
15
16
  ] });
16
17
  export {
17
- j as Searchbar
18
+ n as Searchbar
18
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -1,8 +0,0 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { Skeleton as a } from "../Skeleton/Skeleton.js";
3
- import '../../assets/DialogSummary.css';const t = "_summary_1sruo_1", e = {
4
- summary: t
5
- }, n = ({ size: r = "lg", loading: s, children: o }) => /* @__PURE__ */ m("p", { "data-size": r, className: e.summary, children: /* @__PURE__ */ m(a, { loading: s, children: o }) });
6
- export {
7
- n as DialogSummary
8
- };