{
  "$schema": "https://pdfx.akashpise.dev/schema/registry-item.json",
  "name": "stack",
  "type": "registry:ui",
  "title": "Stack",
  "description": "Vertical layout with theme-based gap",
  "files": [
    {
      "path": "components/pdfx/stack/pdfx-stack.tsx",
      "content": "import { StyleSheet, View } from '@react-pdf/renderer';\nimport type { Style } from '@react-pdf/types';\nimport { usePdfxTheme, useSafeMemo } from '../lib/pdfx-theme-context';\nimport type React from 'react';\ntype PdfxTheme = ReturnType<typeof usePdfxTheme>;\n\nexport type StackGap = 'none' | 'sm' | 'md' | 'lg' | 'xl';\nexport type StackDirection = 'vertical' | 'horizontal';\nexport type StackAlign = 'start' | 'center' | 'end' | 'stretch';\nexport type StackJustify = 'start' | 'center' | 'end' | 'between' | 'around';\n\n/**\n * Flex layout container with gap and direction control.\n * Props - `gap` | `direction` | `align` | `justify` | `wrap` | `noWrap` | `children` | `style`\n * @see {@link StackProps}\n */\nexport interface StackProps {\n  /** Custom styles to merge with component defaults */\n  style?: Style;\n  /** Content to render */\n  children: React.ReactNode;\n  /**\n   * @default 'md'\n   */\n  gap?: StackGap;\n  /**\n   * @default 'vertical'\n   */\n  direction?: StackDirection;\n  /**\n   * @default 'start'\n   */\n  align?: StackAlign;\n  /**\n   * @default 'start'\n   */\n  justify?: StackJustify;\n  /**\n   * @default false\n   */\n  wrap?: boolean;\n  /**\n   * @default false\n   */\n  noWrap?: boolean;\n}\n\nfunction createStackStyles(t: PdfxTheme) {\n  const { spacing } = t.primitives;\n  return StyleSheet.create({\n    vertical: { flexDirection: 'column' },\n    horizontal: { flexDirection: 'row' },\n    gapNone: { gap: spacing[0] },\n    gapSm: { gap: spacing[2] },\n    gapMd: { gap: spacing[4] },\n    gapLg: { gap: spacing[6] },\n    gapXl: { gap: spacing[8] },\n    alignStart: { alignItems: 'flex-start' },\n    alignCenter: { alignItems: 'center' },\n    alignEnd: { alignItems: 'flex-end' },\n    alignStretch: { alignItems: 'stretch' },\n    justifyStart: { justifyContent: 'flex-start' },\n    justifyCenter: { justifyContent: 'center' },\n    justifyEnd: { justifyContent: 'flex-end' },\n    justifyBetween: { justifyContent: 'space-between' },\n    justifyAround: { justifyContent: 'space-around' },\n    wrap: { flexWrap: 'wrap' },\n  });\n}\n\nexport function Stack({\n  gap = 'md',\n  direction = 'vertical',\n  align,\n  justify,\n  wrap,\n  noWrap,\n  children,\n  style,\n}: StackProps) {\n  const theme = usePdfxTheme();\n  const styles = useSafeMemo(() => createStackStyles(theme), [theme]);\n  const gapMap = {\n    none: styles.gapNone,\n    sm: styles.gapSm,\n    md: styles.gapMd,\n    lg: styles.gapLg,\n    xl: styles.gapXl,\n  };\n  const alignMap = {\n    start: styles.alignStart,\n    center: styles.alignCenter,\n    end: styles.alignEnd,\n    stretch: styles.alignStretch,\n  };\n  const justifyMap = {\n    start: styles.justifyStart,\n    center: styles.justifyCenter,\n    end: styles.justifyEnd,\n    between: styles.justifyBetween,\n    around: styles.justifyAround,\n  };\n  const styleArray: Style[] = [\n    direction === 'horizontal' ? styles.horizontal : styles.vertical,\n    gapMap[gap],\n  ];\n  if (align && align in alignMap) styleArray.push(alignMap[align]);\n  if (justify && justify in justifyMap) styleArray.push(justifyMap[justify]);\n  if (wrap) styleArray.push(styles.wrap);\n  if (style) styleArray.push(...[style].flat());\n  return (\n    <View wrap={noWrap ? false : undefined} style={styleArray}>\n      {children}\n    </View>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "dependencies": [
    "@react-pdf/renderer"
  ],
  "registryDependencies": [
    "theme"
  ]
}