mcr-design-systems 1.0.218 → 1.0.220
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.
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import u from "react";
|
|
3
|
-
const
|
|
3
|
+
const M = ({
|
|
4
4
|
size: r = 24,
|
|
5
5
|
color: i = "currentColor",
|
|
6
|
-
className:
|
|
7
|
-
style:
|
|
6
|
+
className: t,
|
|
7
|
+
style: n,
|
|
8
8
|
onClick: o,
|
|
9
|
-
"aria-label":
|
|
10
|
-
title:
|
|
9
|
+
"aria-label": s,
|
|
10
|
+
title: g
|
|
11
11
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
12
|
+
const a = u.useMemo(() => {
|
|
13
|
+
const e = new DOMParser().parseFromString(
|
|
14
|
+
`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
14
15
|
<path d="M7 21.2002V10.7998C7 9.97632 6.99898 9.29843 7.04395 8.74805C7.08988 8.18599 7.18827 7.6689 7.43555 7.1836C7.81902 6.43109 8.43109 5.81902 9.1836 5.43555C9.6689 5.18827 10.186 5.08988 10.748 5.04395C11.2984 4.99898 11.9763 5 12.7998 5H18L18.0986 5.00488C18.3276 5.02757 18.5429 5.12883 18.707 5.29297L24.707 11.293C24.8946 11.4805 25 11.7348 25 12V21.2002C25 22.0237 25.001 22.7016 24.9561 23.252C24.9101 23.814 24.8117 24.3311 24.5645 24.8164C24.181 25.5689 23.5689 26.181 22.8164 26.5645C22.3311 26.8117 21.814 26.9101 21.252 26.9561C20.7016 27.001 20.0237 27 19.2002 27H12.7998C11.9763 27 11.2984 27.001 10.748 26.9561C10.186 26.9101 9.6689 26.8117 9.1836 26.5645C8.43109 26.181 7.81902 25.5689 7.43555 24.8164C7.18827 24.3311 7.08988 23.814 7.04395 23.252C6.99898 22.7016 7 22.0237 7 21.2002ZM20 20C20.5523 20 21 20.4477 21 21C21 21.5523 20.5523 22 20 22H12C11.4477 22 11 21.5523 11 21C11 20.4477 11.4477 20 12 20H20ZM20 16C20.5523 16 21 16.4477 21 17C21 17.5523 20.5523 18 20 18H12C11.4477 18 11 17.5523 11 17C11 16.4477 11.4477 16 12 16H20ZM14 12C14.5523 12 15 12.4477 15 13C15 13.5523 14.5523 14 14 14H12C11.4477 14 11 13.5523 11 13C11 12.4477 11.4477 12 12 12H14ZM9 21.2002C9 22.0566 9.00035 22.6388 9.03711 23.0889C9.07293 23.5273 9.13809 23.7518 9.21778 23.9082C9.40951 24.2845 9.71555 24.5905 10.0918 24.7822C10.2482 24.8619 10.4727 24.9271 10.9111 24.9629C11.3612 24.9997 11.9434 25 12.7998 25H19.2002C20.0566 25 20.6388 24.9997 21.0889 24.9629C21.5273 24.9271 21.7518 24.8619 21.9082 24.7822C22.2845 24.5905 22.5905 24.2845 22.7822 23.9082C22.8619 23.7518 22.9271 23.5273 22.9629 23.0889C22.9997 22.6388 23 22.0566 23 21.2002V13H19.5996C19.3362 13 19.0781 13.0011 18.8613 12.9834C18.6328 12.9647 18.3631 12.9204 18.0918 12.7822C17.7155 12.5905 17.4095 12.2845 17.2178 11.9082C17.0795 11.6369 17.0353 11.3672 17.0166 11.1387C16.9989 10.9218 17 10.6638 17 10.4004V7H12.7998C11.9434 7 11.3612 7.00035 10.9111 7.03711C10.4727 7.07293 10.2482 7.13809 10.0918 7.21778C9.71555 7.40951 9.40951 7.71555 9.21778 8.0918C9.13809 8.2482 9.07293 8.47272 9.03711 8.91113C9.00035 9.36117 9 9.94342 9 10.7998V21.2002ZM19 10.4004C19 10.6967 19.0012 10.859 19.0107 10.9756C19.0111 10.98 19.0114 10.9843 19.0117 10.9883C19.0157 10.9887 19.0199 10.9899 19.0244 10.9902C19.141 10.9998 19.3033 11 19.5996 11H21.5859L19 8.41406V10.4004Z" fill="black"/>
|
|
15
16
|
<path d="M32 26C32 22.6863 29.3137 20 26 20C22.6863 20 20 22.6863 20 26C20 29.3137 22.6863 32 26 32C29.3137 32 32 29.3137 32 26Z" fill="white"/>
|
|
16
17
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M26 20.5C22.9624 20.5 20.5 22.9624 20.5 26C20.5 29.0376 22.9624 31.5 26 31.5C29.0376 31.5 31.5 29.0376 31.5 26C31.5 22.9624 29.0376 20.5 26 20.5ZM26.5 24C26.5 23.7239 26.2761 23.5 26 23.5C25.7239 23.5 25.5 23.7239 25.5 24V26C25.5 26.2761 25.7239 26.5 26 26.5C26.2761 26.5 26.5 26.2761 26.5 26V24ZM26 27.5C25.7239 27.5 25.5 27.7239 25.5 28C25.5 28.2761 25.7239 28.5 26 28.5H26.005C26.2811 28.5 26.505 28.2761 26.505 28C26.505 27.7239 26.2811 27.5 26.005 27.5H26Z" fill="#DC2626"/>
|
|
17
18
|
</svg>
|
|
18
|
-
`,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
`,
|
|
20
|
+
"image/svg+xml"
|
|
21
|
+
).querySelector("svg");
|
|
22
|
+
if (!e) return "";
|
|
23
|
+
if (e.setAttribute("width", r.toString()), e.setAttribute("height", r.toString()), e.querySelectorAll(
|
|
21
24
|
"path, circle, rect, polygon, polyline, line, ellipse"
|
|
22
|
-
).forEach((
|
|
23
|
-
const l =
|
|
24
|
-
l && l !== "none" &&
|
|
25
|
-
}),
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
"class",
|
|
29
|
-
`${e} ${C}`.trim()
|
|
30
|
-
);
|
|
25
|
+
).forEach((C) => {
|
|
26
|
+
const l = C.getAttribute("stroke");
|
|
27
|
+
l && l !== "none" && C.setAttribute("stroke", i);
|
|
28
|
+
}), t) {
|
|
29
|
+
const C = e.getAttribute("class") || "";
|
|
30
|
+
e.setAttribute("class", `${C} ${t}`.trim());
|
|
31
31
|
}
|
|
32
|
-
return new XMLSerializer().serializeToString(
|
|
33
|
-
}, [r, i,
|
|
34
|
-
return /* @__PURE__ */
|
|
32
|
+
return new XMLSerializer().serializeToString(e);
|
|
33
|
+
}, [r, i, t]);
|
|
34
|
+
return /* @__PURE__ */ c(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
|
-
className:
|
|
37
|
+
className: t,
|
|
38
38
|
style: {
|
|
39
39
|
display: "inline-flex",
|
|
40
40
|
alignItems: "center",
|
|
41
41
|
justifyContent: "center",
|
|
42
42
|
flexShrink: 0,
|
|
43
43
|
lineHeight: 0,
|
|
44
|
-
...
|
|
44
|
+
...n
|
|
45
45
|
},
|
|
46
46
|
onClick: o,
|
|
47
|
-
"aria-label":
|
|
48
|
-
title:
|
|
49
|
-
dangerouslySetInnerHTML: { __html:
|
|
47
|
+
"aria-label": s || "file-error icon",
|
|
48
|
+
title: g,
|
|
49
|
+
dangerouslySetInnerHTML: { __html: a }
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
};
|
|
53
53
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
M as FileErrorIcon,
|
|
55
|
+
M as default
|
|
56
56
|
};
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import u from "react";
|
|
3
|
+
const v = ({
|
|
4
4
|
size: r = 24,
|
|
5
5
|
color: i = "currentColor",
|
|
6
|
-
className:
|
|
7
|
-
style:
|
|
8
|
-
onClick:
|
|
9
|
-
"aria-label":
|
|
10
|
-
title:
|
|
6
|
+
className: t,
|
|
7
|
+
style: s,
|
|
8
|
+
onClick: n,
|
|
9
|
+
"aria-label": o,
|
|
10
|
+
title: c
|
|
11
11
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
12
|
+
const g = u.useMemo(() => {
|
|
13
|
+
const e = new DOMParser().parseFromString(
|
|
14
|
+
`<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
14
15
|
<path d="M7 21.2002V10.7998C7 9.97632 6.99898 9.29843 7.04395 8.74805C7.08988 8.18599 7.18827 7.6689 7.43555 7.1836C7.81902 6.43109 8.43109 5.81902 9.1836 5.43555C9.6689 5.18827 10.186 5.08988 10.748 5.04395C11.2984 4.99898 11.9763 5 12.7998 5H18L18.0986 5.00488C18.3276 5.02757 18.5429 5.12883 18.707 5.29297L24.707 11.293C24.8946 11.4805 25 11.7348 25 12V21.2002C25 22.0237 25.001 22.7016 24.9561 23.252C24.9101 23.814 24.8117 24.3311 24.5645 24.8164C24.181 25.5689 23.5689 26.181 22.8164 26.5645C22.3311 26.8117 21.814 26.9101 21.252 26.9561C20.7016 27.001 20.0237 27 19.2002 27H12.7998C11.9763 27 11.2984 27.001 10.748 26.9561C10.186 26.9101 9.6689 26.8117 9.1836 26.5645C8.43109 26.181 7.81902 25.5689 7.43555 24.8164C7.18827 24.3311 7.08988 23.814 7.04395 23.252C6.99898 22.7016 7 22.0237 7 21.2002ZM20 20C20.5523 20 21 20.4477 21 21C21 21.5523 20.5523 22 20 22H12C11.4477 22 11 21.5523 11 21C11 20.4477 11.4477 20 12 20H20ZM20 16C20.5523 16 21 16.4477 21 17C21 17.5523 20.5523 18 20 18H12C11.4477 18 11 17.5523 11 17C11 16.4477 11.4477 16 12 16H20ZM14 12C14.5523 12 15 12.4477 15 13C15 13.5523 14.5523 14 14 14H12C11.4477 14 11 13.5523 11 13C11 12.4477 11.4477 12 12 12H14ZM9 21.2002C9 22.0566 9.00035 22.6388 9.03711 23.0889C9.07293 23.5273 9.13809 23.7518 9.21778 23.9082C9.40951 24.2845 9.71555 24.5905 10.0918 24.7822C10.2482 24.8619 10.4727 24.9271 10.9111 24.9629C11.3612 24.9997 11.9434 25 12.7998 25H19.2002C20.0566 25 20.6388 24.9997 21.0889 24.9629C21.5273 24.9271 21.7518 24.8619 21.9082 24.7822C22.2845 24.5905 22.5905 24.2845 22.7822 23.9082C22.8619 23.7518 22.9271 23.5273 22.9629 23.0889C22.9997 22.6388 23 22.0566 23 21.2002V13H19.5996C19.3362 13 19.0781 13.0011 18.8613 12.9834C18.6328 12.9647 18.3631 12.9204 18.0918 12.7822C17.7155 12.5905 17.4095 12.2845 17.2178 11.9082C17.0795 11.6369 17.0353 11.3672 17.0166 11.1387C16.9989 10.9218 17 10.6638 17 10.4004V7H12.7998C11.9434 7 11.3612 7.00035 10.9111 7.03711C10.4727 7.07293 10.2482 7.13809 10.0918 7.21778C9.71555 7.40951 9.40951 7.71555 9.21778 8.0918C9.13809 8.2482 9.07293 8.47272 9.03711 8.91113C9.00035 9.36117 9 9.94342 9 10.7998V21.2002ZM19 10.4004C19 10.6967 19.0012 10.859 19.0107 10.9756C19.0111 10.98 19.0114 10.9843 19.0117 10.9883C19.0157 10.9887 19.0199 10.9899 19.0244 10.9902C19.141 10.9998 19.3033 11 19.5996 11H21.5859L19 8.41406V10.4004Z" fill="black"/>
|
|
15
16
|
<path d="M32 26C32 29.3137 29.3137 32 26 32C22.6863 32 20 29.3137 20 26C20 22.6863 22.6863 20 26 20C29.3137 20 32 22.6863 32 26Z" fill="white"/>
|
|
16
17
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M26 20.5C22.9624 20.5 20.5 22.9624 20.5 26C20.5 29.0376 22.9624 31.5 26 31.5C29.0376 31.5 31.5 29.0376 31.5 26C31.5 22.9624 29.0376 20.5 26 20.5ZM28.6036 24.8536C28.7988 24.6583 28.7988 24.3417 28.6036 24.1464C28.4083 23.9512 28.0917 23.9512 27.8964 24.1464L25.25 26.7929L24.1036 25.6464C23.9083 25.4512 23.5917 25.4512 23.3964 25.6464C23.2012 25.8417 23.2012 26.1583 23.3964 26.3536L24.8964 27.8536C25.0917 28.0488 25.4083 28.0488 25.6036 27.8536L28.6036 24.8536Z" fill="#16A34A"/>
|
|
17
18
|
</svg>
|
|
18
|
-
`,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
`,
|
|
20
|
+
"image/svg+xml"
|
|
21
|
+
).querySelector("svg");
|
|
22
|
+
if (!e) return "";
|
|
23
|
+
if (e.setAttribute("width", r.toString()), e.setAttribute("height", r.toString()), e.querySelectorAll(
|
|
21
24
|
"path, circle, rect, polygon, polyline, line, ellipse"
|
|
22
|
-
).forEach((
|
|
23
|
-
const l =
|
|
24
|
-
l && l !== "none" &&
|
|
25
|
-
}),
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
"class",
|
|
29
|
-
`${e} ${C}`.trim()
|
|
30
|
-
);
|
|
25
|
+
).forEach((C) => {
|
|
26
|
+
const l = C.getAttribute("stroke");
|
|
27
|
+
l && l !== "none" && C.setAttribute("stroke", i);
|
|
28
|
+
}), t) {
|
|
29
|
+
const C = e.getAttribute("class") || "";
|
|
30
|
+
e.setAttribute("class", `${C} ${t}`.trim());
|
|
31
31
|
}
|
|
32
|
-
return new XMLSerializer().serializeToString(
|
|
33
|
-
}, [r, i,
|
|
34
|
-
return /* @__PURE__ */
|
|
32
|
+
return new XMLSerializer().serializeToString(e);
|
|
33
|
+
}, [r, i, t]);
|
|
34
|
+
return /* @__PURE__ */ a(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
|
-
className:
|
|
37
|
+
className: t,
|
|
38
38
|
style: {
|
|
39
39
|
display: "inline-flex",
|
|
40
40
|
alignItems: "center",
|
|
41
41
|
justifyContent: "center",
|
|
42
42
|
flexShrink: 0,
|
|
43
43
|
lineHeight: 0,
|
|
44
|
-
...
|
|
44
|
+
...s
|
|
45
45
|
},
|
|
46
|
-
onClick:
|
|
47
|
-
"aria-label":
|
|
48
|
-
title:
|
|
49
|
-
dangerouslySetInnerHTML: { __html:
|
|
46
|
+
onClick: n,
|
|
47
|
+
"aria-label": o || "file-success icon",
|
|
48
|
+
title: c,
|
|
49
|
+
dangerouslySetInnerHTML: { __html: g }
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
};
|
|
53
53
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
v as FileSuccessIcon,
|
|
55
|
+
v as default
|
|
56
56
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsxs as g, jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as g, jsx as t, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ke, useState as je, useRef as De, useCallback as T, useMemo as P, memo as Ee } from "react";
|
|
3
3
|
import { cn as f } from "../../shared/utils/cn.js";
|
|
4
|
-
import { dataTestId as
|
|
4
|
+
import { dataTestId as Fe } from "../../shared/utils/dataTestId.js";
|
|
5
5
|
import { Typography as z } from "../Typography/index.js";
|
|
6
6
|
import y from "../Icon/Icon.js";
|
|
7
7
|
import { Dropdown as ce } from "../Dropdown/index.js";
|
|
8
|
-
import { selectVariants as
|
|
8
|
+
import { selectVariants as Pe } from "./helper/variants.js";
|
|
9
9
|
import me from "../Chip/index.js";
|
|
10
|
-
import
|
|
11
|
-
import { useChipOverflow as
|
|
12
|
-
const pe =
|
|
10
|
+
import ze from "../TextField/HelperText.js";
|
|
11
|
+
import { useChipOverflow as Ve } from "../../shared/hooks/useChipOverflow.js";
|
|
12
|
+
const pe = ke(
|
|
13
13
|
({
|
|
14
14
|
items: S = [],
|
|
15
|
-
value:
|
|
15
|
+
value: r,
|
|
16
16
|
onChange: b,
|
|
17
17
|
placeholder: x = "Select an option...",
|
|
18
18
|
disabled: a = !1,
|
|
@@ -20,18 +20,18 @@ const pe = Te(
|
|
|
20
20
|
loading: V = !1,
|
|
21
21
|
showCheckmark: q = !1,
|
|
22
22
|
emptyText: G = "No options available",
|
|
23
|
-
state:
|
|
23
|
+
state: ue,
|
|
24
24
|
label: J,
|
|
25
|
-
helpText:
|
|
26
|
-
required:
|
|
25
|
+
helpText: fe,
|
|
26
|
+
required: he = !1,
|
|
27
27
|
leadingIcon: c,
|
|
28
28
|
trailingIcon: m,
|
|
29
29
|
mode: l = "single",
|
|
30
|
-
displayType:
|
|
31
|
-
maxDisplayChips:
|
|
30
|
+
displayType: de = "chip",
|
|
31
|
+
maxDisplayChips: qe,
|
|
32
32
|
// eslint-disable-line @typescript-eslint/no-unused-vars -- kept for backward compatibility
|
|
33
|
-
moreItemsText:
|
|
34
|
-
trigger:
|
|
33
|
+
moreItemsText: ge = "+{count}",
|
|
34
|
+
trigger: xe,
|
|
35
35
|
side: K = "bottom",
|
|
36
36
|
align: L = "start",
|
|
37
37
|
sideOffset: Q = 4,
|
|
@@ -39,46 +39,46 @@ const pe = Te(
|
|
|
39
39
|
itemHeight: W = 32,
|
|
40
40
|
maxHeight: X = 300,
|
|
41
41
|
size: n = "md",
|
|
42
|
-
variant:
|
|
43
|
-
fullWidth:
|
|
44
|
-
className:
|
|
45
|
-
iconsSize:
|
|
42
|
+
variant: k = "default",
|
|
43
|
+
fullWidth: j = !1,
|
|
44
|
+
className: Ne,
|
|
45
|
+
iconsSize: ve,
|
|
46
46
|
"data-testid": i,
|
|
47
47
|
width: A,
|
|
48
48
|
error: Y,
|
|
49
|
-
haveIcon:
|
|
50
|
-
iconsCustom:
|
|
49
|
+
haveIcon: Ce,
|
|
50
|
+
iconsCustom: ye,
|
|
51
51
|
onBlur: Z,
|
|
52
52
|
dropdownProps: _,
|
|
53
53
|
allowSearch: H,
|
|
54
|
-
title:
|
|
54
|
+
title: D,
|
|
55
55
|
onSearchChange: B,
|
|
56
56
|
searchValue: I,
|
|
57
57
|
showClearButton: O = !1,
|
|
58
58
|
searchPlaceholder: ee = "Search...",
|
|
59
59
|
allItems: $,
|
|
60
|
-
...
|
|
61
|
-
},
|
|
62
|
-
const [p, R] =
|
|
60
|
+
...be
|
|
61
|
+
}, Ae) => {
|
|
62
|
+
const [p, R] = je(!1), we = De(null), E = Y ? "error" : ue, o = Pe({
|
|
63
63
|
size: n,
|
|
64
|
-
variant:
|
|
65
|
-
fullWidth:
|
|
66
|
-
state:
|
|
64
|
+
variant: k,
|
|
65
|
+
fullWidth: j,
|
|
66
|
+
state: E,
|
|
67
67
|
disabled: a,
|
|
68
68
|
readOnly: s
|
|
69
|
-
}),
|
|
69
|
+
}), Me = T(
|
|
70
70
|
(e) => {
|
|
71
|
-
if (l === "multiple" && Array.isArray(
|
|
72
|
-
const h =
|
|
71
|
+
if (l === "multiple" && Array.isArray(r) && !a && !s) {
|
|
72
|
+
const h = r.filter((d) => d !== e);
|
|
73
73
|
b?.(h);
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
|
-
[l,
|
|
77
|
-
),
|
|
78
|
-
l === "multiple" && Array.isArray(
|
|
79
|
-
}, [l,
|
|
80
|
-
if (!
|
|
81
|
-
const e = Array.isArray(
|
|
76
|
+
[l, r, b, a, s]
|
|
77
|
+
), te = T(() => {
|
|
78
|
+
l === "multiple" && Array.isArray(r) && r.length > 0 && !a && !s && b?.([]);
|
|
79
|
+
}, [l, r, b, a, s]), u = P(() => {
|
|
80
|
+
if (!r) return [];
|
|
81
|
+
const e = Array.isArray(r) ? r : [r], h = $ && $.length > 0 ? $ : S, d = /* @__PURE__ */ new Map();
|
|
82
82
|
return ((M) => {
|
|
83
83
|
M.forEach((C) => {
|
|
84
84
|
"items" in C ? C.items.forEach((le) => {
|
|
@@ -92,14 +92,14 @@ const pe = Te(
|
|
|
92
92
|
label: M
|
|
93
93
|
};
|
|
94
94
|
});
|
|
95
|
-
}, [
|
|
95
|
+
}, [r, S, $]), F = P(() => {
|
|
96
96
|
if (l === "single") {
|
|
97
97
|
const e = u[0];
|
|
98
98
|
return e ? e.label : x;
|
|
99
99
|
}
|
|
100
|
-
return l === "multiple" ?
|
|
101
|
-
}, [l, u, x,
|
|
102
|
-
items: l === "multiple" && Array.isArray(
|
|
100
|
+
return l === "multiple" ? r?.length === 0 ? x : D ? `${D} ` : "" : "";
|
|
101
|
+
}, [l, u, x, D, r]), N = Ve({
|
|
102
|
+
items: l === "multiple" && Array.isArray(r) ? u.map((e) => ({
|
|
103
103
|
value: e.value,
|
|
104
104
|
label: e.label
|
|
105
105
|
})) : [],
|
|
@@ -109,7 +109,7 @@ const pe = Te(
|
|
|
109
109
|
moreChipWidth: 60
|
|
110
110
|
// Estimated width for "+X more" chip
|
|
111
111
|
}), w = P(() => {
|
|
112
|
-
if (l !== "multiple" || !Array.isArray(
|
|
112
|
+
if (l !== "multiple" || !Array.isArray(r))
|
|
113
113
|
return {
|
|
114
114
|
displayItems: [],
|
|
115
115
|
remainingCount: 0,
|
|
@@ -132,12 +132,12 @@ const pe = Te(
|
|
|
132
132
|
} : h;
|
|
133
133
|
}, [
|
|
134
134
|
l,
|
|
135
|
-
|
|
135
|
+
r,
|
|
136
136
|
N.displayItems,
|
|
137
137
|
N.remainingCount,
|
|
138
138
|
N.hasMore,
|
|
139
139
|
u
|
|
140
|
-
]),
|
|
140
|
+
]), Se = A ? { width: typeof A == "number" ? `${A}px` : A } : {}, $e = f(o.container(), Ne), v = (e) => {
|
|
141
141
|
switch (e) {
|
|
142
142
|
case "sm":
|
|
143
143
|
return 16;
|
|
@@ -148,7 +148,7 @@ const pe = Te(
|
|
|
148
148
|
default:
|
|
149
149
|
return 16;
|
|
150
150
|
}
|
|
151
|
-
},
|
|
151
|
+
}, re = (e) => {
|
|
152
152
|
switch (e) {
|
|
153
153
|
case "sm":
|
|
154
154
|
return "small";
|
|
@@ -169,13 +169,13 @@ const pe = Te(
|
|
|
169
169
|
R(e), !e && Z && Z(
|
|
170
170
|
new FocusEvent("blur")
|
|
171
171
|
);
|
|
172
|
-
},
|
|
172
|
+
}, Re = () => /* @__PURE__ */ g(
|
|
173
173
|
"div",
|
|
174
174
|
{
|
|
175
175
|
className: o.trigger(),
|
|
176
176
|
"data-state": p ? "open" : "closed",
|
|
177
177
|
children: [
|
|
178
|
-
c && /* @__PURE__ */
|
|
178
|
+
c && /* @__PURE__ */ t("span", { className: o.leadingIcon(), children: c.node || c.name && /* @__PURE__ */ t(
|
|
179
179
|
y,
|
|
180
180
|
{
|
|
181
181
|
name: c.name,
|
|
@@ -183,7 +183,7 @@ const pe = Te(
|
|
|
183
183
|
"aria-label": c["aria-label"]
|
|
184
184
|
}
|
|
185
185
|
) }),
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ t(
|
|
187
187
|
"span",
|
|
188
188
|
{
|
|
189
189
|
className: f(
|
|
@@ -193,14 +193,14 @@ const pe = Te(
|
|
|
193
193
|
children: F
|
|
194
194
|
}
|
|
195
195
|
),
|
|
196
|
-
m ? /* @__PURE__ */
|
|
196
|
+
m ? /* @__PURE__ */ t("span", { className: o.trailingIcon(), children: m.node || m.name && /* @__PURE__ */ t(
|
|
197
197
|
y,
|
|
198
198
|
{
|
|
199
199
|
name: m.name,
|
|
200
200
|
size: v(n),
|
|
201
201
|
"aria-label": m["aria-label"]
|
|
202
202
|
}
|
|
203
|
-
) }) : /* @__PURE__ */
|
|
203
|
+
) }) : /* @__PURE__ */ t(
|
|
204
204
|
y,
|
|
205
205
|
{
|
|
206
206
|
name: p ? "chevron-up" : "chevron-down",
|
|
@@ -214,22 +214,22 @@ const pe = Te(
|
|
|
214
214
|
return /* @__PURE__ */ g(
|
|
215
215
|
"div",
|
|
216
216
|
{
|
|
217
|
-
ref:
|
|
218
|
-
className:
|
|
219
|
-
style:
|
|
220
|
-
...
|
|
221
|
-
...
|
|
217
|
+
ref: Ae,
|
|
218
|
+
className: $e,
|
|
219
|
+
style: Se,
|
|
220
|
+
...Fe(i || "select"),
|
|
221
|
+
...be,
|
|
222
222
|
children: [
|
|
223
223
|
J && /* @__PURE__ */ g("div", { className: "mb-1 flex items-center gap-[2px]", children: [
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
|
|
224
|
+
/* @__PURE__ */ t(z, { variants: "action", size: "sm", color: "fg-neutral-subtle", children: J }),
|
|
225
|
+
he && /* @__PURE__ */ t(z, { variants: "action", size: "sm", color: "fg-accent-error", children: "*" })
|
|
226
226
|
] }),
|
|
227
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ t("div", { className: "relative h-11", children: l === "multiple" ? /* @__PURE__ */ t(
|
|
228
228
|
ce,
|
|
229
229
|
{
|
|
230
230
|
..._,
|
|
231
231
|
items: S,
|
|
232
|
-
value:
|
|
232
|
+
value: r,
|
|
233
233
|
onValueChange: (e) => {
|
|
234
234
|
a || s || b?.(Array.isArray(e) ? e : [e]);
|
|
235
235
|
},
|
|
@@ -239,7 +239,7 @@ const pe = Te(
|
|
|
239
239
|
loading: V,
|
|
240
240
|
showCheckmark: q,
|
|
241
241
|
emptyText: G,
|
|
242
|
-
state:
|
|
242
|
+
state: E,
|
|
243
243
|
open: p,
|
|
244
244
|
onOpenChange: ne,
|
|
245
245
|
side: K,
|
|
@@ -252,33 +252,28 @@ const pe = Te(
|
|
|
252
252
|
itemHeight: W,
|
|
253
253
|
maxHeight: X,
|
|
254
254
|
size: n,
|
|
255
|
-
variant:
|
|
256
|
-
fullWidth:
|
|
255
|
+
variant: k,
|
|
256
|
+
fullWidth: j,
|
|
257
257
|
searchPlaceholder: ee,
|
|
258
258
|
width: A,
|
|
259
259
|
"data-testid": i ? `${i}-dropdown` : void 0,
|
|
260
260
|
showClearButton: O,
|
|
261
|
-
onClear:
|
|
261
|
+
onClear: te,
|
|
262
262
|
searchValue: I,
|
|
263
263
|
onSearchChange: B,
|
|
264
264
|
className: "flex items-center",
|
|
265
265
|
children: /* @__PURE__ */ g(
|
|
266
266
|
"div",
|
|
267
267
|
{
|
|
268
|
-
ref:
|
|
269
|
-
className: f(
|
|
270
|
-
o.trigger({
|
|
271
|
-
state: Y ? "error" : void 0
|
|
272
|
-
}),
|
|
273
|
-
"flex"
|
|
274
|
-
),
|
|
268
|
+
ref: we,
|
|
269
|
+
className: f(o.trigger(), "flex"),
|
|
275
270
|
"data-state": p ? "open" : "closed",
|
|
276
271
|
onPointerDown: se,
|
|
277
272
|
onClick: (e) => {
|
|
278
273
|
a || s || se(e) || R(!p);
|
|
279
274
|
},
|
|
280
275
|
children: [
|
|
281
|
-
c && /* @__PURE__ */
|
|
276
|
+
c && /* @__PURE__ */ t("span", { className: o.leadingIcon(), children: c.node || c.name && /* @__PURE__ */ t(
|
|
282
277
|
y,
|
|
283
278
|
{
|
|
284
279
|
name: c.name,
|
|
@@ -287,19 +282,19 @@ const pe = Te(
|
|
|
287
282
|
className: "cursor-pointer"
|
|
288
283
|
}
|
|
289
284
|
) }),
|
|
290
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ t(
|
|
291
286
|
"div",
|
|
292
287
|
{
|
|
293
288
|
className: f(
|
|
294
289
|
"flex-1 flex flex-nowrap gap-1 min-h-0 overflow-hidden",
|
|
295
290
|
!a && !s && "cursor-pointer"
|
|
296
291
|
),
|
|
297
|
-
children: Array.isArray(w) ? null : /* @__PURE__ */
|
|
292
|
+
children: Array.isArray(w) ? null : /* @__PURE__ */ t(ie, { children: de === "chip" ? /* @__PURE__ */ t(
|
|
298
293
|
"div",
|
|
299
294
|
{
|
|
300
295
|
ref: N.containerRef,
|
|
301
296
|
className: "flex items-center gap-xs-3 flex-nowrap w-full max-w-full overflow-hidden",
|
|
302
|
-
children: w.displayItems.length === 0 && !w.hasMore ? /* @__PURE__ */
|
|
297
|
+
children: w.displayItems.length === 0 && !w.hasMore ? /* @__PURE__ */ t(
|
|
303
298
|
"div",
|
|
304
299
|
{
|
|
305
300
|
className: f(
|
|
@@ -309,12 +304,12 @@ const pe = Te(
|
|
|
309
304
|
children: x
|
|
310
305
|
}
|
|
311
306
|
) : /* @__PURE__ */ g(ie, { children: [
|
|
312
|
-
w.displayItems.map((e) => /* @__PURE__ */
|
|
307
|
+
w.displayItems.map((e) => /* @__PURE__ */ t(
|
|
313
308
|
me,
|
|
314
309
|
{
|
|
315
|
-
size:
|
|
310
|
+
size: re(n),
|
|
316
311
|
onRemove: !a && !s ? () => {
|
|
317
|
-
|
|
312
|
+
Me(e.value);
|
|
318
313
|
} : void 0,
|
|
319
314
|
className: "bg-bg-surface-level-3 flex-shrink-0",
|
|
320
315
|
variant: "neutral",
|
|
@@ -328,15 +323,15 @@ const pe = Te(
|
|
|
328
323
|
},
|
|
329
324
|
e.value
|
|
330
325
|
)),
|
|
331
|
-
w.hasMore && /* @__PURE__ */
|
|
326
|
+
w.hasMore && /* @__PURE__ */ t(
|
|
332
327
|
me,
|
|
333
328
|
{
|
|
334
|
-
size:
|
|
329
|
+
size: re(n),
|
|
335
330
|
variant: "neutral",
|
|
336
331
|
className: "bg-bg-surface-level-3 flex-shrink-0",
|
|
337
332
|
dataTestIdName: `${i || "select"}-chip-more`,
|
|
338
333
|
onClick: (e) => e.stopPropagation(),
|
|
339
|
-
children:
|
|
334
|
+
children: ge.replace(
|
|
340
335
|
"{count}",
|
|
341
336
|
w.remainingCount.toString()
|
|
342
337
|
)
|
|
@@ -346,14 +341,14 @@ const pe = Te(
|
|
|
346
341
|
}
|
|
347
342
|
) : (
|
|
348
343
|
// Default display mode - show summary text
|
|
349
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ t(
|
|
350
345
|
"div",
|
|
351
346
|
{
|
|
352
347
|
className: f(
|
|
353
348
|
o.placeholder(),
|
|
354
349
|
!a && !s && "cursor-pointer"
|
|
355
350
|
),
|
|
356
|
-
children: Array.isArray(
|
|
351
|
+
children: Array.isArray(r) ? r?.length > 0 ? /* @__PURE__ */ g(
|
|
357
352
|
z,
|
|
358
353
|
{
|
|
359
354
|
variants: "body",
|
|
@@ -363,7 +358,7 @@ const pe = Te(
|
|
|
363
358
|
F,
|
|
364
359
|
/* @__PURE__ */ g("span", { className: "text-fg-brand-rest", children: [
|
|
365
360
|
"(",
|
|
366
|
-
|
|
361
|
+
r?.length,
|
|
367
362
|
")"
|
|
368
363
|
] })
|
|
369
364
|
]
|
|
@@ -375,12 +370,12 @@ const pe = Te(
|
|
|
375
370
|
}
|
|
376
371
|
),
|
|
377
372
|
/* @__PURE__ */ g("div", { className: "flex items-center gap-xs", children: [
|
|
378
|
-
Array.isArray(
|
|
373
|
+
Array.isArray(r) && r.length > 0 && /* @__PURE__ */ t(
|
|
379
374
|
"button",
|
|
380
375
|
{
|
|
381
376
|
type: "button",
|
|
382
377
|
onClick: (e) => {
|
|
383
|
-
e.stopPropagation(),
|
|
378
|
+
e.stopPropagation(), te();
|
|
384
379
|
},
|
|
385
380
|
className: f(
|
|
386
381
|
"flex items-center justify-center rounded-sm transition-colors",
|
|
@@ -391,7 +386,7 @@ const pe = Te(
|
|
|
391
386
|
"aria-label": "Clear all selections",
|
|
392
387
|
"data-testid": i ? `${i}-clear-all` : void 0,
|
|
393
388
|
"data-no-trigger": "true",
|
|
394
|
-
children: /* @__PURE__ */
|
|
389
|
+
children: /* @__PURE__ */ t(
|
|
395
390
|
y,
|
|
396
391
|
{
|
|
397
392
|
name: "x-circle",
|
|
@@ -402,7 +397,7 @@ const pe = Te(
|
|
|
402
397
|
)
|
|
403
398
|
}
|
|
404
399
|
),
|
|
405
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ t(
|
|
406
401
|
"button",
|
|
407
402
|
{
|
|
408
403
|
type: "button",
|
|
@@ -414,14 +409,14 @@ const pe = Te(
|
|
|
414
409
|
!a && !s && "cursor-pointer"
|
|
415
410
|
),
|
|
416
411
|
"data-testid": i ? `${i}-dropdown-toggle` : "dropdown-toggle",
|
|
417
|
-
children: m ? /* @__PURE__ */
|
|
412
|
+
children: m ? /* @__PURE__ */ t("span", { className: o.trailingIcon(), children: m.node || m.name && /* @__PURE__ */ t(
|
|
418
413
|
y,
|
|
419
414
|
{
|
|
420
415
|
name: m.name,
|
|
421
416
|
size: v(n),
|
|
422
417
|
"aria-label": m["aria-label"]
|
|
423
418
|
}
|
|
424
|
-
) }) : /* @__PURE__ */
|
|
419
|
+
) }) : /* @__PURE__ */ t(
|
|
425
420
|
y,
|
|
426
421
|
{
|
|
427
422
|
name: p ? "chevron-up" : "chevron-down",
|
|
@@ -441,12 +436,12 @@ const pe = Te(
|
|
|
441
436
|
}
|
|
442
437
|
) : (
|
|
443
438
|
/* Single mode - use Dropdown normally */
|
|
444
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ t(
|
|
445
440
|
ce,
|
|
446
441
|
{
|
|
447
442
|
..._,
|
|
448
443
|
items: S,
|
|
449
|
-
value:
|
|
444
|
+
value: r,
|
|
450
445
|
onValueChange: (e) => {
|
|
451
446
|
a || s || (b?.(e), R(!1));
|
|
452
447
|
},
|
|
@@ -455,7 +450,7 @@ const pe = Te(
|
|
|
455
450
|
loading: V,
|
|
456
451
|
showCheckmark: q,
|
|
457
452
|
emptyText: G,
|
|
458
|
-
state:
|
|
453
|
+
state: E,
|
|
459
454
|
open: p,
|
|
460
455
|
onOpenChange: ne,
|
|
461
456
|
side: K,
|
|
@@ -465,8 +460,8 @@ const pe = Te(
|
|
|
465
460
|
itemHeight: W,
|
|
466
461
|
maxHeight: X,
|
|
467
462
|
size: n,
|
|
468
|
-
variant:
|
|
469
|
-
fullWidth:
|
|
463
|
+
variant: k,
|
|
464
|
+
fullWidth: j,
|
|
470
465
|
width: A,
|
|
471
466
|
"data-testid": i ? `${i}-dropdown` : void 0,
|
|
472
467
|
search: H,
|
|
@@ -474,19 +469,19 @@ const pe = Te(
|
|
|
474
469
|
searchValue: I,
|
|
475
470
|
onSearchChange: B,
|
|
476
471
|
showClearButton: O,
|
|
477
|
-
children:
|
|
472
|
+
children: xe || Re()
|
|
478
473
|
}
|
|
479
474
|
)
|
|
480
475
|
) }),
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
-
|
|
476
|
+
/* @__PURE__ */ t(
|
|
477
|
+
ze,
|
|
483
478
|
{
|
|
484
479
|
className: "mt-1",
|
|
485
|
-
text:
|
|
480
|
+
text: fe,
|
|
486
481
|
error: Y,
|
|
487
|
-
haveIcon:
|
|
488
|
-
iconsSize:
|
|
489
|
-
iconsCustom:
|
|
482
|
+
haveIcon: Ce,
|
|
483
|
+
iconsSize: ve,
|
|
484
|
+
iconsCustom: ye
|
|
490
485
|
}
|
|
491
486
|
)
|
|
492
487
|
]
|
|
@@ -495,7 +490,7 @@ const pe = Te(
|
|
|
495
490
|
}
|
|
496
491
|
);
|
|
497
492
|
pe.displayName = "Select";
|
|
498
|
-
const
|
|
493
|
+
const He = Ee(pe);
|
|
499
494
|
export {
|
|
500
|
-
|
|
495
|
+
He as default
|
|
501
496
|
};
|