@northslopetech/altitude-ui 3.0.0-alpha.3 → 3.0.0-alpha.4
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.d.mts +102 -13
- package/dist/index.d.ts +102 -13
- package/dist/index.js +833 -417
- package/dist/index.mjs +818 -423
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -71,6 +71,15 @@ __export(index_exports, {
|
|
|
71
71
|
CogIcon: () => CogIcon,
|
|
72
72
|
CredentialsIcon: () => CredentialsIcon,
|
|
73
73
|
DatePicker: () => DatePicker,
|
|
74
|
+
Dialog: () => Dialog,
|
|
75
|
+
DialogBody: () => DialogBody,
|
|
76
|
+
DialogClose: () => DialogClose,
|
|
77
|
+
DialogContent: () => DialogContent,
|
|
78
|
+
DialogDescription: () => DialogDescription,
|
|
79
|
+
DialogFooter: () => DialogFooter,
|
|
80
|
+
DialogOverlay: () => DialogOverlay,
|
|
81
|
+
DialogTitle: () => DialogTitle,
|
|
82
|
+
DialogTrigger: () => DialogTrigger,
|
|
74
83
|
DocumentIcon: () => DocumentIcon,
|
|
75
84
|
DollarIcon: () => DollarIcon,
|
|
76
85
|
DownloadIcon: () => DownloadIcon,
|
|
@@ -115,6 +124,16 @@ __export(index_exports, {
|
|
|
115
124
|
HomeIcon: () => HomeIcon,
|
|
116
125
|
InformationIcon: () => InformationIcon,
|
|
117
126
|
Input: () => Input,
|
|
127
|
+
Item: () => Item2,
|
|
128
|
+
ItemActions: () => ItemActions,
|
|
129
|
+
ItemContent: () => ItemContent,
|
|
130
|
+
ItemDescription: () => ItemDescription,
|
|
131
|
+
ItemFooter: () => ItemFooter,
|
|
132
|
+
ItemGroup: () => ItemGroup,
|
|
133
|
+
ItemHeader: () => ItemHeader,
|
|
134
|
+
ItemMedia: () => ItemMedia,
|
|
135
|
+
ItemSeparator: () => ItemSeparator,
|
|
136
|
+
ItemTitle: () => ItemTitle,
|
|
118
137
|
Label: () => Label2,
|
|
119
138
|
LineChart: () => LineChart,
|
|
120
139
|
LocationIcon: () => LocationIcon,
|
|
@@ -194,6 +213,8 @@ __export(index_exports, {
|
|
|
194
213
|
getPerformanceColor: () => getPerformanceColor,
|
|
195
214
|
getSeriesColor: () => getSeriesColor,
|
|
196
215
|
initializePdfWorker: () => initializePdfWorker,
|
|
216
|
+
itemMediaVariants: () => itemMediaVariants,
|
|
217
|
+
itemVariants: () => itemVariants,
|
|
197
218
|
selectTriggerVariants: () => selectTriggerVariants,
|
|
198
219
|
switchVariants: () => switchVariants,
|
|
199
220
|
tabsVariants: () => tabsVariants,
|
|
@@ -1095,13 +1116,136 @@ function FieldError({
|
|
|
1095
1116
|
);
|
|
1096
1117
|
}
|
|
1097
1118
|
|
|
1098
|
-
// src/components/ui/
|
|
1119
|
+
// src/components/ui/dialog.tsx
|
|
1099
1120
|
var React9 = __toESM(require("react"));
|
|
1100
|
-
var
|
|
1101
|
-
var import_use_render = require("@base-ui/react/use-render");
|
|
1121
|
+
var import_dialog = require("@base-ui/react/dialog");
|
|
1102
1122
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1103
|
-
var
|
|
1123
|
+
var DialogChromeContext = React9.createContext(null);
|
|
1124
|
+
function useDialogChrome() {
|
|
1125
|
+
return React9.useContext(DialogChromeContext) ?? { showCloseButton: false };
|
|
1126
|
+
}
|
|
1127
|
+
var DialogCloseControl = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1128
|
+
import_dialog.Dialog.Close,
|
|
1129
|
+
{
|
|
1130
|
+
ref,
|
|
1131
|
+
type: "button",
|
|
1132
|
+
className: cn(
|
|
1133
|
+
"shrink-0 rounded-md p-1 text-secondary transition-colors",
|
|
1134
|
+
"hover:bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-interactive focus-visible:ring-offset-2",
|
|
1135
|
+
className
|
|
1136
|
+
),
|
|
1137
|
+
...props,
|
|
1138
|
+
children: [
|
|
1139
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CloseIcon, { size: 16, "aria-hidden": "true" }),
|
|
1140
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "Close" })
|
|
1141
|
+
]
|
|
1142
|
+
}
|
|
1143
|
+
));
|
|
1144
|
+
DialogCloseControl.displayName = "DialogCloseControl";
|
|
1145
|
+
var DIALOG_DESKTOP_FRAME = "h-[480px] w-[640px] max-w-[calc(100vw-2rem)] max-h-[calc(100dvh-2rem)]";
|
|
1146
|
+
var DIALOG_MOBILE_FRAME = "w-[320px] min-h-[240px] max-w-[calc(100vw-2rem)] max-h-[min(640px,calc(100dvh-2rem))] overflow-x-hidden [&_input]:!min-w-0";
|
|
1147
|
+
var Dialog = import_dialog.Dialog.Root;
|
|
1148
|
+
var DialogTrigger = import_dialog.Dialog.Trigger;
|
|
1149
|
+
var DialogOverlay = React9.forwardRef(
|
|
1150
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1151
|
+
import_dialog.Dialog.Backdrop,
|
|
1152
|
+
{
|
|
1153
|
+
ref,
|
|
1154
|
+
className: cn(
|
|
1155
|
+
"fixed inset-0 z-40 bg-dark/60 backdrop-blur-sm data-[hidden]:animate-out data-[hidden]:fade-out-0 data-[open]:animate-in data-[open]:fade-in-0",
|
|
1156
|
+
className
|
|
1157
|
+
),
|
|
1158
|
+
...props
|
|
1159
|
+
}
|
|
1160
|
+
)
|
|
1161
|
+
);
|
|
1162
|
+
DialogOverlay.displayName = "DialogOverlay";
|
|
1163
|
+
var DialogContent = React9.forwardRef(
|
|
1164
|
+
({ className, children, showCloseButton = true, size = "desktop", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_dialog.Dialog.Portal, { children: [
|
|
1165
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DialogOverlay, {}),
|
|
1166
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dialog.Dialog.Viewport, { className: "fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:items-center sm:p-6", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1167
|
+
import_dialog.Dialog.Popup,
|
|
1168
|
+
{
|
|
1169
|
+
ref,
|
|
1170
|
+
"data-slot": "dialog",
|
|
1171
|
+
className: cn(
|
|
1172
|
+
"relative my-auto flex flex-col overflow-hidden rounded-[10px] border border-default surface-default shadow-lg outline-none focus-visible:ring-2 focus-visible:ring-interactive focus-visible:ring-offset-2",
|
|
1173
|
+
size === "desktop" && DIALOG_DESKTOP_FRAME,
|
|
1174
|
+
size === "mobile" && DIALOG_MOBILE_FRAME,
|
|
1175
|
+
className
|
|
1176
|
+
),
|
|
1177
|
+
...props,
|
|
1178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DialogChromeContext.Provider, { value: { showCloseButton }, children })
|
|
1179
|
+
}
|
|
1180
|
+
) })
|
|
1181
|
+
] })
|
|
1182
|
+
);
|
|
1183
|
+
DialogContent.displayName = "DialogContent";
|
|
1184
|
+
var DialogBody = React9.forwardRef(
|
|
1185
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1186
|
+
"div",
|
|
1187
|
+
{
|
|
1188
|
+
ref,
|
|
1189
|
+
"data-slot": "dialog-body",
|
|
1190
|
+
className: cn(
|
|
1191
|
+
"min-h-0 flex-1 overflow-y-auto overscroll-contain p-6",
|
|
1192
|
+
className
|
|
1193
|
+
),
|
|
1194
|
+
...props
|
|
1195
|
+
}
|
|
1196
|
+
)
|
|
1197
|
+
);
|
|
1198
|
+
DialogBody.displayName = "DialogBody";
|
|
1199
|
+
var DialogFooter = React9.forwardRef(
|
|
1104
1200
|
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1201
|
+
"div",
|
|
1202
|
+
{
|
|
1203
|
+
ref,
|
|
1204
|
+
className: cn(
|
|
1205
|
+
"shrink-0 flex flex-col-reverse gap-2 p-4 sm:flex-row sm:justify-end sm:gap-2",
|
|
1206
|
+
className
|
|
1207
|
+
),
|
|
1208
|
+
...props
|
|
1209
|
+
}
|
|
1210
|
+
)
|
|
1211
|
+
);
|
|
1212
|
+
DialogFooter.displayName = "DialogFooter";
|
|
1213
|
+
var DialogTitle = React9.forwardRef(
|
|
1214
|
+
({ className, children, ...props }, ref) => {
|
|
1215
|
+
const { showCloseButton } = useDialogChrome();
|
|
1216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "shrink-0 flex items-center justify-between p-4", children: [
|
|
1217
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1218
|
+
import_dialog.Dialog.Title,
|
|
1219
|
+
{
|
|
1220
|
+
ref,
|
|
1221
|
+
className: cn("type-h4-medium text-default", className),
|
|
1222
|
+
...props,
|
|
1223
|
+
children
|
|
1224
|
+
}
|
|
1225
|
+
),
|
|
1226
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DialogCloseControl, {}) : null
|
|
1227
|
+
] });
|
|
1228
|
+
}
|
|
1229
|
+
);
|
|
1230
|
+
DialogTitle.displayName = "DialogTitle";
|
|
1231
|
+
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1232
|
+
import_dialog.Dialog.Description,
|
|
1233
|
+
{
|
|
1234
|
+
ref,
|
|
1235
|
+
className: cn("type-body-sm-regular text-secondary", className),
|
|
1236
|
+
...props
|
|
1237
|
+
}
|
|
1238
|
+
));
|
|
1239
|
+
DialogDescription.displayName = "DialogDescription";
|
|
1240
|
+
var DialogClose = import_dialog.Dialog.Close;
|
|
1241
|
+
|
|
1242
|
+
// src/components/ui/breadcrumb.tsx
|
|
1243
|
+
var React10 = __toESM(require("react"));
|
|
1244
|
+
var import_merge_props = require("@base-ui/react/merge-props");
|
|
1245
|
+
var import_use_render = require("@base-ui/react/use-render");
|
|
1246
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1247
|
+
var Breadcrumb = React10.forwardRef(
|
|
1248
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1105
1249
|
"nav",
|
|
1106
1250
|
{
|
|
1107
1251
|
"aria-label": "breadcrumb",
|
|
@@ -1113,8 +1257,8 @@ var Breadcrumb = React9.forwardRef(
|
|
|
1113
1257
|
)
|
|
1114
1258
|
);
|
|
1115
1259
|
Breadcrumb.displayName = "Breadcrumb";
|
|
1116
|
-
var BreadcrumbList =
|
|
1117
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1260
|
+
var BreadcrumbList = React10.forwardRef(
|
|
1261
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1118
1262
|
"ol",
|
|
1119
1263
|
{
|
|
1120
1264
|
"data-slot": "breadcrumb-list",
|
|
@@ -1128,8 +1272,8 @@ var BreadcrumbList = React9.forwardRef(
|
|
|
1128
1272
|
)
|
|
1129
1273
|
);
|
|
1130
1274
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
1131
|
-
var BreadcrumbItem =
|
|
1132
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1275
|
+
var BreadcrumbItem = React10.forwardRef(
|
|
1276
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1133
1277
|
"li",
|
|
1134
1278
|
{
|
|
1135
1279
|
"data-slot": "breadcrumb-item",
|
|
@@ -1140,7 +1284,7 @@ var BreadcrumbItem = React9.forwardRef(
|
|
|
1140
1284
|
)
|
|
1141
1285
|
);
|
|
1142
1286
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
1143
|
-
var BreadcrumbLink =
|
|
1287
|
+
var BreadcrumbLink = React10.forwardRef(
|
|
1144
1288
|
({ className, render, ...props }, ref) => (0, import_use_render.useRender)({
|
|
1145
1289
|
ref,
|
|
1146
1290
|
defaultTagName: "a",
|
|
@@ -1157,8 +1301,8 @@ var BreadcrumbLink = React9.forwardRef(
|
|
|
1157
1301
|
})
|
|
1158
1302
|
);
|
|
1159
1303
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
1160
|
-
var BreadcrumbPage =
|
|
1161
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1304
|
+
var BreadcrumbPage = React10.forwardRef(
|
|
1305
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1162
1306
|
"span",
|
|
1163
1307
|
{
|
|
1164
1308
|
"data-slot": "breadcrumb-page",
|
|
@@ -1172,7 +1316,7 @@ var BreadcrumbPage = React9.forwardRef(
|
|
|
1172
1316
|
)
|
|
1173
1317
|
);
|
|
1174
1318
|
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
1175
|
-
var BreadcrumbSeparator =
|
|
1319
|
+
var BreadcrumbSeparator = React10.forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1176
1320
|
"li",
|
|
1177
1321
|
{
|
|
1178
1322
|
"data-slot": "breadcrumb-separator",
|
|
@@ -1181,11 +1325,11 @@ var BreadcrumbSeparator = React9.forwardRef(({ children, className, ...props },
|
|
|
1181
1325
|
className: cn("[&>svg]:size-3.5", className),
|
|
1182
1326
|
ref,
|
|
1183
1327
|
...props,
|
|
1184
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
1328
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CaretRightIcon, { className: "cn-rtl-flip" })
|
|
1185
1329
|
}
|
|
1186
1330
|
));
|
|
1187
1331
|
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
1188
|
-
var BreadcrumbEllipsis =
|
|
1332
|
+
var BreadcrumbEllipsis = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1189
1333
|
"span",
|
|
1190
1334
|
{
|
|
1191
1335
|
"data-slot": "breadcrumb-ellipsis",
|
|
@@ -1198,22 +1342,22 @@ var BreadcrumbEllipsis = React9.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1198
1342
|
ref,
|
|
1199
1343
|
...props,
|
|
1200
1344
|
children: [
|
|
1201
|
-
/* @__PURE__ */ (0,
|
|
1202
|
-
/* @__PURE__ */ (0,
|
|
1345
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MoreMenuIcon, {}),
|
|
1346
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "More" })
|
|
1203
1347
|
]
|
|
1204
1348
|
}
|
|
1205
1349
|
));
|
|
1206
1350
|
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
1207
1351
|
|
|
1208
1352
|
// src/components/ui/tooltip.tsx
|
|
1209
|
-
var
|
|
1353
|
+
var React11 = __toESM(require("react"));
|
|
1210
1354
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
1211
|
-
var
|
|
1355
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1212
1356
|
function TooltipProvider({
|
|
1213
1357
|
delayDuration = 0,
|
|
1214
1358
|
...props
|
|
1215
1359
|
}) {
|
|
1216
|
-
return /* @__PURE__ */ (0,
|
|
1360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1217
1361
|
TooltipPrimitive.Provider,
|
|
1218
1362
|
{
|
|
1219
1363
|
"data-slot": "tooltip-provider",
|
|
@@ -1224,11 +1368,11 @@ function TooltipProvider({
|
|
|
1224
1368
|
}
|
|
1225
1369
|
TooltipProvider.displayName = "TooltipProvider";
|
|
1226
1370
|
function Tooltip({ delayDuration, ...props }) {
|
|
1227
|
-
return /* @__PURE__ */ (0,
|
|
1371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipProvider, { delayDuration, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
1228
1372
|
}
|
|
1229
1373
|
Tooltip.displayName = "Tooltip";
|
|
1230
|
-
var TooltipTrigger =
|
|
1231
|
-
return /* @__PURE__ */ (0,
|
|
1374
|
+
var TooltipTrigger = React11.forwardRef(({ ...props }, ref) => {
|
|
1375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1232
1376
|
TooltipPrimitive.Trigger,
|
|
1233
1377
|
{
|
|
1234
1378
|
ref,
|
|
@@ -1238,8 +1382,8 @@ var TooltipTrigger = React10.forwardRef(({ ...props }, ref) => {
|
|
|
1238
1382
|
);
|
|
1239
1383
|
});
|
|
1240
1384
|
TooltipTrigger.displayName = "TooltipTrigger";
|
|
1241
|
-
var TooltipContent =
|
|
1242
|
-
return /* @__PURE__ */ (0,
|
|
1385
|
+
var TooltipContent = React11.forwardRef(({ className, sideOffset = 2, children, ...props }, ref) => {
|
|
1386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1243
1387
|
TooltipPrimitive.Content,
|
|
1244
1388
|
{
|
|
1245
1389
|
ref,
|
|
@@ -1251,7 +1395,7 @@ var TooltipContent = React10.forwardRef(({ className, sideOffset = 2, children,
|
|
|
1251
1395
|
),
|
|
1252
1396
|
...props,
|
|
1253
1397
|
children: [
|
|
1254
|
-
/* @__PURE__ */ (0,
|
|
1398
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipPrimitive.Arrow, { className: "fill-dark", width: 10, height: 9 }),
|
|
1255
1399
|
children
|
|
1256
1400
|
]
|
|
1257
1401
|
}
|
|
@@ -1260,21 +1404,21 @@ var TooltipContent = React10.forwardRef(({ className, sideOffset = 2, children,
|
|
|
1260
1404
|
TooltipContent.displayName = "TooltipContent";
|
|
1261
1405
|
|
|
1262
1406
|
// src/components/ui/sidebar.tsx
|
|
1263
|
-
var
|
|
1264
|
-
var
|
|
1407
|
+
var React12 = __toESM(require("react"));
|
|
1408
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1265
1409
|
var SIDEBAR_CONSTANTS = {
|
|
1266
1410
|
WIDTH: "144px",
|
|
1267
1411
|
WIDTH_ICON: "48px"
|
|
1268
1412
|
};
|
|
1269
|
-
var SidebarContext =
|
|
1413
|
+
var SidebarContext = React12.createContext(null);
|
|
1270
1414
|
function useSidebar() {
|
|
1271
|
-
const context =
|
|
1415
|
+
const context = React12.useContext(SidebarContext);
|
|
1272
1416
|
if (!context) {
|
|
1273
1417
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
1274
1418
|
}
|
|
1275
1419
|
return context;
|
|
1276
1420
|
}
|
|
1277
|
-
var SidebarProvider =
|
|
1421
|
+
var SidebarProvider = React12.forwardRef(
|
|
1278
1422
|
({
|
|
1279
1423
|
defaultOpen = true,
|
|
1280
1424
|
open: openProp,
|
|
@@ -1284,9 +1428,9 @@ var SidebarProvider = React11.forwardRef(
|
|
|
1284
1428
|
children,
|
|
1285
1429
|
...props
|
|
1286
1430
|
}, ref) => {
|
|
1287
|
-
const [_open, _setOpen] =
|
|
1431
|
+
const [_open, _setOpen] = React12.useState(defaultOpen);
|
|
1288
1432
|
const open = openProp ?? _open;
|
|
1289
|
-
const setOpen =
|
|
1433
|
+
const setOpen = React12.useCallback(
|
|
1290
1434
|
(value) => {
|
|
1291
1435
|
const openState = typeof value === "function" ? value(open) : value;
|
|
1292
1436
|
if (setOpenProp) {
|
|
@@ -1297,11 +1441,11 @@ var SidebarProvider = React11.forwardRef(
|
|
|
1297
1441
|
},
|
|
1298
1442
|
[setOpenProp, open]
|
|
1299
1443
|
);
|
|
1300
|
-
const toggleSidebar =
|
|
1444
|
+
const toggleSidebar = React12.useCallback(() => {
|
|
1301
1445
|
return setOpen((open2) => !open2);
|
|
1302
1446
|
}, [setOpen]);
|
|
1303
1447
|
const state = open ? "expanded" : "collapsed";
|
|
1304
|
-
const contextValue =
|
|
1448
|
+
const contextValue = React12.useMemo(
|
|
1305
1449
|
() => ({
|
|
1306
1450
|
state,
|
|
1307
1451
|
open,
|
|
@@ -1310,7 +1454,7 @@ var SidebarProvider = React11.forwardRef(
|
|
|
1310
1454
|
}),
|
|
1311
1455
|
[state, open, setOpen, toggleSidebar]
|
|
1312
1456
|
);
|
|
1313
|
-
return /* @__PURE__ */ (0,
|
|
1457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1314
1458
|
"div",
|
|
1315
1459
|
{
|
|
1316
1460
|
style: {
|
|
@@ -1330,10 +1474,10 @@ var SidebarProvider = React11.forwardRef(
|
|
|
1330
1474
|
}
|
|
1331
1475
|
);
|
|
1332
1476
|
SidebarProvider.displayName = "SidebarProvider";
|
|
1333
|
-
var Sidebar =
|
|
1477
|
+
var Sidebar = React12.forwardRef(
|
|
1334
1478
|
({ collapsible = "icon", className, children, ...props }, ref) => {
|
|
1335
1479
|
const { state } = useSidebar();
|
|
1336
|
-
return /* @__PURE__ */ (0,
|
|
1480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1337
1481
|
"aside",
|
|
1338
1482
|
{
|
|
1339
1483
|
ref,
|
|
@@ -1344,7 +1488,7 @@ var Sidebar = React11.forwardRef(
|
|
|
1344
1488
|
"aria-expanded": state === "expanded",
|
|
1345
1489
|
role: "navigation",
|
|
1346
1490
|
children: [
|
|
1347
|
-
/* @__PURE__ */ (0,
|
|
1491
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1348
1492
|
"div",
|
|
1349
1493
|
{
|
|
1350
1494
|
className: cn(
|
|
@@ -1353,7 +1497,7 @@ var Sidebar = React11.forwardRef(
|
|
|
1353
1497
|
)
|
|
1354
1498
|
}
|
|
1355
1499
|
),
|
|
1356
|
-
/* @__PURE__ */ (0,
|
|
1500
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1357
1501
|
"div",
|
|
1358
1502
|
{
|
|
1359
1503
|
className: cn(
|
|
@@ -1362,7 +1506,7 @@ var Sidebar = React11.forwardRef(
|
|
|
1362
1506
|
className
|
|
1363
1507
|
),
|
|
1364
1508
|
...props,
|
|
1365
|
-
children: /* @__PURE__ */ (0,
|
|
1509
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1366
1510
|
"div",
|
|
1367
1511
|
{
|
|
1368
1512
|
"data-sidebar": "sidebar",
|
|
@@ -1378,9 +1522,9 @@ var Sidebar = React11.forwardRef(
|
|
|
1378
1522
|
}
|
|
1379
1523
|
);
|
|
1380
1524
|
Sidebar.displayName = "Sidebar";
|
|
1381
|
-
var SidebarInset =
|
|
1525
|
+
var SidebarInset = React12.forwardRef(
|
|
1382
1526
|
({ className, ...props }, ref) => {
|
|
1383
|
-
return /* @__PURE__ */ (0,
|
|
1527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1384
1528
|
"main",
|
|
1385
1529
|
{
|
|
1386
1530
|
ref,
|
|
@@ -1394,9 +1538,9 @@ var SidebarInset = React11.forwardRef(
|
|
|
1394
1538
|
}
|
|
1395
1539
|
);
|
|
1396
1540
|
SidebarInset.displayName = "SidebarInset";
|
|
1397
|
-
var SidebarHeader =
|
|
1541
|
+
var SidebarHeader = React12.forwardRef(
|
|
1398
1542
|
({ className, ...props }, ref) => {
|
|
1399
|
-
return /* @__PURE__ */ (0,
|
|
1543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1400
1544
|
"div",
|
|
1401
1545
|
{
|
|
1402
1546
|
ref,
|
|
@@ -1412,9 +1556,9 @@ var SidebarHeader = React11.forwardRef(
|
|
|
1412
1556
|
}
|
|
1413
1557
|
);
|
|
1414
1558
|
SidebarHeader.displayName = "SidebarHeader";
|
|
1415
|
-
var SidebarFooter =
|
|
1559
|
+
var SidebarFooter = React12.forwardRef(
|
|
1416
1560
|
({ className, ...props }, ref) => {
|
|
1417
|
-
return /* @__PURE__ */ (0,
|
|
1561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1418
1562
|
"div",
|
|
1419
1563
|
{
|
|
1420
1564
|
ref,
|
|
@@ -1426,9 +1570,9 @@ var SidebarFooter = React11.forwardRef(
|
|
|
1426
1570
|
}
|
|
1427
1571
|
);
|
|
1428
1572
|
SidebarFooter.displayName = "SidebarFooter";
|
|
1429
|
-
var SidebarContent =
|
|
1573
|
+
var SidebarContent = React12.forwardRef(
|
|
1430
1574
|
({ className, ...props }, ref) => {
|
|
1431
|
-
return /* @__PURE__ */ (0,
|
|
1575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1432
1576
|
"div",
|
|
1433
1577
|
{
|
|
1434
1578
|
ref,
|
|
@@ -1443,9 +1587,9 @@ var SidebarContent = React11.forwardRef(
|
|
|
1443
1587
|
}
|
|
1444
1588
|
);
|
|
1445
1589
|
SidebarContent.displayName = "SidebarContent";
|
|
1446
|
-
var SidebarGroup =
|
|
1590
|
+
var SidebarGroup = React12.forwardRef(
|
|
1447
1591
|
({ className, ...props }, ref) => {
|
|
1448
|
-
return /* @__PURE__ */ (0,
|
|
1592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1449
1593
|
"div",
|
|
1450
1594
|
{
|
|
1451
1595
|
ref,
|
|
@@ -1457,7 +1601,7 @@ var SidebarGroup = React11.forwardRef(
|
|
|
1457
1601
|
}
|
|
1458
1602
|
);
|
|
1459
1603
|
SidebarGroup.displayName = "SidebarGroup";
|
|
1460
|
-
var SidebarGroupContent =
|
|
1604
|
+
var SidebarGroupContent = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1461
1605
|
"div",
|
|
1462
1606
|
{
|
|
1463
1607
|
ref,
|
|
@@ -1467,8 +1611,8 @@ var SidebarGroupContent = React11.forwardRef(({ className, ...props }, ref) => /
|
|
|
1467
1611
|
}
|
|
1468
1612
|
));
|
|
1469
1613
|
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
1470
|
-
var SidebarMenu =
|
|
1471
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1614
|
+
var SidebarMenu = React12.forwardRef(
|
|
1615
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1472
1616
|
"ul",
|
|
1473
1617
|
{
|
|
1474
1618
|
ref,
|
|
@@ -1479,8 +1623,8 @@ var SidebarMenu = React11.forwardRef(
|
|
|
1479
1623
|
)
|
|
1480
1624
|
);
|
|
1481
1625
|
SidebarMenu.displayName = "SidebarMenu";
|
|
1482
|
-
var SidebarMenuItem =
|
|
1483
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1626
|
+
var SidebarMenuItem = React12.forwardRef(
|
|
1627
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1484
1628
|
"li",
|
|
1485
1629
|
{
|
|
1486
1630
|
ref,
|
|
@@ -1491,9 +1635,9 @@ var SidebarMenuItem = React11.forwardRef(
|
|
|
1491
1635
|
)
|
|
1492
1636
|
);
|
|
1493
1637
|
SidebarMenuItem.displayName = "SidebarMenuItem";
|
|
1494
|
-
var SidebarMenuButton =
|
|
1638
|
+
var SidebarMenuButton = React12.forwardRef(({ isActive = false, tooltip, className, children, ...props }, ref) => {
|
|
1495
1639
|
const { state } = useSidebar();
|
|
1496
|
-
const button = /* @__PURE__ */ (0,
|
|
1640
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1497
1641
|
"button",
|
|
1498
1642
|
{
|
|
1499
1643
|
ref,
|
|
@@ -1512,22 +1656,22 @@ var SidebarMenuButton = React11.forwardRef(({ isActive = false, tooltip, classNa
|
|
|
1512
1656
|
return button;
|
|
1513
1657
|
}
|
|
1514
1658
|
const tooltipProps = typeof tooltip === "string" ? { children: tooltip } : tooltip;
|
|
1515
|
-
return /* @__PURE__ */ (0,
|
|
1516
|
-
/* @__PURE__ */ (0,
|
|
1517
|
-
/* @__PURE__ */ (0,
|
|
1659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Tooltip, { delayDuration: 0, children: [
|
|
1660
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipTrigger, { asChild: true, children: button }),
|
|
1661
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipContent, { side: "right", align: "center", ...tooltipProps })
|
|
1518
1662
|
] });
|
|
1519
1663
|
});
|
|
1520
1664
|
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
1521
1665
|
|
|
1522
1666
|
// src/components/ui/date-picker.tsx
|
|
1523
|
-
var
|
|
1667
|
+
var React14 = __toESM(require("react"));
|
|
1524
1668
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
1525
1669
|
|
|
1526
1670
|
// src/components/ui/input.tsx
|
|
1527
|
-
var
|
|
1528
|
-
var
|
|
1671
|
+
var React13 = __toESM(require("react"));
|
|
1672
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1529
1673
|
var inputBaseStyles = "flex h-10 py-2 w-full border bg-light text-dark focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 transition-colors rounded-md px-3 min-w-80 placeholder:text-secondary read-only:bg-gray read-only:cursor-default read-only:border-transparent read-only:text-secondary read-only:focus-visible:border-transparent border-secondary focus-visible:border-2 focus-visible:border-strong disabled:border-secondary aria-invalid:border-error aria-invalid:focus-visible:border-error";
|
|
1530
|
-
var Input =
|
|
1674
|
+
var Input = React13.forwardRef(
|
|
1531
1675
|
({
|
|
1532
1676
|
className,
|
|
1533
1677
|
style,
|
|
@@ -1538,7 +1682,7 @@ var Input = React12.forwardRef(
|
|
|
1538
1682
|
readOnly,
|
|
1539
1683
|
...props
|
|
1540
1684
|
}, ref) => {
|
|
1541
|
-
const [internalValue, setInternalValue] =
|
|
1685
|
+
const [internalValue, setInternalValue] = React13.useState(value || "");
|
|
1542
1686
|
const isControlled = value !== void 0;
|
|
1543
1687
|
const currentValue = isControlled ? value : internalValue;
|
|
1544
1688
|
const showClear = showClearProp !== false && currentValue && currentValue.toString().length > 0 && !readOnly;
|
|
@@ -1568,8 +1712,8 @@ var Input = React12.forwardRef(
|
|
|
1568
1712
|
}
|
|
1569
1713
|
onClear?.();
|
|
1570
1714
|
};
|
|
1571
|
-
return /* @__PURE__ */ (0,
|
|
1572
|
-
/* @__PURE__ */ (0,
|
|
1715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "relative", children: [
|
|
1716
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1573
1717
|
"input",
|
|
1574
1718
|
{
|
|
1575
1719
|
className: cn(
|
|
@@ -1585,23 +1729,23 @@ var Input = React12.forwardRef(
|
|
|
1585
1729
|
...props
|
|
1586
1730
|
}
|
|
1587
1731
|
),
|
|
1588
|
-
showClear && /* @__PURE__ */ (0,
|
|
1732
|
+
showClear && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1589
1733
|
"button",
|
|
1590
1734
|
{
|
|
1591
1735
|
type: "button",
|
|
1592
1736
|
onClick: handleClear,
|
|
1593
1737
|
className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-secondary hover:text-dark transition-colors",
|
|
1594
|
-
children: /* @__PURE__ */ (0,
|
|
1738
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CloseIcon, {})
|
|
1595
1739
|
}
|
|
1596
1740
|
),
|
|
1597
|
-
showLock && /* @__PURE__ */ (0,
|
|
1741
|
+
showLock && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LockIcon, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 text-secondary" })
|
|
1598
1742
|
] });
|
|
1599
1743
|
}
|
|
1600
1744
|
);
|
|
1601
1745
|
Input.displayName = "Input";
|
|
1602
1746
|
|
|
1603
1747
|
// src/components/ui/date-picker.tsx
|
|
1604
|
-
var
|
|
1748
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1605
1749
|
var getDayNames = () => {
|
|
1606
1750
|
const days = [];
|
|
1607
1751
|
for (let i = 0; i < 7; i++) {
|
|
@@ -1637,7 +1781,7 @@ var formatDateInput = (date) => {
|
|
|
1637
1781
|
day: "2-digit"
|
|
1638
1782
|
});
|
|
1639
1783
|
};
|
|
1640
|
-
var DatePicker =
|
|
1784
|
+
var DatePicker = React14.forwardRef(
|
|
1641
1785
|
({
|
|
1642
1786
|
value,
|
|
1643
1787
|
onValueChange,
|
|
@@ -1656,19 +1800,19 @@ var DatePicker = React13.forwardRef(
|
|
|
1656
1800
|
if (isNaN(parsed.getTime())) return void 0;
|
|
1657
1801
|
return parsed;
|
|
1658
1802
|
};
|
|
1659
|
-
const [selectedDate, setSelectedDate] =
|
|
1803
|
+
const [selectedDate, setSelectedDate] = React14.useState(
|
|
1660
1804
|
value || parseDate(defaultValue)
|
|
1661
1805
|
);
|
|
1662
|
-
const [currentMonth, setCurrentMonth] =
|
|
1806
|
+
const [currentMonth, setCurrentMonth] = React14.useState(() => {
|
|
1663
1807
|
const date = value || parseDate(defaultValue) || /* @__PURE__ */ new Date();
|
|
1664
1808
|
return new Date(date.getFullYear(), date.getMonth());
|
|
1665
1809
|
});
|
|
1666
|
-
const [open, setOpen] =
|
|
1667
|
-
const [inputValue, setInputValue] =
|
|
1810
|
+
const [open, setOpen] = React14.useState(false);
|
|
1811
|
+
const [inputValue, setInputValue] = React14.useState(() => {
|
|
1668
1812
|
const initialDate = value || parseDate(defaultValue);
|
|
1669
1813
|
return initialDate ? formatDateInput(initialDate) : "";
|
|
1670
1814
|
});
|
|
1671
|
-
|
|
1815
|
+
React14.useEffect(() => {
|
|
1672
1816
|
setSelectedDate(value);
|
|
1673
1817
|
if (value) {
|
|
1674
1818
|
setCurrentMonth(new Date(value.getFullYear(), value.getMonth()));
|
|
@@ -1679,7 +1823,7 @@ var DatePicker = React13.forwardRef(
|
|
|
1679
1823
|
setInputValue("");
|
|
1680
1824
|
}
|
|
1681
1825
|
}, [value]);
|
|
1682
|
-
|
|
1826
|
+
React14.useEffect(() => {
|
|
1683
1827
|
if (value) return;
|
|
1684
1828
|
const parsedDefault = parseDate(defaultValue);
|
|
1685
1829
|
if (!parsedDefault) return;
|
|
@@ -1802,14 +1946,14 @@ var DatePicker = React13.forwardRef(
|
|
|
1802
1946
|
const months = getMonthNames();
|
|
1803
1947
|
const dayNames = getDayNames();
|
|
1804
1948
|
const years = generateYears();
|
|
1805
|
-
return /* @__PURE__ */ (0,
|
|
1949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1806
1950
|
PopoverPrimitive.Root,
|
|
1807
1951
|
{
|
|
1808
1952
|
open: disabled ? false : open,
|
|
1809
1953
|
onOpenChange: disabled ? void 0 : setOpen,
|
|
1810
1954
|
children: [
|
|
1811
|
-
/* @__PURE__ */ (0,
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1955
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "relative", children: [
|
|
1956
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1813
1957
|
Input,
|
|
1814
1958
|
{
|
|
1815
1959
|
ref,
|
|
@@ -1822,7 +1966,7 @@ var DatePicker = React13.forwardRef(
|
|
|
1822
1966
|
...props
|
|
1823
1967
|
}
|
|
1824
1968
|
),
|
|
1825
|
-
/* @__PURE__ */ (0,
|
|
1969
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "absolute right-3 top-1/2 transform -translate-y-1/2 hover:bg-gray rounded p-0.5 transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1826
1970
|
CalendarIcon,
|
|
1827
1971
|
{
|
|
1828
1972
|
size: 20,
|
|
@@ -1833,7 +1977,7 @@ var DatePicker = React13.forwardRef(
|
|
|
1833
1977
|
}
|
|
1834
1978
|
) }) })
|
|
1835
1979
|
] }),
|
|
1836
|
-
/* @__PURE__ */ (0,
|
|
1980
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1837
1981
|
PopoverPrimitive.Content,
|
|
1838
1982
|
{
|
|
1839
1983
|
className: "z-50 w-80 rounded-lg border border-secondary bg-light text-dark shadow-lg animate-in fade-in-0 zoom-in-95 duration-200",
|
|
@@ -1842,51 +1986,51 @@ var DatePicker = React13.forwardRef(
|
|
|
1842
1986
|
alignOffset: -12,
|
|
1843
1987
|
side: "bottom",
|
|
1844
1988
|
sticky: "always",
|
|
1845
|
-
children: /* @__PURE__ */ (0,
|
|
1846
|
-
/* @__PURE__ */ (0,
|
|
1847
|
-
/* @__PURE__ */ (0,
|
|
1989
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "p-4", children: [
|
|
1990
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center justify-between mb-4 gap-1", children: [
|
|
1991
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1848
1992
|
"button",
|
|
1849
1993
|
{
|
|
1850
1994
|
onClick: () => handleMonthChange("prev"),
|
|
1851
1995
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
1852
|
-
children: /* @__PURE__ */ (0,
|
|
1996
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ArrowLeftIcon, {})
|
|
1853
1997
|
}
|
|
1854
1998
|
),
|
|
1855
|
-
/* @__PURE__ */ (0,
|
|
1856
|
-
/* @__PURE__ */ (0,
|
|
1999
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex gap-1 flex-1 min-w-0", children: [
|
|
2000
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1857
2001
|
Select,
|
|
1858
2002
|
{
|
|
1859
2003
|
value: currentMonth.getMonth().toString(),
|
|
1860
2004
|
onValueChange: handleMonthSelect,
|
|
1861
2005
|
children: [
|
|
1862
|
-
/* @__PURE__ */ (0,
|
|
1863
|
-
/* @__PURE__ */ (0,
|
|
2006
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectTrigger, { className: "min-w-fit h-8 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectValue, {}) }),
|
|
2007
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectContent, { children: months.map((month, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectItem, { value: index.toString(), children: month }, month)) })
|
|
1864
2008
|
]
|
|
1865
2009
|
}
|
|
1866
2010
|
),
|
|
1867
|
-
/* @__PURE__ */ (0,
|
|
2011
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1868
2012
|
Select,
|
|
1869
2013
|
{
|
|
1870
2014
|
value: currentMonth.getFullYear().toString(),
|
|
1871
2015
|
onValueChange: handleYearSelect,
|
|
1872
2016
|
children: [
|
|
1873
|
-
/* @__PURE__ */ (0,
|
|
1874
|
-
/* @__PURE__ */ (0,
|
|
2017
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectTrigger, { className: "min-w-fit h-8 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectValue, {}) }),
|
|
2018
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectContent, { children: years.map((year) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectItem, { value: year.toString(), children: year }, year)) })
|
|
1875
2019
|
]
|
|
1876
2020
|
}
|
|
1877
2021
|
)
|
|
1878
2022
|
] }),
|
|
1879
|
-
/* @__PURE__ */ (0,
|
|
2023
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1880
2024
|
"button",
|
|
1881
2025
|
{
|
|
1882
2026
|
onClick: () => handleMonthChange("next"),
|
|
1883
2027
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
1884
|
-
children: /* @__PURE__ */ (0,
|
|
2028
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ArrowRightIcon, {})
|
|
1885
2029
|
}
|
|
1886
2030
|
)
|
|
1887
2031
|
] }),
|
|
1888
|
-
/* @__PURE__ */ (0,
|
|
1889
|
-
/* @__PURE__ */ (0,
|
|
2032
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-1", children: [
|
|
2033
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "grid grid-cols-7 gap-1 mb-2", children: dayNames.map((day) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1890
2034
|
Typography,
|
|
1891
2035
|
{
|
|
1892
2036
|
variant: "label-xs-bold",
|
|
@@ -1896,11 +2040,11 @@ var DatePicker = React13.forwardRef(
|
|
|
1896
2040
|
},
|
|
1897
2041
|
day
|
|
1898
2042
|
)) }),
|
|
1899
|
-
/* @__PURE__ */ (0,
|
|
2043
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "grid grid-cols-7 gap-1", children: days.map((date, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1900
2044
|
"div",
|
|
1901
2045
|
{
|
|
1902
2046
|
className: "h-8 w-8 flex items-center justify-center",
|
|
1903
|
-
children: date && /* @__PURE__ */ (0,
|
|
2047
|
+
children: date && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1904
2048
|
"button",
|
|
1905
2049
|
{
|
|
1906
2050
|
onClick: () => handleDateSelect(date),
|
|
@@ -1914,7 +2058,7 @@ var DatePicker = React13.forwardRef(
|
|
|
1914
2058
|
isToday(date) && !isDateSelected(date) && !isDateDisabled(date) && "text-blue-600 after:content-[''] after:absolute after:bottom-1 after:left-1/2 after:-translate-x-1/2 after:w-1 after:h-1 after:bg-blue-600 after:rounded-full",
|
|
1915
2059
|
isDateDisabled(date) && "text-secondary/40 cursor-not-allowed opacity-50"
|
|
1916
2060
|
),
|
|
1917
|
-
children: /* @__PURE__ */ (0,
|
|
2061
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Typography, { variant: "label-sm", as: "span", children: date.getDate() })
|
|
1918
2062
|
}
|
|
1919
2063
|
)
|
|
1920
2064
|
},
|
|
@@ -1932,9 +2076,9 @@ var DatePicker = React13.forwardRef(
|
|
|
1932
2076
|
DatePicker.displayName = "DatePicker";
|
|
1933
2077
|
|
|
1934
2078
|
// src/components/ui/upload.tsx
|
|
1935
|
-
var
|
|
2079
|
+
var React15 = __toESM(require("react"));
|
|
1936
2080
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
1937
|
-
var
|
|
2081
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1938
2082
|
var DEFAULT_MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
1939
2083
|
var uploadVariants = (0, import_class_variance_authority7.cva)(
|
|
1940
2084
|
"relative flex flex-col items-center justify-center rounded-lg transition-all duration-200 ease-in-out overflow-hidden",
|
|
@@ -1958,7 +2102,7 @@ var uploadVariants = (0, import_class_variance_authority7.cva)(
|
|
|
1958
2102
|
}
|
|
1959
2103
|
}
|
|
1960
2104
|
);
|
|
1961
|
-
var Upload =
|
|
2105
|
+
var Upload = React15.forwardRef(
|
|
1962
2106
|
({
|
|
1963
2107
|
className,
|
|
1964
2108
|
onFileSelect,
|
|
@@ -1971,8 +2115,8 @@ var Upload = React14.forwardRef(
|
|
|
1971
2115
|
selectedFiles = [],
|
|
1972
2116
|
...props
|
|
1973
2117
|
}, ref) => {
|
|
1974
|
-
const fileInputRef =
|
|
1975
|
-
const [isDragOver, setIsDragOver] =
|
|
2118
|
+
const fileInputRef = React15.useRef(null);
|
|
2119
|
+
const [isDragOver, setIsDragOver] = React15.useState(false);
|
|
1976
2120
|
const getFileTypeDisplay = () => {
|
|
1977
2121
|
const typeMap = {
|
|
1978
2122
|
"application/pdf": "PDF",
|
|
@@ -2036,17 +2180,17 @@ var Upload = React14.forwardRef(
|
|
|
2036
2180
|
const renderContent = () => {
|
|
2037
2181
|
switch (effectiveState) {
|
|
2038
2182
|
case "error":
|
|
2039
|
-
return /* @__PURE__ */ (0,
|
|
2183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2040
2184
|
"div",
|
|
2041
2185
|
{
|
|
2042
2186
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2043
2187
|
style: { gap: "32px" },
|
|
2044
2188
|
children: [
|
|
2045
|
-
/* @__PURE__ */ (0,
|
|
2046
|
-
/* @__PURE__ */ (0,
|
|
2047
|
-
/* @__PURE__ */ (0,
|
|
2189
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-4", children: [
|
|
2190
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "heading-lg", children: "Upload fail" }),
|
|
2191
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "body-md", className: "text-error", children: errorMessage })
|
|
2048
2192
|
] }),
|
|
2049
|
-
/* @__PURE__ */ (0,
|
|
2193
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2050
2194
|
Button,
|
|
2051
2195
|
{
|
|
2052
2196
|
variant: "destructive",
|
|
@@ -2060,22 +2204,22 @@ var Upload = React14.forwardRef(
|
|
|
2060
2204
|
}
|
|
2061
2205
|
);
|
|
2062
2206
|
case "uploading":
|
|
2063
|
-
return /* @__PURE__ */ (0,
|
|
2207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2064
2208
|
"div",
|
|
2065
2209
|
{
|
|
2066
2210
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2067
2211
|
style: { gap: "32px" },
|
|
2068
2212
|
children: [
|
|
2069
|
-
/* @__PURE__ */ (0,
|
|
2070
|
-
/* @__PURE__ */ (0,
|
|
2071
|
-
/* @__PURE__ */ (0,
|
|
2213
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "heading-lg", className: "text-dark", children: "Uploading files" }),
|
|
2214
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "w-full max-w-[720px] space-y-2", children: [
|
|
2215
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w-full bg-gray rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2072
2216
|
"div",
|
|
2073
2217
|
{
|
|
2074
2218
|
className: "bg-canvas-primary h-2 rounded-full transition-all duration-300 ease-in-out",
|
|
2075
2219
|
style: { width: `${progress}%` }
|
|
2076
2220
|
}
|
|
2077
2221
|
) }),
|
|
2078
|
-
/* @__PURE__ */ (0,
|
|
2222
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2079
2223
|
Typography,
|
|
2080
2224
|
{
|
|
2081
2225
|
variant: "body-sm",
|
|
@@ -2091,29 +2235,29 @@ var Upload = React14.forwardRef(
|
|
|
2091
2235
|
}
|
|
2092
2236
|
);
|
|
2093
2237
|
case "success":
|
|
2094
|
-
return /* @__PURE__ */ (0,
|
|
2238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2095
2239
|
"div",
|
|
2096
2240
|
{
|
|
2097
2241
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2098
2242
|
style: { gap: "32px" },
|
|
2099
|
-
children: /* @__PURE__ */ (0,
|
|
2100
|
-
/* @__PURE__ */ (0,
|
|
2101
|
-
selectedFiles.length > 0 && /* @__PURE__ */ (0,
|
|
2243
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-4", children: [
|
|
2244
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "heading-lg", className: "text-success", children: "Upload successful!" }),
|
|
2245
|
+
selectedFiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "text-center", children: selectedFiles.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "body-sm", children: file.name }, index)) })
|
|
2102
2246
|
] })
|
|
2103
2247
|
}
|
|
2104
2248
|
);
|
|
2105
2249
|
default:
|
|
2106
|
-
return /* @__PURE__ */ (0,
|
|
2250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2107
2251
|
"div",
|
|
2108
2252
|
{
|
|
2109
2253
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2110
2254
|
style: { gap: "32px" },
|
|
2111
2255
|
children: [
|
|
2112
|
-
/* @__PURE__ */ (0,
|
|
2113
|
-
/* @__PURE__ */ (0,
|
|
2114
|
-
/* @__PURE__ */ (0,
|
|
2256
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-4", children: [
|
|
2257
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "heading-lg", className: "text-dark", children: "Drag & drop files here" }),
|
|
2258
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "or click to browse from your computer" })
|
|
2115
2259
|
] }),
|
|
2116
|
-
/* @__PURE__ */ (0,
|
|
2260
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2117
2261
|
Button,
|
|
2118
2262
|
{
|
|
2119
2263
|
variant: "default",
|
|
@@ -2127,10 +2271,10 @@ var Upload = React14.forwardRef(
|
|
|
2127
2271
|
children: "Choose files"
|
|
2128
2272
|
}
|
|
2129
2273
|
),
|
|
2130
|
-
/* @__PURE__ */ (0,
|
|
2274
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
2131
2275
|
"Supported file: ",
|
|
2132
2276
|
getFileTypeDisplay(),
|
|
2133
|
-
/* @__PURE__ */ (0,
|
|
2277
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("br", {}),
|
|
2134
2278
|
"Max: ",
|
|
2135
2279
|
Math.round(maxFileSize / 1024 / 1024),
|
|
2136
2280
|
" MB each"
|
|
@@ -2140,7 +2284,7 @@ var Upload = React14.forwardRef(
|
|
|
2140
2284
|
);
|
|
2141
2285
|
}
|
|
2142
2286
|
};
|
|
2143
|
-
return /* @__PURE__ */ (0,
|
|
2287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2144
2288
|
"div",
|
|
2145
2289
|
{
|
|
2146
2290
|
ref,
|
|
@@ -2164,7 +2308,7 @@ var Upload = React14.forwardRef(
|
|
|
2164
2308
|
"aria-disabled": disabled,
|
|
2165
2309
|
...props,
|
|
2166
2310
|
children: [
|
|
2167
|
-
/* @__PURE__ */ (0,
|
|
2311
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2168
2312
|
"input",
|
|
2169
2313
|
{
|
|
2170
2314
|
ref: fileInputRef,
|
|
@@ -2184,29 +2328,75 @@ var Upload = React14.forwardRef(
|
|
|
2184
2328
|
Upload.displayName = "Upload";
|
|
2185
2329
|
|
|
2186
2330
|
// src/components/ui/checkbox.tsx
|
|
2187
|
-
var
|
|
2188
|
-
var
|
|
2331
|
+
var React16 = __toESM(require("react"));
|
|
2332
|
+
var import_checkbox = require("@base-ui/react/checkbox");
|
|
2189
2333
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
2190
|
-
var
|
|
2191
|
-
var checkboxVariants = (0, import_class_variance_authority8.cva)(
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2334
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2335
|
+
var checkboxVariants = (0, import_class_variance_authority8.cva)([
|
|
2336
|
+
// Base layout & appearance
|
|
2337
|
+
"peer group relative size-4 shrink-0",
|
|
2338
|
+
"rounded-xs border border-default surface-default shadow-xs",
|
|
2339
|
+
// Transitions & hover
|
|
2340
|
+
"transition-colors hover:brightness-[90%]",
|
|
2341
|
+
// Focus
|
|
2342
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-default",
|
|
2343
|
+
// Disabled
|
|
2344
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
|
2345
|
+
// Checked
|
|
2346
|
+
"data-[checked]:border-0 data-[checked]:focus-visible:border-0",
|
|
2347
|
+
"data-[checked]:interactive-accent data-[checked]:interactive-accent-fg",
|
|
2348
|
+
// Indeterminate
|
|
2349
|
+
"data-[indeterminate]:border-0 data-[indeterminate]:focus-visible:border-0",
|
|
2350
|
+
"data-[indeterminate]:interactive-accent data-[indeterminate]:interactive-accent-fg",
|
|
2351
|
+
// Error (aria-invalid) — only applies to unchecked/checked states.
|
|
2352
|
+
// Indeterminate has no error state per design.
|
|
2353
|
+
"aria-invalid:border-error",
|
|
2354
|
+
"aria-invalid:data-[checked]:border-0 aria-invalid:data-[checked]:interactive-destructive aria-invalid:data-[checked]:interactive-destructive-fg",
|
|
2355
|
+
"aria-invalid:focus-visible:ring-3 aria-invalid:focus-visible:ring-focus-error",
|
|
2356
|
+
// SVG children
|
|
2357
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
2358
|
+
]);
|
|
2359
|
+
var Checkbox = React16.forwardRef(({ className, ...props }, ref) => {
|
|
2360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2361
|
+
import_checkbox.Checkbox.Root,
|
|
2362
|
+
{
|
|
2363
|
+
"data-slot": "checkbox",
|
|
2364
|
+
ref,
|
|
2365
|
+
className: cn(checkboxVariants(), className),
|
|
2366
|
+
...props,
|
|
2367
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2368
|
+
import_checkbox.Checkbox.Indicator,
|
|
2369
|
+
{
|
|
2370
|
+
"data-slot": "checkbox-indicator",
|
|
2371
|
+
className: "absolute inset-0 flex items-center justify-center text-current",
|
|
2372
|
+
children: [
|
|
2373
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2374
|
+
CheckmarkIcon,
|
|
2375
|
+
{
|
|
2376
|
+
size: 14,
|
|
2377
|
+
className: "text-current hidden group-data-[checked]:block"
|
|
2378
|
+
}
|
|
2379
|
+
),
|
|
2380
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2381
|
+
MinusIcon,
|
|
2382
|
+
{
|
|
2383
|
+
size: 14,
|
|
2384
|
+
className: "text-current hidden group-data-[indeterminate]:block"
|
|
2385
|
+
}
|
|
2386
|
+
)
|
|
2387
|
+
]
|
|
2388
|
+
}
|
|
2389
|
+
)
|
|
2390
|
+
}
|
|
2391
|
+
);
|
|
2392
|
+
});
|
|
2393
|
+
Checkbox.displayName = "Checkbox";
|
|
2204
2394
|
|
|
2205
2395
|
// src/components/ui/switch.tsx
|
|
2206
|
-
var
|
|
2396
|
+
var React17 = __toESM(require("react"));
|
|
2207
2397
|
var import_switch = require("@base-ui/react/switch");
|
|
2208
2398
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
2209
|
-
var
|
|
2399
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2210
2400
|
var switchVariants = (0, import_class_variance_authority9.cva)(
|
|
2211
2401
|
"peer inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 relative focus-visible:ring-3 focus-visible:ring-focus-default aria-invalid:border-error aria-invalid:ring-3 aria-invalid:ring-focus-error data-checked:interactive-accent data-unchecked:interactive-secondary data-unchecked:border-default data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
2212
2402
|
{
|
|
@@ -2235,16 +2425,16 @@ var switchThumbVariants = (0, import_class_variance_authority9.cva)(
|
|
|
2235
2425
|
}
|
|
2236
2426
|
}
|
|
2237
2427
|
);
|
|
2238
|
-
var Switch =
|
|
2428
|
+
var Switch = React17.forwardRef(
|
|
2239
2429
|
({ className, size, ...props }, ref) => {
|
|
2240
|
-
return /* @__PURE__ */ (0,
|
|
2430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2241
2431
|
import_switch.Switch.Root,
|
|
2242
2432
|
{
|
|
2243
2433
|
ref,
|
|
2244
2434
|
"data-slot": "switch",
|
|
2245
2435
|
className: cn(switchVariants({ size }), className),
|
|
2246
2436
|
...props,
|
|
2247
|
-
children: /* @__PURE__ */ (0,
|
|
2437
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2248
2438
|
import_switch.Switch.Thumb,
|
|
2249
2439
|
{
|
|
2250
2440
|
"data-slot": "switch-thumb",
|
|
@@ -2258,11 +2448,11 @@ var Switch = React16.forwardRef(
|
|
|
2258
2448
|
Switch.displayName = "Switch";
|
|
2259
2449
|
|
|
2260
2450
|
// src/components/ui/textarea.tsx
|
|
2261
|
-
var
|
|
2262
|
-
var
|
|
2263
|
-
var Textarea =
|
|
2451
|
+
var React18 = __toESM(require("react"));
|
|
2452
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2453
|
+
var Textarea = React18.forwardRef(
|
|
2264
2454
|
({ className, style, ...props }, ref) => {
|
|
2265
|
-
return /* @__PURE__ */ (0,
|
|
2455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2266
2456
|
"textarea",
|
|
2267
2457
|
{
|
|
2268
2458
|
className: cn(
|
|
@@ -2279,9 +2469,9 @@ var Textarea = React17.forwardRef(
|
|
|
2279
2469
|
Textarea.displayName = "Textarea";
|
|
2280
2470
|
|
|
2281
2471
|
// src/components/ui/badge.tsx
|
|
2282
|
-
var
|
|
2472
|
+
var React19 = __toESM(require("react"));
|
|
2283
2473
|
var import_class_variance_authority10 = require("class-variance-authority");
|
|
2284
|
-
var
|
|
2474
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2285
2475
|
var badgeVariants = (0, import_class_variance_authority10.cva)(
|
|
2286
2476
|
"px-2 py-1 inline-flex items-center justify-center gap-1 whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-default",
|
|
2287
2477
|
{
|
|
@@ -2315,20 +2505,20 @@ function isSingleDisplayCharacter(node) {
|
|
|
2315
2505
|
if (parts.length !== 1) return false;
|
|
2316
2506
|
return isSingleDisplayCharacter(parts[0]);
|
|
2317
2507
|
}
|
|
2318
|
-
if (
|
|
2508
|
+
if (React19.isValidElement(node)) {
|
|
2319
2509
|
return isSingleDisplayCharacter(
|
|
2320
2510
|
node.props.children
|
|
2321
2511
|
);
|
|
2322
2512
|
}
|
|
2323
2513
|
return false;
|
|
2324
2514
|
}
|
|
2325
|
-
var Badge =
|
|
2515
|
+
var Badge = React19.forwardRef(
|
|
2326
2516
|
({ className, variant, rounded, style, children, ...props }, ref) => {
|
|
2327
2517
|
if (!variant) {
|
|
2328
2518
|
return null;
|
|
2329
2519
|
}
|
|
2330
2520
|
const circle = isSingleDisplayCharacter(children);
|
|
2331
|
-
return /* @__PURE__ */ (0,
|
|
2521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2332
2522
|
"span",
|
|
2333
2523
|
{
|
|
2334
2524
|
className: cn(
|
|
@@ -2346,13 +2536,218 @@ var Badge = React18.forwardRef(
|
|
|
2346
2536
|
);
|
|
2347
2537
|
Badge.displayName = "Badge";
|
|
2348
2538
|
|
|
2539
|
+
// src/components/ui/item.tsx
|
|
2540
|
+
var React20 = __toESM(require("react"));
|
|
2541
|
+
var import_merge_props2 = require("@base-ui/react/merge-props");
|
|
2542
|
+
var import_use_render2 = require("@base-ui/react/use-render");
|
|
2543
|
+
var import_class_variance_authority11 = require("class-variance-authority");
|
|
2544
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2545
|
+
var ItemGroupContext = React20.createContext(false);
|
|
2546
|
+
var ItemGroup = React20.forwardRef(
|
|
2547
|
+
({ className, ...props }, ref) => {
|
|
2548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemGroupContext.Provider, { value: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2549
|
+
"div",
|
|
2550
|
+
{
|
|
2551
|
+
ref,
|
|
2552
|
+
role: "list",
|
|
2553
|
+
"data-slot": "item-group",
|
|
2554
|
+
className: cn(
|
|
2555
|
+
"gap-4 has-data-[size=sm]:gap-2.5 group/item-group flex w-full flex-col",
|
|
2556
|
+
className
|
|
2557
|
+
),
|
|
2558
|
+
...props
|
|
2559
|
+
}
|
|
2560
|
+
) });
|
|
2561
|
+
}
|
|
2562
|
+
);
|
|
2563
|
+
var ItemSeparator = React20.forwardRef(({ className, ...props }, ref) => {
|
|
2564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2565
|
+
Separator2,
|
|
2566
|
+
{
|
|
2567
|
+
ref,
|
|
2568
|
+
"data-slot": "item-separator",
|
|
2569
|
+
orientation: "horizontal",
|
|
2570
|
+
className: cn("my-2", className),
|
|
2571
|
+
...props
|
|
2572
|
+
}
|
|
2573
|
+
);
|
|
2574
|
+
});
|
|
2575
|
+
var itemVariants = (0, import_class_variance_authority11.cva)(
|
|
2576
|
+
"surface-default rounded-md border group/item flex w-full flex-wrap transition-colors duration-100 outline-none [a]:relative [a]:isolate [a]:after:absolute [a]:after:inset-0 [a]:after:rounded-[inherit] [a]:after:-z-10 [a]:after:pointer-events-none [a]:after:transition-colors",
|
|
2577
|
+
{
|
|
2578
|
+
variants: {
|
|
2579
|
+
variant: {
|
|
2580
|
+
default: "border-transparent [a]:hover:after:bg-black/10",
|
|
2581
|
+
outline: "border-default [a]:hover:after:bg-black/10",
|
|
2582
|
+
muted: "surface-secondary border-transparent"
|
|
2583
|
+
},
|
|
2584
|
+
size: {
|
|
2585
|
+
default: "items-start gap-4 p-4",
|
|
2586
|
+
sm: "items-center gap-2 px-4 py-3"
|
|
2587
|
+
}
|
|
2588
|
+
},
|
|
2589
|
+
defaultVariants: {
|
|
2590
|
+
variant: "default",
|
|
2591
|
+
size: "default"
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
);
|
|
2595
|
+
var Item2 = ({
|
|
2596
|
+
className,
|
|
2597
|
+
variant = "default",
|
|
2598
|
+
size = "default",
|
|
2599
|
+
render,
|
|
2600
|
+
...props
|
|
2601
|
+
}) => {
|
|
2602
|
+
const insideGroup = React20.useContext(ItemGroupContext);
|
|
2603
|
+
return (0, import_use_render2.useRender)({
|
|
2604
|
+
defaultTagName: "div",
|
|
2605
|
+
props: (0, import_merge_props2.mergeProps)(
|
|
2606
|
+
{
|
|
2607
|
+
role: insideGroup ? "listitem" : void 0,
|
|
2608
|
+
className: cn(itemVariants({ variant, size, className }))
|
|
2609
|
+
},
|
|
2610
|
+
props
|
|
2611
|
+
),
|
|
2612
|
+
render,
|
|
2613
|
+
state: {
|
|
2614
|
+
slot: "item",
|
|
2615
|
+
variant,
|
|
2616
|
+
size
|
|
2617
|
+
}
|
|
2618
|
+
});
|
|
2619
|
+
};
|
|
2620
|
+
var itemMediaVariants = (0, import_class_variance_authority11.cva)(
|
|
2621
|
+
"gap-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none",
|
|
2622
|
+
{
|
|
2623
|
+
variants: {
|
|
2624
|
+
variant: {
|
|
2625
|
+
default: "bg-transparent",
|
|
2626
|
+
icon: "[&_svg:not([class*='size-'])]:size-5",
|
|
2627
|
+
iconBadge: "size-8 overflow-hidden rounded bg-surface-secondary p-2 [&_svg:not([class*='size-'])]:size-4",
|
|
2628
|
+
image: "size-10 overflow-hidden rounded-md group-data-[size=sm]/item:size-8 [&_img]:size-full [&_img]:object-cover"
|
|
2629
|
+
}
|
|
2630
|
+
},
|
|
2631
|
+
defaultVariants: {
|
|
2632
|
+
variant: "default"
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
);
|
|
2636
|
+
var ItemMedia = React20.forwardRef(
|
|
2637
|
+
({ className, variant = "default", ...props }, ref) => {
|
|
2638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2639
|
+
"div",
|
|
2640
|
+
{
|
|
2641
|
+
ref,
|
|
2642
|
+
"data-slot": "item-media",
|
|
2643
|
+
"data-variant": variant,
|
|
2644
|
+
className: cn(itemMediaVariants({ variant, className })),
|
|
2645
|
+
...props
|
|
2646
|
+
}
|
|
2647
|
+
);
|
|
2648
|
+
}
|
|
2649
|
+
);
|
|
2650
|
+
var ItemContent = React20.forwardRef(({ className, ...props }, ref) => {
|
|
2651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2652
|
+
"div",
|
|
2653
|
+
{
|
|
2654
|
+
ref,
|
|
2655
|
+
"data-slot": "item-content",
|
|
2656
|
+
className: cn(
|
|
2657
|
+
"gap-1 group-data-[size=sm]/item:gap-0 flex flex-1 flex-col [&+[data-slot=item-content]]:flex-none",
|
|
2658
|
+
className
|
|
2659
|
+
),
|
|
2660
|
+
...props
|
|
2661
|
+
}
|
|
2662
|
+
);
|
|
2663
|
+
});
|
|
2664
|
+
var ItemTitle = React20.forwardRef(
|
|
2665
|
+
({ className, ...props }, ref) => {
|
|
2666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2667
|
+
"div",
|
|
2668
|
+
{
|
|
2669
|
+
ref,
|
|
2670
|
+
"data-slot": "item-title",
|
|
2671
|
+
className: cn(
|
|
2672
|
+
"type-label-sm-medium gap-2 text-default underline-offset-4 line-clamp-1 flex w-full items-center",
|
|
2673
|
+
className
|
|
2674
|
+
),
|
|
2675
|
+
...props
|
|
2676
|
+
}
|
|
2677
|
+
);
|
|
2678
|
+
}
|
|
2679
|
+
);
|
|
2680
|
+
var ItemDescription = React20.forwardRef(({ className, ...props }, ref) => {
|
|
2681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2682
|
+
"p",
|
|
2683
|
+
{
|
|
2684
|
+
ref,
|
|
2685
|
+
"data-slot": "item-description",
|
|
2686
|
+
className: cn(
|
|
2687
|
+
"type-body-sm-regular text-secondary text-left line-clamp-2 [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
2688
|
+
className
|
|
2689
|
+
),
|
|
2690
|
+
...props
|
|
2691
|
+
}
|
|
2692
|
+
);
|
|
2693
|
+
});
|
|
2694
|
+
var ItemActions = React20.forwardRef(({ className, ...props }, ref) => {
|
|
2695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2696
|
+
"div",
|
|
2697
|
+
{
|
|
2698
|
+
ref,
|
|
2699
|
+
"data-slot": "item-actions",
|
|
2700
|
+
className: cn("gap-2 flex items-center", className),
|
|
2701
|
+
...props
|
|
2702
|
+
}
|
|
2703
|
+
);
|
|
2704
|
+
});
|
|
2705
|
+
var ItemHeader = React20.forwardRef(({ className, ...props }, ref) => {
|
|
2706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2707
|
+
"div",
|
|
2708
|
+
{
|
|
2709
|
+
ref,
|
|
2710
|
+
"data-slot": "item-header",
|
|
2711
|
+
className: cn(
|
|
2712
|
+
"gap-2 flex basis-full items-center justify-between",
|
|
2713
|
+
className
|
|
2714
|
+
),
|
|
2715
|
+
...props
|
|
2716
|
+
}
|
|
2717
|
+
);
|
|
2718
|
+
});
|
|
2719
|
+
var ItemFooter = React20.forwardRef(({ className, ...props }, ref) => {
|
|
2720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2721
|
+
"div",
|
|
2722
|
+
{
|
|
2723
|
+
ref,
|
|
2724
|
+
"data-slot": "item-footer",
|
|
2725
|
+
className: cn(
|
|
2726
|
+
"gap-2 flex basis-full items-center justify-between",
|
|
2727
|
+
className
|
|
2728
|
+
),
|
|
2729
|
+
...props
|
|
2730
|
+
}
|
|
2731
|
+
);
|
|
2732
|
+
});
|
|
2733
|
+
Item2.displayName = "Item";
|
|
2734
|
+
ItemMedia.displayName = "ItemMedia";
|
|
2735
|
+
ItemGroup.displayName = "ItemGroup";
|
|
2736
|
+
ItemSeparator.displayName = "ItemSeparator";
|
|
2737
|
+
ItemContent.displayName = "ItemContent";
|
|
2738
|
+
ItemTitle.displayName = "ItemTitle";
|
|
2739
|
+
ItemDescription.displayName = "ItemDescription";
|
|
2740
|
+
ItemActions.displayName = "ItemActions";
|
|
2741
|
+
ItemHeader.displayName = "ItemHeader";
|
|
2742
|
+
ItemFooter.displayName = "ItemFooter";
|
|
2743
|
+
|
|
2349
2744
|
// src/components/pdf-viewer/index.tsx
|
|
2350
|
-
var
|
|
2745
|
+
var React30 = __toESM(require("react"));
|
|
2351
2746
|
var import_TextLayer = require("react-pdf/dist/Page/TextLayer.css");
|
|
2352
2747
|
|
|
2353
2748
|
// src/components/pdf-viewer/components/CustomScrollbar.tsx
|
|
2354
|
-
var
|
|
2355
|
-
var
|
|
2749
|
+
var React21 = __toESM(require("react"));
|
|
2750
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2356
2751
|
var scrollbarStyles = `
|
|
2357
2752
|
.custom-scrollbar-content {
|
|
2358
2753
|
overflow: auto;
|
|
@@ -2420,15 +2815,15 @@ function CustomScrollbar({
|
|
|
2420
2815
|
backgroundColor = "#F5F5F5",
|
|
2421
2816
|
className
|
|
2422
2817
|
}) {
|
|
2423
|
-
const internalContainerRef =
|
|
2818
|
+
const internalContainerRef = React21.useRef(null);
|
|
2424
2819
|
const containerRef = externalContainerRef || internalContainerRef;
|
|
2425
|
-
const wrapperRef =
|
|
2426
|
-
const thumbVerticalRef =
|
|
2427
|
-
const thumbHorizontalRef =
|
|
2428
|
-
const lastScrollPosRef =
|
|
2429
|
-
const scrollTimeoutsRef =
|
|
2820
|
+
const wrapperRef = React21.useRef(null);
|
|
2821
|
+
const thumbVerticalRef = React21.useRef(null);
|
|
2822
|
+
const thumbHorizontalRef = React21.useRef(null);
|
|
2823
|
+
const lastScrollPosRef = React21.useRef({ top: 0, left: 0 });
|
|
2824
|
+
const scrollTimeoutsRef = React21.useRef({ vertical: null, horizontal: null });
|
|
2430
2825
|
const WHEEL_LINE_HEIGHT_PX = 16;
|
|
2431
|
-
const showScrollbar =
|
|
2826
|
+
const showScrollbar = React21.useCallback(
|
|
2432
2827
|
(direction) => {
|
|
2433
2828
|
const wrapper = wrapperRef.current;
|
|
2434
2829
|
if (!wrapper) return;
|
|
@@ -2442,7 +2837,7 @@ function CustomScrollbar({
|
|
|
2442
2837
|
},
|
|
2443
2838
|
[autoHideDelay]
|
|
2444
2839
|
);
|
|
2445
|
-
const updateScrollbarThumbPosition =
|
|
2840
|
+
const updateScrollbarThumbPosition = React21.useCallback(() => {
|
|
2446
2841
|
const container = containerRef.current;
|
|
2447
2842
|
const thumbVertical = thumbVerticalRef.current;
|
|
2448
2843
|
const thumbHorizontal = thumbHorizontalRef.current;
|
|
@@ -2480,7 +2875,7 @@ function CustomScrollbar({
|
|
|
2480
2875
|
}
|
|
2481
2876
|
}
|
|
2482
2877
|
}, [containerRef]);
|
|
2483
|
-
|
|
2878
|
+
React21.useEffect(() => {
|
|
2484
2879
|
const container = containerRef.current;
|
|
2485
2880
|
if (!container) return;
|
|
2486
2881
|
lastScrollPosRef.current = {
|
|
@@ -2513,7 +2908,7 @@ function CustomScrollbar({
|
|
|
2513
2908
|
if (rafId) cancelAnimationFrame(rafId);
|
|
2514
2909
|
};
|
|
2515
2910
|
}, [containerRef, showScrollbar, updateScrollbarThumbPosition]);
|
|
2516
|
-
|
|
2911
|
+
React21.useEffect(() => {
|
|
2517
2912
|
const container = containerRef.current;
|
|
2518
2913
|
if (!container) return;
|
|
2519
2914
|
const normalizeWheelDelta = (delta, deltaMode, axisSize) => {
|
|
@@ -2569,7 +2964,7 @@ function CustomScrollbar({
|
|
|
2569
2964
|
container.removeEventListener("wheel", handleWheel);
|
|
2570
2965
|
};
|
|
2571
2966
|
}, [containerRef, showScrollbar]);
|
|
2572
|
-
|
|
2967
|
+
React21.useEffect(() => {
|
|
2573
2968
|
const thumbVertical = thumbVerticalRef.current;
|
|
2574
2969
|
const thumbHorizontal = thumbHorizontalRef.current;
|
|
2575
2970
|
const container = containerRef.current;
|
|
@@ -2629,19 +3024,19 @@ function CustomScrollbar({
|
|
|
2629
3024
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
2630
3025
|
};
|
|
2631
3026
|
}, [containerRef, showScrollbar]);
|
|
2632
|
-
|
|
3027
|
+
React21.useEffect(() => {
|
|
2633
3028
|
updateScrollbarThumbPosition();
|
|
2634
3029
|
}, [children, updateScrollbarThumbPosition]);
|
|
2635
|
-
return /* @__PURE__ */ (0,
|
|
2636
|
-
/* @__PURE__ */ (0,
|
|
2637
|
-
/* @__PURE__ */ (0,
|
|
3030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
3031
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("style", { children: scrollbarStyles }),
|
|
3032
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2638
3033
|
"div",
|
|
2639
3034
|
{
|
|
2640
3035
|
ref: wrapperRef,
|
|
2641
3036
|
className: `flex-1 min-w-0 custom-scrollbar-wrapper ${className || ""}`,
|
|
2642
3037
|
style: { background: backgroundColor },
|
|
2643
3038
|
children: [
|
|
2644
|
-
/* @__PURE__ */ (0,
|
|
3039
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2645
3040
|
"div",
|
|
2646
3041
|
{
|
|
2647
3042
|
ref: containerRef,
|
|
@@ -2650,8 +3045,8 @@ function CustomScrollbar({
|
|
|
2650
3045
|
children
|
|
2651
3046
|
}
|
|
2652
3047
|
),
|
|
2653
|
-
/* @__PURE__ */ (0,
|
|
2654
|
-
/* @__PURE__ */ (0,
|
|
3048
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "scrollbar-track-vertical", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ref: thumbVerticalRef, className: "scrollbar-thumb-vertical" }) }),
|
|
3049
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "scrollbar-track-horizontal", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2655
3050
|
"div",
|
|
2656
3051
|
{
|
|
2657
3052
|
ref: thumbHorizontalRef,
|
|
@@ -2665,7 +3060,7 @@ function CustomScrollbar({
|
|
|
2665
3060
|
}
|
|
2666
3061
|
|
|
2667
3062
|
// src/components/pdf-viewer/components/PdfControls.tsx
|
|
2668
|
-
var
|
|
3063
|
+
var React22 = __toESM(require("react"));
|
|
2669
3064
|
|
|
2670
3065
|
// src/components/pdf-viewer/utils/types.ts
|
|
2671
3066
|
var DEFAULT_BOUNDING_BOX_STYLE = {
|
|
@@ -2681,7 +3076,7 @@ var PDF_ZOOM = {
|
|
|
2681
3076
|
};
|
|
2682
3077
|
|
|
2683
3078
|
// src/components/pdf-viewer/components/PdfControls.tsx
|
|
2684
|
-
var
|
|
3079
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2685
3080
|
var PdfControls = ({
|
|
2686
3081
|
currentPage,
|
|
2687
3082
|
totalPages,
|
|
@@ -2695,11 +3090,11 @@ var PdfControls = ({
|
|
|
2695
3090
|
const canGoNext = currentPage < totalPages;
|
|
2696
3091
|
const canZoomIn = zoom < PDF_ZOOM.MAX;
|
|
2697
3092
|
const canZoomOut = zoom > PDF_ZOOM.MIN;
|
|
2698
|
-
const [pageInputValue, setPageInputValue] =
|
|
3093
|
+
const [pageInputValue, setPageInputValue] = React22.useState(
|
|
2699
3094
|
String(currentPage)
|
|
2700
3095
|
);
|
|
2701
|
-
const isEscapeRef =
|
|
2702
|
-
|
|
3096
|
+
const isEscapeRef = React22.useRef(false);
|
|
3097
|
+
React22.useEffect(() => {
|
|
2703
3098
|
setPageInputValue(String(currentPage));
|
|
2704
3099
|
}, [currentPage]);
|
|
2705
3100
|
const handlePageInputChange = (e) => {
|
|
@@ -2735,14 +3130,14 @@ var PdfControls = ({
|
|
|
2735
3130
|
const newZoom = Math.max(zoom - PDF_ZOOM.STEP, PDF_ZOOM.MIN);
|
|
2736
3131
|
onZoomChange(newZoom);
|
|
2737
3132
|
};
|
|
2738
|
-
return /* @__PURE__ */ (0,
|
|
3133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2739
3134
|
"div",
|
|
2740
3135
|
{
|
|
2741
3136
|
className: "flex flex-col items-center justify-end py-2 px-1 gap-4",
|
|
2742
3137
|
style: { background: "#DEDEDE" },
|
|
2743
3138
|
children: [
|
|
2744
|
-
/* @__PURE__ */ (0,
|
|
2745
|
-
/* @__PURE__ */ (0,
|
|
3139
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col items-center gap-1", children: [
|
|
3140
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2746
3141
|
"button",
|
|
2747
3142
|
{
|
|
2748
3143
|
onClick: onPreviousPage,
|
|
@@ -2750,10 +3145,10 @@ var PdfControls = ({
|
|
|
2750
3145
|
className: "p-1.5 rounded transition-colors hover:bg-neutral-400 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
2751
3146
|
"aria-label": "Previous page",
|
|
2752
3147
|
type: "button",
|
|
2753
|
-
children: /* @__PURE__ */ (0,
|
|
3148
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CaretUpIcon, { size: 16, style: { color: "#666666" } })
|
|
2754
3149
|
}
|
|
2755
3150
|
),
|
|
2756
|
-
/* @__PURE__ */ (0,
|
|
3151
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex flex-col items-center", children: totalPages > 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2757
3152
|
"input",
|
|
2758
3153
|
{
|
|
2759
3154
|
type: "text",
|
|
@@ -2769,8 +3164,8 @@ var PdfControls = ({
|
|
|
2769
3164
|
},
|
|
2770
3165
|
"aria-label": "Current page"
|
|
2771
3166
|
}
|
|
2772
|
-
) : /* @__PURE__ */ (0,
|
|
2773
|
-
/* @__PURE__ */ (0,
|
|
3167
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-sm", style: { color: "#666666" }, children: "-" }) }),
|
|
3168
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2774
3169
|
"button",
|
|
2775
3170
|
{
|
|
2776
3171
|
onClick: onNextPage,
|
|
@@ -2778,12 +3173,12 @@ var PdfControls = ({
|
|
|
2778
3173
|
className: "p-1.5 rounded transition-colors hover:bg-neutral-400 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
2779
3174
|
"aria-label": "Next page",
|
|
2780
3175
|
type: "button",
|
|
2781
|
-
children: /* @__PURE__ */ (0,
|
|
3176
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CaretDownIcon, { size: 16, style: { color: "#666666" } })
|
|
2782
3177
|
}
|
|
2783
3178
|
)
|
|
2784
3179
|
] }),
|
|
2785
|
-
/* @__PURE__ */ (0,
|
|
2786
|
-
/* @__PURE__ */ (0,
|
|
3180
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col items-center gap-1", children: [
|
|
3181
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2787
3182
|
"button",
|
|
2788
3183
|
{
|
|
2789
3184
|
onClick: handleZoomIn,
|
|
@@ -2791,10 +3186,10 @@ var PdfControls = ({
|
|
|
2791
3186
|
className: "p-1.5 rounded transition-colors hover:bg-neutral-400 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
2792
3187
|
"aria-label": "Zoom in",
|
|
2793
3188
|
type: "button",
|
|
2794
|
-
children: /* @__PURE__ */ (0,
|
|
3189
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ZoomInIcon, { size: 16, style: { color: "#666666" } })
|
|
2795
3190
|
}
|
|
2796
3191
|
),
|
|
2797
|
-
/* @__PURE__ */ (0,
|
|
3192
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2798
3193
|
"button",
|
|
2799
3194
|
{
|
|
2800
3195
|
onClick: handleZoomOut,
|
|
@@ -2802,7 +3197,7 @@ var PdfControls = ({
|
|
|
2802
3197
|
className: "p-1.5 rounded transition-colors hover:bg-neutral-400 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
2803
3198
|
"aria-label": "Zoom out",
|
|
2804
3199
|
type: "button",
|
|
2805
|
-
children: /* @__PURE__ */ (0,
|
|
3200
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ZoomOutIcon, { size: 16, style: { color: "#666666" } })
|
|
2806
3201
|
}
|
|
2807
3202
|
)
|
|
2808
3203
|
] })
|
|
@@ -2813,7 +3208,7 @@ var PdfControls = ({
|
|
|
2813
3208
|
PdfControls.displayName = "PdfControls";
|
|
2814
3209
|
|
|
2815
3210
|
// src/components/pdf-viewer/components/PdfDocument.tsx
|
|
2816
|
-
var
|
|
3211
|
+
var React24 = __toESM(require("react"));
|
|
2817
3212
|
var import_react_pdf = require("react-pdf");
|
|
2818
3213
|
|
|
2819
3214
|
// src/components/pdf-viewer/utils/constants.ts
|
|
@@ -2839,7 +3234,7 @@ var INTERSECTION_OBSERVER_CONFIG = {
|
|
|
2839
3234
|
};
|
|
2840
3235
|
|
|
2841
3236
|
// src/components/pdf-viewer/components/BoundingBoxOverlay.tsx
|
|
2842
|
-
var
|
|
3237
|
+
var React23 = __toESM(require("react"));
|
|
2843
3238
|
|
|
2844
3239
|
// src/components/pdf-viewer/utils/boundingBoxUtils.ts
|
|
2845
3240
|
function clamp01(value) {
|
|
@@ -2866,7 +3261,7 @@ function normalizeBoundingBox(box) {
|
|
|
2866
3261
|
}
|
|
2867
3262
|
|
|
2868
3263
|
// src/components/pdf-viewer/components/BoundingBoxOverlay.tsx
|
|
2869
|
-
var
|
|
3264
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2870
3265
|
var BoundingBoxOverlayInner = ({
|
|
2871
3266
|
boxes,
|
|
2872
3267
|
highlightedIds,
|
|
@@ -2876,11 +3271,11 @@ var BoundingBoxOverlayInner = ({
|
|
|
2876
3271
|
onBoxMouseEnter,
|
|
2877
3272
|
onBoxMouseLeave
|
|
2878
3273
|
}) => {
|
|
2879
|
-
const validBoxes =
|
|
3274
|
+
const validBoxes = React23.useMemo(
|
|
2880
3275
|
() => boxes.map(normalizeBoundingBox).filter((b) => b !== null),
|
|
2881
3276
|
[boxes]
|
|
2882
3277
|
);
|
|
2883
|
-
const sortedBoxes =
|
|
3278
|
+
const sortedBoxes = React23.useMemo(
|
|
2884
3279
|
() => [...validBoxes].sort((a, b) => {
|
|
2885
3280
|
const aHighlighted = highlightedIds.has(a.id);
|
|
2886
3281
|
const bHighlighted = highlightedIds.has(b.id);
|
|
@@ -2891,7 +3286,7 @@ var BoundingBoxOverlayInner = ({
|
|
|
2891
3286
|
[validBoxes, highlightedIds]
|
|
2892
3287
|
);
|
|
2893
3288
|
if (sortedBoxes.length === 0) return null;
|
|
2894
|
-
return /* @__PURE__ */ (0,
|
|
3289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2895
3290
|
"svg",
|
|
2896
3291
|
{
|
|
2897
3292
|
viewBox: "0 0 1 1",
|
|
@@ -2911,7 +3306,7 @@ var BoundingBoxOverlayInner = ({
|
|
|
2911
3306
|
const baseStyle = isHighlighted ? { ...DEFAULT_BOUNDING_BOX_STYLE, ...highlightStyle } : { ...DEFAULT_BOUNDING_BOX_STYLE, ...defaultStyle };
|
|
2912
3307
|
const style = { ...baseStyle, ...box.style };
|
|
2913
3308
|
const isInteractive = !!(onBoxClick || onBoxMouseEnter);
|
|
2914
|
-
return /* @__PURE__ */ (0,
|
|
3309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2915
3310
|
"rect",
|
|
2916
3311
|
{
|
|
2917
3312
|
x: box.x1,
|
|
@@ -2931,7 +3326,7 @@ var BoundingBoxOverlayInner = ({
|
|
|
2931
3326
|
onMouseLeave: onBoxMouseLeave ? (e) => onBoxMouseLeave(box, e) : void 0,
|
|
2932
3327
|
"aria-label": box.label,
|
|
2933
3328
|
role: onBoxClick ? "button" : void 0,
|
|
2934
|
-
children: box.label && /* @__PURE__ */ (0,
|
|
3329
|
+
children: box.label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("title", { children: box.label })
|
|
2935
3330
|
},
|
|
2936
3331
|
box.id
|
|
2937
3332
|
);
|
|
@@ -2939,11 +3334,11 @@ var BoundingBoxOverlayInner = ({
|
|
|
2939
3334
|
}
|
|
2940
3335
|
);
|
|
2941
3336
|
};
|
|
2942
|
-
var BoundingBoxOverlay =
|
|
3337
|
+
var BoundingBoxOverlay = React23.memo(BoundingBoxOverlayInner);
|
|
2943
3338
|
BoundingBoxOverlay.displayName = "BoundingBoxOverlay";
|
|
2944
3339
|
|
|
2945
3340
|
// src/components/pdf-viewer/components/PdfDocument.tsx
|
|
2946
|
-
var
|
|
3341
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2947
3342
|
var PdfDocument = ({
|
|
2948
3343
|
file,
|
|
2949
3344
|
pageWidth,
|
|
@@ -2965,14 +3360,14 @@ var PdfDocument = ({
|
|
|
2965
3360
|
onBoxMouseEnter,
|
|
2966
3361
|
onBoxMouseLeave
|
|
2967
3362
|
}) => {
|
|
2968
|
-
const mountedRef =
|
|
2969
|
-
|
|
3363
|
+
const mountedRef = React24.useRef(true);
|
|
3364
|
+
React24.useEffect(() => {
|
|
2970
3365
|
mountedRef.current = true;
|
|
2971
3366
|
return () => {
|
|
2972
3367
|
mountedRef.current = false;
|
|
2973
3368
|
};
|
|
2974
3369
|
}, []);
|
|
2975
|
-
const boxesByPage =
|
|
3370
|
+
const boxesByPage = React24.useMemo(() => {
|
|
2976
3371
|
const map = /* @__PURE__ */ new Map();
|
|
2977
3372
|
boundingBoxes?.forEach((box) => {
|
|
2978
3373
|
const pageBoxes = map.get(box.page) || [];
|
|
@@ -2981,7 +3376,7 @@ var PdfDocument = ({
|
|
|
2981
3376
|
});
|
|
2982
3377
|
return map;
|
|
2983
3378
|
}, [boundingBoxes]);
|
|
2984
|
-
const highlightedIdsSet =
|
|
3379
|
+
const highlightedIdsSet = React24.useMemo(
|
|
2985
3380
|
() => new Set(highlightedBoxIds),
|
|
2986
3381
|
[highlightedBoxIds]
|
|
2987
3382
|
);
|
|
@@ -3020,14 +3415,14 @@ var PdfDocument = ({
|
|
|
3020
3415
|
function renderCurrentPage() {
|
|
3021
3416
|
const placeholderHeight = getPlaceholderHeight(currentPage);
|
|
3022
3417
|
const boxesForPage = boxesByPage.get(currentPage) ?? [];
|
|
3023
|
-
return /* @__PURE__ */ (0,
|
|
3418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3024
3419
|
"div",
|
|
3025
3420
|
{
|
|
3026
3421
|
ref: (el) => registerPageRef(currentPage, el),
|
|
3027
3422
|
"data-page-num": currentPage,
|
|
3028
3423
|
className: "flex justify-center",
|
|
3029
|
-
children: /* @__PURE__ */ (0,
|
|
3030
|
-
/* @__PURE__ */ (0,
|
|
3424
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { position: "relative" }, children: [
|
|
3425
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3031
3426
|
import_react_pdf.Page,
|
|
3032
3427
|
{
|
|
3033
3428
|
pageNumber: currentPage,
|
|
@@ -3035,12 +3430,12 @@ var PdfDocument = ({
|
|
|
3035
3430
|
className: "shadow-sm",
|
|
3036
3431
|
renderTextLayer: enableTextLayer,
|
|
3037
3432
|
renderAnnotationLayer: false,
|
|
3038
|
-
loading: /* @__PURE__ */ (0,
|
|
3433
|
+
loading: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3039
3434
|
"div",
|
|
3040
3435
|
{
|
|
3041
3436
|
className: "flex items-center justify-center bg-white",
|
|
3042
3437
|
style: { width: pageWidth, height: placeholderHeight },
|
|
3043
|
-
children: /* @__PURE__ */ (0,
|
|
3438
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
3044
3439
|
"Loading page ",
|
|
3045
3440
|
currentPage,
|
|
3046
3441
|
"..."
|
|
@@ -3049,7 +3444,7 @@ var PdfDocument = ({
|
|
|
3049
3444
|
)
|
|
3050
3445
|
}
|
|
3051
3446
|
),
|
|
3052
|
-
/* @__PURE__ */ (0,
|
|
3447
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3053
3448
|
BoundingBoxOverlay,
|
|
3054
3449
|
{
|
|
3055
3450
|
boxes: boxesForPage,
|
|
@@ -3072,7 +3467,7 @@ var PdfDocument = ({
|
|
|
3072
3467
|
const shouldRender = visiblePages.has(pageNum);
|
|
3073
3468
|
const placeholderHeight = getPlaceholderHeight(pageNum);
|
|
3074
3469
|
const boxesForPage = boxesByPage.get(pageNum) ?? [];
|
|
3075
|
-
return /* @__PURE__ */ (0,
|
|
3470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3076
3471
|
"div",
|
|
3077
3472
|
{
|
|
3078
3473
|
ref: (el) => registerPageRef(pageNum, el),
|
|
@@ -3081,8 +3476,8 @@ var PdfDocument = ({
|
|
|
3081
3476
|
style: {
|
|
3082
3477
|
minHeight: shouldRender ? void 0 : placeholderHeight
|
|
3083
3478
|
},
|
|
3084
|
-
children: shouldRender ? /* @__PURE__ */ (0,
|
|
3085
|
-
/* @__PURE__ */ (0,
|
|
3479
|
+
children: shouldRender ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { position: "relative" }, children: [
|
|
3480
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3086
3481
|
import_react_pdf.Page,
|
|
3087
3482
|
{
|
|
3088
3483
|
pageNumber: pageNum,
|
|
@@ -3090,12 +3485,12 @@ var PdfDocument = ({
|
|
|
3090
3485
|
className: "shadow-sm",
|
|
3091
3486
|
renderTextLayer: enableTextLayer,
|
|
3092
3487
|
renderAnnotationLayer: false,
|
|
3093
|
-
loading: /* @__PURE__ */ (0,
|
|
3488
|
+
loading: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3094
3489
|
"div",
|
|
3095
3490
|
{
|
|
3096
3491
|
className: "flex items-center justify-center bg-white",
|
|
3097
3492
|
style: { width: pageWidth, height: placeholderHeight },
|
|
3098
|
-
children: /* @__PURE__ */ (0,
|
|
3493
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
3099
3494
|
"Loading page ",
|
|
3100
3495
|
pageNum,
|
|
3101
3496
|
"..."
|
|
@@ -3104,7 +3499,7 @@ var PdfDocument = ({
|
|
|
3104
3499
|
)
|
|
3105
3500
|
}
|
|
3106
3501
|
),
|
|
3107
|
-
/* @__PURE__ */ (0,
|
|
3502
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3108
3503
|
BoundingBoxOverlay,
|
|
3109
3504
|
{
|
|
3110
3505
|
boxes: boxesForPage,
|
|
@@ -3116,7 +3511,7 @@ var PdfDocument = ({
|
|
|
3116
3511
|
onBoxMouseLeave
|
|
3117
3512
|
}
|
|
3118
3513
|
)
|
|
3119
|
-
] }) : /* @__PURE__ */ (0,
|
|
3514
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3120
3515
|
"div",
|
|
3121
3516
|
{
|
|
3122
3517
|
className: "flex items-center justify-center bg-white shadow-sm",
|
|
@@ -3124,7 +3519,7 @@ var PdfDocument = ({
|
|
|
3124
3519
|
width: pageWidth,
|
|
3125
3520
|
height: placeholderHeight
|
|
3126
3521
|
},
|
|
3127
|
-
children: /* @__PURE__ */ (0,
|
|
3522
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
3128
3523
|
"Page ",
|
|
3129
3524
|
pageNum
|
|
3130
3525
|
] })
|
|
@@ -3136,16 +3531,16 @@ var PdfDocument = ({
|
|
|
3136
3531
|
});
|
|
3137
3532
|
}
|
|
3138
3533
|
if (!file) {
|
|
3139
|
-
return /* @__PURE__ */ (0,
|
|
3534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No PDF available" }) });
|
|
3140
3535
|
}
|
|
3141
|
-
return /* @__PURE__ */ (0,
|
|
3536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3142
3537
|
import_react_pdf.Document,
|
|
3143
3538
|
{
|
|
3144
3539
|
file,
|
|
3145
3540
|
onLoadSuccess: handleDocumentLoadSuccess,
|
|
3146
3541
|
onLoadError,
|
|
3147
|
-
loading: /* @__PURE__ */ (0,
|
|
3148
|
-
error: /* @__PURE__ */ (0,
|
|
3542
|
+
loading: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "Rendering PDF..." }) }),
|
|
3543
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Typography, { variant: "body-md", className: "text-error", children: "Failed to render PDF" }) }),
|
|
3149
3544
|
className: "flex flex-col items-center p-4 min-w-fit",
|
|
3150
3545
|
children: numPages > 0 && pageWidth > 0 && (viewMode === "single" ? renderCurrentPage() : renderPagesWithVirtualization())
|
|
3151
3546
|
}
|
|
@@ -3154,19 +3549,19 @@ var PdfDocument = ({
|
|
|
3154
3549
|
PdfDocument.displayName = "PdfDocument";
|
|
3155
3550
|
|
|
3156
3551
|
// src/components/pdf-viewer/components/PdfHeader.tsx
|
|
3157
|
-
var
|
|
3552
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3158
3553
|
var PdfHeader = ({
|
|
3159
3554
|
title,
|
|
3160
3555
|
onDownload,
|
|
3161
3556
|
onPrint
|
|
3162
3557
|
}) => {
|
|
3163
|
-
return /* @__PURE__ */ (0,
|
|
3558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
3164
3559
|
"div",
|
|
3165
3560
|
{
|
|
3166
3561
|
className: "flex items-center justify-between gap-4 px-4 py-1",
|
|
3167
3562
|
style: { background: "#B5B5B5" },
|
|
3168
3563
|
children: [
|
|
3169
|
-
/* @__PURE__ */ (0,
|
|
3564
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex-shrink min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3170
3565
|
Typography,
|
|
3171
3566
|
{
|
|
3172
3567
|
variant: "label-md-bold",
|
|
@@ -3175,25 +3570,25 @@ var PdfHeader = ({
|
|
|
3175
3570
|
children: title || "Untitled Document"
|
|
3176
3571
|
}
|
|
3177
3572
|
) }),
|
|
3178
|
-
/* @__PURE__ */ (0,
|
|
3179
|
-
/* @__PURE__ */ (0,
|
|
3573
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
|
|
3574
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3180
3575
|
"button",
|
|
3181
3576
|
{
|
|
3182
3577
|
onClick: onDownload,
|
|
3183
3578
|
className: "p-1 hover:bg-neutral-500 rounded transition-colors",
|
|
3184
3579
|
"aria-label": "Download PDF",
|
|
3185
3580
|
type: "button",
|
|
3186
|
-
children: /* @__PURE__ */ (0,
|
|
3581
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DownloadIcon, { variant: "dark", size: 16 })
|
|
3187
3582
|
}
|
|
3188
3583
|
),
|
|
3189
|
-
/* @__PURE__ */ (0,
|
|
3584
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3190
3585
|
"button",
|
|
3191
3586
|
{
|
|
3192
3587
|
onClick: onPrint,
|
|
3193
3588
|
className: "p-1 hover:bg-neutral-500 rounded transition-colors",
|
|
3194
3589
|
"aria-label": "Print PDF",
|
|
3195
3590
|
type: "button",
|
|
3196
|
-
children: /* @__PURE__ */ (0,
|
|
3591
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(PrintIcon, { variant: "dark", size: 16 })
|
|
3197
3592
|
}
|
|
3198
3593
|
)
|
|
3199
3594
|
] })
|
|
@@ -3204,12 +3599,12 @@ var PdfHeader = ({
|
|
|
3204
3599
|
PdfHeader.displayName = "PdfHeader";
|
|
3205
3600
|
|
|
3206
3601
|
// src/components/pdf-viewer/hooks/useContainerWidth.ts
|
|
3207
|
-
var
|
|
3602
|
+
var React25 = __toESM(require("react"));
|
|
3208
3603
|
function useContainerWidth(padding = 32) {
|
|
3209
|
-
const [containerWidth, setContainerWidth] =
|
|
3210
|
-
const containerRef =
|
|
3211
|
-
const lastWidthRef =
|
|
3212
|
-
|
|
3604
|
+
const [containerWidth, setContainerWidth] = React25.useState(0);
|
|
3605
|
+
const containerRef = React25.useRef(null);
|
|
3606
|
+
const lastWidthRef = React25.useRef(0);
|
|
3607
|
+
React25.useEffect(() => {
|
|
3213
3608
|
const element = containerRef.current;
|
|
3214
3609
|
if (!element) return;
|
|
3215
3610
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
@@ -3233,9 +3628,9 @@ function useContainerWidth(padding = 32) {
|
|
|
3233
3628
|
}
|
|
3234
3629
|
|
|
3235
3630
|
// src/components/pdf-viewer/hooks/usePdfDownload.ts
|
|
3236
|
-
var
|
|
3631
|
+
var React26 = __toESM(require("react"));
|
|
3237
3632
|
function usePdfDownload(file, title) {
|
|
3238
|
-
const download =
|
|
3633
|
+
const download = React26.useCallback(async () => {
|
|
3239
3634
|
if (!file) return;
|
|
3240
3635
|
try {
|
|
3241
3636
|
let blob;
|
|
@@ -3267,11 +3662,11 @@ function usePdfDownload(file, title) {
|
|
|
3267
3662
|
}
|
|
3268
3663
|
|
|
3269
3664
|
// src/components/pdf-viewer/hooks/usePdfPrint.ts
|
|
3270
|
-
var
|
|
3665
|
+
var React27 = __toESM(require("react"));
|
|
3271
3666
|
function usePdfPrint(file) {
|
|
3272
|
-
const [printBlobUrl, setPrintBlobUrl] =
|
|
3273
|
-
const printFrameRef =
|
|
3274
|
-
const preparePrint =
|
|
3667
|
+
const [printBlobUrl, setPrintBlobUrl] = React27.useState(null);
|
|
3668
|
+
const printFrameRef = React27.useRef(null);
|
|
3669
|
+
const preparePrint = React27.useCallback(async () => {
|
|
3275
3670
|
if (!file) return;
|
|
3276
3671
|
try {
|
|
3277
3672
|
let blob;
|
|
@@ -3287,14 +3682,14 @@ function usePdfPrint(file) {
|
|
|
3287
3682
|
console.error("Failed to prepare PDF for printing:", error);
|
|
3288
3683
|
}
|
|
3289
3684
|
}, [file]);
|
|
3290
|
-
|
|
3685
|
+
React27.useEffect(() => {
|
|
3291
3686
|
return () => {
|
|
3292
3687
|
if (printBlobUrl) {
|
|
3293
3688
|
URL.revokeObjectURL(printBlobUrl);
|
|
3294
3689
|
}
|
|
3295
3690
|
};
|
|
3296
3691
|
}, [printBlobUrl]);
|
|
3297
|
-
const print =
|
|
3692
|
+
const print = React27.useCallback(() => {
|
|
3298
3693
|
if (printFrameRef.current?.contentWindow) {
|
|
3299
3694
|
printFrameRef.current.contentWindow.print();
|
|
3300
3695
|
}
|
|
@@ -3303,7 +3698,7 @@ function usePdfPrint(file) {
|
|
|
3303
3698
|
}
|
|
3304
3699
|
|
|
3305
3700
|
// src/components/pdf-viewer/hooks/usePdfScroll.ts
|
|
3306
|
-
var
|
|
3701
|
+
var React28 = __toESM(require("react"));
|
|
3307
3702
|
function usePdfScroll({
|
|
3308
3703
|
containerRef,
|
|
3309
3704
|
numPages,
|
|
@@ -3314,30 +3709,30 @@ function usePdfScroll({
|
|
|
3314
3709
|
effectiveWidth,
|
|
3315
3710
|
viewportBuffer
|
|
3316
3711
|
}) {
|
|
3317
|
-
const [internalPage, setInternalPage] =
|
|
3712
|
+
const [internalPage, setInternalPage] = React28.useState(1);
|
|
3318
3713
|
const isControlled = scrollTo !== void 0;
|
|
3319
3714
|
const currentPage = isControlled ? scrollTo.page : internalPage;
|
|
3320
|
-
const scrollOperationRef =
|
|
3715
|
+
const scrollOperationRef = React28.useRef({
|
|
3321
3716
|
isProgrammatic: false,
|
|
3322
3717
|
targetPage: null,
|
|
3323
3718
|
lastReportedPage: 1,
|
|
3324
3719
|
notifyOnComplete: false
|
|
3325
3720
|
});
|
|
3326
|
-
const [visibleRange, setVisibleRange] =
|
|
3721
|
+
const [visibleRange, setVisibleRange] = React28.useState({
|
|
3327
3722
|
start: 1,
|
|
3328
3723
|
end: Math.min(1 + viewportBuffer, numPages || 1 + viewportBuffer)
|
|
3329
3724
|
});
|
|
3330
|
-
const visiblePages =
|
|
3725
|
+
const visiblePages = React28.useMemo(() => {
|
|
3331
3726
|
const pages = /* @__PURE__ */ new Set();
|
|
3332
3727
|
for (let i = visibleRange.start; i <= visibleRange.end; i++) {
|
|
3333
3728
|
pages.add(i);
|
|
3334
3729
|
}
|
|
3335
3730
|
return pages;
|
|
3336
3731
|
}, [visibleRange.start, visibleRange.end]);
|
|
3337
|
-
const observerRef =
|
|
3338
|
-
const intersectionRatiosRef =
|
|
3339
|
-
const pageRefsMapRef =
|
|
3340
|
-
const cumulativeOffsets =
|
|
3732
|
+
const observerRef = React28.useRef(null);
|
|
3733
|
+
const intersectionRatiosRef = React28.useRef(/* @__PURE__ */ new Map());
|
|
3734
|
+
const pageRefsMapRef = React28.useRef(/* @__PURE__ */ new Map());
|
|
3735
|
+
const cumulativeOffsets = React28.useMemo(() => {
|
|
3341
3736
|
if (!pageDimensions?.size) return null;
|
|
3342
3737
|
const offsets = [CONTAINER_PADDING];
|
|
3343
3738
|
let cumulative = CONTAINER_PADDING;
|
|
@@ -3349,7 +3744,7 @@ function usePdfScroll({
|
|
|
3349
3744
|
}
|
|
3350
3745
|
return offsets;
|
|
3351
3746
|
}, [pageDimensions, effectiveWidth]);
|
|
3352
|
-
const calculatePageOffset =
|
|
3747
|
+
const calculatePageOffset = React28.useCallback(
|
|
3353
3748
|
(pageNum) => {
|
|
3354
3749
|
if (cumulativeOffsets && pageNum <= cumulativeOffsets.length) {
|
|
3355
3750
|
return cumulativeOffsets[pageNum - 1];
|
|
@@ -3364,11 +3759,11 @@ function usePdfScroll({
|
|
|
3364
3759
|
},
|
|
3365
3760
|
[cumulativeOffsets, pageDimensions, effectiveWidth]
|
|
3366
3761
|
);
|
|
3367
|
-
const onPageChangeRef =
|
|
3368
|
-
|
|
3762
|
+
const onPageChangeRef = React28.useRef(onPageChange);
|
|
3763
|
+
React28.useEffect(() => {
|
|
3369
3764
|
onPageChangeRef.current = onPageChange;
|
|
3370
3765
|
}, [onPageChange]);
|
|
3371
|
-
const updatePage =
|
|
3766
|
+
const updatePage = React28.useCallback(
|
|
3372
3767
|
(pageNum) => {
|
|
3373
3768
|
scrollOperationRef.current.lastReportedPage = pageNum;
|
|
3374
3769
|
if (isControlled) {
|
|
@@ -3380,7 +3775,7 @@ function usePdfScroll({
|
|
|
3380
3775
|
[isControlled]
|
|
3381
3776
|
// Removed onPageChange - now uses ref
|
|
3382
3777
|
);
|
|
3383
|
-
const onProgrammaticScrollComplete =
|
|
3778
|
+
const onProgrammaticScrollComplete = React28.useCallback((pageNum) => {
|
|
3384
3779
|
const shouldNotify = scrollOperationRef.current.notifyOnComplete;
|
|
3385
3780
|
scrollOperationRef.current.isProgrammatic = false;
|
|
3386
3781
|
scrollOperationRef.current.targetPage = null;
|
|
@@ -3390,7 +3785,7 @@ function usePdfScroll({
|
|
|
3390
3785
|
onPageChangeRef.current?.(pageNum);
|
|
3391
3786
|
}
|
|
3392
3787
|
}, []);
|
|
3393
|
-
const scrollToPage =
|
|
3788
|
+
const scrollToPage = React28.useCallback(
|
|
3394
3789
|
(pageNum) => {
|
|
3395
3790
|
const container = containerRef.current;
|
|
3396
3791
|
if (!container || !pageDimensions?.size) return;
|
|
@@ -3421,7 +3816,7 @@ function usePdfScroll({
|
|
|
3421
3816
|
onProgrammaticScrollComplete
|
|
3422
3817
|
]
|
|
3423
3818
|
);
|
|
3424
|
-
const scrollToPosition =
|
|
3819
|
+
const scrollToPosition = React28.useCallback(
|
|
3425
3820
|
(target) => {
|
|
3426
3821
|
const container = containerRef.current;
|
|
3427
3822
|
if (!container || !pageDimensions?.size) return;
|
|
@@ -3462,7 +3857,7 @@ function usePdfScroll({
|
|
|
3462
3857
|
onProgrammaticScrollComplete
|
|
3463
3858
|
]
|
|
3464
3859
|
);
|
|
3465
|
-
const handlePageChange =
|
|
3860
|
+
const handlePageChange = React28.useCallback(
|
|
3466
3861
|
(pageNum) => {
|
|
3467
3862
|
const clampedPage = Math.max(1, Math.min(pageNum, numPages));
|
|
3468
3863
|
scrollOperationRef.current.lastReportedPage = clampedPage;
|
|
@@ -3476,12 +3871,12 @@ function usePdfScroll({
|
|
|
3476
3871
|
},
|
|
3477
3872
|
[numPages, scrollToPage, isControlled, onPageChange]
|
|
3478
3873
|
);
|
|
3479
|
-
const updatePageRef =
|
|
3480
|
-
|
|
3874
|
+
const updatePageRef = React28.useRef(updatePage);
|
|
3875
|
+
React28.useEffect(() => {
|
|
3481
3876
|
updatePageRef.current = updatePage;
|
|
3482
3877
|
}, [updatePage]);
|
|
3483
|
-
const lastBufferRef =
|
|
3484
|
-
|
|
3878
|
+
const lastBufferRef = React28.useRef({ start: 1, end: 1 + viewportBuffer });
|
|
3879
|
+
React28.useEffect(() => {
|
|
3485
3880
|
const container = containerRef.current;
|
|
3486
3881
|
if (!container) return;
|
|
3487
3882
|
const observer = new IntersectionObserver(
|
|
@@ -3541,7 +3936,7 @@ function usePdfScroll({
|
|
|
3541
3936
|
ratiosMap.clear();
|
|
3542
3937
|
};
|
|
3543
3938
|
}, [containerRef, numPages, viewportBuffer]);
|
|
3544
|
-
const observePage =
|
|
3939
|
+
const observePage = React28.useCallback(
|
|
3545
3940
|
(pageNum, element) => {
|
|
3546
3941
|
const prevElement = pageRefsMapRef.current.get(pageNum);
|
|
3547
3942
|
if (element) {
|
|
@@ -3562,7 +3957,7 @@ function usePdfScroll({
|
|
|
3562
3957
|
},
|
|
3563
3958
|
[]
|
|
3564
3959
|
);
|
|
3565
|
-
|
|
3960
|
+
React28.useEffect(() => {
|
|
3566
3961
|
const container = containerRef.current;
|
|
3567
3962
|
if (!container) return;
|
|
3568
3963
|
const handleUserScroll = () => {
|
|
@@ -3620,9 +4015,9 @@ function usePdfScroll({
|
|
|
3620
4015
|
}
|
|
3621
4016
|
};
|
|
3622
4017
|
}, [containerRef, onProgrammaticScrollComplete]);
|
|
3623
|
-
const lastScrollTargetRef =
|
|
3624
|
-
const prevEffectiveWidthRef =
|
|
3625
|
-
|
|
4018
|
+
const lastScrollTargetRef = React28.useRef(null);
|
|
4019
|
+
const prevEffectiveWidthRef = React28.useRef(effectiveWidth);
|
|
4020
|
+
React28.useEffect(() => {
|
|
3626
4021
|
if (prevEffectiveWidthRef.current !== effectiveWidth) {
|
|
3627
4022
|
prevEffectiveWidthRef.current = effectiveWidth;
|
|
3628
4023
|
const lastScrollTarget = lastScrollTargetRef.current;
|
|
@@ -3631,7 +4026,7 @@ function usePdfScroll({
|
|
|
3631
4026
|
}
|
|
3632
4027
|
}
|
|
3633
4028
|
}, [effectiveWidth]);
|
|
3634
|
-
|
|
4029
|
+
React28.useEffect(() => {
|
|
3635
4030
|
if (!isControlled || !scrollTo || numPages <= 0) return;
|
|
3636
4031
|
if (!pageDimensions?.size) return;
|
|
3637
4032
|
const lastScrollTarget = lastScrollTargetRef.current;
|
|
@@ -3664,7 +4059,7 @@ function usePdfScroll({
|
|
|
3664
4059
|
pageDimensions,
|
|
3665
4060
|
effectiveWidth
|
|
3666
4061
|
]);
|
|
3667
|
-
|
|
4062
|
+
React28.useEffect(() => {
|
|
3668
4063
|
const pageRefs = pageRefsMapRef.current;
|
|
3669
4064
|
const ratios = intersectionRatiosRef.current;
|
|
3670
4065
|
for (const pageNum of pageRefs.keys()) {
|
|
@@ -3688,14 +4083,14 @@ function usePdfScroll({
|
|
|
3688
4083
|
}
|
|
3689
4084
|
|
|
3690
4085
|
// src/components/pdf-viewer/hooks/useZoomControl.ts
|
|
3691
|
-
var
|
|
4086
|
+
var React29 = __toESM(require("react"));
|
|
3692
4087
|
function useZoomControl({
|
|
3693
4088
|
containerRef,
|
|
3694
4089
|
initialZoom = PDF_ZOOM.DEFAULT
|
|
3695
4090
|
}) {
|
|
3696
|
-
const [zoom, setZoom] =
|
|
3697
|
-
const scrollRatioRef =
|
|
3698
|
-
const handleZoomChange =
|
|
4091
|
+
const [zoom, setZoom] = React29.useState(initialZoom);
|
|
4092
|
+
const scrollRatioRef = React29.useRef({ x: 0.5, y: 0 });
|
|
4093
|
+
const handleZoomChange = React29.useCallback(
|
|
3699
4094
|
(newZoom) => {
|
|
3700
4095
|
const container = containerRef.current;
|
|
3701
4096
|
if (container) {
|
|
@@ -3716,7 +4111,7 @@ function useZoomControl({
|
|
|
3716
4111
|
},
|
|
3717
4112
|
[containerRef]
|
|
3718
4113
|
);
|
|
3719
|
-
|
|
4114
|
+
React29.useEffect(() => {
|
|
3720
4115
|
const container = containerRef.current;
|
|
3721
4116
|
if (!container) return;
|
|
3722
4117
|
requestAnimationFrame(() => {
|
|
@@ -3741,9 +4136,9 @@ function initializePdfWorker(workerUrl) {
|
|
|
3741
4136
|
}
|
|
3742
4137
|
|
|
3743
4138
|
// src/components/pdf-viewer/index.tsx
|
|
3744
|
-
var
|
|
4139
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3745
4140
|
var DEFAULT_VIEWPORT_BUFFER = 1;
|
|
3746
|
-
var PdfViewer =
|
|
4141
|
+
var PdfViewer = React30.forwardRef(
|
|
3747
4142
|
({
|
|
3748
4143
|
file,
|
|
3749
4144
|
title,
|
|
@@ -3770,15 +4165,15 @@ var PdfViewer = React28.forwardRef(
|
|
|
3770
4165
|
className,
|
|
3771
4166
|
...props
|
|
3772
4167
|
}, ref) => {
|
|
3773
|
-
const [numPages, setNumPages] =
|
|
3774
|
-
const [pageDimensions, setPageDimensions] =
|
|
4168
|
+
const [numPages, setNumPages] = React30.useState(0);
|
|
4169
|
+
const [pageDimensions, setPageDimensions] = React30.useState(null);
|
|
3775
4170
|
const { containerWidth, containerRef } = useContainerWidth();
|
|
3776
4171
|
const { zoom, handleZoomChange } = useZoomControl({ containerRef });
|
|
3777
4172
|
const { printFrameRef, printBlobUrl, preparePrint, print } = usePdfPrint(file);
|
|
3778
4173
|
const download = usePdfDownload(file, title);
|
|
3779
4174
|
const baseWidth = Math.min(pageWidth || containerWidth, 800);
|
|
3780
4175
|
const effectiveWidth = Math.round(baseWidth * (zoom / 100));
|
|
3781
|
-
const handleDimensionsLoaded =
|
|
4176
|
+
const handleDimensionsLoaded = React30.useCallback(
|
|
3782
4177
|
(dimensions) => {
|
|
3783
4178
|
setPageDimensions(dimensions);
|
|
3784
4179
|
onDimensionsReady?.(dimensions);
|
|
@@ -3795,7 +4190,7 @@ var PdfViewer = React28.forwardRef(
|
|
|
3795
4190
|
effectiveWidth,
|
|
3796
4191
|
viewportBuffer
|
|
3797
4192
|
});
|
|
3798
|
-
const handleLoadSuccess =
|
|
4193
|
+
const handleLoadSuccess = React30.useCallback(
|
|
3799
4194
|
async (pages) => {
|
|
3800
4195
|
setNumPages(pages);
|
|
3801
4196
|
onLoadSuccess?.(pages);
|
|
@@ -3803,28 +4198,28 @@ var PdfViewer = React28.forwardRef(
|
|
|
3803
4198
|
},
|
|
3804
4199
|
[onLoadSuccess, preparePrint]
|
|
3805
4200
|
);
|
|
3806
|
-
const handleDownload =
|
|
4201
|
+
const handleDownload = React30.useCallback(() => {
|
|
3807
4202
|
if (onDownload) {
|
|
3808
4203
|
onDownload();
|
|
3809
4204
|
return;
|
|
3810
4205
|
}
|
|
3811
4206
|
download();
|
|
3812
4207
|
}, [onDownload, download]);
|
|
3813
|
-
const handlePrint =
|
|
4208
|
+
const handlePrint = React30.useCallback(() => {
|
|
3814
4209
|
if (onPrint) {
|
|
3815
4210
|
onPrint();
|
|
3816
4211
|
return;
|
|
3817
4212
|
}
|
|
3818
4213
|
print();
|
|
3819
4214
|
}, [onPrint, print]);
|
|
3820
|
-
return /* @__PURE__ */ (0,
|
|
4215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3821
4216
|
"div",
|
|
3822
4217
|
{
|
|
3823
4218
|
ref,
|
|
3824
4219
|
className: cn("h-full flex flex-col", className),
|
|
3825
4220
|
...props,
|
|
3826
4221
|
children: [
|
|
3827
|
-
printBlobUrl && /* @__PURE__ */ (0,
|
|
4222
|
+
printBlobUrl && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3828
4223
|
"iframe",
|
|
3829
4224
|
{
|
|
3830
4225
|
ref: printFrameRef,
|
|
@@ -3833,7 +4228,7 @@ var PdfViewer = React28.forwardRef(
|
|
|
3833
4228
|
title: "PDF for printing"
|
|
3834
4229
|
}
|
|
3835
4230
|
),
|
|
3836
|
-
/* @__PURE__ */ (0,
|
|
4231
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3837
4232
|
PdfHeader,
|
|
3838
4233
|
{
|
|
3839
4234
|
title,
|
|
@@ -3841,8 +4236,8 @@ var PdfViewer = React28.forwardRef(
|
|
|
3841
4236
|
onPrint: handlePrint
|
|
3842
4237
|
}
|
|
3843
4238
|
),
|
|
3844
|
-
/* @__PURE__ */ (0,
|
|
3845
|
-
/* @__PURE__ */ (0,
|
|
4239
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1 flex overflow-hidden min-h-0", children: [
|
|
4240
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CustomScrollbar, { containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3846
4241
|
PdfDocument,
|
|
3847
4242
|
{
|
|
3848
4243
|
file,
|
|
@@ -3866,7 +4261,7 @@ var PdfViewer = React28.forwardRef(
|
|
|
3866
4261
|
onBoxMouseLeave
|
|
3867
4262
|
}
|
|
3868
4263
|
) }),
|
|
3869
|
-
showControls && /* @__PURE__ */ (0,
|
|
4264
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3870
4265
|
PdfControls,
|
|
3871
4266
|
{
|
|
3872
4267
|
currentPage,
|
|
@@ -3887,10 +4282,10 @@ var PdfViewer = React28.forwardRef(
|
|
|
3887
4282
|
PdfViewer.displayName = "PdfViewer";
|
|
3888
4283
|
|
|
3889
4284
|
// src/components/ui/tabs.tsx
|
|
3890
|
-
var
|
|
3891
|
-
var
|
|
3892
|
-
var
|
|
3893
|
-
var tabsVariants = (0,
|
|
4285
|
+
var React31 = __toESM(require("react"));
|
|
4286
|
+
var import_class_variance_authority12 = require("class-variance-authority");
|
|
4287
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4288
|
+
var tabsVariants = (0, import_class_variance_authority12.cva)(
|
|
3894
4289
|
"inline-flex items-center justify-start whitespace-nowrap transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-interactive focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 h-10",
|
|
3895
4290
|
{
|
|
3896
4291
|
variants: {
|
|
@@ -3903,17 +4298,17 @@ var tabsVariants = (0, import_class_variance_authority11.cva)(
|
|
|
3903
4298
|
}
|
|
3904
4299
|
}
|
|
3905
4300
|
);
|
|
3906
|
-
var TabsContext =
|
|
4301
|
+
var TabsContext = React31.createContext(
|
|
3907
4302
|
void 0
|
|
3908
4303
|
);
|
|
3909
4304
|
function useTabsContext() {
|
|
3910
|
-
const context =
|
|
4305
|
+
const context = React31.useContext(TabsContext);
|
|
3911
4306
|
if (!context) {
|
|
3912
4307
|
throw new Error("Tabs components must be used within a Tabs provider");
|
|
3913
4308
|
}
|
|
3914
4309
|
return context;
|
|
3915
4310
|
}
|
|
3916
|
-
var Tabs =
|
|
4311
|
+
var Tabs = React31.forwardRef((props, ref) => {
|
|
3917
4312
|
const {
|
|
3918
4313
|
className,
|
|
3919
4314
|
value,
|
|
@@ -3922,7 +4317,7 @@ var Tabs = React29.forwardRef((props, ref) => {
|
|
|
3922
4317
|
children,
|
|
3923
4318
|
...restProps
|
|
3924
4319
|
} = props;
|
|
3925
|
-
const contextValue =
|
|
4320
|
+
const contextValue = React31.useMemo(
|
|
3926
4321
|
() => ({
|
|
3927
4322
|
activeTab: value,
|
|
3928
4323
|
setActiveTab: onValueChange,
|
|
@@ -3930,13 +4325,13 @@ var Tabs = React29.forwardRef((props, ref) => {
|
|
|
3930
4325
|
}),
|
|
3931
4326
|
[value, onValueChange, variant]
|
|
3932
4327
|
);
|
|
3933
|
-
return /* @__PURE__ */ (0,
|
|
4328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TabsContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { ref, className: cn("w-full", className), ...restProps, children }) });
|
|
3934
4329
|
});
|
|
3935
4330
|
Tabs.displayName = "Tabs";
|
|
3936
|
-
var TabsList =
|
|
4331
|
+
var TabsList = React31.forwardRef(
|
|
3937
4332
|
(props, ref) => {
|
|
3938
4333
|
const { className, children, ...restProps } = props;
|
|
3939
|
-
return /* @__PURE__ */ (0,
|
|
4334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3940
4335
|
"div",
|
|
3941
4336
|
{
|
|
3942
4337
|
ref,
|
|
@@ -3952,7 +4347,7 @@ TabsList.displayName = "TabsList";
|
|
|
3952
4347
|
var getTabTypographyStyles = (isActive) => ({
|
|
3953
4348
|
font: isActive ? "var(--typography-label-sm-bold)" : "var(--typography-label-sm-regular)"
|
|
3954
4349
|
});
|
|
3955
|
-
var TabsTrigger =
|
|
4350
|
+
var TabsTrigger = React31.forwardRef(
|
|
3956
4351
|
(props, ref) => {
|
|
3957
4352
|
const { className, value, disabled, style, children, ...restProps } = props;
|
|
3958
4353
|
const { activeTab, setActiveTab, variant } = useTabsContext();
|
|
@@ -3960,22 +4355,22 @@ var TabsTrigger = React29.forwardRef(
|
|
|
3960
4355
|
throw new Error("TabsTrigger must have a value prop");
|
|
3961
4356
|
}
|
|
3962
4357
|
const isActive = activeTab === value;
|
|
3963
|
-
const tokenStyles =
|
|
4358
|
+
const tokenStyles = React31.useMemo(
|
|
3964
4359
|
() => ({
|
|
3965
4360
|
...getTabTypographyStyles(isActive),
|
|
3966
4361
|
...style
|
|
3967
4362
|
}),
|
|
3968
4363
|
[isActive, style]
|
|
3969
4364
|
);
|
|
3970
|
-
const triggerClassName =
|
|
4365
|
+
const triggerClassName = React31.useMemo(
|
|
3971
4366
|
() => cn(tabsVariants({ variant }), className),
|
|
3972
4367
|
[variant, className]
|
|
3973
4368
|
);
|
|
3974
|
-
const handleClick =
|
|
4369
|
+
const handleClick = React31.useCallback(() => {
|
|
3975
4370
|
if (disabled) return;
|
|
3976
4371
|
setActiveTab(value);
|
|
3977
4372
|
}, [disabled, setActiveTab, value]);
|
|
3978
|
-
return /* @__PURE__ */ (0,
|
|
4373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3979
4374
|
"button",
|
|
3980
4375
|
{
|
|
3981
4376
|
ref,
|
|
@@ -3989,13 +4384,13 @@ var TabsTrigger = React29.forwardRef(
|
|
|
3989
4384
|
disabled,
|
|
3990
4385
|
onClick: handleClick,
|
|
3991
4386
|
...restProps,
|
|
3992
|
-
children: /* @__PURE__ */ (0,
|
|
4387
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "pl-3 pr-6 py-2", children })
|
|
3993
4388
|
}
|
|
3994
4389
|
);
|
|
3995
4390
|
}
|
|
3996
4391
|
);
|
|
3997
4392
|
TabsTrigger.displayName = "TabsTrigger";
|
|
3998
|
-
var TabsContent =
|
|
4393
|
+
var TabsContent = React31.forwardRef(
|
|
3999
4394
|
(props, ref) => {
|
|
4000
4395
|
const { className, value, children, ...restProps } = props;
|
|
4001
4396
|
const { activeTab } = useTabsContext();
|
|
@@ -4006,7 +4401,7 @@ var TabsContent = React29.forwardRef(
|
|
|
4006
4401
|
if (!isActive) {
|
|
4007
4402
|
return null;
|
|
4008
4403
|
}
|
|
4009
|
-
return /* @__PURE__ */ (0,
|
|
4404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4010
4405
|
"div",
|
|
4011
4406
|
{
|
|
4012
4407
|
ref,
|
|
@@ -4024,11 +4419,11 @@ var TabsContent = React29.forwardRef(
|
|
|
4024
4419
|
TabsContent.displayName = "TabsContent";
|
|
4025
4420
|
|
|
4026
4421
|
// src/components/ui/dropdown-menu.tsx
|
|
4027
|
-
var
|
|
4422
|
+
var React32 = __toESM(require("react"));
|
|
4028
4423
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
4029
|
-
var
|
|
4424
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4030
4425
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
4031
|
-
var DropdownMenuTrigger =
|
|
4426
|
+
var DropdownMenuTrigger = React32.forwardRef(({ className, icon, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4032
4427
|
DropdownMenuPrimitive.Trigger,
|
|
4033
4428
|
{
|
|
4034
4429
|
ref,
|
|
@@ -4038,7 +4433,7 @@ var DropdownMenuTrigger = React30.forwardRef(({ className, icon, children, ...pr
|
|
|
4038
4433
|
),
|
|
4039
4434
|
...props,
|
|
4040
4435
|
children: [
|
|
4041
|
-
icon || /* @__PURE__ */ (0,
|
|
4436
|
+
icon || /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(MoreMenuIcon, {}),
|
|
4042
4437
|
children
|
|
4043
4438
|
]
|
|
4044
4439
|
}
|
|
@@ -4048,7 +4443,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
4048
4443
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
4049
4444
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
4050
4445
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
4051
|
-
var DropdownMenuSubTrigger =
|
|
4446
|
+
var DropdownMenuSubTrigger = React32.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4052
4447
|
DropdownMenuPrimitive.SubTrigger,
|
|
4053
4448
|
{
|
|
4054
4449
|
ref,
|
|
@@ -4061,12 +4456,12 @@ var DropdownMenuSubTrigger = React30.forwardRef(({ className, inset, children, .
|
|
|
4061
4456
|
...props,
|
|
4062
4457
|
children: [
|
|
4063
4458
|
children,
|
|
4064
|
-
/* @__PURE__ */ (0,
|
|
4459
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ArrowRightIcon, { className: "ml-auto" })
|
|
4065
4460
|
]
|
|
4066
4461
|
}
|
|
4067
4462
|
));
|
|
4068
4463
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
4069
|
-
var DropdownMenuSubContent =
|
|
4464
|
+
var DropdownMenuSubContent = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4070
4465
|
DropdownMenuPrimitive.SubContent,
|
|
4071
4466
|
{
|
|
4072
4467
|
ref,
|
|
@@ -4078,7 +4473,7 @@ var DropdownMenuSubContent = React30.forwardRef(({ className, ...props }, ref) =
|
|
|
4078
4473
|
}
|
|
4079
4474
|
));
|
|
4080
4475
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
4081
|
-
var DropdownMenuContent =
|
|
4476
|
+
var DropdownMenuContent = React32.forwardRef(({ className, sideOffset = 4, align = "end", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4082
4477
|
DropdownMenuPrimitive.Content,
|
|
4083
4478
|
{
|
|
4084
4479
|
ref,
|
|
@@ -4092,7 +4487,7 @@ var DropdownMenuContent = React30.forwardRef(({ className, sideOffset = 4, align
|
|
|
4092
4487
|
}
|
|
4093
4488
|
) }));
|
|
4094
4489
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
4095
|
-
var DropdownMenuItem =
|
|
4490
|
+
var DropdownMenuItem = React32.forwardRef(({ className, inset, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4096
4491
|
DropdownMenuPrimitive.Item,
|
|
4097
4492
|
{
|
|
4098
4493
|
ref,
|
|
@@ -4109,7 +4504,7 @@ var DropdownMenuItem = React30.forwardRef(({ className, inset, style, ...props }
|
|
|
4109
4504
|
}
|
|
4110
4505
|
));
|
|
4111
4506
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
4112
|
-
var DropdownMenuCheckboxItem =
|
|
4507
|
+
var DropdownMenuCheckboxItem = React32.forwardRef(({ className, children, style, checked, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4113
4508
|
DropdownMenuPrimitive.CheckboxItem,
|
|
4114
4509
|
{
|
|
4115
4510
|
ref,
|
|
@@ -4124,7 +4519,7 @@ var DropdownMenuCheckboxItem = React30.forwardRef(({ className, children, style,
|
|
|
4124
4519
|
},
|
|
4125
4520
|
...props,
|
|
4126
4521
|
children: [
|
|
4127
|
-
/* @__PURE__ */ (0,
|
|
4522
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4128
4523
|
Checkbox,
|
|
4129
4524
|
{
|
|
4130
4525
|
checked: checked === true,
|
|
@@ -4132,12 +4527,12 @@ var DropdownMenuCheckboxItem = React30.forwardRef(({ className, children, style,
|
|
|
4132
4527
|
"aria-hidden": "true"
|
|
4133
4528
|
}
|
|
4134
4529
|
),
|
|
4135
|
-
/* @__PURE__ */ (0,
|
|
4530
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "flex-1", children })
|
|
4136
4531
|
]
|
|
4137
4532
|
}
|
|
4138
4533
|
));
|
|
4139
4534
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
4140
|
-
var DropdownMenuRadioItem =
|
|
4535
|
+
var DropdownMenuRadioItem = React32.forwardRef(({ className, children, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4141
4536
|
DropdownMenuPrimitive.RadioItem,
|
|
4142
4537
|
{
|
|
4143
4538
|
ref,
|
|
@@ -4151,13 +4546,13 @@ var DropdownMenuRadioItem = React30.forwardRef(({ className, children, style, ..
|
|
|
4151
4546
|
},
|
|
4152
4547
|
...props,
|
|
4153
4548
|
children: [
|
|
4154
|
-
/* @__PURE__ */ (0,
|
|
4549
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "h-2 w-2 rounded-full bg-current" }) }) }),
|
|
4155
4550
|
children
|
|
4156
4551
|
]
|
|
4157
4552
|
}
|
|
4158
4553
|
));
|
|
4159
4554
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
4160
|
-
var DropdownMenuLabel =
|
|
4555
|
+
var DropdownMenuLabel = React32.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4161
4556
|
DropdownMenuPrimitive.Label,
|
|
4162
4557
|
{
|
|
4163
4558
|
ref,
|
|
@@ -4170,7 +4565,7 @@ var DropdownMenuLabel = React30.forwardRef(({ className, inset, ...props }, ref)
|
|
|
4170
4565
|
}
|
|
4171
4566
|
));
|
|
4172
4567
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
4173
|
-
var DropdownMenuSeparator =
|
|
4568
|
+
var DropdownMenuSeparator = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4174
4569
|
DropdownMenuPrimitive.Separator,
|
|
4175
4570
|
{
|
|
4176
4571
|
ref,
|
|
@@ -4183,7 +4578,7 @@ var DropdownMenuShortcut = ({
|
|
|
4183
4578
|
className,
|
|
4184
4579
|
...props
|
|
4185
4580
|
}) => {
|
|
4186
|
-
return /* @__PURE__ */ (0,
|
|
4581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4187
4582
|
"span",
|
|
4188
4583
|
{
|
|
4189
4584
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
@@ -4194,21 +4589,21 @@ var DropdownMenuShortcut = ({
|
|
|
4194
4589
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
4195
4590
|
|
|
4196
4591
|
// src/components/ui/charts/chart-legend.tsx
|
|
4197
|
-
var
|
|
4592
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4198
4593
|
function ChartLegend({
|
|
4199
4594
|
items,
|
|
4200
4595
|
x = 0,
|
|
4201
4596
|
y = 550,
|
|
4202
4597
|
className = ""
|
|
4203
4598
|
}) {
|
|
4204
|
-
return /* @__PURE__ */ (0,
|
|
4599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("foreignObject", { x, y, width: "100%", height: "40", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4205
4600
|
"div",
|
|
4206
4601
|
{
|
|
4207
4602
|
className: `flex justify-center items-center gap-6 ${className}`,
|
|
4208
4603
|
style: { height: "100%" },
|
|
4209
|
-
children: items.map(({ key, color, label }) => /* @__PURE__ */ (0,
|
|
4210
|
-
/* @__PURE__ */ (0,
|
|
4211
|
-
/* @__PURE__ */ (0,
|
|
4604
|
+
children: items.map(({ key, color, label }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4605
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-3 h-3", style: { backgroundColor: color } }),
|
|
4606
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Typography, { variant: "body-xs", children: label || key })
|
|
4212
4607
|
] }, key))
|
|
4213
4608
|
}
|
|
4214
4609
|
) });
|
|
@@ -4326,12 +4721,12 @@ var formatLargeNumber = (value) => {
|
|
|
4326
4721
|
};
|
|
4327
4722
|
|
|
4328
4723
|
// src/components/ui/charts/chart-labels.tsx
|
|
4329
|
-
var
|
|
4724
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4330
4725
|
var createCustomXAxisLabel = (text, yOffset = 40) => {
|
|
4331
4726
|
const CustomXAxisLabel = ({ viewBox }) => {
|
|
4332
4727
|
if (!viewBox) return null;
|
|
4333
4728
|
const { x, y, width } = viewBox;
|
|
4334
|
-
return /* @__PURE__ */ (0,
|
|
4729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("foreignObject", { x, y: y + yOffset, width, height: 20, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
4335
4730
|
};
|
|
4336
4731
|
CustomXAxisLabel.displayName = "CustomXAxisLabel";
|
|
4337
4732
|
return CustomXAxisLabel;
|
|
@@ -4341,7 +4736,7 @@ var createCustomYAxisLabel = (text, leftMargin) => {
|
|
|
4341
4736
|
if (!viewBox) return null;
|
|
4342
4737
|
const { x, y, height } = viewBox;
|
|
4343
4738
|
const offset = leftMargin ? leftMargin + 10 : 110;
|
|
4344
|
-
return /* @__PURE__ */ (0,
|
|
4739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("foreignObject", { x: x - offset, y, width: 100, height, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex items-center justify-center h-full transform -rotate-90 whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
4345
4740
|
};
|
|
4346
4741
|
CustomYAxisLabel.displayName = "CustomYAxisLabel";
|
|
4347
4742
|
return CustomYAxisLabel;
|
|
@@ -4350,14 +4745,14 @@ var createCustomYAxisRightLabel = (text) => {
|
|
|
4350
4745
|
const CustomYAxisRightLabel = ({ viewBox }) => {
|
|
4351
4746
|
if (!viewBox) return null;
|
|
4352
4747
|
const { x, y, width, height } = viewBox;
|
|
4353
|
-
return /* @__PURE__ */ (0,
|
|
4748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("foreignObject", { x: x + width - 70, y, width: 120, height, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex items-center justify-center h-full transform rotate-90 whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
4354
4749
|
};
|
|
4355
4750
|
CustomYAxisRightLabel.displayName = "CustomYAxisRightLabel";
|
|
4356
4751
|
return CustomYAxisRightLabel;
|
|
4357
4752
|
};
|
|
4358
4753
|
var customXAxisTick = (props) => {
|
|
4359
4754
|
const { x, y, payload } = props;
|
|
4360
|
-
return /* @__PURE__ */ (0,
|
|
4755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4361
4756
|
"foreignObject",
|
|
4362
4757
|
{
|
|
4363
4758
|
x: -20,
|
|
@@ -4365,12 +4760,12 @@ var customXAxisTick = (props) => {
|
|
|
4365
4760
|
width: 40,
|
|
4366
4761
|
height: 20,
|
|
4367
4762
|
style: { overflow: "visible" },
|
|
4368
|
-
children: /* @__PURE__ */ (0,
|
|
4763
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4369
4764
|
"div",
|
|
4370
4765
|
{
|
|
4371
4766
|
className: "flex items-start justify-center h-full",
|
|
4372
4767
|
style: { overflow: "visible" },
|
|
4373
|
-
children: /* @__PURE__ */ (0,
|
|
4768
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4374
4769
|
Typography,
|
|
4375
4770
|
{
|
|
4376
4771
|
variant: "body-xs",
|
|
@@ -4385,7 +4780,7 @@ var customXAxisTick = (props) => {
|
|
|
4385
4780
|
};
|
|
4386
4781
|
var customXAxisTickRotated = (props) => {
|
|
4387
4782
|
const { x, y, payload } = props;
|
|
4388
|
-
return /* @__PURE__ */ (0,
|
|
4783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4389
4784
|
"text",
|
|
4390
4785
|
{
|
|
4391
4786
|
x: 0,
|
|
@@ -4404,25 +4799,25 @@ var customYAxisTick = (props) => {
|
|
|
4404
4799
|
const { x, y, payload } = props;
|
|
4405
4800
|
const text = String(payload.value);
|
|
4406
4801
|
const estimatedWidth = Math.max(text.length * 8, 80);
|
|
4407
|
-
return /* @__PURE__ */ (0,
|
|
4802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4408
4803
|
"foreignObject",
|
|
4409
4804
|
{
|
|
4410
4805
|
x: x - estimatedWidth + 5,
|
|
4411
4806
|
y: y - 6,
|
|
4412
4807
|
width: estimatedWidth,
|
|
4413
4808
|
height: 15,
|
|
4414
|
-
children: /* @__PURE__ */ (0,
|
|
4809
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex justify-end w-full", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Typography, { variant: "body-xs", className: "text-secondary", children: payload.value }) })
|
|
4415
4810
|
}
|
|
4416
4811
|
);
|
|
4417
4812
|
};
|
|
4418
4813
|
|
|
4419
4814
|
// src/components/ui/charts/chart-tooltip.tsx
|
|
4420
|
-
var
|
|
4815
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4421
4816
|
function TooltipContainer({
|
|
4422
4817
|
children,
|
|
4423
4818
|
className = ""
|
|
4424
4819
|
}) {
|
|
4425
|
-
return /* @__PURE__ */ (0,
|
|
4820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4426
4821
|
"div",
|
|
4427
4822
|
{
|
|
4428
4823
|
className: `bg-light border border-subtle rounded p-2.5 text-dark ${className}`,
|
|
@@ -4436,10 +4831,10 @@ function TooltipItem({
|
|
|
4436
4831
|
value,
|
|
4437
4832
|
className = ""
|
|
4438
4833
|
}) {
|
|
4439
|
-
return /* @__PURE__ */ (0,
|
|
4440
|
-
/* @__PURE__ */ (0,
|
|
4441
|
-
/* @__PURE__ */ (0,
|
|
4442
|
-
/* @__PURE__ */ (0,
|
|
4834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
4835
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("br", {}),
|
|
4836
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Typography, { variant: "label-sm", className, children: [
|
|
4837
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4443
4838
|
"span",
|
|
4444
4839
|
{
|
|
4445
4840
|
className: "inline-block w-3 h-3 mr-1.5",
|
|
@@ -4457,9 +4852,9 @@ function GenericTooltip({
|
|
|
4457
4852
|
items,
|
|
4458
4853
|
className = ""
|
|
4459
4854
|
}) {
|
|
4460
|
-
return /* @__PURE__ */ (0,
|
|
4461
|
-
title && /* @__PURE__ */ (0,
|
|
4462
|
-
items.map((item, index) => /* @__PURE__ */ (0,
|
|
4855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(TooltipContainer, { className, children: [
|
|
4856
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Typography, { variant: "label-sm-bold", children: title }),
|
|
4857
|
+
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4463
4858
|
TooltipItem,
|
|
4464
4859
|
{
|
|
4465
4860
|
color: item.color,
|
|
@@ -4474,7 +4869,7 @@ function GenericTooltip({
|
|
|
4474
4869
|
// src/components/ui/charts/bar-chart.tsx
|
|
4475
4870
|
var import_react2 = require("react");
|
|
4476
4871
|
var import_recharts = require("recharts");
|
|
4477
|
-
var
|
|
4872
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4478
4873
|
var BarChart = (0, import_react2.forwardRef)(
|
|
4479
4874
|
({
|
|
4480
4875
|
data,
|
|
@@ -4501,19 +4896,19 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
4501
4896
|
};
|
|
4502
4897
|
const defaultLegendItems = showLegend && legendItems.length === 0 ? [{ key: yAxisKey, color: barColor, label: yAxisKey }] : legendItems;
|
|
4503
4898
|
const hasData = data && data.length > 0;
|
|
4504
|
-
return /* @__PURE__ */ (0,
|
|
4899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
4505
4900
|
"div",
|
|
4506
4901
|
{
|
|
4507
4902
|
ref,
|
|
4508
4903
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
4509
4904
|
children: [
|
|
4510
|
-
/* @__PURE__ */ (0,
|
|
4511
|
-
/* @__PURE__ */ (0,
|
|
4905
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
4906
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4512
4907
|
import_recharts.ResponsiveContainer,
|
|
4513
4908
|
{
|
|
4514
4909
|
width: "100%",
|
|
4515
4910
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
4516
|
-
children: /* @__PURE__ */ (0,
|
|
4911
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
4517
4912
|
import_recharts.BarChart,
|
|
4518
4913
|
{
|
|
4519
4914
|
data,
|
|
@@ -4525,7 +4920,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
4525
4920
|
onClick: handleClick,
|
|
4526
4921
|
layout,
|
|
4527
4922
|
children: [
|
|
4528
|
-
/* @__PURE__ */ (0,
|
|
4923
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4529
4924
|
import_recharts.XAxis,
|
|
4530
4925
|
{
|
|
4531
4926
|
dataKey: xAxisKey,
|
|
@@ -4539,7 +4934,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
4539
4934
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel, 80) : void 0
|
|
4540
4935
|
}
|
|
4541
4936
|
),
|
|
4542
|
-
/* @__PURE__ */ (0,
|
|
4937
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4543
4938
|
import_recharts.YAxis,
|
|
4544
4939
|
{
|
|
4545
4940
|
axisLine: false,
|
|
@@ -4550,7 +4945,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
4550
4945
|
type: yAxisType
|
|
4551
4946
|
}
|
|
4552
4947
|
),
|
|
4553
|
-
/* @__PURE__ */ (0,
|
|
4948
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4554
4949
|
import_recharts.Tooltip,
|
|
4555
4950
|
{
|
|
4556
4951
|
content: ({
|
|
@@ -4559,7 +4954,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
4559
4954
|
label
|
|
4560
4955
|
}) => {
|
|
4561
4956
|
if (active && payload && payload.length) {
|
|
4562
|
-
return /* @__PURE__ */ (0,
|
|
4957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4563
4958
|
GenericTooltip,
|
|
4564
4959
|
{
|
|
4565
4960
|
title: label?.toString(),
|
|
@@ -4575,7 +4970,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
4575
4970
|
}
|
|
4576
4971
|
}
|
|
4577
4972
|
),
|
|
4578
|
-
/* @__PURE__ */ (0,
|
|
4973
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4579
4974
|
import_recharts.Bar,
|
|
4580
4975
|
{
|
|
4581
4976
|
dataKey: barDataKey || yAxisKey,
|
|
@@ -4583,12 +4978,12 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
4583
4978
|
name: barDataKey || yAxisKey
|
|
4584
4979
|
}
|
|
4585
4980
|
),
|
|
4586
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
4981
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChartLegend, { items: defaultLegendItems })
|
|
4587
4982
|
]
|
|
4588
4983
|
}
|
|
4589
4984
|
)
|
|
4590
4985
|
}
|
|
4591
|
-
) : /* @__PURE__ */ (0,
|
|
4986
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
4592
4987
|
]
|
|
4593
4988
|
}
|
|
4594
4989
|
);
|
|
@@ -4599,7 +4994,7 @@ BarChart.displayName = "BarChart";
|
|
|
4599
4994
|
// src/components/ui/charts/line-chart.tsx
|
|
4600
4995
|
var import_react3 = require("react");
|
|
4601
4996
|
var import_recharts2 = require("recharts");
|
|
4602
|
-
var
|
|
4997
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4603
4998
|
var LineChart = (0, import_react3.forwardRef)(
|
|
4604
4999
|
({
|
|
4605
5000
|
data,
|
|
@@ -4628,19 +5023,19 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
4628
5023
|
)
|
|
4629
5024
|
);
|
|
4630
5025
|
const hasData = data && data.length > 0;
|
|
4631
|
-
return /* @__PURE__ */ (0,
|
|
5026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
4632
5027
|
"div",
|
|
4633
5028
|
{
|
|
4634
5029
|
ref,
|
|
4635
5030
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
4636
5031
|
children: [
|
|
4637
|
-
/* @__PURE__ */ (0,
|
|
4638
|
-
/* @__PURE__ */ (0,
|
|
5032
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
5033
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4639
5034
|
import_recharts2.ResponsiveContainer,
|
|
4640
5035
|
{
|
|
4641
5036
|
width: "100%",
|
|
4642
5037
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
4643
|
-
children: /* @__PURE__ */ (0,
|
|
5038
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
4644
5039
|
import_recharts2.LineChart,
|
|
4645
5040
|
{
|
|
4646
5041
|
data,
|
|
@@ -4651,7 +5046,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
4651
5046
|
},
|
|
4652
5047
|
onClick: handleClick,
|
|
4653
5048
|
children: [
|
|
4654
|
-
/* @__PURE__ */ (0,
|
|
5049
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4655
5050
|
import_recharts2.XAxis,
|
|
4656
5051
|
{
|
|
4657
5052
|
dataKey: xAxisKey,
|
|
@@ -4663,7 +5058,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
4663
5058
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel) : void 0
|
|
4664
5059
|
}
|
|
4665
5060
|
),
|
|
4666
|
-
/* @__PURE__ */ (0,
|
|
5061
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4667
5062
|
import_recharts2.YAxis,
|
|
4668
5063
|
{
|
|
4669
5064
|
axisLine: false,
|
|
@@ -4672,7 +5067,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
4672
5067
|
label: yAxisLabel ? createCustomYAxisLabel(yAxisLabel, 40) : void 0
|
|
4673
5068
|
}
|
|
4674
5069
|
),
|
|
4675
|
-
/* @__PURE__ */ (0,
|
|
5070
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4676
5071
|
import_recharts2.Tooltip,
|
|
4677
5072
|
{
|
|
4678
5073
|
content: ({
|
|
@@ -4681,7 +5076,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
4681
5076
|
label
|
|
4682
5077
|
}) => {
|
|
4683
5078
|
if (active && payload && payload.length) {
|
|
4684
|
-
return /* @__PURE__ */ (0,
|
|
5079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4685
5080
|
GenericTooltip,
|
|
4686
5081
|
{
|
|
4687
5082
|
title: label?.toString(),
|
|
@@ -4697,7 +5092,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
4697
5092
|
}
|
|
4698
5093
|
}
|
|
4699
5094
|
),
|
|
4700
|
-
series.map((s, index) => /* @__PURE__ */ (0,
|
|
5095
|
+
series.map((s, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4701
5096
|
import_recharts2.Line,
|
|
4702
5097
|
{
|
|
4703
5098
|
type: "monotone",
|
|
@@ -4709,12 +5104,12 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
4709
5104
|
},
|
|
4710
5105
|
s.dataKey
|
|
4711
5106
|
)),
|
|
4712
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
5107
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChartLegend, { items: defaultLegendItems })
|
|
4713
5108
|
]
|
|
4714
5109
|
}
|
|
4715
5110
|
)
|
|
4716
5111
|
}
|
|
4717
|
-
) : /* @__PURE__ */ (0,
|
|
5112
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
4718
5113
|
]
|
|
4719
5114
|
}
|
|
4720
5115
|
);
|
|
@@ -4725,7 +5120,7 @@ LineChart.displayName = "LineChart";
|
|
|
4725
5120
|
// src/components/ui/charts/pie-chart.tsx
|
|
4726
5121
|
var import_react4 = require("react");
|
|
4727
5122
|
var import_recharts3 = require("recharts");
|
|
4728
|
-
var
|
|
5123
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4729
5124
|
var PieChart = (0, import_react4.forwardRef)(
|
|
4730
5125
|
({
|
|
4731
5126
|
data,
|
|
@@ -4753,20 +5148,20 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4753
5148
|
)
|
|
4754
5149
|
);
|
|
4755
5150
|
const hasData = data && data.length > 0;
|
|
4756
|
-
return /* @__PURE__ */ (0,
|
|
5151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4757
5152
|
"div",
|
|
4758
5153
|
{
|
|
4759
5154
|
ref,
|
|
4760
5155
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
4761
5156
|
children: [
|
|
4762
|
-
/* @__PURE__ */ (0,
|
|
4763
|
-
/* @__PURE__ */ (0,
|
|
5157
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
5158
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4764
5159
|
import_recharts3.PieChart,
|
|
4765
5160
|
{
|
|
4766
5161
|
width: 600,
|
|
4767
5162
|
height: CHART_CONSTANTS.LARGE_HEIGHT,
|
|
4768
5163
|
children: [
|
|
4769
|
-
/* @__PURE__ */ (0,
|
|
5164
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4770
5165
|
import_recharts3.Pie,
|
|
4771
5166
|
{
|
|
4772
5167
|
data,
|
|
@@ -4778,7 +5173,7 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4778
5173
|
label: showLabels,
|
|
4779
5174
|
labelLine: false,
|
|
4780
5175
|
onClick: handleClick,
|
|
4781
|
-
children: data.map((entry, index) => /* @__PURE__ */ (0,
|
|
5176
|
+
children: data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4782
5177
|
import_recharts3.Cell,
|
|
4783
5178
|
{
|
|
4784
5179
|
fill: entry.color || getSeriesColor(index)
|
|
@@ -4787,7 +5182,7 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4787
5182
|
))
|
|
4788
5183
|
}
|
|
4789
5184
|
),
|
|
4790
|
-
/* @__PURE__ */ (0,
|
|
5185
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4791
5186
|
import_recharts3.Tooltip,
|
|
4792
5187
|
{
|
|
4793
5188
|
content: ({
|
|
@@ -4796,7 +5191,7 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4796
5191
|
}) => {
|
|
4797
5192
|
if (active && payload && payload.length && payload[0]) {
|
|
4798
5193
|
const data2 = payload[0].payload;
|
|
4799
|
-
return /* @__PURE__ */ (0,
|
|
5194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4800
5195
|
GenericTooltip,
|
|
4801
5196
|
{
|
|
4802
5197
|
title: data2.name,
|
|
@@ -4814,10 +5209,10 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
4814
5209
|
}
|
|
4815
5210
|
}
|
|
4816
5211
|
),
|
|
4817
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
5212
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChartLegend, { items: defaultLegendItems, y: 400 })
|
|
4818
5213
|
]
|
|
4819
5214
|
}
|
|
4820
|
-
) }) : /* @__PURE__ */ (0,
|
|
5215
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
4821
5216
|
]
|
|
4822
5217
|
}
|
|
4823
5218
|
);
|
|
@@ -4828,7 +5223,7 @@ PieChart.displayName = "PieChart";
|
|
|
4828
5223
|
// src/components/ui/table.tsx
|
|
4829
5224
|
var import_react5 = require("react");
|
|
4830
5225
|
var import_react_table = require("@tanstack/react-table");
|
|
4831
|
-
var
|
|
5226
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4832
5227
|
function Table({
|
|
4833
5228
|
table,
|
|
4834
5229
|
className,
|
|
@@ -4858,15 +5253,15 @@ function Table({
|
|
|
4858
5253
|
},
|
|
4859
5254
|
[table]
|
|
4860
5255
|
);
|
|
4861
|
-
return /* @__PURE__ */ (0,
|
|
4862
|
-
/* @__PURE__ */ (0,
|
|
4863
|
-
/* @__PURE__ */ (0,
|
|
5256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
|
|
5257
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: cn("overflow-x-auto", className), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("table", { className: "min-w-full divide-y divide-border", children: [
|
|
5258
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("thead", { className: "bg-dark text-light", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("th", { className: "px-6 py-3 text-left", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
4864
5259
|
"div",
|
|
4865
5260
|
{
|
|
4866
5261
|
className: `flex items-center space-x-1 ${header.column.getCanSort() ? "cursor-pointer select-none" : ""}`,
|
|
4867
5262
|
onClick: header.column.getToggleSortingHandler(),
|
|
4868
5263
|
children: [
|
|
4869
|
-
/* @__PURE__ */ (0,
|
|
5264
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4870
5265
|
Typography,
|
|
4871
5266
|
{
|
|
4872
5267
|
variant: "label-xs",
|
|
@@ -4877,19 +5272,19 @@ function Table({
|
|
|
4877
5272
|
)
|
|
4878
5273
|
}
|
|
4879
5274
|
),
|
|
4880
|
-
header.column.getCanSort() && /* @__PURE__ */ (0,
|
|
4881
|
-
header.column.getIsSorted() === "asc" && /* @__PURE__ */ (0,
|
|
4882
|
-
header.column.getIsSorted() === "desc" && /* @__PURE__ */ (0,
|
|
5275
|
+
header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "ml-1", children: [
|
|
5276
|
+
header.column.getIsSorted() === "asc" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CaretUpIcon, { className: "text-light" }),
|
|
5277
|
+
header.column.getIsSorted() === "desc" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CaretDownIcon, { className: "text-light" })
|
|
4883
5278
|
] })
|
|
4884
5279
|
]
|
|
4885
5280
|
}
|
|
4886
5281
|
) }, header.id)) }, headerGroup.id)) }),
|
|
4887
|
-
/* @__PURE__ */ (0,
|
|
5282
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("tbody", { className: "bg-light divide-y divide-border", children: table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("tr", { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Typography, { variant: "body-sm", children: (0, import_react_table.flexRender)(
|
|
4888
5283
|
cell.column.columnDef.cell,
|
|
4889
5284
|
cell.getContext()
|
|
4890
5285
|
) }) }, cell.id)) }, row.id)) })
|
|
4891
5286
|
] }) }),
|
|
4892
|
-
showPagination && /* @__PURE__ */ (0,
|
|
5287
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
4893
5288
|
"div",
|
|
4894
5289
|
{
|
|
4895
5290
|
className: cn(
|
|
@@ -4897,9 +5292,9 @@ function Table({
|
|
|
4897
5292
|
paginationClassName
|
|
4898
5293
|
),
|
|
4899
5294
|
children: [
|
|
4900
|
-
/* @__PURE__ */ (0,
|
|
4901
|
-
/* @__PURE__ */ (0,
|
|
4902
|
-
/* @__PURE__ */ (0,
|
|
5295
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Typography, { variant: "body-sm", className: "text-secondary", children: showingText }) }),
|
|
5296
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
5297
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4903
5298
|
Button,
|
|
4904
5299
|
{
|
|
4905
5300
|
variant: "ghost",
|
|
@@ -4907,7 +5302,7 @@ function Table({
|
|
|
4907
5302
|
onClick: handlePreviousPage,
|
|
4908
5303
|
disabled: !table.getCanPreviousPage(),
|
|
4909
5304
|
className: "p-2",
|
|
4910
|
-
children: /* @__PURE__ */ (0,
|
|
5305
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ArrowLeftIcon, {})
|
|
4911
5306
|
}
|
|
4912
5307
|
),
|
|
4913
5308
|
Array.from(
|
|
@@ -4924,7 +5319,7 @@ function Table({
|
|
|
4924
5319
|
pageNumber = currentPage - 2 + i;
|
|
4925
5320
|
}
|
|
4926
5321
|
const isActive = pageNumber === currentPage;
|
|
4927
|
-
return /* @__PURE__ */ (0,
|
|
5322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4928
5323
|
Button,
|
|
4929
5324
|
{
|
|
4930
5325
|
variant: isActive ? "default" : "ghost",
|
|
@@ -4937,11 +5332,11 @@ function Table({
|
|
|
4937
5332
|
);
|
|
4938
5333
|
}
|
|
4939
5334
|
),
|
|
4940
|
-
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */ (0,
|
|
4941
|
-
/* @__PURE__ */ (0,
|
|
4942
|
-
/* @__PURE__ */ (0,
|
|
5335
|
+
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
5336
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "px-1 text-secondary", children: "..." }),
|
|
5337
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Typography, { variant: "body-sm", className: "text-secondary", children: totalPages })
|
|
4943
5338
|
] }),
|
|
4944
|
-
/* @__PURE__ */ (0,
|
|
5339
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4945
5340
|
Button,
|
|
4946
5341
|
{
|
|
4947
5342
|
variant: "ghost",
|
|
@@ -4949,12 +5344,12 @@ function Table({
|
|
|
4949
5344
|
onClick: handleNextPage,
|
|
4950
5345
|
disabled: !table.getCanNextPage(),
|
|
4951
5346
|
className: "p-2",
|
|
4952
|
-
children: /* @__PURE__ */ (0,
|
|
5347
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ArrowRightIcon, {})
|
|
4953
5348
|
}
|
|
4954
5349
|
)
|
|
4955
5350
|
] }),
|
|
4956
|
-
/* @__PURE__ */ (0,
|
|
4957
|
-
/* @__PURE__ */ (0,
|
|
5351
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-3 w-48", children: [
|
|
5352
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4958
5353
|
Typography,
|
|
4959
5354
|
{
|
|
4960
5355
|
variant: "body-sm",
|
|
@@ -4962,14 +5357,14 @@ function Table({
|
|
|
4962
5357
|
children: "Rows per page:"
|
|
4963
5358
|
}
|
|
4964
5359
|
),
|
|
4965
|
-
/* @__PURE__ */ (0,
|
|
5360
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
4966
5361
|
Select,
|
|
4967
5362
|
{
|
|
4968
5363
|
value: table.getState().pagination.pageSize.toString(),
|
|
4969
5364
|
onValueChange: handlePageSizeChange,
|
|
4970
5365
|
children: [
|
|
4971
|
-
/* @__PURE__ */ (0,
|
|
4972
|
-
/* @__PURE__ */ (0,
|
|
5366
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectTrigger, { className: "min-w-0 h-8", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectValue, {}) }),
|
|
5367
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectContent, { children: [10, 20, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectItem, { value: size.toString(), children: size }, size)) })
|
|
4973
5368
|
]
|
|
4974
5369
|
}
|
|
4975
5370
|
)
|
|
@@ -5022,6 +5417,15 @@ function Table({
|
|
|
5022
5417
|
CogIcon,
|
|
5023
5418
|
CredentialsIcon,
|
|
5024
5419
|
DatePicker,
|
|
5420
|
+
Dialog,
|
|
5421
|
+
DialogBody,
|
|
5422
|
+
DialogClose,
|
|
5423
|
+
DialogContent,
|
|
5424
|
+
DialogDescription,
|
|
5425
|
+
DialogFooter,
|
|
5426
|
+
DialogOverlay,
|
|
5427
|
+
DialogTitle,
|
|
5428
|
+
DialogTrigger,
|
|
5025
5429
|
DocumentIcon,
|
|
5026
5430
|
DollarIcon,
|
|
5027
5431
|
DownloadIcon,
|
|
@@ -5066,6 +5470,16 @@ function Table({
|
|
|
5066
5470
|
HomeIcon,
|
|
5067
5471
|
InformationIcon,
|
|
5068
5472
|
Input,
|
|
5473
|
+
Item,
|
|
5474
|
+
ItemActions,
|
|
5475
|
+
ItemContent,
|
|
5476
|
+
ItemDescription,
|
|
5477
|
+
ItemFooter,
|
|
5478
|
+
ItemGroup,
|
|
5479
|
+
ItemHeader,
|
|
5480
|
+
ItemMedia,
|
|
5481
|
+
ItemSeparator,
|
|
5482
|
+
ItemTitle,
|
|
5069
5483
|
Label,
|
|
5070
5484
|
LineChart,
|
|
5071
5485
|
LocationIcon,
|
|
@@ -5145,6 +5559,8 @@ function Table({
|
|
|
5145
5559
|
getPerformanceColor,
|
|
5146
5560
|
getSeriesColor,
|
|
5147
5561
|
initializePdfWorker,
|
|
5562
|
+
itemMediaVariants,
|
|
5563
|
+
itemVariants,
|
|
5148
5564
|
selectTriggerVariants,
|
|
5149
5565
|
switchVariants,
|
|
5150
5566
|
tabsVariants,
|