@paragrav/rhf-utils 0.0.75 → 0.0.76

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,4 +1,4 @@
1
- import { default as e } from "./client/zod/context/RhfUtilsClientForZodContextProvider .mjs";
1
+ import { default as e } from "./client/zod/context/RhfUtilsClientForZodContextProvider.mjs";
2
2
  import { default as s } from "./client/zod/context/useRhfUtilsClientForZodContext.mjs";
3
3
  import { default as u } from "./client/zod/createRhfUtilsClientForZod.mjs";
4
4
  import { default as m } from "./devtool/LazyDevTool.mjs";
@@ -1,5 +1,5 @@
1
1
  export type { ClientConfig } from './client/config';
2
- export { default as RhfUtilsClientForZodContextProvider } from './client/zod/context/RhfUtilsClientForZodContextProvider ';
2
+ export { default as RhfUtilsClientForZodContextProvider } from './client/zod/context/RhfUtilsClientForZodContextProvider';
3
3
  export { default as useRhfUtilsClientForZodContext } from './client/zod/context/useRhfUtilsClientForZodContext';
4
4
  export { default as createRhfUtilsClientForZod } from './client/zod/createRhfUtilsClientForZod';
5
5
  export { default as LazyDevTool } from './devtool/LazyDevTool';
package/package.json CHANGED
@@ -2,12 +2,13 @@
2
2
  "name": "@paragrav/rhf-utils",
3
3
  "author": "paragrav.dev",
4
4
  "license": "MIT",
5
- "version": "0.0.75",
5
+ "version": "0.0.76",
6
6
  "description": "Integration utilities for react-hook-form.",
7
7
  "type": "module",
8
8
  "sideEffects": false,
9
9
  "files": [
10
- "dist"
10
+ "dist/esm/*",
11
+ "dist/types/*"
11
12
  ],
12
13
  "module": "./dist/esm/exports.mjs",
13
14
  "imports": {
@@ -1,7 +0,0 @@
1
- import { ZodTypeFieldValues } from '../createZodRhfUtilsClient';
2
- import { RhfUtilsClientContext } from '../../context';
3
-
4
- export type RhfUtilsZodClientContext = RhfUtilsClientContext<ZodTypeFieldValues, '_input', '_output'>;
5
- declare const useRhfUtilsZodContext: () => RhfUtilsZodClientContext, _RhfUtilsZodContextProvider: import('react').Provider<RhfUtilsZodClientContext | undefined>;
6
- export default useRhfUtilsZodContext;
7
- export { _RhfUtilsZodContextProvider as _RhfUtilsContextProvider };
@@ -1,12 +0,0 @@
1
- import { ClientConfig } from '../../config';
2
- import { default as React } from 'react';
3
-
4
- type Props = React.PropsWithChildren<{
5
- config: ClientConfig;
6
- }>;
7
- /**
8
- * Provides a flattened version of the form errors.
9
- * Allows flattening and filtering to happen once per errors change.
10
- */
11
- declare const RhfUtilsZodContextProvider: React.FC<Props>;
12
- export default RhfUtilsZodContextProvider;
@@ -1,6 +0,0 @@
1
- import { SafeFieldValues } from '../../form/SafeFieldValues';
2
- import { z } from 'zod';
3
-
4
- export type ZodTypeFieldValues = z.ZodType<SafeFieldValues>;
5
- declare const createZodRhfUtilsClient: (config: import('../config').ClientConfig) => import('..').CreateRhfUtilsClient<ZodTypeFieldValues, "_input", "_output">;
6
- export default createZodRhfUtilsClient;
@@ -1,5 +0,0 @@
1
- import { SafeFieldValues } from '../../form/SafeFieldValues';
2
- import { z } from 'zod';
3
-
4
- export type ZodTypeFieldValues = z.ZodType<SafeFieldValues>;
5
- export declare const createZodRhfUtilsClient: (config: import('../config').ClientConfig) => import('..').CreateRhfUtilsClient<ZodTypeFieldValues, "_input", "_output">;
@@ -1,10 +0,0 @@
1
- import { FlatFieldErrors } from '../flat/types';
2
-
3
- export type FormErrorsFlatContext = {
4
- all: FlatFieldErrors;
5
- roots: FlatFieldErrors;
6
- orphans: FlatFieldErrors;
7
- };
8
- declare const useFormErrorsFlatContextMaybe: () => FormErrorsFlatContext | undefined, useFormErrorsFlatContext: () => FormErrorsFlatContext, _FormErrorsFlatContextProvider: import('react').Provider<FormErrorsFlatContext | undefined>;
9
- export default useFormErrorsFlatContext;
10
- export { _FormErrorsFlatContextProvider, useFormErrorsFlatContextMaybe };
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- type Props = React.PropsWithChildren<{
3
- formRef: React.RefObject<HTMLFormElement>;
4
- outputErrors?: boolean;
5
- }>;
6
- /**
7
- * Provides a flattened version of the form errors.
8
- * Allows flattening and filtering to happen once per errors change.
9
- */
10
- declare const FormErrorsFlatContextProvider: React.FC<Props>;
11
- export default FormErrorsFlatContextProvider;
@@ -1,7 +0,0 @@
1
- import { FieldError } from 'react-hook-form';
2
-
3
- /**
4
- * Determine if {@link FieldError} is a field error (i.e., has `ref`).
5
- */
6
- declare const isFieldError: (error: FieldError) => boolean;
7
- export default isFieldError;
@@ -1,9 +0,0 @@
1
- /**
2
- * Determined if there are orphan errors and no field errors.
3
- * (May be useful when reporting or displaying a specific message to user.)
4
- * RHF doesn't seem to have any other mechanism to indicate a failed submit but to `setErrors()`.
5
- * Therefore, we have no way of distinguishing between "placeholder" root error and actual error.
6
- * (e.g., "Please fix form errors above." vs "Start date must be less than end date.")
7
- */
8
- declare const useFormHasOrphanAndNoFieldErrors: (formRef: React.RefObject<HTMLFormElement>) => boolean;
9
- export default useFormHasOrphanAndNoFieldErrors;
@@ -1,7 +0,0 @@
1
- import { FlatFieldErrors } from '../flat/types';
2
-
3
- type Props = React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement> & {
4
- errors: FlatFieldErrors;
5
- };
6
- declare const FormRootErrors: React.FC<Props>;
7
- export default FormRootErrors;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare const FormRootErrorsFromContext: React.FC;
3
- export default FormRootErrorsFromContext;
@@ -1,7 +0,0 @@
1
- import { FieldErrors } from 'react-hook-form';
2
-
3
- /**
4
- * Create memoized value from form errors.
5
- */
6
- declare const useFormErrorsMemo: <TReturn>(callback: (errors: FieldErrors) => TReturn) => TReturn;
7
- export default useFormErrorsMemo;