@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
71 lines (69 loc) • 1.77 kB
JavaScript
/**
* WARNING: This file is intended to be used within MySheerID.
* This file is not intended for use in other contexts and there are no guarantees about its behavior outside of MySheerID.
*/
/**
* VERSION: 2.230.0-alpha.0
* BUILD_TIMESTAMP: 1778694697559
* BUILD_DATE: Wed May 13 2026 17:51:37 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 7af1c105d5485ac4ed1190c56d492bb4590667a9
*/
import { d as s, j as d } from "../_mysheerid-preview.js";
import { F as y } from "./FormFieldLayout-DDEEmlGC.js";
import { I as L, S as $ } from "./FormSelectChoice-C-rIlDKl.js";
const H = ({
fieldId: t = void 0,
value: e,
onChange: i,
placeholder: m,
label: n,
errorMessage: o,
showPlaceholderAndHideLabel: u = !1,
isRequired: r = !0,
isLoading: p = !1,
disabled: c = !1,
explanation: f = "",
autoFocus: F,
options: a,
containerId: I = void 0,
onKeyDown: b,
refId: v = "status",
suppressPlaceholder: x = !0
}) => {
const l = `sid-${s(t)}`, j = `sid-${s(t)}-error`;
return /* @__PURE__ */ d.jsx(
y,
{
fieldId: t,
label: n,
errorMessage: o,
showPlaceholderAndHideLabel: u,
isRequired: r,
explanation: f,
containerId: I,
children: /* @__PURE__ */ d.jsx(
L,
{
autoFocus: F,
fieldId: v,
inputId: l,
fieldLabelId: `${l}-label`,
suppressPlaceholder: x,
isErrored: !!o,
options: $(a),
onChange: i,
value: a.find((S) => S.value === (e && e.value)),
placeholder: m,
isRequired: r,
isLoading: p,
disabled: c,
ariaDescribedBy: o ? j : void 0,
onKeyDown: b
}
)
}
);
};
export {
H as F
};