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
|
@@ -5,31 +5,32 @@ import { CloseIcon as pt } from "../../icons/close-icon/CloseIcon.js";
|
|
|
5
5
|
import { CheckIcon as ft } from "../../icons/check-icon/CheckIcon.js";
|
|
6
6
|
import { PlusIconCircle as mt } from "../../icons/plus-icon-circle/PlusIconCircle.js";
|
|
7
7
|
import { StyledChip as ht } from "../../data-display/chip/StyledChip.js";
|
|
8
|
-
import { StyledCheckbox as
|
|
8
|
+
import { StyledCheckbox as ue } from "../checkbox/base-ui/StyledCheckbox.js";
|
|
9
9
|
import { useBackCloses as bt } from "../../../hooks/useBackCloses.hook.js";
|
|
10
|
-
import {
|
|
10
|
+
import { fieldWidthStyle as gt } from "../field-styles.js";
|
|
11
|
+
import { LoadingIcon as xt } from "../../../table/shared-components/LoadingIcon.js";
|
|
11
12
|
import B from "./StyledSelectAutocomplete.module.js";
|
|
12
|
-
import { useEffect as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { FloatingPortal as
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
const s =
|
|
18
|
-
e && (g || S) || (
|
|
19
|
-
}, [
|
|
20
|
-
R === void 0 &&
|
|
21
|
-
}, [
|
|
22
|
-
|
|
23
|
-
R !== void 0 || s ||
|
|
13
|
+
import { useEffect as pe, useMemo as U, useRef as fe, useState as D } from "react";
|
|
14
|
+
import { jsx as o, jsxs as I } from "react/jsx-runtime";
|
|
15
|
+
import { FloatingPortal as yt, autoUpdate as wt, flip as kt, offset as vt, shift as Dt, size as It, useDismiss as Nt, useFloating as Ct, useInteractions as At, useMergeRefs as me, useRole as St } from "@floating-ui/react";
|
|
16
|
+
var Mt = (l) => typeof l == "object" && l !== null && "label" in l ? String(l.label) : String(l), Rt = (l) => typeof l == "object" && l !== null && "disabled" in l && !!l.disabled;
|
|
17
|
+
function qt({ dataTest: l, options: b, renderInput: he, value: N, onChange: C, getOptionLabel: be, getOptionKey: A, isOptionEqualToValue: V, renderOption: T, renderValue: Y, filterOptions: O, loading: q, loadingText: ge = "Loading…", noOptionsText: xe = "No options", disabled: S, readOnly: g, error: ye, helperText: we, size: ke = "small", rowSize: ve = "compact", disableClearable: De, disableCloseOnSelect: Ie, popupIcon: Ne, autoHeight: Ce, multiple: Ae, allowSelectAll: M, selectAllLabel: Se = "Select all", width: G = "full", fullWidth: Pt, classes: Me, inputValue: R, onInputChange: Re, open: J, onOpen: Pe, onClose: _e, className: $e, wrapperClassName: Le, getOptionDisabled: Ee, slotProps: Q }) {
|
|
18
|
+
const s = Ae === !0, d = be ?? Mt, P = (e, t) => V ? V(e, t) : e === t, [Oe, We] = D(!1), n = J ?? Oe, c = (e) => {
|
|
19
|
+
e && (g || S) || (J === void 0 && We(e), e ? Pe?.() : (x(null), _e?.()));
|
|
20
|
+
}, [Fe, X] = D(""), m = R ?? Fe, _ = (e, t, a) => {
|
|
21
|
+
R === void 0 && X(t), Re?.(e, t, a);
|
|
22
|
+
}, [r, x] = D(null), Z = `${l}-listbox`, K = fe([]), ee = fe(null), [je, ze] = D(null), [te, He] = D(null), i = s ? Array.isArray(N) ? N : [] : [], y = s ? null : N ?? null, le = !s && y !== null ? d(y) : "";
|
|
23
|
+
pe(() => {
|
|
24
|
+
R !== void 0 || s || X(le);
|
|
24
25
|
}, [
|
|
25
26
|
R,
|
|
26
27
|
s,
|
|
27
|
-
|
|
28
|
+
le
|
|
28
29
|
]);
|
|
29
|
-
const
|
|
30
|
+
const W = (e) => s ? i.some((t) => P(e, t)) : y !== null && P(e, y), $ = (e) => Ee?.(e) ?? Rt(e), se = U(() => {
|
|
30
31
|
const e = [...b];
|
|
31
32
|
if (O) return O(e, { inputValue: m });
|
|
32
|
-
const t = !s &&
|
|
33
|
+
const t = !s && y !== null ? d(y).toLowerCase() : null;
|
|
33
34
|
if (!m || m.toLowerCase() === t) return e;
|
|
34
35
|
const a = m.toLowerCase();
|
|
35
36
|
return e.filter((p) => d(p).toLowerCase().includes(a));
|
|
@@ -38,66 +39,66 @@ function Vt({ dataTest: l, options: b, renderInput: me, value: N, onChange: C, g
|
|
|
38
39
|
m,
|
|
39
40
|
O,
|
|
40
41
|
N
|
|
41
|
-
]), u = U(() =>
|
|
42
|
-
|
|
42
|
+
]), u = U(() => se.slice(0, 100), [se]), re = u.flatMap((e, t) => $(e) ? [] : [t]), F = M && s ? [-1, ...re] : re, oe = u.map((e, t) => t), h = M && s ? [-1, ...oe] : oe, k = u.findIndex(W);
|
|
43
|
+
pe(() => {
|
|
43
44
|
if (!n) return;
|
|
44
|
-
const e =
|
|
45
|
+
const e = r ?? k;
|
|
45
46
|
if (e < 0) return;
|
|
46
|
-
const t = requestAnimationFrame(() =>
|
|
47
|
+
const t = requestAnimationFrame(() => K.current[e]?.scrollIntoView({ block: "nearest" }));
|
|
47
48
|
return () => cancelAnimationFrame(t);
|
|
48
49
|
}, [
|
|
49
|
-
|
|
50
|
+
r,
|
|
50
51
|
n,
|
|
51
|
-
|
|
52
|
+
te,
|
|
52
53
|
k
|
|
53
54
|
]);
|
|
54
|
-
const { refs: L, floatingStyles: Be, context:
|
|
55
|
+
const { refs: L, floatingStyles: Be, context: ne } = Ct({
|
|
55
56
|
open: n,
|
|
56
57
|
onOpenChange: c,
|
|
57
58
|
placement: "bottom-start",
|
|
58
59
|
strategy: "fixed",
|
|
59
60
|
whileElementsMounted: wt,
|
|
60
61
|
middleware: [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
vt(0),
|
|
63
|
+
kt({ padding: 8 }),
|
|
64
|
+
Dt({ padding: 8 }),
|
|
65
|
+
It({ apply({ rects: e, availableHeight: t }) {
|
|
66
|
+
ze(e.reference.width), He(Ce ? t - 8 : Math.min(t - 8, 320));
|
|
66
67
|
} })
|
|
67
68
|
]
|
|
68
|
-
}), { getReferenceProps: Ue, getFloatingProps: Ve, getItemProps: Te } =
|
|
69
|
+
}), { getReferenceProps: Ue, getFloatingProps: Ve, getItemProps: Te } = At([Nt(ne), St(ne, { role: "listbox" })]);
|
|
69
70
|
bt({
|
|
70
71
|
active: n,
|
|
71
72
|
requestClose: () => c(!1)
|
|
72
73
|
});
|
|
73
|
-
const Ye =
|
|
74
|
+
const Ye = me([L.setReference]), ae = U(() => n ? it(L.reference.current) : void 0, [n, L]), j = ct(ae), qe = me([dt(L.setFloating, j)]), Ge = (e) => F.includes(k) ? k : F[e === 1 ? 0 : F.length - 1] ?? null, Je = (e) => {
|
|
74
75
|
h.length !== 0 && x((t) => {
|
|
75
76
|
const a = h.indexOf(t ?? k);
|
|
76
77
|
return a === -1 ? h[e === 1 ? 0 : h.length - 1] ?? null : h[Math.min(Math.max(a + e, 0), h.length - 1)] ?? null;
|
|
77
78
|
});
|
|
78
|
-
}, v = (e, t, a = !s || !
|
|
79
|
+
}, v = (e, t, a = !s || !Ie) => {
|
|
79
80
|
if (s) {
|
|
80
|
-
const p = i.some((f) => P(t, f)),
|
|
81
|
-
C?.(e,
|
|
81
|
+
const p = i.some((f) => P(t, f)), w = p ? i.filter((f) => !P(t, f)) : [...i, t];
|
|
82
|
+
C?.(e, w, p ? "removeOption" : "selectOption", { option: t }), _(e, "", "reset"), a && c(!1);
|
|
82
83
|
} else
|
|
83
|
-
C?.(e, t, "selectOption", { option: t }),
|
|
84
|
-
},
|
|
85
|
-
C?.(e, s ? [] : null, "clear", void 0),
|
|
86
|
-
},
|
|
84
|
+
C?.(e, t, "selectOption", { option: t }), _(e, d(t), "reset"), a && c(!1);
|
|
85
|
+
}, ie = (e) => {
|
|
86
|
+
C?.(e, s ? [] : null, "clear", void 0), _(e, "", "clear");
|
|
87
|
+
}, z = (e) => {
|
|
87
88
|
const t = b.length > 0 && i.length === b.length;
|
|
88
89
|
C?.(e, t ? [] : b, t ? "clear" : "selectOption", void 0);
|
|
89
90
|
}, Qe = (e) => {
|
|
90
|
-
if (e.key === "Backspace" && m === "" &&
|
|
91
|
+
if (e.key === "Backspace" && m === "" && ce) {
|
|
91
92
|
const t = i[i.length - 1];
|
|
92
|
-
s ? t !== void 0 && v(e, t, !1) :
|
|
93
|
+
s ? t !== void 0 && v(e, t, !1) : ie(e);
|
|
93
94
|
} else if (e.key === "Enter" && !n)
|
|
94
95
|
e.preventDefault(), c(!0);
|
|
95
|
-
else if (e.key === "Enter" &&
|
|
96
|
-
e.preventDefault(),
|
|
97
|
-
else if (e.key === "Enter" &&
|
|
96
|
+
else if (e.key === "Enter" && r === -1)
|
|
97
|
+
e.preventDefault(), z(e);
|
|
98
|
+
else if (e.key === "Enter" && r != null && u[r] != null) {
|
|
98
99
|
e.preventDefault();
|
|
99
|
-
const t = u[
|
|
100
|
-
|
|
100
|
+
const t = u[r];
|
|
101
|
+
$(t) || v(e, t, !0);
|
|
101
102
|
} else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
102
103
|
if (e.preventDefault(), !n) {
|
|
103
104
|
x(Ge(e.key === "ArrowDown" ? 1 : -1)), c(!0);
|
|
@@ -106,19 +107,19 @@ function Vt({ dataTest: l, options: b, renderInput: me, value: N, onChange: C, g
|
|
|
106
107
|
Je(e.key === "ArrowDown" ? 1 : -1);
|
|
107
108
|
} else if (e.key === "Home" || e.key === "End")
|
|
108
109
|
e.preventDefault(), x(h[e.key === "Home" ? 0 : h.length - 1] ?? null);
|
|
109
|
-
else if (e.key === " " &&
|
|
110
|
-
e.preventDefault(),
|
|
111
|
-
else if (e.key === " " &&
|
|
110
|
+
else if (e.key === " " && r === -1)
|
|
111
|
+
e.preventDefault(), z(e);
|
|
112
|
+
else if (e.key === " " && r != null && u[r] != null) {
|
|
112
113
|
e.preventDefault();
|
|
113
|
-
const t = u[
|
|
114
|
-
|
|
114
|
+
const t = u[r];
|
|
115
|
+
$(t) || v(e, t, !1);
|
|
115
116
|
} else e.key === "Escape" && n ? (e.preventDefault(), e.stopPropagation(), c(!1)) : e.key === "Tab" && c(!1);
|
|
116
|
-
},
|
|
117
|
-
let
|
|
118
|
-
n &&
|
|
117
|
+
}, ce = !De && !g && !S && (s ? i.length > 0 : y !== null);
|
|
118
|
+
let de;
|
|
119
|
+
n && r != null && (r === -1 || u[r] !== void 0) && (de = r === -1 ? `${l}-select-all` : `${l}-option-${r}`);
|
|
119
120
|
const Xe = (e) => {
|
|
120
|
-
e.preventDefault(), !(S || g) && (
|
|
121
|
-
}, Ze = s ? Y ? Y(i, ({ index: e }) => ({ "data-index": e })) : i.map((e, t) => /* @__PURE__ */
|
|
121
|
+
e.preventDefault(), !(S || g) && (ee.current?.focus(), c(!n));
|
|
122
|
+
}, Ze = s ? Y ? Y(i, ({ index: e }) => ({ "data-index": e })) : i.map((e, t) => /* @__PURE__ */ o(ht, {
|
|
122
123
|
dataTest: `selected-chip-${d(e)}`,
|
|
123
124
|
label: d(e),
|
|
124
125
|
readOnly: g,
|
|
@@ -127,26 +128,26 @@ function Vt({ dataTest: l, options: b, renderInput: me, value: N, onChange: C, g
|
|
|
127
128
|
}, A ? A(e) : `${d(e)}-${t}`)) : void 0, Ke = /* @__PURE__ */ I("span", {
|
|
128
129
|
className: "flex items-center gap-1",
|
|
129
130
|
children: [
|
|
130
|
-
q && /* @__PURE__ */
|
|
131
|
+
q && /* @__PURE__ */ o(xt, {
|
|
131
132
|
width: 20,
|
|
132
133
|
height: 20,
|
|
133
134
|
className: "animate-spin"
|
|
134
135
|
}),
|
|
135
|
-
|
|
136
|
+
ce && /* @__PURE__ */ o("button", {
|
|
136
137
|
type: "button",
|
|
137
138
|
tabIndex: -1,
|
|
138
139
|
"aria-label": "Clear",
|
|
139
140
|
"data-testid": `${l}-clear`,
|
|
140
141
|
className: "invisible flex min-h-6 min-w-6 cursor-pointer items-center justify-center rounded-full border-0 bg-delta-50 group-focus-within:visible",
|
|
141
142
|
onMouseDown: (e) => e.preventDefault(),
|
|
142
|
-
onClick:
|
|
143
|
-
children: /* @__PURE__ */
|
|
143
|
+
onClick: ie,
|
|
144
|
+
children: /* @__PURE__ */ o(pt, {
|
|
144
145
|
width: 20,
|
|
145
146
|
height: 20,
|
|
146
147
|
className: "text-delta-700"
|
|
147
148
|
})
|
|
148
149
|
}),
|
|
149
|
-
g ? null : /* @__PURE__ */
|
|
150
|
+
g ? null : /* @__PURE__ */ o("button", {
|
|
150
151
|
type: "button",
|
|
151
152
|
tabIndex: -1,
|
|
152
153
|
"aria-label": "Toggle options",
|
|
@@ -155,11 +156,11 @@ function Vt({ dataTest: l, options: b, renderInput: me, value: N, onChange: C, g
|
|
|
155
156
|
className: "flex cursor-pointer items-center border-0 bg-transparent",
|
|
156
157
|
onMouseDown: (e) => e.preventDefault(),
|
|
157
158
|
onClick: Xe,
|
|
158
|
-
children:
|
|
159
|
+
children: Ne ?? (s ? /* @__PURE__ */ o(mt, {
|
|
159
160
|
width: 24,
|
|
160
161
|
height: 24,
|
|
161
162
|
className: "text-delta-700"
|
|
162
|
-
}) : /* @__PURE__ */
|
|
163
|
+
}) : /* @__PURE__ */ o(ut, {
|
|
163
164
|
width: 24,
|
|
164
165
|
height: 24,
|
|
165
166
|
className: E(B["select-custom-icon"], n && B["select-custom-icon-open"], "text-delta-700")
|
|
@@ -168,25 +169,25 @@ function Vt({ dataTest: l, options: b, renderInput: me, value: N, onChange: C, g
|
|
|
168
169
|
]
|
|
169
170
|
}), et = {
|
|
170
171
|
disabled: S,
|
|
171
|
-
size:
|
|
172
|
+
size: ke,
|
|
172
173
|
fullWidth: !0,
|
|
173
|
-
error:
|
|
174
|
+
error: ye,
|
|
174
175
|
helperText: we,
|
|
175
176
|
value: m,
|
|
176
177
|
onChange: (e) => {
|
|
177
|
-
x(null),
|
|
178
|
+
x(null), _(e, e.target.value, "input"), n || c(!0);
|
|
178
179
|
},
|
|
179
180
|
onKeyDown: Qe,
|
|
180
181
|
slotProps: {
|
|
181
182
|
htmlInput: {
|
|
182
183
|
...Ue(),
|
|
183
|
-
ref:
|
|
184
|
+
ref: ee,
|
|
184
185
|
onClick: () => c(!0),
|
|
185
186
|
role: "combobox",
|
|
186
187
|
"aria-autocomplete": "list",
|
|
187
188
|
"aria-expanded": n,
|
|
188
|
-
"aria-controls": n ?
|
|
189
|
-
"aria-activedescendant":
|
|
189
|
+
"aria-controls": n ? Z : void 0,
|
|
190
|
+
"aria-activedescendant": de,
|
|
190
191
|
autoComplete: "off",
|
|
191
192
|
readOnly: g
|
|
192
193
|
},
|
|
@@ -196,38 +197,38 @@ function Vt({ dataTest: l, options: b, renderInput: me, value: N, onChange: C, g
|
|
|
196
197
|
endAdornment: Ke
|
|
197
198
|
}
|
|
198
199
|
}
|
|
199
|
-
}, tt = E("asma-pressable", "relative box-border flex cursor-pointer items-center gap-x-3 px-3 py-2 text-base text-delta-800",
|
|
200
|
-
const { key: p, ...
|
|
200
|
+
}, tt = E("asma-pressable", "relative box-border flex cursor-pointer items-center gap-x-3 px-3 py-2 text-base text-delta-800", ve === "regular" ? "min-h-12" : "min-h-10", "aria-selected:bg-gama-50 hover:bg-delta-50", "aria-disabled:cursor-default aria-disabled:!bg-transparent aria-disabled:text-delta-300"), lt = (e, t, a) => {
|
|
201
|
+
const { key: p, ...w } = e;
|
|
201
202
|
return /* @__PURE__ */ I("li", {
|
|
202
|
-
...
|
|
203
|
+
...w,
|
|
203
204
|
children: [
|
|
204
|
-
e["data-active"] !== void 0 && /* @__PURE__ */
|
|
205
|
+
e["data-active"] !== void 0 && /* @__PURE__ */ o("span", {
|
|
205
206
|
"aria-hidden": "true",
|
|
206
207
|
className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
|
|
207
208
|
}),
|
|
208
|
-
s ? /* @__PURE__ */
|
|
209
|
+
s ? /* @__PURE__ */ o(ue, {
|
|
209
210
|
dataTest: `${l}-${d(t)}-checkbox`,
|
|
210
211
|
checked: a.selected,
|
|
211
212
|
size: "medium",
|
|
212
213
|
checkboxClassName: "!h-4 !w-4",
|
|
213
214
|
hideWrapper: !0,
|
|
214
215
|
decorative: !0
|
|
215
|
-
}) : /* @__PURE__ */
|
|
216
|
+
}) : /* @__PURE__ */ o("span", {
|
|
216
217
|
className: "w-5",
|
|
217
|
-
children: a.selected && /* @__PURE__ */
|
|
218
|
+
children: a.selected && /* @__PURE__ */ o(ft, {
|
|
218
219
|
width: 20,
|
|
219
220
|
height: 20,
|
|
220
221
|
className: "text-gama-500"
|
|
221
222
|
})
|
|
222
223
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ o("span", {
|
|
224
225
|
className: "line-clamp-2 min-w-0 flex-1 break-words",
|
|
225
226
|
children: d(t)
|
|
226
227
|
})
|
|
227
228
|
]
|
|
228
229
|
}, p);
|
|
229
230
|
}, st = (e, t) => {
|
|
230
|
-
const a =
|
|
231
|
+
const a = $(e), p = {
|
|
231
232
|
...Te({
|
|
232
233
|
onMouseDown: (f) => f.preventDefault(),
|
|
233
234
|
onClick: (f) => {
|
|
@@ -237,83 +238,85 @@ function Vt({ dataTest: l, options: b, renderInput: me, value: N, onChange: C, g
|
|
|
237
238
|
}),
|
|
238
239
|
key: A ? String(A(e)) : `${d(e)}-${t}`,
|
|
239
240
|
ref: (f) => {
|
|
240
|
-
|
|
241
|
+
K.current[t] = f;
|
|
241
242
|
},
|
|
242
243
|
role: "option",
|
|
243
244
|
id: `${l}-option-${t}`,
|
|
244
|
-
"aria-selected":
|
|
245
|
+
"aria-selected": W(e),
|
|
245
246
|
"aria-disabled": a || void 0,
|
|
246
|
-
"data-active":
|
|
247
|
+
"data-active": r === t ? "" : void 0,
|
|
247
248
|
className: tt
|
|
248
|
-
},
|
|
249
|
-
selected:
|
|
249
|
+
}, w = {
|
|
250
|
+
selected: W(e),
|
|
250
251
|
index: t,
|
|
251
252
|
inputValue: m
|
|
252
253
|
};
|
|
253
|
-
return T ? T(p, e,
|
|
254
|
-
},
|
|
254
|
+
return T ? T(p, e, w) : lt(p, e, w);
|
|
255
|
+
}, rt = !!(M && s), H = b.length > 0 && i.length === b.length, ot = i.length > 0 && !H;
|
|
255
256
|
return /* @__PURE__ */ I("div", {
|
|
256
|
-
className: E(B.styledSelectAutocompleteWrapper,
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
className: E(B.styledSelectAutocompleteWrapper, Le, $e),
|
|
258
|
+
"data-field-width": G,
|
|
259
|
+
style: gt(G),
|
|
260
|
+
children: [he(et), n && /* @__PURE__ */ o(yt, {
|
|
261
|
+
root: ae,
|
|
259
262
|
children: /* @__PURE__ */ I("ul", {
|
|
260
263
|
ref: qe,
|
|
261
|
-
...
|
|
264
|
+
...j ? nt : {},
|
|
262
265
|
style: {
|
|
263
|
-
...
|
|
266
|
+
...j ? at : {},
|
|
264
267
|
...Be,
|
|
265
|
-
width:
|
|
266
|
-
maxHeight:
|
|
268
|
+
width: je ?? void 0,
|
|
269
|
+
maxHeight: te ?? void 0,
|
|
267
270
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
268
|
-
...
|
|
271
|
+
...Q?.popper?.style
|
|
269
272
|
},
|
|
270
273
|
...Ve(),
|
|
271
|
-
id:
|
|
274
|
+
id: Z,
|
|
272
275
|
role: "listbox",
|
|
273
276
|
"aria-multiselectable": s ? !0 : void 0,
|
|
274
|
-
className: E("z-[1300] m-0 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)]",
|
|
277
|
+
className: E("z-[1300] m-0 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)]", rt && "py-0", "[&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", Me?.listbox, Q?.popper?.className),
|
|
275
278
|
children: [M && s && /* @__PURE__ */ I("li", {
|
|
276
279
|
id: `${l}-select-all`,
|
|
277
280
|
role: "option",
|
|
278
|
-
"aria-selected":
|
|
279
|
-
"data-active":
|
|
281
|
+
"aria-selected": H,
|
|
282
|
+
"data-active": r === -1 ? "" : void 0,
|
|
280
283
|
tabIndex: -1,
|
|
281
284
|
onMouseDown: (e) => e.preventDefault(),
|
|
282
|
-
onClick:
|
|
285
|
+
onClick: z,
|
|
283
286
|
onMouseMove: () => x(null),
|
|
284
287
|
className: "relative box-border flex h-8 cursor-pointer items-center gap-x-3 bg-[var(--colors-gray-10)] px-3 text-xs font-semibold uppercase tracking-[0.2px] text-delta-600 hover:bg-delta-50",
|
|
285
288
|
children: [
|
|
286
|
-
|
|
289
|
+
r === -1 && /* @__PURE__ */ o("span", {
|
|
287
290
|
"aria-hidden": "true",
|
|
288
291
|
className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
|
|
289
292
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ o(ue, {
|
|
291
294
|
dataTest: `${l}-select-all`,
|
|
292
|
-
checked:
|
|
293
|
-
indeterminate:
|
|
295
|
+
checked: H,
|
|
296
|
+
indeterminate: ot,
|
|
294
297
|
size: "medium",
|
|
295
298
|
checkboxClassName: "!h-4 !w-4",
|
|
296
299
|
hideWrapper: !0,
|
|
297
300
|
decorative: !0
|
|
298
301
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ o("span", {
|
|
300
303
|
className: "flex-1 truncate",
|
|
301
|
-
children:
|
|
304
|
+
children: Se
|
|
302
305
|
})
|
|
303
306
|
]
|
|
304
|
-
}), q ? /* @__PURE__ */
|
|
307
|
+
}), q ? /* @__PURE__ */ o("li", {
|
|
305
308
|
role: "presentation",
|
|
306
309
|
className: "px-3 py-2 text-sm text-delta-600",
|
|
307
|
-
children:
|
|
308
|
-
}) : u.length === 0 ? /* @__PURE__ */
|
|
310
|
+
children: ge
|
|
311
|
+
}) : u.length === 0 ? /* @__PURE__ */ o("li", {
|
|
309
312
|
role: "presentation",
|
|
310
313
|
className: "px-3 py-2 text-sm text-delta-600",
|
|
311
|
-
children:
|
|
314
|
+
children: xe
|
|
312
315
|
}) : u.map(st)]
|
|
313
316
|
})
|
|
314
317
|
})]
|
|
315
318
|
});
|
|
316
319
|
}
|
|
317
320
|
export {
|
|
318
|
-
|
|
321
|
+
qt as StyledSelectAutocomplete
|
|
319
322
|
};
|
|
@@ -18,7 +18,7 @@ function Bt({ dataTest: i, min: r = 0, max: a = 100, step: h = 1, value: T, defa
|
|
|
18
18
|
if (U?.length && Ut(U)) return /* @__PURE__ */ c(Dt, {
|
|
19
19
|
dataTest: i,
|
|
20
20
|
disableClearable: !0,
|
|
21
|
-
className:
|
|
21
|
+
className: st,
|
|
22
22
|
size: "small",
|
|
23
23
|
disabled: s,
|
|
24
24
|
error: N,
|
|
@@ -103,7 +103,7 @@ function Bt({ dataTest: i, min: r = 0, max: a = 100, step: h = 1, value: T, defa
|
|
|
103
103
|
onKeyUp: (e) => A(H, e, Number(e.currentTarget.value), t)
|
|
104
104
|
}, t);
|
|
105
105
|
return /* @__PURE__ */ x("div", {
|
|
106
|
-
className: u("flex max-w-
|
|
106
|
+
className: u("flex max-w-form-column flex-col gap-3", n && "h-full"),
|
|
107
107
|
children: [
|
|
108
108
|
!n && (D ?? $) && /* @__PURE__ */ x("div", {
|
|
109
109
|
className: "grid w-full grid-cols-2 gap-4",
|
|
@@ -1,74 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { CharacterCounter as R } from "../../../helpers/CharacterCounter.js";
|
|
2
|
+
import { useHelperSlot as U } from "../../../helpers/useHelperSlot.js";
|
|
3
|
+
import { fieldWidthStyle as V } from "../field-styles.js";
|
|
4
|
+
import t from "./StyledTextarea.module.js";
|
|
5
|
+
import { useEffect as X, useId as m, useRef as Y } from "react";
|
|
6
|
+
import { jsx as e, jsxs as Z } from "react/jsx-runtime";
|
|
7
|
+
var nt = ({ id: A, variant: h = "active", label: s = "", labelClassName: M = "", description: n = "", reserveHelperText: F, value: a = "", minRows: r = 3, maxRows: i = 1 / 0, disabled: x, error: l, errorMessage: _, containerClassName: j = "", className: w = "", maxLength: B = 1 / 0, counter: C, refLink: E, dataTest: k, counterLimit: g, width: y = "full", locale: W, ...d }) => {
|
|
8
|
+
const q = Y(null), c = E ?? q, f = !!(C && g), u = m(), b = m(), z = m(), $ = A ?? z, I = l ? _ : n, { show: N, role: D } = U("StyledTextarea", l, I, F);
|
|
9
|
+
X(() => {
|
|
10
|
+
const o = c.current;
|
|
9
11
|
if (!o) return;
|
|
10
|
-
const
|
|
12
|
+
const p = window.getComputedStyle(o), v = parseFloat(p.lineHeight) || 24, T = parseFloat(p.paddingTop), H = parseFloat(p.paddingBottom);
|
|
11
13
|
o.style.height = "auto";
|
|
12
|
-
const K = o.scrollHeight - T -
|
|
13
|
-
o.style.height = `${Q *
|
|
14
|
+
const K = o.scrollHeight - T - H, O = Math.max(1, Math.ceil(K / v)), Q = Math.min(Math.max(O, r), i);
|
|
15
|
+
o.style.height = `${Q * v + T + H}px`;
|
|
14
16
|
}, [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
c,
|
|
18
|
+
a,
|
|
17
19
|
r,
|
|
18
20
|
i,
|
|
19
|
-
|
|
21
|
+
f
|
|
20
22
|
]), i < r && (r = i);
|
|
21
|
-
const G =
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
className: `relative flex flex-col gap-1 ${
|
|
24
|
-
"data-testid":
|
|
23
|
+
const G = l ? "error" : "active", S = l ? "error" : x ? "disabled" : "active", J = typeof s != "string" || s.trim() !== "" ? void 0 : typeof n == "string" && n.trim() !== "" ? n : d.placeholder;
|
|
24
|
+
return /* @__PURE__ */ Z("div", {
|
|
25
|
+
className: `relative flex flex-col gap-1 ${j}`,
|
|
26
|
+
"data-testid": k,
|
|
27
|
+
"data-field-width": y,
|
|
28
|
+
style: V(y),
|
|
25
29
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ e("label", {
|
|
27
31
|
htmlFor: $,
|
|
28
|
-
className: `${
|
|
29
|
-
children:
|
|
32
|
+
className: `${t.label} ${t[S]} ${M}`,
|
|
33
|
+
children: s
|
|
30
34
|
}),
|
|
31
|
-
N && /* @__PURE__ */
|
|
32
|
-
id:
|
|
35
|
+
N && /* @__PURE__ */ e("span", {
|
|
36
|
+
id: u,
|
|
33
37
|
role: D,
|
|
34
|
-
className: `${
|
|
35
|
-
children:
|
|
38
|
+
className: `${t.description} ${t[S]} min-h-[24px]`,
|
|
39
|
+
children: I
|
|
36
40
|
}),
|
|
37
|
-
|
|
41
|
+
h === "view_only" ? /* @__PURE__ */ e("div", {
|
|
38
42
|
className: "pt-3 font-roboto text-base font-normal text-delta-700",
|
|
39
|
-
children:
|
|
40
|
-
}) :
|
|
43
|
+
children: a
|
|
44
|
+
}) : h === "not_editable" ? /* @__PURE__ */ e("div", {
|
|
41
45
|
className: "rounded bg-delta-50 p-3 font-roboto text-base font-normal text-delta-700",
|
|
42
|
-
children:
|
|
43
|
-
}) : /* @__PURE__ */
|
|
44
|
-
...
|
|
45
|
-
"aria-describedby": [N ?
|
|
46
|
-
"aria-invalid":
|
|
47
|
-
"aria-label":
|
|
46
|
+
children: a
|
|
47
|
+
}) : /* @__PURE__ */ e("textarea", {
|
|
48
|
+
...d,
|
|
49
|
+
"aria-describedby": [N ? u : null, f ? b : null].filter(Boolean).join(" ") || void 0,
|
|
50
|
+
"aria-invalid": l,
|
|
51
|
+
"aria-label": d["aria-label"] ?? J,
|
|
48
52
|
id: $,
|
|
49
|
-
ref:
|
|
50
|
-
className: `${
|
|
53
|
+
ref: c,
|
|
54
|
+
className: `${t.textarea} ${t[G]} ${w}`,
|
|
51
55
|
wrap: "soft",
|
|
52
|
-
value:
|
|
53
|
-
disabled:
|
|
56
|
+
value: a,
|
|
57
|
+
disabled: x,
|
|
54
58
|
maxLength: B
|
|
55
59
|
}),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}), /* @__PURE__ */ c("div", {
|
|
64
|
-
id: u,
|
|
65
|
-
"aria-live": "polite",
|
|
66
|
-
className: "sr-only",
|
|
67
|
-
children: [p - t.length, " characters remaining"]
|
|
68
|
-
})] })
|
|
60
|
+
f && /* @__PURE__ */ e(R, {
|
|
61
|
+
id: b,
|
|
62
|
+
length: a.length,
|
|
63
|
+
limit: g,
|
|
64
|
+
locale: W,
|
|
65
|
+
className: "self-end"
|
|
66
|
+
})
|
|
69
67
|
]
|
|
70
68
|
});
|
|
71
69
|
};
|
|
72
70
|
export {
|
|
73
|
-
|
|
71
|
+
nt as StyledTextarea
|
|
74
72
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var a = "
|
|
1
|
+
var a = "_textarea_lhzo8_1", e = "_active_lhzo8_1", _ = "_error_lhzo8_41", r = "_label_lhzo8_82", l = "_disabled_lhzo8_90", t = "_description_lhzo8_95", o = {
|
|
2
2
|
textarea: a,
|
|
3
3
|
active: e,
|
|
4
4
|
error: _,
|
|
5
5
|
label: r,
|
|
6
|
-
disabled:
|
|
6
|
+
disabled: l,
|
|
7
7
|
description: t
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
o as default
|
|
11
11
|
};
|