@rilaykit/forms 0.1.3 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +8 -5
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -42,10 +42,11 @@ const rilay = ril.create()
42
42
  ### 2. Build a Form
43
43
 
44
44
  ```tsx
45
+ import { form } from '@rilaykit/forms';
45
46
  import { required, email } from '@rilaykit/core';
46
47
 
47
- const loginForm = rilay
48
- .form('login')
48
+ const loginForm = form
49
+ .create(rilay, 'login')
49
50
  .add({
50
51
  id: 'email',
51
52
  type: 'input',
@@ -87,8 +88,10 @@ function LoginForm() {
87
88
  Construct forms with a chainable, type-safe API. Each field type and its props are validated at compile time.
88
89
 
89
90
  ```tsx
90
- const contactForm = rilay
91
- .form('contact')
91
+ import { form } from '@rilaykit/forms';
92
+
93
+ const contactForm = form
94
+ .create(rilay, 'contact')
92
95
  .add(
93
96
  { id: 'firstName', type: 'input', props: { label: 'First Name' } },
94
97
  { id: 'lastName', type: 'input', props: { label: 'Last Name' } },
@@ -152,7 +155,7 @@ Combined with `@rilaykit/core`'s condition system, fields show/hide reactively b
152
155
  ```tsx
153
156
  import { when } from '@rilaykit/core';
154
157
 
155
- rilay.form('account')
158
+ form.create(rilay, 'account')
156
159
  .add({
157
160
  id: 'accountType',
158
161
  type: 'select',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rilaykit/forms",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "private": false,
5
5
  "description": "Form building utilities and components for RilayKit",
6
6
  "main": "dist/index.js",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "zustand": "^5.0.5",
40
- "@rilaykit/core": "0.1.3"
40
+ "@rilaykit/core": "0.1.4"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": ">=18.0.0",