warqadui 0.0.24 → 0.0.26

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.js CHANGED
@@ -1092,19 +1092,33 @@ var PageHeader = ({
1092
1092
 
1093
1093
  // src/hooks/useModal.tsx
1094
1094
  var import_react7 = require("react");
1095
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1096
+ var defaultState = {
1097
+ type: null,
1098
+ title: "Untitled",
1099
+ content: null,
1100
+ width: 600,
1101
+ data: null
1102
+ };
1095
1103
  var useModal = (initialState = false) => {
1096
1104
  const [isOpen, setIsOpen] = (0, import_react7.useState)(initialState);
1097
- const [state, setState] = (0, import_react7.useState)(null);
1105
+ const [state, setState] = (0, import_react7.useState)(defaultState);
1106
+ const resetState = (0, import_react7.useCallback)(() => {
1107
+ setState(defaultState);
1108
+ }, []);
1098
1109
  const open = (0, import_react7.useCallback)(() => setIsOpen(true), []);
1099
1110
  const close = (0, import_react7.useCallback)(() => {
1100
1111
  setIsOpen(false);
1101
- setState(null);
1112
+ resetState();
1102
1113
  }, []);
1103
1114
  const toggle = (0, import_react7.useCallback)(() => setIsOpen((prev) => !prev), []);
1104
1115
  const openState = (0, import_react7.useCallback)((data) => {
1105
1116
  setState(data);
1106
1117
  open();
1107
1118
  }, []);
1119
+ const ModalComponent = (props) => {
1120
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Modal, { isOpen: true, onClose: close, title: state?.title, children: state?.content });
1121
+ };
1108
1122
  return {
1109
1123
  isOpen,
1110
1124
  open,
@@ -1112,7 +1126,9 @@ var useModal = (initialState = false) => {
1112
1126
  toggle,
1113
1127
  openState,
1114
1128
  state,
1115
- Modal
1129
+ resetState,
1130
+ defaultState,
1131
+ Modal: ModalComponent
1116
1132
  };
1117
1133
  };
1118
1134
 
@@ -1120,7 +1136,7 @@ var useModal = (initialState = false) => {
1120
1136
  var import_react8 = require("react");
1121
1137
  var import_lucide_react6 = require("lucide-react");
1122
1138
  var import_react_hook_form = require("react-hook-form");
1123
- var import_jsx_runtime16 = require("react/jsx-runtime");
1139
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1124
1140
  var Input = (0, import_react8.forwardRef)(
1125
1141
  ({
1126
1142
  label,
@@ -1153,12 +1169,12 @@ var Input = (0, import_react8.forwardRef)(
1153
1169
  form.clearErrors("root");
1154
1170
  }
1155
1171
  }, [form?.watch(name)]);
1156
- const renderInput = (inputProps, localType = type || "text") => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1172
+ const renderInput = (inputProps, localType = type || "text") => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1157
1173
  "div",
1158
1174
  {
1159
1175
  className: `${label ? "space-y-2" : ""} group relative ${containerClassName} `,
1160
1176
  children: [
1161
- label && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1177
+ label && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1162
1178
  "label",
1163
1179
  {
1164
1180
  htmlFor: props.id,
@@ -1166,12 +1182,12 @@ var Input = (0, import_react8.forwardRef)(
1166
1182
  style: { color: isFocused ? primaryColor : void 0 },
1167
1183
  children: [
1168
1184
  label,
1169
- props.required && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
1185
+ props.required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
1170
1186
  ]
1171
1187
  }
1172
1188
  ),
1173
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "relative", children: [
1174
- icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "absolute inset-y-0 left-0 pl-2.5 flex items-center pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1189
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative", children: [
1190
+ icon && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "absolute inset-y-0 left-0 pl-2.5 flex items-center pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1175
1191
  "div",
1176
1192
  {
1177
1193
  className: `transition-colors duration-200`,
@@ -1179,7 +1195,7 @@ var Input = (0, import_react8.forwardRef)(
1179
1195
  children: icon
1180
1196
  }
1181
1197
  ) }),
1182
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1198
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1183
1199
  "input",
1184
1200
  {
1185
1201
  ref,
@@ -1201,23 +1217,23 @@ var Input = (0, import_react8.forwardRef)(
1201
1217
  type: localType === "password" ? showPassword ? "text" : "password" : localType
1202
1218
  }
1203
1219
  ),
1204
- type === "password" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1220
+ type === "password" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1205
1221
  "button",
1206
1222
  {
1207
1223
  type: "button",
1208
1224
  onClick: () => setShowPassword(!showPassword),
1209
1225
  className: "absolute inset-y-0 right-0 pr-2.5 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors focus:outline-none cursor-pointer",
1210
1226
  tabIndex: -1,
1211
- children: showPassword ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.EyeOff, { className: "h-5 w-5" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.Eye, { className: "h-5 w-5" })
1227
+ children: showPassword ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react6.EyeOff, { className: "h-5 w-5" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react6.Eye, { className: "h-5 w-5" })
1212
1228
  }
1213
1229
  )
1214
1230
  ] }),
1215
- message && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message })
1231
+ message && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message })
1216
1232
  ]
1217
1233
  }
1218
1234
  );
1219
1235
  if (form && name && type === "number") {
1220
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1236
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1221
1237
  import_react_hook_form.Controller,
1222
1238
  {
1223
1239
  control: form.control,
@@ -1287,7 +1303,7 @@ var import_react9 = require("react");
1287
1303
  var import_react_phone_number_input = __toESM(require("react-phone-number-input"));
1288
1304
  var import_style = require("react-phone-number-input/style.css");
1289
1305
  var import_react_hook_form2 = require("react-hook-form");
1290
- var import_jsx_runtime17 = require("react/jsx-runtime");
1306
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1291
1307
  var PhoneInput = (0, import_react9.forwardRef)(
1292
1308
  ({
1293
1309
  label,
@@ -1316,8 +1332,8 @@ var PhoneInput = (0, import_react9.forwardRef)(
1316
1332
  }
1317
1333
  message = currentError?.message || message;
1318
1334
  }
1319
- const renderInput = (onChangeHandler, currentValue) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: `space-y-2 group relative ${containerClassName}`, children: [
1320
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1335
+ const renderInput = (onChangeHandler, currentValue) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: `space-y-2 group relative ${containerClassName}`, children: [
1336
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1321
1337
  "label",
1322
1338
  {
1323
1339
  className: `block text-xs font-medium transition-colors duration-200`,
@@ -1326,12 +1342,12 @@ var PhoneInput = (0, import_react9.forwardRef)(
1326
1342
  },
1327
1343
  children: [
1328
1344
  label,
1329
- props.required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
1345
+ props.required && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
1330
1346
  ]
1331
1347
  }
1332
1348
  ),
1333
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative", children: [
1334
- icon && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "absolute inset-y-0 left-0 pl-2.5 flex items-center pointer-events-none z-10", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1349
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "relative", children: [
1350
+ icon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "absolute inset-y-0 left-0 pl-2.5 flex items-center pointer-events-none z-10", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1335
1351
  "div",
1336
1352
  {
1337
1353
  className: `transition-colors duration-200`,
@@ -1339,7 +1355,7 @@ var PhoneInput = (0, import_react9.forwardRef)(
1339
1355
  children: icon
1340
1356
  }
1341
1357
  ) }),
1342
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1358
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1343
1359
  import_react_phone_number_input.default,
1344
1360
  {
1345
1361
  ref,
@@ -1359,10 +1375,10 @@ var PhoneInput = (0, import_react9.forwardRef)(
1359
1375
  }
1360
1376
  )
1361
1377
  ] }),
1362
- message && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message })
1378
+ message && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message })
1363
1379
  ] });
