diff --git a/.changeset/add-to-cart-reasons.md b/.changeset/add-to-cart-reasons.md new file mode 100644 index 00000000..33304c35 --- /dev/null +++ b/.changeset/add-to-cart-reasons.md @@ -0,0 +1,5 @@ +--- +"@godaddy/gd-commerce-storefront": minor +--- + +`AddToCartButton` now says why it is disabled through its accessible description: more than the available stock, a quantity that is not a whole number of 1 or more, the cart still loading, the store connecting, the store not reachable, or no store connected. `ProductDetailsQuantity` shows the quantity message under the field and marks the field invalid. A SKU whose available count is negative (oversold) now counts as sold out, like a count of 0. Default rendering is unchanged for quantities that can be added. diff --git a/.changeset/catalog-header-deprecation.md b/.changeset/catalog-header-deprecation.md new file mode 100644 index 00000000..f7be1d5a --- /dev/null +++ b/.changeset/catalog-header-deprecation.md @@ -0,0 +1,5 @@ +--- +"@godaddy/gd-commerce-storefront": patch +--- + +Deprecate `Catalog`'s `title`, `description` and `showHeader` props. They still work. Compose `CatalogRoot` with `` instead, or leave `CatalogHeader` out when the page renders its own H1. Catalog loading placeholders now render inside the `CatalogProducts` element, so they follow the host's grid. The packaged catalog's placeholders now use its loaded spacing from the `lg` breakpoint, 32px between cards and 40px above and below, instead of 24px and 32px. diff --git a/.changeset/composable-cart.md b/.changeset/composable-cart.md new file mode 100644 index 00000000..292d7604 --- /dev/null +++ b/.changeset/composable-cart.md @@ -0,0 +1,5 @@ +--- +"@godaddy/gd-commerce-storefront": minor +--- + +Add composable cart parts. `CartDrawerRoot` builds a custom cart drawer and `CartRoot` builds a cart page, both from the same parts: `CartTitle`, `CartDescription`, `CartClose`, `CartNotices`, `CartItems`, `CartEmpty`, `CartSummary`, `CartSubtotal`, `CartCheckoutNote` and `CartCheckout`. `CartItems` renders its child as the item for every line, built from `CartItemRoot` with `CartItemImage`, `CartItemName`, `CartItemOptions`, `CartItemPrice`, `CartItemQuantity` and `CartItemRemove`. `useCart` reads the cart anywhere inside the provider, for example for a custom cart button, and `useCartItem` reads one line. `CommerceProvider` and `CommerceStorefront` take an optional `onItemAdded` callback, called after every live or sample add, so a site with a cart page can confirm adds. An add now opens the drawer only when a `CartDrawer` or `CartDrawerRoot` is mounted. Without one, `open` stays `false` and `CartButton` does nothing. Every action still goes through the shared cart queue, and the sample cart never reaches the store. `CartDrawer` is now composed from these parts. Visual change: the packaged drawer now shows the 1px divider between cart lines that it always declared, which the CSS reset hid. The `commerce-cart-checkout-adjustments-note` class moved from the note's paragraph to its outer element, so hiding it also removes its spacing. Markup changes: each part has a wrapper `
`, the line list is a `role="list"` element instead of a `