Files
NapCatQQ/.pnpm-store/v3/files/f7/89f6e0cf28096634cec5ee3f6bac8f2fafe35450865bdb9b4c56721fa19ce683201b07f06f62704343f7ef5ce1921aa8b75e3d54879d90ca823ff80163d846
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

23 lines
1005 B
Plaintext

"use client";
import {
useContextProps
} from "./chunk-BSTJ7ZCN.mjs";
// src/base-form.tsx
import { FormValidationContext } from "@react-stately/form";
import { createContext, forwardRef, useMemo } from "react";
import { form } from "@heroui/theme";
import { jsx } from "react/jsx-runtime";
var FormContext = createContext(null);
var Form = forwardRef(function Form2(props, ref) {
[props, ref] = useContextProps(props, ref, FormContext);
let { validationErrors, validationBehavior = "native", children, className, ...domProps } = props;
const styles = useMemo(() => form({ className }), [className]);
return /* @__PURE__ */ jsx("form", { noValidate: validationBehavior !== "native", ...domProps, ref, className: styles, children: /* @__PURE__ */ jsx(FormContext.Provider, { value: { ...props, validationBehavior }, children: /* @__PURE__ */ jsx(FormValidationContext.Provider, { value: validationErrors != null ? validationErrors : {}, children }) }) });
});
export {
FormContext,
Form
};