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.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/feedback/dialog/StyledDialog.js +177 -149
- package/dist/components/feedback/dialog/StyledDialog.module.js +1 -1
- package/dist/components/feedback/dialog/StyledDialogActions.js +4 -3
- package/dist/components/feedback/dialog/StyledDialogContent.js +9 -8
- package/dist/components/feedback/dialog/StyledDialogTitle.js +23 -21
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +1 -0
- package/dist/components/feedback/dialog/dialogHeaderStyles.js +7 -0
- package/dist/components/feedback/dialog/useDialogHeaderPinning.js +56 -0
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +203 -182
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +148 -133
- package/dist/components/inputs/full-screen-picker/FullScreenPicker.js +1 -1
- package/dist/components/inputs/full-screen-picker/useReleaseFieldOnKeyboardDismiss.js +13 -12
- package/dist/components/inputs/input-field/StyledInputField.js +139 -136
- package/dist/hooks/useElementHeightPx.js +26 -0
- package/dist/hooks/useLayoutViewportHeight.js +5 -0
- package/dist/hooks/useMediaQuery.hook.js +9 -8
- package/dist/hooks/useOnScreenKeyboard.js +24 -0
- package/dist/index.js +366 -352
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +4 -3
- package/dist/src/components/feedback/dialog/StyledDialogTitle.d.ts +4 -0
- package/dist/src/components/feedback/dialog/dialogHeaderStyles.d.ts +28 -0
- package/dist/src/components/feedback/dialog/dialogTitleContext.d.ts +5 -0
- package/dist/src/components/feedback/dialog/useDialogHeaderPinning.d.ts +33 -0
- package/dist/src/hooks/useElementHeightPx.d.ts +16 -0
- package/dist/src/hooks/useLayoutViewportHeight.d.ts +6 -0
- package/dist/src/hooks/useMediaQuery.hook.d.ts +6 -0
- package/dist/src/hooks/useOnScreenKeyboard.d.ts +21 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/table/components/StyledTableIndex.js +5 -5
- package/package.json +1 -1
- package/dist/src/table/components/columns/helpers/useElementHeightPx.d.ts +0 -7
- package/dist/table/components/columns/helpers/useElementHeightPx.js +0 -26
- /package/dist/{components/inputs/full-screen-picker → hooks}/useVisualViewportHeight.js +0 -0
- /package/dist/src/{components/inputs/full-screen-picker → hooks}/useVisualViewportHeight.d.ts +0 -0
|
@@ -1,279 +1,282 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import { StyledTooltip as
|
|
4
|
-
import { CloseIcon as
|
|
5
|
-
import { LockIcon as
|
|
6
|
-
import { CharacterCounter as
|
|
7
|
-
import { HelperRow as
|
|
8
|
-
import { useHelperRowBudget as
|
|
9
|
-
import { useHelperSlot as
|
|
10
|
-
import { fieldLabelAboveClass as
|
|
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
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import { useMergeRefs as
|
|
15
|
-
var
|
|
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:
|
|
20
|
-
}),
|
|
21
|
-
const
|
|
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
|
-
})] }) :
|
|
26
|
-
const e =
|
|
27
|
-
if (!(!i || !e) && (
|
|
28
|
-
if (e.removeAttribute("data-scrollable"),
|
|
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,
|
|
35
|
-
|
|
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
|
-
|
|
45
|
-
]),
|
|
46
|
-
l || (C || (
|
|
47
|
-
},
|
|
48
|
-
!h && !l &&
|
|
49
|
-
},
|
|
50
|
-
!h && !l &&
|
|
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
|
-
|
|
55
|
+
E(() => {
|
|
53
56
|
g();
|
|
54
57
|
}, [
|
|
55
58
|
g,
|
|
56
59
|
S,
|
|
57
60
|
x
|
|
58
|
-
]),
|
|
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]),
|
|
63
|
-
const e =
|
|
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 !==
|
|
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
|
|
74
|
-
|
|
75
|
-
}, [])]), { style:
|
|
76
|
-
...
|
|
77
|
-
...
|
|
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
|
-
...
|
|
82
|
-
} :
|
|
83
|
-
...
|
|
84
|
-
...
|
|
85
|
-
paddingLeft:
|
|
86
|
-
paddingRight:
|
|
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
|
-
} :
|
|
89
|
-
|
|
91
|
+
} : Y;
|
|
92
|
+
E(() => {
|
|
90
93
|
if (!v) return;
|
|
91
|
-
const e =
|
|
92
|
-
|
|
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
|
-
|
|
96
|
-
|
|
98
|
+
I,
|
|
99
|
+
P,
|
|
97
100
|
c
|
|
98
101
|
]);
|
|
99
|
-
const
|
|
100
|
-
...
|
|
101
|
-
style: v ?
|
|
102
|
-
id:
|
|
103
|
-
name:
|
|
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:
|
|
108
|
+
placeholder: gt ? Be : void 0,
|
|
106
109
|
disabled: h,
|
|
107
110
|
readOnly: l,
|
|
108
|
-
required:
|
|
109
|
-
autoComplete:
|
|
110
|
-
autoFocus:
|
|
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
|
|
115
|
-
"aria-describedby": [
|
|
116
|
-
onChange:
|
|
117
|
-
onFocus:
|
|
118
|
-
onBlur:
|
|
119
|
-
onKeyDown: s.onKeyDown ||
|
|
120
|
-
|
|
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
|
-
},
|
|
123
|
-
"data-start-adornment":
|
|
124
|
-
"data-end-adornment":
|
|
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:
|
|
128
|
-
className:
|
|
129
|
-
onClick:
|
|
130
|
-
"data-field-width":
|
|
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
|
-
...
|
|
136
|
+
...wt(q),
|
|
134
137
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
135
138
|
letterSpacing: "0.00938em",
|
|
136
|
-
...
|
|
137
|
-
|
|
139
|
+
...M(We),
|
|
140
|
+
...$e
|
|
138
141
|
},
|
|
139
142
|
children: [
|
|
140
|
-
|
|
141
|
-
className:
|
|
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
|
-
...
|
|
149
|
+
...M(n?.inputLabel?.sx),
|
|
147
150
|
...n?.inputLabel?.style
|
|
148
151
|
},
|
|
149
152
|
children: /* @__PURE__ */ f("label", {
|
|
150
|
-
htmlFor:
|
|
151
|
-
children: [
|
|
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(
|
|
158
|
-
reason: c ?
|
|
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:
|
|
163
|
-
ref:
|
|
164
|
-
onMouseDown:
|
|
165
|
-
...
|
|
166
|
-
style:
|
|
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
|
-
|
|
170
|
-
className:
|
|
171
|
-
children:
|
|
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
|
-
...
|
|
175
|
-
ref:
|
|
177
|
+
...ce,
|
|
178
|
+
ref: de,
|
|
176
179
|
"data-testid": u,
|
|
177
|
-
rows:
|
|
178
|
-
className:
|
|
180
|
+
rows: _ ?? k ?? 2,
|
|
181
|
+
className: ue
|
|
179
182
|
}) : /* @__PURE__ */ t("input", {
|
|
180
|
-
...
|
|
181
|
-
...
|
|
182
|
-
ref:
|
|
183
|
+
...ce,
|
|
184
|
+
...vt,
|
|
185
|
+
ref: de,
|
|
183
186
|
"data-testid": u,
|
|
184
|
-
type:
|
|
185
|
-
className:
|
|
187
|
+
type: Fe,
|
|
188
|
+
className: ue
|
|
186
189
|
}),
|
|
187
|
-
|
|
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 ||
|
|
197
|
+
e.stopPropagation(), e.preventDefault(), C || ie(!1), we?.();
|
|
195
198
|
},
|
|
196
|
-
children: /* @__PURE__ */ t(
|
|
199
|
+
children: /* @__PURE__ */ t(Ht, {
|
|
197
200
|
width: 18,
|
|
198
201
|
height: 18
|
|
199
202
|
})
|
|
200
203
|
}) : b && /* @__PURE__ */ t("span", {
|
|
201
|
-
ref:
|
|
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:
|
|
210
|
+
className: $t
|
|
208
211
|
}) : w ? /* @__PURE__ */ t("fieldset", {
|
|
209
212
|
"aria-hidden": !0,
|
|
210
|
-
className:
|
|
211
|
-
focused:
|
|
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 &&
|
|
219
|
+
}), c && ye),
|
|
217
220
|
children: /* @__PURE__ */ t("legend", {
|
|
218
|
-
className:
|
|
221
|
+
className: Mt(F),
|
|
219
222
|
children: /* @__PURE__ */ f("span", {
|
|
220
223
|
className: "inline-block px-[5px]",
|
|
221
|
-
children: [
|
|
224
|
+
children: [a, N && " *"]
|
|
222
225
|
})
|
|
223
226
|
})
|
|
224
227
|
}) : /* @__PURE__ */ t("div", {
|
|
225
228
|
"aria-hidden": !0,
|
|
226
|
-
className:
|
|
227
|
-
focused:
|
|
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 &&
|
|
235
|
+
}), c && ye)
|
|
233
236
|
})
|
|
234
237
|
]
|
|
235
238
|
}), w && /* @__PURE__ */ f("label", {
|
|
236
|
-
htmlFor:
|
|
237
|
-
className:
|
|
239
|
+
htmlFor: G,
|
|
240
|
+
className: r(Ft({
|
|
238
241
|
shrink: F,
|
|
239
|
-
focused:
|
|
242
|
+
focused: A,
|
|
240
243
|
error: y,
|
|
241
244
|
disabled: h,
|
|
242
245
|
readOnly: l,
|
|
243
|
-
size:
|
|
246
|
+
size: De
|
|
244
247
|
}), n?.inputLabel?.className),
|
|
245
248
|
style: {
|
|
246
|
-
...
|
|
249
|
+
...M(n?.inputLabel?.sx),
|
|
247
250
|
...n?.inputLabel?.style,
|
|
248
|
-
...
|
|
251
|
+
...Bt(F)
|
|
249
252
|
},
|
|
250
|
-
children: [
|
|
253
|
+
children: [a, N && " *"]
|
|
251
254
|
})]
|
|
252
255
|
})
|
|
253
256
|
}),
|
|
254
|
-
|
|
255
|
-
ref:
|
|
256
|
-
id:
|
|
257
|
-
role:
|
|
257
|
+
J && /* @__PURE__ */ t(_t, {
|
|
258
|
+
ref: yt,
|
|
259
|
+
id: ne,
|
|
260
|
+
role: ft,
|
|
258
261
|
error: y,
|
|
259
|
-
message:
|
|
262
|
+
message: Z,
|
|
260
263
|
hideErrorIcon: n?.formHelperText?.hideErrorIcon,
|
|
261
|
-
className:
|
|
264
|
+
className: r("mr-[14px] box-border items-start", n?.formHelperText?.className),
|
|
262
265
|
style: {
|
|
263
|
-
...
|
|
264
|
-
...
|
|
266
|
+
...bt,
|
|
267
|
+
...M(n?.formHelperText?.sx)
|
|
265
268
|
}
|
|
266
269
|
}),
|
|
267
|
-
|
|
268
|
-
id:
|
|
269
|
-
length:
|
|
270
|
+
V && R ? /* @__PURE__ */ t(Nt, {
|
|
271
|
+
id: se,
|
|
272
|
+
length: it,
|
|
270
273
|
limit: R,
|
|
271
|
-
locale:
|
|
274
|
+
locale: Ae,
|
|
272
275
|
className: "pt-1"
|
|
273
276
|
}) : null
|
|
274
277
|
]
|
|
275
278
|
});
|
|
276
279
|
};
|
|
277
280
|
export {
|
|
278
|
-
|
|
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
|
+
};
|
|
@@ -3,24 +3,25 @@ function e(t) {
|
|
|
3
3
|
function i() {
|
|
4
4
|
return window.matchMedia(t).matches;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
return
|
|
9
|
-
|
|
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(
|
|
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)"),
|
|
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
|
-
|
|
21
|
+
p as useFullScreenPickerMediaQuery,
|
|
22
22
|
s as useMaxXsMediaQuery,
|
|
23
23
|
h as useMobileMediaQuery,
|
|
24
24
|
c as usePickerOneRowHeaderMediaQuery,
|
|
25
|
-
x as
|
|
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
|
+
};
|