mirror of
https://github.com/vercel-labs/json-render.git
synced 2026-10-30 07:54:05 +08:00
* add dynamic forms support: computed values, watchers, cross-field validation - `$computed` and `$template` prop expressions for derived values and string interpolation - Element-level `watch` field for cascading state dependencies - Cross-field validators (`lessThan`, `greaterThan`, `equalTo`, `requiredIf`) with deep arg resolution - `validateForm` built-in action for form-level validation * fixes * fixes * fixes * fixes * fixes * fixes * fixes * tests * fixes * update turbo * tests * fixes * fixes * fixes
26 lines
679 B
TypeScript
26 lines
679 B
TypeScript
import { defineCatalog } from "@json-render/core";
|
|
import { schema } from "@json-render/react/schema";
|
|
import { shadcnComponentDefinitions } from "@json-render/shadcn/catalog";
|
|
import { z } from "zod";
|
|
|
|
export const catalog = defineCatalog(schema, {
|
|
components: {
|
|
...shadcnComponentDefinitions,
|
|
},
|
|
actions: {
|
|
confetti: {
|
|
params: z.object({}),
|
|
description: "Fire confetti",
|
|
},
|
|
},
|
|
functions: {
|
|
formatAddress: {
|
|
description:
|
|
"Formats country and city into a single address string like 'City, Country'",
|
|
},
|
|
citiesForCountry: {
|
|
description: "Returns an array of city names for the given country code",
|
|
},
|
|
},
|
|
});
|