asma-ui-core 3.73.1 → 3.74.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/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +32 -32
- package/dist/components/inputs/input-field/StyledInputField.js +114 -122
- package/dist/components/inputs/radio-button/base-ui/StyledRadioGroup.js +30 -36
- package/dist/components/inputs/select/StyledSelect.js +90 -96
- package/dist/components/inputs/slider/StyledSlider.js +58 -64
- package/dist/components/inputs/textarea/StyledTextarea.js +44 -47
- package/dist/helpers/HelperRow.js +19 -0
- package/dist/helpers/useHelperSlot.js +12 -0
- package/dist/src/helpers/HelperRow.d.ts +16 -0
- package/dist/src/helpers/useHelperSlot.d.ts +11 -0
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as j } from "../../../../helpers/cn.js";
|
|
2
2
|
import { LoadingIcon as Y } from "../../../icons/loading-icon/LoadingIcon.js";
|
|
3
3
|
import { CheckIcon as Z } from "../../../icons/check-icon/CheckIcon.js";
|
|
4
4
|
import { PlusIconCircle as ee } from "../../../icons/plus-icon-circle/PlusIconCircle.js";
|
|
5
|
-
import { StyledChip as
|
|
5
|
+
import { StyledChip as B } from "../../../data-display/chip/StyledChip.js";
|
|
6
6
|
import { StyledCheckbox as te } from "../../checkbox/base-ui/StyledCheckbox.js";
|
|
7
|
-
import { StyledTooltip as
|
|
7
|
+
import { StyledTooltip as L } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
8
8
|
import { StyledInputField as le } from "../../input-field/StyledInputField.js";
|
|
9
9
|
import { StyledSelectAutocomplete as ae } from "../../select-autocomplete/StyledSelectAutocomplete.js";
|
|
10
10
|
import { DynamicInteractiveChipGroup as re } from "./DynamicInteractiveChipGroup.js";
|
|
11
|
-
import { createElement as
|
|
12
|
-
import { Fragment as
|
|
13
|
-
var ye = oe((S,
|
|
14
|
-
const [
|
|
11
|
+
import { createElement as q, forwardRef as oe, useCallback as b, useState as ne } from "react";
|
|
12
|
+
import { Fragment as E, jsx as l, jsxs as O } from "react/jsx-runtime";
|
|
13
|
+
var ye = oe((S, F) => {
|
|
14
|
+
const [z, k] = ne(!1), { options: f, dataTest: g, value: x, readOnly: u, multiple: o, required: H, onChange: y, size: K, title: v, noOptionsText: _, placeholder: R, disabled: I, helperText: G, disableHelperText: A, error: N, valueKey: P = "value", labelKey: W = "label", renderLabel: i, getOptionTooltip: V, startAdornment: J, autocompleteProps: n, loading: m, maxTags: M, onFocus: Q, onBlur: U } = S, C = f.length < 11, s = (e) => typeof e == "object" ? e?.[W]?.toString() ?? "" : e?.toString() ?? "", p = b((e) => typeof e == "object" ? e?.[P] : e, [P]), D = b((e, t) => p(e) === p(t), [p]), w = (e) => {
|
|
15
15
|
const t = p(e);
|
|
16
16
|
return t == null ? "" : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : e == null ? "" : s(e);
|
|
17
|
-
},
|
|
17
|
+
}, $ = b((e) => {
|
|
18
18
|
k(!0), n?.onOpen?.(e);
|
|
19
19
|
}, [n]), X = b((e, t) => {
|
|
20
20
|
k(!1), n?.onClose?.(e, t);
|
|
@@ -28,18 +28,18 @@ var ye = oe((S, E) => {
|
|
|
28
28
|
className: "text-base font-semibold text-delta-800",
|
|
29
29
|
children: v
|
|
30
30
|
}), /* @__PURE__ */ l(ae, {
|
|
31
|
-
open:
|
|
32
|
-
onOpen:
|
|
31
|
+
open: z,
|
|
32
|
+
onOpen: $,
|
|
33
33
|
onClose: X,
|
|
34
34
|
disableCloseOnSelect: o,
|
|
35
35
|
dataTest: g,
|
|
36
36
|
disabled: !!I || !!m,
|
|
37
|
-
noOptionsText:
|
|
37
|
+
noOptionsText: _,
|
|
38
38
|
loading: m,
|
|
39
39
|
readOnly: u,
|
|
40
40
|
value: x,
|
|
41
|
-
size:
|
|
42
|
-
disableClearable:
|
|
41
|
+
size: K,
|
|
42
|
+
disableClearable: H,
|
|
43
43
|
options: f,
|
|
44
44
|
fullWidth: !0,
|
|
45
45
|
classes: { listbox: "max-h-[300px]" },
|
|
@@ -48,13 +48,13 @@ var ye = oe((S, E) => {
|
|
|
48
48
|
y(t);
|
|
49
49
|
},
|
|
50
50
|
filterSelectedOptions: !1,
|
|
51
|
-
isOptionEqualToValue: n?.isOptionEqualToValue ??
|
|
51
|
+
isOptionEqualToValue: n?.isOptionEqualToValue ?? D,
|
|
52
52
|
autoHeight: !0,
|
|
53
53
|
multiple: o,
|
|
54
54
|
renderValue: o ? (e) => {
|
|
55
55
|
if (!Array.isArray(e)) return null;
|
|
56
56
|
const t = e, d = M ?? f.length, a = t.slice(0, d), c = t.length - d;
|
|
57
|
-
return [...a.map((r) => /* @__PURE__ */ l(
|
|
57
|
+
return [...a.map((r) => /* @__PURE__ */ l(B, {
|
|
58
58
|
dataTest: `${w(r)}-chip`,
|
|
59
59
|
readOnly: u,
|
|
60
60
|
variant: "outlined",
|
|
@@ -65,13 +65,13 @@ var ye = oe((S, E) => {
|
|
|
65
65
|
},
|
|
66
66
|
disabled: !!I || !!m,
|
|
67
67
|
onDelete: () => {
|
|
68
|
-
Array.isArray(x) && y(x.filter((h) => !
|
|
68
|
+
Array.isArray(x) && y(x.filter((h) => !D(h, r)));
|
|
69
69
|
}
|
|
70
|
-
}, w(r))), c > 0 ? /* @__PURE__ */ l(
|
|
70
|
+
}, w(r))), c > 0 ? /* @__PURE__ */ l(B, {
|
|
71
71
|
dataTest: "remaining-count-tag-chip",
|
|
72
72
|
label: `+${c}`,
|
|
73
73
|
variant: "outlined",
|
|
74
|
-
onClick:
|
|
74
|
+
onClick: $
|
|
75
75
|
}, "remaining-count") : null];
|
|
76
76
|
} : void 0,
|
|
77
77
|
popupIcon: m ? /* @__PURE__ */ l(Y, {
|
|
@@ -82,21 +82,21 @@ var ye = oe((S, E) => {
|
|
|
82
82
|
width: 24
|
|
83
83
|
}) : void 0,
|
|
84
84
|
renderOption: (e, t, d) => {
|
|
85
|
-
const a = typeof t == "object" ? !!t?.disabled : !1, c =
|
|
85
|
+
const a = typeof t == "object" ? !!t?.disabled : !1, c = V ? V(t) : null;
|
|
86
86
|
if (o) {
|
|
87
87
|
const h = d.selected;
|
|
88
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ q("li", {
|
|
89
89
|
...e,
|
|
90
90
|
role: "option",
|
|
91
91
|
"aria-selected": h,
|
|
92
92
|
key: e.id,
|
|
93
93
|
onClick: a ? void 0 : e.onClick,
|
|
94
|
-
className:
|
|
94
|
+
className: j("flex min-h-10 cursor-pointer items-center gap-x-1 bg-white px-2 text-base aria-selected:bg-gama-50 hover:bg-gama-50", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
|
|
95
95
|
"aria-disabled": a
|
|
96
|
-
}, /* @__PURE__ */ l(
|
|
96
|
+
}, /* @__PURE__ */ l(L, {
|
|
97
97
|
arrow: !0,
|
|
98
98
|
title: c,
|
|
99
|
-
children: /* @__PURE__ */ O(
|
|
99
|
+
children: /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ l(te, {
|
|
100
100
|
disabled: a,
|
|
101
101
|
dataTest: `${w(t)}-checkbox`,
|
|
102
102
|
size: "small",
|
|
@@ -110,18 +110,18 @@ var ye = oe((S, E) => {
|
|
|
110
110
|
}));
|
|
111
111
|
}
|
|
112
112
|
const r = d.selected;
|
|
113
|
-
return /* @__PURE__ */
|
|
113
|
+
return /* @__PURE__ */ q("li", {
|
|
114
114
|
...e,
|
|
115
115
|
role: "option",
|
|
116
116
|
"aria-selected": r,
|
|
117
117
|
key: e.id,
|
|
118
|
-
className:
|
|
118
|
+
className: j("flex min-h-10 cursor-pointer items-center gap-x-1 px-2 text-base aria-selected:bg-gama-50 hover:bg-gama-50", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
|
|
119
119
|
onClick: a ? void 0 : e.onClick,
|
|
120
120
|
"aria-disabled": a
|
|
121
|
-
}, /* @__PURE__ */ l(
|
|
121
|
+
}, /* @__PURE__ */ l(L, {
|
|
122
122
|
arrow: !0,
|
|
123
123
|
title: c,
|
|
124
|
-
children: /* @__PURE__ */ O(
|
|
124
|
+
children: /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ l("span", {
|
|
125
125
|
className: "w-5 min-w-5",
|
|
126
126
|
children: r && /* @__PURE__ */ l(Z, {
|
|
127
127
|
className: "size-5 min-h-5 min-w-5 text-gama-500",
|
|
@@ -137,13 +137,13 @@ var ye = oe((S, E) => {
|
|
|
137
137
|
renderInput: (e) => /* @__PURE__ */ l(le, {
|
|
138
138
|
dataTest: `${g}-input-field`,
|
|
139
139
|
...e,
|
|
140
|
-
inputRef:
|
|
141
|
-
error:
|
|
142
|
-
helperText: A ? void 0 :
|
|
143
|
-
reserveHelperText: !
|
|
140
|
+
inputRef: F,
|
|
141
|
+
error: N,
|
|
142
|
+
helperText: A ? void 0 : G,
|
|
143
|
+
reserveHelperText: A ? !1 : N !== void 0,
|
|
144
144
|
variant: "outlined",
|
|
145
145
|
label: "",
|
|
146
|
-
placeholder:
|
|
146
|
+
placeholder: R,
|
|
147
147
|
readOnly: u,
|
|
148
148
|
onFocus: Q,
|
|
149
149
|
onBlur: U,
|
|
@@ -1,125 +1,122 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
1
|
+
import { cn as a } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as D } from "../../../helpers/sx.js";
|
|
3
3
|
import { CloseIcon as Qe } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
!r && !t && K(!1), te?.(e);
|
|
4
|
+
import { HelperRow as Xe } from "../../../helpers/HelperRow.js";
|
|
5
|
+
import { useHelperRowBudget as Ze } from "../../../helpers/useHelperRowBudget.js";
|
|
6
|
+
import { useHelperSlot as qe } from "../../../helpers/useHelperSlot.js";
|
|
7
|
+
import { floatingLabelClass as Oe, floatingLabelLayoutStyle as et, notchedLegendClass as tt, notchedOutlineClass as Q, singleLineInputLayoutStyle as nt, singleLineShellLayoutStyle as ot } from "../field-styles.js";
|
|
8
|
+
import y from "./StyledInputField.module.js";
|
|
9
|
+
import { Children as it, useCallback as lt, useId as at, useLayoutEffect as X, useRef as Z, useState as E } from "react";
|
|
10
|
+
import { jsx as o, jsxs as S } from "react/jsx-runtime";
|
|
11
|
+
import { useMergeRefs as q } from "@floating-ui/react";
|
|
12
|
+
var Bt = ({ dataTest: h, label: l, value: m, defaultValue: b, onChange: O, onBlur: ee, onFocus: te, error: c, helperText: P, reserveHelperText: ne, expandHelperText: oe = !0, disabled: s, readOnly: t, required: v, allowClear: ie, onClear: le, type: ae = "text", placeholder: se, name: re, id: de, autoComplete: ce, autoFocus: pe, multiline: r, rows: N, minRows: H, maxRows: R, size: he = "medium", fullWidth: me, className: ue, style: ge, sx: fe, inputRef: xe, slotProps: n, InputProps: T, onKeyDown: k, onClick: ye, variant: st }) => {
|
|
13
|
+
const Se = at(), A = de ?? Se, $ = `${A}-helper-text`, j = Z(null), z = Z(null), [be, He] = E(void 0), [L, K] = E(!1), [Le, U] = E(b != null && b !== ""), C = m !== void 0, V = C ? m !== "" && m != null : Le, Ie = !!s || !!t, w = n?.input?.startAdornment ?? T?.startAdornment, u = it.count(w) > 0, d = u && Array.isArray(w), g = n?.input?.endAdornment ?? T?.endAdornment, _ = !!(ie && V && !Ie), { ref: ve, ...i } = n?.htmlInput ?? {}, Ne = xe ?? ve, { className: Re, style: B, ref: Ae } = n?.input ?? {}, Ce = q([Ae]), we = n?.input?.onMouseDown, _e = ce ?? i.autoComplete, Be = re ?? i.name, I = L || V || u, Fe = (e) => {
|
|
14
|
+
t || (C || U(e.target.value !== ""), O?.(e));
|
|
15
|
+
}, Me = (e) => {
|
|
16
|
+
!s && !t && K(!0), te?.(e);
|
|
17
|
+
}, De = (e) => {
|
|
18
|
+
!s && !t && K(!1), ee?.(e);
|
|
20
19
|
};
|
|
21
|
-
|
|
20
|
+
X(() => {
|
|
22
21
|
const e = j.current;
|
|
23
|
-
if (!
|
|
22
|
+
if (!r || N != null || !e) return;
|
|
24
23
|
e.style.height = "auto";
|
|
25
|
-
const
|
|
24
|
+
const p = getComputedStyle(e), x = Number.parseFloat(p.lineHeight) || 24, J = Number.parseFloat(p.paddingTop) + Number.parseFloat(p.paddingBottom), Ge = H ? H * x + J : 0, Je = R ? R * x + J : Number.POSITIVE_INFINITY;
|
|
26
25
|
e.style.height = `${Math.min(Je, Math.max(Ge, e.scrollHeight))}px`;
|
|
27
26
|
}, [
|
|
28
27
|
b,
|
|
29
|
-
A,
|
|
30
|
-
L,
|
|
31
|
-
d,
|
|
32
28
|
R,
|
|
33
|
-
|
|
29
|
+
H,
|
|
30
|
+
r,
|
|
31
|
+
N,
|
|
32
|
+
m
|
|
34
33
|
]);
|
|
35
|
-
const W =
|
|
34
|
+
const W = q([Ne, lt((e) => {
|
|
36
35
|
j.current = e instanceof HTMLTextAreaElement ? e : null;
|
|
37
|
-
}, [])]), { style: F, ...
|
|
38
|
-
...
|
|
39
|
-
...
|
|
40
|
-
} :
|
|
36
|
+
}, [])]), { style: F, ...Ee } = i, f = !r && !d, { height: rt, minHeight: dt, maxHeight: ct, paddingTop: pt, paddingBottom: ht, ...Pe } = B ?? {}, Te = f ? {
|
|
37
|
+
...Pe,
|
|
38
|
+
...ot()
|
|
39
|
+
} : d ? {
|
|
41
40
|
boxSizing: "border-box",
|
|
42
41
|
minHeight: 40,
|
|
43
42
|
...B
|
|
44
|
-
} : B, { height:
|
|
43
|
+
} : B, { height: mt, minHeight: ut, maxHeight: gt, paddingTop: ft, paddingBottom: xt, paddingLeft: yt, paddingRight: ke, ...$e } = F ?? {}, je = f ? {
|
|
45
44
|
...$e,
|
|
46
|
-
...
|
|
47
|
-
paddingLeft:
|
|
48
|
-
paddingRight:
|
|
45
|
+
...nt({
|
|
46
|
+
paddingLeft: u ? 40 : 14,
|
|
47
|
+
paddingRight: ke ?? be ?? (_ || g ? 40 : 14)
|
|
49
48
|
})
|
|
50
49
|
} : F;
|
|
51
|
-
|
|
52
|
-
if (!
|
|
53
|
-
const e = z.current,
|
|
54
|
-
|
|
50
|
+
X(() => {
|
|
51
|
+
if (!f) return;
|
|
52
|
+
const e = z.current, p = e ? Math.ceil(e.getBoundingClientRect().width) + 20 : void 0;
|
|
53
|
+
He((x) => x === p ? x : p);
|
|
55
54
|
});
|
|
56
|
-
const ze =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
id: l.id ?? w,
|
|
62
|
-
name: Me,
|
|
55
|
+
const ze = I || !l, { show: M, role: Ke } = qe("StyledInputField", c, P, ne, t), { fieldRef: Ue, rowRef: Ve, rowStyle: We } = Ze(oe && M), Y = {
|
|
56
|
+
...Ee,
|
|
57
|
+
style: f ? je : F,
|
|
58
|
+
id: i.id ?? A,
|
|
59
|
+
name: Be,
|
|
63
60
|
placeholder: ze ? se : void 0,
|
|
64
|
-
disabled:
|
|
61
|
+
disabled: s,
|
|
65
62
|
readOnly: t,
|
|
66
63
|
required: v,
|
|
67
64
|
autoComplete: _e,
|
|
68
|
-
autoFocus:
|
|
69
|
-
value:
|
|
65
|
+
autoFocus: pe,
|
|
66
|
+
value: m,
|
|
70
67
|
defaultValue: b,
|
|
71
|
-
"aria-invalid":
|
|
72
|
-
"aria-label":
|
|
73
|
-
"aria-describedby":
|
|
74
|
-
onChange:
|
|
75
|
-
onFocus:
|
|
76
|
-
onBlur:
|
|
77
|
-
onKeyDown:
|
|
78
|
-
|
|
68
|
+
"aria-invalid": c ? !0 : void 0,
|
|
69
|
+
"aria-label": i["aria-label"] ?? (i["aria-labelledby"] ? void 0 : typeof l == "string" && l !== "" ? l : void 0),
|
|
70
|
+
"aria-describedby": M ? $ : i["aria-describedby"],
|
|
71
|
+
onChange: Fe,
|
|
72
|
+
onFocus: Me,
|
|
73
|
+
onBlur: De,
|
|
74
|
+
onKeyDown: i.onKeyDown || k ? (e) => {
|
|
75
|
+
k?.(e), e.defaultPrevented || i.onKeyDown?.(e);
|
|
79
76
|
} : void 0
|
|
80
|
-
},
|
|
81
|
-
"data-start-adornment":
|
|
82
|
-
"data-end-adornment":
|
|
77
|
+
}, G = a(y.Input, "peer border-0 bg-transparent text-base tracking-[0.00938em] text-delta-800 outline-none placeholder:text-delta-500", d ? "box-border h-8 min-w-[60px] flex-1 py-0 pl-0 pr-0 leading-[23px]" : r ? "w-full resize-none overflow-hidden p-0 pl-0 pr-0 leading-[23px]" : a("w-full", y["Input--singleLine"]), "disabled:text-delta-300", t && "text-delta-800", Re), Ye = !r && !d ? {
|
|
78
|
+
"data-start-adornment": u ? "true" : void 0,
|
|
79
|
+
"data-end-adornment": _ || g ? "true" : void 0
|
|
83
80
|
} : {};
|
|
84
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ S("div", {
|
|
85
82
|
ref: Ue,
|
|
86
|
-
className:
|
|
83
|
+
className: a("group relative inline-flex flex-col", ue),
|
|
87
84
|
onClick: ye,
|
|
88
85
|
style: {
|
|
89
|
-
width:
|
|
86
|
+
width: me ? "100%" : 235,
|
|
90
87
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
91
88
|
letterSpacing: "0.00938em",
|
|
92
|
-
...
|
|
89
|
+
...D(fe),
|
|
93
90
|
...ge
|
|
94
91
|
},
|
|
95
|
-
children: [/* @__PURE__ */
|
|
92
|
+
children: [/* @__PURE__ */ S("div", {
|
|
96
93
|
className: "relative overflow-visible",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
98
|
-
className:
|
|
99
|
-
ref:
|
|
100
|
-
onMouseDown:
|
|
101
|
-
style:
|
|
102
|
-
"data-testid":
|
|
94
|
+
children: [/* @__PURE__ */ S("div", {
|
|
95
|
+
className: a("relative flex", f && y.InputShell, r && "box-border items-center px-[14px] py-[16.5px]", d && a(y.AdornmentList, g && y["AdornmentList--endAdornment"]), t && "rounded bg-delta-50"),
|
|
96
|
+
ref: Ce,
|
|
97
|
+
onMouseDown: we,
|
|
98
|
+
style: Te,
|
|
99
|
+
"data-testid": d ? `${h}-adornment-list` : `${h}-shell`,
|
|
103
100
|
children: [
|
|
104
|
-
|
|
105
|
-
className:
|
|
106
|
-
children:
|
|
101
|
+
u && /* @__PURE__ */ o("span", {
|
|
102
|
+
className: a("items-center text-delta-500", d ? "contents" : "absolute left-3 flex"),
|
|
103
|
+
children: w
|
|
107
104
|
}),
|
|
108
|
-
|
|
109
|
-
...
|
|
105
|
+
r ? /* @__PURE__ */ o("textarea", {
|
|
106
|
+
...Y,
|
|
110
107
|
ref: W,
|
|
111
108
|
"data-testid": h,
|
|
112
|
-
rows:
|
|
113
|
-
className:
|
|
114
|
-
}) : /* @__PURE__ */
|
|
115
|
-
...
|
|
109
|
+
rows: N ?? H ?? 2,
|
|
110
|
+
className: G
|
|
111
|
+
}) : /* @__PURE__ */ o("input", {
|
|
112
|
+
...Y,
|
|
116
113
|
...Ye,
|
|
117
114
|
ref: W,
|
|
118
115
|
"data-testid": h,
|
|
119
116
|
type: ae,
|
|
120
|
-
className:
|
|
117
|
+
className: G
|
|
121
118
|
}),
|
|
122
|
-
|
|
119
|
+
_ ? /* @__PURE__ */ o("button", {
|
|
123
120
|
type: "button",
|
|
124
121
|
"aria-label": "Clear",
|
|
125
122
|
"data-testid": `${h}-clear`,
|
|
@@ -127,79 +124,74 @@ var Ft = ({ dataTest: h, label: a, value: u, defaultValue: b, onChange: ee, onBl
|
|
|
127
124
|
onClick: (e) => {
|
|
128
125
|
e.stopPropagation(), e.preventDefault(), C || U(!1), le?.();
|
|
129
126
|
},
|
|
130
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ o(Qe, {
|
|
131
128
|
width: 18,
|
|
132
129
|
height: 18
|
|
133
130
|
})
|
|
134
|
-
}) :
|
|
131
|
+
}) : g && /* @__PURE__ */ o("span", {
|
|
135
132
|
ref: z,
|
|
136
133
|
className: "absolute inset-y-0 right-[14px] flex max-w-[calc(100%-28px)] items-center gap-1",
|
|
137
|
-
children:
|
|
134
|
+
children: g
|
|
138
135
|
}),
|
|
139
|
-
|
|
136
|
+
l ? /* @__PURE__ */ o("fieldset", {
|
|
140
137
|
"aria-hidden": !0,
|
|
141
|
-
className:
|
|
142
|
-
focused:
|
|
143
|
-
error:
|
|
144
|
-
disabled:
|
|
138
|
+
className: Q({
|
|
139
|
+
focused: L,
|
|
140
|
+
error: c,
|
|
141
|
+
disabled: s,
|
|
145
142
|
readOnly: t,
|
|
146
143
|
notched: !0
|
|
147
144
|
}),
|
|
148
|
-
children: /* @__PURE__ */
|
|
149
|
-
className:
|
|
150
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ o("legend", {
|
|
146
|
+
className: tt(I),
|
|
147
|
+
children: /* @__PURE__ */ S("span", {
|
|
151
148
|
className: "inline-block px-[5px]",
|
|
152
|
-
children: [
|
|
149
|
+
children: [l, v && " *"]
|
|
153
150
|
})
|
|
154
151
|
})
|
|
155
|
-
}) : /* @__PURE__ */
|
|
152
|
+
}) : /* @__PURE__ */ o("div", {
|
|
156
153
|
"aria-hidden": !0,
|
|
157
|
-
className:
|
|
158
|
-
focused:
|
|
159
|
-
error:
|
|
160
|
-
disabled:
|
|
154
|
+
className: Q({
|
|
155
|
+
focused: L,
|
|
156
|
+
error: c,
|
|
157
|
+
disabled: s,
|
|
161
158
|
readOnly: t,
|
|
162
159
|
notched: !1
|
|
163
160
|
})
|
|
164
161
|
})
|
|
165
162
|
]
|
|
166
|
-
}),
|
|
167
|
-
htmlFor:
|
|
168
|
-
className:
|
|
169
|
-
shrink:
|
|
170
|
-
focused:
|
|
171
|
-
error:
|
|
172
|
-
disabled:
|
|
163
|
+
}), l && /* @__PURE__ */ S("label", {
|
|
164
|
+
htmlFor: A,
|
|
165
|
+
className: a(Oe({
|
|
166
|
+
shrink: I,
|
|
167
|
+
focused: L,
|
|
168
|
+
error: c,
|
|
169
|
+
disabled: s,
|
|
173
170
|
readOnly: t,
|
|
174
|
-
size:
|
|
171
|
+
size: he
|
|
175
172
|
}), n?.inputLabel?.className),
|
|
176
173
|
style: {
|
|
177
|
-
...
|
|
174
|
+
...D(n?.inputLabel?.sx),
|
|
178
175
|
...n?.inputLabel?.style,
|
|
179
|
-
...
|
|
176
|
+
...et(I)
|
|
180
177
|
},
|
|
181
|
-
children: [
|
|
178
|
+
children: [l, v && " *"]
|
|
182
179
|
})]
|
|
183
|
-
}),
|
|
180
|
+
}), M && /* @__PURE__ */ o(Xe, {
|
|
184
181
|
ref: Ve,
|
|
185
182
|
id: $,
|
|
186
183
|
role: Ke,
|
|
187
|
-
|
|
184
|
+
error: c,
|
|
185
|
+
message: P,
|
|
186
|
+
hideErrorIcon: n?.formHelperText?.hideErrorIcon,
|
|
187
|
+
className: a("mr-[14px] box-border items-start", n?.formHelperText?.className),
|
|
188
188
|
style: {
|
|
189
189
|
...We,
|
|
190
|
-
...
|
|
191
|
-
}
|
|
192
|
-
children: [o && !n?.formHelperText?.hideErrorIcon && /* @__PURE__ */ i(Xe, {
|
|
193
|
-
width: 20,
|
|
194
|
-
height: 20,
|
|
195
|
-
className: "min-w-5 shrink-0"
|
|
196
|
-
}), /* @__PURE__ */ i("span", {
|
|
197
|
-
className: "text-sm leading-5 tracking-[0.03333em]",
|
|
198
|
-
children: I
|
|
199
|
-
})]
|
|
190
|
+
...D(n?.formHelperText?.sx)
|
|
191
|
+
}
|
|
200
192
|
})]
|
|
201
193
|
});
|
|
202
194
|
};
|
|
203
195
|
export {
|
|
204
|
-
|
|
196
|
+
Bt as StyledInputField
|
|
205
197
|
};
|
|
@@ -1,49 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RadioGroupContext as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}, A = U(() => ({
|
|
1
|
+
import { cn as u } from "../../../../helpers/cn.js";
|
|
2
|
+
import { RadioGroupContext as D } from "./RadioGroupContext.js";
|
|
3
|
+
import { HelperRow as M } from "../../../../helpers/HelperRow.js";
|
|
4
|
+
import { useHelperSlot as P } from "../../../../helpers/useHelperSlot.js";
|
|
5
|
+
import { forwardRef as U, useId as f, useMemo as V, useState as k } from "react";
|
|
6
|
+
import { jsx as v, jsxs as q } from "react/jsx-runtime";
|
|
7
|
+
var Q = U(({ value: s, defaultValue: R, onValueChange: x, disabled: r, readOnly: e, dataTest: N, error: o, errorText: S, helperText: l, reserveHelperText: h, children: w, name: g, ...t }, b) => {
|
|
8
|
+
const i = f(), G = f(), a = g ?? G, n = s !== void 0, [H, j] = k(R ?? null), c = n ? s : H, C = (p) => {
|
|
9
|
+
e || (n || j(p), x?.(p));
|
|
10
|
+
}, I = V(() => ({
|
|
12
11
|
name: a,
|
|
13
|
-
value:
|
|
12
|
+
value: c,
|
|
14
13
|
disabled: r,
|
|
15
|
-
onSelect:
|
|
14
|
+
onSelect: C
|
|
16
15
|
}), [
|
|
17
16
|
a,
|
|
18
|
-
|
|
17
|
+
c,
|
|
19
18
|
r
|
|
20
|
-
]),
|
|
21
|
-
|
|
22
|
-
const C = B(e), E = /\bflex-(?:row|col)\b/.test(t.className ?? "");
|
|
23
|
-
return /* @__PURE__ */ g("div", {
|
|
19
|
+
]), m = o ? S ?? l : l, { show: d, role: y } = P("StyledRadioGroup", o, m, h, e), A = /\bflex-(?:row|col)\b/.test(t.className ?? "");
|
|
20
|
+
return /* @__PURE__ */ q("div", {
|
|
24
21
|
...t,
|
|
25
|
-
ref:
|
|
22
|
+
ref: b,
|
|
26
23
|
role: "radiogroup",
|
|
27
24
|
"data-testid": N,
|
|
28
|
-
"aria-describedby": d ?
|
|
29
|
-
"aria-invalid":
|
|
30
|
-
"aria-readonly":
|
|
31
|
-
className: u("flex items-start", !
|
|
32
|
-
children: [/* @__PURE__ */
|
|
33
|
-
value:
|
|
34
|
-
children:
|
|
35
|
-
}), d && /* @__PURE__ */
|
|
36
|
-
id:
|
|
37
|
-
role:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
height: 20,
|
|
42
|
-
className: "min-w-5 shrink-0"
|
|
43
|
-
}), s]
|
|
25
|
+
"aria-describedby": d ? i : void 0,
|
|
26
|
+
"aria-invalid": o,
|
|
27
|
+
"aria-readonly": e ? !0 : void 0,
|
|
28
|
+
className: u("flex items-start", !A && "flex-col", e && "pointer-events-none", t.className),
|
|
29
|
+
children: [/* @__PURE__ */ v(D.Provider, {
|
|
30
|
+
value: I,
|
|
31
|
+
children: w
|
|
32
|
+
}), d && /* @__PURE__ */ v(M, {
|
|
33
|
+
id: i,
|
|
34
|
+
role: y,
|
|
35
|
+
error: o,
|
|
36
|
+
message: m,
|
|
37
|
+
className: u("m-0 items-center", o && "font-medium")
|
|
44
38
|
})]
|
|
45
39
|
});
|
|
46
40
|
});
|
|
47
41
|
export {
|
|
48
|
-
|
|
42
|
+
Q as StyledRadioGroup
|
|
49
43
|
};
|
|
@@ -1,53 +1,50 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
1
|
+
import { cn as p } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as Ee } from "../../../helpers/sx.js";
|
|
3
3
|
import { ChevronDownIcon as Ne } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
4
4
|
import { CloseIcon as Pe } from "../../icons/close-icon/CloseIcon.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Ve("StyledSelect", l, k);
|
|
18
|
-
const de = Te(l), { fieldRef: ue, rowRef: fe, rowStyle: me } = Ue(ee && S), [o, h] = B(!1), [b, D] = B(!1), [pe, O] = B(J), F = M !== void 0, r = F ? M : pe, i = Array.isArray(r) ? r.length > 0 : r !== void 0 && r !== "" && r !== null, a = $(null), Y = $(null), ge = (e) => {
|
|
19
|
-
if (h(e), e) return;
|
|
5
|
+
import { TOP_LAYER_PROPS as _e, TOP_LAYER_RESET_STYLE as qe, getOpenModalDialogAncestor as Be, shouldUsePopoverTopLayer as He, useTopLayerRef as Ie } from "../../../hooks/useTopLayer.hook.js";
|
|
6
|
+
import { HelperRow as Le } from "../../../helpers/HelperRow.js";
|
|
7
|
+
import { useHelperRowBudget as Te } from "../../../helpers/useHelperRowBudget.js";
|
|
8
|
+
import { useHelperSlot as Ue } from "../../../helpers/useHelperSlot.js";
|
|
9
|
+
import { outlineClass as Ve } from "../field-styles.js";
|
|
10
|
+
import { useFormControlContext as je } from "../../miscellaneous/FormControlContext.js";
|
|
11
|
+
import { Children as N, cloneElement as Ke, isValidElement as P, useEffect as _, useId as Me, useMemo as Ye, useRef as $, useState as q } from "react";
|
|
12
|
+
import { jsx as n, jsxs as B } from "react/jsx-runtime";
|
|
13
|
+
import { FloatingPortal as ze, autoUpdate as Oe, flip as We, offset as $e, shift as Ge, size as Je, useClick as Qe, useDismiss as Xe, useFloating as Ze, useInteractions as et, useMergeRefs as G, useRole as tt } from "@floating-ui/react";
|
|
14
|
+
var gt = ({ dataTest: H, value: I, defaultValue: J, onChange: L, error: Q, errorText: X, helperText: T, reserveHelperText: Z, expandHelperText: ee = !0, allowClear: U, disabled: te, readOnly: i, name: m, placeholder: w, displayEmpty: A, multiple: u, renderValue: V, fullWidth: re, className: oe, style: se, sx: ne, variant: le, children: v, MenuProps: ae, onFocus: ie, onBlur: ce, labelId: g }) => {
|
|
15
|
+
const c = je(), j = `${H}-listbox`, y = le === "standard", d = Q ?? c?.error ?? !1, s = te ?? c?.disabled ?? !1, K = d ? X ?? T : T, { show: R, role: ue } = Ue("StyledSelect", d, K, Z, i), M = Me(), { fieldRef: de, rowRef: fe, rowStyle: pe } = Te(ee && R), [o, b] = q(!1), [h, S] = q(!1), [me, Y] = q(J), k = I !== void 0, r = k ? I : me, l = Array.isArray(r) ? r.length > 0 : r !== void 0 && r !== "" && r !== null, a = $(null), z = $(null), ge = (e) => {
|
|
16
|
+
if (b(e), e) return;
|
|
20
17
|
const t = document.activeElement;
|
|
21
|
-
t && t !== document.body && !a.current?.contains(t) ||
|
|
22
|
-
}, { refs:
|
|
18
|
+
t && t !== document.body && !a.current?.contains(t) || z.current?.focus();
|
|
19
|
+
}, { refs: f, floatingStyles: ye, context: D } = Ze({
|
|
23
20
|
open: o,
|
|
24
21
|
onOpenChange: ge,
|
|
25
22
|
placement: "bottom-start",
|
|
26
23
|
strategy: "fixed",
|
|
27
|
-
whileElementsMounted:
|
|
24
|
+
whileElementsMounted: Oe,
|
|
28
25
|
middleware: [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
$e(4),
|
|
27
|
+
We({ padding: 8 }),
|
|
28
|
+
Ge({ padding: 8 }),
|
|
29
|
+
Je({ apply({ rects: e, elements: t }) {
|
|
33
30
|
t.floating.style.minWidth = `${e.reference.width + 20}px`;
|
|
34
31
|
} })
|
|
35
32
|
]
|
|
36
|
-
}), { getReferenceProps:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
]), xe = G([
|
|
41
|
-
|
|
33
|
+
}), { getReferenceProps: be, getFloatingProps: he } = et([
|
|
34
|
+
Qe(D, { enabled: !s && !i }),
|
|
35
|
+
Xe(D),
|
|
36
|
+
tt(D, { role: "listbox" })
|
|
37
|
+
]), xe = G([f.setReference, z]), O = Ye(() => o ? Be(f.reference.current) : void 0, [o, f]), F = He(O), we = G([Ie(f.setFloating, F), a]);
|
|
38
|
+
_(() => c?.setFocused(o || h), [
|
|
42
39
|
o,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
]),
|
|
46
|
-
|
|
40
|
+
h,
|
|
41
|
+
c
|
|
42
|
+
]), _(() => c?.setFilled(l || !!w || !!A), [
|
|
43
|
+
l,
|
|
44
|
+
w,
|
|
47
45
|
A,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
]), I(() => {
|
|
46
|
+
c
|
|
47
|
+
]), _(() => {
|
|
51
48
|
if (!o) return;
|
|
52
49
|
const e = requestAnimationFrame(() => {
|
|
53
50
|
const t = a.current?.querySelector('[role="option"][aria-selected="true"]');
|
|
@@ -56,33 +53,33 @@ var ht = ({ dataTest: L, value: M, defaultValue: J, onChange: T, error: Q, error
|
|
|
56
53
|
return () => cancelAnimationFrame(e);
|
|
57
54
|
}, [o]);
|
|
58
55
|
const Ae = (e, t) => {
|
|
59
|
-
const x =
|
|
60
|
-
|
|
56
|
+
const x = u ? Array.isArray(r) && r.includes(e) ? r.filter((E) => E !== e) : [...Array.isArray(r) ? r : [], e] : e;
|
|
57
|
+
k || Y(x), L?.({ target: {
|
|
61
58
|
value: x,
|
|
62
|
-
name:
|
|
63
|
-
} }, t),
|
|
59
|
+
name: m
|
|
60
|
+
} }, t), u || (b(!1), requestAnimationFrame(() => f.domReference.current?.focus()));
|
|
64
61
|
}, W = () => {
|
|
65
|
-
const e =
|
|
66
|
-
|
|
62
|
+
const e = u ? [] : "";
|
|
63
|
+
k || Y(e), L?.({ target: {
|
|
67
64
|
value: e,
|
|
68
|
-
name:
|
|
69
|
-
} }, null),
|
|
70
|
-
}, ve =
|
|
71
|
-
if (!
|
|
65
|
+
name: m
|
|
66
|
+
} }, null), b(!1), S(!1);
|
|
67
|
+
}, ve = N.map(v, (e) => {
|
|
68
|
+
if (!P(e)) return e;
|
|
72
69
|
const t = e.props.value;
|
|
73
70
|
return Ke(e, {
|
|
74
|
-
selected:
|
|
71
|
+
selected: u ? Array.isArray(r) && r.includes(t) : t === r,
|
|
75
72
|
onClick: () => Ae(t, e.props.children)
|
|
76
73
|
});
|
|
77
|
-
}), Re =
|
|
74
|
+
}), Re = N.toArray(v).find((e) => P(e) && e.props.value === r), Se = V ? V(r) : u && Array.isArray(r) ? N.toArray(v).filter((e) => P(e) && r.includes(e.props.value)).map((e) => {
|
|
78
75
|
const t = e.props.children;
|
|
79
76
|
return typeof t == "string" || typeof t == "number" ? String(t) : "";
|
|
80
|
-
}).join(", ") : Re?.props.children,
|
|
81
|
-
if ((e.key === "Backspace" || e.key === "Delete") &&
|
|
77
|
+
}).join(", ") : Re?.props.children, ke = (e) => {
|
|
78
|
+
if ((e.key === "Backspace" || e.key === "Delete") && U && l && !s && !i) {
|
|
82
79
|
e.preventDefault(), W();
|
|
83
80
|
return;
|
|
84
81
|
}
|
|
85
|
-
e.key !== "ArrowDown" && e.key !== "ArrowUp" || s ||
|
|
82
|
+
e.key !== "ArrowDown" && e.key !== "ArrowUp" || s || i || (e.preventDefault(), b(!0), requestAnimationFrame(() => {
|
|
86
83
|
if (a.current?.querySelector('[role="option"][aria-selected="true"]')) return;
|
|
87
84
|
const t = a.current?.querySelectorAll('[role="option"]:not([aria-disabled="true"])');
|
|
88
85
|
t?.length && t[e.key === "ArrowUp" ? t.length - 1 : 0]?.focus();
|
|
@@ -90,49 +87,49 @@ var ht = ({ dataTest: L, value: M, defaultValue: J, onChange: T, error: Q, error
|
|
|
90
87
|
}, De = (e) => {
|
|
91
88
|
const t = a.current ? Array.from(a.current.querySelectorAll('[role="option"]:not([aria-disabled="true"])')) : [];
|
|
92
89
|
if (t.length === 0) return;
|
|
93
|
-
const x = t.findIndex((
|
|
90
|
+
const x = t.findIndex((E) => E === document.activeElement);
|
|
94
91
|
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), t[(x + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus()) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), document.activeElement?.click());
|
|
95
|
-
},
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
ref:
|
|
98
|
-
className:
|
|
92
|
+
}, C = y && (o || h), Fe = s ? "text-delta-300" : C ? "text-gama-500" : "text-delta-800", Ce = s ? "text-delta-300" : "text-delta-700";
|
|
93
|
+
return /* @__PURE__ */ B("div", {
|
|
94
|
+
ref: de,
|
|
95
|
+
className: p("group relative inline-flex flex-col", re && "w-full", oe),
|
|
99
96
|
style: {
|
|
100
97
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
101
|
-
...
|
|
98
|
+
...Ee(ne),
|
|
102
99
|
...se
|
|
103
100
|
},
|
|
104
101
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ B("button", {
|
|
106
103
|
ref: xe,
|
|
107
104
|
type: "button",
|
|
108
|
-
"data-testid":
|
|
109
|
-
...
|
|
105
|
+
"data-testid": H,
|
|
106
|
+
...be({ onKeyDown: ke }),
|
|
110
107
|
role: "combobox",
|
|
111
108
|
"aria-haspopup": "listbox",
|
|
112
109
|
"aria-expanded": o,
|
|
113
|
-
"aria-controls":
|
|
110
|
+
"aria-controls": j,
|
|
114
111
|
"aria-labelledby": g,
|
|
115
|
-
"aria-label": g ? void 0 :
|
|
116
|
-
"aria-invalid":
|
|
117
|
-
"aria-describedby":
|
|
112
|
+
"aria-label": g ? void 0 : m,
|
|
113
|
+
"aria-invalid": d ? !0 : void 0,
|
|
114
|
+
"aria-describedby": R ? M : void 0,
|
|
118
115
|
"aria-disabled": s ? !0 : void 0,
|
|
119
116
|
disabled: s,
|
|
120
117
|
onFocus: (e) => {
|
|
121
|
-
|
|
118
|
+
S(!0), ie?.(e);
|
|
122
119
|
},
|
|
123
120
|
onBlur: (e) => {
|
|
124
|
-
|
|
121
|
+
S(!1), ce?.(e);
|
|
125
122
|
},
|
|
126
|
-
style: { minWidth:
|
|
127
|
-
className:
|
|
123
|
+
style: { minWidth: l && !y ? 105 : void 0 },
|
|
124
|
+
className: p("relative flex w-full items-center justify-between text-left outline-none", "h-10 rounded-lg border-0 px-3 text-base transition-colors", C ? "bg-gama-50" : "bg-transparent", Fe, y && "min-w-0", s && "cursor-not-allowed", i && "pointer-events-none"),
|
|
128
125
|
children: [
|
|
129
126
|
/* @__PURE__ */ n("span", {
|
|
130
|
-
className:
|
|
131
|
-
children:
|
|
127
|
+
className: p("min-w-0 flex-1 truncate", !l && "text-delta-500"),
|
|
128
|
+
children: l || A ? Se : w
|
|
132
129
|
}),
|
|
133
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ B("span", {
|
|
134
131
|
className: "flex items-center gap-1",
|
|
135
|
-
children: [
|
|
132
|
+
children: [U && l && !s && /* @__PURE__ */ n("span", {
|
|
136
133
|
"aria-hidden": "true",
|
|
137
134
|
"data-testid": "select-clear-button",
|
|
138
135
|
className: "flex items-center justify-center rounded-full p-[2px] hover:bg-gama-100",
|
|
@@ -146,53 +143,50 @@ var ht = ({ dataTest: L, value: M, defaultValue: J, onChange: T, error: Q, error
|
|
|
146
143
|
}), /* @__PURE__ */ n(Ne, {
|
|
147
144
|
width: 24,
|
|
148
145
|
height: 24,
|
|
149
|
-
className:
|
|
146
|
+
className: p("shrink-0 transition-transform", C ? "text-gama-500" : Ce, o && "rotate-180")
|
|
150
147
|
})]
|
|
151
148
|
}),
|
|
152
|
-
/* @__PURE__ */ n("div", { className:
|
|
153
|
-
focused: o ||
|
|
154
|
-
error:
|
|
149
|
+
/* @__PURE__ */ n("div", { className: Ve({
|
|
150
|
+
focused: o || h,
|
|
151
|
+
error: d,
|
|
155
152
|
disabled: s,
|
|
156
|
-
readOnly:
|
|
153
|
+
readOnly: i,
|
|
157
154
|
borderless: y
|
|
158
155
|
}) })
|
|
159
156
|
]
|
|
160
157
|
}),
|
|
161
158
|
o && /* @__PURE__ */ n(ze, {
|
|
162
|
-
root:
|
|
159
|
+
root: O,
|
|
163
160
|
children: /* @__PURE__ */ n("ul", {
|
|
164
161
|
ref: we,
|
|
165
|
-
id:
|
|
162
|
+
id: j,
|
|
166
163
|
role: "listbox",
|
|
167
164
|
"aria-labelledby": g,
|
|
168
|
-
"aria-label": g ? void 0 :
|
|
169
|
-
...
|
|
165
|
+
"aria-label": g ? void 0 : m,
|
|
166
|
+
...F ? _e : {},
|
|
170
167
|
style: {
|
|
171
|
-
...
|
|
168
|
+
...F ? qe : {},
|
|
172
169
|
...ye,
|
|
173
170
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif"
|
|
174
171
|
},
|
|
175
|
-
...
|
|
172
|
+
...he(),
|
|
176
173
|
onKeyDown: De,
|
|
177
|
-
className:
|
|
174
|
+
className: p("z-[1300] m-0 max-h-72 list-none overflow-auto rounded-lg border border-solid border-delta-300 bg-white px-0 py-1 shadow-[0px_2px_4px_0px_rgba(34,33,51,0.15)]", ae?.className),
|
|
178
175
|
children: ve
|
|
179
176
|
})
|
|
180
177
|
}),
|
|
181
|
-
|
|
178
|
+
R && /* @__PURE__ */ n(Le, {
|
|
182
179
|
ref: fe,
|
|
183
|
-
id:
|
|
184
|
-
role:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
height: 20,
|
|
190
|
-
className: "min-w-5 shrink-0"
|
|
191
|
-
}), /* @__PURE__ */ n("span", { children: k })]
|
|
180
|
+
id: M,
|
|
181
|
+
role: ue,
|
|
182
|
+
error: d,
|
|
183
|
+
message: K,
|
|
184
|
+
className: "m-0 mr-[14px] box-border items-center",
|
|
185
|
+
style: pe
|
|
192
186
|
})
|
|
193
187
|
]
|
|
194
188
|
});
|
|
195
189
|
};
|
|
196
190
|
export {
|
|
197
|
-
|
|
191
|
+
gt as StyledSelect
|
|
198
192
|
};
|
|
@@ -1,61 +1,58 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const C = lt(b), P = (w === !0 && Number.isFinite(p) && p > 0 && o > e ? Array.from({ length: Math.floor((o - e) / p) + 1 }, (t, l) => ({ value: e + p * l })) : Array.isArray(w) ? w : []).filter((t) => t.value >= e && t.value <= o), k = f ? Math.min(i[0], i[1]) : e, R = f ? Math.max(i[0], i[1]) : A, F = (t) => f ? t >= k && t <= R : t <= R, T = f ? D(k, e, o) : 0, K = D(R, e, o) - T, I = a ? {
|
|
12
|
-
bottom: `${T}%`,
|
|
13
|
-
height: `${K}%`
|
|
1
|
+
import { cn as i } from "../../../helpers/cn.js";
|
|
2
|
+
import { HelperRow as et } from "../../../helpers/HelperRow.js";
|
|
3
|
+
import { useHelperSlot as lt } from "../../../helpers/useHelperSlot.js";
|
|
4
|
+
import g from "./StyledSlider.module.js";
|
|
5
|
+
import { useId as at, useState as rt } from "react";
|
|
6
|
+
import { jsx as p, jsxs as H } from "react/jsx-runtime";
|
|
7
|
+
var T = (c, e, o) => o === e ? 0 : Math.min(100, Math.max(0, (c - e) / (o - e) * 100)), ot = (c) => Array.isArray(c) ? [c[0] ?? 0, c[1] ?? 0] : null, ft = ({ dataTest: c, min: e = 0, max: o = 100, step: b = 1, value: z, defaultValue: E, disabled: v, size: D = "medium", orientation: L = "horizontal", marks: w, name: G, className: J, classes: u, slotProps: M, error: y, errorText: O, helperText: U, reserveHelperText: Q, ariaLabel: S, ariaLabelledBy: W, onChange: _, onChangeCommitted: j }) => {
|
|
8
|
+
const V = at(), a = L === "vertical", d = D === "small" ? 6 : 8, [Z, k] = rt(E ?? e), A = z ?? Z, n = ot(A), f = n !== null, B = y ? O ?? U : U, { show: F, role: C } = lt("StyledSlider", y, B, Q), $ = (w === !0 && Number.isFinite(b) && b > 0 && o > e ? Array.from({ length: Math.floor((o - e) / b) + 1 }, (t, l) => ({ value: e + b * l })) : Array.isArray(w) ? w : []).filter((t) => t.value >= e && t.value <= o), K = f ? Math.min(n[0], n[1]) : e, x = f ? Math.max(n[0], n[1]) : A, X = (t) => f ? t >= K && t <= x : t <= x, P = f ? T(K, e, o) : 0, Y = T(x, e, o) - P, I = a ? {
|
|
9
|
+
bottom: `${P}%`,
|
|
10
|
+
height: `${Y}%`
|
|
14
11
|
} : {
|
|
15
|
-
left: `${
|
|
16
|
-
width: `${
|
|
17
|
-
},
|
|
18
|
-
const l =
|
|
12
|
+
left: `${P}%`,
|
|
13
|
+
width: `${Y}%`
|
|
14
|
+
}, q = (t) => {
|
|
15
|
+
const l = T(t, e, o);
|
|
19
16
|
return a ? { bottom: `${l}%` } : { left: `${l}%` };
|
|
20
17
|
}, tt = (t) => {
|
|
21
18
|
if (v) return;
|
|
22
|
-
const l = t.currentTarget.getBoundingClientRect(), r = a ? 1 - (t.clientY - l.top) / l.height : (t.clientX - l.left) / l.width,
|
|
23
|
-
N(
|
|
24
|
-
}, N = (t, l, r,
|
|
19
|
+
const l = t.currentTarget.getBoundingClientRect(), r = a ? 1 - (t.clientY - l.top) / l.height : (t.clientX - l.left) / l.width, m = e + Math.round(Math.min(1, Math.max(0, r)) * ((o - e) / b)) * b, h = Math.min(o, Math.max(e, m));
|
|
20
|
+
N(_, t, h, f && Math.abs((n?.[1] ?? e) - h) < Math.abs((n?.[0] ?? e) - h) ? 1 : 0);
|
|
21
|
+
}, N = (t, l, r, m) => {
|
|
25
22
|
let h = r;
|
|
26
23
|
if (!f) h = r;
|
|
27
24
|
else {
|
|
28
|
-
const s = [
|
|
29
|
-
s[
|
|
25
|
+
const s = [n?.[0] ?? 0, n?.[1] ?? 0];
|
|
26
|
+
s[m] = r, m === 0 && s[0] > s[1] && (s[0] = s[1]), m === 1 && s[1] < s[0] && (s[1] = s[0]), h = s;
|
|
30
27
|
}
|
|
31
|
-
|
|
32
|
-
},
|
|
28
|
+
z === void 0 && k(h), t && t(l, h, m);
|
|
29
|
+
}, R = (t, l) => /* @__PURE__ */ p("input", {
|
|
33
30
|
type: "range",
|
|
34
31
|
"data-testid": f ? `${c}-thumb-${t}` : c,
|
|
35
|
-
name:
|
|
32
|
+
name: G,
|
|
36
33
|
min: e,
|
|
37
34
|
max: o,
|
|
38
|
-
step:
|
|
35
|
+
step: b,
|
|
39
36
|
value: l,
|
|
40
37
|
disabled: v,
|
|
41
|
-
"aria-orientation":
|
|
42
|
-
"aria-label": typeof
|
|
43
|
-
"aria-labelledby":
|
|
44
|
-
"aria-invalid":
|
|
45
|
-
"aria-describedby":
|
|
46
|
-
className:
|
|
47
|
-
onChange: (r) => N(
|
|
48
|
-
onPointerUp: (r) => N(
|
|
49
|
-
onKeyUp: (r) => N(
|
|
38
|
+
"aria-orientation": L,
|
|
39
|
+
"aria-label": typeof S == "function" ? S(t) : S,
|
|
40
|
+
"aria-labelledby": W,
|
|
41
|
+
"aria-invalid": y ? !0 : void 0,
|
|
42
|
+
"aria-describedby": F ? V : void 0,
|
|
43
|
+
className: i(g.SliderInput, a ? g.Vertical : g.Horizontal, !a && "z-0", D === "small" && g.Small, v && g.Disabled, u?.thumb, M?.thumb?.className),
|
|
44
|
+
onChange: (r) => N(_, r, Number(r.currentTarget.value), t),
|
|
45
|
+
onPointerUp: (r) => N(j, r, Number(r.currentTarget.value), t),
|
|
46
|
+
onKeyUp: (r) => N(j, r, Number(r.currentTarget.value), t)
|
|
50
47
|
}, t);
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
className:
|
|
48
|
+
return /* @__PURE__ */ H("div", {
|
|
49
|
+
className: i("relative flex", a ? "h-full w-8 flex-col items-center" : "mt-px w-full flex-col", u?.root, J),
|
|
53
50
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
className:
|
|
56
|
-
children: [/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ H("div", {
|
|
52
|
+
className: i("relative", a ? "h-full w-8" : "h-4 w-full"),
|
|
53
|
+
children: [/* @__PURE__ */ H("div", {
|
|
57
54
|
onPointerDown: tt,
|
|
58
|
-
className:
|
|
55
|
+
className: i("absolute", a ? "left-1/2 w-1 -translate-x-1/2" : "top-[calc(50%+6px)] h-1 -translate-y-1/2"),
|
|
59
56
|
style: a ? {
|
|
60
57
|
top: d,
|
|
61
58
|
bottom: d
|
|
@@ -64,23 +61,23 @@ var D = (c, e, o) => o === e ? 0 : Math.min(100, Math.max(0, (c - e) / (o - e) *
|
|
|
64
61
|
right: d
|
|
65
62
|
},
|
|
66
63
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
className:
|
|
64
|
+
/* @__PURE__ */ p("div", { className: i("absolute inset-0 rounded-full bg-delta-100", u?.rail, M?.rail?.className) }),
|
|
65
|
+
/* @__PURE__ */ p("div", {
|
|
66
|
+
className: i("absolute rounded-full", a ? "left-0 w-full" : "top-0 h-full", v ? "bg-delta-200" : "bg-gama-500", u?.track),
|
|
70
67
|
style: I
|
|
71
68
|
}),
|
|
72
|
-
|
|
73
|
-
const l =
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
-
className:
|
|
76
|
-
style:
|
|
69
|
+
$.map((t) => {
|
|
70
|
+
const l = X(t.value);
|
|
71
|
+
return /* @__PURE__ */ p("span", {
|
|
72
|
+
className: i("absolute z-10 box-border h-2 w-2 -translate-x-1/2 rounded-full border border-solid", a ? "left-1/2 translate-y-1/2" : "top-1/2 -translate-y-1/2", l ? i(v ? "border-delta-200 bg-delta-200" : "border-gama-500 bg-gama-500", u?.markActive) : i("border-delta-300 bg-white", u?.mark)),
|
|
73
|
+
style: q(t.value)
|
|
77
74
|
}, t.value);
|
|
78
75
|
})
|
|
79
76
|
]
|
|
80
|
-
}), f ? [
|
|
77
|
+
}), f ? [R(0, n[0]), R(1, n[1])] : R(0, A)]
|
|
81
78
|
}),
|
|
82
|
-
|
|
83
|
-
className:
|
|
79
|
+
$.some((t) => t.label != null) && /* @__PURE__ */ p("div", {
|
|
80
|
+
className: i(a ? "pointer-events-none absolute inset-x-0" : "relative mt-[14px] h-6"),
|
|
84
81
|
style: a ? {
|
|
85
82
|
top: d,
|
|
86
83
|
bottom: d
|
|
@@ -88,25 +85,22 @@ var D = (c, e, o) => o === e ? 0 : Math.min(100, Math.max(0, (c - e) / (o - e) *
|
|
|
88
85
|
marginLeft: d,
|
|
89
86
|
marginRight: d
|
|
90
87
|
},
|
|
91
|
-
children:
|
|
92
|
-
className:
|
|
93
|
-
style:
|
|
88
|
+
children: $.map((t) => t.label == null ? null : /* @__PURE__ */ p("span", {
|
|
89
|
+
className: i("absolute text-base font-semibold text-delta-700", a ? "left-[37px] translate-y-1/2" : "-translate-x-1/2", X(t.value) && u?.markLabelActive, u?.markLabel, M?.markLabel?.className),
|
|
90
|
+
style: q(t.value),
|
|
94
91
|
children: t.label
|
|
95
92
|
}, t.value))
|
|
96
93
|
}),
|
|
97
|
-
|
|
98
|
-
id:
|
|
94
|
+
F && /* @__PURE__ */ p(et, {
|
|
95
|
+
id: V,
|
|
99
96
|
role: C,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
height: 20,
|
|
104
|
-
className: "min-w-5 shrink-0"
|
|
105
|
-
}), /* @__PURE__ */ m("span", { children: $ })]
|
|
97
|
+
error: y,
|
|
98
|
+
message: B,
|
|
99
|
+
className: "m-0 items-center"
|
|
106
100
|
})
|
|
107
101
|
]
|
|
108
102
|
});
|
|
109
103
|
};
|
|
110
104
|
export {
|
|
111
|
-
|
|
105
|
+
ft as StyledSlider
|
|
112
106
|
};
|
|
@@ -1,77 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
n.style.height = "auto";
|
|
15
|
-
const J = n.scrollHeight - F - H, K = Math.max(1, Math.ceil(J / A)), O = Math.min(Math.max(K, r), i);
|
|
16
|
-
n.style.height = `${O * A + F + H}px`;
|
|
1
|
+
import { useHelperSlot as R } from "../../../helpers/useHelperSlot.js";
|
|
2
|
+
import e from "./StyledTextarea.module.js";
|
|
3
|
+
import { useEffect as U, useId as m, useRef as V } from "react";
|
|
4
|
+
import { Fragment as W, jsx as n, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
var tt = ({ id: H, variant: x = "active", label: d = "", labelClassName: A = "", description: l = "", reserveHelperText: M, value: t = "", minRows: r = 3, maxRows: i = 1 / 0, disabled: g, error: a, errorMessage: j, containerClassName: _ = "", className: w = "", maxLength: B = 1 / 0, counter: E, refLink: k, dataTest: C, counterLimit: p, ...y }) => {
|
|
6
|
+
const q = V(null), h = k ?? q, s = !!(E && p), b = m(), u = m(), z = m(), $ = H ?? z, v = a ? j : l, { show: N, role: D } = R("StyledTextarea", a, v, M);
|
|
7
|
+
U(() => {
|
|
8
|
+
const o = h.current;
|
|
9
|
+
if (!o) return;
|
|
10
|
+
const f = window.getComputedStyle(o), S = parseFloat(f.lineHeight) || 24, T = parseFloat(f.paddingTop), F = parseFloat(f.paddingBottom);
|
|
11
|
+
o.style.height = "auto";
|
|
12
|
+
const K = o.scrollHeight - T - F, O = Math.max(1, Math.ceil(K / S)), Q = Math.min(Math.max(O, r), i);
|
|
13
|
+
o.style.height = `${Q * S + T + F}px`;
|
|
17
14
|
}, [
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
h,
|
|
16
|
+
t,
|
|
20
17
|
r,
|
|
21
18
|
i,
|
|
22
19
|
s
|
|
23
20
|
]), i < r && (r = i);
|
|
24
|
-
const
|
|
21
|
+
const G = a ? "error" : "active", I = a ? "error" : g ? "disabled" : "active", J = typeof d != "string" || d.trim() !== "" ? void 0 : typeof l == "string" && l.trim() !== "" ? l : y.placeholder;
|
|
25
22
|
return /* @__PURE__ */ c("div", {
|
|
26
|
-
className: `relative flex flex-col gap-1 ${
|
|
23
|
+
className: `relative flex flex-col gap-1 ${_}`,
|
|
27
24
|
"data-testid": C,
|
|
28
25
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
htmlFor:
|
|
31
|
-
className: `${
|
|
26
|
+
/* @__PURE__ */ n("label", {
|
|
27
|
+
htmlFor: $,
|
|
28
|
+
className: `${e.label} ${e[I]} ${A}`,
|
|
32
29
|
children: d
|
|
33
30
|
}),
|
|
34
|
-
|
|
35
|
-
id:
|
|
36
|
-
role:
|
|
37
|
-
className: `${
|
|
38
|
-
children:
|
|
31
|
+
N && /* @__PURE__ */ n("span", {
|
|
32
|
+
id: b,
|
|
33
|
+
role: D,
|
|
34
|
+
className: `${e.description} ${e[I]} min-h-[24px]`,
|
|
35
|
+
children: v
|
|
39
36
|
}),
|
|
40
|
-
x === "view_only" ? /* @__PURE__ */
|
|
37
|
+
x === "view_only" ? /* @__PURE__ */ n("div", {
|
|
41
38
|
className: "pt-3 font-roboto text-base font-normal text-delta-700",
|
|
42
|
-
children:
|
|
43
|
-
}) : x === "not_editable" ? /* @__PURE__ */
|
|
39
|
+
children: t
|
|
40
|
+
}) : x === "not_editable" ? /* @__PURE__ */ n("div", {
|
|
44
41
|
className: "rounded bg-delta-50 p-3 font-roboto text-base font-normal text-delta-700",
|
|
45
|
-
children:
|
|
46
|
-
}) : /* @__PURE__ */
|
|
47
|
-
...
|
|
48
|
-
"aria-describedby": [
|
|
49
|
-
"aria-invalid":
|
|
50
|
-
"aria-label":
|
|
51
|
-
id:
|
|
52
|
-
ref:
|
|
53
|
-
className: `${
|
|
42
|
+
children: t
|
|
43
|
+
}) : /* @__PURE__ */ n("textarea", {
|
|
44
|
+
...y,
|
|
45
|
+
"aria-describedby": [N ? b : null, s ? u : null].filter(Boolean).join(" ") || void 0,
|
|
46
|
+
"aria-invalid": a,
|
|
47
|
+
"aria-label": J,
|
|
48
|
+
id: $,
|
|
49
|
+
ref: h,
|
|
50
|
+
className: `${e.textarea} ${e[G]} ${w} ${s ? "pb-[32px]" : ""}`,
|
|
54
51
|
wrap: "soft",
|
|
55
|
-
value:
|
|
52
|
+
value: t,
|
|
56
53
|
disabled: g,
|
|
57
|
-
maxLength:
|
|
54
|
+
maxLength: B
|
|
58
55
|
}),
|
|
59
|
-
s && /* @__PURE__ */ c(
|
|
56
|
+
s && /* @__PURE__ */ c(W, { children: [/* @__PURE__ */ c("div", {
|
|
60
57
|
className: "pointer-events-none absolute bottom-3 right-3 flex h-[15px] justify-end font-roboto text-[10px]",
|
|
61
58
|
children: [
|
|
62
|
-
|
|
59
|
+
t.length,
|
|
63
60
|
"/",
|
|
64
61
|
p
|
|
65
62
|
]
|
|
66
63
|
}), /* @__PURE__ */ c("div", {
|
|
67
|
-
id:
|
|
64
|
+
id: u,
|
|
68
65
|
"aria-live": "polite",
|
|
69
66
|
className: "sr-only",
|
|
70
|
-
children: [p -
|
|
67
|
+
children: [p - t.length, " characters remaining"]
|
|
71
68
|
})] })
|
|
72
69
|
]
|
|
73
70
|
});
|
|
74
71
|
};
|
|
75
72
|
export {
|
|
76
|
-
|
|
73
|
+
tt as StyledTextarea
|
|
77
74
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cn as s } from "./cn.js";
|
|
2
|
+
import { ErrorOutlineIcon as l } from "../components/icons/error-outline-icon/ErrorOutlineIcon.js";
|
|
3
|
+
import { forwardRef as x } from "react";
|
|
4
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
var w = x(({ id: t, role: i, error: r, message: m, hideErrorIcon: o, className: a, style: n }, p) => /* @__PURE__ */ c("div", {
|
|
6
|
+
ref: p,
|
|
7
|
+
id: t,
|
|
8
|
+
role: i,
|
|
9
|
+
className: s("flex min-h-[24px] gap-1 pt-1 text-sm leading-5 tracking-[0.03333em]", r ? "text-error-500" : "text-delta-600", a),
|
|
10
|
+
style: n,
|
|
11
|
+
children: [r && !o && /* @__PURE__ */ e(l, {
|
|
12
|
+
width: 20,
|
|
13
|
+
height: 20,
|
|
14
|
+
className: "min-w-5 shrink-0"
|
|
15
|
+
}), /* @__PURE__ */ e("span", { children: m })]
|
|
16
|
+
}));
|
|
17
|
+
export {
|
|
18
|
+
w as HelperRow
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useHelperAlertRole as u } from "./useHelperAlertRole.js";
|
|
2
|
+
import { warnMissingErrorMessage as s } from "./warnMissingErrorMessage.js";
|
|
3
|
+
function f(r, e, o, t, l) {
|
|
4
|
+
const n = l !== !0 && (t === !0 || o != null || !!e);
|
|
5
|
+
return s(r, e, o), {
|
|
6
|
+
show: n,
|
|
7
|
+
role: u(e)
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
f as useHelperSlot
|
|
12
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export interface HelperRowProps {
|
|
3
|
+
id: string;
|
|
4
|
+
role: 'alert' | 'status';
|
|
5
|
+
error?: boolean;
|
|
6
|
+
message?: ReactNode;
|
|
7
|
+
hideErrorIcon?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Shared helper-text row rendered beneath input components (Figma "Helper text" row,
|
|
13
|
+
* 24 px min-height, pt 4 px, gap 4 px). Renders error icon + message text with proper
|
|
14
|
+
* ARIA role. Consumers add layout tweaks (margin, alignment) via `className`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const HelperRow: import('react').ForwardRefExoticComponent<HelperRowProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface UseHelperSlotResult {
|
|
3
|
+
show: boolean;
|
|
4
|
+
role: 'alert' | 'status';
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Shared logic for the helper-text row beneath input components.
|
|
8
|
+
* Returns `show` (whether the slot should render) and `role` (ARIA live-region role).
|
|
9
|
+
* Emits a dev-mode warning when `error` is set but `message` is empty.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useHelperSlot(component: string, error: boolean | undefined, message: ReactNode, reserveHelperText?: boolean, readOnly?: boolean): UseHelperSlotResult;
|