asma-ui-core 3.115.0 → 3.116.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/dist/asma-ui-core.css +1 -1
- package/dist/components/data-display/chip/StyledChip.js +1 -0
- package/dist/components/inputs/full-screen-picker/FullScreenPicker.js +15 -15
- package/dist/components/inputs/full-screen-picker/pickerCopy.js +4 -6
- package/dist/components/inputs/phone-field/CountryCodeOptions.js +31 -24
- package/dist/components/inputs/phone-field/CountryCodeSelect.js +2 -1
- package/dist/components/inputs/select-autocomplete/SelectAutocompletePicker.js +125 -123
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +177 -172
- package/dist/hooks/useMediaQuery.hook.js +8 -7
- package/dist/src/components/inputs/full-screen-picker/FullScreenPicker.d.ts +2 -1
- package/dist/src/components/inputs/full-screen-picker/pickerCopy.d.ts +0 -1
- package/dist/src/components/inputs/phone-field/CountryCodeOptions.d.ts +3 -1
- package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +1 -0
- package/dist/src/hooks/useMediaQuery.hook.d.ts +8 -0
- package/dist/tailwind.config.d.ts +3 -0
- package/package.json +1 -1
|
@@ -24,6 +24,7 @@ var Y = ({ readOnly: m, disabled: a, interactive: e, focusableDisabled: o, tabIn
|
|
|
24
24
|
}, U = S(u, "width"), q = S(u, "max-width"), A = /* @__PURE__ */ X("div", {
|
|
25
25
|
ref: W,
|
|
26
26
|
"data-testid": m,
|
|
27
|
+
"data-chip": "",
|
|
27
28
|
"aria-label": N,
|
|
28
29
|
"data-hovered": K,
|
|
29
30
|
"data-focus": P,
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { CloseIcon as w } from "../../icons/close-icon/CloseIcon.js";
|
|
2
2
|
import { StyledButton as y } from "../button/StyledButton.js";
|
|
3
|
-
import {
|
|
3
|
+
import { usePickerOneRowHeaderMediaQuery as g } from "../../../hooks/useMediaQuery.hook.js";
|
|
4
4
|
import { StyledDialog as k } from "../../feedback/dialog/StyledDialog.js";
|
|
5
5
|
import { PickerLiveRegion as N } from "./PickerLiveRegion.js";
|
|
6
6
|
import { isKeyboardModality as S, trackInputModality as I } from "./inputModality.js";
|
|
7
7
|
import { useVisualViewportHeight as R } from "./useVisualViewportHeight.js";
|
|
8
|
-
import { useEffect as
|
|
8
|
+
import { useEffect as p, useRef as x } from "react";
|
|
9
9
|
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
10
|
-
var B = ({ open: o, onClose:
|
|
10
|
+
var B = ({ open: o, onClose: i, dataTest: t, title: r, fallbackName: a, ...n }) => {
|
|
11
11
|
const l = r != null && r !== !1 && r !== "";
|
|
12
|
-
return
|
|
12
|
+
return p(I, []), /* @__PURE__ */ e(k, {
|
|
13
13
|
open: o,
|
|
14
|
-
onClose: (f, s) =>
|
|
15
|
-
dataTest:
|
|
14
|
+
onClose: (f, s) => i(s),
|
|
15
|
+
dataTest: t,
|
|
16
16
|
fullScreen: !0,
|
|
17
17
|
showCloseIcon: !1,
|
|
18
18
|
ariaLabel: l ? void 0 : a,
|
|
19
|
-
children: /* @__PURE__ */ e(
|
|
19
|
+
children: /* @__PURE__ */ e(P, {
|
|
20
20
|
...n,
|
|
21
|
-
dataTest:
|
|
21
|
+
dataTest: t,
|
|
22
22
|
title: l ? r : void 0,
|
|
23
|
-
onClose:
|
|
23
|
+
onClose: i
|
|
24
24
|
})
|
|
25
25
|
});
|
|
26
|
-
},
|
|
27
|
-
const s = g(), v = R(), c =
|
|
28
|
-
return
|
|
26
|
+
}, P = ({ dataTest: o, title: i, closeLabel: t, search: r, headerRow: a, children: n, announcement: l, onClose: f }) => {
|
|
27
|
+
const s = g(), v = R(), c = x(null), u = x(null);
|
|
28
|
+
return p(() => {
|
|
29
29
|
const b = requestAnimationFrame(() => {
|
|
30
30
|
const h = c.current?.closest("dialog");
|
|
31
31
|
if (!h || document.activeElement !== h || !S()) return;
|
|
@@ -44,9 +44,9 @@ var B = ({ open: o, onClose: t, dataTest: i, title: r, fallbackName: a, ...n })
|
|
|
44
44
|
/* @__PURE__ */ m("div", {
|
|
45
45
|
className: "flex items-start gap-2",
|
|
46
46
|
children: [
|
|
47
|
-
|
|
47
|
+
i !== void 0 && /* @__PURE__ */ e("h2", {
|
|
48
48
|
className: "m-0 min-w-0 flex-1 break-words pl-4 pt-2 text-[20px] font-semibold leading-7 text-delta-800",
|
|
49
|
-
children:
|
|
49
|
+
children: i
|
|
50
50
|
}),
|
|
51
51
|
s && /* @__PURE__ */ e("div", {
|
|
52
52
|
className: "min-w-0 max-w-[240px] flex-1 pt-2",
|
|
@@ -55,7 +55,7 @@ var B = ({ open: o, onClose: t, dataTest: i, title: r, fallbackName: a, ...n })
|
|
|
55
55
|
/* @__PURE__ */ e(y, {
|
|
56
56
|
dataTest: `${o}-close`,
|
|
57
57
|
refLink: c,
|
|
58
|
-
"aria-label":
|
|
58
|
+
"aria-label": t,
|
|
59
59
|
variant: "textGray",
|
|
60
60
|
startIcon: /* @__PURE__ */ e(w, {
|
|
61
61
|
width: 24,
|
|
@@ -9,8 +9,7 @@ var a = {
|
|
|
9
9
|
noMatches: "Ingen treff",
|
|
10
10
|
matchCount: (e) => `${e} treff`,
|
|
11
11
|
cleared: "Valget er fjernet",
|
|
12
|
-
clearedAll: "Alle valg er fjernet"
|
|
13
|
-
truncated: (e, l) => `Viser ${e} av ${l}. Søk for å finne flere.`
|
|
12
|
+
clearedAll: "Alle valg er fjernet"
|
|
14
13
|
},
|
|
15
14
|
en: {
|
|
16
15
|
close: "Close",
|
|
@@ -22,13 +21,12 @@ var a = {
|
|
|
22
21
|
noMatches: "No matches",
|
|
23
22
|
matchCount: (e) => e === 1 ? "1 match" : `${e} matches`,
|
|
24
23
|
cleared: "Selection cleared",
|
|
25
|
-
clearedAll: "All selections cleared"
|
|
26
|
-
truncated: (e, l) => `Showing ${e} of ${l}. Search to find more.`
|
|
24
|
+
clearedAll: "All selections cleared"
|
|
27
25
|
}
|
|
28
|
-
},
|
|
26
|
+
}, c = (e, l) => ({
|
|
29
27
|
...a[e],
|
|
30
28
|
...l
|
|
31
29
|
});
|
|
32
30
|
export {
|
|
33
|
-
|
|
31
|
+
c as getPickerText
|
|
34
32
|
};
|
|
@@ -1,32 +1,39 @@
|
|
|
1
1
|
import { cn as g } from "../../../helpers/cn.js";
|
|
2
|
-
import { StyledSelectItem as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import { jsx as s, jsxs as
|
|
5
|
-
var v = ({ dataTest:
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
|
|
2
|
+
import { StyledSelectItem as N } from "../select/StyledSelectItem.js";
|
|
3
|
+
import { useEffect as d, useRef as k } from "react";
|
|
4
|
+
import { jsx as s, jsxs as f } from "react/jsx-runtime";
|
|
5
|
+
var v = ({ dataTest: u, visible: a, selectedIso2: o, activeIndex: r, optionId: t, onSelect: p, listId: h, label: x, renderFlag: S, className: b, onKeyDown: c, onFocus: w, open: m }) => {
|
|
6
|
+
const i = c !== void 0, n = k(null);
|
|
7
|
+
return d(() => {
|
|
8
|
+
if (!m) return;
|
|
9
|
+
const e = requestAnimationFrame(() => {
|
|
10
|
+
const l = a.findIndex((C) => C.iso2 === o);
|
|
11
|
+
l < 0 || n.current?.querySelector(`#${CSS.escape(t(l))}`)?.scrollIntoView({ block: "center" });
|
|
12
|
+
});
|
|
13
|
+
return () => cancelAnimationFrame(e);
|
|
14
|
+
}, [m]), d(() => {
|
|
15
|
+
r !== null && n.current?.querySelector(`#${CSS.escape(t(r))}`)?.scrollIntoView({ block: "nearest" });
|
|
9
16
|
}), /* @__PURE__ */ s("ul", {
|
|
10
|
-
ref:
|
|
11
|
-
id:
|
|
17
|
+
ref: n,
|
|
18
|
+
id: h,
|
|
12
19
|
role: "listbox",
|
|
13
|
-
"aria-label":
|
|
14
|
-
"data-testid": `${
|
|
15
|
-
tabIndex:
|
|
16
|
-
"aria-activedescendant":
|
|
17
|
-
onKeyDown:
|
|
18
|
-
onFocus:
|
|
19
|
-
className: g("m-0 min-h-0 flex-1 list-none overflow-y-auto p-0",
|
|
20
|
-
children:
|
|
21
|
-
id: t(
|
|
22
|
-
selected: e.iso2 ===
|
|
23
|
-
active:
|
|
24
|
-
onClick: () =>
|
|
25
|
-
children: /* @__PURE__ */
|
|
20
|
+
"aria-label": x,
|
|
21
|
+
"data-testid": `${u}-listbox`,
|
|
22
|
+
tabIndex: i ? 0 : void 0,
|
|
23
|
+
"aria-activedescendant": i && r !== null ? t(r) : void 0,
|
|
24
|
+
onKeyDown: c,
|
|
25
|
+
onFocus: w,
|
|
26
|
+
className: g("m-0 min-h-0 flex-1 list-none overflow-y-auto p-0", i && a.length > 0 && "outline-none", "[&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", b),
|
|
27
|
+
children: a.map((e, l) => /* @__PURE__ */ s(N, {
|
|
28
|
+
id: t(l),
|
|
29
|
+
selected: e.iso2 === o,
|
|
30
|
+
active: l === r,
|
|
31
|
+
onClick: () => p(e.iso2),
|
|
32
|
+
children: /* @__PURE__ */ f("span", {
|
|
26
33
|
className: "flex w-full items-center justify-between gap-2",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ f("span", {
|
|
28
35
|
className: "flex min-w-0 items-center gap-2",
|
|
29
|
-
children: [
|
|
36
|
+
children: [S?.(e.iso2, "eager"), /* @__PURE__ */ s("span", {
|
|
30
37
|
className: "truncate",
|
|
31
38
|
children: e.name
|
|
32
39
|
})]
|
|
@@ -48,7 +48,8 @@ var ae = ({ dataTest: r, countries: y, value: s, onChange: O, disabled: c, selec
|
|
|
48
48
|
label: g,
|
|
49
49
|
renderFlag: x,
|
|
50
50
|
onKeyDown: e ? z : void 0,
|
|
51
|
-
onFocus: e && o.activeIndex === null ? () => o.openWithKeyboard(1) : void 0
|
|
51
|
+
onFocus: e && o.activeIndex === null ? () => o.openWithKeyboard(1) : void 0,
|
|
52
|
+
open: t
|
|
52
53
|
}), S = {
|
|
53
54
|
role: "combobox",
|
|
54
55
|
"aria-activedescendant": o.activeIndex === null ? void 0 : o.optionId(o.activeIndex),
|
|
@@ -1,217 +1,219 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as le } from "../../../helpers/cn.js";
|
|
2
2
|
import { StyledCheckbox as Ne } from "../checkbox/base-ui/StyledCheckbox.js";
|
|
3
|
-
import { StyledButton as
|
|
3
|
+
import { StyledButton as B } from "../button/StyledButton.js";
|
|
4
4
|
import { StyledSearchField as De } from "../search-field/StyledSearchField.js";
|
|
5
|
-
import { useAnnouncer as
|
|
6
|
-
import { nextActiveIndex as
|
|
5
|
+
import { useAnnouncer as Se } from "../full-screen-picker/PickerLiveRegion.js";
|
|
6
|
+
import { nextActiveIndex as $e } from "./listboxCursor.js";
|
|
7
7
|
import { FullScreenPicker as Ie } from "../full-screen-picker/FullScreenPicker.js";
|
|
8
|
-
import { useEffect as
|
|
9
|
-
import { jsx as
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
const [s,
|
|
13
|
-
|
|
14
|
-
const _ =
|
|
8
|
+
import { useEffect as T, useMemo as _e, useRef as ee, useState as y } from "react";
|
|
9
|
+
import { jsx as n, jsxs as A } from "react/jsx-runtime";
|
|
10
|
+
var Me = 500, re = "px-3 py-2 text-sm text-delta-600", te = "[&>div]:px-0";
|
|
11
|
+
function ze({ open: l, dataTest: o, listboxId: u, title: N, name: v, text: a, options: f, multiple: d, value: m, clearable: H, isEqual: b, isOptionDisabled: K, getLabel: j, getOptionKey: E, filterOptions: D, renderOptionRow: ne, optionRowClassName: U, loading: S, loadingText: oe, noOptionsText: ae, allowSelectAll: ce, selectAllLabel: se, onSelect: ie, onClear: de, onApply: ue, onCancel: fe }) {
|
|
12
|
+
const [s, $] = y(""), [t, h] = y(null), [i, W] = y([]), [me, he] = y(!1), [pe, we] = y(!1), [ke, I, Ce] = Se();
|
|
13
|
+
l !== pe && (we(l), l && ($(""), h(null), W(Array.isArray(m) ? [...m] : []), he(!d && H && m !== null && !Array.isArray(m)), Ce()));
|
|
14
|
+
const _ = ee([]), z = d ? null : m, Q = (e) => d ? i.some((r) => b(e, r)) : z !== null && b(e, z), c = _e(() => {
|
|
15
15
|
const e = [...f];
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
return
|
|
16
|
+
if (D) return D(e, { inputValue: s });
|
|
17
|
+
const r = s.trim().toLowerCase();
|
|
18
|
+
return r ? e.filter((k) => j(k).toLowerCase().includes(r)) : e;
|
|
19
19
|
}, [
|
|
20
20
|
f,
|
|
21
21
|
s,
|
|
22
|
-
|
|
23
|
-
]),
|
|
24
|
-
|
|
22
|
+
D
|
|
23
|
+
]), M = !!(ce && d), p = M ? [-1, ...c.map((e, r) => r)] : c.map((e, r) => r), w = c.findIndex(Q), { noMatches: Y, matchCount: G } = a;
|
|
24
|
+
T(() => {
|
|
25
25
|
if (s === "") return;
|
|
26
|
-
const e = window.setTimeout(() => I(
|
|
26
|
+
const e = window.setTimeout(() => I(c.length === 0 ? Y : G(c.length)), Me);
|
|
27
27
|
return () => window.clearTimeout(e);
|
|
28
28
|
}, [
|
|
29
29
|
I,
|
|
30
|
-
|
|
30
|
+
c.length,
|
|
31
31
|
s,
|
|
32
32
|
Y,
|
|
33
33
|
G
|
|
34
|
-
])
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
34
|
+
]);
|
|
35
|
+
const R = ee(!1);
|
|
36
|
+
T(() => {
|
|
37
|
+
if (!l) {
|
|
38
|
+
R.current = !1;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
R.current || S || (R.current = !0, w >= 0 && _.current[w]?.scrollIntoView({ block: "center" }));
|
|
42
|
+
}, [l, S]);
|
|
43
|
+
const L = (e) => {
|
|
44
|
+
h(e), e !== null && e >= 0 && _.current[e]?.scrollIntoView({ block: "nearest" });
|
|
45
|
+
}, V = (e, r = a.selectedCount(e.length)) => {
|
|
46
|
+
W(e), I(r);
|
|
47
|
+
}, ye = (e) => {
|
|
48
|
+
V(i.some((r) => b(e, r)) ? i.filter((r) => !b(e, r)) : [...i, e]);
|
|
49
|
+
}, g = f.length > 0 && i.length === f.length, J = () => V(g ? [] : [...f]), O = (e, r, k = !0) => {
|
|
50
|
+
K(r) || (d ? ye(r) : ie(e, r, k));
|
|
51
|
+
}, F = (e, r) => {
|
|
52
|
+
t === -1 ? J() : t !== null && c[t] !== void 0 && O(e, c[t], r);
|
|
53
|
+
}, X = (e) => {
|
|
54
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), L($e(p, t, w, e.key === "ArrowDown" ? 1 : -1))) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), L(p[e.key === "Home" ? 0 : p.length - 1] ?? null)) : e.key === "Enter" ? (e.preventDefault(), F(e, !0)) : e.key === " " && s === "" && t !== null && (e.preventDefault(), F(e, !1));
|
|
49
55
|
}, ve = (e) => {
|
|
50
56
|
if (e.key !== " ") {
|
|
51
|
-
|
|
57
|
+
X(e);
|
|
52
58
|
return;
|
|
53
59
|
}
|
|
54
|
-
e.preventDefault(),
|
|
60
|
+
e.preventDefault(), F(e, !1);
|
|
55
61
|
}, be = () => {
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
let
|
|
59
|
-
|
|
60
|
-
const ge = (e,
|
|
61
|
-
const
|
|
62
|
+
t === null && L(w >= 0 ? w : p[0] ?? null);
|
|
63
|
+
}, Z = (e) => `${o}-option-${e}`;
|
|
64
|
+
let x;
|
|
65
|
+
t === -1 && M ? x = `${o}-select-all` : t !== null && c[t] !== void 0 && (x = Z(t));
|
|
66
|
+
const ge = (e, r) => {
|
|
67
|
+
const k = K(e), q = Q(e);
|
|
62
68
|
return ne({
|
|
63
|
-
key:
|
|
69
|
+
key: E ? String(E(e)) : `${j(e)}-${r}`,
|
|
64
70
|
ref: (C) => {
|
|
65
|
-
_.current[
|
|
71
|
+
_.current[r] = C;
|
|
66
72
|
},
|
|
67
73
|
role: "option",
|
|
68
|
-
id:
|
|
69
|
-
"aria-selected":
|
|
70
|
-
"aria-disabled":
|
|
71
|
-
"data-active":
|
|
72
|
-
className:
|
|
74
|
+
id: Z(r),
|
|
75
|
+
"aria-selected": q,
|
|
76
|
+
"aria-disabled": k || void 0,
|
|
77
|
+
"data-active": t === r ? "" : void 0,
|
|
78
|
+
className: U,
|
|
73
79
|
onMouseDown: (C) => C.preventDefault(),
|
|
74
|
-
onClick: (C) =>
|
|
75
|
-
onMouseMove: () =>
|
|
80
|
+
onClick: (C) => O(C, e),
|
|
81
|
+
onMouseMove: () => h(null)
|
|
76
82
|
}, e, {
|
|
77
|
-
selected:
|
|
78
|
-
index:
|
|
83
|
+
selected: q,
|
|
84
|
+
index: r,
|
|
79
85
|
inputValue: s,
|
|
80
86
|
inPicker: !0
|
|
81
87
|
});
|
|
82
|
-
}, xe =
|
|
88
|
+
}, xe = l ? S ? /* @__PURE__ */ n("li", {
|
|
83
89
|
role: "presentation",
|
|
84
|
-
className:
|
|
90
|
+
className: re,
|
|
85
91
|
children: oe
|
|
86
|
-
}) :
|
|
92
|
+
}) : c.length === 0 ? /* @__PURE__ */ n("li", {
|
|
87
93
|
role: "presentation",
|
|
88
|
-
className:
|
|
89
|
-
"data-testid": `${
|
|
94
|
+
className: re,
|
|
95
|
+
"data-testid": `${o}-picker-empty`,
|
|
90
96
|
children: s === "" ? ae : a.noMatches
|
|
91
|
-
}) :
|
|
92
|
-
dataTest: `${
|
|
97
|
+
}) : c.map(ge) : null, Ae = /* @__PURE__ */ n(De, {
|
|
98
|
+
dataTest: `${o}-picker-search`,
|
|
93
99
|
label: a.search,
|
|
94
100
|
value: s,
|
|
95
101
|
fullWidth: !0,
|
|
96
102
|
onChange: (e) => {
|
|
97
|
-
|
|
103
|
+
$(e.target.value), h(null);
|
|
98
104
|
},
|
|
99
105
|
onClear: () => {
|
|
100
|
-
|
|
106
|
+
$(""), h(null);
|
|
101
107
|
},
|
|
102
|
-
onKeyDown:
|
|
108
|
+
onKeyDown: X,
|
|
103
109
|
autoComplete: "off",
|
|
104
110
|
slotProps: { htmlInput: {
|
|
105
111
|
role: "combobox",
|
|
106
112
|
"aria-controls": u,
|
|
107
113
|
"aria-expanded": !0,
|
|
108
|
-
"aria-activedescendant":
|
|
114
|
+
"aria-activedescendant": x,
|
|
109
115
|
"aria-autocomplete": "list"
|
|
110
116
|
} }
|
|
111
117
|
});
|
|
112
|
-
let
|
|
113
|
-
return
|
|
114
|
-
dataTest:
|
|
115
|
-
count: a.selectedCount(
|
|
116
|
-
clearAllLabel:
|
|
117
|
-
clearAllShown:
|
|
118
|
+
let P;
|
|
119
|
+
return d ? P = /* @__PURE__ */ n(Re, {
|
|
120
|
+
dataTest: o,
|
|
121
|
+
count: a.selectedCount(i.length),
|
|
122
|
+
clearAllLabel: H ? a.clearAll : void 0,
|
|
123
|
+
clearAllShown: i.length > 0,
|
|
118
124
|
doneLabel: a.done,
|
|
119
|
-
onClearAll: () =>
|
|
120
|
-
onDone: (e) => ue(e,
|
|
121
|
-
}) : me && (
|
|
122
|
-
dataTest:
|
|
125
|
+
onClearAll: () => V([], a.clearedAll),
|
|
126
|
+
onDone: (e) => ue(e, i)
|
|
127
|
+
}) : me && (P = /* @__PURE__ */ n(Le, {
|
|
128
|
+
dataTest: o,
|
|
123
129
|
label: a.clearOne,
|
|
124
130
|
onClear: de
|
|
125
|
-
})), /* @__PURE__ */
|
|
126
|
-
open:
|
|
131
|
+
})), /* @__PURE__ */ n(Ie, {
|
|
132
|
+
open: l,
|
|
127
133
|
onClose: fe,
|
|
128
|
-
dataTest: `${
|
|
129
|
-
title:
|
|
130
|
-
fallbackName:
|
|
134
|
+
dataTest: `${o}-picker`,
|
|
135
|
+
title: N,
|
|
136
|
+
fallbackName: v,
|
|
131
137
|
closeLabel: a.close,
|
|
132
138
|
search: Ae,
|
|
133
|
-
headerRow:
|
|
139
|
+
headerRow: P,
|
|
134
140
|
announcement: ke,
|
|
135
|
-
children:
|
|
141
|
+
children: /* @__PURE__ */ A("ul", {
|
|
136
142
|
id: u,
|
|
137
143
|
role: "listbox",
|
|
138
|
-
"aria-label":
|
|
139
|
-
"aria-multiselectable":
|
|
144
|
+
"aria-label": v,
|
|
145
|
+
"aria-multiselectable": d || void 0,
|
|
140
146
|
tabIndex: 0,
|
|
141
|
-
"aria-activedescendant":
|
|
147
|
+
"aria-activedescendant": x,
|
|
142
148
|
onKeyDown: ve,
|
|
143
149
|
onFocus: be,
|
|
144
|
-
className:
|
|
145
|
-
children: [M && /* @__PURE__ */
|
|
146
|
-
id: `${
|
|
150
|
+
className: le("m-0 list-none p-0 [&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", p.length > 0 && "outline-none", "[&>li[role=option]]:pr-4 [&>li[role=option]]:text-delta-700", d ? "[&>li[aria-selected=true]:not(:hover)]:bg-white" : "[&>li[aria-selected=true]:not([aria-disabled=true])]:bg-gama-25 [&>li[role=option]]:gap-x-1 [&>li[role=option]]:pl-2"),
|
|
151
|
+
children: [M && /* @__PURE__ */ A("li", {
|
|
152
|
+
id: `${o}-select-all`,
|
|
147
153
|
role: "option",
|
|
148
|
-
"aria-selected":
|
|
149
|
-
"data-active":
|
|
154
|
+
"aria-selected": g,
|
|
155
|
+
"data-active": t === -1 ? "" : void 0,
|
|
150
156
|
tabIndex: -1,
|
|
151
157
|
onMouseDown: (e) => e.preventDefault(),
|
|
152
158
|
onClick: J,
|
|
153
|
-
className:
|
|
159
|
+
className: U,
|
|
154
160
|
children: [
|
|
155
|
-
|
|
161
|
+
t === -1 && /* @__PURE__ */ n("span", {
|
|
156
162
|
"aria-hidden": "true",
|
|
157
163
|
className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
|
|
158
164
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
dataTest: `${
|
|
161
|
-
checked:
|
|
162
|
-
indeterminate:
|
|
165
|
+
/* @__PURE__ */ n(Ne, {
|
|
166
|
+
dataTest: `${o}-picker-select-all`,
|
|
167
|
+
checked: g,
|
|
168
|
+
indeterminate: i.length > 0 && !g,
|
|
163
169
|
size: "medium",
|
|
164
170
|
checkboxClassName: "!h-4 !w-4",
|
|
165
171
|
hideWrapper: !0,
|
|
166
172
|
decorative: !0
|
|
167
173
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ n("span", {
|
|
169
175
|
className: "min-w-0 flex-1 break-words",
|
|
170
|
-
children:
|
|
176
|
+
children: se
|
|
171
177
|
})
|
|
172
178
|
]
|
|
173
179
|
}), xe]
|
|
174
|
-
})
|
|
175
|
-
className: "m-0 px-3 py-2 text-sm text-delta-600",
|
|
176
|
-
"data-testid": `${t}-picker-truncated`,
|
|
177
|
-
children: a.truncated(F, m.length)
|
|
178
|
-
})]
|
|
180
|
+
})
|
|
179
181
|
});
|
|
180
182
|
}
|
|
181
|
-
var
|
|
182
|
-
className: "flex items-center
|
|
183
|
-
"data-testid": `${
|
|
184
|
-
children: [/* @__PURE__ */
|
|
185
|
-
className: "flex min-w-
|
|
186
|
-
children: [/* @__PURE__ */
|
|
183
|
+
var Re = ({ dataTest: l, count: o, clearAllLabel: u, clearAllShown: N, doneLabel: v, onClearAll: a, onDone: f }) => /* @__PURE__ */ A("div", {
|
|
184
|
+
className: "flex flex-wrap items-center gap-x-6 gap-y-2 px-4 py-2",
|
|
185
|
+
"data-testid": `${l}-picker-selection-row`,
|
|
186
|
+
children: [/* @__PURE__ */ A("div", {
|
|
187
|
+
className: "flex min-w-min flex-[1_1_0%] flex-wrap items-center gap-x-1",
|
|
188
|
+
children: [/* @__PURE__ */ n("span", {
|
|
187
189
|
className: "text-base text-delta-600",
|
|
188
|
-
"data-testid": `${
|
|
189
|
-
children:
|
|
190
|
-
}), u !== void 0 && /* @__PURE__ */
|
|
191
|
-
dataTest: `${
|
|
190
|
+
"data-testid": `${l}-picker-count`,
|
|
191
|
+
children: o
|
|
192
|
+
}), u !== void 0 && /* @__PURE__ */ n(B, {
|
|
193
|
+
dataTest: `${l}-picker-clear-all`,
|
|
192
194
|
variant: "text",
|
|
193
|
-
className:
|
|
195
|
+
className: le(te, !N && "invisible"),
|
|
194
196
|
onClick: a,
|
|
195
197
|
children: u
|
|
196
198
|
})]
|
|
197
|
-
}), /* @__PURE__ */
|
|
198
|
-
dataTest: `${
|
|
199
|
+
}), /* @__PURE__ */ n(B, {
|
|
200
|
+
dataTest: `${l}-picker-done`,
|
|
199
201
|
variant: "contained",
|
|
200
|
-
className: "shrink-0 whitespace-nowrap",
|
|
202
|
+
className: "ml-auto shrink-0 whitespace-nowrap",
|
|
201
203
|
onClick: f,
|
|
202
|
-
children:
|
|
204
|
+
children: v
|
|
203
205
|
})]
|
|
204
|
-
}),
|
|
206
|
+
}), Le = ({ dataTest: l, label: o, onClear: u }) => /* @__PURE__ */ n("div", {
|
|
205
207
|
className: "flex px-4 py-2",
|
|
206
|
-
"data-testid": `${
|
|
207
|
-
children: /* @__PURE__ */
|
|
208
|
-
dataTest: `${
|
|
208
|
+
"data-testid": `${l}-picker-clear-row`,
|
|
209
|
+
children: /* @__PURE__ */ n(B, {
|
|
210
|
+
dataTest: `${l}-picker-clear`,
|
|
209
211
|
variant: "text",
|
|
210
212
|
className: te,
|
|
211
213
|
onClick: u,
|
|
212
|
-
children:
|
|
214
|
+
children: o
|
|
213
215
|
})
|
|
214
216
|
});
|
|
215
217
|
export {
|
|
216
|
-
|
|
218
|
+
ze as SelectAutocompletePicker
|
|
217
219
|
};
|