asma-ui-core 3.134.0 → 3.134.2

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 (35) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/feedback/dialog/StyledDialog.js +177 -149
  3. package/dist/components/feedback/dialog/StyledDialog.module.js +1 -1
  4. package/dist/components/feedback/dialog/StyledDialogActions.js +4 -3
  5. package/dist/components/feedback/dialog/StyledDialogContent.js +9 -8
  6. package/dist/components/feedback/dialog/StyledDialogTitle.js +23 -21
  7. package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +1 -0
  8. package/dist/components/feedback/dialog/dialogHeaderStyles.js +7 -0
  9. package/dist/components/feedback/dialog/useDialogHeaderPinning.js +56 -0
  10. package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +203 -182
  11. package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +148 -133
  12. package/dist/components/inputs/full-screen-picker/FullScreenPicker.js +1 -1
  13. package/dist/components/inputs/full-screen-picker/useReleaseFieldOnKeyboardDismiss.js +13 -12
  14. package/dist/components/inputs/input-field/StyledInputField.js +139 -136
  15. package/dist/hooks/useElementHeightPx.js +26 -0
  16. package/dist/hooks/useLayoutViewportHeight.js +5 -0
  17. package/dist/hooks/useMediaQuery.hook.js +9 -8
  18. package/dist/hooks/useOnScreenKeyboard.js +24 -0
  19. package/dist/index.js +366 -352
  20. package/dist/src/components/feedback/dialog/StyledDialog.d.ts +4 -3
  21. package/dist/src/components/feedback/dialog/StyledDialogTitle.d.ts +4 -0
  22. package/dist/src/components/feedback/dialog/dialogHeaderStyles.d.ts +28 -0
  23. package/dist/src/components/feedback/dialog/dialogTitleContext.d.ts +5 -0
  24. package/dist/src/components/feedback/dialog/useDialogHeaderPinning.d.ts +33 -0
  25. package/dist/src/hooks/useElementHeightPx.d.ts +16 -0
  26. package/dist/src/hooks/useLayoutViewportHeight.d.ts +6 -0
  27. package/dist/src/hooks/useMediaQuery.hook.d.ts +6 -0
  28. package/dist/src/hooks/useOnScreenKeyboard.d.ts +21 -0
  29. package/dist/src/index.d.ts +6 -0
  30. package/dist/table/components/StyledTableIndex.js +5 -5
  31. package/package.json +1 -1
  32. package/dist/src/table/components/columns/helpers/useElementHeightPx.d.ts +0 -7
  33. package/dist/table/components/columns/helpers/useElementHeightPx.js +0 -26
  34. /package/dist/{components/inputs/full-screen-picker → hooks}/useVisualViewportHeight.js +0 -0
  35. /package/dist/src/{components/inputs/full-screen-picker → hooks}/useVisualViewportHeight.d.ts +0 -0
@@ -1,279 +1,282 @@
1
- import { cn as a } from "../../../helpers/cn.js";
2
- import { resolveSx as B } from "../../../helpers/sx.js";
3
- import { StyledTooltip as vt } from "../../data-display/tooltip/StyledTooltip.js";
4
- import { CloseIcon as Lt } from "../../icons/close-icon/CloseIcon.js";
5
- import { LockIcon as St } from "../../icons/lock-icon/LockIcon.js";
6
- import { CharacterCounter as It } from "../../../helpers/CharacterCounter.js";
7
- import { HelperRow as Nt } from "../../../helpers/HelperRow.js";
8
- import { useHelperRowBudget as _t } from "../../../helpers/useHelperRowBudget.js";
9
- import { useHelperSlot as At } from "../../../helpers/useHelperSlot.js";
10
- import { fieldLabelAboveClass as Ht, fieldWidthStyle as Ct, floatingLabelClass as Rt, floatingLabelLayoutStyle as wt, notchedLegendClass as Ft, notchedOutlineClass as he, singleLineInputLayoutStyle as Bt, singleLineShellLayoutStyle as Mt } from "../field-styles.js";
1
+ import { cn as r } from "../../../helpers/cn.js";
2
+ import { resolveSx as M } from "../../../helpers/sx.js";
3
+ import { StyledTooltip as St } from "../../data-display/tooltip/StyledTooltip.js";
4
+ import { CloseIcon as Ht } from "../../icons/close-icon/CloseIcon.js";
5
+ import { LockIcon as It } from "../../icons/lock-icon/LockIcon.js";
6
+ import { CharacterCounter as Nt } from "../../../helpers/CharacterCounter.js";
7
+ import { HelperRow as _t } from "../../../helpers/HelperRow.js";
8
+ import { useHelperRowBudget as At } from "../../../helpers/useHelperRowBudget.js";
9
+ import { useHelperSlot as Ct } from "../../../helpers/useHelperSlot.js";
10
+ import { fieldLabelAboveClass as Rt, fieldWidthStyle as wt, floatingLabelClass as Ft, floatingLabelLayoutStyle as Bt, notchedLegendClass as Mt, notchedOutlineClass as ge, singleLineInputLayoutStyle as Et, singleLineShellLayoutStyle as Ot } from "../field-styles.js";
11
11
  import L from "./StyledInputField.module.js";
