@midas-ds/components 17.15.6 → 17.15.7

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,9 @@
1
+ ## 17.15.7 (2026-07-02)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **components,link:** add visually hidden label for new-tab and download icons ([afebdc4e492](https://github.com/migrationsverket/midas/commit/afebdc4e492))
6
+
1
7
  ## 17.15.6 (2026-07-02)
2
8
 
3
9
  ### 🧪 Tests updated
@@ -0,0 +1,59 @@
1
+ 'use client';
2
+ import { t as e } from "./clsx-BtlV5Vo3.js";
3
+ import { t } from "./createLucideIcon-DhIhuN5D.js";
4
+ import { t as n } from "./square-arrow-out-up-right-Bobm4VNc.js";
5
+ import { t as r } from "./arrow-right-7yeXXFNV.js";
6
+ import { t as i } from "./useLocalizedStringFormatter-bRLuRzVD.js";
7
+ import { Link as a, RouterProvider as o } from "react-aria-components";
8
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ import { VisuallyHidden as u } from "react-aria";
10
+ import '../assets/link.css';var d = t("arrow-down-to-line", [
11
+ ["path", {
12
+ d: "M12 17V3",
13
+ key: "1cwfxf"
14
+ }],
15
+ ["path", {
16
+ d: "m6 11 6 6 6-6",
17
+ key: "12ii2o"
18
+ }],
19
+ ["path", {
20
+ d: "M19 21H5",
21
+ key: "150jfl"
22
+ }]
23
+ ]), f = {
24
+ link: "_link_duep2_1",
25
+ icon: "_icon_duep2_53",
26
+ standalone: "_standalone_duep2_57",
27
+ stretched: "_stretched_duep2_76"
28
+ }, p = {
29
+ en: {
30
+ opensInNewTab: "Opens in new tab",
31
+ downloadsFile: "Downloads file"
32
+ },
33
+ sv: {
34
+ opensInNewTab: "Öppnas i ny flik",
35
+ downloadsFile: "Hämtar fil"
36
+ }
37
+ }, m = ({ children: t, standalone: o, target: m, stretched: g, download: _, icon: v, className: y, as: b, ...x }) => {
38
+ let S = b || a, C = i(p), w = v ? { icon: v } : _ ? {
39
+ icon: d,
40
+ label: C.format("downloadsFile")
41
+ } : m === "_blank" ? {
42
+ icon: n,
43
+ label: C.format("opensInNewTab")
44
+ } : o ? { icon: r } : null;
45
+ return /* @__PURE__ */ l(S, {
46
+ className: e(f.link, o && f.standalone, g && f.stretched, y),
47
+ ...x,
48
+ target: m,
49
+ download: _,
50
+ children: [t, w ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(h, {
51
+ className: f.icon,
52
+ icon: w.icon,
53
+ size: 16,
54
+ "aria-hidden": !0
55
+ }), w.label && /* @__PURE__ */ c(u, { children: w.label })] }) : null]
56
+ });
57
+ }, h = ({ icon: e, ...t }) => /* @__PURE__ */ c(e, { ...t });
58
+ //#endregion
59
+ export { o as n, m as t };
@@ -0,0 +1,52 @@
1
+ 'use client';
2
+ import { t as e } from "./clsx-BtlV5Vo3.js";
3
+ import { t } from "./createLucideIcon-DhIhuN5D.js";
4
+ import { t as n } from "./square-arrow-out-up-right-Bobm4VNc.js";
5
+ import { t as r } from "./arrow-right-7yeXXFNV.js";
6
+ import { t as i } from "./useLocalizedStringFormatter-bRLuRzVD.js";
7
+ import "react";
8
+ import { Link as a, RouterProvider as o } from "react-aria-components";
9
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
10
+ import { VisuallyHidden as l } from "react-aria";
11
+ import '../assets/link-button.css';var u = t("arrow-left", [["path", {
12
+ d: "m12 19-7-7 7-7",
13
+ key: "1l729n"
14
+ }], ["path", {
15
+ d: "M19 12H5",
16
+ key: "x3x0zl"
17
+ }]]), d = {
18
+ linkButton: "_linkButton_1k5w6_1",
19
+ secondary: "_secondary_1k5w6_58",
20
+ icon: "_icon_1k5w6_63",
21
+ tertiary: "_tertiary_1k5w6_102",
22
+ danger: "_danger_1k5w6_130",
23
+ iconBtn: "_iconBtn_1k5w6_149",
24
+ medium: "_medium_1k5w6_173",
25
+ iconLeft: "_iconLeft_1k5w6_178",
26
+ fullwidth: "_fullwidth_1k5w6_182",
27
+ button: "_button_1k5w6_192"
28
+ }, f = {
29
+ en: { opensInNewTab: "Opens in new tab" },
30
+ sv: { opensInNewTab: "Öppnas i ny flik" }
31
+ }, p = ({ children: t, variant: o, fullwidth: p, icon: h, iconPlacement: g, className: _, as: v, size: y = "large", ...b }) => {
32
+ let x = v || a, S = i(f), C = h ? { icon: h } : b.target === "_blank" ? {
33
+ icon: n,
34
+ label: S.format("opensInNewTab")
35
+ } : g === "left" ? { icon: u } : { icon: r };
36
+ return /* @__PURE__ */ c(x, {
37
+ className: e(d.linkButton, o === "primary" && d.primary, o === "secondary" && d.secondary, o === "tertiary" && d.tertiary, o === "danger" && d.danger, o === "icon" && d.iconBtn, y === "medium" && d.medium, p && d.fullwidth, g === "left" && d.iconLeft, _),
38
+ ...b,
39
+ children: [
40
+ t,
41
+ /* @__PURE__ */ s(m, {
42
+ className: d.icon,
43
+ icon: C.icon,
44
+ size: 20,
45
+ "aria-hidden": !0
46
+ }),
47
+ C.label && /* @__PURE__ */ s(l, { children: C.label })
48
+ ]
49
+ });
50
+ }, m = ({ icon: e, ...t }) => /* @__PURE__ */ s(e, { ...t });
51
+ //#endregion
52
+ export { o as n, p as t };
package/index.js CHANGED
@@ -4,9 +4,9 @@ import { n as e, t } from "./chunks/accordion-KEgnlzYi.js";
4
4
  import { t as n } from "./chunks/clsx-BtlV5Vo3.js";
