@cdx-ui/utils 0.0.1-beta.20 → 0.0.1-beta.22

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 (2) hide show
  1. package/README.md +6 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -21,7 +21,7 @@ pnpm add @cdx-ui/utils
21
21
  | `useControllableState(params)` | Hook that supports both controlled and uncontrolled modes for a single value. Warns in dev if the mode switches during a component's lifetime. |
22
22
  | `mergeRefs(...refs)` | Combines multiple refs (callback or object) into one ref callback. |
23
23
  | `flattenChildren(children)` | Recursively flattens React `children` into a flat array (used internally for spaced-child layouts). |
24
- | `ariaAttr(condition)` | Returns `'true'` or `undefined` — shorthand for boolean ARIA attribute values. |
24
+ | `ariaAttr(condition)` | Returns `true` (boolean) or `undefined` — shorthand for boolean ARIA attribute values. |
25
25
 
26
26
  ### Context
27
27
 
@@ -38,23 +38,16 @@ Used internally by `@cdx-ui/components` to propagate variant props (size, color,
38
38
  | `withStyleContext(Component, scope?)` | HOC that adds a `context` prop and provides it to descendants via `ParentContext`. |
39
39
  | `useStyleContext(scope?)` | Reads the style context set by the nearest `withStyleContext` wrapper. |
40
40
  | `useParentContext()` | Reads the full `StyleContextMap` from the nearest provider. |
41
- | `ParentContext` | The raw React context (rarely needed directly). |
42
41
 
43
42
  ### Form control
44
43
 
45
44
  Low-level form-field state used by the `Field` and `Input` primitives.
46
45
 
47
- | Export | Description |
48
- | --------------------------- | --------------------------------------------------------------------------------------------------------- |
49
- | `useFormControlRoot(props)` | Creates the root state object for a form field (id generation, `aria-describedby` wiring). |
50
- | `useFormControl(props)` | Merges component-level props with inherited form-control context. |
51
- | `useFormControlContext()` | Reads form-control state from the nearest provider. |
52
- | `FormControlContext` | The raw React context for form-control state. |
53
- | `FormControlContextValue` | Type: full context shape including field state, `id`, `labelId`, `feedbackId`, `helpTextId`, and setters. |
54
- | `FormControlState` | Type: `{ isRequired, isInvalid, isDisabled, isReadOnly }`. |
55
- | `FormControlRootProps` | Type: input props for `useFormControlRoot`. |
56
- | `FormControlRootReturn` | Type: return value of `useFormControlRoot` (`htmlProps` + context fields). |
57
- | `FormControlFieldProps` | Type: props accepted by `useFormControl` (field state flags + `id`). |
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. |
58
51
 
59
52
  ## Further reading
60
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdx-ui/utils",
3
- "version": "0.0.1-beta.20",
3
+ "version": "0.0.1-beta.22",
4
4
  "main": "lib/commonjs/index.js",
5
5
  "module": "lib/module/index.js",
6
6
  "react-native": "src/index.ts",