@midas-ds/components 16.8.2 → 16.8.4

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,19 @@
1
+ ## 16.8.4 (2026-02-16)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated theme to 3.10.7
6
+
7
+ ## 16.8.3 (2026-02-12)
8
+
9
+ ### 🩹 Fixes
10
+
11
+ - **components,toast:** add focus-visible to toast region ([0eae529892](https://github.com/migrationsverket/midas/commit/0eae529892))
12
+
13
+ ### 🔧 Maintenance
14
+
15
+ - **components,menu:** deprecate `MenuItemObject` ([95b5ef21c1](https://github.com/migrationsverket/midas/commit/95b5ef21c1))
16
+
1
17
  ## 16.8.2 (2026-02-07)
2
18
 
3
19
  ### 🏭 Refactoring
package/assets/Toast.css CHANGED
@@ -1 +1 @@
1
- @keyframes _slideInEnd_16lmz_1{0%{transform:translate(calc(100% + 1rem));opacity:0}to{transform:translate(0);opacity:1}}@keyframes _slideOutEnd_16lmz_1{0%{transform:translate(0);opacity:1}to{transform:translate(calc(100% + 1rem));opacity:0}}@keyframes _slideInTop_16lmz_1{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _slideOutTop_16lmz_1{0%{transform:translateY(0);opacity:1}to{transform:translateY(-100%);opacity:0}}._toastRegion_16lmz_49{position:fixed;left:50%;top:calc(92px + 1rem);transform:translate(-50%);display:flex;flex-direction:column;gap:8px;border:none;width:calc(100% - 2rem);z-index:var(--midas-z-index-toast)}._toastRegion_16lmz_49:focus-visible{outline:none}@media(min-width:768px){._toastRegion_16lmz_49{width:unset;left:unset;transform:unset;top:calc(80px + 1rem);right:1rem}}._toast_16lmz_49{font-family:var(--midas-typography-font-family);display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;color:var(--midas-text-primary);padding-left:calc(1rem - 3px);border-left:3px solid transparent;width:calc(100% - 1rem);font-size:.875rem}@media(forced-colors:active){._toast_16lmz_49{border:1px solid;border-left:3px solid}}._toast_16lmz_49[data-focus-visible],._toast_16lmz_49:focus-visible{outline:none;box-shadow:var(--midas-state-focus)}._toast_16lmz_49._success_16lmz_97{--bg: var(--midas-support-background-success);--border: var(--midas-support-border-success);background:var(--bg);border-left-color:var(--border)}._toast_16lmz_49._info_16lmz_105{--bg: var(--midas-support-background-info);--border: var(--midas-support-border-info);background:var(--bg);border-left-color:var(--border)}._toast_16lmz_49._important_16lmz_113{--border: var(--midas-support-border-important);--bg: var(--midas-support-background-important);background:var(--bg);border-left-color:var(--border)}._toast_16lmz_49._warning_16lmz_121{--border: var(--midas-support-border-warning);--bg: var(--midas-support-background-warning);background:var(--bg);border-left-color:var(--border)}._toast_16lmz_49 ._icon_16lmz_129{color:var(--midas-icon-primary);flex:0 0 auto}@media(forced-colors:active){._toast_16lmz_49 ._icon_16lmz_129{stroke:mark}}@media(min-width:768px){._toast_16lmz_49{width:18rem}}._toastContent_16lmz_143{padding:.875rem 0;display:flex;align-items:flex-start;gap:1rem}._toastMessage_16lmz_150{padding:.125rem 0 0;margin:0;line-height:1.2}::view-transition-new(._viewTransition_16lmz_156):only-child{animation-name:_slideInTop_16lmz_1;animation-duration:.5s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-direction:normal;animation-fill-mode:both}@media(min-width:768px){::view-transition-new(._viewTransition_16lmz_156):only-child{animation-name:_slideInEnd_16lmz_1}}::view-transition-old(._viewTransition_16lmz_156):only-child{animation-name:_slideOutTop_16lmz_1;animation-duration:.5s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-direction:normal;animation-fill-mode:both}@media(min-width:768px){::view-transition-old(._viewTransition_16lmz_156):only-child{animation-name:_slideOutEnd_16lmz_1}}@media(prefers-reduced-motion){::view-transition-new(._viewTransition_16lmz_156):only-child,::view-transition-old(._viewTransition_16lmz_156):only-child{animation:none}}
1
+ @keyframes _slideInEnd_1gp8e_1{0%{transform:translate(calc(100% + 1rem));opacity:0}to{transform:translate(0);opacity:1}}@keyframes _slideOutEnd_1gp8e_1{0%{transform:translate(0);opacity:1}to{transform:translate(calc(100% + 1rem));opacity:0}}@keyframes _slideInTop_1gp8e_1{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _slideOutTop_1gp8e_1{0%{transform:translateY(0);opacity:1}to{transform:translateY(-100%);opacity:0}}._toastRegion_1gp8e_49{position:fixed;left:50%;top:calc(92px + 1rem);transform:translate(-50%);display:flex;flex-direction:column;gap:8px;border:none;width:calc(100% - 2rem);z-index:var(--midas-z-index-toast)}._toastRegion_1gp8e_49:focus-visible{outline:none;box-shadow:var(--midas-state-focus)}@media(min-width:768px){._toastRegion_1gp8e_49{width:unset;left:unset;transform:unset;top:calc(80px + 1rem);right:1rem}}._toast_1gp8e_49{font-family:var(--midas-typography-font-family);display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;color:var(--midas-text-primary);padding-left:calc(1rem - 3px);border-left:3px solid transparent;width:calc(100% - 1rem);font-size:.875rem}@media(forced-colors:active){._toast_1gp8e_49{border:1px solid;border-left:3px solid}}._toast_1gp8e_49[data-focus-visible],._toast_1gp8e_49:focus-visible{outline:none;box-shadow:var(--midas-state-focus)}._toast_1gp8e_49._success_1gp8e_98{--bg: var(--midas-support-background-success);--border: var(--midas-support-border-success);background:var(--bg);border-left-color:var(--border)}._toast_1gp8e_49._info_1gp8e_106{--bg: var(--midas-support-background-info);--border: var(--midas-support-border-info);background:var(--bg);border-left-color:var(--border)}._toast_1gp8e_49._important_1gp8e_114{--border: var(--midas-support-border-important);--bg: var(--midas-support-background-important);background:var(--bg);border-left-color:var(--border)}._toast_1gp8e_49._warning_1gp8e_122{--border: var(--midas-support-border-warning);--bg: var(--midas-support-background-warning);background:var(--bg);border-left-color:var(--border)}._toast_1gp8e_49 ._icon_1gp8e_130{color:var(--midas-icon-primary);flex:0 0 auto}@media(forced-colors:active){._toast_1gp8e_49 ._icon_1gp8e_130{stroke:mark}}@media(min-width:768px){._toast_1gp8e_49{width:18rem}}._toastContent_1gp8e_144{padding:.875rem 0;display:flex;align-items:flex-start;gap:1rem}._toastMessage_1gp8e_151{padding:.125rem 0 0;margin:0;line-height:1.2}::view-transition-new(._viewTransition_1gp8e_157):only-child{animation-name:_slideInTop_1gp8e_1;animation-duration:.5s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-direction:normal;animation-fill-mode:both}@media(min-width:768px){::view-transition-new(._viewTransition_1gp8e_157):only-child{animation-name:_slideInEnd_1gp8e_1}}::view-transition-old(._viewTransition_1gp8e_157):only-child{animation-name:_slideOutTop_1gp8e_1;animation-duration:.5s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-direction:normal;animation-fill-mode:both}@media(min-width:768px){::view-transition-old(._viewTransition_1gp8e_157):only-child{animation-name:_slideOutEnd_1gp8e_1}}@media(prefers-reduced-motion){::view-transition-new(._viewTransition_1gp8e_157):only-child,::view-transition-old(._viewTransition_1gp8e_157):only-child{animation:none}}
@@ -0,0 +1,158 @@
1
+ 'use client';
2
+ import { jsx as e, jsxs as c, Fragment as g } from "react/jsx-runtime";
3
+ import { B as T } from "./Button-CaLOUTDO.js";
4
+ import { useToast as f, useToastRegion as v } from "react-aria";
5
+ import { ToastQueue as w, useToastQueue as h, useToastState as R } from "react-stately";
6
+ import _ from "react";
7
+ import { createPortal as y, flushSync as b } from "react-dom";
8
+ import { c as l } from "./clsx-AexbMWKp.js";
9
+ import { F as P } from "./FeedbackStatusIcon-X9Bjgeta.js";
10
+ import { X as I } from "./x-B9bYxG31.js";
11
+ import '../assets/Toast.css';const N = "_toastRegion_1gp8e_49", E = "_toast_1gp8e_49", O = "_success_1gp8e_98", x = "_info_1gp8e_106", C = "_important_1gp8e_114", M = "_warning_1gp8e_122", S = "_icon_1gp8e_130", k = "_toastContent_1gp8e_144", B = "_toastMessage_1gp8e_151", F = "_viewTransition_1gp8e_157", Q = "_slideInTop_1gp8e_1", V = "_slideInEnd_1gp8e_1", j = "_slideOutTop_1gp8e_1", G = "_slideOutEnd_1gp8e_1", n = {
12
+ toastRegion: N,
13
+ toast: E,
14
+ success: O,
15
+ info: x,
16
+ important: C,
17
+ warning: M,
18
+ icon: S,
19
+ toastContent: k,
20
+ toastMessage: B,
21
+ viewTransition: F,
22
+ slideInTop: Q,
23
+ slideInEnd: V,
24
+ slideOutTop: j,
25
+ slideOutEnd: G
26
+ }, u = {
27
+ wrapUpdate(t) {
28
+ "startViewTransition" in document ? document.startViewTransition(() => {
29
+ b(t);
30
+ }) : t();
31
+ },
32
+ maxVisibleToasts: 5
33
+ }, z = new w(u), Y = (t) => {
34
+ const o = h(z);
35
+ return o.visibleToasts.length > 0 ? y(
36
+ /* @__PURE__ */ e(
37
+ d,
38
+ {
39
+ ...t,
40
+ state: o
41
+ }
42
+ ),
43
+ document.body
44
+ ) : null;
45
+ }, Z = ({ children: t, ...o }) => {
46
+ const s = R(u);
47
+ return /* @__PURE__ */ c(g, { children: [
48
+ typeof t == "function" ? t(s) : t,
49
+ s.visibleToasts.length > 0 && /* @__PURE__ */ e(
50
+ d,
51
+ {
52
+ ...o,
53
+ state: s
54
+ }
55
+ )
56
+ ] });
57
+ };
58
+ function d({
59
+ state: t,
60
+ className: o,
61
+ ...s
62
+ }) {
63
+ const a = _.useRef(null), { regionProps: r } = v(s, t, a);
64
+ return /* @__PURE__ */ e(
65
+ "div",
66
+ {
67
+ ...r,
68
+ ref: a,
69
+ className: l(n.toastRegion, o),
70
+ children: t.visibleToasts.map((i) => /* @__PURE__ */ e(
71
+ U,
72
+ {
73
+ toast: i,
74
+ state: t
75
+ },
76
+ i.key
77
+ ))
78
+ }
79
+ );
80
+ }
81
+ function U({
82
+ state: t,
83
+ className: o,
84
+ ...s
85
+ }) {
86
+ const a = _.useRef(null), { toastProps: r, contentProps: i, titleProps: p, closeButtonProps: m } = f(
87
+ s,
88
+ t,
89
+ a
90
+ );
91
+ return /* @__PURE__ */ c(
92
+ "div",
93
+ {
94
+ ...r,
95
+ ref: a,
96
+ className: l(
97
+ n.toast,
98
+ n[s.toast.content.type],
99
+ o
100
+ ),
101
+ style: {
102
+ viewTransitionName: s.toast.key,
103
+ viewTransitionClass: n.viewTransition
104
+ },
105
+ children: [
106
+ /* @__PURE__ */ c(
107
+ "div",
108
+ {
109
+ ...i,
110
+ className: l(n.toastContent, i.className),
111
+ children: [
112
+ /* @__PURE__ */ e(
113
+ P,
114
+ {
115
+ "aria-hidden": !0,
116
+ className: n.icon,
117
+ status: s.toast.content.type
118
+ }
119
+ ),
120
+ /* @__PURE__ */ c("div", { children: [
121
+ /* @__PURE__ */ e(
122
+ "p",
123
+ {
124
+ className: n.toastMessage,
125
+ ...p,
126
+ children: s.toast.content.message
127
+ }
128
+ ),
129
+ s.toast.content.children
130
+ ] })
131
+ ]
132
+ }
133
+ ),
134
+ /* @__PURE__ */ e(
135
+ T,
136
+ {
137
+ variant: "icon",
138
+ ...m,
139
+ children: /* @__PURE__ */ e(
140
+ I,
141
+ {
142
+ size: 20,
143
+ "aria-hidden": !0
144
+ }
145
+ )
146
+ }
147
+ )
148
+ ]
149
+ }
150
+ );
151
+ }
152
+ export {
153
+ Y as G,
154
+ U as T,
155
+ Z as a,
156
+ d as b,
157
+ z as t
158
+ };
package/index.js CHANGED
@@ -39,7 +39,7 @@ import { T as Xo, a as Yo, b as _o, c as $o } from "./chunks/TabList-BaR443mu.js
39
39
  import { T as aa, a as ra } from "./chunks/Tag-C7VZ0T0o.js";
40
40
  import { T as ta } from "./chunks/Text-Bxww8mmL.js";
41
41
  import { I as pa, T as xa, a as ma, b as ia } from "./chunks/TextArea-Bb7H-w23.js";
42
- import { G as na, T as da, a as Ta, b as ca, t as la } from "./chunks/Toast-D7PXIDa9.js";
42
+ import { G as na, T as da, a as Ta, b as ca, t as la } from "./chunks/Toast-UPM-1ipu.js";
43
43
  import { T as ga, a as Ca } from "./chunks/ToggleButtonGroup-CXKTrLbb.js";
44
44
  import { T as Ba, a as La } from "./chunks/Tooltip-rDmOkGmX.js";
45
45
  import { L as Ia } from "./chunks/ListBox-D5BBeZWL.js";
@@ -50,7 +50,7 @@ import { c as za } from "./chunks/clsx-AexbMWKp.js";
50
50
  import { DialogTrigger as Qa, MenuTrigger as Va, RouterProvider as Za } from "react-aria-components";
51
51
  import { u as qa } from "./chunks/useLocalizedStringFormatter-BHvsRxDk.js";
52
52
  import { useToastState as Ka } from "react-stately";
53
- const o = "16.8.2", a = {
53
+ const o = "16.8.4", a = {
54
54
  version: o
55
55
  }, r = a.version;
56
56
  export {
package/menu/Menu.d.ts CHANGED
@@ -2,6 +2,9 @@ import { MenuTrigger, MenuTriggerProps, MenuProps as AriaMenuProps } from 'react
2
2
  import { Size } from '../common/types';
3
3
  import { ExcludeKeysFrom } from '../utils/types';
4
4
  export { MenuTrigger, type MenuTriggerProps };
5
+ /**
6
+ * @deprecated Links are not enforced in menus.
7
+ */
5
8
  export type MenuItemObject = ExcludeKeysFrom<{
6
9
  [prop: string]: unknown;
7
10
  }, 'href'>;
@@ -11,4 +14,4 @@ export interface MenuProps<T> extends AriaMenuProps<T> {
11
14
  **/
12
15
  size?: Size;
13
16
  }
14
- export declare const Menu: <T extends MenuItemObject>({ className, size, ...rest }: MenuProps<T>) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const Menu: <T extends object>({ className, size, ...rest }: MenuProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -9,13 +9,13 @@ interface Item {
9
9
  type Story = StoryObj<typeof Menu<Item>>;
10
10
  declare const _default: {
11
11
  title: string;
12
- component: <T extends import('./Menu').MenuItemObject>({ className, size, ...rest }: import('./Menu').MenuProps<T>) => import("react/jsx-runtime").JSX.Element;
12
+ component: <T extends object>({ className, size, ...rest }: import('./Menu').MenuProps<T>) => import("react/jsx-runtime").JSX.Element;
13
13
  subcomponents: {
14
- MenuItem: <T extends import('./Menu').MenuItemObject>(props: import('./MenuItem').MenuItemProps<T>) => import("react/jsx-runtime").JSX.Element;
14
+ MenuItem: <T extends object>(props: import('./MenuItem').MenuItemProps<T>) => import("react/jsx-runtime").JSX.Element;
15
15
  };
16
- render: (args: import('./Menu').MenuProps<import('./Menu').MenuItemObject>) => import("react/jsx-runtime").JSX.Element;
16
+ render: (args: import('./Menu').MenuProps<object>) => import("react/jsx-runtime").JSX.Element;
17
17
  args: {
18
- children: (item: import('./Menu').MenuItemObject) => import("react/jsx-runtime").JSX.Element;
18
+ children: (item: object) => import("react/jsx-runtime").JSX.Element;
19
19
  items: {
20
20
  id: number;
21
21
  name: string;
@@ -1,5 +1,3 @@
1
1
  import { MenuItemProps as AriaMenuItemProps } from 'react-aria-components';
2
- import { LinkDOMProps } from '@react-types/shared';
3
- import { MenuItemObject } from '.';
4
- export type MenuItemProps<T> = Omit<AriaMenuItemProps<T>, keyof LinkDOMProps>;
5
- export declare const MenuItem: <T extends MenuItemObject>(props: MenuItemProps<T>) => import("react/jsx-runtime").JSX.Element;
2
+ export type MenuItemProps<T> = AriaMenuItemProps<T>;
3
+ export declare const MenuItem: <T extends object>(props: MenuItemProps<T>) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "description": "Midas Components",
15
15
  "homepage": "https://designsystem.migrationsverket.se/",
16
16
  "license": "CC0-1.0",
17
- "version": "16.8.2",
17
+ "version": "16.8.4",
18
18
  "module": "./index.js",
19
19
  "type": "module",
20
20
  "main": "./index.js",
@@ -41,7 +41,7 @@
41
41
  "./*": "./*/index.js"
42
42
  },
43
43
  "dependencies": {
44
- "@midas-ds/theme": "3.10.6",
44
+ "@midas-ds/theme": "3.10.7",
45
45
  "react-aria-components": "1.14.0"
46
46
  }
47
47
  }
package/toast/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { G as s, T as t, a as e, b as r, t as T } from "../chunks/Toast-D7PXIDa9.js";
1
+ import { G as s, T as t, a as e, b as r, t as T } from "../chunks/Toast-UPM-1ipu.js";
2
2
  import { useToastState as u } from "react-stately";
3
3
  export {
4
4
  s as GlobalToastRegion,
@@ -1,158 +0,0 @@
1
- 'use client';
2
- import { jsx as n, jsxs as c, Fragment as f } from "react/jsx-runtime";
3
- import { B as p } from "./Button-CaLOUTDO.js";
4
- import { useToast as g, useToastRegion as v } from "react-aria";
5
- import { ToastQueue as z, useToastQueue as w, useToastState as h } from "react-stately";
6
- import m from "react";
7
- import { createPortal as R, flushSync as y } from "react-dom";
8
- import { c as l } from "./clsx-AexbMWKp.js";
9
- import { F as b } from "./FeedbackStatusIcon-X9Bjgeta.js";
10
- import { X as P } from "./x-B9bYxG31.js";
11
- import '../assets/Toast.css';const I = "_toastRegion_16lmz_49", N = "_toast_16lmz_49", E = "_success_16lmz_97", O = "_info_16lmz_105", x = "_important_16lmz_113", C = "_warning_16lmz_121", M = "_icon_16lmz_129", S = "_toastContent_16lmz_143", k = "_toastMessage_16lmz_150", B = "_viewTransition_16lmz_156", F = "_slideInTop_16lmz_1", Q = "_slideInEnd_16lmz_1", V = "_slideOutTop_16lmz_1", j = "_slideOutEnd_16lmz_1", e = {
12
- toastRegion: I,
13
- toast: N,
14
- success: E,
15
- info: O,
16
- important: x,
17
- warning: C,
18
- icon: M,
19
- toastContent: S,
20
- toastMessage: k,
21
- viewTransition: B,
22
- slideInTop: F,
23
- slideInEnd: Q,
24
- slideOutTop: V,
25
- slideOutEnd: j
26
- }, _ = {
27
- wrapUpdate(t) {
28
- "startViewTransition" in document ? document.startViewTransition(() => {
29
- y(t);
30
- }) : t();
31
- },
32
- maxVisibleToasts: 5
33
- }, G = new z(_), Y = (t) => {
34
- const o = w(G);
35
- return o.visibleToasts.length > 0 ? R(
36
- /* @__PURE__ */ n(
37
- u,
38
- {
39
- ...t,
40
- state: o
41
- }
42
- ),
43
- document.body
44
- ) : null;
45
- }, Z = ({ children: t, ...o }) => {
46
- const s = h(_);
47
- return /* @__PURE__ */ c(f, { children: [
48
- typeof t == "function" ? t(s) : t,
49
- s.visibleToasts.length > 0 && /* @__PURE__ */ n(
50
- u,
51
- {
52
- ...o,
53
- state: s
54
- }
55
- )
56
- ] });
57
- };
58
- function u({
59
- state: t,
60
- className: o,
61
- ...s
62
- }) {
63
- const a = m.useRef(null), { regionProps: r } = v(s, t, a);
64
- return /* @__PURE__ */ n(
65
- "div",
66
- {
67
- ...r,
68
- ref: a,
69
- className: l(e.toastRegion, o),
70
- children: t.visibleToasts.map((i) => /* @__PURE__ */ n(
71
- U,
72
- {
73
- toast: i,
74
- state: t
75
- },
76
- i.key
77
- ))
78
- }
79
- );
80
- }
81
- function U({
82
- state: t,
83
- className: o,
84
- ...s
85
- }) {
86
- const a = m.useRef(null), { toastProps: r, contentProps: i, titleProps: d, closeButtonProps: T } = g(
87
- s,
88
- t,
89
- a
90
- );
91
- return /* @__PURE__ */ c(
92
- "div",
93
- {
94
- ...r,
95
- ref: a,
96
- className: l(
97
- e.toast,
98
- e[s.toast.content.type],
99
- o
100
- ),
101
- style: {
102
- viewTransitionName: s.toast.key,
103
- viewTransitionClass: e.viewTransition
104
- },
105
- children: [
106
- /* @__PURE__ */ c(
107
- "div",
108
- {
109
- ...i,
110
- className: l(e.toastContent, i.className),
111
- children: [
112
- /* @__PURE__ */ n(
113
- b,
114
- {
115
- "aria-hidden": !0,
116
- className: e.icon,
117
- status: s.toast.content.type
118
- }
119
- ),
120
- /* @__PURE__ */ c("div", { children: [
121
- /* @__PURE__ */ n(
122
- "p",
123
- {
124
- className: e.toastMessage,
125
- ...d,
126
- children: s.toast.content.message
127
- }
128
- ),
129
- s.toast.content.children
130
- ] })
131
- ]
132
- }
133
- ),
134
- /* @__PURE__ */ n(
135
- p,
136
- {
137
- variant: "icon",
138
- ...T,
139
- children: /* @__PURE__ */ n(
140
- P,
141
- {
142
- size: 20,
143
- "aria-hidden": !0
144
- }
145
- )
146
- }
147
- )
148
- ]
149
- }
150
- );
151
- }
152
- export {
153
- Y as G,
154
- U as T,
155
- Z as a,
156
- u as b,
157
- G as t
158
- };