@midas-ds/layout 0.2.49 β 0.2.50
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 +10 -0
- package/chunks/header-iv39Aynt.js +90 -0
- package/chunks/{navigation-DBKcWjzG.js β navigation-DJD1q1vB.js} +2 -2
- package/chunks/panel-C7322H8Y.js +159 -0
- package/chunks/sidebar-C19-ABpL.js +63 -0
- package/header/index.js +1 -1
- package/index.js +7 -7
- package/navigation/index.js +1 -1
- package/package.json +3 -2
- package/panel/index.js +1 -1
- package/sidebar/index.js +1 -1
- 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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 0.2.50 (2026-10-09)
|
|
2
|
+
|
|
3
|
+
### π Features
|
|
4
|
+
|
|
5
|
+
- **components,layout,table-styles:** depend on lucide-react ([#1405](https://github.com/migrationsverket/midas/pull/1405))
|
|
6
|
+
|
|
7
|
+
### π§± Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated components to 17.30.0
|
|
10
|
+
|
|
1
11
|
## 0.2.49 (2026-10-09)
|
|
2
12
|
|
|
3
13
|
### π§± Updated Dependencies
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./clsx-Bok9rGJm.js";
|
|
3
|
+
import { t } from "./utils-CjjqyX25.js";
|
|
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: t, className: n }) => /* @__PURE__ */ r("div", {
|
|
10
|
+
className: e(v.headerActions, n),
|
|
11
|
+
children: t
|
|
12
|
+
}), b = {
|
|
13
|
+
headerAction: "_headerAction_dgfa1_1",
|
|
14
|
+
label: "_label_dgfa1_7"
|
|
15
|
+
}, x = o(({ children: t, icon: a, className: o, ...s }, c) => (!t && !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: e(b.headerAction, o),
|
|
20
|
+
...s,
|
|
21
|
+
children: l(t, (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: t, ...n }) => /* @__PURE__ */ r("span", {
|
|
41
|
+
className: e(w.headerTitle, t),
|
|
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: e, className: n, defaultOpen: a, isOpen: o, onOpenChange: f, title: v, ...y }) => {
|
|
55
|
+
let b = t(), 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(e, (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: t, ...n }) => /* @__PURE__ */ r("header", {
|
|
86
|
+
className: e(t, 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,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { t as e } from "./clsx-Bok9rGJm.js";
|
|
3
|
-
import { r as t } from "./header-
|
|
4
|
-
import { n } from "./sidebar-
|
|
3
|
+
import { r as t } from "./header-iv39Aynt.js";
|
|
4
|
+
import { n } from "./sidebar-C19-ABpL.js";
|
|
5
5
|
import { n as r } from "./navbar-DwUBXEZn.js";
|
|
6
6
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
7
|
import { useContext as o } from "react";
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./clsx-Bok9rGJm.js";
|
|
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 { t as e } from "./clsx-Bok9rGJm.js";
|
|
3
|
+
import { t } from "./utils-CjjqyX25.js";
|
|
4
|
+
import { c as n, l as r, s as i, u as a } from "./panel-C7322H8Y.js";
|
|
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 = t(), [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(a, {
|
|
36
|
+
className: e(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(n, {
|
|
41
|
+
className: e(_.sidebarHeader, { [_.collapsed]: C }),
|
|
42
|
+
children: [/* @__PURE__ */ o(i, {
|
|
43
|
+
className: e(_.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: e(_.collapseButton, { [_.collapsed]: C }),
|
|
52
|
+
children: /* @__PURE__ */ o(f, { size: 20 })
|
|
53
|
+
})
|
|
54
|
+
})]
|
|
55
|
+
}), /* @__PURE__ */ o(r, {
|
|
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-iv39Aynt.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 {
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./chunks/header-iv39Aynt.js";
|
|
2
|
+
import { n as s, t as c } from "./chunks/layout-D1po9FHB.js";
|
|
3
|
+
import { t as l } from "./chunks/main-fC0vGdZw.js";
|
|
4
|
+
import { a as u, i as d, n as f, o as p, r as m, t as h } from "./chunks/navigation-DJD1q1vB.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-C7322H8Y.js";
|
|
6
|
+
import { n as E, t as D } from "./chunks/sidebar-C19-ABpL.js";
|
|
7
7
|
import { n as O, t as k } from "./chunks/navbar-DwUBXEZn.js";
|
|
8
|
-
export { o as Header, r as HeaderAction, a as HeaderActions, e as HeaderLogo, t as HeaderTitle,
|
|
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/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-DJD1q1vB.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.50",
|
|
18
18
|
"module": "./index.js",
|
|
19
19
|
"type": "module",
|
|
20
20
|
"main": "./index.js",
|
|
@@ -41,9 +41,10 @@
|
|
|
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.0",
|
|
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",
|
|
47
48
|
"react-aria-components": "1.21.1"
|
|
48
49
|
}
|
|
49
50
|
}
|
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-C7322H8Y.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-C19-ABpL.js";
|
|
2
2
|
export { t as Sidebar, e as SidebarContext };
|
|
@@ -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 };
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { t as e } from "./clsx-Bok9rGJm.js";
|
|
3
|
-
import { t } from "./createLucideIcon-BgluSHFG.js";
|
|
4
|
-
import { t as n } from "./utils-CjjqyX25.js";
|
|
5
|
-
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
import { createContext as o, forwardRef as s } from "react";
|
|
7
|
-
import { Dialog as c, Modal as l, composeRenderProps as u } from "react-aria-components";
|
|
8
|
-
import { Button as d, DialogTrigger as f, Logo as p, ModalOverlay as m, Text as h, clsx as g, useLocalizedStringFormatter as _ } from "@midas-ds/components";
|
|
9
|
-
import '../assets/header.css';var v = { headerActions: "_headerActions_zpqnd_1" }, y = ({ children: t, className: n }) => /* @__PURE__ */ i("div", {
|
|
10
|
-
className: e(v.headerActions, n),
|
|
11
|
-
children: t
|
|
12
|
-
}), b = {
|
|
13
|
-
headerAction: "_headerAction_dgfa1_1",
|
|
14
|
-
label: "_label_dgfa1_7"
|
|
15
|
-
}, x = s(({ children: t, icon: n, className: o, ...s }, c) => (!t && !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__ */ i(d, {
|
|
16
|
-
ref: c,
|
|
17
|
-
size: "medium",
|
|
18
|
-
variant: "tertiary",
|
|
19
|
-
className: e(b.headerAction, o),
|
|
20
|
-
...s,
|
|
21
|
-
children: u(t, (e) => /* @__PURE__ */ a(r, { children: [n, e !== void 0 && /* @__PURE__ */ i("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__ */ a(r, { children: [/* @__PURE__ */ i(p, {
|
|
31
|
-
size: "x-small",
|
|
32
|
-
primary: e,
|
|
33
|
-
padding: !1,
|
|
34
|
-
className: S.mobile
|
|
35
|
-
}), /* @__PURE__ */ i(p, {
|
|
36
|
-
size: "small",
|
|
37
|
-
primary: e,
|
|
38
|
-
padding: !1,
|
|
39
|
-
className: S.desktop
|
|
40
|
-
})] }), w = { headerTitle: "_headerTitle_cw9hi_1" }, T = ({ className: t, ...n }) => /* @__PURE__ */ i("span", {
|
|
41
|
-
className: e(w.headerTitle, t),
|
|
42
|
-
...n
|
|
43
|
-
}), E = t("menu", [
|
|
44
|
-
["path", {
|
|
45
|
-
d: "M4 5h16",
|
|
46
|
-
key: "1tepv9"
|
|
47
|
-
}],
|
|
48
|
-
["path", {
|
|
49
|
-
d: "M4 12h16",
|
|
50
|
-
key: "1lakjw"
|
|
51
|
-
}],
|
|
52
|
-
["path", {
|
|
53
|
-
d: "M4 19h16",
|
|
54
|
-
key: "1djgab"
|
|
55
|
-
}]
|
|
56
|
-
]), D = o(void 0), O = {
|
|
57
|
-
en: { openMenu: "Open menu" },
|
|
58
|
-
sv: { openMenu: "Γppna meny" }
|
|
59
|
-
}, k = {
|
|
60
|
-
triggerButton: "_triggerButton_1k2eg_1",
|
|
61
|
-
overlay: "_overlay_1k2eg_5",
|
|
62
|
-
"drawer-blur": "_drawer-blur_1k2eg_1",
|
|
63
|
-
drawer: "_drawer_1k2eg_18",
|
|
64
|
-
"drawer-slide": "_drawer-slide_1k2eg_1",
|
|
65
|
-
dialog: "_dialog_1k2eg_43",
|
|
66
|
-
header: "_header_1k2eg_49"
|
|
67
|
-
}, A = ({ children: e, className: t, defaultOpen: r, isOpen: o, onOpenChange: s, title: p, ...v }) => {
|
|
68
|
-
let y = n(), b = _(O);
|
|
69
|
-
return y ? /* @__PURE__ */ i(D.Provider, {
|
|
70
|
-
value: {},
|
|
71
|
-
children: /* @__PURE__ */ a(f, {
|
|
72
|
-
isOpen: o,
|
|
73
|
-
onOpenChange: s,
|
|
74
|
-
defaultOpen: r,
|
|
75
|
-
children: [/* @__PURE__ */ i(d, {
|
|
76
|
-
"aria-label": b.format("openMenu"),
|
|
77
|
-
icon: E,
|
|
78
|
-
variant: "icon",
|
|
79
|
-
size: "medium",
|
|
80
|
-
className: k.triggerButton
|
|
81
|
-
}), /* @__PURE__ */ i(m, {
|
|
82
|
-
className: g(t, k.overlay),
|
|
83
|
-
isDismissable: !0,
|
|
84
|
-
...v,
|
|
85
|
-
children: u(e, (e) => /* @__PURE__ */ i(l, {
|
|
86
|
-
className: k.drawer,
|
|
87
|
-
children: /* @__PURE__ */ a(c, {
|
|
88
|
-
className: k.dialog,
|
|
89
|
-
children: [p && /* @__PURE__ */ i(h, {
|
|
90
|
-
className: k.header,
|
|
91
|
-
children: p
|
|
92
|
-
}), e]
|
|
93
|
-
})
|
|
94
|
-
}))
|
|
95
|
-
})]
|
|
96
|
-
})
|
|
97
|
-
}) : null;
|
|
98
|
-
}, j = { header: "_header_s0sjn_1" }, M = ({ className: t, ...n }) => /* @__PURE__ */ i("header", {
|
|
99
|
-
className: e(t, j.header),
|
|
100
|
-
...n
|
|
101
|
-
});
|
|
102
|
-
//#endregion
|
|
103
|
-
export { C as a, T as i, A as n, x as o, D as r, y as s, M as t };
|
package/chunks/panel-MI09-Qe_.js
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { t as e } from "./clsx-Bok9rGJm.js";
|
|
3
|
-
import { t } from "./createLucideIcon-BgluSHFG.js";
|
|
4
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
-
import { createContext as i, forwardRef as a, useContext as o, useEffect as s, useRef as c, useState as l } from "react";
|
|
6
|
-
import { Button as u, Text as d, clsx as f, useLocalizedStringFormatter as p } from "@midas-ds/components";
|
|
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 = t("x", [["path", {
|
|
10
|
-
d: "M18 6 6 18",
|
|
11
|
-
key: "1bl5f8"
|
|
12
|
-
}], ["path", {
|
|
13
|
-
d: "m6 6 12 12",
|
|
14
|
-
key: "d8bk6v"
|
|
15
|
-
}]]), b = { panelBody: "_panelBody_1p0jk_1" }, x = a(({ className: t, ...r }, i) => /* @__PURE__ */ n("aside", {
|
|
16
|
-
ref: i,
|
|
17
|
-
className: e(t, b.panelBody),
|
|
18
|
-
...r
|
|
19
|
-
})), S = { panelContent: "_panelContent_1gfrc_1" }, C = a(({ className: t, ...r }, i) => /* @__PURE__ */ n("div", {
|
|
20
|
-
ref: i,
|
|
21
|
-
tabIndex: 0,
|
|
22
|
-
className: e(t, S.panelContent),
|
|
23
|
-
...r
|
|
24
|
-
})), w = { panelHeader: "_panelHeader_1g1ux_1" }, T = ({ className: t, ...r }) => /* @__PURE__ */ n("div", {
|
|
25
|
-
className: e(t, w.panelHeader),
|
|
26
|
-
...r
|
|
27
|
-
}), E = { panelTitle: "_panelTitle_w7y4m_1" }, D = ({ className: e, title: t, ...r }) => /* @__PURE__ */ n(d, {
|
|
28
|
-
className: f(e, E.panelTitle),
|
|
29
|
-
...r,
|
|
30
|
-
children: t
|
|
31
|
-
}), O = {
|
|
32
|
-
en: { closePanel: "Close panel" },
|
|
33
|
-
sv: { closePanel: "StΓ€ng panel" }
|
|
34
|
-
}, k = {
|
|
35
|
-
panel: "_panel_16dwe_6",
|
|
36
|
-
promote: "_promote_16dwe_1",
|
|
37
|
-
"slide-horizontally": "_slide-horizontally_16dwe_1",
|
|
38
|
-
"slide-vertically": "_slide-vertically_16dwe_1",
|
|
39
|
-
panelActions: "_panelActions_16dwe_63",
|
|
40
|
-
panelTitle: "_panelTitle_16dwe_69"
|
|
41
|
-
}, A = (e) => {
|
|
42
|
-
let { onExited: t } = e, [r, i] = m(e.isOpen, e.defaultOpen || !1, e.onOpenChange), a = c(null), o = _(a, r);
|
|
43
|
-
return s(() => {
|
|
44
|
-
!r && !o && t?.();
|
|
45
|
-
}, [
|
|
46
|
-
r,
|
|
47
|
-
o,
|
|
48
|
-
t
|
|
49
|
-
]), !r && !o ? null : /* @__PURE__ */ n(j, {
|
|
50
|
-
isExiting: o,
|
|
51
|
-
onPress: () => i((e) => !e),
|
|
52
|
-
ref: a,
|
|
53
|
-
...e
|
|
54
|
-
});
|
|
55
|
-
}, j = a(({ className: t, title: i, actions: a, onPress: o, children: s, isExiting: c, defaultOpen: l, promoting: d, onPromotionEnd: f, "aria-hidden": m, ..._ }, b) => {
|
|
56
|
-
let S = p(O), w = v(b), E = g(w, !l);
|
|
57
|
-
return /* @__PURE__ */ r(x, {
|
|
58
|
-
"aria-hidden": m || void 0,
|
|
59
|
-
"aria-label": i,
|
|
60
|
-
className: e(t, k.panel),
|
|
61
|
-
ref: w,
|
|
62
|
-
"data-entering": E || void 0,
|
|
63
|
-
"data-exiting": c || void 0,
|
|
64
|
-
"data-promoting": d || void 0,
|
|
65
|
-
onAnimationEnd: (e) => {
|
|
66
|
-
e.target === e.currentTarget && d && f?.();
|
|
67
|
-
},
|
|
68
|
-
...h(_),
|
|
69
|
-
children: [/* @__PURE__ */ r(T, { children: [/* @__PURE__ */ n(D, {
|
|
70
|
-
className: k.panelTitle,
|
|
71
|
-
title: i
|
|
72
|
-
}), /* @__PURE__ */ r("div", {
|
|
73
|
-
className: k.panelActions,
|
|
74
|
-
children: [a, /* @__PURE__ */ n(u, {
|
|
75
|
-
"aria-label": S.format("closePanel"),
|
|
76
|
-
onPress: o,
|
|
77
|
-
size: "medium",
|
|
78
|
-
variant: "icon",
|
|
79
|
-
children: /* @__PURE__ */ n(y, { size: 20 })
|
|
80
|
-
})]
|
|
81
|
-
})] }), /* @__PURE__ */ n(C, { children: s })]
|
|
82
|
-
});
|
|
83
|
-
}), M = (e) => null;
|
|
84
|
-
M.displayName = "usePanels";
|
|
85
|
-
var N = i({
|
|
86
|
-
panels: [],
|
|
87
|
-
panelVariant: "overlay",
|
|
88
|
-
addPanel: () => {},
|
|
89
|
-
closePanel: () => {},
|
|
90
|
-
removePanel: () => {},
|
|
91
|
-
resetPromoting: () => {}
|
|
92
|
-
}), P = ({ children: e, defaultPanels: t = [], panelBehavior: r = "replace", panelVariant: i = "overlay" }) => {
|
|
93
|
-
let [a, o] = l(t.map((e) => ({
|
|
94
|
-
...e,
|
|
95
|
-
isOpen: !0,
|
|
96
|
-
defaultOpen: !0
|
|
97
|
-
})));
|
|
98
|
-
return /* @__PURE__ */ n(N.Provider, {
|
|
99
|
-
value: {
|
|
100
|
-
panels: a,
|
|
101
|
-
panelVariant: i,
|
|
102
|
-
addPanel: (e) => {
|
|
103
|
-
o((t) => {
|
|
104
|
-
if (r === "replace") return [{
|
|
105
|
-
...e,
|
|
106
|
-
isOpen: !0
|
|
107
|
-
}];
|
|
108
|
-
let n = t.findIndex((t) => t.id === e.id);
|
|
109
|
-
if (n === -1) return [...t, {
|
|
110
|
-
...e,
|
|
111
|
-
isOpen: !0
|
|
112
|
-
}];
|
|
113
|
-
if (r === "bring-to-front") {
|
|
114
|
-
if (n === t.length - 1) return t;
|
|
115
|
-
let r = t[n];
|
|
116
|
-
return [...t.filter((t) => t.id !== e.id), {
|
|
117
|
-
...r,
|
|
118
|
-
isOpen: !0,
|
|
119
|
-
promoting: !0
|
|
120
|
-
}];
|
|
121
|
-
}
|
|
122
|
-
return r === "pop-to" ? t.map((e, t) => t > n ? {
|
|
123
|
-
...e,
|
|
124
|
-
isOpen: !1
|
|
125
|
-
} : e) : t;
|
|
126
|
-
});
|
|
127
|
-
},
|
|
128
|
-
closePanel: (e) => {
|
|
129
|
-
o((t) => t.map((t) => t.id === e ? {
|
|
130
|
-
...t,
|
|
131
|
-
isOpen: !1
|
|
132
|
-
} : t));
|
|
133
|
-
},
|
|
134
|
-
removePanel: (e) => {
|
|
135
|
-
o((t) => t.filter((t) => t.id !== e));
|
|
136
|
-
},
|
|
137
|
-
resetPromoting: (e) => {
|
|
138
|
-
o((t) => t.map((t) => t.id === e ? {
|
|
139
|
-
...t,
|
|
140
|
-
promoting: !1
|
|
141
|
-
} : t));
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
children: e
|
|
145
|
-
});
|
|
146
|
-
}, F = () => o(N), I = { push: "_push_xcbfl_1" }, L = ({ children: t, className: i, ...a }) => {
|
|
147
|
-
let { panels: o, panelVariant: s, closePanel: c, removePanel: l, resetPromoting: u } = F(), d = o.length > 0;
|
|
148
|
-
return /* @__PURE__ */ r("div", {
|
|
149
|
-
className: e(i, s === "push" && I.push),
|
|
150
|
-
"data-open": s === "push" && d ? !0 : void 0,
|
|
151
|
-
...a,
|
|
152
|
-
children: [o.map(({ id: e, ...t }, r, { length: i }) => /* @__PURE__ */ n(A, {
|
|
153
|
-
"aria-hidden": r < i - 1 || void 0,
|
|
154
|
-
id: e,
|
|
155
|
-
onOpenChange: (t) => {
|
|
156
|
-
t || c(e);
|
|
157
|
-
},
|
|
158
|
-
onExited: () => l(e),
|
|
159
|
-
onPromotionEnd: () => u(e),
|
|
160
|
-
...t
|
|
161
|
-
}, e)), t]
|
|
162
|
-
});
|
|
163
|
-
};
|
|
164
|
-
//#endregion
|
|
165
|
-
export { M as a, T as c, N as i, C as l, F as n, A as o, P as r, D as s, L as t, x as u };
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { t as e } from "./clsx-Bok9rGJm.js";
|
|
3
|
-
import { t } from "./createLucideIcon-BgluSHFG.js";
|
|
4
|
-
import { c as n, l as r, s as i, u as a } from "./panel-MI09-Qe_.js";
|
|
5
|
-
import { t as o } from "./utils-CjjqyX25.js";
|
|
6
|
-
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
-
import l, { createContext as u } from "react";
|
|
8
|
-
import { Button as d, useLocalizedStringFormatter as f } from "@midas-ds/components";
|
|
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 = t("panel-left-close", [
|
|
12
|
-
["rect", {
|
|
13
|
-
width: "18",
|
|
14
|
-
height: "18",
|
|
15
|
-
x: "3",
|
|
16
|
-
y: "3",
|
|
17
|
-
rx: "2",
|
|
18
|
-
key: "afitv7"
|
|
19
|
-
}],
|
|
20
|
-
["path", {
|
|
21
|
-
d: "M9 3v18",
|
|
22
|
-
key: "fh3hqa"
|
|
23
|
-
}],
|
|
24
|
-
["path", {
|
|
25
|
-
d: "m16 15-3-3 3-3",
|
|
26
|
-
key: "14y99z"
|
|
27
|
-
}]
|
|
28
|
-
]), g = {
|
|
29
|
-
en: {
|
|
30
|
-
expandSidebar: "Expand sidebar",
|
|
31
|
-
collapseSidebar: "Collapse sidebar"
|
|
32
|
-
},
|
|
33
|
-
sv: {
|
|
34
|
-
expandSidebar: "Expandera sidopanel",
|
|
35
|
-
collapseSidebar: "Minimera sidopanel"
|
|
36
|
-
}
|
|
37
|
-
}, _ = u(void 0), v = {
|
|
38
|
-
sidebar: "_sidebar_1gkx7_1",
|
|
39
|
-
collapsed: "_collapsed_1gkx7_8",
|
|
40
|
-
sidebarHeader: "_sidebarHeader_1gkx7_20",
|
|
41
|
-
sidebarTitle: "_sidebarTitle_1gkx7_29",
|
|
42
|
-
collapseButton: "_collapseButton_1gkx7_47",
|
|
43
|
-
sidebarContent: "_sidebarContent_1gkx7_55"
|
|
44
|
-
}, y = ({ children: t, className: u, title: y, ...b }) => {
|
|
45
|
-
let x = f(g), S = o(), [C, w] = p(b.isCollapsed, b.defaultCollapsed || !1, b.onCollapseChange), [T, E] = l.useState(!1), D = () => {
|
|
46
|
-
E(!0), w((e) => !e);
|
|
47
|
-
}, O = (e) => {
|
|
48
|
-
e.propertyName === "width" && e.target === e.currentTarget && E(!1);
|
|
49
|
-
};
|
|
50
|
-
return S ? null : /* @__PURE__ */ s(_.Provider, {
|
|
51
|
-
value: { isCollapsed: C },
|
|
52
|
-
children: /* @__PURE__ */ c(a, {
|
|
53
|
-
className: e(u, v.sidebar, { [v.collapsed]: C }),
|
|
54
|
-
"data-transitioning": T || void 0,
|
|
55
|
-
onTransitionEnd: O,
|
|
56
|
-
...m(b, { propNames: /* @__PURE__ */ new Set(["style"]) }),
|
|
57
|
-
children: [/* @__PURE__ */ c(n, {
|
|
58
|
-
className: e(v.sidebarHeader, { [v.collapsed]: C }),
|
|
59
|
-
children: [/* @__PURE__ */ s(i, {
|
|
60
|
-
className: e(v.sidebarTitle, { [v.collapsed]: C }),
|
|
61
|
-
title: y
|
|
62
|
-
}), /* @__PURE__ */ s(d, {
|
|
63
|
-
"aria-label": C ? x.format("expandSidebar") : x.format("collapseSidebar"),
|
|
64
|
-
onPress: D,
|
|
65
|
-
variant: "icon",
|
|
66
|
-
size: "medium",
|
|
67
|
-
children: /* @__PURE__ */ s("span", {
|
|
68
|
-
className: e(v.collapseButton, { [v.collapsed]: C }),
|
|
69
|
-
children: /* @__PURE__ */ s(h, { size: 20 })
|
|
70
|
-
})
|
|
71
|
-
})]
|
|
72
|
-
}), /* @__PURE__ */ s(r, {
|
|
73
|
-
className: v.sidebarContent,
|
|
74
|
-
children: t
|
|
75
|
-
})]
|
|
76
|
-
})
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
//#endregion
|
|
80
|
-
export { _ as n, y as t };
|