{
  "$schema": "https://pdfx.akashpise.dev/schema/registry-item.json",
  "name": "divider",
  "type": "registry:ui",
  "title": "Divider",
  "description": "Horizontal rule with theme-based spacing",
  "files": [
    {
      "path": "components/pdfx/divider/pdfx-divider.tsx",
      "content": "import { Text as PDFText, StyleSheet, View } from '@react-pdf/renderer';\nimport type { Style } from '@react-pdf/types';\nimport { usePdfxTheme, useSafeMemo } from '../lib/pdfx-theme-context';\ntype PdfxTheme = ReturnType<typeof usePdfxTheme>;\n\nexport type DividerVariant = 'solid' | 'dashed' | 'dotted';\nexport type DividerThickness = 'thin' | 'medium' | 'thick';\nexport type DividerSpacing = 'none' | 'sm' | 'md' | 'lg';\n\n/**\n * Horizontal rule with optional label, style variants, and spacing presets.\n * Props - `spacing` | `variant` | `color` | `thickness` | `label` | `width` | `style`\n * @see {@link DividerProps}\n */\nexport interface DividerProps {\n  /** Custom styles to merge with component defaults */\n  style?: Style;\n  /**\n   * @default 'md'\n   */\n  spacing?: DividerSpacing;\n  /**\n   * @default 'solid'\n   */\n  variant?: DividerVariant;\n  color?: string;\n  /**\n   * @default 'thin'\n   */\n  thickness?: DividerThickness;\n  label?: string;\n  width?: string | number;\n}\n\nconst THEME_COLOR_KEYS = ['foreground','muted','mutedForeground','primary','primaryForeground','accent','destructive','success','warning','info'] as const;\nfunction resolveColor(value: string, colors: Record<string, string>): string {\n  return THEME_COLOR_KEYS.includes(value as (typeof THEME_COLOR_KEYS)[number]) ? colors[value] : value;\n}\nfunction createDividerStyles(t: PdfxTheme) {\n  const { spacing, fontWeights } = t.primitives;\n  return StyleSheet.create({\n    base: { borderBottomColor: t.colors.border, borderBottomStyle: 'solid' },\n    spacingNone: { marginVertical: spacing[0] },\n    spacingSm: { marginVertical: t.spacing.paragraphGap },\n    spacingMd: { marginVertical: t.spacing.componentGap },\n    spacingLg: { marginVertical: t.spacing.sectionGap },\n    solid: { borderBottomStyle: 'solid' },\n    dashed: { borderBottomStyle: 'dashed' },\n    dotted: { borderBottomStyle: 'dotted' },\n    thin: { borderBottomWidth: spacing[0.5] },\n    medium: { borderBottomWidth: spacing[1] },\n    thick: { borderBottomWidth: spacing[2] },\n    labelContainer: { flexDirection: 'row', alignItems: 'center' },\n    labelLine: { flex: 1, borderBottomColor: t.colors.border, borderBottomStyle: 'solid' },\n    labelText: {\n      fontFamily: t.typography.body.fontFamily,\n      fontSize: t.primitives.typography.xs,\n      color: t.colors.mutedForeground,\n      fontWeight: fontWeights.medium,\n      paddingHorizontal: spacing[3],\n      textTransform: 'uppercase',\n      letterSpacing: t.primitives.letterSpacing.wider * 10,\n    },\n  });\n}\n\nexport function Divider({\n  spacing = 'md',\n  variant = 'solid',\n  color,\n  thickness = 'thin',\n  label,\n  width,\n  style,\n}: DividerProps) {\n  const theme = usePdfxTheme();\n  const styles = useSafeMemo(() => createDividerStyles(theme), [theme]);\n  const spacingMap = {\n    none: styles.spacingNone,\n    sm: styles.spacingSm,\n    md: styles.spacingMd,\n    lg: styles.spacingLg,\n  };\n  const variantMap = { solid: styles.solid, dashed: styles.dashed, dotted: styles.dotted };\n  const thicknessMap = { thin: styles.thin, medium: styles.medium, thick: styles.thick };\n\n  if (label) {\n    const lineStyle: Style[] = [styles.labelLine, thicknessMap[thickness], variantMap[variant]];\n    if (color) lineStyle.push({ borderBottomColor: resolveColor(color, theme.colors) });\n    const containerStyles: Style[] = [styles.labelContainer, spacingMap[spacing]];\n    if (width !== undefined) containerStyles.push({ width } as Style);\n    if (style) containerStyles.push(...[style].flat());\n    const labelTextStyle: Style[] = [styles.labelText];\n    if (color) labelTextStyle.push({ color: resolveColor(color, theme.colors) });\n    return (\n      <View style={containerStyles}>\n        <View style={lineStyle} />\n        <PDFText style={labelTextStyle}>{label}</PDFText>\n        <View style={lineStyle} />\n      </View>\n    );\n  }\n\n  const styleArray: Style[] = [\n    styles.base,\n    spacingMap[spacing],\n    variantMap[variant],\n    thicknessMap[thickness],\n  ];\n  if (color) styleArray.push({ borderBottomColor: resolveColor(color, theme.colors) });\n  if (width !== undefined) styleArray.push({ width } as Style);\n  if (style) styleArray.push(...[style].flat());\n  return <View style={styleArray} />;\n}\n",
      "type": "registry:component"
    }
  ],
  "dependencies": [
    "@react-pdf/renderer"
  ],
  "registryDependencies": [
    "theme"
  ]
}