asma-ui-core 3.109.0 → 3.110.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/feedback/minimizable-dialog/MinimizableDialog.js +17 -15
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +26 -24
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +61 -58
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +74 -71
- package/dist/components/inputs/dynamic-select/components/DynamicSelectReadOnlyValue.js +13 -10
- package/dist/components/inputs/field-styles.js +16 -6
- package/dist/components/inputs/form-layout/StyledFieldPair.js +22 -0
- package/dist/components/inputs/form-layout/StyledFieldPair.module.js +8 -0
- package/dist/components/inputs/form-layout/StyledFormColumn.js +13 -0
- package/dist/components/inputs/input-field/StyledInputField.js +235 -198
- package/dist/components/inputs/phone-field/StyledPhoneField.js +41 -39
- package/dist/components/inputs/search-field/StyledSearchField.js +22 -20
- package/dist/components/inputs/select/StyledSelect.js +110 -108
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +111 -108
- package/dist/components/inputs/slider/StyledSlider.js +2 -2
- package/dist/components/inputs/textarea/StyledTextarea.js +50 -52
- package/dist/components/inputs/textarea/StyledTextarea.module.js +3 -3
- package/dist/components/miscellaneous/StyledFormControl.js +29 -25
- package/dist/components/miscellaneous/StyledInputLabel.js +28 -18
- package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +137 -122
- package/dist/datetime/components/date-picker/components/DatePickerInputRangeCompact.js +17 -15
- package/dist/datetime/components/date-picker/components/DatePickerInputRangeCompact.module.js +2 -2
- package/dist/datetime/components/date-picker/components/DatePickerInputSingle.js +9 -8
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectMonth.js +17 -14
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectYear.js +14 -9
- package/dist/datetime/components/time-picker/StyledTimePicker.js +78 -74
- package/dist/datetime/components/time-picker/TimePickerInput.js +43 -41
- package/dist/datetime/components/time-picker/helpers/timePickerWidth.js +12 -0
- package/dist/helpers/CharacterCounter.js +21 -0
- package/dist/index.js +219 -211
- package/dist/src/components/inputs/dynamic-select/components/DynamicSelectReadOnlyValue.d.ts +2 -2
- package/dist/src/components/inputs/dynamic-select/types.d.ts +3 -0
- package/dist/src/components/inputs/field-styles.d.ts +22 -0
- package/dist/src/components/inputs/form-layout/StyledFieldPair.d.ts +18 -0
- package/dist/src/components/inputs/form-layout/StyledFormColumn.d.ts +12 -0
- package/dist/src/components/inputs/form-layout/index.d.ts +4 -0
- package/dist/src/components/inputs/input-field/StyledInputField.d.ts +19 -4
- package/dist/src/components/inputs/select/StyledSelect.d.ts +7 -2
- package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +5 -1
- package/dist/src/components/inputs/textarea/StyledTextarea.d.ts +6 -0
- package/dist/src/components/miscellaneous/StyledFormControl.d.ts +5 -2
- package/dist/src/components/miscellaneous/StyledInputLabel.d.ts +7 -5
- package/dist/src/datetime/components/date-picker/components/BaseDatePickerInput.d.ts +2 -0
- package/dist/src/datetime/components/date-picker/types.d.ts +3 -0
- package/dist/src/datetime/components/time-picker/helpers/timePickerWidth.d.ts +7 -0
- package/dist/src/datetime/components/time-picker/types.d.ts +3 -1
- package/dist/src/helpers/CharacterCounter.d.ts +16 -0
- package/dist/src/helpers/CharacterCounter.test.d.ts +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/tailwind.config.d.ts +14 -0
- package/package.json +1 -1
- package/src/styles/fieldWidthTokens.css +8 -0
- package/src/styles/index.css +1 -0
- package/tw-configs/twConfigs.json +14 -0
|
@@ -2,44 +2,45 @@ import { cn as p } from "../../../helpers/cn.js";
|
|
|
2
2
|
import { SearchIcon as u } from "../../icons/search-icon/SearchIcon.js";
|
|
3
3
|
import { CloseIcon as f } from "../../icons/close-icon/CloseIcon.js";
|
|
4
4
|
import { StyledInputField as v } from "../input-field/StyledInputField.js";
|
|
5
|
-
import { useState as
|
|
5
|
+
import { useState as x } from "react";
|
|
6
6
|
import { jsx as t } from "react/jsx-runtime";
|
|
7
|
-
var F = ({ value:
|
|
8
|
-
const [m,
|
|
7
|
+
var F = ({ value: a, onClear: d, label: l, onFocus: c, onBlur: h, slotProps: n, ...r }) => {
|
|
8
|
+
const [m, i] = x(!1), o = m || a, s = typeof l == "string" ? l : void 0;
|
|
9
9
|
return /* @__PURE__ */ t("div", {
|
|
10
10
|
className: "relative w-full",
|
|
11
11
|
children: /* @__PURE__ */ t(v, {
|
|
12
12
|
size: "small",
|
|
13
13
|
variant: "outlined",
|
|
14
|
-
|
|
14
|
+
labelPlacement: "floating",
|
|
15
|
+
value: a,
|
|
15
16
|
reserveHelperText: !1,
|
|
16
|
-
label:
|
|
17
|
-
placeholder:
|
|
17
|
+
label: o ? l : void 0,
|
|
18
|
+
placeholder: o ? void 0 : s,
|
|
18
19
|
onFocus: (e) => {
|
|
19
|
-
|
|
20
|
+
i(!0), c?.(e);
|
|
20
21
|
},
|
|
21
22
|
onBlur: (e) => {
|
|
22
|
-
|
|
23
|
+
i(!1), h?.(e);
|
|
23
24
|
},
|
|
24
25
|
slotProps: {
|
|
25
|
-
...
|
|
26
|
+
...n,
|
|
26
27
|
htmlInput: {
|
|
27
|
-
"aria-label":
|
|
28
|
-
...
|
|
28
|
+
"aria-label": o ? void 0 : s,
|
|
29
|
+
...n?.htmlInput,
|
|
29
30
|
style: {
|
|
30
31
|
overflow: "hidden",
|
|
31
32
|
textOverflow: "ellipsis",
|
|
32
33
|
whiteSpace: "nowrap",
|
|
33
|
-
...
|
|
34
|
-
...
|
|
34
|
+
...a ? { paddingRight: 40 } : {},
|
|
35
|
+
...n?.htmlInput?.style
|
|
35
36
|
}
|
|
36
37
|
},
|
|
37
38
|
input: {
|
|
38
|
-
endAdornment:
|
|
39
|
+
endAdornment: a ? /* @__PURE__ */ t("button", {
|
|
39
40
|
type: "button",
|
|
40
41
|
"aria-label": "Clear",
|
|
41
42
|
"data-testid": "styled-search-clear-icon",
|
|
42
|
-
className: p("asma-pressable", "cursor-pointer rounded-full border-0 bg-delta-50", "flex items-center justify-center", "transform-gpu transition-all duration-300 ease-in-out",
|
|
43
|
+
className: p("asma-pressable", "cursor-pointer rounded-full border-0 bg-delta-50", "flex items-center justify-center", "transform-gpu transition-all duration-300 ease-in-out", a ? "scale-100 opacity-100" : "pointer-events-none scale-75 opacity-0", r.readOnly && "-translate-x-[6.5px]"),
|
|
43
44
|
style: {
|
|
44
45
|
width: 24,
|
|
45
46
|
height: 24,
|
|
@@ -55,7 +56,7 @@ var F = ({ value: r, onClear: d, label: i, onFocus: c, onBlur: h, slotProps: o,
|
|
|
55
56
|
className: "pointer-events-none"
|
|
56
57
|
})
|
|
57
58
|
}) : null,
|
|
58
|
-
startAdornment:
|
|
59
|
+
startAdornment: o ? void 0 : /* @__PURE__ */ t("span", {
|
|
59
60
|
"data-testid": "styled-search-icon",
|
|
60
61
|
className: "flex items-center",
|
|
61
62
|
children: /* @__PURE__ */ t(u, {
|
|
@@ -65,13 +66,14 @@ var F = ({ value: r, onClear: d, label: i, onFocus: c, onBlur: h, slotProps: o,
|
|
|
65
66
|
className: "pointer-events-none"
|
|
66
67
|
})
|
|
67
68
|
}),
|
|
68
|
-
...
|
|
69
|
+
...n?.input
|
|
69
70
|
}
|
|
70
71
|
},
|
|
71
|
-
...
|
|
72
|
+
...r,
|
|
72
73
|
sx: {
|
|
73
|
-
width:
|
|
74
|
-
|
|
74
|
+
width: r.fullWidth ? "100%" : "var(--dynamic-toolbar-search-width, 160px)",
|
|
75
|
+
maxWidth: "none",
|
|
76
|
+
...r.sx
|
|
75
77
|
}
|
|
76
78
|
})
|
|
77
79
|
});
|
|
@@ -1,211 +1,213 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as x } from "../../../helpers/cn.js";
|
|
2
2
|
import { resolveSx as je } from "../../../helpers/sx.js";
|
|
3
|
-
import { TOP_LAYER_PROPS as Ue, TOP_LAYER_RESET_STYLE as Ve, getOpenModalDialogAncestor as
|
|
3
|
+
import { TOP_LAYER_PROPS as Ue, TOP_LAYER_RESET_STYLE as Ve, getOpenModalDialogAncestor as se, shouldUsePopoverTopLayer as We, useTopLayerRef as Ye } from "../../../hooks/useTopLayer.hook.js";
|
|
4
4
|
import { ChevronDownIcon as ze } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
5
5
|
import { CloseIcon as Ke } from "../../icons/close-icon/CloseIcon.js";
|
|
6
|
-
import { useBackCloses as
|
|
7
|
-
import { HelperRow as
|
|
8
|
-
import { useHelperRowBudget as
|
|
9
|
-
import { useHelperSlot as
|
|
10
|
-
import { outlineClass as
|
|
11
|
-
import { useFormControlContext as
|
|
12
|
-
import { Children as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { FloatingPortal as
|
|
15
|
-
var
|
|
16
|
-
const
|
|
17
|
-
K(e), e ||
|
|
18
|
-
}, { refs: { domReference: De, reference:
|
|
6
|
+
import { useBackCloses as Ge } from "../../../hooks/useBackCloses.hook.js";
|
|
7
|
+
import { HelperRow as Je } from "../../../helpers/HelperRow.js";
|
|
8
|
+
import { useHelperRowBudget as Qe } from "../../../helpers/useHelperRowBudget.js";
|
|
9
|
+
import { useHelperSlot as Xe } from "../../../helpers/useHelperSlot.js";
|
|
10
|
+
import { fieldWidthStyle as Ze, outlineClass as et } from "../field-styles.js";
|
|
11
|
+
import { useFormControlContext as tt } from "../../miscellaneous/FormControlContext.js";
|
|
12
|
+
import { Children as le, cloneElement as ot, isValidElement as m, useEffect as H, useId as rt, useRef as st, useState as v } from "react";
|
|
13
|
+
import { jsx as i, jsxs as L } from "react/jsx-runtime";
|
|
14
|
+
import { FloatingPortal as lt, autoUpdate as nt, flip as it, offset as at, shift as ct, size as dt, useClick as ut, useDismiss as ft, useFloating as pt, useInteractions as mt, useMergeRefs as bt, useRole as gt } from "@floating-ui/react";
|
|
15
|
+
var Et = ({ dataTest: T, value: q, defaultValue: ne, onChange: M, error: ie, errorText: ae, helperText: $, reserveHelperText: ce, expandHelperText: de = !0, allowClear: j, disabled: ue, readOnly: c, name: w, placeholder: D, displayEmpty: C, multiple: d, renderValue: U, width: V = "full", fullWidth: ht, className: fe, style: pe, sx: me, variant: be, children: W, MenuProps: ge, onFocus: he, onBlur: ye, labelId: A, required: xe }) => {
|
|
16
|
+
const n = tt(), R = `${T}-listbox`, u = be === "standard", b = ie ?? n?.error ?? !1, l = ue ?? n?.disabled ?? !1, Y = b ? ae ?? $ : $, { show: F, role: ve } = Xe("StyledSelect", b, Y, ce, c), z = rt(), { fieldRef: we, rowRef: Ae, rowStyle: Re } = Qe(de && F), [r, K] = v(!1), [k, I] = v(!1), [g, h] = v(null), [ke, G] = v(ne), _ = q !== void 0, o = _ ? q : ke, f = Array.isArray(o) ? o.length > 0 : o !== void 0 && o !== "" && o !== null, y = le.toArray(W), J = (e) => d ? Array.isArray(o) && o.includes(e) : e === o, s = y.flatMap((e, t) => m(e) && !e.props.disabled ? [t] : []), O = y.findIndex((e) => m(e) && J(e.props.value)), Se = (e = 1) => s.includes(O) ? O : s[e === 1 ? 0 : s.length - 1] ?? null, S = g === null ? void 0 : `${R}-option-${g}`, E = st(null), p = (e) => {
|
|
17
|
+
K(e), e || h(null);
|
|
18
|
+
}, { refs: { domReference: De, reference: Q, setFloating: Ce, setReference: Fe }, floatingStyles: Ie, context: P } = pt({
|
|
19
19
|
open: r,
|
|
20
|
-
onOpenChange:
|
|
20
|
+
onOpenChange: p,
|
|
21
21
|
placement: "bottom-start",
|
|
22
22
|
strategy: "fixed",
|
|
23
|
-
whileElementsMounted:
|
|
23
|
+
whileElementsMounted: nt,
|
|
24
24
|
middleware: [
|
|
25
|
-
|
|
26
|
-
nt({ padding: 8 }),
|
|
25
|
+
at(0),
|
|
27
26
|
it({ padding: 8 }),
|
|
28
|
-
|
|
27
|
+
ct({ padding: 8 }),
|
|
28
|
+
dt({ apply({ rects: e, elements: t }) {
|
|
29
29
|
t.floating.style.minWidth = `${e.reference.width}px`;
|
|
30
30
|
} })
|
|
31
31
|
]
|
|
32
|
-
}), { getReferenceProps:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
}), { getReferenceProps: _e, getFloatingProps: Oe } = mt([
|
|
33
|
+
ut(P, { enabled: !l && !c }),
|
|
34
|
+
ft(P),
|
|
35
|
+
gt(P, { role: "listbox" })
|
|
36
36
|
]);
|
|
37
|
-
|
|
37
|
+
Ge({
|
|
38
38
|
active: r,
|
|
39
|
-
requestClose: () =>
|
|
39
|
+
requestClose: () => p(!1)
|
|
40
40
|
});
|
|
41
|
-
const [
|
|
42
|
-
H(() =>
|
|
41
|
+
const [X, Z] = v(), N = We(X), Ee = bt([Ye(Ce, N), E]);
|
|
42
|
+
H(() => n?.setFocused(r || k), [
|
|
43
43
|
r,
|
|
44
44
|
k,
|
|
45
|
-
|
|
46
|
-
]), H(() =>
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
n
|
|
46
|
+
]), H(() => n?.setFilled(f || !!D || !!C), [
|
|
47
|
+
f,
|
|
48
|
+
D,
|
|
49
49
|
C,
|
|
50
|
-
|
|
50
|
+
n
|
|
51
51
|
]), H(() => {
|
|
52
52
|
if (!r) return;
|
|
53
53
|
const e = requestAnimationFrame(() => {
|
|
54
|
-
const t =
|
|
54
|
+
const t = S ? document.getElementById(S) : E.current?.querySelector('[role="option"][aria-selected="true"]');
|
|
55
55
|
t && E.current?.contains(t) && t.scrollIntoView({ block: "nearest" });
|
|
56
56
|
});
|
|
57
57
|
return () => cancelAnimationFrame(e);
|
|
58
|
-
}, [
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
value:
|
|
58
|
+
}, [S, r]);
|
|
59
|
+
const ee = (e, t, a = !d) => {
|
|
60
|
+
const re = d ? Array.isArray(o) && o.includes(e) ? o.filter(($e) => $e !== e) : [...Array.isArray(o) ? o : [], e] : e;
|
|
61
|
+
_ || G(re), M?.({ target: {
|
|
62
|
+
value: re,
|
|
63
63
|
name: w
|
|
64
|
-
} }, t), a && (
|
|
65
|
-
},
|
|
64
|
+
} }, t), a && (p(!1), requestAnimationFrame(() => De.current?.focus()));
|
|
65
|
+
}, te = () => {
|
|
66
66
|
const e = d ? [] : "";
|
|
67
|
-
|
|
67
|
+
_ || G(e), M?.({ target: {
|
|
68
68
|
value: e,
|
|
69
69
|
name: w
|
|
70
|
-
} }, null),
|
|
71
|
-
},
|
|
72
|
-
if (!
|
|
70
|
+
} }, null), p(!1), I(!1);
|
|
71
|
+
}, Pe = le.map(W, (e, t) => {
|
|
72
|
+
if (!m(e)) return e;
|
|
73
73
|
const a = e.props.value;
|
|
74
|
-
return
|
|
75
|
-
id: `${
|
|
74
|
+
return ot(e, {
|
|
75
|
+
id: `${R}-option-${t}`,
|
|
76
76
|
active: t === g,
|
|
77
|
-
selected:
|
|
77
|
+
selected: J(a),
|
|
78
78
|
onClick: () => {
|
|
79
|
-
|
|
79
|
+
h(null), ee(a, e.props.children);
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
|
-
}),
|
|
82
|
+
}), Ne = y.find((e) => m(e) && e.props.value === o), Be = U ? U(o) : d && Array.isArray(o) ? y.filter((e) => m(e) && o.includes(e.props.value)).map((e) => {
|
|
83
83
|
const t = e.props.children;
|
|
84
84
|
return typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
85
|
-
}).join(", ") :
|
|
86
|
-
s.length !== 0 &&
|
|
87
|
-
const a = s.indexOf(t ??
|
|
85
|
+
}).join(", ") : Ne?.props.children, He = (e) => {
|
|
86
|
+
s.length !== 0 && h((t) => {
|
|
87
|
+
const a = s.indexOf(t ?? O ?? -1);
|
|
88
88
|
return a === -1 ? s[e === 1 ? 0 : s.length - 1] ?? null : s[Math.min(Math.max(a + e, 0), s.length - 1)] ?? null;
|
|
89
89
|
});
|
|
90
|
-
},
|
|
90
|
+
}, oe = (e) => {
|
|
91
91
|
const t = g === null ? void 0 : y[g];
|
|
92
|
-
!
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
if ((e.key === "Backspace" || e.key === "Delete") &&
|
|
97
|
-
e.preventDefault(),
|
|
92
|
+
!m(t) || t.props.disabled || ee(t.props.value, t.props.children, e);
|
|
93
|
+
}, Le = (e = 1) => {
|
|
94
|
+
Z(se(Q.current)), h(Se(e)), K(!0);
|
|
95
|
+
}, Te = (e) => {
|
|
96
|
+
if ((e.key === "Backspace" || e.key === "Delete") && j && f && !l && !c) {
|
|
97
|
+
e.preventDefault(), te();
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
if (!(
|
|
100
|
+
if (!(l || c)) {
|
|
101
101
|
if (!r && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
102
|
-
e.preventDefault(),
|
|
102
|
+
e.preventDefault(), Le(e.key === "ArrowDown" ? 1 : -1);
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
|
-
r && (e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(),
|
|
105
|
+
r && (e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), He(e.key === "ArrowDown" ? 1 : -1)) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), h(s[e.key === "Home" ? 0 : s.length - 1] ?? null)) : e.key === " " ? (e.preventDefault(), oe(!1)) : e.key === "Enter" ? (e.preventDefault(), oe(!0)) : e.key === "Escape" ? (e.preventDefault(), p(!1)) : e.key === "Tab" && p(!1));
|
|
106
106
|
}
|
|
107
|
-
}, B =
|
|
107
|
+
}, B = u && (r || k), qe = l ? "text-delta-300" : B ? "text-gama-500" : "text-delta-800", Me = l ? "text-delta-300" : "text-delta-700";
|
|
108
108
|
return /* @__PURE__ */ L("div", {
|
|
109
109
|
ref: we,
|
|
110
|
-
className:
|
|
110
|
+
className: x("group relative flex-col", u ? "inline-flex" : "flex", fe),
|
|
111
|
+
"data-field-width": u ? void 0 : V,
|
|
111
112
|
style: {
|
|
113
|
+
...u ? {} : Ze(V),
|
|
112
114
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
113
115
|
...je(me),
|
|
114
116
|
...pe
|
|
115
117
|
},
|
|
116
118
|
children: [
|
|
117
119
|
/* @__PURE__ */ L("button", {
|
|
118
|
-
ref:
|
|
120
|
+
ref: Fe,
|
|
119
121
|
type: "button",
|
|
120
122
|
"data-testid": T,
|
|
121
|
-
...
|
|
122
|
-
onClick: () =>
|
|
123
|
-
onKeyDown:
|
|
123
|
+
..._e({
|
|
124
|
+
onClick: () => Z(se(Q.current)),
|
|
125
|
+
onKeyDown: Te
|
|
124
126
|
}),
|
|
125
127
|
role: "combobox",
|
|
126
128
|
"aria-haspopup": "listbox",
|
|
127
129
|
"aria-expanded": r,
|
|
128
|
-
"aria-controls": r ?
|
|
129
|
-
"aria-activedescendant": r ?
|
|
130
|
-
"aria-labelledby":
|
|
131
|
-
"aria-label":
|
|
132
|
-
"aria-invalid":
|
|
130
|
+
"aria-controls": r ? R : void 0,
|
|
131
|
+
"aria-activedescendant": r ? S : void 0,
|
|
132
|
+
"aria-labelledby": A ?? n?.labelId,
|
|
133
|
+
"aria-label": A ? void 0 : w,
|
|
134
|
+
"aria-invalid": b ? !0 : void 0,
|
|
135
|
+
"aria-required": xe ?? n?.required ? !0 : void 0,
|
|
133
136
|
"aria-describedby": F ? z : void 0,
|
|
134
|
-
"aria-disabled":
|
|
135
|
-
disabled:
|
|
137
|
+
"aria-disabled": l ? !0 : void 0,
|
|
138
|
+
disabled: l,
|
|
136
139
|
onFocus: (e) => {
|
|
137
|
-
I(!0),
|
|
140
|
+
I(!0), he?.(e);
|
|
138
141
|
},
|
|
139
142
|
onBlur: (e) => {
|
|
140
|
-
I(!1),
|
|
143
|
+
I(!1), ye?.(e);
|
|
141
144
|
},
|
|
142
|
-
|
|
143
|
-
className: h("relative flex w-full items-center justify-between text-left outline-none", "h-10 rounded-lg border-0 px-3 text-base transition-colors", "asma-touch-ready", B ? "bg-gama-50" : "bg-transparent", Te, R && "min-w-0", n && "cursor-not-allowed", c && "pointer-events-none"),
|
|
145
|
+
className: x("relative flex w-full items-center justify-between text-left outline-none", "h-10 rounded-lg border-0 px-3 text-base transition-colors", "asma-touch-ready", B ? "bg-gama-50" : "bg-transparent", qe, u && "min-w-0", l && "cursor-not-allowed", c && "pointer-events-none"),
|
|
144
146
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
className:
|
|
147
|
-
children:
|
|
147
|
+
/* @__PURE__ */ i("span", {
|
|
148
|
+
className: x("min-w-0 flex-1 truncate", !f && "text-delta-500"),
|
|
149
|
+
children: f || C ? Be : D
|
|
148
150
|
}),
|
|
149
151
|
/* @__PURE__ */ L("span", {
|
|
150
152
|
className: "flex items-center gap-1",
|
|
151
|
-
children: [
|
|
153
|
+
children: [j && f && !l && /* @__PURE__ */ i("span", {
|
|
152
154
|
"aria-hidden": "true",
|
|
153
155
|
"data-testid": "select-clear-button",
|
|
154
156
|
className: "invisible flex items-center justify-center rounded-full p-[2px] group-focus-within:visible hover:bg-gama-100",
|
|
155
157
|
onClick: (e) => {
|
|
156
|
-
e.stopPropagation(),
|
|
158
|
+
e.stopPropagation(), te();
|
|
157
159
|
},
|
|
158
|
-
children: /* @__PURE__ */
|
|
160
|
+
children: /* @__PURE__ */ i(Ke, {
|
|
159
161
|
width: 18,
|
|
160
162
|
height: 18
|
|
161
163
|
})
|
|
162
|
-
}), /* @__PURE__ */
|
|
164
|
+
}), /* @__PURE__ */ i(ze, {
|
|
163
165
|
width: 24,
|
|
164
166
|
height: 24,
|
|
165
|
-
className:
|
|
167
|
+
className: x("shrink-0 transition-transform", B ? "text-gama-500" : Me, r && "flip-180")
|
|
166
168
|
})]
|
|
167
169
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ i("div", { className: et({
|
|
169
171
|
focused: r || k,
|
|
170
|
-
error:
|
|
171
|
-
disabled:
|
|
172
|
+
error: b,
|
|
173
|
+
disabled: l,
|
|
172
174
|
readOnly: c,
|
|
173
|
-
borderless:
|
|
175
|
+
borderless: u
|
|
174
176
|
}) })
|
|
175
177
|
]
|
|
176
178
|
}),
|
|
177
|
-
r && /* @__PURE__ */
|
|
178
|
-
root:
|
|
179
|
-
children: /* @__PURE__ */
|
|
180
|
-
ref:
|
|
179
|
+
r && /* @__PURE__ */ i(lt, {
|
|
180
|
+
root: X,
|
|
181
|
+
children: /* @__PURE__ */ i("ul", {
|
|
182
|
+
ref: Ee,
|
|
181
183
|
...Oe(),
|
|
182
|
-
id:
|
|
184
|
+
id: R,
|
|
183
185
|
role: "listbox",
|
|
184
186
|
"aria-multiselectable": d ? !0 : void 0,
|
|
185
|
-
"aria-labelledby":
|
|
186
|
-
"aria-label":
|
|
187
|
+
"aria-labelledby": A ?? n?.labelId,
|
|
188
|
+
"aria-label": A ? void 0 : w,
|
|
187
189
|
...N ? Ue : {},
|
|
188
190
|
style: {
|
|
189
191
|
...N ? Ve : {},
|
|
190
|
-
...
|
|
192
|
+
...Ie,
|
|
191
193
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif"
|
|
192
194
|
},
|
|
193
|
-
className:
|
|
194
|
-
children:
|
|
195
|
+
className: x("z-[1300] m-0 max-h-72 list-none overflow-auto rounded border border-solid border-delta-300 bg-white px-0 py-2 shadow-[0px_2px_4px_0px_rgba(34,33,51,0.15)]", "[&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", ge?.className),
|
|
196
|
+
children: Pe
|
|
195
197
|
})
|
|
196
198
|
}),
|
|
197
|
-
F && /* @__PURE__ */
|
|
198
|
-
ref:
|
|
199
|
+
F && /* @__PURE__ */ i(Je, {
|
|
200
|
+
ref: Ae,
|
|
199
201
|
id: z,
|
|
200
|
-
role:
|
|
201
|
-
error:
|
|
202
|
+
role: ve,
|
|
203
|
+
error: b,
|
|
202
204
|
message: Y,
|
|
203
205
|
className: "m-0 mr-[14px] box-border items-center",
|
|
204
|
-
style:
|
|
206
|
+
style: Re
|
|
205
207
|
})
|
|
206
208
|
]
|
|
207
209
|
});
|
|
208
210
|
};
|
|
209
211
|
export {
|
|
210
|
-
|
|
212
|
+
Et as StyledSelect
|
|
211
213
|
};
|