@midas-ds/layout 0.2.10 → 0.2.11
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/assets/header.css +1 -1
- package/chunks/header-5ItL8E3-.js +103 -0
- package/chunks/{navigation-hnDP7Bj_.js → navigation-C7NE8eU6.js} +1 -1
- package/header/Header.stories.d.ts +2 -2
- package/header/header-actions/HeaderActions.d.ts +6 -3
- package/header/header-actions/HeaderActions.stories.d.ts +1 -1
- package/header/header-logo/HeaderLogo.d.ts +4 -0
- package/header/header-logo/index.d.ts +1 -0
- package/header/header-title/HeaderTitle.d.ts +3 -0
- package/header/header-title/index.d.ts +2 -0
- package/header/index.d.ts +2 -0
- package/header/index.js +2 -2
- package/index.js +8 -8
- package/navigation/index.js +1 -1
- package/package.json +1 -1
- package/chunks/header-C2zESp2o.js +0 -86
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 0.2.11 (2026-07-10)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **layout,header:** responsive header with HeaderLogo, HeaderActions, live docs examples ([33a1a41691e](https://github.com/migrationsverket/midas/commit/33a1a41691e))
|
|
6
|
+
|
|
7
|
+
### 🩹 Fixes
|
|
8
|
+
|
|
9
|
+
- **layout,header:** fix left edge spacing, system name padding, action gap, and mobile icon sizing ([18422bbafd6](https://github.com/migrationsverket/midas/commit/18422bbafd6))
|
|
10
|
+
|
|
1
11
|
## 0.2.10 (2026-07-08)
|
|
2
12
|
|
|
3
13
|
### 🧱 Updated Dependencies
|
package/assets/header.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._headerActions_zpqnd_1{align-items:center;gap:0;margin-inline-start:auto;display:flex}._headerAction_dgfa1_1{color:var(--midas-text-primary);position:relative}@media (width<=768px){._label_dgfa1_7{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}._headerAction_dgfa1_1{padding-inline:calc(var(--midas-space-50) - var(--border-width))}}._mobile_vwr3x_1{aspect-ratio:100/92;flex-shrink:0;height:2.25rem}@media (width>640px){._mobile_vwr3x_1{display:none}}._desktop_vwr3x_11{aspect-ratio:112/40;flex-shrink:0;height:2.5rem}@media (width<=640px){._desktop_vwr3x_11{display:none}}._headerTitle_cw9hi_1{font-family:var(--midas-typography-font-family);font-size:var(--midas-typography-font-size-30);font-weight:var(--midas-typography-weight-semi-bold);line-height:var(--midas-typography-line-height-50);color:var(--midas-text-primary);white-space:nowrap;margin-inline-start:var(--midas-space-medium);padding-inline-end:var(--midas-space-medium)}._triggerButton_1k2eg_1{margin-inline-start:calc(-1 * var(--midas-space-50))}._overlay_1k2eg_5{display:block}._overlay_1k2eg_5[data-entering]{animation:_drawer-blur_1k2eg_1 var(--midas-transition-duration-quick)}._overlay_1k2eg_5[data-exiting]{animation:_drawer-blur_1k2eg_1 var(--midas-transition-duration-quick) reverse var(--midas-transition-timing-ease-in)}._drawer_1k2eg_18{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_1k2eg_18[data-entering]{animation:_drawer-slide_1k2eg_1 var(--midas-transition-duration-quick)}._drawer_1k2eg_18[data-exiting]{animation:_drawer-slide_1k2eg_1 var(--midas-transition-duration-quick) reverse var(--midas-transition-timing-ease-in)}._dialog_1k2eg_43:focus-visible{outline:none}._header_1k2eg_49{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_1k2eg_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_1k2eg_1{0%{transform:translate(-100%)}to{transform:translate(0)}}._header_s0sjn_1{background-color:var(--midas-background-base);border-bottom:1px solid var(--midas-border-color-subtle);min-height:4.5rem;padding-inline:var(--midas-space-medium);align-items:center;display:flex}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./clsx-CbxlCXZ3.js";
|
|
3
|
+
import { t } from "./createLucideIcon-BgluSHFG.js";
|
|
4
|
+
import { t as n } from "./utils-B0BlrR1T.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 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { t as e } from "./clsx-CbxlCXZ3.js";
|
|
3
|
-
import { r as t } from "./header-
|
|
3
|
+
import { r as t } from "./header-5ItL8E3-.js";
|
|
4
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";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface HeaderActionsProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const HeaderActions: ({ children, className }: HeaderActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { HeaderActions } from './HeaderActions';
|
|
3
3
|
type Story = StoryObj<typeof HeaderActions>;
|
|
4
4
|
declare const _default: {
|
|
5
|
-
component: ({
|
|
5
|
+
component: ({ children, className }: import('./HeaderActions').HeaderActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
title: string;
|
|
7
7
|
tags: string[];
|
|
8
8
|
parameters: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './HeaderLogo';
|
package/header/index.d.ts
CHANGED
package/header/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, r,
|
|
2
|
-
export {
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../chunks/header-5ItL8E3-.js";
|
|
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, r,
|
|
2
|
-
import { n as
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as
|
|
5
|
-
import { t as
|
|
6
|
-
import { a as
|
|
7
|
-
import { t as
|
|
8
|
-
export {
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./chunks/header-5ItL8E3-.js";
|
|
2
|
+
import { n as s, t as c } from "./chunks/sidebar-c0uIh8ge.js";
|
|
3
|
+
import { a as l, c as u, i as d, l as f, n as p, o as m, r as h, s as g, t as _, u as v } from "./chunks/panel-CJr6C1-h.js";
|
|
4
|
+
import { n as y, t as b } from "./chunks/layout-BL0juoss.js";
|
|
5
|
+
import { t as x } from "./chunks/main-BHQLIt4r.js";
|
|
6
|
+
import { a as S, i as C, n as w, o as T, r as E, t as D } from "./chunks/navigation-C7NE8eU6.js";
|
|
7
|
+
import { t as O } from "./chunks/navbar-C63VGKFb.js";
|
|
8
|
+
export { o as Header, r as HeaderAction, a as HeaderActions, e as HeaderLogo, t as HeaderTitle, y as Layout, b as LayoutContent, x as Main, n as MobileMenu, i as MobileMenuContext, O as Navbar, T as Navigation, S as NavigationHeader, C as NavigationItem, E as NavigationLink, w as NavigationSection, D as NavigationSubMenu, m as Panel, v as PanelBody, f as PanelContent, d as PanelContext, u as PanelHeader, h as PanelProvider, _ as PanelRegion, g as PanelTitle, c as Sidebar, s as SidebarContext, l as UsePanels, p 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-C7NE8eU6.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
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { t as e } from "./clsx-CbxlCXZ3.js";
|
|
3
|
-
import { t } from "./createLucideIcon-BgluSHFG.js";
|
|
4
|
-
import { t as n } from "./utils-B0BlrR1T.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, LogoContext 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_1rka5_1" }, y = ({ className: t, ...n }) => /* @__PURE__ */ i("div", {
|
|
10
|
-
className: e(t, v.headerActions),
|
|
11
|
-
...n
|
|
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
|
-
ref: o,
|
|
14
|
-
size: "medium",
|
|
15
|
-
variant: "tertiary",
|
|
16
|
-
...n,
|
|
17
|
-
children: u(e, (e) => /* @__PURE__ */ a(r, { children: [t, e !== void 0 && /* @__PURE__ */ i("span", {
|
|
18
|
-
className: b.label,
|
|
19
|
-
children: e
|
|
20
|
-
})] }))
|
|
21
|
-
})));
|
|
22
|
-
x.displayName = "HeaderAction";
|
|
23
|
-
var S = t("menu", [
|
|
24
|
-
["path", {
|
|
25
|
-
d: "M4 5h16",
|
|
26
|
-
key: "1tepv9"
|
|
27
|
-
}],
|
|
28
|
-
["path", {
|
|
29
|
-
d: "M4 12h16",
|
|
30
|
-
key: "1lakjw"
|
|
31
|
-
}],
|
|
32
|
-
["path", {
|
|
33
|
-
d: "M4 19h16",
|
|
34
|
-
key: "1djgab"
|
|
35
|
-
}]
|
|
36
|
-
]), C = o(void 0), w = {
|
|
37
|
-
en: { openMenu: "Open menu" },
|
|
38
|
-
sv: { openMenu: "Öppna meny" }
|
|
39
|
-
}, T = {
|
|
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
|
-
}, E = ({ children: e, className: t, defaultOpen: r, isOpen: o, onOpenChange: s, title: p, ...v }) => {
|
|
47
|
-
let y = n(), b = _(w);
|
|
48
|
-
return y ? /* @__PURE__ */ i(C.Provider, {
|
|
49
|
-
value: {},
|
|
50
|
-
children: /* @__PURE__ */ a(f, {
|
|
51
|
-
isOpen: o,
|
|
52
|
-
onOpenChange: s,
|
|
53
|
-
defaultOpen: r,
|
|
54
|
-
children: [/* @__PURE__ */ i(d, {
|
|
55
|
-
"aria-label": b.format("openMenu"),
|
|
56
|
-
icon: S,
|
|
57
|
-
variant: "icon"
|
|
58
|
-
}), /* @__PURE__ */ i(m, {
|
|
59
|
-
className: g(t, T.overlay),
|
|
60
|
-
isDismissable: !0,
|
|
61
|
-
...v,
|
|
62
|
-
children: u(e, (e) => /* @__PURE__ */ i(l, {
|
|
63
|
-
className: T.drawer,
|
|
64
|
-
children: /* @__PURE__ */ a(c, {
|
|
65
|
-
className: T.dialog,
|
|
66
|
-
children: [p && /* @__PURE__ */ i(h, {
|
|
67
|
-
className: T.header,
|
|
68
|
-
children: p
|
|
69
|
-
}), e]
|
|
70
|
-
})
|
|
71
|
-
}))
|
|
72
|
-
})]
|
|
73
|
-
})
|
|
74
|
-
}) : null;
|
|
75
|
-
}, D = { header: "_header_i5439_1" }, O = ({ className: t, ...r }) => {
|
|
76
|
-
let a = n();
|
|
77
|
-
return /* @__PURE__ */ i(p.Provider, {
|
|
78
|
-
value: { size: a ? "x-small" : "large" },
|
|
79
|
-
children: /* @__PURE__ */ i("header", {
|
|
80
|
-
className: e(t, D.header),
|
|
81
|
-
...r
|
|
82
|
-
})
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
//#endregion
|
|
86
|
-
export { y as a, x as i, E as n, C as r, O as t };
|