1364
1380
  if (form && name) {
1365
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1381
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1366
1382
  import_react_hook_form2.Controller,
1367
1383
  {
1368
1384
  name,
@@ -1385,7 +1401,7 @@ var import_react10 = __toESM(require("react"));
1385
1401
  var import_react_dom = require("react-dom");
1386
1402
  var import_lucide_react7 = require("lucide-react");
1387
1403
  var import_react_hook_form3 = require("react-hook-form");
1388
- var import_jsx_runtime18 = require("react/jsx-runtime");
1404
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1389
1405
  var SelectContext = (0, import_react10.createContext)(void 0);
1390
1406
  var useSelectContext = () => {
1391
1407
  const context = (0, import_react10.useContext)(SelectContext);
@@ -1396,7 +1412,7 @@ var useSelectContext = () => {
1396
1412
  var Select = (0, import_react10.forwardRef)((props, ref) => {
1397
1413
  const { form, name, onChange, value, children, options = [] } = props;
1398
1414
  if (form && name) {
1399
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1415
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1400
1416
  import_react_hook_form3.Controller,
1401
1417
  {
1402
1418
  name,
@@ -1408,7 +1424,7 @@ var Select = (0, import_react10.forwardRef)((props, ref) => {
1408
1424
  ref: fieldRef,
1409
1425
  onBlur
1410
1426
  }
1411
- }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1427
+ }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1412
1428
  SelectRoot,
1413
1429
  {
1414
1430
  ...props,
@@ -1425,7 +1441,7 @@ var Select = (0, import_react10.forwardRef)((props, ref) => {
1425
1441
  }
1426
1442
  );
1427
1443
  }
1428
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1444
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1429
1445
  SelectRoot,
1430
1446
  {
1431
1447
  ...props,
@@ -1532,25 +1548,25 @@ var SelectRoot = ({
1532
1548
  disabled
1533
1549
  };
1534
1550
  const hasChildren = import_react10.default.Children.count(children) > 0;
1535
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectContext.Provider, { value: valueCtx, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1551
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectContext.Provider, { value: valueCtx, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1536
1552
  "div",
1537
1553
  {
1538
1554
  ref: containerRef,
1539
1555
  className: `${label ? "space-y-2" : ""} group relative ${containerClassName}`,
1540
1556
  children: [
1541
- label && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1557
+ label && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1542
1558
  "label",
1543
1559
  {
1544
1560
  className: `block text-xs font-medium transition-colors duration-200`,
1545
1561
  style: { color: isFocused || isOpen ? primaryColor : void 0 },
1546
1562
  children: [
1547
1563
  label,
1548
- required && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
1564
+ required && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
1549
1565
  ]
1550
1566
  }
1551
1567
  ),
1552
- hasChildren ? children : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
1553
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1568
+ hasChildren ? children : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
1569
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1554
1570
  SelectTrigger,
1555
1571
  {
1556
1572
  id,
@@ -1561,7 +1577,7 @@ var SelectRoot = ({
1561
1577
  ...props
1562
1578
  }
1563
1579
  ),
1564
- allOptions && allOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SelectContent, { children: allOptions.map((opt, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1580
+ allOptions && allOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectContent, { children: allOptions.map((opt, index) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1565
1581
  SelectItem,
1566
1582
  {
1567
1583
  value: opt.value,
@@ -1571,7 +1587,7 @@ var SelectRoot = ({
1571
1587
  String(opt.value) || index
1572
1588
  )) })
1573
1589
  ] }),
1574
- message && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message })
1590
+ message && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message })
1575
1591
  ]
1576
1592
  }
1577
1593
  ) });
@@ -1603,7 +1619,7 @@ var SelectTrigger = (0, import_react10.forwardRef)(
1603
1619
  const lastFocusTime = (0, import_react10.useRef)(0);
1604
1620
  const displayOption = options.find((o) => o.value === selectedValue);
1605
1621
  const displayValue = displayOption ? displayOption.label : selectedValue != null && selectedValue !== "" ? String(selectedValue) : placeholder;
1606
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "relative", ref: dropdownAnchorRef, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1622
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "relative", ref: dropdownAnchorRef, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1607
1623
  "div",
1608
1624
  {
1609
1625
  id,
@@ -1652,8 +1668,8 @@ var SelectTrigger = (0, import_react10.forwardRef)(
1652
1668
  }
1653
1669
  },
1654
1670
  ...props,
1655
- children: children ? children : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
1656
- icon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1671
+ children: children ? children : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
1672
+ icon && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1657
1673
  "div",
1658
1674
  {
1659
1675
  className: `pl-2.5 pr-2 flex items-center transition-colors duration-200`,
@@ -1663,14 +1679,14 @@ var SelectTrigger = (0, import_react10.forwardRef)(
1663
1679
  children: icon
1664
1680
  }
1665
1681
  ),
1666
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1682
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1667
1683
  "div",
1668
1684
  {
1669
1685
  className: `flex-1 truncate text-sm ${icon ? "" : "pl-2.5"} ${!selectedValue && selectedValue !== 0 && selectedValue !== false ? "text-gray-400 dark:text-zinc-500" : ""}`,
1670
1686
  children: displayValue
1671
1687
  }
1672
1688
  ),
1673
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "pr-2.5 flex items-center gap-1 shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1689
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pr-2.5 flex items-center gap-1 shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1674
1690
  import_lucide_react7.ChevronDown,
1675
1691
  {
1676
1692
  className: `h-4 w-4 text-gray-400 transition-transform ${isOpen ? "rotate-180" : ""}`
@@ -1716,7 +1732,7 @@ var SelectContent = (0, import_react10.forwardRef)(
1716
1732
  }, [isOpen]);
1717
1733
  if (!isOpen || typeof document === "undefined") return null;
1718
1734
  return (0, import_react_dom.createPortal)(
1719
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1735
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1720
1736
  "div",
1721
1737
  {
1722
1738
  ref: dropdownContentRef,
@@ -1724,7 +1740,7 @@ var SelectContent = (0, import_react10.forwardRef)(
1724
1740
  style: { ...dropdownStyle, ...style },
1725
1741
  onMouseDown: (e) => e.stopPropagation(),
1726
1742
  ...props,
1727
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex flex-col gap-0.5", children: import_react10.default.Children.count(children) === 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "p-3 text-center text-sm text-gray-500", children: "No options available" }) : children })
1743
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex flex-col gap-0.5", children: import_react10.default.Children.count(children) === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "p-3 text-center text-sm text-gray-500", children: "No options available" }) : children })
1728
1744
  }
1729
1745
  ),
1730
1746
  document.body
@@ -1755,7 +1771,7 @@ var SelectItem = (0, import_react10.forwardRef)(
1755
1771
  setIsOpen(false);
1756
1772
  fieldInternalProps?.onBlur?.();
1757
1773
  };
1758
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1774
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1759
1775
  "button",
1760
1776
  {
1761
1777
  ref,
@@ -1771,8 +1787,8 @@ var SelectItem = (0, import_react10.forwardRef)(
1771
1787
  },
1772
1788
  ...props,
1773
1789
  children: [
1774
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "whitespace-nowrap truncate flex-1", children: children || label }),
1775
- isSelected && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1790
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "whitespace-nowrap truncate flex-1", children: children || label }),
1791
+ isSelected && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1776
1792
  import_lucide_react7.Check,
1777
1793
  {
1778
1794
  className: "h-4 w-4 shrink-0 ml-2",
@@ -1789,7 +1805,7 @@ SelectItem.displayName = "SelectItem";
1789
1805
  // src/components/Fields/textArea.tsx
1790
1806
  var import_react11 = require("react");
1791
1807
  var import_react_hook_form4 = require("react-hook-form");
1792
- var import_jsx_runtime19 = require("react/jsx-runtime");
1808
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1793
1809
  var Textarea = (0, import_react11.forwardRef)(
1794
1810
  ({
1795
1811
  label,
@@ -1813,8 +1829,8 @@ var Textarea = (0, import_react11.forwardRef)(
1813
1829
  const errorObj = name.split(".").reduce((acc, current) => acc?.[current], errors);
1814
1830
  message = errorObj?.message;
1815
1831
  }
1816
- const renderInput = (inputProps, ref2) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: `space-y-2 group w-full! relative ${containerClassName}`, children: [
1817
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1832
+ const renderInput = (inputProps, ref2) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: `space-y-2 group w-full! relative ${containerClassName}`, children: [
1833
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1818
1834
  "label",
1819
1835
  {
1820
1836
  htmlFor: props.id,
@@ -1822,11 +1838,11 @@ var Textarea = (0, import_react11.forwardRef)(
1822
1838
  style: { color: isFocused ? primaryColor : void 0 },
1823
1839
  children: [
1824
1840
  label,
1825
- props.required && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
1841
+ props.required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
1826
1842
  ]
1827
1843
  }
1828
1844
  ),
1829
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1845
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1830
1846
  "textarea",
1831
1847
  {
1832
1848
  ref: ref2,
@@ -1847,10 +1863,10 @@ var Textarea = (0, import_react11.forwardRef)(
1847
1863
  ...inputProps
1848
1864
  }
1849
1865
  ) }),
1850
- message && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message })
1866
+ message && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message })
1851
1867
  ] });
1852
1868
  if (form && name) {
1853
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1869
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1854
1870
  import_react_hook_form4.Controller,
1855
1871
  {
1856
1872
  control: form.control,
@@ -2049,7 +2065,7 @@ var useApis_default = useApi;
2049
2065
 
2050
2066
  // src/components/Fields/searchApi.tsx
2051
2067
  var import_react_hook_form5 = require("react-hook-form");
2052
- var import_jsx_runtime20 = require("react/jsx-runtime");
2068
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2053
2069
  var SearchApiContext = (0, import_react13.createContext)(
2054
2070
  void 0
2055
2071
  );
@@ -2065,12 +2081,12 @@ var SearchApi = (0, import_react13.forwardRef)(
2065
2081
  (props, _) => {
2066
2082
  const { form, name, onChange, value, children, ...restProps } = props;
2067
2083
  if (form && name) {
2068
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2084
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2069
2085
  import_react_hook_form5.Controller,
2070
2086
  {
2071
2087
  name,
2072
2088
  control: form.control,
2073
- render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2089
+ render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2074
2090
  SearchApiRoot,
2075
2091
  {
2076
2092
  ...restProps,
@@ -2088,7 +2104,7 @@ var SearchApi = (0, import_react13.forwardRef)(
2088
2104
  }
2089
2105
  );
2090
2106
  }
2091
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2107
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2092
2108
  SearchApiRoot,
2093
2109
  {
2094
2110
  ...restProps,
@@ -2117,7 +2133,7 @@ var SearchApiRoot = ({
2117
2133
  valueKey = "_id",
2118
2134
  filter = [],
2119
2135
  required,
2120
- v = 2,
2136
+ v = 1,
2121
2137
  variant = "default",
2122
2138
  fieldInternalProps,
2123
2139
  label,
@@ -2348,26 +2364,26 @@ var SearchApiRoot = ({
2348
2364
  error: message
2349
2365
  };
2350
2366
  const hasChildren = !!children;
2351
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SearchApiContext.Provider, { value: valueCtx, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2367
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SearchApiContext.Provider, { value: valueCtx, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2352
2368
  "div",
2353
2369
  {
2354
2370
  ref: containerRef,
2355
2371
  className: `${label ? "space-y-2" : ""} group relative ${containerClassName}`,
2356
2372
  children: [
2357
- label && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2373
+ label && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2358
2374
  "label",
2359
2375
  {
2360
2376
  className: `block text-xs font-medium transition-colors duration-200`,
2361
2377
  style: { color: isFocused || isOpen ? primaryColor : void 0 },
2362
2378
  children: [
2363
2379
  label,
2364
- required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
2380
+ required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
2365
2381
  ]
2366
2382
  }
2367
2383
  ),
2368
- hasChildren ? children : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
2369
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SearchApiTrigger, { className, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SearchApiInput, { ...props }) }),
2370
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SearchApiContent, { children: filteredOptions.map((opt, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2384
+ hasChildren ? children : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
2385
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SearchApiTrigger, { className, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SearchApiInput, { ...props }) }),
2386
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SearchApiContent, { children: filteredOptions.map((opt, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2371
2387
  SearchApiItem,
2372
2388
  {
2373
2389
  option: opt,
@@ -2397,7 +2413,7 @@ var SearchApiTrigger = (0, import_react13.forwardRef)(
2397
2413
  inputRef,
2398
2414
  searchTerm
2399
2415
  } = useSearchApiContext();
2400
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "relative", ref: dropdownAnchorRef, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2416
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "relative", ref: dropdownAnchorRef, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2401
2417
  "div",
2402
2418
  {
2403
2419
  className: `flex items-center w-full px-0 text-gray-900 dark:text-white transition-all duration-200 cursor-text py-1 ${variant === "ghost" ? "bg-transparent border-transparent shadow-none px-0 h-full" : isFocused || isOpen ? "ring-2 bg-white dark:bg-zinc-900 border rounded-xl h-9" : "border-gray-200 dark:border-zinc-800 border rounded-xl bg-white dark:bg-zinc-900/50 h-9"} ${className}`,
@@ -2414,25 +2430,25 @@ var SearchApiTrigger = (0, import_react13.forwardRef)(
2414
2430
  },
2415
2431
  ...props,
2416
2432
  children: [
2417
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2433
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2418
2434
  "div",
2419
2435
  {
2420
2436
  className: `${variant === "ghost" ? "pl-0" : "pl-2.5"} text-gray-400`,
2421
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Search, { className: "h-4 w-4" })
2437
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react8.Search, { className: "h-4 w-4" })
2422
2438
  }
2423
2439
  ),
2424
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex-1 relative ms-2", children }),
2425
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "pr-2.5 w-16! flex items-center gap-1 shrink-0 min-w-10 justify-end", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Loader2, { className: "h-4 w-4 animate-spin text-blue-500 shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-1", children: [
2426
- selectedValue && !disabled && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2440
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex-1 relative ms-2", children }),
2441
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "pr-2.5 w-16! flex items-center gap-1 shrink-0 min-w-10 justify-end", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react8.Loader2, { className: "h-4 w-4 animate-spin text-blue-500 shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1", children: [
2442
+ selectedValue && !disabled && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2427
2443
  "button",
2428
2444
  {
2429
2445
  onClick: clearSelection,
2430
2446
  type: "button",
2431
2447
  className: "p-0.5 hover:bg-gray-200 dark:hover:bg-zinc-700 rounded-full text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",
2432
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.X, { className: "h-3 w-3" })
2448
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react8.X, { className: "h-3 w-3" })
2433
2449
  }
2434
2450
  ),
2435
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2451
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2436
2452
  import_lucide_react8.ChevronDown,
2437
2453
  {
2438
2454
  className: `h-4 w-4 text-gray-400 transition-transform ${isOpen ? "rotate-180" : ""}`
@@ -2464,7 +2480,10 @@ var SearchApiInput = (0, import_react13.forwardRef)(
2464
2480
  options,
2465
2481
  handleSelect,
2466
2482
  inputRef,
2467
- fieldInternalProps
2483
+ fieldInternalProps,
2484
+ form,
2485
+ name,
2486
+ obj
2468
2487
  } = useSearchApiContext();
2469
2488
  const setInternalInputRef = (element) => {
2470
2489
  inputRef.current = element;
@@ -2508,9 +2527,9 @@ var SearchApiInput = (0, import_react13.forwardRef)(
2508
2527
  break;
2509
2528
  }
2510
2529
  };
2511
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
2512
- !isOpen && selectedValue && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "absolute inset-0 flex items-center ms-1 truncate select-none", children: getDisplayValue() }),
2513
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2530
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
2531
+ !isOpen && selectedValue && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute inset-0 flex items-center ms-1 truncate select-none", children: getDisplayValue() }),
2532
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2514
2533
  "input",
2515
2534
  {
2516
2535
  ref: setInternalInputRef,
@@ -2526,6 +2545,10 @@ var SearchApiInput = (0, import_react13.forwardRef)(
2526
2545
  } else {
2527
2546
  setIsOpen(false);
2528
2547
  }
2548
+ if (form) {
2549
+ if (name) form.clearErrors(name);
2550
+ if (obj) form.clearErrors(obj);
2551
+ }
2529
2552
  },
2530
2553
  onFocus: () => {
2531
2554
  setIsFocused(true);
@@ -2585,7 +2608,7 @@ var SearchApiContent = (0, import_react13.forwardRef)(
2585
2608
  }, [isOpen]);
2586
2609
  if (!isOpen || typeof document === "undefined") return null;
2587
2610
  return (0, import_react_dom2.createPortal)(
2588
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2611
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2589
2612
  "div",
2590
2613
  {
2591
2614
  ref: dropdownContentRef,
@@ -2594,11 +2617,11 @@ var SearchApiContent = (0, import_react13.forwardRef)(
2594
2617
  onMouseDown: (e) => e.stopPropagation(),
2595
2618
  ...props,
2596
2619
  children: [
2597
- error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "px-3 py-2 text-sm text-red-600 dark:text-red-400 border-b border-gray-100 dark:border-zinc-800", children: error }),
2598
- isLoading && options.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "p-4 text-center text-sm text-gray-500", children: [
2599
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Loader2, { className: "h-5 w-5 animate-spin mx-auto mb-2" }),
2620
+ error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "px-3 py-2 text-sm text-red-600 dark:text-red-400 border-b border-gray-100 dark:border-zinc-800", children: error }),
2621
+ isLoading && options.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "p-4 text-center text-sm text-gray-500", children: [
2622
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react8.Loader2, { className: "h-5 w-5 animate-spin mx-auto mb-2" }),
2600
2623
  "Loading options..."
2601
- ] }) : children ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "py-1", children }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "p-4 text-center text-sm text-gray-500", children: searchTerm ? `No results for "${searchTerm}"` : "No options available" })
2624
+ ] }) : children ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "py-1", children }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "p-4 text-center text-sm text-gray-500", children: searchTerm ? `No results for "${searchTerm}"` : "No options available" })
2602
2625
  ]
2603
2626
  }
2604
2627
  ),
