diff --git a/apps/www/__registry__/index.ts b/apps/www/__registry__/index.ts index 8689a294..40a63868 100644 --- a/apps/www/__registry__/index.ts +++ b/apps/www/__registry__/index.ts @@ -38,12 +38,54 @@ export const Index = { component: () => import("../src/lib/registry/default/example/AspectRatioDemo.vue").then((m) => m.default), files: ["../src/lib/registry/default/example/AspectRatioDemo.vue"], }, - "AutoForm": { - name: "AutoForm", + "AutoFormArray": { + name: "AutoFormArray", type: "components:example", registryDependencies: ["button","toast","auto-form"], - component: () => import("../src/lib/registry/default/example/AutoForm.vue").then((m) => m.default), - files: ["../src/lib/registry/default/example/AutoForm.vue"], + component: () => import("../src/lib/registry/default/example/AutoFormArray.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/AutoFormArray.vue"], + }, + "AutoFormBasic": { + name: "AutoFormBasic", + type: "components:example", + registryDependencies: ["button","toast","auto-form"], + component: () => import("../src/lib/registry/default/example/AutoFormBasic.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/AutoFormBasic.vue"], + }, + "AutoFormConfirmPassword": { + name: "AutoFormConfirmPassword", + type: "components:example", + registryDependencies: ["button","toast","auto-form"], + component: () => import("../src/lib/registry/default/example/AutoFormConfirmPassword.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/AutoFormConfirmPassword.vue"], + }, + "AutoFormControlled": { + name: "AutoFormControlled", + type: "components:example", + registryDependencies: ["button","toast","auto-form"], + component: () => import("../src/lib/registry/default/example/AutoFormControlled.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/AutoFormControlled.vue"], + }, + "AutoFormDependencies": { + name: "AutoFormDependencies", + type: "components:example", + registryDependencies: ["button","toast","auto-form"], + component: () => import("../src/lib/registry/default/example/AutoFormDependencies.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/AutoFormDependencies.vue"], + }, + "AutoFormInputWithoutLabel": { + name: "AutoFormInputWithoutLabel", + type: "components:example", + registryDependencies: ["button","toast","auto-form"], + component: () => import("../src/lib/registry/default/example/AutoFormInputWithoutLabel.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/AutoFormInputWithoutLabel.vue"], + }, + "AutoFormSubObject": { + name: "AutoFormSubObject", + type: "components:example", + registryDependencies: ["button","toast","auto-form"], + component: () => import("../src/lib/registry/default/example/AutoFormSubObject.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/AutoFormSubObject.vue"], }, "AvatarDemo": { name: "AvatarDemo", @@ -1285,12 +1327,54 @@ export const Index = { component: () => import("../src/lib/registry/new-york/example/AspectRatioDemo.vue").then((m) => m.default), files: ["../src/lib/registry/new-york/example/AspectRatioDemo.vue"], }, - "AutoForm": { - name: "AutoForm", + "AutoFormArray": { + name: "AutoFormArray", type: "components:example", registryDependencies: ["button","toast","auto-form"], - component: () => import("../src/lib/registry/new-york/example/AutoForm.vue").then((m) => m.default), - files: ["../src/lib/registry/new-york/example/AutoForm.vue"], + component: () => import("../src/lib/registry/new-york/example/AutoFormArray.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/AutoFormArray.vue"], + }, + "AutoFormBasic": { + name: "AutoFormBasic", + type: "components:example", + registryDependencies: ["button","toast","auto-form"], + component: () => import("../src/lib/registry/new-york/example/AutoFormBasic.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/AutoFormBasic.vue"], + }, + "AutoFormConfirmPassword": { + name: "AutoFormConfirmPassword", + type: "components:example", + registryDependencies: ["button","toast","auto-form"], + component: () => import("../src/lib/registry/new-york/example/AutoFormConfirmPassword.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/AutoFormConfirmPassword.vue"], + }, + "AutoFormControlled": { + name: "AutoFormControlled", + type: "components:example", + registryDependencies: ["button","toast","auto-form"], + component: () => import("../src/lib/registry/new-york/example/AutoFormControlled.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/AutoFormControlled.vue"], + }, + "AutoFormDependencies": { + name: "AutoFormDependencies", + type: "components:example", + registryDependencies: ["button","toast","auto-form"], + component: () => import("../src/lib/registry/new-york/example/AutoFormDependencies.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/AutoFormDependencies.vue"], + }, + "AutoFormInputWithoutLabel": { + name: "AutoFormInputWithoutLabel", + type: "components:example", + registryDependencies: ["button","toast","auto-form"], + component: () => import("../src/lib/registry/new-york/example/AutoFormInputWithoutLabel.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/AutoFormInputWithoutLabel.vue"], + }, + "AutoFormSubObject": { + name: "AutoFormSubObject", + type: "components:example", + registryDependencies: ["button","toast","auto-form"], + component: () => import("../src/lib/registry/new-york/example/AutoFormSubObject.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/AutoFormSubObject.vue"], }, "AvatarDemo": { name: "AvatarDemo", diff --git a/apps/www/src/content/docs/components/auto-form.md b/apps/www/src/content/docs/components/auto-form.md index 62909ac0..9d0925b5 100644 --- a/apps/www/src/content/docs/components/auto-form.md +++ b/apps/www/src/content/docs/components/auto-form.md @@ -1,7 +1,39 @@ --- title: Auto Form -description: Building forms with VeeValidate and Zod. +description: Automatically generate a form from Zod schema. primitive: https://vee-validate.logaretm.com/v4/guide/overview/ --- - +### Basic + + + +### Input Without Label +This example shows how to use AutoForm input without label. + + + +### Sub Object +Automatically generate a form from a Zod schema. + + + +### Controlled +This example shows how to use AutoForm in a controlled way. + + + +### Confirm Password +Refined schema to validate that two fields match. + + + +### Array support +You can use arrays in your schemas to create dynamic forms. + + + +### Dependencies +Create dependencies between fields. + + diff --git a/apps/www/src/lib/registry/default/example/AutoFormArray.vue b/apps/www/src/lib/registry/default/example/AutoFormArray.vue new file mode 100644 index 00000000..8b97ddc4 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/AutoFormArray.vue @@ -0,0 +1,38 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/AutoForm.vue b/apps/www/src/lib/registry/default/example/AutoFormBasic.vue similarity index 100% rename from apps/www/src/lib/registry/default/example/AutoForm.vue rename to apps/www/src/lib/registry/default/example/AutoFormBasic.vue diff --git a/apps/www/src/lib/registry/default/example/AutoFormConfirmPassword.vue b/apps/www/src/lib/registry/default/example/AutoFormConfirmPassword.vue new file mode 100644 index 00000000..740824e7 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/AutoFormConfirmPassword.vue @@ -0,0 +1,36 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/AutoFormControlled.vue b/apps/www/src/lib/registry/default/example/AutoFormControlled.vue new file mode 100644 index 00000000..14d002a1 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/AutoFormControlled.vue @@ -0,0 +1,37 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/AutoFormDependencies.vue b/apps/www/src/lib/registry/default/example/AutoFormDependencies.vue new file mode 100644 index 00000000..a242d9b0 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/AutoFormDependencies.vue @@ -0,0 +1,72 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/AutoFormInputWithoutLabel.vue b/apps/www/src/lib/registry/default/example/AutoFormInputWithoutLabel.vue new file mode 100644 index 00000000..ec94e250 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/AutoFormInputWithoutLabel.vue @@ -0,0 +1,48 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/AutoFormSubObject.vue b/apps/www/src/lib/registry/default/example/AutoFormSubObject.vue new file mode 100644 index 00000000..4c6a5a11 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/AutoFormSubObject.vue @@ -0,0 +1,54 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/auto-form/AutoForm.vue b/apps/www/src/lib/registry/default/ui/auto-form/AutoForm.vue index 7da60774..3cdf2c89 100644 --- a/apps/www/src/lib/registry/default/ui/auto-form/AutoForm.vue +++ b/apps/www/src/lib/registry/default/ui/auto-form/AutoForm.vue @@ -1,9 +1,9 @@ - + + diff --git a/apps/www/src/lib/registry/new-york/example/AutoForm.vue b/apps/www/src/lib/registry/new-york/example/AutoFormBasic.vue similarity index 100% rename from apps/www/src/lib/registry/new-york/example/AutoForm.vue rename to apps/www/src/lib/registry/new-york/example/AutoFormBasic.vue diff --git a/apps/www/src/lib/registry/new-york/example/AutoFormConfirmPassword.vue b/apps/www/src/lib/registry/new-york/example/AutoFormConfirmPassword.vue new file mode 100644 index 00000000..9f96b908 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/example/AutoFormConfirmPassword.vue @@ -0,0 +1,36 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/example/AutoFormControlled.vue b/apps/www/src/lib/registry/new-york/example/AutoFormControlled.vue new file mode 100644 index 00000000..eb3b3acb --- /dev/null +++ b/apps/www/src/lib/registry/new-york/example/AutoFormControlled.vue @@ -0,0 +1,37 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/example/AutoFormDependencies.vue b/apps/www/src/lib/registry/new-york/example/AutoFormDependencies.vue new file mode 100644 index 00000000..bdd5f505 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/example/AutoFormDependencies.vue @@ -0,0 +1,72 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/example/AutoFormInputWithoutLabel.vue b/apps/www/src/lib/registry/new-york/example/AutoFormInputWithoutLabel.vue new file mode 100644 index 00000000..f2fadc94 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/example/AutoFormInputWithoutLabel.vue @@ -0,0 +1,48 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/example/AutoFormSubObject.vue b/apps/www/src/lib/registry/new-york/example/AutoFormSubObject.vue new file mode 100644 index 00000000..c83aa270 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/example/AutoFormSubObject.vue @@ -0,0 +1,54 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/ui/auto-form/AutoForm.vue b/apps/www/src/lib/registry/new-york/ui/auto-form/AutoForm.vue index e883328e..6eb3ce5f 100644 --- a/apps/www/src/lib/registry/new-york/ui/auto-form/AutoForm.vue +++ b/apps/www/src/lib/registry/new-york/ui/auto-form/AutoForm.vue @@ -1,9 +1,9 @@ -\n\n\n" + "content": "\n\n\n" }, { "name": "AutoFormField.vue", @@ -32,7 +32,7 @@ }, { "name": "AutoFormFieldArray.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "AutoFormFieldBoolean.vue", @@ -60,7 +60,7 @@ }, { "name": "AutoFormFieldObject.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "AutoFormLabel.vue", diff --git a/apps/www/src/public/registry/styles/new-york/auto-form.json b/apps/www/src/public/registry/styles/new-york/auto-form.json index 7e5e2857..d8df2e73 100644 --- a/apps/www/src/public/registry/styles/new-york/auto-form.json +++ b/apps/www/src/public/registry/styles/new-york/auto-form.json @@ -24,7 +24,7 @@ "files": [ { "name": "AutoForm.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "AutoFormField.vue",