@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.mjs
CHANGED
|
@@ -889,13 +889,136 @@ function FieldError({
|
|
|
889
889
|
);
|
|
890
890
|
}
|
|
891
891
|
|
|
892
|
-
// src/components/ui/
|
|
892
|
+
// src/components/ui/dialog.tsx
|
|
893
893
|
import * as React9 from "react";
|
|
894
|
-
import {
|
|
895
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
894
|
+
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
896
895
|
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
897
|
-
var
|
|
896
|
+
var DialogChromeContext = React9.createContext(null);
|
|
897
|
+
function useDialogChrome() {
|
|
898
|
+
return React9.useContext(DialogChromeContext) ?? { showCloseButton: false };
|
|
899
|
+
}
|
|
900
|
+
var DialogCloseControl = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs3(
|
|
901
|
+
DialogPrimitive.Close,
|
|
902
|
+
{
|
|
903
|
+
ref,
|
|
904
|
+
type: "button",
|
|
905
|
+
className: cn(
|
|
906
|
+
"shrink-0 rounded-md p-1 text-secondary transition-colors",
|
|
907
|
+
"hover:bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-interactive focus-visible:ring-offset-2",
|
|
908
|
+
className
|
|
909
|
+
),
|
|
910
|
+
...props,
|
|
911
|
+
children: [
|
|
912
|
+
/* @__PURE__ */ jsx10(CloseIcon, { size: 16, "aria-hidden": "true" }),
|
|
913
|
+
/* @__PURE__ */ jsx10("span", { className: "sr-only", children: "Close" })
|
|
914
|
+
]
|
|
915
|
+
}
|
|
916
|
+
));
|
|
917
|
+
DialogCloseControl.displayName = "DialogCloseControl";
|
|
918
|
+
var DIALOG_DESKTOP_FRAME = "h-[480px] w-[640px] max-w-[calc(100vw-2rem)] max-h-[calc(100dvh-2rem)]";
|
|
919
|
+
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";
|
|
920
|
+
var Dialog = DialogPrimitive.Root;
|
|
921
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
922
|
+
var DialogOverlay = React9.forwardRef(
|
|
923
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
924
|
+
DialogPrimitive.Backdrop,
|
|
925
|
+
{
|
|
926
|
+
ref,
|
|
927
|
+
className: cn(
|
|
928
|
+
"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",
|
|
929
|
+
className
|
|
930
|
+
),
|
|
931
|
+
...props
|
|
932
|
+
}
|
|
933
|
+
)
|
|
934
|
+
);
|
|
935
|
+
DialogOverlay.displayName = "DialogOverlay";
|
|
936
|
+
var DialogContent = React9.forwardRef(
|
|
937
|
+
({ className, children, showCloseButton = true, size = "desktop", ...props }, ref) => /* @__PURE__ */ jsxs3(DialogPrimitive.Portal, { children: [
|
|
938
|
+
/* @__PURE__ */ jsx10(DialogOverlay, {}),
|
|
939
|
+
/* @__PURE__ */ jsx10(DialogPrimitive.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__ */ jsx10(
|
|
940
|
+
DialogPrimitive.Popup,
|
|
941
|
+
{
|
|
942
|
+
ref,
|
|
943
|
+
"data-slot": "dialog",
|
|
944
|
+
className: cn(
|
|
945
|
+
"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",
|
|
946
|
+
size === "desktop" && DIALOG_DESKTOP_FRAME,
|
|
947
|
+
size === "mobile" && DIALOG_MOBILE_FRAME,
|
|
948
|
+
className
|
|
949
|
+
),
|
|
950
|
+
...props,
|
|
951
|
+
children: /* @__PURE__ */ jsx10(DialogChromeContext.Provider, { value: { showCloseButton }, children })
|
|
952
|
+
}
|
|
953
|
+
) })
|
|
954
|
+
] })
|
|
955
|
+
);
|
|
956
|
+
DialogContent.displayName = "DialogContent";
|
|
957
|
+
var DialogBody = React9.forwardRef(
|
|
958
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
959
|
+
"div",
|
|
960
|
+
{
|
|
961
|
+
ref,
|
|
962
|
+
"data-slot": "dialog-body",
|
|
963
|
+
className: cn(
|
|
964
|
+
"min-h-0 flex-1 overflow-y-auto overscroll-contain p-6",
|
|
965
|
+
className
|
|
966
|
+
),
|
|
967
|
+
...props
|
|
968
|
+
}
|
|
969
|
+
)
|
|
970
|
+
);
|
|
971
|
+
DialogBody.displayName = "DialogBody";
|
|
972
|
+
var DialogFooter = React9.forwardRef(
|
|
898
973
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
974
|
+
"div",
|
|
975
|
+
{
|
|
976
|
+
ref,
|
|
977
|
+
className: cn(
|
|
978
|
+
"shrink-0 flex flex-col-reverse gap-2 p-4 sm:flex-row sm:justify-end sm:gap-2",
|
|
979
|
+
className
|
|
980
|
+
),
|
|
981
|
+
...props
|
|
982
|
+
}
|
|
983
|
+
)
|
|
984
|
+
);
|
|
985
|
+
DialogFooter.displayName = "DialogFooter";
|
|
986
|
+
var DialogTitle = React9.forwardRef(
|
|
987
|
+
({ className, children, ...props }, ref) => {
|
|
988
|
+
const { showCloseButton } = useDialogChrome();
|
|
989
|
+
return /* @__PURE__ */ jsxs3("div", { className: "shrink-0 flex items-center justify-between p-4", children: [
|
|
990
|
+
/* @__PURE__ */ jsx10(
|
|
991
|
+
DialogPrimitive.Title,
|
|
992
|
+
{
|
|
993
|
+
ref,
|
|
994
|
+
className: cn("type-h4-medium text-default", className),
|
|
995
|
+
...props,
|
|
996
|
+
children
|
|
997
|
+
}
|
|
998
|
+
),
|
|
999
|
+
showCloseButton ? /* @__PURE__ */ jsx10(DialogCloseControl, {}) : null
|
|
1000
|
+
] });
|
|
1001
|
+
}
|
|
1002
|
+
);
|
|
1003
|
+
DialogTitle.displayName = "DialogTitle";
|
|
1004
|
+
var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
1005
|
+
DialogPrimitive.Description,
|
|
1006
|
+
{
|
|
1007
|
+
ref,
|
|
1008
|
+
className: cn("type-body-sm-regular text-secondary", className),
|
|
1009
|
+
...props
|
|
1010
|
+
}
|
|
1011
|
+
));
|
|
1012
|
+
DialogDescription.displayName = "DialogDescription";
|
|
1013
|
+
var DialogClose = DialogPrimitive.Close;
|
|
1014
|
+
|
|
1015
|
+
// src/components/ui/breadcrumb.tsx
|
|
1016
|
+
import * as React10 from "react";
|
|
1017
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
1018
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
1019
|
+
import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1020
|
+
var Breadcrumb = React10.forwardRef(
|
|
1021
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
899
1022
|
"nav",
|
|
900
1023
|
{
|
|
901
1024
|
"aria-label": "breadcrumb",
|
|
@@ -907,8 +1030,8 @@ var Breadcrumb = React9.forwardRef(
|
|
|
907
1030
|
)
|
|
908
1031
|
);
|
|
909
1032
|
Breadcrumb.displayName = "Breadcrumb";
|
|
910
|
-
var BreadcrumbList =
|
|
911
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1033
|
+
var BreadcrumbList = React10.forwardRef(
|
|
1034
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
912
1035
|
"ol",
|
|
913
1036
|
{
|
|
914
1037
|
"data-slot": "breadcrumb-list",
|
|
@@ -922,8 +1045,8 @@ var BreadcrumbList = React9.forwardRef(
|
|
|
922
1045
|
)
|
|
923
1046
|
);
|
|
924
1047
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
925
|
-
var BreadcrumbItem =
|
|
926
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1048
|
+
var BreadcrumbItem = React10.forwardRef(
|
|
1049
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
927
1050
|
"li",
|
|
928
1051
|
{
|
|
929
1052
|
"data-slot": "breadcrumb-item",
|
|
@@ -934,7 +1057,7 @@ var BreadcrumbItem = React9.forwardRef(
|
|
|
934
1057
|
)
|
|
935
1058
|
);
|
|
936
1059
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
937
|
-
var BreadcrumbLink =
|
|
1060
|
+
var BreadcrumbLink = React10.forwardRef(
|
|
938
1061
|
({ className, render, ...props }, ref) => useRender({
|
|
939
1062
|
ref,
|
|
940
1063
|
defaultTagName: "a",
|
|
@@ -951,8 +1074,8 @@ var BreadcrumbLink = React9.forwardRef(
|
|
|
951
1074
|
})
|
|
952
1075
|
);
|
|
953
1076
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
954
|
-
var BreadcrumbPage =
|
|
955
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1077
|
+
var BreadcrumbPage = React10.forwardRef(
|
|
1078
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
956
1079
|
"span",
|
|
957
1080
|
{
|
|
958
1081
|
"data-slot": "breadcrumb-page",
|
|
@@ -966,7 +1089,7 @@ var BreadcrumbPage = React9.forwardRef(
|
|
|
966
1089
|
)
|
|
967
1090
|
);
|
|
968
1091
|
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
969
|
-
var BreadcrumbSeparator =
|
|
1092
|
+
var BreadcrumbSeparator = React10.forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
970
1093
|
"li",
|
|
971
1094
|
{
|
|
972
1095
|
"data-slot": "breadcrumb-separator",
|
|
@@ -975,11 +1098,11 @@ var BreadcrumbSeparator = React9.forwardRef(({ children, className, ...props },
|
|
|
975
1098
|
className: cn("[&>svg]:size-3.5", className),
|
|
976
1099
|
ref,
|
|
977
1100
|
...props,
|
|
978
|
-
children: children ?? /* @__PURE__ */
|
|
1101
|
+
children: children ?? /* @__PURE__ */ jsx11(CaretRightIcon, { className: "cn-rtl-flip" })
|
|
979
1102
|
}
|
|
980
1103
|
));
|
|
981
1104
|
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
982
|
-
var BreadcrumbEllipsis =
|
|
1105
|
+
var BreadcrumbEllipsis = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs4(
|
|
983
1106
|
"span",
|
|
984
1107
|
{
|
|
985
1108
|
"data-slot": "breadcrumb-ellipsis",
|
|
@@ -992,22 +1115,22 @@ var BreadcrumbEllipsis = React9.forwardRef(({ className, ...props }, ref) => /*
|
|
|
992
1115
|
ref,
|
|
993
1116
|
...props,
|
|
994
1117
|
children: [
|
|
995
|
-
/* @__PURE__ */
|
|
996
|
-
/* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ jsx11(MoreMenuIcon, {}),
|
|
1119
|
+
/* @__PURE__ */ jsx11("span", { className: "sr-only", children: "More" })
|
|
997
1120
|
]
|
|
998
1121
|
}
|
|
999
1122
|
));
|
|
1000
1123
|
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
1001
1124
|
|
|
1002
1125
|
// src/components/ui/tooltip.tsx
|
|
1003
|
-
import * as
|
|
1126
|
+
import * as React11 from "react";
|
|
1004
1127
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
1005
|
-
import { jsx as
|
|
1128
|
+
import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1006
1129
|
function TooltipProvider({
|
|
1007
1130
|
delayDuration = 0,
|
|
1008
1131
|
...props
|
|
1009
1132
|
}) {
|
|
1010
|
-
return /* @__PURE__ */
|
|
1133
|
+
return /* @__PURE__ */ jsx12(
|
|
1011
1134
|
TooltipPrimitive.Provider,
|
|
1012
1135
|
{
|
|
1013
1136
|
"data-slot": "tooltip-provider",
|
|
@@ -1018,11 +1141,11 @@ function TooltipProvider({
|
|
|
1018
1141
|
}
|
|
1019
1142
|
TooltipProvider.displayName = "TooltipProvider";
|
|
1020
1143
|
function Tooltip({ delayDuration, ...props }) {
|
|
1021
|
-
return /* @__PURE__ */
|
|
1144
|
+
return /* @__PURE__ */ jsx12(TooltipProvider, { delayDuration, children: /* @__PURE__ */ jsx12(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
1022
1145
|
}
|
|
1023
1146
|
Tooltip.displayName = "Tooltip";
|
|
1024
|
-
var TooltipTrigger =
|
|
1025
|
-
return /* @__PURE__ */
|
|
1147
|
+
var TooltipTrigger = React11.forwardRef(({ ...props }, ref) => {
|
|
1148
|
+
return /* @__PURE__ */ jsx12(
|
|
1026
1149
|
TooltipPrimitive.Trigger,
|
|
1027
1150
|
{
|
|
1028
1151
|
ref,
|
|
@@ -1032,8 +1155,8 @@ var TooltipTrigger = React10.forwardRef(({ ...props }, ref) => {
|
|
|
1032
1155
|
);
|
|
1033
1156
|
});
|
|
1034
1157
|
TooltipTrigger.displayName = "TooltipTrigger";
|
|
1035
|
-
var TooltipContent =
|
|
1036
|
-
return /* @__PURE__ */
|
|
1158
|
+
var TooltipContent = React11.forwardRef(({ className, sideOffset = 2, children, ...props }, ref) => {
|
|
1159
|
+
return /* @__PURE__ */ jsx12(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs5(
|
|
1037
1160
|
TooltipPrimitive.Content,
|
|
1038
1161
|
{
|
|
1039
1162
|
ref,
|
|
@@ -1045,7 +1168,7 @@ var TooltipContent = React10.forwardRef(({ className, sideOffset = 2, children,
|
|
|
1045
1168
|
),
|
|
1046
1169
|
...props,
|
|
1047
1170
|
children: [
|
|
1048
|
-
/* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ jsx12(TooltipPrimitive.Arrow, { className: "fill-dark", width: 10, height: 9 }),
|
|
1049
1172
|
children
|
|
1050
1173
|
]
|
|
1051
1174
|
}
|
|
@@ -1054,21 +1177,21 @@ var TooltipContent = React10.forwardRef(({ className, sideOffset = 2, children,
|
|
|
1054
1177
|
TooltipContent.displayName = "TooltipContent";
|
|
1055
1178
|
|
|
1056
1179
|
// src/components/ui/sidebar.tsx
|
|
1057
|
-
import * as
|
|
1058
|
-
import { jsx as
|
|
1180
|
+
import * as React12 from "react";
|
|
1181
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1059
1182
|
var SIDEBAR_CONSTANTS = {
|
|
1060
1183
|
WIDTH: "144px",
|
|
1061
1184
|
WIDTH_ICON: "48px"
|
|
1062
1185
|
};
|
|
1063
|
-
var SidebarContext =
|
|
1186
|
+
var SidebarContext = React12.createContext(null);
|
|
1064
1187
|
function useSidebar() {
|
|
1065
|
-
const context =
|
|
1188
|
+
const context = React12.useContext(SidebarContext);
|
|
1066
1189
|
if (!context) {
|
|
1067
1190
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
1068
1191
|
}
|
|
1069
1192
|
return context;
|
|
1070
1193
|
}
|
|
1071
|
-
var SidebarProvider =
|
|
1194
|
+
var SidebarProvider = React12.forwardRef(
|
|
1072
1195
|
({
|
|
1073
1196
|
defaultOpen = true,
|
|
1074
1197
|
open: openProp,
|
|
@@ -1078,9 +1201,9 @@ var SidebarProvider = React11.forwardRef(
|
|
|
1078
1201
|
children,
|
|
1079
1202
|
...props
|
|
1080
1203
|
}, ref) => {
|
|
1081
|
-
const [_open, _setOpen] =
|
|
1204
|
+
const [_open, _setOpen] = React12.useState(defaultOpen);
|
|
1082
1205
|
const open = openProp ?? _open;
|
|
1083
|
-
const setOpen =
|
|
1206
|
+
const setOpen = React12.useCallback(
|
|
1084
1207
|
(value) => {
|
|
1085
1208
|
const openState = typeof value === "function" ? value(open) : value;
|
|
1086
1209
|
if (setOpenProp) {
|
|
@@ -1091,11 +1214,11 @@ var SidebarProvider = React11.forwardRef(
|
|
|
1091
1214
|
},
|
|
1092
1215
|
[setOpenProp, open]
|
|
1093
1216
|
);
|
|
1094
|
-
const toggleSidebar =
|
|
1217
|
+
const toggleSidebar = React12.useCallback(() => {
|
|
1095
1218
|
return setOpen((open2) => !open2);
|
|
1096
1219
|
}, [setOpen]);
|
|
1097
1220
|
const state = open ? "expanded" : "collapsed";
|
|
1098
|
-
const contextValue =
|
|
1221
|
+
const contextValue = React12.useMemo(
|
|
1099
1222
|
() => ({
|
|
1100
1223
|
state,
|
|
1101
1224
|
open,
|
|
@@ -1104,7 +1227,7 @@ var SidebarProvider = React11.forwardRef(
|
|
|
1104
1227
|
}),
|
|
1105
1228
|
[state, open, setOpen, toggleSidebar]
|
|
1106
1229
|
);
|
|
1107
|
-
return /* @__PURE__ */
|
|
1230
|
+
return /* @__PURE__ */ jsx13(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx13(
|
|
1108
1231
|
"div",
|
|
1109
1232
|
{
|
|
1110
1233
|
style: {
|
|
@@ -1124,10 +1247,10 @@ var SidebarProvider = React11.forwardRef(
|
|
|
1124
1247
|
}
|
|
1125
1248
|
);
|
|
1126
1249
|
SidebarProvider.displayName = "SidebarProvider";
|
|
1127
|
-
var Sidebar =
|
|
1250
|
+
var Sidebar = React12.forwardRef(
|
|
1128
1251
|
({ collapsible = "icon", className, children, ...props }, ref) => {
|
|
1129
1252
|
const { state } = useSidebar();
|
|
1130
|
-
return /* @__PURE__ */
|
|
1253
|
+
return /* @__PURE__ */ jsxs6(
|
|
1131
1254
|
"aside",
|
|
1132
1255
|
{
|
|
1133
1256
|
ref,
|
|
@@ -1138,7 +1261,7 @@ var Sidebar = React11.forwardRef(
|
|
|
1138
1261
|
"aria-expanded": state === "expanded",
|
|
1139
1262
|
role: "navigation",
|
|
1140
1263
|
children: [
|
|
1141
|
-
/* @__PURE__ */
|
|
1264
|
+
/* @__PURE__ */ jsx13(
|
|
1142
1265
|
"div",
|
|
1143
1266
|
{
|
|
1144
1267
|
className: cn(
|
|
@@ -1147,7 +1270,7 @@ var Sidebar = React11.forwardRef(
|
|
|
1147
1270
|
)
|
|
1148
1271
|
}
|
|
1149
1272
|
),
|
|
1150
|
-
/* @__PURE__ */
|
|
1273
|
+
/* @__PURE__ */ jsx13(
|
|
1151
1274
|
"div",
|
|
1152
1275
|
{
|
|
1153
1276
|
className: cn(
|
|
@@ -1156,7 +1279,7 @@ var Sidebar = React11.forwardRef(
|
|
|
1156
1279
|
className
|
|
1157
1280
|
),
|
|
1158
1281
|
...props,
|
|
1159
|
-
children: /* @__PURE__ */
|
|
1282
|
+
children: /* @__PURE__ */ jsx13(
|
|
1160
1283
|
"div",
|
|
1161
1284
|
{
|
|
1162
1285
|
"data-sidebar": "sidebar",
|
|
@@ -1172,9 +1295,9 @@ var Sidebar = React11.forwardRef(
|
|
|
1172
1295
|
}
|
|
1173
1296
|
);
|
|
1174
1297
|
Sidebar.displayName = "Sidebar";
|
|
1175
|
-
var SidebarInset =
|
|
1298
|
+
var SidebarInset = React12.forwardRef(
|
|
1176
1299
|
({ className, ...props }, ref) => {
|
|
1177
|
-
return /* @__PURE__ */
|
|
1300
|
+
return /* @__PURE__ */ jsx13(
|
|
1178
1301
|
"main",
|
|
1179
1302
|
{
|
|
1180
1303
|
ref,
|
|
@@ -1188,9 +1311,9 @@ var SidebarInset = React11.forwardRef(
|
|
|
1188
1311
|
}
|
|
1189
1312
|
);
|
|
1190
1313
|
SidebarInset.displayName = "SidebarInset";
|
|
1191
|
-
var SidebarHeader =
|
|
1314
|
+
var SidebarHeader = React12.forwardRef(
|
|
1192
1315
|
({ className, ...props }, ref) => {
|
|
1193
|
-
return /* @__PURE__ */
|
|
1316
|
+
return /* @__PURE__ */ jsx13(
|
|
1194
1317
|
"div",
|
|
1195
1318
|
{
|
|
1196
1319
|
ref,
|
|
@@ -1206,9 +1329,9 @@ var SidebarHeader = React11.forwardRef(
|
|
|
1206
1329
|
}
|
|
1207
1330
|
);
|
|
1208
1331
|
SidebarHeader.displayName = "SidebarHeader";
|
|
1209
|
-
var SidebarFooter =
|
|
1332
|
+
var SidebarFooter = React12.forwardRef(
|
|
1210
1333
|
({ className, ...props }, ref) => {
|
|
1211
|
-
return /* @__PURE__ */
|
|
1334
|
+
return /* @__PURE__ */ jsx13(
|
|
1212
1335
|
"div",
|
|
1213
1336
|
{
|
|
1214
1337
|
ref,
|
|
@@ -1220,9 +1343,9 @@ var SidebarFooter = React11.forwardRef(
|
|
|
1220
1343
|
}
|
|
1221
1344
|
);
|
|
1222
1345
|
SidebarFooter.displayName = "SidebarFooter";
|
|
1223
|
-
var SidebarContent =
|
|
1346
|
+
var SidebarContent = React12.forwardRef(
|
|
1224
1347
|
({ className, ...props }, ref) => {
|
|
1225
|
-
return /* @__PURE__ */
|
|
1348
|
+
return /* @__PURE__ */ jsx13(
|
|
1226
1349
|
"div",
|
|
1227
1350
|
{
|
|
1228
1351
|
ref,
|
|
@@ -1237,9 +1360,9 @@ var SidebarContent = React11.forwardRef(
|
|
|
1237
1360
|
}
|
|
1238
1361
|
);
|
|
1239
1362
|
SidebarContent.displayName = "SidebarContent";
|
|
1240
|
-
var SidebarGroup =
|
|
1363
|
+
var SidebarGroup = React12.forwardRef(
|
|
1241
1364
|
({ className, ...props }, ref) => {
|
|
1242
|
-
return /* @__PURE__ */
|
|
1365
|
+
return /* @__PURE__ */ jsx13(
|
|
1243
1366
|
"div",
|
|
1244
1367
|
{
|
|
1245
1368
|
ref,
|
|
@@ -1251,7 +1374,7 @@ var SidebarGroup = React11.forwardRef(
|
|
|
1251
1374
|
}
|
|
1252
1375
|
);
|
|
1253
1376
|
SidebarGroup.displayName = "SidebarGroup";
|
|
1254
|
-
var SidebarGroupContent =
|
|
1377
|
+
var SidebarGroupContent = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1255
1378
|
"div",
|
|
1256
1379
|
{
|
|
1257
1380
|
ref,
|
|
@@ -1261,8 +1384,8 @@ var SidebarGroupContent = React11.forwardRef(({ className, ...props }, ref) => /
|
|
|
1261
1384
|
}
|
|
1262
1385
|
));
|
|
1263
1386
|
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
1264
|
-
var SidebarMenu =
|
|
1265
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1387
|
+
var SidebarMenu = React12.forwardRef(
|
|
1388
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1266
1389
|
"ul",
|
|
1267
1390
|
{
|
|
1268
1391
|
ref,
|
|
@@ -1273,8 +1396,8 @@ var SidebarMenu = React11.forwardRef(
|
|
|
1273
1396
|
)
|
|
1274
1397
|
);
|
|
1275
1398
|
SidebarMenu.displayName = "SidebarMenu";
|
|
1276
|
-
var SidebarMenuItem =
|
|
1277
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
1399
|
+
var SidebarMenuItem = React12.forwardRef(
|
|
1400
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1278
1401
|
"li",
|
|
1279
1402
|
{
|
|
1280
1403
|
ref,
|
|
@@ -1285,9 +1408,9 @@ var SidebarMenuItem = React11.forwardRef(
|
|
|
1285
1408
|
)
|
|
1286
1409
|
);
|
|
1287
1410
|
SidebarMenuItem.displayName = "SidebarMenuItem";
|
|
1288
|
-
var SidebarMenuButton =
|
|
1411
|
+
var SidebarMenuButton = React12.forwardRef(({ isActive = false, tooltip, className, children, ...props }, ref) => {
|
|
1289
1412
|
const { state } = useSidebar();
|
|
1290
|
-
const button = /* @__PURE__ */
|
|
1413
|
+
const button = /* @__PURE__ */ jsx13(
|
|
1291
1414
|
"button",
|
|
1292
1415
|
{
|
|
1293
1416
|
ref,
|
|
@@ -1306,22 +1429,22 @@ var SidebarMenuButton = React11.forwardRef(({ isActive = false, tooltip, classNa
|
|
|
1306
1429
|
return button;
|
|
1307
1430
|
}
|
|
1308
1431
|
const tooltipProps = typeof tooltip === "string" ? { children: tooltip } : tooltip;
|
|
1309
|
-
return /* @__PURE__ */
|
|
1310
|
-
/* @__PURE__ */
|
|
1311
|
-
/* @__PURE__ */
|
|
1432
|
+
return /* @__PURE__ */ jsxs6(Tooltip, { delayDuration: 0, children: [
|
|
1433
|
+
/* @__PURE__ */ jsx13(TooltipTrigger, { asChild: true, children: button }),
|
|
1434
|
+
/* @__PURE__ */ jsx13(TooltipContent, { side: "right", align: "center", ...tooltipProps })
|
|
1312
1435
|
] });
|
|
1313
1436
|
});
|
|
1314
1437
|
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
1315
1438
|
|
|
1316
1439
|
// src/components/ui/date-picker.tsx
|
|
1317
|
-
import * as
|
|
1440
|
+
import * as React14 from "react";
|
|
1318
1441
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1319
1442
|
|
|
1320
1443
|
// src/components/ui/input.tsx
|
|
1321
|
-
import * as
|
|
1322
|
-
import { jsx as
|
|
1444
|
+
import * as React13 from "react";
|
|
1445
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1323
1446
|
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";
|
|
1324
|
-
var Input =
|
|
1447
|
+
var Input = React13.forwardRef(
|
|
1325
1448
|
({
|
|
1326
1449
|
className,
|
|
1327
1450
|
style,
|
|
@@ -1332,7 +1455,7 @@ var Input = React12.forwardRef(
|
|
|
1332
1455
|
readOnly,
|
|
1333
1456
|
...props
|
|
1334
1457
|
}, ref) => {
|
|
1335
|
-
const [internalValue, setInternalValue] =
|
|
1458
|
+
const [internalValue, setInternalValue] = React13.useState(value || "");
|
|
1336
1459
|
const isControlled = value !== void 0;
|
|
1337
1460
|
const currentValue = isControlled ? value : internalValue;
|
|
1338
1461
|
const showClear = showClearProp !== false && currentValue && currentValue.toString().length > 0 && !readOnly;
|
|
@@ -1362,8 +1485,8 @@ var Input = React12.forwardRef(
|
|
|
1362
1485
|
}
|
|
1363
1486
|
onClear?.();
|
|
1364
1487
|
};
|
|
1365
|
-
return /* @__PURE__ */
|
|
1366
|
-
/* @__PURE__ */
|
|
1488
|
+
return /* @__PURE__ */ jsxs7("div", { className: "relative", children: [
|
|
1489
|
+
/* @__PURE__ */ jsx14(
|
|
1367
1490
|
"input",
|
|
1368
1491
|
{
|
|
1369
1492
|
className: cn(
|
|
@@ -1379,23 +1502,23 @@ var Input = React12.forwardRef(
|
|
|
1379
1502
|
...props
|
|
1380
1503
|
}
|
|
1381
1504
|
),
|
|
1382
|
-
showClear && /* @__PURE__ */
|
|
1505
|
+
showClear && /* @__PURE__ */ jsx14(
|
|
1383
1506
|
"button",
|
|
1384
1507
|
{
|
|
1385
1508
|
type: "button",
|
|
1386
1509
|
onClick: handleClear,
|
|
1387
1510
|
className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-secondary hover:text-dark transition-colors",
|
|
1388
|
-
children: /* @__PURE__ */
|
|
1511
|
+
children: /* @__PURE__ */ jsx14(CloseIcon, {})
|
|
1389
1512
|
}
|
|
1390
1513
|
),
|
|
1391
|
-
showLock && /* @__PURE__ */
|
|
1514
|
+
showLock && /* @__PURE__ */ jsx14(LockIcon, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 text-secondary" })
|
|
1392
1515
|
] });
|
|
1393
1516
|
}
|
|
1394
1517
|
);
|
|
1395
1518
|
Input.displayName = "Input";
|
|
1396
1519
|
|
|
1397
1520
|
// src/components/ui/date-picker.tsx
|
|
1398
|
-
import { jsx as
|
|
1521
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1399
1522
|
var getDayNames = () => {
|
|
1400
1523
|
const days = [];
|
|
1401
1524
|
for (let i = 0; i < 7; i++) {
|
|
@@ -1431,7 +1554,7 @@ var formatDateInput = (date) => {
|
|
|
1431
1554
|
day: "2-digit"
|
|
1432
1555
|
});
|
|
1433
1556
|
};
|
|
1434
|
-
var DatePicker =
|
|
1557
|
+
var DatePicker = React14.forwardRef(
|
|
1435
1558
|
({
|
|
1436
1559
|
value,
|
|
1437
1560
|
onValueChange,
|
|
@@ -1450,19 +1573,19 @@ var DatePicker = React13.forwardRef(
|
|
|
1450
1573
|
if (isNaN(parsed.getTime())) return void 0;
|
|
1451
1574
|
return parsed;
|
|
1452
1575
|
};
|
|
1453
|
-
const [selectedDate, setSelectedDate] =
|
|
1576
|
+
const [selectedDate, setSelectedDate] = React14.useState(
|
|
1454
1577
|
value || parseDate(defaultValue)
|
|
1455
1578
|
);
|
|
1456
|
-
const [currentMonth, setCurrentMonth] =
|
|
1579
|
+
const [currentMonth, setCurrentMonth] = React14.useState(() => {
|
|
1457
1580
|
const date = value || parseDate(defaultValue) || /* @__PURE__ */ new Date();
|
|
1458
1581
|
return new Date(date.getFullYear(), date.getMonth());
|
|
1459
1582
|
});
|
|
1460
|
-
const [open, setOpen] =
|
|
1461
|
-
const [inputValue, setInputValue] =
|
|
1583
|
+
const [open, setOpen] = React14.useState(false);
|
|
1584
|
+
const [inputValue, setInputValue] = React14.useState(() => {
|
|
1462
1585
|
const initialDate = value || parseDate(defaultValue);
|
|
1463
1586
|
return initialDate ? formatDateInput(initialDate) : "";
|
|
1464
1587
|
});
|
|
1465
|
-
|
|
1588
|
+
React14.useEffect(() => {
|
|
1466
1589
|
setSelectedDate(value);
|
|
1467
1590
|
if (value) {
|
|
1468
1591
|
setCurrentMonth(new Date(value.getFullYear(), value.getMonth()));
|
|
@@ -1473,7 +1596,7 @@ var DatePicker = React13.forwardRef(
|
|
|
1473
1596
|
setInputValue("");
|
|
1474
1597
|
}
|
|
1475
1598
|
}, [value]);
|
|
1476
|
-
|
|
1599
|
+
React14.useEffect(() => {
|
|
1477
1600
|
if (value) return;
|
|
1478
1601
|
const parsedDefault = parseDate(defaultValue);
|
|
1479
1602
|
if (!parsedDefault) return;
|
|
@@ -1596,14 +1719,14 @@ var DatePicker = React13.forwardRef(
|
|
|
1596
1719
|
const months = getMonthNames();
|
|
1597
1720
|
const dayNames = getDayNames();
|
|
1598
1721
|
const years = generateYears();
|
|
1599
|
-
return /* @__PURE__ */
|
|
1722
|
+
return /* @__PURE__ */ jsxs8(
|
|
1600
1723
|
PopoverPrimitive.Root,
|
|
1601
1724
|
{
|
|
1602
1725
|
open: disabled ? false : open,
|
|
1603
1726
|
onOpenChange: disabled ? void 0 : setOpen,
|
|
1604
1727
|
children: [
|
|
1605
|
-
/* @__PURE__ */
|
|
1606
|
-
/* @__PURE__ */
|
|
1728
|
+
/* @__PURE__ */ jsxs8("div", { className: "relative", children: [
|
|
1729
|
+
/* @__PURE__ */ jsx15(
|
|
1607
1730
|
Input,
|
|
1608
1731
|
{
|
|
1609
1732
|
ref,
|
|
@@ -1616,7 +1739,7 @@ var DatePicker = React13.forwardRef(
|
|
|
1616
1739
|
...props
|
|
1617
1740
|
}
|
|
1618
1741
|
),
|
|
1619
|
-
/* @__PURE__ */
|
|
1742
|
+
/* @__PURE__ */ jsx15(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsx15("button", { className: "absolute right-3 top-1/2 transform -translate-y-1/2 hover:bg-gray rounded p-0.5 transition-colors", children: /* @__PURE__ */ jsx15(
|
|
1620
1743
|
CalendarIcon,
|
|
1621
1744
|
{
|
|
1622
1745
|
size: 20,
|
|
@@ -1627,7 +1750,7 @@ var DatePicker = React13.forwardRef(
|
|
|
1627
1750
|
}
|
|
1628
1751
|
) }) })
|
|
1629
1752
|
] }),
|
|
1630
|
-
/* @__PURE__ */
|
|
1753
|
+
/* @__PURE__ */ jsx15(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx15(
|
|
1631
1754
|
PopoverPrimitive.Content,
|
|
1632
1755
|
{
|
|
1633
1756
|
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",
|
|
@@ -1636,51 +1759,51 @@ var DatePicker = React13.forwardRef(
|
|
|
1636
1759
|
alignOffset: -12,
|
|
1637
1760
|
side: "bottom",
|
|
1638
1761
|
sticky: "always",
|
|
1639
|
-
children: /* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1762
|
+
children: /* @__PURE__ */ jsxs8("div", { className: "p-4", children: [
|
|
1763
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between mb-4 gap-1", children: [
|
|
1764
|
+
/* @__PURE__ */ jsx15(
|
|
1642
1765
|
"button",
|
|
1643
1766
|
{
|
|
1644
1767
|
onClick: () => handleMonthChange("prev"),
|
|
1645
1768
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
1646
|
-
children: /* @__PURE__ */
|
|
1769
|
+
children: /* @__PURE__ */ jsx15(ArrowLeftIcon, {})
|
|
1647
1770
|
}
|
|
1648
1771
|
),
|
|
1649
|
-
/* @__PURE__ */
|
|
1650
|
-
/* @__PURE__ */
|
|
1772
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex gap-1 flex-1 min-w-0", children: [
|
|
1773
|
+
/* @__PURE__ */ jsxs8(
|
|
1651
1774
|
Select,
|
|
1652
1775
|
{
|
|
1653
1776
|
value: currentMonth.getMonth().toString(),
|
|
1654
1777
|
onValueChange: handleMonthSelect,
|
|
1655
1778
|
children: [
|
|
1656
|
-
/* @__PURE__ */
|
|
1657
|
-
/* @__PURE__ */
|
|
1779
|
+
/* @__PURE__ */ jsx15(SelectTrigger, { className: "min-w-fit h-8 text-sm", children: /* @__PURE__ */ jsx15(SelectValue, {}) }),
|
|
1780
|
+
/* @__PURE__ */ jsx15(SelectContent, { children: months.map((month, index) => /* @__PURE__ */ jsx15(SelectItem, { value: index.toString(), children: month }, month)) })
|
|
1658
1781
|
]
|
|
1659
1782
|
}
|
|
1660
1783
|
),
|
|
1661
|
-
/* @__PURE__ */
|
|
1784
|
+
/* @__PURE__ */ jsxs8(
|
|
1662
1785
|
Select,
|
|
1663
1786
|
{
|
|
1664
1787
|
value: currentMonth.getFullYear().toString(),
|
|
1665
1788
|
onValueChange: handleYearSelect,
|
|
1666
1789
|
children: [
|
|
1667
|
-
/* @__PURE__ */
|
|
1668
|
-
/* @__PURE__ */
|
|
1790
|
+
/* @__PURE__ */ jsx15(SelectTrigger, { className: "min-w-fit h-8 text-sm", children: /* @__PURE__ */ jsx15(SelectValue, {}) }),
|
|
1791
|
+
/* @__PURE__ */ jsx15(SelectContent, { children: years.map((year) => /* @__PURE__ */ jsx15(SelectItem, { value: year.toString(), children: year }, year)) })
|
|
1669
1792
|
]
|
|
1670
1793
|
}
|
|
1671
1794
|
)
|
|
1672
1795
|
] }),
|
|
1673
|
-
/* @__PURE__ */
|
|
1796
|
+
/* @__PURE__ */ jsx15(
|
|
1674
1797
|
"button",
|
|
1675
1798
|
{
|
|
1676
1799
|
onClick: () => handleMonthChange("next"),
|
|
1677
1800
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
1678
|
-
children: /* @__PURE__ */
|
|
1801
|
+
children: /* @__PURE__ */ jsx15(ArrowRightIcon, {})
|
|
1679
1802
|
}
|
|
1680
1803
|
)
|
|
1681
1804
|
] }),
|
|
1682
|
-
/* @__PURE__ */
|
|
1683
|
-
/* @__PURE__ */
|
|
1805
|
+
/* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
|
|
1806
|
+
/* @__PURE__ */ jsx15("div", { className: "grid grid-cols-7 gap-1 mb-2", children: dayNames.map((day) => /* @__PURE__ */ jsx15(
|
|
1684
1807
|
Typography,
|
|
1685
1808
|
{
|
|
1686
1809
|
variant: "label-xs-bold",
|
|
@@ -1690,11 +1813,11 @@ var DatePicker = React13.forwardRef(
|
|
|
1690
1813
|
},
|
|
1691
1814
|
day
|
|
1692
1815
|
)) }),
|
|
1693
|
-
/* @__PURE__ */
|
|
1816
|
+
/* @__PURE__ */ jsx15("div", { className: "grid grid-cols-7 gap-1", children: days.map((date, index) => /* @__PURE__ */ jsx15(
|
|
1694
1817
|
"div",
|
|
1695
1818
|
{
|
|
1696
1819
|
className: "h-8 w-8 flex items-center justify-center",
|
|
1697
|
-
children: date && /* @__PURE__ */
|
|
1820
|
+
children: date && /* @__PURE__ */ jsx15(
|
|
1698
1821
|
"button",
|
|
1699
1822
|
{
|
|
1700
1823
|
onClick: () => handleDateSelect(date),
|
|
@@ -1708,7 +1831,7 @@ var DatePicker = React13.forwardRef(
|
|
|
1708
1831
|
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",
|
|
1709
1832
|
isDateDisabled(date) && "text-secondary/40 cursor-not-allowed opacity-50"
|
|
1710
1833
|
),
|
|
1711
|
-
children: /* @__PURE__ */
|
|
1834
|
+
children: /* @__PURE__ */ jsx15(Typography, { variant: "label-sm", as: "span", children: date.getDate() })
|
|
1712
1835
|
}
|
|
1713
1836
|
)
|
|
1714
1837
|
},
|
|
@@ -1726,9 +1849,9 @@ var DatePicker = React13.forwardRef(
|
|
|
1726
1849
|
DatePicker.displayName = "DatePicker";
|
|
1727
1850
|
|
|
1728
1851
|
// src/components/ui/upload.tsx
|
|
1729
|
-
import * as
|
|
1852
|
+
import * as React15 from "react";
|
|
1730
1853
|
import { cva as cva7 } from "class-variance-authority";
|
|
1731
|
-
import { jsx as
|
|
1854
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1732
1855
|
var DEFAULT_MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
1733
1856
|
var uploadVariants = cva7(
|
|
1734
1857
|
"relative flex flex-col items-center justify-center rounded-lg transition-all duration-200 ease-in-out overflow-hidden",
|
|
@@ -1752,7 +1875,7 @@ var uploadVariants = cva7(
|
|
|
1752
1875
|
}
|
|
1753
1876
|
}
|
|
1754
1877
|
);
|
|
1755
|
-
var Upload =
|
|
1878
|
+
var Upload = React15.forwardRef(
|
|
1756
1879
|
({
|
|
1757
1880
|
className,
|
|
1758
1881
|
onFileSelect,
|
|
@@ -1765,8 +1888,8 @@ var Upload = React14.forwardRef(
|
|
|
1765
1888
|
selectedFiles = [],
|
|
1766
1889
|
...props
|
|
1767
1890
|
}, ref) => {
|
|
1768
|
-
const fileInputRef =
|
|
1769
|
-
const [isDragOver, setIsDragOver] =
|
|
1891
|
+
const fileInputRef = React15.useRef(null);
|
|
1892
|
+
const [isDragOver, setIsDragOver] = React15.useState(false);
|
|
1770
1893
|
const getFileTypeDisplay = () => {
|
|
1771
1894
|
const typeMap = {
|
|
1772
1895
|
"application/pdf": "PDF",
|
|
@@ -1830,17 +1953,17 @@ var Upload = React14.forwardRef(
|
|
|
1830
1953
|
const renderContent = () => {
|
|
1831
1954
|
switch (effectiveState) {
|
|
1832
1955
|
case "error":
|
|
1833
|
-
return /* @__PURE__ */
|
|
1956
|
+
return /* @__PURE__ */ jsxs9(
|
|
1834
1957
|
"div",
|
|
1835
1958
|
{
|
|
1836
1959
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
1837
1960
|
style: { gap: "32px" },
|
|
1838
1961
|
children: [
|
|
1839
|
-
/* @__PURE__ */
|
|
1840
|
-
/* @__PURE__ */
|
|
1841
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ jsxs9("div", { className: "space-y-4", children: [
|
|
1963
|
+
/* @__PURE__ */ jsx16(Typography, { variant: "heading-lg", children: "Upload fail" }),
|
|
1964
|
+
/* @__PURE__ */ jsx16(Typography, { variant: "body-md", className: "text-error", children: errorMessage })
|
|
1842
1965
|
] }),
|
|
1843
|
-
/* @__PURE__ */
|
|
1966
|
+
/* @__PURE__ */ jsx16(
|
|
1844
1967
|
Button,
|
|
1845
1968
|
{
|
|
1846
1969
|
variant: "destructive",
|
|
@@ -1854,22 +1977,22 @@ var Upload = React14.forwardRef(
|
|
|
1854
1977
|
}
|
|
1855
1978
|
);
|
|
1856
1979
|
case "uploading":
|
|
1857
|
-
return /* @__PURE__ */
|
|
1980
|
+
return /* @__PURE__ */ jsxs9(
|
|
1858
1981
|
"div",
|
|
1859
1982
|
{
|
|
1860
1983
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
1861
1984
|
style: { gap: "32px" },
|
|
1862
1985
|
children: [
|
|
1863
|
-
/* @__PURE__ */
|
|
1864
|
-
/* @__PURE__ */
|
|
1865
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ jsx16(Typography, { variant: "heading-lg", className: "text-dark", children: "Uploading files" }),
|
|
1987
|
+
/* @__PURE__ */ jsxs9("div", { className: "w-full max-w-[720px] space-y-2", children: [
|
|
1988
|
+
/* @__PURE__ */ jsx16("div", { className: "w-full bg-gray rounded-full h-2", children: /* @__PURE__ */ jsx16(
|
|
1866
1989
|
"div",
|
|
1867
1990
|
{
|
|
1868
1991
|
className: "bg-canvas-primary h-2 rounded-full transition-all duration-300 ease-in-out",
|
|
1869
1992
|
style: { width: `${progress}%` }
|
|
1870
1993
|
}
|
|
1871
1994
|
) }),
|
|
1872
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ jsxs9(
|
|
1873
1996
|
Typography,
|
|
1874
1997
|
{
|
|
1875
1998
|
variant: "body-sm",
|
|
@@ -1885,29 +2008,29 @@ var Upload = React14.forwardRef(
|
|
|
1885
2008
|
}
|
|
1886
2009
|
);
|
|
1887
2010
|
case "success":
|
|
1888
|
-
return /* @__PURE__ */
|
|
2011
|
+
return /* @__PURE__ */ jsx16(
|
|
1889
2012
|
"div",
|
|
1890
2013
|
{
|
|
1891
2014
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
1892
2015
|
style: { gap: "32px" },
|
|
1893
|
-
children: /* @__PURE__ */
|
|
1894
|
-
/* @__PURE__ */
|
|
1895
|
-
selectedFiles.length > 0 && /* @__PURE__ */
|
|
2016
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "space-y-4", children: [
|
|
2017
|
+
/* @__PURE__ */ jsx16(Typography, { variant: "heading-lg", className: "text-success", children: "Upload successful!" }),
|
|
2018
|
+
selectedFiles.length > 0 && /* @__PURE__ */ jsx16("div", { className: "text-center", children: selectedFiles.map((file, index) => /* @__PURE__ */ jsx16(Typography, { variant: "body-sm", children: file.name }, index)) })
|
|
1896
2019
|
] })
|
|
1897
2020
|
}
|
|
1898
2021
|
);
|
|
1899
2022
|
default:
|
|
1900
|
-
return /* @__PURE__ */
|
|
2023
|
+
return /* @__PURE__ */ jsxs9(
|
|
1901
2024
|
"div",
|
|
1902
2025
|
{
|
|
1903
2026
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
1904
2027
|
style: { gap: "32px" },
|
|
1905
2028
|
children: [
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
-
/* @__PURE__ */
|
|
1908
|
-
/* @__PURE__ */
|
|
2029
|
+
/* @__PURE__ */ jsxs9("div", { className: "space-y-4", children: [
|
|
2030
|
+
/* @__PURE__ */ jsx16(Typography, { variant: "heading-lg", className: "text-dark", children: "Drag & drop files here" }),
|
|
2031
|
+
/* @__PURE__ */ jsx16(Typography, { variant: "body-md", className: "text-secondary", children: "or click to browse from your computer" })
|
|
1909
2032
|
] }),
|
|
1910
|
-
/* @__PURE__ */
|
|
2033
|
+
/* @__PURE__ */ jsx16(
|
|
1911
2034
|
Button,
|
|
1912
2035
|
{
|
|
1913
2036
|
variant: "default",
|
|
@@ -1921,10 +2044,10 @@ var Upload = React14.forwardRef(
|
|
|
1921
2044
|
children: "Choose files"
|
|
1922
2045
|
}
|
|
1923
2046
|
),
|
|
1924
|
-
/* @__PURE__ */
|
|
2047
|
+
/* @__PURE__ */ jsxs9(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
1925
2048
|
"Supported file: ",
|
|
1926
2049
|
getFileTypeDisplay(),
|
|
1927
|
-
/* @__PURE__ */
|
|
2050
|
+
/* @__PURE__ */ jsx16("br", {}),
|
|
1928
2051
|
"Max: ",
|
|
1929
2052
|
Math.round(maxFileSize / 1024 / 1024),
|
|
1930
2053
|
" MB each"
|
|
@@ -1934,7 +2057,7 @@ var Upload = React14.forwardRef(
|
|
|
1934
2057
|
);
|
|
1935
2058
|
}
|
|
1936
2059
|
};
|
|
1937
|
-
return /* @__PURE__ */
|
|
2060
|
+
return /* @__PURE__ */ jsxs9(
|
|
1938
2061
|
"div",
|
|
1939
2062
|
{
|
|
1940
2063
|
ref,
|
|
@@ -1958,7 +2081,7 @@ var Upload = React14.forwardRef(
|
|
|
1958
2081
|
"aria-disabled": disabled,
|
|
1959
2082
|
...props,
|
|
1960
2083
|
children: [
|
|
1961
|
-
/* @__PURE__ */
|
|
2084
|
+
/* @__PURE__ */ jsx16(
|
|
1962
2085
|
"input",
|
|
1963
2086
|
{
|
|
1964
2087
|
ref: fileInputRef,
|
|
@@ -1978,29 +2101,75 @@ var Upload = React14.forwardRef(
|
|
|
1978
2101
|
Upload.displayName = "Upload";
|
|
1979
2102
|
|
|
1980
2103
|
// src/components/ui/checkbox.tsx
|
|
1981
|
-
import * as
|
|
1982
|
-
import
|
|
2104
|
+
import * as React16 from "react";
|
|
2105
|
+
import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
|
|
1983
2106
|
import { cva as cva8 } from "class-variance-authority";
|
|
1984
|
-
import { jsx as
|
|
1985
|
-
var checkboxVariants = cva8(
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
2107
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2108
|
+
var checkboxVariants = cva8([
|
|
2109
|
+
// Base layout & appearance
|
|
2110
|
+
"peer group relative size-4 shrink-0",
|
|
2111
|
+
"rounded-xs border border-default surface-default shadow-xs",
|
|
2112
|
+
// Transitions & hover
|
|
2113
|
+
"transition-colors hover:brightness-[90%]",
|
|
2114
|
+
// Focus
|
|
2115
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-default",
|
|
2116
|
+
// Disabled
|
|
2117
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
|
2118
|
+
// Checked
|
|
2119
|
+
"data-[checked]:border-0 data-[checked]:focus-visible:border-0",
|
|
2120
|
+
"data-[checked]:interactive-accent data-[checked]:interactive-accent-fg",
|
|
2121
|
+
// Indeterminate
|
|
2122
|
+
"data-[indeterminate]:border-0 data-[indeterminate]:focus-visible:border-0",
|
|
2123
|
+
"data-[indeterminate]:interactive-accent data-[indeterminate]:interactive-accent-fg",
|
|
2124
|
+
// Error (aria-invalid) — only applies to unchecked/checked states.
|
|
2125
|
+
// Indeterminate has no error state per design.
|
|
2126
|
+
"aria-invalid:border-error",
|
|
2127
|
+
"aria-invalid:data-[checked]:border-0 aria-invalid:data-[checked]:interactive-destructive aria-invalid:data-[checked]:interactive-destructive-fg",
|
|
2128
|
+
"aria-invalid:focus-visible:ring-3 aria-invalid:focus-visible:ring-focus-error",
|
|
2129
|
+
// SVG children
|
|
2130
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
2131
|
+
]);
|
|
2132
|
+
var Checkbox = React16.forwardRef(({ className, ...props }, ref) => {
|
|
2133
|
+
return /* @__PURE__ */ jsx17(
|
|
2134
|
+
CheckboxPrimitive.Root,
|
|
2135
|
+
{
|
|
2136
|
+
"data-slot": "checkbox",
|
|
2137
|
+
ref,
|
|
2138
|
+
className: cn(checkboxVariants(), className),
|
|
2139
|
+
...props,
|
|
2140
|
+
children: /* @__PURE__ */ jsxs10(
|
|
2141
|
+
CheckboxPrimitive.Indicator,
|
|
2142
|
+
{
|
|
2143
|
+
"data-slot": "checkbox-indicator",
|
|
2144
|
+
className: "absolute inset-0 flex items-center justify-center text-current",
|
|
2145
|
+
children: [
|
|
2146
|
+
/* @__PURE__ */ jsx17(
|
|
2147
|
+
CheckmarkIcon,
|
|
2148
|
+
{
|
|
2149
|
+
size: 14,
|
|
2150
|
+
className: "text-current hidden group-data-[checked]:block"
|
|
2151
|
+
}
|
|
2152
|
+
),
|
|
2153
|
+
/* @__PURE__ */ jsx17(
|
|
2154
|
+
MinusIcon,
|
|
2155
|
+
{
|
|
2156
|
+
size: 14,
|
|
2157
|
+
className: "text-current hidden group-data-[indeterminate]:block"
|
|
2158
|
+
}
|
|
2159
|
+
)
|
|
2160
|
+
]
|
|
2161
|
+
}
|
|
2162
|
+
)
|
|
2163
|
+
}
|
|
2164
|
+
);
|
|
2165
|
+
});
|
|
2166
|
+
Checkbox.displayName = "Checkbox";
|
|
1998
2167
|
|
|
1999
2168
|
// src/components/ui/switch.tsx
|
|
2000
|
-
import * as
|
|
2169
|
+
import * as React17 from "react";
|
|
2001
2170
|
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
2002
2171
|
import { cva as cva9 } from "class-variance-authority";
|
|
2003
|
-
import { jsx as
|
|
2172
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2004
2173
|
var switchVariants = cva9(
|
|
2005
2174
|
"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",
|
|
2006
2175
|
{
|
|
@@ -2029,16 +2198,16 @@ var switchThumbVariants = cva9(
|
|
|
2029
2198
|
}
|
|
2030
2199
|
}
|
|
2031
2200
|
);
|
|
2032
|
-
var Switch =
|
|
2201
|
+
var Switch = React17.forwardRef(
|
|
2033
2202
|
({ className, size, ...props }, ref) => {
|
|
2034
|
-
return /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ jsx18(
|
|
2035
2204
|
SwitchPrimitive.Root,
|
|
2036
2205
|
{
|
|
2037
2206
|
ref,
|
|
2038
2207
|
"data-slot": "switch",
|
|
2039
2208
|
className: cn(switchVariants({ size }), className),
|
|
2040
2209
|
...props,
|
|
2041
|
-
children: /* @__PURE__ */
|
|
2210
|
+
children: /* @__PURE__ */ jsx18(
|
|
2042
2211
|
SwitchPrimitive.Thumb,
|
|
2043
2212
|
{
|
|
2044
2213
|
"data-slot": "switch-thumb",
|
|
@@ -2052,11 +2221,11 @@ var Switch = React16.forwardRef(
|
|
|
2052
2221
|
Switch.displayName = "Switch";
|
|
2053
2222
|
|
|
2054
2223
|
// src/components/ui/textarea.tsx
|
|
2055
|
-
import * as
|
|
2056
|
-
import { jsx as
|
|
2057
|
-
var Textarea =
|
|
2224
|
+
import * as React18 from "react";
|
|
2225
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2226
|
+
var Textarea = React18.forwardRef(
|
|
2058
2227
|
({ className, style, ...props }, ref) => {
|
|
2059
|
-
return /* @__PURE__ */
|
|
2228
|
+
return /* @__PURE__ */ jsx19(
|
|
2060
2229
|
"textarea",
|
|
2061
2230
|
{
|
|
2062
2231
|
className: cn(
|
|
@@ -2073,9 +2242,9 @@ var Textarea = React17.forwardRef(
|
|
|
2073
2242
|
Textarea.displayName = "Textarea";
|
|
2074
2243
|
|
|
2075
2244
|
// src/components/ui/badge.tsx
|
|
2076
|
-
import * as
|
|
2245
|
+
import * as React19 from "react";
|
|
2077
2246
|
import { cva as cva10 } from "class-variance-authority";
|
|
2078
|
-
import { jsx as
|
|
2247
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2079
2248
|
var badgeVariants = cva10(
|
|
2080
2249
|
"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",
|
|
2081
2250
|
{
|
|
@@ -2109,20 +2278,20 @@ function isSingleDisplayCharacter(node) {
|
|
|
2109
2278
|
if (parts.length !== 1) return false;
|
|
2110
2279
|
return isSingleDisplayCharacter(parts[0]);
|
|
2111
2280
|
}
|
|
2112
|
-
if (
|
|
2281
|
+
if (React19.isValidElement(node)) {
|
|
2113
2282
|
return isSingleDisplayCharacter(
|
|
2114
2283
|
node.props.children
|
|
2115
2284
|
);
|
|
2116
2285
|
}
|
|
2117
2286
|
return false;
|
|
2118
2287
|
}
|
|
2119
|
-
var Badge =
|
|
2288
|
+
var Badge = React19.forwardRef(
|
|
2120
2289
|
({ className, variant, rounded, style, children, ...props }, ref) => {
|
|
2121
2290
|
if (!variant) {
|
|
2122
2291
|
return null;
|
|
2123
2292
|
}
|
|
2124
2293
|
const circle = isSingleDisplayCharacter(children);
|
|
2125
|
-
return /* @__PURE__ */
|
|
2294
|
+
return /* @__PURE__ */ jsx20(
|
|
2126
2295
|
"span",
|
|
2127
2296
|
{
|
|
2128
2297
|
className: cn(
|
|
@@ -2140,13 +2309,218 @@ var Badge = React18.forwardRef(
|
|
|
2140
2309
|
);
|
|
2141
2310
|
Badge.displayName = "Badge";
|
|
2142
2311
|
|
|
2312
|
+
// src/components/ui/item.tsx
|
|
2313
|
+
import * as React20 from "react";
|
|
2314
|
+
import { mergeProps as mergeProps2 } from "@base-ui/react/merge-props";
|
|
2315
|
+
import { useRender as useRender2 } from "@base-ui/react/use-render";
|
|
2316
|
+
import { cva as cva11 } from "class-variance-authority";
|
|
2317
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2318
|
+
var ItemGroupContext = React20.createContext(false);
|
|
2319
|
+
var ItemGroup = React20.forwardRef(
|
|
2320
|
+
({ className, ...props }, ref) => {
|
|
2321
|
+
return /* @__PURE__ */ jsx21(ItemGroupContext.Provider, { value: true, children: /* @__PURE__ */ jsx21(
|
|
2322
|
+
"div",
|
|
2323
|
+
{
|
|
2324
|
+
ref,
|
|
2325
|
+
role: "list",
|
|
2326
|
+
"data-slot": "item-group",
|
|
2327
|
+
className: cn(
|
|
2328
|
+
"gap-4 has-data-[size=sm]:gap-2.5 group/item-group flex w-full flex-col",
|
|
2329
|
+
className
|
|
2330
|
+
),
|
|
2331
|
+
...props
|
|
2332
|
+
}
|
|
2333
|
+
) });
|
|
2334
|
+
}
|
|
2335
|
+
);
|
|
2336
|
+
var ItemSeparator = React20.forwardRef(({ className, ...props }, ref) => {
|
|
2337
|
+
return /* @__PURE__ */ jsx21(
|
|
2338
|
+
Separator2,
|
|
2339
|
+
{
|
|
2340
|
+
ref,
|
|
2341
|
+
"data-slot": "item-separator",
|
|
2342
|
+
orientation: "horizontal",
|
|
2343
|
+
className: cn("my-2", className),
|
|
2344
|
+
...props
|
|
2345
|
+
}
|
|
2346
|
+
);
|
|
2347
|
+
});
|
|
2348
|
+
var itemVariants = cva11(
|
|
2349
|
+
"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",
|
|
2350
|
+
{
|
|
2351
|
+
variants: {
|
|
2352
|
+
variant: {
|
|
2353
|
+
default: "border-transparent [a]:hover:after:bg-black/10",
|
|
2354
|
+
outline: "border-default [a]:hover:after:bg-black/10",
|
|
2355
|
+
muted: "surface-secondary border-transparent"
|
|
2356
|
+
},
|
|
2357
|
+
size: {
|
|
2358
|
+
default: "items-start gap-4 p-4",
|
|
2359
|
+
sm: "items-center gap-2 px-4 py-3"
|
|
2360
|
+
}
|
|
2361
|
+
},
|
|
2362
|
+
defaultVariants: {
|
|
2363
|
+
variant: "default",
|
|
2364
|
+
size: "default"
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
);
|
|
2368
|
+
var Item2 = ({
|
|
2369
|
+
className,
|
|
2370
|
+
variant = "default",
|
|
2371
|
+
size = "default",
|
|
2372
|
+
render,
|
|
2373
|
+
...props
|
|
2374
|
+
}) => {
|
|
2375
|
+
const insideGroup = React20.useContext(ItemGroupContext);
|
|
2376
|
+
return useRender2({
|
|
2377
|
+
defaultTagName: "div",
|
|
2378
|
+
props: mergeProps2(
|
|
2379
|
+
{
|
|
2380
|
+
role: insideGroup ? "listitem" : void 0,
|
|
2381
|
+
className: cn(itemVariants({ variant, size, className }))
|
|
2382
|
+
},
|
|
2383
|
+
props
|
|
2384
|
+
),
|
|
2385
|
+
render,
|
|
2386
|
+
state: {
|
|
2387
|
+
slot: "item",
|
|
2388
|
+
variant,
|
|
2389
|
+
size
|
|
2390
|
+
}
|
|
2391
|
+
});
|
|
2392
|
+
};
|
|
2393
|
+
var itemMediaVariants = cva11(
|
|
2394
|
+
"gap-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none",
|
|
2395
|
+
{
|
|
2396
|
+
variants: {
|
|
2397
|
+
variant: {
|
|
2398
|
+
default: "bg-transparent",
|
|
2399
|
+
icon: "[&_svg:not([class*='size-'])]:size-5",
|
|
2400
|
+
iconBadge: "size-8 overflow-hidden rounded bg-surface-secondary p-2 [&_svg:not([class*='size-'])]:size-4",
|
|
2401
|
+
image: "size-10 overflow-hidden rounded-md group-data-[size=sm]/item:size-8 [&_img]:size-full [&_img]:object-cover"
|
|
2402
|
+
}
|
|
2403
|
+
},
|
|
2404
|
+
defaultVariants: {
|
|
2405
|
+
variant: "default"
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
);
|
|
2409
|
+
var ItemMedia = React20.forwardRef(
|
|
2410
|
+
({ className, variant = "default", ...props }, ref) => {
|
|
2411
|
+
return /* @__PURE__ */ jsx21(
|
|
2412
|
+
"div",
|
|
2413
|
+
{
|
|
2414
|
+
ref,
|
|
2415
|
+
"data-slot": "item-media",
|
|
2416
|
+
"data-variant": variant,
|
|
2417
|
+
className: cn(itemMediaVariants({ variant, className })),
|
|
2418
|
+
...props
|
|
2419
|
+
}
|
|
2420
|
+
);
|
|
2421
|
+
}
|
|
2422
|
+
);
|
|
2423
|
+
var ItemContent = React20.forwardRef(({ className, ...props }, ref) => {
|
|
2424
|
+
return /* @__PURE__ */ jsx21(
|
|
2425
|
+
"div",
|
|
2426
|
+
{
|
|
2427
|
+
ref,
|
|
2428
|
+
"data-slot": "item-content",
|
|
2429
|
+
className: cn(
|
|
2430
|
+
"gap-1 group-data-[size=sm]/item:gap-0 flex flex-1 flex-col [&+[data-slot=item-content]]:flex-none",
|
|
2431
|
+
className
|
|
2432
|
+
),
|
|
2433
|
+
...props
|
|
2434
|
+
}
|
|
2435
|
+
);
|
|
2436
|
+
});
|
|
2437
|
+
var ItemTitle = React20.forwardRef(
|
|
2438
|
+
({ className, ...props }, ref) => {
|
|
2439
|
+
return /* @__PURE__ */ jsx21(
|
|
2440
|
+
"div",
|
|
2441
|
+
{
|
|
2442
|
+
ref,
|
|
2443
|
+
"data-slot": "item-title",
|
|
2444
|
+
className: cn(
|
|
2445
|
+
"type-label-sm-medium gap-2 text-default underline-offset-4 line-clamp-1 flex w-full items-center",
|
|
2446
|
+
className
|
|
2447
|
+
),
|
|
2448
|
+
...props
|
|
2449
|
+
}
|
|
2450
|
+
);
|
|
2451
|
+
}
|
|
2452
|
+
);
|
|
2453
|
+
var ItemDescription = React20.forwardRef(({ className, ...props }, ref) => {
|
|
2454
|
+
return /* @__PURE__ */ jsx21(
|
|
2455
|
+
"p",
|
|
2456
|
+
{
|
|
2457
|
+
ref,
|
|
2458
|
+
"data-slot": "item-description",
|
|
2459
|
+
className: cn(
|
|
2460
|
+
"type-body-sm-regular text-secondary text-left line-clamp-2 [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
2461
|
+
className
|
|
2462
|
+
),
|
|
2463
|
+
...props
|
|
2464
|
+
}
|
|
2465
|
+
);
|
|
2466
|
+
});
|
|
2467
|
+
var ItemActions = React20.forwardRef(({ className, ...props }, ref) => {
|
|
2468
|
+
return /* @__PURE__ */ jsx21(
|
|
2469
|
+
"div",
|
|
2470
|
+
{
|
|
2471
|
+
ref,
|
|
2472
|
+
"data-slot": "item-actions",
|
|
2473
|
+
className: cn("gap-2 flex items-center", className),
|
|
2474
|
+
...props
|
|
2475
|
+
}
|
|
2476
|
+
);
|
|
2477
|
+
});
|
|
2478
|
+
var ItemHeader = React20.forwardRef(({ className, ...props }, ref) => {
|
|
2479
|
+
return /* @__PURE__ */ jsx21(
|
|
2480
|
+
"div",
|
|
2481
|
+
{
|
|
2482
|
+
ref,
|
|
2483
|
+
"data-slot": "item-header",
|
|
2484
|
+
className: cn(
|
|
2485
|
+
"gap-2 flex basis-full items-center justify-between",
|
|
2486
|
+
className
|
|
2487
|
+
),
|
|
2488
|
+
...props
|
|
2489
|
+
}
|
|
2490
|
+
);
|
|
2491
|
+
});
|
|
2492
|
+
var ItemFooter = React20.forwardRef(({ className, ...props }, ref) => {
|
|
2493
|
+
return /* @__PURE__ */ jsx21(
|
|
2494
|
+
"div",
|
|
2495
|
+
{
|
|
2496
|
+
ref,
|
|
2497
|
+
"data-slot": "item-footer",
|
|
2498
|
+
className: cn(
|
|
2499
|
+
"gap-2 flex basis-full items-center justify-between",
|
|
2500
|
+
className
|
|
2501
|
+
),
|
|
2502
|
+
...props
|
|
2503
|
+
}
|
|
2504
|
+
);
|
|
2505
|
+
});
|
|
2506
|
+
Item2.displayName = "Item";
|
|
2507
|
+
ItemMedia.displayName = "ItemMedia";
|
|
2508
|
+
ItemGroup.displayName = "ItemGroup";
|
|
2509
|
+
ItemSeparator.displayName = "ItemSeparator";
|
|
2510
|
+
ItemContent.displayName = "ItemContent";
|
|
2511
|
+
ItemTitle.displayName = "ItemTitle";
|
|
2512
|
+
ItemDescription.displayName = "ItemDescription";
|
|
2513
|
+
ItemActions.displayName = "ItemActions";
|
|
2514
|
+
ItemHeader.displayName = "ItemHeader";
|
|
2515
|
+
ItemFooter.displayName = "ItemFooter";
|
|
2516
|
+
|
|
2143
2517
|
// src/components/pdf-viewer/index.tsx
|
|
2144
|
-
import * as
|
|
2518
|
+
import * as React30 from "react";
|
|
2145
2519
|
import "react-pdf/dist/Page/TextLayer.css";
|
|
2146
2520
|
|
|
2147
2521
|
// src/components/pdf-viewer/components/CustomScrollbar.tsx
|
|
2148
|
-
import * as
|
|
2149
|
-
import { Fragment, jsx as
|
|
2522
|
+
import * as React21 from "react";
|
|
2523
|
+
import { Fragment, jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2150
2524
|
var scrollbarStyles = `
|
|
2151
2525
|
.custom-scrollbar-content {
|
|
2152
2526
|
overflow: auto;
|
|
@@ -2214,15 +2588,15 @@ function CustomScrollbar({
|
|
|
2214
2588
|
backgroundColor = "#F5F5F5",
|
|
2215
2589
|
className
|
|
2216
2590
|
}) {
|
|
2217
|
-
const internalContainerRef =
|
|
2591
|
+
const internalContainerRef = React21.useRef(null);
|
|
2218
2592
|
const containerRef = externalContainerRef || internalContainerRef;
|
|
2219
|
-
const wrapperRef =
|
|
2220
|
-
const thumbVerticalRef =
|
|
2221
|
-
const thumbHorizontalRef =
|
|
2222
|
-
const lastScrollPosRef =
|
|
2223
|
-
const scrollTimeoutsRef =
|
|
2593
|
+
const wrapperRef = React21.useRef(null);
|
|
2594
|
+
const thumbVerticalRef = React21.useRef(null);
|
|
2595
|
+
const thumbHorizontalRef = React21.useRef(null);
|
|
2596
|
+
const lastScrollPosRef = React21.useRef({ top: 0, left: 0 });
|
|
2597
|
+
const scrollTimeoutsRef = React21.useRef({ vertical: null, horizontal: null });
|
|
2224
2598
|
const WHEEL_LINE_HEIGHT_PX = 16;
|
|
2225
|
-
const showScrollbar =
|
|
2599
|
+
const showScrollbar = React21.useCallback(
|
|
2226
2600
|
(direction) => {
|
|
2227
2601
|
const wrapper = wrapperRef.current;
|
|
2228
2602
|
if (!wrapper) return;
|
|
@@ -2236,7 +2610,7 @@ function CustomScrollbar({
|
|
|
2236
2610
|
},
|
|
2237
2611
|
[autoHideDelay]
|
|
2238
2612
|
);
|
|
2239
|
-
const updateScrollbarThumbPosition =
|
|
2613
|
+
const updateScrollbarThumbPosition = React21.useCallback(() => {
|
|
2240
2614
|
const container = containerRef.current;
|
|
2241
2615
|
const thumbVertical = thumbVerticalRef.current;
|
|
2242
2616
|
const thumbHorizontal = thumbHorizontalRef.current;
|
|
@@ -2274,7 +2648,7 @@ function CustomScrollbar({
|
|
|
2274
2648
|
}
|
|
2275
2649
|
}
|
|
2276
2650
|
}, [containerRef]);
|
|
2277
|
-
|
|
2651
|
+
React21.useEffect(() => {
|
|
2278
2652
|
const container = containerRef.current;
|
|
2279
2653
|
if (!container) return;
|
|
2280
2654
|
lastScrollPosRef.current = {
|
|
@@ -2307,7 +2681,7 @@ function CustomScrollbar({
|
|
|
2307
2681
|
if (rafId) cancelAnimationFrame(rafId);
|
|
2308
2682
|
};
|
|
2309
2683
|
}, [containerRef, showScrollbar, updateScrollbarThumbPosition]);
|
|
2310
|
-
|
|
2684
|
+
React21.useEffect(() => {
|
|
2311
2685
|
const container = containerRef.current;
|
|
2312
2686
|
if (!container) return;
|
|
2313
2687
|
const normalizeWheelDelta = (delta, deltaMode, axisSize) => {
|
|
@@ -2363,7 +2737,7 @@ function CustomScrollbar({
|
|
|
2363
2737
|
container.removeEventListener("wheel", handleWheel);
|
|
2364
2738
|
};
|
|
2365
2739
|
}, [containerRef, showScrollbar]);
|
|
2366
|
-
|
|
2740
|
+
React21.useEffect(() => {
|
|
2367
2741
|
const thumbVertical = thumbVerticalRef.current;
|
|
2368
2742
|
const thumbHorizontal = thumbHorizontalRef.current;
|
|
2369
2743
|
const container = containerRef.current;
|
|
@@ -2423,19 +2797,19 @@ function CustomScrollbar({
|
|
|
2423
2797
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
2424
2798
|
};
|
|
2425
2799
|
}, [containerRef, showScrollbar]);
|
|
2426
|
-
|
|
2800
|
+
React21.useEffect(() => {
|
|
2427
2801
|
updateScrollbarThumbPosition();
|
|
2428
2802
|
}, [children, updateScrollbarThumbPosition]);
|
|
2429
|
-
return /* @__PURE__ */
|
|
2430
|
-
/* @__PURE__ */
|
|
2431
|
-
/* @__PURE__ */
|
|
2803
|
+
return /* @__PURE__ */ jsxs11(Fragment, { children: [
|
|
2804
|
+
/* @__PURE__ */ jsx22("style", { children: scrollbarStyles }),
|
|
2805
|
+
/* @__PURE__ */ jsxs11(
|
|
2432
2806
|
"div",
|
|
2433
2807
|
{
|
|
2434
2808
|
ref: wrapperRef,
|
|
2435
2809
|
className: `flex-1 min-w-0 custom-scrollbar-wrapper ${className || ""}`,
|
|
2436
2810
|
style: { background: backgroundColor },
|
|
2437
2811
|
children: [
|
|
2438
|
-
/* @__PURE__ */
|
|
2812
|
+
/* @__PURE__ */ jsx22(
|
|
2439
2813
|
"div",
|
|
2440
2814
|
{
|
|
2441
2815
|
ref: containerRef,
|
|
@@ -2444,8 +2818,8 @@ function CustomScrollbar({
|
|
|
2444
2818
|
children
|
|
2445
2819
|
}
|
|
2446
2820
|
),
|
|
2447
|
-
/* @__PURE__ */
|
|
2448
|
-
/* @__PURE__ */
|
|
2821
|
+
/* @__PURE__ */ jsx22("div", { className: "scrollbar-track-vertical", children: /* @__PURE__ */ jsx22("div", { ref: thumbVerticalRef, className: "scrollbar-thumb-vertical" }) }),
|
|
2822
|
+
/* @__PURE__ */ jsx22("div", { className: "scrollbar-track-horizontal", children: /* @__PURE__ */ jsx22(
|
|
2449
2823
|
"div",
|
|
2450
2824
|
{
|
|
2451
2825
|
ref: thumbHorizontalRef,
|
|
@@ -2459,7 +2833,7 @@ function CustomScrollbar({
|
|
|
2459
2833
|
}
|
|
2460
2834
|
|
|
2461
2835
|
// src/components/pdf-viewer/components/PdfControls.tsx
|
|
2462
|
-
import * as
|
|
2836
|
+
import * as React22 from "react";
|
|
2463
2837
|
|
|
2464
2838
|
// src/components/pdf-viewer/utils/types.ts
|
|
2465
2839
|
var DEFAULT_BOUNDING_BOX_STYLE = {
|
|
@@ -2475,7 +2849,7 @@ var PDF_ZOOM = {
|
|
|
2475
2849
|
};
|
|
2476
2850
|
|
|
2477
2851
|
// src/components/pdf-viewer/components/PdfControls.tsx
|
|
2478
|
-
import { jsx as
|
|
2852
|
+
import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2479
2853
|
var PdfControls = ({
|
|
2480
2854
|
currentPage,
|
|
2481
2855
|
totalPages,
|
|
@@ -2489,11 +2863,11 @@ var PdfControls = ({
|
|
|
2489
2863
|
const canGoNext = currentPage < totalPages;
|
|
2490
2864
|
const canZoomIn = zoom < PDF_ZOOM.MAX;
|
|
2491
2865
|
const canZoomOut = zoom > PDF_ZOOM.MIN;
|
|
2492
|
-
const [pageInputValue, setPageInputValue] =
|
|
2866
|
+
const [pageInputValue, setPageInputValue] = React22.useState(
|
|
2493
2867
|
String(currentPage)
|
|
2494
2868
|
);
|
|
2495
|
-
const isEscapeRef =
|
|
2496
|
-
|
|
2869
|
+
const isEscapeRef = React22.useRef(false);
|
|
2870
|
+
React22.useEffect(() => {
|
|
2497
2871
|
setPageInputValue(String(currentPage));
|
|
2498
2872
|
}, [currentPage]);
|
|
2499
2873
|
const handlePageInputChange = (e) => {
|
|
@@ -2529,14 +2903,14 @@ var PdfControls = ({
|
|
|
2529
2903
|
const newZoom = Math.max(zoom - PDF_ZOOM.STEP, PDF_ZOOM.MIN);
|
|
2530
2904
|
onZoomChange(newZoom);
|
|
2531
2905
|
};
|
|
2532
|
-
return /* @__PURE__ */
|
|
2906
|
+
return /* @__PURE__ */ jsxs12(
|
|
2533
2907
|
"div",
|
|
2534
2908
|
{
|
|
2535
2909
|
className: "flex flex-col items-center justify-end py-2 px-1 gap-4",
|
|
2536
2910
|
style: { background: "#DEDEDE" },
|
|
2537
2911
|
children: [
|
|
2538
|
-
/* @__PURE__ */
|
|
2539
|
-
/* @__PURE__ */
|
|
2912
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-center gap-1", children: [
|
|
2913
|
+
/* @__PURE__ */ jsx23(
|
|
2540
2914
|
"button",
|
|
2541
2915
|
{
|
|
2542
2916
|
onClick: onPreviousPage,
|
|
@@ -2544,10 +2918,10 @@ var PdfControls = ({
|
|
|
2544
2918
|
className: "p-1.5 rounded transition-colors hover:bg-neutral-400 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
2545
2919
|
"aria-label": "Previous page",
|
|
2546
2920
|
type: "button",
|
|
2547
|
-
children: /* @__PURE__ */
|
|
2921
|
+
children: /* @__PURE__ */ jsx23(CaretUpIcon, { size: 16, style: { color: "#666666" } })
|
|
2548
2922
|
}
|
|
2549
2923
|
),
|
|
2550
|
-
/* @__PURE__ */
|
|
2924
|
+
/* @__PURE__ */ jsx23("div", { className: "flex flex-col items-center", children: totalPages > 0 ? /* @__PURE__ */ jsx23(
|
|
2551
2925
|
"input",
|
|
2552
2926
|
{
|
|
2553
2927
|
type: "text",
|
|
@@ -2563,8 +2937,8 @@ var PdfControls = ({
|
|
|
2563
2937
|
},
|
|
2564
2938
|
"aria-label": "Current page"
|
|
2565
2939
|
}
|
|
2566
|
-
) : /* @__PURE__ */
|
|
2567
|
-
/* @__PURE__ */
|
|
2940
|
+
) : /* @__PURE__ */ jsx23("span", { className: "text-sm", style: { color: "#666666" }, children: "-" }) }),
|
|
2941
|
+
/* @__PURE__ */ jsx23(
|
|
2568
2942
|
"button",
|
|
2569
2943
|
{
|
|
2570
2944
|
onClick: onNextPage,
|
|
@@ -2572,12 +2946,12 @@ var PdfControls = ({
|
|
|
2572
2946
|
className: "p-1.5 rounded transition-colors hover:bg-neutral-400 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
2573
2947
|
"aria-label": "Next page",
|
|
2574
2948
|
type: "button",
|
|
2575
|
-
children: /* @__PURE__ */
|
|
2949
|
+
children: /* @__PURE__ */ jsx23(CaretDownIcon, { size: 16, style: { color: "#666666" } })
|
|
2576
2950
|
}
|
|
2577
2951
|
)
|
|
2578
2952
|
] }),
|
|
2579
|
-
/* @__PURE__ */
|
|
2580
|
-
/* @__PURE__ */
|
|
2953
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-center gap-1", children: [
|
|
2954
|
+
/* @__PURE__ */ jsx23(
|
|
2581
2955
|
"button",
|
|
2582
2956
|
{
|
|
2583
2957
|
onClick: handleZoomIn,
|
|
@@ -2585,10 +2959,10 @@ var PdfControls = ({
|
|
|
2585
2959
|
className: "p-1.5 rounded transition-colors hover:bg-neutral-400 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
2586
2960
|
"aria-label": "Zoom in",
|
|
2587
2961
|
type: "button",
|
|
2588
|
-
children: /* @__PURE__ */
|
|
2962
|
+
children: /* @__PURE__ */ jsx23(ZoomInIcon, { size: 16, style: { color: "#666666" } })
|
|
2589
2963
|
}
|
|
2590
2964
|
),
|
|
2591
|
-
/* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ jsx23(
|
|
2592
2966
|
"button",
|
|
2593
2967
|
{
|
|
2594
2968
|
onClick: handleZoomOut,
|
|
@@ -2596,7 +2970,7 @@ var PdfControls = ({
|
|
|
2596
2970
|
className: "p-1.5 rounded transition-colors hover:bg-neutral-400 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
2597
2971
|
"aria-label": "Zoom out",
|
|
2598
2972
|
type: "button",
|
|
2599
|
-
children: /* @__PURE__ */
|
|
2973
|
+
children: /* @__PURE__ */ jsx23(ZoomOutIcon, { size: 16, style: { color: "#666666" } })
|
|
2600
2974
|
}
|
|
2601
2975
|
)
|
|
2602
2976
|
] })
|
|
@@ -2607,7 +2981,7 @@ var PdfControls = ({
|
|
|
2607
2981
|
PdfControls.displayName = "PdfControls";
|
|
2608
2982
|
|
|
2609
2983
|
// src/components/pdf-viewer/components/PdfDocument.tsx
|
|
2610
|
-
import * as
|
|
2984
|
+
import * as React24 from "react";
|
|
2611
2985
|
import { Document, Page } from "react-pdf";
|
|
2612
2986
|
|
|
2613
2987
|
// src/components/pdf-viewer/utils/constants.ts
|
|
@@ -2633,7 +3007,7 @@ var INTERSECTION_OBSERVER_CONFIG = {
|
|
|
2633
3007
|
};
|
|
2634
3008
|
|
|
2635
3009
|
// src/components/pdf-viewer/components/BoundingBoxOverlay.tsx
|
|
2636
|
-
import * as
|
|
3010
|
+
import * as React23 from "react";
|
|
2637
3011
|
|
|
2638
3012
|
// src/components/pdf-viewer/utils/boundingBoxUtils.ts
|
|
2639
3013
|
function clamp01(value) {
|
|
@@ -2660,7 +3034,7 @@ function normalizeBoundingBox(box) {
|
|
|
2660
3034
|
}
|
|
2661
3035
|
|
|
2662
3036
|
// src/components/pdf-viewer/components/BoundingBoxOverlay.tsx
|
|
2663
|
-
import { jsx as
|
|
3037
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2664
3038
|
var BoundingBoxOverlayInner = ({
|
|
2665
3039
|
boxes,
|
|
2666
3040
|
highlightedIds,
|
|
@@ -2670,11 +3044,11 @@ var BoundingBoxOverlayInner = ({
|
|
|
2670
3044
|
onBoxMouseEnter,
|
|
2671
3045
|
onBoxMouseLeave
|
|
2672
3046
|
}) => {
|
|
2673
|
-
const validBoxes =
|
|
3047
|
+
const validBoxes = React23.useMemo(
|
|
2674
3048
|
() => boxes.map(normalizeBoundingBox).filter((b) => b !== null),
|
|
2675
3049
|
[boxes]
|
|
2676
3050
|
);
|
|
2677
|
-
const sortedBoxes =
|
|
3051
|
+
const sortedBoxes = React23.useMemo(
|
|
2678
3052
|
() => [...validBoxes].sort((a, b) => {
|
|
2679
3053
|
const aHighlighted = highlightedIds.has(a.id);
|
|
2680
3054
|
const bHighlighted = highlightedIds.has(b.id);
|
|
@@ -2685,7 +3059,7 @@ var BoundingBoxOverlayInner = ({
|
|
|
2685
3059
|
[validBoxes, highlightedIds]
|
|
2686
3060
|
);
|
|
2687
3061
|
if (sortedBoxes.length === 0) return null;
|
|
2688
|
-
return /* @__PURE__ */
|
|
3062
|
+
return /* @__PURE__ */ jsx24(
|
|
2689
3063
|
"svg",
|
|
2690
3064
|
{
|
|
2691
3065
|
viewBox: "0 0 1 1",
|
|
@@ -2705,7 +3079,7 @@ var BoundingBoxOverlayInner = ({
|
|
|
2705
3079
|
const baseStyle = isHighlighted ? { ...DEFAULT_BOUNDING_BOX_STYLE, ...highlightStyle } : { ...DEFAULT_BOUNDING_BOX_STYLE, ...defaultStyle };
|
|
2706
3080
|
const style = { ...baseStyle, ...box.style };
|
|
2707
3081
|
const isInteractive = !!(onBoxClick || onBoxMouseEnter);
|
|
2708
|
-
return /* @__PURE__ */
|
|
3082
|
+
return /* @__PURE__ */ jsx24(
|
|
2709
3083
|
"rect",
|
|
2710
3084
|
{
|
|
2711
3085
|
x: box.x1,
|
|
@@ -2725,7 +3099,7 @@ var BoundingBoxOverlayInner = ({
|
|
|
2725
3099
|
onMouseLeave: onBoxMouseLeave ? (e) => onBoxMouseLeave(box, e) : void 0,
|
|
2726
3100
|
"aria-label": box.label,
|
|
2727
3101
|
role: onBoxClick ? "button" : void 0,
|
|
2728
|
-
children: box.label && /* @__PURE__ */
|
|
3102
|
+
children: box.label && /* @__PURE__ */ jsx24("title", { children: box.label })
|
|
2729
3103
|
},
|
|
2730
3104
|
box.id
|
|
2731
3105
|
);
|
|
@@ -2733,11 +3107,11 @@ var BoundingBoxOverlayInner = ({
|
|
|
2733
3107
|
}
|
|
2734
3108
|
);
|
|
2735
3109
|
};
|
|
2736
|
-
var BoundingBoxOverlay =
|
|
3110
|
+
var BoundingBoxOverlay = React23.memo(BoundingBoxOverlayInner);
|
|
2737
3111
|
BoundingBoxOverlay.displayName = "BoundingBoxOverlay";
|
|
2738
3112
|
|
|
2739
3113
|
// src/components/pdf-viewer/components/PdfDocument.tsx
|
|
2740
|
-
import { jsx as
|
|
3114
|
+
import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2741
3115
|
var PdfDocument = ({
|
|
2742
3116
|
file,
|
|
2743
3117
|
pageWidth,
|
|
@@ -2759,14 +3133,14 @@ var PdfDocument = ({
|
|
|
2759
3133
|
onBoxMouseEnter,
|
|
2760
3134
|
onBoxMouseLeave
|
|
2761
3135
|
}) => {
|
|
2762
|
-
const mountedRef =
|
|
2763
|
-
|
|
3136
|
+
const mountedRef = React24.useRef(true);
|
|
3137
|
+
React24.useEffect(() => {
|
|
2764
3138
|
mountedRef.current = true;
|
|
2765
3139
|
return () => {
|
|
2766
3140
|
mountedRef.current = false;
|
|
2767
3141
|
};
|
|
2768
3142
|
}, []);
|
|
2769
|
-
const boxesByPage =
|
|
3143
|
+
const boxesByPage = React24.useMemo(() => {
|
|
2770
3144
|
const map = /* @__PURE__ */ new Map();
|
|
2771
3145
|
boundingBoxes?.forEach((box) => {
|
|
2772
3146
|
const pageBoxes = map.get(box.page) || [];
|
|
@@ -2775,7 +3149,7 @@ var PdfDocument = ({
|
|
|
2775
3149
|
});
|
|
2776
3150
|
return map;
|
|
2777
3151
|
}, [boundingBoxes]);
|
|
2778
|
-
const highlightedIdsSet =
|
|
3152
|
+
const highlightedIdsSet = React24.useMemo(
|
|
2779
3153
|
() => new Set(highlightedBoxIds),
|
|
2780
3154
|
[highlightedBoxIds]
|
|
2781
3155
|
);
|
|
@@ -2814,14 +3188,14 @@ var PdfDocument = ({
|
|
|
2814
3188
|
function renderCurrentPage() {
|
|
2815
3189
|
const placeholderHeight = getPlaceholderHeight(currentPage);
|
|
2816
3190
|
const boxesForPage = boxesByPage.get(currentPage) ?? [];
|
|
2817
|
-
return /* @__PURE__ */
|
|
3191
|
+
return /* @__PURE__ */ jsx25(
|
|
2818
3192
|
"div",
|
|
2819
3193
|
{
|
|
2820
3194
|
ref: (el) => registerPageRef(currentPage, el),
|
|
2821
3195
|
"data-page-num": currentPage,
|
|
2822
3196
|
className: "flex justify-center",
|
|
2823
|
-
children: /* @__PURE__ */
|
|
2824
|
-
/* @__PURE__ */
|
|
3197
|
+
children: /* @__PURE__ */ jsxs13("div", { style: { position: "relative" }, children: [
|
|
3198
|
+
/* @__PURE__ */ jsx25(
|
|
2825
3199
|
Page,
|
|
2826
3200
|
{
|
|
2827
3201
|
pageNumber: currentPage,
|
|
@@ -2829,12 +3203,12 @@ var PdfDocument = ({
|
|
|
2829
3203
|
className: "shadow-sm",
|
|
2830
3204
|
renderTextLayer: enableTextLayer,
|
|
2831
3205
|
renderAnnotationLayer: false,
|
|
2832
|
-
loading: /* @__PURE__ */
|
|
3206
|
+
loading: /* @__PURE__ */ jsx25(
|
|
2833
3207
|
"div",
|
|
2834
3208
|
{
|
|
2835
3209
|
className: "flex items-center justify-center bg-white",
|
|
2836
3210
|
style: { width: pageWidth, height: placeholderHeight },
|
|
2837
|
-
children: /* @__PURE__ */
|
|
3211
|
+
children: /* @__PURE__ */ jsxs13(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
2838
3212
|
"Loading page ",
|
|
2839
3213
|
currentPage,
|
|
2840
3214
|
"..."
|
|
@@ -2843,7 +3217,7 @@ var PdfDocument = ({
|
|
|
2843
3217
|
)
|
|
2844
3218
|
}
|
|
2845
3219
|
),
|
|
2846
|
-
/* @__PURE__ */
|
|
3220
|
+
/* @__PURE__ */ jsx25(
|
|
2847
3221
|
BoundingBoxOverlay,
|
|
2848
3222
|
{
|
|
2849
3223
|
boxes: boxesForPage,
|
|
@@ -2866,7 +3240,7 @@ var PdfDocument = ({
|
|
|
2866
3240
|
const shouldRender = visiblePages.has(pageNum);
|
|
2867
3241
|
const placeholderHeight = getPlaceholderHeight(pageNum);
|
|
2868
3242
|
const boxesForPage = boxesByPage.get(pageNum) ?? [];
|
|
2869
|
-
return /* @__PURE__ */
|
|
3243
|
+
return /* @__PURE__ */ jsx25(
|
|
2870
3244
|
"div",
|
|
2871
3245
|
{
|
|
2872
3246
|
ref: (el) => registerPageRef(pageNum, el),
|
|
@@ -2875,8 +3249,8 @@ var PdfDocument = ({
|
|
|
2875
3249
|
style: {
|
|
2876
3250
|
minHeight: shouldRender ? void 0 : placeholderHeight
|
|
2877
3251
|
},
|
|
2878
|
-
children: shouldRender ? /* @__PURE__ */
|
|
2879
|
-
/* @__PURE__ */
|
|
3252
|
+
children: shouldRender ? /* @__PURE__ */ jsxs13("div", { style: { position: "relative" }, children: [
|
|
3253
|
+
/* @__PURE__ */ jsx25(
|
|
2880
3254
|
Page,
|
|
2881
3255
|
{
|
|
2882
3256
|
pageNumber: pageNum,
|
|
@@ -2884,12 +3258,12 @@ var PdfDocument = ({
|
|
|
2884
3258
|
className: "shadow-sm",
|
|
2885
3259
|
renderTextLayer: enableTextLayer,
|
|
2886
3260
|
renderAnnotationLayer: false,
|
|
2887
|
-
loading: /* @__PURE__ */
|
|
3261
|
+
loading: /* @__PURE__ */ jsx25(
|
|
2888
3262
|
"div",
|
|
2889
3263
|
{
|
|
2890
3264
|
className: "flex items-center justify-center bg-white",
|
|
2891
3265
|
style: { width: pageWidth, height: placeholderHeight },
|
|
2892
|
-
children: /* @__PURE__ */
|
|
3266
|
+
children: /* @__PURE__ */ jsxs13(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
2893
3267
|
"Loading page ",
|
|
2894
3268
|
pageNum,
|
|
2895
3269
|
"..."
|
|
@@ -2898,7 +3272,7 @@ var PdfDocument = ({
|
|
|
2898
3272
|
)
|
|
2899
3273
|
}
|
|
2900
3274
|
),
|
|
2901
|
-
/* @__PURE__ */
|
|
3275
|
+
/* @__PURE__ */ jsx25(
|
|
2902
3276
|
BoundingBoxOverlay,
|
|
2903
3277
|
{
|
|
2904
3278
|
boxes: boxesForPage,
|
|
@@ -2910,7 +3284,7 @@ var PdfDocument = ({
|
|
|
2910
3284
|
onBoxMouseLeave
|
|
2911
3285
|
}
|
|
2912
3286
|
)
|
|
2913
|
-
] }) : /* @__PURE__ */
|
|
3287
|
+
] }) : /* @__PURE__ */ jsx25(
|
|
2914
3288
|
"div",
|
|
2915
3289
|
{
|
|
2916
3290
|
className: "flex items-center justify-center bg-white shadow-sm",
|
|
@@ -2918,7 +3292,7 @@ var PdfDocument = ({
|
|
|
2918
3292
|
width: pageWidth,
|
|
2919
3293
|
height: placeholderHeight
|
|
2920
3294
|
},
|
|
2921
|
-
children: /* @__PURE__ */
|
|
3295
|
+
children: /* @__PURE__ */ jsxs13(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
2922
3296
|
"Page ",
|
|
2923
3297
|
pageNum
|
|
2924
3298
|
] })
|
|
@@ -2930,16 +3304,16 @@ var PdfDocument = ({
|
|
|
2930
3304
|
});
|
|
2931
3305
|
}
|
|
2932
3306
|
if (!file) {
|
|
2933
|
-
return /* @__PURE__ */
|
|
3307
|
+
return /* @__PURE__ */ jsx25("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ jsx25(Typography, { variant: "body-md", className: "text-secondary", children: "No PDF available" }) });
|
|
2934
3308
|
}
|
|
2935
|
-
return /* @__PURE__ */
|
|
3309
|
+
return /* @__PURE__ */ jsx25(
|
|
2936
3310
|
Document,
|
|
2937
3311
|
{
|
|
2938
3312
|
file,
|
|
2939
3313
|
onLoadSuccess: handleDocumentLoadSuccess,
|
|
2940
3314
|
onLoadError,
|
|
2941
|
-
loading: /* @__PURE__ */
|
|
2942
|
-
error: /* @__PURE__ */
|
|
3315
|
+
loading: /* @__PURE__ */ jsx25("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ jsx25(Typography, { variant: "body-md", className: "text-secondary", children: "Rendering PDF..." }) }),
|
|
3316
|
+
error: /* @__PURE__ */ jsx25("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ jsx25(Typography, { variant: "body-md", className: "text-error", children: "Failed to render PDF" }) }),
|
|
2943
3317
|
className: "flex flex-col items-center p-4 min-w-fit",
|
|
2944
3318
|
children: numPages > 0 && pageWidth > 0 && (viewMode === "single" ? renderCurrentPage() : renderPagesWithVirtualization())
|
|
2945
3319
|
}
|
|
@@ -2948,19 +3322,19 @@ var PdfDocument = ({
|
|
|
2948
3322
|
PdfDocument.displayName = "PdfDocument";
|
|
2949
3323
|
|
|
2950
3324
|
// src/components/pdf-viewer/components/PdfHeader.tsx
|
|
2951
|
-
import { jsx as
|
|
3325
|
+
import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2952
3326
|
var PdfHeader = ({
|
|
2953
3327
|
title,
|
|
2954
3328
|
onDownload,
|
|
2955
3329
|
onPrint
|
|
2956
3330
|
}) => {
|
|
2957
|
-
return /* @__PURE__ */
|
|
3331
|
+
return /* @__PURE__ */ jsxs14(
|
|
2958
3332
|
"div",
|
|
2959
3333
|
{
|
|
2960
3334
|
className: "flex items-center justify-between gap-4 px-4 py-1",
|
|
2961
3335
|
style: { background: "#B5B5B5" },
|
|
2962
3336
|
children: [
|
|
2963
|
-
/* @__PURE__ */
|
|
3337
|
+
/* @__PURE__ */ jsx26("div", { className: "flex-shrink min-w-0", children: /* @__PURE__ */ jsx26(
|
|
2964
3338
|
Typography,
|
|
2965
3339
|
{
|
|
2966
3340
|
variant: "label-md-bold",
|
|
@@ -2969,25 +3343,25 @@ var PdfHeader = ({
|
|
|
2969
3343
|
children: title || "Untitled Document"
|
|
2970
3344
|
}
|
|
2971
3345
|
) }),
|
|
2972
|
-
/* @__PURE__ */
|
|
2973
|
-
/* @__PURE__ */
|
|
3346
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
|
|
3347
|
+
/* @__PURE__ */ jsx26(
|
|
2974
3348
|
"button",
|
|
2975
3349
|
{
|
|
2976
3350
|
onClick: onDownload,
|
|
2977
3351
|
className: "p-1 hover:bg-neutral-500 rounded transition-colors",
|
|
2978
3352
|
"aria-label": "Download PDF",
|
|
2979
3353
|
type: "button",
|
|
2980
|
-
children: /* @__PURE__ */
|
|
3354
|
+
children: /* @__PURE__ */ jsx26(DownloadIcon, { variant: "dark", size: 16 })
|
|
2981
3355
|
}
|
|
2982
3356
|
),
|
|
2983
|
-
/* @__PURE__ */
|
|
3357
|
+
/* @__PURE__ */ jsx26(
|
|
2984
3358
|
"button",
|
|
2985
3359
|
{
|
|
2986
3360
|
onClick: onPrint,
|
|
2987
3361
|
className: "p-1 hover:bg-neutral-500 rounded transition-colors",
|
|
2988
3362
|
"aria-label": "Print PDF",
|
|
2989
3363
|
type: "button",
|
|
2990
|
-
children: /* @__PURE__ */
|
|
3364
|
+
children: /* @__PURE__ */ jsx26(PrintIcon, { variant: "dark", size: 16 })
|
|
2991
3365
|
}
|
|
2992
3366
|
)
|
|
2993
3367
|
] })
|
|
@@ -2998,12 +3372,12 @@ var PdfHeader = ({
|
|
|
2998
3372
|
PdfHeader.displayName = "PdfHeader";
|
|
2999
3373
|
|
|
3000
3374
|
// src/components/pdf-viewer/hooks/useContainerWidth.ts
|
|
3001
|
-
import * as
|
|
3375
|
+
import * as React25 from "react";
|
|
3002
3376
|
function useContainerWidth(padding = 32) {
|
|
3003
|
-
const [containerWidth, setContainerWidth] =
|
|
3004
|
-
const containerRef =
|
|
3005
|
-
const lastWidthRef =
|
|
3006
|
-
|
|
3377
|
+
const [containerWidth, setContainerWidth] = React25.useState(0);
|
|
3378
|
+
const containerRef = React25.useRef(null);
|
|
3379
|
+
const lastWidthRef = React25.useRef(0);
|
|
3380
|
+
React25.useEffect(() => {
|
|
3007
3381
|
const element = containerRef.current;
|
|
3008
3382
|
if (!element) return;
|
|
3009
3383
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
@@ -3027,9 +3401,9 @@ function useContainerWidth(padding = 32) {
|
|
|
3027
3401
|
}
|
|
3028
3402
|
|
|
3029
3403
|
// src/components/pdf-viewer/hooks/usePdfDownload.ts
|
|
3030
|
-
import * as
|
|
3404
|
+
import * as React26 from "react";
|
|
3031
3405
|
function usePdfDownload(file, title) {
|
|
3032
|
-
const download =
|
|
3406
|
+
const download = React26.useCallback(async () => {
|
|
3033
3407
|
if (!file) return;
|
|
3034
3408
|
try {
|
|
3035
3409
|
let blob;
|
|
@@ -3061,11 +3435,11 @@ function usePdfDownload(file, title) {
|
|
|
3061
3435
|
}
|
|
3062
3436
|
|
|
3063
3437
|
// src/components/pdf-viewer/hooks/usePdfPrint.ts
|
|
3064
|
-
import * as
|
|
3438
|
+
import * as React27 from "react";
|
|
3065
3439
|
function usePdfPrint(file) {
|
|
3066
|
-
const [printBlobUrl, setPrintBlobUrl] =
|
|
3067
|
-
const printFrameRef =
|
|
3068
|
-
const preparePrint =
|
|
3440
|
+
const [printBlobUrl, setPrintBlobUrl] = React27.useState(null);
|
|
3441
|
+
const printFrameRef = React27.useRef(null);
|
|
3442
|
+
const preparePrint = React27.useCallback(async () => {
|
|
3069
3443
|
if (!file) return;
|
|
3070
3444
|
try {
|
|
3071
3445
|
let blob;
|
|
@@ -3081,14 +3455,14 @@ function usePdfPrint(file) {
|
|
|
3081
3455
|
console.error("Failed to prepare PDF for printing:", error);
|
|
3082
3456
|
}
|
|
3083
3457
|
}, [file]);
|
|
3084
|
-
|
|
3458
|
+
React27.useEffect(() => {
|
|
3085
3459
|
return () => {
|
|
3086
3460
|
if (printBlobUrl) {
|
|
3087
3461
|
URL.revokeObjectURL(printBlobUrl);
|
|
3088
3462
|
}
|
|
3089
3463
|
};
|
|
3090
3464
|
}, [printBlobUrl]);
|
|
3091
|
-
const print =
|
|
3465
|
+
const print = React27.useCallback(() => {
|
|
3092
3466
|
if (printFrameRef.current?.contentWindow) {
|
|
3093
3467
|
printFrameRef.current.contentWindow.print();
|
|
3094
3468
|
}
|
|
@@ -3097,7 +3471,7 @@ function usePdfPrint(file) {
|
|
|
3097
3471
|
}
|
|
3098
3472
|
|
|
3099
3473
|
// src/components/pdf-viewer/hooks/usePdfScroll.ts
|
|
3100
|
-
import * as
|
|
3474
|
+
import * as React28 from "react";
|
|
3101
3475
|
function usePdfScroll({
|
|
3102
3476
|
containerRef,
|
|
3103
3477
|
numPages,
|
|
@@ -3108,30 +3482,30 @@ function usePdfScroll({
|
|
|
3108
3482
|
effectiveWidth,
|
|
3109
3483
|
viewportBuffer
|
|
3110
3484
|
}) {
|
|
3111
|
-
const [internalPage, setInternalPage] =
|
|
3485
|
+
const [internalPage, setInternalPage] = React28.useState(1);
|
|
3112
3486
|
const isControlled = scrollTo !== void 0;
|
|
3113
3487
|
const currentPage = isControlled ? scrollTo.page : internalPage;
|
|
3114
|
-
const scrollOperationRef =
|
|
3488
|
+
const scrollOperationRef = React28.useRef({
|
|
3115
3489
|
isProgrammatic: false,
|
|
3116
3490
|
targetPage: null,
|
|
3117
3491
|
lastReportedPage: 1,
|
|
3118
3492
|
notifyOnComplete: false
|
|
3119
3493
|
});
|
|
3120
|
-
const [visibleRange, setVisibleRange] =
|
|
3494
|
+
const [visibleRange, setVisibleRange] = React28.useState({
|
|
3121
3495
|
start: 1,
|
|
3122
3496
|
end: Math.min(1 + viewportBuffer, numPages || 1 + viewportBuffer)
|
|
3123
3497
|
});
|
|
3124
|
-
const visiblePages =
|
|
3498
|
+
const visiblePages = React28.useMemo(() => {
|
|
3125
3499
|
const pages = /* @__PURE__ */ new Set();
|
|
3126
3500
|
for (let i = visibleRange.start; i <= visibleRange.end; i++) {
|
|
3127
3501
|
pages.add(i);
|
|
3128
3502
|
}
|
|
3129
3503
|
return pages;
|
|
3130
3504
|
}, [visibleRange.start, visibleRange.end]);
|
|
3131
|
-
const observerRef =
|
|
3132
|
-
const intersectionRatiosRef =
|
|
3133
|
-
const pageRefsMapRef =
|
|
3134
|
-
const cumulativeOffsets =
|
|
3505
|
+
const observerRef = React28.useRef(null);
|
|
3506
|
+
const intersectionRatiosRef = React28.useRef(/* @__PURE__ */ new Map());
|
|
3507
|
+
const pageRefsMapRef = React28.useRef(/* @__PURE__ */ new Map());
|
|
3508
|
+
const cumulativeOffsets = React28.useMemo(() => {
|
|
3135
3509
|
if (!pageDimensions?.size) return null;
|
|
3136
3510
|
const offsets = [CONTAINER_PADDING];
|
|
3137
3511
|
let cumulative = CONTAINER_PADDING;
|
|
@@ -3143,7 +3517,7 @@ function usePdfScroll({
|
|
|
3143
3517
|
}
|
|
3144
3518
|
return offsets;
|
|
3145
3519
|
}, [pageDimensions, effectiveWidth]);
|
|
3146
|
-
const calculatePageOffset =
|
|
3520
|
+
const calculatePageOffset = React28.useCallback(
|
|
3147
3521
|
(pageNum) => {
|
|
3148
3522
|
if (cumulativeOffsets && pageNum <= cumulativeOffsets.length) {
|
|
3149
3523
|
return cumulativeOffsets[pageNum - 1];
|
|
@@ -3158,11 +3532,11 @@ function usePdfScroll({
|
|
|
3158
3532
|
},
|
|
3159
3533
|
[cumulativeOffsets, pageDimensions, effectiveWidth]
|
|
3160
3534
|
);
|
|
3161
|
-
const onPageChangeRef =
|
|
3162
|
-
|
|
3535
|
+
const onPageChangeRef = React28.useRef(onPageChange);
|
|
3536
|
+
React28.useEffect(() => {
|
|
3163
3537
|
onPageChangeRef.current = onPageChange;
|
|
3164
3538
|
}, [onPageChange]);
|
|
3165
|
-
const updatePage =
|
|
3539
|
+
const updatePage = React28.useCallback(
|
|
3166
3540
|
(pageNum) => {
|
|
3167
3541
|
scrollOperationRef.current.lastReportedPage = pageNum;
|
|
3168
3542
|
if (isControlled) {
|
|
@@ -3174,7 +3548,7 @@ function usePdfScroll({
|
|
|
3174
3548
|
[isControlled]
|
|
3175
3549
|
// Removed onPageChange - now uses ref
|
|
3176
3550
|
);
|
|
3177
|
-
const onProgrammaticScrollComplete =
|
|
3551
|
+
const onProgrammaticScrollComplete = React28.useCallback((pageNum) => {
|
|
3178
3552
|
const shouldNotify = scrollOperationRef.current.notifyOnComplete;
|
|
3179
3553
|
scrollOperationRef.current.isProgrammatic = false;
|
|
3180
3554
|
scrollOperationRef.current.targetPage = null;
|
|
@@ -3184,7 +3558,7 @@ function usePdfScroll({
|
|
|
3184
3558
|
onPageChangeRef.current?.(pageNum);
|
|
3185
3559
|
}
|
|
3186
3560
|
}, []);
|
|
3187
|
-
const scrollToPage =
|
|
3561
|
+
const scrollToPage = React28.useCallback(
|
|
3188
3562
|
(pageNum) => {
|
|
3189
3563
|
const container = containerRef.current;
|
|
3190
3564
|
if (!container || !pageDimensions?.size) return;
|
|
@@ -3215,7 +3589,7 @@ function usePdfScroll({
|
|
|
3215
3589
|
onProgrammaticScrollComplete
|
|
3216
3590
|
]
|
|
3217
3591
|
);
|
|
3218
|
-
const scrollToPosition =
|
|
3592
|
+
const scrollToPosition = React28.useCallback(
|
|
3219
3593
|
(target) => {
|
|
3220
3594
|
const container = containerRef.current;
|
|
3221
3595
|
if (!container || !pageDimensions?.size) return;
|
|
@@ -3256,7 +3630,7 @@ function usePdfScroll({
|
|
|
3256
3630
|
onProgrammaticScrollComplete
|
|
3257
3631
|
]
|
|
3258
3632
|
);
|
|
3259
|
-
const handlePageChange =
|
|
3633
|
+
const handlePageChange = React28.useCallback(
|
|
3260
3634
|
(pageNum) => {
|
|
3261
3635
|
const clampedPage = Math.max(1, Math.min(pageNum, numPages));
|
|
3262
3636
|
scrollOperationRef.current.lastReportedPage = clampedPage;
|
|
@@ -3270,12 +3644,12 @@ function usePdfScroll({
|
|
|
3270
3644
|
},
|
|
3271
3645
|
[numPages, scrollToPage, isControlled, onPageChange]
|
|
3272
3646
|
);
|
|
3273
|
-
const updatePageRef =
|
|
3274
|
-
|
|
3647
|
+
const updatePageRef = React28.useRef(updatePage);
|
|
3648
|
+
React28.useEffect(() => {
|
|
3275
3649
|
updatePageRef.current = updatePage;
|
|
3276
3650
|
}, [updatePage]);
|
|
3277
|
-
const lastBufferRef =
|
|
3278
|
-
|
|
3651
|
+
const lastBufferRef = React28.useRef({ start: 1, end: 1 + viewportBuffer });
|
|
3652
|
+
React28.useEffect(() => {
|
|
3279
3653
|
const container = containerRef.current;
|
|
3280
3654
|
if (!container) return;
|
|
3281
3655
|
const observer = new IntersectionObserver(
|
|
@@ -3335,7 +3709,7 @@ function usePdfScroll({
|
|
|
3335
3709
|
ratiosMap.clear();
|
|
3336
3710
|
};
|
|
3337
3711
|
}, [containerRef, numPages, viewportBuffer]);
|
|
3338
|
-
const observePage =
|
|
3712
|
+
const observePage = React28.useCallback(
|
|
3339
3713
|
(pageNum, element) => {
|
|
3340
3714
|
const prevElement = pageRefsMapRef.current.get(pageNum);
|
|
3341
3715
|
if (element) {
|
|
@@ -3356,7 +3730,7 @@ function usePdfScroll({
|
|
|
3356
3730
|
},
|
|
3357
3731
|
[]
|
|
3358
3732
|
);
|
|
3359
|
-
|
|
3733
|
+
React28.useEffect(() => {
|
|
3360
3734
|
const container = containerRef.current;
|
|
3361
3735
|
if (!container) return;
|
|
3362
3736
|
const handleUserScroll = () => {
|
|
@@ -3414,9 +3788,9 @@ function usePdfScroll({
|
|
|
3414
3788
|
}
|
|
3415
3789
|
};
|
|
3416
3790
|
}, [containerRef, onProgrammaticScrollComplete]);
|
|
3417
|
-
const lastScrollTargetRef =
|
|
3418
|
-
const prevEffectiveWidthRef =
|
|
3419
|
-
|
|
3791
|
+
const lastScrollTargetRef = React28.useRef(null);
|
|
3792
|
+
const prevEffectiveWidthRef = React28.useRef(effectiveWidth);
|
|
3793
|
+
React28.useEffect(() => {
|
|
3420
3794
|
if (prevEffectiveWidthRef.current !== effectiveWidth) {
|
|
3421
3795
|
prevEffectiveWidthRef.current = effectiveWidth;
|
|
3422
3796
|
const lastScrollTarget = lastScrollTargetRef.current;
|
|
@@ -3425,7 +3799,7 @@ function usePdfScroll({
|
|
|
3425
3799
|
}
|
|
3426
3800
|
}
|
|
3427
3801
|
}, [effectiveWidth]);
|
|
3428
|
-
|
|
3802
|
+
React28.useEffect(() => {
|
|
3429
3803
|
if (!isControlled || !scrollTo || numPages <= 0) return;
|
|
3430
3804
|
if (!pageDimensions?.size) return;
|
|
3431
3805
|
const lastScrollTarget = lastScrollTargetRef.current;
|
|
@@ -3458,7 +3832,7 @@ function usePdfScroll({
|
|
|
3458
3832
|
pageDimensions,
|
|
3459
3833
|
effectiveWidth
|
|
3460
3834
|
]);
|
|
3461
|
-
|
|
3835
|
+
React28.useEffect(() => {
|
|
3462
3836
|
const pageRefs = pageRefsMapRef.current;
|
|
3463
3837
|
const ratios = intersectionRatiosRef.current;
|
|
3464
3838
|
for (const pageNum of pageRefs.keys()) {
|
|
@@ -3482,14 +3856,14 @@ function usePdfScroll({
|
|
|
3482
3856
|
}
|
|
3483
3857
|
|
|
3484
3858
|
// src/components/pdf-viewer/hooks/useZoomControl.ts
|
|
3485
|
-
import * as
|
|
3859
|
+
import * as React29 from "react";
|
|
3486
3860
|
function useZoomControl({
|
|
3487
3861
|
containerRef,
|
|
3488
3862
|
initialZoom = PDF_ZOOM.DEFAULT
|
|
3489
3863
|
}) {
|
|
3490
|
-
const [zoom, setZoom] =
|
|
3491
|
-
const scrollRatioRef =
|
|
3492
|
-
const handleZoomChange =
|
|
3864
|
+
const [zoom, setZoom] = React29.useState(initialZoom);
|
|
3865
|
+
const scrollRatioRef = React29.useRef({ x: 0.5, y: 0 });
|
|
3866
|
+
const handleZoomChange = React29.useCallback(
|
|
3493
3867
|
(newZoom) => {
|
|
3494
3868
|
const container = containerRef.current;
|
|
3495
3869
|
if (container) {
|
|
@@ -3510,7 +3884,7 @@ function useZoomControl({
|
|
|
3510
3884
|
},
|
|
3511
3885
|
[containerRef]
|
|
3512
3886
|
);
|
|
3513
|
-
|
|
3887
|
+
React29.useEffect(() => {
|
|
3514
3888
|
const container = containerRef.current;
|
|
3515
3889
|
if (!container) return;
|
|
3516
3890
|
requestAnimationFrame(() => {
|
|
@@ -3535,9 +3909,9 @@ function initializePdfWorker(workerUrl) {
|
|
|
3535
3909
|
}
|
|
3536
3910
|
|
|
3537
3911
|
// src/components/pdf-viewer/index.tsx
|
|
3538
|
-
import { jsx as
|
|
3912
|
+
import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3539
3913
|
var DEFAULT_VIEWPORT_BUFFER = 1;
|
|
3540
|
-
var PdfViewer =
|
|
3914
|
+
var PdfViewer = React30.forwardRef(
|
|
3541
3915
|
({
|
|
3542
3916
|
file,
|
|
3543
3917
|
title,
|
|
@@ -3564,15 +3938,15 @@ var PdfViewer = React28.forwardRef(
|
|
|
3564
3938
|
className,
|
|
3565
3939
|
...props
|
|
3566
3940
|
}, ref) => {
|
|
3567
|
-
const [numPages, setNumPages] =
|
|
3568
|
-
const [pageDimensions, setPageDimensions] =
|
|
3941
|
+
const [numPages, setNumPages] = React30.useState(0);
|
|
3942
|
+
const [pageDimensions, setPageDimensions] = React30.useState(null);
|
|
3569
3943
|
const { containerWidth, containerRef } = useContainerWidth();
|
|
3570
3944
|
const { zoom, handleZoomChange } = useZoomControl({ containerRef });
|
|
3571
3945
|
const { printFrameRef, printBlobUrl, preparePrint, print } = usePdfPrint(file);
|
|
3572
3946
|
const download = usePdfDownload(file, title);
|
|
3573
3947
|
const baseWidth = Math.min(pageWidth || containerWidth, 800);
|
|
3574
3948
|
const effectiveWidth = Math.round(baseWidth * (zoom / 100));
|
|
3575
|
-
const handleDimensionsLoaded =
|
|
3949
|
+
const handleDimensionsLoaded = React30.useCallback(
|
|
3576
3950
|
(dimensions) => {
|
|
3577
3951
|
setPageDimensions(dimensions);
|
|
3578
3952
|
onDimensionsReady?.(dimensions);
|
|
@@ -3589,7 +3963,7 @@ var PdfViewer = React28.forwardRef(
|
|
|
3589
3963
|
effectiveWidth,
|
|
3590
3964
|
viewportBuffer
|
|
3591
3965
|
});
|
|
3592
|
-
const handleLoadSuccess =
|
|
3966
|
+
const handleLoadSuccess = React30.useCallback(
|
|
3593
3967
|
async (pages) => {
|
|
3594
3968
|
setNumPages(pages);
|
|
3595
3969
|
onLoadSuccess?.(pages);
|
|
@@ -3597,28 +3971,28 @@ var PdfViewer = React28.forwardRef(
|
|
|
3597
3971
|
},
|
|
3598
3972
|
[onLoadSuccess, preparePrint]
|
|
3599
3973
|
);
|
|
3600
|
-
const handleDownload =
|
|
3974
|
+
const handleDownload = React30.useCallback(() => {
|
|
3601
3975
|
if (onDownload) {
|
|
3602
3976
|
onDownload();
|
|
3603
3977
|
return;
|
|
3604
3978
|
}
|
|
3605
3979
|
download();
|
|
3606
3980
|
}, [onDownload, download]);
|
|
3607
|
-
const handlePrint =
|
|
3981
|
+
const handlePrint = React30.useCallback(() => {
|
|
3608
3982
|
if (onPrint) {
|
|
3609
3983
|
onPrint();
|
|
3610
3984
|
return;
|
|
3611
3985
|
}
|
|
3612
3986
|
print();
|
|
3613
3987
|
}, [onPrint, print]);
|
|
3614
|
-
return /* @__PURE__ */
|
|
3988
|
+
return /* @__PURE__ */ jsxs15(
|
|
3615
3989
|
"div",
|
|
3616
3990
|
{
|
|
3617
3991
|
ref,
|
|
3618
3992
|
className: cn("h-full flex flex-col", className),
|
|
3619
3993
|
...props,
|
|
3620
3994
|
children: [
|
|
3621
|
-
printBlobUrl && /* @__PURE__ */
|
|
3995
|
+
printBlobUrl && /* @__PURE__ */ jsx27(
|
|
3622
3996
|
"iframe",
|
|
3623
3997
|
{
|
|
3624
3998
|
ref: printFrameRef,
|
|
@@ -3627,7 +4001,7 @@ var PdfViewer = React28.forwardRef(
|
|
|
3627
4001
|
title: "PDF for printing"
|
|
3628
4002
|
}
|
|
3629
4003
|
),
|
|
3630
|
-
/* @__PURE__ */
|
|
4004
|
+
/* @__PURE__ */ jsx27(
|
|
3631
4005
|
PdfHeader,
|
|
3632
4006
|
{
|
|
3633
4007
|
title,
|
|
@@ -3635,8 +4009,8 @@ var PdfViewer = React28.forwardRef(
|
|
|
3635
4009
|
onPrint: handlePrint
|
|
3636
4010
|
}
|
|
3637
4011
|
),
|
|
3638
|
-
/* @__PURE__ */
|
|
3639
|
-
/* @__PURE__ */
|
|
4012
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex-1 flex overflow-hidden min-h-0", children: [
|
|
4013
|
+
/* @__PURE__ */ jsx27(CustomScrollbar, { containerRef, children: /* @__PURE__ */ jsx27(
|
|
3640
4014
|
PdfDocument,
|
|
3641
4015
|
{
|
|
3642
4016
|
file,
|
|
@@ -3660,7 +4034,7 @@ var PdfViewer = React28.forwardRef(
|
|
|
3660
4034
|
onBoxMouseLeave
|
|
3661
4035
|
}
|
|
3662
4036
|
) }),
|
|
3663
|
-
showControls && /* @__PURE__ */
|
|
4037
|
+
showControls && /* @__PURE__ */ jsx27(
|
|
3664
4038
|
PdfControls,
|
|
3665
4039
|
{
|
|
3666
4040
|
currentPage,
|
|
@@ -3681,10 +4055,10 @@ var PdfViewer = React28.forwardRef(
|
|
|
3681
4055
|
PdfViewer.displayName = "PdfViewer";
|
|
3682
4056
|
|
|
3683
4057
|
// src/components/ui/tabs.tsx
|
|
3684
|
-
import * as
|
|
3685
|
-
import { cva as
|
|
3686
|
-
import { jsx as
|
|
3687
|
-
var tabsVariants =
|
|
4058
|
+
import * as React31 from "react";
|
|
4059
|
+
import { cva as cva12 } from "class-variance-authority";
|
|
4060
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4061
|
+
var tabsVariants = cva12(
|
|
3688
4062
|
"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",
|
|
3689
4063
|
{
|
|
3690
4064
|
variants: {
|
|
@@ -3697,17 +4071,17 @@ var tabsVariants = cva11(
|
|
|
3697
4071
|
}
|
|
3698
4072
|
}
|
|
3699
4073
|
);
|
|
3700
|
-
var TabsContext =
|
|
4074
|
+
var TabsContext = React31.createContext(
|
|
3701
4075
|
void 0
|
|
3702
4076
|
);
|
|
3703
4077
|
function useTabsContext() {
|
|
3704
|
-
const context =
|
|
4078
|
+
const context = React31.useContext(TabsContext);
|
|
3705
4079
|
if (!context) {
|
|
3706
4080
|
throw new Error("Tabs components must be used within a Tabs provider");
|
|
3707
4081
|
}
|
|
3708
4082
|
return context;
|
|
3709
4083
|
}
|
|
3710
|
-
var Tabs =
|
|
4084
|
+
var Tabs = React31.forwardRef((props, ref) => {
|
|
3711
4085
|
const {
|
|
3712
4086
|
className,
|
|
3713
4087
|
value,
|
|
@@ -3716,7 +4090,7 @@ var Tabs = React29.forwardRef((props, ref) => {
|
|
|
3716
4090
|
children,
|
|
3717
4091
|
...restProps
|
|
3718
4092
|
} = props;
|
|
3719
|
-
const contextValue =
|
|
4093
|
+
const contextValue = React31.useMemo(
|
|
3720
4094
|
() => ({
|
|
3721
4095
|
activeTab: value,
|
|
3722
4096
|
setActiveTab: onValueChange,
|
|
@@ -3724,13 +4098,13 @@ var Tabs = React29.forwardRef((props, ref) => {
|
|
|
3724
4098
|
}),
|
|
3725
4099
|
[value, onValueChange, variant]
|
|
3726
4100
|
);
|
|
3727
|
-
return /* @__PURE__ */
|
|
4101
|
+
return /* @__PURE__ */ jsx28(TabsContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx28("div", { ref, className: cn("w-full", className), ...restProps, children }) });
|
|
3728
4102
|
});
|
|
3729
4103
|
Tabs.displayName = "Tabs";
|
|
3730
|
-
var TabsList =
|
|
4104
|
+
var TabsList = React31.forwardRef(
|
|
3731
4105
|
(props, ref) => {
|
|
3732
4106
|
const { className, children, ...restProps } = props;
|
|
3733
|
-
return /* @__PURE__ */
|
|
4107
|
+
return /* @__PURE__ */ jsx28(
|
|
3734
4108
|
"div",
|
|
3735
4109
|
{
|
|
3736
4110
|
ref,
|
|
@@ -3746,7 +4120,7 @@ TabsList.displayName = "TabsList";
|
|
|
3746
4120
|
var getTabTypographyStyles = (isActive) => ({
|
|
3747
4121
|
font: isActive ? "var(--typography-label-sm-bold)" : "var(--typography-label-sm-regular)"
|
|
3748
4122
|
});
|
|
3749
|
-
var TabsTrigger =
|
|
4123
|
+
var TabsTrigger = React31.forwardRef(
|
|
3750
4124
|
(props, ref) => {
|
|
3751
4125
|
const { className, value, disabled, style, children, ...restProps } = props;
|
|
3752
4126
|
const { activeTab, setActiveTab, variant } = useTabsContext();
|
|
@@ -3754,22 +4128,22 @@ var TabsTrigger = React29.forwardRef(
|
|
|
3754
4128
|
throw new Error("TabsTrigger must have a value prop");
|
|
3755
4129
|
}
|
|
3756
4130
|
const isActive = activeTab === value;
|
|
3757
|
-
const tokenStyles =
|
|
4131
|
+
const tokenStyles = React31.useMemo(
|
|
3758
4132
|
() => ({
|
|
3759
4133
|
...getTabTypographyStyles(isActive),
|
|
3760
4134
|
...style
|
|
3761
4135
|
}),
|
|
3762
4136
|
[isActive, style]
|
|
3763
4137
|
);
|
|
3764
|
-
const triggerClassName =
|
|
4138
|
+
const triggerClassName = React31.useMemo(
|
|
3765
4139
|
() => cn(tabsVariants({ variant }), className),
|
|
3766
4140
|
[variant, className]
|
|
3767
4141
|
);
|
|
3768
|
-
const handleClick =
|
|
4142
|
+
const handleClick = React31.useCallback(() => {
|
|
3769
4143
|
if (disabled) return;
|
|
3770
4144
|
setActiveTab(value);
|
|
3771
4145
|
}, [disabled, setActiveTab, value]);
|
|
3772
|
-
return /* @__PURE__ */
|
|
4146
|
+
return /* @__PURE__ */ jsx28(
|
|
3773
4147
|
"button",
|
|
3774
4148
|
{
|
|
3775
4149
|
ref,
|
|
@@ -3783,13 +4157,13 @@ var TabsTrigger = React29.forwardRef(
|
|
|
3783
4157
|
disabled,
|
|
3784
4158
|
onClick: handleClick,
|
|
3785
4159
|
...restProps,
|
|
3786
|
-
children: /* @__PURE__ */
|
|
4160
|
+
children: /* @__PURE__ */ jsx28("span", { className: "pl-3 pr-6 py-2", children })
|
|
3787
4161
|
}
|
|
3788
4162
|
);
|
|
3789
4163
|
}
|
|
3790
4164
|
);
|
|
3791
4165
|
TabsTrigger.displayName = "TabsTrigger";
|
|
3792
|
-
var TabsContent =
|
|
4166
|
+
var TabsContent = React31.forwardRef(
|
|
3793
4167
|
(props, ref) => {
|
|
3794
4168
|
const { className, value, children, ...restProps } = props;
|
|
3795
4169
|
const { activeTab } = useTabsContext();
|
|
@@ -3800,7 +4174,7 @@ var TabsContent = React29.forwardRef(
|
|
|
3800
4174
|
if (!isActive) {
|
|
3801
4175
|
return null;
|
|
3802
4176
|
}
|
|
3803
|
-
return /* @__PURE__ */
|
|
4177
|
+
return /* @__PURE__ */ jsx28(
|
|
3804
4178
|
"div",
|
|
3805
4179
|
{
|
|
3806
4180
|
ref,
|
|
@@ -3818,11 +4192,11 @@ var TabsContent = React29.forwardRef(
|
|
|
3818
4192
|
TabsContent.displayName = "TabsContent";
|
|
3819
4193
|
|
|
3820
4194
|
// src/components/ui/dropdown-menu.tsx
|
|
3821
|
-
import * as
|
|
4195
|
+
import * as React32 from "react";
|
|
3822
4196
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3823
|
-
import { jsx as
|
|
4197
|
+
import { jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3824
4198
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
3825
|
-
var DropdownMenuTrigger =
|
|
4199
|
+
var DropdownMenuTrigger = React32.forwardRef(({ className, icon, children, ...props }, ref) => /* @__PURE__ */ jsxs16(
|
|
3826
4200
|
DropdownMenuPrimitive.Trigger,
|
|
3827
4201
|
{
|
|
3828
4202
|
ref,
|
|
@@ -3832,7 +4206,7 @@ var DropdownMenuTrigger = React30.forwardRef(({ className, icon, children, ...pr
|
|
|
3832
4206
|
),
|
|
3833
4207
|
...props,
|
|
3834
4208
|
children: [
|
|
3835
|
-
icon || /* @__PURE__ */
|
|
4209
|
+
icon || /* @__PURE__ */ jsx29(MoreMenuIcon, {}),
|
|
3836
4210
|
children
|
|
3837
4211
|
]
|
|
3838
4212
|
}
|
|
@@ -3842,7 +4216,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
3842
4216
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
3843
4217
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
3844
4218
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
3845
|
-
var DropdownMenuSubTrigger =
|
|
4219
|
+
var DropdownMenuSubTrigger = React32.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs16(
|
|
3846
4220
|
DropdownMenuPrimitive.SubTrigger,
|
|
3847
4221
|
{
|
|
3848
4222
|
ref,
|
|
@@ -3855,12 +4229,12 @@ var DropdownMenuSubTrigger = React30.forwardRef(({ className, inset, children, .
|
|
|
3855
4229
|
...props,
|
|
3856
4230
|
children: [
|
|
3857
4231
|
children,
|
|
3858
|
-
/* @__PURE__ */
|
|
4232
|
+
/* @__PURE__ */ jsx29(ArrowRightIcon, { className: "ml-auto" })
|
|
3859
4233
|
]
|
|
3860
4234
|
}
|
|
3861
4235
|
));
|
|
3862
4236
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
3863
|
-
var DropdownMenuSubContent =
|
|
4237
|
+
var DropdownMenuSubContent = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx29(
|
|
3864
4238
|
DropdownMenuPrimitive.SubContent,
|
|
3865
4239
|
{
|
|
3866
4240
|
ref,
|
|
@@ -3872,7 +4246,7 @@ var DropdownMenuSubContent = React30.forwardRef(({ className, ...props }, ref) =
|
|
|
3872
4246
|
}
|
|
3873
4247
|
));
|
|
3874
4248
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3875
|
-
var DropdownMenuContent =
|
|
4249
|
+
var DropdownMenuContent = React32.forwardRef(({ className, sideOffset = 4, align = "end", ...props }, ref) => /* @__PURE__ */ jsx29(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx29(
|
|
3876
4250
|
DropdownMenuPrimitive.Content,
|
|
3877
4251
|
{
|
|
3878
4252
|
ref,
|
|
@@ -3886,7 +4260,7 @@ var DropdownMenuContent = React30.forwardRef(({ className, sideOffset = 4, align
|
|
|
3886
4260
|
}
|
|
3887
4261
|
) }));
|
|
3888
4262
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3889
|
-
var DropdownMenuItem =
|
|
4263
|
+
var DropdownMenuItem = React32.forwardRef(({ className, inset, style, ...props }, ref) => /* @__PURE__ */ jsx29(
|
|
3890
4264
|
DropdownMenuPrimitive.Item,
|
|
3891
4265
|
{
|
|
3892
4266
|
ref,
|
|
@@ -3903,7 +4277,7 @@ var DropdownMenuItem = React30.forwardRef(({ className, inset, style, ...props }
|
|
|
3903
4277
|
}
|
|
3904
4278
|
));
|
|
3905
4279
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
3906
|
-
var DropdownMenuCheckboxItem =
|
|
4280
|
+
var DropdownMenuCheckboxItem = React32.forwardRef(({ className, children, style, checked, ...props }, ref) => /* @__PURE__ */ jsxs16(
|
|
3907
4281
|
DropdownMenuPrimitive.CheckboxItem,
|
|
3908
4282
|
{
|
|
3909
4283
|
ref,
|
|
@@ -3918,7 +4292,7 @@ var DropdownMenuCheckboxItem = React30.forwardRef(({ className, children, style,
|
|
|
3918
4292
|
},
|
|
3919
4293
|
...props,
|
|
3920
4294
|
children: [
|
|
3921
|
-
/* @__PURE__ */
|
|
4295
|
+
/* @__PURE__ */ jsx29(
|
|
3922
4296
|
Checkbox,
|
|
3923
4297
|
{
|
|
3924
4298
|
checked: checked === true,
|
|
@@ -3926,12 +4300,12 @@ var DropdownMenuCheckboxItem = React30.forwardRef(({ className, children, style,
|
|
|
3926
4300
|
"aria-hidden": "true"
|
|
3927
4301
|
}
|
|
3928
4302
|
),
|
|
3929
|
-
/* @__PURE__ */
|
|
4303
|
+
/* @__PURE__ */ jsx29("span", { className: "flex-1", children })
|
|
3930
4304
|
]
|
|
3931
4305
|
}
|
|
3932
4306
|
));
|
|
3933
4307
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
3934
|
-
var DropdownMenuRadioItem =
|
|
4308
|
+
var DropdownMenuRadioItem = React32.forwardRef(({ className, children, style, ...props }, ref) => /* @__PURE__ */ jsxs16(
|
|
3935
4309
|
DropdownMenuPrimitive.RadioItem,
|
|
3936
4310
|
{
|
|
3937
4311
|
ref,
|
|
@@ -3945,13 +4319,13 @@ var DropdownMenuRadioItem = React30.forwardRef(({ className, children, style, ..
|
|
|
3945
4319
|
},
|
|
3946
4320
|
...props,
|
|
3947
4321
|
children: [
|
|
3948
|
-
/* @__PURE__ */
|
|
4322
|
+
/* @__PURE__ */ jsx29("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx29(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx29("span", { className: "h-2 w-2 rounded-full bg-current" }) }) }),
|
|
3949
4323
|
children
|
|
3950
4324
|
]
|
|
3951
4325
|
}
|
|
3952
4326
|
));
|
|
3953
4327
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
3954
|
-
var DropdownMenuLabel =
|
|
4328
|
+
var DropdownMenuLabel = React32.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx29(
|
|
3955
4329
|
DropdownMenuPrimitive.Label,
|
|
3956
4330
|
{
|
|
3957
4331
|
ref,
|
|
@@ -3964,7 +4338,7 @@ var DropdownMenuLabel = React30.forwardRef(({ className, inset, ...props }, ref)
|
|
|
3964
4338
|
}
|
|
3965
4339
|
));
|
|
3966
4340
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
3967
|
-
var DropdownMenuSeparator =
|
|
4341
|
+
var DropdownMenuSeparator = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx29(
|
|
3968
4342
|
DropdownMenuPrimitive.Separator,
|
|
3969
4343
|
{
|
|
3970
4344
|
ref,
|
|
@@ -3977,7 +4351,7 @@ var DropdownMenuShortcut = ({
|
|
|
3977
4351
|
className,
|
|
3978
4352
|
...props
|
|
3979
4353
|
}) => {
|
|
3980
|
-
return /* @__PURE__ */
|
|
4354
|
+
return /* @__PURE__ */ jsx29(
|
|
3981
4355
|
"span",
|
|
3982
4356
|
{
|
|
3983
4357
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
@@ -3988,21 +4362,21 @@ var DropdownMenuShortcut = ({
|
|
|
3988
4362
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3989
4363
|
|
|
3990
4364
|
// src/components/ui/charts/chart-legend.tsx
|
|
3991
|
-
import { jsx as
|
|
4365
|
+
import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3992
4366
|
function ChartLegend({
|
|
3993
4367
|
items,
|
|
3994
4368
|
x = 0,
|
|
3995
4369
|
y = 550,
|
|
3996
4370
|
className = ""
|
|
3997
4371
|
}) {
|
|
3998
|
-
return /* @__PURE__ */
|
|
4372
|
+
return /* @__PURE__ */ jsx30("foreignObject", { x, y, width: "100%", height: "40", children: /* @__PURE__ */ jsx30(
|
|
3999
4373
|
"div",
|
|
4000
4374
|
{
|
|
4001
4375
|
className: `flex justify-center items-center gap-6 ${className}`,
|
|
4002
4376
|
style: { height: "100%" },
|
|
4003
|
-
children: items.map(({ key, color, label }) => /* @__PURE__ */
|
|
4004
|
-
/* @__PURE__ */
|
|
4005
|
-
/* @__PURE__ */
|
|
4377
|
+
children: items.map(({ key, color, label }) => /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
|
|
4378
|
+
/* @__PURE__ */ jsx30("div", { className: "w-3 h-3", style: { backgroundColor: color } }),
|
|
4379
|
+
/* @__PURE__ */ jsx30(Typography, { variant: "body-xs", children: label || key })
|
|
4006
4380
|
] }, key))
|
|
4007
4381
|
}
|
|
4008
4382
|
) });
|
|
@@ -4120,12 +4494,12 @@ var formatLargeNumber = (value) => {
|
|
|
4120
4494
|
};
|
|
4121
4495
|
|
|
4122
4496
|
// src/components/ui/charts/chart-labels.tsx
|
|
4123
|
-
import { jsx as
|
|
4497
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
4124
4498
|
var createCustomXAxisLabel = (text, yOffset = 40) => {
|
|
4125
4499
|
const CustomXAxisLabel = ({ viewBox }) => {
|
|
4126
4500
|
if (!viewBox) return null;
|
|
4127
4501
|
const { x, y, width } = viewBox;
|
|
4128
|
-
return /* @__PURE__ */
|
|
4502
|
+
return /* @__PURE__ */ jsx31("g", { children: /* @__PURE__ */ jsx31("foreignObject", { x, y: y + yOffset, width, height: 20, children: /* @__PURE__ */ jsx31("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ jsx31(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
4129
4503
|
};
|
|
4130
4504
|
CustomXAxisLabel.displayName = "CustomXAxisLabel";
|
|
4131
4505
|
return CustomXAxisLabel;
|
|
@@ -4135,7 +4509,7 @@ var createCustomYAxisLabel = (text, leftMargin) => {
|
|
|
4135
4509
|
if (!viewBox) return null;
|
|
4136
4510
|
const { x, y, height } = viewBox;
|
|
4137
4511
|
const offset = leftMargin ? leftMargin + 10 : 110;
|
|
4138
|
-
return /* @__PURE__ */
|
|
4512
|
+
return /* @__PURE__ */ jsx31("g", { children: /* @__PURE__ */ jsx31("foreignObject", { x: x - offset, y, width: 100, height, children: /* @__PURE__ */ jsx31("div", { className: "flex items-center justify-center h-full transform -rotate-90 whitespace-nowrap", children: /* @__PURE__ */ jsx31(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
4139
4513
|
};
|
|
4140
4514
|
CustomYAxisLabel.displayName = "CustomYAxisLabel";
|
|
4141
4515
|
return CustomYAxisLabel;
|
|
@@ -4144,14 +4518,14 @@ var createCustomYAxisRightLabel = (text) => {
|
|
|
4144
4518
|
const CustomYAxisRightLabel = ({ viewBox }) => {
|
|
4145
4519
|
if (!viewBox) return null;
|
|
4146
4520
|
const { x, y, width, height } = viewBox;
|
|
4147
|
-
return /* @__PURE__ */
|
|
4521
|
+
return /* @__PURE__ */ jsx31("g", { children: /* @__PURE__ */ jsx31("foreignObject", { x: x + width - 70, y, width: 120, height, children: /* @__PURE__ */ jsx31("div", { className: "flex items-center justify-center h-full transform rotate-90 whitespace-nowrap", children: /* @__PURE__ */ jsx31(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
4148
4522
|
};
|
|
4149
4523
|
CustomYAxisRightLabel.displayName = "CustomYAxisRightLabel";
|
|
4150
4524
|
return CustomYAxisRightLabel;
|
|
4151
4525
|
};
|
|
4152
4526
|
var customXAxisTick = (props) => {
|
|
4153
4527
|
const { x, y, payload } = props;
|
|
4154
|
-
return /* @__PURE__ */
|
|
4528
|
+
return /* @__PURE__ */ jsx31("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ jsx31(
|
|
4155
4529
|
"foreignObject",
|
|
4156
4530
|
{
|
|
4157
4531
|
x: -20,
|
|
@@ -4159,12 +4533,12 @@ var customXAxisTick = (props) => {
|
|
|
4159
4533
|
width: 40,
|
|
4160
4534
|
height: 20,
|
|
4161
4535
|
style: { overflow: "visible" },
|
|
4162
|
-
children: /* @__PURE__ */
|
|
4536
|
+
children: /* @__PURE__ */ jsx31(
|
|
4163
4537
|
"div",
|
|
4164
4538
|
{
|
|
4165
4539
|
className: "flex items-start justify-center h-full",
|
|
4166
4540
|
style: { overflow: "visible" },
|
|
4167
|
-
children: /* @__PURE__ */
|
|
4541
|
+
children: /* @__PURE__ */ jsx31(
|
|
4168
4542
|
Typography,
|
|
4169
4543
|
{
|
|
4170
4544
|
variant: "body-xs",
|
|
@@ -4179,7 +4553,7 @@ var customXAxisTick = (props) => {
|
|
|
4179
4553
|
};
|
|
4180
4554
|
var customXAxisTickRotated = (props) => {
|
|
4181
4555
|
const { x, y, payload } = props;
|
|
4182
|
-
return /* @__PURE__ */
|
|
4556
|
+
return /* @__PURE__ */ jsx31("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ jsx31(
|
|
4183
4557
|
"text",
|
|
4184
4558
|
{
|
|
4185
4559
|
x: 0,
|
|
@@ -4198,25 +4572,25 @@ var customYAxisTick = (props) => {
|
|
|
4198
4572
|
const { x, y, payload } = props;
|
|
4199
4573
|
const text = String(payload.value);
|
|
4200
4574
|
const estimatedWidth = Math.max(text.length * 8, 80);
|
|
4201
|
-
return /* @__PURE__ */
|
|
4575
|
+
return /* @__PURE__ */ jsx31(
|
|
4202
4576
|
"foreignObject",
|
|
4203
4577
|
{
|
|
4204
4578
|
x: x - estimatedWidth + 5,
|
|
4205
4579
|
y: y - 6,
|
|
4206
4580
|
width: estimatedWidth,
|
|
4207
4581
|
height: 15,
|
|
4208
|
-
children: /* @__PURE__ */
|
|
4582
|
+
children: /* @__PURE__ */ jsx31("div", { className: "flex justify-end w-full", children: /* @__PURE__ */ jsx31(Typography, { variant: "body-xs", className: "text-secondary", children: payload.value }) })
|
|
4209
4583
|
}
|
|
4210
4584
|
);
|
|
4211
4585
|
};
|
|
4212
4586
|
|
|
4213
4587
|
// src/components/ui/charts/chart-tooltip.tsx
|
|
4214
|
-
import { Fragment as Fragment2, jsx as
|
|
4588
|
+
import { Fragment as Fragment2, jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4215
4589
|
function TooltipContainer({
|
|
4216
4590
|
children,
|
|
4217
4591
|
className = ""
|
|
4218
4592
|
}) {
|
|
4219
|
-
return /* @__PURE__ */
|
|
4593
|
+
return /* @__PURE__ */ jsx32(
|
|
4220
4594
|
"div",
|
|
4221
4595
|
{
|
|
4222
4596
|
className: `bg-light border border-subtle rounded p-2.5 text-dark ${className}`,
|
|
@@ -4230,10 +4604,10 @@ function TooltipItem({
|
|
|
4230
4604
|
value,
|
|
4231
4605
|
className = ""
|
|
4232
4606
|
}) {
|
|
4233
|
-
return /* @__PURE__ */
|
|
4234
|
-
/* @__PURE__ */
|
|
4235
|
-
/* @__PURE__ */
|
|
4236
|
-
/* @__PURE__ */
|
|
4607
|
+
return /* @__PURE__ */ jsxs18(Fragment2, { children: [
|
|
4608
|
+
/* @__PURE__ */ jsx32("br", {}),
|
|
4609
|
+
/* @__PURE__ */ jsxs18(Typography, { variant: "label-sm", className, children: [
|
|
4610
|
+
/* @__PURE__ */ jsx32(
|
|
4237
4611
|
"span",
|
|
4238
4612
|
{
|
|
4239
4613
|
className: "inline-block w-3 h-3 mr-1.5",
|
|
@@ -4251,9 +4625,9 @@ function GenericTooltip({
|
|
|
4251
4625
|
items,
|
|
4252
4626
|
className = ""
|
|
4253
4627
|
}) {
|
|
4254
|
-
return /* @__PURE__ */
|
|
4255
|
-
title && /* @__PURE__ */
|
|
4256
|
-
items.map((item, index) => /* @__PURE__ */
|
|
4628
|
+
return /* @__PURE__ */ jsxs18(TooltipContainer, { className, children: [
|
|
4629
|
+
title && /* @__PURE__ */ jsx32(Typography, { variant: "label-sm-bold", children: title }),
|
|
4630
|
+
items.map((item, index) => /* @__PURE__ */ jsx32(
|
|
4257
4631
|
TooltipItem,
|
|
4258
4632
|
{
|
|
4259
4633
|
color: item.color,
|
|
@@ -4266,7 +4640,7 @@ function GenericTooltip({
|
|
|
4266
4640
|
}
|
|
4267
4641
|
|
|
4268
4642
|
// src/components/ui/charts/bar-chart.tsx
|
|
4269
|
-
import { forwardRef as
|
|
4643
|
+
import { forwardRef as forwardRef24 } from "react";
|
|
4270
4644
|
import {
|
|
4271
4645
|
BarChart as RechartsBarChart,
|
|
4272
4646
|
Bar,
|
|
@@ -4275,8 +4649,8 @@ import {
|
|
|
4275
4649
|
Tooltip as Tooltip2,
|
|
4276
4650
|
ResponsiveContainer
|
|
4277
4651
|
} from "recharts";
|
|
4278
|
-
import { jsx as
|
|
4279
|
-
var BarChart =
|
|
4652
|
+
import { jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4653
|
+
var BarChart = forwardRef24(
|
|
4280
4654
|
({
|
|
4281
4655
|
data,
|
|
4282
4656
|
xAxisKey,
|
|
@@ -4302,19 +4676,19 @@ var BarChart = forwardRef22(
|
|
|
4302
4676
|
};
|
|
4303
4677
|
const defaultLegendItems = showLegend && legendItems.length === 0 ? [{ key: yAxisKey, color: barColor, label: yAxisKey }] : legendItems;
|
|
4304
4678
|
const hasData = data && data.length > 0;
|
|
4305
|
-
return /* @__PURE__ */
|
|
4679
|
+
return /* @__PURE__ */ jsxs19(
|
|
4306
4680
|
"div",
|
|
4307
4681
|
{
|
|
4308
4682
|
ref,
|
|
4309
4683
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
4310
4684
|
children: [
|
|
4311
|
-
/* @__PURE__ */
|
|
4312
|
-
/* @__PURE__ */
|
|
4685
|
+
/* @__PURE__ */ jsx33("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ jsx33(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
4686
|
+
/* @__PURE__ */ jsx33("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ jsx33(
|
|
4313
4687
|
ResponsiveContainer,
|
|
4314
4688
|
{
|
|
4315
4689
|
width: "100%",
|
|
4316
4690
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
4317
|
-
children: /* @__PURE__ */
|
|
4691
|
+
children: /* @__PURE__ */ jsxs19(
|
|
4318
4692
|
RechartsBarChart,
|
|
4319
4693
|
{
|
|
4320
4694
|
data,
|
|
@@ -4326,7 +4700,7 @@ var BarChart = forwardRef22(
|
|
|
4326
4700
|
onClick: handleClick,
|
|
4327
4701
|
layout,
|
|
4328
4702
|
children: [
|
|
4329
|
-
/* @__PURE__ */
|
|
4703
|
+
/* @__PURE__ */ jsx33(
|
|
4330
4704
|
XAxis,
|
|
4331
4705
|
{
|
|
4332
4706
|
dataKey: xAxisKey,
|
|
@@ -4340,7 +4714,7 @@ var BarChart = forwardRef22(
|
|
|
4340
4714
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel, 80) : void 0
|
|
4341
4715
|
}
|
|
4342
4716
|
),
|
|
4343
|
-
/* @__PURE__ */
|
|
4717
|
+
/* @__PURE__ */ jsx33(
|
|
4344
4718
|
YAxis,
|
|
4345
4719
|
{
|
|
4346
4720
|
axisLine: false,
|
|
@@ -4351,7 +4725,7 @@ var BarChart = forwardRef22(
|
|
|
4351
4725
|
type: yAxisType
|
|
4352
4726
|
}
|
|
4353
4727
|
),
|
|
4354
|
-
/* @__PURE__ */
|
|
4728
|
+
/* @__PURE__ */ jsx33(
|
|
4355
4729
|
Tooltip2,
|
|
4356
4730
|
{
|
|
4357
4731
|
content: ({
|
|
@@ -4360,7 +4734,7 @@ var BarChart = forwardRef22(
|
|
|
4360
4734
|
label
|
|
4361
4735
|
}) => {
|
|
4362
4736
|
if (active && payload && payload.length) {
|
|
4363
|
-
return /* @__PURE__ */
|
|
4737
|
+
return /* @__PURE__ */ jsx33(
|
|
4364
4738
|
GenericTooltip,
|
|
4365
4739
|
{
|
|
4366
4740
|
title: label?.toString(),
|
|
@@ -4376,7 +4750,7 @@ var BarChart = forwardRef22(
|
|
|
4376
4750
|
}
|
|
4377
4751
|
}
|
|
4378
4752
|
),
|
|
4379
|
-
/* @__PURE__ */
|
|
4753
|
+
/* @__PURE__ */ jsx33(
|
|
4380
4754
|
Bar,
|
|
4381
4755
|
{
|
|
4382
4756
|
dataKey: barDataKey || yAxisKey,
|
|
@@ -4384,12 +4758,12 @@ var BarChart = forwardRef22(
|
|
|
4384
4758
|
name: barDataKey || yAxisKey
|
|
4385
4759
|
}
|
|
4386
4760
|
),
|
|
4387
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */
|
|
4761
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ jsx33(ChartLegend, { items: defaultLegendItems })
|
|
4388
4762
|
]
|
|
4389
4763
|
}
|
|
4390
4764
|
)
|
|
4391
4765
|
}
|
|
4392
|
-
) : /* @__PURE__ */
|
|
4766
|
+
) : /* @__PURE__ */ jsx33("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ jsx33(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
4393
4767
|
]
|
|
4394
4768
|
}
|
|
4395
4769
|
);
|
|
@@ -4398,7 +4772,7 @@ var BarChart = forwardRef22(
|
|
|
4398
4772
|
BarChart.displayName = "BarChart";
|
|
4399
4773
|
|
|
4400
4774
|
// src/components/ui/charts/line-chart.tsx
|
|
4401
|
-
import { forwardRef as
|
|
4775
|
+
import { forwardRef as forwardRef25 } from "react";
|
|
4402
4776
|
import {
|
|
4403
4777
|
LineChart as RechartsLineChart,
|
|
4404
4778
|
Line,
|
|
@@ -4407,8 +4781,8 @@ import {
|
|
|
4407
4781
|
Tooltip as Tooltip3,
|
|
4408
4782
|
ResponsiveContainer as ResponsiveContainer2
|
|
4409
4783
|
} from "recharts";
|
|
4410
|
-
import { jsx as
|
|
4411
|
-
var LineChart =
|
|
4784
|
+
import { jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4785
|
+
var LineChart = forwardRef25(
|
|
4412
4786
|
({
|
|
4413
4787
|
data,
|
|
4414
4788
|
xAxisKey,
|
|
@@ -4436,19 +4810,19 @@ var LineChart = forwardRef23(
|
|
|
4436
4810
|
)
|
|
4437
4811
|
);
|
|
4438
4812
|
const hasData = data && data.length > 0;
|
|
4439
|
-
return /* @__PURE__ */
|
|
4813
|
+
return /* @__PURE__ */ jsxs20(
|
|
4440
4814
|
"div",
|
|
4441
4815
|
{
|
|
4442
4816
|
ref,
|
|
4443
4817
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
4444
4818
|
children: [
|
|
4445
|
-
/* @__PURE__ */
|
|
4446
|
-
/* @__PURE__ */
|
|
4819
|
+
/* @__PURE__ */ jsx34("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ jsx34(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
4820
|
+
/* @__PURE__ */ jsx34("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ jsx34(
|
|
4447
4821
|
ResponsiveContainer2,
|
|
4448
4822
|
{
|
|
4449
4823
|
width: "100%",
|
|
4450
4824
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
4451
|
-
children: /* @__PURE__ */
|
|
4825
|
+
children: /* @__PURE__ */ jsxs20(
|
|
4452
4826
|
RechartsLineChart,
|
|
4453
4827
|
{
|
|
4454
4828
|
data,
|
|
@@ -4459,7 +4833,7 @@ var LineChart = forwardRef23(
|
|
|
4459
4833
|
},
|
|
4460
4834
|
onClick: handleClick,
|
|
4461
4835
|
children: [
|
|
4462
|
-
/* @__PURE__ */
|
|
4836
|
+
/* @__PURE__ */ jsx34(
|
|
4463
4837
|
XAxis2,
|
|
4464
4838
|
{
|
|
4465
4839
|
dataKey: xAxisKey,
|
|
@@ -4471,7 +4845,7 @@ var LineChart = forwardRef23(
|
|
|
4471
4845
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel) : void 0
|
|
4472
4846
|
}
|
|
4473
4847
|
),
|
|
4474
|
-
/* @__PURE__ */
|
|
4848
|
+
/* @__PURE__ */ jsx34(
|
|
4475
4849
|
YAxis2,
|
|
4476
4850
|
{
|
|
4477
4851
|
axisLine: false,
|
|
@@ -4480,7 +4854,7 @@ var LineChart = forwardRef23(
|
|
|
4480
4854
|
label: yAxisLabel ? createCustomYAxisLabel(yAxisLabel, 40) : void 0
|
|
4481
4855
|
}
|
|
4482
4856
|
),
|
|
4483
|
-
/* @__PURE__ */
|
|
4857
|
+
/* @__PURE__ */ jsx34(
|
|
4484
4858
|
Tooltip3,
|
|
4485
4859
|
{
|
|
4486
4860
|
content: ({
|
|
@@ -4489,7 +4863,7 @@ var LineChart = forwardRef23(
|
|
|
4489
4863
|
label
|
|
4490
4864
|
}) => {
|
|
4491
4865
|
if (active && payload && payload.length) {
|
|
4492
|
-
return /* @__PURE__ */
|
|
4866
|
+
return /* @__PURE__ */ jsx34(
|
|
4493
4867
|
GenericTooltip,
|
|
4494
4868
|
{
|
|
4495
4869
|
title: label?.toString(),
|
|
@@ -4505,7 +4879,7 @@ var LineChart = forwardRef23(
|
|
|
4505
4879
|
}
|
|
4506
4880
|
}
|
|
4507
4881
|
),
|
|
4508
|
-
series.map((s, index) => /* @__PURE__ */
|
|
4882
|
+
series.map((s, index) => /* @__PURE__ */ jsx34(
|
|
4509
4883
|
Line,
|
|
4510
4884
|
{
|
|
4511
4885
|
type: "monotone",
|
|
@@ -4517,12 +4891,12 @@ var LineChart = forwardRef23(
|
|
|
4517
4891
|
},
|
|
4518
4892
|
s.dataKey
|
|
4519
4893
|
)),
|
|
4520
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */
|
|
4894
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ jsx34(ChartLegend, { items: defaultLegendItems })
|
|
4521
4895
|
]
|
|
4522
4896
|
}
|
|
4523
4897
|
)
|
|
4524
4898
|
}
|
|
4525
|
-
) : /* @__PURE__ */
|
|
4899
|
+
) : /* @__PURE__ */ jsx34("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ jsx34(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
4526
4900
|
]
|
|
4527
4901
|
}
|
|
4528
4902
|
);
|
|
@@ -4531,10 +4905,10 @@ var LineChart = forwardRef23(
|
|
|
4531
4905
|
LineChart.displayName = "LineChart";
|
|
4532
4906
|
|
|
4533
4907
|
// src/components/ui/charts/pie-chart.tsx
|
|
4534
|
-
import { forwardRef as
|
|
4908
|
+
import { forwardRef as forwardRef26 } from "react";
|
|
4535
4909
|
import { PieChart as RechartsPieChart, Pie, Cell, Tooltip as Tooltip4 } from "recharts";
|
|
4536
|
-
import { jsx as
|
|
4537
|
-
var PieChart =
|
|
4910
|
+
import { jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4911
|
+
var PieChart = forwardRef26(
|
|
4538
4912
|
({
|
|
4539
4913
|
data,
|
|
4540
4914
|
title,
|
|
@@ -4561,20 +4935,20 @@ var PieChart = forwardRef24(
|
|
|
4561
4935
|
)
|
|
4562
4936
|
);
|
|
4563
4937
|
const hasData = data && data.length > 0;
|
|
4564
|
-
return /* @__PURE__ */
|
|
4938
|
+
return /* @__PURE__ */ jsxs21(
|
|
4565
4939
|
"div",
|
|
4566
4940
|
{
|
|
4567
4941
|
ref,
|
|
4568
4942
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
4569
4943
|
children: [
|
|
4570
|
-
/* @__PURE__ */
|
|
4571
|
-
/* @__PURE__ */
|
|
4944
|
+
/* @__PURE__ */ jsx35("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ jsx35(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
4945
|
+
/* @__PURE__ */ jsx35("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ jsx35("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs21(
|
|
4572
4946
|
RechartsPieChart,
|
|
4573
4947
|
{
|
|
4574
4948
|
width: 600,
|
|
4575
4949
|
height: CHART_CONSTANTS.LARGE_HEIGHT,
|
|
4576
4950
|
children: [
|
|
4577
|
-
/* @__PURE__ */
|
|
4951
|
+
/* @__PURE__ */ jsx35(
|
|
4578
4952
|
Pie,
|
|
4579
4953
|
{
|
|
4580
4954
|
data,
|
|
@@ -4586,7 +4960,7 @@ var PieChart = forwardRef24(
|
|
|
4586
4960
|
label: showLabels,
|
|
4587
4961
|
labelLine: false,
|
|
4588
4962
|
onClick: handleClick,
|
|
4589
|
-
children: data.map((entry, index) => /* @__PURE__ */
|
|
4963
|
+
children: data.map((entry, index) => /* @__PURE__ */ jsx35(
|
|
4590
4964
|
Cell,
|
|
4591
4965
|
{
|
|
4592
4966
|
fill: entry.color || getSeriesColor(index)
|
|
@@ -4595,7 +4969,7 @@ var PieChart = forwardRef24(
|
|
|
4595
4969
|
))
|
|
4596
4970
|
}
|
|
4597
4971
|
),
|
|
4598
|
-
/* @__PURE__ */
|
|
4972
|
+
/* @__PURE__ */ jsx35(
|
|
4599
4973
|
Tooltip4,
|
|
4600
4974
|
{
|
|
4601
4975
|
content: ({
|
|
@@ -4604,7 +4978,7 @@ var PieChart = forwardRef24(
|
|
|
4604
4978
|
}) => {
|
|
4605
4979
|
if (active && payload && payload.length && payload[0]) {
|
|
4606
4980
|
const data2 = payload[0].payload;
|
|
4607
|
-
return /* @__PURE__ */
|
|
4981
|
+
return /* @__PURE__ */ jsx35(
|
|
4608
4982
|
GenericTooltip,
|
|
4609
4983
|
{
|
|
4610
4984
|
title: data2.name,
|
|
@@ -4622,10 +4996,10 @@ var PieChart = forwardRef24(
|
|
|
4622
4996
|
}
|
|
4623
4997
|
}
|
|
4624
4998
|
),
|
|
4625
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */
|
|
4999
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ jsx35(ChartLegend, { items: defaultLegendItems, y: 400 })
|
|
4626
5000
|
]
|
|
4627
5001
|
}
|
|
4628
|
-
) }) : /* @__PURE__ */
|
|
5002
|
+
) }) : /* @__PURE__ */ jsx35("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ jsx35(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
4629
5003
|
]
|
|
4630
5004
|
}
|
|
4631
5005
|
);
|
|
@@ -4638,7 +5012,7 @@ import { useCallback as useCallback9 } from "react";
|
|
|
4638
5012
|
import {
|
|
4639
5013
|
flexRender
|
|
4640
5014
|
} from "@tanstack/react-table";
|
|
4641
|
-
import { Fragment as Fragment3, jsx as
|
|
5015
|
+
import { Fragment as Fragment3, jsx as jsx36, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4642
5016
|
function Table({
|
|
4643
5017
|
table,
|
|
4644
5018
|
className,
|
|
@@ -4668,15 +5042,15 @@ function Table({
|
|
|
4668
5042
|
},
|
|
4669
5043
|
[table]
|
|
4670
5044
|
);
|
|
4671
|
-
return /* @__PURE__ */
|
|
4672
|
-
/* @__PURE__ */
|
|
4673
|
-
/* @__PURE__ */
|
|
5045
|
+
return /* @__PURE__ */ jsxs22("div", { children: [
|
|
5046
|
+
/* @__PURE__ */ jsx36("div", { className: cn("overflow-x-auto", className), children: /* @__PURE__ */ jsxs22("table", { className: "min-w-full divide-y divide-border", children: [
|
|
5047
|
+
/* @__PURE__ */ jsx36("thead", { className: "bg-dark text-light", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx36("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx36("th", { className: "px-6 py-3 text-left", children: /* @__PURE__ */ jsxs22(
|
|
4674
5048
|
"div",
|
|
4675
5049
|
{
|
|
4676
5050
|
className: `flex items-center space-x-1 ${header.column.getCanSort() ? "cursor-pointer select-none" : ""}`,
|
|
4677
5051
|
onClick: header.column.getToggleSortingHandler(),
|
|
4678
5052
|
children: [
|
|
4679
|
-
/* @__PURE__ */
|
|
5053
|
+
/* @__PURE__ */ jsx36(
|
|
4680
5054
|
Typography,
|
|
4681
5055
|
{
|
|
4682
5056
|
variant: "label-xs",
|
|
@@ -4687,19 +5061,19 @@ function Table({
|
|
|
4687
5061
|
)
|
|
4688
5062
|
}
|
|
4689
5063
|
),
|
|
4690
|
-
header.column.getCanSort() && /* @__PURE__ */
|
|
4691
|
-
header.column.getIsSorted() === "asc" && /* @__PURE__ */
|
|
4692
|
-
header.column.getIsSorted() === "desc" && /* @__PURE__ */
|
|
5064
|
+
header.column.getCanSort() && /* @__PURE__ */ jsxs22("span", { className: "ml-1", children: [
|
|
5065
|
+
header.column.getIsSorted() === "asc" && /* @__PURE__ */ jsx36(CaretUpIcon, { className: "text-light" }),
|
|
5066
|
+
header.column.getIsSorted() === "desc" && /* @__PURE__ */ jsx36(CaretDownIcon, { className: "text-light" })
|
|
4693
5067
|
] })
|
|
4694
5068
|
]
|
|
4695
5069
|
}
|
|
4696
5070
|
) }, header.id)) }, headerGroup.id)) }),
|
|
4697
|
-
/* @__PURE__ */
|
|
5071
|
+
/* @__PURE__ */ jsx36("tbody", { className: "bg-light divide-y divide-border", children: table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx36("tr", { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx36("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ jsx36(Typography, { variant: "body-sm", children: flexRender(
|
|
4698
5072
|
cell.column.columnDef.cell,
|
|
4699
5073
|
cell.getContext()
|
|
4700
5074
|
) }) }, cell.id)) }, row.id)) })
|
|
4701
5075
|
] }) }),
|
|
4702
|
-
showPagination && /* @__PURE__ */
|
|
5076
|
+
showPagination && /* @__PURE__ */ jsxs22(
|
|
4703
5077
|
"div",
|
|
4704
5078
|
{
|
|
4705
5079
|
className: cn(
|
|
@@ -4707,9 +5081,9 @@ function Table({
|
|
|
4707
5081
|
paginationClassName
|
|
4708
5082
|
),
|
|
4709
5083
|
children: [
|
|
4710
|
-
/* @__PURE__ */
|
|
4711
|
-
/* @__PURE__ */
|
|
4712
|
-
/* @__PURE__ */
|
|
5084
|
+
/* @__PURE__ */ jsx36("div", { className: "flex items-center", children: /* @__PURE__ */ jsx36(Typography, { variant: "body-sm", className: "text-secondary", children: showingText }) }),
|
|
5085
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center space-x-1", children: [
|
|
5086
|
+
/* @__PURE__ */ jsx36(
|
|
4713
5087
|
Button,
|
|
4714
5088
|
{
|
|
4715
5089
|
variant: "ghost",
|
|
@@ -4717,7 +5091,7 @@ function Table({
|
|
|
4717
5091
|
onClick: handlePreviousPage,
|
|
4718
5092
|
disabled: !table.getCanPreviousPage(),
|
|
4719
5093
|
className: "p-2",
|
|
4720
|
-
children: /* @__PURE__ */
|
|
5094
|
+
children: /* @__PURE__ */ jsx36(ArrowLeftIcon, {})
|
|
4721
5095
|
}
|
|
4722
5096
|
),
|
|
4723
5097
|
Array.from(
|
|
@@ -4734,7 +5108,7 @@ function Table({
|
|
|
4734
5108
|
pageNumber = currentPage - 2 + i;
|
|
4735
5109
|
}
|
|
4736
5110
|
const isActive = pageNumber === currentPage;
|
|
4737
|
-
return /* @__PURE__ */
|
|
5111
|
+
return /* @__PURE__ */ jsx36(
|
|
4738
5112
|
Button,
|
|
4739
5113
|
{
|
|
4740
5114
|
variant: isActive ? "default" : "ghost",
|
|
@@ -4747,11 +5121,11 @@ function Table({
|
|
|
4747
5121
|
);
|
|
4748
5122
|
}
|
|
4749
5123
|
),
|
|
4750
|
-
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */
|
|
4751
|
-
/* @__PURE__ */
|
|
4752
|
-
/* @__PURE__ */
|
|
5124
|
+
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */ jsxs22(Fragment3, { children: [
|
|
5125
|
+
/* @__PURE__ */ jsx36("span", { className: "px-1 text-secondary", children: "..." }),
|
|
5126
|
+
/* @__PURE__ */ jsx36(Typography, { variant: "body-sm", className: "text-secondary", children: totalPages })
|
|
4753
5127
|
] }),
|
|
4754
|
-
/* @__PURE__ */
|
|
5128
|
+
/* @__PURE__ */ jsx36(
|
|
4755
5129
|
Button,
|
|
4756
5130
|
{
|
|
4757
5131
|
variant: "ghost",
|
|
@@ -4759,12 +5133,12 @@ function Table({
|
|
|
4759
5133
|
onClick: handleNextPage,
|
|
4760
5134
|
disabled: !table.getCanNextPage(),
|
|
4761
5135
|
className: "p-2",
|
|
4762
|
-
children: /* @__PURE__ */
|
|
5136
|
+
children: /* @__PURE__ */ jsx36(ArrowRightIcon, {})
|
|
4763
5137
|
}
|
|
4764
5138
|
)
|
|
4765
5139
|
] }),
|
|
4766
|
-
/* @__PURE__ */
|
|
4767
|
-
/* @__PURE__ */
|
|
5140
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-3 w-48", children: [
|
|
5141
|
+
/* @__PURE__ */ jsx36(
|
|
4768
5142
|
Typography,
|
|
4769
5143
|
{
|
|
4770
5144
|
variant: "body-sm",
|
|
@@ -4772,14 +5146,14 @@ function Table({
|
|
|
4772
5146
|
children: "Rows per page:"
|
|
4773
5147
|
}
|
|
4774
5148
|
),
|
|
4775
|
-
/* @__PURE__ */
|
|
5149
|
+
/* @__PURE__ */ jsxs22(
|
|
4776
5150
|
Select,
|
|
4777
5151
|
{
|
|
4778
5152
|
value: table.getState().pagination.pageSize.toString(),
|
|
4779
5153
|
onValueChange: handlePageSizeChange,
|
|
4780
5154
|
children: [
|
|
4781
|
-
/* @__PURE__ */
|
|
4782
|
-
/* @__PURE__ */
|
|
5155
|
+
/* @__PURE__ */ jsx36(SelectTrigger, { className: "min-w-0 h-8", children: /* @__PURE__ */ jsx36(SelectValue, {}) }),
|
|
5156
|
+
/* @__PURE__ */ jsx36(SelectContent, { children: [10, 20, 50, 100].map((size) => /* @__PURE__ */ jsx36(SelectItem, { value: size.toString(), children: size }, size)) })
|
|
4783
5157
|
]
|
|
4784
5158
|
}
|
|
4785
5159
|
)
|
|
@@ -4831,6 +5205,15 @@ export {
|
|
|
4831
5205
|
CogIcon,
|
|
4832
5206
|
CredentialsIcon,
|
|
4833
5207
|
DatePicker,
|
|
5208
|
+
Dialog,
|
|
5209
|
+
DialogBody,
|
|
5210
|
+
DialogClose,
|
|
5211
|
+
DialogContent,
|
|
5212
|
+
DialogDescription,
|
|
5213
|
+
DialogFooter,
|
|
5214
|
+
DialogOverlay,
|
|
5215
|
+
DialogTitle,
|
|
5216
|
+
DialogTrigger,
|
|
4834
5217
|
DocumentIcon,
|
|
4835
5218
|
DollarIcon,
|
|
4836
5219
|
DownloadIcon,
|
|
@@ -4875,6 +5258,16 @@ export {
|
|
|
4875
5258
|
HomeIcon,
|
|
4876
5259
|
InformationIcon,
|
|
4877
5260
|
Input,
|
|
5261
|
+
Item2 as Item,
|
|
5262
|
+
ItemActions,
|
|
5263
|
+
ItemContent,
|
|
5264
|
+
ItemDescription,
|
|
5265
|
+
ItemFooter,
|
|
5266
|
+
ItemGroup,
|
|
5267
|
+
ItemHeader,
|
|
5268
|
+
ItemMedia,
|
|
5269
|
+
ItemSeparator,
|
|
5270
|
+
ItemTitle,
|
|
4878
5271
|
Label2 as Label,
|
|
4879
5272
|
LineChart,
|
|
4880
5273
|
LocationIcon,
|
|
@@ -4954,6 +5347,8 @@ export {
|
|
|
4954
5347
|
getPerformanceColor,
|
|
4955
5348
|
getSeriesColor,
|
|
4956
5349
|
initializePdfWorker,
|
|
5350
|
+
itemMediaVariants,
|
|
5351
|
+
itemVariants,
|
|
4957
5352
|
selectTriggerVariants,
|
|
4958
5353
|
switchVariants,
|
|
4959
5354
|
tabsVariants,
|