@cdx-ui/utils 0.0.1-beta.28 → 0.0.1-beta.29
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 +9 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,14 +41,15 @@ Used internally by `@cdx-ui/components` to propagate variant props (size, color,
|
|
|
41
41
|
|
|
42
42
|
### Form control
|
|
43
43
|
|
|
44
|
-
Low-level form-field state used by the `Field
|
|
45
|
-
|
|
46
|
-
| Export
|
|
47
|
-
|
|
|
48
|
-
| `useFormControlRoot(props)`
|
|
49
|
-
| `useFormControl(props)`
|
|
50
|
-
| `useFormControlContext()`
|
|
51
|
-
| `useReportFormControlLabelFocus(
|
|
44
|
+
Low-level form-field state used by the `Field` and `Input` primitives.
|
|
45
|
+
|
|
46
|
+
| Export | Description |
|
|
47
|
+
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
48
|
+
| `useFormControlRoot(props)` | Creates the root state object for a form field (id generation, `aria-describedby` wiring). |
|
|
49
|
+
| `useFormControl(props)` | Merges component-level props with inherited form-control context. |
|
|
50
|
+
| `useFormControlContext()` | Reads form-control state from the nearest provider. |
|
|
51
|
+
| `useReportFormControlLabelFocus(ref)` | Reports label focus/blur events to the parent `FormControlContext` — used by `Field.Label` to trigger `isFocused` styling on the associated input. |
|
|
52
|
+
| `FormControlContext` | The React context object for form-control state propagation. |
|
|
52
53
|
|
|
53
54
|
## Further reading
|
|
54
55
|
|