@@ -2627,7 +2650,7 @@ var SearchApiItem = (0, import_react13.forwardRef)(
2627
2650
  const optValue = getOptionValue(option);
2628
2651
  const isSelected = selectedValue === optValue;
2629
2652
  const isHighlighted = index === activeIndex;
2630
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2653
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2631
2654
  "button",
2632
2655
  {
2633
2656
  ref,
@@ -2646,8 +2669,8 @@ var SearchApiItem = (0, import_react13.forwardRef)(
2646
2669
  onMouseEnter: () => setActiveIndex(index),
2647
2670
  ...props,
2648
2671
  children: [
2649
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "truncate", children: option[labelKey] }),
2650
- isSelected && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Check, { className: "h-4 w-4", style: { color: primaryColor } })
2672
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "truncate", children: option[labelKey] }),
2673
+ isSelected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react8.Check, { className: "h-4 w-4", style: { color: primaryColor } })
2651
2674
  ]
2652
2675
  },
2653
2676
  optValue || index
@@ -2663,7 +2686,7 @@ var import_react_hook_form6 = require("react-hook-form");
2663
2686
  var import_dayjs = __toESM(require("dayjs"));
2664
2687
  var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"));
2665
2688
  var import_lucide_react9 = require("lucide-react");
2666
- var import_jsx_runtime21 = require("react/jsx-runtime");
2689
+ var import_jsx_runtime22 = require("react/jsx-runtime");
2667
2690
  import_dayjs.default.extend(import_customParseFormat.default);
