@altinn/altinn-components 0.42.0 → 0.42.2
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.
|
@@ -5,14 +5,14 @@ import "react";
|
|
|
5
5
|
import { useRootContext as H } from "../RootProvider/RootProvider.js";
|
|
6
6
|
import { DropdownBase as S } from "../Dropdown/DropdownBase.js";
|
|
7
7
|
import { DrawerBase as k } from "../Dropdown/DrawerBase.js";
|
|
8
|
-
import { GlobalMenu as
|
|
8
|
+
import { GlobalMenu as f } from "../GlobalMenu/GlobalMenu.js";
|
|
9
9
|
import { GlobalMenuButton as B } from "../GlobalMenu/GlobalMenuButton.js";
|
|
10
10
|
import { HeaderBase as D } from "./HeaderBase.js";
|
|
11
11
|
import { HeaderLogo as I } from "./HeaderLogo.js";
|
|
12
12
|
import { HeaderGroup as N } from "./HeaderGroup.js";
|
|
13
|
-
import { HeaderSearch as
|
|
13
|
+
import { HeaderSearch as w } from "./HeaderSearch.js";
|
|
14
14
|
import { LocaleSwitcher as F } from "./LocaleSwitcher.js";
|
|
15
|
-
import { Searchbar as
|
|
15
|
+
import { Searchbar as x } from "../Searchbar/Searchbar.js";
|
|
16
16
|
import "../Snackbar/useSnackbar.js";
|
|
17
17
|
import { useIsDesktop as G } from "../../hooks/useIsDesktop.js";
|
|
18
18
|
import '../../assets/Header.css';const L = "_drawer_afyu3_1", j = "_dropdown_afyu3_6", z = "_relative_afyu3_19", t = {
|
|
@@ -21,21 +21,21 @@ import '../../assets/Header.css';const L = "_drawer_afyu3_1", j = "_dropdown_afy
|
|
|
21
21
|
relative: z
|
|
22
22
|
}, A = ({
|
|
23
23
|
globalMenu: e,
|
|
24
|
-
desktopMenu:
|
|
25
|
-
mobileMenu:
|
|
24
|
+
desktopMenu: _,
|
|
25
|
+
mobileMenu: C,
|
|
26
26
|
locale: p,
|
|
27
27
|
search: s,
|
|
28
28
|
currentAccount: m,
|
|
29
|
-
logo:
|
|
30
|
-
badge:
|
|
29
|
+
logo: u = {},
|
|
30
|
+
badge: l
|
|
31
31
|
}) => {
|
|
32
|
-
const { currentId: r, toggleId:
|
|
32
|
+
const { currentId: r, toggleId: i, openId: v, closeAll: d } = H(), c = () => {
|
|
33
33
|
v("search");
|
|
34
|
-
},
|
|
35
|
-
|
|
34
|
+
}, a = () => {
|
|
35
|
+
i("search");
|
|
36
36
|
}, y = () => {
|
|
37
|
-
|
|
38
|
-
},
|
|
37
|
+
i("menu");
|
|
38
|
+
}, h = G();
|
|
39
39
|
return /* @__PURE__ */ n(
|
|
40
40
|
D,
|
|
41
41
|
{
|
|
@@ -43,15 +43,14 @@ import '../../assets/Header.css';const L = "_drawer_afyu3_1", j = "_dropdown_afy
|
|
|
43
43
|
open: r === "search" || r === "menu" || r === "locale",
|
|
44
44
|
onClose: d,
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */ o(I, { ...
|
|
47
|
-
s &&
|
|
46
|
+
/* @__PURE__ */ o(I, { ...u, badge: l, className: t.logo }),
|
|
47
|
+
s && h && /* @__PURE__ */ o(w, { expanded: r === "search", children: /* @__PURE__ */ o(x, { ...s, expanded: r === "search", onClose: a, onFocus: c }) }),
|
|
48
48
|
/* @__PURE__ */ n(N, { children: [
|
|
49
49
|
p && /* @__PURE__ */ o(F, { ...p }),
|
|
50
50
|
/* @__PURE__ */ n("div", { className: t.relative, children: [
|
|
51
51
|
/* @__PURE__ */ o(
|
|
52
52
|
B,
|
|
53
53
|
{
|
|
54
|
-
badge: i,
|
|
55
54
|
currentAccount: m,
|
|
56
55
|
onClick: y,
|
|
57
56
|
expanded: r === "menu",
|
|
@@ -68,10 +67,10 @@ import '../../assets/Header.css';const L = "_drawer_afyu3_1", j = "_dropdown_afy
|
|
|
68
67
|
open: r === "menu",
|
|
69
68
|
className: t.dropdown,
|
|
70
69
|
children: /* @__PURE__ */ o(
|
|
71
|
-
|
|
70
|
+
f,
|
|
72
71
|
{
|
|
73
72
|
...e,
|
|
74
|
-
menu:
|
|
73
|
+
menu: _ || (e == null ? void 0 : e.menu),
|
|
75
74
|
currentAccount: m,
|
|
76
75
|
onClose: d
|
|
77
76
|
}
|
|
@@ -80,12 +79,12 @@ import '../../assets/Header.css';const L = "_drawer_afyu3_1", j = "_dropdown_afy
|
|
|
80
79
|
)
|
|
81
80
|
] })
|
|
82
81
|
] }),
|
|
83
|
-
s && !
|
|
82
|
+
s && !h && /* @__PURE__ */ o(w, { expanded: r === "search", children: /* @__PURE__ */ o(x, { ...s, expanded: r === "search", onClose: a, onFocus: c }) }),
|
|
84
83
|
e && /* @__PURE__ */ o(k, { open: r === "menu", className: t.drawer, children: /* @__PURE__ */ o(
|
|
85
|
-
|
|
84
|
+
f,
|
|
86
85
|
{
|
|
87
86
|
...e,
|
|
88
|
-
menu:
|
|
87
|
+
menu: C || (e == null ? void 0 : e.menu),
|
|
89
88
|
currentAccount: m,
|
|
90
89
|
onClose: d
|
|
91
90
|
}
|
|
@@ -1,35 +1,44 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as B, createElement as L,
|
|
2
|
+
import { jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
3
|
+
import { useState as B, createElement as L, useMemo as S, Fragment as j } from "react";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { SeenByLogButton as
|
|
7
|
-
import { Divider as
|
|
8
|
-
import { List as
|
|
6
|
+
import { SeenByLogButton as g } from "../Dialog/SeenByLogButton.js";
|
|
7
|
+
import { Divider as i } from "../Divider/Divider.js";
|
|
8
|
+
import { List as m } from "../List/List.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import { Flex as
|
|
10
|
+
import { Flex as k } from "../Page/Flex.js";
|
|
11
11
|
import { Section as f } from "../Page/Section.js";
|
|
12
12
|
import { UsedByLogItem as h } from "./UsedByLogItem.js";
|
|
13
|
-
const
|
|
14
|
-
collapsible:
|
|
13
|
+
const q = ({
|
|
14
|
+
collapsible: a = !0,
|
|
15
15
|
expanded: l,
|
|
16
16
|
title: c,
|
|
17
17
|
items: r,
|
|
18
18
|
size: p = "sm",
|
|
19
19
|
endUserLabel: t
|
|
20
20
|
}) => {
|
|
21
|
-
const [
|
|
22
|
-
|
|
21
|
+
const [d, v] = B(l || !a && !0), x = () => {
|
|
22
|
+
v((o) => !o);
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
if ((r == null ? void 0 : r.length) === 1)
|
|
25
|
+
return /* @__PURE__ */ n(f, { spacing: 1, children: /* @__PURE__ */ n(m, { size: p, spacing: 1, children: r == null ? void 0 : r.map((o) => /* @__PURE__ */ L(h, { ...o, key: o.id, size: p, endUserLabel: t })) }) });
|
|
26
|
+
const e = S(
|
|
27
|
+
() => r.map((o) => ({
|
|
28
|
+
...o,
|
|
29
|
+
...o.avatar
|
|
30
|
+
})),
|
|
31
|
+
[r]
|
|
32
|
+
);
|
|
33
|
+
return /* @__PURE__ */ u(f, { spacing: 1, children: [
|
|
34
|
+
c && /* @__PURE__ */ n(k, { children: a ? /* @__PURE__ */ n(g, { icon: { items: e }, as: "button", onClick: x, children: c }) : /* @__PURE__ */ n(g, { icon: { items: e }, as: "div", children: c }) }),
|
|
35
|
+
c && d && /* @__PURE__ */ n(i, {}),
|
|
36
|
+
d && /* @__PURE__ */ n(m, { size: p, spacing: 1, children: r == null ? void 0 : r.map((o, y) => /* @__PURE__ */ u(j, { children: [
|
|
37
|
+
y > 0 && /* @__PURE__ */ n(i, {}),
|
|
38
|
+
/* @__PURE__ */ n(h, { ...o, size: p, endUserLabel: t })
|
|
39
|
+
] }, o.id)) })
|
|
31
40
|
] });
|
|
32
41
|
};
|
|
33
42
|
export {
|
|
34
|
-
|
|
43
|
+
q as UsedByLog
|
|
35
44
|
};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { jsxs as r, jsx as
|
|
1
|
+
import { jsxs as r, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { Badge as
|
|
5
|
-
import { Byline as
|
|
4
|
+
import { Badge as p } from "../Badge/Badge.js";
|
|
5
|
+
import { Byline as c } from "../Byline/Byline.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
import { Flex as
|
|
9
|
-
const
|
|
8
|
+
import { Flex as g } from "../Page/Flex.js";
|
|
9
|
+
const v = ({
|
|
10
10
|
type: e,
|
|
11
11
|
name: t,
|
|
12
12
|
description: o,
|
|
13
13
|
isEndUser: m,
|
|
14
14
|
endUserLabel: a,
|
|
15
|
-
|
|
15
|
+
avatar: l,
|
|
16
|
+
size: n = "sm"
|
|
16
17
|
}) => {
|
|
17
18
|
const i = m && { label: a };
|
|
18
|
-
return /* @__PURE__ */ r(
|
|
19
|
-
/* @__PURE__ */ r(
|
|
19
|
+
return /* @__PURE__ */ r(g, { align: "center", spacing: 2, as: "li", children: [
|
|
20
|
+
/* @__PURE__ */ r(c, { size: n, avatar: { name: t, type: e, ...l }, children: [
|
|
20
21
|
/* @__PURE__ */ r("strong", { children: [
|
|
21
22
|
t,
|
|
22
23
|
o && NaN
|
|
@@ -24,9 +25,9 @@ const u = ({
|
|
|
24
25
|
" ",
|
|
25
26
|
o
|
|
26
27
|
] }),
|
|
27
|
-
i && /* @__PURE__ */
|
|
28
|
+
i && /* @__PURE__ */ s(p, { variant: "subtle", ...i })
|
|
28
29
|
] });
|
|
29
30
|
};
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
+
v as UsedByLogItem
|
|
32
33
|
};
|
|
@@ -6,8 +6,9 @@ export interface UsedByLogItemProps extends AvatarProps {
|
|
|
6
6
|
endUserLabel?: string;
|
|
7
7
|
badge?: BadgeProps;
|
|
8
8
|
size?: 'sm' | 'md';
|
|
9
|
+
avatar?: AvatarProps;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* SeenByLog item
|
|
12
13
|
*/
|
|
13
|
-
export declare const UsedByLogItem: ({ type, name, description, isEndUser, endUserLabel, size, }: UsedByLogItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const UsedByLogItem: ({ type, name, description, isEndUser, endUserLabel, avatar, size, }: UsedByLogItemProps) => import("react/jsx-runtime").JSX.Element;
|