asma-ui-core 3.124.0 → 3.126.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +6 -5
- package/dist/components/data-display/read-only-text/StyledReadOnlyText.js +56 -0
- package/dist/components/icons/index.js +1 -0
- package/dist/components/icons/location-filled-icon/LocationFilledIcon.js +17 -0
- package/dist/components/icons/location-filled-icon/index.js +1 -0
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.module.js +12 -12
- package/dist/components/inputs/field-styles.js +1 -1
- package/dist/components/inputs/input-field/StyledInputField.js +226 -205
- package/dist/components/miscellaneous/StyledFormControlLabel.js +14 -14
- package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +81 -73
- package/dist/datetime/components/date-picker/components/DatePickerInputRangeCompact.js +28 -26
- package/dist/datetime/components/date-picker/components/DatePickerInputSingle.js +23 -21
- package/dist/datetime/components/time-picker/StyledTimePicker.js +25 -25
- package/dist/datetime/components/time-picker/TimePickerInput.js +41 -40
- package/dist/index.js +449 -445
- package/dist/src/components/data-display/read-only-text/StyledReadOnlyText.d.ts +38 -0
- package/dist/src/components/data-display/read-only-text/index.d.ts +1 -0
- package/dist/src/components/icons/index.d.ts +1 -0
- package/dist/src/components/icons/location-filled-icon/LocationFilledIcon.d.ts +12 -0
- package/dist/src/components/icons/location-filled-icon/index.d.ts +1 -0
- package/dist/src/components/inputs/field-styles.d.ts +3 -1
- package/dist/src/components/inputs/input-field/StyledInputField.d.ts +14 -1
- package/dist/src/datetime/components/date-picker/components/BaseDatePickerInput.d.ts +2 -0
- package/dist/src/datetime/components/date-picker/types.d.ts +7 -0
- package/dist/src/datetime/components/time-picker/types.d.ts +2 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/table/shared-components/StyledCheckbox.module.js +11 -11
- package/package.json +1 -1
|
@@ -1,258 +1,279 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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";
|
|
11
|
+
import L from "./StyledInputField.module.js";
|
|
12
|
+
import { Children as Et, useCallback as pe, useId as Ot, useLayoutEffect as M, useRef as Y, 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, {
|
|
16
|
+
title: u,
|
|
17
|
+
openOnTap: !0,
|
|
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: J, 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: Q = "full", fullWidth: Wt, className: Oe, style: Te, sx: De, inputRef: ke, slotProps: n, InputProps: X, onKeyDown: Z, onClick: We, variant: $t }) => {
|
|
21
|
+
const $e = Ot(), W = Fe ?? $e, q = `${W}-helper-text`, $ = Y(null), z = Y(0), ee = Y(null), [ze, Ue] = E(void 0), [H, te] = E(!1), [je, ne] = 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, oe = C ? x !== "" && x != null : je, Ge = !!h || !!l, U = n?.input?.startAdornment ?? X?.startAdornment, I = Et.count(U) > 0, m = I && Array.isArray(U), j = n?.input?.endAdornment ?? X?.endAdornment, b = c ? /* @__PURE__ */ f(Tt, { children: [j, /* @__PURE__ */ t(St, {
|
|
22
|
+
width: 24,
|
|
23
|
+
height: 24,
|
|
24
|
+
className: "text-delta-700"
|
|
25
|
+
})] }) : j, N = !!(Ae && oe && !Ge), { ref: Ve, ...s } = n?.htmlInput ?? {}, Ye = ke ?? Ve, { className: Je, style: P, ref: Qe } = n?.input ?? {}, Xe = me([Qe]), Ze = n?.input?.onMouseDown, le = n?.input?.onClick, qe = le ? { onClick: le } : {}, et = Be ?? s.autoComplete, tt = we ?? s.name, K = s.id ?? W, R = Se ?? s.maxLength, ie = `${W}-counter`, ae = Ie !== !1 && !!R && !o, nt = C ? String(x ?? "").length : Pe, w = fe === "floating" && !!r && !o, F = H || oe || 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 = "";
|
|
18
29
|
else {
|
|
19
30
|
if (e.style.height = "auto", e.scrollHeight === 0) {
|
|
20
31
|
e.style.height = "";
|
|
21
32
|
return;
|
|
22
33
|
}
|
|
23
|
-
const
|
|
24
|
-
e.style.height = `${Math.min(
|
|
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`;
|
|
25
36
|
}
|
|
26
37
|
e.scrollHeight > e.clientHeight + 1 && e.setAttribute("data-scrollable", "true");
|
|
27
38
|
}
|
|
28
39
|
}, [
|
|
29
40
|
k,
|
|
30
|
-
|
|
41
|
+
D,
|
|
31
42
|
i,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
]),
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
!
|
|
38
|
-
},
|
|
39
|
-
!
|
|
43
|
+
l,
|
|
44
|
+
A
|
|
45
|
+
]), ot = (e) => {
|
|
46
|
+
l || (C || (ne(e.target.value !== ""), Ke(e.target.value.length), g()), xe?.(e));
|
|
47
|
+
}, lt = (e) => {
|
|
48
|
+
!h && !l && te(!0), be?.(e);
|
|
49
|
+
}, it = (e) => {
|
|
50
|
+
!h && !l && te(!1), ye?.(e);
|
|
40
51
|
};
|
|
41
|
-
|
|
42
|
-
|
|
52
|
+
M(() => {
|
|
53
|
+
g();
|
|
43
54
|
}, [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
]),
|
|
55
|
+
g,
|
|
56
|
+
S,
|
|
57
|
+
x
|
|
58
|
+
]), M(() => {
|
|
48
59
|
if (!i || !document.fonts) return;
|
|
49
|
-
const e = () =>
|
|
60
|
+
const e = () => g();
|
|
50
61
|
return document.fonts.addEventListener("loadingdone", e), () => document.fonts.removeEventListener("loadingdone", e);
|
|
51
|
-
}, [i,
|
|
52
|
-
const e =
|
|
62
|
+
}, [i, g]), M(() => {
|
|
63
|
+
const e = $.current;
|
|
53
64
|
if (!i || !e || typeof ResizeObserver > "u") return;
|
|
54
|
-
let
|
|
55
|
-
const
|
|
56
|
-
e.offsetWidth !==
|
|
65
|
+
let d = 0;
|
|
66
|
+
const p = new ResizeObserver(() => {
|
|
67
|
+
e.offsetWidth !== z.current && (cancelAnimationFrame(d), d = requestAnimationFrame(g));
|
|
57
68
|
});
|
|
58
|
-
return
|
|
59
|
-
cancelAnimationFrame(
|
|
69
|
+
return p.observe(e), () => {
|
|
70
|
+
cancelAnimationFrame(d), p.disconnect();
|
|
60
71
|
};
|
|
61
|
-
}, [i,
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
}, [])]), { style:
|
|
65
|
-
...
|
|
66
|
-
...
|
|
67
|
-
} :
|
|
72
|
+
}, [i, g]);
|
|
73
|
+
const re = me([Ye, pe((e) => {
|
|
74
|
+
$.current = e instanceof HTMLTextAreaElement ? e : null;
|
|
75
|
+
}, [])]), { style: G, ...at } = s, v = !i && !m && !o, { height: zt, minHeight: Ut, maxHeight: jt, paddingTop: Pt, paddingBottom: Kt, ...rt } = P ?? {}, st = v ? {
|
|
76
|
+
...rt,
|
|
77
|
+
...Mt()
|
|
78
|
+
} : m ? {
|
|
68
79
|
boxSizing: "border-box",
|
|
69
80
|
minHeight: 40,
|
|
70
|
-
|
|
71
|
-
} :
|
|
72
|
-
...
|
|
73
|
-
...
|
|
74
|
-
paddingLeft:
|
|
75
|
-
paddingRight:
|
|
81
|
+
...P
|
|
82
|
+
} : P, { height: Gt, minHeight: Vt, maxHeight: Yt, paddingTop: Jt, paddingBottom: Qt, paddingLeft: Xt, paddingRight: dt, ...ct } = G ?? {}, ut = v ? {
|
|
83
|
+
...ct,
|
|
84
|
+
...Bt({
|
|
85
|
+
paddingLeft: I ? 40 : 14,
|
|
86
|
+
paddingRight: dt ?? ze ?? (N || b ? 40 : 14)
|
|
76
87
|
})
|
|
77
|
-
} :
|
|
78
|
-
|
|
79
|
-
if (!
|
|
80
|
-
const e =
|
|
81
|
-
|
|
88
|
+
} : G;
|
|
89
|
+
M(() => {
|
|
90
|
+
if (!v) return;
|
|
91
|
+
const e = ee.current, d = e ? Math.ceil(e.getBoundingClientRect().width) + 20 : void 0;
|
|
92
|
+
Ue((p) => p === d ? p : d);
|
|
82
93
|
}, [
|
|
83
|
-
f,
|
|
84
94
|
v,
|
|
85
|
-
|
|
95
|
+
N,
|
|
96
|
+
j,
|
|
97
|
+
c
|
|
86
98
|
]);
|
|
87
|
-
const
|
|
88
|
-
...
|
|
89
|
-
style:
|
|
90
|
-
id:
|
|
91
|
-
name:
|
|
92
|
-
maxLength:
|
|
93
|
-
placeholder:
|
|
94
|
-
disabled:
|
|
95
|
-
readOnly:
|
|
96
|
-
required:
|
|
97
|
-
autoComplete:
|
|
98
|
-
autoFocus:
|
|
99
|
-
value:
|
|
100
|
-
defaultValue:
|
|
101
|
-
"aria-invalid":
|
|
102
|
-
"aria-label":
|
|
103
|
-
"aria-describedby": [
|
|
104
|
-
onChange:
|
|
105
|
-
onFocus:
|
|
106
|
-
onBlur:
|
|
107
|
-
onKeyDown:
|
|
108
|
-
|
|
99
|
+
const ht = F || !w, { show: V, role: pt } = At("StyledInputField", y, J, ve, l), { fieldRef: mt, rowRef: gt, rowStyle: ft } = _t(Le && V), se = {
|
|
100
|
+
...at,
|
|
101
|
+
style: v ? ut : G,
|
|
102
|
+
id: K,
|
|
103
|
+
name: tt,
|
|
104
|
+
maxLength: R,
|
|
105
|
+
placeholder: ht ? Re : void 0,
|
|
106
|
+
disabled: h,
|
|
107
|
+
readOnly: l,
|
|
108
|
+
required: _,
|
|
109
|
+
autoComplete: et,
|
|
110
|
+
autoFocus: Me,
|
|
111
|
+
value: x,
|
|
112
|
+
defaultValue: S,
|
|
113
|
+
"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": [V ? q : s["aria-describedby"], ae ? ie : void 0].filter(Boolean).join(" ") || void 0,
|
|
116
|
+
onChange: ot,
|
|
117
|
+
onFocus: lt,
|
|
118
|
+
onBlur: it,
|
|
119
|
+
onKeyDown: s.onKeyDown || Z ? (e) => {
|
|
120
|
+
Z?.(e), e.defaultPrevented || s.onKeyDown?.(e);
|
|
109
121
|
} : void 0
|
|
110
|
-
},
|
|
111
|
-
"data-start-adornment":
|
|
112
|
-
"data-end-adornment":
|
|
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
|
|
113
125
|
} : {};
|
|
114
|
-
return /* @__PURE__ */
|
|
115
|
-
ref:
|
|
116
|
-
className:
|
|
117
|
-
onClick:
|
|
118
|
-
"data-field-width":
|
|
126
|
+
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": Q,
|
|
119
131
|
style: {
|
|
120
132
|
display: "flex",
|
|
121
|
-
...
|
|
133
|
+
...Ct(Q),
|
|
122
134
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
123
135
|
letterSpacing: "0.00938em",
|
|
124
|
-
...
|
|
125
|
-
...
|
|
136
|
+
...B(De),
|
|
137
|
+
...Te
|
|
126
138
|
},
|
|
127
139
|
children: [
|
|
128
|
-
r && !
|
|
129
|
-
className:
|
|
140
|
+
r && !w && /* @__PURE__ */ t("div", {
|
|
141
|
+
className: a(Ht({
|
|
142
|
+
disabled: h,
|
|
143
|
+
flush: o
|
|
144
|
+
}), n?.inputLabel?.className),
|
|
130
145
|
style: {
|
|
131
|
-
...
|
|
132
|
-
...
|
|
146
|
+
...B(n?.inputLabel?.sx),
|
|
147
|
+
...n?.inputLabel?.style
|
|
133
148
|
},
|
|
134
|
-
children: /* @__PURE__ */
|
|
135
|
-
htmlFor:
|
|
136
|
-
children: [r,
|
|
149
|
+
children: /* @__PURE__ */ f("label", {
|
|
150
|
+
htmlFor: K,
|
|
151
|
+
children: [r, _ && /* @__PURE__ */ t("span", {
|
|
137
152
|
"aria-hidden": "true",
|
|
138
153
|
children: " *"
|
|
139
154
|
})]
|
|
140
155
|
})
|
|
141
156
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
144
|
-
children:
|
|
145
|
-
className:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
type: "button",
|
|
172
|
-
tabIndex: -1,
|
|
173
|
-
"aria-label": "Clear",
|
|
174
|
-
"data-testid": `${y}-clear`,
|
|
175
|
-
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",
|
|
176
|
-
onClick: (e) => {
|
|
177
|
-
e.stopPropagation(), e.preventDefault(), C || Z(!1), Le?.();
|
|
178
|
-
},
|
|
179
|
-
children: /* @__PURE__ */ o(mt, {
|
|
180
|
-
width: 18,
|
|
181
|
-
height: 18
|
|
182
|
-
})
|
|
183
|
-
}) : h && /* @__PURE__ */ o("span", {
|
|
184
|
-
ref: V,
|
|
185
|
-
className: "absolute inset-y-0 right-[14px] flex max-w-[calc(100%-28px)] items-center gap-1",
|
|
186
|
-
children: h
|
|
187
|
-
}),
|
|
188
|
-
R ? /* @__PURE__ */ o("fieldset", {
|
|
189
|
-
"aria-hidden": !0,
|
|
190
|
-
className: se({
|
|
191
|
-
focused: A,
|
|
192
|
-
error: g,
|
|
193
|
-
disabled: d,
|
|
194
|
-
readOnly: n,
|
|
195
|
-
notched: !0
|
|
157
|
+
/* @__PURE__ */ t(kt, {
|
|
158
|
+
reason: c ? O : o ? T : void 0,
|
|
159
|
+
children: /* @__PURE__ */ f("div", {
|
|
160
|
+
className: "relative overflow-visible",
|
|
161
|
+
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,
|
|
167
|
+
"data-testid": m ? `${u}-adornment-list` : `${u}-shell`,
|
|
168
|
+
children: [
|
|
169
|
+
I && /* @__PURE__ */ t("span", {
|
|
170
|
+
className: a("items-center text-delta-500", m ? "contents" : "absolute left-3 flex"),
|
|
171
|
+
children: U
|
|
172
|
+
}),
|
|
173
|
+
i ? /* @__PURE__ */ t("textarea", {
|
|
174
|
+
...se,
|
|
175
|
+
ref: re,
|
|
176
|
+
"data-testid": u,
|
|
177
|
+
rows: A ?? D ?? 2,
|
|
178
|
+
className: de
|
|
179
|
+
}) : /* @__PURE__ */ t("input", {
|
|
180
|
+
...se,
|
|
181
|
+
...xt,
|
|
182
|
+
ref: re,
|
|
183
|
+
"data-testid": u,
|
|
184
|
+
type: Ce,
|
|
185
|
+
className: de
|
|
196
186
|
}),
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
187
|
+
N ? /* @__PURE__ */ t("button", {
|
|
188
|
+
type: "button",
|
|
189
|
+
tabIndex: -1,
|
|
190
|
+
"aria-label": "Clear",
|
|
191
|
+
"data-testid": `${u}-clear`,
|
|
192
|
+
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
|
+
onClick: (e) => {
|
|
194
|
+
e.stopPropagation(), e.preventDefault(), C || ne(!1), He?.();
|
|
195
|
+
},
|
|
196
|
+
children: /* @__PURE__ */ t(Lt, {
|
|
197
|
+
width: 18,
|
|
198
|
+
height: 18
|
|
202
199
|
})
|
|
200
|
+
}) : b && /* @__PURE__ */ t("span", {
|
|
201
|
+
ref: ee,
|
|
202
|
+
className: "absolute inset-y-0 right-[14px] flex max-w-[calc(100%-28px)] items-center gap-1",
|
|
203
|
+
children: b
|
|
204
|
+
}),
|
|
205
|
+
o ? /* @__PURE__ */ t("div", {
|
|
206
|
+
"aria-hidden": !0,
|
|
207
|
+
className: Dt
|
|
208
|
+
}) : w ? /* @__PURE__ */ t("fieldset", {
|
|
209
|
+
"aria-hidden": !0,
|
|
210
|
+
className: a(he({
|
|
211
|
+
focused: H,
|
|
212
|
+
error: y,
|
|
213
|
+
disabled: h,
|
|
214
|
+
readOnly: l,
|
|
215
|
+
notched: !0
|
|
216
|
+
}), c && ge),
|
|
217
|
+
children: /* @__PURE__ */ t("legend", {
|
|
218
|
+
className: Ft(F),
|
|
219
|
+
children: /* @__PURE__ */ f("span", {
|
|
220
|
+
className: "inline-block px-[5px]",
|
|
221
|
+
children: [r, _ && " *"]
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
}) : /* @__PURE__ */ t("div", {
|
|
225
|
+
"aria-hidden": !0,
|
|
226
|
+
className: a(he({
|
|
227
|
+
focused: H,
|
|
228
|
+
error: y,
|
|
229
|
+
disabled: h,
|
|
230
|
+
readOnly: l,
|
|
231
|
+
notched: !1
|
|
232
|
+
}), c && ge)
|
|
203
233
|
})
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
size: Ne
|
|
224
|
-
}), t?.inputLabel?.className),
|
|
225
|
-
style: {
|
|
226
|
-
...F(t?.inputLabel?.sx),
|
|
227
|
-
...t?.inputLabel?.style,
|
|
228
|
-
...St(w)
|
|
229
|
-
},
|
|
230
|
-
children: [r, H && " *"]
|
|
231
|
-
})]
|
|
234
|
+
]
|
|
235
|
+
}), w && /* @__PURE__ */ f("label", {
|
|
236
|
+
htmlFor: K,
|
|
237
|
+
className: a(Rt({
|
|
238
|
+
shrink: F,
|
|
239
|
+
focused: H,
|
|
240
|
+
error: y,
|
|
241
|
+
disabled: h,
|
|
242
|
+
readOnly: l,
|
|
243
|
+
size: Ee
|
|
244
|
+
}), n?.inputLabel?.className),
|
|
245
|
+
style: {
|
|
246
|
+
...B(n?.inputLabel?.sx),
|
|
247
|
+
...n?.inputLabel?.style,
|
|
248
|
+
...wt(F)
|
|
249
|
+
},
|
|
250
|
+
children: [r, _ && " *"]
|
|
251
|
+
})]
|
|
252
|
+
})
|
|
232
253
|
}),
|
|
233
|
-
|
|
234
|
-
ref:
|
|
235
|
-
id:
|
|
236
|
-
role:
|
|
237
|
-
error:
|
|
238
|
-
message:
|
|
239
|
-
hideErrorIcon:
|
|
240
|
-
className:
|
|
254
|
+
V && /* @__PURE__ */ t(Nt, {
|
|
255
|
+
ref: gt,
|
|
256
|
+
id: q,
|
|
257
|
+
role: pt,
|
|
258
|
+
error: y,
|
|
259
|
+
message: J,
|
|
260
|
+
hideErrorIcon: n?.formHelperText?.hideErrorIcon,
|
|
261
|
+
className: a("mr-[14px] box-border items-start", n?.formHelperText?.className),
|
|
241
262
|
style: {
|
|
242
|
-
...
|
|
243
|
-
...
|
|
263
|
+
...ft,
|
|
264
|
+
...B(n?.formHelperText?.sx)
|
|
244
265
|
}
|
|
245
266
|
}),
|
|
246
|
-
|
|
247
|
-
id:
|
|
248
|
-
length:
|
|
249
|
-
limit:
|
|
250
|
-
locale:
|
|
267
|
+
ae && R ? /* @__PURE__ */ t(It, {
|
|
268
|
+
id: ie,
|
|
269
|
+
length: nt,
|
|
270
|
+
limit: R,
|
|
271
|
+
locale: Ne,
|
|
251
272
|
className: "pt-1"
|
|
252
273
|
}) : null
|
|
253
274
|
]
|
|
254
275
|
});
|
|
255
276
|
};
|
|
256
277
|
export {
|
|
257
|
-
|
|
278
|
+
mn as StyledInputField
|
|
258
279
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as r } from "../../helpers/cn.js";
|
|
2
2
|
import { resolveSx as g } from "../../helpers/sx.js";
|
|
3
|
-
import { cloneElement as
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
3
|
+
import { cloneElement as w, isValidElement as n, useId as C } from "react";
|
|
4
|
+
import { jsx as L, jsxs as A } from "react/jsx-runtime";
|
|
5
|
+
var E = {
|
|
6
6
|
end: "flex-row",
|
|
7
7
|
start: "flex-row-reverse",
|
|
8
8
|
top: "flex-col-reverse",
|
|
9
9
|
bottom: "flex-col"
|
|
10
|
-
},
|
|
11
|
-
const e =
|
|
10
|
+
}, O = ({ control: l, label: a, checked: i, disabled: d, name: m, value: c, labelPlacement: x = "end", className: f, sx: p, onChange: h }) => {
|
|
11
|
+
const e = n(l) ? l.props : {}, s = d ?? e.disabled ?? !1, u = !!e.readOnly, t = C(), b = e["aria-label"] != null || e["aria-labelledby"] != null, v = typeof a == "string" ? a.trim().length > 0 : a != null, o = n(l) && v && !b, y = n(l) ? w(l, {
|
|
12
12
|
checked: e.checked ?? i,
|
|
13
13
|
onChange: e.onChange ?? h,
|
|
14
14
|
disabled: s,
|
|
15
|
-
name: e.name ??
|
|
15
|
+
name: e.name ?? m,
|
|
16
16
|
value: e.value ?? c,
|
|
17
|
-
...
|
|
17
|
+
...o ? { "aria-labelledby": t } : {}
|
|
18
18
|
}) : l;
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
className:
|
|
19
|
+
return /* @__PURE__ */ A("label", {
|
|
20
|
+
className: r("m-0 inline-flex items-center gap-2 align-middle text-delta-800", s || u ? "cursor-default" : "cursor-pointer", E[x], f),
|
|
21
21
|
style: {
|
|
22
22
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
23
23
|
...g(p)
|
|
24
24
|
},
|
|
25
|
-
children: [
|
|
26
|
-
id:
|
|
27
|
-
className:
|
|
25
|
+
children: [y, a != null && /* @__PURE__ */ L("span", {
|
|
26
|
+
id: o ? t : void 0,
|
|
27
|
+
className: r("text-sm leading-5 tracking-[0.00938em]", "max-xs:min-w-0 max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]", s && "text-delta-300"),
|
|
28
28
|
children: a
|
|
29
29
|
})]
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
O as StyledFormControlLabel
|
|
34
34
|
};
|