@wealthx/shadcn 1.5.11 → 1.5.13

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.
Files changed (36) hide show
  1. package/.turbo/turbo-build.log +88 -88
  2. package/CHANGELOG.md +12 -0
  3. package/dist/{chunk-O5CP6VP6.mjs → chunk-BF5FKUF6.mjs} +104 -63
  4. package/dist/{chunk-ZMTCMP2G.mjs → chunk-EB626HVW.mjs} +70 -3
  5. package/dist/chunk-KICT4VQL.mjs +508 -0
  6. package/dist/chunk-V23CBULF.mjs +432 -0
  7. package/dist/components/ui/ai-conversations.js +70 -3
  8. package/dist/components/ui/ai-conversations.mjs +1 -1
  9. package/dist/components/ui/appointment-calendar-view.js +177 -176
  10. package/dist/components/ui/appointment-calendar-view.mjs +1 -1
  11. package/dist/components/ui/bank-statement-generate-dialog.js +209 -107
  12. package/dist/components/ui/bank-statement-generate-dialog.mjs +2 -1
  13. package/dist/components/ui/resource-center/index.js +1030 -0
  14. package/dist/components/ui/resource-center/index.mjs +29 -0
  15. package/dist/index.js +661 -403
  16. package/dist/index.mjs +16 -14
  17. package/dist/styles.css +1 -1
  18. package/package.json +4 -4
  19. package/src/components/index.tsx +2 -0
  20. package/src/components/ui/ai-conversations.tsx +157 -23
  21. package/src/components/ui/appointment-calendar-view.tsx +211 -199
  22. package/src/components/ui/bank-statement-generate-dialog.tsx +147 -96
  23. package/src/components/ui/resource-center/index.tsx +35 -0
  24. package/src/components/ui/resource-center/resource-cards.tsx +218 -0
  25. package/src/components/ui/resource-center/resource-carousel.tsx +122 -0
  26. package/src/components/ui/resource-center/resource-center-header.tsx +95 -0
  27. package/src/components/ui/resource-center/resource-email-editor-dialog.tsx +131 -0
  28. package/src/components/ui/resource-center/resource-modal.tsx +76 -0
  29. package/src/components/ui/resource-center/types.ts +81 -0
  30. package/src/styles/styles-css.ts +1 -1
  31. package/tsup.config.ts +1 -1
  32. package/dist/chunk-IODGRCQG.mjs +0 -438
  33. package/dist/chunk-XYWEGBAA.mjs +0 -348
  34. package/dist/components/ui/resource-center.js +0 -748
  35. package/dist/components/ui/resource-center.mjs +0 -24
  36. package/src/components/ui/resource-center.tsx +0 -539
@@ -65,6 +65,11 @@ module.exports = __toCommonJS(bank_statement_generate_dialog_exports);
65
65
  var import_react5 = require("react");
66
66
  var import_date_fns3 = require("date-fns");
67
67
 
68
+ // src/components/ui/button.tsx
69
+ var import_react = require("react");
70
+ var import_class_variance_authority = require("class-variance-authority");
71
+ var import_lucide_react = require("lucide-react");
72
+
68
73
  // src/lib/utils.ts
69
74
  var import_clsx = require("clsx");
70
75
  var import_tailwind_merge = require("tailwind-merge");
@@ -104,11 +109,6 @@ function cn(...inputs) {
104
109
  return twMerge((0, import_clsx.clsx)(inputs));
105
110
  }
106
111
 
107
- // src/components/ui/button.tsx
108
- var import_react = require("react");
109
- var import_class_variance_authority = require("class-variance-authority");
110
- var import_lucide_react = require("lucide-react");
111
-
112
112
  // src/lib/slot.tsx
113
113
  var React = __toESM(require("react"));
114
114
  function mergeRefs(...refs) {
@@ -911,6 +911,9 @@ function FieldLabel(_a) {
911
911
  );
912
912
  }
913
913
 
