@wealthx/shadcn 1.2.2 → 1.3.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/.turbo/turbo-build.log +200 -156
- package/CHANGELOG.md +22 -0
- package/dist/{chunk-4Y6R4WEC.mjs → chunk-2A5RRQGG.mjs} +9 -22
- package/dist/{chunk-TS2ZX2VS.mjs → chunk-2UM72RJ7.mjs} +11 -15
- package/dist/{chunk-A56YQQHG.mjs → chunk-3NCUZIFP.mjs} +2 -2
- package/dist/chunk-3OYFOX3X.mjs +79 -0
- package/dist/{chunk-RP3SQYA3.mjs → chunk-3TTACBDP.mjs} +9 -4
- package/dist/chunk-4GAWMKMI.mjs +710 -0
- package/dist/{chunk-VGSESELX.mjs → chunk-5FQIKDKP.mjs} +5 -5
- package/dist/{chunk-K3JYD4IU.mjs → chunk-5IS7G74I.mjs} +11 -4
- package/dist/chunk-6AW4KJHE.mjs +235 -0
- package/dist/chunk-6CR5N2JW.mjs +302 -0
- package/dist/{chunk-XIRTEFKH.mjs → chunk-6DZEXFNB.mjs} +36 -8
- package/dist/chunk-6O6KD7CE.mjs +271 -0
- package/dist/chunk-7PV3IWCN.mjs +33 -0
- package/dist/{chunk-SPJ5KXW7.mjs → chunk-7S5AESZO.mjs} +5 -5
- package/dist/{chunk-RYCLWMZ7.mjs → chunk-ABFDMHOR.mjs} +9 -7
- package/dist/{chunk-SWGT756Z.mjs → chunk-AMQZRHEZ.mjs} +10 -4
- package/dist/{chunk-WAZD7NFU.mjs → chunk-BKNFWEH2.mjs} +6 -6
- package/dist/{chunk-CLIN5525.mjs → chunk-C7CQJNMR.mjs} +1 -1
- package/dist/{chunk-D4ILTPOG.mjs → chunk-CFMQP5QS.mjs} +5 -4
- package/dist/{chunk-VPBN3WOO.mjs → chunk-DGHAXJBN.mjs} +9 -7
- package/dist/chunk-DOEO3CDL.mjs +27 -0
- package/dist/{chunk-5MEWU56Z.mjs → chunk-DUJTAXMH.mjs} +11 -6
- package/dist/{chunk-GGM2UYGG.mjs → chunk-EBXQWIYG.mjs} +10 -4
- package/dist/chunk-EWRB4PAD.mjs +468 -0
- package/dist/{chunk-ZSHYDDRB.mjs → chunk-FAKPBKLT.mjs} +6 -2
- package/dist/chunk-FNQXOAYJ.mjs +169 -0
- package/dist/{chunk-A6AAWBPF.mjs → chunk-GHC7LLUX.mjs} +13 -4
- package/dist/chunk-HBZLGDIN.mjs +507 -0
- package/dist/{chunk-SIZMLSRU.mjs → chunk-HISNT2MG.mjs} +8 -6
- package/dist/{chunk-CGH4DRNG.mjs → chunk-HVY6KCCF.mjs} +10 -7
- package/dist/chunk-I3RZS7V2.mjs +136 -0
- package/dist/chunk-IAE3F7DR.mjs +1962 -0
- package/dist/{chunk-UT4KJR7V.mjs → chunk-IHMFS7NZ.mjs} +35 -74
- package/dist/{chunk-PCPLO5HT.mjs → chunk-IOJRDS6V.mjs} +96 -14
- package/dist/{chunk-LHYCMLVA.mjs → chunk-JKGDCQTZ.mjs} +11 -4
- package/dist/{chunk-H45TKD34.mjs → chunk-JMHR3YGZ.mjs} +1 -1
- package/dist/{chunk-4MN6UQHG.mjs → chunk-K5A5L6T2.mjs} +17 -39
- package/dist/chunk-LV35NGVG.mjs +272 -0
- package/dist/{chunk-FZIXGLMV.mjs → chunk-M3FV7LOK.mjs} +5 -12
- package/dist/{chunk-FMAXJ2SI.mjs → chunk-MBON7YRJ.mjs} +1 -1
- package/dist/chunk-MIZQHHUO.mjs +441 -0
- package/dist/chunk-MN5NYQCL.mjs +29 -0
- package/dist/chunk-NL3ZO62D.mjs +31 -0
- package/dist/{chunk-Q76O3RIQ.mjs → chunk-NMOI6CQD.mjs} +1 -1
- package/dist/{chunk-P6AM5V7O.mjs → chunk-OODBHKG7.mjs} +1 -1
- package/dist/chunk-PBL4OQV2.mjs +283 -0
- package/dist/{chunk-Y4QFWRNR.mjs → chunk-PU4YZQXV.mjs} +17 -18
- package/dist/chunk-QMY3AZJH.mjs +80 -0
- package/dist/{chunk-BL3DXM2X.mjs → chunk-QZ4RE6NA.mjs} +11 -4
- package/dist/{chunk-VACKZOMY.mjs → chunk-R3VSPKNP.mjs} +3 -3
- package/dist/{chunk-OPNQAVVH.mjs → chunk-RJI6GKVF.mjs} +8 -6
- package/dist/{chunk-WG6JGJXB.mjs → chunk-T4BJLT57.mjs} +1 -1
- package/dist/chunk-UMTOX62O.mjs +415 -0
- package/dist/{chunk-7MMXNK3C.mjs → chunk-VLARHE5V.mjs} +8 -6
- package/dist/{chunk-2I5S2AMY.mjs → chunk-XREGSKX3.mjs} +2 -2
- package/dist/{chunk-JNQORUPP.mjs → chunk-YJG55G2H.mjs} +14 -11
- package/dist/{chunk-ZRSDX6OW.mjs → chunk-ZC45IGZO.mjs} +33 -30
- package/dist/components/ui/add-column-modal.js +42 -14
- package/dist/components/ui/add-column-modal.mjs +5 -5
- package/dist/components/ui/add-lead-modal.js +42 -11
- package/dist/components/ui/add-lead-modal.mjs +3 -3
- package/dist/components/ui/advisor-card.js +497 -0
- package/dist/components/ui/advisor-card.mjs +13 -0
- package/dist/components/ui/ai-assistant-drawer.js +11 -10
- package/dist/components/ui/ai-assistant-drawer.mjs +3 -3
- package/dist/components/ui/alert-dialog.js +2 -2
- package/dist/components/ui/alert-dialog.mjs +2 -2
- package/dist/components/ui/appointment-action-dialogs.js +1160 -0
- package/dist/components/ui/appointment-action-dialogs.mjs +23 -0
- package/dist/components/ui/appointment-availability-settings.js +1590 -0
- package/dist/components/ui/appointment-availability-settings.mjs +23 -0
- package/dist/components/ui/appointment-book-dialog.js +1744 -0
- package/dist/components/ui/appointment-book-dialog.mjs +27 -0
- package/dist/components/ui/appointment-calendar-view.js +833 -0
- package/dist/components/ui/appointment-calendar-view.mjs +14 -0
- package/dist/components/ui/appointment-detail-sheet.js +1517 -0
- package/dist/components/ui/appointment-detail-sheet.mjs +24 -0
- package/dist/components/ui/appointment-gmail-connect.js +467 -0
- package/dist/components/ui/appointment-gmail-connect.mjs +14 -0
- package/dist/components/ui/appointment-mini-card.js +345 -0
- package/dist/components/ui/appointment-mini-card.mjs +11 -0
- package/dist/components/ui/appointment-time-slot-picker.js +311 -0
- package/dist/components/ui/appointment-time-slot-picker.mjs +13 -0
- package/dist/components/ui/appointment-upcoming-card.js +1268 -0
- package/dist/components/ui/appointment-upcoming-card.mjs +21 -0
- package/dist/components/ui/backoffice-alert-history-chart.js +11 -5
- package/dist/components/ui/backoffice-alert-history-chart.mjs +5 -4
- package/dist/components/ui/backoffice-alerts-chart.js +786 -0
- package/dist/components/ui/backoffice-alerts-chart.mjs +19 -0
- package/dist/components/ui/backoffice-connections-chart.js +817 -0
- package/dist/components/ui/backoffice-connections-chart.mjs +19 -0
- package/dist/components/ui/backoffice-contact-history-chart.js +11 -5
- package/dist/components/ui/backoffice-contact-history-chart.mjs +5 -4
- package/dist/components/ui/badge.js +6 -6
- package/dist/components/ui/badge.mjs +1 -1
- package/dist/components/ui/borrowing-capacity-line-chart.js +30 -21
- package/dist/components/ui/borrowing-capacity-line-chart.mjs +5 -4
- package/dist/components/ui/button.js +2 -2
- package/dist/components/ui/button.mjs +1 -1
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/calendar.mjs +2 -2
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/card.mjs +1 -1
- package/dist/components/ui/cash-balance-line-chart.js +31 -23
- package/dist/components/ui/cash-balance-line-chart.mjs +5 -4
- package/dist/components/ui/cashflow-bar-chart.js +12 -5
- package/dist/components/ui/cashflow-bar-chart.mjs +5 -4
- package/dist/components/ui/chip.js +97 -18
- package/dist/components/ui/chip.mjs +3 -2
- package/dist/components/ui/color-picker.js +158 -28
- package/dist/components/ui/color-picker.mjs +3 -1
- package/dist/components/ui/data-table.js +140 -119
- package/dist/components/ui/data-table.mjs +3 -2
- package/dist/components/ui/date-picker.js +48 -27
- package/dist/components/ui/date-picker.mjs +4 -3
- package/dist/components/ui/dialog.js +37 -9
- package/dist/components/ui/dialog.mjs +2 -2
- package/dist/components/ui/expense-bar-chart.js +12 -5
- package/dist/components/ui/expense-bar-chart.mjs +5 -4
- package/dist/components/ui/field.mjs +2 -2
- package/dist/components/ui/financial-cards.js +322 -155
- package/dist/components/ui/financial-cards.mjs +5 -3
- package/dist/components/ui/financial-drawers.js +2 -2
- package/dist/components/ui/financial-drawers.mjs +3 -3
- package/dist/components/ui/financial-sections.js +14 -10
- package/dist/components/ui/financial-sections.mjs +6 -5
- package/dist/components/ui/income-bar-chart.js +12 -5
- package/dist/components/ui/income-bar-chart.mjs +5 -4
- package/dist/components/ui/input-group.js +2 -2
- package/dist/components/ui/input-group.mjs +2 -2
- package/dist/components/ui/kanban-column.js +52 -44
- package/dist/components/ui/kanban-column.mjs +7 -5
- package/dist/components/ui/opportunity-card.js +52 -44
- package/dist/components/ui/opportunity-card.mjs +6 -4
- package/dist/components/ui/opportunity-edit-modals.js +1367 -1263
- package/dist/components/ui/opportunity-edit-modals.mjs +8 -8
- package/dist/components/ui/opportunity-summary-tab.js +2744 -2157
- package/dist/components/ui/opportunity-summary-tab.mjs +14 -14
- package/dist/components/ui/page-header.js +92 -0
- package/dist/components/ui/page-header.mjs +8 -0
- package/dist/components/ui/page-top-bar.js +88 -0
- package/dist/components/ui/page-top-bar.mjs +8 -0
- package/dist/components/ui/pagination.js +303 -19
- package/dist/components/ui/pagination.mjs +11 -4
- package/dist/components/ui/pipeline-board.js +205 -191
- package/dist/components/ui/pipeline-board.mjs +9 -7
- package/dist/components/ui/pipeline-dialogs.js +114 -65
- package/dist/components/ui/pipeline-dialogs.mjs +7 -6
- package/dist/components/ui/pipeline-primitives.js +6 -6
- package/dist/components/ui/pipeline-primitives.mjs +2 -2
- package/dist/components/ui/property-cashflow-doughnut-chart.js +14 -12
- package/dist/components/ui/property-cashflow-doughnut-chart.mjs +5 -4
- package/dist/components/ui/property-debt-equity-doughnut-chart.js +14 -12
- package/dist/components/ui/property-debt-equity-doughnut-chart.mjs +5 -4
- package/dist/components/ui/property-mobile-estimate-line-chart.js +16 -14
- package/dist/components/ui/property-mobile-estimate-line-chart.mjs +5 -4
- package/dist/components/ui/sidebar-nav.js +234 -95
- package/dist/components/ui/sidebar-nav.mjs +4 -1
- package/dist/components/ui/stage-timeline.js +6 -6
- package/dist/components/ui/stage-timeline.mjs +3 -3
- package/dist/components/ui/transactions-expense-categories-doughnut-chart.js +18 -16
- package/dist/components/ui/transactions-expense-categories-doughnut-chart.mjs +5 -4
- package/dist/components/ui/transactions-income-expense-bar-chart.js +28 -12
- package/dist/components/ui/transactions-income-expense-bar-chart.mjs +5 -4
- package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.js +18 -16
- package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.mjs +5 -4
- package/dist/index.js +12899 -9343
- package/dist/index.mjs +256 -190
- package/dist/styles.css +1 -1
- package/package.json +71 -1
- package/src/components/index.tsx +114 -9
- package/src/components/ui/add-column-modal.tsx +7 -7
- package/src/components/ui/add-lead-modal.tsx +6 -3
- package/src/components/ui/advisor-card.tsx +227 -0
- package/src/components/ui/ai-assistant-drawer.tsx +4 -3
- package/src/components/ui/appointment-action-dialogs.tsx +297 -0
- package/src/components/ui/appointment-availability-settings.tsx +645 -0
- package/src/components/ui/appointment-book-dialog.tsx +618 -0
- package/src/components/ui/appointment-calendar-view.tsx +510 -0
- package/src/components/ui/appointment-detail-sheet.tsx +415 -0
- package/src/components/ui/appointment-gmail-connect.tsx +188 -0
- package/src/components/ui/appointment-mini-card.tsx +104 -0
- package/src/components/ui/appointment-time-slot-picker.tsx +123 -0
- package/src/components/ui/appointment-upcoming-card.tsx +635 -0
- package/src/components/ui/backoffice-alert-history-chart.tsx +10 -2
- package/src/components/ui/backoffice-alerts-chart.tsx +312 -0
- package/src/components/ui/backoffice-connections-chart.tsx +339 -0
- package/src/components/ui/backoffice-contact-history-chart.tsx +10 -2
- package/src/components/ui/badge.tsx +12 -6
- package/src/components/ui/borrowing-capacity-line-chart.tsx +4 -11
- package/src/components/ui/button.tsx +2 -2
- package/src/components/ui/card.tsx +1 -1
- package/src/components/ui/cash-balance-line-chart.tsx +4 -23
- package/src/components/ui/cashflow-bar-chart.tsx +9 -2
- package/src/components/ui/chart-shared.tsx +4 -11
- package/src/components/ui/chip.tsx +23 -19
- package/src/components/ui/color-picker.tsx +4 -2
- package/src/components/ui/data-table.tsx +28 -74
- package/src/components/ui/date-picker.tsx +42 -37
- package/src/components/ui/dialog.tsx +72 -6
- package/src/components/ui/expense-bar-chart.tsx +11 -2
- package/src/components/ui/financial-cards.tsx +99 -10
- package/src/components/ui/income-bar-chart.tsx +11 -2
- package/src/components/ui/opportunity-card.tsx +10 -39
- package/src/components/ui/opportunity-edit-modals.tsx +98 -36
- package/src/components/ui/opportunity-summary-tab.tsx +548 -232
- package/src/components/ui/page-header.tsx +57 -0
- package/src/components/ui/page-top-bar.tsx +48 -0
- package/src/components/ui/pagination.tsx +171 -22
- package/src/components/ui/pipeline-board.tsx +12 -5
- package/src/components/ui/property-cashflow-doughnut-chart.tsx +3 -1
- package/src/components/ui/property-debt-equity-doughnut-chart.tsx +3 -1
- package/src/components/ui/property-mobile-estimate-line-chart.tsx +3 -1
- package/src/components/ui/sidebar-nav.tsx +36 -37
- package/src/components/ui/transactions-expense-categories-doughnut-chart.tsx +3 -1
- package/src/components/ui/transactions-income-expense-bar-chart.tsx +12 -9
- package/src/components/ui/transactions-liabilities-breakdown-doughnut-chart.tsx +3 -1
- package/src/lib/format-currency.ts +44 -0
- package/src/lib/format-date.ts +50 -0
- package/src/lib/opportunity-constants.ts +12 -0
- package/src/styles/globals.css +17 -15
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +14 -0
- package/dist/chunk-S4QRUQNW.mjs +0 -475
- package/dist/chunk-URGMJAE3.mjs +0 -1885
- package/dist/chunk-WNGWBVLV.mjs +0 -148
- package/dist/{chunk-LLVQKSU3.mjs → chunk-GD4BJDJR.mjs} +3 -3
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Skeleton
|
|
3
|
+
} from "./chunk-D6ID6M4V.mjs";
|
|
4
|
+
import {
|
|
5
|
+
ChartLegendItem,
|
|
6
|
+
ChartPeriodButton,
|
|
7
|
+
FALLBACK_TICK,
|
|
8
|
+
formatCount,
|
|
9
|
+
formatMonthLabel,
|
|
10
|
+
formatTooltipDate,
|
|
11
|
+
hexToRgba
|
|
12
|
+
} from "./chunk-M3FV7LOK.mjs";
|
|
13
|
+
import {
|
|
14
|
+
Empty,
|
|
15
|
+
EmptyDescription
|
|
16
|
+
} from "./chunk-NQPOYKAQ.mjs";
|
|
17
|
+
import {
|
|
18
|
+
Card,
|
|
19
|
+
CardAction,
|
|
20
|
+
CardContent,
|
|
21
|
+
CardHeader,
|
|
22
|
+
CardTitle
|
|
23
|
+
} from "./chunk-C7CQJNMR.mjs";
|
|
24
|
+
import {
|
|
25
|
+
ToggleGroup,
|
|
26
|
+
ToggleGroupItem
|
|
27
|
+
} from "./chunk-EI5F6FMT.mjs";
|
|
28
|
+
import {
|
|
29
|
+
useThemeVars
|
|
30
|
+
} from "./chunk-FEZKMUCF.mjs";
|
|
31
|
+
import {
|
|
32
|
+
cn
|
|
33
|
+
} from "./chunk-VLQZANBF.mjs";
|
|
34
|
+
|
|
35
|
+
// src/components/ui/backoffice-alerts-chart.tsx
|
|
36
|
+
import { useMemo, useState } from "react";
|
|
37
|
+
import {
|
|
38
|
+
Chart as ChartJS,
|
|
39
|
+
CategoryScale,
|
|
40
|
+
LinearScale,
|
|
41
|
+
LineController,
|
|
42
|
+
LineElement,
|
|
43
|
+
PointElement,
|
|
44
|
+
BarController,
|
|
45
|
+
BarElement,
|
|
46
|
+
Tooltip
|
|
47
|
+
} from "chart.js";
|
|
48
|
+
import { Chart } from "react-chartjs-2";
|
|
49
|
+
import { BarChart2, LineChart } from "lucide-react";
|
|
50
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
51
|
+
ChartJS.register(
|
|
52
|
+
CategoryScale,
|
|
53
|
+
LinearScale,
|
|
54
|
+
LineController,
|
|
55
|
+
LineElement,
|
|
56
|
+
PointElement,
|
|
57
|
+
BarController,
|
|
58
|
+
BarElement,
|
|
59
|
+
Tooltip
|
|
60
|
+
);
|
|
61
|
+
var PERIODS = [3, 6, 12];
|
|
62
|
+
var SLICE_COUNT = { 3: 3, 6: 6, 12: 12 };
|
|
63
|
+
var NEED_ACTION_COLOR = "#F44336";
|
|
64
|
+
var WATCH_COLOR = "#FF9800";
|
|
65
|
+
var INSIGHT_COLOR = "#3B82F6";
|
|
66
|
+
function AlertsLegend() {
|
|
67
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-x-3 gap-y-1.5 pb-2", children: [
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
ChartLegendItem,
|
|
70
|
+
{
|
|
71
|
+
label: "Need Action",
|
|
72
|
+
color: NEED_ACTION_COLOR,
|
|
73
|
+
lineStyle: "solid"
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ jsx(ChartLegendItem, { label: "Watch", color: WATCH_COLOR, lineStyle: "solid" }),
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
ChartLegendItem,
|
|
79
|
+
{
|
|
80
|
+
label: "Insight",
|
|
81
|
+
color: INSIGHT_COLOR,
|
|
82
|
+
lineStyle: "solid"
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] });
|
|
86
|
+
}
|
|
87
|
+
function BackofficeAlertsChart({
|
|
88
|
+
chartData,
|
|
89
|
+
title = "Alerts Summary",
|
|
90
|
+
showLegend = true,
|
|
91
|
+
legendPosition = "top",
|
|
92
|
+
showXAxis = true,
|
|
93
|
+
showYAxis = false,
|
|
94
|
+
defaultPeriod = 6,
|
|
95
|
+
height = 200,
|
|
96
|
+
width = "100%",
|
|
97
|
+
className,
|
|
98
|
+
isLoading = false
|
|
99
|
+
}) {
|
|
100
|
+
const [period, setPeriod] = useState(defaultPeriod);
|
|
101
|
+
const [chartType, setChartType] = useState("line");
|
|
102
|
+
const themeVars = useThemeVars();
|
|
103
|
+
const fontFamily = themeVars["--font-sans"] || "Figtree, sans-serif";
|
|
104
|
+
const sliced = useMemo(() => {
|
|
105
|
+
if (!(chartData == null ? void 0 : chartData.length)) return null;
|
|
106
|
+
const count = Math.min(SLICE_COUNT[period], chartData.length);
|
|
107
|
+
return chartData.slice(chartData.length - count);
|
|
108
|
+
}, [chartData, period]);
|
|
109
|
+
const labels = useMemo(
|
|
110
|
+
() => {
|
|
111
|
+
var _a;
|
|
112
|
+
return (_a = sliced == null ? void 0 : sliced.map((p) => formatMonthLabel(p.date))) != null ? _a : [];
|
|
113
|
+
},
|
|
114
|
+
[sliced]
|
|
115
|
+
);
|
|
116
|
+
const isBar = chartType === "bar";
|
|
117
|
+
const datasets = useMemo(() => {
|
|
118
|
+
if (!sliced) return [];
|
|
119
|
+
return [
|
|
120
|
+
{
|
|
121
|
+
type: chartType,
|
|
122
|
+
label: "Need Action",
|
|
123
|
+
data: sliced.map((p) => p.needAction),
|
|
124
|
+
borderColor: NEED_ACTION_COLOR,
|
|
125
|
+
backgroundColor: isBar ? NEED_ACTION_COLOR : hexToRgba(NEED_ACTION_COLOR, 0.08),
|
|
126
|
+
fill: !isBar,
|
|
127
|
+
tension: 0.3,
|
|
128
|
+
pointRadius: 0,
|
|
129
|
+
borderWidth: 2
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
type: chartType,
|
|
133
|
+
label: "Watch",
|
|
134
|
+
data: sliced.map((p) => p.watch),
|
|
135
|
+
borderColor: WATCH_COLOR,
|
|
136
|
+
backgroundColor: isBar ? WATCH_COLOR : hexToRgba(WATCH_COLOR, 0.08),
|
|
137
|
+
fill: !isBar,
|
|
138
|
+
tension: 0.3,
|
|
139
|
+
pointRadius: 0,
|
|
140
|
+
borderWidth: 2
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: chartType,
|
|
144
|
+
label: "Insight",
|
|
145
|
+
data: sliced.map((p) => p.insight),
|
|
146
|
+
borderColor: INSIGHT_COLOR,
|
|
147
|
+
backgroundColor: isBar ? INSIGHT_COLOR : hexToRgba(INSIGHT_COLOR, 0.08),
|
|
148
|
+
fill: !isBar,
|
|
149
|
+
tension: 0.3,
|
|
150
|
+
pointRadius: 0,
|
|
151
|
+
borderWidth: 2
|
|
152
|
+
}
|
|
153
|
+
];
|
|
154
|
+
}, [sliced, chartType, isBar]);
|
|
155
|
+
const options = useMemo(
|
|
156
|
+
() => ({
|
|
157
|
+
responsive: true,
|
|
158
|
+
maintainAspectRatio: false,
|
|
159
|
+
animation: { duration: 300 },
|
|
160
|
+
layout: { padding: 0 },
|
|
161
|
+
plugins: {
|
|
162
|
+
legend: { display: false },
|
|
163
|
+
tooltip: {
|
|
164
|
+
mode: "index",
|
|
165
|
+
intersect: false,
|
|
166
|
+
padding: 12,
|
|
167
|
+
cornerRadius: 0,
|
|
168
|
+
titleFont: { size: 11, weight: 600 },
|
|
169
|
+
bodyFont: { size: 12, weight: 500 },
|
|
170
|
+
callbacks: {
|
|
171
|
+
title: (tooltipItems) => {
|
|
172
|
+
var _a, _b, _c, _d;
|
|
173
|
+
const idx = (_a = tooltipItems[0]) == null ? void 0 : _a.dataIndex;
|
|
174
|
+
if (idx != null && ((_b = sliced == null ? void 0 : sliced[idx]) == null ? void 0 : _b.date)) {
|
|
175
|
+
return formatTooltipDate(sliced[idx].date, "monthly");
|
|
176
|
+
}
|
|
177
|
+
return (_d = (_c = tooltipItems[0]) == null ? void 0 : _c.label) != null ? _d : "";
|
|
178
|
+
},
|
|
179
|
+
label: (ctx) => {
|
|
180
|
+
const val = ctx.raw;
|
|
181
|
+
if (val === 0) return;
|
|
182
|
+
return ` ${ctx.dataset.label}: ${formatCount(val)}`;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
scales: {
|
|
188
|
+
x: {
|
|
189
|
+
display: showXAxis,
|
|
190
|
+
grid: { display: false },
|
|
191
|
+
border: { display: false },
|
|
192
|
+
ticks: {
|
|
193
|
+
maxRotation: 0,
|
|
194
|
+
minRotation: 0,
|
|
195
|
+
color: FALLBACK_TICK,
|
|
196
|
+
font: { size: 10 }
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
y: {
|
|
200
|
+
display: showYAxis,
|
|
201
|
+
grid: { display: false },
|
|
202
|
+
border: { display: false },
|
|
203
|
+
beginAtZero: true,
|
|
204
|
+
ticks: {
|
|
205
|
+
padding: 8,
|
|
206
|
+
maxTicksLimit: 5,
|
|
207
|
+
color: FALLBACK_TICK,
|
|
208
|
+
font: { size: 10 },
|
|
209
|
+
callback: (v) => formatCount(Number(v))
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}),
|
|
214
|
+
[showXAxis, showYAxis, sliced]
|
|
215
|
+
);
|
|
216
|
+
return /* @__PURE__ */ jsxs(
|
|
217
|
+
Card,
|
|
218
|
+
{
|
|
219
|
+
className: cn("w-full py-4 sm:py-6 gap-2", className),
|
|
220
|
+
style: { maxWidth: width, fontFamily },
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ jsxs(CardHeader, { className: "px-3 sm:px-6", children: [
|
|
223
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-xs font-semibold uppercase tracking-wide", children: title }),
|
|
224
|
+
/* @__PURE__ */ jsx(CardAction, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
225
|
+
/* @__PURE__ */ jsxs(
|
|
226
|
+
ToggleGroup,
|
|
227
|
+
{
|
|
228
|
+
type: "single",
|
|
229
|
+
variant: "outline",
|
|
230
|
+
size: "sm",
|
|
231
|
+
value: chartType,
|
|
232
|
+
onValueChange: (v) => v && setChartType(v),
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ jsx(ToggleGroupItem, { value: "line", "aria-label": "Line chart", children: /* @__PURE__ */ jsx(LineChart, { className: "size-3.5" }) }),
|
|
235
|
+
/* @__PURE__ */ jsx(ToggleGroupItem, { value: "bar", "aria-label": "Bar chart", children: /* @__PURE__ */ jsx(BarChart2, { className: "size-3.5" }) })
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
),
|
|
239
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-0.5 sm:gap-1", children: PERIODS.map((p) => /* @__PURE__ */ jsx(
|
|
240
|
+
ChartPeriodButton,
|
|
241
|
+
{
|
|
242
|
+
period: p,
|
|
243
|
+
active: period === p,
|
|
244
|
+
onClick: () => setPeriod(p)
|
|
245
|
+
},
|
|
246
|
+
p
|
|
247
|
+
)) })
|
|
248
|
+
] }) })
|
|
249
|
+
] }),
|
|
250
|
+
/* @__PURE__ */ jsx(CardContent, { className: "px-3 sm:px-6", children: isLoading ? /* @__PURE__ */ jsx(Skeleton, { style: { height, width: "100%" } }) : !sliced ? /* @__PURE__ */ jsx(Empty, { className: "flex-none p-4", style: { height }, children: /* @__PURE__ */ jsx(EmptyDescription, { children: "No data available" }) }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
251
|
+
showLegend && legendPosition === "top" && /* @__PURE__ */ jsx(AlertsLegend, {}),
|
|
252
|
+
/* @__PURE__ */ jsx("div", { style: { height, width: "100%", position: "relative" }, children: /* @__PURE__ */ jsx(
|
|
253
|
+
Chart,
|
|
254
|
+
{
|
|
255
|
+
type: chartType,
|
|
256
|
+
data: { labels, datasets },
|
|
257
|
+
options,
|
|
258
|
+
"aria-label": title
|
|
259
|
+
},
|
|
260
|
+
chartType
|
|
261
|
+
) }),
|
|
262
|
+
showLegend && legendPosition === "bottom" && /* @__PURE__ */ jsx(AlertsLegend, {})
|
|
263
|
+
] }) })
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export {
|
|
270
|
+
BackofficeAlertsChart
|
|
271
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/lib/format-date.ts
|
|
2
|
+
import { format, parseISO } from "date-fns";
|
|
3
|
+
function safeParse(iso) {
|
|
4
|
+
return parseISO(iso);
|
|
5
|
+
}
|
|
6
|
+
function formatDateShort(iso) {
|
|
7
|
+
if (!iso) return "\u2014";
|
|
8
|
+
try {
|
|
9
|
+
return format(safeParse(iso), "dd MMM yyyy");
|
|
10
|
+
} catch (e) {
|
|
11
|
+
return iso;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function formatDateDayMonth(iso) {
|
|
15
|
+
try {
|
|
16
|
+
return format(safeParse(iso), "dd MMM");
|
|
17
|
+
} catch (e) {
|
|
18
|
+
return iso;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function formatDateWithWeekday(iso) {
|
|
22
|
+
try {
|
|
23
|
+
return format(safeParse(iso), "EEE, dd MMM yyyy");
|
|
24
|
+
} catch (e) {
|
|
25
|
+
return iso;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
formatDateShort,
|
|
31
|
+
formatDateDayMonth,
|
|
32
|
+
formatDateWithWeekday
|
|
33
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Sheet,
|
|
3
|
+
SheetContent
|
|
4
|
+
} from "./chunk-462HMNO4.mjs";
|
|
1
5
|
import {
|
|
2
6
|
Tabs,
|
|
3
7
|
TabsContent,
|
|
4
8
|
TabsList,
|
|
5
9
|
TabsTrigger
|
|
6
10
|
} from "./chunk-JHJHG4GO.mjs";
|
|
7
|
-
import {
|
|
8
|
-
Sheet,
|
|
9
|
-
SheetContent
|
|
10
|
-
} from "./chunk-462HMNO4.mjs";
|
|
11
11
|
import {
|
|
12
12
|
Spinner
|
|
13
13
|
} from "./chunk-7YAU5CY6.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Button
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XREGSKX3.mjs";
|
|
17
17
|
|
|
18
18
|
// src/components/ui/financial-drawers.tsx
|
|
19
19
|
import { X } from "lucide-react";
|
|
@@ -4,9 +4,11 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
DoughnutLegendRow,
|
|
6
6
|
FALLBACK_PRIMARY,
|
|
7
|
-
FALLBACK_SECONDARY
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
FALLBACK_SECONDARY
|
|
8
|
+
} from "./chunk-M3FV7LOK.mjs";
|
|
9
|
+
import {
|
|
10
|
+
formatCurrencyAbbrev
|
|
11
|
+
} from "./chunk-MN5NYQCL.mjs";
|
|
10
12
|
import {
|
|
11
13
|
Empty,
|
|
12
14
|
EmptyDescription
|
|
@@ -16,7 +18,7 @@ import {
|
|
|
16
18
|
CardContent,
|
|
17
19
|
CardHeader,
|
|
18
20
|
CardTitle
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-C7CQJNMR.mjs";
|
|
20
22
|
import {
|
|
21
23
|
useThemeVars
|
|
22
24
|
} from "./chunk-FEZKMUCF.mjs";
|
|
@@ -84,7 +86,7 @@ function PropertyDebtEquityDoughnutChart({
|
|
|
84
86
|
label: (ctx) => {
|
|
85
87
|
const val = ctx.raw;
|
|
86
88
|
const pct = estimate > 0 ? `${(val / estimate * 100).toFixed(1)}%` : "0%";
|
|
87
|
-
return ` ${ctx.label}: ${
|
|
89
|
+
return ` ${ctx.label}: ${formatCurrencyAbbrev(val)} (${pct})`;
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
}
|
|
@@ -100,7 +102,7 @@ function PropertyDebtEquityDoughnutChart({
|
|
|
100
102
|
className: cn("w-full py-4 sm:py-6 gap-2", className),
|
|
101
103
|
style: { maxWidth: width, fontFamily },
|
|
102
104
|
children: [
|
|
103
|
-
/* @__PURE__ */ jsx(CardHeader, { className: "px-3 sm:px-6", children: /* @__PURE__ */ jsx(CardTitle, { className: "text-
|
|
105
|
+
/* @__PURE__ */ jsx(CardHeader, { className: "px-3 sm:px-6", children: /* @__PURE__ */ jsx(CardTitle, { className: "text-xs font-semibold uppercase tracking-wide", children: title }) }),
|
|
104
106
|
/* @__PURE__ */ jsx(CardContent, { className: "px-3 sm:px-6", children: isLoading ? /* @__PURE__ */ jsx(Skeleton, { style: { height, width: "100%" } }) : !hasData ? /* @__PURE__ */ jsx(Empty, { className: "flex-none p-4", style: { height }, children: /* @__PURE__ */ jsx(EmptyDescription, { children: "No data available" }) }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
105
107
|
/* @__PURE__ */ jsxs("div", { style: { height, width: "100%", position: "relative" }, children: [
|
|
106
108
|
/* @__PURE__ */ jsx(
|
|
@@ -125,7 +127,7 @@ function PropertyDebtEquityDoughnutChart({
|
|
|
125
127
|
pointerEvents: "none"
|
|
126
128
|
},
|
|
127
129
|
children: [
|
|
128
|
-
/* @__PURE__ */ jsx("div", { className: "text-base font-semibold leading-tight", children:
|
|
130
|
+
/* @__PURE__ */ jsx("div", { className: "text-base font-semibold leading-tight", children: formatCurrencyAbbrev(equity) }),
|
|
129
131
|
/* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground leading-none mt-1", children: "Equity" })
|
|
130
132
|
]
|
|
131
133
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
formatCount,
|
|
10
10
|
formatMonthLabel,
|
|
11
11
|
formatTooltipDate
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M3FV7LOK.mjs";
|
|
13
13
|
import {
|
|
14
14
|
Empty,
|
|
15
15
|
EmptyDescription
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
CardContent,
|
|
21
21
|
CardHeader,
|
|
22
22
|
CardTitle
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-C7CQJNMR.mjs";
|
|
24
24
|
import {
|
|
25
25
|
useThemeVars
|
|
26
26
|
} from "./chunk-FEZKMUCF.mjs";
|
|
@@ -40,7 +40,13 @@ import {
|
|
|
40
40
|
} from "chart.js";
|
|
41
41
|
import { Chart } from "react-chartjs-2";
|
|
42
42
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
43
|
-
ChartJS.register(
|
|
43
|
+
ChartJS.register(
|
|
44
|
+
CategoryScale,
|
|
45
|
+
LinearScale,
|
|
46
|
+
BarController,
|
|
47
|
+
BarElement,
|
|
48
|
+
Tooltip
|
|
49
|
+
);
|
|
44
50
|
var ALERT_PERIODS = [3, 6, 12];
|
|
45
51
|
var SLICE_COUNT = { 3: 3, 6: 6, 12: 12 };
|
|
46
52
|
function ChartLegend() {
|
|
@@ -176,7 +182,7 @@ function BackofficeAlertHistoryChart({
|
|
|
176
182
|
style: { maxWidth: width, fontFamily },
|
|
177
183
|
children: [
|
|
178
184
|
/* @__PURE__ */ jsxs(CardHeader, { className: "px-3 sm:px-6", children: [
|
|
179
|
-
/* @__PURE__ */ jsx(CardTitle, { className: "text-
|
|
185
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-xs font-semibold uppercase tracking-wide", children: title }),
|
|
180
186
|
/* @__PURE__ */ jsx(CardAction, { children: /* @__PURE__ */ jsx("div", { className: "flex gap-0.5 sm:gap-1", children: ALERT_PERIODS.map((p) => /* @__PURE__ */ jsx(
|
|
181
187
|
ChartPeriodButton,
|
|
182
188
|
{
|
|
@@ -17,12 +17,12 @@ var badgeVariants = cva(
|
|
|
17
17
|
{
|
|
18
18
|
variants: {
|
|
19
19
|
variant: {
|
|
20
|
-
default: "bg-primary text-
|
|
21
|
-
secondary: "bg-muted text-muted-foreground [a&]:hover:bg-muted/80",
|
|
22
|
-
destructive: "bg-destructive text-destructive-
|
|
23
|
-
success: "bg-success text-success-
|
|
24
|
-
warning: "bg-warning text-warning-
|
|
25
|
-
info: "bg-info text-info-
|
|
20
|
+
default: "border-primary/40 bg-primary/10 text-foreground [a&]:hover:bg-primary/15",
|
|
21
|
+
secondary: "border-border bg-muted text-muted-foreground [a&]:hover:bg-muted/80",
|
|
22
|
+
destructive: "border-destructive/40 bg-destructive/10 text-destructive-text focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/15",
|
|
23
|
+
success: "border-success/40 bg-success/10 text-success-text [a&]:hover:bg-success/15",
|
|
24
|
+
warning: "border-warning/40 bg-warning/10 text-warning-text [a&]:hover:bg-warning/15",
|
|
25
|
+
info: "border-info/40 bg-info/10 text-info-text [a&]:hover:bg-info/15",
|
|
26
26
|
outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
27
27
|
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
28
28
|
link: "text-primary underline-offset-4 [a&]:hover:underline"
|
|
@@ -27,7 +27,7 @@ function CardHeader(_a) {
|
|
|
27
27
|
"div",
|
|
28
28
|
__spreadValues({
|
|
29
29
|
className: cn(
|
|
30
|
-
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-
|
|
30
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-center gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
31
31
|
className
|
|
32
32
|
),
|
|
33
33
|
"data-slot": "card-header"
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
} from "./chunk-34NWQURD.mjs";
|
|
8
8
|
import {
|
|
9
9
|
Badge
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BKNFWEH2.mjs";
|
|
11
11
|
import {
|
|
12
12
|
Spinner
|
|
13
13
|
} from "./chunk-7YAU5CY6.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Button
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XREGSKX3.mjs";
|
|
17
17
|
import {
|
|
18
18
|
cn
|
|
19
19
|
} from "./chunk-VLQZANBF.mjs";
|
|
@@ -62,11 +62,12 @@ function AiTaskCard({
|
|
|
62
62
|
onSelect
|
|
63
63
|
}) {
|
|
64
64
|
return /* @__PURE__ */ jsxs(
|
|
65
|
-
|
|
65
|
+
Button,
|
|
66
66
|
{
|
|
67
67
|
type: "button",
|
|
68
|
+
variant: "ghost",
|
|
68
69
|
onClick: () => onSelect(suggestion.title),
|
|
69
|
-
className: "
|
|
70
|
+
className: "h-auto w-full flex-col items-start gap-1 border border-border bg-background p-3 text-left hover:bg-muted/50",
|
|
70
71
|
children: [
|
|
71
72
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: suggestion.title }),
|
|
72
73
|
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: suggestion.description })
|
|
@@ -4,9 +4,11 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
DoughnutLegendRow,
|
|
6
6
|
FALLBACK_PRIMARY,
|
|
7
|
-
FALLBACK_SECONDARY
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
FALLBACK_SECONDARY
|
|
8
|
+
} from "./chunk-M3FV7LOK.mjs";
|
|
9
|
+
import {
|
|
10
|
+
formatCurrencyAbbrev
|
|
11
|
+
} from "./chunk-MN5NYQCL.mjs";
|
|
10
12
|
import {
|
|
11
13
|
Empty,
|
|
12
14
|
EmptyDescription
|
|
@@ -16,7 +18,7 @@ import {
|
|
|
16
18
|
CardContent,
|
|
17
19
|
CardHeader,
|
|
18
20
|
CardTitle
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-C7CQJNMR.mjs";
|
|
20
22
|
import {
|
|
21
23
|
useThemeVars
|
|
22
24
|
} from "./chunk-FEZKMUCF.mjs";
|
|
@@ -85,7 +87,7 @@ function PropertyCashflowDoughnutChart({
|
|
|
85
87
|
label: (ctx) => {
|
|
86
88
|
const val = ctx.raw;
|
|
87
89
|
const pct = total > 0 ? `${(val / total * 100).toFixed(1)}%` : "0%";
|
|
88
|
-
return ` ${ctx.label}: ${
|
|
90
|
+
return ` ${ctx.label}: ${formatCurrencyAbbrev(val)} (${pct})`;
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
}
|
|
@@ -102,7 +104,7 @@ function PropertyCashflowDoughnutChart({
|
|
|
102
104
|
className: cn("w-full py-4 sm:py-6 gap-2", className),
|
|
103
105
|
style: { maxWidth: width, fontFamily },
|
|
104
106
|
children: [
|
|
105
|
-
/* @__PURE__ */ jsx(CardHeader, { className: "px-3 sm:px-6", children: /* @__PURE__ */ jsx(CardTitle, { className: "text-
|
|
107
|
+
/* @__PURE__ */ jsx(CardHeader, { className: "px-3 sm:px-6", children: /* @__PURE__ */ jsx(CardTitle, { className: "text-xs font-semibold uppercase tracking-wide", children: title }) }),
|
|
106
108
|
/* @__PURE__ */ jsx(CardContent, { className: "px-3 sm:px-6", children: isLoading ? /* @__PURE__ */ jsx(Skeleton, { style: { height, width: "100%" } }) : !hasData ? /* @__PURE__ */ jsx(Empty, { className: "flex-none p-4", style: { height }, children: /* @__PURE__ */ jsx(EmptyDescription, { children: "No data available" }) }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
107
109
|
/* @__PURE__ */ jsxs("div", { style: { height, width: "100%", position: "relative" }, children: [
|
|
108
110
|
/* @__PURE__ */ jsx(
|
|
@@ -127,7 +129,7 @@ function PropertyCashflowDoughnutChart({
|
|
|
127
129
|
pointerEvents: "none"
|
|
128
130
|
},
|
|
129
131
|
children: [
|
|
130
|
-
/* @__PURE__ */ jsx("div", { className: "text-base font-semibold leading-tight", children:
|
|
132
|
+
/* @__PURE__ */ jsx("div", { className: "text-base font-semibold leading-tight", children: formatCurrencyAbbrev(Math.abs(netCashflow)) }),
|
|
131
133
|
/* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground leading-none mt-1", children: netLabel })
|
|
132
134
|
]
|
|
133
135
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-VLQZANBF.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/ui/page-top-bar.tsx
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function PageTopBar({ title, actions, className }) {
|
|
8
|
+
return /* @__PURE__ */ jsxs(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
"data-slot": "page-top-bar",
|
|
12
|
+
className: cn(
|
|
13
|
+
"flex shrink-0 items-center justify-between gap-4",
|
|
14
|
+
"border-b border-border bg-background px-6 py-3",
|
|
15
|
+
className
|
|
16
|
+
),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsx("h1", { className: "text-lg font-semibold leading-tight", children: title }),
|
|
19
|
+
actions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: actions })
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
PageTopBar
|
|
27
|
+
};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Calendar
|
|
3
|
-
} from "./chunk-P6AM5V7O.mjs";
|
|
4
1
|
import {
|
|
5
2
|
Popover,
|
|
6
3
|
PopoverContent,
|
|
7
4
|
PopoverTrigger
|
|
8
5
|
} from "./chunk-3GF7OVTP.mjs";
|
|
6
|
+
import {
|
|
7
|
+
Calendar
|
|
8
|
+
} from "./chunk-OODBHKG7.mjs";
|
|
9
|
+
import {
|
|
10
|
+
Input
|
|
11
|
+
} from "./chunk-GYMYRIZP.mjs";
|
|
9
12
|
import {
|
|
10
13
|
Button
|
|
11
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XREGSKX3.mjs";
|
|
12
15
|
import {
|
|
13
16
|
cn
|
|
14
17
|
} from "./chunk-VLQZANBF.mjs";
|
|
@@ -65,6 +68,8 @@ function DatePicker({
|
|
|
65
68
|
{
|
|
66
69
|
className: cn(
|
|
67
70
|
"w-full justify-start rounded-none font-normal data-[empty=true]:text-muted-foreground",
|
|
71
|
+
// Show open/focus state when the popover is expanded
|
|
72
|
+
"aria-expanded:border-ring aria-expanded:ring-2 aria-expanded:ring-ring/20",
|
|
68
73
|
className
|
|
69
74
|
),
|
|
70
75
|
"data-empty": !value,
|
|
@@ -102,9 +107,9 @@ function DatePicker({
|
|
|
102
107
|
showTimePicker ? /* @__PURE__ */ jsx("div", { className: "border-t border-border px-3 pb-3 pt-2", children: /* @__PURE__ */ jsxs("label", { className: "mb-1.5 block text-xs font-medium text-muted-foreground", children: [
|
|
103
108
|
"Time",
|
|
104
109
|
/* @__PURE__ */ jsx(
|
|
105
|
-
|
|
110
|
+
Input,
|
|
106
111
|
{
|
|
107
|
-
className: "mt-1.5 h-8
|
|
112
|
+
className: "mt-1.5 h-8",
|
|
108
113
|
onChange: handleTimeChange,
|
|
109
114
|
type: "time",
|
|
110
115
|
value: timeValue
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
formatMonthLabel,
|
|
11
11
|
formatTooltipDate,
|
|
12
12
|
hexToRgba
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-M3FV7LOK.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Empty,
|
|
16
16
|
EmptyDescription
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
CardContent,
|
|
22
22
|
CardHeader,
|
|
23
23
|
CardTitle
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-C7CQJNMR.mjs";
|
|
25
25
|
import {
|
|
26
26
|
useThemeVars
|
|
27
27
|
} from "./chunk-FEZKMUCF.mjs";
|
|
@@ -41,7 +41,13 @@ import {
|
|
|
41
41
|
} from "chart.js";
|
|
42
42
|
import { Chart } from "react-chartjs-2";
|
|
43
43
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
44
|
-
ChartJS.register(
|
|
44
|
+
ChartJS.register(
|
|
45
|
+
CategoryScale,
|
|
46
|
+
LinearScale,
|
|
47
|
+
BarController,
|
|
48
|
+
BarElement,
|
|
49
|
+
Tooltip
|
|
50
|
+
);
|
|
45
51
|
var CONTACT_PERIODS = [3, 6, 12];
|
|
46
52
|
var SLICE_COUNT = {
|
|
47
53
|
3: 3,
|
|
@@ -220,7 +226,7 @@ function BackofficeContactHistoryChart({
|
|
|
220
226
|
style: { maxWidth: width, fontFamily },
|
|
221
227
|
children: [
|
|
222
228
|
/* @__PURE__ */ jsxs(CardHeader, { className: "px-3 sm:px-6", children: [
|
|
223
|
-
/* @__PURE__ */ jsx(CardTitle, { className: "text-
|
|
229
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-xs font-semibold uppercase tracking-wide", children: title }),
|
|
224
230
|
/* @__PURE__ */ jsx(CardAction, { children: /* @__PURE__ */ jsx("div", { className: "flex gap-0.5 sm:gap-1", children: CONTACT_PERIODS.map((p) => /* @__PURE__ */ jsx(
|
|
225
231
|
ChartPeriodButton,
|
|
226
232
|
{
|