@propeller-commerce/propeller-v2-react-ui 0.4.24 → 0.4.25

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/CHANGELOG.md CHANGED
@@ -8,6 +8,30 @@ once it reaches 1.0. Until then (the `0.x` line) the public API may change
8
8
  between minor versions; breaking changes are called out below and in
9
9
  [MIGRATION.md](./MIGRATION.md).
10
10
 
11
+ ## [0.4.25] - 2026-07-20
12
+
13
+ ### Fixed
14
+
15
+ - **Raw enums no longer leak to the UI.** `OrderList` + `OrderSummary` gained a
16
+ `statusLabels` prop (raw status → localized, e.g. `NEW`→"Nieuw"), and
17
+ `OrderSummary` a `paymethodLabels` prop (raw method → localized, mapping both
18
+ the order-path `REKENING` and quote-path `ACCOUNT` variants to one label).
19
+ Unknown keys fall back to the raw value.
20
+ - `AddressCard`: new `showTypeBadge` prop (@default true) — set `false` to hide
21
+ the invoice/delivery chip where a heading already names the type.
22
+ - **Concatenated sentences → placeholder interpolation** (fixes broken Dutch
23
+ word order + missing spaces):
24
+ - `FavoriteLists` delete confirm: full-sentence `deleteConfirm` with a
25
+ `{name}` placeholder (the verb was stranded before the object, no space
26
+ before the quote).
27
+ - `CartOverview` / `QuoteActions` terms consent: `termsConsent` with a `{link}`
28
+ placeholder (was "de<a>…", no space, English order).
29
+ - `LoginForm` account-header prompt: `noAccount` with a `{link}` placeholder
30
+ (was "account?Create an Account", no space).
31
+ - **Pluralization**: `FavoriteLists` item count uses `itemSingular`/`itemPlural`
32
+ by count ("1 artikel" not "1 artikelen"); `GridToolbar` product count uses
33
+ `productSingular`/`productPlural` (+ a space).
34
+
11
35
  ## [0.4.24] - 2026-07-20
12
36
 
13
37
  ### Fixed
package/dist/index.cjs CHANGED
@@ -3278,10 +3278,15 @@ function LoginForm(rawProps) {
3278
3278
  ] }) : null,
3279
3279
  props.accountHeaderLoginForm ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-login-form__footer flex flex-col gap-2 text-sm pt-3 text-center", children: [
3280
3280
  /* @__PURE__ */ jsxRuntime.jsx(LoginFormForgotPasswordLink, {}),
3281
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-login-form__register text-xs text-muted-foreground", children: [
3282
- propellerV2CoreUi.getLabel(props.labels, "noAccount", "Don't have an account?"),
3283
- /* @__PURE__ */ jsxRuntime.jsx(LoginFormRegisterLink, {})
3284
- ] })
3281
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-login-form__register text-xs text-muted-foreground", children: (() => {
3282
+ const tpl = propellerV2CoreUi.getLabel(props.labels, "noAccount", "Don't have an account? {link}");
3283
+ const [before, after = ""] = tpl.split("{link}");
3284
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3285
+ before,
3286
+ /* @__PURE__ */ jsxRuntime.jsx(LoginFormRegisterLink, {}),
3287
+ after
3288
+ ] });
3289
+ })() })
3285
3290
  ] }) : null
3286
3291
  ]
3287
3292
  }
@@ -5450,7 +5455,8 @@ function AddressCard(rawProps) {
5450
5455
  ] });
5451
5456
  }