914
+ // src/components/ui/pagination.tsx
915
+ var import_lucide_react7 = require("lucide-react");
916
+
914
917
  // src/components/ui/select.tsx
915
918
  var import_lucide_react6 = require("lucide-react");
916
919
  var import_select = require("@base-ui/react/select");
@@ -1058,10 +1061,68 @@ function SelectScrollDownButton(_a) {
1058
1061
  );
1059
1062
  }
1060
1063
 
1064
+ // src/components/ui/pagination.tsx
1065
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1066
+ function PaginationNavButtons({
1067
+ hasPrev,
1068
+ hasNext,
1069
+ onFirst,
1070
+ onPrev,
1071
+ onNext,
1072
+ onLast
1073
+ }) {
1074
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-1", children: [
1075
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1076
+ Button,
1077
+ {
1078
+ "aria-label": "Go to first page",
1079
+ disabled: !hasPrev,
1080
+ onClick: onFirst,
1081
+ size: "icon-sm",
1082
+ variant: "outline",
1083
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.ChevronsLeftIcon, { className: "size-4" })
1084
+ }
1085
+ ),
1086
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1087
+ Button,
1088
+ {
1089
+ "aria-label": "Go to previous page",
1090
+ disabled: !hasPrev,
1091
+ onClick: onPrev,
1092
+ size: "icon-sm",
1093
+ variant: "outline",
1094
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.ChevronLeftIcon, { className: "size-4" })
1095
+ }
1096
+ ),
1097
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1098
+ Button,
1099
+ {
1100
+ "aria-label": "Go to next page",
1101
+ disabled: !hasNext,
1102
+ onClick: onNext,
1103
+ size: "icon-sm",
1104
+ variant: "outline",
1105
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.ChevronRightIcon, { className: "size-4" })
1106
+ }
1107
+ ),
1108
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1109
+ Button,
1110
+ {
1111
+ "aria-label": "Go to last page",
1112
+ disabled: !hasNext,
1113
+ onClick: onLast,
1114
+ size: "icon-sm",
1115
+ variant: "outline",
1116
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.ChevronsRightIcon, { className: "size-4" })
1117
+ }
1118
+ )
1119
+ ] });
1120
+ }
1121
+
1061
1122
  // src/components/ui/spinner.tsx
1062
1123
  var import_class_variance_authority3 = require("class-variance-authority");
