@midas-ds/components 16.7.1 → 16.8.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/CHANGELOG.md +12 -0
- package/chunks/Layout-CFhqS9ej.js +484 -0
- package/index.d.ts +1 -0
- package/index.js +17 -15
- package/layout/Layout.d.ts +7 -0
- package/layout/components/Sidebar.d.ts +6 -1
- package/layout/components/SidebarLink.d.ts +1 -1
- package/layout/context/LayoutContext.d.ts +1 -2
- package/layout/index.js +1 -1
- package/package.json +1 -1
- package/chunks/Layout-C2-vyEKy.js +0 -467
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 16.8.1 (2026-02-06)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **layout:** add boilerplate components ([ab85d70f46](https://github.com/migrationsverket/midas/commit/ab85d70f46))
|
|
6
|
+
|
|
7
|
+
## 16.8.0 (2026-02-06)
|
|
8
|
+
|
|
9
|
+
### 🚀 Features
|
|
10
|
+
|
|
11
|
+
- **components, layout:** add click-event for sidebar links ([#1040](https://github.com/migrationsverket/midas/pull/1040))
|
|
12
|
+
|
|
1
13
|
## 16.7.1 (2026-02-05)
|
|
2
14
|
|
|
3
15
|
### 🔧 Maintenance
|
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as e, jsxs as o, Fragment as G } from "react/jsx-runtime";
|
|
3
|
+
import { G as z } from "./GridItem-z7zclNdT.js";
|
|
4
|
+
import * as f from "react";
|
|
5
|
+
import { useState as W, useEffect as j } from "react";
|
|
6
|
+
import { c as b } from "./clsx-AexbMWKp.js";
|
|
7
|
+
import { Link as y, RouterProvider as w } from "react-aria-components";
|
|
8
|
+
import { B as E } from "./Button-CaLOUTDO.js";
|
|
9
|
+
import { a as D, T as q } from "./Tooltip-rDmOkGmX.js";
|
|
10
|
+
import { a as I, B as M } from "./BadgeContainer-CKVsfTlF.js";
|
|
11
|
+
import { c as T } from "./createLucideIcon-CP-mMPfa.js";
|
|
12
|
+
import { u as C } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
13
|
+
import { variables as A } from "@midas-ds/theme";
|
|
14
|
+
import { L } from "./Logo-CCxPAmgw.js";
|
|
15
|
+
import { X as R } from "./x-B9bYxG31.js";
|
|
16
|
+
import '../assets/Layout.css';const $ = [
|
|
17
|
+
["path", { d: "M4 5h16", key: "1tepv9" }],
|
|
18
|
+
["path", { d: "M4 12h16", key: "1lakjw" }],
|
|
19
|
+
["path", { d: "M4 19h16", key: "1djgab" }]
|
|
20
|
+
], F = T("menu", $);
|
|
21
|
+
const X = [
|
|
22
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
23
|
+
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
24
|
+
["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
|
|
25
|
+
], J = T("panel-left-close", X);
|
|
26
|
+
const K = [
|
|
27
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
28
|
+
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
29
|
+
["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
|
|
30
|
+
], Q = T("panel-left-open", K), U = "_baseLayout_1n71v_1", V = "_mainContent_1n71v_10", Y = "_header_1n71v_15", Z = "_headerExternal_1n71v_26", ee = "_headerContent_1n71v_41", ne = "_logo_1n71v_60", ae = "_headerItems_1n71v_69", te = "_toggleButton_1n71v_75", se = "_sidebar_1n71v_83", ie = "_main_1n71v_10", re = "_app_1n71v_116", oe = "_sidebarOpened_1n71v_124", le = "_sidebarHeader_1n71v_128", de = "_appName_1n71v_140", ce = "_collapseButton_1n71v_147", me = "_sidebarCollapsed_1n71v_156", pe = "_userName_1n71v_166", _e = "_userTitle_1n71v_184", ve = "_title_1n71v_196", he = "_sidebarNav_1n71v_207", ue = "_list_1n71v_213", be = "_listGroupTitle_1n71v_219", Ne = "_listItem_1n71v_226", fe = "_listItemCollapsed_1n71v_231", ke = "_listLink_1n71v_235", Ce = "_listLinkCollapsed_1n71v_298", xe = "_active_1n71v_303", ge = "_backdrop_1n71v_321", Le = "_backdropOpened_1n71v_331", ye = "_skipToContent_1n71v_349", Ie = "_navbar_1n71v_363", Me = "_navbarList_1n71v_375", Ee = "_navbarItem_1n71v_397", Te = "_headerContentExternal_1n71v_448", Se = "_logoExternalContainer_1n71v_456", ze = "_logoExternal_1n71v_456", Be = "_logoExternalDesktop_1n71v_468", Oe = "_navbarWrapper_1n71v_477", n = {
|
|
31
|
+
baseLayout: U,
|
|
32
|
+
mainContent: V,
|
|
33
|
+
header: Y,
|
|
34
|
+
headerExternal: Z,
|
|
35
|
+
headerContent: ee,
|
|
36
|
+
logo: ne,
|
|
37
|
+
headerItems: ae,
|
|
38
|
+
toggleButton: te,
|
|
39
|
+
sidebar: se,
|
|
40
|
+
main: ie,
|
|
41
|
+
app: re,
|
|
42
|
+
sidebarOpened: oe,
|
|
43
|
+
sidebarHeader: le,
|
|
44
|
+
appName: de,
|
|
45
|
+
collapseButton: ce,
|
|
46
|
+
sidebarCollapsed: me,
|
|
47
|
+
userName: pe,
|
|
48
|
+
userTitle: _e,
|
|
49
|
+
title: ve,
|
|
50
|
+
sidebarNav: he,
|
|
51
|
+
list: ue,
|
|
52
|
+
listGroupTitle: be,
|
|
53
|
+
listItem: Ne,
|
|
54
|
+
listItemCollapsed: fe,
|
|
55
|
+
listLink: ke,
|
|
56
|
+
listLinkCollapsed: Ce,
|
|
57
|
+
active: xe,
|
|
58
|
+
backdrop: ge,
|
|
59
|
+
backdropOpened: Le,
|
|
60
|
+
skipToContent: ye,
|
|
61
|
+
navbar: Ie,
|
|
62
|
+
navbarList: Me,
|
|
63
|
+
navbarItem: Ee,
|
|
64
|
+
headerContentExternal: Te,
|
|
65
|
+
logoExternalContainer: Se,
|
|
66
|
+
logoExternal: ze,
|
|
67
|
+
logoExternalDesktop: Be,
|
|
68
|
+
navbarWrapper: Oe
|
|
69
|
+
}, P = f.createContext(
|
|
70
|
+
void 0
|
|
71
|
+
), we = ({
|
|
72
|
+
items: a,
|
|
73
|
+
title: t,
|
|
74
|
+
user: r,
|
|
75
|
+
app: i,
|
|
76
|
+
children: s,
|
|
77
|
+
clientSideRouter: p,
|
|
78
|
+
clientSideHref: d,
|
|
79
|
+
headerChildren: v,
|
|
80
|
+
isCollapsed: _,
|
|
81
|
+
setIsCollapsed: m,
|
|
82
|
+
isOpened: h,
|
|
83
|
+
setIsOpened: N,
|
|
84
|
+
variant: l,
|
|
85
|
+
id: u
|
|
86
|
+
}) => /* @__PURE__ */ e(
|
|
87
|
+
P.Provider,
|
|
88
|
+
{
|
|
89
|
+
value: {
|
|
90
|
+
items: a,
|
|
91
|
+
title: t,
|
|
92
|
+
user: r,
|
|
93
|
+
app: i,
|
|
94
|
+
headerChildren: v,
|
|
95
|
+
isCollapsed: _,
|
|
96
|
+
setIsCollapsed: m,
|
|
97
|
+
isOpened: h,
|
|
98
|
+
setIsOpened: N,
|
|
99
|
+
clientSideRouter: p,
|
|
100
|
+
clientSideHref: d,
|
|
101
|
+
variant: l,
|
|
102
|
+
id: u
|
|
103
|
+
},
|
|
104
|
+
children: s
|
|
105
|
+
}
|
|
106
|
+
), k = () => {
|
|
107
|
+
const a = f.useContext(P);
|
|
108
|
+
if (!a)
|
|
109
|
+
throw new Error("useLayoutContext must be used within a LayoutProvider");
|
|
110
|
+
return a;
|
|
111
|
+
}, H = ({
|
|
112
|
+
title: a,
|
|
113
|
+
href: t,
|
|
114
|
+
icon: r,
|
|
115
|
+
active: i,
|
|
116
|
+
hasBadge: s,
|
|
117
|
+
onClick: p
|
|
118
|
+
}) => {
|
|
119
|
+
const { isCollapsed: d, setIsOpened: v, clientSideHref: _ } = k(), m = _ ? _(t) : t, [h, N] = W(!1);
|
|
120
|
+
j(() => {
|
|
121
|
+
if (typeof window < "u") {
|
|
122
|
+
const u = window.location.pathname === m || window.location.pathname.startsWith(m + "/");
|
|
123
|
+
N(i ?? u);
|
|
124
|
+
}
|
|
125
|
+
}, [i, m]);
|
|
126
|
+
const l = () => {
|
|
127
|
+
v?.(!1), p && p({
|
|
128
|
+
title: a,
|
|
129
|
+
href: m
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
return d ? /* @__PURE__ */ o(D, { children: [
|
|
133
|
+
/* @__PURE__ */ e(
|
|
134
|
+
y,
|
|
135
|
+
{
|
|
136
|
+
href: t,
|
|
137
|
+
"aria-label": a,
|
|
138
|
+
className: b(
|
|
139
|
+
n.listLink,
|
|
140
|
+
n.listLinkCollapsed,
|
|
141
|
+
h && n.active
|
|
142
|
+
),
|
|
143
|
+
onPress: l,
|
|
144
|
+
children: /* @__PURE__ */ o(I, { children: [
|
|
145
|
+
/* @__PURE__ */ e(
|
|
146
|
+
r,
|
|
147
|
+
{
|
|
148
|
+
size: 20,
|
|
149
|
+
"aria-label": a
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
s && /* @__PURE__ */ e(M, {})
|
|
153
|
+
] })
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ e(q, { placement: "right", children: a })
|
|
157
|
+
] }) : /* @__PURE__ */ o(
|
|
158
|
+
y,
|
|
159
|
+
{
|
|
160
|
+
href: t,
|
|
161
|
+
"aria-label": a,
|
|
162
|
+
className: b(n.listLink, h && n.active),
|
|
163
|
+
onPress: l,
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ o(I, { children: [
|
|
166
|
+
/* @__PURE__ */ e(r, { size: 20 }),
|
|
167
|
+
s && /* @__PURE__ */ e(M, {})
|
|
168
|
+
] }),
|
|
169
|
+
a
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}, Pe = { closeMenu: "Close menu", openMenu: "Open menu", maximizeMenu: "Maximize menu", minimizeMenu: "Minimize menu", sidebarMenu: "Sidebar menu", bottomMenu: "Bottom menu", skipToContent: "Skip to main content" }, He = { closeMenu: "Stäng meny", openMenu: "Öppna meny", maximizeMenu: "Maximera meny", minimizeMenu: "Minimera meny", sidebarMenu: "Sidomeny", bottomMenu: "Bottenmeny", skipToContent: "Hoppa till huvudinnehåll" }, x = {
|
|
174
|
+
en: Pe,
|
|
175
|
+
sv: He
|
|
176
|
+
}, Ge = ({
|
|
177
|
+
onLinkClick: a
|
|
178
|
+
}) => {
|
|
179
|
+
const {
|
|
180
|
+
items: t,
|
|
181
|
+
app: r,
|
|
182
|
+
isOpened: i,
|
|
183
|
+
isCollapsed: s,
|
|
184
|
+
setIsCollapsed: p,
|
|
185
|
+
setIsOpened: d,
|
|
186
|
+
clientSideRouter: v,
|
|
187
|
+
clientSideHref: _,
|
|
188
|
+
id: m
|
|
189
|
+
} = k(), h = C(x), N = ({ group: l }) => /* @__PURE__ */ e("ul", { className: n.list, children: l.items.map((u, g) => /* @__PURE__ */ e(
|
|
190
|
+
"li",
|
|
191
|
+
{
|
|
192
|
+
className: b(
|
|
193
|
+
n.listItem,
|
|
194
|
+
s && n.listItemCollapsed
|
|
195
|
+
),
|
|
196
|
+
children: /* @__PURE__ */ e(
|
|
197
|
+
H,
|
|
198
|
+
{
|
|
199
|
+
onClick: a,
|
|
200
|
+
...u
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
},
|
|
204
|
+
"link_" + g
|
|
205
|
+
)) });
|
|
206
|
+
return f.useEffect(() => {
|
|
207
|
+
const l = (u) => {
|
|
208
|
+
u.key === "Escape" && d !== void 0 && d(!1);
|
|
209
|
+
};
|
|
210
|
+
return window.addEventListener("keydown", l), () => {
|
|
211
|
+
window.removeEventListener("keydown", l);
|
|
212
|
+
};
|
|
213
|
+
}, [d]), /* @__PURE__ */ o(
|
|
214
|
+
"aside",
|
|
215
|
+
{
|
|
216
|
+
id: m,
|
|
217
|
+
className: b(
|
|
218
|
+
n.sidebar,
|
|
219
|
+
s && n.sidebarCollapsed,
|
|
220
|
+
i && n.sidebarOpened
|
|
221
|
+
),
|
|
222
|
+
children: [
|
|
223
|
+
/* @__PURE__ */ o("div", { className: n.sidebarHeader, children: [
|
|
224
|
+
!s && /* @__PURE__ */ e("p", { className: n.appName, children: r.name }),
|
|
225
|
+
/* @__PURE__ */ e(
|
|
226
|
+
E,
|
|
227
|
+
{
|
|
228
|
+
variant: "icon",
|
|
229
|
+
"aria-label": s ? h.format("maximizeMenu") : h.format("minimizeMenu"),
|
|
230
|
+
onPress: () => p(!s),
|
|
231
|
+
className: n.collapseButton,
|
|
232
|
+
children: s ? /* @__PURE__ */ e(Q, { size: 20 }) : /* @__PURE__ */ e(J, { size: 20 })
|
|
233
|
+
}
|
|
234
|
+
)
|
|
235
|
+
] }),
|
|
236
|
+
/* @__PURE__ */ e(
|
|
237
|
+
"nav",
|
|
238
|
+
{
|
|
239
|
+
className: n.sidebarNav,
|
|
240
|
+
"aria-label": h.format("sidebarMenu"),
|
|
241
|
+
children: /* @__PURE__ */ e("ul", { className: n.list, children: t.map((l, u) => /* @__PURE__ */ o("li", { children: [
|
|
242
|
+
l.title && !s && /* @__PURE__ */ e("p", { className: n.listGroupTitle, children: l.title }),
|
|
243
|
+
v ? /* @__PURE__ */ e(
|
|
244
|
+
w,
|
|
245
|
+
{
|
|
246
|
+
navigate: v,
|
|
247
|
+
useHref: _,
|
|
248
|
+
children: /* @__PURE__ */ e(N, { group: l })
|
|
249
|
+
}
|
|
250
|
+
) : /* @__PURE__ */ e(N, { group: l })
|
|
251
|
+
] }, "list_" + u)) })
|
|
252
|
+
}
|
|
253
|
+
)
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
}, We = () => {
|
|
258
|
+
const {
|
|
259
|
+
title: a,
|
|
260
|
+
user: t,
|
|
261
|
+
app: r,
|
|
262
|
+
isOpened: i,
|
|
263
|
+
setIsOpened: s,
|
|
264
|
+
setIsCollapsed: p,
|
|
265
|
+
headerChildren: d,
|
|
266
|
+
variant: v,
|
|
267
|
+
id: _
|
|
268
|
+
} = k(), m = C(x);
|
|
269
|
+
return v === "external" ? /* @__PURE__ */ e("header", { className: b(n.header, n.headerExternal), children: /* @__PURE__ */ o("div", { className: n.headerContentExternal, children: [
|
|
270
|
+
/* @__PURE__ */ o("div", { className: n.logoExternalContainer, children: [
|
|
271
|
+
/* @__PURE__ */ e(
|
|
272
|
+
L,
|
|
273
|
+
{
|
|
274
|
+
size: "x-small",
|
|
275
|
+
padding: !1,
|
|
276
|
+
className: n.logoExternal
|
|
277
|
+
}
|
|
278
|
+
),
|
|
279
|
+
/* @__PURE__ */ e(
|
|
280
|
+
L,
|
|
281
|
+
{
|
|
282
|
+
size: "small",
|
|
283
|
+
padding: !1,
|
|
284
|
+
className: n.logoExternalDesktop
|
|
285
|
+
}
|
|
286
|
+
),
|
|
287
|
+
/* @__PURE__ */ o("div", { children: [
|
|
288
|
+
/* @__PURE__ */ e("p", { className: n.userName, children: t.name }),
|
|
289
|
+
/* @__PURE__ */ e("p", { className: n.userTitle, children: t.title })
|
|
290
|
+
] })
|
|
291
|
+
] }),
|
|
292
|
+
/* @__PURE__ */ e("div", { className: n.headerItems, children: d })
|
|
293
|
+
] }) }) : /* @__PURE__ */ o(
|
|
294
|
+
"header",
|
|
295
|
+
{
|
|
296
|
+
className: n.header,
|
|
297
|
+
style: {
|
|
298
|
+
borderTop: `solid 4px ${r.color ? r.color : A.brandPrimary}`
|
|
299
|
+
},
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ o("div", { className: n.headerContent, children: [
|
|
302
|
+
/* @__PURE__ */ e("div", { className: n.logo, children: /* @__PURE__ */ e(
|
|
303
|
+
L,
|
|
304
|
+
{
|
|
305
|
+
size: "small",
|
|
306
|
+
padding: !1
|
|
307
|
+
}
|
|
308
|
+
) }),
|
|
309
|
+
i !== void 0 && /* @__PURE__ */ e(
|
|
310
|
+
E,
|
|
311
|
+
{
|
|
312
|
+
variant: "icon",
|
|
313
|
+
className: n.toggleButton,
|
|
314
|
+
"aria-label": i ? m.format("closeMenu") : m.format("openMenu"),
|
|
315
|
+
"aria-controls": _,
|
|
316
|
+
onPressStart: () => {
|
|
317
|
+
p(!1), s?.(!0);
|
|
318
|
+
},
|
|
319
|
+
children: i ? /* @__PURE__ */ e(
|
|
320
|
+
R,
|
|
321
|
+
{
|
|
322
|
+
size: 20,
|
|
323
|
+
"aria-hidden": "true"
|
|
324
|
+
}
|
|
325
|
+
) : /* @__PURE__ */ e(
|
|
326
|
+
F,
|
|
327
|
+
{
|
|
328
|
+
size: 20,
|
|
329
|
+
"aria-hidden": "true"
|
|
330
|
+
}
|
|
331
|
+
)
|
|
332
|
+
}
|
|
333
|
+
),
|
|
334
|
+
/* @__PURE__ */ o("div", { children: [
|
|
335
|
+
/* @__PURE__ */ e("p", { className: n.userName, children: t.name }),
|
|
336
|
+
/* @__PURE__ */ e("p", { className: n.userTitle, children: t.title }),
|
|
337
|
+
/* @__PURE__ */ e("p", { className: n.title, children: a })
|
|
338
|
+
] })
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ e("div", { className: n.headerItems, children: d })
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
);
|
|
344
|
+
}, B = ({
|
|
345
|
+
id: a = "main:first-of-type"
|
|
346
|
+
}) => {
|
|
347
|
+
const t = () => {
|
|
348
|
+
const i = document.querySelector(a);
|
|
349
|
+
i && (i.tabIndex = -1, i.focus(), setTimeout(() => i.removeAttribute("tabindex"), 1e3));
|
|
350
|
+
}, r = C(x);
|
|
351
|
+
return /* @__PURE__ */ e(
|
|
352
|
+
E,
|
|
353
|
+
{
|
|
354
|
+
onPress: t,
|
|
355
|
+
className: n.skipToContent,
|
|
356
|
+
children: r.format("skipToContent")
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
}, je = () => {
|
|
360
|
+
const { isOpened: a, setIsOpened: t } = k();
|
|
361
|
+
return a ? /* @__PURE__ */ e(
|
|
362
|
+
"div",
|
|
363
|
+
{
|
|
364
|
+
className: b(n.backdrop, n.backdropOpened),
|
|
365
|
+
onClick: () => {
|
|
366
|
+
t?.(!1);
|
|
367
|
+
},
|
|
368
|
+
"aria-hidden": !0
|
|
369
|
+
}
|
|
370
|
+
) : null;
|
|
371
|
+
}, De = () => {
|
|
372
|
+
const { items: a, clientSideRouter: t, clientSideHref: r } = k(), i = C(x), s = a.at(0)?.items;
|
|
373
|
+
return /* @__PURE__ */ e(
|
|
374
|
+
"nav",
|
|
375
|
+
{
|
|
376
|
+
className: n.navbar,
|
|
377
|
+
"aria-label": i.format("bottomMenu"),
|
|
378
|
+
children: s && /* @__PURE__ */ e("ul", { className: b(n.navbarList), children: t ? /* @__PURE__ */ e(
|
|
379
|
+
w,
|
|
380
|
+
{
|
|
381
|
+
navigate: t,
|
|
382
|
+
useHref: r,
|
|
383
|
+
children: /* @__PURE__ */ e(O, { items: s })
|
|
384
|
+
}
|
|
385
|
+
) : /* @__PURE__ */ e(O, { items: s }) })
|
|
386
|
+
}
|
|
387
|
+
);
|
|
388
|
+
}, O = ({
|
|
389
|
+
items: a
|
|
390
|
+
}) => /* @__PURE__ */ e(G, { children: a.map(({ href: t, active: r, icon: i, title: s, hasBadge: p }, d) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
|
|
391
|
+
y,
|
|
392
|
+
{
|
|
393
|
+
href: t,
|
|
394
|
+
className: b(n.navbarItem),
|
|
395
|
+
"data-active": r,
|
|
396
|
+
"aria-current": r && "page",
|
|
397
|
+
children: [
|
|
398
|
+
/* @__PURE__ */ o(I, { children: [
|
|
399
|
+
/* @__PURE__ */ e(i, { size: 20 }),
|
|
400
|
+
p && /* @__PURE__ */ e(M, {})
|
|
401
|
+
] }),
|
|
402
|
+
s
|
|
403
|
+
]
|
|
404
|
+
}
|
|
405
|
+
) }, d)) }), c = ({
|
|
406
|
+
items: a,
|
|
407
|
+
title: t,
|
|
408
|
+
user: r,
|
|
409
|
+
app: i,
|
|
410
|
+
children: s,
|
|
411
|
+
headerChildren: p,
|
|
412
|
+
clientSideRouter: d,
|
|
413
|
+
clientSideHref: v,
|
|
414
|
+
variant: _,
|
|
415
|
+
className: m,
|
|
416
|
+
onSidebarLinkClick: h
|
|
417
|
+
}) => {
|
|
418
|
+
const [N, l] = f.useState(!1), [u, g] = f.useState(!1), S = f.useId();
|
|
419
|
+
return _ === "external" ? /* @__PURE__ */ e(
|
|
420
|
+
c.Provider,
|
|
421
|
+
{
|
|
422
|
+
items: a,
|
|
423
|
+
title: t,
|
|
424
|
+
user: r,
|
|
425
|
+
app: i,
|
|
426
|
+
clientSideRouter: d,
|
|
427
|
+
clientSideHref: v,
|
|
428
|
+
headerChildren: p,
|
|
429
|
+
isCollapsed: N,
|
|
430
|
+
setIsCollapsed: l,
|
|
431
|
+
variant: _,
|
|
432
|
+
id: S,
|
|
433
|
+
children: /* @__PURE__ */ o("div", { className: b(n.baseLayout, m), children: [
|
|
434
|
+
/* @__PURE__ */ e(B, {}),
|
|
435
|
+
/* @__PURE__ */ e(c.Header, {}),
|
|
436
|
+
/* @__PURE__ */ o("div", { className: n.mainContent, children: [
|
|
437
|
+
/* @__PURE__ */ e(c.Sidebar, { onLinkClick: h }),
|
|
438
|
+
/* @__PURE__ */ e(z, { children: /* @__PURE__ */ e("main", { className: n.main, children: /* @__PURE__ */ e("div", { className: n.app, children: s }) }) }),
|
|
439
|
+
/* @__PURE__ */ e(c.Backdrop, {})
|
|
440
|
+
] }),
|
|
441
|
+
/* @__PURE__ */ e("div", { className: n.navbarWrapper, children: /* @__PURE__ */ e(c.Navbar, {}) })
|
|
442
|
+
] })
|
|
443
|
+
}
|
|
444
|
+
) : /* @__PURE__ */ e(
|
|
445
|
+
c.Provider,
|
|
446
|
+
{
|
|
447
|
+
items: a,
|
|
448
|
+
title: t,
|
|
449
|
+
user: r,
|
|
450
|
+
app: i,
|
|
451
|
+
clientSideRouter: d,
|
|
452
|
+
clientSideHref: v,
|
|
453
|
+
headerChildren: p,
|
|
454
|
+
isCollapsed: N,
|
|
455
|
+
setIsCollapsed: l,
|
|
456
|
+
isOpened: u,
|
|
457
|
+
setIsOpened: g,
|
|
458
|
+
variant: _,
|
|
459
|
+
id: S,
|
|
460
|
+
children: /* @__PURE__ */ o("div", { className: b(n.baseLayout, m), children: [
|
|
461
|
+
/* @__PURE__ */ e(B, {}),
|
|
462
|
+
/* @__PURE__ */ e(c.Header, {}),
|
|
463
|
+
/* @__PURE__ */ o("div", { className: n.mainContent, children: [
|
|
464
|
+
/* @__PURE__ */ e(c.Sidebar, { onLinkClick: h }),
|
|
465
|
+
/* @__PURE__ */ e(z, { children: /* @__PURE__ */ e("main", { className: n.main, children: /* @__PURE__ */ e("div", { className: n.app, children: s }) }) }),
|
|
466
|
+
/* @__PURE__ */ e(c.Backdrop, {})
|
|
467
|
+
] })
|
|
468
|
+
] })
|
|
469
|
+
}
|
|
470
|
+
);
|
|
471
|
+
};
|
|
472
|
+
c.Provider = we;
|
|
473
|
+
c.Header = We;
|
|
474
|
+
c.Sidebar = Ge;
|
|
475
|
+
c.SidebarLink = H;
|
|
476
|
+
c.Navbar = De;
|
|
477
|
+
c.Backdrop = je;
|
|
478
|
+
export {
|
|
479
|
+
We as H,
|
|
480
|
+
c as L,
|
|
481
|
+
De as N,
|
|
482
|
+
Ge as S,
|
|
483
|
+
H as a
|
|
484
|
+
};
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { A as s, a as p } from "./chunks/AccordionItem-CSvARy63.js";
|
|
3
3
|
import { B as m, a as i } from "./chunks/BadgeContainer-CKVsfTlF.js";
|
|
4
|
-
import { B as
|
|
4
|
+
import { B as n, a as d } from "./chunks/Breadcrumb-BQ_nyDfo.js";
|
|
5
5
|
import { B as c } from "./chunks/Button-CaLOUTDO.js";
|
|
6
6
|
import { B as u } from "./chunks/ButtonGroup-Dr6HOBo2.js";
|
|
7
7
|
import { C, R as b } from "./chunks/RangeCalendar-h9wkh43W.js";
|
|
@@ -21,7 +21,7 @@ import { G as eo } from "./chunks/GridItem-z7zclNdT.js";
|
|
|
21
21
|
import { H as so } from "./chunks/Heading-D8tNNJkt.js";
|
|
22
22
|
import { I as xo } from "./chunks/InfoBanner-C4HnaXQO.js";
|
|
23
23
|
import { L as io } from "./chunks/Label-6GZmmff9.js";
|
|
24
|
-
import { H as
|
|
24
|
+
import { H as no, L as To, N as co, S as lo, a as uo } from "./chunks/Layout-CFhqS9ej.js";
|
|
25
25
|
import { L as Co } from "./chunks/Link-rqGQvFQq.js";
|
|
26
26
|
import { L as Bo } from "./chunks/LinkButton-B1zayj7k.js";
|
|
27
27
|
import { L as So } from "./chunks/Logo-CCxPAmgw.js";
|
|
@@ -39,17 +39,18 @@ import { T as Xo, a as Yo, b as _o, c as $o } from "./chunks/TabList-BaR443mu.js
|
|
|
39
39
|
import { T as aa, a as ra } from "./chunks/Tag-C7VZ0T0o.js";
|
|
40
40
|
import { T as ta } from "./chunks/Text-Bxww8mmL.js";
|
|
41
41
|
import { I as pa, T as xa, a as ma, b as ia } from "./chunks/TextArea-Bb7H-w23.js";
|
|
42
|
-
import { G as
|
|
42
|
+
import { G as na, T as da, a as Ta, b as ca, t as la } from "./chunks/Toast-D7PXIDa9.js";
|
|
43
43
|
import { T as ga, a as Ca } from "./chunks/ToggleButtonGroup-CXKTrLbb.js";
|
|
44
44
|
import { T as Ba, a as La } from "./chunks/Tooltip-rDmOkGmX.js";
|
|
45
45
|
import { L as Ia } from "./chunks/ListBox-D5BBeZWL.js";
|
|
46
46
|
import { L as Ra, a as Ga } from "./chunks/ListBoxLoadMoreItem-ufPaJaNS.js";
|
|
47
47
|
import { L as ka, a as va, b as Fa, c as Ma } from "./chunks/ListBoxSection-C4y3K7T5.js";
|
|
48
48
|
import { M as ha, a as Ha, b as ya, c as Na, S as wa } from "./chunks/Separator-XIzn8lsq.js";
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
|
|
49
|
+
import { c as za } from "./chunks/clsx-AexbMWKp.js";
|
|
50
|
+
import { DialogTrigger as Qa, MenuTrigger as Va, RouterProvider as Za } from "react-aria-components";
|
|
51
|
+
import { u as qa } from "./chunks/useLocalizedStringFormatter-BHvsRxDk.js";
|
|
52
|
+
import { useToastState as Ka } from "react-stately";
|
|
53
|
+
const o = "16.8.1", a = {
|
|
53
54
|
version: o
|
|
54
55
|
}, r = a.version;
|
|
55
56
|
export {
|
|
@@ -57,7 +58,7 @@ export {
|
|
|
57
58
|
p as AccordionItem,
|
|
58
59
|
m as Badge,
|
|
59
60
|
i as BadgeContainer,
|
|
60
|
-
|
|
61
|
+
n as Breadcrumb,
|
|
61
62
|
d as Breadcrumbs,
|
|
62
63
|
c as Button,
|
|
63
64
|
u as ButtonGroup,
|
|
@@ -84,14 +85,14 @@ export {
|
|
|
84
85
|
K as DatePicker,
|
|
85
86
|
U as DateRangePicker,
|
|
86
87
|
q as DateSegment,
|
|
87
|
-
|
|
88
|
+
Qa as DialogTrigger,
|
|
88
89
|
_ as DropZone,
|
|
89
90
|
X as FieldError,
|
|
90
91
|
$ as FileTrigger,
|
|
91
|
-
|
|
92
|
+
na as GlobalToastRegion,
|
|
92
93
|
ao as Grid,
|
|
93
94
|
eo as GridItem,
|
|
94
|
-
|
|
95
|
+
no as Header,
|
|
95
96
|
so as Heading,
|
|
96
97
|
xo as InfoBanner,
|
|
97
98
|
pa as Input,
|
|
@@ -112,7 +113,7 @@ export {
|
|
|
112
113
|
Ha as MenuItem,
|
|
113
114
|
ya as MenuPopover,
|
|
114
115
|
Na as MenuSection,
|
|
115
|
-
|
|
116
|
+
Va as MenuTrigger,
|
|
116
117
|
Do as Modal,
|
|
117
118
|
co as Navbar,
|
|
118
119
|
Go as Popover,
|
|
@@ -120,7 +121,7 @@ export {
|
|
|
120
121
|
Fo as Radio,
|
|
121
122
|
Mo as RadioGroup,
|
|
122
123
|
b as RangeCalendar,
|
|
123
|
-
|
|
124
|
+
Za as RouterProvider,
|
|
124
125
|
qo as Row,
|
|
125
126
|
ho as SearchField,
|
|
126
127
|
yo as Select,
|
|
@@ -150,7 +151,8 @@ export {
|
|
|
150
151
|
Ba as Tooltip,
|
|
151
152
|
La as TooltipTrigger,
|
|
152
153
|
r as VERSION,
|
|
154
|
+
za as clsx,
|
|
153
155
|
la as toastQueue,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
qa as useLocalizedStringFormatter,
|
|
157
|
+
Ka as useToastState
|
|
156
158
|
};
|
package/layout/Layout.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ export interface SidebarLinkGroup {
|
|
|
11
11
|
title?: string;
|
|
12
12
|
items: SidebarLinkProps[];
|
|
13
13
|
}
|
|
14
|
+
export type SidebarLinkClickData = {
|
|
15
|
+
title: string;
|
|
16
|
+
href: string;
|
|
17
|
+
};
|
|
14
18
|
export interface SidebarLinkProps {
|
|
15
19
|
title: string;
|
|
16
20
|
href: string;
|
|
@@ -19,6 +23,7 @@ export interface SidebarLinkProps {
|
|
|
19
23
|
hasBadge?: boolean;
|
|
20
24
|
isCollapsed?: boolean;
|
|
21
25
|
setIsOpened?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
26
|
+
onClick?: (e: SidebarLinkClickData) => void;
|
|
22
27
|
}
|
|
23
28
|
export interface SidebarUser {
|
|
24
29
|
name: string;
|
|
@@ -54,6 +59,8 @@ export interface MidasLayout {
|
|
|
54
59
|
clientSideHref?: (href: Href) => string;
|
|
55
60
|
variant: 'internal' | 'external';
|
|
56
61
|
className?: string;
|
|
62
|
+
/** Event triggered when sidebar link is clicked. */
|
|
63
|
+
onSidebarLinkClick?: (e: SidebarLinkClickData) => void;
|
|
57
64
|
}
|
|
58
65
|
export declare const Layout: React.FC<MidasLayout> & {
|
|
59
66
|
Provider: typeof LayoutProvider;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
import { SidebarLinkClickData } from '../Layout';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
+
type SidebarProps = {
|
|
4
|
+
onLinkClick?: (e: SidebarLinkClickData) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const Sidebar: React.FC<SidebarProps>;
|
|
7
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SidebarLinkProps } from '../Layout';
|
|
2
|
-
export declare const SidebarLink: ({ title, href, icon: IconComponent, active, hasBadge, }: SidebarLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const SidebarLink: ({ title, href, icon: IconComponent, active, hasBadge, onClick, }: SidebarLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SidebarLinkGroup, SidebarUser, App } from '../Layout';
|
|
2
2
|
import { Href } from '@react-types/shared';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
interface LayoutContextProps {
|
|
4
|
+
export interface LayoutContextProps {
|
|
5
5
|
items: SidebarLinkGroup[];
|
|
6
6
|
title: string;
|
|
7
7
|
user: SidebarUser;
|
|
@@ -20,4 +20,3 @@ export declare const LayoutProvider: React.FC<LayoutContextProps & {
|
|
|
20
20
|
children: React.ReactNode;
|
|
21
21
|
}>;
|
|
22
22
|
export declare const useLayoutContext: () => LayoutContextProps;
|
|
23
|
-
export {};
|
package/layout/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,467 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as e, jsxs as r, Fragment as H } from "react/jsx-runtime";
|
|
3
|
-
import { G as S } from "./GridItem-z7zclNdT.js";
|
|
4
|
-
import * as N from "react";
|
|
5
|
-
import { useState as G, useEffect as W } from "react";
|
|
6
|
-
import { c as u } from "./clsx-AexbMWKp.js";
|
|
7
|
-
import { Link as L, RouterProvider as O } from "react-aria-components";
|
|
8
|
-
import { B as M } from "./Button-CaLOUTDO.js";
|
|
9
|
-
import { a as j, T as D } from "./Tooltip-rDmOkGmX.js";
|
|
10
|
-
import { a as y, B as I } from "./BadgeContainer-CKVsfTlF.js";
|
|
11
|
-
import { c as E } from "./createLucideIcon-CP-mMPfa.js";
|
|
12
|
-
import { u as C } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
13
|
-
import { variables as q } from "@midas-ds/theme";
|
|
14
|
-
import { L as g } from "./Logo-CCxPAmgw.js";
|
|
15
|
-
import { X as A } from "./x-B9bYxG31.js";
|
|
16
|
-
import '../assets/Layout.css';const R = [
|
|
17
|
-
["path", { d: "M4 5h16", key: "1tepv9" }],
|
|
18
|
-
["path", { d: "M4 12h16", key: "1lakjw" }],
|
|
19
|
-
["path", { d: "M4 19h16", key: "1djgab" }]
|
|
20
|
-
], $ = E("menu", R);
|
|
21
|
-
const F = [
|
|
22
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
23
|
-
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
24
|
-
["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
|
|
25
|
-
], X = E("panel-left-close", F);
|
|
26
|
-
const J = [
|
|
27
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
28
|
-
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
29
|
-
["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
|
|
30
|
-
], K = E("panel-left-open", J), Q = "_baseLayout_1n71v_1", U = "_mainContent_1n71v_10", V = "_header_1n71v_15", Y = "_headerExternal_1n71v_26", Z = "_headerContent_1n71v_41", ee = "_logo_1n71v_60", ae = "_headerItems_1n71v_69", ne = "_toggleButton_1n71v_75", te = "_sidebar_1n71v_83", se = "_main_1n71v_10", ie = "_app_1n71v_116", re = "_sidebarOpened_1n71v_124", oe = "_sidebarHeader_1n71v_128", le = "_appName_1n71v_140", de = "_collapseButton_1n71v_147", ce = "_sidebarCollapsed_1n71v_156", me = "_userName_1n71v_166", pe = "_userTitle_1n71v_184", _e = "_title_1n71v_196", ve = "_sidebarNav_1n71v_207", ue = "_list_1n71v_213", he = "_listGroupTitle_1n71v_219", be = "_listItem_1n71v_226", Ne = "_listItemCollapsed_1n71v_231", fe = "_listLink_1n71v_235", ke = "_listLinkCollapsed_1n71v_298", Ce = "_active_1n71v_303", xe = "_backdrop_1n71v_321", ge = "_backdropOpened_1n71v_331", Le = "_skipToContent_1n71v_349", ye = "_navbar_1n71v_363", Ie = "_navbarList_1n71v_375", Me = "_navbarItem_1n71v_397", Ee = "_headerContentExternal_1n71v_448", Te = "_logoExternalContainer_1n71v_456", Se = "_logoExternal_1n71v_456", ze = "_logoExternalDesktop_1n71v_468", Be = "_navbarWrapper_1n71v_477", a = {
|
|
31
|
-
baseLayout: Q,
|
|
32
|
-
mainContent: U,
|
|
33
|
-
header: V,
|
|
34
|
-
headerExternal: Y,
|
|
35
|
-
headerContent: Z,
|
|
36
|
-
logo: ee,
|
|
37
|
-
headerItems: ae,
|
|
38
|
-
toggleButton: ne,
|
|
39
|
-
sidebar: te,
|
|
40
|
-
main: se,
|
|
41
|
-
app: ie,
|
|
42
|
-
sidebarOpened: re,
|
|
43
|
-
sidebarHeader: oe,
|
|
44
|
-
appName: le,
|
|
45
|
-
collapseButton: de,
|
|
46
|
-
sidebarCollapsed: ce,
|
|
47
|
-
userName: me,
|
|
48
|
-
userTitle: pe,
|
|
49
|
-
title: _e,
|
|
50
|
-
sidebarNav: ve,
|
|
51
|
-
list: ue,
|
|
52
|
-
listGroupTitle: he,
|
|
53
|
-
listItem: be,
|
|
54
|
-
listItemCollapsed: Ne,
|
|
55
|
-
listLink: fe,
|
|
56
|
-
listLinkCollapsed: ke,
|
|
57
|
-
active: Ce,
|
|
58
|
-
backdrop: xe,
|
|
59
|
-
backdropOpened: ge,
|
|
60
|
-
skipToContent: Le,
|
|
61
|
-
navbar: ye,
|
|
62
|
-
navbarList: Ie,
|
|
63
|
-
navbarItem: Me,
|
|
64
|
-
headerContentExternal: Ee,
|
|
65
|
-
logoExternalContainer: Te,
|
|
66
|
-
logoExternal: Se,
|
|
67
|
-
logoExternalDesktop: ze,
|
|
68
|
-
navbarWrapper: Be
|
|
69
|
-
}, w = N.createContext(
|
|
70
|
-
void 0
|
|
71
|
-
), Oe = ({
|
|
72
|
-
items: t,
|
|
73
|
-
title: s,
|
|
74
|
-
user: i,
|
|
75
|
-
app: n,
|
|
76
|
-
children: o,
|
|
77
|
-
clientSideRouter: m,
|
|
78
|
-
clientSideHref: d,
|
|
79
|
-
headerChildren: v,
|
|
80
|
-
isCollapsed: _,
|
|
81
|
-
setIsCollapsed: p,
|
|
82
|
-
isOpened: h,
|
|
83
|
-
setIsOpened: l,
|
|
84
|
-
variant: b,
|
|
85
|
-
id: f
|
|
86
|
-
}) => /* @__PURE__ */ e(
|
|
87
|
-
w.Provider,
|
|
88
|
-
{
|
|
89
|
-
value: {
|
|
90
|
-
items: t,
|
|
91
|
-
title: s,
|
|
92
|
-
user: i,
|
|
93
|
-
app: n,
|
|
94
|
-
headerChildren: v,
|
|
95
|
-
isCollapsed: _,
|
|
96
|
-
setIsCollapsed: p,
|
|
97
|
-
isOpened: h,
|
|
98
|
-
setIsOpened: l,
|
|
99
|
-
clientSideRouter: m,
|
|
100
|
-
clientSideHref: d,
|
|
101
|
-
variant: b,
|
|
102
|
-
id: f
|
|
103
|
-
},
|
|
104
|
-
children: o
|
|
105
|
-
}
|
|
106
|
-
), k = () => {
|
|
107
|
-
const t = N.useContext(w);
|
|
108
|
-
if (!t)
|
|
109
|
-
throw new Error("useLayoutContext must be used within a LayoutProvider");
|
|
110
|
-
return t;
|
|
111
|
-
}, P = ({
|
|
112
|
-
title: t,
|
|
113
|
-
href: s,
|
|
114
|
-
icon: i,
|
|
115
|
-
active: n,
|
|
116
|
-
hasBadge: o
|
|
117
|
-
}) => {
|
|
118
|
-
const { isCollapsed: m, setIsOpened: d, clientSideHref: v } = k(), _ = v ? v(s) : s, [p, h] = G(!1);
|
|
119
|
-
return W(() => {
|
|
120
|
-
if (typeof window < "u") {
|
|
121
|
-
const l = window.location.pathname === _ || window.location.pathname.startsWith(_ + "/");
|
|
122
|
-
h(n ?? l);
|
|
123
|
-
}
|
|
124
|
-
}, [n, _]), m ? /* @__PURE__ */ r(j, { children: [
|
|
125
|
-
/* @__PURE__ */ e(
|
|
126
|
-
L,
|
|
127
|
-
{
|
|
128
|
-
href: s,
|
|
129
|
-
"aria-label": t,
|
|
130
|
-
className: u(
|
|
131
|
-
a.listLink,
|
|
132
|
-
a.listLinkCollapsed,
|
|
133
|
-
p && a.active
|
|
134
|
-
),
|
|
135
|
-
onPress: () => d?.(!1),
|
|
136
|
-
children: /* @__PURE__ */ r(y, { children: [
|
|
137
|
-
/* @__PURE__ */ e(
|
|
138
|
-
i,
|
|
139
|
-
{
|
|
140
|
-
size: 20,
|
|
141
|
-
"aria-label": t
|
|
142
|
-
}
|
|
143
|
-
),
|
|
144
|
-
o && /* @__PURE__ */ e(I, {})
|
|
145
|
-
] })
|
|
146
|
-
}
|
|
147
|
-
),
|
|
148
|
-
/* @__PURE__ */ e(D, { placement: "right", children: t })
|
|
149
|
-
] }) : /* @__PURE__ */ r(
|
|
150
|
-
L,
|
|
151
|
-
{
|
|
152
|
-
href: s,
|
|
153
|
-
"aria-label": t,
|
|
154
|
-
className: u(a.listLink, p && a.active),
|
|
155
|
-
onPress: () => d?.(!1),
|
|
156
|
-
children: [
|
|
157
|
-
/* @__PURE__ */ r(y, { children: [
|
|
158
|
-
/* @__PURE__ */ e(i, { size: 20 }),
|
|
159
|
-
o && /* @__PURE__ */ e(I, {})
|
|
160
|
-
] }),
|
|
161
|
-
t
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
);
|
|
165
|
-
}, we = { closeMenu: "Close menu", openMenu: "Open menu", maximizeMenu: "Maximize menu", minimizeMenu: "Minimize menu", sidebarMenu: "Sidebar menu", bottomMenu: "Bottom menu", skipToContent: "Skip to main content" }, Pe = { closeMenu: "Stäng meny", openMenu: "Öppna meny", maximizeMenu: "Maximera meny", minimizeMenu: "Minimera meny", sidebarMenu: "Sidomeny", bottomMenu: "Bottenmeny", skipToContent: "Hoppa till huvudinnehåll" }, x = {
|
|
166
|
-
en: we,
|
|
167
|
-
sv: Pe
|
|
168
|
-
}, He = () => {
|
|
169
|
-
const {
|
|
170
|
-
items: t,
|
|
171
|
-
app: s,
|
|
172
|
-
isOpened: i,
|
|
173
|
-
isCollapsed: n,
|
|
174
|
-
setIsCollapsed: o,
|
|
175
|
-
setIsOpened: m,
|
|
176
|
-
clientSideRouter: d,
|
|
177
|
-
clientSideHref: v,
|
|
178
|
-
id: _
|
|
179
|
-
} = k(), p = C(x), h = ({ group: l }) => /* @__PURE__ */ e("ul", { className: a.list, children: l.items.map((b, f) => /* @__PURE__ */ e(
|
|
180
|
-
"li",
|
|
181
|
-
{
|
|
182
|
-
className: u(
|
|
183
|
-
a.listItem,
|
|
184
|
-
n && a.listItemCollapsed
|
|
185
|
-
),
|
|
186
|
-
children: /* @__PURE__ */ e(P, { ...b })
|
|
187
|
-
},
|
|
188
|
-
"link_" + f
|
|
189
|
-
)) });
|
|
190
|
-
return N.useEffect(() => {
|
|
191
|
-
const l = (b) => {
|
|
192
|
-
b.key === "Escape" && m !== void 0 && m(!1);
|
|
193
|
-
};
|
|
194
|
-
return window.addEventListener("keydown", l), () => {
|
|
195
|
-
window.removeEventListener("keydown", l);
|
|
196
|
-
};
|
|
197
|
-
}, [m]), /* @__PURE__ */ r(
|
|
198
|
-
"aside",
|
|
199
|
-
{
|
|
200
|
-
id: _,
|
|
201
|
-
className: u(
|
|
202
|
-
a.sidebar,
|
|
203
|
-
n && a.sidebarCollapsed,
|
|
204
|
-
i && a.sidebarOpened
|
|
205
|
-
),
|
|
206
|
-
children: [
|
|
207
|
-
/* @__PURE__ */ r("div", { className: a.sidebarHeader, children: [
|
|
208
|
-
!n && /* @__PURE__ */ e("p", { className: a.appName, children: s.name }),
|
|
209
|
-
/* @__PURE__ */ e(
|
|
210
|
-
M,
|
|
211
|
-
{
|
|
212
|
-
variant: "icon",
|
|
213
|
-
"aria-label": n ? p.format("maximizeMenu") : p.format("minimizeMenu"),
|
|
214
|
-
onPress: () => o(!n),
|
|
215
|
-
className: a.collapseButton,
|
|
216
|
-
children: n ? /* @__PURE__ */ e(K, { size: 20 }) : /* @__PURE__ */ e(X, { size: 20 })
|
|
217
|
-
}
|
|
218
|
-
)
|
|
219
|
-
] }),
|
|
220
|
-
/* @__PURE__ */ e(
|
|
221
|
-
"nav",
|
|
222
|
-
{
|
|
223
|
-
className: a.sidebarNav,
|
|
224
|
-
"aria-label": p.format("sidebarMenu"),
|
|
225
|
-
children: /* @__PURE__ */ e("ul", { className: a.list, children: t.map((l, b) => /* @__PURE__ */ r("li", { children: [
|
|
226
|
-
l.title && !n && /* @__PURE__ */ e("p", { className: a.listGroupTitle, children: l.title }),
|
|
227
|
-
d ? /* @__PURE__ */ e(
|
|
228
|
-
O,
|
|
229
|
-
{
|
|
230
|
-
navigate: d,
|
|
231
|
-
useHref: v,
|
|
232
|
-
children: /* @__PURE__ */ e(h, { group: l })
|
|
233
|
-
}
|
|
234
|
-
) : /* @__PURE__ */ e(h, { group: l })
|
|
235
|
-
] }, "list_" + b)) })
|
|
236
|
-
}
|
|
237
|
-
)
|
|
238
|
-
]
|
|
239
|
-
}
|
|
240
|
-
);
|
|
241
|
-
}, Ge = () => {
|
|
242
|
-
const {
|
|
243
|
-
title: t,
|
|
244
|
-
user: s,
|
|
245
|
-
app: i,
|
|
246
|
-
isOpened: n,
|
|
247
|
-
setIsOpened: o,
|
|
248
|
-
setIsCollapsed: m,
|
|
249
|
-
headerChildren: d,
|
|
250
|
-
variant: v,
|
|
251
|
-
id: _
|
|
252
|
-
} = k(), p = C(x);
|
|
253
|
-
return v === "external" ? /* @__PURE__ */ e("header", { className: u(a.header, a.headerExternal), children: /* @__PURE__ */ r("div", { className: a.headerContentExternal, children: [
|
|
254
|
-
/* @__PURE__ */ r("div", { className: a.logoExternalContainer, children: [
|
|
255
|
-
/* @__PURE__ */ e(
|
|
256
|
-
g,
|
|
257
|
-
{
|
|
258
|
-
size: "x-small",
|
|
259
|
-
padding: !1,
|
|
260
|
-
className: a.logoExternal
|
|
261
|
-
}
|
|
262
|
-
),
|
|
263
|
-
/* @__PURE__ */ e(
|
|
264
|
-
g,
|
|
265
|
-
{
|
|
266
|
-
size: "small",
|
|
267
|
-
padding: !1,
|
|
268
|
-
className: a.logoExternalDesktop
|
|
269
|
-
}
|
|
270
|
-
),
|
|
271
|
-
/* @__PURE__ */ r("div", { children: [
|
|
272
|
-
/* @__PURE__ */ e("p", { className: a.userName, children: s.name }),
|
|
273
|
-
/* @__PURE__ */ e("p", { className: a.userTitle, children: s.title })
|
|
274
|
-
] })
|
|
275
|
-
] }),
|
|
276
|
-
/* @__PURE__ */ e("div", { className: a.headerItems, children: d })
|
|
277
|
-
] }) }) : /* @__PURE__ */ r(
|
|
278
|
-
"header",
|
|
279
|
-
{
|
|
280
|
-
className: a.header,
|
|
281
|
-
style: {
|
|
282
|
-
borderTop: `solid 4px ${i.color ? i.color : q.brandPrimary}`
|
|
283
|
-
},
|
|
284
|
-
children: [
|
|
285
|
-
/* @__PURE__ */ r("div", { className: a.headerContent, children: [
|
|
286
|
-
/* @__PURE__ */ e("div", { className: a.logo, children: /* @__PURE__ */ e(
|
|
287
|
-
g,
|
|
288
|
-
{
|
|
289
|
-
size: "small",
|
|
290
|
-
padding: !1
|
|
291
|
-
}
|
|
292
|
-
) }),
|
|
293
|
-
n !== void 0 && /* @__PURE__ */ e(
|
|
294
|
-
M,
|
|
295
|
-
{
|
|
296
|
-
variant: "icon",
|
|
297
|
-
className: a.toggleButton,
|
|
298
|
-
"aria-label": n ? p.format("closeMenu") : p.format("openMenu"),
|
|
299
|
-
"aria-controls": _,
|
|
300
|
-
onPressStart: () => {
|
|
301
|
-
m(!1), o?.(!0);
|
|
302
|
-
},
|
|
303
|
-
children: n ? /* @__PURE__ */ e(
|
|
304
|
-
A,
|
|
305
|
-
{
|
|
306
|
-
size: 20,
|
|
307
|
-
"aria-hidden": "true"
|
|
308
|
-
}
|
|
309
|
-
) : /* @__PURE__ */ e(
|
|
310
|
-
$,
|
|
311
|
-
{
|
|
312
|
-
size: 20,
|
|
313
|
-
"aria-hidden": "true"
|
|
314
|
-
}
|
|
315
|
-
)
|
|
316
|
-
}
|
|
317
|
-
),
|
|
318
|
-
/* @__PURE__ */ r("div", { children: [
|
|
319
|
-
/* @__PURE__ */ e("p", { className: a.userName, children: s.name }),
|
|
320
|
-
/* @__PURE__ */ e("p", { className: a.userTitle, children: s.title }),
|
|
321
|
-
/* @__PURE__ */ e("p", { className: a.title, children: t })
|
|
322
|
-
] })
|
|
323
|
-
] }),
|
|
324
|
-
/* @__PURE__ */ e("div", { className: a.headerItems, children: d })
|
|
325
|
-
]
|
|
326
|
-
}
|
|
327
|
-
);
|
|
328
|
-
}, z = ({
|
|
329
|
-
id: t = "main:first-of-type"
|
|
330
|
-
}) => {
|
|
331
|
-
const s = () => {
|
|
332
|
-
const n = document.querySelector(t);
|
|
333
|
-
n && (n.tabIndex = -1, n.focus(), setTimeout(() => n.removeAttribute("tabindex"), 1e3));
|
|
334
|
-
}, i = C(x);
|
|
335
|
-
return /* @__PURE__ */ e(
|
|
336
|
-
M,
|
|
337
|
-
{
|
|
338
|
-
onPress: s,
|
|
339
|
-
className: a.skipToContent,
|
|
340
|
-
children: i.format("skipToContent")
|
|
341
|
-
}
|
|
342
|
-
);
|
|
343
|
-
}, We = () => {
|
|
344
|
-
const { isOpened: t, setIsOpened: s } = k();
|
|
345
|
-
return t ? /* @__PURE__ */ e(
|
|
346
|
-
"div",
|
|
347
|
-
{
|
|
348
|
-
className: u(a.backdrop, a.backdropOpened),
|
|
349
|
-
onClick: () => {
|
|
350
|
-
s?.(!1);
|
|
351
|
-
},
|
|
352
|
-
"aria-hidden": !0
|
|
353
|
-
}
|
|
354
|
-
) : null;
|
|
355
|
-
}, je = () => {
|
|
356
|
-
const { items: t, clientSideRouter: s, clientSideHref: i } = k(), n = C(x), o = t.at(0)?.items;
|
|
357
|
-
return /* @__PURE__ */ e(
|
|
358
|
-
"nav",
|
|
359
|
-
{
|
|
360
|
-
className: a.navbar,
|
|
361
|
-
"aria-label": n.format("bottomMenu"),
|
|
362
|
-
children: o && /* @__PURE__ */ e("ul", { className: u(a.navbarList), children: s ? /* @__PURE__ */ e(
|
|
363
|
-
O,
|
|
364
|
-
{
|
|
365
|
-
navigate: s,
|
|
366
|
-
useHref: i,
|
|
367
|
-
children: /* @__PURE__ */ e(B, { items: o })
|
|
368
|
-
}
|
|
369
|
-
) : /* @__PURE__ */ e(B, { items: o }) })
|
|
370
|
-
}
|
|
371
|
-
);
|
|
372
|
-
}, B = ({
|
|
373
|
-
items: t
|
|
374
|
-
}) => /* @__PURE__ */ e(H, { children: t.map(({ href: s, active: i, icon: n, title: o, hasBadge: m }, d) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ r(
|
|
375
|
-
L,
|
|
376
|
-
{
|
|
377
|
-
href: s,
|
|
378
|
-
className: u(a.navbarItem),
|
|
379
|
-
"data-active": i,
|
|
380
|
-
"aria-current": i && "page",
|
|
381
|
-
children: [
|
|
382
|
-
/* @__PURE__ */ r(y, { children: [
|
|
383
|
-
/* @__PURE__ */ e(n, { size: 20 }),
|
|
384
|
-
m && /* @__PURE__ */ e(I, {})
|
|
385
|
-
] }),
|
|
386
|
-
o
|
|
387
|
-
]
|
|
388
|
-
}
|
|
389
|
-
) }, d)) }), c = ({
|
|
390
|
-
items: t,
|
|
391
|
-
title: s,
|
|
392
|
-
user: i,
|
|
393
|
-
app: n,
|
|
394
|
-
children: o,
|
|
395
|
-
headerChildren: m,
|
|
396
|
-
clientSideRouter: d,
|
|
397
|
-
clientSideHref: v,
|
|
398
|
-
variant: _,
|
|
399
|
-
className: p
|
|
400
|
-
}) => {
|
|
401
|
-
const [h, l] = N.useState(!1), [b, f] = N.useState(!1), T = N.useId();
|
|
402
|
-
return _ === "external" ? /* @__PURE__ */ e(
|
|
403
|
-
c.Provider,
|
|
404
|
-
{
|
|
405
|
-
items: t,
|
|
406
|
-
title: s,
|
|
407
|
-
user: i,
|
|
408
|
-
app: n,
|
|
409
|
-
clientSideRouter: d,
|
|
410
|
-
clientSideHref: v,
|
|
411
|
-
headerChildren: m,
|
|
412
|
-
isCollapsed: h,
|
|
413
|
-
setIsCollapsed: l,
|
|
414
|
-
variant: _,
|
|
415
|
-
id: T,
|
|
416
|
-
children: /* @__PURE__ */ r("div", { className: u(a.baseLayout, p), children: [
|
|
417
|
-
/* @__PURE__ */ e(z, {}),
|
|
418
|
-
/* @__PURE__ */ e(c.Header, {}),
|
|
419
|
-
/* @__PURE__ */ r("div", { className: a.mainContent, children: [
|
|
420
|
-
/* @__PURE__ */ e(c.Sidebar, {}),
|
|
421
|
-
/* @__PURE__ */ e(S, { children: /* @__PURE__ */ e("main", { className: a.main, children: /* @__PURE__ */ e("div", { className: a.app, children: o }) }) }),
|
|
422
|
-
/* @__PURE__ */ e(c.Backdrop, {})
|
|
423
|
-
] }),
|
|
424
|
-
/* @__PURE__ */ e("div", { className: a.navbarWrapper, children: /* @__PURE__ */ e(c.Navbar, {}) })
|
|
425
|
-
] })
|
|
426
|
-
}
|
|
427
|
-
) : /* @__PURE__ */ e(
|
|
428
|
-
c.Provider,
|
|
429
|
-
{
|
|
430
|
-
items: t,
|
|
431
|
-
title: s,
|
|
432
|
-
user: i,
|
|
433
|
-
app: n,
|
|
434
|
-
clientSideRouter: d,
|
|
435
|
-
clientSideHref: v,
|
|
436
|
-
headerChildren: m,
|
|
437
|
-
isCollapsed: h,
|
|
438
|
-
setIsCollapsed: l,
|
|
439
|
-
isOpened: b,
|
|
440
|
-
setIsOpened: f,
|
|
441
|
-
variant: _,
|
|
442
|
-
id: T,
|
|
443
|
-
children: /* @__PURE__ */ r("div", { className: u(a.baseLayout, p), children: [
|
|
444
|
-
/* @__PURE__ */ e(z, {}),
|
|
445
|
-
/* @__PURE__ */ e(c.Header, {}),
|
|
446
|
-
/* @__PURE__ */ r("div", { className: a.mainContent, children: [
|
|
447
|
-
/* @__PURE__ */ e(c.Sidebar, {}),
|
|
448
|
-
/* @__PURE__ */ e(S, { children: /* @__PURE__ */ e("main", { className: a.main, children: /* @__PURE__ */ e("div", { className: a.app, children: o }) }) }),
|
|
449
|
-
/* @__PURE__ */ e(c.Backdrop, {})
|
|
450
|
-
] })
|
|
451
|
-
] })
|
|
452
|
-
}
|
|
453
|
-
);
|
|
454
|
-
};
|
|
455
|
-
c.Provider = Oe;
|
|
456
|
-
c.Header = Ge;
|
|
457
|
-
c.Sidebar = He;
|
|
458
|
-
c.SidebarLink = P;
|
|
459
|
-
c.Navbar = je;
|
|
460
|
-
c.Backdrop = We;
|
|
461
|
-
export {
|
|
462
|
-
Ge as H,
|
|
463
|
-
c as L,
|
|
464
|
-
je as N,
|
|
465
|
-
He as S,
|
|
466
|
-
P as a
|
|
467
|
-
};
|