{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "cart-summary", "title": "Cart Summary", "description": "Subtotal, optional total, taxes-and-shipping note, and a checkout button.", "registryDependencies": [ "https://lumo-www.vercel.app/r/lib.json" ], "files": [ { "path": "packages/core/src/components/lumo/cart-summary.tsx", "content": "import * as React from \"react\"\r\nimport type { Money } from \"@/lib/lumo/types\"\r\nimport { formatMoney } from \"@/lib/lumo/money\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nexport interface CartSummaryProps extends React.HTMLAttributes {\r\n subtotal: Money\r\n /** Grand total, when your backend has computed taxes and shipping. */\r\n total?: Money\r\n locale?: string\r\n onCheckout?: () => void\r\n checkoutLabel?: string\r\n disabled?: boolean\r\n /** Note under the rows. Defaults to a taxes-and-shipping disclaimer. */\r\n note?: React.ReactNode\r\n}\r\n\r\nconst CartSummary = React.forwardRef(\r\n (\r\n {\r\n className,\r\n subtotal,\r\n total,\r\n locale,\r\n onCheckout,\r\n checkoutLabel = \"Checkout\",\r\n disabled = false,\r\n note,\r\n children,\r\n ...props\r\n },\r\n ref\r\n ) => {\r\n return (\r\n
\r\n
\r\n Subtotal\r\n {formatMoney(subtotal, { locale })}\r\n
\r\n\r\n {children}\r\n\r\n {total && (\r\n
\r\n Total\r\n {formatMoney(total, { locale })}\r\n
\r\n )}\r\n\r\n

\r\n {note ?? \"Taxes and shipping calculated at checkout.\"}\r\n

\r\n\r\n {onCheckout && (\r\n \r\n {checkoutLabel}\r\n \r\n )}\r\n
\r\n )\r\n }\r\n)\r\nCartSummary.displayName = \"CartSummary\"\r\n\r\nexport { CartSummary }\r\n", "type": "registry:ui", "target": "components/lumo/cart-summary.tsx" } ], "type": "registry:ui" }