@paragrav/rhf-utils 0.0.71 → 0.0.73

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.
@@ -0,0 +1,14 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import i from "react";
3
+ import n from "../createRhfUtilsClientForZod.mjs";
4
+ import { _RhfUtilsClientForZodContextProvider as l } from "./useRhfUtilsClientForZodContext.mjs";
5
+ const s = ({
6
+ config: t,
7
+ children: o
8
+ }) => {
9
+ const [r] = i.useState(() => n(t));
10
+ return /* @__PURE__ */ e(l, { value: r, children: o });
11
+ }, a = s;
12
+ export {
13
+ a as default
14
+ };
@@ -1,6 +1,6 @@
1
1
  import t from "../../../utils/createContext.mjs";
2
- const [, o, s] = t(), r = o;
2
+ const [, o, n] = t(), r = o;
3
3
  export {
4
- s as _RhfUtilsContextProvider,
4
+ n as _RhfUtilsClientForZodContextProvider,
5
5
  r as default
6
6
  };
@@ -1,7 +1,7 @@
1
1
  import { zodResolver as t } from "@hookform/resolvers/zod";
2
2
  import "zod";
3
- import { createRhfUtilsClient as e } from "../index.mjs";
4
- const o = e(t), s = o;
3
+ import { createRhfUtilsClient as o } from "../index.mjs";
4
+ const e = o(t), s = e;
5
5
  export {
6
6
  s as default
7
7
  };
@@ -1,6 +1,6 @@
1
- import { default as e } from "./client/zod/context/index.mjs";
2
- import { default as s } from "./client/zod/context/provider.mjs";
3
- import { default as u } from "./client/zod/createZodRhfUtilsClient.mjs";
1
+ import { default as e } from "./client/zod/context/RhfUtilsClientForZodContextProvider .mjs";
2
+ import { default as s } from "./client/zod/context/useRhfUtilsClientForZodContext.mjs";
3
+ import { default as u } from "./client/zod/createRhfUtilsClientForZod.mjs";
4
4
  import { default as m } from "./devtool/LazyDevTool.mjs";
5
5
  import { default as d } from "./errors/flat/context/FlatFieldErrorsContextProvider.mjs";
6
6
  import { default as x } from "./errors/flat/context/useFlatFieldErrorsContext.mjs";
