@behivetech/forms.form-field 0.3.2 → 0.3.4
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.
- package/README.md +2 -12
- package/docs.json +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Dumb wrapper that provides label + hint/error + required-marker layout around any form control (`Checkbox`, `Input`, `Textarea`, `Select`, `Toggle`, ...) — the same job AntD's `Form.Item` does. The control itself owns none of this chrome; it just needs an `id` matching `htmlFor`.
|
|
4
4
|
|
|
5
|
+
Docs: https://bht-galaxy.vercel.app/behivetech/forms/form-field
|
|
6
|
+
|
|
5
7
|
## Usage
|
|
6
8
|
|
|
7
9
|
```jsx
|
|
@@ -24,15 +26,3 @@ import { Checkbox } from '@behivetech/atoms.checkbox';
|
|
|
24
26
|
`hint` is hidden whenever `error` is present. If `label`, `hint`, and `error` are all omitted, `FormField` renders as a plain wrapper around `children`.
|
|
25
27
|
|
|
26
28
|
**Known limitation**: `FormField` doesn't automatically wire `aria-describedby` from the control to the hint/error text — pass it yourself if you need that linkage today.
|
|
27
|
-
|
|
28
|
-
## Props
|
|
29
|
-
|
|
30
|
-
| Prop | Type | Default | Description |
|
|
31
|
-
| ----------- | ----------- | ------- | ----------------------------------------------------------------------------- |
|
|
32
|
-
| `label` | `ReactNode` | — | Field label |
|
|
33
|
-
| `htmlFor` | `string` | — | Associates the label with the control — pass the same id you give the control |
|
|
34
|
-
| `hint` | `ReactNode` | — | Supporting hint text; hidden while `error` is present |
|
|
35
|
-
| `error` | `ReactNode` | — | Error message; also visually marks the field as invalid |
|
|
36
|
-
| `required` | `boolean` | `false` | Shows a required marker next to the label |
|
|
37
|
-
| `children` | `ReactNode` | — | The form control this field wraps (required) |
|
|
38
|
-
| `className` | `string` | — | Additional class names |
|
package/docs.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@behivetech/forms.form-field",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"description": "Dumb wrapper that provides label + hint/error + required-marker layout around any form control (`Checkbox`, `Input`, `Textarea`, `Select`, `Toggle`, ...) — the same job AntD's `Form.Item` does. The control itself owns none of this chrome; it just needs an `id` matching `htmlFor`.",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"private": false,
|
|
7
8
|
"exports": {
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
"url": "https://github.com/behivetech/bht-galaxy.git",
|
|
45
46
|
"directory": "registry/behivetech/forms/form-field"
|
|
46
47
|
},
|
|
48
|
+
"homepage": "https://bht-galaxy.vercel.app/behivetech/forms/form-field",
|
|
47
49
|
"publishConfig": {
|
|
48
50
|
"registry": "https://registry.npmjs.org",
|
|
49
51
|
"access": "public",
|