asma-ui-core 3.73.0 → 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.
@@ -1,20 +1,20 @@
1
- import { cn as $ } from "../../../../helpers/cn.js";
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 j } from "../../../data-display/chip/StyledChip.js";
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 B } from "../../../data-display/tooltip/StyledTooltip.js";
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 L, forwardRef as oe, useCallback as b, useState as ne } from "react";
12
- import { Fragment as q, jsx as l, jsxs as O } from "react/jsx-runtime";
13
- var ye = oe((S, E) => {
14
- const [F, k] = ne(!1), { options: f, dataTest: g, value: x, readOnly: u, multiple: o, required: z, onChange: y, size: H, title: v, noOptionsText: K, placeholder: _, disabled: I, helperText: R, disableHelperText: A, error: G, valueKey: N = "value", labelKey: W = "label", renderLabel: i, getOptionTooltip: P, 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?.[N] : e, [N]), V = b((e, t) => p(e) === p(t), [p]), w = (e) => {
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
- }, D = b((e) => {
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: F,
32
- onOpen: D,
31
+ open: z,
32
+ onOpen: $,
33
33
  onClose: X,
34
34
  disableCloseOnSelect: o,
35
35
  dataTest: g,
36
36
  disabled: !!I || !!m,
37
- noOptionsText: K,
37
+ noOptionsText: _,
38
38
  loading: m,
39
39
  readOnly: u,
40
40
  value: x,
41
- size: H,
42
- disableClearable: z,
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 ?? V,
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(j, {
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) => !V(h, r)));
68
+ Array.isArray(x) && y(x.filter((h) => !D(h, r)));
69
69
  }
70
- }, w(r))), c > 0 ? /* @__PURE__ */ l(j, {
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: D
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 = P ? P(t) : null;
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__ */ L("li", {
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: $("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"),
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(B, {
96
+ }, /* @__PURE__ */ l(L, {
97
97
  arrow: !0,
98
98
  title: c,
99
- children: /* @__PURE__ */ O(q, { children: [/* @__PURE__ */ l(te, {
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__ */ L("li", {
113
+ return /* @__PURE__ */ q("li", {
114
114
  ...e,
115
115
  role: "option",
116
116
  "aria-selected": r,
117
117
  key: e.id,
118
- className: $("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"),
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(B, {
121
+ }, /* @__PURE__ */ l(L, {
122
122
  arrow: !0,
123
123
  title: c,
124
- children: /* @__PURE__ */ O(q, { children: [/* @__PURE__ */ l("span", {
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: E,
141
- error: G,
142
- helperText: A ? void 0 : R,
143
- reserveHelperText: !A,
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,
@@ -22,7 +22,7 @@ var d = () => ({
22
22
  } : {
23
23
  top: "50%",
24
24
  transform: "translateY(-50%)"
25
- }, x = ({ focused: e, error: r, disabled: t, readOnly: o, borderless: a }) => n("pointer-events-none absolute inset-0 rounded border border-solid transition-colors", a && !e ? "border-transparent" : t ? "border-delta-300" : o ? "border-delta-200" : r ? n("border-error-500", e && "border-2") : e ? "border-2 border-gama-400" : "border-delta-500 group-hover:border-2 group-hover:border-gama-300"), s = ({ focused: e, error: r, disabled: t, readOnly: o, notched: a = !0 }) => n("pointer-events-none absolute z-0 m-0 box-border min-w-0 overflow-hidden rounded border border-solid transition-colors", a ? "inset-x-0 bottom-0 top-[-5px] px-2 py-0" : "inset-0", t ? "border-delta-300" : o ? "border-delta-200" : r ? "border-error-500" : e ? "border-2 border-gama-400" : "border-delta-500 group-hover:border-2 group-hover:border-gama-300"), g = (e) => n("invisible block h-[11px] overflow-hidden p-0 text-xs leading-[23px] transition-[max-width] duration-150", e ? "max-w-full" : "max-w-[0.01px]"), p = ({ shrink: e, focused: r, error: t, disabled: o, readOnly: a }) => n("pointer-events-none absolute left-[14px] z-10 max-w-[calc(100%-1.75rem)] truncate transition-colors duration-150", o ? "text-delta-300" : a ? "text-delta-800" : t ? "text-error-500" : r ? "text-gama-500" : e ? "text-delta-800" : "text-delta-500", e ? "bg-white px-1 text-xs leading-[16px] tracking-[0.24px]" : "text-base leading-[23px] tracking-[0.00938em]");
25
+ }, x = ({ focused: e, error: r, disabled: t, readOnly: o, borderless: a }) => n("pointer-events-none absolute inset-0 rounded border border-solid transition-colors", a && !e ? "border-transparent" : t ? "border-delta-300" : o ? "border-delta-200" : r ? "border-error-500" : e ? "border-[3px] border-gama-400" : "border-delta-500 group-hover:border-2 group-hover:border-gama-300"), s = ({ focused: e, error: r, disabled: t, readOnly: o, notched: a = !0 }) => n("pointer-events-none absolute z-0 m-0 box-border min-w-0 overflow-hidden rounded border border-solid transition-colors", a ? "inset-x-0 bottom-0 top-[-5px] px-2 py-0" : "inset-0", t ? "border-delta-300" : o ? "border-delta-200" : r ? "border-error-500" : e ? "border-[3px] border-gama-400" : "border-delta-500 group-hover:border-2 group-hover:border-gama-300"), g = (e) => n("invisible block h-[11px] overflow-hidden p-0 text-xs leading-[23px] transition-[max-width] duration-150", e ? "max-w-full" : "max-w-[0.01px]"), p = ({ shrink: e, focused: r, error: t, disabled: o, readOnly: a }) => n("pointer-events-none absolute left-[14px] z-10 max-w-[calc(100%-1.75rem)] truncate transition-colors duration-150", o ? "text-delta-300" : a ? "text-delta-800" : t ? "text-error-500" : r ? "text-gama-500" : e ? "text-delta-800" : "text-delta-500", e ? "bg-white px-1 text-xs leading-[16px] tracking-[0.24px]" : "text-base leading-[23px] tracking-[0.00938em]");
26
26
  export {
27
27
  p as floatingLabelClass,
28
28
  b as floatingLabelLayoutStyle,
@@ -1,125 +1,122 @@
1
- import { cn as s } from "../../../helpers/cn.js";
2
- import { resolveSx as E } from "../../../helpers/sx.js";
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 { 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);
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
- Z(() => {
20
+ X(() => {
22
21
  const e = j.current;
23
- if (!d || R != null || !e) return;
22
+ if (!r || N != null || !e) return;
24
23
  e.style.height = "auto";
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;
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
- u
29
+ H,
30
+ r,
31
+ N,
32
+ m
34
33
  ]);
35
- const W = O([ve, at((e) => {
34
+ const W = q([Ne, lt((e) => {
36
35
  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()
40
- } : c ? {
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: ut, minHeight: gt, maxHeight: ft, paddingTop: xt, paddingBottom: yt, paddingLeft: St, paddingRight: Te, ...$e } = F ?? {}, je = x ? {
43
+ } : B, { height: mt, minHeight: ut, maxHeight: gt, paddingTop: ft, paddingBottom: xt, paddingLeft: yt, paddingRight: ke, ...$e } = F ?? {}, je = f ? {
45
44
  ...$e,
46
- ...ot({
47
- paddingLeft: g ? 40 : 14,
48
- paddingRight: Te ?? be ?? (M || f ? 40 : 14)
45
+ ...nt({
46
+ paddingLeft: u ? 40 : 14,
47
+ paddingRight: ke ?? be ?? (_ || g ? 40 : 14)
49
48
  })
50
49
  } : F;
51
- Z(() => {
52
- if (!x) return;
53
- const e = z.current, m = e ? Math.ceil(e.getBoundingClientRect().width) + 20 : void 0;
54
- Ie((y) => y === m ? y : m);
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 = 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,
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: r,
61
+ disabled: s,
65
62
  readOnly: t,
66
63
  required: v,
67
64
  autoComplete: _e,
68
- autoFocus: me,
69
- value: u,
65
+ autoFocus: pe,
66
+ value: m,
70
67
  defaultValue: b,
71
- "aria-invalid": o ? !0 : void 0,
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);
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
- }, 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 ? {
81
- "data-start-adornment": g ? "true" : void 0,
82
- "data-end-adornment": M || f ? "true" : void 0
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__ */ p("div", {
81
+ return /* @__PURE__ */ S("div", {
85
82
  ref: Ue,
86
- className: s("group relative inline-flex flex-col", ue),
83
+ className: a("group relative inline-flex flex-col", ue),
87
84
  onClick: ye,
88
85
  style: {
89
- width: he ? "100%" : 235,
86
+ width: me ? "100%" : 235,
90
87
  fontFamily: "Roboto, Helvetica, Arial, sans-serif",
91
88
  letterSpacing: "0.00938em",
92
- ...E(fe),
89
+ ...D(fe),
93
90
  ...ge
94
91
  },
95
- children: [/* @__PURE__ */ p("div", {
92
+ children: [/* @__PURE__ */ S("div", {
96
93
  className: "relative overflow-visible",
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`,
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
- g && /* @__PURE__ */ i("span", {
105
- className: s("items-center text-delta-500", c ? "contents" : "absolute left-3 flex"),
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
- d ? /* @__PURE__ */ i("textarea", {
109
- ...G,
105
+ r ? /* @__PURE__ */ o("textarea", {
106
+ ...Y,
110
107
  ref: W,
111
108
  "data-testid": h,
112
- rows: R ?? L ?? 2,
113
- className: J
114
- }) : /* @__PURE__ */ i("input", {
115
- ...G,
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: J
117
+ className: G
121
118
  }),
122
- M ? /* @__PURE__ */ i("button", {
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__ */ i(Qe, {
127
+ children: /* @__PURE__ */ o(Qe, {
131
128
  width: 18,
132
129
  height: 18
133
130
  })
134
- }) : f && /* @__PURE__ */ i("span", {
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: f
134
+ children: g
138
135
  }),
139
- a ? /* @__PURE__ */ i("fieldset", {
136
+ l ? /* @__PURE__ */ o("fieldset", {
140
137
  "aria-hidden": !0,
141
- className: X({
142
- focused: H,
143
- error: o,
144
- disabled: r,
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__ */ i("legend", {
149
- className: nt(N),
150
- children: /* @__PURE__ */ p("span", {
145
+ children: /* @__PURE__ */ o("legend", {
146
+ className: tt(I),
147
+ children: /* @__PURE__ */ S("span", {
151
148
  className: "inline-block px-[5px]",
152
- children: [a, v && " *"]
149
+ children: [l, v && " *"]
153
150
  })
154
151
  })
155
- }) : /* @__PURE__ */ i("div", {
152
+ }) : /* @__PURE__ */ o("div", {
156
153
  "aria-hidden": !0,
157
- className: X({
158
- focused: H,
159
- error: o,
160
- disabled: r,
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
- }), a && /* @__PURE__ */ p("label", {
167
- htmlFor: w,
168
- className: s(et({
169
- shrink: N,
170
- focused: H,
171
- error: o,
172
- disabled: r,
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: pe
171
+ size: he
175
172
  }), n?.inputLabel?.className),
176
173
  style: {
177
- ...E(n?.inputLabel?.sx),
174
+ ...D(n?.inputLabel?.sx),
178
175
  ...n?.inputLabel?.style,
179
- ...tt(N)
176
+ ...et(I)
180
177
  },
181
- children: [a, v && " *"]
178
+ children: [l, v && " *"]
182
179
  })]
183
- }), !t && Y && /* @__PURE__ */ p("div", {
180
+ }), M && /* @__PURE__ */ o(Xe, {
184
181
  ref: Ve,
185
182
  id: $,
186
183
  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),
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
- ...E(n?.formHelperText?.sx)
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
- Ft as StyledInputField
196
+ Bt as StyledInputField
205
197
  };
@@ -1,49 +1,43 @@
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(() => ({
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: m,
12
+ value: c,
14
13
  disabled: r,
15
- onSelect: k
14
+ onSelect: C
16
15
  }), [
17
16
  a,
18
- m,
17
+ c,
19
18
  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", {
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: G,
22
+ ref: b,
26
23
  role: "radiogroup",
27
24
  "data-testid": N,
28
- "aria-describedby": d ? l : void 0,
29
- "aria-invalid": e,
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, {
40
- width: 20,
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
- W as StyledRadioGroup
42
+ Q as StyledRadioGroup
49
43
  };