@voyant-travel/admin 0.115.1 → 0.115.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-page.d.ts","sourceRoot":"","sources":["../../src/dashboard/dashboard-page.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dashboard-page.d.ts","sourceRoot":"","sources":["../../src/dashboard/dashboard-page.tsx"],"names":[],"mappings":"AAqCA,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAG5B,MAAM,6BAA6B,CAAA;AAoBpC,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,6BAA6B,CAAA;AAEpC,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,CAAC,CAAA;CACjF;AAED,wBAAgB,aAAa,CAAC,EAAE,WAAgB,EAAE,GAAE,kBAAuB,2CAme1E"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
|
-
import { Link } from "@tanstack/react-router";
|
|
5
4
|
import { useVoyantReactContext } from "@voyant-travel/react";
|
|
6
5
|
import { Badge, Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@voyant-travel/ui/components";
|
|
7
6
|
import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, } from "@voyant-travel/ui/components/chart";
|
|
@@ -122,7 +121,7 @@ export function DashboardPage({ emptyStates = {} } = {}) {
|
|
|
122
121
|
suppliers: totalSuppliers,
|
|
123
122
|
}), icon: _jsx(Package, { className: "h-4 w-4 text-muted-foreground" }), empty: activeProducts === 0 && totalProducts === 0, emptyLabel: messages.dashboard.metricUnavailable, isLoading: productsPending || suppliersPending })] }), _jsx(AdminWidgetSlotRenderer, { slot: "dashboard.after-kpis", props: widgetProps }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: messages.dashboard.revenueTrendTitle }), _jsx(CardDescription, { children: messages.dashboard.revenueTrendDescription })] }), _jsx(CardContent, { children: bookingsPending ? (_jsx(DashboardAreaChartSkeleton, {})) : !hasRevenueData ? (_jsx(DashboardEmptyState, { emptyState: resolvedEmptyStates.revenueTrend })) : (_jsx(ChartContainer, { config: revenueChartConfig, className: "h-[300px] w-full", children: _jsxs(AreaChart, { data: monthlyRevenue, margin: { top: 10, right: 10, left: 0, bottom: 0 }, children: [_jsx("defs", { children: _jsxs("linearGradient", { id: "fillRevenue", x1: "0", y1: "0", x2: "0", y2: "1", children: [_jsx("stop", { offset: "5%", stopColor: "var(--chart-1)", stopOpacity: 0.3 }), _jsx("stop", { offset: "95%", stopColor: "var(--chart-1)", stopOpacity: 0 })] }) }), _jsx(CartesianGrid, { vertical: false }), _jsx(XAxis, { dataKey: "month", tickLine: false, axisLine: false, tickMargin: 8 }), _jsx(YAxis, { tickLine: false, axisLine: false, tickMargin: 8, tickFormatter: (value) => `$${(value / 1000).toFixed(0)}k` }), _jsx(ChartTooltip, { content: _jsx(ChartTooltipContent, { formatter: (value) => typeof value === "number"
|
|
124
123
|
? formatCurrency(value * 100, defaultCurrency)
|
|
125
|
-
: String(value) }) }), _jsx(Area, { type: "monotone", dataKey: "revenue", stroke: "var(--chart-1)", fill: "url(#fillRevenue)", strokeWidth: 2 })] }) })) })] }), _jsxs("div", { className: "grid gap-4 lg:grid-cols-2", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: messages.dashboard.monthlyBookingsTitle }), _jsx(CardDescription, { children: messages.dashboard.monthlyBookingsDescription })] }), _jsx(CardContent, { children: bookingsPending ? (_jsx(DashboardBarChartSkeleton, {})) : !hasMonthlyBookingsData ? (_jsx(DashboardEmptyState, { emptyState: resolvedEmptyStates.monthlyBookings, compact: true })) : (_jsx(ChartContainer, { config: monthlyBookingsConfig, className: "h-[250px] w-full", children: _jsxs(BarChart, { data: monthlyBookings, margin: { top: 10, right: 10, left: 0, bottom: 0 }, children: [_jsx(CartesianGrid, { vertical: false }), _jsx(XAxis, { dataKey: "month", tickLine: false, axisLine: false, tickMargin: 8 }), _jsx(YAxis, { tickLine: false, axisLine: false, tickMargin: 8, allowDecimals: false }), _jsx(ChartTooltip, { content: _jsx(ChartTooltipContent, {}) }), _jsx(Bar, { dataKey: "count", fill: "var(--chart-1)", radius: [4, 4, 0, 0] })] }) })) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: messages.dashboard.bookingStatusTitle }), _jsx(CardDescription, { children: messages.dashboard.bookingStatusDescription })] }), _jsx(CardContent, { children: bookingsPending ? (_jsx(DashboardPieChartSkeleton, {})) : !hasBookingStatusData ? (_jsx(DashboardEmptyState, { emptyState: resolvedEmptyStates.bookingStatus })) : (_jsx(ChartContainer, { config: bookingStatusConfig, className: "mx-auto h-[300px] w-full", children: _jsxs(PieChart, { children: [_jsx(ChartTooltip, { content: _jsx(ChartTooltipContent, { nameKey: "status", hideLabel: true }) }), _jsx(Pie, { data: localizedStatusBreakdown, dataKey: "count", nameKey: "status", cx: "50%", cy: "50%", innerRadius: 60, outerRadius: 100, paddingAngle: 2, children: localizedStatusBreakdown.map((entry) => (_jsx(Cell, { fill: entry.fill }, entry.status))) }), _jsx(ChartLegend, { content: _jsx(ChartLegendContent, { nameKey: "status" }) })] }) })) })] })] }), _jsxs("div", { className: "grid gap-4 lg:grid-cols-2", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "flex flex-row items-center justify-between", children: [_jsxs("div", { children: [_jsx(CardTitle, { children: messages.dashboard.upcomingDeparturesTitle }), _jsx(CardDescription, { children: messages.dashboard.upcomingDeparturesDescription })] }), _jsx(
|
|
124
|
+
: String(value) }) }), _jsx(Area, { type: "monotone", dataKey: "revenue", stroke: "var(--chart-1)", fill: "url(#fillRevenue)", strokeWidth: 2 })] }) })) })] }), _jsxs("div", { className: "grid gap-4 lg:grid-cols-2", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: messages.dashboard.monthlyBookingsTitle }), _jsx(CardDescription, { children: messages.dashboard.monthlyBookingsDescription })] }), _jsx(CardContent, { children: bookingsPending ? (_jsx(DashboardBarChartSkeleton, {})) : !hasMonthlyBookingsData ? (_jsx(DashboardEmptyState, { emptyState: resolvedEmptyStates.monthlyBookings, compact: true })) : (_jsx(ChartContainer, { config: monthlyBookingsConfig, className: "h-[250px] w-full", children: _jsxs(BarChart, { data: monthlyBookings, margin: { top: 10, right: 10, left: 0, bottom: 0 }, children: [_jsx(CartesianGrid, { vertical: false }), _jsx(XAxis, { dataKey: "month", tickLine: false, axisLine: false, tickMargin: 8 }), _jsx(YAxis, { tickLine: false, axisLine: false, tickMargin: 8, allowDecimals: false }), _jsx(ChartTooltip, { content: _jsx(ChartTooltipContent, {}) }), _jsx(Bar, { dataKey: "count", fill: "var(--chart-1)", radius: [4, 4, 0, 0] })] }) })) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: messages.dashboard.bookingStatusTitle }), _jsx(CardDescription, { children: messages.dashboard.bookingStatusDescription })] }), _jsx(CardContent, { children: bookingsPending ? (_jsx(DashboardPieChartSkeleton, {})) : !hasBookingStatusData ? (_jsx(DashboardEmptyState, { emptyState: resolvedEmptyStates.bookingStatus })) : (_jsx(ChartContainer, { config: bookingStatusConfig, className: "mx-auto h-[300px] w-full", children: _jsxs(PieChart, { children: [_jsx(ChartTooltip, { content: _jsx(ChartTooltipContent, { nameKey: "status", hideLabel: true }) }), _jsx(Pie, { data: localizedStatusBreakdown, dataKey: "count", nameKey: "status", cx: "50%", cy: "50%", innerRadius: 60, outerRadius: 100, paddingAngle: 2, children: localizedStatusBreakdown.map((entry) => (_jsx(Cell, { fill: entry.fill }, entry.status))) }), _jsx(ChartLegend, { content: _jsx(ChartLegendContent, { nameKey: "status" }) })] }) })) })] })] }), _jsxs("div", { className: "grid gap-4 lg:grid-cols-2", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "flex flex-row items-center justify-between", children: [_jsxs("div", { children: [_jsx(CardTitle, { children: messages.dashboard.upcomingDeparturesTitle }), _jsx(CardDescription, { children: messages.dashboard.upcomingDeparturesDescription })] }), _jsx("a", { href: "/bookings", className: "text-sm text-primary hover:underline", children: messages.dashboard.viewAll })] }), _jsx(CardContent, { children: bookingsPending ? (_jsx(DashboardUpcomingListSkeleton, {})) : upcoming.length === 0 ? (_jsx(DashboardEmptyState, { emptyState: resolvedEmptyStates.upcomingDepartures, compact: true })) : (_jsx("div", { className: "space-y-3", children: upcoming.map((booking) => (_jsxs("a", { href: `/bookings/${encodeURIComponent(booking.id)}`, className: "flex items-center justify-between rounded-lg border p-3 transition-colors hover:bg-muted/50", children: [_jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "text-sm font-medium", children: booking.bookingNumber ?? booking.id.slice(0, 8) }), _jsxs("span", { className: "text-xs text-muted-foreground", children: [booking.startDate
|
|
126
125
|
? new Date(booking.startDate).toLocaleDateString(resolvedLocale, {
|
|
127
126
|
month: "short",
|
|
128
127
|
day: "numeric",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/admin",
|
|
3
|
-
"version": "0.115.
|
|
3
|
+
"version": "0.115.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -181,10 +181,10 @@
|
|
|
181
181
|
"react": "^19.0.0",
|
|
182
182
|
"react-dom": "^19.0.0",
|
|
183
183
|
"recharts": "^3.0.0",
|
|
184
|
-
"@voyant-travel/ui": "^0.108.
|
|
184
|
+
"@voyant-travel/ui": "^0.108.2"
|
|
185
185
|
},
|
|
186
186
|
"dependencies": {
|
|
187
|
-
"@voyant-travel/i18n": "^0.
|
|
187
|
+
"@voyant-travel/i18n": "^0.109.0",
|
|
188
188
|
"@voyant-travel/react": "^0.104.1",
|
|
189
189
|
"@voyant-travel/types": "^0.106.0"
|
|
190
190
|
},
|
|
@@ -194,14 +194,14 @@
|
|
|
194
194
|
"@testing-library/react": "^16.0.0",
|
|
195
195
|
"@types/react": "^19.2.14",
|
|
196
196
|
"@types/react-dom": "^19.2.3",
|
|
197
|
-
"jsdom": "^
|
|
197
|
+
"jsdom": "^29.1.1",
|
|
198
198
|
"lucide-react": "^1.7.0",
|
|
199
199
|
"react": "^19.2.4",
|
|
200
200
|
"react-dom": "^19.2.4",
|
|
201
201
|
"recharts": "3.8.1",
|
|
202
202
|
"typescript": "^6.0.2",
|
|
203
203
|
"vitest": "^4.1.2",
|
|
204
|
-
"@voyant-travel/ui": "^0.108.
|
|
204
|
+
"@voyant-travel/ui": "^0.108.2",
|
|
205
205
|
"@voyant-travel/voyant-typescript-config": "^0.1.0"
|
|
206
206
|
},
|
|
207
207
|
"files": [
|