view-contracts 0.5.2 → 0.5.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 CHANGED
@@ -92,6 +92,25 @@ Color, spacing, typography, and component variants are defined in project YAML
92
92
 
93
93
  See [docs/design-tokens-and-theme.md](./docs/design-tokens-and-theme.md).
94
94
 
95
+ ### Forms
96
+
97
+ Form inputs (`TextInput`, `TextArea`, `Select`) accept `value` and `onChange`:
98
+
99
+ ```tsx
100
+ <TextArea
101
+ name="notes"
102
+ value={vm.notes}
103
+ onChange={{ name: "fieldChange", params: { field: "notes" } }}
104
+ rows={3}
105
+ />
106
+
107
+ <TextInput name="subject" value={vm.subject} />
108
+ ```
109
+
110
+ - `value` + `onChange` → controlled input. The action handler receives a `value` param with the new input value automatically.
111
+ - `value` only → read-only / uncontrolled initial value.
112
+ - Neither → empty input (backward-compatible).
113
+
95
114
  ### Compile instead of hand-coding
96
115
 
97
116
  ```txt
package/cli-contract.yaml CHANGED
@@ -3,7 +3,7 @@ cli_contracts: 0.1.0
3
3
 
4
4
  info:
5
5
  title: view-contracts CLI
6
- version: 0.5.2
6
+ version: 0.5.3
7
7
  description: >-
8
8
  Contract-first UI design toolchain. Compiles restricted view-contract TSX
9
9
  to language-neutral View IR and renders platform targets (React, SwiftUI, Compose).