{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "notification-settings",
  "title": "Notification Settings",
  "description": "Preferences for email and push notifications using switch fields.",
  "registryDependencies": [
    "@buzzform/switch",
    "card",
    "sonner"
  ],
  "files": [
    {
      "path": "registry/shadcn/examples/notification-settings.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} from \"@/registry/shadcn/form\";\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardHeader,\n  CardTitle,\n} from \"@/components/ui/card\";\n\nconst notificationSettingsSchema = defineSchema({\n  fields: [\n    {\n      type: \"switch\",\n      name: \"emailNotifications\",\n      label: \"Email notifications\",\n      description: \"Receive updates and alerts via email\",\n      defaultValue: true,\n    },\n    {\n      type: \"switch\",\n      name: \"pushNotifications\",\n      label: \"Push notifications\",\n      description: \"Get notified on your device\",\n      defaultValue: false,\n    },\n    {\n      type: \"switch\",\n      name: \"marketingEmails\",\n      label: \"Marketing emails\",\n      description: \"Receive tips, product updates, and promotions\",\n      defaultValue: false,\n    },\n    {\n      type: \"switch\",\n      name: \"weeklyDigest\",\n      label: \"Weekly digest\",\n      description: \"A summary of your activity sent every Monday\",\n      defaultValue: true,\n      disabled: { $data: \"/emailNotifications\", not: true },\n    },\n  ],\n});\n\ntype NotificationSettingsSchema = InferType<\n  typeof notificationSettingsSchema.fields\n>;\n\nexport default function NotificationSettingsCard() {\n  const handleSubmit = async ({ value }: { value: unknown }) => {\n    const data = value as NotificationSettingsSchema;\n    await new Promise((resolve) => setTimeout(resolve, 500));\n    toast(\"Settings saved!\", {\n      description: (\n        <pre className=\"mt-2 max-h-48 overflow-auto rounded-md bg-muted text-muted-foreground p-3 text-xs\">\n          <code>{JSON.stringify(data, null, 2)}</code>\n        </pre>\n      ),\n    });\n  };\n\n  return (\n    <Card className=\"w-full max-w-md\">\n      <CardHeader>\n        <CardTitle>Notifications</CardTitle>\n        <CardDescription>\n          Choose how you want to be notified about updates.\n        </CardDescription>\n      </CardHeader>\n      <CardContent>\n        <Form schema={notificationSettingsSchema} onSubmit={handleSubmit}>\n          <FormContent className=\"space-y-4\">\n            <FormFields />\n            <FormSubmit className=\"w-full\">Save Preferences</FormSubmit>\n          </FormContent>\n        </Form>\n      </CardContent>\n    </Card>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/buzzform/examples/notification-settings.tsx"
    }
  ],
  "type": "registry:block"
}