@propeller-commerce/propeller-v2-react-ui 0.16.0 → 0.18.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/dist/index.js CHANGED
@@ -5,6 +5,8 @@ import * as React6 from 'react';
5
5
  import { createContext, useState, useRef, useMemo, useCallback, useContext, useEffect } from 'react';
6
6
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
7
7
  import { ProductStatus, ProductSortField, SortOrder, PurchaseRole, CrossupsellType, CartStatus, CartAddressType, Gender, YesNo, AddressType, MagicTokenService, PaymentStatuses, OrderSearchFields, OrderItemClass, ProductSearchableField, machineService, AttributeType, OrderSortField, OrderType, OrderDiscountType, BundleCondition } from '@propeller-commerce/propeller-sdk-v2';
8
+ import { clsx } from 'clsx';
9
+ import { twMerge } from 'tailwind-merge';
8
10
  import { User } from 'lucide-react';
9
11
 
10
12
  // src/index.ts
@@ -1390,7 +1392,7 @@ function useFavorites(options) {
1390
1392
  if (onEdit) {
1391
1393
  onEdit(listId, data);
1392
1394
  cancelEdit();
1393
- onListChanged?.();
1395
+ onListChanged?.({ action: "updated", listId, ...data });
1394
1396
  return;
1395
1397
  }
1396
1398
  setSaving(true);
@@ -1405,7 +1407,7 @@ function useFavorites(options) {
1405
1407
  const updated = await service.updateFavoriteList(listId, { name: data.name, isDefault: data.isDefault });
1406
1408
  setLists((prev) => prev.map((l) => String(l.id) === listId ? updated : l));
1407
1409
  cancelEdit();
1408
- onListChanged?.();
1410
+ onListChanged?.({ action: "updated", listId, name: data.name, isDefault: data.isDefault });
1409
1411
  } catch (e) {
1410
1412
  setError(e instanceof Error ? e.message : "Failed to update list");
1411
1413
  } finally {
@@ -1422,7 +1424,7 @@ function useFavorites(options) {
1422
1424
  if (onDelete) {
1423
1425
  onDelete(listId);
1424
1426
  setListToDelete(null);
1425
- onListChanged?.();
1427
+ onListChanged?.({ action: "deleted", listId, name: list.name });
1426
1428
  return;
1427
1429
  }
1428
1430
  setSaving(true);
@@ -1431,7 +1433,7 @@ function useFavorites(options) {
1431
1433
  try {
1432
1434
  const service = createServices(graphqlClient).favoriteList;
1433
1435
  await service.deleteFavoriteList(listId);
1434
- onListChanged?.();
1436
+ onListChanged?.({ action: "deleted", listId, name: list.name });
1435
1437
  } catch (e) {
1436
1438
  setError(e instanceof Error ? e.message : "Failed to delete list");
1437
1439
  setLists((prev) => [...prev, list]);
@@ -1444,7 +1446,7 @@ function useFavorites(options) {
1444
1446
  const data = { name, isDefault };
1445
1447
  if (onCreate) {
1446
1448
  onCreate(data);
1447
- onListChanged?.();
1449
+ onListChanged?.({ action: "created", name, isDefault });
1448
1450
  return;
1449
1451
  }
1450
1452
  setSaving(true);
@@ -1461,7 +1463,7 @@ function useFavorites(options) {
1461
1463
  if (isCustomer(user)) createInput.customerId = user.customerId;
1462
1464
  const created = await service.createFavoriteList(createInput);
1463
1465
  setLists((prev) => [...prev, created]);
1464
- onListChanged?.();
1466
+ onListChanged?.({ action: "created", listId: created?.id, name, isDefault });
1465
1467
  } catch (e) {
1466
1468
  setError(e instanceof Error ? e.message : "Failed to create list");
1467
1469
  } finally {
@@ -2183,6 +2185,15 @@ function useProductInfo(options) {
2183
2185
  clusterImageUrl
2184
2186
  };
2185
2187
  }
2188
+
2189
+ // src/composables/shared/utils/listingUserId.ts
2190
+ function resolveListingUserId(user, configuration) {
2191
+ if (user && "contactId" in user) return user.contactId;
2192
+ if (user && "customerId" in user) return user.customerId;
2193
+ return configuration?.anonymousUserId;
2194
+ }
2195
+
2196
+ // src/composables/react/useProductSearch.ts
2186
2197
  var inflightFetches2 = /* @__PURE__ */ new Set();
2187
2198
  function buildAttributeInput(names) {
2188
2199
  if (!names || names.length === 0) return void 0;
@@ -2287,7 +2298,7 @@ function useProductSearch(options) {
2287
2298
  ] : [];
2288
2299
  const priceFilter = options.priceFilterMin !== void 0 || options.priceFilterMax !== void 0 ? { from: options.priceFilterMin ?? 0, to: options.priceFilterMax ?? 999999 } : void 0;
2289
2300
  const inventoryFilter = buildInventoryFilter(options.availability, options.minStock);
2290
- const userId = options.user && "contactId" in options.user ? options.user.contactId : options.user && "customerId" in options.user ? options.user.customerId : void 0;
2301
+ const userId = resolveListingUserId(options.user, configuration);
2291
2302
  const contactId = options.user && "contactId" in options.user ? options.user.contactId : void 0;
2292
2303
  const customerId = options.user && "customerId" in options.user ? options.user.customerId : void 0;
2293
2304
  const orderlistScope = options.orderlistIds && options.orderlistIds.length > 0 ? {
@@ -2424,7 +2435,7 @@ function useProductSearch(options) {
2424
2435
  applyOrderlists: options.applyOrderlists !== false,
2425
2436
  orderlistIds: options.orderlistIds
2426
2437
  } : { applyOrderlists: false };
2427
- const userId = options.user && "contactId" in options.user ? options.user.contactId : options.user && "customerId" in options.user ? options.user.customerId : void 0;
2438
+ const userId = resolveListingUserId(options.user, configuration);
2428
2439
  const contactId = options.user && "contactId" in options.user ? options.user.contactId : void 0;
2429
2440
  const customerId = options.user && "customerId" in options.user ? options.user.customerId : void 0;
2430
2441
  const inventoryFilter = buildInventoryFilter(options.availability, options.minStock);
@@ -2590,7 +2601,7 @@ function useQuickOrder(options) {
2590
2601
  try {
2591
2602
  const service = createServices(graphqlClient).category;
2592
2603
  const orderlistScope = orderlistIds && orderlistIds.length > 0 ? { applyOrderlists: applyOrderlists !== false, orderlistIds } : { applyOrderlists: false };
2593
- const userId = user && "contactId" in user ? user.contactId : user && "customerId" in user ? user.customerId : void 0;
2604
+ const userId = resolveListingUserId(user, configuration);
2594
2605
  const contactId = user && "contactId" in user ? user.contactId : void 0;
2595
2606
  const customerId = user && "customerId" in user ? user.customerId : void 0;
2596
2607
  const input = {
@@ -2732,7 +2743,7 @@ function useSpareParts(options) {
2732
2743
  [isControlled, options.parts, internalParts]
2733
2744
  );
2734
2745
  const isLoading = !isControlled && internalLoading;
2735
- const userId = options.user && "contactId" in options.user ? options.user.contactId : options.user && "customerId" in options.user ? options.user.customerId : void 0;
2746
+ const userId = resolveListingUserId(options.user, options.configuration);
2736
2747
  const contactId = options.user && "contactId" in options.user ? options.user.contactId : void 0;
2737
2748
  const customerId = options.user && "customerId" in options.user ? options.user.customerId : void 0;
2738
2749
  const userKey = `${contactId ?? ""}:${customerId ?? ""}`;
@@ -3035,9 +3046,7 @@ function useProductSlider(options) {
3035
3046
  }
3036
3047
  }
3037
3048
  function resolveUserId() {
3038
- if (options.user && "contactId" in options.user) return options.user.contactId;
3039
- if (options.user && "customerId" in options.user) return options.user.customerId;
3040
- return void 0;
3049
+ return resolveListingUserId(options.user, options.configuration);
3041
3050
  }
3042
3051
  const fetchCrossupsells = useCallback(async (input) => {
3043
3052
  setLoading(true);
@@ -4024,6 +4033,9 @@ LoginFormExport.RegisterLink = LoginFormRegisterLink;
4024
4033
  LoginFormExport.GuestCheckoutButton = LoginFormGuestCheckoutButton;
4025
4034
  LoginFormExport.ErrorMessage = LoginFormErrorMessage;
4026
4035
  var LoginForm_default = LoginFormExport;
4036
+ function cn(...inputs) {
4037
+ return twMerge(clsx(inputs));
4038
+ }
4027
4039
  function AccountIconAndMenu(rawProps) {
4028
4040
  const props = useInfraProps(rawProps);
4029
4041
  const LoginFormImpl = props.loginFormComponent ?? LoginForm_default;
@@ -4172,7 +4184,7 @@ function AccountIconAndMenu(rawProps) {
4172
4184
  onClick: (event) => handleIconClick(),
4173
4185
  "aria-label": getLabel(props.labels, "accountLabel", "Account"),
4174
4186
  "data-open": menuOpen ? "true" : "false",
4175
- className: `propeller-account-menu__trigger inline-flex items-center gap-2 px-3 py-2 rounded-control text-sm font-medium transition-colors text-white hover:bg-white/10${props.iconClassName ? " " + props.iconClassName : ""}`,
4187
+ className: cn(`propeller-account-menu__trigger inline-flex items-center gap-2 px-3 py-2 rounded-control text-sm font-medium transition-colors text-white hover:bg-white/10${props.iconClassName ? " " + props.iconClassName : ""}`),
4176
4188
  children: [
4177
4189
  /* @__PURE__ */ jsx(
4178
4190
  "svg",
@@ -4200,7 +4212,7 @@ function AccountIconAndMenu(rawProps) {
4200
4212
  menuOpen ? /* @__PURE__ */ jsxs(
4201
4213
  "div",
4202
4214
  {
4203
- className: `propeller-account-menu__popover absolute right-0 mt-2 w-80 bg-popover text-foreground rounded-container shadow-lg border border-border py-4 px-5 z-50${props.menuClassName ? " " + props.menuClassName : ""}`,
4215
+ className: cn(`propeller-account-menu__popover absolute right-0 mt-2 w-80 bg-popover text-foreground rounded-container shadow-lg border border-border py-4 px-5 z-50${props.menuClassName ? " " + props.menuClassName : ""}`),
4204
4216
  children: [
4205
4217
  !!props.user ? /* @__PURE__ */ jsxs(Fragment, { children: [
4206
4218
  /* @__PURE__ */ jsxs("div", { className: "propeller-account-menu__user pb-3 mb-3 border-b border-border", children: [
@@ -4561,7 +4573,7 @@ function AddToCart(rawProps) {
4561
4573
  return /* @__PURE__ */ jsxs(
4562
4574
  "div",
4563
4575
  {
4564
- className: `propeller-add-to-cart ${props.className || ""}`,
4576
+ className: cn(`propeller-add-to-cart ${props.className || ""}`),
4565
4577
  "data-loading": loading ? "true" : "false",
4566
4578
  children: [
4567
4579
  /* @__PURE__ */ jsxs("div", { className: "propeller-add-to-cart__controls flex flex-wrap items-center gap-2 w-full md:flex-nowrap", children: [
@@ -4931,7 +4943,14 @@ function AddToFavorite(rawProps) {
4931
4943
  setMemberListIds(newMemberIds);
4932
4944
  setSelectedListId("");
4933
4945
  setIsOpen(false);
4934
- if (props.onFavoriteChanged) props.onFavoriteChanged();
4946
+ if (props.onFavoriteChanged) {
4947
+ props.onFavoriteChanged({
4948
+ action: "added",
4949
+ listId: selectedListId,
4950
+ productId: props.productId,
4951
+ clusterId: props.clusterId
4952
+ });
4953
+ }
4935
4954
  } catch (error) {
4936
4955
  console.error("Error adding to favorite list:", error);
4937
4956
  } finally {
@@ -4948,7 +4967,14 @@ function AddToFavorite(rawProps) {
4948
4967
  setMemberListIds(newMemberIds);
4949
4968
  setSelectedListId("");
4950
4969
  setIsOpen(false);
4951
- if (props.onFavoriteChanged) props.onFavoriteChanged();
4970
+ if (props.onFavoriteChanged) {
4971
+ props.onFavoriteChanged({
4972
+ action: "removed",
4973
+ listId,
4974
+ productId: props.productId,
4975
+ clusterId: props.clusterId
4976
+ });
4977
+ }
4952
4978
  } catch (error) {
4953
4979
  console.error("Error removing from favorite list:", error);
4954
4980
  } finally {
@@ -4988,7 +5014,7 @@ function AddToFavorite(rawProps) {
4988
5014
  type: "button",
4989
5015
  onClick: (event) => toggleModal(),
4990
5016
  title: isFavorited() ? getLabel(props.labels, "removeFromFavorites", "Remove from favorites") : getLabel(props.labels, "addToFavorites", "Add to favorites"),
4991
- className: `propeller-add-to-favorite__btn inline-flex items-center justify-center rounded-control border p-2.5 transition-colors ${isFavorited() ? "border-primary/30 bg-primary/5 text-primary hover:bg-primary/10" : "border-border bg-card text-foreground-subtle hover:text-primary hover:border-primary/30 hover:bg-primary/5"} ${props.className || ""}`,
5017
+ className: cn(`propeller-add-to-favorite__btn inline-flex items-center justify-center rounded-control border p-2.5 transition-colors ${isFavorited() ? "border-primary/30 bg-primary/5 text-primary hover:bg-primary/10" : "border-border bg-card text-foreground-subtle hover:text-primary hover:border-primary/30 hover:bg-primary/5"} ${props.className || ""}`),
4992
5018
  children: [
4993
5019
  isFavorited() ? /* @__PURE__ */ jsx(
4994
5020
  "svg",
@@ -6137,7 +6163,7 @@ function AddressSelector(props) {
6137
6163
  setIsLoading(false);
6138
6164
  }
6139
6165
  }
6140
- return /* @__PURE__ */ jsxs("div", { className: `propeller-address-selector ${props.className || ""}`, children: [
6166
+ return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-address-selector ${props.className || ""}`), children: [
6141
6167
  /* @__PURE__ */ jsxs(
6142
6168
  "button",
6143
6169
  {
@@ -6280,7 +6306,7 @@ function Breadcrumbs(props) {
6280
6306
  return index === displayItems.length - 1;
6281
6307
  }
6282
6308
  const showSeparatorBefore = (index) => props.showHome !== false || index > 0;
6283
- return /* @__PURE__ */ jsx("nav", { "aria-label": getLabel(props.labels, "breadcrumbAriaLabel", "Breadcrumb"), className: `propeller-breadcrumbs ${props.className || ""}`, children: /* @__PURE__ */ jsxs("ol", { className: "propeller-breadcrumbs__list flex flex-wrap items-center text-sm text-muted-foreground", children: [
6309
+ return /* @__PURE__ */ jsx("nav", { "aria-label": getLabel(props.labels, "breadcrumbAriaLabel", "Breadcrumb"), className: cn(`propeller-breadcrumbs ${props.className || ""}`), children: /* @__PURE__ */ jsxs("ol", { className: "propeller-breadcrumbs__list flex flex-wrap items-center text-sm text-muted-foreground", children: [
6284
6310
  props.showHome !== false ? /* @__PURE__ */ jsx("li", { className: "propeller-breadcrumbs__item flex items-center", "data-home": "true", children: /* @__PURE__ */ jsx(
6285
6311
  "a",
6286
6312
  {
@@ -6358,7 +6384,7 @@ function CartBonusItems(rawProps) {
6358
6384
  const money = (value) => formatPrice(value, { symbol: currency });
6359
6385
  const productName = (item) => getLocalizedValue(item.product?.names, props.language, "Product");
6360
6386
  const productImage = (item) => item.product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || "";
6361
- return /* @__PURE__ */ jsxs("div", { className: `propeller-cart-bonus-items ${props.className || "mt-2"}`, children: [
6387
+ return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-cart-bonus-items ${props.className || "mt-2"}`), children: [
6362
6388
  /* @__PURE__ */ jsx("h2", { className: "propeller-cart-bonus-items__title text-lg font-semibold mb-3", children: getLabel(props.labels, "title", "Bonus items") }),
6363
6389
  /* @__PURE__ */ jsx("div", { className: "propeller-cart-bonus-items__list space-y-4", children: items.map((item) => {
6364
6390
  const img = productImage(item);
@@ -6505,7 +6531,7 @@ function ItemStock(props) {
6505
6531
  return /* @__PURE__ */ jsx(Fragment, { children: hasInventory() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
6506
6532
  "div",
6507
6533
  {
6508
- className: `propeller-item-stock flex flex-wrap items-center gap-1.5 ${props.className || ""}`,
6534
+ className: cn(`propeller-item-stock flex flex-wrap items-center gap-1.5 ${props.className || ""}`),
6509
6535
  "data-available": isAvailable() ? "true" : "false",
6510
6536
  "data-stock": getStockStatusData(),
6511
6537
  children: [
@@ -6834,7 +6860,7 @@ function CartItem(rawProps) {
6834
6860
  return /* @__PURE__ */ jsx(CartItemContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
6835
6861
  "div",
6836
6862
  {
6837
- className: `propeller-cart-item flex flex-wrap md:flex-nowrap items-start gap-4 ${props.cardFrame === false ? "" : "bg-card p-4 rounded-container shadow-sm border border-border"} ${props.className || ""}`,
6863
+ className: cn(`propeller-cart-item flex flex-wrap md:flex-nowrap items-start gap-4 ${props.cardFrame === false ? "" : "bg-card p-4 rounded-container shadow-sm border border-border"} ${props.className || ""}`),
6838
6864
  "data-bundle": isBundleItem() ? "true" : "false",
6839
6865
  "data-loading": loading ? "true" : "false",
6840
6866
  children: rawProps.children
@@ -6844,7 +6870,7 @@ function CartItem(rawProps) {
6844
6870
  return /* @__PURE__ */ jsx(CartItemContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(
6845
6871
  "div",
6846
6872
  {
6847
- className: `propeller-cart-item flex flex-wrap md:flex-nowrap items-start gap-4 ${props.cardFrame === false ? "" : "bg-card p-4 rounded-container shadow-sm border border-border"} ${props.className || ""}`,
6873
+ className: cn(`propeller-cart-item flex flex-wrap md:flex-nowrap items-start gap-4 ${props.cardFrame === false ? "" : "bg-card p-4 rounded-container shadow-sm border border-border"} ${props.className || ""}`),
6848
6874
  "data-bundle": isBundleItem() ? "true" : "false",
6849
6875
  "data-loading": loading ? "true" : "false",
6850
6876
  children: [
@@ -7316,7 +7342,7 @@ function CartIconAndSidebar(rawProps) {
7316
7342
  type: "button",
7317
7343
  onClick: () => handleIconClick(),
7318
7344
  "aria-label": getLabel(props.labels, "cartIconLabel", "Shopping cart"),
7319
- className: `propeller-cart-icon__trigger relative inline-flex items-center justify-center p-2 rounded-control transition-colors text-foreground${props.iconClassName ? " " + props.iconClassName : ""}`,
7345
+ className: cn(`propeller-cart-icon__trigger relative inline-flex items-center justify-center p-2 rounded-control transition-colors text-foreground${props.iconClassName ? " " + props.iconClassName : ""}`),
7320
7346
  children: [
7321
7347
  /* @__PURE__ */ jsx(
7322
7348
  "svg",
@@ -7368,7 +7394,7 @@ function CartIconAndSidebar(rawProps) {
7368
7394
  "aria-modal": "true",
7369
7395
  "aria-label": sidebarTitle,
7370
7396
  "data-open": sidebarOpen ? "true" : "false",
7371
- className: `propeller-cart-icon__sidebar fixed inset-y-0 right-0 z-[70] w-full max-w-md bg-card shadow-2xl transform transition-transform duration-300 ease-in-out border-l border-border${sidebarOpen ? " translate-x-0" : " translate-x-full"}${props.sidebarClassName ? " " + props.sidebarClassName : ""}`,
7397
+ className: cn(`propeller-cart-icon__sidebar fixed inset-y-0 right-0 z-[70] w-full max-w-md bg-card shadow-2xl transform transition-transform duration-300 ease-in-out border-l border-border${sidebarOpen ? " translate-x-0" : " translate-x-full"}${props.sidebarClassName ? " " + props.sidebarClassName : ""}`),
7372
7398
  children: /* @__PURE__ */ jsx("div", { className: "flex flex-col h-full", children: isMounted ? /* @__PURE__ */ jsxs(Fragment, { children: [
7373
7399
  /* @__PURE__ */ jsxs("div", { className: "propeller-cart-icon__sidebar-header flex items-center justify-between px-5 py-4 border-b border-border", children: [
7374
7400
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
@@ -8000,7 +8026,7 @@ function CategoryDescription(props) {
8000
8026
  return /* @__PURE__ */ jsx(Fragment, { children: !!html ? /* @__PURE__ */ jsxs(
8001
8027
  "div",
8002
8028
  {
8003
- className: `propeller-category-description mb-6 ${props.className || ""}`,
8029
+ className: cn(`propeller-category-description mb-6 ${props.className || ""}`),
8004
8030
  "data-expanded": expanded ? "true" : "false",
8005
8031
  "data-truncatable": shouldTruncate ? "true" : "false",
8006
8032
  children: [
@@ -8030,7 +8056,7 @@ function CategoryShortDescription(props) {
8030
8056
  (d) => d.language === props.language
8031
8057
  );
8032
8058
  const html = match?.value || "";
8033
- return /* @__PURE__ */ jsx(Fragment, { children: !!html ? /* @__PURE__ */ jsx("div", { className: `propeller-category-short-description mb-6 ${props.className || ""}`, children: /* @__PURE__ */ jsx(
8059
+ return /* @__PURE__ */ jsx(Fragment, { children: !!html ? /* @__PURE__ */ jsx("div", { className: cn(`propeller-category-short-description mb-6 ${props.className || ""}`), children: /* @__PURE__ */ jsx(
8034
8060
  "div",
8035
8061
  {
8036
8062
  className: "propeller-category-short-description__content prose prose-slate max-w-none text-muted-foreground",
@@ -8165,7 +8191,7 @@ function ClusterCard(rawProps) {
8165
8191
  return /* @__PURE__ */ jsx(ClusterCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
8166
8192
  "div",
8167
8193
  {
8168
- className: `propeller-cluster-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className ?? ""}`,
8194
+ className: cn(`propeller-cluster-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className ?? ""}`),
8169
8195
  "data-cluster-id": cluster.clusterId,
8170
8196
  "data-layout": isRow ? "row" : "grid",
8171
8197
  children: rawProps.children
@@ -8175,7 +8201,7 @@ function ClusterCard(rawProps) {
8175
8201
  return /* @__PURE__ */ jsx(ClusterCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(
8176
8202
  "div",
8177
8203
  {
8178
- className: `propeller-cluster-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className || ""}`,
8204
+ className: cn(`propeller-cluster-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className || ""}`),
8179
8205
  "data-layout": isRow ? "row" : "grid",
8180
8206
  children: [
8181
8207
  props.showImage !== false ? /* @__PURE__ */ jsx(ClusterCardImage, {}) : null,
@@ -8467,7 +8493,7 @@ function MachineCard(props) {
8467
8493
  return /* @__PURE__ */ jsx(
8468
8494
  "div",
8469
8495
  {
8470
- className: `propeller-machine-card group relative flex h-full flex-col overflow-hidden rounded-lg border border-border bg-background ${props.className ?? ""}`,
8496
+ className: cn(`propeller-machine-card group relative flex h-full flex-col overflow-hidden rounded-lg border border-border bg-background ${props.className ?? ""}`),
8471
8497
  children: /* @__PURE__ */ jsxs(
8472
8498
  "a",
8473
8499
  {
@@ -8528,7 +8554,7 @@ function LoginToOrderButton(props) {
8528
8554
  "button",
8529
8555
  {
8530
8556
  type: "button",
8531
- className: `propeller-login-to-order inline-flex items-center justify-center gap-2 h-10 px-4 w-full rounded-control bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 transition-opacity ${props.className || ""}`,
8557
+ className: cn(`propeller-login-to-order inline-flex items-center justify-center gap-2 h-10 px-4 w-full rounded-control bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 transition-opacity ${props.className || ""}`),
8532
8558
  onClick: () => {
8533
8559
  if (props.onLoginClick) props.onLoginClick();
8534
8560
  },
@@ -8589,7 +8615,7 @@ function ProductPriceDisplay(props) {
8589
8615
  function getSecondaryTaxLabel() {
8590
8616
  return props.includeTax ? getLabel(props.labels, "exclTax", "excl. VAT") : getLabel(props.labels, "inclTax", "incl. VAT");
8591
8617
  }
8592
- return /* @__PURE__ */ jsxs("div", { className: `propeller-product-price ${props.className || ""}`, "data-hidden": isHidden2() ? "true" : "false", children: [
8618
+ return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-price ${props.className || ""}`), "data-hidden": isHidden2() ? "true" : "false", children: [
8593
8619
  isHidden2() && props.showLoginPrompt !== false ? /* @__PURE__ */ jsx("p", { className: "propeller-product-price__login-prompt text-sm text-muted-foreground italic", children: getLabel(props.labels, "loginToSeePrices", "Log in to see prices") }) : null,
8594
8620
  !isHidden2() && !!getLeadingPrice() ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-price__content flex flex-col gap-0.5", children: [
8595
8621
  /* @__PURE__ */ jsxs("div", { className: "propeller-product-price__primary flex items-baseline gap-2", children: [
@@ -8736,7 +8762,7 @@ function ProductCardRoot(rawProps) {
8736
8762
  return /* @__PURE__ */ jsx(ProductCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
8737
8763
  "div",
8738
8764
  {
8739
- className: `propeller-product-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className || ""}`,
8765
+ className: cn(`propeller-product-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className || ""}`),
8740
8766
  "data-layout": isRow ? "row" : "grid",
8741
8767
  children: rawProps.children
8742
8768
  }
@@ -8745,7 +8771,7 @@ function ProductCardRoot(rawProps) {
8745
8771
  return /* @__PURE__ */ jsx(ProductCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(
8746
8772
  "div",
8747
8773
  {
8748
- className: `propeller-product-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className || ""}`,
8774
+ className: cn(`propeller-product-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? "flex-row flex-wrap md:flex-nowrap items-center" : "flex-col"} ${props.className || ""}`),
8749
8775
  "data-layout": isRow ? "row" : "grid",
8750
8776
  children: [
8751
8777
  props.showImage !== false ? /* @__PURE__ */ jsx(ProductCardImage, {}) : null,
@@ -9192,7 +9218,7 @@ function ProductGrid(rawProps) {
9192
9218
  return /* @__PURE__ */ jsx(ProductGridConfigProvider, { value: gridConfig, children: /* @__PURE__ */ jsx(ProductGridSearchContext.Provider, { value: compoundCtx, children: /* @__PURE__ */ jsx(
9193
9219
  "div",
9194
9220
  {
9195
- className: `propeller-product-grid w-full ${props.className || ""}`,
9221
+ className: cn(`propeller-product-grid w-full ${props.className || ""}`),
9196
9222
  "data-loading": getIsLoading() ? "true" : "false",
9197
9223
  "data-mode": "compound",
9198
9224
  children: rawProps.children
@@ -9202,7 +9228,7 @@ function ProductGrid(rawProps) {
9202
9228
  return /* @__PURE__ */ jsx(ProductGridConfigProvider, { value: gridConfig, children: /* @__PURE__ */ jsxs(
9203
9229
  "div",
9204
9230
  {
9205
- className: `propeller-product-grid w-full ${props.className || ""}`,
9231
+ className: cn(`propeller-product-grid w-full ${props.className || ""}`),
9206
9232
  "data-loading": getIsLoading() ? "true" : "false",
9207
9233
  children: [
9208
9234
  getIsLoading() ? /* @__PURE__ */ jsx("div", { className: `propeller-product-grid__skeleton-grid ${getGridColsClass()}`, children: getSkeletonItems()?.map((_, idx) => /* @__PURE__ */ jsxs(
@@ -9305,7 +9331,7 @@ function ProductGridItems(props) {
9305
9331
  const gridClass = cols === 1 ? "flex flex-col gap-4" : cols === 2 ? "grid grid-cols-2 gap-3 sm:gap-6 auto-rows-fr" : cols === 4 ? "grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-6 auto-rows-fr" : cols === 5 ? "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 sm:gap-6 auto-rows-fr" : cols === 6 ? "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 sm:gap-6 auto-rows-fr" : "grid grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-6 auto-rows-fr";
9306
9332
  if (isLoading) {
9307
9333
  const skeletonCount = cols === 2 ? 4 : cols === 4 ? 8 : cols === 5 ? 10 : cols === 6 ? 12 : 6;
9308
- return /* @__PURE__ */ jsx("div", { className: `propeller-product-grid__skeleton-grid ${gridClass} ${props.className ?? ""}`, children: Array.from({ length: skeletonCount }).map((_, idx) => /* @__PURE__ */ jsxs(
9334
+ return /* @__PURE__ */ jsx("div", { className: cn(`propeller-product-grid__skeleton-grid ${gridClass} ${props.className ?? ""}`), children: Array.from({ length: skeletonCount }).map((_, idx) => /* @__PURE__ */ jsxs(
9309
9335
  "div",
9310
9336
  {
9311
9337
  className: "propeller-product-grid__skeleton-card flex flex-col overflow-hidden rounded-container border border-border bg-card shadow-sm",
@@ -9327,7 +9353,7 @@ function ProductGridItems(props) {
9327
9353
  /* @__PURE__ */ jsx("p", { className: "propeller-product-grid__empty-message mt-1 text-sm text-muted-foreground", children: getLabel(props.labels, "noProductsHelp", "Try adjusting your filters or search term.") })
9328
9354
  ] }) });
9329
9355
  }
9330
- return /* @__PURE__ */ jsx("div", { className: `propeller-product-grid__grid ${gridClass} ${props.className ?? ""}`, children: items.map((item, idx) => {
9356
+ return /* @__PURE__ */ jsx("div", { className: cn(`propeller-product-grid__grid ${gridClass} ${props.className ?? ""}`), children: items.map((item, idx) => {
9331
9357
  const isCluster = "clusterId" in item && !!item.clusterId;
9332
9358
  const key = item.productId || item.clusterId || idx;
9333
9359
  return /* @__PURE__ */ jsxs(React6.Fragment, { children: [
@@ -9588,7 +9614,7 @@ function GridFilters(rawProps) {
9588
9614
  return /* @__PURE__ */ jsxs(
9589
9615
  "div",
9590
9616
  {
9591
- className: `propeller-grid-filters space-y-4 ${props.isMobile ? "pb-8" : "sticky top-24"} ${isPending ? "opacity-50 pointer-events-none" : ""} ${props.className || ""}`,
9617
+ className: cn(`propeller-grid-filters space-y-4 ${props.isMobile ? "pb-8" : "sticky top-24"} ${isPending ? "opacity-50 pointer-events-none" : ""} ${props.className || ""}`),
9592
9618
  "data-mobile": props.isMobile ? "true" : "false",
9593
9619
  "data-pending": isPending ? "true" : "false",
9594
9620
  children: [
@@ -10012,7 +10038,7 @@ function GridToolbar(rawProps) {
10012
10038
  return /* @__PURE__ */ jsxs(
10013
10039
  "div",
10014
10040
  {
10015
- className: `propeller-grid-toolbar ${props.className || ""}`,
10041
+ className: cn(`propeller-grid-toolbar ${props.className || ""}`),
10016
10042
  "data-view-mode": currentViewMode,
10017
10043
  children: [
10018
10044
  /* @__PURE__ */ jsxs("div", { className: "propeller-grid-toolbar__bar flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-4", children: [
@@ -10251,7 +10277,7 @@ function GridPagination(props) {
10251
10277
  return /* @__PURE__ */ jsx(
10252
10278
  "div",
10253
10279
  {
10254
- className: `propeller-grid-pagination ${props.className || ""}`,
10280
+ className: cn(`propeller-grid-pagination ${props.className || ""}`),
10255
10281
  "data-variant": variant,
10256
10282
  children: showPagination ? /* @__PURE__ */ jsxs(Fragment, { children: [
10257
10283
  variant === "compact" ? /* @__PURE__ */ jsxs("div", { className: "propeller-grid-pagination__compact flex justify-center items-center gap-2", children: [
@@ -10629,7 +10655,7 @@ function ClusterConfigurator(props) {
10629
10655
  initFromProduct(props.defaultProduct);
10630
10656
  }
10631
10657
  }, []);
10632
- return /* @__PURE__ */ jsx("div", { className: `propeller-cluster-configurator ${props.className || ""}`, children: !!props.config?.settings?.length ? /* @__PURE__ */ jsx("div", { className: "propeller-cluster-configurator__content flex flex-col gap-6", children: settingsWithValues?.map((setting) => /* @__PURE__ */ jsxs(
10658
+ return /* @__PURE__ */ jsx("div", { className: cn(`propeller-cluster-configurator ${props.className || ""}`), children: !!props.config?.settings?.length ? /* @__PURE__ */ jsx("div", { className: "propeller-cluster-configurator__content flex flex-col gap-6", children: settingsWithValues?.map((setting) => /* @__PURE__ */ jsxs(
10633
10659
  "div",
10634
10660
  {
10635
10661
  className: "propeller-cluster-configurator__group",
@@ -10778,7 +10804,7 @@ function ClusterInfo(rawProps) {
10778
10804
  props.onClusterLoaded(fetchedCluster);
10779
10805
  }
10780
10806
  }, [fetchedCluster]);
10781
- return /* @__PURE__ */ jsxs("div", { className: `propeller-cluster-info ${props.className || ""}`, "data-loading": loading ? "true" : "false", children: [
10807
+ return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-cluster-info ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
10782
10808
  loading && !props.cluster ? /* @__PURE__ */ jsxs("div", { className: "propeller-cluster-info__skeleton animate-pulse space-y-3", children: [
10783
10809
  /* @__PURE__ */ jsx("div", { className: "propeller-cluster-info__skeleton-line h-4 bg-surface-hover rounded w-1/4" }),
10784
10810
  /* @__PURE__ */ jsx("div", { className: "propeller-cluster-info__skeleton-line h-8 bg-surface-hover rounded w-3/4" })
@@ -10869,7 +10895,7 @@ function ClusterOptions(rawProps) {
10869
10895
  }
10870
10896
  }
10871
10897
  const renderedOptions = getOptionsForRender();
10872
- return /* @__PURE__ */ jsx("div", { className: `propeller-cluster-options ${props.className || ""}`, children: renderedOptions.length > 0 ? /* @__PURE__ */ jsx("div", { className: "propeller-cluster-options__content flex flex-col gap-6", children: renderedOptions.map((option) => /* @__PURE__ */ jsxs(
10898
+ return /* @__PURE__ */ jsx("div", { className: cn(`propeller-cluster-options ${props.className || ""}`), children: renderedOptions.length > 0 ? /* @__PURE__ */ jsx("div", { className: "propeller-cluster-options__content flex flex-col gap-6", children: renderedOptions.map((option) => /* @__PURE__ */ jsxs(
10873
10899
  "div",
10874
10900
  {
10875
10901
  className: "propeller-cluster-options__group",
@@ -11362,7 +11388,7 @@ function FavoriteListItem(rawProps) {
11362
11388
  {
11363
11389
  onClick: (e) => handleItemClick(e),
11364
11390
  "data-type": isProduct ? "product" : "cluster",
11365
- className: `propeller-favorite-list-item flex flex-row items-center gap-4 rounded-container border border-border bg-card p-4 transition-colors hover:border-secondary/20 hover:shadow-sm cursor-pointer ${props.className || ""}`,
11391
+ className: cn(`propeller-favorite-list-item flex flex-row items-center gap-4 rounded-container border border-border bg-card p-4 transition-colors hover:border-secondary/20 hover:shadow-sm cursor-pointer ${props.className || ""}`),
11366
11392
  children: rawProps.children
11367
11393
  }
11368
11394
  ) });
@@ -11372,7 +11398,7 @@ function FavoriteListItem(rawProps) {
11372
11398
  {
11373
11399
  onClick: (e) => handleItemClick(e),
11374
11400
  "data-type": isProduct ? "product" : "cluster",
11375
- className: `propeller-favorite-list-item flex flex-row items-center gap-4 rounded-container border border-border bg-card p-4 transition-colors hover:border-secondary/20 hover:shadow-sm cursor-pointer ${props.className || ""}`,
11401
+ className: cn(`propeller-favorite-list-item flex flex-row items-center gap-4 rounded-container border border-border bg-card p-4 transition-colors hover:border-secondary/20 hover:shadow-sm cursor-pointer ${props.className || ""}`),
11376
11402
  children: [
11377
11403
  /* @__PURE__ */ jsx(FavoriteListItemImage, {}),
11378
11404
  /* @__PURE__ */ jsxs("div", { className: "propeller-favorite-list-item__body flex flex-col gap-0.5 min-w-0 flex-1", children: [
@@ -11886,7 +11912,7 @@ function FavoriteListDetails(rawProps) {
11886
11912
  fetchList();
11887
11913
  }
11888
11914
  }, [props.favoriteListId]);
11889
- return /* @__PURE__ */ jsxs("div", { className: `propeller-favorite-list-details ${props.className || ""}`, "data-loading": loading ? "true" : "false", children: [
11915
+ return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-favorite-list-details ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
11890
11916
  loading ? /* @__PURE__ */ jsx("div", { className: "propeller-favorite-list-details__skeleton space-y-4", children: [1, 2, 3]?.map((i) => /* @__PURE__ */ jsxs(
11891
11917
  "div",
11892
11918
  {
@@ -12331,7 +12357,7 @@ function FavoriteLists(rawProps) {
12331
12357
  setNewSetAsDefault(false);
12332
12358
  closeCreateModal();
12333
12359
  }
12334
- return /* @__PURE__ */ jsxs("div", { className: `propeller-favorite-lists ${props.className || ""}`, "data-loading": loading ? "true" : "false", children: [
12360
+ return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-favorite-lists ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
12335
12361
  props.allowFavoriteListCreate !== false && !loading && displayedLists.length > 0 ? /* @__PURE__ */ jsx("div", { className: "propeller-favorite-lists__toolbar flex justify-end mb-4", children: /* @__PURE__ */ jsxs(
12336
12362
  "button",
12337
12363
  {
@@ -12854,7 +12880,7 @@ function ForgotPassword(rawProps) {
12854
12880
  }
12855
12881
  var ForgotPassword_default = ForgotPassword;
12856
12882
  function GridTitle(props) {
12857
- return /* @__PURE__ */ jsx("div", { className: `propeller-grid-title mb-8 ${props.className || ""}`, children: /* @__PURE__ */ jsxs("div", { className: "propeller-grid-title__row flex items-baseline gap-3 mb-3", children: [
12883
+ return /* @__PURE__ */ jsx("div", { className: cn(`propeller-grid-title mb-8 ${props.className || ""}`), children: /* @__PURE__ */ jsxs("div", { className: "propeller-grid-title__row flex items-baseline gap-3 mb-3", children: [
12858
12884
  props.headingLevel === "h2" ? /* @__PURE__ */ jsx("h2", { className: "propeller-grid-title__heading text-3xl sm:text-4xl font-bold tracking-tight", children: props.title }) : null,
12859
12885
  props.headingLevel !== "h2" ? /* @__PURE__ */ jsx("h1", { className: "propeller-grid-title__heading text-3xl sm:text-4xl font-bold tracking-tight", children: props.title }) : null
12860
12886
  ] }) });
@@ -13261,7 +13287,7 @@ function Menu(rawProps) {
13261
13287
  return /* @__PURE__ */ jsx(
13262
13288
  "div",
13263
13289
  {
13264
- className: `propeller-menu ${props.className || ""}`,
13290
+ className: cn(`propeller-menu ${props.className || ""}`),
13265
13291
  "data-variant": props.menuStyle || "custom",
13266
13292
  "data-loading": isLoading ? "true" : "false",
13267
13293
  children: customMenu
@@ -13271,7 +13297,7 @@ function Menu(rawProps) {
13271
13297
  return /* @__PURE__ */ jsxs(
13272
13298
  "div",
13273
13299
  {
13274
- className: `propeller-menu ${props.className || ""}`,
13300
+ className: cn(`propeller-menu ${props.className || ""}`),
13275
13301
  "data-variant": getMenuStyle(),
13276
13302
  "data-loading": isLoading ? "true" : "false",
13277
13303
  children: [
@@ -13417,7 +13443,7 @@ function OrderActions(rawProps) {
13417
13443
  // (the bug screenshot showed "Order / confirmation / (PDF)" on three lines).
13418
13444
  // `whitespace-nowrap` on the buttons is the belt-and-braces guarantee that
13419
13445
  // text never wraps even in narrow containers without flex sizing.
13420
- /* @__PURE__ */ jsxs("div", { className: `propeller-order-actions flex-shrink-0 ${props.className || ""}`, children: [
13446
+ /* @__PURE__ */ jsxs("div", { className: cn(`propeller-order-actions flex-shrink-0 ${props.className || ""}`), children: [
13421
13447
  /* @__PURE__ */ jsxs("div", { className: "propeller-order-actions__actions flex flex-row items-center gap-3 flex-shrink-0", children: [
13422
13448
  /* @__PURE__ */ jsxs(
13423
13449
  "button",
@@ -13667,7 +13693,7 @@ function OrderBonusItems(rawProps) {
13667
13693
  const bonusItems = getNettedBonusItems(allItems);
13668
13694
  if (bonusItems.length === 0) return null;
13669
13695
  const OrderItemCardImpl = props.orderItemCardComponent ?? OrderItemCard_default;
13670
- return /* @__PURE__ */ jsxs("div", { className: `propeller-order-bonus-items ${props.className || "mb-8"}`, children: [
13696
+ return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-order-bonus-items ${props.className || "mb-8"}`), children: [
13671
13697
  /* @__PURE__ */ jsx("h3", { className: "propeller-order-bonus-items__title text-lg font-bold mb-3 text-foreground", children: getLabel(props.labels, "title", "Bonus items") }),
13672
13698
  /* @__PURE__ */ jsx("div", { className: "propeller-order-bonus-items__table bg-card rounded-container shadow overflow-hidden", children: /* @__PURE__ */ jsx("table", { className: "w-full", children: bonusItems.map((item) => /* @__PURE__ */ jsx(
13673
13699
  OrderItemCardImpl,
@@ -13757,7 +13783,7 @@ function OrderList(rawProps) {
13757
13783
  }
13758
13784
  return fields;
13759
13785
  }
13760
- return /* @__PURE__ */ jsxs("div", { className: `propeller-order-list ${props.className || ""}`, "data-loading": loading ? "true" : "false", children: [
13786
+ return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-order-list ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
13761
13787
  props.enableSearch && searchFields().length > 0 ? /* @__PURE__ */ jsxs("div", { className: "propeller-order-list__filters mb-6 bg-card p-4 rounded-container shadow space-y-4", children: [
13762
13788
  searchFields().includes("term") ? /* @__PURE__ */ jsxs("div", { className: "propeller-order-list__search-field w-full", children: [
13763
13789
  /* @__PURE__ */ jsx("label", { className: "propeller-order-list__filter-label block text-sm font-medium text-muted-foreground capitalize mb-1", children: getColumnLabel("term") }),
@@ -14347,6 +14373,7 @@ function QuickOrderInner(props) {
14347
14373
  target: "_blank",
14348
14374
  rel: "noopener nofollow",
14349
14375
  className: "text-primary hover:underline text-sm inline-block mb-4",
14376
+ onClick: () => props.onTemplateDownload?.(),
14350
14377
  children: L("downloadTemplate", "Download XLSX template")
14351
14378
  }
14352
14379
  ) : null,
@@ -14510,7 +14537,7 @@ function OrderShipments(props) {
14510
14537
  const code = tat.code || "";
14511
14538
  return `${baseUrl}${code}`;
14512
14539
  }
14513
- return /* @__PURE__ */ jsxs("div", { className: `order-shipments ${props.className || ""}`, children: [
14540
+ return /* @__PURE__ */ jsxs("div", { className: cn(`order-shipments ${props.className || ""}`), children: [
14514
14541
  shipments.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
14515
14542
  /* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold", children: getLabel(props.labels, "title", "Shipping details") }),
14516
14543
  /* @__PURE__ */ jsx("div", { className: "overflow-x-auto rounded-lg border border-border bg-card shadow-sm", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-sm", children: [
@@ -14911,7 +14938,7 @@ function PriceToggle(props) {
14911
14938
  return /* @__PURE__ */ jsxs(
14912
14939
  "div",
14913
14940
  {
14914
- className: `propeller-price-toggle flex items-center gap-2 ${props.className || ""}`,
14941
+ className: cn(`propeller-price-toggle flex items-center gap-2 ${props.className || ""}`),
14915
14942
  "data-state": isOn ? "on" : "off",
14916
14943
  children: [
14917
14944
  /* @__PURE__ */ jsx("span", { className: "propeller-price-toggle__label hidden sm:inline text-xs", children: label }),
@@ -15003,7 +15030,7 @@ function ProductBulkPrices(props) {
15003
15030
  return /* @__PURE__ */ jsx(Fragment, { children: !isHidden2 && hasItems ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
15004
15031
  "div",
15005
15032
  {
15006
- className: `propeller-product-bulk-prices ${props.className || ""}`,
15033
+ className: cn(`propeller-product-bulk-prices ${props.className || ""}`),
15007
15034
  "data-include-tax": includeTax ? "true" : "false",
15008
15035
  children: [
15009
15036
  getLabel(props.labels, "title", "Volume pricing") ? /* @__PURE__ */ jsx("h3", { className: "propeller-product-bulk-prices__title text-base font-semibold text-foreground mb-3", children: getLabel(props.labels, "title", "Volume pricing") }) : null,
@@ -15150,7 +15177,7 @@ function ProductBundles(rawProps) {
15150
15177
  useEffect(() => {
15151
15178
  fetchBundles(props.productId);
15152
15179
  }, [props.productId]);
15153
- return /* @__PURE__ */ jsx(Fragment, { children: isMounted && !isLoading && bundles.length > 0 ? /* @__PURE__ */ jsxs("div", { className: `propeller-product-bundles ${props.className || "mb-12"}`, children: [
15180
+ return /* @__PURE__ */ jsx(Fragment, { children: isMounted && !isLoading && bundles.length > 0 ? /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-bundles ${props.className || "mb-12"}`), children: [
15154
15181
  bundles.map((bundle, bundleIdx) => {
15155
15182
  const bundlePrice = getBundlePrice(bundle, includeTax);
15156
15183
  const originalPrice = getOriginalPrice(bundle, includeTax);
@@ -15449,7 +15476,7 @@ function ProductDescription(props) {
15449
15476
  return /* @__PURE__ */ jsx(Fragment, { children: !!html ? /* @__PURE__ */ jsxs(
15450
15477
  "div",
15451
15478
  {
15452
- className: `propeller-product-description ${props.className || ""}`,
15479
+ className: cn(`propeller-product-description ${props.className || ""}`),
15453
15480
  "data-expanded": expanded ? "true" : "false",
15454
15481
  "data-truncatable": shouldTruncate ? "true" : "false",
15455
15482
  children: [
@@ -15488,7 +15515,7 @@ function ProductDownloads(props) {
15488
15515
  const match = alts.find((a) => a.language === lang);
15489
15516
  return match?.value || alts?.[0]?.value || "Download";
15490
15517
  }
15491
- return /* @__PURE__ */ jsxs("div", { className: `propeller-product-downloads ${props.className || ""}`, children: [
15518
+ return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-downloads ${props.className || ""}`), children: [
15492
15519
  hasItems ? /* @__PURE__ */ jsx("h3", { className: "propeller-product-downloads__title text-base font-semibold text-foreground mb-3", children: getLabel(props.labels, "title", "Downloads") }) : null,
15493
15520
  hasItems ? /* @__PURE__ */ jsx("ul", { className: "propeller-product-downloads__list space-y-2", children: items.map((doc, index) => /* @__PURE__ */ jsx("li", { className: "propeller-product-downloads__item", children: !!getDocumentUrl(doc) ? /* @__PURE__ */ jsxs(
15494
15521
  "a",
@@ -15559,7 +15586,7 @@ function ProductGallery(props) {
15559
15586
  if (images.length === 0) return;
15560
15587
  setSelectedIndex((idx) => (idx + 1) % images.length);
15561
15588
  }
15562
- return /* @__PURE__ */ jsxs("div", { className: `propeller-product-gallery ${props.className || ""}`, children: [
15589
+ return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-gallery ${props.className || ""}`), children: [
15563
15590
  /* @__PURE__ */ jsxs("div", { className: "propeller-product-gallery__stage relative aspect-square bg-card overflow-hidden", children: [
15564
15591
  images.length === 0 ? /* @__PURE__ */ jsx("div", { className: "propeller-product-gallery__empty flex h-full w-full items-center justify-center bg-surface-hover", children: /* @__PURE__ */ jsx(
15565
15592
  "svg",
@@ -15894,13 +15921,13 @@ function ProductInfo(rawProps) {
15894
15921
  }
15895
15922
  };
15896
15923
  if (rawProps.children !== void 0) {
15897
- return /* @__PURE__ */ jsx(ProductInfoContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ProductGridConfigProvider, { value: pdpConfig, children: /* @__PURE__ */ jsxs("div", { className: `propeller-product-info ${props.className || ""}`, children: [
15924
+ return /* @__PURE__ */ jsx(ProductInfoContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ProductGridConfigProvider, { value: pdpConfig, children: /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-info ${props.className || ""}`), children: [
15898
15925
  props.beforeContent ? props.beforeContent(product) : null,
15899
15926
  rawProps.children,
15900
15927
  props.afterContent ? props.afterContent(product) : null
15901
15928
  ] }) }) });
15902
15929
  }
15903
- return /* @__PURE__ */ jsx(ProductInfoContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ProductGridConfigProvider, { value: pdpConfig, children: /* @__PURE__ */ jsxs("div", { className: `propeller-product-info ${props.className || ""}`, children: [
15930
+ return /* @__PURE__ */ jsx(ProductInfoContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ProductGridConfigProvider, { value: pdpConfig, children: /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-info ${props.className || ""}`), children: [
15904
15931
  props.beforeContent ? props.beforeContent(product) : null,
15905
15932
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
15906
15933
  /* @__PURE__ */ jsxs("div", { className: "propeller-product-info__media relative", children: [
@@ -15922,7 +15949,7 @@ function ProductInfo(rawProps) {
15922
15949
  props.afterContent ? props.afterContent(product) : null
15923
15950
  ] }) }) });
15924
15951
  }
15925
- return /* @__PURE__ */ jsxs("div", { className: `propeller-product-info ${props.className || ""}`, "data-loading": loading ? "true" : "false", children: [
15952
+ return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-info ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
15926
15953
  loading && !props.product ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-info__skeleton animate-pulse space-y-3", children: [
15927
15954
  /* @__PURE__ */ jsx("div", { className: "propeller-product-info__skeleton-line h-4 bg-surface-hover rounded w-1/4" }),
15928
15955
  /* @__PURE__ */ jsx("div", { className: "propeller-product-info__skeleton-line h-8 bg-surface-hover rounded w-3/4" })
@@ -16198,7 +16225,7 @@ function ProductShortDescription(props) {
16198
16225
  "div",
16199
16226
  {
16200
16227
  dangerouslySetInnerHTML: { __html: html },
16201
- className: `propeller-product-short-description prose prose-slate max-w-none text-muted-foreground ${props.className || ""}`
16228
+ className: cn(`propeller-product-short-description prose prose-slate max-w-none text-muted-foreground ${props.className || ""}`)
16202
16229
  }
16203
16230
  ) : null });
16204
16231
  }
@@ -16365,7 +16392,7 @@ function ProductSlider(rawProps) {
16365
16392
  }, [sliderId, items().length]);
16366
16393
  return /* @__PURE__ */ jsxs(Fragment, { children: [
16367
16394
  " ",
16368
- !(isCrossUpsellMode() && !isLoading && items().length === 0) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: `propeller-product-slider ${props.containerClassName || "mb-12"}`, "data-loading": isLoading ? "true" : "false", children: [
16395
+ !(isCrossUpsellMode() && !isLoading && items().length === 0) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-slider ${props.containerClassName || "mb-12"}`), "data-loading": isLoading ? "true" : "false", children: [
16369
16396
  sliderTitle() || items().length > 0 ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-slider__header flex items-center justify-between mb-6", children: [
16370
16397
  sliderTitle() ? /* @__PURE__ */ jsx("h2", { className: "propeller-product-slider__title text-2xl font-bold", children: sliderTitle() }) : null,
16371
16398
  items().length > desktopCount() ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-slider__nav flex gap-2", children: [
@@ -16553,7 +16580,7 @@ function ProductSpecifications(rawProps) {
16553
16580
  return /* @__PURE__ */ jsx(Fragment, { children: !loading && (hasPublicAttributes() || props.packageDescription || hasSlotContent) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
16554
16581
  "div",
16555
16582
  {
16556
- className: `propeller-product-specifications ${props.className || ""}`,
16583
+ className: cn(`propeller-product-specifications ${props.className || ""}`),
16557
16584
  "data-layout": props.layout === "list" ? "list" : "table",
16558
16585
  "data-grouped": props.grouping ? "true" : "false",
16559
16586
  children: [
@@ -16634,7 +16661,7 @@ function ProductVideos(props) {
16634
16661
  }
16635
16662
  return uri;
16636
16663
  }
16637
- return /* @__PURE__ */ jsxs("div", { className: `propeller-product-videos ${props.className || ""}`, children: [
16664
+ return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-videos ${props.className || ""}`), children: [
16638
16665
  hasItems ? /* @__PURE__ */ jsx("h3", { className: "propeller-product-videos__title text-base font-semibold text-foreground mb-3", children: getLabel(props.labels, "title", "Videos") }) : null,
16639
16666
  hasItems ? /* @__PURE__ */ jsx("div", { className: "propeller-product-videos__list space-y-4", children: items.map((video, index) => /* @__PURE__ */ jsx(
16640
16667
  "div",
@@ -16732,7 +16759,7 @@ function ProductTabs(rawProps) {
16732
16759
  return /* @__PURE__ */ jsx(Fragment, { children: props.product ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
16733
16760
  "div",
16734
16761
  {
16735
- className: `propeller-product-tabs ${props.className || ""}`,
16762
+ className: cn(`propeller-product-tabs ${props.className || ""}`),
16736
16763
  "data-active-tab": activeTab,
16737
16764
  children: [
16738
16765
  /* @__PURE__ */ jsxs("div", { className: "propeller-product-tabs__desktop hidden md:block", children: [
@@ -17038,7 +17065,7 @@ function PurchaseAuthorizationConfigurator(rawProps) {
17038
17065
  onPurchaseAuthorizationDelete: props.onPurchaseAuthorizationDelete,
17039
17066
  afterPurchaseAuthorizationDelete: props.afterPurchaseAuthorizationDelete
17040
17067
  });
17041
- return /* @__PURE__ */ jsx("div", { className: `propeller-purchase-authorization-configurator ${props.className || ""}`, children: isAuthManager ? /* @__PURE__ */ jsxs(Fragment, { children: [
17068
+ return /* @__PURE__ */ jsx("div", { className: cn(`propeller-purchase-authorization-configurator ${props.className || ""}`), children: isAuthManager ? /* @__PURE__ */ jsxs(Fragment, { children: [
17042
17069
  /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
17043
17070
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
17044
17071
  /* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold", children: getLabel(props.labels, "title", "Purchase Authorization Settings") }),
@@ -17405,7 +17432,7 @@ function PurchaseAuthorizationRequests(rawProps) {
17405
17432
  if (fromBundle) return fromBundle;
17406
17433
  return item?.product?.sku || "";
17407
17434
  }
17408
- return /* @__PURE__ */ jsx("div", { className: `propeller-purchase-authorization-requests ${props.className || ""}`, children: isAuthManager ? /* @__PURE__ */ jsxs("div", { className: "propeller-purchase-authorization-requests__content space-y-4", children: [
17435
+ return /* @__PURE__ */ jsx("div", { className: cn(`propeller-purchase-authorization-requests ${props.className || ""}`), children: isAuthManager ? /* @__PURE__ */ jsxs("div", { className: "propeller-purchase-authorization-requests__content space-y-4", children: [
17409
17436
  !props.hideTitle ? /* @__PURE__ */ jsx("h2", { className: "propeller-purchase-authorization-requests__title text-xl font-semibold", children: getLabel(props.labels, "title", "Authorization Requests") }) : null,
17410
17437
  loading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx("div", { className: "w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin" }) }) : null,
17411
17438
  !loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -18725,7 +18752,7 @@ function SearchBar(rawProps) {
18725
18752
  {
18726
18753
  ref: containerRef,
18727
18754
  "data-search-bar": true,
18728
- className: `propeller-search-bar ${props.containerClassName || "relative flex-1 max-w-2xl mx-8"}`,
18755
+ className: cn(`propeller-search-bar ${props.containerClassName || "relative flex-1 max-w-2xl mx-8"}`),
18729
18756
  "data-open": showDropdown ? "true" : "false",
18730
18757
  children: [
18731
18758
  /* @__PURE__ */ jsx("form", { className: "propeller-search-bar__form", onSubmit: (e) => handleSubmit(e), children: /* @__PURE__ */ jsxs("div", { className: "propeller-search-bar__input-wrapper relative", children: [