@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
55 lines (53 loc) • 1.25 kB
JavaScript
/**
* VERSION: 2.230.0-alpha.0
* BUILD_TIMESTAMP: 1778694684677
* BUILD_DATE: Wed May 13 2026 17:51:24 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 7af1c105d5485ac4ed1190c56d492bb4590667a9
*/
import { bh as F, d as s, j as n } from "../sheerid.js";
import { I as C } from "./InputText-CCNbZmMe.js";
import { F as h } from "./FormFieldLayout-DEVPpEyA.js";
const l = (t, r = void 0) => (F(t) || []).length >= 2 && !r, v = ({
fieldId: t,
value: r,
onChange: a,
placeholder: m,
label: d,
errorMessage: o,
showPlaceholderAndHideLabel: e = !1,
required: i = !0,
explanation: u = "",
...p
}) => {
const x = `sid-${s(t)}-error`;
return /* @__PURE__ */ n.jsx(
h,
{
fieldId: t,
label: d,
errorMessage: o,
showPlaceholderAndHideLabel: e,
isRequired: i,
explanation: u,
children: /* @__PURE__ */ n.jsx(
C,
{
id: s(t),
value: r,
onChange: (c) => a(c.target.value),
placeholder: e ? m : "",
hidePlaceholder: !e,
refId: t,
isErrored: !!o,
required: i,
"aria-describedby": o ? x : void 0,
...p
}
)
}
);
};
export {
v as F,
l as i
};