@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.d.cts
CHANGED
|
@@ -3074,6 +3074,15 @@ declare function TripPage({ title, tagline, destination, duration, images, video
|
|
|
3074
3074
|
interface Category2Trip extends TripCardProps {
|
|
3075
3075
|
/** Marca a trip como featured — sobe para o topo do grid principal. */
|
|
3076
3076
|
featured?: boolean;
|
|
3077
|
+
/**
|
|
3078
|
+
* Per-group filter membership — `{ groupId: [optionId, …] }`, where the ids
|
|
3079
|
+
* match the `filterGroups` option ids. A trip is kept when, for every active
|
|
3080
|
+
* filter group, its ids intersect the selected option(s). Groups that no trip
|
|
3081
|
+
* carries data for stay display-only (selecting them doesn't filter).
|
|
3082
|
+
*/
|
|
3083
|
+
filterTags?: Record<string, string[]>;
|
|
3084
|
+
/** Numeric price driving the price sort (the display string stays in `price`). */
|
|
3085
|
+
priceValue?: number;
|
|
3077
3086
|
}
|
|
3078
3087
|
interface Category2BlogPost {
|
|
3079
3088
|
title: string;
|
|
@@ -3105,8 +3114,12 @@ interface CategoryPage2Props {
|
|
|
3105
3114
|
label: string;
|
|
3106
3115
|
href?: string;
|
|
3107
3116
|
}>;
|
|
3108
|
-
/**
|
|
3109
|
-
|
|
3117
|
+
/**
|
|
3118
|
+
* Render the overlay SiteHeader inside the hero. Pass `true` for the default
|
|
3119
|
+
* header, a `SiteHeaderLink[]` for custom links, or a full
|
|
3120
|
+
* {@link TripSiteHeaderConfig} to wire languages + onLanguageChange.
|
|
3121
|
+
*/
|
|
3122
|
+
siteHeader?: boolean | SiteHeaderLink[] | TripSiteHeaderConfig;
|
|
3110
3123
|
popularTours?: Category2Trip[];
|
|
3111
3124
|
popularToursTitle?: string;
|
|
3112
3125
|
popularToursEyebrow?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -3074,6 +3074,15 @@ declare function TripPage({ title, tagline, destination, duration, images, video
|
|
|
3074
3074
|
interface Category2Trip extends TripCardProps {
|
|
3075
3075
|
/** Marca a trip como featured — sobe para o topo do grid principal. */
|
|
3076
3076
|
featured?: boolean;
|
|
3077
|
+
/**
|
|
3078
|
+
* Per-group filter membership — `{ groupId: [optionId, …] }`, where the ids
|
|
3079
|
+
* match the `filterGroups` option ids. A trip is kept when, for every active
|
|
3080
|
+
* filter group, its ids intersect the selected option(s). Groups that no trip
|
|
3081
|
+
* carries data for stay display-only (selecting them doesn't filter).
|
|
3082
|
+
*/
|
|
3083
|
+
filterTags?: Record<string, string[]>;
|
|
3084
|
+
/** Numeric price driving the price sort (the display string stays in `price`). */
|
|
3085
|
+
priceValue?: number;
|
|
3077
3086
|
}
|
|
3078
3087
|
interface Category2BlogPost {
|
|
3079
3088
|
title: string;
|
|
@@ -3105,8 +3114,12 @@ interface CategoryPage2Props {
|
|
|
3105
3114
|
label: string;
|
|
3106
3115
|
href?: string;
|
|
3107
3116
|
}>;
|
|
3108
|
-
/**
|
|
3109
|
-
|
|
3117
|
+
/**
|
|
3118
|
+
* Render the overlay SiteHeader inside the hero. Pass `true` for the default
|
|
3119
|
+
* header, a `SiteHeaderLink[]` for custom links, or a full
|
|
3120
|
+
* {@link TripSiteHeaderConfig} to wire languages + onLanguageChange.
|
|
3121
|
+
*/
|
|
3122
|
+
siteHeader?: boolean | SiteHeaderLink[] | TripSiteHeaderConfig;
|
|
3110
3123
|
popularTours?: Category2Trip[];
|
|
3111
3124
|
popularToursTitle?: string;
|
|
3112
3125
|
popularToursEyebrow?: string;
|
package/dist/index.js
CHANGED
|
@@ -13757,14 +13757,56 @@ function CategoryPage2({
|
|
|
13757
13757
|
const [sort, setSort] = React29.useState(
|
|
13758
13758
|
defaultSort != null ? defaultSort : (_a = sortOptions == null ? void 0 : sortOptions[0]) == null ? void 0 : _a.id
|
|
13759
13759
|
);
|
|
13760
|
-
const sortedTrips = React29.useMemo(
|
|
13761
|
-
|
|
13762
|
-
|
|
13763
|
-
|
|
13764
|
-
|
|
13765
|
-
|
|
13766
|
-
|
|
13767
|
-
|
|
13760
|
+
const sortedTrips = React29.useMemo(() => {
|
|
13761
|
+
const active = Object.entries(filterValue).filter(
|
|
13762
|
+
([, vals]) => vals && vals.length > 0
|
|
13763
|
+
);
|
|
13764
|
+
const filtered = active.length ? trips.filter(
|
|
13765
|
+
(trip) => active.every(([groupId, selected]) => {
|
|
13766
|
+
var _a2, _b;
|
|
13767
|
+
const groupHasData = trips.some(
|
|
13768
|
+
(t) => {
|
|
13769
|
+
var _a3, _b2, _c;
|
|
13770
|
+
return ((_c = (_b2 = (_a3 = t.filterTags) == null ? void 0 : _a3[groupId]) == null ? void 0 : _b2.length) != null ? _c : 0) > 0;
|
|
13771
|
+
}
|
|
13772
|
+
);
|
|
13773
|
+
if (!groupHasData) return true;
|
|
13774
|
+
const tags = (_b = (_a2 = trip.filterTags) == null ? void 0 : _a2[groupId]) != null ? _b : [];
|
|
13775
|
+
return selected.some((id) => tags.includes(id));
|
|
13776
|
+
})
|
|
13777
|
+
) : trips;
|
|
13778
|
+
const list = [...filtered];
|
|
13779
|
+
switch (sort) {
|
|
13780
|
+
case "price-asc":
|
|
13781
|
+
list.sort((a, b) => {
|
|
13782
|
+
var _a2, _b;
|
|
13783
|
+
return ((_a2 = a.priceValue) != null ? _a2 : Infinity) - ((_b = b.priceValue) != null ? _b : Infinity);
|
|
13784
|
+
});
|
|
13785
|
+
break;
|
|
13786
|
+
case "price-desc":
|
|
13787
|
+
list.sort((a, b) => {
|
|
13788
|
+
var _a2, _b;
|
|
13789
|
+
return ((_a2 = b.priceValue) != null ? _a2 : -Infinity) - ((_b = a.priceValue) != null ? _b : -Infinity);
|
|
13790
|
+
});
|
|
13791
|
+
break;
|
|
13792
|
+
case "duration-asc":
|
|
13793
|
+
list.sort((a, b) => {
|
|
13794
|
+
var _a2, _b;
|
|
13795
|
+
return ((_a2 = a.nights) != null ? _a2 : Infinity) - ((_b = b.nights) != null ? _b : Infinity);
|
|
13796
|
+
});
|
|
13797
|
+
break;
|
|
13798
|
+
case "duration-desc":
|
|
13799
|
+
list.sort((a, b) => {
|
|
13800
|
+
var _a2, _b;
|
|
13801
|
+
return ((_a2 = b.nights) != null ? _a2 : -Infinity) - ((_b = a.nights) != null ? _b : -Infinity);
|
|
13802
|
+
});
|
|
13803
|
+
break;
|
|
13804
|
+
default:
|
|
13805
|
+
list.sort((a, b) => (b.featured ? 1 : 0) - (a.featured ? 1 : 0));
|
|
13806
|
+
break;
|
|
13807
|
+
}
|
|
13808
|
+
return list;
|
|
13809
|
+
}, [trips, filterValue, sort]);
|
|
13768
13810
|
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
|
|
13769
13811
|
/* @__PURE__ */ jsxs(
|
|
13770
13812
|
"section",
|
|
@@ -13791,16 +13833,34 @@ function CategoryPage2({
|
|
|
13791
13833
|
] }),
|
|
13792
13834
|
siteHeader && /* @__PURE__ */ jsx(
|
|
13793
13835
|
SiteHeader,
|
|
13794
|
-
{
|
|
13795
|
-
links: Array.isArray(siteHeader) ? siteHeader : void 0,
|
|
13836
|
+
__spreadProps(__spreadValues({}, Array.isArray(siteHeader) ? { links: siteHeader } : typeof siteHeader === "object" ? siteHeader : {}), {
|
|
13796
13837
|
position: "overlay"
|
|
13797
|
-
}
|
|
13838
|
+
})
|
|
13798
13839
|
),
|
|
13799
13840
|
/* @__PURE__ */ jsxs("div", { className: "relative mx-auto w-full max-w-6xl px-6 sm:px-8", children: [
|
|
13800
|
-
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) =>
|
|
13801
|
-
|
|
13802
|
-
/* @__PURE__ */
|
|
13803
|
-
|
|
13841
|
+
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => {
|
|
13842
|
+
const isLast = i === breadcrumb.length - 1;
|
|
13843
|
+
return /* @__PURE__ */ jsxs(React29.Fragment, { children: [
|
|
13844
|
+
i > 0 && /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-3 w-3 text-white/50 shrink-0" }),
|
|
13845
|
+
crumb.href && !isLast ? /* @__PURE__ */ jsx(
|
|
13846
|
+
"a",
|
|
13847
|
+
{
|
|
13848
|
+
href: crumb.href,
|
|
13849
|
+
className: "text-xs text-white/70 font-ui hover:text-white hover:underline transition-colors",
|
|
13850
|
+
children: crumb.label
|
|
13851
|
+
}
|
|
13852
|
+
) : /* @__PURE__ */ jsx(
|
|
13853
|
+
"span",
|
|
13854
|
+
{
|
|
13855
|
+
className: cn(
|
|
13856
|
+
"text-xs font-ui",
|
|
13857
|
+
isLast ? "text-white" : "text-white/70"
|
|
13858
|
+
),
|
|
13859
|
+
children: crumb.label
|
|
13860
|
+
}
|
|
13861
|
+
)
|
|
13862
|
+
] }, i);
|
|
13863
|
+
}) }),
|
|
13804
13864
|
/* @__PURE__ */ jsx("h1", { className: "text-3xl sm:text-5xl font-bold text-white font-heading leading-tight max-w-3xl", children: title }),
|
|
13805
13865
|
intro && /* @__PURE__ */ 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 }),
|
|
13806
13866
|
trustpilotMini && /* @__PURE__ */ jsx("div", { className: "mt-5 max-w-sm", children: /* @__PURE__ */ jsx(TrustpilotEmbed, { config: trustpilotMini }) })
|
|
@@ -13818,7 +13878,7 @@ function CategoryPage2({
|
|
|
13818
13878
|
),
|
|
13819
13879
|
/* @__PURE__ */ 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__ */ jsx("div", { className: "inline-flex gap-5 min-w-max pb-2", children: popularTours.map((trip, i) => {
|
|
13820
13880
|
var _b;
|
|
13821
|
-
const _a2 = trip, { featured: _featured, variant: _variant } = _a2, cardProps = __objRest(_a2, ["featured", "variant"]);
|
|
13881
|
+
const _a2 = trip, { featured: _featured, variant: _variant, filterTags: _filterTags, priceValue: _priceValue } = _a2, cardProps = __objRest(_a2, ["featured", "variant", "filterTags", "priceValue"]);
|
|
13822
13882
|
return /* @__PURE__ */ jsx(
|
|
13823
13883
|
TripCard,
|
|
13824
13884
|
__spreadProps(__spreadValues({}, cardProps), {
|
|
@@ -13845,9 +13905,9 @@ function CategoryPage2({
|
|
|
13845
13905
|
}
|
|
13846
13906
|
) }),
|
|
13847
13907
|
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground font-ui mb-5", children: [
|
|
13848
|
-
|
|
13908
|
+
sortedTrips.length,
|
|
13849
13909
|
" ",
|
|
13850
|
-
|
|
13910
|
+
sortedTrips.length === 1 ? "trip" : "trips",
|
|
13851
13911
|
" found"
|
|
13852
13912
|
] }),
|
|
13853
13913
|
(() => {
|
|
@@ -13855,7 +13915,7 @@ function CategoryPage2({
|
|
|
13855
13915
|
const hiddenCount = sortedTrips.length - visibleTrips.length;
|
|
13856
13916
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13857
13917
|
/* @__PURE__ */ 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) => {
|
|
13858
|
-
const _a2 = trip, { featured: _featured } = _a2, cardProps = __objRest(_a2, ["featured"]);
|
|
13918
|
+
const _a2 = trip, { featured: _featured, filterTags: _filterTags, priceValue: _priceValue } = _a2, cardProps = __objRest(_a2, ["featured", "filterTags", "priceValue"]);
|
|
13859
13919
|
return /* @__PURE__ */ jsx(
|
|
13860
13920
|
TripCard,
|
|
13861
13921
|
__spreadProps(__spreadValues({}, cardProps), {
|