@shophost/react 2.0.55 → 2.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/admin-client.js CHANGED
@@ -1200,7 +1200,7 @@ const Sc = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
1200
1200
  const { t: d } = it();
1201
1201
  return e(im, { children: ({ isOpen: m, onClose: u, product: g, modifierGroups: p, quantity: h, onIncrement: y, onDecrement: b, isDecrementDisabled: w, isIncrementDisabled: f, isSubmitting: x, isOutOfStock: k, maxQuantity: N, onAddToCart: C, onQuantityInput: M, stockMessage: U, validationError: H }) => e(Or, { open: m, onOpenChange: (J) => {
1202
1202
  J || u();
1203
- }, children: i(Lr, { className: v("w-[calc(100vw)] max-w-[calc(100vw)] sm:max-w-md max-h-[75vh] sm:max-h-[90vh] overflow-x-hidden overflow-y-auto p-0", "top-auto left-1/2 right-auto bottom-0 -translate-x-1/2 translate-y-0 rounded-t-xl rounded-b-none border-none", "sm:top-1/2 sm:left-1/2 sm:right-auto sm:bottom-auto sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-xl sm:border", r), children: [o ? o({ onClose: u, product: g }) : i("div", { className: "flex justify-between items-start pb-3", children: [e("div", { className: "absolute left-1/2 -translate-x-1/2 top-2 w-12 h-1.5 bg-gray-300 rounded-full sm:hidden" }), i("div", { children: [e(os, { className: "text-2xl font-black font-red-hat-display", children: g.title }), e("p", { className: "text-sm text-gray-500", children: g.description })] }), e("button", { type: "button", onClick: u, className: "cursor-pointer text-gray-500 hover:text-gray-700 text-2xl leading-none", "aria-label": "Close modal", children: "×" })] }), p.length > 0 ? i("div", { children: [p.map((J) => e(nm, { group: J, renderOptions: () => J.modifiers.map((S) => e(sm, { modifier: S, groupId: J.id, children: (P) => l ? l(P) : i("div", { className: v("mb-1.5 flex cursor-pointer items-center rounded-lg border px-3 py-2 text-sm font-medium text-gray-600 dark:text-gray-400", P.isSelected ? "border-blue-500 bg-blue-50" : "border-gray-200"), onClick: P.onSelect, children: [e("input", { type: P.isMultiSelect ? "checkbox" : "radio", checked: P.isSelected, className: "mr-2", onChange: (ne) => ne.preventDefault() }), i("span", { children: [P.modifier.title, P.formattedPrice] })] }) }, S.id)), children: (S) => s ? s(S) : i("div", { className: "mb-3", children: [i("div", { className: "font-medium mb-2", children: [i("div", { className: "flex items-center font-black font-red-hat-display text-lg", children: [S.groupName, S.isRequired && e("span", { className: "text-red-500 ml-1", children: "*" })] }), S.selectionRequirements && i("span", { className: "text-sm text-gray-600 dark:text-gray-400", children: ["Select ", S.selectionRequirements] })] }), e("div", { children: S.renderOptions() })] }) }, J.id)), (H || U) && e("div", { className: "mb-2 text-sm text-red-500", children: H || U })] }) : t, n ? n({ isDecrementDisabled: w, isIncrementDisabled: f, isSubmitting: x, isOutOfStock: k, maxQuantity: N, onAddToCart: C, onDecrement: b, onIncrement: y, onQuantityInput: M, quantity: h, stockMessage: U, validationError: H }) : i("div", { className: "flex items-center mt-8 border-t pt-4", children: [e("div", { children: i("div", { className: "flex items-center justify-center gap-2.5", children: [e("button", { type: "button", onClick: b, className: v("flex h-9 min-w-9 items-center justify-center rounded-lg border text-base", w || x ? "cursor-not-allowed opacity-50" : "cursor-pointer"), "aria-label": "Decrease quantity", disabled: w || x, children: "-" }), e(je, { min: 1, max: k ? 1 : N ?? void 0, step: 1, value: h, onChange: (J) => M(J.target.value), disabled: x, inputClassName: "h-9 px-2 text-center", className: "max-w-10 min-w-10", "aria-label": "Quantity" }), e("button", { type: "button", onClick: y, className: v("flex h-9 min-w-9 items-center justify-center rounded-lg border text-base", f || x ? "cursor-not-allowed opacity-50" : "cursor-pointer"), "aria-label": "Increase quantity", disabled: f || x, children: "+" })] }) }), e("div", { className: "pl-4 sm:pl-5 w-full", children: e("button", { type: "button", onClick: C, className: "storefront-primary-action btn text-sm rounded-lg w-full", disabled: k || x, children: x ? i("span", { className: "inline-flex items-center justify-center gap-2", children: [e(Sr, { className: "size-4 animate-spin", "aria-hidden": "true" }), d("common.loading")] }) : k ? "Out of stock" : a }) })] })] }) }) });
1203
+ }, children: i(Lr, { className: v("w-[calc(100vw)] max-w-[calc(100vw)] sm:max-w-md max-h-[75vh] sm:max-h-[90vh] overflow-x-hidden overflow-y-auto p-0 h-min", "top-auto left-1/2 right-auto bottom-0 -translate-x-1/2 translate-y-0 rounded-t-xl rounded-b-none border-none", "sm:top-1/2 sm:left-1/2 sm:right-auto sm:bottom-auto sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-xl sm:border", r), children: [o ? o({ onClose: u, product: g }) : i("div", { className: "flex justify-between items-start pb-3", children: [e("div", { className: "absolute left-1/2 -translate-x-1/2 top-2 w-12 h-1.5 bg-gray-300 rounded-full sm:hidden" }), i("div", { children: [e(os, { className: "text-2xl font-black font-red-hat-display", children: g.title }), e("p", { className: "text-sm text-gray-500", children: g.description })] }), e("button", { type: "button", onClick: u, className: "cursor-pointer text-gray-500 hover:text-gray-700 text-2xl leading-none", "aria-label": "Close modal", children: "×" })] }), p.length > 0 ? i("div", { children: [p.map((J) => e(nm, { group: J, renderOptions: () => J.modifiers.map((S) => e(sm, { modifier: S, groupId: J.id, children: (P) => l ? l(P) : i("div", { className: v("mb-1.5 flex cursor-pointer items-center rounded-lg border px-3 py-2 text-sm font-medium text-gray-600 dark:text-gray-400", P.isSelected ? "border-blue-500 bg-blue-50" : "border-gray-200"), onClick: P.onSelect, children: [e("input", { type: P.isMultiSelect ? "checkbox" : "radio", checked: P.isSelected, className: "mr-2", onChange: (ne) => ne.preventDefault() }), i("span", { children: [P.modifier.title, P.formattedPrice] })] }) }, S.id)), children: (S) => s ? s(S) : i("div", { className: "mb-3", children: [i("div", { className: "font-medium mb-2", children: [i("div", { className: "flex items-center font-black font-red-hat-display text-lg", children: [S.groupName, S.isRequired && e("span", { className: "text-red-500 ml-1", children: "*" })] }), S.selectionRequirements && i("span", { className: "text-sm text-gray-600 dark:text-gray-400", children: ["Select ", S.selectionRequirements] })] }), e("div", { children: S.renderOptions() })] }) }, J.id)), (H || U) && e("div", { className: "mb-2 text-sm text-red-500", children: H || U })] }) : t, n ? n({ isDecrementDisabled: w, isIncrementDisabled: f, isSubmitting: x, isOutOfStock: k, maxQuantity: N, onAddToCart: C, onDecrement: b, onIncrement: y, onQuantityInput: M, quantity: h, stockMessage: U, validationError: H }) : i("div", { className: "flex items-center mt-8 border-t pt-4", children: [e("div", { children: i("div", { className: "flex items-center justify-center gap-2.5", children: [e("button", { type: "button", onClick: b, className: v("flex h-9 min-w-9 items-center justify-center rounded-lg border text-base", w || x ? "cursor-not-allowed opacity-50" : "cursor-pointer"), "aria-label": "Decrease quantity", disabled: w || x, children: "-" }), e(je, { min: 1, max: k ? 1 : N ?? void 0, step: 1, value: h, onChange: (J) => M(J.target.value), disabled: x, inputClassName: "h-9 px-2 text-center", className: "max-w-10 min-w-10", "aria-label": "Quantity" }), e("button", { type: "button", onClick: y, className: v("flex h-9 min-w-9 items-center justify-center rounded-lg border text-base", f || x ? "cursor-not-allowed opacity-50" : "cursor-pointer"), "aria-label": "Increase quantity", disabled: f || x, children: "+" })] }) }), e("div", { className: "pl-4 sm:pl-5 w-full", children: e("button", { type: "button", onClick: C, className: "storefront-primary-action btn text-sm rounded-lg w-full", disabled: k || x, children: x ? i("span", { className: "inline-flex items-center justify-center gap-2", children: [e(Sr, { className: "size-4 animate-spin", "aria-hidden": "true" }), d("common.loading")] }) : k ? "Out of stock" : a }) })] })] }) }) });
1204
1204
  }, H0 = ({ children: a, minQuantity: t = 1 }) => {
1205
1205
  const { quantity: r, handleIncrement: n, handleDecrement: s, handleQuantityInput: o, isIncrementDisabled: l } = Ut(), d = r <= t;
1206
1206
  return a({ quantity: r, onIncrement: n, onDecrement: s, onQuantityInput: o, isDecrementDisabled: d, isIncrementDisabled: l });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shophost/react",
3
- "version": "2.0.55",
3
+ "version": "2.0.56",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.mjs",
@@ -82,8 +82,8 @@
82
82
  "@react-aria/datepicker": "^3.16.1",
83
83
  "@react-stately/datepicker": "^3.16.1",
84
84
  "@remixicon/react": "^4.6.0",
85
- "@shophost/client": "^2.0.55",
86
- "@shophost/rest-api": "^2.0.55",
85
+ "@shophost/client": "^2.0.56",
86
+ "@shophost/rest-api": "^2.0.56",
87
87
  "@tanstack/react-query": "^5.67.2",
88
88
  "@tanstack/react-table": "^8.21.3",
89
89
  "@vercel/blob": "^0.27.2",