Add the Nook "Cart" component to this project, exactly as Nook ships it. Editable cart rows, undoable removal, promo codes and an order summary. Steps 1. Check for `nook.json` in the project root. If it is missing, run `npx nook-ui@latest init` first (React or Next.js with Tailwind CSS v4). It adds the Nook tokens, the theme and `cn()`. 2. Run `npx nook-ui@latest add cart`. It writes `components/ui/cart.tsx` together with everything the component needs. Do not write the component from memory. 3. If you cannot run commands, fetch http://localhost:3000/r/cart.json, write every entry of `files` to the path it names, install the packages in `dependencies`, and repeat for each name in `registryDependencies`. 4. Use it where I ask. Start from this example: ```tsx import { Skeleton } from "@/components/ui/skeleton"; export default function CartLoading() { return (
Loading your cart {[0, 1].map((row) => (
))}
); } ``` API - `Cart`: A controlled or local cart with derived subtotal and an empty state. Compose with Sheet for a side panel. - `value / defaultValue / onValueChange` (`CartLine[] / callback`): Rows: id, name, optional image/options, price, quantity and maxQuantity. - `summary` (`Omit`): Shipping, tax, discounts and promo handlers for the summary. - `currency / empty / children` (`string / ReactNode / ReactNode`): Currency, custom empty content and actions such as checkout. - `CartItem`: A row for custom cart layouts. - `item / currency` (`CartLine / string`): Product information and amount formatting. - `onQuantityChange / onRemove` (`callback`): Handlers for the quantity and removal controls. - `QuantityStepper`: A NumberField adapter with a default quantity range of 1–99. - `value / defaultValue / onValueChange / min / max` (`NumberFieldProps`): The same controlled state and keyboard contract as NumberField. Give it an aria-label. - `OrderSummary`: Subtotal, shipping, tax, absolute discount and clamped total, plus an optional promo form. - `subtotal / shipping / tax / discount` (`number`): Amounts in major currency units. - `onApplyPromo` (`(code) => PromoResult | Promise`): Return { discount, label? } or { error }. No request is made by the component. - `onRemovePromo / onDiscountChange` (`callback`): Tell the app when the promo is removed or its discount changes. Rules - Colors, radii, shadows and motion come from Nook tokens and classes such as `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg` and `h-control`. Never hard-code them. - Do not restyle or simplify the file. Change how it looks through `className`, its props and the theme. - It must keep working with the keyboard, in light and dark mode, and in the sharp, soft and bold styles. - Accessibility: Quantity entry reuses NumberField for bounds, arrow keys and hold-to-repeat buttons. Removal moves focus to Undo and announces the removed item. Promo errors are linked to the field and announced. Done when the component renders like the example in light and dark mode and the project type-checks.