@vritti/quantum-ui 0.1.19 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Form.d.ts +1 -2
- package/dist/Form.js +1 -22
- package/dist/Form.js.map +1 -1
- package/dist/OnboardingProvider.js +1 -1
- package/dist/axios.js +4041 -0
- package/dist/axios.js.map +1 -0
- package/dist/index.d.ts +39 -2
- package/dist/index.js +1 -1
- package/dist/utils/axios.js +1 -3944
- package/dist/utils/axios.js.map +1 -1
- package/package.json +1 -1
package/dist/Form.d.ts
CHANGED
|
@@ -232,7 +232,7 @@ declare const fieldVariants = cva(
|
|
|
232
232
|
}
|
|
233
233
|
);
|
|
234
234
|
|
|
235
|
-
export declare function Form<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = TFieldValues>({ form, onSubmit, children, showRootError, rootErrorPosition, rootErrorClassName,
|
|
235
|
+
export declare function Form<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = TFieldValues>({ form, onSubmit, children, showRootError, rootErrorPosition, rootErrorClassName, ...props }: FormProps<TFieldValues, TContext, TTransformedValues>): JSX.Element;
|
|
236
236
|
|
|
237
237
|
export declare namespace Form {
|
|
238
238
|
var displayName: string;
|
|
@@ -245,7 +245,6 @@ export declare interface FormProps<TFieldValues extends FieldValues = FieldValue
|
|
|
245
245
|
showRootError?: boolean;
|
|
246
246
|
rootErrorPosition?: 'top' | 'bottom';
|
|
247
247
|
rootErrorClassName?: string;
|
|
248
|
-
csrfEndpoint?: string;
|
|
249
248
|
}
|
|
250
249
|
|
|
251
250
|
declare function Label({ className, ...props }: React_2.ComponentProps<typeof LabelPrimitive.Root>) {
|
package/dist/Form.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { C as Checkbox } from './Checkbox.js';
|
|
4
3
|
import { c as FieldError } from './field.js';
|
|
5
4
|
import { c as cn } from './utils.js';
|
|
6
|
-
import {
|
|
5
|
+
import { C as Checkbox } from './Checkbox.js';
|
|
7
6
|
|
|
8
7
|
var isCheckBoxInput = (element) => element.type === 'checkbox';
|
|
9
8
|
|
|
@@ -656,29 +655,9 @@ function Form({
|
|
|
656
655
|
showRootError = true,
|
|
657
656
|
rootErrorPosition = "bottom",
|
|
658
657
|
rootErrorClassName,
|
|
659
|
-
csrfEndpoint,
|
|
660
658
|
...props
|
|
661
659
|
}) {
|
|
662
660
|
const handleSubmit = form.handleSubmit(onSubmit);
|
|
663
|
-
React__default.useEffect(() => {
|
|
664
|
-
if (csrfEndpoint) {
|
|
665
|
-
axios.get(csrfEndpoint).then((response) => {
|
|
666
|
-
const token = response.data?.csrfToken;
|
|
667
|
-
if (token) {
|
|
668
|
-
setCsrfToken(token);
|
|
669
|
-
} else {
|
|
670
|
-
console.warn("[Form] CSRF endpoint did not return a csrfToken field");
|
|
671
|
-
}
|
|
672
|
-
}).catch((error) => {
|
|
673
|
-
console.error("[Form] Failed to fetch CSRF token:", error);
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
return () => {
|
|
677
|
-
if (csrfEndpoint) {
|
|
678
|
-
clearCsrfToken();
|
|
679
|
-
}
|
|
680
|
-
};
|
|
681
|
-
}, [csrfEndpoint]);
|
|
682
661
|
const processedChildren = processChildren(children, form.control);
|
|
683
662
|
return /* @__PURE__ */ jsx(FormProvider, { ...form, children: /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, ...props, children: [
|
|
684
663
|
showRootError && rootErrorPosition === "top" && form.formState.errors.root && /* @__PURE__ */ jsx(
|