@midas-ds/layout 0.1.7 → 0.1.9
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/assets/Sidebar.css +1 -1
- package/chunks/Sidebar-CjS41s7C.js +91 -0
- package/index.js +1 -1
- package/navigation/navigation-link/NavigationLink.stories.d.ts +4 -0
- package/package.json +2 -2
- package/sidebar/Sidebar.stories.d.ts +2 -0
- package/sidebar/index.js +1 -1
- package/chunks/Sidebar-DDglufEI.js +0 -84
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 0.1.9 (2026-05-11)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **components,layout:** add badge pattern to navigation docs and fix sidebar transition ([b46ae8a3141](https://github.com/migrationsverket/midas/commit/b46ae8a3141))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated components to 17.14.7
|
|
10
|
+
|
|
11
|
+
## 0.1.8 (2026-05-11)
|
|
12
|
+
|
|
13
|
+
### 🧱 Updated Dependencies
|
|
14
|
+
|
|
15
|
+
- Updated components to 17.14.6
|
|
16
|
+
|
|
1
17
|
## 0.1.7 (2026-05-11)
|
|
2
18
|
|
|
3
19
|
### 🧱 Updated Dependencies
|
package/assets/Sidebar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._sidebar_zlaev_1{background-color:var(--midas-background-base);border-right:1px solid var(--midas-border-color-subtle);flex-shrink:0;transition:width var(--midas-transition-duration-fast) ease-out;width:15rem}._sidebar_zlaev_1._collapsed_zlaev_8{width:80px}@media(max-width:640px){._sidebar_zlaev_1{display:none}}._sidebarHeader_zlaev_17{gap:0}._sidebarHeader_zlaev_17._collapsed_zlaev_8{justify-content:center;padding:var(--midas-space-small)}._sidebarTitle_zlaev_26{display:block;font-size:var(--midas-typography-font-size-20);height:auto;interpolate-size:allow-keywords;opacity:1;overflow:hidden;transition:height var(--midas-transition-duration-fast) ease-out,opacity var(--midas-transition-duration-instant) ease-out}@starting-style{._sidebarTitle_zlaev_26{height:0;opacity:0}}._sidebarTitle_zlaev_26._collapsed_zlaev_8{display:none;height:0;opacity:0}._sidebarContent_zlaev_49{padding:var(--midas-space-small)}._sidebar_zlaev_1[data-transitioning] [data-badge]{opacity:0;transition:none}._sidebar_zlaev_1 [data-badge]{transition:opacity var(--midas-transition-duration-normal) ease var(--midas-transition-duration-fast)}@media(prefers-reduced-motion:reduce){._sidebar_zlaev_1[data-transitioning] [data-badge],._sidebar_zlaev_1 [data-badge]{transition:none}}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
3
|
+
import C from "react";
|
|
4
|
+
import { c as o } from "./clsx-OuTLNxxd.js";
|
|
5
|
+
import { useLocalizedStringFormatter as u, Button as x } from "@midas-ds/components";
|
|
6
|
+
import { useControlledState as S } from "@react-stately/utils";
|
|
7
|
+
import { filterDOMProps as g } from "@react-aria/utils";
|
|
8
|
+
import { u as y } from "./useIsMobileDevice-D0iMVFPx.js";
|
|
9
|
+
import { S as P } from "./SidebarContext-CoDRKR2m.js";
|
|
10
|
+
import { c } from "./createLucideIcon-CP-mMPfa.js";
|
|
11
|
+
import { P as z, b as T, c as N, a as k } from "./PanelTitle-j0OTJVF9.js";
|
|
12
|
+
import '../assets/Sidebar.css';const M = [
|
|
13
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
14
|
+
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
15
|
+
["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
|
|
16
|
+
], H = c("panel-left-close", M);
|
|
17
|
+
const E = [
|
|
18
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
19
|
+
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
20
|
+
["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
|
|
21
|
+
], I = c("panel-left-open", E), L = { expandSidebar: "Expand sidebar", collapseSidebar: "Collapse sidebar" }, w = { expandSidebar: "Expandera sidopanel", collapseSidebar: "Minimera sidopanel" }, D = {
|
|
22
|
+
en: L,
|
|
23
|
+
sv: w
|
|
24
|
+
}, $ = "_sidebar_zlaev_1", j = "_collapsed_zlaev_8", q = "_sidebarHeader_zlaev_17", B = "_sidebarTitle_zlaev_26", F = "_sidebarContent_zlaev_49", s = {
|
|
25
|
+
sidebar: $,
|
|
26
|
+
collapsed: j,
|
|
27
|
+
sidebarHeader: q,
|
|
28
|
+
sidebarTitle: B,
|
|
29
|
+
sidebarContent: F
|
|
30
|
+
}, X = ({
|
|
31
|
+
children: p,
|
|
32
|
+
className: m,
|
|
33
|
+
title: r,
|
|
34
|
+
...i
|
|
35
|
+
}) => {
|
|
36
|
+
const n = u(D), b = y(), [e, f] = S(
|
|
37
|
+
i.isCollapsed,
|
|
38
|
+
i.defaultCollapsed || !1,
|
|
39
|
+
i.onCollapseChange
|
|
40
|
+
), [h, l] = C.useState(!1), _ = () => {
|
|
41
|
+
l(!0), f((t) => !t);
|
|
42
|
+
}, v = (t) => {
|
|
43
|
+
t.propertyName === "width" && t.target === t.currentTarget && l(!1);
|
|
44
|
+
};
|
|
45
|
+
return b ? null : /* @__PURE__ */ a(P.Provider, { value: { isCollapsed: e }, children: /* @__PURE__ */ d(
|
|
46
|
+
z,
|
|
47
|
+
{
|
|
48
|
+
className: o(m, s.sidebar, {
|
|
49
|
+
[s.collapsed]: e
|
|
50
|
+
}),
|
|
51
|
+
"data-transitioning": h || void 0,
|
|
52
|
+
onTransitionEnd: v,
|
|
53
|
+
...g(i),
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ d(
|
|
56
|
+
T,
|
|
57
|
+
{
|
|
58
|
+
className: o(s.sidebarHeader, {
|
|
59
|
+
[s.collapsed]: e
|
|
60
|
+
}),
|
|
61
|
+
children: [
|
|
62
|
+
r ? /* @__PURE__ */ a(
|
|
63
|
+
N,
|
|
64
|
+
{
|
|
65
|
+
className: o(s.sidebarTitle, {
|
|
66
|
+
[s.collapsed]: e
|
|
67
|
+
}),
|
|
68
|
+
title: r
|
|
69
|
+
}
|
|
70
|
+
) : /* @__PURE__ */ a("div", {}),
|
|
71
|
+
/* @__PURE__ */ a(
|
|
72
|
+
x,
|
|
73
|
+
{
|
|
74
|
+
"aria-label": e ? n.format("expandSidebar") : n.format("collapseSidebar"),
|
|
75
|
+
onPress: _,
|
|
76
|
+
variant: "icon",
|
|
77
|
+
size: e ? "large" : "medium",
|
|
78
|
+
children: e ? /* @__PURE__ */ a(I, { size: 20 }) : /* @__PURE__ */ a(H, { size: 20 })
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ a(k, { className: s.sidebarContent, children: p })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
) });
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
X as S
|
|
91
|
+
};
|
package/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { L as i, a as x } from "./chunks/LayoutContent-jW-93mu7.js";
|
|
|
3
3
|
import { M as P } from "./chunks/Main-CyaHtpCj.js";
|
|
4
4
|
import { N as b, a as d, b as f, c as p, d as M, e as N } from "./chunks/NavigationSubMenu-DabVRyqI.js";
|
|
5
5
|
import { P as v, a as g, b as c, c as H, u as S } from "./chunks/PanelRegion-D7EnJBY_.js";
|
|
6
|
-
import { S as L } from "./chunks/Sidebar-
|
|
6
|
+
import { S as L } from "./chunks/Sidebar-CjS41s7C.js";
|
|
7
7
|
import { S as A } from "./chunks/SidebarContext-CoDRKR2m.js";
|
|
8
8
|
import { N as B } from "./chunks/Navbar-Do2dFMRr.js";
|
|
9
9
|
import { M as R } from "./chunks/MobileMenuContext-Coj0sJ0N.js";
|
|
@@ -19,3 +19,7 @@ export declare const Primary: Story;
|
|
|
19
19
|
export declare const Active: Story;
|
|
20
20
|
export declare const Disabled: Story;
|
|
21
21
|
export declare const Collapsed: Story;
|
|
22
|
+
export declare const WithBadge: Story;
|
|
23
|
+
export declare const WithBadgeLabel: Story;
|
|
24
|
+
export declare const WithBadgeActive: Story;
|
|
25
|
+
export declare const WithBadgeCollapsed: Story;
|
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.1.
|
|
17
|
+
"version": "0.1.9",
|
|
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.14.
|
|
40
|
+
"@midas-ds/components": "17.14.7",
|
|
41
41
|
"@react-aria/collections": "^3.0.3",
|
|
42
42
|
"@react-aria/utils": "^3.33.1",
|
|
43
43
|
"@react-stately/utils": "^3.11.0"
|
|
@@ -17,4 +17,6 @@ declare const _default: {
|
|
|
17
17
|
export default _default;
|
|
18
18
|
export declare const Primary: Story;
|
|
19
19
|
export declare const Collapsed: Story;
|
|
20
|
+
export declare const WithBadge: Story;
|
|
21
|
+
export declare const WithBadgeCollapsed: Story;
|
|
20
22
|
export declare const Controlled: Story;
|
package/sidebar/index.js
CHANGED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
3
|
-
import { c as o } from "./clsx-OuTLNxxd.js";
|
|
4
|
-
import { useLocalizedStringFormatter as h, Button as _ } from "@midas-ds/components";
|
|
5
|
-
import { useControlledState as C } from "@react-stately/utils";
|
|
6
|
-
import { filterDOMProps as x } from "@react-aria/utils";
|
|
7
|
-
import { u as S } from "./useIsMobileDevice-D0iMVFPx.js";
|
|
8
|
-
import { S as u } from "./SidebarContext-CoDRKR2m.js";
|
|
9
|
-
import { c as d } from "./createLucideIcon-CP-mMPfa.js";
|
|
10
|
-
import { P as v, b as y, c as P, a as g } from "./PanelTitle-j0OTJVF9.js";
|
|
11
|
-
import '../assets/Sidebar.css';const k = [
|
|
12
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
13
|
-
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
14
|
-
["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
|
|
15
|
-
], M = d("panel-left-close", k);
|
|
16
|
-
const N = [
|
|
17
|
-
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
18
|
-
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
19
|
-
["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
|
|
20
|
-
], z = d("panel-left-open", N), H = { expandSidebar: "Expand sidebar", collapseSidebar: "Collapse sidebar" }, T = { expandSidebar: "Expandera sidopanel", collapseSidebar: "Minimera sidopanel" }, L = {
|
|
21
|
-
en: H,
|
|
22
|
-
sv: T
|
|
23
|
-
}, D = "_sidebar_c9frf_1", I = "_collapsed_c9frf_8", j = "_sidebarHeader_c9frf_17", q = "_sidebarTitle_c9frf_26", w = "_sidebarContent_c9frf_49", s = {
|
|
24
|
-
sidebar: D,
|
|
25
|
-
collapsed: I,
|
|
26
|
-
sidebarHeader: j,
|
|
27
|
-
sidebarTitle: q,
|
|
28
|
-
sidebarContent: w
|
|
29
|
-
}, Q = ({
|
|
30
|
-
children: n,
|
|
31
|
-
className: c,
|
|
32
|
-
title: t,
|
|
33
|
-
...r
|
|
34
|
-
}) => {
|
|
35
|
-
const i = h(L), p = S(), [e, f] = C(
|
|
36
|
-
r.isCollapsed,
|
|
37
|
-
r.defaultCollapsed || !1,
|
|
38
|
-
r.onCollapseChange
|
|
39
|
-
), m = () => f((b) => !b);
|
|
40
|
-
return p ? null : /* @__PURE__ */ a(u.Provider, { value: { isCollapsed: e }, children: /* @__PURE__ */ l(
|
|
41
|
-
v,
|
|
42
|
-
{
|
|
43
|
-
className: o(c, s.sidebar, {
|
|
44
|
-
[s.collapsed]: e
|
|
45
|
-
}),
|
|
46
|
-
...x(r),
|
|
47
|
-
children: [
|
|
48
|
-
/* @__PURE__ */ l(
|
|
49
|
-
y,
|
|
50
|
-
{
|
|
51
|
-
className: o(s.sidebarHeader, {
|
|
52
|
-
[s.collapsed]: e
|
|
53
|
-
}),
|
|
54
|
-
children: [
|
|
55
|
-
t ? /* @__PURE__ */ a(
|
|
56
|
-
P,
|
|
57
|
-
{
|
|
58
|
-
className: o(s.sidebarTitle, {
|
|
59
|
-
[s.collapsed]: e
|
|
60
|
-
}),
|
|
61
|
-
title: t
|
|
62
|
-
}
|
|
63
|
-
) : /* @__PURE__ */ a("div", {}),
|
|
64
|
-
/* @__PURE__ */ a(
|
|
65
|
-
_,
|
|
66
|
-
{
|
|
67
|
-
"aria-label": e ? i.format("expandSidebar") : i.format("collapseSidebar"),
|
|
68
|
-
onPress: m,
|
|
69
|
-
variant: "icon",
|
|
70
|
-
size: e ? "large" : "medium",
|
|
71
|
-
children: e ? /* @__PURE__ */ a(z, { size: 20 }) : /* @__PURE__ */ a(M, { size: 20 })
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
/* @__PURE__ */ a(g, { className: s.sidebarContent, children: n })
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
) });
|
|
81
|
-
};
|
|
82
|
-
export {
|
|
83
|
-
Q as S
|
|
84
|
-
};
|