5452
5457
  function AddressCardTypeBadge(props) {
5453
- const { derived } = useAddressCardContext();
5458
+ const { derived, resolved } = useAddressCardContext();
5459
+ if (resolved.showTypeBadge === false) return null;
5454
5460
  if (!derived.addressType) return null;
5455
5461
  return /* @__PURE__ */ jsxRuntime.jsx(
5456
5462
  "span",
@@ -7149,18 +7155,23 @@ function CartOverview(props) {
7149
7155
  onChange: (event) => setTermsAccepted(event.target.checked)
7150
7156
  }
7151
7157
  ),
7152
- /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: "cart-overview-terms", className: "text-sm leading-none", children: [
7153
- propellerV2CoreUi.getLabel(props.labels, "termsPrefix", "I agree to the"),
7154
- /* @__PURE__ */ jsxRuntime.jsx(
7155
- "a",
7156
- {
7157
- href: "#",
7158
- className: "text-primary hover:underline font-medium",
7159
- onClick: handleTermsLinkClick,
7160
- children: propellerV2CoreUi.getLabel(props.labels, "termsLink", "Terms and Conditions")
7161
- }
7162
- )
7163
- ] })
7158
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "cart-overview-terms", className: "text-sm leading-none", children: (() => {
7159
+ const tpl = propellerV2CoreUi.getLabel(props.labels, "termsConsent", "I agree to the {link}");
7160
+ const [before, after = ""] = tpl.split("{link}");
7161
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7162
+ before,
7163
+ /* @__PURE__ */ jsxRuntime.jsx(
7164
+ "a",
7165
+ {
7166
+ href: "#",
7167
+ className: "text-primary hover:underline font-medium",
7168
+ onClick: handleTermsLinkClick,
7169
+ children: propellerV2CoreUi.getLabel(props.labels, "termsLink", "Terms and Conditions")
7170
+ }
7171
+ ),
7172
+ after
7173
+ ] });
7174
+ })() })
7164
7175
  ] }) : null,
7165
7176
  showPurchaseButton ? /* @__PURE__ */ jsxRuntime.jsxs(
7166
7177
  "button",
@@ -9925,7 +9936,7 @@ function FavoriteLists(rawProps) {
9925
9936
  ),
9926
9937
  getTotalCount(list),
9927
9938
  "\xA0",
9928
- propellerV2CoreUi.getLabel(props.labels, "items", "items")
9939
+ getTotalCount(list) === 1 ? propellerV2CoreUi.getLabel(props.labels, "itemSingular", "item") : propellerV2CoreUi.getLabel(props.labels, "itemPlural", "items")
9929
9940
  ] }) : null
9930
9941
  ] })
9931
9942
  ] }) : null
@@ -10109,15 +10120,15 @@ function FavoriteLists(rawProps) {
10109
10120
  )
10110
10121
  ] }),
10111
10122
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
10112
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "propeller-favorite-lists__delete-prompt", children: [
10113
- propellerV2CoreUi.getLabel(props.labels, "deleteConfirm", "Are you sure you want to delete"),
10114
- /* @__PURE__ */ jsxRuntime.jsxs("strong", { children: [
10115
- '"',
10116
- listToDelete?.name,
10117
- '"'
10118
- ] }),
10119
- "?"
10120
- ] }),
10123
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "propeller-favorite-lists__delete-prompt", children: (() => {
10124
+ const tpl = propellerV2CoreUi.getLabel(props.labels, "deleteConfirm", 'Are you sure you want to delete "{name}"?');
10125
+ const [before, after = ""] = tpl.split("{name}");
10126
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10127
+ before,
10128
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: listToDelete?.name }),
10129
+ after
10130
+ ] });
10131
+ })() }),
10121
10132
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "propeller-favorite-lists__delete-warning text-sm text-destructive", children: propellerV2CoreUi.getLabel(props.labels, "deleteWarning", "This action cannot be undone.") })
10122
10133
  ] }),
