@midas-ds/components 17.6.3 → 17.6.5
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 +16 -0
- package/chunks/{Layout-hXzqx4cY.js → Layout-CmKsh0kv.js} +131 -122
- package/index.js +2 -2
- package/layout/Layout.d.ts +2 -0
- package/layout/components/SidebarLink.d.ts +1 -1
- package/layout/index.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 17.6.5 (2026-03-09)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated theme to 3.12.6
|
|
6
|
+
|
|
7
|
+
## 17.6.4 (2026-03-09)
|
|
8
|
+
|
|
9
|
+
### 🩹 Fixes
|
|
10
|
+
|
|
11
|
+
- **components, layout:** add "target" to SidebarLinkProps ([dead9e36ca](https://github.com/migrationsverket/midas/commit/dead9e36ca))
|
|
12
|
+
|
|
13
|
+
### 🧪 Tests updated
|
|
14
|
+
|
|
15
|
+
- **components, layout:** add tests for target="_blank" ([8e97dc9c93](https://github.com/migrationsverket/midas/commit/8e97dc9c93))
|
|
16
|
+
|
|
1
17
|
## 17.6.3 (2026-03-09)
|
|
2
18
|
|
|
3
19
|
This was a version bump only for components to align it with other projects, there were no code changes.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as e, jsxs as o, Fragment as G } from "react/jsx-runtime";
|
|
3
|
-
import { G as
|
|
3
|
+
import { G as B } from "./GridItem-z7zclNdT.js";
|
|
4
4
|
import * as y from "react";
|
|
5
5
|
import { useState as W, useEffect as j } from "react";
|
|
6
6
|
import { c as b } from "./clsx-AexbMWKp.js";
|
|
7
|
-
import { Link as L, RouterProvider as
|
|
8
|
-
import { B as
|
|
7
|
+
import { Link as L, RouterProvider as P } from "react-aria-components";
|
|
8
|
+
import { B as T } from "./Button-BhIvfqOc.js";
|
|
9
9
|
import { a as D, T as q } from "./Tooltip-C1bbgr2l.js";
|
|
10
10
|
import { a as I, B as M } from "./BadgeContainer-CKVsfTlF.js";
|
|
11
|
-
import { c as
|
|
12
|
-
import { u as
|
|
11
|
+
import { c as S } from "./createLucideIcon-CP-mMPfa.js";
|
|
12
|
+
import { u as k } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
13
13
|
import { variables as A } from "@midas-ds/theme";
|
|
14
14
|
import { L as g } from "./Logo-CCxPAmgw.js";
|
|
15
15
|
import { X as R } from "./x-B9bYxG31.js";
|
|
@@ -17,17 +17,17 @@ import '../assets/Layout.css';const $ = [
|
|
|
17
17
|
["path", { d: "M4 5h16", key: "1tepv9" }],
|
|
18
18
|
["path", { d: "M4 12h16", key: "1lakjw" }],
|
|
19
19
|
["path", { d: "M4 19h16", key: "1djgab" }]
|
|
20
|
-
], F =
|
|
20
|
+
], F = S("menu", $);
|
|
21
21
|
const X = [
|
|
22
22
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
23
23
|
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
24
24
|
["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
|
|
25
|
-
], J =
|
|
25
|
+
], J = S("panel-left-close", X);
|
|
26
26
|
const K = [
|
|
27
27
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
28
28
|
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
29
29
|
["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
|
|
30
|
-
], Q =
|
|
30
|
+
], Q = S("panel-left-open", K), U = "_baseLayout_1ylxx_1", V = "_mainContent_1ylxx_10", Y = "_header_1ylxx_15", Z = "_headerExternal_1ylxx_26", ee = "_headerContent_1ylxx_41", ae = "_logo_1ylxx_60", te = "_headerItems_1ylxx_69", ne = "_toggleButton_1ylxx_75", se = "_sidebar_1ylxx_83", ie = "_main_1ylxx_10", re = "_app_1ylxx_116", oe = "_sidebarOpened_1ylxx_124", le = "_sidebarHeader_1ylxx_128", de = "_appName_1ylxx_140", ce = "_collapseButton_1ylxx_147", me = "_sidebarCollapsed_1ylxx_156", pe = "_userName_1ylxx_166", _e = "_userTitle_1ylxx_184", xe = "_title_1ylxx_196", ue = "_sidebarNav_1ylxx_207", he = "_list_1ylxx_213", be = "_listGroupTitle_1ylxx_219", ve = "_listItem_1ylxx_226", ye = "_listItemCollapsed_1ylxx_231", Ne = "_listLink_1ylxx_235", fe = "_listLinkCollapsed_1ylxx_298", ke = "_active_1ylxx_303", Ce = "_backdrop_1ylxx_321", ge = "_backdropOpened_1ylxx_331", Le = "_skipToContent_1ylxx_349", Ie = "_navbar_1ylxx_363", Me = "_navbarList_1ylxx_375", Ee = "_navbarItem_1ylxx_397", Te = "_headerContentExternal_1ylxx_448", Se = "_logoExternalContainer_1ylxx_456", ze = "_logoExternal_1ylxx_456", Be = "_logoExternalDesktop_1ylxx_468", Oe = "_navbarWrapper_1ylxx_477", a = {
|
|
31
31
|
baseLayout: U,
|
|
32
32
|
mainContent: V,
|
|
33
33
|
header: Y,
|
|
@@ -47,8 +47,8 @@ const K = [
|
|
|
47
47
|
userName: pe,
|
|
48
48
|
userTitle: _e,
|
|
49
49
|
title: xe,
|
|
50
|
-
sidebarNav:
|
|
51
|
-
list:
|
|
50
|
+
sidebarNav: ue,
|
|
51
|
+
list: he,
|
|
52
52
|
listGroupTitle: be,
|
|
53
53
|
listItem: ve,
|
|
54
54
|
listItemCollapsed: ye,
|
|
@@ -66,7 +66,7 @@ const K = [
|
|
|
66
66
|
logoExternal: ze,
|
|
67
67
|
logoExternalDesktop: Be,
|
|
68
68
|
navbarWrapper: Oe
|
|
69
|
-
},
|
|
69
|
+
}, H = y.createContext(
|
|
70
70
|
void 0
|
|
71
71
|
), we = ({
|
|
72
72
|
items: t,
|
|
@@ -75,61 +75,62 @@ const K = [
|
|
|
75
75
|
app: i,
|
|
76
76
|
children: s,
|
|
77
77
|
clientSideRouter: p,
|
|
78
|
-
clientSideHref:
|
|
79
|
-
headerChildren:
|
|
80
|
-
isCollapsed:
|
|
81
|
-
setIsCollapsed:
|
|
82
|
-
isOpened:
|
|
78
|
+
clientSideHref: l,
|
|
79
|
+
headerChildren: u,
|
|
80
|
+
isCollapsed: h,
|
|
81
|
+
setIsCollapsed: x,
|
|
82
|
+
isOpened: _,
|
|
83
83
|
setIsOpened: v,
|
|
84
|
-
variant:
|
|
85
|
-
id:
|
|
84
|
+
variant: d,
|
|
85
|
+
id: m
|
|
86
86
|
}) => /* @__PURE__ */ e(
|
|
87
|
-
|
|
87
|
+
H.Provider,
|
|
88
88
|
{
|
|
89
89
|
value: {
|
|
90
90
|
items: t,
|
|
91
91
|
title: n,
|
|
92
92
|
user: r,
|
|
93
93
|
app: i,
|
|
94
|
-
headerChildren:
|
|
95
|
-
isCollapsed:
|
|
96
|
-
setIsCollapsed:
|
|
97
|
-
isOpened:
|
|
94
|
+
headerChildren: u,
|
|
95
|
+
isCollapsed: h,
|
|
96
|
+
setIsCollapsed: x,
|
|
97
|
+
isOpened: _,
|
|
98
98
|
setIsOpened: v,
|
|
99
99
|
clientSideRouter: p,
|
|
100
|
-
clientSideHref:
|
|
101
|
-
variant:
|
|
102
|
-
id:
|
|
100
|
+
clientSideHref: l,
|
|
101
|
+
variant: d,
|
|
102
|
+
id: m
|
|
103
103
|
},
|
|
104
104
|
children: s
|
|
105
105
|
}
|
|
106
|
-
),
|
|
107
|
-
const t = y.useContext(
|
|
106
|
+
), f = () => {
|
|
107
|
+
const t = y.useContext(H);
|
|
108
108
|
if (!t)
|
|
109
109
|
throw new Error("useLayoutContext must be used within a LayoutProvider");
|
|
110
110
|
return t;
|
|
111
|
-
},
|
|
111
|
+
}, E = ({
|
|
112
112
|
title: t,
|
|
113
113
|
href: n,
|
|
114
114
|
icon: r,
|
|
115
115
|
active: i,
|
|
116
116
|
hasBadge: s,
|
|
117
|
-
onClick: p
|
|
117
|
+
onClick: p,
|
|
118
|
+
target: l
|
|
118
119
|
}) => {
|
|
119
|
-
const { isCollapsed:
|
|
120
|
+
const { isCollapsed: u, setIsOpened: h, clientSideHref: x } = f(), _ = x ? x(n) : n, [v, d] = W(!1);
|
|
120
121
|
j(() => {
|
|
121
122
|
if (typeof window < "u") {
|
|
122
|
-
const
|
|
123
|
-
|
|
123
|
+
const N = window.location.pathname === _ || window.location.pathname.startsWith(_ + "/");
|
|
124
|
+
d(i ?? N);
|
|
124
125
|
}
|
|
125
|
-
}, [i,
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
}, [i, _]);
|
|
127
|
+
const m = () => {
|
|
128
|
+
h?.(!1), p && p({
|
|
128
129
|
title: t,
|
|
129
|
-
href:
|
|
130
|
+
href: _
|
|
130
131
|
});
|
|
131
132
|
};
|
|
132
|
-
return
|
|
133
|
+
return u ? /* @__PURE__ */ o(D, { children: [
|
|
133
134
|
/* @__PURE__ */ e(
|
|
134
135
|
L,
|
|
135
136
|
{
|
|
@@ -138,9 +139,10 @@ const K = [
|
|
|
138
139
|
className: b(
|
|
139
140
|
a.listLink,
|
|
140
141
|
a.listLinkCollapsed,
|
|
141
|
-
|
|
142
|
+
v && a.active
|
|
142
143
|
),
|
|
143
|
-
onPress:
|
|
144
|
+
onPress: m,
|
|
145
|
+
target: l,
|
|
144
146
|
children: /* @__PURE__ */ o(I, { children: [
|
|
145
147
|
/* @__PURE__ */ e(
|
|
146
148
|
r,
|
|
@@ -159,8 +161,9 @@ const K = [
|
|
|
159
161
|
{
|
|
160
162
|
href: n,
|
|
161
163
|
"aria-label": t,
|
|
162
|
-
className: b(a.listLink,
|
|
163
|
-
onPress:
|
|
164
|
+
className: b(a.listLink, v && a.active),
|
|
165
|
+
onPress: m,
|
|
166
|
+
target: l,
|
|
164
167
|
children: [
|
|
165
168
|
/* @__PURE__ */ o(I, { children: [
|
|
166
169
|
/* @__PURE__ */ e(r, { size: 20 }),
|
|
@@ -170,7 +173,7 @@ const K = [
|
|
|
170
173
|
]
|
|
171
174
|
}
|
|
172
175
|
);
|
|
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" },
|
|
176
|
+
}, 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" }, C = {
|
|
174
177
|
en: Pe,
|
|
175
178
|
sv: He
|
|
176
179
|
}, Ge = ({
|
|
@@ -182,38 +185,51 @@ const K = [
|
|
|
182
185
|
isOpened: i,
|
|
183
186
|
isCollapsed: s,
|
|
184
187
|
setIsCollapsed: p,
|
|
185
|
-
setIsOpened:
|
|
186
|
-
clientSideRouter:
|
|
187
|
-
clientSideHref:
|
|
188
|
-
id:
|
|
189
|
-
} =
|
|
188
|
+
setIsOpened: l,
|
|
189
|
+
clientSideRouter: u,
|
|
190
|
+
clientSideHref: h,
|
|
191
|
+
id: x
|
|
192
|
+
} = f(), _ = k(C), v = ({ group: d }) => /* @__PURE__ */ e("ul", { className: a.list, children: d.items.map((m, N) => /* @__PURE__ */ e(
|
|
190
193
|
"li",
|
|
191
194
|
{
|
|
192
195
|
className: b(
|
|
193
196
|
a.listItem,
|
|
194
197
|
s && a.listItemCollapsed
|
|
195
198
|
),
|
|
196
|
-
children: /* @__PURE__ */ e(
|
|
197
|
-
|
|
199
|
+
children: m.target === "_blank" || !u ? /* @__PURE__ */ e(
|
|
200
|
+
E,
|
|
198
201
|
{
|
|
199
202
|
onClick: t,
|
|
200
|
-
...
|
|
203
|
+
...m
|
|
204
|
+
}
|
|
205
|
+
) : /* @__PURE__ */ e(
|
|
206
|
+
P,
|
|
207
|
+
{
|
|
208
|
+
navigate: u,
|
|
209
|
+
useHref: h,
|
|
210
|
+
children: /* @__PURE__ */ e(
|
|
211
|
+
E,
|
|
212
|
+
{
|
|
213
|
+
onClick: t,
|
|
214
|
+
...m
|
|
215
|
+
}
|
|
216
|
+
)
|
|
201
217
|
}
|
|
202
218
|
)
|
|
203
219
|
},
|
|
204
|
-
"link_" +
|
|
220
|
+
"link_" + N
|
|
205
221
|
)) });
|
|
206
222
|
return y.useEffect(() => {
|
|
207
|
-
const
|
|
208
|
-
|
|
223
|
+
const d = (m) => {
|
|
224
|
+
m.key === "Escape" && l !== void 0 && l(!1);
|
|
209
225
|
};
|
|
210
|
-
return window.addEventListener("keydown",
|
|
211
|
-
window.removeEventListener("keydown",
|
|
226
|
+
return window.addEventListener("keydown", d), () => {
|
|
227
|
+
window.removeEventListener("keydown", d);
|
|
212
228
|
};
|
|
213
|
-
}, [
|
|
229
|
+
}, [l]), /* @__PURE__ */ o(
|
|
214
230
|
"aside",
|
|
215
231
|
{
|
|
216
|
-
id:
|
|
232
|
+
id: x,
|
|
217
233
|
className: b(
|
|
218
234
|
a.sidebar,
|
|
219
235
|
s && a.sidebarCollapsed,
|
|
@@ -223,10 +239,10 @@ const K = [
|
|
|
223
239
|
/* @__PURE__ */ o("div", { className: a.sidebarHeader, children: [
|
|
224
240
|
!s && /* @__PURE__ */ e("p", { className: a.appName, children: r.name }),
|
|
225
241
|
/* @__PURE__ */ e(
|
|
226
|
-
|
|
242
|
+
T,
|
|
227
243
|
{
|
|
228
244
|
variant: "icon",
|
|
229
|
-
"aria-label": s ?
|
|
245
|
+
"aria-label": s ? _.format("maximizeMenu") : _.format("minimizeMenu"),
|
|
230
246
|
onPress: () => p(!s),
|
|
231
247
|
className: a.collapseButton,
|
|
232
248
|
children: s ? /* @__PURE__ */ e(Q, { size: 20 }) : /* @__PURE__ */ e(J, { size: 20 })
|
|
@@ -237,18 +253,11 @@ const K = [
|
|
|
237
253
|
"nav",
|
|
238
254
|
{
|
|
239
255
|
className: a.sidebarNav,
|
|
240
|
-
"aria-label":
|
|
241
|
-
children: /* @__PURE__ */ e("ul", { className: a.list, children: n.map((
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
{
|
|
246
|
-
navigate: x,
|
|
247
|
-
useHref: _,
|
|
248
|
-
children: /* @__PURE__ */ e(v, { group: l })
|
|
249
|
-
}
|
|
250
|
-
) : /* @__PURE__ */ e(v, { group: l })
|
|
251
|
-
] }, "list_" + u)) })
|
|
256
|
+
"aria-label": _.format("sidebarMenu"),
|
|
257
|
+
children: /* @__PURE__ */ e("ul", { className: a.list, children: n.map((d, m) => /* @__PURE__ */ o("li", { children: [
|
|
258
|
+
d.title && !s && /* @__PURE__ */ e("p", { className: a.listGroupTitle, children: d.title }),
|
|
259
|
+
/* @__PURE__ */ e(v, { group: d })
|
|
260
|
+
] }, "list_" + m)) })
|
|
252
261
|
}
|
|
253
262
|
)
|
|
254
263
|
]
|
|
@@ -262,11 +271,11 @@ const K = [
|
|
|
262
271
|
isOpened: i,
|
|
263
272
|
setIsOpened: s,
|
|
264
273
|
setIsCollapsed: p,
|
|
265
|
-
headerChildren:
|
|
266
|
-
variant:
|
|
267
|
-
id:
|
|
268
|
-
} =
|
|
269
|
-
return
|
|
274
|
+
headerChildren: l,
|
|
275
|
+
variant: u,
|
|
276
|
+
id: h
|
|
277
|
+
} = f(), x = k(C);
|
|
278
|
+
return u === "external" ? /* @__PURE__ */ e("header", { className: b(a.header, a.headerExternal), children: /* @__PURE__ */ o("div", { className: a.headerContentExternal, children: [
|
|
270
279
|
/* @__PURE__ */ o("div", { className: a.logoExternalContainer, children: [
|
|
271
280
|
/* @__PURE__ */ e(
|
|
272
281
|
g,
|
|
@@ -289,7 +298,7 @@ const K = [
|
|
|
289
298
|
/* @__PURE__ */ e("p", { className: a.userTitle, children: n.title })
|
|
290
299
|
] })
|
|
291
300
|
] }),
|
|
292
|
-
/* @__PURE__ */ e("div", { className: a.headerItems, children:
|
|
301
|
+
/* @__PURE__ */ e("div", { className: a.headerItems, children: l })
|
|
293
302
|
] }) }) : /* @__PURE__ */ o(
|
|
294
303
|
"header",
|
|
295
304
|
{
|
|
@@ -307,12 +316,12 @@ const K = [
|
|
|
307
316
|
}
|
|
308
317
|
) }),
|
|
309
318
|
i !== void 0 && /* @__PURE__ */ e(
|
|
310
|
-
|
|
319
|
+
T,
|
|
311
320
|
{
|
|
312
321
|
variant: "icon",
|
|
313
322
|
className: a.toggleButton,
|
|
314
|
-
"aria-label": i ?
|
|
315
|
-
"aria-controls":
|
|
323
|
+
"aria-label": i ? x.format("closeMenu") : x.format("openMenu"),
|
|
324
|
+
"aria-controls": h,
|
|
316
325
|
onPressStart: () => {
|
|
317
326
|
p(!1), s?.(!0);
|
|
318
327
|
},
|
|
@@ -337,19 +346,19 @@ const K = [
|
|
|
337
346
|
/* @__PURE__ */ e("p", { className: a.title, children: t })
|
|
338
347
|
] })
|
|
339
348
|
] }),
|
|
340
|
-
/* @__PURE__ */ e("div", { className: a.headerItems, children:
|
|
349
|
+
/* @__PURE__ */ e("div", { className: a.headerItems, children: l })
|
|
341
350
|
]
|
|
342
351
|
}
|
|
343
352
|
);
|
|
344
|
-
},
|
|
353
|
+
}, O = ({
|
|
345
354
|
id: t = "main:first-of-type"
|
|
346
355
|
}) => {
|
|
347
356
|
const n = () => {
|
|
348
357
|
const i = document.querySelector(t);
|
|
349
358
|
i && (i.tabIndex = -1, i.focus(), setTimeout(() => i.removeAttribute("tabindex"), 1e3));
|
|
350
|
-
}, r =
|
|
359
|
+
}, r = k(C);
|
|
351
360
|
return /* @__PURE__ */ e(
|
|
352
|
-
|
|
361
|
+
T,
|
|
353
362
|
{
|
|
354
363
|
onPress: n,
|
|
355
364
|
className: a.skipToContent,
|
|
@@ -357,7 +366,7 @@ const K = [
|
|
|
357
366
|
}
|
|
358
367
|
);
|
|
359
368
|
}, je = () => {
|
|
360
|
-
const { isOpened: t, setIsOpened: n } =
|
|
369
|
+
const { isOpened: t, setIsOpened: n } = f();
|
|
361
370
|
return t ? /* @__PURE__ */ e(
|
|
362
371
|
"div",
|
|
363
372
|
{
|
|
@@ -369,25 +378,25 @@ const K = [
|
|
|
369
378
|
}
|
|
370
379
|
) : null;
|
|
371
380
|
}, De = () => {
|
|
372
|
-
const { items: t, clientSideRouter: n, clientSideHref: r } =
|
|
381
|
+
const { items: t, clientSideRouter: n, clientSideHref: r } = f(), i = k(C), s = t.at(0)?.items;
|
|
373
382
|
return /* @__PURE__ */ e(
|
|
374
383
|
"nav",
|
|
375
384
|
{
|
|
376
385
|
className: a.navbar,
|
|
377
386
|
"aria-label": i.format("bottomMenu"),
|
|
378
387
|
children: s && /* @__PURE__ */ e("ul", { className: b(a.navbarList), children: n ? /* @__PURE__ */ e(
|
|
379
|
-
|
|
388
|
+
P,
|
|
380
389
|
{
|
|
381
390
|
navigate: n,
|
|
382
391
|
useHref: r,
|
|
383
|
-
children: /* @__PURE__ */ e(
|
|
392
|
+
children: /* @__PURE__ */ e(w, { items: s })
|
|
384
393
|
}
|
|
385
|
-
) : /* @__PURE__ */ e(
|
|
394
|
+
) : /* @__PURE__ */ e(w, { items: s }) })
|
|
386
395
|
}
|
|
387
396
|
);
|
|
388
|
-
},
|
|
397
|
+
}, w = ({
|
|
389
398
|
items: t
|
|
390
|
-
}) => /* @__PURE__ */ e(G, { children: t.map(({ href: n, active: r, icon: i, title: s, hasBadge: p },
|
|
399
|
+
}) => /* @__PURE__ */ e(G, { children: t.map(({ href: n, active: r, icon: i, title: s, hasBadge: p }, l) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
|
|
391
400
|
L,
|
|
392
401
|
{
|
|
393
402
|
href: n,
|
|
@@ -402,40 +411,40 @@ const K = [
|
|
|
402
411
|
s
|
|
403
412
|
]
|
|
404
413
|
}
|
|
405
|
-
) },
|
|
414
|
+
) }, l)) }), c = ({
|
|
406
415
|
items: t,
|
|
407
416
|
title: n,
|
|
408
417
|
user: r,
|
|
409
418
|
app: i,
|
|
410
419
|
children: s,
|
|
411
420
|
headerChildren: p,
|
|
412
|
-
clientSideRouter:
|
|
413
|
-
clientSideHref:
|
|
414
|
-
variant:
|
|
415
|
-
className:
|
|
416
|
-
onSidebarLinkClick:
|
|
421
|
+
clientSideRouter: l,
|
|
422
|
+
clientSideHref: u,
|
|
423
|
+
variant: h,
|
|
424
|
+
className: x,
|
|
425
|
+
onSidebarLinkClick: _
|
|
417
426
|
}) => {
|
|
418
|
-
const [v,
|
|
419
|
-
return
|
|
427
|
+
const [v, d] = y.useState(!1), [m, N] = y.useState(!1), z = y.useId();
|
|
428
|
+
return h === "external" ? /* @__PURE__ */ e(
|
|
420
429
|
c.Provider,
|
|
421
430
|
{
|
|
422
431
|
items: t,
|
|
423
432
|
title: n,
|
|
424
433
|
user: r,
|
|
425
434
|
app: i,
|
|
426
|
-
clientSideRouter:
|
|
427
|
-
clientSideHref:
|
|
435
|
+
clientSideRouter: l,
|
|
436
|
+
clientSideHref: u,
|
|
428
437
|
headerChildren: p,
|
|
429
438
|
isCollapsed: v,
|
|
430
|
-
setIsCollapsed:
|
|
431
|
-
variant:
|
|
432
|
-
id:
|
|
433
|
-
children: /* @__PURE__ */ o("div", { className: b(a.baseLayout,
|
|
434
|
-
/* @__PURE__ */ e(
|
|
439
|
+
setIsCollapsed: d,
|
|
440
|
+
variant: h,
|
|
441
|
+
id: z,
|
|
442
|
+
children: /* @__PURE__ */ o("div", { className: b(a.baseLayout, x), children: [
|
|
443
|
+
/* @__PURE__ */ e(O, {}),
|
|
435
444
|
/* @__PURE__ */ e(c.Header, {}),
|
|
436
445
|
/* @__PURE__ */ o("div", { className: a.mainContent, children: [
|
|
437
|
-
/* @__PURE__ */ e(c.Sidebar, { onLinkClick:
|
|
438
|
-
/* @__PURE__ */ e(
|
|
446
|
+
/* @__PURE__ */ e(c.Sidebar, { onLinkClick: _ }),
|
|
447
|
+
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("main", { className: a.main, children: /* @__PURE__ */ e("div", { className: a.app, children: s }) }) }),
|
|
439
448
|
/* @__PURE__ */ e(c.Backdrop, {})
|
|
440
449
|
] }),
|
|
441
450
|
/* @__PURE__ */ e("div", { className: a.navbarWrapper, children: /* @__PURE__ */ e(c.Navbar, {}) })
|
|
@@ -448,21 +457,21 @@ const K = [
|
|
|
448
457
|
title: n,
|
|
449
458
|
user: r,
|
|
450
459
|
app: i,
|
|
451
|
-
clientSideRouter:
|
|
452
|
-
clientSideHref:
|
|
460
|
+
clientSideRouter: l,
|
|
461
|
+
clientSideHref: u,
|
|
453
462
|
headerChildren: p,
|
|
454
463
|
isCollapsed: v,
|
|
455
|
-
setIsCollapsed:
|
|
456
|
-
isOpened:
|
|
457
|
-
setIsOpened:
|
|
458
|
-
variant:
|
|
459
|
-
id:
|
|
460
|
-
children: /* @__PURE__ */ o("div", { className: b(a.baseLayout,
|
|
461
|
-
/* @__PURE__ */ e(
|
|
464
|
+
setIsCollapsed: d,
|
|
465
|
+
isOpened: m,
|
|
466
|
+
setIsOpened: N,
|
|
467
|
+
variant: h,
|
|
468
|
+
id: z,
|
|
469
|
+
children: /* @__PURE__ */ o("div", { className: b(a.baseLayout, x), children: [
|
|
470
|
+
/* @__PURE__ */ e(O, {}),
|
|
462
471
|
/* @__PURE__ */ e(c.Header, {}),
|
|
463
472
|
/* @__PURE__ */ o("div", { className: a.mainContent, children: [
|
|
464
|
-
/* @__PURE__ */ e(c.Sidebar, { onLinkClick:
|
|
465
|
-
/* @__PURE__ */ e(
|
|
473
|
+
/* @__PURE__ */ e(c.Sidebar, { onLinkClick: _ }),
|
|
474
|
+
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("main", { className: a.main, children: /* @__PURE__ */ e("div", { className: a.app, children: s }) }) }),
|
|
466
475
|
/* @__PURE__ */ e(c.Backdrop, {})
|
|
467
476
|
] })
|
|
468
477
|
] })
|
|
@@ -472,7 +481,7 @@ const K = [
|
|
|
472
481
|
c.Provider = we;
|
|
473
482
|
c.Header = We;
|
|
474
483
|
c.Sidebar = Ge;
|
|
475
|
-
c.SidebarLink =
|
|
484
|
+
c.SidebarLink = E;
|
|
476
485
|
c.Navbar = De;
|
|
477
486
|
c.Backdrop = je;
|
|
478
487
|
export {
|
|
@@ -480,5 +489,5 @@ export {
|
|
|
480
489
|
c as L,
|
|
481
490
|
De as N,
|
|
482
491
|
Ge as S,
|
|
483
|
-
|
|
492
|
+
E as a
|
|
484
493
|
};
|
package/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import { G as ao } from "./chunks/GridItem-z7zclNdT.js";
|
|
|
21
21
|
import { H as eo } from "./chunks/Heading-nfcRc2QF.js";
|
|
22
22
|
import { I as so } from "./chunks/InfoBanner-D_pwTOHH.js";
|
|
23
23
|
import { L as xo } from "./chunks/Label-s4J9sYdy.js";
|
|
24
|
-
import { H as io, L as fo, N as no, S as To, a as co } from "./chunks/Layout-
|
|
24
|
+
import { H as io, L as fo, N as no, S as To, a as co } from "./chunks/Layout-CmKsh0kv.js";
|
|
25
25
|
import { L as uo } from "./chunks/Link-rqGQvFQq.js";
|
|
26
26
|
import { L as Bo } from "./chunks/LinkButton-DJ-D5PkB.js";
|
|
27
27
|
import { L as Lo } from "./chunks/Logo-CCxPAmgw.js";
|
|
@@ -49,7 +49,7 @@ import { c as Na } from "./chunks/clsx-AexbMWKp.js";
|
|
|
49
49
|
import { DialogTrigger as za, MenuTrigger as Oa, RouterProvider as Qa } from "react-aria-components";
|
|
50
50
|
import { u as Za } from "./chunks/useLocalizedStringFormatter-BHvsRxDk.js";
|
|
51
51
|
import { useToastState as qa } from "react-stately";
|
|
52
|
-
const o = "17.6.
|
|
52
|
+
const o = "17.6.5", a = {
|
|
53
53
|
version: o
|
|
54
54
|
}, r = a.version;
|
|
55
55
|
export {
|
package/layout/Layout.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Href } from '@react-types/shared';
|
|
|
6
6
|
import { LayoutProvider } from './context/LayoutContext';
|
|
7
7
|
import { Backdrop } from './components/Backdrop';
|
|
8
8
|
import { Navbar } from './components/Navbar';
|
|
9
|
+
import { HTMLAttributeAnchorTarget } from 'react';
|
|
9
10
|
import * as React from 'react';
|
|
10
11
|
export interface SidebarLinkGroup {
|
|
11
12
|
title?: string;
|
|
@@ -24,6 +25,7 @@ export interface SidebarLinkProps {
|
|
|
24
25
|
isCollapsed?: boolean;
|
|
25
26
|
setIsOpened?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
26
27
|
onClick?: (e: SidebarLinkClickData) => void;
|
|
28
|
+
target?: HTMLAttributeAnchorTarget;
|
|
27
29
|
}
|
|
28
30
|
export interface SidebarUser {
|
|
29
31
|
name: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SidebarLinkProps } from '../Layout';
|
|
2
|
-
export declare const SidebarLink: ({ title, href, icon: IconComponent, active, hasBadge, onClick, }: SidebarLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const SidebarLink: ({ title, href, icon: IconComponent, active, hasBadge, onClick, target, }: SidebarLinkProps) => import("react/jsx-runtime").JSX.Element;
|
package/layout/index.js
CHANGED
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"description": "Midas Components",
|
|
15
15
|
"homepage": "https://designsystem.migrationsverket.se/",
|
|
16
16
|
"license": "CC0-1.0",
|
|
17
|
-
"version": "17.6.
|
|
17
|
+
"version": "17.6.5",
|
|
18
18
|
"module": "./index.js",
|
|
19
19
|
"type": "module",
|
|
20
20
|
"main": "./index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"./*": "./*/index.js"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@midas-ds/theme": "3.12.
|
|
44
|
+
"@midas-ds/theme": "3.12.6",
|
|
45
45
|
"react-aria-components": "1.14.0"
|
|
46
46
|
}
|
|
47
47
|
}
|