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