5
5
  import { t as r } from "./chunks/spinner-C3WiZYld.js";
6
6
  import { a as i, i as a, n as o, r as s, t as c } from "./chunks/layout-BzK7P4Xn.js";
7
- import { t as l } from "./chunks/link-Q46Ny2Po.js";
7
+ import { t as l } from "./chunks/link-CZNuhFX6.js";
8
8
  import { a as u, i as d, n as f, o as p, r as m, t as h } from "./chunks/table-BZ7VvZaq.js";
9
- import { t as g } from "./chunks/link-button-Cm2B0s4X.js";
9
+ import { t as g } from "./chunks/link-button-ZsK6UGko.js";
10
10
  import { n as _, t as v } from "./chunks/date-picker-ByfWqOZh.js";
11
11
  import { n as y, t as b } from "./chunks/calendar-C0rlcHfr.js";
12
12
  import { t as x } from "./chunks/color-scheme-switch-Ce4vL8Yz.js";
@@ -58,7 +58,7 @@ var Ze = {
58
58
  description: "Midas Components",
59
59
  homepage: "https://designsystem.migrationsverket.se/",
60
60
  license: "CC0-1.0",
61
- version: "17.15.6",
61
+ version: "17.15.7",
62
62
  module: "./index.js",
63
63
  type: "module",
64
64
  main: "./index.js",
package/link/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../chunks/link-Q46Ny2Po.js";
1
+ import { n as e, t } from "../chunks/link-CZNuhFX6.js";
2
2
  export { t as Link, e as RouterProvider };
@@ -0,0 +1,13 @@
1
+ declare const _default: {
2
+ "en": {
3
+ "opensInNewTab": "Opens in new tab",
4
+ "downloadsFile": "Downloads file"
5
+ },
6
+ "sv": {
7
+ "opensInNewTab": "Öppnas i ny flik",
8
+ "downloadsFile": "Hämtar fil"
9
+ }
10
+ }
11
+ ;
12
+
13
+ export default _default;
@@ -10,3 +10,4 @@ export declare const Previous: Story;
10
10
  export declare const Disabled: Story;
11
11
  export declare const AppLink: Story;
12
12
  export declare const Danger: Story;
13
+ export declare const NewTab: Story;
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../chunks/link-button-Cm2B0s4X.js";
1
+ import { n as e, t } from "../chunks/link-button-ZsK6UGko.js";
2
2
  export { t as LinkButton, e as RouterProvider };
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ "en": {
3
+ "opensInNewTab": "Opens in new tab"
4
+ },
5
+ "sv": {
6
+ "opensInNewTab": "Öppnas i ny flik"
7
+ }
8
+ }
9
+ ;
10
+
11
+ export default _default;
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": "17.15.6",
17
+ "version": "17.15.7",
18
18
  "module": "./index.js",
