asma-ui-core 3.68.6 → 3.69.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/DynamicInteractiveChipGroup.js +49 -43
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +45 -44
- package/dist/components/inputs/input-field/StyledInputField.js +127 -116
- package/dist/components/inputs/radio-button/base-ui/StyledRadioGroup.js +37 -32
- package/dist/components/inputs/search-field/StyledSearchField.js +9 -8
- package/dist/components/inputs/select/StyledSelect.js +123 -111
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +67 -65
- package/dist/components/inputs/slider/StyledSlider.js +69 -61
- package/dist/components/inputs/textarea/StyledTextarea.js +52 -47
- package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +12 -12
- package/dist/datetime/components/date-picker/hooks/useDatePickerValidation.js +32 -31
- package/dist/datetime/components/time-picker/TimePickerInput.js +19 -18
- package/dist/datetime/components/time-picker/components/HelperText.js +10 -9
- package/dist/helpers/helperTextRoom.js +34 -0
- package/dist/helpers/useHelperAlertRole.js +11 -0
- package/dist/helpers/useHelperRowBudget.js +24 -0
- package/dist/helpers/warnMissingErrorMessage.js +6 -0
- package/dist/index.js +170 -165
- package/dist/src/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.test.d.ts +1 -0
- package/dist/src/components/inputs/dynamic-select/types.d.ts +1 -1
- package/dist/src/components/inputs/input-field/StyledInputField.d.ts +3 -3
- package/dist/src/components/inputs/input-field/StyledInputField.helper-slot.test.d.ts +1 -0
- package/dist/src/components/inputs/radio-button/base-ui/StyledRadioGroup.d.ts +2 -0
- package/dist/src/components/inputs/select/StyledSelect.d.ts +4 -4
- package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +5 -4
- package/dist/src/components/inputs/slider/StyledSlider.d.ts +2 -2
- package/dist/src/components/inputs/textarea/StyledTextarea.d.ts +1 -0
- package/dist/src/datetime/components/date-picker/hooks/useDatePickerValidation.d.ts +18 -1
- package/dist/src/datetime/components/date-picker/index.d.ts +1 -0
- package/dist/src/datetime/components/time-picker/components/HelperText.d.ts +12 -0
- package/dist/src/datetime/components/time-picker/index.d.ts +1 -0
- package/dist/src/helpers/helperTextRoom.d.ts +9 -0
- package/dist/src/helpers/helperTextRoom.test.d.ts +1 -0
- package/dist/src/helpers/useHelperAlertRole.d.ts +2 -0
- package/dist/src/helpers/useHelperAlertRole.test.d.ts +1 -0
- package/dist/src/helpers/useHelperRowBudget.d.ts +7 -0
- package/dist/src/helpers/warnMissingErrorMessage.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,194 +1,205 @@
|
|
|
1
1
|
import { cn as s } from "../../../helpers/cn.js";
|
|
2
2
|
import { resolveSx as E } from "../../../helpers/sx.js";
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { ErrorOutlineIcon as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
import { CloseIcon as Qe } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { ErrorOutlineIcon as Xe } from "../../icons/error-outline-icon/ErrorOutlineIcon.js";
|
|
5
|
+
import { useHelperAlertRole as Ze } from "../../../helpers/useHelperAlertRole.js";
|
|
6
|
+
import { useHelperRowBudget as qe } from "../../../helpers/useHelperRowBudget.js";
|
|
7
|
+
import { warnMissingErrorMessage as Oe } from "../../../helpers/warnMissingErrorMessage.js";
|
|
8
|
+
import { floatingLabelClass as et, floatingLabelLayoutStyle as tt, notchedLegendClass as nt, notchedOutlineClass as X, singleLineInputLayoutStyle as ot, singleLineShellLayoutStyle as it } from "../field-styles.js";
|
|
9
|
+
import S from "./StyledInputField.module.js";
|
|
10
|
+
import { Children as lt, useCallback as at, useId as st, useLayoutEffect as Z, useRef as q, useState as k } from "react";
|
|
11
|
+
import { jsx as i, jsxs as p } from "react/jsx-runtime";
|
|
12
|
+
import { useMergeRefs as O } from "@floating-ui/react";
|
|
13
|
+
var Ft = ({ dataTest: h, label: a, value: u, defaultValue: b, onChange: ee, onBlur: te, onFocus: ne, error: o, helperText: I, reserveHelperText: D = !0, expandHelperText: oe = !0, disabled: r, readOnly: t, required: v, allowClear: ie, onClear: le, type: ae = "text", placeholder: se, name: re, id: de, autoComplete: ce, autoFocus: me, multiline: d, rows: R, minRows: L, maxRows: A, size: pe = "medium", fullWidth: he, className: ue, style: ge, sx: fe, inputRef: xe, slotProps: n, InputProps: P, onKeyDown: T, onClick: ye, variant: rt }) => {
|
|
14
|
+
const Se = st(), w = de ?? Se, $ = `${w}-helper-text`, j = q(null), z = q(null), [be, Ie] = k(void 0), [H, K] = k(!1), [Le, U] = k(b != null && b !== ""), C = u !== void 0, V = C ? u !== "" && u != null : Le, He = !!r || !!t, _ = n?.input?.startAdornment ?? P?.startAdornment, g = lt.count(_) > 0, c = g && Array.isArray(_), f = n?.input?.endAdornment ?? P?.endAdornment, M = !!(ie && V && !He), { ref: Ne, ...l } = n?.htmlInput ?? {}, ve = xe ?? Ne, { className: Re, style: B, ref: Ae } = n?.input ?? {}, we = O([Ae]), Ce = n?.input?.onMouseDown, _e = ce ?? l.autoComplete, Me = re ?? l.name, N = H || V || g, Be = (e) => {
|
|
15
|
+
t || (C || U(e.target.value !== ""), ee?.(e));
|
|
16
|
+
}, Fe = (e) => {
|
|
17
|
+
!r && !t && K(!0), ne?.(e);
|
|
18
|
+
}, Ee = (e) => {
|
|
19
|
+
!r && !t && K(!1), te?.(e);
|
|
17
20
|
};
|
|
18
|
-
|
|
19
|
-
const e =
|
|
20
|
-
if (!
|
|
21
|
+
Z(() => {
|
|
22
|
+
const e = j.current;
|
|
23
|
+
if (!d || R != null || !e) return;
|
|
21
24
|
e.style.height = "auto";
|
|
22
|
-
const m = getComputedStyle(e),
|
|
23
|
-
e.style.height = `${Math.min(
|
|
25
|
+
const m = getComputedStyle(e), y = Number.parseFloat(m.lineHeight) || 24, Q = Number.parseFloat(m.paddingTop) + Number.parseFloat(m.paddingBottom), Ge = L ? L * y + Q : 0, Je = A ? A * y + Q : Number.POSITIVE_INFINITY;
|
|
26
|
+
e.style.height = `${Math.min(Je, Math.max(Ge, e.scrollHeight))}px`;
|
|
24
27
|
}, [
|
|
25
|
-
|
|
26
|
-
C,
|
|
27
|
-
v,
|
|
28
|
-
r,
|
|
28
|
+
b,
|
|
29
29
|
A,
|
|
30
|
+
L,
|
|
31
|
+
d,
|
|
32
|
+
R,
|
|
30
33
|
u
|
|
31
34
|
]);
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
}, [])]), { style: F, ...
|
|
35
|
-
...
|
|
36
|
-
...
|
|
35
|
+
const W = O([ve, at((e) => {
|
|
36
|
+
j.current = e instanceof HTMLTextAreaElement ? e : null;
|
|
37
|
+
}, [])]), { style: F, ...ke } = l, x = !d && !c, { height: dt, minHeight: ct, maxHeight: mt, paddingTop: pt, paddingBottom: ht, ...De } = B ?? {}, Pe = x ? {
|
|
38
|
+
...De,
|
|
39
|
+
...it()
|
|
37
40
|
} : c ? {
|
|
38
41
|
boxSizing: "border-box",
|
|
39
42
|
minHeight: 40,
|
|
40
43
|
...B
|
|
41
|
-
} : B, { height:
|
|
42
|
-
|
|
43
|
-
...
|
|
44
|
+
} : B, { height: ut, minHeight: gt, maxHeight: ft, paddingTop: xt, paddingBottom: yt, paddingLeft: St, paddingRight: Te, ...$e } = F ?? {}, je = x ? {
|
|
45
|
+
...$e,
|
|
46
|
+
...ot({
|
|
44
47
|
paddingLeft: g ? 40 : 14,
|
|
45
|
-
paddingRight:
|
|
48
|
+
paddingRight: Te ?? be ?? (M || f ? 40 : 14)
|
|
46
49
|
})
|
|
47
50
|
} : F;
|
|
48
|
-
|
|
51
|
+
Z(() => {
|
|
49
52
|
if (!x) return;
|
|
50
|
-
const e =
|
|
51
|
-
|
|
53
|
+
const e = z.current, m = e ? Math.ceil(e.getBoundingClientRect().width) + 20 : void 0;
|
|
54
|
+
Ie((y) => y === m ? y : m);
|
|
52
55
|
});
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
const ze = N || !a, Y = !t && (D || I != null || !!o);
|
|
57
|
+
Oe("StyledInputField", o, I);
|
|
58
|
+
const Ke = Ze(o), { fieldRef: Ue, rowRef: Ve, rowStyle: We } = qe(oe && Y), G = {
|
|
59
|
+
...ke,
|
|
60
|
+
style: x ? je : F,
|
|
61
|
+
id: l.id ?? w,
|
|
62
|
+
name: Me,
|
|
63
|
+
placeholder: ze ? se : void 0,
|
|
64
|
+
disabled: r,
|
|
65
|
+
readOnly: t,
|
|
66
|
+
required: v,
|
|
67
|
+
autoComplete: _e,
|
|
68
|
+
autoFocus: me,
|
|
64
69
|
value: u,
|
|
65
|
-
defaultValue:
|
|
70
|
+
defaultValue: b,
|
|
66
71
|
"aria-invalid": o ? !0 : void 0,
|
|
67
|
-
"aria-label":
|
|
68
|
-
"aria-describedby": !
|
|
69
|
-
onChange:
|
|
70
|
-
onFocus:
|
|
71
|
-
onBlur:
|
|
72
|
-
onKeyDown:
|
|
73
|
-
T?.(e), e.defaultPrevented ||
|
|
72
|
+
"aria-label": l["aria-label"] ?? (l["aria-labelledby"] ? void 0 : typeof a == "string" && a !== "" ? a : void 0),
|
|
73
|
+
"aria-describedby": !t && (D || I != null || o) ? $ : l["aria-describedby"],
|
|
74
|
+
onChange: Be,
|
|
75
|
+
onFocus: Fe,
|
|
76
|
+
onBlur: Ee,
|
|
77
|
+
onKeyDown: l.onKeyDown || T ? (e) => {
|
|
78
|
+
T?.(e), e.defaultPrevented || l.onKeyDown?.(e);
|
|
74
79
|
} : void 0
|
|
75
|
-
},
|
|
80
|
+
}, J = s(S.Input, "peer border-0 bg-transparent text-base tracking-[0.00938em] text-delta-800 outline-none placeholder:text-delta-500", c ? "box-border h-8 min-w-[60px] flex-1 py-0 pl-0 pr-0 leading-[23px]" : d ? "w-full resize-none overflow-hidden p-0 pl-0 pr-0 leading-[23px]" : s("w-full", S["Input--singleLine"]), "disabled:text-delta-300", t && "text-delta-800", Re), Ye = !d && !c ? {
|
|
76
81
|
"data-start-adornment": g ? "true" : void 0,
|
|
77
82
|
"data-end-adornment": M || f ? "true" : void 0
|
|
78
83
|
} : {};
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
return /* @__PURE__ */ p("div", {
|
|
85
|
+
ref: Ue,
|
|
86
|
+
className: s("group relative inline-flex flex-col", ue),
|
|
87
|
+
onClick: ye,
|
|
82
88
|
style: {
|
|
83
|
-
width:
|
|
89
|
+
width: he ? "100%" : 235,
|
|
84
90
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
85
91
|
letterSpacing: "0.00938em",
|
|
86
|
-
...E(
|
|
87
|
-
...
|
|
92
|
+
...E(fe),
|
|
93
|
+
...ge
|
|
88
94
|
},
|
|
89
|
-
children: [/* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ p("div", {
|
|
90
96
|
className: "relative overflow-visible",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
92
|
-
className: s("relative flex", x &&
|
|
93
|
-
ref:
|
|
94
|
-
onMouseDown:
|
|
95
|
-
style:
|
|
96
|
-
"data-testid": c ? `${
|
|
97
|
+
children: [/* @__PURE__ */ p("div", {
|
|
98
|
+
className: s("relative flex", x && S.InputShell, d && "box-border items-center px-[14px] py-[16.5px]", c && s(S.AdornmentList, f && S["AdornmentList--endAdornment"]), t && "rounded bg-delta-50"),
|
|
99
|
+
ref: we,
|
|
100
|
+
onMouseDown: Ce,
|
|
101
|
+
style: Pe,
|
|
102
|
+
"data-testid": c ? `${h}-adornment-list` : `${h}-shell`,
|
|
97
103
|
children: [
|
|
98
104
|
g && /* @__PURE__ */ i("span", {
|
|
99
105
|
className: s("items-center text-delta-500", c ? "contents" : "absolute left-3 flex"),
|
|
100
|
-
children:
|
|
106
|
+
children: _
|
|
101
107
|
}),
|
|
102
|
-
|
|
103
|
-
...
|
|
104
|
-
ref:
|
|
105
|
-
"data-testid":
|
|
106
|
-
rows:
|
|
107
|
-
className:
|
|
108
|
+
d ? /* @__PURE__ */ i("textarea", {
|
|
109
|
+
...G,
|
|
110
|
+
ref: W,
|
|
111
|
+
"data-testid": h,
|
|
112
|
+
rows: R ?? L ?? 2,
|
|
113
|
+
className: J
|
|
108
114
|
}) : /* @__PURE__ */ i("input", {
|
|
109
|
-
...
|
|
110
|
-
|
|
111
|
-
ref:
|
|
112
|
-
"data-testid":
|
|
113
|
-
type:
|
|
114
|
-
className:
|
|
115
|
+
...G,
|
|
116
|
+
...Ye,
|
|
117
|
+
ref: W,
|
|
118
|
+
"data-testid": h,
|
|
119
|
+
type: ae,
|
|
120
|
+
className: J
|
|
115
121
|
}),
|
|
116
122
|
M ? /* @__PURE__ */ i("button", {
|
|
117
123
|
type: "button",
|
|
118
124
|
"aria-label": "Clear",
|
|
119
|
-
"data-testid": `${
|
|
125
|
+
"data-testid": `${h}-clear`,
|
|
120
126
|
className: "absolute right-4 z-40 flex items-center justify-center rounded-full border-0 bg-transparent p-[2px] duration-300 hover:bg-gama-100",
|
|
121
127
|
onClick: (e) => {
|
|
122
|
-
e.stopPropagation(), e.preventDefault(),
|
|
128
|
+
e.stopPropagation(), e.preventDefault(), C || U(!1), le?.();
|
|
123
129
|
},
|
|
124
|
-
children: /* @__PURE__ */ i(
|
|
130
|
+
children: /* @__PURE__ */ i(Qe, {
|
|
125
131
|
width: 18,
|
|
126
132
|
height: 18
|
|
127
133
|
})
|
|
128
134
|
}) : f && /* @__PURE__ */ i("span", {
|
|
129
|
-
ref:
|
|
135
|
+
ref: z,
|
|
130
136
|
className: "absolute inset-y-0 right-[14px] flex max-w-[calc(100%-28px)] items-center gap-1",
|
|
131
137
|
children: f
|
|
132
138
|
}),
|
|
133
|
-
|
|
139
|
+
a ? /* @__PURE__ */ i("fieldset", {
|
|
134
140
|
"aria-hidden": !0,
|
|
135
|
-
className:
|
|
136
|
-
focused:
|
|
141
|
+
className: X({
|
|
142
|
+
focused: H,
|
|
137
143
|
error: o,
|
|
138
|
-
disabled:
|
|
139
|
-
readOnly:
|
|
144
|
+
disabled: r,
|
|
145
|
+
readOnly: t,
|
|
140
146
|
notched: !0
|
|
141
147
|
}),
|
|
142
148
|
children: /* @__PURE__ */ i("legend", {
|
|
143
|
-
className:
|
|
144
|
-
children: /* @__PURE__ */
|
|
149
|
+
className: nt(N),
|
|
150
|
+
children: /* @__PURE__ */ p("span", {
|
|
145
151
|
className: "inline-block px-[5px]",
|
|
146
|
-
children: [
|
|
152
|
+
children: [a, v && " *"]
|
|
147
153
|
})
|
|
148
154
|
})
|
|
149
155
|
}) : /* @__PURE__ */ i("div", {
|
|
150
156
|
"aria-hidden": !0,
|
|
151
|
-
className:
|
|
152
|
-
focused:
|
|
157
|
+
className: X({
|
|
158
|
+
focused: H,
|
|
153
159
|
error: o,
|
|
154
|
-
disabled:
|
|
155
|
-
readOnly:
|
|
160
|
+
disabled: r,
|
|
161
|
+
readOnly: t,
|
|
156
162
|
notched: !1
|
|
157
163
|
})
|
|
158
164
|
})
|
|
159
165
|
]
|
|
160
|
-
}),
|
|
161
|
-
htmlFor:
|
|
162
|
-
className: s(
|
|
166
|
+
}), a && /* @__PURE__ */ p("label", {
|
|
167
|
+
htmlFor: w,
|
|
168
|
+
className: s(et({
|
|
163
169
|
shrink: N,
|
|
164
|
-
focused:
|
|
170
|
+
focused: H,
|
|
165
171
|
error: o,
|
|
166
|
-
disabled:
|
|
167
|
-
readOnly:
|
|
168
|
-
size:
|
|
169
|
-
}),
|
|
172
|
+
disabled: r,
|
|
173
|
+
readOnly: t,
|
|
174
|
+
size: pe
|
|
175
|
+
}), n?.inputLabel?.className),
|
|
170
176
|
style: {
|
|
171
|
-
...E(
|
|
172
|
-
...
|
|
173
|
-
...
|
|
177
|
+
...E(n?.inputLabel?.sx),
|
|
178
|
+
...n?.inputLabel?.style,
|
|
179
|
+
...tt(N)
|
|
174
180
|
},
|
|
175
|
-
children: [
|
|
181
|
+
children: [a, v && " *"]
|
|
176
182
|
})]
|
|
177
|
-
}), !
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
183
|
+
}), !t && Y && /* @__PURE__ */ p("div", {
|
|
184
|
+
ref: Ve,
|
|
185
|
+
id: $,
|
|
186
|
+
role: Ke,
|
|
187
|
+
className: s("mr-[14px] box-border flex min-h-[24px] items-start gap-1 pt-1", o && !n?.formHelperText?.hideErrorIcon && "text-error-500", !o && "text-delta-600", n?.formHelperText?.className),
|
|
188
|
+
style: {
|
|
189
|
+
...We,
|
|
190
|
+
...E(n?.formHelperText?.sx)
|
|
191
|
+
},
|
|
192
|
+
children: [o && !n?.formHelperText?.hideErrorIcon && /* @__PURE__ */ i(Xe, {
|
|
182
193
|
width: 20,
|
|
183
194
|
height: 20,
|
|
184
195
|
className: "min-w-5 shrink-0"
|
|
185
196
|
}), /* @__PURE__ */ i("span", {
|
|
186
197
|
className: "text-sm leading-5 tracking-[0.03333em]",
|
|
187
|
-
children:
|
|
198
|
+
children: I
|
|
188
199
|
})]
|
|
189
200
|
})]
|
|
190
201
|
});
|
|
191
202
|
};
|
|
192
203
|
export {
|
|
193
|
-
|
|
204
|
+
Ft as StyledInputField
|
|
194
205
|
};
|
|
@@ -1,44 +1,49 @@
|
|
|
1
|
-
import { ErrorOutlineIcon as
|
|
2
|
-
import { RadioGroupContext as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { ErrorOutlineIcon as H } from "../../../icons/error-outline-icon/ErrorOutlineIcon.js";
|
|
2
|
+
import { RadioGroupContext as y } from "./RadioGroupContext.js";
|
|
3
|
+
import { useHelperAlertRole as B } from "../../../../helpers/useHelperAlertRole.js";
|
|
4
|
+
import { warnMissingErrorMessage as D } from "../../../../helpers/warnMissingErrorMessage.js";
|
|
5
|
+
import u from "clsx";
|
|
6
|
+
import { forwardRef as P, useId as f, useMemo as U, useState as V } from "react";
|
|
7
|
+
import { jsx as x, jsxs as g } from "react/jsx-runtime";
|
|
8
|
+
var W = P(({ value: i, defaultValue: h, onValueChange: v, disabled: r, readOnly: o, dataTest: N, error: e, errorText: R, helperText: n, reserveHelperText: w = !0, children: S, name: b, ...t }, G) => {
|
|
9
|
+
const l = f(), I = f(), a = b ?? I, c = i !== void 0, [M, j] = V(h ?? null), m = c ? i : M, k = (p) => {
|
|
10
|
+
o || (c || j(p), v?.(p));
|
|
11
|
+
}, A = U(() => ({
|
|
12
|
+
name: a,
|
|
11
13
|
value: m,
|
|
12
|
-
disabled:
|
|
13
|
-
onSelect:
|
|
14
|
+
disabled: r,
|
|
15
|
+
onSelect: k
|
|
14
16
|
}), [
|
|
15
|
-
|
|
17
|
+
a,
|
|
16
18
|
m,
|
|
17
|
-
|
|
18
|
-
]),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
r
|
|
20
|
+
]), s = e ? R ?? n : n, d = !o && (w || s != null || !!e);
|
|
21
|
+
D("StyledRadioGroup", e, s);
|
|
22
|
+
const C = B(e), E = /\bflex-(?:row|col)\b/.test(t.className ?? "");
|
|
23
|
+
return /* @__PURE__ */ g("div", {
|
|
24
|
+
...t,
|
|
25
|
+
ref: G,
|
|
22
26
|
role: "radiogroup",
|
|
23
27
|
"data-testid": N,
|
|
24
|
-
"aria-describedby":
|
|
28
|
+
"aria-describedby": d ? l : void 0,
|
|
25
29
|
"aria-invalid": e,
|
|
26
|
-
"aria-readonly":
|
|
27
|
-
className:
|
|
28
|
-
children: [/* @__PURE__ */ x(
|
|
29
|
-
value:
|
|
30
|
-
children:
|
|
31
|
-
}),
|
|
32
|
-
id:
|
|
33
|
-
role:
|
|
34
|
-
className:
|
|
35
|
-
children: [e && /* @__PURE__ */ x(
|
|
30
|
+
"aria-readonly": o ? !0 : void 0,
|
|
31
|
+
className: u("flex items-start", !E && "flex-col", o && "pointer-events-none", t.className),
|
|
32
|
+
children: [/* @__PURE__ */ x(y.Provider, {
|
|
33
|
+
value: A,
|
|
34
|
+
children: S
|
|
35
|
+
}), d && /* @__PURE__ */ g("p", {
|
|
36
|
+
id: l,
|
|
37
|
+
role: C,
|
|
38
|
+
className: u("m-0 flex min-h-[24px] items-center gap-1 pt-1 text-sm leading-5 tracking-[0.03333em]", e ? "font-medium text-error-500" : "text-delta-600"),
|
|
39
|
+
children: [e && /* @__PURE__ */ x(H, {
|
|
36
40
|
width: 20,
|
|
37
|
-
height: 20
|
|
38
|
-
|
|
41
|
+
height: 20,
|
|
42
|
+
className: "min-w-5 shrink-0"
|
|
43
|
+
}), s]
|
|
39
44
|
})]
|
|
40
45
|
});
|
|
41
46
|
});
|
|
42
47
|
export {
|
|
43
|
-
|
|
48
|
+
W as StyledRadioGroup
|
|
44
49
|
};
|
|
@@ -4,21 +4,22 @@ import { CloseIcon as f } from "../../icons/close-icon/CloseIcon.js";
|
|
|
4
4
|
import { StyledInputField as u } from "../input-field/StyledInputField.js";
|
|
5
5
|
import { useState as v } from "react";
|
|
6
6
|
import { jsx as t } from "react/jsx-runtime";
|
|
7
|
-
var I = ({ value: o, onClear: s, label:
|
|
8
|
-
const [h,
|
|
7
|
+
var I = ({ value: o, onClear: s, label: i, onFocus: d, onBlur: c, ...r }) => {
|
|
8
|
+
const [h, l] = v(!1), a = h || o, n = typeof i == "string" ? i : void 0;
|
|
9
9
|
return /* @__PURE__ */ t("div", {
|
|
10
10
|
className: "relative w-full",
|
|
11
11
|
children: /* @__PURE__ */ t(u, {
|
|
12
12
|
size: "small",
|
|
13
13
|
variant: "outlined",
|
|
14
14
|
value: o,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
reserveHelperText: !1,
|
|
16
|
+
label: a ? i : void 0,
|
|
17
|
+
placeholder: a ? void 0 : n,
|
|
17
18
|
onFocus: (e) => {
|
|
18
|
-
|
|
19
|
+
l(!0), d?.(e);
|
|
19
20
|
},
|
|
20
21
|
onBlur: (e) => {
|
|
21
|
-
|
|
22
|
+
l(!1), c?.(e);
|
|
22
23
|
},
|
|
23
24
|
slotProps: {
|
|
24
25
|
htmlInput: {
|
|
@@ -28,7 +29,7 @@ var I = ({ value: o, onClear: s, label: n, onFocus: d, onBlur: c, ...r }) => {
|
|
|
28
29
|
whiteSpace: "nowrap",
|
|
29
30
|
...o ? { paddingRight: 40 } : {}
|
|
30
31
|
},
|
|
31
|
-
"aria-label":
|
|
32
|
+
"aria-label": a ? void 0 : n
|
|
32
33
|
},
|
|
33
34
|
input: {
|
|
34
35
|
endAdornment: o ? /* @__PURE__ */ t("button", {
|
|
@@ -51,7 +52,7 @@ var I = ({ value: o, onClear: s, label: n, onFocus: d, onBlur: c, ...r }) => {
|
|
|
51
52
|
className: "pointer-events-none"
|
|
52
53
|
})
|
|
53
54
|
}) : null,
|
|
54
|
-
startAdornment:
|
|
55
|
+
startAdornment: a ? void 0 : /* @__PURE__ */ t("span", {
|
|
55
56
|
"data-testid": "styled-search-icon",
|
|
56
57
|
className: "flex items-center",
|
|
57
58
|
children: /* @__PURE__ */ t(m, {
|