Files
NapCatQQ/.pnpm-store/v3/files/d5/7df65ecaf9e600a0380408112f7485d3da652593e5d04d9d40cbe2e4dc019a5471046c0447588a9ec20a96513cfbefb9248255c9f5258d20ae6c806047c65a
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-YMDFNRVV.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
};