19
19
  "type": "module",
20
20
  "main": "./index.js",
@@ -1,40 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./clsx-BtlV5Vo3.js";
3
- import { t } from "./createLucideIcon-DhIhuN5D.js";
4
- import { t as n } from "./square-arrow-out-up-right-Bobm4VNc.js";
5
- import { t as r } from "./arrow-right-7yeXXFNV.js";
6
- import { Link as i, RouterProvider as a } from "react-aria-components";
7
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
- import '../assets/link.css';var l = t("arrow-down-to-line", [
9
- ["path", {
10
- d: "M12 17V3",
11
- key: "1cwfxf"
12
- }],
13
- ["path", {
14
- d: "m6 11 6 6 6-6",
15
- key: "12ii2o"
16
- }],
17
- ["path", {
18
- d: "M19 21H5",
19
- key: "150jfl"
20
- }]
21
- ]), u = {
22
- link: "_link_duep2_1",
23
- icon: "_icon_duep2_53",
24
- standalone: "_standalone_duep2_57",
25
- stretched: "_stretched_duep2_76"
26
- }, d = ({ children: t, standalone: a, target: d, stretched: p, download: m, icon: h, className: g, as: _, ...v }) => {
27
- let y = _ || i, b = h || (m ? l : d === "_blank" ? n : a ? r : null);
28
- return /* @__PURE__ */ s(y, {
29
- className: e(u.link, a && u.standalone, p && u.stretched, g),
30
- ...v,
31
- target: d,
32
- children: /* @__PURE__ */ c(o, { children: [t, b ? /* @__PURE__ */ s(f, {
33
- className: u.icon,
34
- icon: b,
35
- size: 16
36
- }) : null] })
37
- });
38
- }, f = ({ icon: e, ...t }) => /* @__PURE__ */ s(e, { ...t });
39
- //#endregion
40
- export { a as n, d as t };
@@ -1,39 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./clsx-BtlV5Vo3.js";
3
- import { t } from "./createLucideIcon-DhIhuN5D.js";
4
- import { t as n } from "./square-arrow-out-up-right-Bobm4VNc.js";
5
- import { t as r } from "./arrow-right-7yeXXFNV.js";
6
- import "react";
7
- import { Link as i, RouterProvider as a } from "react-aria-components";
8
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
9
- import '../assets/link-button.css';var c = t("arrow-left", [["path", {
10
- d: "m12 19-7-7 7-7",
11
- key: "1l729n"
12
- }], ["path", {
13
- d: "M19 12H5",
14
- key: "x3x0zl"
15
- }]]), l = {
16
- linkButton: "_linkButton_1k5w6_1",
17
- secondary: "_secondary_1k5w6_58",
18
- icon: "_icon_1k5w6_63",
19
- tertiary: "_tertiary_1k5w6_102",
20
- danger: "_danger_1k5w6_130",
21
- iconBtn: "_iconBtn_1k5w6_149",
22
- medium: "_medium_1k5w6_173",
23
- iconLeft: "_iconLeft_1k5w6_178",
24
- fullwidth: "_fullwidth_1k5w6_182",
25
- button: "_button_1k5w6_192"
26
- }, u = ({ children: t, variant: a, fullwidth: u, icon: f, iconPlacement: p, className: m, as: h, size: g = "large", ..._ }) => {
27
- let v = h || i, y = f || (_.target === "_blank" ? n : p === "left" ? c : r);
28
- return /* @__PURE__ */ s(v, {
29
- className: e(l.linkButton, a === "primary" && l.primary, a === "secondary" && l.secondary, a === "tertiary" && l.tertiary, a === "danger" && l.danger, a === "icon" && l.iconBtn, g === "medium" && l.medium, u && l.fullwidth, p === "left" && l.iconLeft, m),
30
- ..._,
31
- children: [t, /* @__PURE__ */ o(d, {
32
- className: l.icon,
33
- icon: y,
34
- size: 20
35
- })]
36
- });
37
- }, d = ({ icon: e, ...t }) => /* @__PURE__ */ o(e, { ...t });
38
- //#endregion
39
- export { a as n, u as t };