@voyant-travel/catalog-react 0.120.2 → 0.122.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.
|
@@ -230,7 +230,7 @@ export function DynamicCatalogPage({ search, onSearchChange, surface = "admin",
|
|
|
230
230
|
const monthIndex = monthCursor
|
|
231
231
|
? availableMonths.findIndex((m) => compareMonth(m, monthCursor) === 0)
|
|
232
232
|
: -1;
|
|
233
|
-
return (_jsxs("div", { className: "mx-auto w-full max-w-screen-2xl px-6 py-6 lg:px-8", children: [_jsxs("div", { className: "mb-4", children: [_jsx("h1", { className: "font-semibold text-2xl", children: productsLabel }), _jsx("p", { className: "text-muted-foreground text-sm", children: productsTagline })] }), _jsxs("div", { className: "flex flex-wrap items-end gap-2 rounded-
|
|
233
|
+
return (_jsxs("div", { className: "mx-auto w-full max-w-screen-2xl px-6 py-6 lg:px-8", children: [_jsxs("div", { className: "mb-4", children: [_jsx("h1", { className: "font-semibold text-2xl", children: productsLabel }), _jsx("p", { className: "text-muted-foreground text-sm", children: productsTagline })] }), _jsxs("div", { className: "flex flex-wrap items-end gap-2 rounded-md border bg-card p-3", children: [_jsxs("div", { className: "flex min-w-[200px] flex-1 flex-col gap-1", children: [_jsx("span", { className: "text-muted-foreground text-xs", children: s.searchLabel }), _jsxs("div", { className: "relative", children: [_jsx(Search, { className: "-translate-y-1/2 absolute top-1/2 left-2.5 h-4 w-4 text-muted-foreground" }), _jsx(Input, { value: search.q ?? "", onChange: (e) => onSearchChange((prev) => ({ ...prev, q: e.target.value || undefined, page: 1 }), true), placeholder: s.searchPlaceholder, className: "h-9 pl-8" })] })] }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-muted-foreground text-xs", children: s.destination }), _jsxs(Select, { items: countries, value: destination ?? undefined, onValueChange: (value) => setDestination(value), children: [_jsx(SelectTrigger, { className: `${TRIGGER_CLASS} w-[190px]`, "aria-label": s.destination, children: _jsx(SelectValue, { placeholder: s.chooseCountry }) }), _jsx(SelectContent, { children: countries.map((c) => (_jsx(SelectItem, { value: c.value, children: c.label }, c.value))) })] })] }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-muted-foreground text-xs", children: s.when }), _jsxs(Select, { items: monthOptions, value: month, onValueChange: (v) => setMonth(v), children: [_jsx(SelectTrigger, { className: `${TRIGGER_CLASS} w-[140px]`, "aria-label": s.when, children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: monthOptions.map((m) => (_jsx(SelectItem, { value: m.value, children: m.label }, m.value))) })] })] }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("span", { className: "text-muted-foreground text-xs", children: [s.flyingFrom, airportsLoading ? ` · ${s.finding}` : ""] }), _jsxs(Select, { value: airport, onValueChange: (v) => setAirport(v || ALL_AIRPORTS), disabled: airportOptions.length === 0, children: [_jsx(SelectTrigger, { className: `${TRIGGER_CLASS} w-[180px]`, "aria-label": s.departureAirport, children: _jsx(SelectValue, { placeholder: destination ? s.loading : s.allAirports }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: ALL_AIRPORTS, children: s.allAirports }), airportOptions.map((a) => (_jsx(SelectItem, { value: a.code, children: a.label }, a.code)))] })] })] }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-muted-foreground text-xs", children: s.duration }), _jsxs(Select, { items: durations, value: nights, onValueChange: (v) => setNights(v), children: [_jsx(SelectTrigger, { className: `${TRIGGER_CLASS} w-[120px]`, "aria-label": s.duration, children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: durations.map((d) => (_jsx(SelectItem, { value: d.value, children: d.label }, d.value))) })] })] }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-muted-foreground text-xs", children: s.adults }), _jsx(Input, { type: "number", "aria-label": s.adults, min: 1, value: adults, onChange: (e) => setAdults(Math.max(1, Number(e.target.value) || 1)), className: "h-9 w-[80px]" })] }), _jsxs(Button, { onClick: () => void runSearch(), disabled: !destination || state.status === "loading", className: "h-9", children: [_jsx(Search, { className: "mr-1 h-4 w-4" }), state.status === "loading" ? s.searching : s.searchAvailability] }), state.status !== "browse" && (_jsxs(Button, { variant: "ghost", onClick: clearSearch, className: "h-9", children: [_jsx(X, { className: "mr-1 h-4 w-4" }), " ", s.clear] }))] }), state.status === "browse" ? (_jsx("div", { className: "mt-4", children: renderBrowseGrid({ lockedFacets: { supplyModel: ["dynamic"] } }) })) : state.status === "loading" ? (_jsx(DynamicResultsSkeleton, {})) : state.status === "error" ? (_jsx("div", { className: "mt-4 rounded-md border border-destructive/40 bg-destructive/5 p-6 text-center text-destructive text-sm", children: s.error })) : byDate.size === 0 ? (_jsx("div", { className: "mt-4 rounded-md border border-dashed p-6 text-center text-muted-foreground text-sm", children: state.retryable
|
|
234
234
|
? s.availabilityUnavailable
|
|
235
235
|
: s.noDepartures
|
|
236
236
|
.replace("{nights}", nights)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/catalog-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.122.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
"react-dom": "^19.0.0",
|
|
77
77
|
"sonner": "^2.0.0",
|
|
78
78
|
"zod": "^4.0.0",
|
|
79
|
-
"@voyant-travel/admin": "^0.
|
|
80
|
-
"@voyant-travel/commerce-react": "^0.
|
|
81
|
-
"@voyant-travel/
|
|
82
|
-
"@voyant-travel/
|
|
83
|
-
"@voyant-travel/
|
|
79
|
+
"@voyant-travel/admin": "^0.113.0",
|
|
80
|
+
"@voyant-travel/commerce-react": "^0.6.0",
|
|
81
|
+
"@voyant-travel/inventory-react": "^0.6.0",
|
|
82
|
+
"@voyant-travel/distribution-react": "^0.114.0",
|
|
83
|
+
"@voyant-travel/ui": "^0.107.0"
|
|
84
84
|
},
|
|
85
85
|
"peerDependenciesMeta": {
|
|
86
86
|
"@tanstack/react-table": {
|
|
@@ -122,13 +122,13 @@
|
|
|
122
122
|
"typescript": "^6.0.2",
|
|
123
123
|
"vitest": "^4.1.2",
|
|
124
124
|
"zod": "^4.3.6",
|
|
125
|
+
"@voyant-travel/admin": "^0.113.0",
|
|
125
126
|
"@voyant-travel/i18n": "^0.106.1",
|
|
126
|
-
"@voyant-travel/
|
|
127
|
-
"@voyant-travel/inventory-react": "^0.
|
|
127
|
+
"@voyant-travel/commerce-react": "^0.6.0",
|
|
128
|
+
"@voyant-travel/inventory-react": "^0.6.0",
|
|
128
129
|
"@voyant-travel/react": "^0.104.1",
|
|
129
|
-
"@voyant-travel/
|
|
130
|
-
"@voyant-travel/
|
|
131
|
-
"@voyant-travel/ui": "^0.106.2",
|
|
130
|
+
"@voyant-travel/distribution-react": "^0.114.0",
|
|
131
|
+
"@voyant-travel/ui": "^0.107.0",
|
|
132
132
|
"@voyant-travel/voyant-typescript-config": "^0.1.0"
|
|
133
133
|
},
|
|
134
134
|
"files": [
|