@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.cjs CHANGED
@@ -5,6 +5,8 @@ var propellerV2CoreUi = require('@propeller-commerce/propeller-v2-core-ui');
5
5
  var React6 = require('react');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var propellerSdkV2 = require('@propeller-commerce/propeller-sdk-v2');
8
+ var clsx = require('clsx');
9
+ var tailwindMerge = require('tailwind-merge');
8
10
  var lucideReact = require('lucide-react');
9
11
 
10
12
  function _interopNamespace(e) {
@@ -1410,7 +1412,7 @@ function useFavorites(options) {
1410
1412
  if (onEdit) {
1411
1413
  onEdit(listId, data);
1412
1414
  cancelEdit();
1413
- onListChanged?.();
1415
+ onListChanged?.({ action: "updated", listId, ...data });
1414
1416
  return;
1415
1417
  }
1416
1418
  setSaving(true);
@@ -1425,7 +1427,7 @@ function useFavorites(options) {
1425
1427
  const updated = await service.updateFavoriteList(listId, { name: data.name, isDefault: data.isDefault });
1426
1428
  setLists((prev) => prev.map((l) => String(l.id) === listId ? updated : l));
1427
1429
  cancelEdit();
1428
- onListChanged?.();
1430
+ onListChanged?.({ action: "updated", listId, name: data.name, isDefault: data.isDefault });
1429
1431
  } catch (e) {
1430
1432
  setError(e instanceof Error ? e.message : "Failed to update list");
1431
1433
  } finally {
@@ -1442,7 +1444,7 @@ function useFavorites(options) {
1442
1444
  if (onDelete) {
1443
1445
  onDelete(listId);
1444
1446
  setListToDelete(null);
1445
- onListChanged?.();
1447
+ onListChanged?.({ action: "deleted", listId, name: list.name });
1446
1448
  return;
1447
1449
  }
1448
1450
  setSaving(true);
@@ -1451,7 +1453,7 @@ function useFavorites(options) {
1451
1453
  try {
1452
1454
  const service = propellerV2CoreUi.createServices(graphqlClient).favoriteList;
1453
1455
  await service.deleteFavoriteList(listId);
1454
- onListChanged?.();
1456
+ onListChanged?.({ action: "deleted", listId, name: list.name });
1455
1457
  } catch (e) {
1456
1458
  setError(e instanceof Error ? e.message : "Failed to delete list");
1457
1459
  setLists((prev) => [...prev, list]);
@@ -1464,7 +1466,7 @@ function useFavorites(options) {
1464
1466
  const data = { name, isDefault };
1465
1467
  if (onCreate) {
1466
1468
  onCreate(data);
1467
- onListChanged?.();
1469
+ onListChanged?.({ action: "created", name, isDefault });
1468
1470
  return;
1469
1471
  }
1470
1472
  setSaving(true);
@@ -1481,7 +1483,7 @@ function useFavorites(options) {
1481
1483
  if (propellerV2CoreUi.isCustomer(user)) createInput.customerId = user.customerId;
1482
1484
  const created = await service.createFavoriteList(createInput);
1483
1485
  setLists((prev) => [...prev, created]);
1484
- onListChanged?.();
1486
+ onListChanged?.({ action: "created", listId: created?.id, name, isDefault });
1485
1487
  } catch (e) {
1486
1488
  setError(e instanceof Error ? e.message : "Failed to create list");
1487
1489
  } finally {
@@ -2203,6 +2205,15 @@ function useProductInfo(options) {
2203
2205
  clusterImageUrl
2204
2206
  };
2205
2207
  }
2208
+
2209
+ // src/composables/shared/utils/listingUserId.ts
2210
+ function resolveListingUserId(user, configuration) {
2211
+ if (user && "contactId" in user) return user.contactId;
2212
+ if (user && "customerId" in user) return user.customerId;
2213
+ return configuration?.anonymousUserId;
2214
+ }
2215
+
2216
+ // src/composables/react/useProductSearch.ts
2206
2217
  var inflightFetches2 = /* @__PURE__ */ new Set();
2207
2218
  function buildAttributeInput(names) {
2208
2219
  if (!names || names.length === 0) return void 0;
@@ -2307,7 +2318,7 @@ function useProductSearch(options) {
2307
2318
  ] : [];
2308
2319
  const priceFilter = options.priceFilterMin !== void 0 || options.priceFilterMax !== void 0 ? { from: options.priceFilterMin ?? 0, to: options.priceFilterMax ?? 999999 } : void 0;
2309
2320
  const inventoryFilter = propellerV2CoreUi.buildInventoryFilter(options.availability, options.minStock);
2310
- const userId = options.user && "contactId" in options.user ? options.user.contactId : options.user && "customerId" in options.user ? options.user.customerId : void 0;
2321
+ const userId = resolveListingUserId(options.user, configuration);
2311
2322
  const contactId = options.user && "contactId" in options.user ? options.user.contactId : void 0;
2312
2323
  const customerId = options.user && "customerId" in options.user ? options.user.customerId : void 0;
2313
2324
  const orderlistScope = options.orderlistIds && options.orderlistIds.length > 0 ? {
@@ -2444,7 +2455,7 @@ function useProductSearch(options) {
2444
2455
  applyOrderlists: options.applyOrderlists !== false,
2445
2456
  orderlistIds: options.orderlistIds
2446
2457
  } : { applyOrderlists: false };
2447
- const userId = options.user && "contactId" in options.user ? options.user.contactId : options.user && "customerId" in options.user ? options.user.customerId : void 0;
2458
+ const userId = resolveListingUserId(options.user, configuration);
2448
2459
  const contactId = options.user && "contactId" in options.user ? options.user.contactId : void 0;
2449
2460
  const customerId = options.user && "customerId" in options.user ? options.user.customerId : void 0;
2450
2461
  const inventoryFilter = propellerV2CoreUi.buildInventoryFilter(options.availability, options.minStock);
@@ -2610,7 +2621,7 @@ function useQuickOrder(options) {
2610
2621
  try {
2611
2622
  const service = propellerV2CoreUi.createServices(graphqlClient).category;
2612
2623
  const orderlistScope = orderlistIds && orderlistIds.length > 0 ? { applyOrderlists: applyOrderlists !== false, orderlistIds } : { applyOrderlists: false };
2613
- const userId = user && "contactId" in user ? user.contactId : user && "customerId" in user ? user.customerId : void 0;
2624
+ const userId = resolveListingUserId(user, configuration);
2614
2625
  const contactId = user && "contactId" in user ? user.contactId : void 0;
2615
2626
  const customerId = user && "customerId" in user ? user.customerId : void 0;
2616
2627
  const input = {
@@ -2752,7 +2763,7 @@ function useSpareParts(options) {
2752
2763
  [isControlled, options.parts, internalParts]
2753
2764
  );
2754
2765
  const isLoading = !isControlled && internalLoading;
2755
- const userId = options.user && "contactId" in options.user ? options.user.contactId : options.user && "customerId" in options.user ? options.user.customerId : void 0;
2766
+ const userId = resolveListingUserId(options.user, options.configuration);
2756
2767
  const contactId = options.user && "contactId" in options.user ? options.user.contactId : void 0;
2757
2768
  const customerId = options.user && "customerId" in options.user ? options.user.customerId : void 0;
2758
2769
  const userKey = `${contactId ?? ""}:${customerId ?? ""}`;
@@ -3055,9 +3066,7 @@ function useProductSlider(options) {
3055
3066
  }
3056
3067
  }
3057
3068
  function resolveUserId() {
3058
- if (options.user && "contactId" in options.user) return options.user.contactId;
3059
- if (options.user && "customerId" in options.user) return options.user.customerId;
3060
- return void 0;
3069
+ return resolveListingUserId(options.user, options.configuration);
3061
3070
  }
3062
3071
  const fetchCrossupsells = React6.useCallback(async (input) => {
3063
3072
  setLoading(true);
@@ -4044,6 +4053,9 @@ LoginFormExport.RegisterLink = LoginFormRegisterLink;
4044
4053
  LoginFormExport.GuestCheckoutButton = LoginFormGuestCheckoutButton;
4045
4054
  LoginFormExport.ErrorMessage = LoginFormErrorMessage;
4046
4055
  var LoginForm_default = LoginFormExport;
4056
+ function cn(...inputs) {
4057
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
4058
+ }
4047
4059
  function AccountIconAndMenu(rawProps) {
4048
4060
  const props = useInfraProps(rawProps);
4049
4061
  const LoginFormImpl = props.loginFormComponent ?? LoginForm_default;
@@ -4192,7 +4204,7 @@ function AccountIconAndMenu(rawProps) {
4192
4204
  onClick: (event) => handleIconClick(),
4193
4205
  "aria-label": propellerV2CoreUi.getLabel(props.labels, "accountLabel", "Account"),
4194
4206
  "data-open": menuOpen ? "true" : "false",
4195
- 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 : ""}`,
4207
+ 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 : ""}`),
4196
4208
  children: [
4197
4209
  /* @__PURE__ */ jsxRuntime.jsx(
4198
4210
  "svg",
@@ -4220,7 +4232,7 @@ function AccountIconAndMenu(rawProps) {
4220
4232
  menuOpen ? /* @__PURE__ */ jsxRuntime.jsxs(
4221
4233
  "div",
4222
4234
  {
4223
- 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 : ""}`,
4235
+ 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 : ""}`),
4224
4236
  children: [
4225
4237
  !!props.user ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4226
4238
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-account-menu__user pb-3 mb-3 border-b border-border", children: [
@@ -4581,7 +4593,7 @@ function AddToCart(rawProps) {
4581
4593
  return /* @__PURE__ */ jsxRuntime.jsxs(
4582
4594
  "div",
4583
4595
  {
4584
- className: `propeller-add-to-cart ${props.className || ""}`,
4596
+ className: cn(`propeller-add-to-cart ${props.className || ""}`),
4585
4597
  "data-loading": loading ? "true" : "false",
4586
4598
  children: [
4587
4599
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-add-to-cart__controls flex flex-wrap items-center gap-2 w-full md:flex-nowrap", children: [
@@ -4951,7 +4963,14 @@ function AddToFavorite(rawProps) {
4951
4963
  setMemberListIds(newMemberIds);
4952
4964
  setSelectedListId("");
4953
4965
  setIsOpen(false);
4954
- if (props.onFavoriteChanged) props.onFavoriteChanged();
4966
+ if (props.onFavoriteChanged) {
4967
+ props.onFavoriteChanged({
4968
+ action: "added",
4969
+ listId: selectedListId,
4970
+ productId: props.productId,
4971
+ clusterId: props.clusterId
4972
+ });
4973
+ }
4955
4974
  } catch (error) {
4956
4975
  console.error("Error adding to favorite list:", error);
4957
4976
  } finally {
@@ -4968,7 +4987,14 @@ function AddToFavorite(rawProps) {
4968
4987
  setMemberListIds(newMemberIds);
4969
4988
  setSelectedListId("");
4970
4989
  setIsOpen(false);
4971
- if (props.onFavoriteChanged) props.onFavoriteChanged();
4990
+ if (props.onFavoriteChanged) {
4991
+ props.onFavoriteChanged({
4992
+ action: "removed",
4993
+ listId,
4994
+ productId: props.productId,
4995
+ clusterId: props.clusterId
4996
+ });
4997
+ }
4972
4998
  } catch (error) {
4973
4999
  console.error("Error removing from favorite list:", error);
4974
5000
  } finally {
@@ -5008,7 +5034,7 @@ function AddToFavorite(rawProps) {
5008
5034
  type: "button",
5009
5035
  onClick: (event) => toggleModal(),
5010
5036
  title: isFavorited() ? propellerV2CoreUi.getLabel(props.labels, "removeFromFavorites", "Remove from favorites") : propellerV2CoreUi.getLabel(props.labels, "addToFavorites", "Add to favorites"),
5011
- 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 || ""}`,
5037
+ 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 || ""}`),
5012
5038
  children: [
5013
5039
  isFavorited() ? /* @__PURE__ */ jsxRuntime.jsx(
5014
5040
  "svg",
@@ -6157,7 +6183,7 @@ function AddressSelector(props) {
6157
6183
  setIsLoading(false);
6158
6184
  }
6159
6185
  }
6160
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-address-selector ${props.className || ""}`, children: [
6186
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-address-selector ${props.className || ""}`), children: [
6161
6187
  /* @__PURE__ */ jsxRuntime.jsxs(
6162
6188
  "button",
6163
6189
  {
@@ -6300,7 +6326,7 @@ function Breadcrumbs(props) {
6300
6326
  return index === displayItems.length - 1;
6301
6327
  }
6302
6328
  const showSeparatorBefore = (index) => props.showHome !== false || index > 0;
6303
- return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": propellerV2CoreUi.getLabel(props.labels, "breadcrumbAriaLabel", "Breadcrumb"), className: `propeller-breadcrumbs ${props.className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsxs("ol", { className: "propeller-breadcrumbs__list flex flex-wrap items-center text-sm text-muted-foreground", children: [
6329
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": propellerV2CoreUi.getLabel(props.labels, "breadcrumbAriaLabel", "Breadcrumb"), className: cn(`propeller-breadcrumbs ${props.className || ""}`), children: /* @__PURE__ */ jsxRuntime.jsxs("ol", { className: "propeller-breadcrumbs__list flex flex-wrap items-center text-sm text-muted-foreground", children: [
6304
6330
  props.showHome !== false ? /* @__PURE__ */ jsxRuntime.jsx("li", { className: "propeller-breadcrumbs__item flex items-center", "data-home": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
6305
6331
  "a",
6306
6332
  {
@@ -6378,7 +6404,7 @@ function CartBonusItems(rawProps) {
6378
6404
  const money = (value) => propellerV2CoreUi.formatPrice(value, { symbol: currency });
6379
6405
  const productName = (item) => propellerV2CoreUi.getLocalizedValue(item.product?.names, props.language, "Product");
6380
6406
  const productImage = (item) => item.product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || "";
6381
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-cart-bonus-items ${props.className || "mt-2"}`, children: [
6407
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-cart-bonus-items ${props.className || "mt-2"}`), children: [
6382
6408
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "propeller-cart-bonus-items__title text-lg font-semibold mb-3", children: propellerV2CoreUi.getLabel(props.labels, "title", "Bonus items") }),
6383
6409
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-cart-bonus-items__list space-y-4", children: items.map((item) => {
6384
6410
  const img = productImage(item);
@@ -6525,7 +6551,7 @@ function ItemStock(props) {
6525
6551
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: hasInventory() ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
6526
6552
  "div",
6527
6553
  {
6528
- className: `propeller-item-stock flex flex-wrap items-center gap-1.5 ${props.className || ""}`,
6554
+ className: cn(`propeller-item-stock flex flex-wrap items-center gap-1.5 ${props.className || ""}`),
6529
6555
  "data-available": isAvailable() ? "true" : "false",
6530
6556
  "data-stock": getStockStatusData(),
6531
6557
  children: [
@@ -6854,7 +6880,7 @@ function CartItem(rawProps) {
6854
6880
  return /* @__PURE__ */ jsxRuntime.jsx(CartItemContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
6855
6881
  "div",
6856
6882
  {
6857
- 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 || ""}`,
6883
+ 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 || ""}`),
6858
6884
  "data-bundle": isBundleItem() ? "true" : "false",
6859
6885
  "data-loading": loading ? "true" : "false",
6860
6886
  children: rawProps.children
@@ -6864,7 +6890,7 @@ function CartItem(rawProps) {
6864
6890
  return /* @__PURE__ */ jsxRuntime.jsx(CartItemContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(
6865
6891
  "div",
6866
6892
  {
6867
- 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 || ""}`,
6893
+ 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 || ""}`),
6868
6894
  "data-bundle": isBundleItem() ? "true" : "false",
6869
6895
  "data-loading": loading ? "true" : "false",
6870
6896
  children: [
@@ -7336,7 +7362,7 @@ function CartIconAndSidebar(rawProps) {
7336
7362
  type: "button",
7337
7363
  onClick: () => handleIconClick(),
7338
7364
  "aria-label": propellerV2CoreUi.getLabel(props.labels, "cartIconLabel", "Shopping cart"),
7339
- className: `propeller-cart-icon__trigger relative inline-flex items-center justify-center p-2 rounded-control transition-colors text-foreground${props.iconClassName ? " " + props.iconClassName : ""}`,
7365
+ 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 : ""}`),
7340
7366
  children: [
7341
7367
  /* @__PURE__ */ jsxRuntime.jsx(
7342
7368
  "svg",
@@ -7388,7 +7414,7 @@ function CartIconAndSidebar(rawProps) {
7388
7414
  "aria-modal": "true",
7389
7415
  "aria-label": sidebarTitle,
7390
7416
  "data-open": sidebarOpen ? "true" : "false",
7391
- 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 : ""}`,
7417
+ 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 : ""}`),
7392
7418
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col h-full", children: isMounted ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7393
7419
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-cart-icon__sidebar-header flex items-center justify-between px-5 py-4 border-b border-border", children: [
7394
7420
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
@@ -8020,7 +8046,7 @@ function CategoryDescription(props) {
8020
8046
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !!html ? /* @__PURE__ */ jsxRuntime.jsxs(
8021
8047
  "div",
8022
8048
  {
8023
- className: `propeller-category-description mb-6 ${props.className || ""}`,
8049
+ className: cn(`propeller-category-description mb-6 ${props.className || ""}`),
8024
8050
  "data-expanded": expanded ? "true" : "false",
8025
8051
  "data-truncatable": shouldTruncate ? "true" : "false",
8026
8052
  children: [
@@ -8050,7 +8076,7 @@ function CategoryShortDescription(props) {
8050
8076
  (d) => d.language === props.language
8051
8077
  );
8052
8078
  const html = match?.value || "";
8053
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !!html ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: `propeller-category-short-description mb-6 ${props.className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
8079
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !!html ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(`propeller-category-short-description mb-6 ${props.className || ""}`), children: /* @__PURE__ */ jsxRuntime.jsx(
8054
8080
  "div",
8055
8081
  {
8056
8082
  className: "propeller-category-short-description__content prose prose-slate max-w-none text-muted-foreground",
@@ -8185,7 +8211,7 @@ function ClusterCard(rawProps) {
8185
8211
  return /* @__PURE__ */ jsxRuntime.jsx(ClusterCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
8186
8212
  "div",
8187
8213
  {
8188
- 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 ?? ""}`,
8214
+ 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 ?? ""}`),
8189
8215
  "data-cluster-id": cluster.clusterId,
8190
8216
  "data-layout": isRow ? "row" : "grid",
8191
8217
  children: rawProps.children
@@ -8195,7 +8221,7 @@ function ClusterCard(rawProps) {
8195
8221
  return /* @__PURE__ */ jsxRuntime.jsx(ClusterCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(
8196
8222
  "div",
8197
8223
  {
8198
- 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 || ""}`,
8224
+ 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 || ""}`),
8199
8225
  "data-layout": isRow ? "row" : "grid",
8200
8226
  children: [
8201
8227
  props.showImage !== false ? /* @__PURE__ */ jsxRuntime.jsx(ClusterCardImage, {}) : null,
@@ -8487,7 +8513,7 @@ function MachineCard(props) {
8487
8513
  return /* @__PURE__ */ jsxRuntime.jsx(
8488
8514
  "div",
8489
8515
  {
8490
- className: `propeller-machine-card group relative flex h-full flex-col overflow-hidden rounded-lg border border-border bg-background ${props.className ?? ""}`,
8516
+ className: cn(`propeller-machine-card group relative flex h-full flex-col overflow-hidden rounded-lg border border-border bg-background ${props.className ?? ""}`),
8491
8517
  children: /* @__PURE__ */ jsxRuntime.jsxs(
8492
8518
  "a",
8493
8519
  {
@@ -8548,7 +8574,7 @@ function LoginToOrderButton(props) {
8548
8574
  "button",
8549
8575
  {
8550
8576
  type: "button",
8551
- 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 || ""}`,
8577
+ 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 || ""}`),
8552
8578
  onClick: () => {
8553
8579
  if (props.onLoginClick) props.onLoginClick();
8554
8580
  },
@@ -8609,7 +8635,7 @@ function ProductPriceDisplay(props) {
8609
8635
  function getSecondaryTaxLabel() {
8610
8636
  return props.includeTax ? propellerV2CoreUi.getLabel(props.labels, "exclTax", "excl. VAT") : propellerV2CoreUi.getLabel(props.labels, "inclTax", "incl. VAT");
8611
8637
  }
8612
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-product-price ${props.className || ""}`, "data-hidden": isHidden2() ? "true" : "false", children: [
8638
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-product-price ${props.className || ""}`), "data-hidden": isHidden2() ? "true" : "false", children: [
8613
8639
  isHidden2() && props.showLoginPrompt !== false ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "propeller-product-price__login-prompt text-sm text-muted-foreground italic", children: propellerV2CoreUi.getLabel(props.labels, "loginToSeePrices", "Log in to see prices") }) : null,
8614
8640
  !isHidden2() && !!getLeadingPrice() ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-product-price__content flex flex-col gap-0.5", children: [
8615
8641
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-product-price__primary flex items-baseline gap-2", children: [
@@ -8756,7 +8782,7 @@ function ProductCardRoot(rawProps) {
8756
8782
  return /* @__PURE__ */ jsxRuntime.jsx(ProductCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
8757
8783
  "div",
8758
8784
  {
8759
- 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 || ""}`,
8785
+ 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 || ""}`),
8760
8786
  "data-layout": isRow ? "row" : "grid",
8761
8787
  children: rawProps.children
8762
8788
  }
@@ -8765,7 +8791,7 @@ function ProductCardRoot(rawProps) {
8765
8791
  return /* @__PURE__ */ jsxRuntime.jsx(ProductCardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(
8766
8792
  "div",
8767
8793
  {
8768
- 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 || ""}`,
8794
+ 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 || ""}`),
8769
8795
  "data-layout": isRow ? "row" : "grid",
8770
8796
  children: [
8771
8797
  props.showImage !== false ? /* @__PURE__ */ jsxRuntime.jsx(ProductCardImage, {}) : null,
@@ -9212,7 +9238,7 @@ function ProductGrid(rawProps) {
9212
9238
  return /* @__PURE__ */ jsxRuntime.jsx(ProductGridConfigProvider, { value: gridConfig, children: /* @__PURE__ */ jsxRuntime.jsx(ProductGridSearchContext.Provider, { value: compoundCtx, children: /* @__PURE__ */ jsxRuntime.jsx(
9213
9239
  "div",
9214
9240
  {
9215
- className: `propeller-product-grid w-full ${props.className || ""}`,
9241
+ className: cn(`propeller-product-grid w-full ${props.className || ""}`),
9216
9242
  "data-loading": getIsLoading() ? "true" : "false",
9217
9243
  "data-mode": "compound",
9218
9244
  children: rawProps.children
@@ -9222,7 +9248,7 @@ function ProductGrid(rawProps) {
9222
9248
  return /* @__PURE__ */ jsxRuntime.jsx(ProductGridConfigProvider, { value: gridConfig, children: /* @__PURE__ */ jsxRuntime.jsxs(
9223
9249
  "div",
9224
9250
  {
9225
- className: `propeller-product-grid w-full ${props.className || ""}`,
9251
+ className: cn(`propeller-product-grid w-full ${props.className || ""}`),
9226
9252
  "data-loading": getIsLoading() ? "true" : "false",
9227
9253
  children: [
9228
9254
  getIsLoading() ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: `propeller-product-grid__skeleton-grid ${getGridColsClass()}`, children: getSkeletonItems()?.map((_, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
@@ -9325,7 +9351,7 @@ function ProductGridItems(props) {
9325
9351
  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";
9326
9352
  if (isLoading) {
9327
9353
  const skeletonCount = cols === 2 ? 4 : cols === 4 ? 8 : cols === 5 ? 10 : cols === 6 ? 12 : 6;
9328
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `propeller-product-grid__skeleton-grid ${gridClass} ${props.className ?? ""}`, children: Array.from({ length: skeletonCount }).map((_, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
9354
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(`propeller-product-grid__skeleton-grid ${gridClass} ${props.className ?? ""}`), children: Array.from({ length: skeletonCount }).map((_, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
9329
9355
  "div",
9330
9356
  {
9331
9357
  className: "propeller-product-grid__skeleton-card flex flex-col overflow-hidden rounded-container border border-border bg-card shadow-sm",
@@ -9347,7 +9373,7 @@ function ProductGridItems(props) {
9347
9373
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "propeller-product-grid__empty-message mt-1 text-sm text-muted-foreground", children: propellerV2CoreUi.getLabel(props.labels, "noProductsHelp", "Try adjusting your filters or search term.") })
9348
9374
  ] }) });
9349
9375
  }
9350
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `propeller-product-grid__grid ${gridClass} ${props.className ?? ""}`, children: items.map((item, idx) => {
9376
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(`propeller-product-grid__grid ${gridClass} ${props.className ?? ""}`), children: items.map((item, idx) => {
9351
9377
  const isCluster = "clusterId" in item && !!item.clusterId;
9352
9378
  const key = item.productId || item.clusterId || idx;
9353
9379
  return /* @__PURE__ */ jsxRuntime.jsxs(React6__namespace.Fragment, { children: [
@@ -9608,7 +9634,7 @@ function GridFilters(rawProps) {
9608
9634
  return /* @__PURE__ */ jsxRuntime.jsxs(
9609
9635
  "div",
9610
9636
  {
9611
- className: `propeller-grid-filters space-y-4 ${props.isMobile ? "pb-8" : "sticky top-24"} ${isPending ? "opacity-50 pointer-events-none" : ""} ${props.className || ""}`,
9637
+ className: cn(`propeller-grid-filters space-y-4 ${props.isMobile ? "pb-8" : "sticky top-24"} ${isPending ? "opacity-50 pointer-events-none" : ""} ${props.className || ""}`),
9612
9638
  "data-mobile": props.isMobile ? "true" : "false",
9613
9639
  "data-pending": isPending ? "true" : "false",
9614
9640
  children: [
@@ -10032,7 +10058,7 @@ function GridToolbar(rawProps) {
10032
10058
  return /* @__PURE__ */ jsxRuntime.jsxs(
10033
10059
  "div",
10034
10060
  {
10035
- className: `propeller-grid-toolbar ${props.className || ""}`,
10061
+ className: cn(`propeller-grid-toolbar ${props.className || ""}`),
10036
10062
  "data-view-mode": currentViewMode,
10037
10063
  children: [
10038
10064
  /* @__PURE__ */ jsxRuntime.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: [
@@ -10271,7 +10297,7 @@ function GridPagination(props) {
10271
10297
  return /* @__PURE__ */ jsxRuntime.jsx(
10272
10298
  "div",
10273
10299
  {
10274
- className: `propeller-grid-pagination ${props.className || ""}`,
10300
+ className: cn(`propeller-grid-pagination ${props.className || ""}`),
10275
10301
  "data-variant": variant,
10276
10302
  children: showPagination ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10277
10303
  variant === "compact" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-grid-pagination__compact flex justify-center items-center gap-2", children: [
@@ -10649,7 +10675,7 @@ function ClusterConfigurator(props) {
10649
10675
  initFromProduct(props.defaultProduct);
10650
10676
  }
10651
10677
  }, []);
10652
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `propeller-cluster-configurator ${props.className || ""}`, children: !!props.config?.settings?.length ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-cluster-configurator__content flex flex-col gap-6", children: settingsWithValues?.map((setting) => /* @__PURE__ */ jsxRuntime.jsxs(
10678
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(`propeller-cluster-configurator ${props.className || ""}`), children: !!props.config?.settings?.length ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-cluster-configurator__content flex flex-col gap-6", children: settingsWithValues?.map((setting) => /* @__PURE__ */ jsxRuntime.jsxs(
10653
10679
  "div",
10654
10680
  {
10655
10681
  className: "propeller-cluster-configurator__group",
@@ -10798,7 +10824,7 @@ function ClusterInfo(rawProps) {
10798
10824
  props.onClusterLoaded(fetchedCluster);
10799
10825
  }
10800
10826
  }, [fetchedCluster]);
10801
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-cluster-info ${props.className || ""}`, "data-loading": loading ? "true" : "false", children: [
10827
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-cluster-info ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
10802
10828
  loading && !props.cluster ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-cluster-info__skeleton animate-pulse space-y-3", children: [
10803
10829
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-cluster-info__skeleton-line h-4 bg-surface-hover rounded w-1/4" }),
10804
10830
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-cluster-info__skeleton-line h-8 bg-surface-hover rounded w-3/4" })
@@ -10889,7 +10915,7 @@ function ClusterOptions(rawProps) {
10889
10915
  }
10890
10916
  }
10891
10917
  const renderedOptions = getOptionsForRender();
10892
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `propeller-cluster-options ${props.className || ""}`, children: renderedOptions.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-cluster-options__content flex flex-col gap-6", children: renderedOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
10918
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(`propeller-cluster-options ${props.className || ""}`), children: renderedOptions.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-cluster-options__content flex flex-col gap-6", children: renderedOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
10893
10919
  "div",
10894
10920
  {
10895
10921
  className: "propeller-cluster-options__group",
@@ -11382,7 +11408,7 @@ function FavoriteListItem(rawProps) {
11382
11408
  {
11383
11409
  onClick: (e) => handleItemClick(e),
11384
11410
  "data-type": isProduct ? "product" : "cluster",
11385
- 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 || ""}`,
11411
+ 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 || ""}`),
11386
11412
  children: rawProps.children
11387
11413
  }
11388
11414
  ) });
@@ -11392,7 +11418,7 @@ function FavoriteListItem(rawProps) {
11392
11418
  {
11393
11419
  onClick: (e) => handleItemClick(e),
11394
11420
  "data-type": isProduct ? "product" : "cluster",
11395
- 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 || ""}`,
11421
+ 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 || ""}`),
11396
11422
  children: [
11397
11423
  /* @__PURE__ */ jsxRuntime.jsx(FavoriteListItemImage, {}),
11398
11424
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-favorite-list-item__body flex flex-col gap-0.5 min-w-0 flex-1", children: [
@@ -11906,7 +11932,7 @@ function FavoriteListDetails(rawProps) {
11906
11932
  fetchList();
11907
11933
  }
11908
11934
  }, [props.favoriteListId]);
11909
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-favorite-list-details ${props.className || ""}`, "data-loading": loading ? "true" : "false", children: [
11935
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-favorite-list-details ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
11910
11936
  loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-favorite-list-details__skeleton space-y-4", children: [1, 2, 3]?.map((i) => /* @__PURE__ */ jsxRuntime.jsxs(
11911
11937
  "div",
11912
11938
  {
@@ -12351,7 +12377,7 @@ function FavoriteLists(rawProps) {
12351
12377
  setNewSetAsDefault(false);
12352
12378
  closeCreateModal();
12353
12379
  }
12354
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-favorite-lists ${props.className || ""}`, "data-loading": loading ? "true" : "false", children: [
12380
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-favorite-lists ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
12355
12381
  props.allowFavoriteListCreate !== false && !loading && displayedLists.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-favorite-lists__toolbar flex justify-end mb-4", children: /* @__PURE__ */ jsxRuntime.jsxs(
12356
12382
  "button",
12357
12383
  {
@@ -12874,7 +12900,7 @@ function ForgotPassword(rawProps) {
12874
12900
  }
12875
12901
  var ForgotPassword_default = ForgotPassword;
12876
12902
  function GridTitle(props) {
12877
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `propeller-grid-title mb-8 ${props.className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-grid-title__row flex items-baseline gap-3 mb-3", children: [
12903
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(`propeller-grid-title mb-8 ${props.className || ""}`), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-grid-title__row flex items-baseline gap-3 mb-3", children: [
12878
12904
  props.headingLevel === "h2" ? /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "propeller-grid-title__heading text-3xl sm:text-4xl font-bold tracking-tight", children: props.title }) : null,
12879
12905
  props.headingLevel !== "h2" ? /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "propeller-grid-title__heading text-3xl sm:text-4xl font-bold tracking-tight", children: props.title }) : null
12880
12906
  ] }) });
@@ -13281,7 +13307,7 @@ function Menu(rawProps) {
13281
13307
  return /* @__PURE__ */ jsxRuntime.jsx(
13282
13308
  "div",
13283
13309
  {
13284
- className: `propeller-menu ${props.className || ""}`,
13310
+ className: cn(`propeller-menu ${props.className || ""}`),
13285
13311
  "data-variant": props.menuStyle || "custom",
13286
13312
  "data-loading": isLoading ? "true" : "false",
13287
13313
  children: customMenu
@@ -13291,7 +13317,7 @@ function Menu(rawProps) {
13291
13317
  return /* @__PURE__ */ jsxRuntime.jsxs(
13292
13318
  "div",
13293
13319
  {
13294
- className: `propeller-menu ${props.className || ""}`,
13320
+ className: cn(`propeller-menu ${props.className || ""}`),
13295
13321
  "data-variant": getMenuStyle(),
13296
13322
  "data-loading": isLoading ? "true" : "false",
13297
13323
  children: [
@@ -13437,7 +13463,7 @@ function OrderActions(rawProps) {
13437
13463
  // (the bug screenshot showed "Order / confirmation / (PDF)" on three lines).
13438
13464
  // `whitespace-nowrap` on the buttons is the belt-and-braces guarantee that
13439
13465
  // text never wraps even in narrow containers without flex sizing.
13440
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-order-actions flex-shrink-0 ${props.className || ""}`, children: [
13466
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-order-actions flex-shrink-0 ${props.className || ""}`), children: [
13441
13467
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-order-actions__actions flex flex-row items-center gap-3 flex-shrink-0", children: [
13442
13468
  /* @__PURE__ */ jsxRuntime.jsxs(
13443
13469
  "button",
@@ -13687,7 +13713,7 @@ function OrderBonusItems(rawProps) {
13687
13713
  const bonusItems = propellerV2CoreUi.getNettedBonusItems(allItems);
13688
13714
  if (bonusItems.length === 0) return null;
13689
13715
  const OrderItemCardImpl = props.orderItemCardComponent ?? OrderItemCard_default;
13690
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-order-bonus-items ${props.className || "mb-8"}`, children: [
13716
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-order-bonus-items ${props.className || "mb-8"}`), children: [
13691
13717
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "propeller-order-bonus-items__title text-lg font-bold mb-3 text-foreground", children: propellerV2CoreUi.getLabel(props.labels, "title", "Bonus items") }),
13692
13718
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-order-bonus-items__table bg-card rounded-container shadow overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("table", { className: "w-full", children: bonusItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
13693
13719
  OrderItemCardImpl,
@@ -13777,7 +13803,7 @@ function OrderList(rawProps) {
13777
13803
  }
13778
13804
  return fields;
13779
13805
  }
13780
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-order-list ${props.className || ""}`, "data-loading": loading ? "true" : "false", children: [
13806
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-order-list ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
13781
13807
  props.enableSearch && searchFields().length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-order-list__filters mb-6 bg-card p-4 rounded-container shadow space-y-4", children: [
13782
13808
  searchFields().includes("term") ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-order-list__search-field w-full", children: [
13783
13809
  /* @__PURE__ */ jsxRuntime.jsx("label", { className: "propeller-order-list__filter-label block text-sm font-medium text-muted-foreground capitalize mb-1", children: getColumnLabel("term") }),
@@ -14367,6 +14393,7 @@ function QuickOrderInner(props) {
14367
14393
  target: "_blank",
14368
14394
  rel: "noopener nofollow",
14369
14395
  className: "text-primary hover:underline text-sm inline-block mb-4",
14396
+ onClick: () => props.onTemplateDownload?.(),
14370
14397
  children: L("downloadTemplate", "Download XLSX template")
14371
14398
  }
14372
14399
  ) : null,
@@ -14530,7 +14557,7 @@ function OrderShipments(props) {
14530
14557
  const code = tat.code || "";
14531
14558
  return `${baseUrl}${code}`;
14532
14559
  }
14533
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `order-shipments ${props.className || ""}`, children: [
14560
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`order-shipments ${props.className || ""}`), children: [
14534
14561
  shipments.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
14535
14562
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-semibold", children: propellerV2CoreUi.getLabel(props.labels, "title", "Shipping details") }),
14536
14563
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto rounded-lg border border-border bg-card shadow-sm", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full text-sm", children: [
@@ -14931,7 +14958,7 @@ function PriceToggle(props) {
14931
14958
  return /* @__PURE__ */ jsxRuntime.jsxs(
14932
14959
  "div",
14933
14960
  {
14934
- className: `propeller-price-toggle flex items-center gap-2 ${props.className || ""}`,
14961
+ className: cn(`propeller-price-toggle flex items-center gap-2 ${props.className || ""}`),
14935
14962
  "data-state": isOn ? "on" : "off",
14936
14963
  children: [
14937
14964
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-price-toggle__label hidden sm:inline text-xs", children: label }),
@@ -15023,7 +15050,7 @@ function ProductBulkPrices(props) {
15023
15050
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !isHidden2 && hasItems ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
15024
15051
  "div",
15025
15052
  {
15026
- className: `propeller-product-bulk-prices ${props.className || ""}`,
15053
+ className: cn(`propeller-product-bulk-prices ${props.className || ""}`),
15027
15054
  "data-include-tax": includeTax ? "true" : "false",
15028
15055
  children: [
15029
15056
  propellerV2CoreUi.getLabel(props.labels, "title", "Volume pricing") ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "propeller-product-bulk-prices__title text-base font-semibold text-foreground mb-3", children: propellerV2CoreUi.getLabel(props.labels, "title", "Volume pricing") }) : null,
@@ -15170,7 +15197,7 @@ function ProductBundles(rawProps) {
15170
15197
  React6.useEffect(() => {
15171
15198
  fetchBundles(props.productId);
15172
15199
  }, [props.productId]);
15173
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: isMounted && !isLoading && bundles.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-product-bundles ${props.className || "mb-12"}`, children: [
15200
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: isMounted && !isLoading && bundles.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-product-bundles ${props.className || "mb-12"}`), children: [
15174
15201
  bundles.map((bundle, bundleIdx) => {
15175
15202
  const bundlePrice = getBundlePrice(bundle, includeTax);
15176
15203
  const originalPrice = getOriginalPrice(bundle, includeTax);
@@ -15469,7 +15496,7 @@ function ProductDescription(props) {
15469
15496
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !!html ? /* @__PURE__ */ jsxRuntime.jsxs(
15470
15497
  "div",
15471
15498
  {
15472
- className: `propeller-product-description ${props.className || ""}`,
15499
+ className: cn(`propeller-product-description ${props.className || ""}`),
15473
15500
  "data-expanded": expanded ? "true" : "false",
15474
15501
  "data-truncatable": shouldTruncate ? "true" : "false",
15475
15502
  children: [
@@ -15508,7 +15535,7 @@ function ProductDownloads(props) {
15508
15535
  const match = alts.find((a) => a.language === lang);
15509
15536
  return match?.value || alts?.[0]?.value || "Download";
15510
15537
  }
15511
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-product-downloads ${props.className || ""}`, children: [
15538
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-product-downloads ${props.className || ""}`), children: [
15512
15539
  hasItems ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "propeller-product-downloads__title text-base font-semibold text-foreground mb-3", children: propellerV2CoreUi.getLabel(props.labels, "title", "Downloads") }) : null,
15513
15540
  hasItems ? /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "propeller-product-downloads__list space-y-2", children: items.map((doc, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "propeller-product-downloads__item", children: !!getDocumentUrl(doc) ? /* @__PURE__ */ jsxRuntime.jsxs(
15514
15541
  "a",
@@ -15579,7 +15606,7 @@ function ProductGallery(props) {
15579
15606
  if (images.length === 0) return;
15580
15607
  setSelectedIndex((idx) => (idx + 1) % images.length);
15581
15608
  }
15582
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-product-gallery ${props.className || ""}`, children: [
15609
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-product-gallery ${props.className || ""}`), children: [
15583
15610
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-product-gallery__stage relative aspect-square bg-card overflow-hidden", children: [
15584
15611
  images.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-product-gallery__empty flex h-full w-full items-center justify-center bg-surface-hover", children: /* @__PURE__ */ jsxRuntime.jsx(
15585
15612
  "svg",
@@ -15914,13 +15941,13 @@ function ProductInfo(rawProps) {
15914
15941
  }
15915
15942
  };
15916
15943
  if (rawProps.children !== void 0) {
15917
- return /* @__PURE__ */ jsxRuntime.jsx(ProductInfoContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(ProductGridConfigProvider, { value: pdpConfig, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-product-info ${props.className || ""}`, children: [
15944
+ return /* @__PURE__ */ jsxRuntime.jsx(ProductInfoContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(ProductGridConfigProvider, { value: pdpConfig, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-product-info ${props.className || ""}`), children: [
15918
15945
  props.beforeContent ? props.beforeContent(product) : null,
15919
15946
  rawProps.children,
15920
15947
  props.afterContent ? props.afterContent(product) : null
15921
15948
  ] }) }) });
15922
15949
  }
15923
- return /* @__PURE__ */ jsxRuntime.jsx(ProductInfoContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(ProductGridConfigProvider, { value: pdpConfig, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-product-info ${props.className || ""}`, children: [
15950
+ return /* @__PURE__ */ jsxRuntime.jsx(ProductInfoContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(ProductGridConfigProvider, { value: pdpConfig, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-product-info ${props.className || ""}`), children: [
15924
15951
  props.beforeContent ? props.beforeContent(product) : null,
15925
15952
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
15926
15953
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-product-info__media relative", children: [
@@ -15942,7 +15969,7 @@ function ProductInfo(rawProps) {
15942
15969
  props.afterContent ? props.afterContent(product) : null
15943
15970
  ] }) }) });
15944
15971
  }
15945
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-product-info ${props.className || ""}`, "data-loading": loading ? "true" : "false", children: [
15972
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-product-info ${props.className || ""}`), "data-loading": loading ? "true" : "false", children: [
15946
15973
  loading && !props.product ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-product-info__skeleton animate-pulse space-y-3", children: [
15947
15974
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-product-info__skeleton-line h-4 bg-surface-hover rounded w-1/4" }),
15948
15975
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-product-info__skeleton-line h-8 bg-surface-hover rounded w-3/4" })
@@ -16218,7 +16245,7 @@ function ProductShortDescription(props) {
16218
16245
  "div",
16219
16246
  {
16220
16247
  dangerouslySetInnerHTML: { __html: html },
16221
- className: `propeller-product-short-description prose prose-slate max-w-none text-muted-foreground ${props.className || ""}`
16248
+ className: cn(`propeller-product-short-description prose prose-slate max-w-none text-muted-foreground ${props.className || ""}`)
16222
16249
  }
16223
16250
  ) : null });
16224
16251
  }
@@ -16385,7 +16412,7 @@ function ProductSlider(rawProps) {
16385
16412
  }, [sliderId, items().length]);
16386
16413
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16387
16414
  " ",
16388
- !(isCrossUpsellMode() && !isLoading && items().length === 0) ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-product-slider ${props.containerClassName || "mb-12"}`, "data-loading": isLoading ? "true" : "false", children: [
16415
+ !(isCrossUpsellMode() && !isLoading && items().length === 0) ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-product-slider ${props.containerClassName || "mb-12"}`), "data-loading": isLoading ? "true" : "false", children: [
16389
16416
  sliderTitle() || items().length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-product-slider__header flex items-center justify-between mb-6", children: [
16390
16417
  sliderTitle() ? /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "propeller-product-slider__title text-2xl font-bold", children: sliderTitle() }) : null,
16391
16418
  items().length > desktopCount() ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-product-slider__nav flex gap-2", children: [
@@ -16573,7 +16600,7 @@ function ProductSpecifications(rawProps) {
16573
16600
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !loading && (hasPublicAttributes() || props.packageDescription || hasSlotContent) ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
16574
16601
  "div",
16575
16602
  {
16576
- className: `propeller-product-specifications ${props.className || ""}`,
16603
+ className: cn(`propeller-product-specifications ${props.className || ""}`),
16577
16604
  "data-layout": props.layout === "list" ? "list" : "table",
16578
16605
  "data-grouped": props.grouping ? "true" : "false",
16579
16606
  children: [
@@ -16654,7 +16681,7 @@ function ProductVideos(props) {
16654
16681
  }
16655
16682
  return uri;
16656
16683
  }
16657
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-product-videos ${props.className || ""}`, children: [
16684
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-product-videos ${props.className || ""}`), children: [
16658
16685
  hasItems ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "propeller-product-videos__title text-base font-semibold text-foreground mb-3", children: propellerV2CoreUi.getLabel(props.labels, "title", "Videos") }) : null,
16659
16686
  hasItems ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-product-videos__list space-y-4", children: items.map((video, index) => /* @__PURE__ */ jsxRuntime.jsx(
16660
16687
  "div",
@@ -16752,7 +16779,7 @@ function ProductTabs(rawProps) {
16752
16779
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: props.product ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
16753
16780
  "div",
16754
16781
  {
16755
- className: `propeller-product-tabs ${props.className || ""}`,
16782
+ className: cn(`propeller-product-tabs ${props.className || ""}`),
16756
16783
  "data-active-tab": activeTab,
16757
16784
  children: [
16758
16785
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-product-tabs__desktop hidden md:block", children: [
@@ -17058,7 +17085,7 @@ function PurchaseAuthorizationConfigurator(rawProps) {
17058
17085
  onPurchaseAuthorizationDelete: props.onPurchaseAuthorizationDelete,
17059
17086
  afterPurchaseAuthorizationDelete: props.afterPurchaseAuthorizationDelete
17060
17087
  });
17061
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `propeller-purchase-authorization-configurator ${props.className || ""}`, children: isAuthManager ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17088
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(`propeller-purchase-authorization-configurator ${props.className || ""}`), children: isAuthManager ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17062
17089
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
17063
17090
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
17064
17091
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-semibold", children: propellerV2CoreUi.getLabel(props.labels, "title", "Purchase Authorization Settings") }),
@@ -17425,7 +17452,7 @@ function PurchaseAuthorizationRequests(rawProps) {
17425
17452
  if (fromBundle) return fromBundle;
17426
17453
  return item?.product?.sku || "";
17427
17454
  }
17428
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `propeller-purchase-authorization-requests ${props.className || ""}`, children: isAuthManager ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-purchase-authorization-requests__content space-y-4", children: [
17455
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(`propeller-purchase-authorization-requests ${props.className || ""}`), children: isAuthManager ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-purchase-authorization-requests__content space-y-4", children: [
17429
17456
  !props.hideTitle ? /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "propeller-purchase-authorization-requests__title text-xl font-semibold", children: propellerV2CoreUi.getLabel(props.labels, "title", "Authorization Requests") }) : null,
17430
17457
  loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin" }) }) : null,
17431
17458
  !loading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -18745,7 +18772,7 @@ function SearchBar(rawProps) {
18745
18772
  {
18746
18773
  ref: containerRef,
18747
18774
  "data-search-bar": true,
18748
- className: `propeller-search-bar ${props.containerClassName || "relative flex-1 max-w-2xl mx-8"}`,
18775
+ className: cn(`propeller-search-bar ${props.containerClassName || "relative flex-1 max-w-2xl mx-8"}`),
18749
18776
  "data-open": showDropdown ? "true" : "false",
18750
18777
  children: [
18751
18778
  /* @__PURE__ */ jsxRuntime.jsx("form", { className: "propeller-search-bar__form", onSubmit: (e) => handleSubmit(e), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-search-bar__input-wrapper relative", children: [