10123
10134
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-3 pt-6", children: [
@@ -10701,6 +10712,8 @@ var DEFAULT_LABELS2 = {
10701
10712
  [propellerSdkV2.SortOrder.DESC]: "High to Low",
10702
10713
  clearAll: "Clear All",
10703
10714
  products: " Products",
10715
+ productSingular: "Product",
10716
+ productPlural: "Products",
10704
10717
  from: "from",
10705
10718
  results: "results",
10706
10719
  perPage: " per page",
@@ -10794,7 +10807,8 @@ function GridToolbar(rawProps) {
10794
10807
  /* @__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: [
10795
10808
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-grid-toolbar__count text-sm text-muted-foreground font-medium", children: props.itemsFound > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
10796
10809
  props.itemsFound,
10797
- getLabel53("products")
10810
+ "\xA0",
10811
+ props.itemsFound === 1 ? getLabel53("productSingular") : getLabel53("productPlural")
10798
10812
  ] }) : null }),
10799
10813
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-grid-toolbar__controls flex flex-wrap items-center gap-3", children: [
10800
10814
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -11870,6 +11884,9 @@ function OrderList(rawProps) {
11870
11884
  return "bg-warning/10 text-warning";
11871
11885
  }
11872
11886
  }
11887
+ function statusLabel(status) {
11888
+ return props.statusLabels?.[status] || status;
11889
+ }
11873
11890
  function getColumnLabel(col) {
11874
11891
  if (props.columnConfig && props.columnConfig[col]) {
11875
11892
  return props.columnConfig[col];
@@ -12190,7 +12207,7 @@ function OrderList(rawProps) {
12190
12207
  {
12191
12208
  className: `propeller-order-list__status px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${getStatusColor(order.status)}`,
12192
12209
  "data-status": order.status,
12193
- children: order.status
12210
+ children: statusLabel(order.status)
12194
12211
  }
12195
12212
  ) : null,
12196
12213
  col === "total" ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: formatPrice17(order.total?.net) }) : null,
@@ -12492,11 +12509,13 @@ function OrderSummary(props) {
12492
12509
  const showRemarks = props.showRemarks !== void 0 ? props.showRemarks : true;
12493
12510
  const orderNumber = order?.id || "";
12494
12511
  const orderDate = order?.createdAt || "";
12495
- const orderStatus = order?.status || "";
12512
+ const rawStatus = order?.status || "";
12513
+ const orderStatus = rawStatus ? props.statusLabels?.[rawStatus] || rawStatus : "";
12496
12514
  const orderTotal = Number(order?.total?.net || 0);
12497
12515
  const orderReference = order?.reference || "";
12498
12516
  const orderRemarks = order?.remarks || "";
12499
- const paymentMethod = order?.paymentData?.method || "";
12517
+ const rawPaymentMethod = order?.paymentData?.method || "";
12518
+ const paymentMethod = rawPaymentMethod ? props.paymethodLabels?.[rawPaymentMethod.toLowerCase()] || rawPaymentMethod : "";
12500
12519
  const carrierName = order?.postageData?.carrier || "";
12501
12520
  const addresses = order?.addresses || [];
12502
12521
  const invoiceAddress = addresses.find((a) => a.type === "invoice") || null;
@@ -16184,18 +16203,23 @@ function QuoteActions(rawProps) {
16184
16203
  onChange: (event) => handleTermsChange(event.target.checked)
16185
16204
  }
16186
16205
  ),
16187
- /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: "quote-actions-terms", className: "text-sm leading-none", children: [
16188
- propellerV2CoreUi.getLabel(props.labels, "termsPrefix", "I agree to the"),
16189
- /* @__PURE__ */ jsxRuntime.jsx(
16190
- "a",
16191
- {
16192
- href: "#",
16193
- className: "text-primary hover:underline font-medium",
16194
- onClick: (event) => handleTermsLinkClick(event),
16195
- children: propellerV2CoreUi.getLabel(props.labels, "termsLink", "Terms and Conditions")
16196
- }
16197
- )
16198
- ] })
16206
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "quote-actions-terms", className: "text-sm leading-none", children: (() => {
16207
+ const tpl = propellerV2CoreUi.getLabel(props.labels, "termsConsent", "I agree to the {link}");
16208
+ const [before, after = ""] = tpl.split("{link}");
16209
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16210
+ before,
16211
+ /* @__PURE__ */ jsxRuntime.jsx(
16212
+ "a",
16213
+ {
16214
+ href: "#",
16215
+ className: "text-primary hover:underline font-medium",
16216
+ onClick: (event) => handleTermsLinkClick(event),
16217
+ children: propellerV2CoreUi.getLabel(props.labels, "termsLink", "Terms and Conditions")
16218
+ }
16219
+ ),
16220
+ after
16221
+ ] });
16222
+ })() })
16199
16223
  ] }) : null,
16200
16224
  /* @__PURE__ */ jsxRuntime.jsxs(
16201
16225
  "button",