UNPKG

geoiq-frontend-ui-kit

Version:

This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.

45 lines (44 loc) 1.06 kB
import * as t from "react"; import { InputOTP as u, InputOTPGroup as f, InputOTPSlot as y } from "./index.es122.js"; import { Typography as i } from "./index.es17.js"; const g = ({ length: a = 6, className: r, containerClassName: p, onChange: l, value: c = "", disabled: e = !1, isError: n = !1, message: o }) => /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement( u, { maxLength: a, value: c, className: e ? "outline-0 bg-transparent cursor-not-allowed outline-none opacity-50" : r, containerClassName: p, disabled: e, isError: n, onChange: l }, Array.from({ length: a }).map((I, m) => /* @__PURE__ */ t.createElement(f, { key: m }, /* @__PURE__ */ t.createElement( y, { index: m, isError: n, disabled: e, className: r } ))) ), o && /* @__PURE__ */ t.createElement( i, { variant: "body4", className: `${n ? "text-danger-1" : "text-light-4"} mt-1` }, o )); export { g as OtpInput }; //# sourceMappingURL=index.es60.js.map