Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/web/.source/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import * as __fd_glob_7 from "../content/docs/dynamic-values.mdx?collection=docs
import * as __fd_glob_6 from "../content/docs/developer-guide.mdx?collection=docs"
import * as __fd_glob_5 from "../content/docs/custom-fields.mdx?collection=docs"
import * as __fd_glob_4 from "../content/docs/conditional-logic.mdx?collection=docs"
import { default as __fd_glob_3 } from "../content/docs/fields/data/meta.json?collection=docs"
import { default as __fd_glob_2 } from "../content/docs/fields/layout/meta.json?collection=docs"
import { default as __fd_glob_3 } from "../content/docs/fields/layout/meta.json?collection=docs"
import { default as __fd_glob_2 } from "../content/docs/fields/data/meta.json?collection=docs"
import { default as __fd_glob_1 } from "../content/docs/fields/meta.json?collection=docs"
import { default as __fd_glob_0 } from "../content/docs/meta.json?collection=docs"
import { server } from 'fumadocs-mdx/runtime/server';
Expand All @@ -47,4 +47,4 @@ const create = server<typeof Config, import("fumadocs-mdx/runtime/types").Intern
}
}>({"doc":{"passthroughs":["extractedReferences"]}});

export const docs = await create.docs("docs", "content/docs", {"meta.json": __fd_glob_0, "fields/meta.json": __fd_glob_1, "fields/layout/meta.json": __fd_glob_2, "fields/data/meta.json": __fd_glob_3, }, {"conditional-logic.mdx": __fd_glob_4, "custom-fields.mdx": __fd_glob_5, "developer-guide.mdx": __fd_glob_6, "dynamic-values.mdx": __fd_glob_7, "field-hooks.mdx": __fd_glob_8, "field-wrappers.mdx": __fd_glob_9, "form-component.mdx": __fd_glob_10, "form-provider.mdx": __fd_glob_11, "index.mdx": __fd_glob_12, "installation.mdx": __fd_glob_13, "migration.mdx": __fd_glob_14, "option-resolvers.mdx": __fd_glob_15, "output-transformation.mdx": __fd_glob_16, "quick-start.mdx": __fd_glob_17, "render-fields.mdx": __fd_glob_18, "schema.mdx": __fd_glob_19, "use-form.mdx": __fd_glob_20, "validation.mdx": __fd_glob_21, "fields/types.mdx": __fd_glob_22, "fields/layout/array.mdx": __fd_glob_23, "fields/layout/collapsible.mdx": __fd_glob_24, "fields/layout/group.mdx": __fd_glob_25, "fields/layout/row.mdx": __fd_glob_26, "fields/layout/tabs.mdx": __fd_glob_27, "fields/data/checkbox.mdx": __fd_glob_28, "fields/data/date.mdx": __fd_glob_29, "fields/data/email.mdx": __fd_glob_30, "fields/data/number.mdx": __fd_glob_31, "fields/data/password.mdx": __fd_glob_32, "fields/data/radio.mdx": __fd_glob_33, "fields/data/select.mdx": __fd_glob_34, "fields/data/switch.mdx": __fd_glob_35, "fields/data/tags.mdx": __fd_glob_36, "fields/data/text.mdx": __fd_glob_37, "fields/data/textarea.mdx": __fd_glob_38, "fields/data/upload.mdx": __fd_glob_39, });
export const docs = await create.docs("docs", "content/docs", {"meta.json": __fd_glob_0, "fields/meta.json": __fd_glob_1, "fields/data/meta.json": __fd_glob_2, "fields/layout/meta.json": __fd_glob_3, }, {"conditional-logic.mdx": __fd_glob_4, "custom-fields.mdx": __fd_glob_5, "developer-guide.mdx": __fd_glob_6, "dynamic-values.mdx": __fd_glob_7, "field-hooks.mdx": __fd_glob_8, "field-wrappers.mdx": __fd_glob_9, "form-component.mdx": __fd_glob_10, "form-provider.mdx": __fd_glob_11, "index.mdx": __fd_glob_12, "installation.mdx": __fd_glob_13, "migration.mdx": __fd_glob_14, "option-resolvers.mdx": __fd_glob_15, "output-transformation.mdx": __fd_glob_16, "quick-start.mdx": __fd_glob_17, "render-fields.mdx": __fd_glob_18, "schema.mdx": __fd_glob_19, "use-form.mdx": __fd_glob_20, "validation.mdx": __fd_glob_21, "fields/types.mdx": __fd_glob_22, "fields/layout/array.mdx": __fd_glob_23, "fields/layout/collapsible.mdx": __fd_glob_24, "fields/layout/group.mdx": __fd_glob_25, "fields/layout/row.mdx": __fd_glob_26, "fields/layout/tabs.mdx": __fd_glob_27, "fields/data/checkbox.mdx": __fd_glob_28, "fields/data/date.mdx": __fd_glob_29, "fields/data/email.mdx": __fd_glob_30, "fields/data/number.mdx": __fd_glob_31, "fields/data/password.mdx": __fd_glob_32, "fields/data/radio.mdx": __fd_glob_33, "fields/data/select.mdx": __fd_glob_34, "fields/data/switch.mdx": __fd_glob_35, "fields/data/tags.mdx": __fd_glob_36, "fields/data/text.mdx": __fd_glob_37, "fields/data/textarea.mdx": __fd_glob_38, "fields/data/upload.mdx": __fd_glob_39, });
2 changes: 1 addition & 1 deletion apps/web/public/r/document-upload-form.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"files": [
{
"path": "registry/shadcn/examples/document-upload-form.tsx",
"content": "\"use client\";\n\nimport { toast } from \"sonner\";\nimport { defineSchema, type InferType } from \"@buildnbuzz/form-react\";\nimport {\n Form,\n FormContent,\n FormFields,\n FormSubmit,\n FormReset,\n FormActions,\n} from \"@/registry/shadcn/form\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\n\nconst documentSchema = defineSchema({\n fields: [\n {\n type: \"upload\",\n name: \"document\",\n label: \"Upload Document\",\n description: \"PDF, Word, or text files (max 10MB)\",\n maxSize: 10 * 1024 * 1024,\n ui: {\n variant: \"dropzone\",\n accept: \".pdf,.doc,.docx,.txt\",\n dropzoneText: \"Drop your document here or click to browse\",\n },\n },\n {\n type: \"textarea\",\n name: \"notes\",\n label: \"Additional Notes\",\n placeholder: \"Any notes about this document...\",\n ui: {\n rows: 3,\n },\n },\n ],\n});\n\ntype DocumentSchema = InferType<typeof documentSchema.fields>;\n\nexport default function DocumentUploadForm() {\n const handleSubmit = async ({ value }: { value: unknown }) => {\n const data = value as DocumentSchema;\n await new Promise((r) => setTimeout(r, 1000));\n toast(\"Document uploaded successfully!\", {\n description: (\n <div className=\"space-y-2\">\n <p className=\"text-[10px] text-muted-foreground\">\n Check the console for the full File objects.\n </p>\n <pre className=\"max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs text-muted-foreground\">\n <code>\n {JSON.stringify(\n {\n ...data,\n document: data.document\n ? data.document instanceof File\n ? {\n name: data.document.name,\n size: data.document.size,\n type: data.document.type,\n }\n : data.document\n : null,\n },\n null,\n 2,\n )}\n </code>\n </pre>\n </div>\n ),\n });\n };\n\n return (\n <Card className=\"w-full max-w-md\">\n <CardHeader>\n <CardTitle>Document Upload</CardTitle>\n <CardDescription>Drag-and-drop file upload with validation</CardDescription>\n </CardHeader>\n <CardContent>\n <Form schema={documentSchema} onSubmit={handleSubmit}>\n <FormContent>\n <FormFields className=\"space-y-4\" />\n <FormActions className=\"mt-6\">\n <FormReset>Clear</FormReset>\n <FormSubmit>Upload Document</FormSubmit>\n </FormActions>\n </FormContent>\n </Form>\n </CardContent>\n </Card>\n );\n}\n",
"content": "\"use client\";\n\nimport { toast } from \"sonner\";\nimport { defineSchema, type InferType } from \"@buildnbuzz/form-react\";\nimport {\n Form,\n FormContent,\n FormFields,\n FormSubmit,\n FormReset,\n FormActions,\n} from \"@/registry/shadcn/form\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\n\nconst documentSchema = defineSchema({\n fields: [\n {\n type: \"upload\",\n name: \"document\",\n label: \"Upload Document\",\n description: \"PDF, Word, or text files (max 10MB)\",\n maxSize: 10 * 1024 * 1024,\n ui: {\n variant: \"dropzone\",\n accept: \".pdf,.doc,.docx,.txt\",\n dropzoneText: \"Drop your document here or click to browse\",\n },\n },\n {\n type: \"textarea\",\n name: \"notes\",\n label: \"Additional Notes\",\n placeholder: \"Any notes about this document...\",\n ui: {\n rows: 3,\n },\n },\n ],\n});\n\ntype DocumentSchema = InferType<typeof documentSchema.fields>;\n\nexport default function DocumentUploadForm() {\n const handleSubmit = async ({ value }: { value: unknown }) => {\n const data = value as DocumentSchema;\n await new Promise((r) => setTimeout(r, 1000));\n toast(\"Document uploaded successfully!\", {\n description: (\n <div className=\"space-y-2\">\n <p className=\"text-[10px] text-muted-foreground\">\n Check the console for the full File objects.\n </p>\n <pre className=\"max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs text-muted-foreground\">\n <code>\n {JSON.stringify(\n {\n ...data,\n document: data.document\n ? (typeof window !== \"undefined\" && data.document instanceof window.File)\n ? {\n name: data.document.name,\n size: data.document.size,\n type: data.document.type,\n }\n : data.document\n : null,\n },\n null,\n 2,\n )}\n </code>\n </pre>\n </div>\n ),\n });\n };\n\n return (\n <Card className=\"w-full max-w-md\">\n <CardHeader>\n <CardTitle>Document Upload</CardTitle>\n <CardDescription>Drag-and-drop file upload with validation</CardDescription>\n </CardHeader>\n <CardContent>\n <Form schema={documentSchema} onSubmit={handleSubmit}>\n <FormContent>\n <FormFields className=\"space-y-4\" />\n <FormActions className=\"mt-6\">\n <FormReset>Clear</FormReset>\n <FormSubmit>Upload Document</FormSubmit>\n </FormActions>\n </FormContent>\n </Form>\n </CardContent>\n </Card>\n );\n}\n",
"type": "registry:component",
"target": "components/buzzform/examples/document-upload-form.tsx"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/public/r/gallery-upload-form.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"files": [
{
"path": "registry/shadcn/examples/gallery-upload-form.tsx",
"content": "\"use client\";\n\nimport { toast } from \"sonner\";\nimport { defineSchema, type InferType } from \"@buildnbuzz/form-react\";\nimport {\n Form,\n FormContent,\n FormFields,\n FormSubmit,\n FormReset,\n FormActions,\n} from \"@/registry/shadcn/form\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\n\nconst gallerySchema = defineSchema({\n fields: [\n {\n type: \"upload\",\n name: \"images\",\n label: \"Product Images\",\n description: \"Upload up to 6 product images\",\n hasMany: true,\n max: 6,\n ui: {\n variant: \"gallery\",\n accept: \"image/*\",\n shape: \"rounded\",\n },\n },\n ],\n});\n\ntype GallerySchema = InferType<typeof gallerySchema.fields>;\n\nexport default function GalleryUploadForm() {\n const handleSubmit = async ({ value }: { value: unknown }) => {\n const data = value as GallerySchema;\n await new Promise((r) => setTimeout(r, 1000));\n\n const filesInfo = Array.isArray(data.images)\n ? data.images.map((img) =>\n img instanceof File\n ? { name: img.name, size: img.size, type: img.type }\n : img,\n )\n : [];\n\n toast(\"Images saved!\", {\n description: (\n <div className=\"space-y-2\">\n <p className=\"text-[10px] text-muted-foreground\">\n Check the console for the full File objects.\n </p>\n <pre className=\"max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs text-muted-foreground\">\n <code>{JSON.stringify({ ...data, images: filesInfo }, null, 2)}</code>\n </pre>\n </div>\n ),\n });\n };\n\n return (\n <Card className=\"w-full max-w-lg\">\n <CardHeader>\n <CardTitle>Product Gallery</CardTitle>\n <CardDescription>Multi-file upload with thumbnail grid preview</CardDescription>\n </CardHeader>\n <CardContent>\n <Form schema={gallerySchema} onSubmit={handleSubmit}>\n <FormContent>\n <FormFields className=\"space-y-4\" />\n <FormActions className=\"mt-6\">\n <FormReset>Clear</FormReset>\n <FormSubmit>Save Images</FormSubmit>\n </FormActions>\n </FormContent>\n </Form>\n </CardContent>\n </Card>\n );\n}\n",
"content": "\"use client\";\n\nimport { toast } from \"sonner\";\nimport { defineSchema, type InferType } from \"@buildnbuzz/form-react\";\nimport {\n Form,\n FormContent,\n FormFields,\n FormSubmit,\n FormReset,\n FormActions,\n} from \"@/registry/shadcn/form\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\n\nconst gallerySchema = defineSchema({\n fields: [\n {\n type: \"upload\",\n name: \"images\",\n label: \"Product Images\",\n description: \"Upload up to 6 product images\",\n hasMany: true,\n max: 6,\n ui: {\n variant: \"gallery\",\n accept: \"image/*\",\n shape: \"rounded\",\n },\n },\n ],\n});\n\ntype GallerySchema = InferType<typeof gallerySchema.fields>;\n\nexport default function GalleryUploadForm() {\n const handleSubmit = async ({ value }: { value: unknown }) => {\n const data = value as GallerySchema;\n await new Promise((r) => setTimeout(r, 1000));\n\n const filesInfo = Array.isArray(data.images)\n ? data.images.map((img) =>\n typeof window !== \"undefined\" && img instanceof window.File\n ? { name: img.name, size: img.size, type: img.type }\n : img,\n )\n : [];\n\n toast(\"Images saved!\", {\n description: (\n <div className=\"space-y-2\">\n <p className=\"text-[10px] text-muted-foreground\">\n Check the console for the full File objects.\n </p>\n <pre className=\"max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs text-muted-foreground\">\n <code>{JSON.stringify({ ...data, images: filesInfo }, null, 2)}</code>\n </pre>\n </div>\n ),\n });\n };\n\n return (\n <Card className=\"w-full max-w-lg\">\n <CardHeader>\n <CardTitle>Product Gallery</CardTitle>\n <CardDescription>Multi-file upload with thumbnail grid preview</CardDescription>\n </CardHeader>\n <CardContent>\n <Form schema={gallerySchema} onSubmit={handleSubmit}>\n <FormContent>\n <FormFields className=\"space-y-4\" />\n <FormActions className=\"mt-6\">\n <FormReset>Clear</FormReset>\n <FormSubmit>Save Images</FormSubmit>\n </FormActions>\n </FormContent>\n </Form>\n </CardContent>\n </Card>\n );\n}\n",
"type": "registry:component",
"target": "components/buzzform/examples/gallery-upload-form.tsx"
}
Expand Down
Loading
Loading