1063
- var import_lucide_react7 = require("lucide-react");
1064
- var import_jsx_runtime13 = require("react/jsx-runtime");
1124
+ var import_lucide_react8 = require("lucide-react");
1125
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1065
1126
  var spinnerVariants = (0, import_class_variance_authority3.cva)("animate-spin shrink-0", {
1066
1127
  variants: {
1067
1128
  size: {
@@ -1077,8 +1138,8 @@ var spinnerVariants = (0, import_class_variance_authority3.cva)("animate-spin sh
1077
1138
  });
1078
1139
  function Spinner(_a) {
1079
1140
  var _b = _a, { className, size } = _b, props = __objRest(_b, ["className", "size"]);
1080
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1081
- import_lucide_react7.LoaderCircle,
1141
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1142
+ import_lucide_react8.LoaderCircle,
1082
1143
  __spreadValues({
1083
1144
  "aria-hidden": "true",
1084
1145
  className: cn(spinnerVariants({ size }), className),
@@ -1088,15 +1149,15 @@ function Spinner(_a) {
1088
1149
  }
1089
1150
 
1090
1151
  // src/components/ui/table.tsx
1091
- var import_jsx_runtime14 = require("react/jsx-runtime");
1152
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1092
1153
  function Table(_a) {
1093
1154
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1094
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1155
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1095
1156
  "div",
1096
1157
  {
1097
1158
  className: "relative w-full overflow-x-auto",
1098
1159
  "data-slot": "table-container",
1099
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1160
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1100
1161
  "table",
1101
1162
  __spreadValues({
1102
1163
  className: cn("w-full caption-bottom text-body-small", className),
@@ -1108,7 +1169,7 @@ function Table(_a) {
1108
1169
  }
1109
1170
  function TableHeader(_a) {
1110
1171
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1111
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1172
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1112
1173
  "thead",
1113
1174
  __spreadValues({
1114
1175
  className: cn("[&_tr]:border-b", className),
@@ -1118,7 +1179,7 @@ function TableHeader(_a) {
1118
1179
  }
1119
1180
  function TableBody(_a) {
1120
1181
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1121
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1182
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1122
1183
  "tbody",
1123
1184
  __spreadValues({
1124
1185
  className: cn("[&_tr:last-child]:border-0", className),
@@ -1128,7 +1189,7 @@ function TableBody(_a) {
1128
1189
  }
1129
1190
  function TableRow(_a) {
1130
1191
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1131
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1192
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1132
1193
  "tr",
1133
1194
  __spreadValues({
1134
1195
  className: cn(
@@ -1141,7 +1202,7 @@ function TableRow(_a) {
1141
1202
  }
1142
1203
  function TableHead(_a) {
1143
1204
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1144
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1205
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1145
1206
  "th",
1146
1207
  __spreadValues({
1147
1208
  className: cn(
@@ -1155,7 +1216,7 @@ function TableHead(_a) {
1155
1216
  }
1156
1217
  function TableCell(_a) {
1157
1218
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1158
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1219
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1159
1220
  "td",
1160
1221
  __spreadValues({
1161
1222
  className: cn(
@@ -1176,7 +1237,7 @@ var import_toggle2 = require("@base-ui/react/toggle");
1176
1237
  // src/components/ui/toggle.tsx
1177
1238
  var import_class_variance_authority4 = require("class-variance-authority");
1178
1239
  var import_toggle = require("@base-ui/react/toggle");
1179
- var import_jsx_runtime15 = require("react/jsx-runtime");
1240
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1180
1241
  var toggleVariants = (0, import_class_variance_authority4.cva)(
1181
1242
  "inline-flex items-center justify-center gap-2 whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-pressed:bg-primary/10 data-pressed:inset-ring data-pressed:inset-ring-primary data-pressed:text-foreground data-pressed:hover:bg-primary/10 data-pressed:hover:text-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1182
1243
  {
@@ -1199,7 +1260,7 @@ var toggleVariants = (0, import_class_variance_authority4.cva)(
1199
1260
  );
1200
1261
 
1201
1262
  // src/components/ui/toggle-group.tsx
1202
- var import_jsx_runtime16 = require("react/jsx-runtime");
1263
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1203
1264
  var ToggleGroupContext = React5.createContext({
1204
1265
  size: "default",
1205
1266
  variant: "default",
@@ -1221,7 +1282,7 @@ function ToggleGroup(_a) {
1221
1282
  "type",
1222
1283
  "children"
1223
1284
  ]);
1224
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1285
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1225
1286
  import_toggle_group.ToggleGroup,
1226
1287
  __spreadProps(__spreadValues({
1227
1288
  className: cn(
@@ -1236,7 +1297,7 @@ function ToggleGroup(_a) {
1236
1297
  multiple: type === "multiple",
1237
1298
  style: { "--gap": spacing }
1238
1299
  }, props), {
1239
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToggleGroupContext.Provider, { value: { variant, size, spacing }, children })
1300
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupContext.Provider, { value: { variant, size, spacing }, children })
1240
1301
  })
1241
1302
  );
1242
1303
  }
@@ -1253,7 +1314,7 @@ function ToggleGroupItem(_a) {
1253
1314
  "size"
1254
1315
  ]);
1255
1316
  const context = React5.useContext(ToggleGroupContext);
1256
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1317
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1257
1318
  import_toggle2.Toggle,
1258
1319
  __spreadProps(__spreadValues({
1259
1320
  className: cn(
@@ -1277,7 +1338,12 @@ function ToggleGroupItem(_a) {
1277
1338
  }
1278
1339
 
1279
1340
  // src/components/ui/bank-statement-generate-dialog.tsx
1280
- var import_jsx_runtime17 = require("react/jsx-runtime");
1341
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1342
+ var APPLICANT_TYPE_LABELS = {
1343
+ primary: "Main applicant",
1344
+ secondary: "Co-applicant"
1345
+ };
1346
+ var ACCOUNTS_PAGE_SIZE = 5;
1281
1347
  function toIsoDate(date) {
1282
1348
  return date.toISOString().slice(0, 10);
1283
1349
  }
@@ -1301,29 +1367,37 @@ function BankStatementGenerateDialog({
1301
1367
  }) {
1302
1368
  const [statementName, setStatementName] = (0, import_react5.useState)("Bank Statement 1");
1303
1369
  const [rangePreset, setRangePreset] = (0, import_react5.useState)(90);
1304
- const [fromDate, setFromDate] = (0, import_react5.useState)("");
1305
- const [toDate, setToDate] = (0, import_react5.useState)("");
1370
+ const [fromDate, setFromDate] = (0, import_react5.useState)(
1371
+ () => presetToDateRange(90).from
1372
+ );
1373
+ const [toDate, setToDate] = (0, import_react5.useState)(() => presetToDateRange(90).to);
1306
1374
  const [applicantType, setApplicantType] = (0, import_react5.useState)("");
1307
1375
  const [selectedAccountIds, setSelectedAccountIds] = (0, import_react5.useState)([]);
1376
+ const [accountPage, setAccountPage] = (0, import_react5.useState)(1);
1308
1377
  (0, import_react5.useEffect)(() => {
1309
1378
  if (!open) return;
1310
1379
  const timer = setTimeout(() => {
1311
- setStatementName("Bank Statement 1");
1312
- setApplicantType("");
1313
- setSelectedAccountIds([]);
1314
1380
  const { from, to } = presetToDateRange(90);
1381
+ setStatementName("Bank Statement 1");
1315
1382
  setRangePreset(90);
1316
1383
  setFromDate(from);
1317
1384
  setToDate(to);
1385
+ setApplicantType("");
1386
+ setSelectedAccountIds([]);
1387
+ setAccountPage(1);
1318
1388
  }, 0);
1319
1389
  return () => clearTimeout(timer);
1320
1390
  }, [open]);
1321
1391
  const handleApplicantTypeChange = (type) => {
1322
1392
  setApplicantType(type);
1323
1393
  setSelectedAccountIds([]);
1394
+ setAccountPage(1);
1324
1395
  onApplicantTypeChange == null ? void 0 : onApplicantTypeChange(type);
1325
1396
  };
1326
- const applyPreset = (preset) => {
1397
+ const handlePresetChange = (val) => {
1398
+ if (val.length === 0) return;
1399
+ const raw = val[0];
1400
+ const preset = raw === "custom" ? "custom" : Number(raw);
1327
1401
  setRangePreset(preset);
1328
1402
  if (preset !== "custom") {
1329
1403
  const { from, to } = presetToDateRange(preset);
@@ -1339,12 +1413,13 @@ function BankStatementGenerateDialog({
1339
1413
  );
1340
1414
  };
1341
1415
  const handleToggleAll = () => {
1342
- if (areAllSelected) {
1343
- setSelectedAccountIds([]);
1344
- } else {
1345
- setSelectedAccountIds(bankAccounts.map((a) => a.id));
1346
- }
1416
+ setSelectedAccountIds(areAllSelected ? [] : bankAccounts.map((a) => a.id));
1347
1417
  };
1418
+ const accountPageCount = Math.ceil(bankAccounts.length / ACCOUNTS_PAGE_SIZE);
1419
+ const pagedAccounts = bankAccounts.slice(
1420
+ (accountPage - 1) * ACCOUNTS_PAGE_SIZE,
1421
+ accountPage * ACCOUNTS_PAGE_SIZE
1422
+ );
1348
1423
  const periodLabel = (0, import_react5.useMemo)(() => {
1349
1424
  if (fromDate && toDate) {
1350
1425
  return `${(0, import_date_fns3.format)((0, import_date_fns3.parseISO)(fromDate), "dd MMM yyyy")} \u2013 ${(0, import_date_fns3.format)((0, import_date_fns3.parseISO)(toDate), "dd MMM yyyy")}`;
@@ -1363,17 +1438,18 @@ function BankStatementGenerateDialog({
1363
1438
  selectedAccountIds
1364
1439
  });
1365
1440
  };
1366
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Dialog, { open, onOpenChange: (o) => !o && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1441
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Dialog, { open, onOpenChange: (o) => !o && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1367
1442
  DialogContent,
1368
1443
  {
1369
- className: cn("max-w-[700px]", className),
1444
+ size: "3xl",
1445
+ className,
1370
1446
  "data-slot": "bank-statement-generate-dialog",
1371
1447
  children: [
1372
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogTitle, { children: "Generate Bank Statement" }) }),
1373
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col gap-4", children: [
1374
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Field, { children: [
1375
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FieldLabel, { children: "Name" }),
1376
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1448
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DialogTitle, { children: "Generate Bank Statement" }) }),
1449
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-4", children: [
1450
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Field, { children: [
1451
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FieldLabel, { children: "Name" }),
1452
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1377
1453
  Input,
1378
1454
  {
1379
1455
  value: statementName,
@@ -1382,35 +1458,27 @@ function BankStatementGenerateDialog({
1382
1458
  }
1383
1459
  )
1384
1460
  ] }),
1385
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col gap-2", children: [
1386
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-body-small text-muted-foreground", children: "Statement period" }),
1387
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1461
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-2", children: [
1462
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-body-small text-muted-foreground", children: "Statement period" }),
1463
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1388
1464
  ToggleGroup,
1389
1465
  {
1390
1466
  type: "single",
1391
1467
  variant: "outline",
1392
1468
  value: [String(rangePreset)],
1393
- onValueChange: (val) => {
1394
- if (val.length === 0) return;
1395
- const raw = val[0];
1396
- if (raw === "custom") {
1397
- applyPreset("custom");
1398
- } else {
1399
- applyPreset(Number(raw));
1400
- }
1401
- },
1469
+ onValueChange: handlePresetChange,
1402
1470
  className: "w-full",
1403
1471
  children: [
1404
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupItem, { value: "90", className: "flex-1", children: "3 Months" }),
1405
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupItem, { value: "180", className: "flex-1", children: "6 Months" }),
1406
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupItem, { value: "365", className: "flex-1", children: "12 Months" }),
1407
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupItem, { value: "custom", className: "flex-1", children: "Custom" })
1472
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ToggleGroupItem, { value: "90", className: "flex-1", children: "3 Months" }),
1473
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ToggleGroupItem, { value: "180", className: "flex-1", children: "6 Months" }),
1474
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ToggleGroupItem, { value: "365", className: "flex-1", children: "12 Months" }),
1475
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ToggleGroupItem, { value: "custom", className: "flex-1", children: "Custom" })
1408
1476
  ]
1409
1477
  }
1410
1478
  )
1411
1479
  ] }),
1412
- rangePreset === "custom" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex gap-3", children: [
1413
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1480
+ rangePreset === "custom" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex gap-3", children: [
1481
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1414
1482
  DatePicker,
1415
1483
  {
1416
1484
  value: fromDate ? (0, import_date_fns3.parseISO)(fromDate) : void 0,
@@ -1419,7 +1487,7 @@ function BankStatementGenerateDialog({
1419
1487
  className: "flex-1"
1420
1488
  }
1421
1489
  ),
1422
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1490
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1423
1491
  DatePicker,
1424
1492
  {
1425
1493
  value: toDate ? (0, import_date_fns3.parseISO)(toDate) : void 0,
@@ -1429,26 +1497,25 @@ function BankStatementGenerateDialog({
1429
1497
  }
1430
1498
  )
1431
1499
  ] }),
1432
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1500
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1433
1501
  Select,
1434
1502
  {
1435
1503
  value: applicantType,
1436
1504
  onValueChange: (v) => handleApplicantTypeChange(v),
1505
+ items: APPLICANT_TYPE_LABELS,
1437
1506
  children: [
1438
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectValue, { placeholder: "Applicant Type" }) }),
1439
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SelectContent, { children: [
1440
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectItem, { value: "primary", children: "Main applicant" }),
1441
- hasCoApplicant && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectItem, { value: "secondary", children: "Co-applicant" })
1507
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectValue, { placeholder: "Applicant Type" }) }),
1508
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(SelectContent, { children: [
1509
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectItem, { value: "primary", children: APPLICANT_TYPE_LABELS.primary }),
1510
+ hasCoApplicant && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectItem, { value: "secondary", children: APPLICANT_TYPE_LABELS.secondary })
1442
1511
  ] })
1443
1512
  ]
1444
1513
  }
1445
1514
  ),
1446
- applicantType && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "mt-1", children: [
1447
- isLoadingAccounts && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center justify-center p-6", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Spinner, { size: "lg" }) }),
1448
- !isLoadingAccounts && bankAccounts.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "py-4 text-center text-body-medium text-muted-foreground", children: "No bank accounts found for the selected applicant" }),
1449
- !isLoadingAccounts && bankAccounts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Table, { children: [
1450
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TableRow, { children: [
1451
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableHead, { className: "w-10", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1515
+ applicantType && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mt-1", children: isLoadingAccounts ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex items-center justify-center p-6", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Spinner, { size: "lg" }) }) : bankAccounts.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "py-4 text-center text-body-medium text-muted-foreground", children: "No bank accounts found for the selected applicant" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
1516
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Table, { className: "table-fixed", children: [
1517
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TableRow, { children: [
1518
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableHead, { className: "w-10", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1452
1519
  Checkbox,
1453
1520
  {
1454
1521
  checked: areAllSelected,
@@ -1457,47 +1524,82 @@ function BankStatementGenerateDialog({
1457
1524
  "aria-label": "Select all accounts"
1458
1525
  }
1459
1526
  ) }),
1460
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableHead, { children: "Account Name" }),
1461
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableHead, { children: "Account Number" }),
1462
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableHead, { children: "Period" }),
1463
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableHead, { children: "Last Updated" })
1527
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableHead, { children: "Account Name" }),
1528
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableHead, { className: "w-40", children: "Account Number" }),
1529
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableHead, { className: "w-52", children: "Period" }),
1530
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableHead, { className: "w-28", children: "Last Updated" })
1464
1531
  ] }) }),
1465
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableBody, { children: bankAccounts.map((account) => {
1532
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableBody, { children: pagedAccounts.map((account) => {
1466
1533
  var _a, _b;
1467
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TableRow, { children: [
1468
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1469
- Checkbox,
1470
- {
1471
- checked: selectedAccountIds.includes(account.id),
1472
- onCheckedChange: () => handleToggleAccount(account.id),
1473
- "aria-label": `Select ${account.name}`
1474
- }
1475
- ) }),
1476
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2", children: [
1477
- account.institutionLogo && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1478
- "img",
1479
- {
1480
- src: account.institutionLogo,
1481
- alt: (_a = account.institutionName) != null ? _a : "",
1482
- className: "size-8 rounded object-cover"
1483
- }
1484
- ),
1485
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-body-medium font-semibold", children: account.name || account.institutionName || "\u2014" })
1486
- ] }) }),
1487
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-body-medium", children: (_b = account.accountNo) != null ? _b : "\u2014" }) }),
1488
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-body-medium", children: periodLabel }) }),
1489
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-body-medium", children: account.lastUpdated ? (0, import_date_fns3.format)(
1490
- (0, import_date_fns3.parseISO)(account.lastUpdated),
1491
- "dd MMM yyyy"
1492
- ) : "\u2014" }) })
1493
- ] }, account.id);
1534
+ const isSelected = selectedAccountIds.includes(
1535
+ account.id
1536
+ );
1537
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1538
+ TableRow,
1539
+ {
1540
+ "data-state": isSelected ? "selected" : void 0,
1541
+ children: [
1542
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1543
+ Checkbox,
1544
+ {
1545
+ checked: isSelected,
1546
+ onCheckedChange: () => handleToggleAccount(account.id),
1547
+ "aria-label": `Select ${account.name}`
1548
+ }
1549
+ ) }),
1550
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
1551
+ account.institutionLogo && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1552
+ "img",
1553
+ {
1554
+ src: account.institutionLogo,
1555
+ alt: (_a = account.institutionName) != null ? _a : "",
1556
+ className: "size-8 object-cover"
1557
+ }
1558
+ ),
1559
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-body-medium font-semibold", children: account.name || account.institutionName || "\u2014" })
1560
+ ] }) }),
1561
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-body-medium", children: (_b = account.accountNo) != null ? _b : "\u2014" }) }),
1562
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-body-medium", children: periodLabel }) }),
1563
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-body-medium", children: account.lastUpdated ? (0, import_date_fns3.format)(
1564
+ (0, import_date_fns3.parseISO)(account.lastUpdated),
1565
+ "dd MMM yyyy"
1566
+ ) : "\u2014" }) })
1567
+ ]
1568
+ },
1569
+ account.id
1570
+ );
1494
1571
  }) })
