@midas-ds/components 17.2.6 → 17.3.0
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 +15 -0
- package/accordion/index.js +1 -1
- package/assets/AccordionItem.css +1 -1
- package/assets/Button.css +1 -1
- package/assets/Checkbox.css +1 -1
- package/assets/ComboBox.css +1 -1
- package/assets/DateField.css +1 -1
- package/assets/DateRangePicker.css +1 -1
- package/assets/Dialog.css +1 -1
- package/assets/Heading.css +1 -1
- package/assets/LinkButton.css +1 -1
- package/assets/ListBox.css +1 -1
- package/assets/ListBoxEmptyState.css +1 -1
- package/assets/Popover.css +1 -1
- package/assets/RangeCalendar.css +1 -1
- package/assets/SearchField.css +1 -1
- package/assets/Select.css +1 -1
- package/assets/Separator.css +1 -1
- package/assets/Skeleton.css +1 -1
- package/assets/TabList.css +1 -1
- package/assets/Table.css +1 -1
- package/assets/TagGroup.css +1 -1
- package/assets/Text.css +1 -1
- package/assets/TextField.css +1 -1
- package/assets/Tooltip.css +1 -1
- package/assets/default.css +1 -1
- package/button/index.js +1 -1
- package/calendar/index.js +1 -1
- package/card/index.js +1 -1
- package/checkbox/index.js +2 -2
- package/chunks/AccordionItem-BuUIdVd_.js +129 -0
- package/chunks/{Button-CaLOUTDO.js → Button-BhIvfqOc.js} +1 -1
- package/chunks/Button.module-BW0TvYZ2.js +14 -0
- package/chunks/{Card-DMSnokPn.js → Card-CVwiT9zm.js} +1 -1
- package/chunks/{Checkbox-CRLj7_Ox.js → Checkbox-sAkQe7Q9.js} +18 -18
- package/chunks/{CheckboxGroup-DooCBqUG.js → CheckboxGroup-DGVV0X_Z.js} +4 -4
- package/chunks/{ClearButton-DPm_d7SL.js → ClearButton-DBr9Zfwq.js} +1 -1
- package/chunks/{ColorSchemeSwitch-DOQ0yjtt.js → ColorSchemeSwitch-DkY8VTVR.js} +1 -1
- package/chunks/ComboBox-Dx4GD2oe.js +102 -0
- package/chunks/{DateField-6CclHfL2.js → DateField-h3l0qG7u.js} +23 -23
- package/chunks/{DateRangePicker-BoL-sn9u.js → DateRangePicker-BCZ6i1w0.js} +27 -27
- package/chunks/{Dialog-BHxDzbf8.js → Dialog-DVff9MDd.js} +17 -17
- package/chunks/{FieldError-BMTrvSof.js → FieldError-krpMBtie.js} +1 -1
- package/chunks/Heading-nfcRc2QF.js +38 -0
- package/chunks/{InfoBanner-C4HnaXQO.js → InfoBanner-otmuemqy.js} +1 -1
- package/chunks/{Label-6GZmmff9.js → Label-s4J9sYdy.js} +2 -2
- package/chunks/{Layout-BclBqFzc.js → Layout-hXzqx4cY.js} +2 -2
- package/chunks/{LinkButton-B1zayj7k.js → LinkButton-DJ-D5PkB.js} +15 -15
- package/chunks/{ListBox-D5BBeZWL.js → ListBox-CDlOUvzJ.js} +13 -13
- package/chunks/{ListBoxEmptyState-_Cn38cQ6.js → ListBoxEmptyState-CXKkWQy1.js} +3 -3
- package/chunks/{ListBoxHeader-CL9bFH22.js → ListBoxHeader-DSYdXl2I.js} +1 -1
- package/chunks/{Popover-BcEtFiU1.js → Popover-CaP4LFhg.js} +12 -12
- package/chunks/{ProgressBar-Dg0JMQ71.js → ProgressBar-acc8946-.js} +1 -1
- package/chunks/{Radio-CAIyBgBp.js → Radio-DjivEe-_.js} +3 -3
- package/chunks/{RangeCalendar-DIMxoHhy.js → RangeCalendar-LheFd9WF.js} +26 -26
- package/chunks/SearchField-1DYv0w4b.js +128 -0
- package/chunks/Select-CV0H13h-.js +222 -0
- package/chunks/Separator-CkVOLF6I.js +76 -0
- package/chunks/{Skeleton-DqIHQLQl.js → Skeleton-D6mxKxuu.js} +22 -22
- package/chunks/{TabList-BaR443mu.js → TabList-BHX-cuhB.js} +20 -20
- package/chunks/{Table-UbdCFrkS.js → Table-Bg-AKi7d.js} +50 -50
- package/chunks/{TagGroup-CWe0P76-.js → TagGroup-BscTXQ_E.js} +29 -29
- package/chunks/{Text-BuXvuoqM.js → Text-D0r_W4lH.js} +16 -16
- package/chunks/{TextArea-BQuztcdA.js → TextArea-CBRE_gsN.js} +5 -5
- package/chunks/TextField.module-BDIbEV87.js +12 -0
- package/chunks/{Toast-UPM-1ipu.js → Toast-Cxm230CK.js} +1 -1
- package/chunks/{ToggleButtonGroup-CXKTrLbb.js → ToggleButtonGroup-Bv9xpwTT.js} +1 -1
- package/chunks/{Tooltip-rDmOkGmX.js → Tooltip-C1bbgr2l.js} +12 -12
- package/clear-button/index.js +1 -1
- package/color-scheme-switch/index.js +1 -1
- package/combobox/index.js +1 -1
- package/date-field/index.js +1 -1
- package/date-picker/index.js +1 -1
- package/field-error/index.js +1 -1
- package/heading/index.js +1 -1
- package/index.js +36 -36
- package/info-banner/index.js +1 -1
- package/label/index.js +1 -1
- package/layout/index.js +1 -1
- package/link-button/index.js +1 -1
- package/list-box/index.js +3 -3
- package/menu/index.js +1 -1
- package/modal/index.js +1 -1
- package/package.json +2 -2
- package/popover/index.js +1 -1
- package/progress-bar/index.js +1 -1
- package/radio/index.js +1 -1
- package/search-field/index.js +1 -1
- package/select/index.js +1 -1
- package/skeleton/index.js +1 -1
- package/table/index.js +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.js +1 -1
- package/text/index.js +1 -1
- package/textfield/index.js +1 -1
- package/toast/index.js +1 -1
- package/toggle-button/index.js +1 -1
- package/tooltip/index.js +1 -1
- package/chunks/AccordionItem-CSvARy63.js +0 -129
- package/chunks/Button.module-Cm0H98vy.js +0 -14
- package/chunks/ComboBox-DnqZjAqe.js +0 -102
- package/chunks/Heading-D8tNNJkt.js +0 -38
- package/chunks/SearchField-C_OjgTE0.js +0 -128
- package/chunks/Select-D7JfpIUT.js +0 -222
- package/chunks/Separator-XIzn8lsq.js +0 -76
- package/chunks/TextField.module-DmV0iI3P.js +0 -12
package/modal/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.
|
|
17
|
+
"version": "17.3.0",
|
|
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.
|
|
44
|
+
"@midas-ds/theme": "3.12.0",
|
|
45
45
|
"react-aria-components": "1.14.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/popover/index.js
CHANGED
package/progress-bar/index.js
CHANGED
package/radio/index.js
CHANGED
package/search-field/index.js
CHANGED
package/select/index.js
CHANGED
package/skeleton/index.js
CHANGED
package/table/index.js
CHANGED
package/tabs/index.js
CHANGED
package/tag/index.js
CHANGED
package/text/index.js
CHANGED
package/textfield/index.js
CHANGED
package/toast/index.js
CHANGED
package/toggle-button/index.js
CHANGED
package/tooltip/index.js
CHANGED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as n, jsxs as m } from "react/jsx-runtime";
|
|
3
|
-
import { c as d } from "./clsx-AexbMWKp.js";
|
|
4
|
-
import { DisclosureGroup as f, Disclosure as v, DisclosurePanel as C } from "react-aria-components";
|
|
5
|
-
import { createContext as I, useContext as N, useEffect as B } from "react";
|
|
6
|
-
import { B as k } from "./Button-CaLOUTDO.js";
|
|
7
|
-
import { H as w } from "./Heading-D8tNNJkt.js";
|
|
8
|
-
import { F as A } from "./FeedbackStatusIcon-X9Bjgeta.js";
|
|
9
|
-
import { C as T } from "./chevron-down-BBFYYzZq.js";
|
|
10
|
-
import '../assets/AccordionItem.css';const D = "_root_17bdp_1", M = "_contained_17bdp_5", a = {
|
|
11
|
-
root: D,
|
|
12
|
-
contained: M
|
|
13
|
-
}, g = I(void 0), et = ({
|
|
14
|
-
children: o,
|
|
15
|
-
className: c,
|
|
16
|
-
isContained: s,
|
|
17
|
-
size: r = "large",
|
|
18
|
-
...e
|
|
19
|
-
}) => /* @__PURE__ */ n(g.Provider, { value: { isContained: s, size: r }, children: /* @__PURE__ */ n(
|
|
20
|
-
f,
|
|
21
|
-
{
|
|
22
|
-
className: d(
|
|
23
|
-
a.root,
|
|
24
|
-
s ? a.contained : a.uncontained,
|
|
25
|
-
c
|
|
26
|
-
),
|
|
27
|
-
...e,
|
|
28
|
-
children: o
|
|
29
|
-
}
|
|
30
|
-
) }), j = "_item_hpbxd_1", z = "_contained_hpbxd_18", F = "_medium_hpbxd_28", H = "_success_hpbxd_33", P = "_warning_hpbxd_39", S = "_info_hpbxd_45", y = "_important_hpbxd_51", E = "_triggerButton_hpbxd_62", G = "_triggerText_hpbxd_66", R = "_trigger_hpbxd_62", W = "_triggerMainContent_hpbxd_77", $ = "_chevronIcon_hpbxd_94", q = "_statusIcon_hpbxd_100", J = "_panel_hpbxd_122", K = "_content_hpbxd_130", L = "_hasBackground_hpbxd_135", O = "_header_hpbxd_139", t = {
|
|
31
|
-
item: j,
|
|
32
|
-
contained: z,
|
|
33
|
-
medium: F,
|
|
34
|
-
success: H,
|
|
35
|
-
warning: P,
|
|
36
|
-
info: S,
|
|
37
|
-
important: y,
|
|
38
|
-
triggerButton: E,
|
|
39
|
-
triggerText: G,
|
|
40
|
-
trigger: R,
|
|
41
|
-
triggerMainContent: W,
|
|
42
|
-
" ": "_ _hpbxd_1",
|
|
43
|
-
chevronIcon: $,
|
|
44
|
-
statusIcon: q,
|
|
45
|
-
panel: J,
|
|
46
|
-
content: K,
|
|
47
|
-
hasBackground: L,
|
|
48
|
-
header: O
|
|
49
|
-
}, ot = ({
|
|
50
|
-
title: o,
|
|
51
|
-
children: c,
|
|
52
|
-
className: s,
|
|
53
|
-
headingLevel: r = "h2",
|
|
54
|
-
type: e,
|
|
55
|
-
hasBackground: l = !0,
|
|
56
|
-
size: h = "large",
|
|
57
|
-
isContained: u,
|
|
58
|
-
iconAriaLabel: p,
|
|
59
|
-
...x
|
|
60
|
-
}) => {
|
|
61
|
-
const _ = N(g), i = u ?? _?.isContained ?? !1, b = typeof o == "object";
|
|
62
|
-
return B(() => {
|
|
63
|
-
e && !i && console.warn(
|
|
64
|
-
"AccordionItem: When 'type' is set, it is recommended to also set 'isContained' to true for visual consistency."
|
|
65
|
-
);
|
|
66
|
-
}, [e, i]), /* @__PURE__ */ m(
|
|
67
|
-
v,
|
|
68
|
-
{
|
|
69
|
-
...x,
|
|
70
|
-
className: d(
|
|
71
|
-
t.item,
|
|
72
|
-
e && t[e],
|
|
73
|
-
(h === "medium" || _?.size === "medium") && t.medium,
|
|
74
|
-
i && t.contained,
|
|
75
|
-
s
|
|
76
|
-
),
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ n("div", { className: t.trigger, children: /* @__PURE__ */ m(
|
|
79
|
-
k,
|
|
80
|
-
{
|
|
81
|
-
className: t.triggerButton,
|
|
82
|
-
slot: "trigger",
|
|
83
|
-
variant: "icon",
|
|
84
|
-
children: [
|
|
85
|
-
/* @__PURE__ */ n(
|
|
86
|
-
T,
|
|
87
|
-
{
|
|
88
|
-
size: 20,
|
|
89
|
-
className: t.chevronIcon
|
|
90
|
-
}
|
|
91
|
-
),
|
|
92
|
-
/* @__PURE__ */ n("div", { className: t.triggerMainContent, children: b ? o : /* @__PURE__ */ n(
|
|
93
|
-
w,
|
|
94
|
-
{
|
|
95
|
-
level: 3,
|
|
96
|
-
elementType: r,
|
|
97
|
-
className: t.triggerText,
|
|
98
|
-
children: o
|
|
99
|
-
}
|
|
100
|
-
) }),
|
|
101
|
-
e && /* @__PURE__ */ n(
|
|
102
|
-
A,
|
|
103
|
-
{
|
|
104
|
-
"aria-label": p,
|
|
105
|
-
className: t.statusIcon,
|
|
106
|
-
status: e
|
|
107
|
-
}
|
|
108
|
-
)
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
) }),
|
|
112
|
-
/* @__PURE__ */ n(C, { className: t.panel, children: /* @__PURE__ */ n(
|
|
113
|
-
"div",
|
|
114
|
-
{
|
|
115
|
-
className: d(
|
|
116
|
-
t.content,
|
|
117
|
-
l && t.hasBackground
|
|
118
|
-
),
|
|
119
|
-
children: c
|
|
120
|
-
}
|
|
121
|
-
) })
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
};
|
|
126
|
-
export {
|
|
127
|
-
et as A,
|
|
128
|
-
ot as a
|
|
129
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import '../assets/Button.css';const i = "_button_1ikai_1", t = "_secondary_1ikai_48", n = "_tertiary_1ikai_71", _ = "_iconBtn_1ikai_91", o = "_medium_1ikai_111", a = "_danger_1ikai_116", c = "_iconRight_1ikai_138", r = "_fullwidth_1ikai_142", s = "_primary_1ikai_152", e = {
|
|
2
|
-
button: i,
|
|
3
|
-
secondary: t,
|
|
4
|
-
tertiary: n,
|
|
5
|
-
iconBtn: _,
|
|
6
|
-
medium: o,
|
|
7
|
-
danger: a,
|
|
8
|
-
iconRight: c,
|
|
9
|
-
fullwidth: r,
|
|
10
|
-
primary: s
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
e as B
|
|
14
|
-
};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import L from "react";
|
|
4
|
-
import { ComboBox as F, Input as v, Button as R } from "react-aria-components";
|
|
5
|
-
import { c as s } from "./clsx-AexbMWKp.js";
|
|
6
|
-
import { a as y, L as B } from "./Label-6GZmmff9.js";
|
|
7
|
-
import { T as k } from "./Text-BuXvuoqM.js";
|
|
8
|
-
import { F as u } from "./FieldError-BMTrvSof.js";
|
|
9
|
-
import { L as C } from "./ListBox-D5BBeZWL.js";
|
|
10
|
-
import { a as N, L as g } from "./ListBoxEmptyState-_Cn38cQ6.js";
|
|
11
|
-
import { C as E } from "./chevron-down-BBFYYzZq.js";
|
|
12
|
-
import { u as S } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
13
|
-
import '../assets/ComboBox.css';const T = "_combobox_1awtk_1", j = "_inputField_1awtk_6", I = "_medium_1awtk_27", O = "_wrap_1awtk_79", U = "_button_1awtk_85", z = "_icon_1awtk_121", t = {
|
|
14
|
-
combobox: T,
|
|
15
|
-
inputField: j,
|
|
16
|
-
medium: I,
|
|
17
|
-
wrap: O,
|
|
18
|
-
button: U,
|
|
19
|
-
icon: z
|
|
20
|
-
}, D = { showList: "Show list", noResultsFound: "No results found" }, M = { showList: "Visa lista", noResultsFound: "Inga träffar" }, V = {
|
|
21
|
-
en: D,
|
|
22
|
-
sv: M
|
|
23
|
-
};
|
|
24
|
-
function Y({
|
|
25
|
-
label: a,
|
|
26
|
-
description: i,
|
|
27
|
-
errorMessage: r,
|
|
28
|
-
children: p,
|
|
29
|
-
items: f,
|
|
30
|
-
className: _,
|
|
31
|
-
errorPosition: n = "top",
|
|
32
|
-
size: m = "large",
|
|
33
|
-
popover: h,
|
|
34
|
-
listBoxProps: b,
|
|
35
|
-
...e
|
|
36
|
-
}) {
|
|
37
|
-
const d = L.useRef(null), l = S(V), w = (x) => {
|
|
38
|
-
x.currentTarget.value && d.current?.select();
|
|
39
|
-
};
|
|
40
|
-
return /* @__PURE__ */ c(
|
|
41
|
-
F,
|
|
42
|
-
{
|
|
43
|
-
className: s(t.combobox, _),
|
|
44
|
-
...e,
|
|
45
|
-
"data-readonly": e.isReadOnly || void 0,
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ o(y, { popover: h, children: a && /* @__PURE__ */ o(B, { children: a }) }),
|
|
48
|
-
i && /* @__PURE__ */ o(k, { slot: "description", children: i }),
|
|
49
|
-
n === "top" && /* @__PURE__ */ o(u, { "data-testid": "fieldError", children: r }),
|
|
50
|
-
/* @__PURE__ */ c("div", { className: t.wrap, children: [
|
|
51
|
-
/* @__PURE__ */ o(
|
|
52
|
-
v,
|
|
53
|
-
{
|
|
54
|
-
className: s(t.inputField, {
|
|
55
|
-
[t.medium]: m === "medium"
|
|
56
|
-
}),
|
|
57
|
-
"data-readonly": e.isReadOnly || void 0,
|
|
58
|
-
onMouseUp: w,
|
|
59
|
-
ref: d
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
/* @__PURE__ */ o(
|
|
63
|
-
R,
|
|
64
|
-
{
|
|
65
|
-
className: s(t.button, {
|
|
66
|
-
[t.medium]: m === "medium"
|
|
67
|
-
}),
|
|
68
|
-
"aria-label": l.format("showList"),
|
|
69
|
-
children: /* @__PURE__ */ o(
|
|
70
|
-
"div",
|
|
71
|
-
{
|
|
72
|
-
className: t.icon,
|
|
73
|
-
"aria-hidden": "true",
|
|
74
|
-
children: /* @__PURE__ */ o(
|
|
75
|
-
E,
|
|
76
|
-
{
|
|
77
|
-
size: 20,
|
|
78
|
-
"aria-hidden": !0
|
|
79
|
-
}
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
)
|
|
85
|
-
] }),
|
|
86
|
-
n === "bottom" && /* @__PURE__ */ o(u, { "data-testid": "fieldError", children: r }),
|
|
87
|
-
/* @__PURE__ */ o(N, { offset: 4, children: /* @__PURE__ */ o(
|
|
88
|
-
C,
|
|
89
|
-
{
|
|
90
|
-
items: f,
|
|
91
|
-
renderEmptyState: () => /* @__PURE__ */ o(g, { children: l.format("noResultsFound") }),
|
|
92
|
-
...b,
|
|
93
|
-
children: p
|
|
94
|
-
}
|
|
95
|
-
) })
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
export {
|
|
101
|
-
Y as C
|
|
102
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { c as i } from "./clsx-AexbMWKp.js";
|
|
3
|
-
import { Heading as m } from "react-aria-components";
|
|
4
|
-
import '../assets/Heading.css';const l = "_h1_155q3_1", p = "_h2_155q3_2", q = "_h3_155q3_3", d = "_h4_155q3_4", f = "_h5_155q3_5", g = "_h6_155q3_6", h = {
|
|
5
|
-
h1: l,
|
|
6
|
-
h2: p,
|
|
7
|
-
h3: q,
|
|
8
|
-
h4: d,
|
|
9
|
-
h5: f,
|
|
10
|
-
h6: g
|
|
11
|
-
}, v = ({
|
|
12
|
-
children: _,
|
|
13
|
-
className: a,
|
|
14
|
-
enableMargins: o = !1,
|
|
15
|
-
isExpressive: n = !1,
|
|
16
|
-
level: s = 3,
|
|
17
|
-
elementType: t,
|
|
18
|
-
...e
|
|
19
|
-
}) => {
|
|
20
|
-
const r = t && parseInt(t.split("h")[1]);
|
|
21
|
-
return /* @__PURE__ */ c(
|
|
22
|
-
m,
|
|
23
|
-
{
|
|
24
|
-
level: r || s,
|
|
25
|
-
className: i(
|
|
26
|
-
[h.h1, h.h2, h.h3, h.h4, h.h5, h.h6][s - 1],
|
|
27
|
-
a
|
|
28
|
-
),
|
|
29
|
-
...n && { "data-expressive": !0 },
|
|
30
|
-
...o && { "data-margin": !0 },
|
|
31
|
-
...e,
|
|
32
|
-
children: _
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
export {
|
|
37
|
-
v as H
|
|
38
|
-
};
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { s as C } from "./TextField.module-DmV0iI3P.js";
|
|
4
|
-
import { B as F } from "./Button-CaLOUTDO.js";
|
|
5
|
-
import { C as N } from "./ClearButton-DPm_d7SL.js";
|
|
6
|
-
import { c as l } from "./clsx-AexbMWKp.js";
|
|
7
|
-
import * as x from "react";
|
|
8
|
-
import { useSearchFieldState as j } from "react-stately";
|
|
9
|
-
import { useSearchField as p } from "react-aria";
|
|
10
|
-
import { F as _ } from "./FieldError-BMTrvSof.js";
|
|
11
|
-
import { c as B } from "./createLucideIcon-CP-mMPfa.js";
|
|
12
|
-
import { u as D } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
13
|
-
import '../assets/SearchField.css';const E = [
|
|
14
|
-
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
15
|
-
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
16
|
-
], k = B("search", E), P = "_container_basio_1", T = "_inner_basio_10", w = "_inputContainer_basio_15", I = "_medium_basio_21", K = "_icon_basio_26", L = "_clear_basio_39", M = "_input_basio_15", a = {
|
|
17
|
-
container: P,
|
|
18
|
-
inner: T,
|
|
19
|
-
inputContainer: w,
|
|
20
|
-
medium: I,
|
|
21
|
-
icon: K,
|
|
22
|
-
clear: L,
|
|
23
|
-
input: M
|
|
24
|
-
}, R = { search: "Search" }, V = { search: "Sök" }, O = {
|
|
25
|
-
en: R,
|
|
26
|
-
sv: V
|
|
27
|
-
};
|
|
28
|
-
function $(o) {
|
|
29
|
-
return !!o?.length;
|
|
30
|
-
}
|
|
31
|
-
const Z = ({
|
|
32
|
-
errorPosition: o = "top",
|
|
33
|
-
size: i = "large",
|
|
34
|
-
...e
|
|
35
|
-
}) => {
|
|
36
|
-
const { value: n, setValue: m } = j(e), f = D(O), d = x.useRef(null), { inputProps: r, isInvalid: s, validationErrors: h, clearButtonProps: v } = p(
|
|
37
|
-
{
|
|
38
|
-
...e,
|
|
39
|
-
label: e.placeholder,
|
|
40
|
-
validationBehavior: "native"
|
|
41
|
-
},
|
|
42
|
-
{ value: n, setValue: m },
|
|
43
|
-
d
|
|
44
|
-
), S = ({ target: c }) => m(c.value), g = () => m(""), b = () => {
|
|
45
|
-
if (e.validate && $(e.validate(n)) || s || !n) {
|
|
46
|
-
d.current?.focus();
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
e.onSubmit && e.onSubmit(n);
|
|
50
|
-
}, y = ({ key: c }) => {
|
|
51
|
-
c === "Enter" && b();
|
|
52
|
-
};
|
|
53
|
-
return /* @__PURE__ */ u(
|
|
54
|
-
"div",
|
|
55
|
-
{
|
|
56
|
-
className: l(a.container, e.className),
|
|
57
|
-
"data-disabled": r.disabled,
|
|
58
|
-
children: [
|
|
59
|
-
o === "top" && /* @__PURE__ */ t(_, { isInvalid: s, children: e.errorMessage ?? h.join(" ") }),
|
|
60
|
-
/* @__PURE__ */ u("div", { className: a.inner, children: [
|
|
61
|
-
/* @__PURE__ */ u(
|
|
62
|
-
"div",
|
|
63
|
-
{
|
|
64
|
-
className: l(a.inputContainer, {
|
|
65
|
-
[a.medium]: i === "medium"
|
|
66
|
-
}),
|
|
67
|
-
children: [
|
|
68
|
-
/* @__PURE__ */ t(
|
|
69
|
-
k,
|
|
70
|
-
{
|
|
71
|
-
size: 20,
|
|
72
|
-
className: a.icon
|
|
73
|
-
}
|
|
74
|
-
),
|
|
75
|
-
/* @__PURE__ */ t(
|
|
76
|
-
"input",
|
|
77
|
-
{
|
|
78
|
-
...r,
|
|
79
|
-
...r.disabled && { "data-disabled": !0 },
|
|
80
|
-
className: l(
|
|
81
|
-
C.input,
|
|
82
|
-
a.input,
|
|
83
|
-
r.className,
|
|
84
|
-
{ [a.medium]: i === "medium" }
|
|
85
|
-
),
|
|
86
|
-
ref: d,
|
|
87
|
-
onChange: S,
|
|
88
|
-
value: n,
|
|
89
|
-
"aria-invalid": s,
|
|
90
|
-
onKeyDown: y,
|
|
91
|
-
"aria-label": e.placeholder,
|
|
92
|
-
"aria-labelledby": ""
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
n.length > 0 && /* @__PURE__ */ t(
|
|
96
|
-
N,
|
|
97
|
-
{
|
|
98
|
-
...v,
|
|
99
|
-
onPress: g,
|
|
100
|
-
size: i,
|
|
101
|
-
className: l(a.clear, {
|
|
102
|
-
[a.medium]: i === "medium"
|
|
103
|
-
})
|
|
104
|
-
}
|
|
105
|
-
)
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
),
|
|
109
|
-
/* @__PURE__ */ t(
|
|
110
|
-
F,
|
|
111
|
-
{
|
|
112
|
-
size: i,
|
|
113
|
-
isDisabled: e.isDisabled,
|
|
114
|
-
excludeFromTabOrder: !0,
|
|
115
|
-
onPress: b,
|
|
116
|
-
type: "button",
|
|
117
|
-
children: e.buttonText ? e.buttonText : f.format("search")
|
|
118
|
-
}
|
|
119
|
-
)
|
|
120
|
-
] }),
|
|
121
|
-
o === "bottom" && /* @__PURE__ */ t(_, { isInvalid: s, children: e.errorMessage ?? h.join(" ") })
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
};
|
|
126
|
-
export {
|
|
127
|
-
Z as S
|
|
128
|
-
};
|