2668
2691
  var DateInput = (0, import_react14.forwardRef)(
2669
2692
  ({
@@ -2700,7 +2723,7 @@ var DateInput = (0, import_react14.forwardRef)(
2700
2723
  ${className}`;
2701
2724
  const renderDatePicker = (val, changeHandler, blurHandler, refProps) => {
2702
2725
  const dateValue = val && typeof val === "string" ? (0, import_dayjs.default)(val, "DD/MM/YYYY", true) : import_dayjs.default.isDayjs(val) ? val : null;
2703
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2726
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2704
2727
  import_antd.DatePicker,
2705
2728
  {
2706
2729
  ref: refProps,
@@ -2727,7 +2750,7 @@ var DateInput = (0, import_react14.forwardRef)(
2727
2750
  boxShadow: isFocused && !message ? `${primaryColor}33 0px 0px 0px 2px` : void 0
2728
2751
  },
2729
2752
  classNames: { popup: { root: "z-50" } },
2730
- suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2753
+ suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2731
2754
  import_lucide_react9.Calendar,
2732
2755
  {
2733
2756
  className: "h-5 w-5 text-gray-400",
@@ -2739,8 +2762,8 @@ var DateInput = (0, import_react14.forwardRef)(
2739
2762
  }
2740
2763
  );
2741
2764
  };
2742
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: `space-y-2 group relative ${containerClassName}`, children: [
2743
- label && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2765
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: `space-y-2 group relative ${containerClassName}`, children: [
2766
+ label && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2744
2767
  "label",
2745
2768
  {
2746
2769
  className: "block text-xs font-medium transition-colors duration-200",
@@ -2749,11 +2772,11 @@ var DateInput = (0, import_react14.forwardRef)(
2749
2772
  },
2750
2773
  children: [
2751
2774
  label,
2752
- props.required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
2775
+ props.required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-red-500 ml-1", children: "*" })
2753
2776
  ]
2754
2777
  }
2755
2778
  ),
2756
- form && name ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2779
+ form && name ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2757
2780
  import_react_hook_form6.Controller,
2758
2781
  {
2759
2782
  control: form.control,
@@ -2766,7 +2789,7 @@ var DateInput = (0, import_react14.forwardRef)(
2766
2789
  )
2767
2790
  }
2768
2791
  ) : renderDatePicker(value, onChange, onBlur, ref),
2769
- message && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message })
2792
+ message && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: message })
2770
2793
  ] });
2771
2794
  }
2772
2795
  );
@@ -2793,7 +2816,7 @@ var Fields_default = Fields;
2793
2816
  var import_react15 = __toESM(require("react"));
2794
2817
  var import_react_table = require("@tanstack/react-table");
2795
2818
  var import_lucide_react10 = require("lucide-react");
2796
- var import_jsx_runtime22 = require("react/jsx-runtime");
2819
+ var import_jsx_runtime23 = require("react/jsx-runtime");
2797
2820
  function DataTable({
2798
2821
  columns: userColumns,
2799
2822
  data,
@@ -2868,7 +2891,7 @@ function DataTable({
2868
2891
  {
2869
2892
  id: "_index",
2870
2893
  header: "#",
2871
- cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-gray-500 font-medium ml-1", children: row.index + 1 }),
2894
+ cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-gray-500 font-medium ml-1", children: row.index + 1 }),
2872
2895
  enableSorting: false
2873
2896
  },
2874
2897
  ...mappedColumns
@@ -2927,29 +2950,29 @@ function DataTable({
2927
2950
  table.getState().pagination.pageIndex,
2928
2951
  table.getState().pagination.pageSize
2929
2952
  ]);
2930
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: `space-y-4 w-full ${className}`, children: [
2931
- filterables && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
2932
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex-1 max-w-sm", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2953
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: `space-y-4 w-full ${className}`, children: [
2954
+ filterables && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
2955
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex-1 max-w-sm", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2933
2956
  Fields_default.Input,
2934
2957
  {
2935
2958
  placeholder: searchPlaceholder,
2936
2959
  value: globalFilter,
2937
2960
  onChange: (e) => setGlobalFilter(e.target.value),
2938
- icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.Search, { size: 16 }),
2961
+ icon: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Search, { size: 16 }),
2939
2962
  className: "h-9!"
2940
2963
  }
2941
2964
  ) }),
2942
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "relative group", children: [
2943
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("button", { className: "flex items-center gap-2 px-3 h-9 rounded-lg border border-gray-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-zinc-800 transition-colors", children: [
2965
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative group", children: [
2966
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("button", { className: "flex items-center gap-2 px-3 h-9 rounded-lg border border-gray-200 dark:border-zinc-800 bg-white dark:bg-zinc-900 text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-zinc-800 transition-colors", children: [
2944
2967
  "Columns",
2945
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react10.ChevronDown, { size: 14, className: "text-gray-400" })
2968
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.ChevronDown, { size: 14, className: "text-gray-400" })
2946
2969
  ] }),
2947
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "absolute right-0 top-full mt-2 w-48 py-1 bg-white dark:bg-zinc-900 border border-gray-200 dark:border-zinc-800 rounded-lg shadow-xl opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all z-50", children: table.getAllColumns().filter((column) => column.getCanHide()).map((column) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2970
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "absolute right-0 top-full mt-2 w-48 py-1 bg-white dark:bg-zinc-900 border border-gray-200 dark:border-zinc-800 rounded-lg shadow-xl opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all z-50", children: table.getAllColumns().filter((column) => column.getCanHide()).map((column) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2948
2971
  "label",
2949
2972
  {
2950
2973
  className: "flex items-center gap-2 px-3 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-zinc-800 cursor-pointer capitalize",
2951
2974
  children: [
2952
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2975
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2953
2976
  "input",
2954
2977
  {
2955
2978
  type: "checkbox",
@@ -2966,13 +2989,13 @@ function DataTable({
2966
2989
  )) })
2967
2990
  ] }) })
2968
2991
  ] }),
2969
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "rounded-lg border border-gray-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 overflow-hidden relative", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2992
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "rounded-lg border border-gray-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 overflow-hidden relative", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2970
2993
  "table",
2971
2994
  {
2972
2995
  className: "w-full text-left border-collapse",
2973
2996
  style: { accentColor: primaryColor },
2974
2997
  children: [
2975
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("thead", { className: "bg-gray-50/50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-zinc-800", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2998
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("thead", { className: "bg-gray-50/50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-zinc-800", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2976
2999
  "th",
2977
3000
  {
2978
3001
  className: `${rowPadding} text-sm font-semibold text-gray-900 dark:text-zinc-100 text-left ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${header.id === "_index" || header.id === "select" || header.id === "_select" ? "w-px whitespace-nowrap" : ""}`,
@@ -2983,22 +3006,22 @@ function DataTable({
2983
3006
  },
2984
3007
  header.id
2985
3008
  )) }, headerGroup.id)) }),
2986
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tbody", { className: "", children: isLoading ? Array.from({ length: pageRows || 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3009
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tbody", { className: "", children: isLoading ? Array.from({ length: pageRows || 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2987
3010
  "tr",
2988
3011
  {
2989
3012
  className: "border-b border-gray-100 dark:border-zinc-800/50",
2990
- children: columns.map((_2, j) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3013
+ children: columns.map((_2, j) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2991
3014
  "td",
2992
3015
  {
2993
3016
  className: `${rowPadding} ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800/50" : ""}`,
2994
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "h-4 bg-gray-100 dark:bg-zinc-800 rounded animate-pulse w-full" })
3017
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "h-4 bg-gray-100 dark:bg-zinc-800 rounded animate-pulse w-full" })
2995
3018
  },
2996
3019
  `skeleton-cell-${j}`
2997
3020
  ))
2998
3021
  },
2999
3022
  `skeleton-${i}`
3000
- )) : table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react15.default.Fragment, { children: [
3001
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3023
+ )) : table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react15.default.Fragment, { children: [
3024
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3002
3025
  "tr",
3003
3026
  {
3004
3027
  className: `border-b border-gray-200 dark:border-zinc-800 hover:bg-gray-50/50 dark:hover:bg-zinc-900/50 transition-colors last:border-b-0 ${renderSubComponent && hasSubComponent(row.original) ? "cursor-pointer" : ""}`,
@@ -3013,7 +3036,7 @@ function DataTable({
3013
3036
  }
3014
3037
  }
3015
3038
  },
3016
- children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3039
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3017
3040
  "td",
3018
3041
  {
3019
3042
  className: `${rowPadding} text-sm text-gray-700 dark:text-gray-200 ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${cell.column.id === "_index" || cell.column.id === "select" || cell.column.id === "_select" ? "w-px whitespace-nowrap" : ""}`,
@@ -3026,14 +3049,14 @@ function DataTable({
3026
3049
  ))
3027
3050
  }
3028
3051
  ),
3029
- renderSubComponent && row.getIsExpanded() && hasSubComponent(row.original) && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tr", { className: "border-b border-gray-200 dark:border-zinc-800 bg-gray-50/20 dark:bg-zinc-900/20", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { colSpan: columns.length, className: "px-2 py-0", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "relative pl-6 pb-2 pr-2 pt-2 h-full", children: [
3030
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "absolute left-2 top-0 bottom-2 w-6 border-l-2 border-b-2 rounded-bl-xl border-(--theme-primary) dark:border-(--theme-primary) pointer-events-none" }),
3052
+ renderSubComponent && row.getIsExpanded() && hasSubComponent(row.original) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { className: "border-b border-gray-200 dark:border-zinc-800 bg-gray-50/20 dark:bg-zinc-900/20", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("td", { colSpan: columns.length, className: "px-2 py-0", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative pl-6 pb-2 pr-2 pt-2 h-full", children: [
3053
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "absolute left-2 top-0 bottom-2 w-6 border-l-2 border-b-2 rounded-bl-xl border-(--theme-primary) dark:border-(--theme-primary) pointer-events-none" }),
3031
3054
  renderSubComponent({
3032
3055
  row: row.original,
3033
3056
  index: row.index
3034
3057
  })
3035
3058
  ] }) }) })
3036
- ] }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3059
+ ] }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3037
3060
  "td",
3038
3061
  {
3039
3062
  colSpan: columns.length,
@@ -3045,7 +3068,7 @@ function DataTable({
3045
3068
  (group) => group.headers.some(
3046
3069
  (header) => header.column.columnDef.footer
3047
3070
  )
3048
- ) && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tfoot", { className: "bg-gray-50/50 dark:bg-zinc-900/50 border-t border-gray-200 dark:border-zinc-800", children: table.getFooterGroups().map((footerGroup) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tr", { children: footerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3071
+ ) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tfoot", { className: "bg-gray-50/50 dark:bg-zinc-900/50 border-t border-gray-200 dark:border-zinc-800", children: table.getFooterGroups().map((footerGroup) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { children: footerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3049
3072
  "td",
3050
3073
  {
3051
3074
  className: `${rowPadding} text-sm font-semibold text-gray-900 dark:text-zinc-100 text-left ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${header.id === "_index" || header.id === "select" || header.id === "_select" ? "w-px whitespace-nowrap" : ""}`,
@@ -3059,24 +3082,24 @@ function DataTable({
3059
3082
  ]
3060
3083
  }
3061
3084
  ) }) }),
3062
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center justify-between px-2", children: [
3063
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex-1 text-xs text-gray-500", children: selectable && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
3085
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center justify-between px-2", children: [
3086
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex-1 text-xs text-gray-500", children: selectable && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
3064
3087
  table.getFilteredSelectedRowModel().rows.length,
3065
3088
  " of",
3066
3089
  " ",
3067
3090
  table.getFilteredRowModel().rows.length,
3068
3091
  " row(s) selected."
3069
3092
  ] }) }),
3070
- pageRows && table.getPageCount() > 1 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-2", children: [
3071
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "text-sm text-gray-700 dark:text-gray-300 mr-2 select-none", children: [
3093
+ pageRows && table.getPageCount() > 1 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-2", children: [
3094
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "text-sm text-gray-700 dark:text-gray-300 mr-2 select-none", children: [
3072
3095
  "Page",
3073
3096
  " ",
3074
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "font-semibold", children: table.getState().pagination.pageIndex + 1 }),
3097
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "font-semibold", children: table.getState().pagination.pageIndex + 1 }),
3075
3098
  " ",
3076
3099
  "of ",
3077
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "font-semibold", children: table.getPageCount() })
3100
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "font-semibold", children: table.getPageCount() })
3078
3101
  ] }),
3079
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3102
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3080
3103
  "button",
3081
3104
  {
3082
3105
  onClick: () => table.previousPage(),
@@ -3085,7 +3108,7 @@ function DataTable({
3085
3108
  children: "Previous"
3086
3109
  }
3087
3110
  ),
3088
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3111
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3089
3112
  "button",
3090
3113
  {
3091
3114
  onClick: () => table.nextPage(),
@@ -3103,7 +3126,7 @@ function DataTable({
3103
3126
  var import_react16 = __toESM(require("react"));
3104
3127
  var import_react_table2 = require("@tanstack/react-table");
3105
3128
  var import_lucide_react11 = require("lucide-react");
3106
- var import_jsx_runtime23 = require("react/jsx-runtime");
3129
+ var import_jsx_runtime24 = require("react/jsx-runtime");
3107
3130
  function PostTable({
3108
3131
  columns: userColumns,
3109
3132
  data: controlledData,
@@ -3275,23 +3298,23 @@ function PostTable({
3275
3298
  id: "actions",
3276
3299
  header: "Actions",
3277
3300
  cell: ({ row }) => {
3278
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-2", children: [
3279
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3301
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
3302
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3280
3303
  "button",
3281
3304
  {
3282
3305
  onClick: () => handleEdit(row.index, row.original),
3283
3306
  className: "p-1 px-2 rounded-md hover:bg-gray-100 dark:hover:bg-zinc-800 text-gray-500 hover:text-(--theme-primary) dark:hover:text-(--theme-primary) transition-colors",
3284
3307
  title: "Edit",
3285
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Edit2, { size: 16 })
3308
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Edit2, { size: 16 })
3286
3309
  }
3287
3310
  ),
3288
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3311
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3289
3312
  "button",
3290
3313
  {
3291
3314
  onClick: () => handleDelete(row.index),
3292
3315
  className: "p-1 px-2 rounded-md hover:bg-gray-100 dark:hover:bg-zinc-800 text-gray-500 hover:text-red-600 dark:hover:text-red-400 transition-colors",
3293
3316
  title: "Delete",
3294
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Trash2, { size: 16 })
3317
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Trash2, { size: 16 })
3295
3318
  }
3296
3319
  )
3297
3320
  ] });
