Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
23 lines
1005 B
Plaintext
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
|
|
};
|