@propeller-commerce/propeller-v2-react-ui 0.15.5 → 0.15.7
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 +51 -0
- package/dist/index.cjs +36 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -5
- package/dist/index.d.ts +10 -5
- package/dist/index.js +37 -36
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,57 @@ 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.15.7] - 2026-08-10
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **`OrderBonusItems` showed the list price of a free item.** The API models a
|
|
16
|
+
bonus as two order lines: the product line at its list price, plus a sibling
|
|
17
|
+
`class: 'incentive'` line carrying the negative delta and pointing back via
|
|
18
|
+
`parentOrderItemId`. The component rendered the product line and ignored the
|
|
19
|
+
sibling, so a bonus that reads € 0,00 in the cart and at checkout reappeared
|
|
20
|
+
at its list price on the thank-you page and in order details. Bonus lines are
|
|
21
|
+
now netted against their incentive siblings via `getNettedBonusItems()`
|
|
22
|
+
(core-ui 0.6.2); partial discounts keep their remainder instead of collapsing
|
|
23
|
+
to zero. Order totals were already correct — this was display-only.
|
|
24
|
+
|
|
25
|
+
## [0.15.6] - 2026-08-10
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- **Eight user-visible strings could not be translated at all** — they had no
|
|
30
|
+
label key and no prop, so a consumer supplying a full `labels` dictionary
|
|
31
|
+
still shipped English on a Dutch page. Every one now resolves through
|
|
32
|
+
`getLabel` with the previous text as the fallback, so this is additive: a
|
|
33
|
+
consumer that supplies none of the new keys renders exactly as before.
|
|
34
|
+
|
|
35
|
+
| Component | Was | New key |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `CategoryDescription` | Read more / Read less | `readMore`, `readLess` |
|
|
38
|
+
| `ProductDescription` | Read more / Read less | `readMore`, `readLess` |
|
|
39
|
+
| `MachineGrid` | Loading…, No machines found. | `loading`, `noMachines` |
|
|
40
|
+
| `RegisterForm` | Please select an account type. | `selectUserType` |
|
|
41
|
+
| `AccountIconAndMenu` | Hi, {name} | `greeting` |
|
|
42
|
+
|
|
43
|
+
`ProductTabs` now forwards its `labels` to `ProductDescription`, without
|
|
44
|
+
which the two new keys could not be reached on a product page.
|
|
45
|
+
|
|
46
|
+
The greeting takes a `{name}` placeholder rather than a bare prefix, so a
|
|
47
|
+
translation can put the name first — matching the existing `{link}`
|
|
48
|
+
convention in `LoginForm.noAccount`.
|
|
49
|
+
|
|
50
|
+
- **Raw server errors are overridable.** `RegisterForm` rendered
|
|
51
|
+
`result.error` and `PurchaseAuthorizationConfigurator` rendered the
|
|
52
|
+
add-contact failure verbatim — unlocalised upstream text, often cryptic.
|
|
53
|
+
Supplying `registrationFailed` / `addContactFailed` now replaces them
|
|
54
|
+
outright, the same masking `LoginForm` already does with
|
|
55
|
+
`invalidCredentials`. Omit the key to keep the current pass-through.
|
|
56
|
+
|
|
57
|
+
- **Both authorization modal close buttons had no accessible name.** The
|
|
58
|
+
`✕` glyph and the SVG icon were the only content, so screen readers
|
|
59
|
+
announced punctuation or nothing. Both take an `aria-label` from the
|
|
60
|
+
existing `closeLabel` key, with the glyph/icon marked `aria-hidden`.
|
|
61
|
+
|
|
11
62
|
## [0.15.5] - 2026-08-10
|
|
12
63
|
|
|
13
64
|
### Fixed
|
package/dist/index.cjs
CHANGED
|
@@ -4181,10 +4181,7 @@ function AccountIconAndMenu(rawProps) {
|
|
|
4181
4181
|
)
|
|
4182
4182
|
}
|
|
4183
4183
|
),
|
|
4184
|
-
props.user ? /* @__PURE__ */ jsxRuntime.
|
|
4185
|
-
"Hi, ",
|
|
4186
|
-
getUserName()
|
|
4187
|
-
] }) : null,
|
|
4184
|
+
props.user ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-account-menu__greeting hidden md:block font-normal", children: propellerV2CoreUi.getLabel(props.labels, "greeting", "Hi, {name}").replace("{name}", getUserName()) }) : null,
|
|
4188
4185
|
!props.user ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-account-menu__greeting hidden md:block font-normal", children: propellerV2CoreUi.getLabel(props.labels, "accountLabel", "Account") }) : null
|
|
4189
4186
|
]
|
|
4190
4187
|
}
|
|
@@ -7995,7 +7992,7 @@ function CategoryDescription(props) {
|
|
|
7995
7992
|
type: "button",
|
|
7996
7993
|
className: "propeller-category-description__toggle mt-2 text-sm font-medium text-primary hover:underline",
|
|
7997
7994
|
onClick: () => setExpanded((v) => !v),
|
|
7998
|
-
children: expanded ? "Read less" : "Read more"
|
|
7995
|
+
children: expanded ? propellerV2CoreUi.getLabel(props.labels, "readLess", "Read less") : propellerV2CoreUi.getLabel(props.labels, "readMore", "Read more")
|
|
7999
7996
|
}
|
|
8000
7997
|
) : null
|
|
8001
7998
|
]
|
|
@@ -9912,7 +9909,7 @@ function GridToolbar(rawProps) {
|
|
|
9912
9909
|
const [currentSortOrder, setCurrentSortOrder] = React6.useState(propellerSdkV2.SortOrder.DESC);
|
|
9913
9910
|
const [currentOffset, setCurrentOffset] = React6.useState(12);
|
|
9914
9911
|
const [currentViewMode, setCurrentViewMode] = React6.useState("grid");
|
|
9915
|
-
function
|
|
9912
|
+
function getLabel59(key) {
|
|
9916
9913
|
const labels = props.labels || {};
|
|
9917
9914
|
return labels[key] !== void 0 ? labels[key] : DEFAULT_LABELS[key] || key;
|
|
9918
9915
|
}
|
|
@@ -9950,8 +9947,8 @@ function GridToolbar(rawProps) {
|
|
|
9950
9947
|
}
|
|
9951
9948
|
function getAvailabilityLabel() {
|
|
9952
9949
|
const qty = props.minStock;
|
|
9953
|
-
if (qty !== void 0 && qty > propellerV2CoreUi.MIN_STOCK_THRESHOLD) return `${
|
|
9954
|
-
return
|
|
9950
|
+
if (qty !== void 0 && qty > propellerV2CoreUi.MIN_STOCK_THRESHOLD) return `${getLabel59("inStock")}: ${qty}+`;
|
|
9951
|
+
return getLabel59("inStock");
|
|
9955
9952
|
}
|
|
9956
9953
|
function handleSortFieldChange(field) {
|
|
9957
9954
|
setCurrentSortField(field);
|
|
@@ -9997,7 +9994,7 @@ function GridToolbar(rawProps) {
|
|
|
9997
9994
|
/* @__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: [
|
|
9998
9995
|
props.itemsFound,
|
|
9999
9996
|
"\xA0",
|
|
10000
|
-
props.itemsFound === 1 ?
|
|
9997
|
+
props.itemsFound === 1 ? getLabel59("productSingular") : getLabel59("productPlural")
|
|
10001
9998
|
] }) : null }),
|
|
10002
9999
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-grid-toolbar__controls flex flex-wrap items-center gap-3", children: [
|
|
10003
10000
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10008,7 +10005,7 @@ function GridToolbar(rawProps) {
|
|
|
10008
10005
|
onChange: (e) => handleOffsetChange(parseInt(e.target.value)),
|
|
10009
10006
|
children: getOffsetOptions()?.map((n) => /* @__PURE__ */ jsxRuntime.jsxs("option", { value: n, children: [
|
|
10010
10007
|
n,
|
|
10011
|
-
|
|
10008
|
+
getLabel59("perPage")
|
|
10012
10009
|
] }, n))
|
|
10013
10010
|
}
|
|
10014
10011
|
),
|
|
@@ -10024,7 +10021,7 @@ function GridToolbar(rawProps) {
|
|
|
10024
10021
|
{
|
|
10025
10022
|
value: field,
|
|
10026
10023
|
disabled: field === "PRICE" && isPriceSortDisabled(),
|
|
10027
|
-
children:
|
|
10024
|
+
children: getLabel59(field)
|
|
10028
10025
|
},
|
|
10029
10026
|
field
|
|
10030
10027
|
))
|
|
@@ -10037,8 +10034,8 @@ function GridToolbar(rawProps) {
|
|
|
10037
10034
|
value: currentSortOrder,
|
|
10038
10035
|
onChange: (e) => handleSortOrderChange(e.target.value),
|
|
10039
10036
|
children: [
|
|
10040
|
-
/* @__PURE__ */ jsxRuntime.jsx("option", { value: propellerSdkV2.SortOrder.ASC, children:
|
|
10041
|
-
/* @__PURE__ */ jsxRuntime.jsx("option", { value: propellerSdkV2.SortOrder.DESC, children:
|
|
10037
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: propellerSdkV2.SortOrder.ASC, children: getLabel59("ASC") }),
|
|
10038
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: propellerSdkV2.SortOrder.DESC, children: getLabel59("DESC") })
|
|
10042
10039
|
]
|
|
10043
10040
|
}
|
|
10044
10041
|
),
|
|
@@ -10048,7 +10045,7 @@ function GridToolbar(rawProps) {
|
|
|
10048
10045
|
type: "button",
|
|
10049
10046
|
className: "propeller-grid-toolbar__view-toggle h-9 w-9 flex items-center justify-center rounded-control border border-input bg-transparent hover:bg-accent hover:text-accent-foreground transition-colors",
|
|
10050
10047
|
onClick: (event) => handleViewChange(),
|
|
10051
|
-
title: currentViewMode === "grid" ?
|
|
10048
|
+
title: currentViewMode === "grid" ? getLabel59("switchToList") : getLabel59("switchToGrid"),
|
|
10052
10049
|
children: [
|
|
10053
10050
|
currentViewMode === "grid" ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10054
10051
|
"svg",
|
|
@@ -10106,7 +10103,7 @@ function GridToolbar(rawProps) {
|
|
|
10106
10103
|
onClick: (event) => {
|
|
10107
10104
|
if (props.onClearFilters) props.onClearFilters();
|
|
10108
10105
|
},
|
|
10109
|
-
children:
|
|
10106
|
+
children: getLabel59("clearAll")
|
|
10110
10107
|
}
|
|
10111
10108
|
),
|
|
10112
10109
|
props.priceFilterMin !== void 0 || props.priceFilterMax !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -10117,7 +10114,7 @@ function GridToolbar(rawProps) {
|
|
|
10117
10114
|
if (props.onPriceFilterRemove) props.onPriceFilterRemove();
|
|
10118
10115
|
},
|
|
10119
10116
|
children: [
|
|
10120
|
-
|
|
10117
|
+
getLabel59("price"),
|
|
10121
10118
|
": \u20AC",
|
|
10122
10119
|
props.priceFilterMin ?? 0,
|
|
10123
10120
|
" \u2013 \u20AC",
|
|
@@ -10167,7 +10164,7 @@ var DEFAULT_LABELS2 = {
|
|
|
10167
10164
|
of: "of"
|
|
10168
10165
|
};
|
|
10169
10166
|
function GridPagination(props) {
|
|
10170
|
-
function
|
|
10167
|
+
function getLabel59(key) {
|
|
10171
10168
|
const labels = props.labels || {};
|
|
10172
10169
|
return labels[key] !== void 0 ? labels[key] : DEFAULT_LABELS2[key] || key;
|
|
10173
10170
|
}
|
|
@@ -10240,15 +10237,15 @@ function GridPagination(props) {
|
|
|
10240
10237
|
className: "propeller-grid-pagination__btn propeller-grid-pagination__btn--prev inline-flex items-center rounded-control border border-input bg-card px-4 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed",
|
|
10241
10238
|
disabled: currentPage === 1,
|
|
10242
10239
|
onClick: () => handlePageChange(currentPage - 1),
|
|
10243
|
-
children:
|
|
10240
|
+
children: getLabel59("previous")
|
|
10244
10241
|
}
|
|
10245
10242
|
),
|
|
10246
10243
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "propeller-grid-pagination__info px-2 text-sm font-medium text-muted-foreground", children: [
|
|
10247
|
-
|
|
10244
|
+
getLabel59("page"),
|
|
10248
10245
|
"\xA0",
|
|
10249
10246
|
currentPage,
|
|
10250
10247
|
"\xA0",
|
|
10251
|
-
|
|
10248
|
+
getLabel59("of"),
|
|
10252
10249
|
"\xA0",
|
|
10253
10250
|
totalPages
|
|
10254
10251
|
] }),
|
|
@@ -10259,7 +10256,7 @@ function GridPagination(props) {
|
|
|
10259
10256
|
className: "propeller-grid-pagination__btn propeller-grid-pagination__btn--next inline-flex items-center rounded-control border border-input bg-card px-4 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed",
|
|
10260
10257
|
disabled: currentPage === totalPages,
|
|
10261
10258
|
onClick: () => handlePageChange(currentPage + 1),
|
|
10262
|
-
children:
|
|
10259
|
+
children: getLabel59("next")
|
|
10263
10260
|
}
|
|
10264
10261
|
)
|
|
10265
10262
|
] }) : null,
|
|
@@ -10271,7 +10268,7 @@ function GridPagination(props) {
|
|
|
10271
10268
|
className: "propeller-grid-pagination__btn propeller-grid-pagination__btn--prev inline-flex items-center rounded-control border border-input bg-card px-3 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed",
|
|
10272
10269
|
disabled: currentPage === 1,
|
|
10273
10270
|
onClick: () => handlePageChange(currentPage - 1),
|
|
10274
|
-
children:
|
|
10271
|
+
children: getLabel59("previous")
|
|
10275
10272
|
}
|
|
10276
10273
|
),
|
|
10277
10274
|
getFullPages().map((item, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10298,7 +10295,7 @@ function GridPagination(props) {
|
|
|
10298
10295
|
className: "propeller-grid-pagination__btn propeller-grid-pagination__btn--next inline-flex items-center rounded-control border border-input bg-card px-3 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed",
|
|
10299
10296
|
disabled: currentPage === totalPages,
|
|
10300
10297
|
onClick: () => handlePageChange(currentPage + 1),
|
|
10301
|
-
children:
|
|
10298
|
+
children: getLabel59("next")
|
|
10302
10299
|
}
|
|
10303
10300
|
)
|
|
10304
10301
|
] }) : null
|
|
@@ -10437,7 +10434,7 @@ function MachineGrid(rawProps) {
|
|
|
10437
10434
|
const cards = rootMachines.map((m) => ({ machine: m, href: childSlugHref(m) })).filter((c) => c.href !== null);
|
|
10438
10435
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: rawProps.className, children: [
|
|
10439
10436
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "propeller-grid-title mb-6 text-2xl font-semibold", children: rawProps.rootTitle ?? "Machines" }),
|
|
10440
|
-
rootLoading ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "py-12 text-center text-foreground-subtle", children: "Loading\u2026" }) : cards.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "py-12 text-center text-foreground-subtle", children: "No machines found." }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4", children: cards.map(({ machine: m, href }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10437
|
+
rootLoading ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "py-12 text-center text-foreground-subtle", children: propellerV2CoreUi.getLabel(rawProps.machineCardLabels, "loading", "Loading\u2026") }) : cards.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "py-12 text-center text-foreground-subtle", children: propellerV2CoreUi.getLabel(rawProps.machineCardLabels, "noMachines", "No machines found.") }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4", children: cards.map(({ machine: m, href }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10441
10438
|
MachineCard,
|
|
10442
10439
|
{
|
|
10443
10440
|
machine: m,
|
|
@@ -13637,9 +13634,7 @@ var OrderItemCard_default = OrderItemCard;
|
|
|
13637
13634
|
function OrderBonusItems(rawProps) {
|
|
13638
13635
|
const props = useInfraProps(rawProps);
|
|
13639
13636
|
const allItems = props.items ?? props.order?.items ?? [];
|
|
13640
|
-
const bonusItems =
|
|
13641
|
-
(item) => item.class === propellerSdkV2.OrderItemClass.product && item.isBonus === propellerSdkV2.YesNo.Y
|
|
13642
|
-
);
|
|
13637
|
+
const bonusItems = propellerV2CoreUi.getNettedBonusItems(allItems);
|
|
13643
13638
|
if (bonusItems.length === 0) return null;
|
|
13644
13639
|
const OrderItemCardImpl = props.orderItemCardComponent ?? OrderItemCard_default;
|
|
13645
13640
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-order-bonus-items ${props.className || "mb-8"}`, children: [
|
|
@@ -15436,7 +15431,7 @@ function ProductDescription(props) {
|
|
|
15436
15431
|
type: "button",
|
|
15437
15432
|
className: "propeller-product-description__toggle mt-2 text-sm font-medium text-primary hover:underline",
|
|
15438
15433
|
onClick: () => setExpanded((v) => !v),
|
|
15439
|
-
children: expanded ? "Read less" : "Read more"
|
|
15434
|
+
children: expanded ? propellerV2CoreUi.getLabel(props.labels, "readLess", "Read less") : propellerV2CoreUi.getLabel(props.labels, "readMore", "Read more")
|
|
15440
15435
|
}
|
|
15441
15436
|
) : null
|
|
15442
15437
|
]
|
|
@@ -16751,7 +16746,8 @@ function ProductTabs(rawProps) {
|
|
|
16751
16746
|
product: props.product,
|
|
16752
16747
|
language: props.language,
|
|
16753
16748
|
collapsed: props.descriptionCollapsed,
|
|
16754
|
-
maxLength: props.descriptionMaxLength
|
|
16749
|
+
maxLength: props.descriptionMaxLength,
|
|
16750
|
+
labels: props.labels
|
|
16755
16751
|
}
|
|
16756
16752
|
) : null,
|
|
16757
16753
|
specsVisited && isTabVisible("specifications") ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: isActive("specifications") ? "" : "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -16821,7 +16817,8 @@ function ProductTabs(rawProps) {
|
|
|
16821
16817
|
product: props.product,
|
|
16822
16818
|
language: props.language,
|
|
16823
16819
|
collapsed: props.descriptionCollapsed,
|
|
16824
|
-
maxLength: props.descriptionMaxLength
|
|
16820
|
+
maxLength: props.descriptionMaxLength,
|
|
16821
|
+
labels: props.labels
|
|
16825
16822
|
}
|
|
16826
16823
|
) }) : null
|
|
16827
16824
|
] }) : null,
|
|
@@ -17149,8 +17146,9 @@ function PurchaseAuthorizationConfigurator(rawProps) {
|
|
|
17149
17146
|
{
|
|
17150
17147
|
type: "button",
|
|
17151
17148
|
className: "text-muted-foreground hover:text-foreground transition",
|
|
17149
|
+
"aria-label": propellerV2CoreUi.getLabel(props.labels, "closeLabel", "Close"),
|
|
17152
17150
|
onClick: () => closeAddContactModal(),
|
|
17153
|
-
children: "\u2715"
|
|
17151
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: "\u2715" })
|
|
17154
17152
|
}
|
|
17155
17153
|
)
|
|
17156
17154
|
] }),
|
|
@@ -17248,7 +17246,7 @@ function PurchaseAuthorizationConfigurator(rawProps) {
|
|
|
17248
17246
|
}
|
|
17249
17247
|
)
|
|
17250
17248
|
] }),
|
|
17251
|
-
addContactError ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive", children: addContactError }) : null,
|
|
17249
|
+
addContactError ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive", children: props.labels?.addContactFailed || addContactError }) : null,
|
|
17252
17250
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-3 pt-2", children: [
|
|
17253
17251
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17254
17252
|
"button",
|
|
@@ -17401,8 +17399,9 @@ function PurchaseAuthorizationRequests(rawProps) {
|
|
|
17401
17399
|
{
|
|
17402
17400
|
type: "button",
|
|
17403
17401
|
className: "propeller-purchase-authorization-requests__modal-close text-foreground-subtle hover:text-foreground focus:outline-none",
|
|
17402
|
+
"aria-label": propellerV2CoreUi.getLabel(props.labels, "closeLabel", "Close"),
|
|
17404
17403
|
onClick: () => closeModal(),
|
|
17405
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", className: "h-5 w-5", strokeWidth: 2, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) })
|
|
17404
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { "aria-hidden": "true", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", className: "h-5 w-5", strokeWidth: 2, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) })
|
|
17406
17405
|
}
|
|
17407
17406
|
)
|
|
17408
17407
|
] }),
|
|
@@ -17685,6 +17684,8 @@ function RegisterForm(rawProps) {
|
|
|
17685
17684
|
const emailPlaceholder = props.labels?.emailPlaceholder || "name@example.com";
|
|
17686
17685
|
const passwordPlaceholder = props.labels?.passwordPlaceholder || "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
|
|
17687
17686
|
const passwordMismatchText = props.labels?.passwordMismatch || "Passwords do not match";
|
|
17687
|
+
const selectUserTypeText = props.labels?.selectUserType || "Please select an account type.";
|
|
17688
|
+
const registrationFailedText = props.labels?.registrationFailed;
|
|
17688
17689
|
const loginText = props.labels?.loginText || "Already have an account?";
|
|
17689
17690
|
const loginLinkText = props.labels?.loginLink || "Log in";
|
|
17690
17691
|
function isFieldRequired(fieldName) {
|
|
@@ -17695,7 +17696,7 @@ function RegisterForm(rawProps) {
|
|
|
17695
17696
|
async function handleSubmit(e) {
|
|
17696
17697
|
e.preventDefault();
|
|
17697
17698
|
if (!effectiveUserType) {
|
|
17698
|
-
setError(
|
|
17699
|
+
setError(selectUserTypeText);
|
|
17699
17700
|
return;
|
|
17700
17701
|
}
|
|
17701
17702
|
if (password !== confirmPassword) {
|
|
@@ -17771,7 +17772,7 @@ function RegisterForm(rawProps) {
|
|
|
17771
17772
|
);
|
|
17772
17773
|
}
|
|
17773
17774
|
} else if (result.error) {
|
|
17774
|
-
setError(result.error);
|
|
17775
|
+
setError(registrationFailedText || result.error);
|
|
17775
17776
|
}
|
|
17776
17777
|
}
|
|
17777
17778
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-register-form", "data-loading": loading ? "true" : "false", "data-user-type": selectedUserType, children: [
|