@@ -3308,9 +3331,9 @@ function PostTable({
3308
3331
  finalColumns.unshift({
3309
3332
  id: "_index",
3310
3333
  header: "#",
3311
- cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-2", children: [
3312
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-gray-500 font-medium ml-1", children: row.index + 1 }),
3313
- renderSubComponent && hasSubComponent(row.original) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3334
+ cell: ({ row }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
3335
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-gray-500 font-medium ml-1", children: row.index + 1 }),
3336
+ renderSubComponent && hasSubComponent(row.original) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3314
3337
  import_lucide_react11.ChevronDown,
3315
3338
  {
3316
3339
  size: 16,
@@ -3320,7 +3343,7 @@ function PostTable({
3320
3343
  ] }),
3321
3344
  enableSorting: false,
3322
3345
  meta: {
3323
- field: () => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-gray-400 font-medium px-2 block select-none", children: "#" })
3346
+ field: () => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-gray-400 font-medium px-2 block select-none", children: "#" })
3324
3347
  }
3325
3348
  });
3326
3349
  }
@@ -3344,13 +3367,13 @@ function PostTable({
3344
3367
  expanded
3345
3368
  }
3346
3369
  });
3347
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3370
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3348
3371
  "div",
3349
3372
  {
3350
3373
  className: `space-y-4 w-full ${className}`,
3351
3374
  style: { "--theme-primary": primaryColor || "#3b82f6" },
3352
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "rounded-lg border border-gray-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 relative", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("table", { className: "w-full text-left border-collapse", children: [
3353
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("thead", { className: "bg-gray-50/50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-zinc-800", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3375
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "rounded-lg border border-gray-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 relative", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("table", { className: "w-full text-left border-collapse", children: [
3376
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("thead", { className: "bg-gray-50/50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-zinc-800", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3354
3377
  "th",
3355
3378
  {
3356
3379
  className: `${rowPadding} text-sm font-semibold text-gray-900 dark:text-zinc-100 text-left ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${header.id === "_index" ? "w-px whitespace-nowrap" : ""}`,
@@ -3361,23 +3384,23 @@ function PostTable({
3361
3384
  },
3362
3385
  header.id
3363
3386
  )) }, headerGroup.id)) }),
3364
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("tbody", { className: "", children: [
3365
- isLoading ? Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3387
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("tbody", { className: "", children: [
3388
+ isLoading ? Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3366
3389
  "tr",
3367
3390
  {
3368
3391
  className: "border-b border-gray-100 dark:border-zinc-800/50",
3369
- children: columns.map((_2, j) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3392
+ children: columns.map((_2, j) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3370
3393
  "td",
3371
3394
  {
3372
3395
  className: `${rowPadding} ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800/50" : ""}`,
3373
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "h-4 bg-gray-100 dark:bg-zinc-800 rounded animate-pulse w-full" })
3396
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-4 bg-gray-100 dark:bg-zinc-800 rounded animate-pulse w-full" })
3374
3397
  },
3375
3398
  `skeleton-cell-${j}`
3376
3399
  ))
3377
3400
  },
3378
3401
  `skeleton-${i}`
3379
- )) : table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react16.default.Fragment, { children: [
3380
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3402
+ )) : table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react16.default.Fragment, { children: [
3403
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3381
3404
  "tr",
3382
3405
  {
3383
3406
  className: `border-b border-gray-200 dark:border-zinc-800 hover:bg-gray-50/50 dark:hover:bg-zinc-900/50 transition-colors last:border-b-0 ${renderSubComponent && hasSubComponent(row.original) ? "cursor-pointer" : ""}`,
@@ -3392,7 +3415,7 @@ function PostTable({
3392
3415
  }
3393
3416
  }
3394
3417
  },
3395
- children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3418
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3396
3419
  "td",
3397
3420
  {
3398
3421
  className: `${rowPadding} text-sm text-gray-700 dark:text-gray-200 ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${cell.column.id === "_index" ? "w-px whitespace-nowrap" : ""}`,
@@ -3405,14 +3428,14 @@ function PostTable({
3405
3428
  ))
3406
3429
  }
3407
3430
  ),
3408
- renderSubComponent && row.getIsExpanded() && hasSubComponent(row.original) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { className: "border-b border-gray-200 dark:border-zinc-800 bg-gray-50/20 dark:bg-zinc-900/20", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("td", { colSpan: columns.length, className: "px-2 py-0", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative pl-6 pb-2 pr-2 pt-2 h-full", children: [
3409
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "absolute left-2 top-0 bottom-2 w-6 border-l-2 border-b-2 rounded-bl-xl border-(--theme-primary) dark:border-(--theme-primary) pointer-events-none" }),
3431
+ renderSubComponent && row.getIsExpanded() && hasSubComponent(row.original) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tr", { className: "border-b border-gray-200 dark:border-zinc-800 bg-gray-50/20 dark:bg-zinc-900/20", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { colSpan: columns.length, className: "px-2 py-0", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative pl-6 pb-2 pr-2 pt-2 h-full", children: [
3432
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "absolute left-2 top-0 bottom-2 w-6 border-l-2 border-b-2 rounded-bl-xl border-(--theme-primary) dark:border-(--theme-primary) pointer-events-none" }),
3410
3433
  renderSubComponent({
3411
3434
  row: row.original,
3412
3435
  index: row.index
3413
3436
  })
3414
3437
  ] }) }) })
3415
- ] }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3438
+ ] }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3416
3439
  "td",
3417
3440
  {
3418
3441
  colSpan: columns.length,
@@ -3420,7 +3443,7 @@ function PostTable({
3420
3443
  children: "No results found."
3421
3444
  }
3422
3445
  ) }),
3423
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3446
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3424
3447
  "tr",
3425
3448
  {
3426
3449
  ref: entryRowRef,
@@ -3435,7 +3458,7 @@ function PostTable({
3435
3458
  return visibleColumns.map((column) => {
3436
3459
  const currentId = column.id || column.columnDef.accessorKey;
3437
3460
  if (column.id === "actions") {
3438
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3461
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3439
3462
  "td",
3440
3463
  {
3441
3464
  className: cn(
@@ -3443,32 +3466,32 @@ function PostTable({
3443
3466
  "py-1! text-sm align-middle transition-colors duration-200",
3444
3467
  verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""
3445
3468
  ),
3446
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex items-center gap-2", children: editingIndex !== null ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
3447
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3469
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center gap-2", children: editingIndex !== null ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
3470
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3448
3471
  "button",
3449
3472
  {
3450
3473
  onClick: handleSaveField,
3451
3474
  disabled: isSavingAsync,
3452
3475
  className: "flex-1 h-8 flex items-center justify-center rounded-lg bg-green-500/10 text-green-600 dark:bg-emerald-500/20 dark:text-emerald-400 hover:bg-green-500 hover:text-white dark:hover:bg-emerald-500 transition-colors shadow-sm active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed",
3453
3476
  title: "Update",
3454
- children: isSavingAsync ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "w-3.5 h-3.5 rounded-full border-2 border-emerald-500/30 border-t-emerald-500 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Check, { size: 16, strokeWidth: 2.5 })
3477
+ children: isSavingAsync ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-3.5 h-3.5 rounded-full border-2 border-emerald-500/30 border-t-emerald-500 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Check, { size: 16, strokeWidth: 2.5 })
3455
3478
  }
3456
3479
  ),
3457
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3480
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3458
3481
  "button",
3459
3482
  {
3460
3483
  onClick: handleCancelEdit,
3461
3484
  disabled: isSavingAsync,
3462
3485
  className: "flex-1 h-8 flex items-center justify-center rounded-lg bg-red-500/10 text-red-600 dark:bg-red-500/20 dark:text-red-400 hover:bg-red-500 hover:text-white dark:hover:bg-red-500 transition-colors shadow-sm active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed",
3463
3486
  title: "Cancel",
3464
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.X, { size: 16, strokeWidth: 2.5 })
3487
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.X, { size: 16, strokeWidth: 2.5 })
3465
3488
  }
3466
3489
  )
3467
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: renderAddButton ? renderAddButton(
3490
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: renderAddButton ? renderAddButton(
3468
3491
  entryData,
3469
3492
  handleSaveField,
3470
3493
  isSavingAsync
3471
- ) : /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3494
+ ) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3472
3495
  "button",
3473
3496
  {
3474
3497
  onClick: handleSaveField,
@@ -3479,8 +3502,8 @@ function PostTable({
3479
3502
  },
3480
3503
  title: "Add Row",
3481
3504
  children: [
3482
- isSavingAsync ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "w-3.5 h-3.5 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Plus, { size: 14, strokeWidth: 2.5 }),
3483
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: isSavingAsync ? "Adding..." : "Add" })
3505
+ isSavingAsync ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-3.5 h-3.5 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Plus, { size: 14, strokeWidth: 2.5 }),
3506
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: isSavingAsync ? "Adding..." : "Add" })
3484
3507
  ]
3485
3508
  }
3486
3509
  ) }) })
@@ -3506,7 +3529,7 @@ function PostTable({
3506
3529
  });
3507
3530
  }
3508
3531
  };
3509
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3532
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3510
3533
  "td",
