@behivetech/forms.form-provider 0.1.5 → 0.1.6

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.
Files changed (3) hide show
  1. package/README.md +2 -0
  2. package/docs.json +57 -0
  3. package/package.json +7 -5
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  The single place `react-hook-form` is imported directly in this repo. Everything else should import form state/control from here instead of `react-hook-form` — that keeps the underlying library swappable from one spot later.
4
4
 
5
+ Docs: https://bht-galaxy.vercel.app/behivetech/forms/form-provider
6
+
5
7
  Re-exports: `FormProvider` (thin wrapper around RHF's own `FormProvider`), `Form` (convenience `<form>` wired to `handleSubmit`, with `FormProvider` already applied), `useForm`, `useFormContext`, `useController`, `useFormState`, `useWatch`, `Controller`, plus the common RHF types (`UseFormReturn`, `FieldValues`, `SubmitHandler`, `Control`, `FieldErrors`, ...).
6
8
 
7
9
  ## Usage
package/docs.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "https://github.com/behivetech/bht-component-registry/docs.schema.json",
3
+ "version": 2,
4
+ "generatedAt": "2026-10-23T19:01:30.268Z",
5
+ "docs": [
6
+ {
7
+ "displayName": "Form",
8
+ "description": "Convenience wrapper for the common case: a `<form>` whose submit is wired\nto react-hook-form's `handleSubmit`, with `FormProvider` already applied\nso descendants can use `useFormContext()`. For editing UIs with no submit\nmoment (live/instant field-by-field updates), use the bare atoms +\n`FormField` instead — this component assumes a real submit action exists.",
9
+ "extendsNative": true,
10
+ "props": [
11
+ {
12
+ "name": "children",
13
+ "type": "ReactNode",
14
+ "required": true,
15
+ "defaultValue": null,
16
+ "description": "Form content, typically FormField-wrapped controls"
17
+ },
18
+ {
19
+ "name": "methods",
20
+ "type": "UseFormReturn<TFieldValues>",
21
+ "required": true,
22
+ "defaultValue": null,
23
+ "description": "The return value of `useForm()`"
24
+ },
25
+ {
26
+ "name": "onSubmit",
27
+ "type": "SubmitHandler<TFieldValues>",
28
+ "required": true,
29
+ "defaultValue": null,
30
+ "description": "Called with the validated values when the form is submitted"
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ "displayName": "FormProvider",
36
+ "description": "Thin wrapper around react-hook-form's `FormProvider`. Import this (and\n`useForm`, `Controller`, etc.) from this package instead of importing\n`react-hook-form` directly anywhere else — this is the one place that\nknows about the underlying form library, so it can be swapped later\nwithout touching every consumer.",
37
+ "extendsNative": false,
38
+ "props": [
39
+ {
40
+ "name": "children",
41
+ "type": "ReactNode",
42
+ "required": true,
43
+ "defaultValue": null,
44
+ "description": "Descendants that will consume the form context via `useFormContext()`"
45
+ },
46
+ {
47
+ "name": "methods",
48
+ "type": "UseFormReturn<TFieldValues>",
49
+ "required": true,
50
+ "defaultValue": null,
51
+ "description": "The return value of `useForm()` (re-exported from this package)"
52
+ }
53
+ ]
54
+ }
55
+ ],
56
+ "functions": []
57
+ }
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@behivetech/forms.form-provider",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "license": "MIT",
5
+ "description": "The single place `react-hook-form` is imported directly in this repo. Everything else should import form state/control from here instead of `react-hook-form` — that keeps the underlying library swappable from one spot later.",
5
6
  "type": "module",
6
7
  "private": false,
7
8
  "exports": {
@@ -39,16 +40,17 @@
39
40
  "tsup": "^8.5.1",
40
41
  "typescript": "^6.0.3",
41
42
  "vitest": "^4.1.10",
42
- "@behivetech/atoms.button": "0.4.3",
43
- "@behivetech/atoms.text-field": "0.3.3",
44
- "@behivetech/forms.form-field": "0.3.3",
45
- "@bht-component-registry/env": "0.1.0"
43
+ "@behivetech/atoms.text-field": "0.3.4",
44
+ "@behivetech/forms.form-field": "0.3.4",
45
+ "@bht-component-registry/env": "0.1.0",
46
+ "@behivetech/atoms.button": "0.4.4"
46
47
  },
47
48
  "repository": {
48
49
  "type": "git",
49
50
  "url": "https://github.com/behivetech/bht-galaxy.git",
50
51
  "directory": "registry/behivetech/forms/form-provider"
51
52
  },
53
+ "homepage": "https://bht-galaxy.vercel.app/behivetech/forms/form-provider",
52
54
  "publishConfig": {
53
55
  "registry": "https://registry.npmjs.org",
54
56
  "access": "public",