@midas-ds/components 17.14.5 → 17.14.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 +17 -0
- package/assets/BadgeContainer.css +1 -1
- package/assets/CardHeader.css +1 -1
- package/badge/index.js +1 -1
- package/card/index.js +1 -1
- package/chunks/BadgeContainer-DyQDrY6S.js +38 -0
- package/chunks/{CardHeader-C0ZHxQnT.js → CardHeader-BnwDMzW9.js} +13 -13
- package/chunks/{Layout-C6Jjp3Pc.js → Layout-D-nVSBJY.js} +1 -1
- package/chunks/SearchField-BXIDm898.js +121 -0
- package/index.js +5 -5
- package/layout/index.js +1 -1
- package/package.json +1 -1
- 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.7 (2026-05-11)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **components, search-field:** submit parent form on Enter when no onSubmit is provided ([aa984e2a998](https://github.com/migrationsverket/midas/commit/aa984e2a998))
|
|
6
|
+
- **components,layout:** add badge pattern to navigation docs and fix sidebar transition ([b46ae8a3141](https://github.com/migrationsverket/midas/commit/b46ae8a3141))
|
|
7
|
+
|
|
8
|
+
### 🧪 Tests updated
|
|
9
|
+
|
|
10
|
+
- **components, search-field:** add form submission behaviour tests ([0a04b3e0024](https://github.com/migrationsverket/midas/commit/0a04b3e0024))
|
|
11
|
+
|
|
12
|
+
## 17.14.6 (2026-05-11)
|
|
13
|
+
|
|
14
|
+
### 🩹 Fixes
|
|
15
|
+
|
|
16
|
+
- **components,card:** prevent CardBody margin-bottom from collapsing out of card ([6ef863330bb](https://github.com/migrationsverket/midas/commit/6ef863330bb))
|
|
17
|
+
|
|
1
18
|
## 17.14.5 (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/assets/CardHeader.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._card_7i5z9_1{font-family:var(--midas-typography-font-family);position:relative;display:flow-root;background-color:var(--midas-card-background-base);box-shadow:var(--midas-card-shadow)}@media(forced-colors:active){._card_7i5z9_1{border:1px solid}}._card_7i5z9_1._horizontal_7i5z9_12{display:flex;flex-flow:row wrap}._card_7i5z9_1:has(._cardLink_7i5z9_17[data-hovered]){background-color:var(--midas-layer-01-hover)}@media(hover:hover){._card_7i5z9_1:has(._cardLink_7i5z9_17:hover){background-color:var(--midas-layer-01-hover)}}._cardContent_7i5z9_28{padding:1rem;display:flex;flex-direction:column;gap:var(--midas-space-medium);flex-grow:1}._cardContent_7i5z9_28._horizontal_7i5z9_12{padding:.5rem 1rem;flex-direction:row;align-items:center;column-gap:1rem}._cardContent_7i5z9_28+._cardContent_7i5z9_28{padding-top:.5rem}._cardActions_7i5z9_47{display:flex;flex-direction:row;gap:.5rem;margin-top:var(--midas-space-medium);padding:0 var(--midas-space-medium) var(--midas-space-medium) var(--midas-space-medium)}._cardActions_7i5z9_47._horizontal_7i5z9_12{margin-top:0;margin-left:auto}._cardActions_7i5z9_47._deprecated_7i5z9_61{margin-top:0;padding:0}._cardActionArea_7i5z9_67{border:0;padding:0;text-align:unset;background-color:unset;cursor:pointer;width:100%}._cardActionArea_7i5z9_67[data-hovered]{background-color:var(--midas-button-icon-hover)}._cardActionArea_7i5z9_67[data-pressed]{background-color:var(--midas-button-icon-active)}._cardActionArea_7i5z9_67:focus{outline:none}._cardActionArea_7i5z9_67[data-focused]{box-shadow:var(--midas-state-focus)}@media(forced-colors:active){._cardActionArea_7i5z9_67[data-focused]{outline:2px solid highlight}}._cardActionArea_7i5z9_67+._cardContent_7i5z9_28{padding-top:.5rem}._cardImage_7i5z9_100{max-width:100%;height:auto}._cardImage_7i5z9_100._horizontal_7i5z9_12{max-width:unset}._cardLink_7i5z9_17{display:flex;justify-content:space-between;align-items:center;text-decoration:none}._cardLink_7i5z9_17[data-focused],._cardLink_7i5z9_17:focus{outline:none;box-shadow:var(--midas-state-focus)}@media(forced-colors:active){._cardLink_7i5z9_17[data-focused],._cardLink_7i5z9_17:focus{outline:2px solid highlight}}._cardLink_7i5z9_17:after{position:absolute;inset:0;z-index:var(--midas-z-index-base);content:""}._cardLink_7i5z9_17 ._cardLinkIcon_7i5z9_132{color:var(--midas-icon-primary)}._cardBody_337uy_1{margin:var(--midas-space-medium)}._cardHeader_1625c_1{display:flex;align-items:center;justify-content:space-between;padding:var(--midas-space-medium) var(--midas-space-30) 0 var(--midas-space-medium);margin-bottom:var(--midas-space-medium)}._cardHeader_1625c_1:has(+[data-card-image]){margin-bottom:var(--midas-space-small)}._textContainer_1625c_14{display:flex;flex-direction:column;padding-right:var(--midas-space-medium)}._subHeading_1625c_20{margin-bottom:0}
|
package/badge/index.js
CHANGED
package/card/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as d, a as C, b as s, c as e, d as o, e as t, f as n, g as i, h as c } from "../chunks/CardHeader-
|
|
1
|
+
import { C as d, a as C, b as s, c as e, d as o, e as t, f as n, g as i, h as c } from "../chunks/CardHeader-BnwDMzW9.js";
|
|
2
2
|
export {
|
|
3
3
|
d as Card,
|
|
4
4
|
C as CardActionArea,
|
|
@@ -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
|
+
};
|
|
@@ -2,16 +2,16 @@ import { jsx as c, jsxs as m } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as o } from "./clsx-AexbMWKp.js";
|
|
3
3
|
import * as s from "react";
|
|
4
4
|
import { H as u } from "./Heading-nfcRc2QF.js";
|
|
5
|
-
import { Button as h, Link as
|
|
6
|
-
import { A as
|
|
7
|
-
import { T as
|
|
8
|
-
import '../assets/CardHeader.css';const
|
|
9
|
-
card:
|
|
10
|
-
horizontal:
|
|
11
|
-
cardLink:
|
|
12
|
-
cardContent:
|
|
13
|
-
cardActions:
|
|
14
|
-
deprecated:
|
|
5
|
+
import { Button as h, Link as z } from "react-aria-components";
|
|
6
|
+
import { A as x } from "./arrow-right-BVcFGZmy.js";
|
|
7
|
+
import { T as p } from "./Text-D0r_W4lH.js";
|
|
8
|
+
import '../assets/CardHeader.css';const A = "_card_7i5z9_1", g = "_horizontal_7i5z9_12", v = "_cardLink_7i5z9_17", I = "_cardContent_7i5z9_28", N = "_cardActions_7i5z9_47", y = "_deprecated_7i5z9_61", k = "_cardActionArea_7i5z9_67", H = "_cardImage_7i5z9_100", L = "_cardLinkIcon_7i5z9_132", r = {
|
|
9
|
+
card: A,
|
|
10
|
+
horizontal: g,
|
|
11
|
+
cardLink: v,
|
|
12
|
+
cardContent: I,
|
|
13
|
+
cardActions: N,
|
|
14
|
+
deprecated: y,
|
|
15
15
|
cardActionArea: k,
|
|
16
16
|
cardImage: H,
|
|
17
17
|
cardLinkIcon: L
|
|
@@ -116,14 +116,14 @@ import '../assets/CardHeader.css';const g = "_card_1u3lt_1", v = "_horizontal_1u
|
|
|
116
116
|
as: a,
|
|
117
117
|
...e
|
|
118
118
|
}) => /* @__PURE__ */ m(
|
|
119
|
-
a ||
|
|
119
|
+
a || z,
|
|
120
120
|
{
|
|
121
121
|
...e,
|
|
122
122
|
className: o(r.cardLink, e.className),
|
|
123
123
|
children: [
|
|
124
124
|
t,
|
|
125
125
|
/* @__PURE__ */ c(
|
|
126
|
-
|
|
126
|
+
x,
|
|
127
127
|
{
|
|
128
128
|
className: r.cardLinkIcon,
|
|
129
129
|
size: 24
|
|
@@ -159,7 +159,7 @@ import '../assets/CardHeader.css';const g = "_card_1u3lt_1", v = "_horizontal_1u
|
|
|
159
159
|
/* @__PURE__ */ m("div", { className: _.textContainer, children: [
|
|
160
160
|
/* @__PURE__ */ c(f, { elementType: n, children: e }),
|
|
161
161
|
d && /* @__PURE__ */ c(
|
|
162
|
-
|
|
162
|
+
p,
|
|
163
163
|
{
|
|
164
164
|
slot: "description",
|
|
165
165
|
className: _.subHeading,
|
|
@@ -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,11 +1,11 @@
|
|
|
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";
|
|
7
7
|
import { C, R as L } from "./chunks/RangeCalendar-DxLInTav.js";
|
|
8
|
-
import { C as b, a as S, b as D, c as I, d as F, e as R, f as G, g as P, h as k } from "./chunks/CardHeader-
|
|
8
|
+
import { C as b, a as S, b as D, c as I, d as F, e as R, f as G, g as P, h as k } from "./chunks/CardHeader-BnwDMzW9.js";
|
|
9
9
|
import { C as M } from "./chunks/CharacterCounter-Dgnv-orm.js";
|
|
10
10
|
import { C as A } from "./chunks/Checkbox-CyamRrFD.js";
|
|
11
11
|
import { C as y } from "./chunks/CheckboxGroup-CmjQm14M.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.7", o = {
|
|
56
56
|
version: a
|
|
57
57
|
}, r = o.version;
|
|
58
58
|
export {
|
package/layout/index.js
CHANGED
package/package.json
CHANGED
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
|
-
};
|