import { cn } from '@gentleduck/libs/cn' import Image from 'next/image' import type * as React from 'react' import type { MdxComponentMap } from './mdx-component-registry.types' import { Callout } from './mdx-components/callout' import { CodeBlock, ComponentPreview, ComponentSource, MermaidBlock, PreBlock } from './mdx-components/code' import { FigcaptionBlock } from './mdx-components/code/figcaption-block' import { ShellCommand } from './mdx-components/code/pre-block/shell-command' import { ComponentsList } from './mdx-components/components-list' import { Table, TableCell, TableHeader, TableRow } from './mdx-components/table' import { Tab, TabContent, TabList, TabTrigger } from './mdx-components/tabs' import { A, H1, H2, H3, H4, H5, H6, Hr, LinkBlock, LinkedCard, P } from './mdx-components/typography' import { mdxIcons } from './mdx-icons' type PreRendererProps = React.ComponentProps & { __isMermaid__?: boolean } export const mdxBaseComponents = { ...mdxIcons, a: A, blockquote: ({ className, ...props }: React.HTMLAttributes) => (
), ApiRoutes: ({ children }: { children?: React.ReactNode }) =>
{children}
, Callout, ComponentPreview, ComponentSource, ComponentsList, MathMl: ({ children }: { children?: React.ReactNode }) => {children}, MermaidSvg: ({ children, ...props }: React.HTMLAttributes) => (
{children}
), PackageManagerTabs: ({ npm, yarn, pnpm, bun }: { npm?: string; yarn?: string; pnpm?: string; bun?: string }) => ( ), SequenceDisplay: ({ children }: { children?: React.ReactNode }) =>
{children}
, code: CodeBlock, figcaption: FigcaptionBlock, h1: H1, h2: H2, h3: H3, h4: H4, h5: H5, h6: H6, hr: Hr, Image, img: ({ className, alt, ...props }: React.ImgHTMLAttributes) => ( // biome-ignore lint/performance/noImgElement: MDX component override for the native `img` tag {alt} ), Link: LinkBlock, LinkedCard, li: (props: React.HTMLAttributes) =>
  • , MermaidDiagram: MermaidBlock, ol: ({ className, ...props }: React.HTMLAttributes) => (
      ), p: P, pre: (props: PreRendererProps) => { if (props.__isMermaid__) { return } return }, Step: ({ className, ...props }: React.ComponentProps<'h3'>) => (

      ), Steps: ({ ...props }: React.ComponentProps<'div'>) => (
      ), // Tailwind preflight zeroes font-weight on /; restore. strong: ({ className, ...props }: React.HTMLAttributes) => ( ), b: ({ className, ...props }: React.HTMLAttributes) => ( ), em: ({ className, ...props }: React.HTMLAttributes) => ( ), table: Table, Tabs: Tab, TabsContent: TabContent, TabsList: TabList, TabsTrigger: TabTrigger, td: TableCell, th: TableHeader, tr: TableRow, ul: ({ className, ...props }: React.HTMLAttributes) => (
        ), } satisfies MdxComponentMap