@nextblock-cms/ecom 0.20.1 → 0.21.0
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/_virtual/_rolldown/runtime.cjs.js +1 -0
- package/index.cjs.js +1 -1
- package/index.es.js +38 -146
- package/lib/CurrencyProvider.cjs.js +1 -1
- package/lib/CurrencyProvider.d.ts +1 -1
- package/lib/CurrencyProvider.es.js +85 -95
- package/lib/PaymentReadinessProvider.cjs.js +1 -1
- package/lib/PaymentReadinessProvider.d.ts +1 -1
- package/lib/PaymentReadinessProvider.es.js +24 -27
- package/lib/cart-store.cjs.js +1 -1
- package/lib/cart-store.es.js +109 -121
- package/lib/components/AccountNavigationMenu.cjs.js +1 -1
- package/lib/components/AccountNavigationMenu.d.ts +1 -1
- package/lib/components/AccountNavigationMenu.es.js +36 -50
- package/lib/components/AddToCartButton.cjs.js +1 -1
- package/lib/components/AddToCartButton.d.ts +1 -1
- package/lib/components/AddToCartButton.es.js +94 -89
- package/lib/components/Cart.cjs.js +1 -1
- package/lib/components/Cart.d.ts +1 -1
- package/lib/components/Cart.es.js +261 -180
- package/lib/components/CartDrawer.cjs.js +1 -1
- package/lib/components/CartDrawer.d.ts +1 -1
- package/lib/components/CartDrawer.es.js +218 -148
- package/lib/components/CartIcon.cjs.js +1 -1
- package/lib/components/CartIcon.d.ts +1 -1
- package/lib/components/CartIcon.es.js +33 -35
- package/lib/components/Checkout.cjs.js +1 -1
- package/lib/components/Checkout.d.ts +1 -1
- package/lib/components/Checkout.es.js +1092 -1108
- package/lib/components/CouponForm.cjs.js +1 -1
- package/lib/components/CouponForm.d.ts +1 -1
- package/lib/components/CouponForm.es.js +136 -148
- package/lib/components/CurrencySwitcher.cjs.js +1 -1
- package/lib/components/CurrencySwitcher.d.ts +1 -1
- package/lib/components/CurrencySwitcher.es.js +22 -18
- package/lib/components/CustomerProfileForm.cjs.js +1 -1
- package/lib/components/CustomerProfileForm.es.js +454 -313
- package/lib/components/FeaturedProduct.cjs.js +1 -1
- package/lib/components/FeaturedProduct.d.ts +1 -1
- package/lib/components/FeaturedProduct.es.js +98 -83
- package/lib/components/FreemiusLicensePanel.cjs.js +1 -1
- package/lib/components/FreemiusLicensePanel.d.ts +1 -1
- package/lib/components/FreemiusLicensePanel.es.js +70 -65
- package/lib/components/InvoiceDocument.cjs.js +1 -1
- package/lib/components/InvoiceDocument.es.js +256 -192
- package/lib/components/InvoiceViewerShell.cjs.js +2 -2
- package/lib/components/InvoiceViewerShell.d.ts +1 -1
- package/lib/components/InvoiceViewerShell.es.js +75 -106
- package/lib/components/ProductCard.cjs.js +1 -1
- package/lib/components/ProductCard.d.ts +1 -1
- package/lib/components/ProductCard.es.js +186 -171
- package/lib/components/ProductDetailsLayout.cjs.js +1 -1
- package/lib/components/ProductDetailsLayout.es.js +405 -404
- package/lib/components/ProductGallery.cjs.js +1 -1
- package/lib/components/ProductGallery.d.ts +1 -1
- package/lib/components/ProductGallery.es.js +51 -54
- package/lib/components/ProductGrid.cjs.js +1 -1
- package/lib/components/ProductGrid.d.ts +1 -1
- package/lib/components/ProductGrid.es.js +23 -25
- package/lib/components/ShippingEstimator.cjs.js +1 -1
- package/lib/components/ShippingEstimator.d.ts +1 -1
- package/lib/components/ShippingEstimator.es.js +158 -153
- package/lib/components/ShortDescription.cjs.js +1 -1
- package/lib/components/ShortDescription.es.js +17 -17
- package/lib/components/SimpleTiptapRenderer.cjs.js +1 -1
- package/lib/components/SimpleTiptapRenderer.es.js +238 -211
- package/lib/components/SubscriptionSelector.cjs.js +1 -1
- package/lib/components/SubscriptionSelector.es.js +159 -154
- package/lib/countries.cjs.js +1 -1
- package/lib/countries.es.js +232 -75
- package/lib/coupon-server.cjs.js +1 -1
- package/lib/coupon-server.es.js +180 -224
- package/lib/coupons.cjs.js +1 -1
- package/lib/coupons.es.js +12 -14
- package/lib/currency-constants.cjs.js +1 -1
- package/lib/currency-constants.es.js +4 -4
- package/lib/currency-rest-client.cjs.js +1 -1
- package/lib/currency-rest-client.es.js +15 -22
- package/lib/currency-store.cjs.js +1 -1
- package/lib/currency-store.es.js +20 -27
- package/lib/currency-sync.cjs.js +1 -1
- package/lib/currency-sync.es.js +124 -170
- package/lib/currency.cjs.js +1 -1
- package/lib/currency.es.js +242 -310
- package/lib/customer-addresses.cjs.js +1 -1
- package/lib/customer-addresses.es.js +80 -109
- package/lib/customer-orders.cjs.js +1 -1
- package/lib/customer-orders.es.js +31 -43
- package/lib/customer.cjs.js +1 -1
- package/lib/customer.es.js +43 -52
- package/lib/export-helpers.cjs.js +1 -1
- package/lib/export-helpers.es.js +53 -52
- package/lib/factory.cjs.js +1 -1
- package/lib/factory.es.js +10 -7
- package/lib/freemius-coupons.cjs.js +1 -1
- package/lib/freemius-coupons.es.js +245 -262
- package/lib/freemius-license-claim.cjs.js +1 -1
- package/lib/freemius-license-claim.es.js +87 -71
- package/lib/freemius-license.cjs.js +1 -1
- package/lib/freemius-license.es.js +32 -39
- package/lib/freemius-order-sync.cjs.js +1 -1
- package/lib/freemius-order-sync.es.js +226 -290
- package/lib/freemius-trial-provision.cjs.js +1 -1
- package/lib/freemius-trial-provision.es.js +136 -130
- package/lib/inventory-settings.cjs.js +1 -1
- package/lib/inventory-settings.es.js +69 -77
- package/lib/invoice-server.cjs.js +3 -3
- package/lib/invoice-server.es.js +94 -141
- package/lib/invoice-ui.cjs.js +1 -1
- package/lib/invoice-ui.es.js +50 -66
- package/lib/invoice.cjs.js +1 -1
- package/lib/invoice.es.js +85 -94
- package/lib/order-inventory.cjs.js +25 -25
- package/lib/order-inventory.es.js +67 -79
- package/lib/order-tax-details.cjs.js +1 -1
- package/lib/order-tax-details.es.js +142 -153
- package/lib/pages/cms/coupons/CouponEditorForm.cjs.js +1 -1
- package/lib/pages/cms/coupons/CouponEditorForm.d.ts +1 -1
- package/lib/pages/cms/coupons/CouponEditorForm.es.js +227 -185
- package/lib/pages/cms/coupons/CouponsPage.cjs.js +2 -2
- package/lib/pages/cms/coupons/CouponsPage.d.ts +1 -1
- package/lib/pages/cms/coupons/CouponsPage.es.js +235 -166
- package/lib/pages/cms/coupons/CreateCouponDialog.cjs.js +1 -1
- package/lib/pages/cms/coupons/CreateCouponDialog.d.ts +1 -1
- package/lib/pages/cms/coupons/CreateCouponDialog.es.js +35 -34
- package/lib/pages/cms/coupons/EditCouponPage.cjs.js +1 -1
- package/lib/pages/cms/coupons/EditCouponPage.d.ts +1 -1
- package/lib/pages/cms/coupons/EditCouponPage.es.js +47 -47
- package/lib/pages/cms/coupons/ProductScopePicker.cjs.js +1 -1
- package/lib/pages/cms/coupons/ProductScopePicker.d.ts +1 -1
- package/lib/pages/cms/coupons/ProductScopePicker.es.js +128 -117
- package/lib/pages/cms/coupons/actions.cjs.js +1 -1
- package/lib/pages/cms/coupons/actions.es.js +112 -115
- package/lib/pages/cms/coupons/index.cjs.js +1 -0
- package/lib/pages/cms/coupons/index.es.js +3 -0
- package/lib/pages/cms/coupons/product-options.cjs.js +1 -1
- package/lib/pages/cms/coupons/product-options.es.js +21 -23
- package/lib/pages/cms/orders/ExportReportsDialog.cjs.js +1 -1
- package/lib/pages/cms/orders/ExportReportsDialog.es.js +135 -129
- package/lib/pages/cms/orders/MarkPaidButton.d.ts +1 -1
- package/lib/pages/cms/orders/OrderDetailPage.cjs.js +1 -1
- package/lib/pages/cms/orders/OrderDetailPage.d.ts +1 -1
- package/lib/pages/cms/orders/OrderDetailPage.es.js +186 -134
- package/lib/pages/cms/orders/OrderPrintButton.cjs.js +1 -1
- package/lib/pages/cms/orders/OrderPrintButton.d.ts +1 -1
- package/lib/pages/cms/orders/OrderPrintButton.es.js +15 -21
- package/lib/pages/cms/orders/OrderStatusForm.cjs.js +1 -1
- package/lib/pages/cms/orders/OrderStatusForm.d.ts +1 -1
- package/lib/pages/cms/orders/OrderStatusForm.es.js +85 -69
- package/lib/pages/cms/orders/OrdersPage.cjs.js +1 -1
- package/lib/pages/cms/orders/OrdersPage.d.ts +1 -1
- package/lib/pages/cms/orders/OrdersPage.es.js +170 -102
- package/lib/pages/cms/orders/actions.cjs.js +3 -3
- package/lib/pages/cms/orders/actions.es.js +53 -69
- package/lib/pages/cms/orders/export-actions.cjs.js +1 -1
- package/lib/pages/cms/orders/export-actions.es.js +23 -26
- package/lib/pages/cms/orders/index.cjs.js +1 -0
- package/lib/pages/cms/orders/index.es.js +6 -0
- package/lib/pages/cms/orders/server-actions.cjs.js +1 -1
- package/lib/pages/cms/orders/server-actions.es.js +60 -51
- package/lib/pages/cms/payments/PaymentsClient.cjs.js +1 -1
- package/lib/pages/cms/payments/PaymentsClient.d.ts +1 -1
- package/lib/pages/cms/payments/PaymentsClient.es.js +316 -346
- package/lib/pages/cms/payments/PaymentsPage.cjs.js +1 -1
- package/lib/pages/cms/payments/PaymentsPage.d.ts +1 -1
- package/lib/pages/cms/payments/PaymentsPage.es.js +29 -32
- package/lib/pages/cms/payments/actions.cjs.js +1 -1
- package/lib/pages/cms/payments/actions.es.js +38 -48
- package/lib/pages/cms/payments/index.cjs.js +1 -0
- package/lib/pages/cms/payments/index.es.js +3 -0
- package/lib/pages/cms/payments/queries.cjs.js +1 -1
- package/lib/pages/cms/payments/queries.es.js +38 -48
- package/lib/pages/cms/products/ProductsPage.cjs.js +1 -1
- package/lib/pages/cms/products/ProductsPage.d.ts +1 -1
- package/lib/pages/cms/products/ProductsPage.es.js +63 -66
- package/lib/pages/cms/products/[id]/edit/EditProductPage.d.ts +1 -1
- package/lib/pages/cms/products/_id_/edit/EditProductPage.cjs.js +1 -1
- package/lib/pages/cms/products/_id_/edit/EditProductPage.es.js +138 -155
- package/lib/pages/cms/products/actions.cjs.js +4 -4
- package/lib/pages/cms/products/actions.es.js +121 -162
- package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs.js +1 -1
- package/lib/pages/cms/products/attributes/AttributeManagementPage.d.ts +1 -1
- package/lib/pages/cms/products/attributes/AttributeManagementPage.es.js +55 -47
- package/lib/pages/cms/products/attributes/components/AttributeManager.cjs.js +1 -1
- package/lib/pages/cms/products/attributes/components/AttributeManager.d.ts +1 -1
- package/lib/pages/cms/products/attributes/components/AttributeManager.es.js +285 -290
- package/lib/pages/cms/products/categories/CategoryManagementPage.cjs.js +1 -1
- package/lib/pages/cms/products/categories/CategoryManagementPage.d.ts +1 -1
- package/lib/pages/cms/products/categories/CategoryManagementPage.es.js +43 -35
- package/lib/pages/cms/products/categories/components/CategoryManager.cjs.js +1 -1
- package/lib/pages/cms/products/categories/components/CategoryManager.es.js +315 -262
- package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs.js +1 -1
- package/lib/pages/cms/products/components/CopyProductFromLanguage.es.js +115 -113
- package/lib/pages/cms/products/components/CurrencyPriceFields.cjs.js +1 -1
- package/lib/pages/cms/products/components/CurrencyPriceFields.d.ts +1 -1
- package/lib/pages/cms/products/components/CurrencyPriceFields.es.js +136 -145
- package/lib/pages/cms/products/components/DeleteProductButton.cjs.js +1 -1
- package/lib/pages/cms/products/components/DeleteProductButton.d.ts +1 -1
- package/lib/pages/cms/products/components/DeleteProductButton.es.js +35 -47
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.cjs.js +1 -1
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.d.ts +1 -1
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.es.js +106 -84
- package/lib/pages/cms/products/components/ProductCategorySelector.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductCategorySelector.es.js +156 -159
- package/lib/pages/cms/products/components/ProductForm.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductForm.es.js +872 -693
- package/lib/pages/cms/products/components/ProductMediaManager.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductMediaManager.es.js +106 -103
- package/lib/pages/cms/products/components/ProductsBulkTable.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductsBulkTable.d.ts +1 -1
- package/lib/pages/cms/products/components/ProductsBulkTable.es.js +303 -294
- package/lib/pages/cms/products/components/SaleScheduleFields.cjs.js +1 -1
- package/lib/pages/cms/products/components/SaleScheduleFields.d.ts +1 -1
- package/lib/pages/cms/products/components/SaleScheduleFields.es.js +111 -134
- package/lib/pages/cms/products/components/SyncFreemiusButton.cjs.js +1 -1
- package/lib/pages/cms/products/components/SyncFreemiusButton.d.ts +1 -1
- package/lib/pages/cms/products/components/SyncFreemiusButton.es.js +29 -35
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.cjs.js +2 -2
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.d.ts +1 -1
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.es.js +36 -48
- package/lib/pages/cms/products/components/SyncProductForm.d.ts +1 -1
- package/lib/pages/cms/products/components/VariationsEditor.cjs.js +1 -1
- package/lib/pages/cms/products/components/VariationsEditor.d.ts +1 -1
- package/lib/pages/cms/products/components/VariationsEditor.es.js +396 -405
- package/lib/pages/cms/products/index.cjs.js +1 -0
- package/lib/pages/cms/products/index.es.js +8 -0
- package/lib/pages/cms/products/inventory/InventoryPage.cjs.js +1 -1
- package/lib/pages/cms/products/inventory/InventoryPage.d.ts +1 -1
- package/lib/pages/cms/products/inventory/InventoryPage.es.js +21 -15
- package/lib/pages/cms/products/inventory/InventoryTableClient.cjs.js +2 -2
- package/lib/pages/cms/products/inventory/InventoryTableClient.d.ts +1 -1
- package/lib/pages/cms/products/inventory/InventoryTableClient.es.js +230 -209
- package/lib/pages/cms/products/inventory/actions.cjs.js +3 -3
- package/lib/pages/cms/products/inventory/actions.es.js +83 -91
- package/lib/pages/cms/products/new/NewProductPage.cjs.js +1 -1
- package/lib/pages/cms/products/new/NewProductPage.d.ts +1 -1
- package/lib/pages/cms/products/new/NewProductPage.es.js +58 -74
- package/lib/pages/cms/products/product-price-sync.cjs.js +1 -1
- package/lib/pages/cms/products/product-price-sync.es.js +74 -89
- package/lib/pages/cms/products/server-actions.cjs.js +1 -1
- package/lib/pages/cms/products/server-actions.es.js +250 -233
- package/lib/pages/cms/shipping/ShippingPage.cjs.js +2 -2
- package/lib/pages/cms/shipping/ShippingPage.es.js +287 -209
- package/lib/pages/cms/shipping/components/RateForm.cjs.js +1 -1
- package/lib/pages/cms/shipping/components/RateForm.d.ts +1 -1
- package/lib/pages/cms/shipping/components/RateForm.es.js +439 -436
- package/lib/pages/cms/shipping/components/ZoneForm.cjs.js +1 -1
- package/lib/pages/cms/shipping/components/ZoneForm.es.js +245 -224
- package/lib/pages/cms/shipping/index.cjs.js +1 -0
- package/lib/pages/cms/shipping/index.es.js +3 -0
- package/lib/pages/cms/shipping/server-actions.cjs.js +1 -1
- package/lib/pages/cms/shipping/server-actions.es.js +131 -149
- package/lib/pages/cms/taxes/TaxesPage.cjs.js +1 -1
- package/lib/pages/cms/taxes/TaxesPage.d.ts +1 -1
- package/lib/pages/cms/taxes/TaxesPage.es.js +211 -169
- package/lib/pages/cms/taxes/actions.cjs.js +1 -1
- package/lib/pages/cms/taxes/actions.es.js +41 -53
- package/lib/pages/cms/taxes/components/TaxRateForm.cjs.js +1 -1
- package/lib/pages/cms/taxes/components/TaxRateForm.d.ts +1 -1
- package/lib/pages/cms/taxes/components/TaxRateForm.es.js +112 -99
- package/lib/pages/cms/taxes/index.cjs.js +1 -0
- package/lib/pages/cms/taxes/index.es.js +3 -0
- package/lib/payment-config.cjs.js +1 -1
- package/lib/payment-config.es.js +110 -126
- package/lib/product-actions.cjs.js +4 -4
- package/lib/product-actions.es.js +289 -544
- package/lib/product-context.cjs.js +1 -1
- package/lib/product-context.es.js +13 -15
- package/lib/product-schema.cjs.js +1 -1
- package/lib/product-schema.es.js +99 -134
- package/lib/providers/freemius.cjs.js +1 -5
- package/lib/providers/freemius.es.js +446 -530
- package/lib/providers/stripe.cjs.js +1 -1
- package/lib/providers/stripe.es.js +417 -477
- package/lib/server-actions/coupon-actions.cjs.js +1 -1
- package/lib/server-actions/coupon-actions.es.js +22 -22
- package/lib/server-actions/customer-actions.cjs.js +1 -1
- package/lib/server-actions/customer-actions.es.js +26 -28
- package/lib/server-actions/product-actions.cjs.js +1 -1
- package/lib/server-actions/product-actions.es.js +9 -15
- package/lib/server-actions/shipping-actions.cjs.js +1 -1
- package/lib/server-actions/shipping-actions.es.js +27 -24
- package/lib/server-actions/tax-actions.cjs.js +1 -1
- package/lib/server-actions/tax-actions.es.js +33 -39
- package/lib/shared-inventory.cjs.js +2 -2
- package/lib/shared-inventory.es.js +111 -160
- package/lib/shipping/resolver.cjs.js +2 -2
- package/lib/shipping/resolver.es.js +44 -61
- package/lib/shipping-rate-currency.cjs.js +1 -1
- package/lib/shipping-rate-currency.es.js +52 -67
- package/lib/states.cjs.js +1 -1
- package/lib/states.es.js +333 -154
- package/lib/stripe/checkout.cjs.js +1 -1
- package/lib/stripe/checkout.es.js +125 -181
- package/lib/stripe/client.cjs.js +1 -1
- package/lib/stripe/client.es.js +14 -19
- package/lib/stripe/order-sync.cjs.js +1 -1
- package/lib/stripe/order-sync.es.js +106 -126
- package/lib/stripe/webhooks.cjs.js +1 -1
- package/lib/stripe/webhooks.es.js +37 -31
- package/lib/tax-calculation.cjs.js +1 -1
- package/lib/tax-calculation.es.js +84 -98
- package/lib/trials.cjs.js +1 -1
- package/lib/trials.es.js +24 -30
- package/lib/types.cjs.js +1 -1
- package/lib/types.es.js +21 -27
- package/lib/use-cart.cjs.js +1 -1
- package/lib/use-cart.es.js +38 -40
- package/lib/use-price-formatter.cjs.js +1 -1
- package/lib/use-price-formatter.es.js +10 -11
- package/lib/variation-utils.cjs.js +1 -1
- package/lib/variation-utils.es.js +199 -261
- package/lib/zod-config.cjs.js +1 -1
- package/lib/zod-config.es.js +5 -6
- package/package.json +16 -16
- package/server.cjs.js +1 -1
- package/server.es.js +56 -211
|
@@ -1 +1 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";const e=require("../invoice-ui.cjs.js");let t=require("react"),n=require("@nextblock-cms/utils"),r=require("react/jsx-runtime");var i=({images:i=[],className:a})=>{let{t:o}=(0,n.useTranslations)(),[s,c]=(0,t.useState)(0);if(!i.length)return(0,r.jsx)(`div`,{className:(0,n.cn)(`relative aspect-square w-full overflow-hidden rounded-lg bg-secondary`,a),children:(0,r.jsx)(`div`,{className:`flex h-full items-center justify-center text-muted-foreground`,children:e.translateOrFallback(o,`ecommerce.no_image`,`No image`)})});let l=s<i.length?s:0,u=i[l];return(0,r.jsxs)(`div`,{className:(0,n.cn)(`flex flex-col gap-4`,a),children:[(0,r.jsx)(`div`,{className:`relative aspect-square w-full overflow-hidden rounded-lg border bg-white`,children:(0,r.jsx)(`img`,{src:u.url,alt:u.alt??``,width:u.width??1e3,height:u.height??1e3,fetchPriority:`high`,decoding:`async`,className:`h-full w-full object-cover object-center`})}),i.length>1&&(0,r.jsx)(`div`,{className:`flex gap-4 overflow-x-auto p-1 pb-2`,children:i.map((t,a)=>(0,r.jsx)(`button`,{type:`button`,onClick:()=>c(a),"aria-current":l===a?`true`:void 0,"aria-label":e.translateOrFallback(o,`ecommerce.gallery_show_image`,`Show image {index} of {total}`).replace(`{index}`,String(a+1)).replace(`{total}`,String(i.length)),className:(0,n.cn)(`relative aspect-square w-20 flex-shrink-0 overflow-hidden rounded-md border focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring`,l===a?`ring-2 ring-primary`:`ring-1 ring-transparent hover:ring-primary/50`),children:(0,r.jsx)(`img`,{src:t.url,alt:``,width:80,height:80,loading:`lazy`,decoding:`async`,className:`h-full w-full object-cover object-center`})},a))})]})};exports.ProductGallery=i;
|
|
@@ -7,5 +7,5 @@ interface ProductGalleryProps {
|
|
|
7
7
|
}[];
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare const ProductGallery: ({ images, className }: ProductGalleryProps) => import(
|
|
10
|
+
export declare const ProductGallery: ({ images, className }: ProductGalleryProps) => import('react').JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,55 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
)) })
|
|
51
|
-
] });
|
|
52
|
-
};
|
|
53
|
-
export {
|
|
54
|
-
w as ProductGallery
|
|
1
|
+
"use client";
|
|
2
|
+
import { translateOrFallback as e } from "../invoice-ui.es.js";
|
|
3
|
+
import { useState as t } from "react";
|
|
4
|
+
import { cn as n, useTranslations as r } from "@nextblock-cms/utils";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
//#region libs/ecommerce/src/lib/components/ProductGallery.tsx
|
|
7
|
+
var o = ({ images: o = [], className: s }) => {
|
|
8
|
+
let { t: c } = r(), [l, u] = t(0);
|
|
9
|
+
if (!o.length) return /* @__PURE__ */ i("div", {
|
|
10
|
+
className: n("relative aspect-square w-full overflow-hidden rounded-lg bg-secondary", s),
|
|
11
|
+
children: /* @__PURE__ */ i("div", {
|
|
12
|
+
className: "flex h-full items-center justify-center text-muted-foreground",
|
|
13
|
+
children: e(c, "ecommerce.no_image", "No image")
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
let d = l < o.length ? l : 0, f = o[d];
|
|
17
|
+
return /* @__PURE__ */ a("div", {
|
|
18
|
+
className: n("flex flex-col gap-4", s),
|
|
19
|
+
children: [/* @__PURE__ */ i("div", {
|
|
20
|
+
className: "relative aspect-square w-full overflow-hidden rounded-lg border bg-white",
|
|
21
|
+
children: /* @__PURE__ */ i("img", {
|
|
22
|
+
src: f.url,
|
|
23
|
+
alt: f.alt ?? "",
|
|
24
|
+
width: f.width ?? 1e3,
|
|
25
|
+
height: f.height ?? 1e3,
|
|
26
|
+
fetchPriority: "high",
|
|
27
|
+
decoding: "async",
|
|
28
|
+
className: "h-full w-full object-cover object-center"
|
|
29
|
+
})
|
|
30
|
+
}), o.length > 1 && /* @__PURE__ */ i("div", {
|
|
31
|
+
className: "flex gap-4 overflow-x-auto p-1 pb-2",
|
|
32
|
+
children: o.map((t, r) => /* @__PURE__ */ i("button", {
|
|
33
|
+
type: "button",
|
|
34
|
+
onClick: () => u(r),
|
|
35
|
+
"aria-current": d === r ? "true" : void 0,
|
|
36
|
+
"aria-label": e(c, "ecommerce.gallery_show_image", "Show image {index} of {total}").replace("{index}", String(r + 1)).replace("{total}", String(o.length)),
|
|
37
|
+
className: n("relative aspect-square w-20 flex-shrink-0 overflow-hidden rounded-md border focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring", d === r ? "ring-2 ring-primary" : "ring-1 ring-transparent hover:ring-primary/50"),
|
|
38
|
+
children: /* @__PURE__ */ i("img", {
|
|
39
|
+
src: t.url,
|
|
40
|
+
alt: "",
|
|
41
|
+
width: 80,
|
|
42
|
+
height: 80,
|
|
43
|
+
loading: "lazy",
|
|
44
|
+
decoding: "async",
|
|
45
|
+
className: "h-full w-full object-cover object-center"
|
|
46
|
+
})
|
|
47
|
+
}, r))
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
55
50
|
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { o as ProductGallery };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./ProductCard.cjs.js");let t=require("@nextblock-cms/utils"),n=require("react/jsx-runtime");var r=({products:r,columns:i=3,className:a})=>{let{t:o}=(0,t.useTranslations)();if(!r.length){let e=o(`ecommerce.no_products_found`);return(0,n.jsx)(`div`,{className:`py-12 text-center text-muted-foreground`,children:e===`ecommerce.no_products_found`?`No products found.`:e})}return(0,n.jsx)(`div`,{className:(0,t.cn)(`grid gap-6 sm:grid-cols-2`,i===3&&`lg:grid-cols-3`,i===4&&`lg:grid-cols-4`,a),children:r.map((t,r)=>(0,n.jsx)(e.ProductCard,{product:t,priority:r<i},t.id))})};exports.ProductGrid=r;
|
|
@@ -4,5 +4,5 @@ interface ProductGridProps {
|
|
|
4
4
|
columns?: 2 | 3 | 4;
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const ProductGrid: ({ products, columns, className }: ProductGridProps) => import(
|
|
7
|
+
export declare const ProductGrid: ({ products, columns, className }: ProductGridProps) => import('react').JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
g as ProductGrid
|
|
1
|
+
"use client";
|
|
2
|
+
import { ProductCard as e } from "./ProductCard.es.js";
|
|
3
|
+
import { cn as t, useTranslations as n } from "@nextblock-cms/utils";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region libs/ecommerce/src/lib/components/ProductGrid.tsx
|
|
6
|
+
var i = ({ products: i, columns: a = 3, className: o }) => {
|
|
7
|
+
let { t: s } = n();
|
|
8
|
+
if (!i.length) {
|
|
9
|
+
let e = s("ecommerce.no_products_found");
|
|
10
|
+
return /* @__PURE__ */ r("div", {
|
|
11
|
+
className: "py-12 text-center text-muted-foreground",
|
|
12
|
+
children: e === "ecommerce.no_products_found" ? "No products found." : e
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return /* @__PURE__ */ r("div", {
|
|
16
|
+
className: t("grid gap-6 sm:grid-cols-2", a === 3 && "lg:grid-cols-3", a === 4 && "lg:grid-cols-4", o),
|
|
17
|
+
children: i.map((t, n) => /* @__PURE__ */ r(e, {
|
|
18
|
+
product: t,
|
|
19
|
+
priority: n < a
|
|
20
|
+
}, t.id))
|
|
21
|
+
});
|
|
26
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { i as ProductGrid };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";const e=require("../CurrencyProvider.cjs.js"),t=require("../use-price-formatter.cjs.js"),n=require("../countries.cjs.js"),r=require("../states.cjs.js"),i=require("../server-actions/shipping-actions.cjs.js");let a=require("@nextblock-cms/ui/button"),o=require("react"),s=require("lucide-react"),c=require("@nextblock-cms/utils"),l=require("react/jsx-runtime"),u=require("@nextblock-cms/ui/input"),d=require("@nextblock-cms/ui/label");var f=({physicalSubtotal:f})=>{let p=t.usePriceFormatter(),[m,h]=(0,o.useState)(`CA`),[g,_]=(0,o.useState)(``),[v,y]=(0,o.useState)(``),[b,x]=(0,o.useState)(!1),[S,C]=(0,o.useState)(null),[w,T]=(0,o.useState)(null),{t:E,lang:D}=(0,c.useTranslations)(),{activeCurrencyCode:O}=e.useCurrency(),k=(e,t)=>{let n=E(e);return n===e?t:n},A=r.getStatesForCountry(m),j=r.countryUsesStructuredStates(m),M=(0,o.useMemo)(()=>{try{return new Intl.DisplayNames([D],{type:`region`})}catch{return null}},[D]),N=k(`select_an_option`,`Select an option`),P=k(`state_province`,`State / Province`),F=async()=>{x(!0),T(null),C(null);try{let e=await i.getShippingEstimates(f,{country:m,state:g||void 0,postal_code:v},D,O);e.success&&e.methods?C(e.methods):T(e.errorKey?k(e.errorKey,e.error||E(`ecommerce.no_rates_found`)):e.error||E(`ecommerce.no_rates_found`))}catch(e){console.error(`[ShippingEstimator] Failed to load rates:`,e),T(k(`ecommerce.shipping_calculation_failed`,`We couldn't calculate shipping right now. Please try again.`))}finally{x(!1)}};return(0,l.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-muted/30 p-4 mt-6`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 font-semibold text-sm`,children:[(0,l.jsx)(s.Truck,{className:`h-4 w-4`}),(0,l.jsx)(`span`,{children:E(`ecommerce.estimate_shipping`)})]}),(0,l.jsxs)(`div`,{className:`grid gap-3`,children:[(0,l.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,l.jsx)(d.Label,{htmlFor:`estimate-country`,className:`text-xs uppercase tracking-wider text-muted-foreground`,children:E(`ecommerce.country`)}),(0,l.jsx)(`select`,{id:`estimate-country`,name:`estimate-country`,autoComplete:`shipping country`,value:m,onChange:e=>{let t=e.target.value,n=r.getStatesForCountry(t);h(t),_(n.some(e=>e.code===g)?g:``)},className:`flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm`,children:n.countries.map(e=>(0,l.jsx)(`option`,{value:e.code,children:M?.of(e.code)??e.name},e.code))})]}),j&&(0,l.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,l.jsx)(d.Label,{htmlFor:`estimate-state`,className:`text-xs uppercase tracking-wider text-muted-foreground`,children:E(`state_province`)}),(0,l.jsxs)(`select`,{id:`estimate-state`,name:`estimate-state`,autoComplete:`shipping address-level1`,value:g,onChange:e=>_(e.target.value),className:`flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm`,children:[(0,l.jsx)(`option`,{value:``,children:`${N}: ${P}`}),A.map(e=>(0,l.jsx)(`option`,{value:e.code,children:r.getSubdivisionLabel(m,e,D)},e.code))]})]}),(0,l.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,l.jsx)(d.Label,{htmlFor:`estimate-postal`,className:`text-xs uppercase tracking-wider text-muted-foreground`,children:E(`ecommerce.postal_code`)}),(0,l.jsxs)(`div`,{className:`flex gap-2`,children:[(0,l.jsx)(u.Input,{id:`estimate-postal`,name:`estimate-postal`,autoComplete:`shipping postal-code`,placeholder:m===`CA`?`A1A 1A1`:void 0,value:v,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!b&&(e.preventDefault(),F())},className:`h-9 text-sm bg-background`}),(0,l.jsxs)(a.Button,{size:`sm`,variant:`secondary`,onClick:F,disabled:b,className:`shrink-0`,children:[b?(0,l.jsx)(s.Loader2,{className:`h-4 w-4 mr-1.5 animate-spin`}):(0,l.jsx)(s.Calculator,{className:`h-4 w-4 mr-1.5`}),E(`ecommerce.calculate`)]})]})]})]}),w&&(0,l.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive mt-2`,children:w}),(0,l.jsxs)(`div`,{"aria-live":`polite`,children:[S&&S.length>0&&(0,l.jsxs)(`div`,{className:`mt-4 space-y-2 border-t pt-3`,children:[(0,l.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground uppercase`,children:[E(`ecommerce.available_rates`),`:`]}),S.map(e=>(0,l.jsxs)(`div`,{className:`flex justify-between items-center p-3 border rounded-lg bg-muted/30`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(s.Truck,{className:`h-4 w-4 text-muted-foreground`}),(0,l.jsx)(`span`,{className:`text-sm font-medium`,children:e.name})]}),(0,l.jsx)(`span`,{className:`text-sm font-bold tabular-nums`,children:e.amount===0?E(`ecommerce.free`):p(e.amount,O)})]},e.id))]}),S&&S.length===0&&!w&&(0,l.jsx)(`p`,{className:`text-xs text-muted-foreground mt-2 italic`,children:E(`ecommerce.no_rates_found`)})]})]})};exports.ShippingEstimator=f;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface ShippingEstimatorProps {
|
|
2
2
|
physicalSubtotal: number;
|
|
3
3
|
}
|
|
4
|
-
export declare const ShippingEstimator: ({ physicalSubtotal }: ShippingEstimatorProps) => import(
|
|
4
|
+
export declare const ShippingEstimator: ({ physicalSubtotal }: ShippingEstimatorProps) => import('react').JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,154 +1,159 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { useTranslations as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCurrency as e } from "../CurrencyProvider.es.js";
|
|
3
|
+
import { usePriceFormatter as t } from "../use-price-formatter.es.js";
|
|
4
|
+
import { countries as n } from "../countries.es.js";
|
|
5
|
+
import { countryUsesStructuredStates as r, getStatesForCountry as i, getSubdivisionLabel as a } from "../states.es.js";
|
|
6
|
+
import { getShippingEstimates as o } from "../server-actions/shipping-actions.es.js";
|
|
7
|
+
import { Button as s } from "@nextblock-cms/ui/button";
|
|
8
|
+
import { useMemo as c, useState as l } from "react";
|
|
9
|
+
import { Calculator as u, Loader2 as d, Truck as f } from "lucide-react";
|
|
10
|
+
import { useTranslations as p } from "@nextblock-cms/utils";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
import { Input as g } from "@nextblock-cms/ui/input";
|
|
13
|
+
import { Label as _ } from "@nextblock-cms/ui/label";
|
|
14
|
+
//#region libs/ecommerce/src/lib/components/ShippingEstimator.tsx
|
|
15
|
+
var v = ({ physicalSubtotal: v }) => {
|
|
16
|
+
let y = t(), [b, x] = l("CA"), [S, C] = l(""), [w, T] = l(""), [E, D] = l(!1), [O, k] = l(null), [A, j] = l(null), { t: M, lang: N } = p(), { activeCurrencyCode: P } = e(), F = (e, t) => {
|
|
17
|
+
let n = M(e);
|
|
18
|
+
return n === e ? t : n;
|
|
19
|
+
}, I = i(b), L = r(b), R = c(() => {
|
|
20
|
+
try {
|
|
21
|
+
return new Intl.DisplayNames([N], { type: "region" });
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}, [N]), z = F("select_an_option", "Select an option"), B = F("state_province", "State / Province"), V = async () => {
|
|
26
|
+
D(!0), j(null), k(null);
|
|
27
|
+
try {
|
|
28
|
+
let e = await o(v, {
|
|
29
|
+
country: b,
|
|
30
|
+
state: S || void 0,
|
|
31
|
+
postal_code: w
|
|
32
|
+
}, N, P);
|
|
33
|
+
e.success && e.methods ? k(e.methods) : j(e.errorKey ? F(e.errorKey, e.error || M("ecommerce.no_rates_found")) : e.error || M("ecommerce.no_rates_found"));
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.error("[ShippingEstimator] Failed to load rates:", e), j(F("ecommerce.shipping_calculation_failed", "We couldn't calculate shipping right now. Please try again."));
|
|
36
|
+
} finally {
|
|
37
|
+
D(!1);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ h("div", {
|
|
41
|
+
className: "space-y-4 rounded-lg border bg-muted/30 p-4 mt-6",
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ h("div", {
|
|
44
|
+
className: "flex items-center gap-2 font-semibold text-sm",
|
|
45
|
+
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4" }), /* @__PURE__ */ m("span", { children: M("ecommerce.estimate_shipping") })]
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ h("div", {
|
|
48
|
+
className: "grid gap-3",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ h("div", {
|
|
51
|
+
className: "space-y-1.5",
|
|
52
|
+
children: [/* @__PURE__ */ m(_, {
|
|
53
|
+
htmlFor: "estimate-country",
|
|
54
|
+
className: "text-xs uppercase tracking-wider text-muted-foreground",
|
|
55
|
+
children: M("ecommerce.country")
|
|
56
|
+
}), /* @__PURE__ */ m("select", {
|
|
57
|
+
id: "estimate-country",
|
|
58
|
+
name: "estimate-country",
|
|
59
|
+
autoComplete: "shipping country",
|
|
60
|
+
value: b,
|
|
61
|
+
onChange: (e) => {
|
|
62
|
+
let t = e.target.value, n = i(t);
|
|
63
|
+
x(t), C(n.some((e) => e.code === S) ? S : "");
|
|
64
|
+
},
|
|
65
|
+
className: "flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
66
|
+
children: n.map((e) => /* @__PURE__ */ m("option", {
|
|
67
|
+
value: e.code,
|
|
68
|
+
children: R?.of(e.code) ?? e.name
|
|
69
|
+
}, e.code))
|
|
70
|
+
})]
|
|
71
|
+
}),
|
|
72
|
+
L && /* @__PURE__ */ h("div", {
|
|
73
|
+
className: "space-y-1.5",
|
|
74
|
+
children: [/* @__PURE__ */ m(_, {
|
|
75
|
+
htmlFor: "estimate-state",
|
|
76
|
+
className: "text-xs uppercase tracking-wider text-muted-foreground",
|
|
77
|
+
children: M("state_province")
|
|
78
|
+
}), /* @__PURE__ */ h("select", {
|
|
79
|
+
id: "estimate-state",
|
|
80
|
+
name: "estimate-state",
|
|
81
|
+
autoComplete: "shipping address-level1",
|
|
82
|
+
value: S,
|
|
83
|
+
onChange: (e) => C(e.target.value),
|
|
84
|
+
className: "flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
85
|
+
children: [/* @__PURE__ */ m("option", {
|
|
86
|
+
value: "",
|
|
87
|
+
children: `${z}: ${B}`
|
|
88
|
+
}), I.map((e) => /* @__PURE__ */ m("option", {
|
|
89
|
+
value: e.code,
|
|
90
|
+
children: a(b, e, N)
|
|
91
|
+
}, e.code))]
|
|
92
|
+
})]
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ h("div", {
|
|
95
|
+
className: "space-y-1.5",
|
|
96
|
+
children: [/* @__PURE__ */ m(_, {
|
|
97
|
+
htmlFor: "estimate-postal",
|
|
98
|
+
className: "text-xs uppercase tracking-wider text-muted-foreground",
|
|
99
|
+
children: M("ecommerce.postal_code")
|
|
100
|
+
}), /* @__PURE__ */ h("div", {
|
|
101
|
+
className: "flex gap-2",
|
|
102
|
+
children: [/* @__PURE__ */ m(g, {
|
|
103
|
+
id: "estimate-postal",
|
|
104
|
+
name: "estimate-postal",
|
|
105
|
+
autoComplete: "shipping postal-code",
|
|
106
|
+
placeholder: b === "CA" ? "A1A 1A1" : void 0,
|
|
107
|
+
value: w,
|
|
108
|
+
onChange: (e) => T(e.target.value),
|
|
109
|
+
onKeyDown: (e) => {
|
|
110
|
+
e.key === "Enter" && !E && (e.preventDefault(), V());
|
|
111
|
+
},
|
|
112
|
+
className: "h-9 text-sm bg-background"
|
|
113
|
+
}), /* @__PURE__ */ h(s, {
|
|
114
|
+
size: "sm",
|
|
115
|
+
variant: "secondary",
|
|
116
|
+
onClick: V,
|
|
117
|
+
disabled: E,
|
|
118
|
+
className: "shrink-0",
|
|
119
|
+
children: [E ? /* @__PURE__ */ m(d, { className: "h-4 w-4 mr-1.5 animate-spin" }) : /* @__PURE__ */ m(u, { className: "h-4 w-4 mr-1.5" }), M("ecommerce.calculate")]
|
|
120
|
+
})]
|
|
121
|
+
})]
|
|
122
|
+
})
|
|
123
|
+
]
|
|
124
|
+
}),
|
|
125
|
+
A && /* @__PURE__ */ m("p", {
|
|
126
|
+
role: "alert",
|
|
127
|
+
className: "text-xs text-destructive mt-2",
|
|
128
|
+
children: A
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ h("div", {
|
|
131
|
+
"aria-live": "polite",
|
|
132
|
+
children: [O && O.length > 0 && /* @__PURE__ */ h("div", {
|
|
133
|
+
className: "mt-4 space-y-2 border-t pt-3",
|
|
134
|
+
children: [/* @__PURE__ */ h("p", {
|
|
135
|
+
className: "text-xs font-medium text-muted-foreground uppercase",
|
|
136
|
+
children: [M("ecommerce.available_rates"), ":"]
|
|
137
|
+
}), O.map((e) => /* @__PURE__ */ h("div", {
|
|
138
|
+
className: "flex justify-between items-center p-3 border rounded-lg bg-muted/30",
|
|
139
|
+
children: [/* @__PURE__ */ h("div", {
|
|
140
|
+
className: "flex items-center gap-2",
|
|
141
|
+
children: [/* @__PURE__ */ m(f, { className: "h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ m("span", {
|
|
142
|
+
className: "text-sm font-medium",
|
|
143
|
+
children: e.name
|
|
144
|
+
})]
|
|
145
|
+
}), /* @__PURE__ */ m("span", {
|
|
146
|
+
className: "text-sm font-bold tabular-nums",
|
|
147
|
+
children: e.amount === 0 ? M("ecommerce.free") : y(e.amount, P)
|
|
148
|
+
})]
|
|
149
|
+
}, e.id))]
|
|
150
|
+
}), O && O.length === 0 && !A && /* @__PURE__ */ m("p", {
|
|
151
|
+
className: "text-xs text-muted-foreground mt-2 italic",
|
|
152
|
+
children: M("ecommerce.no_rates_found")
|
|
153
|
+
})]
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
});
|
|
154
157
|
};
|
|
158
|
+
//#endregion
|
|
159
|
+
export { v as ShippingEstimator };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("./SimpleTiptapRenderer.cjs.js");let n=require("react");n=e.__toESM(n,1);let r=require("@nextblock-cms/utils"),i=require("react/jsx-runtime");var a=/<\/?[a-z][^>]*>/i,o=e=>a.test(e);function s({value:e,className:n}){let a=e?.trim();return a?o(a)?(0,i.jsx)(`div`,{className:n,dangerouslySetInnerHTML:{__html:t.toNoCookieEmbedSrc(a)??a}}):(0,i.jsx)(`p`,{className:(0,r.cn)(`whitespace-pre-line`,n),children:a}):null}exports.ShortDescription=s,exports.isHtmlShortDescription=o;
|