@planetaexo/design-system 0.54.1 → 0.56.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 +79 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +79 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -13778,14 +13778,56 @@ function CategoryPage2({
|
|
|
13778
13778
|
const [sort, setSort] = React29__namespace.useState(
|
|
13779
13779
|
defaultSort != null ? defaultSort : (_a = sortOptions == null ? void 0 : sortOptions[0]) == null ? void 0 : _a.id
|
|
13780
13780
|
);
|
|
13781
|
-
const sortedTrips = React29__namespace.useMemo(
|
|
13782
|
-
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
|
|
13788
|
-
|
|
13781
|
+
const sortedTrips = React29__namespace.useMemo(() => {
|
|
13782
|
+
const active = Object.entries(filterValue).filter(
|
|
13783
|
+
([, vals]) => vals && vals.length > 0
|
|
13784
|
+
);
|
|
13785
|
+
const filtered = active.length ? trips.filter(
|
|
13786
|
+
(trip) => active.every(([groupId, selected]) => {
|
|
13787
|
+
var _a2, _b;
|
|
13788
|
+
const groupHasData = trips.some(
|
|
13789
|
+
(t) => {
|
|
13790
|
+
var _a3, _b2, _c;
|
|
13791
|
+
return ((_c = (_b2 = (_a3 = t.filterTags) == null ? void 0 : _a3[groupId]) == null ? void 0 : _b2.length) != null ? _c : 0) > 0;
|
|
13792
|
+
}
|
|
13793
|
+
);
|
|
13794
|
+
if (!groupHasData) return true;
|
|
13795
|
+
const tags = (_b = (_a2 = trip.filterTags) == null ? void 0 : _a2[groupId]) != null ? _b : [];
|
|
13796
|
+
return selected.some((id) => tags.includes(id));
|
|
13797
|
+
})
|
|
13798
|
+
) : trips;
|
|
13799
|
+
const list = [...filtered];
|
|
13800
|
+
switch (sort) {
|
|
13801
|
+
case "price-asc":
|
|
13802
|
+
list.sort((a, b) => {
|
|
13803
|
+
var _a2, _b;
|
|
13804
|
+
return ((_a2 = a.priceValue) != null ? _a2 : Infinity) - ((_b = b.priceValue) != null ? _b : Infinity);
|
|
13805
|
+
});
|
|
13806
|
+
break;
|
|
13807
|
+
case "price-desc":
|
|
13808
|
+
list.sort((a, b) => {
|
|
13809
|
+
var _a2, _b;
|
|
13810
|
+
return ((_a2 = b.priceValue) != null ? _a2 : -Infinity) - ((_b = a.priceValue) != null ? _b : -Infinity);
|
|
13811
|
+
});
|
|
13812
|
+
break;
|
|
13813
|
+
case "duration-asc":
|
|
13814
|
+
list.sort((a, b) => {
|
|
13815
|
+
var _a2, _b;
|
|
13816
|
+
return ((_a2 = a.nights) != null ? _a2 : Infinity) - ((_b = b.nights) != null ? _b : Infinity);
|
|
13817
|
+
});
|
|
13818
|
+
break;
|
|
13819
|
+
case "duration-desc":
|
|
13820
|
+
list.sort((a, b) => {
|
|
13821
|
+
var _a2, _b;
|
|
13822
|
+
return ((_a2 = b.nights) != null ? _a2 : -Infinity) - ((_b = a.nights) != null ? _b : -Infinity);
|
|
13823
|
+
});
|
|
13824
|
+
break;
|
|
13825
|
+
default:
|
|
13826
|
+
list.sort((a, b) => (b.featured ? 1 : 0) - (a.featured ? 1 : 0));
|
|
13827
|
+
break;
|
|
13828
|
+
}
|
|
13829
|
+
return list;
|
|
13830
|
+
}, [trips, filterValue, sort]);
|
|
13789
13831
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), children: [
|
|
13790
13832
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
13791
13833
|
"section",
|
|
@@ -13812,16 +13854,34 @@ function CategoryPage2({
|
|
|
13812
13854
|
] }),
|
|
13813
13855
|
siteHeader && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13814
13856
|
SiteHeader,
|
|
13815
|
-
{
|
|
13816
|
-
links: Array.isArray(siteHeader) ? siteHeader : void 0,
|
|
13857
|
+
__spreadProps(__spreadValues({}, Array.isArray(siteHeader) ? { links: siteHeader } : typeof siteHeader === "object" ? siteHeader : {}), {
|
|
13817
13858
|
position: "overlay"
|
|
13818
|
-
}
|
|
13859
|
+
})
|
|
13819
13860
|
),
|
|
13820
13861
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative mx-auto w-full max-w-6xl px-6 sm:px-8", children: [
|
|
13821
|
-
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) =>
|
|
13822
|
-
|
|
13823
|
-
/* @__PURE__ */ jsxRuntime.
|
|
13824
|
-
|
|
13862
|
+
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => {
|
|
13863
|
+
const isLast = i === breadcrumb.length - 1;
|
|
13864
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React29__namespace.Fragment, { children: [
|
|
13865
|
+
i > 0 && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "h-3 w-3 text-white/50 shrink-0" }),
|
|
13866
|
+
crumb.href && !isLast ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
13867
|
+
"a",
|
|
13868
|
+
{
|
|
13869
|
+
href: crumb.href,
|
|
13870
|
+
className: "text-xs text-white/70 font-ui hover:text-white hover:underline transition-colors",
|
|
13871
|
+
children: crumb.label
|
|
13872
|
+
}
|
|
13873
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
13874
|
+
"span",
|
|
13875
|
+
{
|
|
13876
|
+
className: cn(
|
|
13877
|
+
"text-xs font-ui",
|
|
13878
|
+
isLast ? "text-white" : "text-white/70"
|
|
13879
|
+
),
|
|
13880
|
+
children: crumb.label
|
|
13881
|
+
}
|
|
13882
|
+
)
|
|
13883
|
+
] }, i);
|
|
13884
|
+
}) }),
|
|
13825
13885
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl sm:text-5xl font-bold text-white font-heading leading-tight max-w-3xl", children: title }),
|
|
13826
13886
|
intro && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 text-base sm:text-lg text-white/90 leading-relaxed max-w-2xl [&_strong]:font-semibold [&_a]:underline", children: intro }),
|
|
13827
13887
|
trustpilotMini && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-5 max-w-sm", children: /* @__PURE__ */ jsxRuntime.jsx(TrustpilotEmbed, { config: trustpilotMini }) })
|
|
@@ -13839,7 +13899,7 @@ function CategoryPage2({
|
|
|
13839
13899
|
),
|
|
13840
13900
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "-mx-6 sm:-mx-8 px-6 sm:px-8 overflow-x-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex gap-5 min-w-max pb-2", children: popularTours.map((trip, i) => {
|
|
13841
13901
|
var _b;
|
|
13842
|
-
const _a2 = trip, { featured: _featured, variant: _variant } = _a2, cardProps = __objRest(_a2, ["featured", "variant"]);
|
|
13902
|
+
const _a2 = trip, { featured: _featured, variant: _variant, filterTags: _filterTags, priceValue: _priceValue } = _a2, cardProps = __objRest(_a2, ["featured", "variant", "filterTags", "priceValue"]);
|
|
13843
13903
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13844
13904
|
TripCard,
|
|
13845
13905
|
__spreadProps(__spreadValues({}, cardProps), {
|
|
@@ -13866,9 +13926,9 @@ function CategoryPage2({
|
|
|
13866
13926
|
}
|
|
13867
13927
|
) }),
|
|
13868
13928
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-muted-foreground font-ui mb-5", children: [
|
|
13869
|
-
|
|
13929
|
+
sortedTrips.length,
|
|
13870
13930
|
" ",
|
|
13871
|
-
|
|
13931
|
+
sortedTrips.length === 1 ? "trip" : "trips",
|
|
13872
13932
|
" found"
|
|
13873
13933
|
] }),
|
|
13874
13934
|
(() => {
|
|
@@ -13876,7 +13936,7 @@ function CategoryPage2({
|
|
|
13876
13936
|
const hiddenCount = sortedTrips.length - visibleTrips.length;
|
|
13877
13937
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13878
13938
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-8 lg:gap-x-[35px] lg:gap-y-[38px]", children: visibleTrips.map((trip, i) => {
|
|
13879
|
-
const _a2 = trip, { featured: _featured } = _a2, cardProps = __objRest(_a2, ["featured"]);
|
|
13939
|
+
const _a2 = trip, { featured: _featured, filterTags: _filterTags, priceValue: _priceValue } = _a2, cardProps = __objRest(_a2, ["featured", "filterTags", "priceValue"]);
|
|
13880
13940
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13881
13941
|
TripCard,
|
|
13882
13942
|
__spreadProps(__spreadValues({}, cardProps), {
|