@midas-ds/layout 0.2.6 → 0.2.8
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/assets/header.css +1 -1
- package/assets/navigation.css +1 -1
- package/assets/sidebar.css +1 -1
- package/chunks/{header--aFkqcRB.js → header-C2zESp2o.js} +7 -7
- package/chunks/{navigation-C27FuxMS.js → navigation-hnDP7Bj_.js} +11 -11
- package/chunks/sidebar-c0uIh8ge.js +80 -0
- package/header/index.js +1 -1
- package/index.js +3 -3
- package/navigation/index.js +1 -1
- package/package.json +2 -2
- package/sidebar/Sidebar.d.ts +3 -2
- package/sidebar/index.js +1 -1
- package/chunks/sidebar-BhbGgFMU.js +0 -93
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## 0.2.8 (2026-07-06)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **layout,sidebar:** rework collapse/expand animation ([03a1331aa36](https://github.com/migrationsverket/midas/commit/03a1331aa36))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated components to 17.17.1
|
|
10
|
+
|
|
11
|
+
## 0.2.7 (2026-07-06)
|
|
12
|
+
|
|
13
|
+
### 🔧 Maintenance
|
|
14
|
+
|
|
15
|
+
- **workspace:** upgrade nx-stylelint to v19 and stylelint to v17 ([072ccfd0975](https://github.com/migrationsverket/midas/commit/072ccfd0975))
|
|
16
|
+
|
|
17
|
+
### 🧱 Updated Dependencies
|
|
18
|
+
|
|
19
|
+
- Updated components to 17.17.0
|
|
20
|
+
|
|
1
21
|
## 0.2.6 (2026-07-03)
|
|
2
22
|
|
|
3
23
|
### 🧱 Updated Dependencies
|
package/assets/header.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._headerActions_1rka5_1{align-items:center;gap:.25rem;margin-inline-start:auto;display:flex}@media (width<=640px){.
|
|
1
|
+
._headerActions_1rka5_1{align-items:center;gap:.25rem;margin-inline-start:auto;display:flex}@media (width<=640px){._label_1sror_1{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}}._overlay_yrp40_1{display:block}._overlay_yrp40_1[data-entering]{animation:_drawer-blur_yrp40_1 var(--midas-transition-duration-quick)}._overlay_yrp40_1[data-exiting]{animation:_drawer-blur_yrp40_1 var(--midas-transition-duration-quick) reverse var(--midas-transition-timing-ease-in)}._drawer_yrp40_14{background-color:var(--midas-background-base);border-right:1px solid var(--midas-border-color-subtle);outline:none;width:clamp(10rem,15rem,90%);height:calc(100dvh + 200px);margin-right:auto;position:sticky;top:-100px;left:0;overflow-y:auto;box-shadow:-8px 0 20px #0000001a}._drawer_yrp40_14[data-entering]{animation:_drawer-slide_yrp40_1 var(--midas-transition-duration-quick)}._drawer_yrp40_14[data-exiting]{animation:_drawer-slide_yrp40_1 var(--midas-transition-duration-quick) reverse var(--midas-transition-timing-ease-in)}._dialog_yrp40_39:focus-visible{outline:none}._header_yrp40_45{background-color:var(--midas-background-base);margin-bottom:var(--midas-space-medium);padding:var(--midas-space-medium);display:block;position:sticky;top:0}@keyframes _drawer-blur_yrp40_1{0%{-webkit-backdrop-filter:blur();backdrop-filter:blur();background:0 0}to{background:var(--midas-overlay-background);-webkit-backdrop-filter:var(--midas-overlay-blur);backdrop-filter:var(--midas-overlay-blur)}}@keyframes _drawer-slide_yrp40_1{0%{transform:translate(-100%)}to{transform:translate(0)}}._header_i5439_1{background-color:var(--midas-background-base);border-bottom:1px solid var(--midas-border-color-subtle);gap:var(--midas-space-xlarge);display:flex}
|
package/assets/navigation.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._rootList_l3v98_1{margin:0;padding:0}.
|
|
1
|
+
._rootList_l3v98_1{margin:0;padding:0}._navigationHeader_18u5f_1{color:var(--midas-text-secondary);font-size:var(--midas-typography-font-size-20);padding:var(--midas-space-60) var(--midas-space-small) var(--midas-space-xsmall)}._navigationHeader_18u5f_1._collapsed_18u5f_7{display:none}._navigationItem_1jt2l_1{list-style:none}._navigationLink_1kvxy_1{border-left:var(--midas-size-10) solid transparent;color:var(--midas-text-primary);font-family:var(--midas-typography-font-family);align-self:stretch;align-items:center;gap:var(--midas-spacing-30);padding:var(--midas-spacing-50);flex-direction:column;flex:1 0;justify-content:flex-end;text-decoration:none;display:flex}._navigationLink_1kvxy_1[data-hovered],._navigationLink_1kvxy_1:hover{background-color:var(--midas-navigation-link-background-hover)}._navigationLink_1kvxy_1[data-active]{background-color:var(--midas-navigation-link-background-selected)}._navigationLink_1kvxy_1[data-active][data-hovered],._navigationLink_1kvxy_1[data-active]:hover{background-color:var(--midas-navigation-link-background-selected-hover)}._navigationLink_1kvxy_1._sidebar_1kvxy_29{box-sizing:border-box;padding:var(--midas-space-50) var(--midas-space-small);flex-direction:row;justify-content:flex-start;align-items:flex-start;width:100%;padding-inline-start:var(--midas-space-30)}._navigationLink_1kvxy_1._sidebar_1kvxy_29[data-active]{border-color:var(--midas-border-color-tertiary);font-weight:var(--midas-typography-weight-medium)}._navigationLink_1kvxy_1._sidebar_1kvxy_29._collapsed_1kvxy_43{width:100%}._navigationLink_1kvxy_1 svg{height:var(--midas-size-90);width:var(--midas-size-90);flex-shrink:0}._navigationLink_1kvxy_1 ._title_1kvxy_54{max-width:100%;transition:max-width var(--midas-transition-duration-fast) ease-out;overflow:hidden}._navigationLink_1kvxy_1._collapsed_1kvxy_43 ._title_1kvxy_54{white-space:nowrap;max-width:0}[data-transitioning] ._navigationLink_1kvxy_1 ._title_1kvxy_54{white-space:nowrap}@media (prefers-reduced-motion:reduce){._navigationLink_1kvxy_1 ._title_1kvxy_54{transition:none}}._navigationSection_1ae77_1{margin:0 0 1rem;padding:0}._navigationSection_1ae77_1._collapsed_1ae77_5{margin-bottom:0}._navigationSubMenu_vfyl6_1{margin:0 0 1rem 1rem;padding:0}._navigationSubMenu_vfyl6_1._collapsed_vfyl6_5{margin-left:0}
|
package/assets/sidebar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._sidebar_42bd1_1{background-color:var(--midas-background-base);border-right:1px solid var(--midas-border-color-subtle);transition:width var(--midas-transition-duration-fast) ease-out;flex-shrink:0;width:300px}._sidebar_42bd1_1._collapsed_42bd1_8{width:calc(var(--midas-size-icon) + 4 * var(--midas-space-small))}@media (width<=640px){._sidebar_42bd1_1{display:none}}._sidebarHeader_42bd1_17{transition:padding-left var(--midas-transition-duration-fast) ease-out;gap:0}._sidebarHeader_42bd1_17._collapsed_42bd1_8{padding-left:var(--midas-space-30)}._sidebarTitle_42bd1_26{font-size:var(--midas-typography-font-size-30);font-weight:var(--midas-typography-weight-semi-bold);line-height:var(--midas-typography-line-height-50);white-space:nowrap;max-width:100%;transition:max-width var(--midas-transition-duration-fast) ease-out, opacity var(--midas-transition-duration-fast) ease-out;display:block;overflow:hidden}._sidebarTitle_42bd1_26._collapsed_42bd1_8{opacity:0;max-width:0}._collapseButton_42bd1_44{display:inline-flex}._collapseButton_42bd1_44._collapsed_42bd1_8{transform:scaleX(-1)}._sidebarContent_42bd1_52{padding:var(--midas-space-small)}._sidebar_42bd1_1[data-transitioning] [data-badge]{opacity:0;transition:none}._sidebar_42bd1_1 [data-badge]{transition:opacity var(--midas-transition-duration-normal) ease var(--midas-transition-duration-fast)}@media (prefers-reduced-motion:reduce){._sidebar_42bd1_1,._sidebarHeader_42bd1_17,._sidebarTitle_42bd1_26,._sidebar_42bd1_1[data-transitioning] [data-badge],._sidebar_42bd1_1 [data-badge]{transition:none}}
|
|
@@ -9,7 +9,7 @@ import { Button as d, DialogTrigger as f, LogoContext as p, ModalOverlay as m, T
|
|
|
9
9
|
import '../assets/header.css';var v = { headerActions: "_headerActions_1rka5_1" }, y = ({ className: t, ...n }) => /* @__PURE__ */ i("div", {
|
|
10
10
|
className: e(t, v.headerActions),
|
|
11
11
|
...n
|
|
12
|
-
}), b = { label: "
|
|
12
|
+
}), b = { label: "_label_1sror_1" }, x = s(({ children: e, icon: t, ...n }, o) => (!e && !n["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, {
|
|
13
13
|
ref: o,
|
|
14
14
|
size: "medium",
|
|
15
15
|
variant: "tertiary",
|
|
@@ -37,12 +37,12 @@ var S = t("menu", [
|
|
|
37
37
|
en: { openMenu: "Open menu" },
|
|
38
38
|
sv: { openMenu: "Öppna meny" }
|
|
39
39
|
}, T = {
|
|
40
|
-
overlay: "
|
|
41
|
-
"drawer-blur": "_drawer-
|
|
42
|
-
drawer: "
|
|
43
|
-
"drawer-slide": "_drawer-
|
|
44
|
-
dialog: "
|
|
45
|
-
header: "
|
|
40
|
+
overlay: "_overlay_yrp40_1",
|
|
41
|
+
"drawer-blur": "_drawer-blur_yrp40_1",
|
|
42
|
+
drawer: "_drawer_yrp40_14",
|
|
43
|
+
"drawer-slide": "_drawer-slide_yrp40_1",
|
|
44
|
+
dialog: "_dialog_yrp40_39",
|
|
45
|
+
header: "_header_yrp40_45"
|
|
46
46
|
}, E = ({ children: e, className: t, defaultOpen: r, isOpen: o, onOpenChange: s, title: p, ...v }) => {
|
|
47
47
|
let y = n(), b = _(w);
|
|
48
48
|
return y ? /* @__PURE__ */ i(C.Provider, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { t as e } from "./clsx-CbxlCXZ3.js";
|
|
3
|
-
import { r as t } from "./header
|
|
4
|
-
import { n } from "./sidebar-
|
|
3
|
+
import { r as t } from "./header-C2zESp2o.js";
|
|
4
|
+
import { n } from "./sidebar-c0uIh8ge.js";
|
|
5
5
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
6
|
import { useContext as a } from "react";
|
|
7
7
|
import { Collection as o, Focusable as s, Link as c, OverlayTriggerStateContext as l } from "react-aria-components";
|
|
@@ -21,8 +21,8 @@ import '../assets/navigation.css';var h = { rootList: "_rootList_l3v98_1" }, g =
|
|
|
21
21
|
})
|
|
22
22
|
})
|
|
23
23
|
}), _ = {
|
|
24
|
-
navigationHeader: "
|
|
25
|
-
collapsed: "
|
|
24
|
+
navigationHeader: "_navigationHeader_18u5f_1",
|
|
25
|
+
collapsed: "_collapsed_18u5f_7"
|
|
26
26
|
}, v = ({ className: e, ...t }) => {
|
|
27
27
|
let i = a(n);
|
|
28
28
|
return /* @__PURE__ */ r(u, {
|
|
@@ -36,10 +36,10 @@ import '../assets/navigation.css';var h = { rootList: "_rootList_l3v98_1" }, g =
|
|
|
36
36
|
...i
|
|
37
37
|
});
|
|
38
38
|
}, x = {
|
|
39
|
-
navigationLink: "
|
|
40
|
-
sidebar: "
|
|
41
|
-
collapsed: "
|
|
42
|
-
title: "
|
|
39
|
+
navigationLink: "_navigationLink_1kvxy_1",
|
|
40
|
+
sidebar: "_sidebar_1kvxy_29",
|
|
41
|
+
collapsed: "_collapsed_1kvxy_43",
|
|
42
|
+
title: "_title_1kvxy_54"
|
|
43
43
|
}, S = ({ as: e, children: o, className: u, isActive: m, icon: h, "aria-label": g, ..._ }) => {
|
|
44
44
|
let v = a(t), y = a(n), b = y?.isCollapsed, S = a(l), C = e || c, w = () => {
|
|
45
45
|
S?.isOpen && S?.setOpen(!1);
|
|
@@ -74,10 +74,10 @@ import '../assets/navigation.css';var h = { rootList: "_rootList_l3v98_1" }, g =
|
|
|
74
74
|
collapsed: "_collapsed_1ae77_5"
|
|
75
75
|
}, w = ({ className: t, title: o, ...s }) => {
|
|
76
76
|
let c = a(n);
|
|
77
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ i(b, { children: [o && /* @__PURE__ */ r(v, { children: o }), /* @__PURE__ */ r("ul", {
|
|
78
78
|
className: e(t, C.navigationSection, { [C.collapsed]: c?.isCollapsed }),
|
|
79
|
-
children:
|
|
80
|
-
}) });
|
|
79
|
+
children: /* @__PURE__ */ r(m, { ...s })
|
|
80
|
+
})] });
|
|
81
81
|
}, T = {
|
|
82
82
|
navigationSubMenu: "_navigationSubMenu_vfyl6_1",
|
|
83
83
|
collapsed: "_collapsed_vfyl6_5"
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./clsx-CbxlCXZ3.js";
|
|
3
|
+
import { t } from "./createLucideIcon-BgluSHFG.js";
|
|
4
|
+
import { c as n, l as r, s as i, u as a } from "./panel-CJr6C1-h.js";
|
|
5
|
+
import { t as o } from "./utils-B0BlrR1T.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_42bd1_1",
|
|
39
|
+
collapsed: "_collapsed_42bd1_8",
|
|
40
|
+
sidebarHeader: "_sidebarHeader_42bd1_17",
|
|
41
|
+
sidebarTitle: "_sidebarTitle_42bd1_26",
|
|
42
|
+
collapseButton: "_collapseButton_42bd1_44",
|
|
43
|
+
sidebarContent: "_sidebarContent_42bd1_52"
|
|
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),
|
|
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 };
|
package/header/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "../chunks/header
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "../chunks/header-C2zESp2o.js";
|
|
2
2
|
export { i as Header, t as HeaderAction, e as HeaderActions, n as MobileMenu, r as MobileMenuContext };
|
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "./chunks/header
|
|
2
|
-
import { n as a, t as o } from "./chunks/sidebar-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./chunks/header-C2zESp2o.js";
|
|
2
|
+
import { n as a, t as o } from "./chunks/sidebar-c0uIh8ge.js";
|
|
3
3
|
import { a as s, c, i as l, l as u, n as d, o as f, r as p, s as m, t as h, u as g } from "./chunks/panel-CJr6C1-h.js";
|
|
4
4
|
import { n as _, t as v } from "./chunks/layout-BL0juoss.js";
|
|
5
5
|
import { t as y } from "./chunks/main-BHQLIt4r.js";
|
|
6
|
-
import { a as b, i as x, n as S, o as C, r as w, t as T } from "./chunks/navigation-
|
|
6
|
+
import { a as b, i as x, n as S, o as C, r as w, t as T } from "./chunks/navigation-hnDP7Bj_.js";
|
|
7
7
|
import { t as E } from "./chunks/navbar-C63VGKFb.js";
|
|
8
8
|
export { i as Header, t as HeaderAction, e as HeaderActions, _ as Layout, v as LayoutContent, y as Main, n as MobileMenu, r as MobileMenuContext, E as Navbar, C as Navigation, b as NavigationHeader, x as NavigationItem, w as NavigationLink, S as NavigationSection, T as NavigationSubMenu, f as Panel, g as PanelBody, u as PanelContent, l as PanelContext, c as PanelHeader, p as PanelProvider, h as PanelRegion, m as PanelTitle, o as Sidebar, a as SidebarContext, s as UsePanels, d 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-hnDP7Bj_.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.8",
|
|
18
18
|
"module": "./index.js",
|
|
19
19
|
"type": "module",
|
|
20
20
|
"main": "./index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"./*": "./*/index.js"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@midas-ds/components": "17.
|
|
40
|
+
"@midas-ds/components": "17.17.1",
|
|
41
41
|
"@react-aria/collections": "^3.0.3",
|
|
42
42
|
"@react-aria/utils": "^3.33.1",
|
|
43
43
|
"@react-stately/utils": "^3.11.0"
|
package/sidebar/Sidebar.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PanelBodyProps
|
|
2
|
-
export interface SidebarProps extends PanelBodyProps
|
|
1
|
+
import { PanelBodyProps } from '../panel';
|
|
2
|
+
export interface SidebarProps extends PanelBodyProps {
|
|
3
|
+
title: string;
|
|
3
4
|
isCollapsed?: boolean;
|
|
4
5
|
defaultCollapsed?: boolean;
|
|
5
6
|
onCollapseChange?: (isCollapsed: boolean) => void;
|
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-c0uIh8ge.js";
|
|
2
2
|
export { t as Sidebar, e as SidebarContext };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { t as e } from "./clsx-CbxlCXZ3.js";
|
|
3
|
-
import { t } from "./createLucideIcon-BgluSHFG.js";
|
|
4
|
-
import { c as n, l as r, s as i, u as a } from "./panel-CJr6C1-h.js";
|
|
5
|
-
import { t as o } from "./utils-B0BlrR1T.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 = t("panel-left-open", [
|
|
29
|
-
["rect", {
|
|
30
|
-
width: "18",
|
|
31
|
-
height: "18",
|
|
32
|
-
x: "3",
|
|
33
|
-
y: "3",
|
|
34
|
-
rx: "2",
|
|
35
|
-
key: "afitv7"
|
|
36
|
-
}],
|
|
37
|
-
["path", {
|
|
38
|
-
d: "M9 3v18",
|
|
39
|
-
key: "fh3hqa"
|
|
40
|
-
}],
|
|
41
|
-
["path", {
|
|
42
|
-
d: "m14 9 3 3-3 3",
|
|
43
|
-
key: "8010ee"
|
|
44
|
-
}]
|
|
45
|
-
]), _ = {
|
|
46
|
-
en: {
|
|
47
|
-
expandSidebar: "Expand sidebar",
|
|
48
|
-
collapseSidebar: "Collapse sidebar"
|
|
49
|
-
},
|
|
50
|
-
sv: {
|
|
51
|
-
expandSidebar: "Expandera sidopanel",
|
|
52
|
-
collapseSidebar: "Minimera sidopanel"
|
|
53
|
-
}
|
|
54
|
-
}, v = u(void 0), y = {
|
|
55
|
-
sidebar: "_sidebar_zlaev_1",
|
|
56
|
-
collapsed: "_collapsed_zlaev_8",
|
|
57
|
-
sidebarHeader: "_sidebarHeader_zlaev_17",
|
|
58
|
-
sidebarTitle: "_sidebarTitle_zlaev_26",
|
|
59
|
-
sidebarContent: "_sidebarContent_zlaev_49"
|
|
60
|
-
}, b = ({ children: t, className: u, title: b, ...x }) => {
|
|
61
|
-
let S = f(_), C = o(), [w, T] = p(x.isCollapsed, x.defaultCollapsed || !1, x.onCollapseChange), [E, D] = l.useState(!1), O = () => {
|
|
62
|
-
D(!0), T((e) => !e);
|
|
63
|
-
}, k = (e) => {
|
|
64
|
-
e.propertyName === "width" && e.target === e.currentTarget && D(!1);
|
|
65
|
-
};
|
|
66
|
-
return C ? null : /* @__PURE__ */ s(v.Provider, {
|
|
67
|
-
value: { isCollapsed: w },
|
|
68
|
-
children: /* @__PURE__ */ c(a, {
|
|
69
|
-
className: e(u, y.sidebar, { [y.collapsed]: w }),
|
|
70
|
-
"data-transitioning": E || void 0,
|
|
71
|
-
onTransitionEnd: k,
|
|
72
|
-
...m(x),
|
|
73
|
-
children: [/* @__PURE__ */ c(n, {
|
|
74
|
-
className: e(y.sidebarHeader, { [y.collapsed]: w }),
|
|
75
|
-
children: [b ? /* @__PURE__ */ s(i, {
|
|
76
|
-
className: e(y.sidebarTitle, { [y.collapsed]: w }),
|
|
77
|
-
title: b
|
|
78
|
-
}) : /* @__PURE__ */ s("div", {}), /* @__PURE__ */ s(d, {
|
|
79
|
-
"aria-label": w ? S.format("expandSidebar") : S.format("collapseSidebar"),
|
|
80
|
-
onPress: O,
|
|
81
|
-
variant: "icon",
|
|
82
|
-
size: w ? "large" : "medium",
|
|
83
|
-
children: s(w ? g : h, { size: 20 })
|
|
84
|
-
})]
|
|
85
|
-
}), /* @__PURE__ */ s(r, {
|
|
86
|
-
className: y.sidebarContent,
|
|
87
|
-
children: t
|
|
88
|
-
})]
|
|
89
|
-
})
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
//#endregion
|
|
93
|
-
export { v as n, b as t };
|