{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cart-line-item",
  "title": "Cart Line Item",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-native/blocks/cart-line-item/CartLineItem.tsx",
      "content": "import { View, type ViewProps } from 'react-native'\nimport { ImageOff } from 'lucide-react-native'\nimport { Button } from '@/components/ui/button'\nimport { Icon } from '@/components/ui/icon'\nimport { Image, ImageFallback, ImageSource, type ImageSourceValue } from '@/components/ui/image'\nimport { QuantityStepper } from '@/components/ui/quantity-stepper'\nimport { Text } from '@/components/ui/text'\nimport { useAnnouncement } from '@/lib/accessibility'\nimport { cn } from '@/lib/utils'\n\nconst numberFormatter = new Intl.NumberFormat()\n\nexport interface CartLineItemProps extends Omit<ViewProps, 'children'> {\n  className?: string\n  title: string\n  detail?: string\n  /** The line total from the caller, already formatted for currency and locale. */\n  total: string\n  /** The actual positive quantity currently in the cart. */\n  quantity: number\n  /** Supply a small thumbnail source for the cart layout. */\n  image?: ImageSourceValue\n  availableQuantity?: number\n  unavailableReason?: string\n  updating?: boolean\n  removing?: boolean\n  quantityLabel?: string\n  removeLabel?: string\n  removeAccessibilityLabel?: string\n  soldOutLabel?: string\n  formatLimit?: (available: number) => string\n  onQuantityChange?: (quantity: number) => void\n  onRemove?: () => void\n}\n\nexport function CartLineItem({\n  className,\n  title,\n  detail,\n  total,\n  quantity,\n  image,\n  availableQuantity,\n  unavailableReason,\n  updating = false,\n  removing = false,\n  quantityLabel = 'Quantity',\n  removeLabel = 'Remove',\n  removeAccessibilityLabel = `${removeLabel} ${title}`,\n  soldOutLabel = 'Sold out',\n  formatLimit,\n  onQuantityChange,\n  onRemove,\n  ...props\n}: CartLineItemProps) {\n  const stock =\n    availableQuantity != null && Number.isSafeInteger(availableQuantity) ? Math.max(0, availableQuantity) : undefined\n  const blocked = stock === 0 || Boolean(unavailableReason)\n  const unavailable = unavailableReason || (stock === 0 ? soldOutLabel : undefined)\n  const shortage =\n    stock !== undefined && stock > 0 && quantity > stock\n      ? (formatLimit?.(stock) ?? `Only ${numberFormatter.format(stock)} available. Reduce the quantity to continue.`)\n      : undefined\n  const notice = unavailable || shortage\n  const quantityValid = Number.isSafeInteger(quantity) && quantity > 0\n  useAnnouncement(notice)\n\n  return (\n    <View {...props} className={cn('gap-[12px] rounded-lg border border-border bg-card p-[16px]', className)}>\n      <View className=\"flex-row items-start gap-[12px]\">\n        {image !== undefined ? (\n          <Image aria-hidden source={image} className=\"shrink-0\" style={{ width: 72, aspectRatio: 1 }}>\n            <ImageSource />\n            <ImageFallback className=\"p-0\">\n              <Icon icon={ImageOff} size={18} className=\"text-muted-foreground\" />\n            </ImageFallback>\n          </Image>\n        ) : null}\n        <View className=\"min-w-0 flex-1 gap-[4px]\">\n          <Text className=\"font-semibold text-card-foreground\">{title}</Text>\n          {detail ? (\n            <Text size=\"sm\" variant=\"muted\">\n              {detail}\n            </Text>\n          ) : null}\n          <Text size=\"sm\" className=\"font-semibold text-card-foreground\" style={{ fontVariant: ['tabular-nums'] }}>\n            {total}\n          </Text>\n        </View>\n      </View>\n      {notice ? (\n        <Text size=\"sm\" className=\"text-destructive\">\n          {notice}\n        </Text>\n      ) : null}\n      {quantityValid || onRemove ? (\n        <View className=\"flex-row flex-wrap items-center justify-between gap-[8px]\">\n          {quantityValid ? (\n            onQuantityChange ? (\n              <QuantityStepper\n                accessibilityLabel={`${quantityLabel}, ${title}`}\n                value={quantity}\n                min={1}\n                max={Math.max(quantity, stock ?? 99)}\n                disabled={updating || removing || blocked}\n                onValueChange={onQuantityChange}\n              />\n            ) : (\n              <Text size=\"sm\" variant=\"muted\">{`${quantityLabel}: ${numberFormatter.format(quantity)}`}</Text>\n            )\n          ) : null}\n          {onRemove ? (\n            <Button\n              variant=\"ghost\"\n              accessibilityLabel={removeAccessibilityLabel}\n              disabled={updating}\n              loading={removing}\n              textClassName=\"text-destructive\"\n              onPress={() => {\n                if (!updating && !removing) onRemove()\n              }}\n            >\n              {removeLabel}\n            </Button>\n          ) : null}\n        </View>\n      ) : null}\n    </View>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/cart-line-item/CartLineItem.tsx"
    },
    {
      "path": "packages/registry-native/blocks/cart-line-item/index.ts",
      "content": "export { CartLineItem, type CartLineItemProps } from './CartLineItem'\n",
      "type": "registry:block",
      "target": "~/components/blocks/cart-line-item/index.ts"
    }
  ],
  "dependencies": [
    "lucide-react-native"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/accessibility.json",
    "https://native.uipkge.dev/r/native/button.json",
    "https://native.uipkge.dev/r/native/icon.json",
    "https://native.uipkge.dev/r/native/image.json",
    "https://native.uipkge.dev/r/native/quantity-stepper.json",
    "https://native.uipkge.dev/r/native/text.json",
    "https://native.uipkge.dev/r/native/utils.json"
  ],
  "description": "Editable cart line with a thumbnail, formatted total, bounded quantity and a separate remove action.",
  "categories": [
    "commerce"
  ]
}