react-luna-form 0.0.88 → 0.0.89
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 +1 -1
- package/dist/client/cjs/index.js +1 -1
- package/dist/client/esm/index.js +1 -1
- package/dist/config/cjs/index.js +1 -1
- package/dist/config/esm/index.js +1 -1
- package/dist/schema/cjs/index.js +1 -1
- package/dist/schema/esm/index.js +1 -1
- package/dist/server/cjs/index.js +1 -1
- package/dist/server/esm/index.js +1 -1
- package/dist/types/luna-core/util/build.d.ts +20 -1
- package/dist/types/luna-core/util/date.d.ts +15 -0
- package/dist/types/luna-core/util/list.d.ts +3 -1
- package/dist/types/luna-core/util/schema.d.ts +2 -2
- package/docs/fields/input.md +22 -3
- package/docs/fields/list.md +1 -0
- package/docs/setup.md +5 -1
- package/package.json +3 -3
package/docs/fields/list.md
CHANGED
|
@@ -25,6 +25,7 @@ The `advanced` property customizes structural interaction rules and layout rende
|
|
|
25
25
|
A custom label has to be translated by the form; the built-in `Add item` default is already translated by the library — see [Localization](#localization).
|
|
26
26
|
- **`length`** _({ min?: number, max?: number })_: Configures restrictions on how many items can be generated. Enforces boundary conditions where minimum instances ensure permanent default items and maximum instances automatically disable insertion toggles. The matching error messages are declared under the list's `validation.length` — see the [Validation reference](../validation/overview.md#list-length).
|
|
27
27
|
Both bounds apply to the rows a list opens with, not only to the ones added by hand: an initial `value` shorter than `min` leaves the remainder standing and empty, and one longer than `max` stops at `max`. A [`value` event](../events/change.md#targeting-a-list) assigning rows is clamped the same way.
|
|
28
|
+
Each bound is a number, or a `$ref` the host resolves to one. A bound that is not, such as a `$ref` the context does not hold, is a rule the form cannot read: the list is held back with `This list cannot be checked`, an empty one included, since a list has no `required` of its own and `length.min` is how it asks for rows. Meanwhile it shows its rows as if that bound were not declared, a `min` of one or no `max` at all, and a development build names the bound in the console, as it does [for a field](input.md#a-bound-that-is-no-number).
|
|
28
29
|
- **`collapsed`** _(boolean)_: When enabled, list items default to a visually collapsed representation upon mounting or adding.
|
|
29
30
|
Collapsing only hides a row: its fields keep their values, still validate and are still submitted, and a submit that fails on one of them opens the row so the error can be seen.
|
|
30
31
|
- **`keepValue`** _(boolean)_: If `true`, hiding the list leaves the values behind instead of taking them. A list holds nothing under its own name, so declaring it here is a statement about the rows: it covers every value they hold. See [Keeping a value through a hide](../events/change.md#keeping-a-value-through-a-hide).
|
package/docs/setup.md
CHANGED
|
@@ -16,7 +16,7 @@ dependency, so your application resolves one copy of React, Zod and the rest.
|
|
|
16
16
|
| Peer | Version | Used for |
|
|
17
17
|
| -------------------- | --------- | ------------------------------------------- |
|
|
18
18
|
| `react`, `react-dom` | `^19.0.0` | rendering, and `useActionState` on submit |
|
|
19
|
-
| `zod` | `^4.0.
|
|
19
|
+
| `zod` | `^4.0.6` | the schema derived from `sections` |
|
|
20
20
|
| `jotai` | `^2.0.0` | the value, error and source stores |
|
|
21
21
|
| `swr` | `^2.0.0` | fetching a field's remote `source` |
|
|
22
22
|
| `date-fns` | `^4.0.0` | date and time formatting, `duration` filter |
|
|
@@ -29,6 +29,10 @@ them in for you; anywhere else, install them alongside the library. A missing
|
|
|
29
29
|
peer surfaces as a module resolution error at import time, not as a form that
|
|
30
30
|
renders badly.
|
|
31
31
|
|
|
32
|
+
Zod has to be 4.0.6 or later. An earlier 4.0 reports a value that an optional
|
|
33
|
+
text or email field holds back as `Invalid input`, instead of with the field's
|
|
34
|
+
own message.
|
|
35
|
+
|
|
32
36
|
## Styling
|
|
33
37
|
|
|
34
38
|
The components render Tailwind utility classes and **the build ships no CSS**.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-luna-form",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.89",
|
|
4
4
|
"description": "A React library for building forms based on JSON",
|
|
5
5
|
"main": "./dist/client/cjs/index.js",
|
|
6
6
|
"module": "./dist/client/esm/index.js",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"react-dom": "^19.0.0",
|
|
27
27
|
"swr": "^2.0.0",
|
|
28
28
|
"tailwind-merge": "^3.7.0",
|
|
29
|
-
"zod": "^4.0.
|
|
29
|
+
"zod": "^4.0.6"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@luna-form/core": "0.0.
|
|
32
|
+
"@luna-form/core": "0.0.89",
|
|
33
33
|
"@types/react": "19.3.0",
|
|
34
34
|
"@types/react-dom": "19.3.0",
|
|
35
35
|
"eslint-plugin-react": "7.37.5",
|