12
- import { Children as Et, useCallback as pe, useId as Ot, useLayoutEffect as M, useRef as J, useState as E } from "react";
13
- import { Fragment as Tt, jsx as t, jsxs as f } from "react/jsx-runtime";
14
- import { useMergeRefs as me } from "@floating-ui/react";
15
- var ge = "peer-focus-visible:border-focus-ring peer-focus-visible:shadow-[inset_0_0_0_2px_var(--colors-focus-ring)]", Dt = "pointer-events-none absolute -inset-1 rounded peer-focus-visible:shadow-[inset_0_0_0_2px_var(--colors-focus-ring)]", kt = ({ reason: u, children: r }) => u === void 0 ? r : /* @__PURE__ */ t(vt, {
12
+ import { Children as Tt, useCallback as fe, useId as Dt, useLayoutEffect as E, useRef as X, useState as O } from "react";
13
+ import { Fragment as kt, jsx as t, jsxs as f } from "react/jsx-runtime";
14
+ import { useMergeRefs as xe } from "@floating-ui/react";
15
+ var ye = "peer-focus-visible:border-focus-ring peer-focus-visible:shadow-[inset_0_0_0_2px_var(--colors-focus-ring)]", $t = "pointer-events-none absolute -inset-1 rounded peer-focus-visible:shadow-[inset_0_0_0_2px_var(--colors-focus-ring)]", Wt = ({ reason: u, children: a }) => u === void 0 ? a : /* @__PURE__ */ t(St, {
16
16
  title: u,
17
17
  openOnTap: !0,
18
18
  persistentDescription: !0,
19
- children: r
20
- }), mn = ({ dataTest: u, label: r, labelPlacement: fe = "above", value: x, defaultValue: S, onChange: xe, onBlur: ye, onFocus: be, error: y, helperText: Q, reserveHelperText: ve, expandHelperText: Le = !0, maxLength: Se, counter: Ie, locale: Ne, disabled: h, readOnly: _e, lockedReason: O, readOnlyReason: T, required: _, allowClear: Ae, onClear: He, type: Ce = "text", placeholder: Re, name: we, id: Fe, autoComplete: Be, autoFocus: Me, multiline: i, rows: A, minRows: D, maxRows: k, size: Ee = "medium", width: X = "full", fullWidth: Wt, className: Oe, style: Te, sx: De, inputRef: ke, slotProps: n, InputProps: Z, onKeyDown: q, onClick: We, variant: $t }) => {
21
- const $e = Ot(), W = Fe ?? $e, ee = `${W}-helper-text`, $ = J(null), z = J(0), te = J(null), [ze, Ue] = E(void 0), [H, ne] = E(!1), [je, oe] = E(S != null && S !== ""), [Pe, Ke] = E(String(S ?? "").length), c = !!O || O === 0, o = !c && (!!T || T === 0), l = !!_e || c || o, C = x !== void 0, le = C ? x !== "" && x != null : je, Ge = !!h || !!l, U = n?.input?.startAdornment ?? Z?.startAdornment, I = Et.count(U) > 0, m = I && Array.isArray(U), j = n?.input?.endAdornment ?? Z?.endAdornment, b = c ? /* @__PURE__ */ f(Tt, { children: [j, /* @__PURE__ */ t(St, {
19
+ children: a
20
+ }), fn = ({ dataTest: u, label: a, labelPlacement: be = "above", value: x, defaultValue: S, onChange: ve, onBlur: Le, onFocus: Se, error: y, helperText: Z, reserveHelperText: He, expandHelperText: Ie = !0, maxLength: Ne, counter: _e, locale: Ae, disabled: h, readOnly: Ce, lockedReason: T, readOnlyReason: D, required: N, allowClear: Re, onClear: we, type: Fe = "text", placeholder: Be, name: Me, id: Ee, autoComplete: Oe, autoFocus: Te, multiline: i, rows: _, minRows: k, maxRows: $, size: De = "medium", width: q = "full", fullWidth: zt, className: ke, style: $e, sx: We, inputRef: ze, slotProps: n, InputProps: ee, onKeyDown: te, onClick: Ue, variant: Ut }) => {
21
+ const je = Dt(), W = Ee ?? je, ne = `${W}-helper-text`, z = X(null), U = X(0), oe = X(null), [Pe, Ke] = O(void 0), [A, le] = O(!1), [Ge, ie] = O(S != null && S !== ""), [Ve, Ye] = O(String(S ?? "").length), c = !!T || T === 0, o = !c && (!!D || D === 0), l = !!Ce || c || o, C = x !== void 0, re = C ? x !== "" && x != null : Ge, Je = !!h || !!l, j = n?.input?.startAdornment ?? ee?.startAdornment, H = Tt.count(j) > 0, m = H && Array.isArray(j), P = n?.input?.endAdornment ?? ee?.endAdornment, b = c ? /* @__PURE__ */ f(kt, { children: [P, /* @__PURE__ */ t(It, {
22
22
  width: 24,
23
23
  height: 24,
24
24
  className: "text-delta-700"
25
- })] }) : j, N = !!(Ae && le && !Ge), { ref: Ve, ...s } = n?.htmlInput ?? {}, Ye = ke ?? Ve, { className: Je, style: P, ref: Qe } = n?.input ?? {}, Xe = me([Qe]), Ze = n?.input?.onMouseDown, ie = n?.input?.onClick, qe = ie ? { onClick: ie } : {}, et = Be ?? s.autoComplete, tt = we ?? s.name, K = s.id ?? W, R = Se ?? s.maxLength, ae = `${W}-counter`, G = Ie !== !1 && !!R && !o, nt = C ? String(x ?? "").length : Pe, w = fe === "floating" && !!r && !o, F = H || le || I, g = pe(() => {
26
- const e = $.current;
27
- if (!(!i || !e) && (z.current = e.offsetWidth, z.current !== 0)) {
28
- if (e.removeAttribute("data-scrollable"), A != null && !l) e.style.height = "";
25
+ })] }) : P, I = !!(Re && re && !Je), { ref: Qe, ...s } = n?.htmlInput ?? {}, Xe = ze ?? Qe, { className: Ze, style: K, ref: qe } = n?.input ?? {}, et = xe([qe]), tt = n?.input?.onMouseDown, ae = n?.input?.onClick, nt = ae ? { onClick: ae } : {}, ot = Oe ?? s.autoComplete, lt = Me ?? s.name, G = s.id ?? W, R = Ne ?? s.maxLength, se = `${W}-counter`, V = _e !== !1 && !!R && !o, it = C ? String(x ?? "").length : Ve, w = be === "floating" && !!a && !o, F = A || re || H, g = fe(() => {
26
+ const e = z.current;
27
+ if (!(!i || !e) && (U.current = e.offsetWidth, U.current !== 0)) {
28
+ if (e.removeAttribute("data-scrollable"), _ != null && !l) e.style.height = "";
29
29
  else {
30
30
  if (e.style.height = "auto", e.scrollHeight === 0) {
31
31
  e.style.height = "";
32
32
  return;
33
33
  }
34
- const d = getComputedStyle(e), p = Number.parseFloat(d.lineHeight) || 24, ce = Number.parseFloat(d.paddingTop) + Number.parseFloat(d.paddingBottom), ue = A ?? D, yt = ue ? ue * p + ce : 0, bt = l || !k ? Number.POSITIVE_INFINITY : k * p + ce;
35
- e.style.height = `${Math.min(bt, Math.max(yt, e.scrollHeight))}px`;
34
+ const d = getComputedStyle(e), p = Number.parseFloat(d.lineHeight) || 24, he = Number.parseFloat(d.paddingTop) + Number.parseFloat(d.paddingBottom), pe = _ ?? k, Lt = pe ? pe * p + he : 0, Q = l || !$ ? Number.POSITIVE_INFINITY : $ * p + he;
35
+ let B = Math.min(Q, Math.max(Lt, e.scrollHeight));
36
+ e.style.height = `${B}px`;
37
+ for (let me = 0; me < 2 && B < Q && e.scrollHeight > e.clientHeight + 1; me++)
38
+ B = Math.min(Q, e.scrollHeight), e.style.height = `${B}px`;
36
39
  }
37
40
  e.scrollHeight > e.clientHeight + 1 && e.setAttribute("data-scrollable", "true");
38
41
  }
39
42
  }, [
43
+ $,
40
44
  k,
41
- D,
42
45
  i,
43
46
  l,
44
- A
45
- ]), ot = (e) => {
46
- l || (C || (oe(e.target.value !== ""), Ke(e.target.value.length), g()), xe?.(e));
47
- }, lt = (e) => {
48
- !h && !l && ne(!0), be?.(e);
49
- }, it = (e) => {
50
- !h && !l && ne(!1), ye?.(e);
47
+ _
48
+ ]), rt = (e) => {
49
+ l || (C || (ie(e.target.value !== ""), Ye(e.target.value.length), g()), ve?.(e));
50
+ }, at = (e) => {
51
+ !h && !l && le(!0), Se?.(e);
52
+ }, st = (e) => {
53
+ !h && !l && le(!1), Le?.(e);
51
54
  };
52
- M(() => {
55
+ E(() => {
53
56
  g();
54
57
  }, [
55
58
  g,
56
59
  S,
57
60
  x
58
- ]), M(() => {
61
+ ]), E(() => {
59
62
  if (!i || !document.fonts) return;
60
63
  const e = () => g();
61
64
  return document.fonts.addEventListener("loadingdone", e), () => document.fonts.removeEventListener("loadingdone", e);
62
- }, [i, g]), M(() => {
63
- const e = $.current;
65
+ }, [i, g]), E(() => {
66
+ const e = z.current;
64
67
  if (!i || !e || typeof ResizeObserver > "u") return;
65
68
  let d = 0;
66
69
  const p = new ResizeObserver(() => {
67
- e.offsetWidth !== z.current && (cancelAnimationFrame(d), d = requestAnimationFrame(g));
70
+ e.offsetWidth !== U.current && (cancelAnimationFrame(d), d = requestAnimationFrame(g));
68
71
  });
69
72
  return p.observe(e), () => {
70
73
  cancelAnimationFrame(d), p.disconnect();
71
74
  };
72
75
  }, [i, g]);
73
- const re = me([Ye, pe((e) => {
74
- $.current = e instanceof HTMLTextAreaElement ? e : null;
75
- }, [])]), { style: V, ...at } = s, v = !i && !m && !o, { height: zt, minHeight: Ut, maxHeight: jt, paddingTop: Pt, paddingBottom: Kt, ...rt } = P ?? {}, st = v ? {
76
- ...rt,
77
- ...Mt()
76
+ const de = xe([Xe, fe((e) => {
77
+ z.current = e instanceof HTMLTextAreaElement ? e : null;
78
+ }, [])]), { style: Y, ...dt } = s, v = !i && !m && !o, { height: jt, minHeight: Pt, maxHeight: Kt, paddingTop: Gt, paddingBottom: Vt, ...ct } = K ?? {}, ut = v ? {
79
+ ...ct,
80
+ ...Ot()
78
81
  } : m ? {
79
82
  boxSizing: "border-box",
80
83
  minHeight: 40,
81
- ...P
82
- } : P, { height: Gt, minHeight: Vt, maxHeight: Yt, paddingTop: Jt, paddingBottom: Qt, paddingLeft: Xt, paddingRight: dt, ...ct } = V ?? {}, ut = v ? {
83
- ...ct,
84
- ...Bt({
85
- paddingLeft: I ? 40 : 14,
86
- paddingRight: dt ?? ze ?? (N || b ? 40 : 14)
84
+ ...K
85
+ } : K, { height: Yt, minHeight: Jt, maxHeight: Qt, paddingTop: Xt, paddingBottom: Zt, paddingLeft: qt, paddingRight: ht, ...pt } = Y ?? {}, mt = v ? {
86
+ ...pt,
87
+ ...Et({
88
+ paddingLeft: H ? 40 : 14,
89
+ paddingRight: ht ?? Pe ?? (I || b ? 40 : 14)
87
90
  })
88
- } : V;
89
- M(() => {
91
+ } : Y;
92
+ E(() => {
90
93
  if (!v) return;
91
- const e = te.current, d = e ? Math.ceil(e.getBoundingClientRect().width) + 20 : void 0;
92
- Ue((p) => p === d ? p : d);
94
+ const e = oe.current, d = e ? Math.ceil(e.getBoundingClientRect().width) + 20 : void 0;
95
+ Ke((p) => p === d ? p : d);
93
96
  }, [
94
97
  v,
95
- N,
96
- j,
98
+ I,
99
+ P,
97
100
  c
98
101
  ]);
99
- const ht = F || !w, { show: Y, role: pt } = At("StyledInputField", y, Q, ve, l, G), { fieldRef: mt, rowRef: gt, rowStyle: ft } = _t(Le && Y), se = {
100
- ...at,
101
- style: v ? ut : V,
102
- id: K,
103
- name: tt,
102
+ const gt = F || !w, { show: J, role: ft } = Ct("StyledInputField", y, Z, He, l, V), { fieldRef: xt, rowRef: yt, rowStyle: bt } = At(Ie && J), ce = {
103
+ ...dt,
104
+ style: v ? mt : Y,
105
+ id: G,
106
+ name: lt,
104
107
  maxLength: R,
105
- placeholder: ht ? Re : void 0,
108
+ placeholder: gt ? Be : void 0,
106
109
  disabled: h,
107
110
  readOnly: l,
108
- required: _,
109
- autoComplete: et,
110
- autoFocus: Me,
111
+ required: N,
112
+ autoComplete: ot,
113
+ autoFocus: Te,
111
114
  value: x,
112
115
  defaultValue: S,
113
116
  "aria-invalid": y ? !0 : void 0,
114
- "aria-label": s["aria-label"] ?? (s["aria-labelledby"] ? void 0 : typeof r == "string" && r !== "" ? r : void 0),
115
- "aria-describedby": [Y ? ee : s["aria-describedby"], G ? ae : void 0].filter(Boolean).join(" ") || void 0,
116
- onChange: ot,
117
- onFocus: lt,
118
- onBlur: it,
119
- onKeyDown: s.onKeyDown || q ? (e) => {
120
- q?.(e), e.defaultPrevented || s.onKeyDown?.(e);
117
+ "aria-label": s["aria-label"] ?? (s["aria-labelledby"] ? void 0 : typeof a == "string" && a !== "" ? a : void 0),
118
+ "aria-describedby": [J ? ne : s["aria-describedby"], V ? se : void 0].filter(Boolean).join(" ") || void 0,
119
+ onChange: rt,
120
+ onFocus: at,
121
+ onBlur: st,
122
+ onKeyDown: s.onKeyDown || te ? (e) => {
123
+ te?.(e), e.defaultPrevented || s.onKeyDown?.(e);
121
124
  } : void 0
122
- }, de = a(L.Input, "peer border-0 bg-transparent text-base tracking-[0.00938em] outline-none placeholder:text-delta-500", o ? "text-delta-700" : "text-delta-800", m ? "box-border h-8 min-w-[60px] flex-1 py-0 pl-0 pr-0 leading-[23px]" : i ? a("w-full resize-none p-0 pl-0 pr-0", o ? "leading-6" : "leading-[23px]", L["Input--multiline"]) : o ? "m-0 w-full p-0 text-base leading-6" : a("w-full", L["Input--singleLine"], !N && !b && "max-xs:pr-1.5"), "disabled:text-delta-300", l && !o && "text-delta-800", (c || o) && "cursor-default", Je), xt = !i && !m ? {
123
- "data-start-adornment": I ? "true" : void 0,
124
- "data-end-adornment": N || b ? "true" : void 0
125
+ }, ue = r(L.Input, "peer border-0 bg-transparent text-base tracking-[0.00938em] outline-none placeholder:text-delta-500", o ? "text-delta-700" : "text-delta-800", m ? "box-border h-8 min-w-[60px] flex-1 py-0 pl-0 pr-0 leading-[23px]" : i ? r("w-full resize-none p-0 pl-0 pr-0", o ? "leading-6" : "leading-[23px]", L["Input--multiline"]) : o ? "m-0 w-full p-0 text-base leading-6" : r("w-full", L["Input--singleLine"], !I && !b && "max-xs:pr-1.5"), "disabled:text-delta-300", l && !o && "text-delta-800", (c || o) && "cursor-default", Ze), vt = !i && !m ? {
126
+ "data-start-adornment": H ? "true" : void 0,
127
+ "data-end-adornment": I || b ? "true" : void 0
125
128
  } : {};
126
129
  return /* @__PURE__ */ f("div", {
127
- ref: mt,
128
- className: a("group relative min-w-0 flex-col", Oe),
129
- onClick: We,
130
- "data-field-width": X,
130
+ ref: xt,
131
+ className: r("group relative min-w-0 flex-col", ke),
132
+ onClick: Ue,
133
+ "data-field-width": q,
131
134
  style: {
132
135
  display: "flex",
133
- ...Ct(X),
136
+ ...wt(q),
134
137
  fontFamily: "Roboto, Helvetica, Arial, sans-serif",
135
138
  letterSpacing: "0.00938em",
136
- ...B(De),
137
- ...Te
139
+ ...M(We),
140
+ ...$e
138
141
  },
139
142
  children: [
140
- r && !w && /* @__PURE__ */ t("div", {
141
- className: a(Ht({
143
+ a && !w && /* @__PURE__ */ t("div", {
144
+ className: r(Rt({
142
145
  disabled: h,
143
146
  flush: o
144
147
  }), n?.inputLabel?.className),
145
148
  style: {
146
- ...B(n?.inputLabel?.sx),
149
+ ...M(n?.inputLabel?.sx),
147
150
  ...n?.inputLabel?.style
148
151
  },
149
152
  children: /* @__PURE__ */ f("label", {
150
- htmlFor: K,
151
- children: [r, _ && /* @__PURE__ */ t("span", {
153
+ htmlFor: G,
154
+ children: [a, N && /* @__PURE__ */ t("span", {
152
155
  "aria-hidden": "true",
153
156
  children: " *"
154
157
  })]
155
158
  })
156
159
  }),
157
- /* @__PURE__ */ t(kt, {
158
- reason: c ? O : o ? T : void 0,
160
+ /* @__PURE__ */ t(Wt, {
161
+ reason: c ? T : o ? D : void 0,
159
162
  children: /* @__PURE__ */ f("div", {
160
163
  className: "relative overflow-visible",
161
164
  children: [/* @__PURE__ */ f("div", {
162
- className: a("relative flex", v && L.InputShell, i && !o && "box-border items-center px-[14px] py-[16.5px]", m && a(L.AdornmentList, b && L["AdornmentList--endAdornment"]), l && !o && "rounded bg-delta-50", c && i && "pr-[44px]"),
163
- ref: Xe,
164
- onMouseDown: Ze,
165
- ...qe,
166
- style: st,
165
+ className: r("relative flex", v && L.InputShell, i && !o && "box-border items-center px-[14px] py-[16.5px]", m && r(L.AdornmentList, b && L["AdornmentList--endAdornment"]), l && !o && "rounded bg-delta-50", c && i && "pr-[44px]"),
166
+ ref: et,
167
+ onMouseDown: tt,
168
+ ...nt,
169
+ style: ut,
167
170
  "data-testid": m ? `${u}-adornment-list` : `${u}-shell`,
168
171
  children: [
169
- I && /* @__PURE__ */ t("span", {
170
- className: a("items-center text-delta-500", m ? "contents" : "absolute left-3 flex"),
171
- children: U
172
+ H && /* @__PURE__ */ t("span", {
173
+ className: r("items-center text-delta-500", m ? "contents" : "absolute left-3 flex"),
174
+ children: j
172
175
  }),
173
176
  i ? /* @__PURE__ */ t("textarea", {
174
- ...se,
175
- ref: re,
177
+ ...ce,
178
+ ref: de,
176
179
  "data-testid": u,
177
- rows: A ?? D ?? 2,
178
- className: de
180
+ rows: _ ?? k ?? 2,
181
+ className: ue
179
182
  }) : /* @__PURE__ */ t("input", {
180
- ...se,
181
- ...xt,
182
- ref: re,
183
+ ...ce,
184
+ ...vt,
185
+ ref: de,
183
186
  "data-testid": u,
184
- type: Ce,
185
- className: de
187
+ type: Fe,
188
+ className: ue
186
189
  }),
187
- N ? /* @__PURE__ */ t("button", {
190
+ I ? /* @__PURE__ */ t("button", {
188
191
  type: "button",
189
192
  tabIndex: -1,
190
193
  "aria-label": "Clear",
191
194
  "data-testid": `${u}-clear`,
192
195
  className: "asma-pressable absolute right-4 z-40 flex items-center justify-center rounded-full border-0 bg-transparent p-[2px] duration-300 hover:bg-gama-100",
193
196
  onClick: (e) => {
194
- e.stopPropagation(), e.preventDefault(), C || oe(!1), He?.();
197
+ e.stopPropagation(), e.preventDefault(), C || ie(!1), we?.();
195
198
  },
196
- children: /* @__PURE__ */ t(Lt, {
199
+ children: /* @__PURE__ */ t(Ht, {
197
200
  width: 18,
198
201
  height: 18
199
202
  })
200
203
  }) : b && /* @__PURE__ */ t("span", {
201
- ref: te,
204
+ ref: oe,
202
205
  className: "absolute inset-y-0 right-[14px] flex max-w-[calc(100%-28px)] items-center gap-1",
203
206
  children: b
204
207
  }),
205
208
  o ? /* @__PURE__ */ t("div", {
206
209
  "aria-hidden": !0,
207
- className: Dt
210
+ className: $t
208
211
  }) : w ? /* @__PURE__ */ t("fieldset", {
209
212
  "aria-hidden": !0,
210
- className: a(he({
211
- focused: H,
213
+ className: r(ge({
214
+ focused: A,
212
215
  error: y,
213
216
  disabled: h,
214
217
  readOnly: l,
215
218
  notched: !0
216
- }), c && ge),
219
+ }), c && ye),
217
220
  children: /* @__PURE__ */ t("legend", {
218
- className: Ft(F),
221
+ className: Mt(F),
219
222
  children: /* @__PURE__ */ f("span", {
220
223
  className: "inline-block px-[5px]",
221
- children: [r, _ && " *"]
224
+ children: [a, N && " *"]
222
225
  })
223
226
  })
224
227
  }) : /* @__PURE__ */ t("div", {
225
228
  "aria-hidden": !0,
226
- className: a(he({
227
- focused: H,
229
+ className: r(ge({
230
+ focused: A,
228
231
  error: y,
229
232
  disabled: h,
230
233
  readOnly: l,
231
234
  notched: !1
232
- }), c && ge)
235
+ }), c && ye)
233
236
  })
234
237
  ]
235
238
  }), w && /* @__PURE__ */ f("label", {
236
- htmlFor: K,
237
- className: a(Rt({
239
+ htmlFor: G,
240
+ className: r(Ft({
238
241
  shrink: F,
239
- focused: H,
242
+ focused: A,
240
243
  error: y,
241
244
  disabled: h,
242
245
  readOnly: l,
243
- size: Ee
246
+ size: De
244
247
  }), n?.inputLabel?.className),
245
248
  style: {
246
- ...B(n?.inputLabel?.sx),
249
+ ...M(n?.inputLabel?.sx),
247
250
  ...n?.inputLabel?.style,
248
- ...wt(F)
251
+ ...Bt(F)
249
252
  },
250
- children: [r, _ && " *"]
253
+ children: [a, N && " *"]
251
254
  })]
252
255
  })
253
256
  }),
254
- Y && /* @__PURE__ */ t(Nt, {
255
- ref: gt,
256
- id: ee,
257
- role: pt,
257
+ J && /* @__PURE__ */ t(_t, {
258
+ ref: yt,
259
+ id: ne,
260
+ role: ft,
258
261
  error: y,
259
- message: Q,
262
+ message: Z,
260
263
  hideErrorIcon: n?.formHelperText?.hideErrorIcon,
261
- className: a("mr-[14px] box-border items-start", n?.formHelperText?.className),
264
+ className: r("mr-[14px] box-border items-start", n?.formHelperText?.className),
262
265
  style: {
263
- ...ft,
264
- ...B(n?.formHelperText?.sx)
266
+ ...bt,
267
+ ...M(n?.formHelperText?.sx)
265
268
  }
266
269
  }),
267
- G && R ? /* @__PURE__ */ t(It, {
268
- id: ae,
269
- length: nt,
270
+ V && R ? /* @__PURE__ */ t(Nt, {
271
+ id: se,
272
+ length: it,
270
273
  limit: R,
271
- locale: Ne,
274
+ locale: Ae,
272
275
  className: "pt-1"
273
276
  }) : null
274
277
  ]
275
278
  });
276
279
  };
277
280
  export {
278
- mn as StyledInputField
281
+ fn as StyledInputField
279
282
  };
@@ -0,0 +1,26 @@
1
+ import { useCallback as h, useLayoutEffect as d, useState as s } from "react";
2
+ var g = (n) => Math.round(n.getBoundingClientRect().height);
3
+ function b(n = g) {
4
+ const [t, a] = s(null), [u, l] = s(0), m = h((e) => a(e), []);
5
+ return d(() => {
6
+ if (!t) return;
7
+ let e = 0;
8
+ const o = () => {
9
+ const i = n(t);
10
+ i !== null && l((c) => c === i ? c : i);
11
+ }, f = () => {
12
+ cancelAnimationFrame(e), e = requestAnimationFrame(o);
13
+ };
14
+ if (o(), typeof ResizeObserver > "u") return () => cancelAnimationFrame(e);
15
+ const r = new ResizeObserver(f);
16
+ return r.observe(t), () => {
17
+ cancelAnimationFrame(e), r.disconnect();
18
+ };
19
+ }, [t, n]), {
20
+ ref: m,
21
+ heightPx: t ? u : 0
22
+ };
23
+ }
24
+ export {
25
+ b as useElementHeightPx
26
+ };
@@ -0,0 +1,5 @@
1
+ import { useSyncExternalStore as r } from "react";
2
+ var t = (e) => (window.addEventListener("resize", e), () => window.removeEventListener("resize", e)), n = () => window.innerHeight, i = () => 0, s = () => r(t, n, i);
3
+ export {
4
+ s as useLayoutViewportHeight
5
+ };
@@ -3,24 +3,25 @@ function e(t) {
3
3
  function i() {
4
4
  return window.matchMedia(t).matches;
5
5
  }
6
- function a(r) {
7
- const n = window.matchMedia(t);
8
- return n.addEventListener("change", r), () => {
9
- n.removeEventListener("change", r);
6
+ function n(r) {
7
+ const a = window.matchMedia(t);
8
+ return a.addEventListener("change", r), () => {
9
+ a.removeEventListener("change", r);
10
10
  };
11
11
  }
12
12
  function u() {
13
13
  return !1;
14
14
  }
15
15
  return function() {
16
- return o(a, i, u);
16
+ return o(n, i, u);
17
17
  };
18
18
  }
19
- var h = e("(max-width: 743px)"), s = e("not all and (min-width: 320px)"), x = e("(max-height: 480px)"), c = e("(max-height: 480px) and (min-width: 480px)"), m = e("(max-width: 743px), (max-height: 480px)");
19
+ var h = e("(max-width: 743px)"), s = e("not all and (min-width: 320px)"), m = e("(max-height: 480px)"), x = e("(max-height: 30em)"), c = e("(max-height: 480px) and (min-width: 480px)"), p = e("(max-width: 743px), (max-height: 480px)");
20
20
  export {
21
- m as useFullScreenPickerMediaQuery,
21
+ p as useFullScreenPickerMediaQuery,
22
22
  s as useMaxXsMediaQuery,
23
23
  h as useMobileMediaQuery,
24
24
  c as usePickerOneRowHeaderMediaQuery,
25
- x as useShortViewportMediaQuery
25
+ x as useShortScreenMediaQuery,
26
+ m as useShortViewportMediaQuery
26
27
  };
@@ -0,0 +1,24 @@
1
+ import { useSyncExternalStore as t } from "react";
2
+ var r = 150, i = (e = typeof window > "u" ? void 0 : window.visualViewport) => !!e && window.innerHeight - e.height * e.scale >= r, o = (e) => typeof HTMLElement > "u" || !(e instanceof HTMLElement) || e.inputMode === "none" ? !1 : e instanceof HTMLTextAreaElement || e.isContentEditable ? !0 : e instanceof HTMLInputElement ? ![
3
+ "button",
4
+ "checkbox",
5
+ "color",
6
+ "file",
7
+ "hidden",
8
+ "image",
9
+ "radio",
10
+ "range",
11
+ "reset",
12
+ "submit"
13
+ ].includes(e.type) : !1, s = () => typeof document < "u" && o(document.activeElement) && i(), d = (e) => {
14
+ const n = window.visualViewport;
15
+ return n?.addEventListener("resize", e), window.addEventListener("resize", e), document.addEventListener("focusin", e), document.addEventListener("focusout", e), () => {
16
+ n?.removeEventListener("resize", e), window.removeEventListener("resize", e), document.removeEventListener("focusin", e), document.removeEventListener("focusout", e);
17
+ };
18
+ }, u = () => !1, f = () => t(d, s, u);
19
+ export {
20
+ s as isOnScreenKeyboardOpen,
21
+ o as isTextField,
22
+ i as isVisualViewportShrunkByKeyboard,
23
+ f as useOnScreenKeyboardOpen
24
+ };