@midas-ds/layout 0.2.10 → 0.2.12

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 CHANGED
@@ -1,3 +1,23 @@
1
+ ## 0.2.12 (2026-08-13)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **layout,navigation:** migrate off unresolvable @react-aria/collections dependency ([2322e21ef9a](https://github.com/migrationsverket/midas/commit/2322e21ef9a))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated components to 17.18.0
10
+
11
+ ## 0.2.11 (2026-07-10)
12
+
13
+ ### 🚀 Features
14
+
15
+ - **layout,header:** responsive header with HeaderLogo, HeaderActions, live docs examples ([33a1a41691e](https://github.com/migrationsverket/midas/commit/33a1a41691e))
16
+
17
+ ### 🩹 Fixes
18
+
19
+ - **layout,header:** fix left edge spacing, system name padding, action gap, and mobile icon sizing ([18422bbafd6](https://github.com/migrationsverket/midas/commit/18422bbafd6))
20
+
1
21
  ## 0.2.10 (2026-07-08)
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){._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}
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,17 +1,16 @@
1
1
  'use client';
2
2
  import { t as e } from "./clsx-CbxlCXZ3.js";
3
- import { r as t } from "./header-C2zESp2o.js";
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";
7
7
  import { Collection as o, Focusable as s, Link as c, OverlayTriggerStateContext as l } from "react-aria-components";
8
8
  import { Text as u, Tooltip as d, TooltipTrigger as f, clsx as p } from "@midas-ds/components";
9
- import { Collection as m } from "@react-aria/collections";
10
- import '../assets/navigation.css';var h = { rootList: "_rootList_l3v98_1" }, g = ({ className: e, items: t, children: n, dependencies: i, idScope: a, addIdAndValue: s, ...c }) => /* @__PURE__ */ r("nav", {
9
+ import '../assets/navigation.css';var m = { rootList: "_rootList_l3v98_1" }, h = ({ className: e, items: t, children: n, dependencies: i, idScope: a, addIdAndValue: s, ...c }) => /* @__PURE__ */ r("nav", {
11
10
  className: e,
12
11
  ...c,
13
12
  children: /* @__PURE__ */ r("ul", {
14
- className: h.rootList,
13
+ className: m.rootList,
15
14
  children: /* @__PURE__ */ r(o, {
16
15
  items: t,
17
16
  children: n,
@@ -20,38 +19,38 @@ import '../assets/navigation.css';var h = { rootList: "_rootList_l3v98_1" }, g =
20
19
  addIdAndValue: s
21
20
  })
22
21
  })
23
- }), _ = {
22
+ }), g = {
24
23
  navigationHeader: "_navigationHeader_18u5f_1",
25
24
  collapsed: "_collapsed_18u5f_7"
26
- }, v = ({ className: e, ...t }) => {
25
+ }, _ = ({ className: e, ...t }) => {
27
26
  let i = a(n);
28
27
  return /* @__PURE__ */ r(u, {
29
- className: p(e, _.navigationHeader, { [_.collapsed]: i?.isCollapsed }),
28
+ className: p(e, g.navigationHeader, { [g.collapsed]: i?.isCollapsed }),
30
29
  ...t
31
30
  });
32
- }, y = { navigationItem: "_navigationItem_1jt2l_1" }, b = ({ className: t, ...i }) => {
31
+ }, v = { navigationItem: "_navigationItem_1jt2l_1" }, y = ({ className: t, ...i }) => {
33
32
  let o = a(n);
34
33
  return /* @__PURE__ */ r("li", {
35
- className: e(t, y.navigationItem, { [y.collapsed]: o?.isCollapsed }),
34
+ className: e(t, v.navigationItem, { [v.collapsed]: o?.isCollapsed }),
36
35
  ...i
37
36
  });
38
- }, x = {
37
+ }, b = {
39
38
  navigationLink: "_navigationLink_1kvxy_1",
40
39
  sidebar: "_sidebar_1kvxy_29",
41
40
  collapsed: "_collapsed_1kvxy_43",
42
41
  title: "_title_1kvxy_54"
43
- }, S = ({ as: e, children: o, className: u, isActive: m, icon: h, "aria-label": g, ..._ }) => {
44
- let v = a(t), y = a(n), b = y?.isCollapsed, S = a(l), C = e || c, w = () => {
42
+ }, x = ({ as: e, children: o, className: u, isActive: m, icon: h, "aria-label": g, ..._ }) => {
43
+ let v = a(t), y = a(n), x = y?.isCollapsed, S = a(l), C = e || c, w = () => {
45
44
  S?.isOpen && S?.setOpen(!1);
46
45
  }, T = typeof o == "string" ? o : void 0;
47
46
  return !T && !g && process.env.NODE_ENV !== "production" && console.warn("An 'aria-label' is required for <NavigationLink> elements with non plain text children"), /* @__PURE__ */ i(f, {
48
- isDisabled: !b || !T && !g,
47
+ isDisabled: !x || !T && !g,
49
48
  children: [/* @__PURE__ */ r(s, { children: /* @__PURE__ */ i(C, {
50
49
  "aria-current": m && "page",
51
- "aria-label": g || (b ? T : void 0),
52
- className: p(u, x.navigationLink, {
53
- [x.sidebar]: y || v,
54
- [x.collapsed]: b
50
+ "aria-label": g || (x ? T : void 0),
51
+ className: p(u, b.navigationLink, {
52
+ [b.sidebar]: y || v,
53
+ [b.collapsed]: x
55
54
  }),
56
55
  "data-active": m || void 0,
57
56
  ...e ? { onClick: (e) => {
@@ -61,7 +60,7 @@ import '../assets/navigation.css';var h = { rootList: "_rootList_l3v98_1" }, g =
61
60
  } },
62
61
  ..._,
63
62
  children: [h, /* @__PURE__ */ r("span", {
64
- className: x.title,
63
+ className: b.title,
65
64
  children: o
66
65
  })]
67
66
  }) }), /* @__PURE__ */ r(d, {
@@ -69,28 +68,28 @@ import '../assets/navigation.css';var h = { rootList: "_rootList_l3v98_1" }, g =
69
68
  children: T
70
69
  })]
71
70
  });
72
- }, C = {
71
+ }, S = {
73
72
  navigationSection: "_navigationSection_1ae77_1",
74
73
  collapsed: "_collapsed_1ae77_5"
75
- }, w = ({ className: t, title: o, ...s }) => {
76
- let c = a(n);
77
- return /* @__PURE__ */ i(b, { children: [o && /* @__PURE__ */ r(v, { children: o }), /* @__PURE__ */ r("ul", {
78
- className: e(t, C.navigationSection, { [C.collapsed]: c?.isCollapsed }),
79
- children: /* @__PURE__ */ r(m, { ...s })
74
+ }, C = ({ className: t, title: s, ...c }) => {
75
+ let l = a(n);
76
+ return /* @__PURE__ */ i(y, { children: [s && /* @__PURE__ */ r(_, { children: s }), /* @__PURE__ */ r("ul", {
77
+ className: e(t, S.navigationSection, { [S.collapsed]: l?.isCollapsed }),
78
+ children: /* @__PURE__ */ r(o, { ...c })
80
79
  })] });
81
- }, T = {
80
+ }, w = {
82
81
  navigationSubMenu: "_navigationSubMenu_vfyl6_1",
83
82
  collapsed: "_collapsed_vfyl6_5"
84
- }, E = ({ className: t, children: i, items: o, ...s }) => {
85
- let c = a(n), { length: l } = Array.from(o || []);
86
- return typeof i == "function" && l === 0 ? null : /* @__PURE__ */ r("ul", {
87
- className: e(t, T.navigationSubMenu, { [T.collapsed]: c?.isCollapsed }),
88
- children: /* @__PURE__ */ r(m, {
89
- items: o,
90
- ...s,
83
+ }, T = ({ className: t, children: i, items: s, ...c }) => {
84
+ let l = a(n), { length: u } = Array.from(s || []);
85
+ return typeof i == "function" && u === 0 ? null : /* @__PURE__ */ r("ul", {
86
+ className: e(t, w.navigationSubMenu, { [w.collapsed]: l?.isCollapsed }),
87
+ children: /* @__PURE__ */ r(o, {
88
+ items: s,
89
+ ...c,
91
90
  children: i
92
91
  })
93
92
  });
94
93
  };
95
94
  //#endregion
96
- export { v as a, b as i, w as n, g as o, S as r, E as t };
95
+ export { _ as a, y as i, C as n, h as o, x as r, T as t };
@@ -11,5 +11,5 @@ declare const _default: {
11
11
  };
12
12
  };
13
13
  export default _default;
14
- export declare const Primary: Story;
15
- export declare const WithMobileMenu: Story;
14
+ export declare const Desktop: Story;
15
+ export declare const Mobile: Story;
@@ -1,3 +1,6 @@
1
- import { DetailedHTMLProps, HTMLAttributes } from 'react';
2
- export type HeaderActionsProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
3
- export declare const HeaderActions: ({ className, ...rest }: HeaderActionsProps) => import("react/jsx-runtime").JSX.Element;
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: ({ className, ...rest }: import('./HeaderActions').HeaderActionsProps) => import("react/jsx-runtime").JSX.Element;
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,4 @@
1
+ export interface HeaderLogoProps {
2
+ primary?: boolean;
3
+ }
4
+ export declare const HeaderLogo: ({ primary }: HeaderLogoProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './HeaderLogo';
@@ -0,0 +1,3 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export type HeaderTitleProps = HTMLAttributes<HTMLSpanElement>;
3
+ export declare const HeaderTitle: ({ className, ...rest }: HeaderTitleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { HeaderTitle } from './HeaderTitle';
2
+ export type { HeaderTitleProps } from './HeaderTitle';
package/header/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export * from './header-actions';
2
2
  export * from './header-action';
3
+ export * from './header-logo';
4
+ export * from './header-title';
3
5
  export * from './mobile-menu';
4
6
  export * from './Header';
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-C2zESp2o.js";
2
- export { i as Header, t as HeaderAction, e as HeaderActions, n as MobileMenu, r as MobileMenuContext };
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, t as i } from "./chunks/header-C2zESp2o.js";
2
- import { n as a, t as o } from "./chunks/sidebar-c0uIh8ge.js";
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
- import { n as _, t as v } from "./chunks/layout-BL0juoss.js";
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-hnDP7Bj_.js";
7
- import { t as E } from "./chunks/navbar-C63VGKFb.js";
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 };
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-CTvX1yRi.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 };
@@ -1,4 +1,4 @@
1
1
  import { DetailedHTMLProps, HTMLAttributes } from 'react';
2
- import { CollectionProps } from '@react-aria/collections';
2
+ import { CollectionProps } from 'react-aria-components';
3
3
  export type NavigationProps<T extends object> = CollectionProps<T> & Omit<DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, 'children'>;
4
4
  export declare const Navigation: <T extends object>({ className, items, children, dependencies, idScope, addIdAndValue, ...rest }: NavigationProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -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-hnDP7Bj_.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "../chunks/navigation-CTvX1yRi.js";
2
2
  export { r as Navigation, e as NavigationHeader, t as NavigationItem, i as NavigationLink, n as NavigationSection, a as NavigationSubMenu };
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
2
2
  import { NavigationLink } from '.';
3
3
  type Story = StoryObj<typeof NavigationLink>;
4
4
  declare const _default: {
5
- component: <C extends import('react').ElementType = (props: import('react-aria-components').LinkProps & React.RefAttributes<HTMLAnchorElement>) => React.ReactElement | null>({ as, children, className, isActive, icon, "aria-label": ariaLabel, ...rest }: import('./NavigationLink').NavigationLinkProps<C>) => import("react/jsx-runtime").JSX.Element;
5
+ component: <C extends import('react').ElementType = (props: import('react-aria-components').LinkProps & React.RefAttributes<HTMLAnchorElement>) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null>({ as, children, className, isActive, icon, "aria-label": ariaLabel, ...rest }: import('./NavigationLink').NavigationLinkProps<C>) => import("react/jsx-runtime").JSX.Element;
6
6
  title: string;
7
7
  tags: string[];
8
8
  args: {
@@ -1,4 +1,4 @@
1
- import { CollectionProps } from '@react-aria/collections';
1
+ import { CollectionProps } from 'react-aria-components';
2
2
  export interface NavigationSectionProps<T extends object> extends CollectionProps<T> {
3
3
  title?: string;
4
4
  className?: string;
@@ -1,4 +1,4 @@
1
- import { CollectionProps } from '@react-aria/collections';
1
+ import { CollectionProps } from 'react-aria-components';
2
2
  export type NavigationSubMenuProps<T extends object> = CollectionProps<T> & {
3
3
  className?: string;
4
4
  };
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.10",
17
+ "version": "0.2.12",
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.17.3",
40
+ "@midas-ds/components": "17.18.0",
41
41
  "@react-aria/collections": "^3.0.3",
42
42
  "@react-aria/utils": "^3.33.1",
43
43
  "@react-stately/utils": "^3.11.0"
@@ -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 };