@midas-ds/layout 0.0.21 → 0.0.23
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 +14 -0
- package/assets/Header.css +1 -1
- package/assets/NavigationSubMenu.css +1 -1
- package/assets/PanelRegion.css +1 -0
- package/assets/PanelTitle.css +1 -0
- package/assets/Sidebar.css +1 -0
- package/chunks/Header-B1Nk3vII.js +89 -0
- package/chunks/LayoutContent-CvlzZxeo.js +23 -0
- package/chunks/Main-Dt0CIYBE.js +14 -0
- package/chunks/Navbar-Do2dFMRr.js +14 -0
- package/chunks/NavigationSubMenu-G-WkaNZA.js +164 -0
- package/chunks/PanelRegion-zsKP1Rye.js +177 -0
- package/chunks/PanelTitle-xkONCSrW.js +38 -0
- package/chunks/Sidebar-BFIjN5q6.js +70 -0
- package/chunks/SidebarContext-CoDRKR2m.js +8 -0
- package/chunks/clsx-OuTLNxxd.js +16 -0
- package/header/index.js +1 -1
- package/header/mobile-menu/MobileMenu.d.ts +6 -7
- package/index.d.ts +1 -0
- package/index.js +31 -31
- 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/navigation/navigation-header/NavigationHeader.d.ts +1 -2
- package/navigation/navigation-section/NavigationSection.d.ts +2 -2
- package/package.json +2 -2
- package/panel/Panel.d.ts +10 -10
- package/panel/Panel.stories.d.ts +2 -4
- package/panel/PanelContext.d.ts +12 -3
- package/panel/PanelProvider.d.ts +9 -0
- package/panel/PanelRegion.d.ts +3 -0
- package/panel/index.d.ts +5 -4
- package/panel/index.js +9 -13
- package/panel/intl/translations.json.d.ts +0 -4
- package/panel/panel-body/PanelBody.d.ts +3 -3
- package/panel/usePanels.d.ts +1 -0
- package/sidebar/Sidebar.d.ts +7 -0
- package/sidebar/SidebarContext.d.ts +3 -0
- package/sidebar/index.d.ts +2 -0
- package/sidebar/index.js +6 -0
- package/sidebar/intl/translations.json.d.ts +13 -0
- package/assets/Panel.css +0 -1
- package/chunks/Header-T5EUvNY7.js +0 -98
- package/chunks/LayoutContent-DhVL-boV.js +0 -22
- package/chunks/Main-Ce4U9_ce.js +0 -13
- package/chunks/Navbar-wOOCcsru.js +0 -13
- package/chunks/NavigationSubMenu-C-M26YYp.js +0 -171
- package/chunks/Panel-C-B48gnt.js +0 -281
- package/chunks/PanelContext-D6WQ7_yb.js +0 -11
- package/panel/collapse-panel/CollapsePanel.d.ts +0 -8
- package/panel/collapse-panel/CollapsePanelContext.d.ts +0 -3
- package/panel/collapse-panel/index.d.ts +0 -2
- package/panel/dismiss-panel/DismissPanel.d.ts +0 -11
- package/panel/dismiss-panel/DismissPanelContext.d.ts +0 -12
- package/panel/dismiss-panel/DismissPanelOutlet.d.ts +0 -3
- package/panel/dismiss-panel/DismissPanelProvider.d.ts +0 -9
- package/panel/dismiss-panel/index.d.ts +0 -5
- package/panel/dismiss-panel/useDismissPanels.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 0.0.23 (2026-03-25)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **layout:** rename CollapsePanel -> Sidebar ([b3627562f0](https://github.com/migrationsverket/midas/commit/b3627562f0))
|
|
6
|
+
- **layout:** utilize clsx function ([e5bbb1a937](https://github.com/migrationsverket/midas/commit/e5bbb1a937))
|
|
7
|
+
- **layout, mobile-menu:** remove custom state ([e4cc4f9b1e](https://github.com/migrationsverket/midas/commit/e4cc4f9b1e))
|
|
8
|
+
|
|
9
|
+
## 0.0.22 (2026-03-24)
|
|
10
|
+
|
|
11
|
+
### 🧱 Updated Dependencies
|
|
12
|
+
|
|
13
|
+
- Updated components to 17.10.1
|
|
14
|
+
|
|
1
15
|
## 0.0.21 (2026-03-23)
|
|
2
16
|
|
|
3
17
|
### 🩹 Fixes
|
package/assets/Header.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._headerActions_1rka5_1{display:flex;gap:.25rem;align-items:center;margin-inline-start:auto}@media(max-width:640px){._label_1191f_1{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}}.
|
|
1
|
+
._headerActions_1rka5_1{display:flex;gap:.25rem;align-items:center;margin-inline-start:auto}@media(max-width:640px){._label_1191f_1{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}}._overlay_1xtkw_1{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background-color:#0000004d;height:var(--page-height);left:0;position:absolute;top:0;width:100%}._overlay_1xtkw_1[data-entering]{animation:_drawer-blur_1xtkw_1 var(--midas-transition-duration-fast)}._overlay_1xtkw_1[data-exiting]{animation:_drawer-blur_1xtkw_1 var(--midas-transition-duration-fast) reverse ease-in}._drawer_1xtkw_19{background-color:var(--midas-background-base);left:0;position:sticky;width:clamp(10rem,15rem,90%);border-right:1px solid var(--midas-border-color-subtle);box-shadow:-8px 0 20px #0000001a;height:calc(100dvh + 200px);margin-right:auto;outline:none;overflow-y:auto;top:-100px}._drawer_1xtkw_19[data-entering]{animation:_drawer-slide_1xtkw_1 var(--midas-transition-duration-fast)}._drawer_1xtkw_19[data-exiting]{animation:_drawer-slide_1xtkw_1 var(--midas-transition-duration-fast) reverse ease-in}._dialog_1xtkw_44:focus-visible{outline:none}._header_1xtkw_50{background-color:var(--midas-background-base);display:block;margin-bottom:var(--midas-space-medium);padding:var(--midas-space-medium);position:sticky;top:0}@keyframes _drawer-blur_1xtkw_1{0%{background:#0000;-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0)}to{background:#0000004d;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}}@keyframes _drawer-slide_1xtkw_1{0%{transform:translate(-100%)}to{transform:translate(0)}}._header_105ne_1{background-color:var(--midas-background-base);display:flex;flex:1 0 auto;padding:1rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
._rootList_l3v98_1{margin:0;padding:0}._navigationHeader_j94pq_1{color:var(--midas-text-secondary);font-size:var(--midas-typography-font-size-20);padding:var(--midas-spacing-30)}._navigationHeader_j94pq_1._collapsed_j94pq_6{display:none}._navigationItem_1jt2l_1{list-style:none}.
|
|
1
|
+
._rootList_l3v98_1{margin:0;padding:0}._navigationHeader_j94pq_1{color:var(--midas-text-secondary);font-size:var(--midas-typography-font-size-20);padding:var(--midas-spacing-30)}._navigationHeader_j94pq_1._collapsed_j94pq_6{display:none}._navigationItem_1jt2l_1{list-style:none}._navigationLink_14vyt_1{align-items:center;align-self:stretch;border-left:var(--midas-size-10) solid transparent;color:var(--midas-text-primary);display:flex;flex-direction:column;flex:1 0 0%;font-family:var(--midas-typography-font-family);gap:var(--midas-spacing-30);justify-content:flex-end;padding:var(--midas-spacing-50);text-decoration:none}._navigationLink_14vyt_1[data-hovered],._navigationLink_14vyt_1:hover,._navigationLink_14vyt_1[data-active]{background-color:var(--midas-menu-item-background-hover)}._navigationLink_14vyt_1._sidebar_14vyt_21{flex-direction:row;justify-content:flex-start;padding:.625rem var(--midas-spacing-30)}._navigationLink_14vyt_1._sidebar_14vyt_21[data-active]{border-color:var(--midas-border-color-tertiary);font-weight:var(--midas-typography-weight-bold)}._navigationLink_14vyt_1 svg{height:var(--midas-size-90);width:var(--midas-size-90)}._navigationLink_14vyt_1._collapsed_14vyt_37{justify-content:center}._navigationLink_14vyt_1._collapsed_14vyt_37 ._title_14vyt_40{display:none}._navigationSection_1ae77_1{padding:0;margin:0 0 1rem}._navigationSection_1ae77_1._collapsed_1ae77_5{margin-bottom:0}._navigationSubMenu_vfyl6_1{padding:0;margin:0 0 1rem 1rem}._navigationSubMenu_vfyl6_1._collapsed_vfyl6_5{margin-left:0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._panel_tzg9l_1{position:absolute!important;top:0;right:0;width:320px;height:100%;overflow:hidden}._panel_tzg9l_1[data-promoting]{animation:_promote_tzg9l_1 var(--midas-transition-duration-fast) ease-out}@media(prefers-reduced-motion:reduce){._panel_tzg9l_1[data-promoting]{animation-duration:1ms}}._panel_tzg9l_1[data-entering]{animation:_slide-horizontally_tzg9l_1 var(--midas-transition-duration-fast)}._panel_tzg9l_1[data-exiting]{animation:_slide-horizontally_tzg9l_1 var(--midas-transition-duration-fast) reverse ease-in}@media(prefers-reduced-motion:reduce){._panel_tzg9l_1[data-entering],._panel_tzg9l_1[data-exiting]{animation-duration:1ms}}@media not (min-width:800px){._panel_tzg9l_1{bottom:0;width:100%;height:25%;left:0;top:unset}._panel_tzg9l_1[data-entering]{animation:_slide-vertically_tzg9l_1 var(--midas-transition-duration-fast)}._panel_tzg9l_1[data-exiting]{animation:_slide-vertically_tzg9l_1 var(--midas-transition-duration-fast) reverse ease-in}}._panelTitle_tzg9l_54{font-size:var(--midas-typography-font-size-20);display:block}@keyframes _promote_tzg9l_1{0%{opacity:.7;transform:scale(.97)}to{opacity:1;transform:scale(1)}}@keyframes _slide-horizontally_tzg9l_1{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes _slide-vertically_tzg9l_1{0%{transform:translateY(100%)}to{transform:translateY(0)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._panelBody_aouaw_1{background-color:var(--midas-background-base);box-sizing:border-box;padding:1rem}._panelHeader_11qv1_1{align-items:center;display:flex;justify-content:space-between}._panelTitle_w7y4m_1{display:block}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._sidebar_z7c8y_1{width:15rem;transition:width var(--midas-transition-duration-fast) ease-out}._sidebar_z7c8y_1._collapsed_z7c8y_5{width:80px}@media(max-width:640px){._sidebar_z7c8y_1{display:none}}._sidebarHeader_z7c8y_14{gap:0}._sidebarTitle_z7c8y_18{font-size:var(--midas-typography-font-size-20);display:block}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as e, jsxs as n, Fragment as _ } from "react/jsx-runtime";
|
|
3
|
+
import { c as i } from "./clsx-OuTLNxxd.js";
|
|
4
|
+
import { forwardRef as p } from "react";
|
|
5
|
+
import { composeRenderProps as c, ModalOverlay as u, Modal as v, Dialog as b } from "react-aria-components";
|
|
6
|
+
import { Button as d, DialogTrigger as M, Text as f, clsx as y, LogoContext as x } from "@midas-ds/components";
|
|
7
|
+
import { u as m } from "./useIsMobileDevice-D0iMVFPx.js";
|
|
8
|
+
import { M as g } from "./MobileMenuContext-Coj0sJ0N.js";
|
|
9
|
+
import { c as w } from "./createLucideIcon-CP-mMPfa.js";
|
|
10
|
+
import '../assets/Header.css';const N = "_headerActions_1rka5_1", k = {
|
|
11
|
+
headerActions: N
|
|
12
|
+
}, J = ({ className: a, ...o }) => /* @__PURE__ */ e(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
className: i(a, k.headerActions),
|
|
16
|
+
...o
|
|
17
|
+
}
|
|
18
|
+
), A = "_label_1191f_1", H = {
|
|
19
|
+
label: A
|
|
20
|
+
}, D = p(
|
|
21
|
+
({ children: a, icon: o, ...r }, t) => (!a && !r["aria-label"] && process.env.NODE_ENV !== "production" && console.warn(
|
|
22
|
+
"Please provide an 'aria-label' for HeaderAction components that doesnt have a visible label (children)"
|
|
23
|
+
), /* @__PURE__ */ e(
|
|
24
|
+
d,
|
|
25
|
+
{
|
|
26
|
+
ref: t,
|
|
27
|
+
size: "medium",
|
|
28
|
+
variant: "tertiary",
|
|
29
|
+
...r,
|
|
30
|
+
children: c(a, (l) => /* @__PURE__ */ n(_, { children: [
|
|
31
|
+
o,
|
|
32
|
+
typeof l < "u" && /* @__PURE__ */ e("span", { className: H.label, children: l })
|
|
33
|
+
] }))
|
|
34
|
+
}
|
|
35
|
+
))
|
|
36
|
+
);
|
|
37
|
+
D.displayName = "HeaderAction";
|
|
38
|
+
const $ = [
|
|
39
|
+
["path", { d: "M4 5h16", key: "1tepv9" }],
|
|
40
|
+
["path", { d: "M4 12h16", key: "1lakjw" }],
|
|
41
|
+
["path", { d: "M4 19h16", key: "1djgab" }]
|
|
42
|
+
], j = w("menu", $), P = "_overlay_1xtkw_1", z = "_drawer_1xtkw_19", C = "_dialog_1xtkw_44", E = "_header_1xtkw_50", s = {
|
|
43
|
+
overlay: P,
|
|
44
|
+
drawer: z,
|
|
45
|
+
dialog: C,
|
|
46
|
+
header: E
|
|
47
|
+
}, K = ({
|
|
48
|
+
children: a,
|
|
49
|
+
className: o,
|
|
50
|
+
title: r,
|
|
51
|
+
...t
|
|
52
|
+
}) => m() ? /* @__PURE__ */ e(g.Provider, { value: {}, children: /* @__PURE__ */ n(M, { children: [
|
|
53
|
+
/* @__PURE__ */ e(
|
|
54
|
+
d,
|
|
55
|
+
{
|
|
56
|
+
icon: j,
|
|
57
|
+
variant: "icon"
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ e(
|
|
61
|
+
u,
|
|
62
|
+
{
|
|
63
|
+
className: y(o, s.overlay),
|
|
64
|
+
isDismissable: !0,
|
|
65
|
+
...t,
|
|
66
|
+
children: c(a, (h) => /* @__PURE__ */ e(v, { className: s.drawer, children: /* @__PURE__ */ n(b, { className: s.dialog, children: [
|
|
67
|
+
r && /* @__PURE__ */ e(f, { className: s.header, children: r }),
|
|
68
|
+
h
|
|
69
|
+
] }) }))
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] }) }) : null, I = "_header_105ne_1", L = {
|
|
73
|
+
header: I
|
|
74
|
+
}, Q = ({ className: a, ...o }) => {
|
|
75
|
+
const r = m();
|
|
76
|
+
return /* @__PURE__ */ e(x.Provider, { value: { size: r ? "x-small" : "large" }, children: /* @__PURE__ */ e(
|
|
77
|
+
"header",
|
|
78
|
+
{
|
|
79
|
+
className: i(a, L.header),
|
|
80
|
+
...o
|
|
81
|
+
}
|
|
82
|
+
) });
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
Q as H,
|
|
86
|
+
K as M,
|
|
87
|
+
D as a,
|
|
88
|
+
J as b
|
|
89
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as a } from "./clsx-OuTLNxxd.js";
|
|
3
|
+
import '../assets/LayoutContent.css';const n = "_layout_4r2tn_1", l = {
|
|
4
|
+
layout: n
|
|
5
|
+
}, r = ({ className: t, ...o }) => /* @__PURE__ */ s(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: a(t, l.layout),
|
|
9
|
+
...o
|
|
10
|
+
}
|
|
11
|
+
), y = "_layoutContent_yqjxz_1", e = {
|
|
12
|
+
layoutContent: y
|
|
13
|
+
}, m = ({ className: t, ...o }) => /* @__PURE__ */ s(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: a(t, e.layoutContent),
|
|
17
|
+
...o
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
export {
|
|
21
|
+
r as L,
|
|
22
|
+
m as a
|
|
23
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as i } from "./clsx-OuTLNxxd.js";
|
|
3
|
+
import '../assets/Main.css';const n = "_main_vtpiw_1", o = {
|
|
4
|
+
main: n
|
|
5
|
+
}, r = ({ className: s, ...a }) => /* @__PURE__ */ m(
|
|
6
|
+
"main",
|
|
7
|
+
{
|
|
8
|
+
className: i(s, o.main),
|
|
9
|
+
...a
|
|
10
|
+
}
|
|
11
|
+
);
|
|
12
|
+
export {
|
|
13
|
+
r as M
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as s } from "./clsx-OuTLNxxd.js";
|
|
3
|
+
import '../assets/Navbar.css';const t = "_navbar_18aqo_1", n = {
|
|
4
|
+
navbar: t
|
|
5
|
+
}, m = ({ className: a, ...o }) => /* @__PURE__ */ r(
|
|
6
|
+
"footer",
|
|
7
|
+
{
|
|
8
|
+
className: s(a, n.navbar),
|
|
9
|
+
...o
|
|
10
|
+
}
|
|
11
|
+
);
|
|
12
|
+
export {
|
|
13
|
+
m as N
|
|
14
|
+
};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as n, jsxs as g } from "react/jsx-runtime";
|
|
3
|
+
import { Collection as $, OverlayTriggerStateContext as M, Focusable as k, Link as j } from "react-aria-components";
|
|
4
|
+
import { useContext as s } from "react";
|
|
5
|
+
import { Text as H, clsx as N, TooltipTrigger as I, Tooltip as T } from "@midas-ds/components";
|
|
6
|
+
import { S as r } from "./SidebarContext-CoDRKR2m.js";
|
|
7
|
+
import { M as D } from "./MobileMenuContext-Coj0sJ0N.js";
|
|
8
|
+
import { c as _ } from "./clsx-OuTLNxxd.js";
|
|
9
|
+
import { Collection as h } from "@react-aria/collections";
|
|
10
|
+
import '../assets/NavigationSubMenu.css';const O = "_rootList_l3v98_1", q = {
|
|
11
|
+
rootList: O
|
|
12
|
+
}, ao = ({
|
|
13
|
+
className: t,
|
|
14
|
+
items: o,
|
|
15
|
+
children: a,
|
|
16
|
+
dependencies: e,
|
|
17
|
+
idScope: i,
|
|
18
|
+
addIdAndValue: c,
|
|
19
|
+
...l
|
|
20
|
+
}) => /* @__PURE__ */ n(
|
|
21
|
+
"nav",
|
|
22
|
+
{
|
|
23
|
+
className: t,
|
|
24
|
+
...l,
|
|
25
|
+
children: /* @__PURE__ */ n("ul", { className: q.rootList, children: /* @__PURE__ */ n(
|
|
26
|
+
$,
|
|
27
|
+
{
|
|
28
|
+
items: o,
|
|
29
|
+
children: a,
|
|
30
|
+
dependencies: e,
|
|
31
|
+
idScope: i,
|
|
32
|
+
addIdAndValue: c
|
|
33
|
+
}
|
|
34
|
+
) })
|
|
35
|
+
}
|
|
36
|
+
), P = "_navigationHeader_j94pq_1", F = "_collapsed_j94pq_6", b = {
|
|
37
|
+
navigationHeader: P,
|
|
38
|
+
collapsed: F
|
|
39
|
+
}, w = ({ className: t, ...o }) => {
|
|
40
|
+
const a = s(r);
|
|
41
|
+
return /* @__PURE__ */ n(
|
|
42
|
+
H,
|
|
43
|
+
{
|
|
44
|
+
className: N(t, b.navigationHeader, {
|
|
45
|
+
[b.collapsed]: a?.isCollapsed
|
|
46
|
+
}),
|
|
47
|
+
...o
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}, z = "_navigationItem_1jt2l_1", x = {
|
|
51
|
+
navigationItem: z
|
|
52
|
+
}, A = ({ className: t, ...o }) => {
|
|
53
|
+
const a = s(r);
|
|
54
|
+
return /* @__PURE__ */ n(
|
|
55
|
+
"li",
|
|
56
|
+
{
|
|
57
|
+
className: _(t, x.navigationItem, {
|
|
58
|
+
[x.collapsed]: a?.isCollapsed
|
|
59
|
+
}),
|
|
60
|
+
...o
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}, B = "_navigationLink_14vyt_1", E = "_sidebar_14vyt_21", G = "_collapsed_14vyt_37", J = "_title_14vyt_40", d = {
|
|
64
|
+
navigationLink: B,
|
|
65
|
+
sidebar: E,
|
|
66
|
+
collapsed: G,
|
|
67
|
+
title: J
|
|
68
|
+
}, eo = ({
|
|
69
|
+
as: t,
|
|
70
|
+
children: o,
|
|
71
|
+
className: a,
|
|
72
|
+
isActive: e,
|
|
73
|
+
title: i,
|
|
74
|
+
"aria-label": c,
|
|
75
|
+
...l
|
|
76
|
+
}) => {
|
|
77
|
+
const S = s(D), m = s(r), p = m?.isCollapsed, u = s(M), L = t || j, C = () => {
|
|
78
|
+
u?.isOpen && u?.setOpen(!1);
|
|
79
|
+
};
|
|
80
|
+
return /* @__PURE__ */ g(I, { isDisabled: !p, children: [
|
|
81
|
+
/* @__PURE__ */ n(k, { children: /* @__PURE__ */ g(
|
|
82
|
+
L,
|
|
83
|
+
{
|
|
84
|
+
"aria-current": e && "page",
|
|
85
|
+
"aria-label": c || (p ? i : void 0),
|
|
86
|
+
className: N(a, d.navigationLink, {
|
|
87
|
+
[d.sidebar]: m || S,
|
|
88
|
+
[d.collapsed]: p
|
|
89
|
+
}),
|
|
90
|
+
"data-active": e || void 0,
|
|
91
|
+
...t ? {
|
|
92
|
+
onClick: (v) => {
|
|
93
|
+
C(), l.onClick?.(v);
|
|
94
|
+
}
|
|
95
|
+
} : {
|
|
96
|
+
onPress: (v) => {
|
|
97
|
+
C(), l.onPress?.(v);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
...l,
|
|
101
|
+
children: [
|
|
102
|
+
o,
|
|
103
|
+
/* @__PURE__ */ n("span", { className: d.title, children: i })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
) }),
|
|
107
|
+
/* @__PURE__ */ n(T, { placement: "right", children: i })
|
|
108
|
+
] });
|
|
109
|
+
}, K = "_navigationSection_1ae77_1", Q = "_collapsed_1ae77_5", y = {
|
|
110
|
+
navigationSection: K,
|
|
111
|
+
collapsed: Q
|
|
112
|
+
}, io = ({
|
|
113
|
+
className: t,
|
|
114
|
+
title: o,
|
|
115
|
+
...a
|
|
116
|
+
}) => {
|
|
117
|
+
const e = s(r);
|
|
118
|
+
return /* @__PURE__ */ n(A, { children: /* @__PURE__ */ g(
|
|
119
|
+
"ul",
|
|
120
|
+
{
|
|
121
|
+
className: _(t, y.navigationSection, {
|
|
122
|
+
[y.collapsed]: e?.isCollapsed
|
|
123
|
+
}),
|
|
124
|
+
children: [
|
|
125
|
+
o && /* @__PURE__ */ n(w, { children: o }),
|
|
126
|
+
/* @__PURE__ */ n(h, { ...a })
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
) });
|
|
130
|
+
}, R = "_navigationSubMenu_vfyl6_1", U = "_collapsed_vfyl6_5", f = {
|
|
131
|
+
navigationSubMenu: R,
|
|
132
|
+
collapsed: U
|
|
133
|
+
}, so = ({
|
|
134
|
+
className: t,
|
|
135
|
+
children: o,
|
|
136
|
+
items: a,
|
|
137
|
+
...e
|
|
138
|
+
}) => {
|
|
139
|
+
const i = s(r), { length: c } = Array.from(a || []);
|
|
140
|
+
return typeof o == "function" && c === 0 ? null : /* @__PURE__ */ n(
|
|
141
|
+
"ul",
|
|
142
|
+
{
|
|
143
|
+
className: _(t, f.navigationSubMenu, {
|
|
144
|
+
[f.collapsed]: i?.isCollapsed
|
|
145
|
+
}),
|
|
146
|
+
children: /* @__PURE__ */ n(
|
|
147
|
+
h,
|
|
148
|
+
{
|
|
149
|
+
items: a,
|
|
150
|
+
...e,
|
|
151
|
+
children: o
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
};
|
|
157
|
+
export {
|
|
158
|
+
ao as N,
|
|
159
|
+
w as a,
|
|
160
|
+
A as b,
|
|
161
|
+
eo as c,
|
|
162
|
+
io as d,
|
|
163
|
+
so as e
|
|
164
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as f, jsxs as g } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as b, useEffect as E, forwardRef as _, createContext as v, useState as C, useContext as T } from "react";
|
|
4
|
+
import { c as I } from "./clsx-OuTLNxxd.js";
|
|
5
|
+
import { useLocalizedStringFormatter as R, Button as j } from "@midas-ds/components";
|
|
6
|
+
import { useControlledState as y } from "@react-stately/utils";
|
|
7
|
+
import { useExitAnimation as z, useObjectRef as A, useEnterAnimation as S, filterDOMProps as k } from "@react-aria/utils";
|
|
8
|
+
import { P as N, a as L, b as M } from "./PanelTitle-xkONCSrW.js";
|
|
9
|
+
import { c as w } from "./createLucideIcon-CP-mMPfa.js";
|
|
10
|
+
import '../assets/PanelRegion.css';const B = [
|
|
11
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
12
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
13
|
+
], D = w("x", B), F = { closePanel: "Close panel" }, H = { closePanel: "Stäng panel" }, X = {
|
|
14
|
+
en: F,
|
|
15
|
+
sv: H
|
|
16
|
+
}, q = "_panel_tzg9l_1", G = "_panelTitle_tzg9l_54", x = {
|
|
17
|
+
panel: q,
|
|
18
|
+
panelTitle: G
|
|
19
|
+
}, J = (o) => {
|
|
20
|
+
const { onExited: l } = o, [a, m] = y(
|
|
21
|
+
o.isOpen,
|
|
22
|
+
o.defaultOpen || !1,
|
|
23
|
+
o.onOpenChange
|
|
24
|
+
), s = b(null), r = z(s, a), d = () => m((i) => !i);
|
|
25
|
+
return E(() => {
|
|
26
|
+
!a && !r && l?.();
|
|
27
|
+
}, [a, r, l]), !a && !r ? null : /* @__PURE__ */ f(
|
|
28
|
+
K,
|
|
29
|
+
{
|
|
30
|
+
isExiting: r,
|
|
31
|
+
onPress: d,
|
|
32
|
+
ref: s,
|
|
33
|
+
...o
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}, K = _(
|
|
37
|
+
({
|
|
38
|
+
className: o,
|
|
39
|
+
title: l,
|
|
40
|
+
onPress: a,
|
|
41
|
+
children: m,
|
|
42
|
+
isExiting: s,
|
|
43
|
+
defaultOpen: r,
|
|
44
|
+
promoting: d,
|
|
45
|
+
onPromotionEnd: i,
|
|
46
|
+
"aria-hidden": u,
|
|
47
|
+
...t
|
|
48
|
+
}, e) => {
|
|
49
|
+
const n = R(X), c = A(e), P = S(c, !r), O = (p) => {
|
|
50
|
+
p.target === p.currentTarget && d && i?.();
|
|
51
|
+
};
|
|
52
|
+
return /* @__PURE__ */ g(
|
|
53
|
+
N,
|
|
54
|
+
{
|
|
55
|
+
"aria-hidden": u || void 0,
|
|
56
|
+
className: I(o, x.panel),
|
|
57
|
+
ref: c,
|
|
58
|
+
"data-entering": P || void 0,
|
|
59
|
+
"data-exiting": s || void 0,
|
|
60
|
+
"data-promoting": d || void 0,
|
|
61
|
+
onAnimationEnd: O,
|
|
62
|
+
...k(t),
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ g(L, { children: [
|
|
65
|
+
/* @__PURE__ */ f("div", { children: l && /* @__PURE__ */ f(
|
|
66
|
+
M,
|
|
67
|
+
{
|
|
68
|
+
className: x.panelTitle,
|
|
69
|
+
title: l
|
|
70
|
+
}
|
|
71
|
+
) }),
|
|
72
|
+
/* @__PURE__ */ f(
|
|
73
|
+
j,
|
|
74
|
+
{
|
|
75
|
+
variant: "icon",
|
|
76
|
+
"aria-label": n.format("closePanel"),
|
|
77
|
+
onPress: a,
|
|
78
|
+
children: /* @__PURE__ */ f(D, { size: 20 })
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
] }),
|
|
82
|
+
m
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
), h = v({
|
|
88
|
+
panels: [],
|
|
89
|
+
addPanel: () => {
|
|
90
|
+
},
|
|
91
|
+
closePanel: () => {
|
|
92
|
+
},
|
|
93
|
+
removePanel: () => {
|
|
94
|
+
},
|
|
95
|
+
resetPromoting: () => {
|
|
96
|
+
}
|
|
97
|
+
}), te = ({
|
|
98
|
+
children: o,
|
|
99
|
+
defaultPanels: l = [],
|
|
100
|
+
panelBehavior: a = "bring-to-front"
|
|
101
|
+
}) => {
|
|
102
|
+
const [m, s] = C(
|
|
103
|
+
l.map((t) => ({ ...t, isOpen: !0, defaultOpen: !0 }))
|
|
104
|
+
), r = (t) => {
|
|
105
|
+
s((e) => {
|
|
106
|
+
const n = e.findIndex((c) => c.id === t.id);
|
|
107
|
+
if (n === -1)
|
|
108
|
+
return [...e, { ...t, isOpen: !0 }];
|
|
109
|
+
if (a === "bring-to-front") {
|
|
110
|
+
if (n === e.length - 1) return e;
|
|
111
|
+
const c = e[n];
|
|
112
|
+
return [
|
|
113
|
+
...e.filter((P) => P.id !== t.id),
|
|
114
|
+
{ ...c, isOpen: !0, promoting: !0 }
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
return a === "pop-to" ? e.map(
|
|
118
|
+
(c, P) => P > n ? { ...c, isOpen: !1 } : c
|
|
119
|
+
) : e;
|
|
120
|
+
});
|
|
121
|
+
}, d = (t) => {
|
|
122
|
+
s(
|
|
123
|
+
(e) => e.map((n) => n.id === t ? { ...n, isOpen: !1 } : n)
|
|
124
|
+
);
|
|
125
|
+
}, i = (t) => {
|
|
126
|
+
s((e) => e.filter((n) => n.id !== t));
|
|
127
|
+
}, u = (t) => {
|
|
128
|
+
s(
|
|
129
|
+
(e) => e.map((n) => n.id === t ? { ...n, promoting: !1 } : n)
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
return /* @__PURE__ */ f(
|
|
133
|
+
h.Provider,
|
|
134
|
+
{
|
|
135
|
+
value: { panels: m, addPanel: r, closePanel: d, removePanel: i, resetPromoting: u },
|
|
136
|
+
children: o
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}, Q = () => T(h), oe = ({
|
|
140
|
+
children: o,
|
|
141
|
+
className: l,
|
|
142
|
+
...a
|
|
143
|
+
}) => {
|
|
144
|
+
const { panels: m, closePanel: s, removePanel: r, resetPromoting: d } = Q();
|
|
145
|
+
return /* @__PURE__ */ g(
|
|
146
|
+
"aside",
|
|
147
|
+
{
|
|
148
|
+
className: l,
|
|
149
|
+
...a,
|
|
150
|
+
children: [
|
|
151
|
+
m.map(({ id: i, ...u }, t, { length: e }) => /* @__PURE__ */ f(
|
|
152
|
+
J,
|
|
153
|
+
{
|
|
154
|
+
"aria-hidden": t < e - 1 || void 0,
|
|
155
|
+
id: i,
|
|
156
|
+
"data-debug": "Panel",
|
|
157
|
+
onOpenChange: (n) => {
|
|
158
|
+
n || s(i);
|
|
159
|
+
},
|
|
160
|
+
onExited: () => r(i),
|
|
161
|
+
onPromotionEnd: () => d(i),
|
|
162
|
+
...u
|
|
163
|
+
},
|
|
164
|
+
i
|
|
165
|
+
)),
|
|
166
|
+
o
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
};
|
|
171
|
+
export {
|
|
172
|
+
J as P,
|
|
173
|
+
h as a,
|
|
174
|
+
te as b,
|
|
175
|
+
oe as c,
|
|
176
|
+
Q as u
|
|
177
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "./clsx-OuTLNxxd.js";
|
|
3
|
+
import { forwardRef as o } from "react";
|
|
4
|
+
import { Text as t, clsx as c } from "@midas-ds/components";
|
|
5
|
+
import '../assets/PanelTitle.css';const p = "_panelBody_aouaw_1", r = {
|
|
6
|
+
panelBody: p
|
|
7
|
+
}, B = o(
|
|
8
|
+
({ className: e, ...a }, l) => /* @__PURE__ */ s(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
ref: l,
|
|
12
|
+
className: n(e, r.panelBody),
|
|
13
|
+
...a
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
), d = "_panelHeader_11qv1_1", i = {
|
|
17
|
+
panelHeader: d
|
|
18
|
+
}, H = ({ className: e, ...a }) => /* @__PURE__ */ s(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
className: n(e, i.panelHeader),
|
|
22
|
+
...a
|
|
23
|
+
}
|
|
24
|
+
), m = "_panelTitle_w7y4m_1", y = {
|
|
25
|
+
panelTitle: m
|
|
26
|
+
}, P = ({ className: e, title: a, ...l }) => /* @__PURE__ */ s(
|
|
27
|
+
t,
|
|
28
|
+
{
|
|
29
|
+
className: c(e, y.panelTitle),
|
|
30
|
+
...l,
|
|
31
|
+
children: a
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
export {
|
|
35
|
+
B as P,
|
|
36
|
+
H as a,
|
|
37
|
+
P as b
|
|
38
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
import { c as h } from "./clsx-OuTLNxxd.js";
|
|
4
|
+
import { useLocalizedStringFormatter as b, Button as x } from "@midas-ds/components";
|
|
5
|
+
import { useControlledState as y } from "@react-stately/utils";
|
|
6
|
+
import { filterDOMProps as S } from "@react-aria/utils";
|
|
7
|
+
import { u as v } from "./useIsMobileDevice-D0iMVFPx.js";
|
|
8
|
+
import { S as u } from "./SidebarContext-CoDRKR2m.js";
|
|
9
|
+
import { c as t } from "./createLucideIcon-CP-mMPfa.js";
|
|
10
|
+
import { P as C, a as P, b as _ } from "./PanelTitle-xkONCSrW.js";
|
|
11
|
+
import '../assets/Sidebar.css';const g = [
|
|
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
|
+
], k = t("panel-left-close", g);
|
|
16
|
+
const z = [
|
|
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
|
+
], M = t("panel-left-open", z), L = { expandSidebar: "Expand sidebar", collapseSidebar: "Collapse sidebar" }, N = { expandSidebar: "Expandera sidopanel", collapseSidebar: "Minimera sidopanel" }, D = {
|
|
21
|
+
en: L,
|
|
22
|
+
sv: N
|
|
23
|
+
}, I = "_sidebar_z7c8y_1", j = "_collapsed_z7c8y_5", o = {
|
|
24
|
+
sidebar: I,
|
|
25
|
+
collapsed: j
|
|
26
|
+
}, A = ({
|
|
27
|
+
children: n,
|
|
28
|
+
className: d,
|
|
29
|
+
title: l,
|
|
30
|
+
...s
|
|
31
|
+
}) => {
|
|
32
|
+
const i = b(D), c = v(), [a, p] = y(
|
|
33
|
+
s.isCollapsed,
|
|
34
|
+
s.defaultCollapsed || !1,
|
|
35
|
+
s.onCollapseChange
|
|
36
|
+
), m = () => p((f) => !f);
|
|
37
|
+
return c ? null : /* @__PURE__ */ e(u.Provider, { value: { isCollapsed: a }, children: /* @__PURE__ */ e(
|
|
38
|
+
C,
|
|
39
|
+
{
|
|
40
|
+
className: h(d, o.sidebar, {
|
|
41
|
+
[o.collapsed]: a
|
|
42
|
+
}),
|
|
43
|
+
...S(s),
|
|
44
|
+
children: /* @__PURE__ */ r("aside", { children: [
|
|
45
|
+
/* @__PURE__ */ r(P, { children: [
|
|
46
|
+
/* @__PURE__ */ e("div", { children: !a && l && /* @__PURE__ */ e(
|
|
47
|
+
_,
|
|
48
|
+
{
|
|
49
|
+
className: o.panelTitle,
|
|
50
|
+
title: l
|
|
51
|
+
}
|
|
52
|
+
) }),
|
|
53
|
+
/* @__PURE__ */ e(
|
|
54
|
+
x,
|
|
55
|
+
{
|
|
56
|
+
variant: "icon",
|
|
57
|
+
"aria-label": a ? i.format("expandSidebar") : i.format("collapseSidebar"),
|
|
58
|
+
onPress: m,
|
|
59
|
+
children: a ? /* @__PURE__ */ e(M, { size: 20 }) : /* @__PURE__ */ e(k, { size: 20 })
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
] }),
|
|
63
|
+
n
|
|
64
|
+
] })
|
|
65
|
+
}
|
|
66
|
+
) });
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
A as S
|
|
70
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function a(r) {
|
|
2
|
+
var f, n, t = "";
|
|
3
|
+
if (typeof r == "string" || typeof r == "number") t += r;
|
|
4
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
5
|
+
var o = r.length;
|
|
6
|
+
for (f = 0; f < o; f++) r[f] && (n = a(r[f])) && (t && (t += " "), t += n);
|
|
7
|
+
} else for (n in r) r[n] && (t && (t += " "), t += n);
|
|
8
|
+
return t;
|
|
9
|
+
}
|
|
10
|
+
function i() {
|
|
11
|
+
for (var r, f, n = 0, t = "", o = arguments.length; n < o; n++) (r = arguments[n]) && (f = a(r)) && (t && (t += " "), t += f);
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
i as c
|
|
16
|
+
};
|
package/header/index.js
CHANGED