3511
3534
  {
3512
3535
  "data-column-id": column.id,
@@ -3526,7 +3549,7 @@ function PostTable({
3526
3549
  column.id === "_index" ? "w-px whitespace-nowrap" : "",
3527
3550
  hasError && "ring-1 ring-inset ring-red-500"
3528
3551
  ),
3529
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3552
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3530
3553
  "div",
3531
3554
  {
3532
3555
  className: cn(
@@ -3539,13 +3562,22 @@ function PostTable({
3539
3562
  handleSaveField();
3540
3563
  }
3541
3564
  },
3565
+ onInput: () => {
3566
+ if (fieldErrors[accessor]) {
3567
+ setFieldErrors((prev) => {
3568
+ const next = { ...prev };
3569
+ delete next[accessor];
3570
+ return next;
3571
+ });
3572
+ }
3573
+ },
3542
3574
  children: [
3543
3575
  fieldRenderer ? fieldRenderer({
3544
3576
  value,
3545
3577
  onChange: onChangeValue,
3546
3578
  rowData: entryData,
3547
3579
  setRowData: setEntryData
3548
- }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3580
+ }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3549
3581
  Fields_default.Input,
3550
3582
  {
3551
3583
  id: `pti-${accessor}`,
@@ -3557,7 +3589,7 @@ function PostTable({
3557
3589
  placeholder: `${typeof column.columnDef.header === "string" ? column.columnDef.header : column.id}`
3558
3590
  }
3559
3591
  ),
3560
- typeof error === "string" && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "absolute left-1/2 -translate-x-1/2 bottom-[100%] mb-2 z-[9999] pointer-events-none opacity-0 group-hover:opacity-100 focus-within:opacity-100 group-focus-within:opacity-100 transition-opacity whitespace-nowrap bg-red-500 text-white text-xs px-2.5 py-1.5 rounded shadow-lg before:content-[''] before:absolute before:top-full before:left-1/2 before:-translate-x-1/2 before:border-4 before:border-transparent before:border-t-red-500", children: error })
3592
+ typeof error === "string" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "absolute left-1/2 -translate-x-1/2 bottom-full mb-2 z-9999 pointer-events-none opacity-0 group-hover:opacity-100 focus-within:opacity-100 group-focus-within:opacity-100 transition-opacity whitespace-nowrap bg-red-500 text-white text-xs px-2.5 py-1.5 rounded shadow-lg before:content-[''] before:absolute before:top-full before:left-1/2 before:-translate-x-1/2 before:border-4 before:border-transparent before:border-t-red-500", children: error })
3561
3593
  ]
3562
3594
  }
3563
3595
  )
@@ -3573,7 +3605,7 @@ function PostTable({
3573
3605
  (group) => group.headers.some(
3574
3606
  (header) => header.column.columnDef.footer
3575
3607
  )
3576
- ) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tfoot", { className: "bg-gray-50/50 dark:bg-zinc-900/50 border-t border-gray-200 dark:border-zinc-800", children: table.getFooterGroups().map((footerGroup) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { children: footerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3608
+ ) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tfoot", { className: "bg-gray-50/50 dark:bg-zinc-900/50 border-t border-gray-200 dark:border-zinc-800", children: table.getFooterGroups().map((footerGroup) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tr", { children: footerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3577
3609
  "td",
3578
3610
  {
3579
3611
  className: `${rowPadding} text-sm font-semibold text-gray-900 dark:text-zinc-100 text-left ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${header.id === "_index" ? "w-px whitespace-nowrap" : ""}`,
@@ -3592,7 +3624,7 @@ function PostTable({
3592
3624
  // src/components/tables/SimpleTable.tsx
3593
3625
  var import_react17 = require("react");
3594
3626
  var import_react_table3 = require("@tanstack/react-table");
3595
- var import_jsx_runtime24 = require("react/jsx-runtime");
3627
+ var import_jsx_runtime25 = require("react/jsx-runtime");
3596
3628
  function SimpleTable({
3597
3629
  columns: userColumns,
3598
3630
  data,
@@ -3639,17 +3671,17 @@ function SimpleTable({
3639
3671
  )
3640
3672
  );
3641
3673
  }, [table]);
3642
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: `w-full overflow-hidden ${className}`, children: [
3643
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3674
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: `w-full overflow-hidden ${className}`, children: [
3675
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3644
3676
  "table",
3645
3677
  {
3646
3678
  className: `w-full max-w-full text-left border-collapse table-fixed ${verticalLines ? "border border-black dark:border-white" : ""}`,
3647
3679
  children: [
3648
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3680
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3649
3681
  "tr",
3650
3682
  {
3651
3683
  className: `border-b ${verticalLines ? "border-black dark:border-white" : "border-gray-200 dark:border-zinc-800"}`,
3652
- children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3684
+ children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3653
3685
  "th",
3654
3686
  {
3655
3687
  className: `${rowPadding} font-semibold text-gray-900 dark:text-zinc-100 text-sm align-top ${verticalLines ? "border-x border-black dark:border-white" : ""} ${header.column.columnDef.className || "wrap-break-word"}`,
@@ -3668,32 +3700,32 @@ function SimpleTable({
3668
3700
  },
3669
3701
  headerGroup.id
3670
3702
  )) }),
3671
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tbody", { className: "text-black dark:text-white font-semibold font-sans tabular-nums", children: isLoading ? Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3703
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("tbody", { className: "text-black dark:text-white font-semibold font-sans tabular-nums", children: isLoading ? Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3672
3704
  "tr",
3673
3705
  {
3674
3706
  className: `border-b ${verticalLines ? "border-black dark:border-white" : "border-gray-100 dark:border-zinc-800/60 last:border-0"}`,
3675
- children: columns.map((col, colIdx) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3707
+ children: columns.map((col, colIdx) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3676
3708
  "td",
3677
3709
  {
3678
3710
  className: `text-sm ${rowPadding} align-top ${verticalLines ? "border-x border-black dark:border-white" : ""}`,
3679
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-4 bg-gray-200 dark:bg-zinc-800 rounded-sm animate-pulse w-full" })
3711
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "h-4 bg-gray-200 dark:bg-zinc-800 rounded-sm animate-pulse w-full" })
3680
3712
  },
3681
3713
  `skeleton-col-${colIdx}`
3682
3714
  ))
3683
3715
  },
3684
3716
  `skeleton-row-${i}`
3685
- )) : data.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3717
+ )) : data.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3686
3718
  "td",
3687
3719
  {
3688
3720
  colSpan: columns.length,
3689
3721
  className: "text-center py-8 text-gray-500 font-medium",
3690
3722
  children: "No transactions found."
3691
3723
  }
3692
- ) }) : table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3724
+ ) }) : table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3693
3725
  "tr",
3694
3726
  {
3695
3727
  className: `border-b ${verticalLines ? "border-black dark:border-white" : "border-gray-100 dark:border-zinc-800/60 last:border-0"} hover:bg-gray-50/50 dark:hover:bg-zinc-900/30 transition-colors`,
3696
- children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3728
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3697
3729
  "td",
3698
3730
  {
3699
3731
  className: `text-sm ${rowPadding} align-top ${verticalLines ? "border-x border-black dark:border-white" : ""} ${cell.column.columnDef.className || "wrap-break-word"}`,
@@ -3704,11 +3736,11 @@ function SimpleTable({
3704
3736
  },
3705
3737
  row.id
3706
3738
  )) }),
3707
- hasFooters && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tfoot", { className: "text-black dark:text-white font-bold font-sans tabular-nums", children: table.getFooterGroups().map((footerGroup) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3739
+ hasFooters && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("tfoot", { className: "text-black dark:text-white font-bold font-sans tabular-nums", children: table.getFooterGroups().map((footerGroup) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3708
3740
  "tr",
3709
3741
  {
3710
3742
  className: `${verticalLines ? "border-t border-black dark:border-white" : "bg-gray-50/30 dark:bg-zinc-900/10"}`,
3711
- children: footerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3743
+ children: footerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3712
3744
  "td",
3713
3745
  {
3714
3746
  className: `text-sm ${rowPadding} ${verticalLines ? "border-x border-black dark:border-white" : ""} ${header.column.columnDef.className || "wrap-break-word"}`,
@@ -3725,13 +3757,13 @@ function SimpleTable({
3725
3757
  ]
3726
3758
  }
3727
3759
  ),
3728
- componentFooter && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mt-2 pt-3 border-t border-gray-200 dark:border-zinc-800", children: componentFooter() })
3760
+ componentFooter && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "mt-2 pt-3 border-t border-gray-200 dark:border-zinc-800", children: componentFooter() })
3729
3761
  ] });
3730
3762
  }
3731
3763
 
3732
3764
  // src/components/Badge.tsx
3733
3765
  var import_react18 = __toESM(require("react"));
