@fluidattacks/design 3.10.2-pr → 3.10.2-pr-01

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,4 @@
1
- import { FieldValues, UseFormReturn } from 'react-hook-form';
1
+ import { TFormMethods } from '../types';
2
2
  export declare const InnerForm: React.FC<{
3
- children: (methods: Readonly<UseFormReturn<FieldValues, unknown, undefined>>) => JSX.Element;
3
+ children: (methods: Readonly<TFormMethods>) => JSX.Element;
4
4
  }>;
@@ -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 = UseFormReturn<FieldValues, 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 };
package/package.json CHANGED
@@ -112,5 +112,5 @@
112
112
  "test-storybook": "test-storybook"
113
113
  },
114
114
  "typings": "./dist/index.d.ts",
115
- "version": "3.10.2-pr"
115
+ "version": "3.10.2-pr-01"
116
116
  }