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