3734
- var import_jsx_runtime25 = require("react/jsx-runtime");
3766
+ var import_jsx_runtime26 = require("react/jsx-runtime");
3735
3767
  var Badge = import_react18.default.forwardRef(
3736
3768
  ({
3737
3769
  children,
@@ -3753,7 +3785,7 @@ var Badge = import_react18.default.forwardRef(
3753
3785
  md: "px-2.5 py-1 text-xs leading-tight font-semibold",
3754
3786
  lg: "px-3 py-1.5 text-sm leading-tight font-semibold"
3755
3787
  };
3756
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3788
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3757
3789
  "span",
3758
3790
  {
3759
3791
  ref,
@@ -3767,13 +3799,13 @@ var Badge = import_react18.default.forwardRef(
3767
3799
  Badge.displayName = "Badge";
3768
3800
 
3769
3801
  // src/components/Branding.tsx
3770
- var import_jsx_runtime26 = require("react/jsx-runtime");
3802
+ var import_jsx_runtime27 = require("react/jsx-runtime");
3771
3803
  var Branding = ({
3772
3804
  text,
3773
3805
  disabled = false,
3774
3806
  className
3775
3807
  }) => {
3776
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3808
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3777
3809
  "p",
3778
3810
  {
3779
3811
  className: cn(
@@ -3790,7 +3822,7 @@ var Branding = ({
3790
3822
  var import_react19 = require("react");
3791
3823
  var import_react_to_print = require("react-to-print");
3792
3824
  var import_lucide_react12 = require("lucide-react");
3793
- var import_jsx_runtime27 = require("react/jsx-runtime");
3825
+ var import_jsx_runtime28 = require("react/jsx-runtime");
3794
3826
  var useA4StatementView = ({
3795
3827
  url,
3796
3828
  v = 1,
@@ -3819,7 +3851,7 @@ var useA4StatementView = ({
3819
3851
  renderFooter: (value) => value.reduce((acc, item) => acc + item.amount, 0)
3820
3852
  }
3821
3853
  ],
3822
- data = apiData || [],
3854
+ data = [],
3823
3855
  error = apiError,
3824
3856
  info,
3825
3857
  index,
@@ -3850,20 +3882,20 @@ var useA4StatementView = ({
3850
3882
  const columnsWithFooters = columns.filter(
3851
3883
  (col) => col.renderFooter && !col.hide
3852
3884
  );
3853
- const DisplayFinalTotalEl = columnsWithFooters.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3885
+ const DisplayFinalTotalEl = columnsWithFooters.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3854
3886
  "div",
3855
3887
  {
3856
3888
  id: "a4-final-total",
3857
3889
  className: "mt-6 flex flex-wrap justify-end items-center pt-4 border-t border-black dark:border-zinc-700 print:border-black gap-4",
3858
3890
  children: [
3859
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "text-black dark:text-white print:text-black font-bold uppercase tracking-widest text-xs mr-auto", children: "Grand Totals" }),
3860
- columnsWithFooters.map((col, idx) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3891
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-black dark:text-white print:text-black font-bold uppercase tracking-widest text-xs mr-auto", children: "Grand Totals" }),
3892
+ columnsWithFooters.map((col, idx) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3861
3893
  "div",
3862
3894
  {
3863
3895
  className: "flex items-center gap-3 px-4 py-2 rounded-md border border-black dark:border-zinc-700 print:border-black",
3864
3896
  children: [
3865
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-black dark:text-white print:text-black font-bold uppercase tracking-widest text-xs", children: typeof col.header === "string" ? col.header : typeof col.key === "string" ? col.key : "Total" }),
3866
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "text-base font-bold font-sans tabular-nums text-black dark:text-white print:text-black", children: col.renderFooter(filteredDisplayData) })
3897
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-black dark:text-white print:text-black font-bold uppercase tracking-widest text-xs", children: typeof col.header === "string" ? col.header : typeof col.key === "string" ? col.key : "Total" }),
3898
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-base font-bold font-sans tabular-nums text-black dark:text-white print:text-black", children: col.renderFooter(filteredDisplayData) })
3867
3899
  ]
3868
3900
  },
3869
3901
  col.key || idx
@@ -3938,53 +3970,53 @@ var useA4StatementView = ({
3938
3970
  }, 150);
3939
3971
  return () => clearTimeout(timer);
3940
3972
  }, [isMeasuring, depsString]);
3941
- const HeaderEl = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3973
+ const HeaderEl = /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3942
3974
  "div",
3943
3975
  {
3944
3976
  className: "flex justify-between items-start mb-5 px-8 pt-8",
3945
3977
  id: "a4-header-section",
3946
3978
  children: [
3947
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("section", { children: [
3948
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h1", { className: "text-4xl font-bold text-blue-600 dark:text-blue-500 print:text-blue-600 tracking-tight uppercase", children: title }),
3949
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-gray-500 dark:text-gray-400 print:text-gray-500 mt-1 uppercase text-xs font-semibold tracking-wider", children: subtitle })
3979
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("section", { children: [
3980
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h1", { className: "text-4xl font-bold text-blue-600 dark:text-blue-500 print:text-blue-600 tracking-tight uppercase", children: title }),
3981
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-gray-500 dark:text-gray-400 print:text-gray-500 mt-1 uppercase text-xs font-semibold tracking-wider", children: subtitle })
3950
3982
  ] }) }) }),
3951
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "text-right", children: [
3952
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h2", { className: "text-lg font-bold text-gray-800 dark:text-gray-100 print:text-gray-800", children: store?.name }),
3953
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "text-sm text-gray-500 dark:text-gray-400 print:text-gray-500 leading-relaxed text-right flex flex-col items-end", children: [
3954
- store?.address && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "whitespace-pre-line", children: store.address }),
3955
- store?.phone && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: store.phone }),
3956
- store?.email && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: store.email })
3983
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "text-right", children: [
3984
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h2", { className: "text-lg font-bold text-gray-800 dark:text-gray-100 print:text-gray-800", children: store?.name }),
3985
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "text-sm text-gray-500 dark:text-gray-400 print:text-gray-500 leading-relaxed text-right flex flex-col items-end", children: [
3986
+ store?.address && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "whitespace-pre-line", children: store.address }),
3987
+ store?.phone && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: store.phone }),
3988
+ store?.email && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: store.email })
3957
3989
  ] })
3958
3990
  ] })
3959
3991
  ]
3960
3992
  }
3961
3993
  );
3962
- const DisplayInfoGridEl = Array.isArray(info) && info.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { id: "a4-info-grid", className: "px-8", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(InfoGrid, { className: "mb-4", items: info, isLoading }) }) : null;
3994
+ const DisplayInfoGridEl = Array.isArray(info) && info.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { id: "a4-info-grid", className: "px-8", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(InfoGrid, { className: "mb-4", items: info, isLoading }) }) : null;
3963
3995
  if (!isLoading && (error || !data || data.length === 0)) {
3964
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col relative w-full items-center justify-center p-8 min-h-96", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col items-center justify-center p-12 bg-gray-50/50 dark:bg-zinc-900/30 rounded-2xl border border-dashed border-gray-300 dark:border-zinc-700 w-full max-w-xl text-center shadow-sm", children: [
3965
- error ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-16 h-16 bg-red-100 dark:bg-red-500/10 rounded-full flex items-center justify-center mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react12.AlertCircle, { className: "w-8 h-8 text-red-600 dark:text-red-500" }) }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-16 h-16 bg-gray-200 dark:bg-zinc-800 rounded-full flex items-center justify-center mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react12.FileX, { className: "w-8 h-8 text-gray-500 dark:text-gray-400" }) }),
3966
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className: "text-xl font-bold text-gray-900 dark:text-white mb-2", children: error ? "Failed to Load Statement" : "No Records Found" }),
3967
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-xs mb-8 leading-relaxed", children: error ? typeof error === "string" ? error : "An unexpected error occurred while fetching the statement data." : "There are no transactions or records available in this requested statement." }),
3968
- url && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3996
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-col relative w-full items-center justify-center p-8 min-h-96", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col items-center justify-center p-12 bg-gray-50/50 dark:bg-zinc-900/30 rounded-2xl border border-dashed border-gray-300 dark:border-zinc-700 w-full max-w-xl text-center shadow-sm", children: [
3997
+ error ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-16 h-16 bg-red-100 dark:bg-red-500/10 rounded-full flex items-center justify-center mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react12.AlertCircle, { className: "w-8 h-8 text-red-600 dark:text-red-500" }) }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-16 h-16 bg-gray-200 dark:bg-zinc-800 rounded-full flex items-center justify-center mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react12.FileX, { className: "w-8 h-8 text-gray-500 dark:text-gray-400" }) }),
3998
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h3", { className: "text-xl font-bold text-gray-900 dark:text-white mb-2", children: error ? "Failed to Load Statement" : "No Records Found" }),
3999
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-xs mb-8 leading-relaxed", children: error ? typeof error === "string" ? error : "An unexpected error occurred while fetching the statement data." : "There are no transactions or records available in this requested statement." }),
4000
+ url && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3969
4001
  "button",
3970
4002
  {
3971
4003
  onClick: () => get({ url, v, params, delay }),
3972
4004
  className: "flex items-center gap-2 px-6 py-2.5 bg-black dark:bg-white text-white dark:text-black font-semibold rounded-lg shadow-md hover:bg-gray-800 dark:hover:bg-gray-100 transition-all active:scale-95",
3973
4005
  children: [
3974
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react12.RefreshCw, { size: 16 }),
4006
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react12.RefreshCw, { size: 16 }),
3975
4007
  "Try Again"
3976
4008
  ]
3977
4009
  }
3978
4010
  )
3979
4011
  ] }) });
3980
4012
  }
3981
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col relative w-full items-center", children: [
3982
- isMeasuring && filteredDisplayData.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "absolute top-0 opacity-0 pointer-events-none -left-full", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4013
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col relative w-full items-center", children: [
4014
+ isMeasuring && filteredDisplayData.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "absolute top-0 opacity-0 pointer-events-none -left-full", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3983
4015
  "div",