@@ -48,8 +48,8 @@ export {
48
48
  ir as FormSubmitError,
49
49
  w as FormUtilsContextProvider,
50
50
  m as LazyDevTool,
51
- s as RhfUtilsZodContextProvider,
52
- u as createZodRhfUtilsClient,
51
+ e as RhfUtilsClientForZodContextProvider,
52
+ u as createRhfUtilsClientForZod,
53
53
  xr as getSubmitterButtonData,
54
54
  x as useFlatFieldErrorsContext,
55
55
  z as useForm,
@@ -74,7 +74,7 @@ export {
74
74
  I as useOrphanFormErrorsToConsole,
75
75
  yr as useResetFormAfterSubmitSuccessful,
76
76
  Sr as useResetFormOnSubmitError,
77
- e as useRhfUtilsZodContext,
77
+ s as useRhfUtilsClientForZodContext,
78
78
  g as useRootFormFieldErrorsMemo,
79
79
  Or as useSubmitFormOnChange
80
80
  };
@@ -0,0 +1,8 @@
1
+ import { ClientConfig } from '../../config';
2
+ import { default as React } from 'react';
3
+
4
+ type Props = React.PropsWithChildren<{
5
+ config: ClientConfig;
6
+ }>;
7
+ declare const RhfUtilsClientForZodContextProvider: React.FC<Props>;
8
+ export default RhfUtilsClientForZodContextProvider;
@@ -0,0 +1,6 @@
1
+ import { default as createRhfUtilsClientForZod } from '../createRhfUtilsClientForZod';
2
+
3
+ export type RhfUtilsClientForZodContext = ReturnType<typeof createRhfUtilsClientForZod>;
4
+ declare const useRhfUtilsClientForZodContext: () => import('../..').CreateRhfUtilsClient<import('../createRhfUtilsClientForZod').ZodTypeFieldValues, "_input", "_output">, _RhfUtilsClientForZodContextProvider: import('react').Provider<import('../..').CreateRhfUtilsClient<import('../createRhfUtilsClientForZod').ZodTypeFieldValues, "_input", "_output"> | undefined>;
5
+ export default useRhfUtilsClientForZodContext;
6
+ export { _RhfUtilsClientForZodContextProvider };
@@ -0,0 +1,6 @@
1
+ import { SafeFieldValues } from '../../form/SafeFieldValues';
2
+ import { z } from 'zod';
3
+
4
+ export type ZodTypeFieldValues = z.ZodType<SafeFieldValues>;
5
+ declare const createRhfUtilsClientForZod: (config: import('../config').ClientConfig) => import('..').CreateRhfUtilsClient<ZodTypeFieldValues, "_input", "_output">;
6
+ export default createRhfUtilsClientForZod;
@@ -1,7 +1,7 @@
1
1
  export type { ClientConfig } from './client/config';
2
- export { default as useRhfUtilsZodContext } from './client/zod/context';
3
- export { default as RhfUtilsZodContextProvider } from './client/zod/context/provider';
4
- export { default as createZodRhfUtilsClient } from './client/zod/createZodRhfUtilsClient';
2
+ export { default as RhfUtilsClientForZodContextProvider } from './client/zod/context/RhfUtilsClientForZodContextProvider ';
3
+ export { default as useRhfUtilsClientForZodContext } from './client/zod/context/useRhfUtilsClientForZodContext';
4
+ export { default as createRhfUtilsClientForZod } from './client/zod/createRhfUtilsClientForZod';
5
5
  export { default as LazyDevTool } from './devtool/LazyDevTool';
6
6
  export { default as FlatFieldErrorsContextProvider } from './errors/flat/context/FlatFieldErrorsContextProvider';
7
7
  export { default as useFlatFieldErrorsContext } from './errors/flat/context/useFlatFieldErrorsContext';
@@ -2,7 +2,10 @@ import { default as useResetFormAfterSubmitSuccessful } from '../submit/useReset
2
2
  import { DevtoolUIProps } from '@hookform/devtools/dist/devToolUI';
3
3
 
4
4
  export type UseFormOptions = {
5
- /** Control visibility of certain items via your own classes and styles. (Defaults merged with individual class names.) */
5
+ /**
6
+ * Control visibility of certain items via your own classes and styles.
7
+ * (Defaults merged with individual class names.)
8
+ */
6
9
  classNames?: string[];
7
10
  /** Request submit via listener on form change. */
8
11
  submitOnChange?: boolean;
@@ -17,5 +20,5 @@ export type UseFormOptions = {
17
20
  /** Reset form after successful submit. */
18
21
  resetFormAfterSubmitSuccessful?: Parameters<typeof useResetFormAfterSubmitSuccessful>[0];
19
22
  /** Control dev tool options. */
20
- devTool?: DevtoolUIProps | 'disabled';
23
+ devTool?: Pick<DevtoolUIProps, 'placement' | 'styles'> | 'disabled';
21
24
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@paragrav/rhf-utils",
3
3
  "author": "paragrav.dev",
4
4
  "license": "MIT",
5
- "version": "0.0.71",
5
+ "version": "0.0.73",
6
6
  "description": "Integration utilities for react-hook-form.",
7
7
  "type": "module",
8
8
  "sideEffects": false,
@@ -21,19 +21,35 @@
21
21
  "default": "./dist/esm/exports.mjs",
22
22
  "types": "./dist/types/exports.d.ts"
23
23
  },
24
- "./client/zod/createZodRhfUtilsClient": {
25
- "default": "./dist/esm/client/zod/createZodRhfUtilsClient.mjs",
26
- "types": "./dist/types/client/zod/createZodRhfUtilsClient.d.ts"
27
- },
28
- "./client/zod/useRhfUtilsZodContext": {
29
- "default": "./dist/esm/client/zod/useRhfUtilsZodContext.mjs",
30
- "types": "./dist/types/client/zod/useRhfUtilsZodContext.d.ts"
31
- },
32
- "./client/zod/RhfUtilsZodContextProvider": {
33
- "default": "./dist/esm/client/zod/RhfUtilsZodContextProvider.mjs",
34
- "types": "./dist/types/client/zod/RhfUtilsZodContextProvider.d.ts"
35
- },
36
- "./LazyDevTool": {
24
+ "./client": {
25
+ "zod": {
26
+ "createRhfUtilsClientForZod": {
27
+ "default": "./dist/esm/client/zod/createRhfUtilsClientForZod.mjs",
28
+ "types": "./dist/types/client/zod/createRhfUtilsClientForZod.d.ts"
29
+ },
30
+ "useRhfUtilsClientForZodContext": {
31
+ "default": "./dist/esm/client/zod/useRhfUtilsClientForZodContext.mjs",
32
+ "types": "./dist/types/client/zod/useRhfUtilsClientForZodContext.d.ts"
33
+ },
34
+ "RhfUtilsClientForZodContextProvider": {
35
+ "default": "./dist/esm/client/zod/RhfUtilsClientForZodContextProvider.mjs",
36
+ "types": "./dist/types/client/zod/RhfUtilsClientForZodContextProvider.d.ts"
37
+ }
38
+ }
39
+ },
40
+ "./client/zod/createRhfUtilsClientForZod": {
41
+ "default": "./dist/esm/client/zod/createRhfUtilsClientForZod.mjs",
42
+ "types": "./dist/types/client/zod/createRhfUtilsClientForZod.d.ts"
43
+ },
44
+ "./client/zod/useRhfUtilsClientForZodContext": {
45
+ "default": "./dist/esm/client/zod/useRhfUtilsClientForZodContext.mjs",
46
+ "types": "./dist/types/client/zod/useRhfUtilsClientForZodContext.d.ts"
47
+ },
48
+ "./client/zod/RhfUtilsClientForZodContextProvider": {
49
+ "default": "./dist/esm/client/zod/RhfUtilsClientForZodContextProvider.mjs",
50
+ "types": "./dist/types/client/zod/RhfUtilsClientForZodContextProvider.d.ts"
51
+ },
52
+ "./devtool/LazyDevTool": {
37
53
  "default": "./dist/esm/devtool/LazyDevTool.mjs",
38
54
  "types": "./dist/types/devtool/LazyDevTool.d.ts"
39
55
  },
@@ -101,6 +117,10 @@
101
117
  "default": "./dist/esm/errors/root/useRootFormFieldErrors.mjs",
102
118
  "types": "./dist/types/errors/root/useRootFormFieldErrors.d.ts"
103
119
  },
120
+ "./errors/RootErrorsListFromFlatFieldErrorsContext": {
121
+ "default": "./dist/esm/errors/root/RootErrorsListFromFlatFieldErrorsContext.mjs",
122
+ "types": "./dist/types/errors/root/RootErrorsListFromFlatFieldErrorsContext.d.ts"
123
+ },
104
124
  "./form/useForm": {
105
125
  "default": "./dist/esm/form/useForm.mjs",
106
126
  "types": "./dist/types/form/useForm.d.ts"
@@ -178,30 +198,16 @@
178
198
  "types": "./dist/types/submit/useSubmitFormOnChange.d.ts"
179
199
  }
180
200
  },
181
- "scripts": {
182
- "build": "vite build",
183
- "build:dev": "vite build --config vite.config.dev.ts",
184
- "dev": "vite --config vite.config.dev.ts",
185
- "lint": "eslint --ignore-path ./.gitignore --ext ts,tsx --report-unused-disable-directives --max-warnings 0 .",
186
- "preinstall": "npx only-allow pnpm",
187
- "prepare": "husky",
188
- "prepublishOnly": "pnpm build",
189
- "preview": "vite preview --config vite.config.dev.ts",
190
- "test": "vitest",
191
- "test:ct": "playwright test -c playwright-ct.config.ts",
192
- "test:ct:ui": "playwright test -c playwright-ct.config.ts --ui",
193
- "tsc": "tsc",
194
- "validate": "cross-env CI=1 pnpm install && pnpm tsc & pnpm lint & pnpm test && pnpm test:ct"
195
- },
196
201
  "peerDependencies": {
197
202
  "@hookform/devtools": "^4",
203
+ "@hookform/resolvers": "^3",
198
204
  "flat": "^6",
199
- "query-string": "^9",
200
205
  "react": "^18",
201
- "react-hook-form": "^7"
206
+ "react-dom": "^18",
207
+ "react-hook-form": "^7",
208
+ "zod": "^3"
202
209
  },
203
210
  "devDependencies": {
204
- "@hookform/resolvers": "^3.3.4",
205
211
  "@playwright/experimental-ct-react": "^1.43.1",
206
212
  "@playwright/test": "^1.43.1",
207
213
  "@rollup/plugin-typescript": "^11.1.6",
@@ -223,20 +229,17 @@
223
229
  "husky": "^9.0.11",
224
230
  "lint-staged": "^15.2.2",
225
231
  "prettier": "^3.2.5",
226
- "react-dom": "^18.2.0",
227
232
  "rollup": "^4.13.0",
228
233
  "typescript": "^5.4.3",
229
234
  "vite": "^5.2.5",
230
235
  "vite-plugin-dts": "^3.8.1",
231
236
  "vite-tsconfig-paths": "^4.3.2",
232
- "vitest": "^1.4.0",
233
- "zod": "^3.22.4"
237
+ "vitest": "^1.4.0"
234
238
  },
235
239
  "engines": {
236
240
  "node": ">=20.12",
237
241
  "pnpm": ">=9.0.6"
238
242
  },
239
- "packageManager": "pnpm@9.0.6",
240
243
  "repository": {
241
244
  "type": "git",
242
245
  "url": "git+https://github.com/paragrav/rhf-utils.git"
@@ -254,5 +257,18 @@
254
257
  "utilities",
255
258
  "utils",
256
259
  "zod"
257
- ]
258
- }
260
+ ],
261
+ "scripts": {
262
+ "build": "vite build",
263
+ "build:dev": "vite build --config vite.config.dev.ts",
264
+ "dev": "vite --config vite.config.dev.ts",
265
+ "lint": "eslint --ignore-path ./.gitignore --ext ts,tsx --report-unused-disable-directives --max-warnings 0 .",
266
+ "preinstall": "npx only-allow pnpm",
267
+ "preview": "vite preview --config vite.config.dev.ts",
268
+ "test": "vitest",
269
+ "test:ct": "playwright test -c playwright-ct.config.ts",
270
+ "test:ct:ui": "playwright test -c playwright-ct.config.ts --ui",
271
+ "tsc": "tsc",
272
+ "validate": "cross-env CI=1 pnpm install && pnpm tsc & pnpm lint & pnpm test && pnpm test:ct"
273
+ }
274
+ }
@@ -1,11 +0,0 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import i from "react";
3
- import s from "../createZodRhfUtilsClient.mjs";
4
- import { _RhfUtilsContextProvider as f } from "./index.mjs";
5
- const n = ({ config: t, children: o }) => {
6
- const [r] = i.useState(() => s(t));
7
- return /* @__PURE__ */ e(f, { value: r, children: o });
8
- }, c = n;
9
- export {
10
- c as default
11
- };