{"version":3,"sources":["../src/catalog.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst styleSchema = z.record(z.string(), z.any()).nullable();\n\n/**\n * Standard component definitions for React Email catalogs.\n *\n * These define the available email components with their Zod prop schemas.\n * All components render using @react-email/components primitives.\n */\nexport const standardComponentDefinitions = {\n  // ==========================================================================\n  // Document Structure\n  // ==========================================================================\n\n  Html: {\n    props: z.object({\n      lang: z.string().nullable(),\n      dir: z.enum([\"ltr\", \"rtl\"]).nullable(),\n    }),\n    slots: [\"default\"],\n    description:\n      \"Top-level HTML email wrapper. Must be the root element. Children should include Head and Body.\",\n    example: { lang: \"en\", dir: \"ltr\" },\n  },\n\n  Head: {\n    props: z.object({}),\n    slots: [\"default\"],\n    description:\n      \"Email head section. Place inside Html. Can contain metadata but typically left empty.\",\n    example: {},\n  },\n\n  Body: {\n    props: z.object({\n      style: styleSchema,\n    }),\n    slots: [\"default\"],\n    description:\n      \"Email body wrapper. Place inside Html after Head. Contains all visible email content.\",\n    example: { style: { backgroundColor: \"#f6f9fc\" } },\n  },\n\n  Container: {\n    props: z.object({\n      style: styleSchema,\n    }),\n    slots: [\"default\"],\n    description:\n      \"Constrains content width for email clients. Place inside Body. Typically max-width 600px.\",\n    example: {\n      style: {\n        maxWidth: \"600px\",\n        margin: \"0 auto\",\n        padding: \"20px 0 48px\",\n      },\n    },\n  },\n\n  Section: {\n    props: z.object({\n      style: styleSchema,\n    }),\n    slots: [\"default\"],\n    description:\n      \"Groups related content. Renders as a table-based section for email compatibility.\",\n    example: { style: { padding: \"24px\", backgroundColor: \"#ffffff\" } },\n  },\n\n  Row: {\n    props: z.object({\n      style: styleSchema,\n    }),\n    slots: [\"default\"],\n    description:\n      \"Horizontal layout row. Use inside Section for multi-column layouts.\",\n    example: { style: {} },\n  },\n\n  Column: {\n    props: z.object({\n      style: styleSchema,\n    }),\n    slots: [\"default\"],\n    description:\n      \"Column within a Row. Set width via style for proportional layouts.\",\n    example: { style: { width: \"50%\" } },\n  },\n\n  // ==========================================================================\n  // Content Components\n  // ==========================================================================\n\n  Heading: {\n    props: z.object({\n      text: z.string(),\n      as: z.enum([\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"]).nullable(),\n      style: styleSchema,\n    }),\n    slots: [],\n    description:\n      \"Heading text at various levels. h1 is largest, h6 is smallest.\",\n    example: { text: \"Welcome!\", as: \"h1\" },\n  },\n\n  Text: {\n    props: z.object({\n      text: z.string(),\n      style: styleSchema,\n    }),\n    slots: [],\n    description:\n      \"Body text paragraph. Use style for font size, color, weight, and alignment.\",\n    example: { text: \"Thank you for signing up.\" },\n  },\n\n  Link: {\n    props: z.object({\n      text: z.string(),\n      href: z.string(),\n      style: styleSchema,\n    }),\n    slots: [],\n    description: \"Hyperlink with visible text and a URL.\",\n    example: {\n      text: \"Visit our website\",\n      href: \"https://example.com\",\n      style: { color: \"#2563eb\" },\n    },\n  },\n\n  Button: {\n    props: z.object({\n      text: z.string(),\n      href: z.string(),\n      style: styleSchema,\n    }),\n    slots: [],\n    description:\n      \"Call-to-action button rendered as a link styled as a button. Provide text and href.\",\n    example: {\n      text: \"Get Started\",\n      href: \"https://example.com\",\n      style: {\n        backgroundColor: \"#5F51E8\",\n        borderRadius: \"3px\",\n        color: \"#fff\",\n        padding: \"12px 20px\",\n      },\n    },\n  },\n\n  Image: {\n    props: z.object({\n      src: z.string(),\n      alt: z.string().nullable(),\n      width: z.number().nullable(),\n      height: z.number().nullable(),\n      style: styleSchema,\n    }),\n    slots: [],\n    description:\n      \"Image from a URL. src must be a fully qualified URL. Specify width and height for consistent rendering.\",\n    example: {\n      src: \"https://picsum.photos/400/200?random=1\",\n      alt: \"Hero image\",\n      width: 400,\n      height: 200,\n    },\n  },\n\n  Hr: {\n    props: z.object({\n      style: styleSchema,\n    }),\n    slots: [],\n    description: \"Horizontal rule separator between content sections.\",\n    example: {\n      style: { borderColor: \"#e6ebf1\", margin: \"20px 0\" },\n    },\n  },\n\n  // ==========================================================================\n  // Utility Components\n  // ==========================================================================\n\n  Preview: {\n    props: z.object({\n      text: z.string(),\n    }),\n    slots: [],\n    description:\n      \"Preview text shown in email client inboxes before the email is opened. Place inside Html.\",\n    example: { text: \"You have a new message from Acme Corp\" },\n  },\n\n  Markdown: {\n    props: z.object({\n      content: z.string(),\n      markdownContainerStyles: styleSchema,\n      markdownCustomStyles: z.record(z.string(), z.any()).nullable(),\n    }),\n    slots: [],\n    description:\n      \"Renders markdown content as email-safe HTML. Supports headings, paragraphs, lists, links, bold, italic, and code.\",\n    example: {\n      content: \"# Hello\\n\\nThis is **bold** and *italic* text.\",\n    },\n  },\n};\n\nexport type StandardComponentDefinitions = typeof standardComponentDefinitions;\n\nexport type StandardComponentProps<\n  K extends keyof StandardComponentDefinitions,\n> = StandardComponentDefinitions[K][\"props\"] extends { _output: infer O }\n  ? O\n  : z.output<StandardComponentDefinitions[K][\"props\"]>;\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,IAAM,cAAc,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC,EAAE,SAAS;AAQpD,IAAM,+BAA+B;AAAA;AAAA;AAAA;AAAA,EAK1C,MAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,MACd,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,MAC1B,KAAK,EAAE,KAAK,CAAC,OAAO,KAAK,CAAC,EAAE,SAAS;AAAA,IACvC,CAAC;AAAA,IACD,OAAO,CAAC,SAAS;AAAA,IACjB,aACE;AAAA,IACF,SAAS,EAAE,MAAM,MAAM,KAAK,MAAM;AAAA,EACpC;AAAA,EAEA,MAAM;AAAA,IACJ,OAAO,EAAE,OAAO,CAAC,CAAC;AAAA,IAClB,OAAO,CAAC,SAAS;AAAA,IACjB,aACE;AAAA,IACF,SAAS,CAAC;AAAA,EACZ;AAAA,EAEA,MAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,MACd,OAAO;AAAA,IACT,CAAC;AAAA,IACD,OAAO,CAAC,SAAS;AAA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