@fluidattacks/design 3.10.2-pr → 3.10.2-pr-02
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { FieldValues, useFormContext, useWatch } from 'react-hook-form';
|
|
3
3
|
import { InnerForm } from './inner-form';
|
|
4
|
-
import { IFormProps } from './types';
|
|
4
|
+
import { IFormProps, TFormMethods } from './types';
|
|
5
5
|
declare const Form: <T extends FieldValues = FieldValues>({ alert, cancelLabel, children, id, mode, onCancel, onSubmit, showButtons, submitLabel, submitDisabled, yupSchema, ...props }: Readonly<PropsWithChildren<IFormProps<T>>>) => JSX.Element;
|
|
6
|
+
export type { TFormMethods };
|
|
6
7
|
export { InnerForm, Form, useFormContext, useWatch };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FieldValues
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { TFormMethods } from '../types';
|
|
3
|
+
export declare const InnerForm: <T extends FieldValues = FieldValues>({ children, }: {
|
|
4
|
+
children: (methods: Readonly<TFormMethods<T>>) => JSX.Element;
|
|
5
|
+
}) => JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FieldValues, SubmitHandler, UseFormProps } from 'react-hook-form';
|
|
1
|
+
import { FieldValues, SubmitHandler, UseFormProps, UseFormReturn } from 'react-hook-form';
|
|
2
|
+
type TFormMethods<T extends FieldValues> = UseFormReturn<T, unknown, undefined>;
|
|
2
3
|
/**
|
|
3
4
|
* Form component props.
|
|
4
5
|
* @interface IFormProps
|
|
@@ -23,4 +24,4 @@ interface IFormProps<T extends FieldValues> extends UseFormProps<T, unknown> {
|
|
|
23
24
|
submitDisabled?: boolean;
|
|
24
25
|
yupSchema?: unknown;
|
|
25
26
|
}
|
|
26
|
-
export type { IFormProps };
|
|
27
|
+
export type { IFormProps, TFormMethods };
|
|
@@ -7569,7 +7569,9 @@ ${h[8]}...` : (h.length < 8 && c(!1), t);
|
|
|
7569
7569
|
t && /* @__PURE__ */ n(wt, { buttonProps: t, variant: "primary" })
|
|
7570
7570
|
] }) : void 0
|
|
7571
7571
|
] });
|
|
7572
|
-
}, Zl = ({
|
|
7572
|
+
}, Zl = ({
|
|
7573
|
+
children: e
|
|
7574
|
+
}) => {
|
|
7573
7575
|
const t = ti();
|
|
7574
7576
|
return e(t);
|
|
7575
7577
|
}, _r = b.form`
|
package/package.json
CHANGED