@northslopetech/altitude-ui 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +233 -1
- package/dist/index.d.ts +233 -1
- package/dist/index.js +911 -200
- package/dist/index.mjs +906 -216
- package/dist/pdf.worker.min.mjs +28 -0
- package/dist/tokens.css +1 -1
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -65,6 +65,7 @@ __export(index_exports, {
|
|
|
65
65
|
DatePicker: () => DatePicker,
|
|
66
66
|
Doc: () => Doc,
|
|
67
67
|
Dollar: () => Dollar,
|
|
68
|
+
Download: () => Download,
|
|
68
69
|
DropdownMenu: () => DropdownMenu,
|
|
69
70
|
DropdownMenuCheckboxItem: () => DropdownMenuCheckboxItem,
|
|
70
71
|
DropdownMenuContent: () => DropdownMenuContent,
|
|
@@ -114,9 +115,12 @@ __export(index_exports, {
|
|
|
114
115
|
MagnifyingGlass: () => MagnifyingGlass,
|
|
115
116
|
Minus: () => Minus,
|
|
116
117
|
MoreMenu: () => MoreMenu,
|
|
118
|
+
Panel: () => Panel,
|
|
119
|
+
PdfViewer: () => PdfViewer,
|
|
117
120
|
Phone: () => Phone,
|
|
118
121
|
PieChart: () => PieChart,
|
|
119
122
|
Plus: () => Plus,
|
|
123
|
+
Print: () => Print,
|
|
120
124
|
QuestionCircle: () => QuestionCircle,
|
|
121
125
|
Select: () => Select,
|
|
122
126
|
SelectContent: () => SelectContent,
|
|
@@ -130,6 +134,17 @@ __export(index_exports, {
|
|
|
130
134
|
SelectValue: () => SelectValue,
|
|
131
135
|
Separator: () => Separator2,
|
|
132
136
|
Share: () => Share,
|
|
137
|
+
Sidebar: () => Sidebar,
|
|
138
|
+
SidebarContent: () => SidebarContent,
|
|
139
|
+
SidebarFooter: () => SidebarFooter,
|
|
140
|
+
SidebarGroup: () => SidebarGroup,
|
|
141
|
+
SidebarGroupContent: () => SidebarGroupContent,
|
|
142
|
+
SidebarHeader: () => SidebarHeader,
|
|
143
|
+
SidebarInset: () => SidebarInset,
|
|
144
|
+
SidebarMenu: () => SidebarMenu,
|
|
145
|
+
SidebarMenuButton: () => SidebarMenuButton,
|
|
146
|
+
SidebarMenuItem: () => SidebarMenuItem,
|
|
147
|
+
SidebarProvider: () => SidebarProvider,
|
|
133
148
|
Star: () => Star,
|
|
134
149
|
Statement: () => Statement,
|
|
135
150
|
Table: () => Table,
|
|
@@ -139,8 +154,12 @@ __export(index_exports, {
|
|
|
139
154
|
TabsList: () => TabsList,
|
|
140
155
|
TabsTrigger: () => TabsTrigger,
|
|
141
156
|
Textarea: () => Textarea,
|
|
157
|
+
Tooltip: () => Tooltip,
|
|
142
158
|
TooltipContainer: () => TooltipContainer,
|
|
159
|
+
TooltipContent: () => TooltipContent,
|
|
143
160
|
TooltipItem: () => TooltipItem,
|
|
161
|
+
TooltipProvider: () => TooltipProvider,
|
|
162
|
+
TooltipTrigger: () => TooltipTrigger,
|
|
144
163
|
Trash: () => Trash,
|
|
145
164
|
Typography: () => Typography,
|
|
146
165
|
Upload: () => Upload,
|
|
@@ -165,10 +184,12 @@ __export(index_exports, {
|
|
|
165
184
|
getHeatmapColor: () => getHeatmapColor,
|
|
166
185
|
getPerformanceColor: () => getPerformanceColor,
|
|
167
186
|
getSeriesColor: () => getSeriesColor,
|
|
187
|
+
initializePdfWorker: () => initializePdfWorker,
|
|
168
188
|
selectTriggerVariants: () => selectTriggerVariants,
|
|
169
189
|
tabsVariants: () => tabsVariants,
|
|
170
190
|
typographyVariants: () => typographyVariants,
|
|
171
|
-
uploadVariants: () => uploadVariants
|
|
191
|
+
uploadVariants: () => uploadVariants,
|
|
192
|
+
useSidebar: () => useSidebar
|
|
172
193
|
});
|
|
173
194
|
module.exports = __toCommonJS(index_exports);
|
|
174
195
|
|
|
@@ -1824,6 +1845,77 @@ var Logout = ({
|
|
|
1824
1845
|
]
|
|
1825
1846
|
}
|
|
1826
1847
|
);
|
|
1848
|
+
var Print = ({
|
|
1849
|
+
className,
|
|
1850
|
+
variant = "dark",
|
|
1851
|
+
...props
|
|
1852
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1853
|
+
"svg",
|
|
1854
|
+
{
|
|
1855
|
+
width: "16",
|
|
1856
|
+
height: "16",
|
|
1857
|
+
viewBox: "0 0 16 16",
|
|
1858
|
+
fill: "none",
|
|
1859
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1860
|
+
className: cn(getVariantStyles(variant), className),
|
|
1861
|
+
...props,
|
|
1862
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1863
|
+
"path",
|
|
1864
|
+
{
|
|
1865
|
+
d: "M12.9 5.33333H3.1C1.938 5.33333 1 6.22667 1 7.33333V11.3333H3.8V14H12.2V11.3333H15V7.33333C15 6.22667 14.062 5.33333 12.9 5.33333ZM10.8 12.6667H5.2V9.33333H10.8V12.6667ZM12.9 8C12.515 8 12.2 7.7 12.2 7.33333C12.2 6.96667 12.515 6.66667 12.9 6.66667C13.285 6.66667 13.6 6.96667 13.6 7.33333C13.6 7.7 13.285 8 12.9 8ZM12.2 2H3.8V4.66667H12.2V2Z",
|
|
1866
|
+
fill: "#161616"
|
|
1867
|
+
}
|
|
1868
|
+
)
|
|
1869
|
+
}
|
|
1870
|
+
);
|
|
1871
|
+
var Download = ({
|
|
1872
|
+
className,
|
|
1873
|
+
variant = "dark",
|
|
1874
|
+
...props
|
|
1875
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1876
|
+
"svg",
|
|
1877
|
+
{
|
|
1878
|
+
width: "16",
|
|
1879
|
+
height: "16",
|
|
1880
|
+
viewBox: "0 0 16 16",
|
|
1881
|
+
fill: "none",
|
|
1882
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1883
|
+
className: cn(getVariantStyles(variant), className),
|
|
1884
|
+
...props,
|
|
1885
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1886
|
+
"path",
|
|
1887
|
+
{
|
|
1888
|
+
fillRule: "evenodd",
|
|
1889
|
+
clipRule: "evenodd",
|
|
1890
|
+
d: "M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.1464 9.31042L8.3535 12.1033C8.15824 12.2986 7.84166 12.2986 7.6464 12.1033L4.8535 9.31042C4.53852 8.99543 4.76161 8.45686 5.20706 8.45686H6.99995V4.75C6.99995 4.19772 7.44767 3.75 7.99995 3.75C8.55224 3.75 8.99995 4.19772 8.99995 4.75V8.45686H10.7928C11.2383 8.45686 11.4614 8.99543 11.1464 9.31042Z",
|
|
1891
|
+
fill: "#161616"
|
|
1892
|
+
}
|
|
1893
|
+
)
|
|
1894
|
+
}
|
|
1895
|
+
);
|
|
1896
|
+
var Panel = ({
|
|
1897
|
+
className,
|
|
1898
|
+
variant = "dark",
|
|
1899
|
+
...props
|
|
1900
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1901
|
+
"svg",
|
|
1902
|
+
{
|
|
1903
|
+
width: "16",
|
|
1904
|
+
height: "16",
|
|
1905
|
+
viewBox: "0 0 16 16",
|
|
1906
|
+
fill: "none",
|
|
1907
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1908
|
+
className: cn(getVariantStyles(variant), className),
|
|
1909
|
+
...props,
|
|
1910
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1911
|
+
"path",
|
|
1912
|
+
{
|
|
1913
|
+
d: "M14 2C14.5523 2 15 2.44772 15 3V13C15 13.5523 14.5523 14 14 14H2C1.44772 14 1 13.5523 1 13V3C1 2.44772 1.44772 2 2 2H14ZM7 12H13V4H7V12ZM3 12H5V4H3V12Z",
|
|
1914
|
+
fill: "currentColor"
|
|
1915
|
+
}
|
|
1916
|
+
)
|
|
1917
|
+
}
|
|
1918
|
+
);
|
|
1827
1919
|
|
|
1828
1920
|
// src/components/ui/select.tsx
|
|
1829
1921
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -2243,15 +2335,329 @@ function FieldError({
|
|
|
2243
2335
|
);
|
|
2244
2336
|
}
|
|
2245
2337
|
|
|
2246
|
-
// src/components/ui/
|
|
2338
|
+
// src/components/ui/tooltip.tsx
|
|
2339
|
+
var React4 = __toESM(require("react"));
|
|
2340
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
2341
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2342
|
+
function TooltipProvider({
|
|
2343
|
+
delayDuration = 0,
|
|
2344
|
+
...props
|
|
2345
|
+
}) {
|
|
2346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2347
|
+
TooltipPrimitive.Provider,
|
|
2348
|
+
{
|
|
2349
|
+
"data-slot": "tooltip-provider",
|
|
2350
|
+
delayDuration,
|
|
2351
|
+
...props
|
|
2352
|
+
}
|
|
2353
|
+
);
|
|
2354
|
+
}
|
|
2355
|
+
TooltipProvider.displayName = "TooltipProvider";
|
|
2356
|
+
function Tooltip({ delayDuration, ...props }) {
|
|
2357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipProvider, { delayDuration, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
2358
|
+
}
|
|
2359
|
+
Tooltip.displayName = "Tooltip";
|
|
2360
|
+
var TooltipTrigger = React4.forwardRef(({ ...props }, ref) => {
|
|
2361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2362
|
+
TooltipPrimitive.Trigger,
|
|
2363
|
+
{
|
|
2364
|
+
ref,
|
|
2365
|
+
"data-slot": "tooltip-trigger",
|
|
2366
|
+
...props
|
|
2367
|
+
}
|
|
2368
|
+
);
|
|
2369
|
+
});
|
|
2370
|
+
TooltipTrigger.displayName = "TooltipTrigger";
|
|
2371
|
+
var TooltipContent = React4.forwardRef(({ className, sideOffset = 2, children, ...props }, ref) => {
|
|
2372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2373
|
+
TooltipPrimitive.Content,
|
|
2374
|
+
{
|
|
2375
|
+
ref,
|
|
2376
|
+
"data-slot": "tooltip-content",
|
|
2377
|
+
sideOffset,
|
|
2378
|
+
className: cn(
|
|
2379
|
+
"bg-dark text-light animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-[var(--radix-tooltip-content-transform-origin)] flex items-start gap-2 rounded p-1.5 text-balance shadow-sm",
|
|
2380
|
+
className
|
|
2381
|
+
),
|
|
2382
|
+
...props,
|
|
2383
|
+
children: [
|
|
2384
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipPrimitive.Arrow, { className: "fill-dark", width: 10, height: 9 }),
|
|
2385
|
+
children
|
|
2386
|
+
]
|
|
2387
|
+
}
|
|
2388
|
+
) });
|
|
2389
|
+
});
|
|
2390
|
+
TooltipContent.displayName = "TooltipContent";
|
|
2391
|
+
|
|
2392
|
+
// src/components/ui/sidebar.tsx
|
|
2247
2393
|
var React5 = __toESM(require("react"));
|
|
2394
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2395
|
+
var SIDEBAR_CONSTANTS = {
|
|
2396
|
+
WIDTH: "144px",
|
|
2397
|
+
WIDTH_ICON: "48px"
|
|
2398
|
+
};
|
|
2399
|
+
var SidebarContext = React5.createContext(null);
|
|
2400
|
+
function useSidebar() {
|
|
2401
|
+
const context = React5.useContext(SidebarContext);
|
|
2402
|
+
if (!context) {
|
|
2403
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
2404
|
+
}
|
|
2405
|
+
return context;
|
|
2406
|
+
}
|
|
2407
|
+
var SidebarProvider = React5.forwardRef(
|
|
2408
|
+
({
|
|
2409
|
+
defaultOpen = true,
|
|
2410
|
+
open: openProp,
|
|
2411
|
+
onOpenChange: setOpenProp,
|
|
2412
|
+
className,
|
|
2413
|
+
style,
|
|
2414
|
+
children,
|
|
2415
|
+
...props
|
|
2416
|
+
}, ref) => {
|
|
2417
|
+
const [_open, _setOpen] = React5.useState(defaultOpen);
|
|
2418
|
+
const open = openProp ?? _open;
|
|
2419
|
+
const setOpen = React5.useCallback(
|
|
2420
|
+
(value) => {
|
|
2421
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
2422
|
+
if (setOpenProp) {
|
|
2423
|
+
setOpenProp(openState);
|
|
2424
|
+
} else {
|
|
2425
|
+
_setOpen(openState);
|
|
2426
|
+
}
|
|
2427
|
+
},
|
|
2428
|
+
[setOpenProp, open]
|
|
2429
|
+
);
|
|
2430
|
+
const toggleSidebar = React5.useCallback(() => {
|
|
2431
|
+
return setOpen((open2) => !open2);
|
|
2432
|
+
}, [setOpen]);
|
|
2433
|
+
const state = open ? "expanded" : "collapsed";
|
|
2434
|
+
const contextValue = React5.useMemo(
|
|
2435
|
+
() => ({
|
|
2436
|
+
state,
|
|
2437
|
+
open,
|
|
2438
|
+
setOpen,
|
|
2439
|
+
toggleSidebar
|
|
2440
|
+
}),
|
|
2441
|
+
[state, open, setOpen, toggleSidebar]
|
|
2442
|
+
);
|
|
2443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2444
|
+
"div",
|
|
2445
|
+
{
|
|
2446
|
+
style: {
|
|
2447
|
+
"--sidebar-width": SIDEBAR_CONSTANTS.WIDTH,
|
|
2448
|
+
"--sidebar-width-icon": SIDEBAR_CONSTANTS.WIDTH_ICON,
|
|
2449
|
+
...style
|
|
2450
|
+
},
|
|
2451
|
+
className: cn(
|
|
2452
|
+
"group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-light",
|
|
2453
|
+
className
|
|
2454
|
+
),
|
|
2455
|
+
ref,
|
|
2456
|
+
...props,
|
|
2457
|
+
children
|
|
2458
|
+
}
|
|
2459
|
+
) });
|
|
2460
|
+
}
|
|
2461
|
+
);
|
|
2462
|
+
SidebarProvider.displayName = "SidebarProvider";
|
|
2463
|
+
var Sidebar = React5.forwardRef(
|
|
2464
|
+
({ collapsible = "icon", className, children, ...props }, ref) => {
|
|
2465
|
+
const { state } = useSidebar();
|
|
2466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2467
|
+
"aside",
|
|
2468
|
+
{
|
|
2469
|
+
ref,
|
|
2470
|
+
className: "group peer text-light",
|
|
2471
|
+
"data-state": state,
|
|
2472
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
2473
|
+
"aria-label": "Main navigation",
|
|
2474
|
+
"aria-expanded": state === "expanded",
|
|
2475
|
+
role: "navigation",
|
|
2476
|
+
children: [
|
|
2477
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2478
|
+
"div",
|
|
2479
|
+
{
|
|
2480
|
+
className: cn(
|
|
2481
|
+
"relative h-svh shrink-0 transition-[width] duration-200 ease-linear",
|
|
2482
|
+
"w-[var(--sidebar-width)] group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]"
|
|
2483
|
+
)
|
|
2484
|
+
}
|
|
2485
|
+
),
|
|
2486
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2487
|
+
"div",
|
|
2488
|
+
{
|
|
2489
|
+
className: cn(
|
|
2490
|
+
"fixed inset-y-0 z-10 h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear flex left-0",
|
|
2491
|
+
"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]",
|
|
2492
|
+
className
|
|
2493
|
+
),
|
|
2494
|
+
...props,
|
|
2495
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2496
|
+
"div",
|
|
2497
|
+
{
|
|
2498
|
+
"data-sidebar": "sidebar",
|
|
2499
|
+
className: "flex h-full w-full flex-col gap-8 p-4 px-2 bg-dark",
|
|
2500
|
+
children
|
|
2501
|
+
}
|
|
2502
|
+
)
|
|
2503
|
+
}
|
|
2504
|
+
)
|
|
2505
|
+
]
|
|
2506
|
+
}
|
|
2507
|
+
);
|
|
2508
|
+
}
|
|
2509
|
+
);
|
|
2510
|
+
Sidebar.displayName = "Sidebar";
|
|
2511
|
+
var SidebarInset = React5.forwardRef(
|
|
2512
|
+
({ className, ...props }, ref) => {
|
|
2513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2514
|
+
"main",
|
|
2515
|
+
{
|
|
2516
|
+
ref,
|
|
2517
|
+
className: cn(
|
|
2518
|
+
"relative flex min-h-svh flex-1 flex-col bg-dark",
|
|
2519
|
+
className
|
|
2520
|
+
),
|
|
2521
|
+
...props
|
|
2522
|
+
}
|
|
2523
|
+
);
|
|
2524
|
+
}
|
|
2525
|
+
);
|
|
2526
|
+
SidebarInset.displayName = "SidebarInset";
|
|
2527
|
+
var SidebarHeader = React5.forwardRef(
|
|
2528
|
+
({ className, ...props }, ref) => {
|
|
2529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2530
|
+
"div",
|
|
2531
|
+
{
|
|
2532
|
+
ref,
|
|
2533
|
+
"data-sidebar": "header",
|
|
2534
|
+
className: cn(
|
|
2535
|
+
"flex h-8 justify-between items-center shrink-0 self-stretch",
|
|
2536
|
+
"group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:p-2",
|
|
2537
|
+
className
|
|
2538
|
+
),
|
|
2539
|
+
...props
|
|
2540
|
+
}
|
|
2541
|
+
);
|
|
2542
|
+
}
|
|
2543
|
+
);
|
|
2544
|
+
SidebarHeader.displayName = "SidebarHeader";
|
|
2545
|
+
var SidebarFooter = React5.forwardRef(
|
|
2546
|
+
({ className, ...props }, ref) => {
|
|
2547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2548
|
+
"div",
|
|
2549
|
+
{
|
|
2550
|
+
ref,
|
|
2551
|
+
"data-sidebar": "footer",
|
|
2552
|
+
className: cn("flex flex-col gap-2", className),
|
|
2553
|
+
...props
|
|
2554
|
+
}
|
|
2555
|
+
);
|
|
2556
|
+
}
|
|
2557
|
+
);
|
|
2558
|
+
SidebarFooter.displayName = "SidebarFooter";
|
|
2559
|
+
var SidebarContent = React5.forwardRef(
|
|
2560
|
+
({ className, ...props }, ref) => {
|
|
2561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2562
|
+
"div",
|
|
2563
|
+
{
|
|
2564
|
+
ref,
|
|
2565
|
+
"data-sidebar": "content",
|
|
2566
|
+
className: cn(
|
|
2567
|
+
"flex min-h-0 flex-1 flex-col gap-8 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
2568
|
+
className
|
|
2569
|
+
),
|
|
2570
|
+
...props
|
|
2571
|
+
}
|
|
2572
|
+
);
|
|
2573
|
+
}
|
|
2574
|
+
);
|
|
2575
|
+
SidebarContent.displayName = "SidebarContent";
|
|
2576
|
+
var SidebarGroup = React5.forwardRef(
|
|
2577
|
+
({ className, ...props }, ref) => {
|
|
2578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2579
|
+
"div",
|
|
2580
|
+
{
|
|
2581
|
+
ref,
|
|
2582
|
+
"data-sidebar": "group",
|
|
2583
|
+
className: cn("relative flex w-full min-w-0 flex-col", className),
|
|
2584
|
+
...props
|
|
2585
|
+
}
|
|
2586
|
+
);
|
|
2587
|
+
}
|
|
2588
|
+
);
|
|
2589
|
+
SidebarGroup.displayName = "SidebarGroup";
|
|
2590
|
+
var SidebarGroupContent = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2591
|
+
"div",
|
|
2592
|
+
{
|
|
2593
|
+
ref,
|
|
2594
|
+
"data-sidebar": "group-content",
|
|
2595
|
+
className: cn("w-full text-sm", className),
|
|
2596
|
+
...props
|
|
2597
|
+
}
|
|
2598
|
+
));
|
|
2599
|
+
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
2600
|
+
var SidebarMenu = React5.forwardRef(
|
|
2601
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2602
|
+
"ul",
|
|
2603
|
+
{
|
|
2604
|
+
ref,
|
|
2605
|
+
"data-sidebar": "menu",
|
|
2606
|
+
className: cn("flex w-full min-w-0 flex-col gap-1", className),
|
|
2607
|
+
...props
|
|
2608
|
+
}
|
|
2609
|
+
)
|
|
2610
|
+
);
|
|
2611
|
+
SidebarMenu.displayName = "SidebarMenu";
|
|
2612
|
+
var SidebarMenuItem = React5.forwardRef(
|
|
2613
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2614
|
+
"li",
|
|
2615
|
+
{
|
|
2616
|
+
ref,
|
|
2617
|
+
"data-sidebar": "menu-item",
|
|
2618
|
+
className: cn("group/menu-item relative", className),
|
|
2619
|
+
...props
|
|
2620
|
+
}
|
|
2621
|
+
)
|
|
2622
|
+
);
|
|
2623
|
+
SidebarMenuItem.displayName = "SidebarMenuItem";
|
|
2624
|
+
var SidebarMenuButton = React5.forwardRef(({ isActive = false, tooltip, className, children, ...props }, ref) => {
|
|
2625
|
+
const { state } = useSidebar();
|
|
2626
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2627
|
+
"button",
|
|
2628
|
+
{
|
|
2629
|
+
ref,
|
|
2630
|
+
"data-sidebar": "menu-button",
|
|
2631
|
+
"data-active": isActive,
|
|
2632
|
+
"aria-current": isActive ? "page" : void 0,
|
|
2633
|
+
className: cn(
|
|
2634
|
+
"peer/menu-button flex w-full h-8 items-center gap-2 overflow-hidden rounded-lg p-2 text-left outline-none transition-[width,height,padding] hover:bg-white/10 data-[active=true]:bg-info data-[active=true]:hover:bg-info group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:!gap-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
2635
|
+
className
|
|
2636
|
+
),
|
|
2637
|
+
...props,
|
|
2638
|
+
children
|
|
2639
|
+
}
|
|
2640
|
+
);
|
|
2641
|
+
if (!tooltip || state !== "collapsed") {
|
|
2642
|
+
return button;
|
|
2643
|
+
}
|
|
2644
|
+
const tooltipProps = typeof tooltip === "string" ? { children: tooltip } : tooltip;
|
|
2645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Tooltip, { delayDuration: 0, children: [
|
|
2646
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipTrigger, { asChild: true, children: button }),
|
|
2647
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipContent, { side: "right", align: "center", ...tooltipProps })
|
|
2648
|
+
] });
|
|
2649
|
+
});
|
|
2650
|
+
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
2651
|
+
|
|
2652
|
+
// src/components/ui/date-picker.tsx
|
|
2653
|
+
var React7 = __toESM(require("react"));
|
|
2248
2654
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
2249
2655
|
|
|
2250
2656
|
// src/components/ui/input.tsx
|
|
2251
|
-
var
|
|
2252
|
-
var
|
|
2657
|
+
var React6 = __toESM(require("react"));
|
|
2658
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2253
2659
|
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";
|
|
2254
|
-
var Input =
|
|
2660
|
+
var Input = React6.forwardRef(
|
|
2255
2661
|
({
|
|
2256
2662
|
className,
|
|
2257
2663
|
style,
|
|
@@ -2262,7 +2668,7 @@ var Input = React4.forwardRef(
|
|
|
2262
2668
|
readOnly,
|
|
2263
2669
|
...props
|
|
2264
2670
|
}, ref) => {
|
|
2265
|
-
const [internalValue, setInternalValue] =
|
|
2671
|
+
const [internalValue, setInternalValue] = React6.useState(value || "");
|
|
2266
2672
|
const isControlled = value !== void 0;
|
|
2267
2673
|
const currentValue = isControlled ? value : internalValue;
|
|
2268
2674
|
const showClear = showClearProp !== false && currentValue && currentValue.toString().length > 0 && !readOnly;
|
|
@@ -2292,8 +2698,8 @@ var Input = React4.forwardRef(
|
|
|
2292
2698
|
}
|
|
2293
2699
|
onClear?.();
|
|
2294
2700
|
};
|
|
2295
|
-
return /* @__PURE__ */ (0,
|
|
2296
|
-
/* @__PURE__ */ (0,
|
|
2701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative", children: [
|
|
2702
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2297
2703
|
"input",
|
|
2298
2704
|
{
|
|
2299
2705
|
className: cn(
|
|
@@ -2309,23 +2715,23 @@ var Input = React4.forwardRef(
|
|
|
2309
2715
|
...props
|
|
2310
2716
|
}
|
|
2311
2717
|
),
|
|
2312
|
-
showClear && /* @__PURE__ */ (0,
|
|
2718
|
+
showClear && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2313
2719
|
"button",
|
|
2314
2720
|
{
|
|
2315
2721
|
type: "button",
|
|
2316
2722
|
onClick: handleClear,
|
|
2317
2723
|
className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-secondary hover:text-dark transition-colors",
|
|
2318
|
-
children: /* @__PURE__ */ (0,
|
|
2724
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(X, { className: "h-4 w-4" })
|
|
2319
2725
|
}
|
|
2320
2726
|
),
|
|
2321
|
-
showLock && /* @__PURE__ */ (0,
|
|
2727
|
+
showLock && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Lock, { className: "absolute right-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-secondary" })
|
|
2322
2728
|
] });
|
|
2323
2729
|
}
|
|
2324
2730
|
);
|
|
2325
2731
|
Input.displayName = "Input";
|
|
2326
2732
|
|
|
2327
2733
|
// src/components/ui/date-picker.tsx
|
|
2328
|
-
var
|
|
2734
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2329
2735
|
var getDayNames = () => {
|
|
2330
2736
|
const days = [];
|
|
2331
2737
|
for (let i = 0; i < 7; i++) {
|
|
@@ -2361,7 +2767,7 @@ var formatDateInput = (date) => {
|
|
|
2361
2767
|
day: "2-digit"
|
|
2362
2768
|
});
|
|
2363
2769
|
};
|
|
2364
|
-
var DatePicker =
|
|
2770
|
+
var DatePicker = React7.forwardRef(
|
|
2365
2771
|
({
|
|
2366
2772
|
value,
|
|
2367
2773
|
onValueChange,
|
|
@@ -2380,19 +2786,19 @@ var DatePicker = React5.forwardRef(
|
|
|
2380
2786
|
if (isNaN(parsed.getTime())) return void 0;
|
|
2381
2787
|
return parsed;
|
|
2382
2788
|
};
|
|
2383
|
-
const [selectedDate, setSelectedDate] =
|
|
2789
|
+
const [selectedDate, setSelectedDate] = React7.useState(
|
|
2384
2790
|
value || parseDate(defaultValue)
|
|
2385
2791
|
);
|
|
2386
|
-
const [currentMonth, setCurrentMonth] =
|
|
2792
|
+
const [currentMonth, setCurrentMonth] = React7.useState(() => {
|
|
2387
2793
|
const date = value || parseDate(defaultValue) || /* @__PURE__ */ new Date();
|
|
2388
2794
|
return new Date(date.getFullYear(), date.getMonth());
|
|
2389
2795
|
});
|
|
2390
|
-
const [open, setOpen] =
|
|
2391
|
-
const [inputValue, setInputValue] =
|
|
2796
|
+
const [open, setOpen] = React7.useState(false);
|
|
2797
|
+
const [inputValue, setInputValue] = React7.useState(() => {
|
|
2392
2798
|
const initialDate = value || parseDate(defaultValue);
|
|
2393
2799
|
return initialDate ? formatDateInput(initialDate) : "";
|
|
2394
2800
|
});
|
|
2395
|
-
|
|
2801
|
+
React7.useEffect(() => {
|
|
2396
2802
|
setSelectedDate(value);
|
|
2397
2803
|
if (value) {
|
|
2398
2804
|
setCurrentMonth(new Date(value.getFullYear(), value.getMonth()));
|
|
@@ -2403,7 +2809,7 @@ var DatePicker = React5.forwardRef(
|
|
|
2403
2809
|
setInputValue("");
|
|
2404
2810
|
}
|
|
2405
2811
|
}, [value]);
|
|
2406
|
-
|
|
2812
|
+
React7.useEffect(() => {
|
|
2407
2813
|
if (value) return;
|
|
2408
2814
|
const parsedDefault = parseDate(defaultValue);
|
|
2409
2815
|
if (!parsedDefault) return;
|
|
@@ -2526,14 +2932,14 @@ var DatePicker = React5.forwardRef(
|
|
|
2526
2932
|
const months = getMonthNames();
|
|
2527
2933
|
const dayNames = getDayNames();
|
|
2528
2934
|
const years = generateYears();
|
|
2529
|
-
return /* @__PURE__ */ (0,
|
|
2935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2530
2936
|
PopoverPrimitive.Root,
|
|
2531
2937
|
{
|
|
2532
2938
|
open: disabled ? false : open,
|
|
2533
2939
|
onOpenChange: disabled ? void 0 : setOpen,
|
|
2534
2940
|
children: [
|
|
2535
|
-
/* @__PURE__ */ (0,
|
|
2536
|
-
/* @__PURE__ */ (0,
|
|
2941
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative", children: [
|
|
2942
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2537
2943
|
Input,
|
|
2538
2944
|
{
|
|
2539
2945
|
ref,
|
|
@@ -2546,7 +2952,7 @@ var DatePicker = React5.forwardRef(
|
|
|
2546
2952
|
...props
|
|
2547
2953
|
}
|
|
2548
2954
|
),
|
|
2549
|
-
/* @__PURE__ */ (0,
|
|
2955
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.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_runtime11.jsx)(
|
|
2550
2956
|
Calendar,
|
|
2551
2957
|
{
|
|
2552
2958
|
className: cn(
|
|
@@ -2556,7 +2962,7 @@ var DatePicker = React5.forwardRef(
|
|
|
2556
2962
|
}
|
|
2557
2963
|
) }) })
|
|
2558
2964
|
] }),
|
|
2559
|
-
/* @__PURE__ */ (0,
|
|
2965
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2560
2966
|
PopoverPrimitive.Content,
|
|
2561
2967
|
{
|
|
2562
2968
|
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",
|
|
@@ -2565,51 +2971,51 @@ var DatePicker = React5.forwardRef(
|
|
|
2565
2971
|
alignOffset: -12,
|
|
2566
2972
|
side: "bottom",
|
|
2567
2973
|
sticky: "always",
|
|
2568
|
-
children: /* @__PURE__ */ (0,
|
|
2569
|
-
/* @__PURE__ */ (0,
|
|
2570
|
-
/* @__PURE__ */ (0,
|
|
2974
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "p-4", children: [
|
|
2975
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center justify-between mb-4 gap-1", children: [
|
|
2976
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2571
2977
|
"button",
|
|
2572
2978
|
{
|
|
2573
2979
|
onClick: () => handleMonthChange("prev"),
|
|
2574
2980
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
2575
|
-
children: /* @__PURE__ */ (0,
|
|
2981
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ChevronLeft, { className: "h-4 w-4" })
|
|
2576
2982
|
}
|
|
2577
2983
|
),
|
|
2578
|
-
/* @__PURE__ */ (0,
|
|
2579
|
-
/* @__PURE__ */ (0,
|
|
2984
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex gap-1 flex-1 min-w-0", children: [
|
|
2985
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2580
2986
|
Select,
|
|
2581
2987
|
{
|
|
2582
2988
|
value: currentMonth.getMonth().toString(),
|
|
2583
2989
|
onValueChange: handleMonthSelect,
|
|
2584
2990
|
children: [
|
|
2585
|
-
/* @__PURE__ */ (0,
|
|
2586
|
-
/* @__PURE__ */ (0,
|
|
2991
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectTrigger, { className: "min-w-fit h-8 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectValue, {}) }),
|
|
2992
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectContent, { children: months.map((month, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectItem, { value: index.toString(), children: month }, month)) })
|
|
2587
2993
|
]
|
|
2588
2994
|
}
|
|
2589
2995
|
),
|
|
2590
|
-
/* @__PURE__ */ (0,
|
|
2996
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2591
2997
|
Select,
|
|
2592
2998
|
{
|
|
2593
2999
|
value: currentMonth.getFullYear().toString(),
|
|
2594
3000
|
onValueChange: handleYearSelect,
|
|
2595
3001
|
children: [
|
|
2596
|
-
/* @__PURE__ */ (0,
|
|
2597
|
-
/* @__PURE__ */ (0,
|
|
3002
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectTrigger, { className: "min-w-fit h-8 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectValue, {}) }),
|
|
3003
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectContent, { children: years.map((year) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectItem, { value: year.toString(), children: year }, year)) })
|
|
2598
3004
|
]
|
|
2599
3005
|
}
|
|
2600
3006
|
)
|
|
2601
3007
|
] }),
|
|
2602
|
-
/* @__PURE__ */ (0,
|
|
3008
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2603
3009
|
"button",
|
|
2604
3010
|
{
|
|
2605
3011
|
onClick: () => handleMonthChange("next"),
|
|
2606
3012
|
className: "p-1 hover:bg-gray rounded transition-colors flex-shrink-0",
|
|
2607
|
-
children: /* @__PURE__ */ (0,
|
|
3013
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ChevronRight, { className: "h-4 w-4" })
|
|
2608
3014
|
}
|
|
2609
3015
|
)
|
|
2610
3016
|
] }),
|
|
2611
|
-
/* @__PURE__ */ (0,
|
|
2612
|
-
/* @__PURE__ */ (0,
|
|
3017
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "space-y-1", children: [
|
|
3018
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "grid grid-cols-7 gap-1 mb-2", children: dayNames.map((day) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2613
3019
|
Typography,
|
|
2614
3020
|
{
|
|
2615
3021
|
variant: "label-xs-bold",
|
|
@@ -2619,11 +3025,11 @@ var DatePicker = React5.forwardRef(
|
|
|
2619
3025
|
},
|
|
2620
3026
|
day
|
|
2621
3027
|
)) }),
|
|
2622
|
-
/* @__PURE__ */ (0,
|
|
3028
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "grid grid-cols-7 gap-1", children: days.map((date, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2623
3029
|
"div",
|
|
2624
3030
|
{
|
|
2625
3031
|
className: "h-8 w-8 flex items-center justify-center",
|
|
2626
|
-
children: date && /* @__PURE__ */ (0,
|
|
3032
|
+
children: date && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2627
3033
|
"button",
|
|
2628
3034
|
{
|
|
2629
3035
|
onClick: () => handleDateSelect(date),
|
|
@@ -2637,7 +3043,7 @@ var DatePicker = React5.forwardRef(
|
|
|
2637
3043
|
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",
|
|
2638
3044
|
isDateDisabled(date) && "text-secondary/40 cursor-not-allowed opacity-50"
|
|
2639
3045
|
),
|
|
2640
|
-
children: /* @__PURE__ */ (0,
|
|
3046
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Typography, { variant: "label-sm", as: "span", children: date.getDate() })
|
|
2641
3047
|
}
|
|
2642
3048
|
)
|
|
2643
3049
|
},
|
|
@@ -2655,9 +3061,9 @@ var DatePicker = React5.forwardRef(
|
|
|
2655
3061
|
DatePicker.displayName = "DatePicker";
|
|
2656
3062
|
|
|
2657
3063
|
// src/components/ui/upload.tsx
|
|
2658
|
-
var
|
|
3064
|
+
var React8 = __toESM(require("react"));
|
|
2659
3065
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
2660
|
-
var
|
|
3066
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2661
3067
|
var DEFAULT_MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
2662
3068
|
var uploadVariants = (0, import_class_variance_authority6.cva)(
|
|
2663
3069
|
"relative flex flex-col items-center justify-center rounded-lg transition-all duration-200 ease-in-out overflow-hidden",
|
|
@@ -2681,7 +3087,7 @@ var uploadVariants = (0, import_class_variance_authority6.cva)(
|
|
|
2681
3087
|
}
|
|
2682
3088
|
}
|
|
2683
3089
|
);
|
|
2684
|
-
var Upload =
|
|
3090
|
+
var Upload = React8.forwardRef(
|
|
2685
3091
|
({
|
|
2686
3092
|
className,
|
|
2687
3093
|
onFileSelect,
|
|
@@ -2694,8 +3100,8 @@ var Upload = React6.forwardRef(
|
|
|
2694
3100
|
selectedFiles = [],
|
|
2695
3101
|
...props
|
|
2696
3102
|
}, ref) => {
|
|
2697
|
-
const fileInputRef =
|
|
2698
|
-
const [isDragOver, setIsDragOver] =
|
|
3103
|
+
const fileInputRef = React8.useRef(null);
|
|
3104
|
+
const [isDragOver, setIsDragOver] = React8.useState(false);
|
|
2699
3105
|
const getFileTypeDisplay = () => {
|
|
2700
3106
|
const typeMap = {
|
|
2701
3107
|
"application/pdf": "PDF",
|
|
@@ -2759,17 +3165,17 @@ var Upload = React6.forwardRef(
|
|
|
2759
3165
|
const renderContent = () => {
|
|
2760
3166
|
switch (effectiveState) {
|
|
2761
3167
|
case "error":
|
|
2762
|
-
return /* @__PURE__ */ (0,
|
|
3168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2763
3169
|
"div",
|
|
2764
3170
|
{
|
|
2765
3171
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2766
3172
|
style: { gap: "32px" },
|
|
2767
3173
|
children: [
|
|
2768
|
-
/* @__PURE__ */ (0,
|
|
2769
|
-
/* @__PURE__ */ (0,
|
|
2770
|
-
/* @__PURE__ */ (0,
|
|
3174
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-4", children: [
|
|
3175
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Typography, { variant: "heading-sm", children: "Upload fail" }),
|
|
3176
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Typography, { variant: "body-md", className: "text-error", children: errorMessage })
|
|
2771
3177
|
] }),
|
|
2772
|
-
/* @__PURE__ */ (0,
|
|
3178
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2773
3179
|
Button,
|
|
2774
3180
|
{
|
|
2775
3181
|
variant: "destructive",
|
|
@@ -2783,22 +3189,22 @@ var Upload = React6.forwardRef(
|
|
|
2783
3189
|
}
|
|
2784
3190
|
);
|
|
2785
3191
|
case "uploading":
|
|
2786
|
-
return /* @__PURE__ */ (0,
|
|
3192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2787
3193
|
"div",
|
|
2788
3194
|
{
|
|
2789
3195
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2790
3196
|
style: { gap: "32px" },
|
|
2791
3197
|
children: [
|
|
2792
|
-
/* @__PURE__ */ (0,
|
|
2793
|
-
/* @__PURE__ */ (0,
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
3198
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Typography, { variant: "heading-sm", className: "text-dark", children: "Uploading files" }),
|
|
3199
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "w-full max-w-[720px] space-y-2", children: [
|
|
3200
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-full bg-gray rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2795
3201
|
"div",
|
|
2796
3202
|
{
|
|
2797
3203
|
className: "bg-canvas-primary h-2 rounded-full transition-all duration-300 ease-in-out",
|
|
2798
3204
|
style: { width: `${progress}%` }
|
|
2799
3205
|
}
|
|
2800
3206
|
) }),
|
|
2801
|
-
/* @__PURE__ */ (0,
|
|
3207
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2802
3208
|
Typography,
|
|
2803
3209
|
{
|
|
2804
3210
|
variant: "body-sm",
|
|
@@ -2814,29 +3220,29 @@ var Upload = React6.forwardRef(
|
|
|
2814
3220
|
}
|
|
2815
3221
|
);
|
|
2816
3222
|
case "success":
|
|
2817
|
-
return /* @__PURE__ */ (0,
|
|
3223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2818
3224
|
"div",
|
|
2819
3225
|
{
|
|
2820
3226
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2821
3227
|
style: { gap: "32px" },
|
|
2822
|
-
children: /* @__PURE__ */ (0,
|
|
2823
|
-
/* @__PURE__ */ (0,
|
|
2824
|
-
selectedFiles.length > 0 && /* @__PURE__ */ (0,
|
|
3228
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-4", children: [
|
|
3229
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Typography, { variant: "heading-sm", className: "text-success", children: "Upload successful!" }),
|
|
3230
|
+
selectedFiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "text-center", children: selectedFiles.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Typography, { variant: "body-sm", children: file.name }, index)) })
|
|
2825
3231
|
] })
|
|
2826
3232
|
}
|
|
2827
3233
|
);
|
|
2828
3234
|
default:
|
|
2829
|
-
return /* @__PURE__ */ (0,
|
|
3235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2830
3236
|
"div",
|
|
2831
3237
|
{
|
|
2832
3238
|
className: "flex flex-col items-center text-center max-w-[289px]",
|
|
2833
3239
|
style: { gap: "32px" },
|
|
2834
3240
|
children: [
|
|
2835
|
-
/* @__PURE__ */ (0,
|
|
2836
|
-
/* @__PURE__ */ (0,
|
|
2837
|
-
/* @__PURE__ */ (0,
|
|
3241
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-4", children: [
|
|
3242
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Typography, { variant: "heading-sm", className: "text-dark", children: "Drag & drop files here" }),
|
|
3243
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "or click to browse from your computer" })
|
|
2838
3244
|
] }),
|
|
2839
|
-
/* @__PURE__ */ (0,
|
|
3245
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2840
3246
|
Button,
|
|
2841
3247
|
{
|
|
2842
3248
|
variant: "default",
|
|
@@ -2850,10 +3256,10 @@ var Upload = React6.forwardRef(
|
|
|
2850
3256
|
children: "Choose files"
|
|
2851
3257
|
}
|
|
2852
3258
|
),
|
|
2853
|
-
/* @__PURE__ */ (0,
|
|
3259
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Typography, { variant: "body-sm", className: "text-secondary", children: [
|
|
2854
3260
|
"Supported file: ",
|
|
2855
3261
|
getFileTypeDisplay(),
|
|
2856
|
-
/* @__PURE__ */ (0,
|
|
3262
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("br", {}),
|
|
2857
3263
|
"Max: ",
|
|
2858
3264
|
Math.round(maxFileSize / 1024 / 1024),
|
|
2859
3265
|
" MB each"
|
|
@@ -2863,7 +3269,7 @@ var Upload = React6.forwardRef(
|
|
|
2863
3269
|
);
|
|
2864
3270
|
}
|
|
2865
3271
|
};
|
|
2866
|
-
return /* @__PURE__ */ (0,
|
|
3272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2867
3273
|
"div",
|
|
2868
3274
|
{
|
|
2869
3275
|
ref,
|
|
@@ -2887,7 +3293,7 @@ var Upload = React6.forwardRef(
|
|
|
2887
3293
|
"aria-disabled": disabled,
|
|
2888
3294
|
...props,
|
|
2889
3295
|
children: [
|
|
2890
|
-
/* @__PURE__ */ (0,
|
|
3296
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2891
3297
|
"input",
|
|
2892
3298
|
{
|
|
2893
3299
|
ref: fileInputRef,
|
|
@@ -2907,34 +3313,34 @@ var Upload = React6.forwardRef(
|
|
|
2907
3313
|
Upload.displayName = "Upload";
|
|
2908
3314
|
|
|
2909
3315
|
// src/components/ui/checkbox.tsx
|
|
2910
|
-
var
|
|
3316
|
+
var React9 = __toESM(require("react"));
|
|
2911
3317
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
2912
3318
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
2913
|
-
var
|
|
3319
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2914
3320
|
var checkboxVariants = (0, import_class_variance_authority7.cva)(
|
|
2915
3321
|
"peer size-4 shrink-0 rounded-[4px] border bg-light hover:bg-info-subtle transition-colors focus-visible:outline-none focus-visible:border-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-light [&_svg]:pointer-events-none [&_svg]:size-3 [&_svg]:shrink-0 border-strong focus-visible:border-interactive aria-invalid:border-error aria-invalid:focus-visible:border-error"
|
|
2916
3322
|
);
|
|
2917
|
-
var Checkbox =
|
|
3323
|
+
var Checkbox = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2918
3324
|
CheckboxPrimitive.Root,
|
|
2919
3325
|
{
|
|
2920
3326
|
ref,
|
|
2921
3327
|
className: cn(checkboxVariants(), className),
|
|
2922
3328
|
...props,
|
|
2923
|
-
children: /* @__PURE__ */ (0,
|
|
3329
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CheckIcon, { variant: "light", className: "size-3" }) })
|
|
2924
3330
|
}
|
|
2925
3331
|
));
|
|
2926
3332
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
2927
3333
|
|
|
2928
3334
|
// src/components/ui/textarea.tsx
|
|
2929
|
-
var
|
|
2930
|
-
var
|
|
2931
|
-
var Textarea =
|
|
3335
|
+
var React10 = __toESM(require("react"));
|
|
3336
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3337
|
+
var Textarea = React10.forwardRef(
|
|
2932
3338
|
({ className, style, ...props }, ref) => {
|
|
2933
3339
|
const tokenStyles = {
|
|
2934
3340
|
font: "var(--typography-label-md-regular)",
|
|
2935
3341
|
...style
|
|
2936
3342
|
};
|
|
2937
|
-
return /* @__PURE__ */ (0,
|
|
3343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2938
3344
|
"textarea",
|
|
2939
3345
|
{
|
|
2940
3346
|
className: cn(
|
|
@@ -2951,9 +3357,9 @@ var Textarea = React8.forwardRef(
|
|
|
2951
3357
|
Textarea.displayName = "Textarea";
|
|
2952
3358
|
|
|
2953
3359
|
// src/components/ui/badge.tsx
|
|
2954
|
-
var
|
|
3360
|
+
var React11 = __toESM(require("react"));
|
|
2955
3361
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
2956
|
-
var
|
|
3362
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2957
3363
|
var badgeVariants = (0, import_class_variance_authority8.cva)(
|
|
2958
3364
|
"inline-flex items-center justify-center gap-1 whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
2959
3365
|
{
|
|
@@ -2976,7 +3382,7 @@ var badgeVariants = (0, import_class_variance_authority8.cva)(
|
|
|
2976
3382
|
function getBadgeTypographyStyles() {
|
|
2977
3383
|
return { font: "var(--typography-label-sm-bold)" };
|
|
2978
3384
|
}
|
|
2979
|
-
var Badge =
|
|
3385
|
+
var Badge = React11.forwardRef(
|
|
2980
3386
|
({ className, variant, style, ...props }, ref) => {
|
|
2981
3387
|
if (!variant) {
|
|
2982
3388
|
return null;
|
|
@@ -2986,7 +3392,7 @@ var Badge = React9.forwardRef(
|
|
|
2986
3392
|
...typographyStyles,
|
|
2987
3393
|
...style
|
|
2988
3394
|
};
|
|
2989
|
-
return /* @__PURE__ */ (0,
|
|
3395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2990
3396
|
"span",
|
|
2991
3397
|
{
|
|
2992
3398
|
className: cn(
|
|
@@ -3003,10 +3409,294 @@ var Badge = React9.forwardRef(
|
|
|
3003
3409
|
);
|
|
3004
3410
|
Badge.displayName = "Badge";
|
|
3005
3411
|
|
|
3412
|
+
// src/components/pdf-viewer/index.tsx
|
|
3413
|
+
var React16 = __toESM(require("react"));
|
|
3414
|
+
var import_TextLayer = require("react-pdf/dist/Page/TextLayer.css");
|
|
3415
|
+
|
|
3416
|
+
// src/components/pdf-viewer/components/PdfDocument.tsx
|
|
3417
|
+
var React12 = __toESM(require("react"));
|
|
3418
|
+
var import_react_pdf = require("react-pdf");
|
|
3419
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3420
|
+
var PdfDocument = ({
|
|
3421
|
+
file,
|
|
3422
|
+
pageWidth,
|
|
3423
|
+
enableTextLayer,
|
|
3424
|
+
onLoadSuccess,
|
|
3425
|
+
onLoadError
|
|
3426
|
+
}) => {
|
|
3427
|
+
const [numPages, setNumPages] = React12.useState();
|
|
3428
|
+
function handleDocumentLoadSuccess({ numPages: numPages2 }) {
|
|
3429
|
+
setNumPages(numPages2);
|
|
3430
|
+
onLoadSuccess?.(numPages2);
|
|
3431
|
+
}
|
|
3432
|
+
if (!file) {
|
|
3433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No PDF available" }) });
|
|
3434
|
+
}
|
|
3435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3436
|
+
import_react_pdf.Document,
|
|
3437
|
+
{
|
|
3438
|
+
file,
|
|
3439
|
+
onLoadSuccess: handleDocumentLoadSuccess,
|
|
3440
|
+
onLoadError,
|
|
3441
|
+
loading: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "Rendering PDF..." }) }),
|
|
3442
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Typography, { variant: "body-md", className: "text-error", children: "Failed to render PDF" }) }),
|
|
3443
|
+
className: "flex flex-col items-center p-4",
|
|
3444
|
+
children: numPages && pageWidth > 0 && Array.from(new Array(numPages), (_, index) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3445
|
+
import_react_pdf.Page,
|
|
3446
|
+
{
|
|
3447
|
+
pageNumber: index + 1,
|
|
3448
|
+
width: pageWidth,
|
|
3449
|
+
className: "mb-4 shadow-sm",
|
|
3450
|
+
renderTextLayer: enableTextLayer,
|
|
3451
|
+
renderAnnotationLayer: false
|
|
3452
|
+
},
|
|
3453
|
+
`page_${index + 1}`
|
|
3454
|
+
))
|
|
3455
|
+
}
|
|
3456
|
+
);
|
|
3457
|
+
};
|
|
3458
|
+
PdfDocument.displayName = "PdfDocument";
|
|
3459
|
+
|
|
3460
|
+
// src/components/pdf-viewer/components/PdfHeader.tsx
|
|
3461
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3462
|
+
var PdfHeader = ({
|
|
3463
|
+
title,
|
|
3464
|
+
onDownload,
|
|
3465
|
+
onPrint
|
|
3466
|
+
}) => {
|
|
3467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between gap-4 px-4 py-3 bg-neutral-400 border-b border-subtle", children: [
|
|
3468
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex-shrink min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3469
|
+
Typography,
|
|
3470
|
+
{
|
|
3471
|
+
variant: "label-md-bold",
|
|
3472
|
+
className: "text-dark truncate",
|
|
3473
|
+
title,
|
|
3474
|
+
children: title || "Untitled Document"
|
|
3475
|
+
}
|
|
3476
|
+
) }),
|
|
3477
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
|
|
3478
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3479
|
+
"button",
|
|
3480
|
+
{
|
|
3481
|
+
onClick: onDownload,
|
|
3482
|
+
className: "p-2 hover:bg-neutral-500 rounded transition-colors",
|
|
3483
|
+
"aria-label": "Download PDF",
|
|
3484
|
+
type: "button",
|
|
3485
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Download, { variant: "dark", className: "w-5 h-5" })
|
|
3486
|
+
}
|
|
3487
|
+
),
|
|
3488
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3489
|
+
"button",
|
|
3490
|
+
{
|
|
3491
|
+
onClick: onPrint,
|
|
3492
|
+
className: "p-2 hover:bg-neutral-500 rounded transition-colors",
|
|
3493
|
+
"aria-label": "Print PDF",
|
|
3494
|
+
type: "button",
|
|
3495
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Print, { variant: "dark", className: "w-5 h-5" })
|
|
3496
|
+
}
|
|
3497
|
+
)
|
|
3498
|
+
] })
|
|
3499
|
+
] });
|
|
3500
|
+
};
|
|
3501
|
+
PdfHeader.displayName = "PdfHeader";
|
|
3502
|
+
|
|
3503
|
+
// src/components/pdf-viewer/hooks/useContainerWidth.ts
|
|
3504
|
+
var React13 = __toESM(require("react"));
|
|
3505
|
+
function useContainerWidth(padding = 32) {
|
|
3506
|
+
const [containerWidth, setContainerWidth] = React13.useState(0);
|
|
3507
|
+
const containerRef = React13.useRef(null);
|
|
3508
|
+
const lastWidthRef = React13.useRef(0);
|
|
3509
|
+
React13.useEffect(() => {
|
|
3510
|
+
const element = containerRef.current;
|
|
3511
|
+
if (!element) return;
|
|
3512
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
3513
|
+
for (const entry of entries) {
|
|
3514
|
+
const newWidth = entry.contentRect.width - padding;
|
|
3515
|
+
if (Math.abs(newWidth - lastWidthRef.current) > 1) {
|
|
3516
|
+
lastWidthRef.current = newWidth;
|
|
3517
|
+
setContainerWidth(newWidth);
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
});
|
|
3521
|
+
resizeObserver.observe(element);
|
|
3522
|
+
const initialWidth = element.offsetWidth - padding;
|
|
3523
|
+
lastWidthRef.current = initialWidth;
|
|
3524
|
+
setContainerWidth(initialWidth);
|
|
3525
|
+
return () => {
|
|
3526
|
+
resizeObserver.disconnect();
|
|
3527
|
+
};
|
|
3528
|
+
}, [padding]);
|
|
3529
|
+
return { containerWidth, containerRef };
|
|
3530
|
+
}
|
|
3531
|
+
|
|
3532
|
+
// src/components/pdf-viewer/hooks/usePdfDownload.ts
|
|
3533
|
+
var React14 = __toESM(require("react"));
|
|
3534
|
+
function usePdfDownload(file, title) {
|
|
3535
|
+
const download = React14.useCallback(async () => {
|
|
3536
|
+
if (!file) return;
|
|
3537
|
+
try {
|
|
3538
|
+
let blob;
|
|
3539
|
+
let filename;
|
|
3540
|
+
if (typeof file === "string") {
|
|
3541
|
+
const response = await fetch(file);
|
|
3542
|
+
blob = await response.blob();
|
|
3543
|
+
filename = title || "document.pdf";
|
|
3544
|
+
} else {
|
|
3545
|
+
blob = file;
|
|
3546
|
+
filename = title || file.name || "document.pdf";
|
|
3547
|
+
}
|
|
3548
|
+
const url = URL.createObjectURL(blob);
|
|
3549
|
+
const link = document.createElement("a");
|
|
3550
|
+
link.href = url;
|
|
3551
|
+
link.download = filename;
|
|
3552
|
+
link.style.display = "none";
|
|
3553
|
+
document.body.appendChild(link);
|
|
3554
|
+
link.click();
|
|
3555
|
+
setTimeout(() => {
|
|
3556
|
+
document.body.removeChild(link);
|
|
3557
|
+
URL.revokeObjectURL(url);
|
|
3558
|
+
}, 100);
|
|
3559
|
+
} catch (error) {
|
|
3560
|
+
console.error("Failed to download PDF:", error);
|
|
3561
|
+
}
|
|
3562
|
+
}, [file, title]);
|
|
3563
|
+
return download;
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3566
|
+
// src/components/pdf-viewer/hooks/usePdfPrint.ts
|
|
3567
|
+
var React15 = __toESM(require("react"));
|
|
3568
|
+
function usePdfPrint(file) {
|
|
3569
|
+
const [printBlobUrl, setPrintBlobUrl] = React15.useState(null);
|
|
3570
|
+
const printFrameRef = React15.useRef(null);
|
|
3571
|
+
const preparePrint = React15.useCallback(async () => {
|
|
3572
|
+
if (!file) return;
|
|
3573
|
+
try {
|
|
3574
|
+
let blob;
|
|
3575
|
+
if (typeof file === "string") {
|
|
3576
|
+
const response = await fetch(file);
|
|
3577
|
+
blob = await response.blob();
|
|
3578
|
+
} else {
|
|
3579
|
+
blob = file;
|
|
3580
|
+
}
|
|
3581
|
+
const url = URL.createObjectURL(blob);
|
|
3582
|
+
setPrintBlobUrl(url);
|
|
3583
|
+
} catch (error) {
|
|
3584
|
+
console.error("Failed to prepare PDF for printing:", error);
|
|
3585
|
+
}
|
|
3586
|
+
}, [file]);
|
|
3587
|
+
React15.useEffect(() => {
|
|
3588
|
+
return () => {
|
|
3589
|
+
if (printBlobUrl) {
|
|
3590
|
+
URL.revokeObjectURL(printBlobUrl);
|
|
3591
|
+
}
|
|
3592
|
+
};
|
|
3593
|
+
}, [printBlobUrl]);
|
|
3594
|
+
const print = React15.useCallback(() => {
|
|
3595
|
+
if (printFrameRef.current?.contentWindow) {
|
|
3596
|
+
printFrameRef.current.contentWindow.print();
|
|
3597
|
+
}
|
|
3598
|
+
}, []);
|
|
3599
|
+
return { printFrameRef, printBlobUrl, preparePrint, print };
|
|
3600
|
+
}
|
|
3601
|
+
|
|
3602
|
+
// src/components/pdf-viewer/utils/pdfWorker.ts
|
|
3603
|
+
var import_react_pdf2 = require("react-pdf");
|
|
3604
|
+
function initializePdfWorker(workerUrl) {
|
|
3605
|
+
import_react_pdf2.pdfjs.GlobalWorkerOptions.workerSrc = workerUrl;
|
|
3606
|
+
}
|
|
3607
|
+
|
|
3608
|
+
// src/components/pdf-viewer/index.tsx
|
|
3609
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3610
|
+
var PdfViewer = React16.forwardRef(
|
|
3611
|
+
({
|
|
3612
|
+
file,
|
|
3613
|
+
title,
|
|
3614
|
+
pageWidth,
|
|
3615
|
+
onDownload,
|
|
3616
|
+
onPrint,
|
|
3617
|
+
onLoadSuccess,
|
|
3618
|
+
onError,
|
|
3619
|
+
enableTextLayer = false,
|
|
3620
|
+
className,
|
|
3621
|
+
...props
|
|
3622
|
+
}, ref) => {
|
|
3623
|
+
const { containerWidth, containerRef } = useContainerWidth();
|
|
3624
|
+
const { printFrameRef, printBlobUrl, preparePrint, print } = usePdfPrint(file);
|
|
3625
|
+
const download = usePdfDownload(file, title);
|
|
3626
|
+
const effectiveWidth = pageWidth || containerWidth;
|
|
3627
|
+
const handleLoadSuccess = React16.useCallback(
|
|
3628
|
+
async (numPages) => {
|
|
3629
|
+
onLoadSuccess?.(numPages);
|
|
3630
|
+
await preparePrint();
|
|
3631
|
+
},
|
|
3632
|
+
[onLoadSuccess, preparePrint]
|
|
3633
|
+
);
|
|
3634
|
+
const handleDownload = React16.useCallback(() => {
|
|
3635
|
+
if (onDownload) {
|
|
3636
|
+
onDownload();
|
|
3637
|
+
return;
|
|
3638
|
+
}
|
|
3639
|
+
download();
|
|
3640
|
+
}, [onDownload, download]);
|
|
3641
|
+
const handlePrint = React16.useCallback(() => {
|
|
3642
|
+
if (onPrint) {
|
|
3643
|
+
onPrint();
|
|
3644
|
+
return;
|
|
3645
|
+
}
|
|
3646
|
+
print();
|
|
3647
|
+
}, [onPrint, print]);
|
|
3648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3649
|
+
"div",
|
|
3650
|
+
{
|
|
3651
|
+
ref,
|
|
3652
|
+
className: cn("h-full flex flex-col", className),
|
|
3653
|
+
...props,
|
|
3654
|
+
children: [
|
|
3655
|
+
printBlobUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3656
|
+
"iframe",
|
|
3657
|
+
{
|
|
3658
|
+
ref: printFrameRef,
|
|
3659
|
+
src: printBlobUrl,
|
|
3660
|
+
style: { display: "none" },
|
|
3661
|
+
title: "PDF for printing"
|
|
3662
|
+
}
|
|
3663
|
+
),
|
|
3664
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3665
|
+
PdfHeader,
|
|
3666
|
+
{
|
|
3667
|
+
title,
|
|
3668
|
+
onDownload: handleDownload,
|
|
3669
|
+
onPrint: handlePrint
|
|
3670
|
+
}
|
|
3671
|
+
),
|
|
3672
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3673
|
+
"div",
|
|
3674
|
+
{
|
|
3675
|
+
ref: containerRef,
|
|
3676
|
+
className: "flex-1 overflow-y-auto overflow-x-hidden bg-neutral-300",
|
|
3677
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3678
|
+
PdfDocument,
|
|
3679
|
+
{
|
|
3680
|
+
file,
|
|
3681
|
+
pageWidth: effectiveWidth,
|
|
3682
|
+
enableTextLayer,
|
|
3683
|
+
onLoadSuccess: handleLoadSuccess,
|
|
3684
|
+
onLoadError: onError
|
|
3685
|
+
}
|
|
3686
|
+
)
|
|
3687
|
+
}
|
|
3688
|
+
)
|
|
3689
|
+
]
|
|
3690
|
+
}
|
|
3691
|
+
);
|
|
3692
|
+
}
|
|
3693
|
+
);
|
|
3694
|
+
PdfViewer.displayName = "PdfViewer";
|
|
3695
|
+
|
|
3006
3696
|
// src/components/ui/tabs.tsx
|
|
3007
|
-
var
|
|
3697
|
+
var React17 = __toESM(require("react"));
|
|
3008
3698
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
3009
|
-
var
|
|
3699
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3010
3700
|
var tabsVariants = (0, import_class_variance_authority9.cva)(
|
|
3011
3701
|
"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",
|
|
3012
3702
|
{
|
|
@@ -3020,17 +3710,17 @@ var tabsVariants = (0, import_class_variance_authority9.cva)(
|
|
|
3020
3710
|
}
|
|
3021
3711
|
}
|
|
3022
3712
|
);
|
|
3023
|
-
var TabsContext =
|
|
3713
|
+
var TabsContext = React17.createContext(
|
|
3024
3714
|
void 0
|
|
3025
3715
|
);
|
|
3026
3716
|
function useTabsContext() {
|
|
3027
|
-
const context =
|
|
3717
|
+
const context = React17.useContext(TabsContext);
|
|
3028
3718
|
if (!context) {
|
|
3029
3719
|
throw new Error("Tabs components must be used within a Tabs provider");
|
|
3030
3720
|
}
|
|
3031
3721
|
return context;
|
|
3032
3722
|
}
|
|
3033
|
-
var Tabs =
|
|
3723
|
+
var Tabs = React17.forwardRef((props, ref) => {
|
|
3034
3724
|
const {
|
|
3035
3725
|
className,
|
|
3036
3726
|
value,
|
|
@@ -3039,7 +3729,7 @@ var Tabs = React10.forwardRef((props, ref) => {
|
|
|
3039
3729
|
children,
|
|
3040
3730
|
...restProps
|
|
3041
3731
|
} = props;
|
|
3042
|
-
const contextValue =
|
|
3732
|
+
const contextValue = React17.useMemo(
|
|
3043
3733
|
() => ({
|
|
3044
3734
|
activeTab: value,
|
|
3045
3735
|
setActiveTab: onValueChange,
|
|
@@ -3047,13 +3737,13 @@ var Tabs = React10.forwardRef((props, ref) => {
|
|
|
3047
3737
|
}),
|
|
3048
3738
|
[value, onValueChange, variant]
|
|
3049
3739
|
);
|
|
3050
|
-
return /* @__PURE__ */ (0,
|
|
3740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TabsContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref, className: cn("w-full", className), ...restProps, children }) });
|
|
3051
3741
|
});
|
|
3052
3742
|
Tabs.displayName = "Tabs";
|
|
3053
|
-
var TabsList =
|
|
3743
|
+
var TabsList = React17.forwardRef(
|
|
3054
3744
|
(props, ref) => {
|
|
3055
3745
|
const { className, children, ...restProps } = props;
|
|
3056
|
-
return /* @__PURE__ */ (0,
|
|
3746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3057
3747
|
"div",
|
|
3058
3748
|
{
|
|
3059
3749
|
ref,
|
|
@@ -3069,7 +3759,7 @@ TabsList.displayName = "TabsList";
|
|
|
3069
3759
|
var getTabTypographyStyles = (isActive) => ({
|
|
3070
3760
|
font: isActive ? "var(--typography-label-sm-bold)" : "var(--typography-label-sm-regular)"
|
|
3071
3761
|
});
|
|
3072
|
-
var TabsTrigger =
|
|
3762
|
+
var TabsTrigger = React17.forwardRef(
|
|
3073
3763
|
(props, ref) => {
|
|
3074
3764
|
const { className, value, disabled, style, children, ...restProps } = props;
|
|
3075
3765
|
const { activeTab, setActiveTab, variant } = useTabsContext();
|
|
@@ -3077,22 +3767,22 @@ var TabsTrigger = React10.forwardRef(
|
|
|
3077
3767
|
throw new Error("TabsTrigger must have a value prop");
|
|
3078
3768
|
}
|
|
3079
3769
|
const isActive = activeTab === value;
|
|
3080
|
-
const tokenStyles =
|
|
3770
|
+
const tokenStyles = React17.useMemo(
|
|
3081
3771
|
() => ({
|
|
3082
3772
|
...getTabTypographyStyles(isActive),
|
|
3083
3773
|
...style
|
|
3084
3774
|
}),
|
|
3085
3775
|
[isActive, style]
|
|
3086
3776
|
);
|
|
3087
|
-
const triggerClassName =
|
|
3777
|
+
const triggerClassName = React17.useMemo(
|
|
3088
3778
|
() => cn(tabsVariants({ variant }), className),
|
|
3089
3779
|
[variant, className]
|
|
3090
3780
|
);
|
|
3091
|
-
const handleClick =
|
|
3781
|
+
const handleClick = React17.useCallback(() => {
|
|
3092
3782
|
if (disabled) return;
|
|
3093
3783
|
setActiveTab(value);
|
|
3094
3784
|
}, [disabled, setActiveTab, value]);
|
|
3095
|
-
return /* @__PURE__ */ (0,
|
|
3785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3096
3786
|
"button",
|
|
3097
3787
|
{
|
|
3098
3788
|
ref,
|
|
@@ -3106,13 +3796,13 @@ var TabsTrigger = React10.forwardRef(
|
|
|
3106
3796
|
disabled,
|
|
3107
3797
|
onClick: handleClick,
|
|
3108
3798
|
...restProps,
|
|
3109
|
-
children: /* @__PURE__ */ (0,
|
|
3799
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "pl-3 pr-6 py-2", children })
|
|
3110
3800
|
}
|
|
3111
3801
|
);
|
|
3112
3802
|
}
|
|
3113
3803
|
);
|
|
3114
3804
|
TabsTrigger.displayName = "TabsTrigger";
|
|
3115
|
-
var TabsContent =
|
|
3805
|
+
var TabsContent = React17.forwardRef(
|
|
3116
3806
|
(props, ref) => {
|
|
3117
3807
|
const { className, value, children, ...restProps } = props;
|
|
3118
3808
|
const { activeTab } = useTabsContext();
|
|
@@ -3123,7 +3813,7 @@ var TabsContent = React10.forwardRef(
|
|
|
3123
3813
|
if (!isActive) {
|
|
3124
3814
|
return null;
|
|
3125
3815
|
}
|
|
3126
|
-
return /* @__PURE__ */ (0,
|
|
3816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3127
3817
|
"div",
|
|
3128
3818
|
{
|
|
3129
3819
|
ref,
|
|
@@ -3141,11 +3831,11 @@ var TabsContent = React10.forwardRef(
|
|
|
3141
3831
|
TabsContent.displayName = "TabsContent";
|
|
3142
3832
|
|
|
3143
3833
|
// src/components/ui/dropdown-menu.tsx
|
|
3144
|
-
var
|
|
3834
|
+
var React18 = __toESM(require("react"));
|
|
3145
3835
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
3146
|
-
var
|
|
3836
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3147
3837
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
3148
|
-
var DropdownMenuTrigger =
|
|
3838
|
+
var DropdownMenuTrigger = React18.forwardRef(({ className, icon, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3149
3839
|
DropdownMenuPrimitive.Trigger,
|
|
3150
3840
|
{
|
|
3151
3841
|
ref,
|
|
@@ -3155,7 +3845,7 @@ var DropdownMenuTrigger = React11.forwardRef(({ className, icon, children, ...pr
|
|
|
3155
3845
|
),
|
|
3156
3846
|
...props,
|
|
3157
3847
|
children: [
|
|
3158
|
-
icon || /* @__PURE__ */ (0,
|
|
3848
|
+
icon || /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MoreMenu, { className: "size-4" }),
|
|
3159
3849
|
children
|
|
3160
3850
|
]
|
|
3161
3851
|
}
|
|
@@ -3165,7 +3855,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
3165
3855
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
3166
3856
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
3167
3857
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
3168
|
-
var DropdownMenuSubTrigger =
|
|
3858
|
+
var DropdownMenuSubTrigger = React18.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3169
3859
|
DropdownMenuPrimitive.SubTrigger,
|
|
3170
3860
|
{
|
|
3171
3861
|
ref,
|
|
@@ -3178,12 +3868,12 @@ var DropdownMenuSubTrigger = React11.forwardRef(({ className, inset, children, .
|
|
|
3178
3868
|
...props,
|
|
3179
3869
|
children: [
|
|
3180
3870
|
children,
|
|
3181
|
-
/* @__PURE__ */ (0,
|
|
3871
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ChevronRight, { className: "ml-auto" })
|
|
3182
3872
|
]
|
|
3183
3873
|
}
|
|
3184
3874
|
));
|
|
3185
3875
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
3186
|
-
var DropdownMenuSubContent =
|
|
3876
|
+
var DropdownMenuSubContent = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3187
3877
|
DropdownMenuPrimitive.SubContent,
|
|
3188
3878
|
{
|
|
3189
3879
|
ref,
|
|
@@ -3195,7 +3885,7 @@ var DropdownMenuSubContent = React11.forwardRef(({ className, ...props }, ref) =
|
|
|
3195
3885
|
}
|
|
3196
3886
|
));
|
|
3197
3887
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3198
|
-
var DropdownMenuContent =
|
|
3888
|
+
var DropdownMenuContent = React18.forwardRef(({ className, sideOffset = 4, align = "end", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3199
3889
|
DropdownMenuPrimitive.Content,
|
|
3200
3890
|
{
|
|
3201
3891
|
ref,
|
|
@@ -3209,7 +3899,7 @@ var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, align
|
|
|
3209
3899
|
}
|
|
3210
3900
|
) }));
|
|
3211
3901
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3212
|
-
var DropdownMenuItem =
|
|
3902
|
+
var DropdownMenuItem = React18.forwardRef(({ className, inset, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3213
3903
|
DropdownMenuPrimitive.Item,
|
|
3214
3904
|
{
|
|
3215
3905
|
ref,
|
|
@@ -3226,7 +3916,7 @@ var DropdownMenuItem = React11.forwardRef(({ className, inset, style, ...props }
|
|
|
3226
3916
|
}
|
|
3227
3917
|
));
|
|
3228
3918
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
3229
|
-
var DropdownMenuCheckboxItem =
|
|
3919
|
+
var DropdownMenuCheckboxItem = React18.forwardRef(({ className, children, style, checked, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3230
3920
|
DropdownMenuPrimitive.CheckboxItem,
|
|
3231
3921
|
{
|
|
3232
3922
|
ref,
|
|
@@ -3241,7 +3931,7 @@ var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, style,
|
|
|
3241
3931
|
},
|
|
3242
3932
|
...props,
|
|
3243
3933
|
children: [
|
|
3244
|
-
/* @__PURE__ */ (0,
|
|
3934
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3245
3935
|
Checkbox,
|
|
3246
3936
|
{
|
|
3247
3937
|
checked: checked === true,
|
|
@@ -3249,12 +3939,12 @@ var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, style,
|
|
|
3249
3939
|
"aria-hidden": "true"
|
|
3250
3940
|
}
|
|
3251
3941
|
),
|
|
3252
|
-
/* @__PURE__ */ (0,
|
|
3942
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "flex-1", children })
|
|
3253
3943
|
]
|
|
3254
3944
|
}
|
|
3255
3945
|
));
|
|
3256
3946
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
3257
|
-
var DropdownMenuRadioItem =
|
|
3947
|
+
var DropdownMenuRadioItem = React18.forwardRef(({ className, children, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3258
3948
|
DropdownMenuPrimitive.RadioItem,
|
|
3259
3949
|
{
|
|
3260
3950
|
ref,
|
|
@@ -3268,13 +3958,13 @@ var DropdownMenuRadioItem = React11.forwardRef(({ className, children, style, ..
|
|
|
3268
3958
|
},
|
|
3269
3959
|
...props,
|
|
3270
3960
|
children: [
|
|
3271
|
-
/* @__PURE__ */ (0,
|
|
3961
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "h-2 w-2 rounded-full bg-current" }) }) }),
|
|
3272
3962
|
children
|
|
3273
3963
|
]
|
|
3274
3964
|
}
|
|
3275
3965
|
));
|
|
3276
3966
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
3277
|
-
var DropdownMenuLabel =
|
|
3967
|
+
var DropdownMenuLabel = React18.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3278
3968
|
DropdownMenuPrimitive.Label,
|
|
3279
3969
|
{
|
|
3280
3970
|
ref,
|
|
@@ -3287,7 +3977,7 @@ var DropdownMenuLabel = React11.forwardRef(({ className, inset, ...props }, ref)
|
|
|
3287
3977
|
}
|
|
3288
3978
|
));
|
|
3289
3979
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
3290
|
-
var DropdownMenuSeparator =
|
|
3980
|
+
var DropdownMenuSeparator = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3291
3981
|
DropdownMenuPrimitive.Separator,
|
|
3292
3982
|
{
|
|
3293
3983
|
ref,
|
|
@@ -3300,7 +3990,7 @@ var DropdownMenuShortcut = ({
|
|
|
3300
3990
|
className,
|
|
3301
3991
|
...props
|
|
3302
3992
|
}) => {
|
|
3303
|
-
return /* @__PURE__ */ (0,
|
|
3993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3304
3994
|
"span",
|
|
3305
3995
|
{
|
|
3306
3996
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
@@ -3311,21 +4001,21 @@ var DropdownMenuShortcut = ({
|
|
|
3311
4001
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3312
4002
|
|
|
3313
4003
|
// src/components/ui/charts/chart-legend.tsx
|
|
3314
|
-
var
|
|
4004
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3315
4005
|
function ChartLegend({
|
|
3316
4006
|
items,
|
|
3317
4007
|
x = 0,
|
|
3318
4008
|
y = 550,
|
|
3319
4009
|
className = ""
|
|
3320
4010
|
}) {
|
|
3321
|
-
return /* @__PURE__ */ (0,
|
|
4011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("foreignObject", { x, y, width: "100%", height: "40", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3322
4012
|
"div",
|
|
3323
4013
|
{
|
|
3324
4014
|
className: `flex justify-center items-center gap-6 ${className}`,
|
|
3325
4015
|
style: { height: "100%" },
|
|
3326
|
-
children: items.map(({ key, color, label }) => /* @__PURE__ */ (0,
|
|
3327
|
-
/* @__PURE__ */ (0,
|
|
3328
|
-
/* @__PURE__ */ (0,
|
|
4016
|
+
children: items.map(({ key, color, label }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4017
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "w-3 h-3", style: { backgroundColor: color } }),
|
|
4018
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Typography, { variant: "body-xs", children: label || key })
|
|
3329
4019
|
] }, key))
|
|
3330
4020
|
}
|
|
3331
4021
|
) });
|
|
@@ -3443,12 +4133,12 @@ var formatLargeNumber = (value) => {
|
|
|
3443
4133
|
};
|
|
3444
4134
|
|
|
3445
4135
|
// src/components/ui/charts/chart-labels.tsx
|
|
3446
|
-
var
|
|
4136
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3447
4137
|
var createCustomXAxisLabel = (text, yOffset = 40) => {
|
|
3448
4138
|
const CustomXAxisLabel = ({ viewBox }) => {
|
|
3449
4139
|
if (!viewBox) return null;
|
|
3450
4140
|
const { x, y, width } = viewBox;
|
|
3451
|
-
return /* @__PURE__ */ (0,
|
|
4141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("foreignObject", { x, y: y + yOffset, width, height: 20, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
3452
4142
|
};
|
|
3453
4143
|
CustomXAxisLabel.displayName = "CustomXAxisLabel";
|
|
3454
4144
|
return CustomXAxisLabel;
|
|
@@ -3458,7 +4148,7 @@ var createCustomYAxisLabel = (text, leftMargin) => {
|
|
|
3458
4148
|
if (!viewBox) return null;
|
|
3459
4149
|
const { x, y, height } = viewBox;
|
|
3460
4150
|
const offset = leftMargin ? leftMargin + 10 : 110;
|
|
3461
|
-
return /* @__PURE__ */ (0,
|
|
4151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("foreignObject", { x: x - offset, y, width: 100, height, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex items-center justify-center h-full transform -rotate-90 whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
3462
4152
|
};
|
|
3463
4153
|
CustomYAxisLabel.displayName = "CustomYAxisLabel";
|
|
3464
4154
|
return CustomYAxisLabel;
|
|
@@ -3467,14 +4157,14 @@ var createCustomYAxisRightLabel = (text) => {
|
|
|
3467
4157
|
const CustomYAxisRightLabel = ({ viewBox }) => {
|
|
3468
4158
|
if (!viewBox) return null;
|
|
3469
4159
|
const { x, y, width, height } = viewBox;
|
|
3470
|
-
return /* @__PURE__ */ (0,
|
|
4160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("foreignObject", { x: x + width - 70, y, width: 120, height, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex items-center justify-center h-full transform rotate-90 whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Typography, { variant: "label-xs-bold", className: "text-secondary", children: text }) }) }) });
|
|
3471
4161
|
};
|
|
3472
4162
|
CustomYAxisRightLabel.displayName = "CustomYAxisRightLabel";
|
|
3473
4163
|
return CustomYAxisRightLabel;
|
|
3474
4164
|
};
|
|
3475
4165
|
var customXAxisTick = (props) => {
|
|
3476
4166
|
const { x, y, payload } = props;
|
|
3477
|
-
return /* @__PURE__ */ (0,
|
|
4167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3478
4168
|
"foreignObject",
|
|
3479
4169
|
{
|
|
3480
4170
|
x: -20,
|
|
@@ -3482,12 +4172,12 @@ var customXAxisTick = (props) => {
|
|
|
3482
4172
|
width: 40,
|
|
3483
4173
|
height: 20,
|
|
3484
4174
|
style: { overflow: "visible" },
|
|
3485
|
-
children: /* @__PURE__ */ (0,
|
|
4175
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3486
4176
|
"div",
|
|
3487
4177
|
{
|
|
3488
4178
|
className: "flex items-start justify-center h-full",
|
|
3489
4179
|
style: { overflow: "visible" },
|
|
3490
|
-
children: /* @__PURE__ */ (0,
|
|
4180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3491
4181
|
Typography,
|
|
3492
4182
|
{
|
|
3493
4183
|
variant: "body-xs",
|
|
@@ -3502,7 +4192,7 @@ var customXAxisTick = (props) => {
|
|
|
3502
4192
|
};
|
|
3503
4193
|
var customXAxisTickRotated = (props) => {
|
|
3504
4194
|
const { x, y, payload } = props;
|
|
3505
|
-
return /* @__PURE__ */ (0,
|
|
4195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("g", { transform: `translate(${x},${y})`, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3506
4196
|
"text",
|
|
3507
4197
|
{
|
|
3508
4198
|
x: 0,
|
|
@@ -3521,25 +4211,25 @@ var customYAxisTick = (props) => {
|
|
|
3521
4211
|
const { x, y, payload } = props;
|
|
3522
4212
|
const text = String(payload.value);
|
|
3523
4213
|
const estimatedWidth = Math.max(text.length * 8, 80);
|
|
3524
|
-
return /* @__PURE__ */ (0,
|
|
4214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3525
4215
|
"foreignObject",
|
|
3526
4216
|
{
|
|
3527
4217
|
x: x - estimatedWidth + 5,
|
|
3528
4218
|
y: y - 6,
|
|
3529
4219
|
width: estimatedWidth,
|
|
3530
4220
|
height: 15,
|
|
3531
|
-
children: /* @__PURE__ */ (0,
|
|
4221
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex justify-end w-full", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Typography, { variant: "body-xs", className: "text-secondary", children: payload.value }) })
|
|
3532
4222
|
}
|
|
3533
4223
|
);
|
|
3534
4224
|
};
|
|
3535
4225
|
|
|
3536
4226
|
// src/components/ui/charts/chart-tooltip.tsx
|
|
3537
|
-
var
|
|
4227
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3538
4228
|
function TooltipContainer({
|
|
3539
4229
|
children,
|
|
3540
4230
|
className = ""
|
|
3541
4231
|
}) {
|
|
3542
|
-
return /* @__PURE__ */ (0,
|
|
4232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3543
4233
|
"div",
|
|
3544
4234
|
{
|
|
3545
4235
|
className: `bg-light border border-subtle rounded p-2.5 text-dark ${className}`,
|
|
@@ -3553,10 +4243,10 @@ function TooltipItem({
|
|
|
3553
4243
|
value,
|
|
3554
4244
|
className = ""
|
|
3555
4245
|
}) {
|
|
3556
|
-
return /* @__PURE__ */ (0,
|
|
3557
|
-
/* @__PURE__ */ (0,
|
|
3558
|
-
/* @__PURE__ */ (0,
|
|
3559
|
-
/* @__PURE__ */ (0,
|
|
4246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
4247
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("br", {}),
|
|
4248
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Typography, { variant: "label-sm", className, children: [
|
|
4249
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3560
4250
|
"span",
|
|
3561
4251
|
{
|
|
3562
4252
|
className: "inline-block w-3 h-3 mr-1.5",
|
|
@@ -3574,9 +4264,9 @@ function GenericTooltip({
|
|
|
3574
4264
|
items,
|
|
3575
4265
|
className = ""
|
|
3576
4266
|
}) {
|
|
3577
|
-
return /* @__PURE__ */ (0,
|
|
3578
|
-
title && /* @__PURE__ */ (0,
|
|
3579
|
-
items.map((item, index) => /* @__PURE__ */ (0,
|
|
4267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(TooltipContainer, { className, children: [
|
|
4268
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Typography, { variant: "label-sm-bold", children: title }),
|
|
4269
|
+
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3580
4270
|
TooltipItem,
|
|
3581
4271
|
{
|
|
3582
4272
|
color: item.color,
|
|
@@ -3591,7 +4281,7 @@ function GenericTooltip({
|
|
|
3591
4281
|
// src/components/ui/charts/bar-chart.tsx
|
|
3592
4282
|
var import_react2 = require("react");
|
|
3593
4283
|
var import_recharts = require("recharts");
|
|
3594
|
-
var
|
|
4284
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3595
4285
|
var BarChart = (0, import_react2.forwardRef)(
|
|
3596
4286
|
({
|
|
3597
4287
|
data,
|
|
@@ -3618,19 +4308,19 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3618
4308
|
};
|
|
3619
4309
|
const defaultLegendItems = showLegend && legendItems.length === 0 ? [{ key: yAxisKey, color: barColor, label: yAxisKey }] : legendItems;
|
|
3620
4310
|
const hasData = data && data.length > 0;
|
|
3621
|
-
return /* @__PURE__ */ (0,
|
|
4311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3622
4312
|
"div",
|
|
3623
4313
|
{
|
|
3624
4314
|
ref,
|
|
3625
4315
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3626
4316
|
children: [
|
|
3627
|
-
/* @__PURE__ */ (0,
|
|
3628
|
-
/* @__PURE__ */ (0,
|
|
4317
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
4318
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3629
4319
|
import_recharts.ResponsiveContainer,
|
|
3630
4320
|
{
|
|
3631
4321
|
width: "100%",
|
|
3632
4322
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
3633
|
-
children: /* @__PURE__ */ (0,
|
|
4323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3634
4324
|
import_recharts.BarChart,
|
|
3635
4325
|
{
|
|
3636
4326
|
data,
|
|
@@ -3642,7 +4332,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3642
4332
|
onClick: handleClick,
|
|
3643
4333
|
layout,
|
|
3644
4334
|
children: [
|
|
3645
|
-
/* @__PURE__ */ (0,
|
|
4335
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3646
4336
|
import_recharts.XAxis,
|
|
3647
4337
|
{
|
|
3648
4338
|
dataKey: xAxisKey,
|
|
@@ -3656,7 +4346,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3656
4346
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel, 80) : void 0
|
|
3657
4347
|
}
|
|
3658
4348
|
),
|
|
3659
|
-
/* @__PURE__ */ (0,
|
|
4349
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3660
4350
|
import_recharts.YAxis,
|
|
3661
4351
|
{
|
|
3662
4352
|
axisLine: false,
|
|
@@ -3667,7 +4357,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3667
4357
|
type: yAxisType
|
|
3668
4358
|
}
|
|
3669
4359
|
),
|
|
3670
|
-
/* @__PURE__ */ (0,
|
|
4360
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3671
4361
|
import_recharts.Tooltip,
|
|
3672
4362
|
{
|
|
3673
4363
|
content: ({
|
|
@@ -3676,7 +4366,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3676
4366
|
label
|
|
3677
4367
|
}) => {
|
|
3678
4368
|
if (active && payload && payload.length) {
|
|
3679
|
-
return /* @__PURE__ */ (0,
|
|
4369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3680
4370
|
GenericTooltip,
|
|
3681
4371
|
{
|
|
3682
4372
|
title: label?.toString(),
|
|
@@ -3692,7 +4382,7 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3692
4382
|
}
|
|
3693
4383
|
}
|
|
3694
4384
|
),
|
|
3695
|
-
/* @__PURE__ */ (0,
|
|
4385
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3696
4386
|
import_recharts.Bar,
|
|
3697
4387
|
{
|
|
3698
4388
|
dataKey: barDataKey || yAxisKey,
|
|
@@ -3700,12 +4390,12 @@ var BarChart = (0, import_react2.forwardRef)(
|
|
|
3700
4390
|
name: barDataKey || yAxisKey
|
|
3701
4391
|
}
|
|
3702
4392
|
),
|
|
3703
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
4393
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ChartLegend, { items: defaultLegendItems })
|
|
3704
4394
|
]
|
|
3705
4395
|
}
|
|
3706
4396
|
)
|
|
3707
4397
|
}
|
|
3708
|
-
) : /* @__PURE__ */ (0,
|
|
4398
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
3709
4399
|
]
|
|
3710
4400
|
}
|
|
3711
4401
|
);
|
|
@@ -3716,7 +4406,7 @@ BarChart.displayName = "BarChart";
|
|
|
3716
4406
|
// src/components/ui/charts/line-chart.tsx
|
|
3717
4407
|
var import_react3 = require("react");
|
|
3718
4408
|
var import_recharts2 = require("recharts");
|
|
3719
|
-
var
|
|
4409
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3720
4410
|
var LineChart = (0, import_react3.forwardRef)(
|
|
3721
4411
|
({
|
|
3722
4412
|
data,
|
|
@@ -3745,19 +4435,19 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3745
4435
|
)
|
|
3746
4436
|
);
|
|
3747
4437
|
const hasData = data && data.length > 0;
|
|
3748
|
-
return /* @__PURE__ */ (0,
|
|
4438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3749
4439
|
"div",
|
|
3750
4440
|
{
|
|
3751
4441
|
ref,
|
|
3752
4442
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3753
4443
|
children: [
|
|
3754
|
-
/* @__PURE__ */ (0,
|
|
3755
|
-
/* @__PURE__ */ (0,
|
|
4444
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
4445
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3756
4446
|
import_recharts2.ResponsiveContainer,
|
|
3757
4447
|
{
|
|
3758
4448
|
width: "100%",
|
|
3759
4449
|
height: CHART_CONSTANTS.STANDARD_HEIGHT,
|
|
3760
|
-
children: /* @__PURE__ */ (0,
|
|
4450
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3761
4451
|
import_recharts2.LineChart,
|
|
3762
4452
|
{
|
|
3763
4453
|
data,
|
|
@@ -3768,7 +4458,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3768
4458
|
},
|
|
3769
4459
|
onClick: handleClick,
|
|
3770
4460
|
children: [
|
|
3771
|
-
/* @__PURE__ */ (0,
|
|
4461
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3772
4462
|
import_recharts2.XAxis,
|
|
3773
4463
|
{
|
|
3774
4464
|
dataKey: xAxisKey,
|
|
@@ -3780,7 +4470,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3780
4470
|
label: xAxisLabel ? createCustomXAxisLabel(xAxisLabel) : void 0
|
|
3781
4471
|
}
|
|
3782
4472
|
),
|
|
3783
|
-
/* @__PURE__ */ (0,
|
|
4473
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3784
4474
|
import_recharts2.YAxis,
|
|
3785
4475
|
{
|
|
3786
4476
|
axisLine: false,
|
|
@@ -3789,7 +4479,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3789
4479
|
label: yAxisLabel ? createCustomYAxisLabel(yAxisLabel, 40) : void 0
|
|
3790
4480
|
}
|
|
3791
4481
|
),
|
|
3792
|
-
/* @__PURE__ */ (0,
|
|
4482
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3793
4483
|
import_recharts2.Tooltip,
|
|
3794
4484
|
{
|
|
3795
4485
|
content: ({
|
|
@@ -3798,7 +4488,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3798
4488
|
label
|
|
3799
4489
|
}) => {
|
|
3800
4490
|
if (active && payload && payload.length) {
|
|
3801
|
-
return /* @__PURE__ */ (0,
|
|
4491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3802
4492
|
GenericTooltip,
|
|
3803
4493
|
{
|
|
3804
4494
|
title: label?.toString(),
|
|
@@ -3814,7 +4504,7 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3814
4504
|
}
|
|
3815
4505
|
}
|
|
3816
4506
|
),
|
|
3817
|
-
series.map((s, index) => /* @__PURE__ */ (0,
|
|
4507
|
+
series.map((s, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3818
4508
|
import_recharts2.Line,
|
|
3819
4509
|
{
|
|
3820
4510
|
type: "monotone",
|
|
@@ -3826,12 +4516,12 @@ var LineChart = (0, import_react3.forwardRef)(
|
|
|
3826
4516
|
},
|
|
3827
4517
|
s.dataKey
|
|
3828
4518
|
)),
|
|
3829
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
4519
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChartLegend, { items: defaultLegendItems })
|
|
3830
4520
|
]
|
|
3831
4521
|
}
|
|
3832
4522
|
)
|
|
3833
4523
|
}
|
|
3834
|
-
) : /* @__PURE__ */ (0,
|
|
4524
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
3835
4525
|
]
|
|
3836
4526
|
}
|
|
3837
4527
|
);
|
|
@@ -3842,7 +4532,7 @@ LineChart.displayName = "LineChart";
|
|
|
3842
4532
|
// src/components/ui/charts/pie-chart.tsx
|
|
3843
4533
|
var import_react4 = require("react");
|
|
3844
4534
|
var import_recharts3 = require("recharts");
|
|
3845
|
-
var
|
|
4535
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3846
4536
|
var PieChart = (0, import_react4.forwardRef)(
|
|
3847
4537
|
({
|
|
3848
4538
|
data,
|
|
@@ -3870,20 +4560,20 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
3870
4560
|
)
|
|
3871
4561
|
);
|
|
3872
4562
|
const hasData = data && data.length > 0;
|
|
3873
|
-
return /* @__PURE__ */ (0,
|
|
4563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
3874
4564
|
"div",
|
|
3875
4565
|
{
|
|
3876
4566
|
ref,
|
|
3877
4567
|
className: `bg-light border border-subtle mx-6 ${className}`,
|
|
3878
4568
|
children: [
|
|
3879
|
-
/* @__PURE__ */ (0,
|
|
3880
|
-
/* @__PURE__ */ (0,
|
|
4569
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex items-center justify-between px-3 py-2 border-b border-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Typography, { variant: "label-sm-bold", children: title }) }),
|
|
4570
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "pt-2 px-2", children: hasData ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
3881
4571
|
import_recharts3.PieChart,
|
|
3882
4572
|
{
|
|
3883
4573
|
width: 600,
|
|
3884
4574
|
height: CHART_CONSTANTS.LARGE_HEIGHT,
|
|
3885
4575
|
children: [
|
|
3886
|
-
/* @__PURE__ */ (0,
|
|
4576
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3887
4577
|
import_recharts3.Pie,
|
|
3888
4578
|
{
|
|
3889
4579
|
data,
|
|
@@ -3895,7 +4585,7 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
3895
4585
|
label: showLabels,
|
|
3896
4586
|
labelLine: false,
|
|
3897
4587
|
onClick: handleClick,
|
|
3898
|
-
children: data.map((entry, index) => /* @__PURE__ */ (0,
|
|
4588
|
+
children: data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3899
4589
|
import_recharts3.Cell,
|
|
3900
4590
|
{
|
|
3901
4591
|
fill: entry.color || getSeriesColor(index)
|
|
@@ -3904,7 +4594,7 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
3904
4594
|
))
|
|
3905
4595
|
}
|
|
3906
4596
|
),
|
|
3907
|
-
/* @__PURE__ */ (0,
|
|
4597
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3908
4598
|
import_recharts3.Tooltip,
|
|
3909
4599
|
{
|
|
3910
4600
|
content: ({
|
|
@@ -3913,7 +4603,7 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
3913
4603
|
}) => {
|
|
3914
4604
|
if (active && payload && payload.length && payload[0]) {
|
|
3915
4605
|
const data2 = payload[0].payload;
|
|
3916
|
-
return /* @__PURE__ */ (0,
|
|
4606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3917
4607
|
GenericTooltip,
|
|
3918
4608
|
{
|
|
3919
4609
|
title: data2.name,
|
|
@@ -3931,10 +4621,10 @@ var PieChart = (0, import_react4.forwardRef)(
|
|
|
3931
4621
|
}
|
|
3932
4622
|
}
|
|
3933
4623
|
),
|
|
3934
|
-
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0,
|
|
4624
|
+
showLegend && defaultLegendItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChartLegend, { items: defaultLegendItems, y: 400 })
|
|
3935
4625
|
]
|
|
3936
4626
|
}
|
|
3937
|
-
) }) : /* @__PURE__ */ (0,
|
|
4627
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex items-center justify-center h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Typography, { variant: "body-md", className: "text-secondary", children: "No data is available" }) }) })
|
|
3938
4628
|
]
|
|
3939
4629
|
}
|
|
3940
4630
|
);
|
|
@@ -3945,7 +4635,7 @@ PieChart.displayName = "PieChart";
|
|
|
3945
4635
|
// src/components/ui/table.tsx
|
|
3946
4636
|
var import_react5 = require("react");
|
|
3947
4637
|
var import_react_table = require("@tanstack/react-table");
|
|
3948
|
-
var
|
|
4638
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3949
4639
|
function Table({
|
|
3950
4640
|
table,
|
|
3951
4641
|
className,
|
|
@@ -3975,15 +4665,15 @@ function Table({
|
|
|
3975
4665
|
},
|
|
3976
4666
|
[table]
|
|
3977
4667
|
);
|
|
3978
|
-
return /* @__PURE__ */ (0,
|
|
3979
|
-
/* @__PURE__ */ (0,
|
|
3980
|
-
/* @__PURE__ */ (0,
|
|
4668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
|
|
4669
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cn("overflow-x-auto", className), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("table", { className: "min-w-full divide-y divide-border", children: [
|
|
4670
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("thead", { className: "bg-dark text-light", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("th", { className: "px-6 py-3 text-left", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3981
4671
|
"div",
|
|
3982
4672
|
{
|
|
3983
4673
|
className: `flex items-center space-x-1 ${header.column.getCanSort() ? "cursor-pointer select-none" : ""}`,
|
|
3984
4674
|
onClick: header.column.getToggleSortingHandler(),
|
|
3985
4675
|
children: [
|
|
3986
|
-
/* @__PURE__ */ (0,
|
|
4676
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3987
4677
|
Typography,
|
|
3988
4678
|
{
|
|
3989
4679
|
variant: "label-xs",
|
|
@@ -3994,19 +4684,19 @@ function Table({
|
|
|
3994
4684
|
)
|
|
3995
4685
|
}
|
|
3996
4686
|
),
|
|
3997
|
-
header.column.getCanSort() && /* @__PURE__ */ (0,
|
|
3998
|
-
header.column.getIsSorted() === "asc" && /* @__PURE__ */ (0,
|
|
3999
|
-
header.column.getIsSorted() === "desc" && /* @__PURE__ */ (0,
|
|
4687
|
+
header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "ml-1", children: [
|
|
4688
|
+
header.column.getIsSorted() === "asc" && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronUp, { className: "w-4 h-4 text-light" }),
|
|
4689
|
+
header.column.getIsSorted() === "desc" && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronDown, { className: "w-4 h-4 text-light" })
|
|
4000
4690
|
] })
|
|
4001
4691
|
]
|
|
4002
4692
|
}
|
|
4003
4693
|
) }, header.id)) }, headerGroup.id)) }),
|
|
4004
|
-
/* @__PURE__ */ (0,
|
|
4694
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("tbody", { className: "bg-light divide-y divide-border", children: table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("tr", { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Typography, { variant: "body-sm", children: (0, import_react_table.flexRender)(
|
|
4005
4695
|
cell.column.columnDef.cell,
|
|
4006
4696
|
cell.getContext()
|
|
4007
4697
|
) }) }, cell.id)) }, row.id)) })
|
|
4008
4698
|
] }) }),
|
|
4009
|
-
showPagination && /* @__PURE__ */ (0,
|
|
4699
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4010
4700
|
"div",
|
|
4011
4701
|
{
|
|
4012
4702
|
className: cn(
|
|
@@ -4014,9 +4704,9 @@ function Table({
|
|
|
4014
4704
|
paginationClassName
|
|
4015
4705
|
),
|
|
4016
4706
|
children: [
|
|
4017
|
-
/* @__PURE__ */ (0,
|
|
4018
|
-
/* @__PURE__ */ (0,
|
|
4019
|
-
/* @__PURE__ */ (0,
|
|
4707
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Typography, { variant: "body-sm", className: "text-secondary", children: showingText }) }),
|
|
4708
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
4709
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4020
4710
|
Button,
|
|
4021
4711
|
{
|
|
4022
4712
|
variant: "ghost",
|
|
@@ -4024,7 +4714,7 @@ function Table({
|
|
|
4024
4714
|
onClick: handlePreviousPage,
|
|
4025
4715
|
disabled: !table.getCanPreviousPage(),
|
|
4026
4716
|
className: "p-2",
|
|
4027
|
-
children: /* @__PURE__ */ (0,
|
|
4717
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronLeft, { className: "w-4 h-4" })
|
|
4028
4718
|
}
|
|
4029
4719
|
),
|
|
4030
4720
|
Array.from(
|
|
@@ -4041,7 +4731,7 @@ function Table({
|
|
|
4041
4731
|
pageNumber = currentPage - 2 + i;
|
|
4042
4732
|
}
|
|
4043
4733
|
const isActive = pageNumber === currentPage;
|
|
4044
|
-
return /* @__PURE__ */ (0,
|
|
4734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4045
4735
|
Button,
|
|
4046
4736
|
{
|
|
4047
4737
|
variant: isActive ? "default" : "ghost",
|
|
@@ -4054,11 +4744,11 @@ function Table({
|
|
|
4054
4744
|
);
|
|
4055
4745
|
}
|
|
4056
4746
|
),
|
|
4057
|
-
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */ (0,
|
|
4058
|
-
/* @__PURE__ */ (0,
|
|
4059
|
-
/* @__PURE__ */ (0,
|
|
4747
|
+
table.getPageCount() > 5 && currentPage < totalPages - 3 && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
4748
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "px-1 text-secondary", children: "..." }),
|
|
4749
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Typography, { variant: "body-sm", className: "text-secondary", children: totalPages })
|
|
4060
4750
|
] }),
|
|
4061
|
-
/* @__PURE__ */ (0,
|
|
4751
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4062
4752
|
Button,
|
|
4063
4753
|
{
|
|
4064
4754
|
variant: "ghost",
|
|
@@ -4066,12 +4756,12 @@ function Table({
|
|
|
4066
4756
|
onClick: handleNextPage,
|
|
4067
4757
|
disabled: !table.getCanNextPage(),
|
|
4068
4758
|
className: "p-2",
|
|
4069
|
-
children: /* @__PURE__ */ (0,
|
|
4759
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronRight, { className: "w-4 h-4" })
|
|
4070
4760
|
}
|
|
4071
4761
|
)
|
|
4072
4762
|
] }),
|
|
4073
|
-
/* @__PURE__ */ (0,
|
|
4074
|
-
/* @__PURE__ */ (0,
|
|
4763
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-3 w-48", children: [
|
|
4764
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4075
4765
|
Typography,
|
|
4076
4766
|
{
|
|
4077
4767
|
variant: "body-sm",
|
|
@@ -4079,14 +4769,14 @@ function Table({
|
|
|
4079
4769
|
children: "Rows per page:"
|
|
4080
4770
|
}
|
|
4081
4771
|
),
|
|
4082
|
-
/* @__PURE__ */ (0,
|
|
4772
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4083
4773
|
Select,
|
|
4084
4774
|
{
|
|
4085
4775
|
value: table.getState().pagination.pageSize.toString(),
|
|
4086
4776
|
onValueChange: handlePageSizeChange,
|
|
4087
4777
|
children: [
|
|
4088
|
-
/* @__PURE__ */ (0,
|
|
4089
|
-
/* @__PURE__ */ (0,
|
|
4778
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectTrigger, { className: "min-w-0 h-8", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectValue, {}) }),
|
|
4779
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectContent, { children: [10, 20, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectItem, { value: size.toString(), children: size }, size)) })
|
|
4090
4780
|
]
|
|
4091
4781
|
}
|
|
4092
4782
|
)
|
|
@@ -4133,6 +4823,7 @@ function Table({
|
|
|
4133
4823
|
DatePicker,
|
|
4134
4824
|
Doc,
|
|
4135
4825
|
Dollar,
|
|
4826
|
+
Download,
|
|
4136
4827
|
DropdownMenu,
|
|
4137
4828
|
DropdownMenuCheckboxItem,
|
|
4138
4829
|
DropdownMenuContent,
|
|
@@ -4182,9 +4873,12 @@ function Table({
|
|
|
4182
4873
|
MagnifyingGlass,
|
|
4183
4874
|
Minus,
|
|
4184
4875
|
MoreMenu,
|
|
4876
|
+
Panel,
|
|
4877
|
+
PdfViewer,
|
|
4185
4878
|
Phone,
|
|
4186
4879
|
PieChart,
|
|
4187
4880
|
Plus,
|
|
4881
|
+
Print,
|
|
4188
4882
|
QuestionCircle,
|
|
4189
4883
|
Select,
|
|
4190
4884
|
SelectContent,
|
|
@@ -4198,6 +4892,17 @@ function Table({
|
|
|
4198
4892
|
SelectValue,
|
|
4199
4893
|
Separator,
|
|
4200
4894
|
Share,
|
|
4895
|
+
Sidebar,
|
|
4896
|
+
SidebarContent,
|
|
4897
|
+
SidebarFooter,
|
|
4898
|
+
SidebarGroup,
|
|
4899
|
+
SidebarGroupContent,
|
|
4900
|
+
SidebarHeader,
|
|
4901
|
+
SidebarInset,
|
|
4902
|
+
SidebarMenu,
|
|
4903
|
+
SidebarMenuButton,
|
|
4904
|
+
SidebarMenuItem,
|
|
4905
|
+
SidebarProvider,
|
|
4201
4906
|
Star,
|
|
4202
4907
|
Statement,
|
|
4203
4908
|
Table,
|
|
@@ -4207,8 +4912,12 @@ function Table({
|
|
|
4207
4912
|
TabsList,
|
|
4208
4913
|
TabsTrigger,
|
|
4209
4914
|
Textarea,
|
|
4915
|
+
Tooltip,
|
|
4210
4916
|
TooltipContainer,
|
|
4917
|
+
TooltipContent,
|
|
4211
4918
|
TooltipItem,
|
|
4919
|
+
TooltipProvider,
|
|
4920
|
+
TooltipTrigger,
|
|
4212
4921
|
Trash,
|
|
4213
4922
|
Typography,
|
|
4214
4923
|
Upload,
|
|
@@ -4233,8 +4942,10 @@ function Table({
|
|
|
4233
4942
|
getHeatmapColor,
|
|
4234
4943
|
getPerformanceColor,
|
|
4235
4944
|
getSeriesColor,
|
|
4945
|
+
initializePdfWorker,
|
|
4236
4946
|
selectTriggerVariants,
|
|
4237
4947
|
tabsVariants,
|
|
4238
4948
|
typographyVariants,
|
|
4239
|
-
uploadVariants
|
|
4949
|
+
uploadVariants,
|
|
4950
|
+
useSidebar
|
|
4240
4951
|
});
|