3984
4016
  {
3985
4017
  style: { width: "210mm", boxSizing: "border-box" },
3986
4018
  className: "bg-white",
3987
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4019
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3988
4020
  "div",
3989
4021
  {
3990
4022
  ref: measureContainerRef,
@@ -3992,9 +4024,9 @@ var useA4StatementView = ({
3992
4024
  children: [
3993
4025
  HeaderEl,
3994
4026
  DisplayInfoGridEl,
3995
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "grow w-full px-8 pb-8", children: [
3996
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-4 border-b border-gray-200 dark:border-zinc-800 print:border-gray-200 pb-2 flex items-center gap-2 justify-between px-2 mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className: "text-sm font-bold text-gray-800 dark:text-gray-100 print:text-gray-800 uppercase tracking-wide shrink-0", children: "Recent Transactions" }) }),
3997
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4027
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "grow w-full px-8 pb-8", children: [
4028
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mb-4 border-b border-gray-200 dark:border-zinc-800 print:border-gray-200 pb-2 flex items-center gap-2 justify-between px-2 mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h3", { className: "text-sm font-bold text-gray-800 dark:text-gray-100 print:text-gray-800 uppercase tracking-wide shrink-0", children: "Recent Transactions" }) }),
4029
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3998
4030
  SimpleTable,
3999
4031
  {
4000
4032
  columns,
@@ -4012,42 +4044,42 @@ var useA4StatementView = ({
4012
4044
  )
4013
4045
  }
4014
4046
  ) }),
4015
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "py-2 px-0 md:px-4 w-full", ref: contentRef, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col gap-8 print:block print:gap-0 w-full items-center", children: pages.map((pageData, pageIndex) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4047
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "py-2 px-0 md:px-4 w-full", ref: contentRef, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-col gap-8 print:block print:gap-0 w-full items-center", children: pages.map((pageData, pageIndex) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4016
4048
  PageA4,
4017
4049
  {
4018
4050
  className: "w-full",
4019
4051
  pageNumber: pageIndex + 1,
4020
4052
  totalPages: pages.length,
4021
4053
  isLastPage: pageIndex === pages.length - 1,
4022
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col h-full grow w-full", children: [
4023
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("header", { className: "flex justify-between gap-2 items-center px-8 pt-4 print:hidden", children: [
4054
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col h-full grow w-full", children: [
4055
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("header", { className: "flex justify-between gap-2 items-center px-8 pt-4 print:hidden", children: [
4024
4056
  headers,
4025
- printable && pageIndex === 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-center justify-end ", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2", children: [
4026
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4057
+ printable && pageIndex === 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-end ", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2", children: [
4058
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
4027
4059
  "button",
4028
4060
  {
4029
4061
  onClick: () => url && get({ url, v, params, delay }),
4030
4062
  disabled: isLoading,
4031
4063
  className: "flex items-center gap-2 px-3 py-1.5 text-gray-600 dark:text-gray-300 hover:text-black dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-all disabled:opacity-50",
4032
4064
  children: [
4033
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4065
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4034
4066
  import_lucide_react12.RefreshCw,
4035
4067
  {
4036
4068
  size: 16,
4037
4069
  className: isLoading ? "animate-spin" : ""
4038
4070
  }
4039
4071
  ),
4040
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs font-semibold", children: "Reload" })
4072
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-xs font-semibold", children: "Reload" })
4041
4073
  ]
4042
4074
  }
4043
4075
  ),
4044
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4076
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
4045
4077
  "button",
4046
4078
  {
4047
4079
  onClick: () => reactToPrintFn(),
4048
4080
  className: "flex items-center gap-2 px-4 py-1.5 bg-black dark:bg-zinc-800 text-white rounded-md text-xs font-bold shadow-sm hover:bg-zinc-800 dark:hover:bg-zinc-700 transition-all active:scale-95",
4049
4081
  children: [
4050
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react12.Printer, { size: 16 }),
4082
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react12.Printer, { size: 16 }),
4051
4083
  "Print"
4052
4084
  ]
4053
4085
  }
@@ -4056,10 +4088,10 @@ var useA4StatementView = ({
4056
4088
  ] }),
4057
4089
  pageIndex === 0 && HeaderEl,
4058
4090
  pageIndex === 0 && DisplayInfoGridEl,
4059
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "grow w-full px-8 pb-8", children: [
4060
- pageIndex === 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "mb-4 border-b border-gray-200 dark:border-zinc-800 print:border-gray-200 pb-2 flex items-center gap-2 justify-between px-2 mt-2 print:hidden", children: [
4061
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className: "text-sm font-bold text-gray-800 dark:text-gray-100 print:text-gray-800 uppercase tracking-wide shrink-0", children: "Recent Transactions" }),
4062
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4091
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "grow w-full px-8 pb-8", children: [
4092
+ pageIndex === 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "mb-4 border-b border-gray-200 dark:border-zinc-800 print:border-gray-200 pb-2 flex items-center gap-2 justify-between px-2 mt-2 print:hidden", children: [
4093
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h3", { className: "text-sm font-bold text-gray-800 dark:text-gray-100 print:text-gray-800 uppercase tracking-wide shrink-0", children: "Recent Transactions" }),
4094
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4063
4095
  "input",
4064
4096
  {
4065
4097
  type: "text",
@@ -4070,9 +4102,9 @@ var useA4StatementView = ({
4070
4102
  }
4071
4103
  )
4072
4104
  ] }),
4073
- pageIndex === 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "hidden print:flex mb-4 border-b border-gray-200 print:border-gray-200 pb-2 items-center gap-2 justify-between px-2 mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className: "text-sm font-bold text-gray-800 print:text-gray-800 uppercase tracking-wide shrink-0", children: "Recent Transactions" }) }),
4074
- pageIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "h-5 print:h-0" }),
4075
- (pageData.length > 0 || isLoading) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4105
+ pageIndex === 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "hidden print:flex mb-4 border-b border-gray-200 print:border-gray-200 pb-2 items-center gap-2 justify-between px-2 mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h3", { className: "text-sm font-bold text-gray-800 print:text-gray-800 uppercase tracking-wide shrink-0", children: "Recent Transactions" }) }),
4106
+ pageIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "h-5 print:h-0" }),
4107
+ (pageData.length > 0 || isLoading) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4076
4108
  SimpleTable,
4077
4109
  {
4078
4110
  columns,
@@ -4104,7 +4136,7 @@ var useA4StatementView = ({
4104
4136
  var A4DataView = (props) => {
4105
4137
  const { url, v, delay, params, ...rest } = props;
4106
4138
  const { A4DataView: View } = useA4StatementView({ url, v, delay, params });
4107
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(View, { ...rest });
4139
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(View, { ...rest });
4108
4140
  };
4109
4141
  var useA4DataView_default = useA4StatementView;
4110
4142
 
@@ -4112,7 +4144,7 @@ var useA4DataView_default = useA4StatementView;
4112
4144
  var import_react20 = require("react");
4113
4145
  var import_lucide_react13 = require("lucide-react");
4114
4146
  var import_moment = __toESM(require("moment"));
4115
- var import_jsx_runtime28 = require("react/jsx-runtime");
4147
+ var import_jsx_runtime29 = require("react/jsx-runtime");
4116
4148
  var useTransaction = ({
4117
4149
  url,
4118
4150
  v = 1,
@@ -4147,7 +4179,7 @@ var useTransaction = ({
4147
4179
  hide: true
4148
4180
  }
4149
4181
  ],
4150
- data = apiData || [],
4182
+ data = [],
4151
4183
  error = apiError,
4152
4184
  pageRows,
4153
4185
  searchPlaceholder = "Search transactions...",
@@ -4164,21 +4196,21 @@ var useTransaction = ({
4164
4196
  ...rest
4165
4197
  }) => {
4166
4198
  if (!isLoading && (error || !data || data.length === 0)) {
4167
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4199
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4168
4200
  "div",
4169
4201
  {
4170
4202
  className: `flex flex-col relative w-full items-center justify-center p-8 min-h-96 ${className}`,
4171
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col items-center justify-center p-12 bg-gray-50/50 dark:bg-zinc-900/30 rounded-2xl border border-dashed border-gray-300 dark:border-zinc-700 w-full max-w-xl text-center shadow-sm", children: [
4172
- error ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-16 h-16 bg-red-100 dark:bg-red-500/10 rounded-full flex items-center justify-center mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react13.AlertCircle, { className: "w-8 h-8 text-red-600 dark:text-red-500" }) }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-16 h-16 bg-gray-200 dark:bg-zinc-800 rounded-full flex items-center justify-center mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react13.FileX, { className: "w-8 h-8 text-gray-500 dark:text-gray-400" }) }),
4173
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h3", { className: "text-xl font-bold text-gray-900 dark:text-white mb-2", children: error ? "Failed to Load Data" : "No Records Found" }),
4174
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-xs mb-8 leading-relaxed", children: error ? typeof error === "string" ? error : "An unexpected error occurred while fetching the data." : "There are no transactions or records available to display here." }),
4175
- url && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
4203
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-col items-center justify-center p-12 bg-gray-50/50 dark:bg-zinc-900/30 rounded-2xl border border-dashed border-gray-300 dark:border-zinc-700 w-full max-w-xl text-center shadow-sm", children: [
4204
+ error ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "w-16 h-16 bg-red-100 dark:bg-red-500/10 rounded-full flex items-center justify-center mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react13.AlertCircle, { className: "w-8 h-8 text-red-600 dark:text-red-500" }) }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "w-16 h-16 bg-gray-200 dark:bg-zinc-800 rounded-full flex items-center justify-center mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react13.FileX, { className: "w-8 h-8 text-gray-500 dark:text-gray-400" }) }),
4205
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h3", { className: "text-xl font-bold text-gray-900 dark:text-white mb-2", children: error ? "Failed to Load Data" : "No Records Found" }),
4206
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-xs mb-8 leading-relaxed", children: error ? typeof error === "string" ? error : "An unexpected error occurred while fetching the data." : "There are no transactions or records available to display here." }),
4207
+ url && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4176
4208
  "button",
4177
4209
  {
4178
4210
  onClick: () => get({ url, v, params, delay }),
4179
4211
  className: "flex items-center gap-2 px-6 py-2.5 bg-black dark:bg-white text-white dark:text-black font-semibold rounded-lg shadow-md hover:bg-gray-800 dark:hover:bg-gray-100 transition-all active:scale-95",
4180
4212
  children: [
4181
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react13.RefreshCw, { size: 16 }),
4213
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react13.RefreshCw, { size: 16 }),
4182
4214
  "Try Again"
4183
4215
  ]
4184
4216
  }
@@ -4187,14 +4219,14 @@ var useTransaction = ({
4187
4219
  }
4188
4220
  );
4189
4221
  }
4190
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Card, { children: [
4191
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Card.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("header", { className: "flex items-center justify-between gap-4 py-2", children: [
4192
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "space-y-1", children: [
4193
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Card.Title, { children: title }),
4194
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Card.Description, { children: description })
4222
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Card, { children: [
4223
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Card.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("header", { className: "flex items-center justify-between gap-4 py-2", children: [
4224
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
4225
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Card.Title, { children: title }),
4226
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Card.Description, { children: description })
4195
4227
  ] }),
4196
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("section", { className: "flex gap-2 items-center", children: [
4197
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4228
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("section", { className: "flex gap-2 items-center", children: [
4229
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4198
4230
  Fields_default.DateInput,
4199
4231
  {
4200
4232
  value: date,
@@ -4204,20 +4236,20 @@ var useTransaction = ({
4204
4236
  }
4205
4237
  }
4206
4238
  ),
4207
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4239
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4208
4240
  Button,
4209
4241
  {
4210
4242
  size: "sm",
4211
4243
  className: "rounded-md!",
4212
4244
  onClick: onCreate,
4213
4245
  variant: "primary",
4214
- icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react13.Plus, {}),
4246
+ icon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react13.Plus, {}),
4215
4247
  children: createTitle
4216
4248
  }
4217
4249
  )
4218
4250
  ] })
4219
4251
  ] }) }),
4220
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Card.Content, { className: "space-y-6", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: `w-full ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4252
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Card.Content, { className: "space-y-6", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: `w-full ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4221
4253
  DataTable,
4222
4254
  {
4223
4255
  columns,