{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button",
  "title": "Button",
  "description": "Pressable with variants and a Reanimated press-scale.",
  "dependencies": [
    "class-variance-authority",
    "react-native-reanimated"
  ],
  "registryDependencies": [
    "@app-cn/cn"
  ],
  "files": [
    {
      "path": "../../packages/ui/src/components/button.tsx",
      "content": "import * as React from \"react\";\nimport { Pressable, Text, type PressableProps } from \"react-native\";\nimport Animated, {\n  useAnimatedStyle,\n  useSharedValue,\n  withTiming,\n} from \"react-native-reanimated\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/cn\";\n\nconst buttonVariants = cva(\n  \"flex-row items-center justify-center gap-2 rounded-2xl\",\n  {\n    variants: {\n      variant: {\n        default: \"bg-primary\",\n        secondary: \"bg-secondary\",\n        outline: \"border border-border bg-transparent\",\n        ghost: \"bg-transparent\",\n        destructive: \"bg-destructive\",\n      },\n      size: {\n        sm: \"h-9 px-3\",\n        default: \"h-12 px-5\",\n        lg: \"h-14 px-7\",\n        icon: \"h-12 w-12\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  }\n);\n\nconst buttonTextVariants = cva(\"text-base font-semibold\", {\n  variants: {\n    variant: {\n      default: \"text-primary-foreground\",\n      secondary: \"text-secondary-foreground\",\n      outline: \"text-foreground\",\n      ghost: \"text-foreground\",\n      destructive: \"text-destructive-foreground\",\n    },\n  },\n  defaultVariants: {\n    variant: \"default\",\n  },\n});\n\nexport interface ButtonProps\n  extends Omit<PressableProps, \"children\" | \"style\">,\n    VariantProps<typeof buttonVariants> {\n  children?: React.ReactNode;\n  className?: string;\n  textClassName?: string;\n}\n\n/**\n * appCN Button — NativeWind-styled, accessible, with a spring-y press scale\n * powered by Reanimated. Pass a string child for auto-styled label, or compose\n * your own children (icons, etc.).\n */\nexport function Button({\n  children,\n  variant,\n  size,\n  className,\n  textClassName,\n  disabled,\n  ...props\n}: ButtonProps) {\n  const scale = useSharedValue(1);\n\n  const animatedStyle = useAnimatedStyle(() => ({\n    transform: [{ scale: scale.value }],\n  }));\n\n  return (\n    <Animated.View style={animatedStyle}>\n      <Pressable\n        accessibilityRole=\"button\"\n        accessibilityState={{ disabled: !!disabled }}\n        disabled={disabled}\n        onPressIn={() => {\n          scale.value = withTiming(0.96, { duration: 100 });\n        }}\n        onPressOut={() => {\n          scale.value = withTiming(1, { duration: 140 });\n        }}\n        className={cn(\n          buttonVariants({ variant, size }),\n          disabled && \"opacity-50\",\n          className\n        )}\n        {...props}\n      >\n        {typeof children === \"string\" ? (\n          <Text className={cn(buttonTextVariants({ variant }), textClassName)}>\n            {children}\n          </Text>\n        ) : (\n          children\n        )}\n      </Pressable>\n    </Animated.View>\n  );\n}\n\nexport { buttonVariants, buttonTextVariants };\n",
      "type": "registry:component",
      "target": "components/ui/button.tsx"
    }
  ],
  "type": "registry:component"
}