1572
+ ] }),
1573
+ accountPageCount > 1 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center justify-between pt-2", children: [
1574
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "text-body-small text-muted-foreground", children: [
1575
+ (accountPage - 1) * ACCOUNTS_PAGE_SIZE + 1,
1576
+ "\u2013",
1577
+ Math.min(
1578
+ accountPage * ACCOUNTS_PAGE_SIZE,
1579
+ bankAccounts.length
1580
+ ),
1581
+ " ",
1582
+ "of ",
1583
+ bankAccounts.length,
1584
+ " accounts"
1585
+ ] }),
1586
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1587
+ PaginationNavButtons,
1588
+ {
1589
+ hasPrev: accountPage > 1,
1590
+ hasNext: accountPage < accountPageCount,
1591
+ onFirst: () => setAccountPage(1),
1592
+ onPrev: () => setAccountPage((p) => p - 1),
1593
+ onNext: () => setAccountPage((p) => p + 1),
1594
+ onLast: () => setAccountPage(accountPageCount)
1595
+ }
1596
+ )
1495
1597
  ] })
1496
- ] })
1598
+ ] }) })
1497
1599
  ] }),
1498
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DialogFooter, { children: [
1499
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { variant: "ghost", onClick: onClose, children: "Cancel" }),
1500
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1600
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DialogFooter, { children: [
1601
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { variant: "ghost", onClick: onClose, children: "Cancel" }),
1602
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1501
1603
  Button,
1502
1604
  {
1503
1605
  onClick: handleSubmit,
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  BankStatementGenerateDialog
3
- } from "../../chunk-O5CP6VP6.mjs";
3
+ } from "../../chunk-BF5FKUF6.mjs";
4
4
  import "../../chunk-MUV4EGDW.mjs";
5
+ import "../../chunk-SSUK6C2K.mjs";
5
6
  import "../../chunk-GT3RU6GA.mjs";
6
7
  import "../../chunk-IKXYTCSB.mjs";
7
8
  import "../../chunk-USOVLDGS.mjs";