@midas-ds/components 17.14.6 → 17.14.8
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 +17 -0
- package/assets/BadgeContainer.css +1 -1
- package/badge/index.js +1 -1
- package/chunks/BadgeContainer-DyQDrY6S.js +38 -0
- package/chunks/{Layout-C6Jjp3Pc.js → Layout-D-nVSBJY.js} +1 -1
- package/chunks/SearchField-BXIDm898.js +121 -0
- package/index.js +4 -4
- package/layout/index.js +1 -1
- package/package.json +2 -2
- package/search-field/index.js +1 -1
- package/chunks/BadgeContainer-CKVsfTlF.js +0 -37
- package/chunks/SearchField-DRaSep82.js +0 -118
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## 17.14.8 (2026-05-12)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated theme to 3.14.7
|
|
6
|
+
|
|
7
|
+
## 17.14.7 (2026-05-11)
|
|
8
|
+
|
|
9
|
+
### 🩹 Fixes
|
|
10
|
+
|
|
11
|
+
- **components, search-field:** submit parent form on Enter when no onSubmit is provided ([aa984e2a998](https://github.com/migrationsverket/midas/commit/aa984e2a998))
|
|
12
|
+
- **components,layout:** add badge pattern to navigation docs and fix sidebar transition ([b46ae8a3141](https://github.com/migrationsverket/midas/commit/b46ae8a3141))
|
|
13
|
+
|
|
14
|
+
### 🧪 Tests updated
|
|
15
|
+
|
|
16
|
+
- **components, search-field:** add form submission behaviour tests ([0a04b3e0024](https://github.com/migrationsverket/midas/commit/0a04b3e0024))
|
|
17
|
+
|
|
1
18
|
## 17.14.6 (2026-05-11)
|
|
2
19
|
|
|
3
20
|
### 🩹 Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._badge_1fwow_1{font-family:var(--midas-typography-font-family);background-color:var(--midas-badge-background);min-width:.5rem;min-height:.5rem;border-radius:.5rem;font-size:.625rem;color:var(--midas-text-on-color)}._badge_1fwow_1._hasChildren_1fwow_10{display:flex;align-items:center;justify-content:center;padding:0 .25rem;min-height:1rem}._badgeContainer_1fwow_19{display:flex;min-width:0;position:relative}._badgeContainer_1fwow_19 ._badge_1fwow_1{position:absolute;top:0;right:0;transform:translate(50%,-50%);transform-origin:center left}
|
package/badge/index.js
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { c as t } from "./clsx-AexbMWKp.js";
|
|
4
|
+
import '../assets/BadgeContainer.css';const i = "_badge_1fwow_1", c = "_hasChildren_1fwow_10", g = "_badgeContainer_1fwow_19", s = {
|
|
5
|
+
badge: i,
|
|
6
|
+
hasChildren: c,
|
|
7
|
+
badgeContainer: g
|
|
8
|
+
}, b = ({
|
|
9
|
+
children: a,
|
|
10
|
+
className: e,
|
|
11
|
+
...n
|
|
12
|
+
}) => {
|
|
13
|
+
const r = d.Children.count(a) > 0;
|
|
14
|
+
return /* @__PURE__ */ o(
|
|
15
|
+
"span",
|
|
16
|
+
{
|
|
17
|
+
"data-badge": !0,
|
|
18
|
+
className: t(
|
|
19
|
+
s.badge,
|
|
20
|
+
r && s.hasChildren,
|
|
21
|
+
e
|
|
22
|
+
),
|
|
23
|
+
...n,
|
|
24
|
+
children: a
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}, l = ({ children: a, className: e, ...n }) => /* @__PURE__ */ o(
|
|
28
|
+
"span",
|
|
29
|
+
{
|
|
30
|
+
className: t(s.badgeContainer, e),
|
|
31
|
+
...n,
|
|
32
|
+
children: a
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
export {
|
|
36
|
+
b as B,
|
|
37
|
+
l as a
|
|
38
|
+
};
|
|
@@ -7,7 +7,7 @@ import { c as b } from "./clsx-AexbMWKp.js";
|
|
|
7
7
|
import { Link as L, RouterProvider as P } from "react-aria-components";
|
|
8
8
|
import { B as T } from "./Button-GCROAMSl.js";
|
|
9
9
|
import { a as D, T as q } from "./Tooltip-BYEaNkZG.js";
|
|
10
|
-
import { a as I, B as M } from "./BadgeContainer-
|
|
10
|
+
import { a as I, B as M } from "./BadgeContainer-DyQDrY6S.js";
|
|
11
11
|
import { c as S } from "./createLucideIcon-CP-mMPfa.js";
|
|
12
12
|
import { u as k } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
13
13
|
import { variables as A } from "@midas-ds/theme";
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as i, jsxs as s, Fragment as g } from "react/jsx-runtime";
|
|
3
|
+
import { useSlottedContext as j, FormContext as N, SearchField as p, Input as B } from "react-aria-components";
|
|
4
|
+
import { s as C } from "./TextField.module-BDIbEV87.js";
|
|
5
|
+
import { B as d } from "./Button-GCROAMSl.js";
|
|
6
|
+
import { c } from "./clsx-AexbMWKp.js";
|
|
7
|
+
import { F as h } from "./FieldError-krpMBtie.js";
|
|
8
|
+
import { c as k } from "./createLucideIcon-CP-mMPfa.js";
|
|
9
|
+
import { X as I } from "./x-B9bYxG31.js";
|
|
10
|
+
import { u as D } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
11
|
+
import '../assets/SearchField.css';const E = [
|
|
12
|
+
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
13
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
14
|
+
], T = k("search", E), w = "_container_1msv3_1", L = "_inner_1msv3_10", V = "_inputContainer_1msv3_15", $ = "_medium_1msv3_21", q = "_icon_1msv3_26", K = "_clear_1msv3_38", O = "_input_1msv3_15", e = {
|
|
15
|
+
container: w,
|
|
16
|
+
inner: L,
|
|
17
|
+
inputContainer: V,
|
|
18
|
+
medium: $,
|
|
19
|
+
icon: q,
|
|
20
|
+
clear: K,
|
|
21
|
+
input: O
|
|
22
|
+
}, P = { search: "Search" }, X = { search: "Sök" }, A = {
|
|
23
|
+
en: P,
|
|
24
|
+
sv: X
|
|
25
|
+
};
|
|
26
|
+
function G(o) {
|
|
27
|
+
return !!o?.length;
|
|
28
|
+
}
|
|
29
|
+
const M = ({
|
|
30
|
+
errorPosition: o = "top",
|
|
31
|
+
size: a = "large",
|
|
32
|
+
showButton: v,
|
|
33
|
+
className: _,
|
|
34
|
+
errorMessage: m,
|
|
35
|
+
placeholder: l,
|
|
36
|
+
validationBehavior: f,
|
|
37
|
+
inputMode: S = "search",
|
|
38
|
+
...n
|
|
39
|
+
}) => {
|
|
40
|
+
const b = D(A), x = j(N), F = f ?? x?.validationBehavior ?? "aria", y = v !== !1, u = (t) => {
|
|
41
|
+
!t || n.isInvalid || n.validate && G(n.validate(t)) || n.onSubmit?.(t);
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ i(
|
|
44
|
+
p,
|
|
45
|
+
{
|
|
46
|
+
...n,
|
|
47
|
+
inputMode: S,
|
|
48
|
+
onSubmit: u,
|
|
49
|
+
"aria-label": n["aria-label"] ?? l,
|
|
50
|
+
className: c(e.container, _),
|
|
51
|
+
validationBehavior: F,
|
|
52
|
+
children: ({ state: t }) => /* @__PURE__ */ s(g, { children: [
|
|
53
|
+
o === "top" && /* @__PURE__ */ i(h, { children: ({ validationErrors: r }) => m ?? r.join(" ") }),
|
|
54
|
+
/* @__PURE__ */ s("div", { className: e.inner, children: [
|
|
55
|
+
/* @__PURE__ */ s(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: c(e.inputContainer, {
|
|
59
|
+
[e.medium]: a === "medium"
|
|
60
|
+
}),
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ i(
|
|
63
|
+
T,
|
|
64
|
+
{
|
|
65
|
+
size: 20,
|
|
66
|
+
className: e.icon
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ i(
|
|
70
|
+
B,
|
|
71
|
+
{
|
|
72
|
+
placeholder: l,
|
|
73
|
+
className: c(C.input, e.input, {
|
|
74
|
+
[e.medium]: a === "medium"
|
|
75
|
+
}),
|
|
76
|
+
onKeyDown: n.onSubmit ? void 0 : (r) => {
|
|
77
|
+
r.key === "Enter" && t.value && !n.isInvalid && r.currentTarget.form?.requestSubmit();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
t.value.length > 0 && /* @__PURE__ */ i(
|
|
82
|
+
d,
|
|
83
|
+
{
|
|
84
|
+
variant: "icon",
|
|
85
|
+
size: a,
|
|
86
|
+
className: c(e.clear, {
|
|
87
|
+
[e.medium]: a === "medium"
|
|
88
|
+
}),
|
|
89
|
+
children: /* @__PURE__ */ i(
|
|
90
|
+
I,
|
|
91
|
+
{
|
|
92
|
+
size: 20,
|
|
93
|
+
"aria-hidden": !0
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
y && /* @__PURE__ */ i(
|
|
102
|
+
d,
|
|
103
|
+
{
|
|
104
|
+
slot: null,
|
|
105
|
+
excludeFromTabOrder: !0,
|
|
106
|
+
size: a,
|
|
107
|
+
isDisabled: n.isDisabled,
|
|
108
|
+
type: "button",
|
|
109
|
+
onPress: () => u(t.value),
|
|
110
|
+
children: n.buttonText ?? b.format("search")
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
] }),
|
|
114
|
+
o === "bottom" && /* @__PURE__ */ i(h, { children: ({ validationErrors: r }) => m ?? r.join(" ") })
|
|
115
|
+
] })
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
export {
|
|
120
|
+
M as S
|
|
121
|
+
};
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { A as s, a as p } from "./chunks/AccordionItem-DHhQDd6o.js";
|
|
3
|
-
import { B as m, a as i } from "./chunks/BadgeContainer-
|
|
3
|
+
import { B as m, a as i } from "./chunks/BadgeContainer-DyQDrY6S.js";
|
|
4
4
|
import { B as n, a as d } from "./chunks/Breadcrumb-Bs836gOn.js";
|
|
5
5
|
import { B as l } from "./chunks/Button-GCROAMSl.js";
|
|
6
6
|
import { B as c } from "./chunks/ButtonGroup-Dr6HOBo2.js";
|
|
@@ -23,7 +23,7 @@ import { G as xa } from "./chunks/GridItem-DenBLGXB.js";
|
|
|
23
23
|
import { H as ia } from "./chunks/Heading-nfcRc2QF.js";
|
|
24
24
|
import { I as na } from "./chunks/InfoBanner-CWLvkP6D.js";
|
|
25
25
|
import { L as Ta } from "./chunks/Label-Cqo7Xz2v.js";
|
|
26
|
-
import { H as ga, L as ca, N as ua, S as Ca, a as La } from "./chunks/Layout-
|
|
26
|
+
import { H as ga, L as ca, N as ua, S as Ca, a as La } from "./chunks/Layout-D-nVSBJY.js";
|
|
27
27
|
import { L as ba } from "./chunks/Link-CSIZehbN.js";
|
|
28
28
|
import { L as Da } from "./chunks/LinkButton-Dzp8ZAPs.js";
|
|
29
29
|
import { L as Fa, a as Ra } from "./chunks/Logo-DDykn5b2.js";
|
|
@@ -31,7 +31,7 @@ import { M as Pa, a as ka } from "./chunks/Modal-yigospxi.js";
|
|
|
31
31
|
import { P as Ma } from "./chunks/Popover-CjEPHe4A.js";
|
|
32
32
|
import { P as Aa } from "./chunks/ProgressBar-BrWLkY8H.js";
|
|
33
33
|
import { R as ya, a as Ea } from "./chunks/Radio-CFolRKKY.js";
|
|
34
|
-
import { S as wa } from "./chunks/SearchField-
|
|
34
|
+
import { S as wa } from "./chunks/SearchField-BXIDm898.js";
|
|
35
35
|
import { S as za } from "./chunks/Select-BQ109AJG.js";
|
|
36
36
|
import { S as Va } from "./chunks/Skeleton-ClvqZoDy.js";
|
|
37
37
|
import { S as ja } from "./chunks/Spinner-CfKMn18u.js";
|
|
@@ -52,7 +52,7 @@ import { c as Ko } from "./chunks/clsx-AexbMWKp.js";
|
|
|
52
52
|
import { DialogTrigger as Wo, MenuTrigger as Xo, RouterProvider as Yo } from "react-aria-components";
|
|
53
53
|
import { u as $o } from "./chunks/useLocalizedStringFormatter-BHvsRxDk.js";
|
|
54
54
|
import { useToastState as or } from "react-stately";
|
|
55
|
-
const a = "17.14.
|
|
55
|
+
const a = "17.14.8", o = {
|
|
56
56
|
version: a
|
|
57
57
|
}, r = o.version;
|
|
58
58
|
export {
|
package/layout/index.js
CHANGED
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.14.
|
|
17
|
+
"version": "17.14.8",
|
|
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.14.
|
|
44
|
+
"@midas-ds/theme": "3.14.7",
|
|
45
45
|
"@react-aria/focus": "^3.21.5",
|
|
46
46
|
"@react-stately/toggle": "^3.9.5",
|
|
47
47
|
"@react-stately/utils": "^3.11.0",
|
package/search-field/index.js
CHANGED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import * as i from "react";
|
|
3
|
-
import { c as t } from "./clsx-AexbMWKp.js";
|
|
4
|
-
import '../assets/BadgeContainer.css';const d = "_badge_6i93e_1", c = "_hasChildren_6i93e_10", C = "_badgeContainer_6i93e_19", s = {
|
|
5
|
-
badge: d,
|
|
6
|
-
hasChildren: c,
|
|
7
|
-
badgeContainer: C
|
|
8
|
-
}, l = ({
|
|
9
|
-
children: a,
|
|
10
|
-
className: e,
|
|
11
|
-
...n
|
|
12
|
-
}) => {
|
|
13
|
-
const o = i.Children.count(a) > 0;
|
|
14
|
-
return /* @__PURE__ */ r(
|
|
15
|
-
"span",
|
|
16
|
-
{
|
|
17
|
-
className: t(
|
|
18
|
-
s.badge,
|
|
19
|
-
o && s.hasChildren,
|
|
20
|
-
e
|
|
21
|
-
),
|
|
22
|
-
...n,
|
|
23
|
-
children: a
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
}, _ = ({ children: a, className: e, ...n }) => /* @__PURE__ */ r(
|
|
27
|
-
"span",
|
|
28
|
-
{
|
|
29
|
-
className: t(s.badgeContainer, e),
|
|
30
|
-
...n,
|
|
31
|
-
children: a
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
export {
|
|
35
|
-
l as B,
|
|
36
|
-
_ as a
|
|
37
|
-
};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as i, jsxs as s, Fragment as j } from "react/jsx-runtime";
|
|
3
|
-
import { useSlottedContext as N, FormContext as g, SearchField as y, Input as B } from "react-aria-components";
|
|
4
|
-
import { s as C } from "./TextField.module-BDIbEV87.js";
|
|
5
|
-
import { B as u } from "./Button-GCROAMSl.js";
|
|
6
|
-
import { c as o } from "./clsx-AexbMWKp.js";
|
|
7
|
-
import { F as h } from "./FieldError-krpMBtie.js";
|
|
8
|
-
import { c as k } from "./createLucideIcon-CP-mMPfa.js";
|
|
9
|
-
import { X as I } from "./x-B9bYxG31.js";
|
|
10
|
-
import { u as D } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
11
|
-
import '../assets/SearchField.css';const E = [
|
|
12
|
-
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
13
|
-
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
14
|
-
], L = k("search", E), T = "_container_1msv3_1", V = "_inner_1msv3_10", $ = "_inputContainer_1msv3_15", w = "_medium_1msv3_21", O = "_icon_1msv3_26", P = "_clear_1msv3_38", X = "_input_1msv3_15", n = {
|
|
15
|
-
container: T,
|
|
16
|
-
inner: V,
|
|
17
|
-
inputContainer: $,
|
|
18
|
-
medium: w,
|
|
19
|
-
icon: O,
|
|
20
|
-
clear: P,
|
|
21
|
-
input: X
|
|
22
|
-
}, q = { search: "Search" }, A = { search: "Sök" }, G = {
|
|
23
|
-
en: q,
|
|
24
|
-
sv: A
|
|
25
|
-
};
|
|
26
|
-
function H(a) {
|
|
27
|
-
return !!a?.length;
|
|
28
|
-
}
|
|
29
|
-
const M = ({
|
|
30
|
-
errorPosition: a = "top",
|
|
31
|
-
size: r = "large",
|
|
32
|
-
showButton: _,
|
|
33
|
-
className: v,
|
|
34
|
-
errorMessage: m,
|
|
35
|
-
placeholder: l,
|
|
36
|
-
validationBehavior: f,
|
|
37
|
-
inputMode: S = "search",
|
|
38
|
-
...e
|
|
39
|
-
}) => {
|
|
40
|
-
const b = D(G), p = N(g), x = f ?? p?.validationBehavior ?? "aria", F = _ !== !1, d = (t) => {
|
|
41
|
-
!t || e.isInvalid || e.validate && H(e.validate(t)) || e.onSubmit?.(t);
|
|
42
|
-
};
|
|
43
|
-
return /* @__PURE__ */ i(
|
|
44
|
-
y,
|
|
45
|
-
{
|
|
46
|
-
...e,
|
|
47
|
-
inputMode: S,
|
|
48
|
-
onSubmit: d,
|
|
49
|
-
"aria-label": e["aria-label"] ?? l,
|
|
50
|
-
className: o(n.container, v),
|
|
51
|
-
validationBehavior: x,
|
|
52
|
-
children: ({ state: t }) => /* @__PURE__ */ s(j, { children: [
|
|
53
|
-
a === "top" && /* @__PURE__ */ i(h, { children: ({ validationErrors: c }) => m ?? c.join(" ") }),
|
|
54
|
-
/* @__PURE__ */ s("div", { className: n.inner, children: [
|
|
55
|
-
/* @__PURE__ */ s(
|
|
56
|
-
"div",
|
|
57
|
-
{
|
|
58
|
-
className: o(n.inputContainer, {
|
|
59
|
-
[n.medium]: r === "medium"
|
|
60
|
-
}),
|
|
61
|
-
children: [
|
|
62
|
-
/* @__PURE__ */ i(
|
|
63
|
-
L,
|
|
64
|
-
{
|
|
65
|
-
size: 20,
|
|
66
|
-
className: n.icon
|
|
67
|
-
}
|
|
68
|
-
),
|
|
69
|
-
/* @__PURE__ */ i(
|
|
70
|
-
B,
|
|
71
|
-
{
|
|
72
|
-
placeholder: l,
|
|
73
|
-
className: o(C.input, n.input, {
|
|
74
|
-
[n.medium]: r === "medium"
|
|
75
|
-
})
|
|
76
|
-
}
|
|
77
|
-
),
|
|
78
|
-
t.value.length > 0 && /* @__PURE__ */ i(
|
|
79
|
-
u,
|
|
80
|
-
{
|
|
81
|
-
variant: "icon",
|
|
82
|
-
size: r,
|
|
83
|
-
className: o(n.clear, {
|
|
84
|
-
[n.medium]: r === "medium"
|
|
85
|
-
}),
|
|
86
|
-
children: /* @__PURE__ */ i(
|
|
87
|
-
I,
|
|
88
|
-
{
|
|
89
|
-
size: 20,
|
|
90
|
-
"aria-hidden": !0
|
|
91
|
-
}
|
|
92
|
-
)
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
),
|
|
98
|
-
F && /* @__PURE__ */ i(
|
|
99
|
-
u,
|
|
100
|
-
{
|
|
101
|
-
slot: null,
|
|
102
|
-
excludeFromTabOrder: !0,
|
|
103
|
-
size: r,
|
|
104
|
-
isDisabled: e.isDisabled,
|
|
105
|
-
type: "button",
|
|
106
|
-
onPress: () => d(t.value),
|
|
107
|
-
children: e.buttonText ?? b.format("search")
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
] }),
|
|
111
|
-
a === "bottom" && /* @__PURE__ */ i(h, { children: ({ validationErrors: c }) => m ?? c.join(" ") })
|
|
112
|
-
] })
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
};
|
|
116
|
-
export {
|
|
117
|
-
M as S
|
|
118
|
-
};
|