@altinn/altinn-components 0.6.8 → 0.6.10
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/AvatarGroup.css +1 -1
- package/dist/assets/ButtonBase.css +1 -1
- package/dist/assets/DialogListItemBase.css +1 -1
- package/dist/assets/FooterBase.css +1 -1
- package/dist/assets/GlobalMenuBase.css +1 -1
- package/dist/assets/MenuItemBase.css +1 -1
- package/dist/assets/MenuOption.css +1 -1
- package/dist/components/Avatar/AvatarGroup.js +21 -21
- package/dist/components/Button/ButtonBase.js +7 -7
- package/dist/components/ContextMenu/ContextMenu.d.ts +3 -1
- package/dist/components/ContextMenu/ContextMenu.js +13 -7
- package/dist/components/ContextMenu/ContextMenuBase.d.ts +3 -1
- package/dist/components/ContextMenu/ContextMenuBase.js +19 -18
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/Dialog.js +41 -50
- package/dist/components/Dialog/Dialog.stories.js +150 -192
- package/dist/components/Dialog/DialogFooter.d.ts +2 -1
- package/dist/components/Dialog/DialogListItem.stories.js +110 -131
- package/dist/components/Dialog/DialogListItemBase.js +5 -5
- package/dist/components/Dialog/DialogNav.js +20 -20
- package/dist/components/Footer/FooterBase.js +5 -5
- package/dist/components/Footer/FooterMenu.js +9 -13
- package/dist/components/GlobalMenu/AccountMenu.js +13 -5
- package/dist/components/GlobalMenu/GlobalMenu.js +46 -40
- package/dist/components/GlobalMenu/GlobalMenu.stories.js +16 -5
- package/dist/components/GlobalMenu/GlobalMenuBase.d.ts +8 -2
- package/dist/components/GlobalMenu/GlobalMenuBase.js +9 -10
- package/dist/components/Menu/MenuItem.stories.js +2 -2
- package/dist/components/Menu/MenuItemBase.js +22 -22
- package/dist/components/Menu/MenuItemMedia.js +1 -3
- package/dist/components/Menu/MenuOption.js +20 -20
- package/dist/components/Toolbar/Toolbar.stories.js +14 -7
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { DialogListItem as
|
|
4
|
-
import { DialogStatusEnum as
|
|
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";
|
|
4
|
+
import { DialogStatusEnum as g } from "./DialogStatus.js";
|
|
5
5
|
import "../../index-L8X2o7IH.js";
|
|
6
6
|
import "../Icon/SvgIcon.js";
|
|
7
|
-
import { MetaItem as
|
|
7
|
+
import { MetaItem as i } from "../Meta/MetaItem.js";
|
|
8
8
|
import "../RootProvider/RootProvider.js";
|
|
9
|
-
import { ListBase as
|
|
10
|
-
const
|
|
11
|
-
switch (
|
|
9
|
+
import { ListBase as s } from "../List/ListBase.js";
|
|
10
|
+
const f = (t) => {
|
|
11
|
+
switch (t) {
|
|
12
12
|
case "draft":
|
|
13
13
|
return "Utkast";
|
|
14
14
|
case "sent":
|
|
@@ -22,16 +22,18 @@ const y = (r) => {
|
|
|
22
22
|
default:
|
|
23
23
|
return "";
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
var
|
|
27
|
-
const
|
|
28
|
-
value:
|
|
29
|
-
label:
|
|
30
|
-
})),
|
|
25
|
+
}, d = ["lg", "md", "sm", "xs"];
|
|
26
|
+
var p;
|
|
27
|
+
const o = (p = Object.keys(g)) == null ? void 0 : p.map((t) => ({
|
|
28
|
+
value: t,
|
|
29
|
+
label: f(t)
|
|
30
|
+
})), I = {
|
|
31
31
|
title: "Dialog/DialogListItem",
|
|
32
|
-
component:
|
|
32
|
+
component: r,
|
|
33
33
|
tags: ["autodocs"],
|
|
34
|
-
parameters: {
|
|
34
|
+
parameters: {
|
|
35
|
+
theme: "company"
|
|
36
|
+
},
|
|
35
37
|
argTypes: {},
|
|
36
38
|
args: {
|
|
37
39
|
title: "Title",
|
|
@@ -44,87 +46,74 @@ const c = (g = Object.keys(b)) == null ? void 0 : g.map((r) => ({
|
|
|
44
46
|
type: "person",
|
|
45
47
|
name: "Recipient name"
|
|
46
48
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}, j = {
|
|
52
|
-
args: {
|
|
53
|
-
select: {
|
|
54
|
-
checked: !1
|
|
55
|
-
}
|
|
49
|
+
updatedAt: "2024-11-25 15:30",
|
|
50
|
+
updatedAtLabel: "25. november 2024 kl 15.30",
|
|
51
|
+
status: {}
|
|
56
52
|
}
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}, A = {
|
|
69
|
-
args: {
|
|
70
|
-
touchedBy: [
|
|
71
|
-
{
|
|
72
|
-
name: "Lars"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: "Trine"
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
}, E = {
|
|
80
|
-
args: {
|
|
81
|
-
status: {
|
|
82
|
-
value: "draft"
|
|
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: [
|
|
57
|
+
/* @__PURE__ */ e(
|
|
58
|
+
r,
|
|
59
|
+
{
|
|
60
|
+
...t,
|
|
61
|
+
status: { label: "Krever handling", value: "requires-attention" },
|
|
62
|
+
dueAt: "2025-01-01",
|
|
63
|
+
dueAtLabel: "Frist: 1. januar 2025"
|
|
83
64
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
65
|
+
),
|
|
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." }),
|
|
75
|
+
/* @__PURE__ */ e(
|
|
76
|
+
r,
|
|
77
|
+
{
|
|
78
|
+
...t,
|
|
79
|
+
seen: !0,
|
|
80
|
+
seenBy: { seenByOthersCount: 4, seenByEndUser: !0, label: "Sett av deg + 4" }
|
|
89
81
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
82
|
+
),
|
|
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." }),
|
|
89
|
+
/* @__PURE__ */ e(
|
|
90
|
+
r,
|
|
91
|
+
{
|
|
92
|
+
...t,
|
|
93
|
+
touchedBy: [{ name: "Kari Nordmann" }, { name: "Ola Nordmann" }, { name: "Per Nordmann" }]
|
|
95
94
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ e(i, { children: "Dialog has been touched by a multiple actors." })
|
|
97
|
+
] }), E = (t) => /* @__PURE__ */ l(s, { children: [
|
|
98
|
+
/* @__PURE__ */ e(
|
|
99
|
+
r,
|
|
100
|
+
{
|
|
101
|
+
...t,
|
|
102
|
+
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."
|
|
101
103
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ e(i, { children: "Long title" }),
|
|
106
|
+
/* @__PURE__ */ e(
|
|
107
|
+
r,
|
|
108
|
+
{
|
|
109
|
+
...t,
|
|
110
|
+
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."
|
|
107
111
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}, R = {
|
|
114
|
-
args: {
|
|
115
|
-
title: "Long summary",
|
|
116
|
-
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.
|
|
117
|
-
|
|
118
|
-
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.`
|
|
119
|
-
}
|
|
120
|
-
}, F = {
|
|
121
|
-
args: {
|
|
122
|
-
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.",
|
|
123
|
-
summary: "Short summary."
|
|
124
|
-
}
|
|
125
|
-
}, G = (r) => {
|
|
126
|
-
var p;
|
|
127
|
-
const [t, h] = f({
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ e(i, { children: "Long summary" })
|
|
114
|
+
] }), M = (t) => {
|
|
115
|
+
var h;
|
|
116
|
+
const [a, b] = y({
|
|
128
117
|
1: {
|
|
129
118
|
id: "1",
|
|
130
119
|
title: "Item 1",
|
|
@@ -140,53 +129,43 @@ Cras mattis consectetur purus sit amet fermentum. Lorem ipsum dolor sit amet, co
|
|
|
140
129
|
title: "Item 2",
|
|
141
130
|
selected: !1
|
|
142
131
|
}
|
|
143
|
-
}), m = ({ id:
|
|
144
|
-
|
|
145
|
-
...
|
|
146
|
-
[
|
|
147
|
-
...
|
|
148
|
-
selected: !
|
|
132
|
+
}), m = ({ id: n }) => {
|
|
133
|
+
b((c) => ({
|
|
134
|
+
...c,
|
|
135
|
+
[n]: {
|
|
136
|
+
...c[n],
|
|
137
|
+
selected: !c[n].selected
|
|
149
138
|
}
|
|
150
139
|
}));
|
|
151
140
|
};
|
|
152
|
-
return /* @__PURE__ */ s
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
|
|
141
|
+
return /* @__PURE__ */ e(s, { children: (h = Object.values(a)) == null ? void 0 : h.map((n) => /* @__PURE__ */ l(u, { children: [
|
|
142
|
+
/* @__PURE__ */ e(
|
|
143
|
+
r,
|
|
155
144
|
{
|
|
156
|
-
...
|
|
157
|
-
title:
|
|
158
|
-
onClick:
|
|
159
|
-
selected:
|
|
160
|
-
select: { checked:
|
|
145
|
+
...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) }
|
|
161
150
|
}
|
|
162
151
|
),
|
|
163
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ l(i, { children: [
|
|
164
153
|
"selected:",
|
|
165
|
-
|
|
154
|
+
n.selected ? "true" : "false"
|
|
166
155
|
] })
|
|
167
|
-
] },
|
|
168
|
-
},
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
] },
|
|
172
|
-
/* @__PURE__ */ s(l, { ...r, size: t }),
|
|
173
|
-
/* @__PURE__ */ s(u, { children: t })
|
|
174
|
-
] }, t)) });
|
|
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)) });
|
|
175
161
|
export {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
V as Sizes,
|
|
186
|
-
K as Statuses,
|
|
187
|
-
A as TouchedBy,
|
|
188
|
-
T as default,
|
|
189
|
-
x as seenByEndUser,
|
|
190
|
-
j as selectable,
|
|
191
|
-
q as selected
|
|
162
|
+
x as Attachments,
|
|
163
|
+
j as DueAt,
|
|
164
|
+
K as SeenBy,
|
|
165
|
+
M as Selectable,
|
|
166
|
+
T as Sizes,
|
|
167
|
+
O as Statuses,
|
|
168
|
+
E as TextLength,
|
|
169
|
+
q as TouchedBy,
|
|
170
|
+
I as default
|
|
192
171
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { DialogSelect as _ } from "./DialogSelect.js";
|
|
3
|
-
import '../../assets/DialogListItemBase.css';const d = "
|
|
3
|
+
import '../../assets/DialogListItemBase.css';const d = "_item_1uvy5_1", u = "_link_1uvy5_13", k = "_select_1uvy5_46", t = {
|
|
4
4
|
item: d,
|
|
5
|
-
link:
|
|
6
|
-
select:
|
|
7
|
-
},
|
|
5
|
+
link: u,
|
|
6
|
+
select: k
|
|
7
|
+
}, y = ({
|
|
8
8
|
as: i = "a",
|
|
9
9
|
size: e,
|
|
10
10
|
href: l,
|
|
@@ -20,5 +20,5 @@ import '../../assets/DialogListItemBase.css';const d = "_item_1ate4_1", k = "_li
|
|
|
20
20
|
] });
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
y as DialogListItemBase
|
|
24
24
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "../Icon/SvgIcon.js";
|
|
5
|
-
import { Button as
|
|
6
|
-
import { ContextMenu as
|
|
5
|
+
import { Button as c } from "../Button/Button.js";
|
|
6
|
+
import { ContextMenu as l } from "../ContextMenu/ContextMenu.js";
|
|
7
7
|
import { MetaTimestamp as p } from "../Meta/MetaTimestamp.js";
|
|
8
8
|
import { DialogStatus as v } from "./DialogStatus.js";
|
|
9
|
-
import { DialogTouchedBy as
|
|
10
|
-
import '../../assets/DialogNav.css';const
|
|
11
|
-
nav:
|
|
12
|
-
action:
|
|
13
|
-
},
|
|
14
|
-
backButton:
|
|
9
|
+
import { DialogTouchedBy as d } from "./DialogTouchedBy.js";
|
|
10
|
+
import '../../assets/DialogNav.css';const f = "_nav_678a5_1", x = "_action_678a5_8", m = {
|
|
11
|
+
nav: f,
|
|
12
|
+
action: x
|
|
13
|
+
}, M = ({
|
|
14
|
+
backButton: r = {
|
|
15
15
|
as: "a",
|
|
16
16
|
label: "Back"
|
|
17
17
|
},
|
|
18
|
-
status:
|
|
19
|
-
dueAt:
|
|
18
|
+
status: i,
|
|
19
|
+
dueAt: a,
|
|
20
20
|
dueAtLabel: e,
|
|
21
|
-
touchedBy:
|
|
21
|
+
touchedBy: s,
|
|
22
22
|
menu: n
|
|
23
|
-
}) => /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
n && /* @__PURE__ */
|
|
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" })
|
|
30
30
|
] })
|
|
31
31
|
] });
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
M as DialogNav
|
|
34
34
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as t, jsxs as e } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "../../index-L8X2o7IH.js";
|
|
3
|
-
import '../../assets/FooterBase.css';const
|
|
4
|
-
footer:
|
|
5
|
-
grid:
|
|
6
|
-
},
|
|
3
|
+
import '../../assets/FooterBase.css';const d = "_footer_1d8fg_1", f = "_grid_1d8fg_14", o = {
|
|
4
|
+
footer: d,
|
|
5
|
+
grid: f
|
|
6
|
+
}, a = ({ className: r, children: s }) => /* @__PURE__ */ t("footer", { className: c(o.footer, r), children: /* @__PURE__ */ e("div", { className: o.grid, children: [
|
|
7
7
|
s,
|
|
8
8
|
" "
|
|
9
9
|
] }) });
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
a as FooterBase
|
|
12
12
|
};
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
list: c,
|
|
10
|
-
item: _,
|
|
11
|
-
link: a
|
|
12
|
-
}, p = ({ as: t, className: e, title: o, ...r }) => /* @__PURE__ */ n(t || "a", { className: s(i.link, e), ...r, children: o }), C = ({ className: t, items: e = [] }) => /* @__PURE__ */ n(m, { className: s(i.menu, t), children: /* @__PURE__ */ n("ul", { className: i.list, children: e.map((o) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(p, { ...o }) }, o.id)) }) });
|
|
2
|
+
import { c as i } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/FooterMenu.css';const c = "_menu_3o631_1", r = "_list_3o631_7", m = "_item_3o631_28", _ = "_link_3o631_32", s = {
|
|
4
|
+
menu: c,
|
|
5
|
+
list: r,
|
|
6
|
+
item: m,
|
|
7
|
+
link: _
|
|
8
|
+
}, a = ({ as: t, className: e, title: o, ...l }) => /* @__PURE__ */ n(t || "a", { className: i(s.link, e), ...l, children: o }), k = ({ className: t, items: e = [] }) => /* @__PURE__ */ n("nav", { className: i(s.menu, t), children: /* @__PURE__ */ n("ul", { className: s.list, children: e.map((o) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(a, { ...o }) }, o.id)) }) });
|
|
13
9
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
a as FooterLink,
|
|
11
|
+
k as FooterMenu
|
|
16
12
|
};
|
|
@@ -5,7 +5,7 @@ import "../../index-L8X2o7IH.js";
|
|
|
5
5
|
import "../Icon/SvgIcon.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import { Menu as b } from "../Menu/Menu.js";
|
|
8
|
-
const v = (r) => `${r} hits`,
|
|
8
|
+
const v = (r) => `${r} hits`, k = ({
|
|
9
9
|
accounts: r = [],
|
|
10
10
|
accountGroups: f = {},
|
|
11
11
|
accountSearch: s,
|
|
@@ -29,11 +29,11 @@ const v = (r) => `${r} hits`, R = ({
|
|
|
29
29
|
}).map((e) => ({
|
|
30
30
|
...e,
|
|
31
31
|
groupId: "search"
|
|
32
|
-
})) : p,
|
|
32
|
+
})) : p, I = i ? {
|
|
33
33
|
search: {
|
|
34
34
|
title: ((m = s == null ? void 0 : s.getResultsLabel) == null ? void 0 : m.call(s, l.length)) ?? v(l.length)
|
|
35
35
|
}
|
|
36
|
-
} : f,
|
|
36
|
+
} : f, h = {
|
|
37
37
|
name: "account-search",
|
|
38
38
|
value: i,
|
|
39
39
|
placeholder: (s == null ? void 0 : s.placeholder) ?? "Find account",
|
|
@@ -41,8 +41,16 @@ const v = (r) => `${r} hits`, R = ({
|
|
|
41
41
|
}, C = [
|
|
42
42
|
...l.length > 0 ? l : [{ id: "search", groupId: "search", hidden: !0 }]
|
|
43
43
|
];
|
|
44
|
-
return /* @__PURE__ */ L(
|
|
44
|
+
return /* @__PURE__ */ L(
|
|
45
|
+
b,
|
|
46
|
+
{
|
|
47
|
+
theme: "global",
|
|
48
|
+
search: s && h,
|
|
49
|
+
groups: I,
|
|
50
|
+
items: C
|
|
51
|
+
}
|
|
52
|
+
);
|
|
45
53
|
};
|
|
46
54
|
export {
|
|
47
|
-
|
|
55
|
+
k as AccountMenu
|
|
48
56
|
};
|
|
@@ -1,58 +1,64 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsxs as n, jsx as o, Fragment as x } from "react/jsx-runtime";
|
|
3
|
+
import { useState as G } from "react";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import "../Icon/SvgIcon.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
|
-
import { AccountMenu as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
import { AccountMenu as v } from "./AccountMenu.js";
|
|
8
|
+
import { MenuListItem as l } from "../Menu/MenuBase.js";
|
|
9
|
+
import { Menu as d } from "../Menu/Menu.js";
|
|
10
|
+
import { AccountButton as C } from "./AccountButton.js";
|
|
11
|
+
import { BackButton as j } from "./BackButton.js";
|
|
12
|
+
import { GlobalMenuBase as m, GlobalMenuHeader as f, GlobalMenuFooter as A } from "./GlobalMenuBase.js";
|
|
13
|
+
import { LogoutButton as F } from "./LogoutButton.js";
|
|
14
|
+
const N = ({
|
|
15
|
+
accounts: a = [],
|
|
16
|
+
accountGroups: h = {},
|
|
17
|
+
accountSearch: s,
|
|
18
|
+
items: p = [],
|
|
18
19
|
groups: c,
|
|
19
|
-
changeLabel:
|
|
20
|
-
backLabel:
|
|
21
|
-
currentAccount:
|
|
20
|
+
changeLabel: M = "Change",
|
|
21
|
+
backLabel: g = "Back",
|
|
22
|
+
currentAccount: r,
|
|
22
23
|
onSelectAccount: e,
|
|
23
|
-
logoutButton:
|
|
24
|
+
logoutButton: u
|
|
24
25
|
}) => {
|
|
25
|
-
const [
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
26
|
+
const [b, k] = G(!1), t = () => {
|
|
27
|
+
k((i) => !i);
|
|
28
|
+
}, B = (i) => {
|
|
29
|
+
t(), e == null || e(i);
|
|
29
30
|
};
|
|
30
|
-
return
|
|
31
|
-
/* @__PURE__ */ o(
|
|
31
|
+
return b ? /* @__PURE__ */ n(m, { children: [
|
|
32
|
+
/* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(j, { onClick: t, label: g }) }),
|
|
33
|
+
!s && /* @__PURE__ */ o(l, { as: "div", role: "separator" }),
|
|
32
34
|
/* @__PURE__ */ o(
|
|
33
|
-
|
|
35
|
+
v,
|
|
34
36
|
{
|
|
35
|
-
currentAccount:
|
|
36
|
-
accounts:
|
|
37
|
-
accountGroups:
|
|
38
|
-
accountSearch:
|
|
39
|
-
onSelectAccount:
|
|
37
|
+
currentAccount: r,
|
|
38
|
+
accounts: a,
|
|
39
|
+
accountGroups: h,
|
|
40
|
+
accountSearch: s,
|
|
41
|
+
onSelectAccount: B
|
|
40
42
|
}
|
|
41
43
|
)
|
|
42
|
-
] }) :
|
|
43
|
-
/* @__PURE__ */ o(
|
|
44
|
-
|
|
44
|
+
] }) : r ? /* @__PURE__ */ n(m, { children: [
|
|
45
|
+
/* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(
|
|
46
|
+
C,
|
|
45
47
|
{
|
|
46
|
-
account:
|
|
47
|
-
linkText:
|
|
48
|
-
multipleAccounts:
|
|
49
|
-
onClick:
|
|
48
|
+
account: r,
|
|
49
|
+
linkText: M,
|
|
50
|
+
multipleAccounts: a.length > 1,
|
|
51
|
+
onClick: t
|
|
50
52
|
}
|
|
51
53
|
) }),
|
|
52
|
-
/* @__PURE__ */ o(
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
/* @__PURE__ */ o(l, { as: "div", role: "separator" }),
|
|
55
|
+
/* @__PURE__ */ o(d, { groups: c, items: p }),
|
|
56
|
+
u && /* @__PURE__ */ n(x, { children: [
|
|
57
|
+
/* @__PURE__ */ o(l, { as: "div", role: "separator" }),
|
|
58
|
+
/* @__PURE__ */ o(A, { children: /* @__PURE__ */ o(F, { ...u }) })
|
|
59
|
+
] })
|
|
60
|
+
] }) : /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(d, { groups: c, items: p }) });
|
|
55
61
|
};
|
|
56
62
|
export {
|
|
57
|
-
|
|
63
|
+
N as GlobalMenu
|
|
58
64
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GlobalMenu as
|
|
2
|
-
const
|
|
1
|
+
import { GlobalMenu as t } from "./GlobalMenu.js";
|
|
2
|
+
const r = {
|
|
3
3
|
title: "GlobalMenu/GlobalMenu",
|
|
4
|
-
component:
|
|
4
|
+
component: t,
|
|
5
5
|
tags: ["autodocs"],
|
|
6
6
|
parameters: {},
|
|
7
7
|
args: {
|
|
@@ -14,10 +14,14 @@ const t = {
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
currentAccount: {
|
|
17
|
+
id: "party:mathias",
|
|
17
18
|
type: "person",
|
|
18
19
|
name: "Mathias Dyngeland",
|
|
19
20
|
description: "Fødselsnr. 07101995 XXXXXX"
|
|
20
21
|
},
|
|
22
|
+
logoutButton: {
|
|
23
|
+
label: "Logg ut"
|
|
24
|
+
},
|
|
21
25
|
accounts: [
|
|
22
26
|
{
|
|
23
27
|
id: "party:mathias",
|
|
@@ -148,6 +152,12 @@ const t = {
|
|
|
148
152
|
}
|
|
149
153
|
}
|
|
150
154
|
}, l = {
|
|
155
|
+
args: {
|
|
156
|
+
accountSearch: {
|
|
157
|
+
placeholder: "Finn konto"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}, s = {
|
|
151
161
|
args: {
|
|
152
162
|
logoutLabel: "Logg ut",
|
|
153
163
|
menuLabel: "Meny",
|
|
@@ -161,9 +171,10 @@ const t = {
|
|
|
161
171
|
}
|
|
162
172
|
};
|
|
163
173
|
export {
|
|
174
|
+
l as AccountSearch,
|
|
164
175
|
i as Company,
|
|
165
|
-
|
|
176
|
+
s as CustomLabels,
|
|
166
177
|
o as Default,
|
|
167
178
|
n as Login,
|
|
168
|
-
|
|
179
|
+
r as default
|
|
169
180
|
};
|
|
@@ -2,6 +2,12 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
export interface GlobalMenuBaseProps {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
}
|
|
5
|
+
export interface GlobalMenuHeaderProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface GlobalMenuFooterProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
5
11
|
export declare const GlobalMenuBase: ({ children }: GlobalMenuBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare const GlobalMenuHeader: ({ children }:
|
|
7
|
-
export declare const GlobalMenuFooter: ({ children }:
|
|
12
|
+
export declare const GlobalMenuHeader: ({ children }: GlobalMenuHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const GlobalMenuFooter: ({ children }: GlobalMenuFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import '../../assets/GlobalMenuBase.css';const
|
|
3
|
-
nav:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}, _ = ({ children: o }) => /* @__PURE__ */ e("nav", { className: r.nav, "data-theme": "global", children: o }), c = ({ children: o }) => /* @__PURE__ */ e("header", { className: r.header, children: o }), f = ({ children: o }) => /* @__PURE__ */ e("footer", { className: r.footer, children: o });
|
|
2
|
+
import '../../assets/GlobalMenuBase.css';const n = "_nav_1mnmu_1", a = "_footer_1mnmu_8", t = "_drawer_1mnmu_16", s = "_dropdown_1mnmu_22", r = {
|
|
3
|
+
nav: n,
|
|
4
|
+
footer: a,
|
|
5
|
+
drawer: t,
|
|
6
|
+
dropdown: s
|
|
7
|
+
}, d = ({ children: o }) => /* @__PURE__ */ e("nav", { className: r.nav, "data-theme": "global", children: o }), l = ({ children: o }) => /* @__PURE__ */ e("header", { className: r.header, children: o }), _ = ({ children: o }) => /* @__PURE__ */ e("footer", { className: r.footer, children: o });
|
|
9
8
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
d as GlobalMenuBase,
|
|
10
|
+
_ as GlobalMenuFooter,
|
|
11
|
+
l as GlobalMenuHeader
|
|
13
12
|
};
|