@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/CHANGELOG.md +61 -0
- package/README.md +17 -5
- package/dist/index.cjs +101 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -4
- package/dist/index.d.ts +62 -4
- package/dist/index.js +101 -74
- package/dist/index.js.map +1 -1
- package/dist/pure.cjs +14 -9
- package/dist/pure.cjs.map +1 -1
- package/dist/pure.js +14 -9
- package/dist/pure.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/pure.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var propellerV2CoreUi = require('@propeller-commerce/propeller-v2-core-ui');
|
|
4
|
+
var clsx = require('clsx');
|
|
5
|
+
var tailwindMerge = require('tailwind-merge');
|
|
4
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
7
|
var React = require('react');
|
|
6
8
|
var propellerSdkV2 = require('@propeller-commerce/propeller-sdk-v2');
|
|
@@ -26,6 +28,9 @@ function _interopNamespace(e) {
|
|
|
26
28
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
29
|
|
|
28
30
|
// src/components/Breadcrumbs.tsx
|
|
31
|
+
function cn(...inputs) {
|
|
32
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
33
|
+
}
|
|
29
34
|
function Breadcrumbs(props) {
|
|
30
35
|
const lang = props.language || "NL";
|
|
31
36
|
const path = props.categoryPath || [];
|
|
@@ -58,7 +63,7 @@ function Breadcrumbs(props) {
|
|
|
58
63
|
return index === displayItems.length - 1;
|
|
59
64
|
}
|
|
60
65
|
const showSeparatorBefore = (index) => props.showHome !== false || index > 0;
|
|
61
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": propellerV2CoreUi.getLabel(props.labels, "breadcrumbAriaLabel", "Breadcrumb"), className: `propeller-breadcrumbs ${props.className || ""}
|
|
66
|
+
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: [
|
|
62
67
|
props.showHome !== false ? /* @__PURE__ */ jsxRuntime.jsx("li", { className: "propeller-breadcrumbs__item flex items-center", "data-home": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
68
|
"a",
|
|
64
69
|
{
|
|
@@ -164,7 +169,7 @@ function CategoryShortDescription(props) {
|
|
|
164
169
|
(d) => d.language === props.language
|
|
165
170
|
);
|
|
166
171
|
const html = match?.value || "";
|
|
167
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !!html ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: `propeller-category-short-description mb-6 ${props.className || ""}
|
|
172
|
+
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(
|
|
168
173
|
"div",
|
|
169
174
|
{
|
|
170
175
|
className: "propeller-category-short-description__content prose prose-slate max-w-none text-muted-foreground",
|
|
@@ -174,7 +179,7 @@ function CategoryShortDescription(props) {
|
|
|
174
179
|
}
|
|
175
180
|
var CategoryShortDescription_default = CategoryShortDescription;
|
|
176
181
|
function GridTitle(props) {
|
|
177
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `propeller-grid-title mb-8 ${props.className || ""}
|
|
182
|
+
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: [
|
|
178
183
|
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,
|
|
179
184
|
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
|
|
180
185
|
] }) });
|
|
@@ -222,7 +227,7 @@ function ItemStock(props) {
|
|
|
222
227
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: hasInventory() ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
223
228
|
"div",
|
|
224
229
|
{
|
|
225
|
-
className: `propeller-item-stock flex flex-wrap items-center gap-1.5 ${props.className || ""}
|
|
230
|
+
className: cn(`propeller-item-stock flex flex-wrap items-center gap-1.5 ${props.className || ""}`),
|
|
226
231
|
"data-available": isAvailable() ? "true" : "false",
|
|
227
232
|
"data-stock": getStockStatusData(),
|
|
228
233
|
children: [
|
|
@@ -698,7 +703,7 @@ function ProductBulkPrices(props) {
|
|
|
698
703
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !isHidden && hasItems ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
699
704
|
"div",
|
|
700
705
|
{
|
|
701
|
-
className: `propeller-product-bulk-prices ${props.className || ""}
|
|
706
|
+
className: cn(`propeller-product-bulk-prices ${props.className || ""}`),
|
|
702
707
|
"data-include-tax": includeTax ? "true" : "false",
|
|
703
708
|
children: [
|
|
704
709
|
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,
|
|
@@ -738,7 +743,7 @@ function ProductDownloads(props) {
|
|
|
738
743
|
const match = alts.find((a) => a.language === lang);
|
|
739
744
|
return match?.value || alts?.[0]?.value || "Download";
|
|
740
745
|
}
|
|
741
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-product-downloads ${props.className || ""}
|
|
746
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-product-downloads ${props.className || ""}`), children: [
|
|
742
747
|
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,
|
|
743
748
|
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(
|
|
744
749
|
"a",
|
|
@@ -841,7 +846,7 @@ function ProductPriceDisplay(props) {
|
|
|
841
846
|
function getSecondaryTaxLabel() {
|
|
842
847
|
return props.includeTax ? propellerV2CoreUi.getLabel(props.labels, "exclTax", "excl. VAT") : propellerV2CoreUi.getLabel(props.labels, "inclTax", "incl. VAT");
|
|
843
848
|
}
|
|
844
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-product-price ${props.className || ""}
|
|
849
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-product-price ${props.className || ""}`), "data-hidden": isHidden() ? "true" : "false", children: [
|
|
845
850
|
isHidden() && 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,
|
|
846
851
|
!isHidden() && !!getLeadingPrice() ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-product-price__content flex flex-col gap-0.5", children: [
|
|
847
852
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-product-price__primary flex items-baseline gap-2", children: [
|
|
@@ -875,7 +880,7 @@ function ProductShortDescription(props) {
|
|
|
875
880
|
"div",
|
|
876
881
|
{
|
|
877
882
|
dangerouslySetInnerHTML: { __html: html },
|
|
878
|
-
className: `propeller-product-short-description prose prose-slate max-w-none text-muted-foreground ${props.className || ""}`
|
|
883
|
+
className: cn(`propeller-product-short-description prose prose-slate max-w-none text-muted-foreground ${props.className || ""}`)
|
|
879
884
|
}
|
|
880
885
|
) : null });
|
|
881
886
|
}
|
|
@@ -918,7 +923,7 @@ function ProductVideos(props) {
|
|
|
918
923
|
}
|
|
919
924
|
return uri;
|
|
920
925
|
}
|
|
921
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `propeller-product-videos ${props.className || ""}
|
|
926
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(`propeller-product-videos ${props.className || ""}`), children: [
|
|
922
927
|
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,
|
|
923
928
|
hasItems ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-product-videos__list space-y-4", children: items.map((video, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
924
929
|
"div",
|