@midas-ds/layout 0.2.49 → 0.2.51
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 +20 -0
- package/chunks/header-D4J0i_bA.js +90 -0
- package/chunks/{layout-D1po9FHB.js → layout-DNM8xMYM.js} +1 -1
- package/chunks/{main-fC0vGdZw.js → main-DsKDUX08.js} +1 -1
- package/chunks/{navbar-DwUBXEZn.js → navbar-BVgnjg2G.js} +1 -1
- package/chunks/{navigation-DBKcWjzG.js → navigation-R9Acriur.js} +23 -23
- package/chunks/panel-Dekrlpea.js +159 -0
- package/chunks/sidebar-D5GGUdTv.js +63 -0
- package/header/index.js +1 -1
- package/index.js +8 -8
- package/layout/index.js +1 -1
- package/main/index.js +1 -1
- package/navbar/index.js +1 -1
- package/navigation/index.js +1 -1
- package/package.json +4 -2
- package/panel/index.js +1 -1
- package/sidebar/index.js +1 -1
- package/utils/index.js +12 -2
- package/chunks/clsx-Bok9rGJm.js +0 -18
- package/chunks/createLucideIcon-BgluSHFG.js +0 -39
- package/chunks/header-CKgqPF7j.js +0 -103
- package/chunks/panel-MI09-Qe_.js +0 -165
- package/chunks/sidebar-BYqoekwF.js +0 -80
- package/chunks/utils-CjjqyX25.js +0 -39
- package/header/Header.stories.d.ts +0 -15
- package/header/header-action/HeaderAction.stories.d.ts +0 -14
- package/header/header-actions/HeaderActions.stories.d.ts +0 -13
- package/header/mobile-menu/MobileMenu.stories.d.ts +0 -19
- package/layout/Layout.stories.d.ts +0 -18
- package/navbar/Navbar.stories.d.ts +0 -23
- package/navigation/Navigation.stories.d.ts +0 -25
- package/navigation/navigation-link/NavigationLink.stories.d.ts +0 -25
- package/panel/Panel.stories.d.ts +0 -317
- package/sidebar/Sidebar.stories.d.ts +0 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## 0.2.51 (2026-10-09)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **components,layout,table-styles:** declare public type packages ([#1406](https://github.com/migrationsverket/midas/pull/1406))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated components to 17.30.1
|
|
10
|
+
|
|
11
|
+
## 0.2.50 (2026-10-09)
|
|
12
|
+
|
|
13
|
+
### 🚀 Features
|
|
14
|
+
|
|
15
|
+
- **components,layout,table-styles:** depend on lucide-react ([#1405](https://github.com/migrationsverket/midas/pull/1405))
|
|
16
|
+
|
|
17
|
+
### 🧱 Updated Dependencies
|
|
18
|
+
|
|
19
|
+
- Updated components to 17.30.0
|
|
20
|
+
|
|
1
21
|
## 0.2.49 (2026-10-09)
|
|
2
22
|
|
|
3
23
|
### 🧱 Updated Dependencies
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useIsMobileDevice as e } from "../utils/index.js";
|
|
3
|
+
import t from "clsx";
|
|
4
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { createContext as a, forwardRef as o } from "react";
|
|
6
|
+
import { Dialog as s, Modal as c, composeRenderProps as l } from "react-aria-components";
|
|
7
|
+
import { Button as u, DialogTrigger as d, Logo as f, ModalOverlay as p, Text as m, clsx as h, useLocalizedStringFormatter as g } from "@midas-ds/components";
|
|
8
|
+
import { Menu as _ } from "lucide-react";
|
|
9
|
+
import '../assets/header.css';var v = { headerActions: "_headerActions_zpqnd_1" }, y = ({ children: e, className: n }) => /* @__PURE__ */ r("div", {
|
|
10
|
+
className: t(v.headerActions, n),
|
|
11
|
+
children: e
|
|
12
|
+
}), b = {
|
|
13
|
+
headerAction: "_headerAction_dgfa1_1",
|
|
14
|
+
label: "_label_dgfa1_7"
|
|
15
|
+
}, x = o(({ children: e, icon: a, className: o, ...s }, c) => (!e && !s["aria-label"] && process.env.NODE_ENV !== "production" && console.warn("Please provide an 'aria-label' for HeaderAction components that doesnt have a visible label (children)"), /* @__PURE__ */ r(u, {
|
|
16
|
+
ref: c,
|
|
17
|
+
size: "medium",
|
|
18
|
+
variant: "tertiary",
|
|
19
|
+
className: t(b.headerAction, o),
|
|
20
|
+
...s,
|
|
21
|
+
children: l(e, (e) => /* @__PURE__ */ i(n, { children: [a, e !== void 0 && /* @__PURE__ */ r("span", {
|
|
22
|
+
className: b.label,
|
|
23
|
+
children: e
|
|
24
|
+
})] }))
|
|
25
|
+
})));
|
|
26
|
+
x.displayName = "HeaderAction";
|
|
27
|
+
var S = {
|
|
28
|
+
mobile: "_mobile_vwr3x_1",
|
|
29
|
+
desktop: "_desktop_vwr3x_11"
|
|
30
|
+
}, C = ({ primary: e }) => /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(f, {
|
|
31
|
+
size: "x-small",
|
|
32
|
+
primary: e,
|
|
33
|
+
padding: !1,
|
|
34
|
+
className: S.mobile
|
|
35
|
+
}), /* @__PURE__ */ r(f, {
|
|
36
|
+
size: "small",
|
|
37
|
+
primary: e,
|
|
38
|
+
padding: !1,
|
|
39
|
+
className: S.desktop
|
|
40
|
+
})] }), w = { headerTitle: "_headerTitle_cw9hi_1" }, T = ({ className: e, ...n }) => /* @__PURE__ */ r("span", {
|
|
41
|
+
className: t(w.headerTitle, e),
|
|
42
|
+
...n
|
|
43
|
+
}), E = a(void 0), D = {
|
|
44
|
+
en: { openMenu: "Open menu" },
|
|
45
|
+
sv: { openMenu: "Öppna meny" }
|
|
46
|
+
}, O = {
|
|
47
|
+
triggerButton: "_triggerButton_1k2eg_1",
|
|
48
|
+
overlay: "_overlay_1k2eg_5",
|
|
49
|
+
"drawer-blur": "_drawer-blur_1k2eg_1",
|
|
50
|
+
drawer: "_drawer_1k2eg_18",
|
|
51
|
+
"drawer-slide": "_drawer-slide_1k2eg_1",
|
|
52
|
+
dialog: "_dialog_1k2eg_43",
|
|
53
|
+
header: "_header_1k2eg_49"
|
|
54
|
+
}, k = ({ children: t, className: n, defaultOpen: a, isOpen: o, onOpenChange: f, title: v, ...y }) => {
|
|
55
|
+
let b = e(), x = g(D);
|
|
56
|
+
return b ? /* @__PURE__ */ r(E.Provider, {
|
|
57
|
+
value: {},
|
|
58
|
+
children: /* @__PURE__ */ i(d, {
|
|
59
|
+
isOpen: o,
|
|
60
|
+
onOpenChange: f,
|
|
61
|
+
defaultOpen: a,
|
|
62
|
+
children: [/* @__PURE__ */ r(u, {
|
|
63
|
+
"aria-label": x.format("openMenu"),
|
|
64
|
+
icon: _,
|
|
65
|
+
variant: "icon",
|
|
66
|
+
size: "medium",
|
|
67
|
+
className: O.triggerButton
|
|
68
|
+
}), /* @__PURE__ */ r(p, {
|
|
69
|
+
className: h(n, O.overlay),
|
|
70
|
+
isDismissable: !0,
|
|
71
|
+
...y,
|
|
72
|
+
children: l(t, (e) => /* @__PURE__ */ r(c, {
|
|
73
|
+
className: O.drawer,
|
|
74
|
+
children: /* @__PURE__ */ i(s, {
|
|
75
|
+
className: O.dialog,
|
|
76
|
+
children: [v && /* @__PURE__ */ r(m, {
|
|
77
|
+
className: O.header,
|
|
78
|
+
children: v
|
|
79
|
+
}), e]
|
|
80
|
+
})
|
|
81
|
+
}))
|
|
82
|
+
})]
|
|
83
|
+
})
|
|
84
|
+
}) : null;
|
|
85
|
+
}, A = { header: "_header_s0sjn_1" }, j = ({ className: e, ...n }) => /* @__PURE__ */ r("header", {
|
|
86
|
+
className: t(e, A.header),
|
|
87
|
+
...n
|
|
88
|
+
});
|
|
89
|
+
//#endregion
|
|
90
|
+
export { C as a, T as i, k as n, x as o, E as r, y as s, j as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
2
|
+
import e from "clsx";
|
|
3
3
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
4
|
import { Button as r, useLocalizedStringFormatter as i } from "@midas-ds/components";
|
|
5
5
|
import '../assets/layout.css';var a = { layout: "_layout_4r2tn_1" }, o = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n } from "./
|
|
5
|
-
import
|
|
2
|
+
import { r as e } from "./header-D4J0i_bA.js";
|
|
3
|
+
import { n as t } from "./sidebar-D5GGUdTv.js";
|
|
4
|
+
import { n } from "./navbar-BVgnjg2G.js";
|
|
5
|
+
import r from "clsx";
|
|
6
6
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
7
|
import { useContext as o } from "react";
|
|
8
8
|
import { Collection as s, Focusable as c, Link as l, OverlayTriggerStateContext as u } from "react-aria-components";
|
|
@@ -23,17 +23,17 @@ import '../assets/navigation.css';var h = { rootList: "_rootList_l3v98_1" }, g =
|
|
|
23
23
|
}), _ = {
|
|
24
24
|
navigationHeader: "_navigationHeader_18u5f_1",
|
|
25
25
|
collapsed: "_collapsed_18u5f_7"
|
|
26
|
-
}, v = ({ className: e, ...
|
|
27
|
-
let r = o(
|
|
26
|
+
}, v = ({ className: e, ...n }) => {
|
|
27
|
+
let r = o(t);
|
|
28
28
|
return /* @__PURE__ */ i(d, {
|
|
29
29
|
className: m(e, _.navigationHeader, { [_.collapsed]: r?.isCollapsed }),
|
|
30
|
-
...
|
|
30
|
+
...n
|
|
31
31
|
});
|
|
32
|
-
}, y = { navigationItem: "_navigationItem_1jt2l_1" }, b = ({ className:
|
|
33
|
-
let a = o(
|
|
32
|
+
}, y = { navigationItem: "_navigationItem_1jt2l_1" }, b = ({ className: e, ...n }) => {
|
|
33
|
+
let a = o(t);
|
|
34
34
|
return /* @__PURE__ */ i("li", {
|
|
35
|
-
className: e
|
|
36
|
-
...
|
|
35
|
+
className: r(e, y.navigationItem, { [y.collapsed]: a?.isCollapsed }),
|
|
36
|
+
...n
|
|
37
37
|
});
|
|
38
38
|
}, x = {
|
|
39
39
|
navigationLink: "_navigationLink_7oo3n_1",
|
|
@@ -41,8 +41,8 @@ import '../assets/navigation.css';var h = { rootList: "_rootList_l3v98_1" }, g =
|
|
|
41
41
|
collapsed: "_collapsed_7oo3n_51",
|
|
42
42
|
navbar: "_navbar_7oo3n_56",
|
|
43
43
|
title: "_title_7oo3n_85"
|
|
44
|
-
}, S = ({ as:
|
|
45
|
-
let b = o(
|
|
44
|
+
}, S = ({ as: r, children: s, className: d, isActive: h, isDisabled: g, icon: _, "aria-label": v, ...y }) => {
|
|
45
|
+
let b = o(e), S = o(t), C = o(n), w = S?.isCollapsed, T = o(u), E = r || l, D = () => {
|
|
46
46
|
T?.isOpen && T?.setOpen(!1);
|
|
47
47
|
}, O = typeof s == "string" ? s : void 0;
|
|
48
48
|
return !O && !v && process.env.NODE_ENV !== "production" && console.warn("An 'aria-label' is required for <NavigationLink> elements with non plain text children"), /* @__PURE__ */ a(p, {
|
|
@@ -58,7 +58,7 @@ import '../assets/navigation.css';var h = { rootList: "_rootList_l3v98_1" }, g =
|
|
|
58
58
|
"aria-disabled": g || void 0,
|
|
59
59
|
"data-active": h || void 0,
|
|
60
60
|
"data-disabled": g || void 0,
|
|
61
|
-
...
|
|
61
|
+
...r ? {
|
|
62
62
|
tabIndex: g ? -1 : void 0,
|
|
63
63
|
onClick: (e) => {
|
|
64
64
|
if (g) {
|
|
@@ -86,23 +86,23 @@ import '../assets/navigation.css';var h = { rootList: "_rootList_l3v98_1" }, g =
|
|
|
86
86
|
}, C = {
|
|
87
87
|
navigationSection: "_navigationSection_1ae77_1",
|
|
88
88
|
collapsed: "_collapsed_1ae77_5"
|
|
89
|
-
}, w = ({ className:
|
|
90
|
-
let l = o(
|
|
91
|
-
return /* @__PURE__ */ a(b, { children: [
|
|
92
|
-
className: e
|
|
89
|
+
}, w = ({ className: e, title: n, ...c }) => {
|
|
90
|
+
let l = o(t);
|
|
91
|
+
return /* @__PURE__ */ a(b, { children: [n && /* @__PURE__ */ i(v, { children: n }), /* @__PURE__ */ i("ul", {
|
|
92
|
+
className: r(e, C.navigationSection, { [C.collapsed]: l?.isCollapsed }),
|
|
93
93
|
children: /* @__PURE__ */ i(s, { ...c })
|
|
94
94
|
})] });
|
|
95
95
|
}, T = {
|
|
96
96
|
navigationSubMenu: "_navigationSubMenu_vfyl6_1",
|
|
97
97
|
collapsed: "_collapsed_vfyl6_5"
|
|
98
|
-
}, E = ({ className:
|
|
99
|
-
let l = o(
|
|
100
|
-
return typeof
|
|
101
|
-
className: e
|
|
98
|
+
}, E = ({ className: e, children: n, items: a, ...c }) => {
|
|
99
|
+
let l = o(t), { length: u } = Array.from(a || []);
|
|
100
|
+
return typeof n == "function" && u === 0 ? null : /* @__PURE__ */ i("ul", {
|
|
101
|
+
className: r(e, T.navigationSubMenu, { [T.collapsed]: l?.isCollapsed }),
|
|
102
102
|
children: /* @__PURE__ */ i(s, {
|
|
103
103
|
items: a,
|
|
104
104
|
...c,
|
|
105
|
-
children:
|
|
105
|
+
children: n
|
|
106
106
|
})
|
|
107
107
|
});
|
|
108
108
|
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import e from "clsx";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as r, forwardRef as i, useContext as a, useEffect as o, useRef as s, useState as c } from "react";
|
|
5
|
+
import { Button as l, Text as u, clsx as d, useLocalizedStringFormatter as f } from "@midas-ds/components";
|
|
6
|
+
import { X as p } from "lucide-react";
|
|
7
|
+
import { useControlledState as m } from "@react-stately/utils";
|
|
8
|
+
import { filterDOMProps as h, useEnterAnimation as g, useExitAnimation as _, useObjectRef as v } from "@react-aria/utils";
|
|
9
|
+
import '../assets/panel.css';var y = { panelBody: "_panelBody_1p0jk_1" }, b = i(({ className: n, ...r }, i) => /* @__PURE__ */ t("aside", {
|
|
10
|
+
ref: i,
|
|
11
|
+
className: e(n, y.panelBody),
|
|
12
|
+
...r
|
|
13
|
+
})), x = { panelContent: "_panelContent_1gfrc_1" }, S = i(({ className: n, ...r }, i) => /* @__PURE__ */ t("div", {
|
|
14
|
+
ref: i,
|
|
15
|
+
tabIndex: 0,
|
|
16
|
+
className: e(n, x.panelContent),
|
|
17
|
+
...r
|
|
18
|
+
})), C = { panelHeader: "_panelHeader_1g1ux_1" }, w = ({ className: n, ...r }) => /* @__PURE__ */ t("div", {
|
|
19
|
+
className: e(n, C.panelHeader),
|
|
20
|
+
...r
|
|
21
|
+
}), T = { panelTitle: "_panelTitle_w7y4m_1" }, E = ({ className: e, title: n, ...r }) => /* @__PURE__ */ t(u, {
|
|
22
|
+
className: d(e, T.panelTitle),
|
|
23
|
+
...r,
|
|
24
|
+
children: n
|
|
25
|
+
}), D = {
|
|
26
|
+
en: { closePanel: "Close panel" },
|
|
27
|
+
sv: { closePanel: "Stäng panel" }
|
|
28
|
+
}, O = {
|
|
29
|
+
panel: "_panel_16dwe_6",
|
|
30
|
+
promote: "_promote_16dwe_1",
|
|
31
|
+
"slide-horizontally": "_slide-horizontally_16dwe_1",
|
|
32
|
+
"slide-vertically": "_slide-vertically_16dwe_1",
|
|
33
|
+
panelActions: "_panelActions_16dwe_63",
|
|
34
|
+
panelTitle: "_panelTitle_16dwe_69"
|
|
35
|
+
}, k = (e) => {
|
|
36
|
+
let { onExited: n } = e, [r, i] = m(e.isOpen, e.defaultOpen || !1, e.onOpenChange), a = s(null), c = _(a, r);
|
|
37
|
+
return o(() => {
|
|
38
|
+
!r && !c && n?.();
|
|
39
|
+
}, [
|
|
40
|
+
r,
|
|
41
|
+
c,
|
|
42
|
+
n
|
|
43
|
+
]), !r && !c ? null : /* @__PURE__ */ t(A, {
|
|
44
|
+
isExiting: c,
|
|
45
|
+
onPress: () => i((e) => !e),
|
|
46
|
+
ref: a,
|
|
47
|
+
...e
|
|
48
|
+
});
|
|
49
|
+
}, A = i(({ className: r, title: i, actions: a, onPress: o, children: s, isExiting: c, defaultOpen: u, promoting: d, onPromotionEnd: m, "aria-hidden": _, ...y }, x) => {
|
|
50
|
+
let C = f(D), T = v(x), k = g(T, !u);
|
|
51
|
+
return /* @__PURE__ */ n(b, {
|
|
52
|
+
"aria-hidden": _ || void 0,
|
|
53
|
+
"aria-label": i,
|
|
54
|
+
className: e(r, O.panel),
|
|
55
|
+
ref: T,
|
|
56
|
+
"data-entering": k || void 0,
|
|
57
|
+
"data-exiting": c || void 0,
|
|
58
|
+
"data-promoting": d || void 0,
|
|
59
|
+
onAnimationEnd: (e) => {
|
|
60
|
+
e.target === e.currentTarget && d && m?.();
|
|
61
|
+
},
|
|
62
|
+
...h(y),
|
|
63
|
+
children: [/* @__PURE__ */ n(w, { children: [/* @__PURE__ */ t(E, {
|
|
64
|
+
className: O.panelTitle,
|
|
65
|
+
title: i
|
|
66
|
+
}), /* @__PURE__ */ n("div", {
|
|
67
|
+
className: O.panelActions,
|
|
68
|
+
children: [a, /* @__PURE__ */ t(l, {
|
|
69
|
+
"aria-label": C.format("closePanel"),
|
|
70
|
+
onPress: o,
|
|
71
|
+
size: "medium",
|
|
72
|
+
variant: "icon",
|
|
73
|
+
children: /* @__PURE__ */ t(p, { size: 20 })
|
|
74
|
+
})]
|
|
75
|
+
})] }), /* @__PURE__ */ t(S, { children: s })]
|
|
76
|
+
});
|
|
77
|
+
}), j = (e) => null;
|
|
78
|
+
j.displayName = "usePanels";
|
|
79
|
+
var M = r({
|
|
80
|
+
panels: [],
|
|
81
|
+
panelVariant: "overlay",
|
|
82
|
+
addPanel: () => {},
|
|
83
|
+
closePanel: () => {},
|
|
84
|
+
removePanel: () => {},
|
|
85
|
+
resetPromoting: () => {}
|
|
86
|
+
}), N = ({ children: e, defaultPanels: n = [], panelBehavior: r = "replace", panelVariant: i = "overlay" }) => {
|
|
87
|
+
let [a, o] = c(n.map((e) => ({
|
|
88
|
+
...e,
|
|
89
|
+
isOpen: !0,
|
|
90
|
+
defaultOpen: !0
|
|
91
|
+
})));
|
|
92
|
+
return /* @__PURE__ */ t(M.Provider, {
|
|
93
|
+
value: {
|
|
94
|
+
panels: a,
|
|
95
|
+
panelVariant: i,
|
|
96
|
+
addPanel: (e) => {
|
|
97
|
+
o((t) => {
|
|
98
|
+
if (r === "replace") return [{
|
|
99
|
+
...e,
|
|
100
|
+
isOpen: !0
|
|
101
|
+
}];
|
|
102
|
+
let n = t.findIndex((t) => t.id === e.id);
|
|
103
|
+
if (n === -1) return [...t, {
|
|
104
|
+
...e,
|
|
105
|
+
isOpen: !0
|
|
106
|
+
}];
|
|
107
|
+
if (r === "bring-to-front") {
|
|
108
|
+
if (n === t.length - 1) return t;
|
|
109
|
+
let r = t[n];
|
|
110
|
+
return [...t.filter((t) => t.id !== e.id), {
|
|
111
|
+
...r,
|
|
112
|
+
isOpen: !0,
|
|
113
|
+
promoting: !0
|
|
114
|
+
}];
|
|
115
|
+
}
|
|
116
|
+
return r === "pop-to" ? t.map((e, t) => t > n ? {
|
|
117
|
+
...e,
|
|
118
|
+
isOpen: !1
|
|
119
|
+
} : e) : t;
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
closePanel: (e) => {
|
|
123
|
+
o((t) => t.map((t) => t.id === e ? {
|
|
124
|
+
...t,
|
|
125
|
+
isOpen: !1
|
|
126
|
+
} : t));
|
|
127
|
+
},
|
|
128
|
+
removePanel: (e) => {
|
|
129
|
+
o((t) => t.filter((t) => t.id !== e));
|
|
130
|
+
},
|
|
131
|
+
resetPromoting: (e) => {
|
|
132
|
+
o((t) => t.map((t) => t.id === e ? {
|
|
133
|
+
...t,
|
|
134
|
+
promoting: !1
|
|
135
|
+
} : t));
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
children: e
|
|
139
|
+
});
|
|
140
|
+
}, P = () => a(M), F = { push: "_push_xcbfl_1" }, I = ({ children: r, className: i, ...a }) => {
|
|
141
|
+
let { panels: o, panelVariant: s, closePanel: c, removePanel: l, resetPromoting: u } = P(), d = o.length > 0;
|
|
142
|
+
return /* @__PURE__ */ n("div", {
|
|
143
|
+
className: e(i, s === "push" && F.push),
|
|
144
|
+
"data-open": s === "push" && d ? !0 : void 0,
|
|
145
|
+
...a,
|
|
146
|
+
children: [o.map(({ id: e, ...n }, r, { length: i }) => /* @__PURE__ */ t(k, {
|
|
147
|
+
"aria-hidden": r < i - 1 || void 0,
|
|
148
|
+
id: e,
|
|
149
|
+
onOpenChange: (t) => {
|
|
150
|
+
t || c(e);
|
|
151
|
+
},
|
|
152
|
+
onExited: () => l(e),
|
|
153
|
+
onPromotionEnd: () => u(e),
|
|
154
|
+
...n
|
|
155
|
+
}, e)), r]
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
//#endregion
|
|
159
|
+
export { j as a, w as c, M as i, S as l, P as n, k as o, N as r, E as s, I as t, b as u };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useIsMobileDevice as e } from "../utils/index.js";
|
|
3
|
+
import { c as t, l as n, s as r, u as i } from "./panel-Dekrlpea.js";
|
|
4
|
+
import a from "clsx";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import c, { createContext as l } from "react";
|
|
7
|
+
import { Button as u, useLocalizedStringFormatter as d } from "@midas-ds/components";
|
|
8
|
+
import { PanelLeftClose as f } from "lucide-react";
|
|
9
|
+
import { useControlledState as p } from "@react-stately/utils";
|
|
10
|
+
import { filterDOMProps as m } from "@react-aria/utils";
|
|
11
|
+
import '../assets/sidebar.css';var h = {
|
|
12
|
+
en: {
|
|
13
|
+
expandSidebar: "Expand sidebar",
|
|
14
|
+
collapseSidebar: "Collapse sidebar"
|
|
15
|
+
},
|
|
16
|
+
sv: {
|
|
17
|
+
expandSidebar: "Expandera sidopanel",
|
|
18
|
+
collapseSidebar: "Minimera sidopanel"
|
|
19
|
+
}
|
|
20
|
+
}, g = l(void 0), _ = {
|
|
21
|
+
sidebar: "_sidebar_1gkx7_1",
|
|
22
|
+
collapsed: "_collapsed_1gkx7_8",
|
|
23
|
+
sidebarHeader: "_sidebarHeader_1gkx7_20",
|
|
24
|
+
sidebarTitle: "_sidebarTitle_1gkx7_29",
|
|
25
|
+
collapseButton: "_collapseButton_1gkx7_47",
|
|
26
|
+
sidebarContent: "_sidebarContent_1gkx7_55"
|
|
27
|
+
}, v = ({ children: l, className: v, title: y, ...b }) => {
|
|
28
|
+
let x = d(h), S = e(), [C, w] = p(b.isCollapsed, b.defaultCollapsed || !1, b.onCollapseChange), [T, E] = c.useState(!1), D = () => {
|
|
29
|
+
E(!0), w((e) => !e);
|
|
30
|
+
}, O = (e) => {
|
|
31
|
+
e.propertyName === "width" && e.target === e.currentTarget && E(!1);
|
|
32
|
+
};
|
|
33
|
+
return S ? null : /* @__PURE__ */ o(g.Provider, {
|
|
34
|
+
value: { isCollapsed: C },
|
|
35
|
+
children: /* @__PURE__ */ s(i, {
|
|
36
|
+
className: a(v, _.sidebar, { [_.collapsed]: C }),
|
|
37
|
+
"data-transitioning": T || void 0,
|
|
38
|
+
onTransitionEnd: O,
|
|
39
|
+
...m(b, { propNames: /* @__PURE__ */ new Set(["style"]) }),
|
|
40
|
+
children: [/* @__PURE__ */ s(t, {
|
|
41
|
+
className: a(_.sidebarHeader, { [_.collapsed]: C }),
|
|
42
|
+
children: [/* @__PURE__ */ o(r, {
|
|
43
|
+
className: a(_.sidebarTitle, { [_.collapsed]: C }),
|
|
44
|
+
title: y
|
|
45
|
+
}), /* @__PURE__ */ o(u, {
|
|
46
|
+
"aria-label": C ? x.format("expandSidebar") : x.format("collapseSidebar"),
|
|
47
|
+
onPress: D,
|
|
48
|
+
variant: "icon",
|
|
49
|
+
size: "medium",
|
|
50
|
+
children: /* @__PURE__ */ o("span", {
|
|
51
|
+
className: a(_.collapseButton, { [_.collapsed]: C }),
|
|
52
|
+
children: /* @__PURE__ */ o(f, { size: 20 })
|
|
53
|
+
})
|
|
54
|
+
})]
|
|
55
|
+
}), /* @__PURE__ */ o(n, {
|
|
56
|
+
className: _.sidebarContent,
|
|
57
|
+
children: l
|
|
58
|
+
})]
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
export { g as n, v as t };
|
package/header/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../chunks/header-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../chunks/header-D4J0i_bA.js";
|
|
2
2
|
export { o as Header, r as HeaderAction, a as HeaderActions, e as HeaderLogo, t as HeaderTitle, n as MobileMenu, i as MobileMenuContext };
|
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./chunks/header-
|
|
2
|
-
import { n as s, t as c } from "./chunks/
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { n as O, t as k } from "./chunks/navbar-
|
|
8
|
-
export { o as Header, r as HeaderAction, a as HeaderActions, e as HeaderLogo, t as HeaderTitle,
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./chunks/header-D4J0i_bA.js";
|
|
2
|
+
import { n as s, t as c } from "./chunks/layout-DNM8xMYM.js";
|
|
3
|
+
import { t as l } from "./chunks/main-DsKDUX08.js";
|
|
4
|
+
import { a as u, i as d, n as f, o as p, r as m, t as h } from "./chunks/navigation-R9Acriur.js";
|
|
5
|
+
import { a as g, c as _, i as v, l as y, n as b, o as x, r as S, s as C, t as w, u as T } from "./chunks/panel-Dekrlpea.js";
|
|
6
|
+
import { n as E, t as D } from "./chunks/sidebar-D5GGUdTv.js";
|
|
7
|
+
import { n as O, t as k } from "./chunks/navbar-BVgnjg2G.js";
|
|
8
|
+
export { o as Header, r as HeaderAction, a as HeaderActions, e as HeaderLogo, t as HeaderTitle, s as Layout, c as LayoutContent, l as Main, n as MobileMenu, i as MobileMenuContext, k as Navbar, O as NavbarContext, p as Navigation, u as NavigationHeader, d as NavigationItem, m as NavigationLink, f as NavigationSection, h as NavigationSubMenu, x as Panel, T as PanelBody, y as PanelContent, v as PanelContext, _ as PanelHeader, S as PanelProvider, w as PanelRegion, C as PanelTitle, D as Sidebar, E as SidebarContext, g as UsePanels, b as usePanels };
|
package/layout/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../chunks/layout-
|
|
1
|
+
import { n as e, t } from "../chunks/layout-DNM8xMYM.js";
|
|
2
2
|
export { e as Layout, t as LayoutContent };
|
package/main/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../chunks/main-
|
|
1
|
+
import { t as e } from "../chunks/main-DsKDUX08.js";
|
|
2
2
|
export { e as Main };
|
package/navbar/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../chunks/navbar-
|
|
1
|
+
import { n as e, t } from "../chunks/navbar-BVgnjg2G.js";
|
|
2
2
|
export { t as Navbar, e as NavbarContext };
|
package/navigation/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "../chunks/navigation-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "../chunks/navigation-R9Acriur.js";
|
|
2
2
|
export { r as Navigation, e as NavigationHeader, t as NavigationItem, i as NavigationLink, n as NavigationSection, a as NavigationSubMenu };
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"description": "Midas Layout components",
|
|
15
15
|
"homepage": "https://designsystem.migrationsverket.se/",
|
|
16
16
|
"license": "CC0-1.0",
|
|
17
|
-
"version": "0.2.
|
|
17
|
+
"version": "0.2.51",
|
|
18
18
|
"module": "./index.js",
|
|
19
19
|
"type": "module",
|
|
20
20
|
"main": "./index.js",
|
|
@@ -41,9 +41,11 @@
|
|
|
41
41
|
"react-dom": "^18.3.1 || ^19.0.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@midas-ds/components": "17.
|
|
44
|
+
"@midas-ds/components": "17.30.1",
|
|
45
45
|
"@react-aria/utils": "3.34.1",
|
|
46
46
|
"@react-stately/utils": "3.12.1",
|
|
47
|
+
"lucide-react": ">=0.563.0 <2.0.0",
|
|
48
|
+
"clsx": "^2.1.1",
|
|
47
49
|
"react-aria-components": "1.21.1"
|
|
48
50
|
}
|
|
49
51
|
}
|
package/panel/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "../chunks/panel-
|
|
1
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "../chunks/panel-Dekrlpea.js";
|
|
2
2
|
export { a as Panel, l as PanelBody, r as PanelContent, n as PanelContext, t as PanelHeader, o as PanelProvider, c as PanelRegion, s as PanelTitle, e as UsePanels, i as usePanels };
|
package/sidebar/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../chunks/sidebar-
|
|
1
|
+
import { n as e, t } from "../chunks/sidebar-D5GGUdTv.js";
|
|
2
2
|
export { t as Sidebar, e as SidebarContext };
|
package/utils/index.js
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { useSyncExternalStore as e } from "react";
|
|
3
|
+
//#region src/utils/useIsMobileDevice.ts
|
|
4
|
+
var t = "(max-width: 640px)", n = (e) => {
|
|
5
|
+
let n = window.matchMedia(t);
|
|
6
|
+
return n.addEventListener("change", e), () => n.removeEventListener("change", e);
|
|
7
|
+
}, r = () => window.matchMedia(t).matches, i = () => !1;
|
|
8
|
+
function a() {
|
|
9
|
+
return e(n, r, i);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { a as useIsMobileDevice };
|
package/chunks/clsx-Bok9rGJm.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/clsx/dist/clsx.mjs
|
|
2
|
-
function e(t) {
|
|
3
|
-
var n, r, i = "";
|
|
4
|
-
if (typeof t == "string" || typeof t == "number") i += t;
|
|
5
|
-
else if (typeof t == "object") {
|
|
6
|
-
if (Array.isArray(t)) {
|
|
7
|
-
var a = t.length;
|
|
8
|
-
for (n = 0; n < a; n++) t[n] && (r = e(t[n])) && (i && (i += " "), i += r);
|
|
9
|
-
} else for (r in t) t[r] && (i && (i += " "), i += r);
|
|
10
|
-
}
|
|
11
|
-
return i;
|
|
12
|
-
}
|
|
13
|
-
function t() {
|
|
14
|
-
for (var t, n, r = 0, i = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (n = e(t)) && (i && (i += " "), i += n);
|
|
15
|
-
return i;
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { t };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { createElement as e, forwardRef as t } from "react";
|
|
2
|
-
//#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
|
|
3
|
-
var n = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), r = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), i = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), a = (e) => {
|
|
4
|
-
let t = i(e);
|
|
5
|
-
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
6
|
-
}, o = {
|
|
7
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
-
width: 24,
|
|
9
|
-
height: 24,
|
|
10
|
-
viewBox: "0 0 24 24",
|
|
11
|
-
fill: "none",
|
|
12
|
-
stroke: "currentColor",
|
|
13
|
-
strokeWidth: 2,
|
|
14
|
-
strokeLinecap: "round",
|
|
15
|
-
strokeLinejoin: "round"
|
|
16
|
-
}, s = (e) => {
|
|
17
|
-
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
18
|
-
return !1;
|
|
19
|
-
}, c = t(({ color: t = "currentColor", size: r = 24, strokeWidth: i = 2, absoluteStrokeWidth: a, className: c = "", children: l, iconNode: u, ...d }, f) => e("svg", {
|
|
20
|
-
ref: f,
|
|
21
|
-
...o,
|
|
22
|
-
width: r,
|
|
23
|
-
height: r,
|
|
24
|
-
stroke: t,
|
|
25
|
-
strokeWidth: a ? Number(i) * 24 / Number(r) : i,
|
|
26
|
-
className: n("lucide", c),
|
|
27
|
-
...!l && !s(d) && { "aria-hidden": "true" },
|
|
28
|
-
...d
|
|
29
|
-
}, [...u.map(([t, n]) => e(t, n)), ...Array.isArray(l) ? l : [l]])), l = (i, o) => {
|
|
30
|
-
let s = t(({ className: t, ...s }, l) => e(c, {
|
|
31
|
-
ref: l,
|
|
32
|
-
iconNode: o,
|
|
33
|
-
className: n(`lucide-${r(a(i))}`, `lucide-${i}`, t),
|
|
34
|
-
...s
|
|
35
|
-
}));
|
|
36
|
-
return s.displayName = a(i), s;
|
|
37
|
-
};
|
|
38
|
-
//#endregion
|
|
39
|
-
export { l as t };
|