atomos_next_genesis 0.0.6 → 0.0.9
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.cjs +340 -318
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +22 -37
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +8 -30
- package/dist/index.d.ts +8 -30
- package/dist/index.js +308 -285
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39,7 +39,7 @@ __export(app_exports, {
|
|
|
39
39
|
BreadCrumb: () => Breadcrumb_default,
|
|
40
40
|
Button: () => Button_default,
|
|
41
41
|
Callout: () => Callout_default,
|
|
42
|
-
Card: () =>
|
|
42
|
+
Card: () => Card,
|
|
43
43
|
CardAction: () => CardAction,
|
|
44
44
|
CardContent: () => CardContent,
|
|
45
45
|
CardDescription: () => CardDescription,
|
|
@@ -67,9 +67,9 @@ __export(app_exports, {
|
|
|
67
67
|
FileUploadPreview: () => FileUploadPreview_default,
|
|
68
68
|
GlobalNavigation: () => GlobalNavigation_default,
|
|
69
69
|
HelperText: () => HelperText_default,
|
|
70
|
+
ImageUploadControlled: () => ImageUploadControlled,
|
|
70
71
|
Input: () => Input_default,
|
|
71
72
|
Label: () => Label_default,
|
|
72
|
-
ListItem: () => ListItem_default,
|
|
73
73
|
ListPagination: () => ListPagination_default,
|
|
74
74
|
Loading: () => Loading_default,
|
|
75
75
|
Modal: () => Modal,
|
|
@@ -78,7 +78,6 @@ __export(app_exports, {
|
|
|
78
78
|
Pagination: () => Pagination_default,
|
|
79
79
|
ProgressBar: () => Progress_default,
|
|
80
80
|
Radio: () => Radio_default,
|
|
81
|
-
RazorPayFileUpload: () => ImageUploadControlled,
|
|
82
81
|
Sidebar: () => Sidebar_default,
|
|
83
82
|
Skeleton: () => Skeleton_default,
|
|
84
83
|
Slider: () => Slider_default,
|
|
@@ -299,7 +298,8 @@ var Avatar = (0, import_react3.forwardRef)((props, ref) => {
|
|
|
299
298
|
"relative -z-10 ",
|
|
300
299
|
rounded && "rounded-full",
|
|
301
300
|
border && "border border-gray-200",
|
|
302
|
-
disabled && "opacity-50 pointer-events-none select-none"
|
|
301
|
+
disabled && "opacity-50 pointer-events-none select-none",
|
|
302
|
+
onClick && "cursor-pointer"
|
|
303
303
|
),
|
|
304
304
|
style: {
|
|
305
305
|
borderColor,
|
|
@@ -663,7 +663,7 @@ var Callout_default = Callout;
|
|
|
663
663
|
|
|
664
664
|
// app/components/Card.tsx
|
|
665
665
|
var import_react8 = __toESM(require("react"), 1);
|
|
666
|
-
function
|
|
666
|
+
function Card({ children, className }) {
|
|
667
667
|
return /* @__PURE__ */ import_react8.default.createElement("div", { className: cn("bg-white rounded-lg border border-gray-200 shadow-sm", className) }, children);
|
|
668
668
|
}
|
|
669
669
|
var CardHeader = ({ children, className }) => {
|
|
@@ -1008,7 +1008,7 @@ var Input = (0, import_react15.forwardRef)(
|
|
|
1008
1008
|
"div",
|
|
1009
1009
|
{
|
|
1010
1010
|
className: cn(
|
|
1011
|
-
"group flex items-center gap-2 p-3.5 border border-gray-200 rounded-lg bg-white shadow-[0px_1px_2px_0px_#1018280D] hover:bg-gray-50 hover:border-gray-300 focus-within:border-
|
|
1011
|
+
"group flex items-center gap-2 p-3.5 border border-gray-200 rounded-lg bg-white shadow-[0px_1px_2px_0px_#1018280D] hover:bg-gray-50 hover:border-gray-300 focus-within:border-primary-600 focus-within:bg-gray-25 focus-within:hover:bg-gray-50 focus-within:hover:border-primary-600 has-[:disabled]:opacity-30 has-[:disabled]:bg-gray-300 has-[:disabled]:select-none has-[:disabled]:pointer-events-none",
|
|
1012
1012
|
size === "sm" ? "w-[320px] h-10" : size === "lg" ? "w-[313px] h-11" : "w-full h-10",
|
|
1013
1013
|
error && "border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:hover:border-error-500",
|
|
1014
1014
|
className
|
|
@@ -2256,51 +2256,9 @@ var HelperText = ({ children, className, size, error }) => {
|
|
|
2256
2256
|
};
|
|
2257
2257
|
var HelperText_default = HelperText;
|
|
2258
2258
|
|
|
2259
|
-
// app/components/ListItem.tsx
|
|
2260
|
-
var import_link = __toESM(require("next/link"), 1);
|
|
2261
|
-
var import_react30 = __toESM(require("react"), 1);
|
|
2262
|
-
var ListItem = import_react30.default.forwardRef(({ className, title, href, onClick, as = "link", icon }, ref) => {
|
|
2263
|
-
const commonClasses = cn(
|
|
2264
|
-
"px-4 py-[8px] w-full flex items-center gap-2 focus:outline-none focus:ring-2 focus:ring-primary-600 focus-visible:ring-2 rounded",
|
|
2265
|
-
className
|
|
2266
|
-
);
|
|
2267
|
-
if (as === "button") {
|
|
2268
|
-
return /* @__PURE__ */ import_react30.default.createElement(
|
|
2269
|
-
"button",
|
|
2270
|
-
{
|
|
2271
|
-
className: commonClasses,
|
|
2272
|
-
onClick,
|
|
2273
|
-
ref,
|
|
2274
|
-
type: "button",
|
|
2275
|
-
role: "menuitem"
|
|
2276
|
-
},
|
|
2277
|
-
/* @__PURE__ */ import_react30.default.createElement("span", { className: "text-base font-normal" }, title),
|
|
2278
|
-
icon && /* @__PURE__ */ import_react30.default.createElement("span", { className: "flex-shrink-0", "aria-hidden": "true" }, icon)
|
|
2279
|
-
);
|
|
2280
|
-
}
|
|
2281
|
-
return /* @__PURE__ */ import_react30.default.createElement(
|
|
2282
|
-
import_link.default,
|
|
2283
|
-
{
|
|
2284
|
-
href: href ?? "",
|
|
2285
|
-
className: commonClasses,
|
|
2286
|
-
ref,
|
|
2287
|
-
role: "menuitem",
|
|
2288
|
-
onClick: (e) => {
|
|
2289
|
-
if (!href) {
|
|
2290
|
-
e.preventDefault();
|
|
2291
|
-
}
|
|
2292
|
-
}
|
|
2293
|
-
},
|
|
2294
|
-
/* @__PURE__ */ import_react30.default.createElement("span", { className: "text-base font-normal" }, title),
|
|
2295
|
-
icon && /* @__PURE__ */ import_react30.default.createElement("span", { className: "flex-shrink-0", "aria-hidden": "true" }, icon)
|
|
2296
|
-
);
|
|
2297
|
-
});
|
|
2298
|
-
ListItem.displayName = "ListItem";
|
|
2299
|
-
var ListItem_default = ListItem;
|
|
2300
|
-
|
|
2301
2259
|
// app/components/ListPagination.tsx
|
|
2302
|
-
var
|
|
2303
|
-
var
|
|
2260
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
2261
|
+
var import_react31 = require("@remixicon/react");
|
|
2304
2262
|
var ListPagination = ({
|
|
2305
2263
|
count,
|
|
2306
2264
|
page,
|
|
@@ -2309,10 +2267,10 @@ var ListPagination = ({
|
|
|
2309
2267
|
className
|
|
2310
2268
|
}) => {
|
|
2311
2269
|
const totalPages = Math.ceil(count / rowsPerPage);
|
|
2312
|
-
const [expanded, setExpanded] = (0,
|
|
2270
|
+
const [expanded, setExpanded] = (0, import_react30.useState)(false);
|
|
2313
2271
|
const renderPages = () => {
|
|
2314
2272
|
if (totalPages <= 6 || expanded) {
|
|
2315
|
-
return [...Array(totalPages)].map((_, i) => /* @__PURE__ */
|
|
2273
|
+
return [...Array(totalPages)].map((_, i) => /* @__PURE__ */ import_react30.default.createElement(PageBtn, { key: i, i, page, onPageChange }));
|
|
2316
2274
|
}
|
|
2317
2275
|
const start = [0, 1];
|
|
2318
2276
|
const mid = [page - 1, page, page + 1].filter(
|
|
@@ -2321,7 +2279,7 @@ var ListPagination = ({
|
|
|
2321
2279
|
const end = [totalPages - 2, totalPages - 1];
|
|
2322
2280
|
const range = Array.from(/* @__PURE__ */ new Set([...start, ...mid, ...end]));
|
|
2323
2281
|
return range.map(
|
|
2324
|
-
(i, idx) => typeof range[idx - 1] === "number" && i - range[idx - 1] > 1 ? /* @__PURE__ */
|
|
2282
|
+
(i, idx) => typeof range[idx - 1] === "number" && i - range[idx - 1] > 1 ? /* @__PURE__ */ import_react30.default.createElement(
|
|
2325
2283
|
Button_default,
|
|
2326
2284
|
{
|
|
2327
2285
|
key: `dots-${i}`,
|
|
@@ -2330,20 +2288,20 @@ var ListPagination = ({
|
|
|
2330
2288
|
onClick: () => setExpanded(true)
|
|
2331
2289
|
},
|
|
2332
2290
|
"..."
|
|
2333
|
-
) : /* @__PURE__ */
|
|
2291
|
+
) : /* @__PURE__ */ import_react30.default.createElement(PageBtn, { key: i, i, page, onPageChange })
|
|
2334
2292
|
);
|
|
2335
2293
|
};
|
|
2336
|
-
return /* @__PURE__ */
|
|
2294
|
+
return /* @__PURE__ */ import_react30.default.createElement("section", { className: cn("flex items-center gap-1", className) }, /* @__PURE__ */ import_react30.default.createElement(
|
|
2337
2295
|
NavBtn,
|
|
2338
2296
|
{
|
|
2339
|
-
icon: /* @__PURE__ */
|
|
2297
|
+
icon: /* @__PURE__ */ import_react30.default.createElement(import_react31.RiArrowLeftSLine, { size: 22 }),
|
|
2340
2298
|
onClick: () => onPageChange(page - 1),
|
|
2341
2299
|
disabled: page === 0
|
|
2342
2300
|
}
|
|
2343
|
-
), /* @__PURE__ */
|
|
2301
|
+
), /* @__PURE__ */ import_react30.default.createElement("div", { className: "max-w-[90vw] w-max overflow-auto flex items-center gap-2 p-2" }, renderPages()), /* @__PURE__ */ import_react30.default.createElement(
|
|
2344
2302
|
NavBtn,
|
|
2345
2303
|
{
|
|
2346
|
-
icon: /* @__PURE__ */
|
|
2304
|
+
icon: /* @__PURE__ */ import_react30.default.createElement(import_react31.RiArrowRightSLine, { size: 22 }),
|
|
2347
2305
|
onClick: () => onPageChange(page + 1),
|
|
2348
2306
|
disabled: page === totalPages - 1
|
|
2349
2307
|
}
|
|
@@ -2353,7 +2311,7 @@ var PageBtn = ({
|
|
|
2353
2311
|
i,
|
|
2354
2312
|
page,
|
|
2355
2313
|
onPageChange
|
|
2356
|
-
}) => /* @__PURE__ */
|
|
2314
|
+
}) => /* @__PURE__ */ import_react30.default.createElement(
|
|
2357
2315
|
Button_default,
|
|
2358
2316
|
{
|
|
2359
2317
|
size: "sm",
|
|
@@ -2369,7 +2327,7 @@ var NavBtn = ({
|
|
|
2369
2327
|
icon,
|
|
2370
2328
|
onClick,
|
|
2371
2329
|
disabled
|
|
2372
|
-
}) => /* @__PURE__ */
|
|
2330
|
+
}) => /* @__PURE__ */ import_react30.default.createElement(
|
|
2373
2331
|
Button_default,
|
|
2374
2332
|
{
|
|
2375
2333
|
size: "sm",
|
|
@@ -2383,9 +2341,9 @@ var NavBtn = ({
|
|
|
2383
2341
|
var ListPagination_default = ListPagination;
|
|
2384
2342
|
|
|
2385
2343
|
// app/components/Loading.tsx
|
|
2386
|
-
var
|
|
2344
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
2387
2345
|
var Loading = ({ width, height, loaderColor, variant }) => {
|
|
2388
|
-
return /* @__PURE__ */
|
|
2346
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
2389
2347
|
"div",
|
|
2390
2348
|
{
|
|
2391
2349
|
className: cn(
|
|
@@ -2404,8 +2362,8 @@ var Loading = ({ width, height, loaderColor, variant }) => {
|
|
|
2404
2362
|
var Loading_default = Loading;
|
|
2405
2363
|
|
|
2406
2364
|
// app/components/Modal.tsx
|
|
2407
|
-
var
|
|
2408
|
-
var
|
|
2365
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
2366
|
+
var import_react34 = require("@remixicon/react");
|
|
2409
2367
|
function Modal({
|
|
2410
2368
|
children,
|
|
2411
2369
|
showModal,
|
|
@@ -2415,7 +2373,7 @@ function Modal({
|
|
|
2415
2373
|
className = "",
|
|
2416
2374
|
width = "50%"
|
|
2417
2375
|
}) {
|
|
2418
|
-
(0,
|
|
2376
|
+
(0, import_react33.useEffect)(() => {
|
|
2419
2377
|
if (showModal) {
|
|
2420
2378
|
document.body.style.overflow = "hidden";
|
|
2421
2379
|
} else {
|
|
@@ -2430,13 +2388,13 @@ function Modal({
|
|
|
2430
2388
|
setShowModal(false);
|
|
2431
2389
|
}
|
|
2432
2390
|
};
|
|
2433
|
-
return /* @__PURE__ */
|
|
2391
|
+
return /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, showModal && /* @__PURE__ */ import_react33.default.createElement(
|
|
2434
2392
|
"div",
|
|
2435
2393
|
{
|
|
2436
2394
|
onClick: handleClickOutside,
|
|
2437
2395
|
className: "w-full h-full bg-backdrop bg-blend-overlay fixed top-0 bottom-0 left-0 right-0 flex justify-center items-center z-[1000000] overflow-hidden"
|
|
2438
2396
|
},
|
|
2439
|
-
/* @__PURE__ */
|
|
2397
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
2440
2398
|
"div",
|
|
2441
2399
|
{
|
|
2442
2400
|
style: { width },
|
|
@@ -2445,14 +2403,14 @@ function Modal({
|
|
|
2445
2403
|
className
|
|
2446
2404
|
)
|
|
2447
2405
|
},
|
|
2448
|
-
/* @__PURE__ */
|
|
2449
|
-
closeModal && /* @__PURE__ */
|
|
2406
|
+
/* @__PURE__ */ import_react33.default.createElement("div", null, children),
|
|
2407
|
+
closeModal && /* @__PURE__ */ import_react33.default.createElement(
|
|
2450
2408
|
"div",
|
|
2451
2409
|
{
|
|
2452
2410
|
className: "absolute top-4 ml-5 right-5 z-10 shadow-backdrop rounded-md cursor-pointer hover:bg-gray-100",
|
|
2453
2411
|
onClick: () => setShowModal(false)
|
|
2454
2412
|
},
|
|
2455
|
-
/* @__PURE__ */
|
|
2413
|
+
/* @__PURE__ */ import_react33.default.createElement(import_react34.RiCloseLine, { size: 24 })
|
|
2456
2414
|
)
|
|
2457
2415
|
)
|
|
2458
2416
|
));
|
|
@@ -2460,20 +2418,20 @@ function Modal({
|
|
|
2460
2418
|
|
|
2461
2419
|
// app/components/Notice.tsx
|
|
2462
2420
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
2463
|
-
var
|
|
2464
|
-
var
|
|
2421
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
2422
|
+
var import_react36 = require("@remixicon/react");
|
|
2465
2423
|
var VariantIcon = ({ variant }) => {
|
|
2466
2424
|
switch (variant) {
|
|
2467
2425
|
case "success":
|
|
2468
|
-
return /* @__PURE__ */
|
|
2426
|
+
return /* @__PURE__ */ import_react35.default.createElement("span", null, /* @__PURE__ */ import_react35.default.createElement(import_react36.RiThumbUpLine, { size: 20, color: "#039855" }));
|
|
2469
2427
|
case "warning":
|
|
2470
|
-
return /* @__PURE__ */
|
|
2428
|
+
return /* @__PURE__ */ import_react35.default.createElement("span", null, /* @__PURE__ */ import_react35.default.createElement(import_react36.RiQuestionLine, { color: "#F79009", size: 20 }));
|
|
2471
2429
|
case "info":
|
|
2472
|
-
return /* @__PURE__ */
|
|
2430
|
+
return /* @__PURE__ */ import_react35.default.createElement("span", null, /* @__PURE__ */ import_react35.default.createElement(import_react36.RiErrorWarningLine, { color: "#1570EF", size: 20 }));
|
|
2473
2431
|
case "error":
|
|
2474
|
-
return /* @__PURE__ */
|
|
2432
|
+
return /* @__PURE__ */ import_react35.default.createElement("span", null, /* @__PURE__ */ import_react35.default.createElement(import_react36.RiAlertFill, { color: "#F04438", size: 20 }));
|
|
2475
2433
|
default:
|
|
2476
|
-
return /* @__PURE__ */
|
|
2434
|
+
return /* @__PURE__ */ import_react35.default.createElement("span", null, /* @__PURE__ */ import_react35.default.createElement(import_react36.RiShieldCheckLine, { color: "#475467", size: 20 }));
|
|
2477
2435
|
}
|
|
2478
2436
|
};
|
|
2479
2437
|
var noticeVariants = (0, import_class_variance_authority6.cva)("p-4 w-fit rounded-[6px]", {
|
|
@@ -2502,7 +2460,7 @@ var Notice = ({
|
|
|
2502
2460
|
showIcon = true
|
|
2503
2461
|
}) => {
|
|
2504
2462
|
const handleClose = () => setOpen(false);
|
|
2505
|
-
return /* @__PURE__ */
|
|
2463
|
+
return /* @__PURE__ */ import_react35.default.createElement(import_react35.default.Fragment, null, open && /* @__PURE__ */ import_react35.default.createElement(
|
|
2506
2464
|
"div",
|
|
2507
2465
|
{
|
|
2508
2466
|
className: cn(
|
|
@@ -2513,34 +2471,34 @@ var Notice = ({
|
|
|
2513
2471
|
position === "center" && open && `animate-fade-in`
|
|
2514
2472
|
)
|
|
2515
2473
|
},
|
|
2516
|
-
/* @__PURE__ */
|
|
2474
|
+
/* @__PURE__ */ import_react35.default.createElement("div", { className: "relative" }, showIcon ? noticeTitle == "" ? /* @__PURE__ */ import_react35.default.createElement("div", { className: "flex items-start" }, /* @__PURE__ */ import_react35.default.createElement(VariantIcon, { variant }), /* @__PURE__ */ import_react35.default.createElement("span", { className: "ml-2 mr-8 text-text-sm" }, children), /* @__PURE__ */ import_react35.default.createElement("span", { onClick: handleClose }, /* @__PURE__ */ import_react35.default.createElement(import_react36.RiCloseLine, { size: 20 }))) : /* @__PURE__ */ import_react35.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react35.default.createElement("section", { className: "flex items-start" }, /* @__PURE__ */ import_react35.default.createElement(VariantIcon, { variant }), /* @__PURE__ */ import_react35.default.createElement("div", { className: "ml-2 mr-8 -mt-[3px]" }, /* @__PURE__ */ import_react35.default.createElement("span", { className: "font-bold text-gray-800 mb-1" }, noticeTitle), /* @__PURE__ */ import_react35.default.createElement("p", { className: "text-text-sm text-gray-700" }, children))), /* @__PURE__ */ import_react35.default.createElement(
|
|
2517
2475
|
"span",
|
|
2518
2476
|
{
|
|
2519
2477
|
className: cn("absolute top-0 right-0 cursor-pointer"),
|
|
2520
2478
|
onClick: handleClose
|
|
2521
2479
|
},
|
|
2522
|
-
/* @__PURE__ */
|
|
2523
|
-
)) : /* @__PURE__ */
|
|
2480
|
+
/* @__PURE__ */ import_react35.default.createElement(import_react36.RiCloseLine, { size: 20 })
|
|
2481
|
+
)) : /* @__PURE__ */ import_react35.default.createElement("div", { className: "mr-8" }, /* @__PURE__ */ import_react35.default.createElement("section", { className: "flex items-center" }, /* @__PURE__ */ import_react35.default.createElement("p", { className: "font-bold text-gray-800 mb-1" }, noticeTitle)), /* @__PURE__ */ import_react35.default.createElement(
|
|
2524
2482
|
"span",
|
|
2525
2483
|
{
|
|
2526
2484
|
className: cn("absolute top-0 right-0 cursor-pointer"),
|
|
2527
2485
|
onClick: handleClose
|
|
2528
2486
|
},
|
|
2529
|
-
/* @__PURE__ */
|
|
2530
|
-
), /* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ import_react35.default.createElement(import_react36.RiCloseLine, { size: 20 })
|
|
2488
|
+
), /* @__PURE__ */ import_react35.default.createElement("p", { className: "text-text-sm" }, children)))
|
|
2531
2489
|
));
|
|
2532
2490
|
};
|
|
2533
2491
|
var Notice_default = Notice;
|
|
2534
2492
|
|
|
2535
2493
|
// app/components/OTPInput.tsx
|
|
2536
|
-
var
|
|
2494
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
2537
2495
|
var OTPInput = ({
|
|
2538
2496
|
length,
|
|
2539
2497
|
onChange,
|
|
2540
2498
|
type = "text"
|
|
2541
2499
|
}) => {
|
|
2542
|
-
const [otpValues, setOtpValues] = (0,
|
|
2543
|
-
const inputsRef = (0,
|
|
2500
|
+
const [otpValues, setOtpValues] = (0, import_react37.useState)(Array(length).fill(""));
|
|
2501
|
+
const inputsRef = (0, import_react37.useRef)([]);
|
|
2544
2502
|
const handleChange = (e, idx) => {
|
|
2545
2503
|
var _a;
|
|
2546
2504
|
let value = e.target.value;
|
|
@@ -2579,7 +2537,7 @@ var OTPInput = ({
|
|
|
2579
2537
|
onChange(newOtp.join(""));
|
|
2580
2538
|
(_a = inputsRef.current[Math.min(pasteData.length, length - 1)]) == null ? void 0 : _a.focus();
|
|
2581
2539
|
};
|
|
2582
|
-
return /* @__PURE__ */
|
|
2540
|
+
return /* @__PURE__ */ import_react37.default.createElement("div", { className: "flex items-center gap-2" }, Array.from({ length }).map((_, idx) => /* @__PURE__ */ import_react37.default.createElement(
|
|
2583
2541
|
Input_default,
|
|
2584
2542
|
{
|
|
2585
2543
|
key: idx,
|
|
@@ -2600,8 +2558,8 @@ var OTPInput = ({
|
|
|
2600
2558
|
var OTPInput_default = OTPInput;
|
|
2601
2559
|
|
|
2602
2560
|
// app/components/Pagination.tsx
|
|
2603
|
-
var
|
|
2604
|
-
var
|
|
2561
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
2562
|
+
var import_react39 = require("@remixicon/react");
|
|
2605
2563
|
var Pagination = ({
|
|
2606
2564
|
count,
|
|
2607
2565
|
page,
|
|
@@ -2621,7 +2579,7 @@ var Pagination = ({
|
|
|
2621
2579
|
const handleNextPageClick = () => {
|
|
2622
2580
|
onPageChange(page + 1);
|
|
2623
2581
|
};
|
|
2624
|
-
const [showOptions, setShowOptions] = (0,
|
|
2582
|
+
const [showOptions, setShowOptions] = (0, import_react38.useState)(false);
|
|
2625
2583
|
const handleOptionClick = (option) => {
|
|
2626
2584
|
if (typeof option === "number") {
|
|
2627
2585
|
onRowsPerPageChange(option);
|
|
@@ -2630,7 +2588,7 @@ var Pagination = ({
|
|
|
2630
2588
|
}
|
|
2631
2589
|
setShowOptions(false);
|
|
2632
2590
|
};
|
|
2633
|
-
return /* @__PURE__ */
|
|
2591
|
+
return /* @__PURE__ */ import_react38.default.createElement(
|
|
2634
2592
|
"div",
|
|
2635
2593
|
{
|
|
2636
2594
|
className: cn(
|
|
@@ -2639,7 +2597,7 @@ var Pagination = ({
|
|
|
2639
2597
|
className
|
|
2640
2598
|
)
|
|
2641
2599
|
},
|
|
2642
|
-
/* @__PURE__ */
|
|
2600
|
+
/* @__PURE__ */ import_react38.default.createElement("section", { className: "flex gap-1.5 items-center" }, countVariable && /* @__PURE__ */ import_react38.default.createElement("p", { className: "text-text-sm text-gray-800 font-medium" }, count, " ", countVariable ?? "Items"), itemsPerPage && /* @__PURE__ */ import_react38.default.createElement("div", { className: "flex gap-1.5 items-center" }, /* @__PURE__ */ import_react38.default.createElement("span", { className: "text-gray-800 text-text-sm font-medium" }, "Items per page"), /* @__PURE__ */ import_react38.default.createElement("div", { className: "relative z-[100]" }, /* @__PURE__ */ import_react38.default.createElement(
|
|
2643
2601
|
"div",
|
|
2644
2602
|
{
|
|
2645
2603
|
className: "border border-gray-600 w-[88px] rounded text-sm px-1.5 py-1 cursor-pointer flex items-center justify-between gap-1 text-gray-600",
|
|
@@ -2647,8 +2605,8 @@ var Pagination = ({
|
|
|
2647
2605
|
},
|
|
2648
2606
|
rowsPerPage,
|
|
2649
2607
|
" ",
|
|
2650
|
-
!showOptions ? /* @__PURE__ */
|
|
2651
|
-
), showOptions && /* @__PURE__ */
|
|
2608
|
+
!showOptions ? /* @__PURE__ */ import_react38.default.createElement(import_react39.RiArrowDownSLine, { size: 14 }) : /* @__PURE__ */ import_react38.default.createElement(import_react39.RiArrowUpSLine, { size: 14 })
|
|
2609
|
+
), showOptions && /* @__PURE__ */ import_react38.default.createElement("div", { className: "absolute top-full left-0 shadow bg-white rounded-md text-sm mt-1 z-50" }, rowsPerPageOptions == null ? void 0 : rowsPerPageOptions.map((option, index) => /* @__PURE__ */ import_react38.default.createElement(
|
|
2652
2610
|
"div",
|
|
2653
2611
|
{
|
|
2654
2612
|
key: index,
|
|
@@ -2657,36 +2615,36 @@ var Pagination = ({
|
|
|
2657
2615
|
},
|
|
2658
2616
|
typeof option === "number" ? option : option.label
|
|
2659
2617
|
)))))),
|
|
2660
|
-
/* @__PURE__ */
|
|
2618
|
+
/* @__PURE__ */ import_react38.default.createElement("section", { className: "flex items-center gap-2 font-medium" }, variant === "primary" ? /* @__PURE__ */ import_react38.default.createElement("div", { className: "flex items-center gap-2 text-gray-800 text-text-sm" }, /* @__PURE__ */ import_react38.default.createElement("span", null, "page"), /* @__PURE__ */ import_react38.default.createElement(
|
|
2661
2619
|
"select",
|
|
2662
2620
|
{
|
|
2663
2621
|
value: page + 1,
|
|
2664
2622
|
onChange: (e) => onPageChange(parseInt(e.target.value, 10) - 1),
|
|
2665
2623
|
className: "bg-gray-25 text-gray-500 px-3.5 py-1 border border-gray-200 rounded-md text-sm focus:outline-none focus:border-gray-600"
|
|
2666
2624
|
},
|
|
2667
|
-
totalPages > 0 && [...Array(totalPages)].map((_, index) => /* @__PURE__ */
|
|
2668
|
-
), /* @__PURE__ */
|
|
2625
|
+
totalPages > 0 && [...Array(totalPages)].map((_, index) => /* @__PURE__ */ import_react38.default.createElement("option", { key: index + 1, value: index + 1 }, index + 1))
|
|
2626
|
+
), /* @__PURE__ */ import_react38.default.createElement("span", null, "of ", totalPages > 0 ? totalPages : 0)) : /* @__PURE__ */ import_react38.default.createElement("div", { className: "flex items-center gap-2 text-gray-800 text-text-sm mx-3" }, /* @__PURE__ */ import_react38.default.createElement("span", null, page + 1, " of ", totalPages > 0 ? totalPages : 0)), variant === "primary" ? /* @__PURE__ */ import_react38.default.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ import_react38.default.createElement(
|
|
2669
2627
|
Button_default,
|
|
2670
2628
|
{
|
|
2671
2629
|
variant: "outlined",
|
|
2672
2630
|
intent: "default-outlined",
|
|
2673
|
-
startIcon: /* @__PURE__ */
|
|
2631
|
+
startIcon: /* @__PURE__ */ import_react38.default.createElement(import_react39.RiArrowLeftLine, { size: 20 }),
|
|
2674
2632
|
onClick: handlePrevPageClick,
|
|
2675
2633
|
disabled: page === 0,
|
|
2676
2634
|
className: "rounded-none h-8 rounded-l-lg"
|
|
2677
2635
|
}
|
|
2678
|
-
), /* @__PURE__ */
|
|
2636
|
+
), /* @__PURE__ */ import_react38.default.createElement(
|
|
2679
2637
|
Button_default,
|
|
2680
2638
|
{
|
|
2681
2639
|
variant: "outlined",
|
|
2682
2640
|
intent: "default-outlined",
|
|
2683
|
-
startIcon: /* @__PURE__ */
|
|
2641
|
+
startIcon: /* @__PURE__ */ import_react38.default.createElement(import_react39.RiArrowRightLine, { size: 20 }),
|
|
2684
2642
|
onClick: handleNextPageClick,
|
|
2685
2643
|
disabled: page === totalPages - 1,
|
|
2686
2644
|
className: "rounded-none h-8 rounded-r-lg"
|
|
2687
2645
|
}
|
|
2688
|
-
)) : /* @__PURE__ */
|
|
2689
|
-
|
|
2646
|
+
)) : /* @__PURE__ */ import_react38.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react38.default.createElement(
|
|
2647
|
+
import_react39.RiArrowLeftSLine,
|
|
2690
2648
|
{
|
|
2691
2649
|
size: 22,
|
|
2692
2650
|
cursor: "pointer",
|
|
@@ -2695,8 +2653,8 @@ var Pagination = ({
|
|
|
2695
2653
|
page === 0 && "pointer-events-none select-none opacity-30"
|
|
2696
2654
|
)
|
|
2697
2655
|
}
|
|
2698
|
-
), /* @__PURE__ */
|
|
2699
|
-
|
|
2656
|
+
), /* @__PURE__ */ import_react38.default.createElement(
|
|
2657
|
+
import_react39.RiArrowRightSLine,
|
|
2700
2658
|
{
|
|
2701
2659
|
size: 22,
|
|
2702
2660
|
cursor: "pointer",
|
|
@@ -2711,7 +2669,7 @@ var Pagination = ({
|
|
|
2711
2669
|
var Pagination_default = Pagination;
|
|
2712
2670
|
|
|
2713
2671
|
// app/components/Progress.tsx
|
|
2714
|
-
var
|
|
2672
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
2715
2673
|
var ProgressBar = ({
|
|
2716
2674
|
progress,
|
|
2717
2675
|
progressText = "",
|
|
@@ -2719,7 +2677,7 @@ var ProgressBar = ({
|
|
|
2719
2677
|
progressTextPosition
|
|
2720
2678
|
}) => {
|
|
2721
2679
|
const _progress = Math == null ? void 0 : Math.min(Math == null ? void 0 : Math.max(0, progress), 100);
|
|
2722
|
-
return /* @__PURE__ */
|
|
2680
|
+
return /* @__PURE__ */ import_react40.default.createElement(
|
|
2723
2681
|
"div",
|
|
2724
2682
|
{
|
|
2725
2683
|
className: cn(
|
|
@@ -2727,7 +2685,7 @@ var ProgressBar = ({
|
|
|
2727
2685
|
progressTextPosition === "right" ? "flex items-center gap-1" : progressTextPosition === "left" ? "flex items-center gap-1" : ""
|
|
2728
2686
|
)
|
|
2729
2687
|
},
|
|
2730
|
-
/* @__PURE__ */
|
|
2688
|
+
/* @__PURE__ */ import_react40.default.createElement(
|
|
2731
2689
|
"span",
|
|
2732
2690
|
{
|
|
2733
2691
|
className: cn(
|
|
@@ -2737,7 +2695,7 @@ var ProgressBar = ({
|
|
|
2737
2695
|
},
|
|
2738
2696
|
progressText
|
|
2739
2697
|
),
|
|
2740
|
-
/* @__PURE__ */
|
|
2698
|
+
/* @__PURE__ */ import_react40.default.createElement(
|
|
2741
2699
|
"div",
|
|
2742
2700
|
{
|
|
2743
2701
|
className: "w-full h-2 rounded bg-gray-200",
|
|
@@ -2746,7 +2704,7 @@ var ProgressBar = ({
|
|
|
2746
2704
|
"aria-valuemin": 0,
|
|
2747
2705
|
"aria-valuemax": 100
|
|
2748
2706
|
},
|
|
2749
|
-
/* @__PURE__ */
|
|
2707
|
+
/* @__PURE__ */ import_react40.default.createElement(
|
|
2750
2708
|
"div",
|
|
2751
2709
|
{
|
|
2752
2710
|
className: `${progressColor} h-full transition-all delay-100 duration-300 rounded ease-in`,
|
|
@@ -2754,7 +2712,7 @@ var ProgressBar = ({
|
|
|
2754
2712
|
}
|
|
2755
2713
|
)
|
|
2756
2714
|
),
|
|
2757
|
-
/* @__PURE__ */
|
|
2715
|
+
/* @__PURE__ */ import_react40.default.createElement(
|
|
2758
2716
|
"span",
|
|
2759
2717
|
{
|
|
2760
2718
|
className: cn(
|
|
@@ -2769,7 +2727,7 @@ var ProgressBar = ({
|
|
|
2769
2727
|
var Progress_default = ProgressBar;
|
|
2770
2728
|
|
|
2771
2729
|
// app/components/Radio.tsx
|
|
2772
|
-
var
|
|
2730
|
+
var import_react41 = __toESM(require("react"), 1);
|
|
2773
2731
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
2774
2732
|
var radioVariants = (0, import_class_variance_authority7.cva)("", {
|
|
2775
2733
|
variants: {
|
|
@@ -2782,9 +2740,9 @@ var radioVariants = (0, import_class_variance_authority7.cva)("", {
|
|
|
2782
2740
|
size: "sm"
|
|
2783
2741
|
}
|
|
2784
2742
|
});
|
|
2785
|
-
var Radio = (0,
|
|
2743
|
+
var Radio = (0, import_react41.forwardRef)(
|
|
2786
2744
|
({ size, disabled, checked, className, children, id, name, ...props }, ref) => {
|
|
2787
|
-
return /* @__PURE__ */
|
|
2745
|
+
return /* @__PURE__ */ import_react41.default.createElement("div", { className: "relative inline-flex items-center cursor-pointer" }, /* @__PURE__ */ import_react41.default.createElement(
|
|
2788
2746
|
"input",
|
|
2789
2747
|
{
|
|
2790
2748
|
...props,
|
|
@@ -2801,7 +2759,7 @@ var Radio = (0, import_react42.forwardRef)(
|
|
|
2801
2759
|
radioVariants({ size, className })
|
|
2802
2760
|
)
|
|
2803
2761
|
}
|
|
2804
|
-
), /* @__PURE__ */
|
|
2762
|
+
), /* @__PURE__ */ import_react41.default.createElement(
|
|
2805
2763
|
"span",
|
|
2806
2764
|
{
|
|
2807
2765
|
"aria-hidden": "true",
|
|
@@ -2817,11 +2775,11 @@ Radio.displayName = "Radio";
|
|
|
2817
2775
|
var Radio_default = Radio;
|
|
2818
2776
|
|
|
2819
2777
|
// app/components/RazorPayFileUpload.tsx
|
|
2820
|
-
var
|
|
2821
|
-
var
|
|
2778
|
+
var import_react43 = __toESM(require("react"), 1);
|
|
2779
|
+
var import_react44 = require("@remixicon/react");
|
|
2822
2780
|
|
|
2823
2781
|
// app/components/Spinner.tsx
|
|
2824
|
-
var
|
|
2782
|
+
var import_react42 = __toESM(require("react"), 1);
|
|
2825
2783
|
var colorVars = {
|
|
2826
2784
|
primary: {
|
|
2827
2785
|
c1: "var(--primary-500)",
|
|
@@ -2856,7 +2814,7 @@ var Spinner = ({ size = "md", color = "primary" }) => {
|
|
|
2856
2814
|
return colorVars.primary;
|
|
2857
2815
|
};
|
|
2858
2816
|
const colorValues = getColorValues(color);
|
|
2859
|
-
return /* @__PURE__ */
|
|
2817
|
+
return /* @__PURE__ */ import_react42.default.createElement("div", { className: cn("relative", sizeClass) }, /* @__PURE__ */ import_react42.default.createElement(
|
|
2860
2818
|
"div",
|
|
2861
2819
|
{
|
|
2862
2820
|
className: "spinner",
|
|
@@ -2870,35 +2828,109 @@ var Spinner = ({ size = "md", color = "primary" }) => {
|
|
|
2870
2828
|
var Spinner_default = Spinner;
|
|
2871
2829
|
|
|
2872
2830
|
// app/components/RazorPayFileUpload.tsx
|
|
2873
|
-
var
|
|
2831
|
+
var fileSvg = () => {
|
|
2832
|
+
return /* @__PURE__ */ import_react43.default.createElement(
|
|
2833
|
+
"svg",
|
|
2834
|
+
{
|
|
2835
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2836
|
+
width: "40",
|
|
2837
|
+
height: "55",
|
|
2838
|
+
viewBox: "0 0 36 47",
|
|
2839
|
+
fill: "none"
|
|
2840
|
+
},
|
|
2841
|
+
/* @__PURE__ */ import_react43.default.createElement(
|
|
2842
|
+
"path",
|
|
2843
|
+
{
|
|
2844
|
+
d: "M0 8.72494C0 5.48487 2.6266 2.85828 5.86667 2.85828H20.5333L33 15.8583V40.9916C33 44.2317 30.3734 46.8583 27.1333 46.8583H5.86667C2.6266 46.8583 0 44.2317 0 40.9916V8.72494Z",
|
|
2845
|
+
fill: "var(--primary-600)"
|
|
2846
|
+
}
|
|
2847
|
+
),
|
|
2848
|
+
/* @__PURE__ */ import_react43.default.createElement("g", { filter: "url(#filter0_d_5101_541)" }, /* @__PURE__ */ import_react43.default.createElement(
|
|
2849
|
+
"path",
|
|
2850
|
+
{
|
|
2851
|
+
d: "M20.5334 13.4052V2.85828L33 15.8582L22.974 15.8482C21.6257 15.8469 20.5334 14.7535 20.5334 13.4052Z",
|
|
2852
|
+
fill: "var(--primary-300)"
|
|
2853
|
+
}
|
|
2854
|
+
)),
|
|
2855
|
+
/* @__PURE__ */ import_react43.default.createElement("defs", null, /* @__PURE__ */ import_react43.default.createElement(
|
|
2856
|
+
"filter",
|
|
2857
|
+
{
|
|
2858
|
+
id: "filter0_d_5101_541",
|
|
2859
|
+
x: "14.7435",
|
|
2860
|
+
y: "-2.98023e-05",
|
|
2861
|
+
width: "21.1148",
|
|
2862
|
+
height: "21.6482",
|
|
2863
|
+
filterUnits: "userSpaceOnUse",
|
|
2864
|
+
"color-interpolation-filters": "sRGB"
|
|
2865
|
+
},
|
|
2866
|
+
/* @__PURE__ */ import_react43.default.createElement("feFlood", { "flood-opacity": "0", result: "BackgroundImageFix" }),
|
|
2867
|
+
/* @__PURE__ */ import_react43.default.createElement(
|
|
2868
|
+
"feColorMatrix",
|
|
2869
|
+
{
|
|
2870
|
+
in: "SourceAlpha",
|
|
2871
|
+
type: "matrix",
|
|
2872
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
|
|
2873
|
+
result: "hardAlpha"
|
|
2874
|
+
}
|
|
2875
|
+
),
|
|
2876
|
+
/* @__PURE__ */ import_react43.default.createElement("feOffset", { dx: "-1.4658", dy: "1.4658" }),
|
|
2877
|
+
/* @__PURE__ */ import_react43.default.createElement("feGaussianBlur", { stdDeviation: "2.16205" }),
|
|
2878
|
+
/* @__PURE__ */ import_react43.default.createElement("feComposite", { in2: "hardAlpha", operator: "out" }),
|
|
2879
|
+
/* @__PURE__ */ import_react43.default.createElement(
|
|
2880
|
+
"feColorMatrix",
|
|
2881
|
+
{
|
|
2882
|
+
type: "matrix",
|
|
2883
|
+
values: "0 0 0 0 0.0417487 0 0 0 0 0.107741 0 0 0 0 0.401705 0 0 0 0.07 0"
|
|
2884
|
+
}
|
|
2885
|
+
),
|
|
2886
|
+
/* @__PURE__ */ import_react43.default.createElement(
|
|
2887
|
+
"feBlend",
|
|
2888
|
+
{
|
|
2889
|
+
mode: "normal",
|
|
2890
|
+
in2: "BackgroundImageFix",
|
|
2891
|
+
result: "effect1_dropShadow_5101_541"
|
|
2892
|
+
}
|
|
2893
|
+
),
|
|
2894
|
+
/* @__PURE__ */ import_react43.default.createElement(
|
|
2895
|
+
"feBlend",
|
|
2896
|
+
{
|
|
2897
|
+
mode: "normal",
|
|
2898
|
+
in: "SourceGraphic",
|
|
2899
|
+
in2: "effect1_dropShadow_5101_541",
|
|
2900
|
+
result: "shape"
|
|
2901
|
+
}
|
|
2902
|
+
)
|
|
2903
|
+
))
|
|
2904
|
+
);
|
|
2905
|
+
};
|
|
2874
2906
|
var defaultGetFileIcon = (fileName, fileType) => {
|
|
2875
2907
|
var _a;
|
|
2876
2908
|
const extension = ((_a = fileName.split(".").pop()) == null ? void 0 : _a.toLowerCase()) || "";
|
|
2877
2909
|
if (fileType.startsWith("image/") || ["jpg", "jpeg", "png", "gif", "svg", "webp", "bmp"].includes(extension)) {
|
|
2878
|
-
return /* @__PURE__ */
|
|
2910
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_react44.RiImageLine, { className: "w-5 h-5 text-white" });
|
|
2879
2911
|
}
|
|
2880
2912
|
if (fileType.startsWith("audio/") || ["mp3", "wav", "ogg", "m4a"].includes(extension)) {
|
|
2881
|
-
return /* @__PURE__ */
|
|
2913
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_react44.RiMusic2Line, { className: "w-5 h-5 text-white" });
|
|
2882
2914
|
}
|
|
2883
2915
|
if (fileType.startsWith("video/") || ["mp4", "avi", "mkv", "mov", "wmv"].includes(extension)) {
|
|
2884
|
-
return /* @__PURE__ */
|
|
2916
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_react44.RiVideoLine, { className: "w-5 h-5 text-white" });
|
|
2885
2917
|
}
|
|
2886
2918
|
if (fileType.includes("excel") || ["xls", "xlsx", "csv", "txt", "ods"].includes(extension)) {
|
|
2887
|
-
return /* @__PURE__ */
|
|
2919
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_react44.RiFileExcel2Line, { className: "w-5 h-5 text-white" });
|
|
2888
2920
|
}
|
|
2889
2921
|
if (fileType.includes("word") || ["doc", "docx", "odt", "xml"].includes(extension)) {
|
|
2890
|
-
return /* @__PURE__ */
|
|
2922
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_react44.RiFileWord2Line, { className: "w-5 h-5 text-white" });
|
|
2891
2923
|
}
|
|
2892
2924
|
if (["pptx", "pptm", "xps", "ppsx"].includes(extension)) {
|
|
2893
|
-
return /* @__PURE__ */
|
|
2925
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_react44.RiFilePpt2Line, { className: "w-5 h-5 text-white" });
|
|
2894
2926
|
}
|
|
2895
2927
|
if (fileType.includes("zip") || ["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
|
|
2896
|
-
return /* @__PURE__ */
|
|
2928
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_react44.RiFileZipLine, { className: "w-5 h-5 text-white" });
|
|
2897
2929
|
}
|
|
2898
2930
|
if (fileType === "application/pdf" || extension === "pdf") {
|
|
2899
|
-
return /* @__PURE__ */
|
|
2931
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_react44.RiFilePdf2Line, { className: "w-5 h-5 text-white" });
|
|
2900
2932
|
}
|
|
2901
|
-
return /* @__PURE__ */
|
|
2933
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_react44.RiFileLine, { className: "w-5 h-5 text-white" });
|
|
2902
2934
|
};
|
|
2903
2935
|
function ImageUploadControlled({
|
|
2904
2936
|
items,
|
|
@@ -2919,10 +2951,10 @@ function ImageUploadControlled({
|
|
|
2919
2951
|
disabled
|
|
2920
2952
|
}) {
|
|
2921
2953
|
var _a;
|
|
2922
|
-
const inputRef = (0,
|
|
2923
|
-
const [isDragging, setIsDragging] = (0,
|
|
2924
|
-
const localPreviews = (0,
|
|
2925
|
-
const uploadProgress = (0,
|
|
2954
|
+
const inputRef = (0, import_react43.useRef)(null);
|
|
2955
|
+
const [isDragging, setIsDragging] = (0, import_react43.useState)(false);
|
|
2956
|
+
const localPreviews = (0, import_react43.useRef)(/* @__PURE__ */ new Map());
|
|
2957
|
+
const uploadProgress = (0, import_react43.useRef)(/* @__PURE__ */ new Map());
|
|
2926
2958
|
const formatSize = (bytes) => {
|
|
2927
2959
|
if (!bytes)
|
|
2928
2960
|
return "0 KB";
|
|
@@ -2944,7 +2976,7 @@ function ImageUploadControlled({
|
|
|
2944
2976
|
text: "Uploading",
|
|
2945
2977
|
color: "text-blue-600",
|
|
2946
2978
|
showSpinner: true,
|
|
2947
|
-
icon: /* @__PURE__ */
|
|
2979
|
+
icon: /* @__PURE__ */ import_react43.default.createElement(Spinner_default, { size: "xs", color: "gray" }),
|
|
2948
2980
|
canPreview: false
|
|
2949
2981
|
};
|
|
2950
2982
|
case "success":
|
|
@@ -2952,7 +2984,7 @@ function ImageUploadControlled({
|
|
|
2952
2984
|
text: "Completed",
|
|
2953
2985
|
color: "text-green-600",
|
|
2954
2986
|
showSpinner: false,
|
|
2955
|
-
icon: /* @__PURE__ */
|
|
2987
|
+
icon: /* @__PURE__ */ import_react43.default.createElement(import_react44.RiCheckLine, { className: "w-3 h-3 text-white" }),
|
|
2956
2988
|
canPreview: true
|
|
2957
2989
|
};
|
|
2958
2990
|
case "error":
|
|
@@ -2960,7 +2992,7 @@ function ImageUploadControlled({
|
|
|
2960
2992
|
text: "Failed",
|
|
2961
2993
|
color: "text-red-600",
|
|
2962
2994
|
showSpinner: false,
|
|
2963
|
-
icon: /* @__PURE__ */
|
|
2995
|
+
icon: /* @__PURE__ */ import_react43.default.createElement(import_react44.RiCloseLine, { className: "w-3 h-3 text-white" }),
|
|
2964
2996
|
canPreview: false
|
|
2965
2997
|
};
|
|
2966
2998
|
default:
|
|
@@ -2991,18 +3023,24 @@ function ImageUploadControlled({
|
|
|
2991
3023
|
const fileType = ((_b = item.file) == null ? void 0 : _b.type) || "";
|
|
2992
3024
|
return getFileIcon(fileName, fileType);
|
|
2993
3025
|
};
|
|
2994
|
-
const handleUpload =
|
|
3026
|
+
const handleUpload = import_react43.default.useCallback(
|
|
2995
3027
|
async (item) => {
|
|
2996
|
-
if (!item.file || !onUpload)
|
|
3028
|
+
if (!item.file || !onUpload || item.status === "success" || item.status === "uploading") {
|
|
2997
3029
|
return;
|
|
3030
|
+
}
|
|
2998
3031
|
try {
|
|
2999
3032
|
if (onUpdateItem) {
|
|
3000
3033
|
onUpdateItem(item.id, { status: "uploading", progress: 0 });
|
|
3001
3034
|
}
|
|
3035
|
+
uploadProgress.current.delete(item.id);
|
|
3002
3036
|
const previewUrl = await onUpload(item.file, (progress) => {
|
|
3003
|
-
|
|
3037
|
+
const clampedProgress = Math.min(100, Math.max(0, progress));
|
|
3038
|
+
uploadProgress.current.set(item.id, clampedProgress);
|
|
3004
3039
|
if (onUpdateItem) {
|
|
3005
|
-
onUpdateItem(item.id, {
|
|
3040
|
+
onUpdateItem(item.id, {
|
|
3041
|
+
progress: clampedProgress,
|
|
3042
|
+
status: "uploading"
|
|
3043
|
+
});
|
|
3006
3044
|
}
|
|
3007
3045
|
});
|
|
3008
3046
|
if (onUpdateItem) {
|
|
@@ -3012,15 +3050,25 @@ function ImageUploadControlled({
|
|
|
3012
3050
|
previewUrl
|
|
3013
3051
|
});
|
|
3014
3052
|
}
|
|
3053
|
+
uploadProgress.current.delete(item.id);
|
|
3015
3054
|
} catch (error) {
|
|
3055
|
+
console.error("Upload error:", error);
|
|
3016
3056
|
if (onUpdateItem) {
|
|
3017
|
-
onUpdateItem(item.id, {
|
|
3057
|
+
onUpdateItem(item.id, {
|
|
3058
|
+
progress: 0,
|
|
3059
|
+
status: "error"
|
|
3060
|
+
});
|
|
3018
3061
|
}
|
|
3062
|
+
uploadProgress.current.delete(item.id);
|
|
3019
3063
|
}
|
|
3020
3064
|
},
|
|
3021
3065
|
[onUpload, onUpdateItem]
|
|
3022
3066
|
);
|
|
3023
3067
|
const getCurrentProgress = (item) => {
|
|
3068
|
+
if (item.status === "success")
|
|
3069
|
+
return 100;
|
|
3070
|
+
if (item.status === "error")
|
|
3071
|
+
return 0;
|
|
3024
3072
|
return uploadProgress.current.get(item.id) ?? item.progress ?? 0;
|
|
3025
3073
|
};
|
|
3026
3074
|
const handleRetry = (id) => {
|
|
@@ -3088,7 +3136,7 @@ function ImageUploadControlled({
|
|
|
3088
3136
|
triggerInput();
|
|
3089
3137
|
}
|
|
3090
3138
|
};
|
|
3091
|
-
|
|
3139
|
+
import_react43.default.useEffect(() => {
|
|
3092
3140
|
if (autoUpload && onUpload) {
|
|
3093
3141
|
items.forEach((item) => {
|
|
3094
3142
|
if (item.status === "idle" && item.file) {
|
|
@@ -3097,13 +3145,13 @@ function ImageUploadControlled({
|
|
|
3097
3145
|
});
|
|
3098
3146
|
}
|
|
3099
3147
|
}, [items, autoUpload, onUpload, handleUpload]);
|
|
3100
|
-
|
|
3148
|
+
import_react43.default.useEffect(() => {
|
|
3101
3149
|
const previews = localPreviews == null ? void 0 : localPreviews.current;
|
|
3102
3150
|
return () => {
|
|
3103
3151
|
previews == null ? void 0 : previews.forEach((url) => URL == null ? void 0 : URL.revokeObjectURL(url));
|
|
3104
3152
|
};
|
|
3105
3153
|
}, []);
|
|
3106
|
-
return /* @__PURE__ */
|
|
3154
|
+
return /* @__PURE__ */ import_react43.default.createElement("div", { className: `w-full ${className}` }, /* @__PURE__ */ import_react43.default.createElement(
|
|
3107
3155
|
"input",
|
|
3108
3156
|
{
|
|
3109
3157
|
ref: inputRef,
|
|
@@ -3114,7 +3162,7 @@ function ImageUploadControlled({
|
|
|
3114
3162
|
onChange: handleInputChange,
|
|
3115
3163
|
disabled
|
|
3116
3164
|
}
|
|
3117
|
-
), /* @__PURE__ */
|
|
3165
|
+
), /* @__PURE__ */ import_react43.default.createElement(
|
|
3118
3166
|
Label_default,
|
|
3119
3167
|
{
|
|
3120
3168
|
htmlFor: (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.id,
|
|
@@ -3133,42 +3181,27 @@ function ImageUploadControlled({
|
|
|
3133
3181
|
disabled && "pointer-events-none cursor-not-allowed"
|
|
3134
3182
|
)
|
|
3135
3183
|
},
|
|
3136
|
-
/* @__PURE__ */
|
|
3137
|
-
), /* @__PURE__ */
|
|
3184
|
+
/* @__PURE__ */ import_react43.default.createElement("div", { className: "flex items-center gap-3 text-center" }, /* @__PURE__ */ import_react43.default.createElement("div", null, /* @__PURE__ */ import_react43.default.createElement("p", { className: "text-sm text-gray-600" }, "Drag files here or", /* @__PURE__ */ import_react43.default.createElement("span", { className: "text-primary-600 font-semibold ml-1" }, "Upload"), " ", /* @__PURE__ */ import_react43.default.createElement("br", null))))
|
|
3185
|
+
), /* @__PURE__ */ import_react43.default.createElement("span", { className: "text-xs" }, hintText ?? `Only PNG, JPG, GIF. Max file size ${maxSizeMB}MB`), /* @__PURE__ */ import_react43.default.createElement("div", { className: "flex flex-col gap-4 mt-4" }, items == null ? void 0 : items.map((item) => {
|
|
3138
3186
|
var _a2, _b;
|
|
3139
|
-
const previewUrl = getPreviewUrl(item);
|
|
3140
3187
|
const progress = getCurrentProgress(item);
|
|
3141
3188
|
const statusInfo = getStatusDisplay(item.status);
|
|
3142
3189
|
const progressColor = getProgressColor(item == null ? void 0 : item.status);
|
|
3143
3190
|
const fileIcon = getItemFileIcon(item);
|
|
3144
|
-
return /* @__PURE__ */
|
|
3191
|
+
return /* @__PURE__ */ import_react43.default.createElement(
|
|
3145
3192
|
"div",
|
|
3146
3193
|
{
|
|
3147
3194
|
key: item == null ? void 0 : item.id,
|
|
3148
3195
|
className: "flex items-center gap-4 bg-white max-w-[564px] w-full p-4 rounded-lg border border-gray-200"
|
|
3149
3196
|
},
|
|
3150
|
-
/* @__PURE__ */
|
|
3151
|
-
|
|
3197
|
+
/* @__PURE__ */ import_react43.default.createElement("div", { className: "w-14 h-14 flex-shrink-0 rounded-md overflow-hidden relative" }, /* @__PURE__ */ import_react43.default.createElement("div", { className: "absolute inset-0 w-full h-full object-contain" }, fileSvg()), /* @__PURE__ */ import_react43.default.createElement("div", { className: "relative z-10 top-2 -left-2.5 flex items-center justify-center w-full h-full text-white" }, fileIcon)),
|
|
3198
|
+
/* @__PURE__ */ import_react43.default.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ import_react43.default.createElement("div", { className: "flex items-start justify-between gap-2 mb-3" }, /* @__PURE__ */ import_react43.default.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ import_react43.default.createElement("h4", { className: "text-sm font-medium text-gray-900 truncate" }, (item == null ? void 0 : item.name) || ((_a2 = item.file) == null ? void 0 : _a2.name) || "Unnamed file"), showSizeText && /* @__PURE__ */ import_react43.default.createElement("div", { className: "text-xs text-gray-500 mt-1 flex items-center gap-1" }, formatSize((item == null ? void 0 : item.size) || ((_b = item.file) == null ? void 0 : _b.size)), statusInfo.text && /* @__PURE__ */ import_react43.default.createElement("div", { className: "ml-2 font-medium flex items-center gap-1" }, (statusInfo == null ? void 0 : statusInfo.showSpinner) ? /* @__PURE__ */ import_react43.default.createElement(import_react43.default.Fragment, null, statusInfo.icon, /* @__PURE__ */ import_react43.default.createElement("span", { className: statusInfo.color }, statusInfo.text)) : /* @__PURE__ */ import_react43.default.createElement(import_react43.default.Fragment, null, /* @__PURE__ */ import_react43.default.createElement(
|
|
3199
|
+
"div",
|
|
3152
3200
|
{
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
}
|
|
3158
|
-
), /* @__PURE__ */ import_react44.default.createElement("div", { className: "relative z-10 mt-2 -ml-[2px] flex items-center justify-center w-full h-full text-white" }, fileIcon)),
|
|
3159
|
-
/* @__PURE__ */ import_react44.default.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ import_react44.default.createElement("div", { className: "flex items-start justify-between gap-2 mb-3" }, /* @__PURE__ */ import_react44.default.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ import_react44.default.createElement("h4", { className: "text-sm font-medium text-gray-900 truncate" }, (item == null ? void 0 : item.name) || ((_a2 = item.file) == null ? void 0 : _a2.name) || "Unnamed file"), showSizeText && /* @__PURE__ */ import_react44.default.createElement("div", { className: "text-xs text-gray-500 mt-1 flex items-center gap-1" }, formatSize((item == null ? void 0 : item.size) || ((_b = item.file) == null ? void 0 : _b.size)), statusInfo.text && /* @__PURE__ */ import_react44.default.createElement("div", { className: "ml-2 font-medium flex items-center gap-1" }, (statusInfo == null ? void 0 : statusInfo.showSpinner) ? (
|
|
3160
|
-
// For uploading - just show spinner without circle
|
|
3161
|
-
/* @__PURE__ */ import_react44.default.createElement(import_react44.default.Fragment, null, statusInfo.icon, /* @__PURE__ */ import_react44.default.createElement("span", { className: statusInfo.color }, statusInfo.text))
|
|
3162
|
-
) : (
|
|
3163
|
-
// For completed/failed - show circle with icon
|
|
3164
|
-
/* @__PURE__ */ import_react44.default.createElement(import_react44.default.Fragment, null, /* @__PURE__ */ import_react44.default.createElement(
|
|
3165
|
-
"div",
|
|
3166
|
-
{
|
|
3167
|
-
className: `w-4 h-4 rounded-full flex justify-center items-center ${(statusInfo == null ? void 0 : statusInfo.color) === "text-red-600" ? "bg-red-600" : (statusInfo == null ? void 0 : statusInfo.color) === "text-green-600" ? "bg-green-600" : "bg-gray-400"}`
|
|
3168
|
-
},
|
|
3169
|
-
statusInfo == null ? void 0 : statusInfo.icon
|
|
3170
|
-
), /* @__PURE__ */ import_react44.default.createElement("span", { className: statusInfo.color }, statusInfo == null ? void 0 : statusInfo.text))
|
|
3171
|
-
)))), /* @__PURE__ */ import_react44.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react44.default.createElement("div", { className: "flex items-center gap-2" }, onPreview && (item == null ? void 0 : item.status) === "success" && /* @__PURE__ */ import_react44.default.createElement(
|
|
3201
|
+
className: `w-4 h-4 rounded-full flex justify-center items-center ${(statusInfo == null ? void 0 : statusInfo.color) === "text-red-600" ? "bg-red-600" : (statusInfo == null ? void 0 : statusInfo.color) === "text-green-600" ? "bg-green-600" : "bg-gray-400"}`
|
|
3202
|
+
},
|
|
3203
|
+
statusInfo == null ? void 0 : statusInfo.icon
|
|
3204
|
+
), /* @__PURE__ */ import_react43.default.createElement("span", { className: statusInfo.color }, statusInfo == null ? void 0 : statusInfo.text))))), /* @__PURE__ */ import_react43.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react43.default.createElement("div", { className: "flex items-center gap-2" }, onPreview && (item == null ? void 0 : item.status) === "success" && /* @__PURE__ */ import_react43.default.createElement(
|
|
3172
3205
|
"button",
|
|
3173
3206
|
{
|
|
3174
3207
|
type: "button",
|
|
@@ -3176,8 +3209,8 @@ function ImageUploadControlled({
|
|
|
3176
3209
|
className: "p-2 rounded-md hover:bg-gray-100 transition-colors text-gray-600",
|
|
3177
3210
|
title: "Preview"
|
|
3178
3211
|
},
|
|
3179
|
-
/* @__PURE__ */
|
|
3180
|
-
), (item == null ? void 0 : item.status) === "error" && /* @__PURE__ */
|
|
3212
|
+
/* @__PURE__ */ import_react43.default.createElement(import_react44.RiEyeLine, { size: 16 })
|
|
3213
|
+
), (item == null ? void 0 : item.status) === "error" && /* @__PURE__ */ import_react43.default.createElement(import_react43.default.Fragment, null, /* @__PURE__ */ import_react43.default.createElement("span", { className: "hidden sm:inline-block" }, /* @__PURE__ */ import_react43.default.createElement(
|
|
3181
3214
|
Button_default,
|
|
3182
3215
|
{
|
|
3183
3216
|
variant: "outlined",
|
|
@@ -3187,9 +3220,9 @@ function ImageUploadControlled({
|
|
|
3187
3220
|
onClick: () => handleRetry(item == null ? void 0 : item.id),
|
|
3188
3221
|
className: "whitespace-nowrap h-[30px]"
|
|
3189
3222
|
},
|
|
3190
|
-
/* @__PURE__ */
|
|
3223
|
+
/* @__PURE__ */ import_react43.default.createElement(import_react44.RiRefreshLine, { size: 16 }),
|
|
3191
3224
|
"Try Again"
|
|
3192
|
-
)), /* @__PURE__ */
|
|
3225
|
+
)), /* @__PURE__ */ import_react43.default.createElement("span", { className: "sm:hidden" }, /* @__PURE__ */ import_react43.default.createElement(
|
|
3193
3226
|
Button_default,
|
|
3194
3227
|
{
|
|
3195
3228
|
variant: "outlined",
|
|
@@ -3199,8 +3232,8 @@ function ImageUploadControlled({
|
|
|
3199
3232
|
onClick: () => handleRetry(item == null ? void 0 : item.id),
|
|
3200
3233
|
className: "h-[30px] px-1 py-1"
|
|
3201
3234
|
},
|
|
3202
|
-
/* @__PURE__ */
|
|
3203
|
-
))), /* @__PURE__ */
|
|
3235
|
+
/* @__PURE__ */ import_react43.default.createElement(import_react44.RiRefreshLine, { size: 16 })
|
|
3236
|
+
))), /* @__PURE__ */ import_react43.default.createElement(
|
|
3204
3237
|
"button",
|
|
3205
3238
|
{
|
|
3206
3239
|
type: "button",
|
|
@@ -3208,25 +3241,25 @@ function ImageUploadControlled({
|
|
|
3208
3241
|
className: "p-2 rounded-md hover:bg-gray-100 transition-colors text-gray-600",
|
|
3209
3242
|
title: "Delete"
|
|
3210
3243
|
},
|
|
3211
|
-
/* @__PURE__ */
|
|
3212
|
-
)))), /* @__PURE__ */
|
|
3213
|
-
|
|
3244
|
+
/* @__PURE__ */ import_react43.default.createElement(import_react44.RiDeleteBin6Line, { size: 16 })
|
|
3245
|
+
)))), /* @__PURE__ */ import_react43.default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ import_react43.default.createElement("div", { className: "flex-1" }, /* @__PURE__ */ import_react43.default.createElement("div", { className: "w-full h-2 bg-gray-200 rounded-full overflow-hidden" }, /* @__PURE__ */ import_react43.default.createElement(
|
|
3246
|
+
"div",
|
|
3214
3247
|
{
|
|
3215
|
-
progressColor
|
|
3216
|
-
progress
|
|
3248
|
+
className: `h-full rounded-full transition-all duration-300 ease-out ${progressColor}`,
|
|
3249
|
+
style: { width: `${progress}%` }
|
|
3217
3250
|
}
|
|
3218
|
-
)), /* @__PURE__ */
|
|
3251
|
+
))), /* @__PURE__ */ import_react43.default.createElement("div", { className: "text-xs text-gray-500 w-12 text-right" }, item.status === "error" ? "--%" : item.status === "success" ? "100%" : `${Math.round(progress)}%`)))
|
|
3219
3252
|
);
|
|
3220
3253
|
})));
|
|
3221
3254
|
}
|
|
3222
3255
|
|
|
3223
3256
|
// app/components/Sidebar.tsx
|
|
3224
|
-
var
|
|
3225
|
-
var
|
|
3226
|
-
var
|
|
3257
|
+
var import_react45 = __toESM(require("react"), 1);
|
|
3258
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
3259
|
+
var import_react46 = require("@remixicon/react");
|
|
3227
3260
|
var import_navigation = require("next/navigation");
|
|
3228
3261
|
var Sidebar = ({ children, collapsed, setCollapsed, dense = false }) => {
|
|
3229
|
-
return /* @__PURE__ */
|
|
3262
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
3230
3263
|
"div",
|
|
3231
3264
|
{
|
|
3232
3265
|
onMouseEnter: () => setCollapsed(true),
|
|
@@ -3236,14 +3269,14 @@ var Sidebar = ({ children, collapsed, setCollapsed, dense = false }) => {
|
|
|
3236
3269
|
!collapsed ? dense ? "w-[76px] py-[19px] px-[15px]" : "w-[80px] py-[21px] px-[17px]" : dense ? "w-[304px] py-[20px] px-5" : "w-[308px] py-[22px] px-6"
|
|
3237
3270
|
)
|
|
3238
3271
|
},
|
|
3239
|
-
/* @__PURE__ */
|
|
3272
|
+
/* @__PURE__ */ import_react45.default.createElement("div", null, children)
|
|
3240
3273
|
);
|
|
3241
3274
|
};
|
|
3242
3275
|
var SidebarHeader = ({
|
|
3243
3276
|
children,
|
|
3244
3277
|
dense = false
|
|
3245
3278
|
}) => {
|
|
3246
|
-
return /* @__PURE__ */
|
|
3279
|
+
return /* @__PURE__ */ import_react45.default.createElement("div", { className: cn("z-20", dense ? "mb-3" : "mb-4") }, /* @__PURE__ */ import_react45.default.createElement("div", { className: "flex justify-between items-center" }, /* @__PURE__ */ import_react45.default.createElement("span", { className: "whitespace-nowrap" }, children)));
|
|
3247
3280
|
};
|
|
3248
3281
|
var SidebarMenu = ({
|
|
3249
3282
|
collapsed,
|
|
@@ -3251,12 +3284,12 @@ var SidebarMenu = ({
|
|
|
3251
3284
|
scroll = false,
|
|
3252
3285
|
dense = false
|
|
3253
3286
|
}) => {
|
|
3254
|
-
const [openMenus, setOpenMenus] = (0,
|
|
3287
|
+
const [openMenus, setOpenMenus] = (0, import_react45.useState)({});
|
|
3255
3288
|
const currentPath = (0, import_navigation.usePathname)();
|
|
3256
3289
|
const toggleMenu = (label) => {
|
|
3257
3290
|
setOpenMenus((prev) => ({ ...prev, [label]: !prev[label] }));
|
|
3258
3291
|
};
|
|
3259
|
-
|
|
3292
|
+
import_react45.default.useEffect(() => {
|
|
3260
3293
|
if (!collapsed) {
|
|
3261
3294
|
setOpenMenus({});
|
|
3262
3295
|
}
|
|
@@ -3272,13 +3305,13 @@ var SidebarMenu = ({
|
|
|
3272
3305
|
}
|
|
3273
3306
|
};
|
|
3274
3307
|
const renderMenuItems = (items, level = 0) => {
|
|
3275
|
-
return /* @__PURE__ */
|
|
3308
|
+
return /* @__PURE__ */ import_react45.default.createElement("ul", { className: level > 0 ? "ml-5 border-l border-gray-200" : "" }, items == null ? void 0 : items.map((item, index) => {
|
|
3276
3309
|
const hasSubItems = item.subItems && item.subItems.length > 0;
|
|
3277
3310
|
const isActive = item.href === currentPath;
|
|
3278
3311
|
const isOpen = openMenus[item.label];
|
|
3279
3312
|
const paddingLeft = level === 0 ? dense ? "10px" : "12px" : `${level * 5 + (dense ? 10 : 12)}px`;
|
|
3280
|
-
return /* @__PURE__ */
|
|
3281
|
-
|
|
3313
|
+
return /* @__PURE__ */ import_react45.default.createElement("li", { key: index }, hasSubItems ? /* @__PURE__ */ import_react45.default.createElement(
|
|
3314
|
+
import_link.default,
|
|
3282
3315
|
{
|
|
3283
3316
|
href: item.href || "#",
|
|
3284
3317
|
className: cn(
|
|
@@ -3298,22 +3331,22 @@ var SidebarMenu = ({
|
|
|
3298
3331
|
e.preventDefault();
|
|
3299
3332
|
}
|
|
3300
3333
|
},
|
|
3301
|
-
/* @__PURE__ */
|
|
3302
|
-
collapsed && hasSubItems && /* @__PURE__ */
|
|
3303
|
-
|
|
3334
|
+
/* @__PURE__ */ import_react45.default.createElement("div", { className: "flex items-center gap-2" }, item.icon && level === 0 && /* @__PURE__ */ import_react45.default.createElement("span", { className: dense ? "text-xs" : "text-text-sm" }, item.icon), /* @__PURE__ */ import_react45.default.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)),
|
|
3335
|
+
collapsed && hasSubItems && /* @__PURE__ */ import_react45.default.createElement("span", null, isOpen ? /* @__PURE__ */ import_react45.default.createElement(
|
|
3336
|
+
import_react46.RiArrowDownSLine,
|
|
3304
3337
|
{
|
|
3305
3338
|
size: dense ? 16 : 18,
|
|
3306
3339
|
color: "#475467"
|
|
3307
3340
|
}
|
|
3308
|
-
) : /* @__PURE__ */
|
|
3309
|
-
|
|
3341
|
+
) : /* @__PURE__ */ import_react45.default.createElement(
|
|
3342
|
+
import_react46.RiArrowRightSLine,
|
|
3310
3343
|
{
|
|
3311
3344
|
size: dense ? 16 : 18,
|
|
3312
3345
|
color: "#475467"
|
|
3313
3346
|
}
|
|
3314
3347
|
))
|
|
3315
|
-
) : /* @__PURE__ */
|
|
3316
|
-
|
|
3348
|
+
) : /* @__PURE__ */ import_react45.default.createElement(
|
|
3349
|
+
import_link.default,
|
|
3317
3350
|
{
|
|
3318
3351
|
href: item.href || "#",
|
|
3319
3352
|
className: cn(
|
|
@@ -3324,12 +3357,12 @@ var SidebarMenu = ({
|
|
|
3324
3357
|
level > 0 ? "text-sm font-medium" : "font-semibold"
|
|
3325
3358
|
)
|
|
3326
3359
|
},
|
|
3327
|
-
item.icon && level === 0 && /* @__PURE__ */
|
|
3328
|
-
/* @__PURE__ */
|
|
3329
|
-
), hasSubItems && isOpen && /* @__PURE__ */
|
|
3360
|
+
item.icon && level === 0 && /* @__PURE__ */ import_react45.default.createElement("span", { className: dense ? "text-xs" : "text-text-sm" }, item.icon),
|
|
3361
|
+
/* @__PURE__ */ import_react45.default.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)
|
|
3362
|
+
), hasSubItems && isOpen && /* @__PURE__ */ import_react45.default.createElement("div", { className: dense ? "mt-0.5" : "mt-1" }, renderMenuItems(item.subItems, level + 1)));
|
|
3330
3363
|
}));
|
|
3331
3364
|
};
|
|
3332
|
-
return /* @__PURE__ */
|
|
3365
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
3333
3366
|
"nav",
|
|
3334
3367
|
{
|
|
3335
3368
|
className: cn(
|
|
@@ -3338,7 +3371,7 @@ var SidebarMenu = ({
|
|
|
3338
3371
|
scroll && collapsed ? "overflow-y-auto customScroll" : "overflow-hidden"
|
|
3339
3372
|
)
|
|
3340
3373
|
},
|
|
3341
|
-
/* @__PURE__ */
|
|
3374
|
+
/* @__PURE__ */ import_react45.default.createElement(
|
|
3342
3375
|
"ul",
|
|
3343
3376
|
{
|
|
3344
3377
|
className: cn(
|
|
@@ -3346,13 +3379,13 @@ var SidebarMenu = ({
|
|
|
3346
3379
|
dense ? "my-1.5" : "my-2"
|
|
3347
3380
|
)
|
|
3348
3381
|
},
|
|
3349
|
-
navItems == null ? void 0 : navItems.map((parentItem, parentIndex) => /* @__PURE__ */
|
|
3382
|
+
navItems == null ? void 0 : navItems.map((parentItem, parentIndex) => /* @__PURE__ */ import_react45.default.createElement(
|
|
3350
3383
|
"li",
|
|
3351
3384
|
{
|
|
3352
3385
|
key: parentIndex,
|
|
3353
3386
|
className: "flex flex-col gap-3 mb-1 whitespace-nowrap overflow-hidden"
|
|
3354
3387
|
},
|
|
3355
|
-
/* @__PURE__ */
|
|
3388
|
+
/* @__PURE__ */ import_react45.default.createElement(
|
|
3356
3389
|
"p",
|
|
3357
3390
|
{
|
|
3358
3391
|
className: cn(
|
|
@@ -3376,7 +3409,7 @@ var SidebarFooter = ({
|
|
|
3376
3409
|
dense = false
|
|
3377
3410
|
}) => {
|
|
3378
3411
|
const currentPath = (0, import_navigation.usePathname)();
|
|
3379
|
-
return /* @__PURE__ */
|
|
3412
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
3380
3413
|
"div",
|
|
3381
3414
|
{
|
|
3382
3415
|
className: cn({
|
|
@@ -3388,8 +3421,8 @@ var SidebarFooter = ({
|
|
|
3388
3421
|
}),
|
|
3389
3422
|
onClick: () => setCollapsed(true)
|
|
3390
3423
|
},
|
|
3391
|
-
collapsed && /* @__PURE__ */
|
|
3392
|
-
navItems && navItems.length > 0 && /* @__PURE__ */
|
|
3424
|
+
collapsed && /* @__PURE__ */ import_react45.default.createElement("div", { className: "shadow-md" }, /* @__PURE__ */ import_react45.default.createElement(Divider_default, null)),
|
|
3425
|
+
navItems && navItems.length > 0 && /* @__PURE__ */ import_react45.default.createElement("nav", { className: "flex-grow w-full" }, /* @__PURE__ */ import_react45.default.createElement(
|
|
3393
3426
|
"ul",
|
|
3394
3427
|
{
|
|
3395
3428
|
className: cn(
|
|
@@ -3399,13 +3432,13 @@ var SidebarFooter = ({
|
|
|
3399
3432
|
},
|
|
3400
3433
|
navItems == null ? void 0 : navItems.map((parentItem, parentIndex) => {
|
|
3401
3434
|
var _a;
|
|
3402
|
-
return /* @__PURE__ */
|
|
3435
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
3403
3436
|
"li",
|
|
3404
3437
|
{
|
|
3405
3438
|
key: parentIndex,
|
|
3406
3439
|
className: "flex flex-col gap-3 mb-1 whitespace-nowrap overflow-hidden"
|
|
3407
3440
|
},
|
|
3408
|
-
/* @__PURE__ */
|
|
3441
|
+
/* @__PURE__ */ import_react45.default.createElement(
|
|
3409
3442
|
"p",
|
|
3410
3443
|
{
|
|
3411
3444
|
className: cn({
|
|
@@ -3418,8 +3451,8 @@ var SidebarFooter = ({
|
|
|
3418
3451
|
},
|
|
3419
3452
|
parentItem.label
|
|
3420
3453
|
),
|
|
3421
|
-
/* @__PURE__ */
|
|
3422
|
-
|
|
3454
|
+
/* @__PURE__ */ import_react45.default.createElement("ul", null, (_a = parentItem == null ? void 0 : parentItem.items) == null ? void 0 : _a.map((item, index) => /* @__PURE__ */ import_react45.default.createElement("li", { key: index }, /* @__PURE__ */ import_react45.default.createElement(
|
|
3455
|
+
import_link.default,
|
|
3423
3456
|
{
|
|
3424
3457
|
className: cn({
|
|
3425
3458
|
"hover:bg-gray-100 flex items-center cursor-pointer rounded-md transition-colors duration-300 font-semibold whitespace-nowrap overflow-hidden": true,
|
|
@@ -3432,12 +3465,12 @@ var SidebarFooter = ({
|
|
|
3432
3465
|
href: (item == null ? void 0 : item.href) || "#",
|
|
3433
3466
|
passHref: true
|
|
3434
3467
|
},
|
|
3435
|
-
/* @__PURE__ */
|
|
3468
|
+
/* @__PURE__ */ import_react45.default.createElement(
|
|
3436
3469
|
"div",
|
|
3437
3470
|
{
|
|
3438
3471
|
className: `flex items-center gap-2 whitespace-nowrap`
|
|
3439
3472
|
},
|
|
3440
|
-
/* @__PURE__ */
|
|
3473
|
+
/* @__PURE__ */ import_react45.default.createElement(
|
|
3441
3474
|
"span",
|
|
3442
3475
|
{
|
|
3443
3476
|
className: dense ? "text-xs" : "text-text-sm"
|
|
@@ -3445,7 +3478,7 @@ var SidebarFooter = ({
|
|
|
3445
3478
|
" ",
|
|
3446
3479
|
item.icon
|
|
3447
3480
|
),
|
|
3448
|
-
/* @__PURE__ */
|
|
3481
|
+
/* @__PURE__ */ import_react45.default.createElement("span", { className: cn(!collapsed ? "opacity-0" : "") }, item.label)
|
|
3449
3482
|
)
|
|
3450
3483
|
))))
|
|
3451
3484
|
);
|
|
@@ -3460,7 +3493,7 @@ Sidebar.Footer = SidebarFooter;
|
|
|
3460
3493
|
var Sidebar_default = Sidebar;
|
|
3461
3494
|
|
|
3462
3495
|
// app/components/Skeleton.tsx
|
|
3463
|
-
var
|
|
3496
|
+
var import_react47 = __toESM(require("react"), 1);
|
|
3464
3497
|
var Skeleton = ({
|
|
3465
3498
|
width = "100%",
|
|
3466
3499
|
height = "100%",
|
|
@@ -3473,7 +3506,7 @@ var Skeleton = ({
|
|
|
3473
3506
|
borderRadius: circle ? "50%" : void 0,
|
|
3474
3507
|
display: "block"
|
|
3475
3508
|
};
|
|
3476
|
-
return /* @__PURE__ */
|
|
3509
|
+
return /* @__PURE__ */ import_react47.default.createElement(
|
|
3477
3510
|
"span",
|
|
3478
3511
|
{
|
|
3479
3512
|
className: cn(
|
|
@@ -3490,11 +3523,11 @@ var Skeleton = ({
|
|
|
3490
3523
|
var Skeleton_default = Skeleton;
|
|
3491
3524
|
|
|
3492
3525
|
// app/components/Slider.tsx
|
|
3493
|
-
var
|
|
3494
|
-
var Slider = (0,
|
|
3526
|
+
var import_react48 = __toESM(require("react"), 1);
|
|
3527
|
+
var Slider = (0, import_react48.forwardRef)(
|
|
3495
3528
|
({ value, min = 0, max = 100, size = "sm", ...props }, ref) => {
|
|
3496
3529
|
const progress = (value - min) / (max - min) * 100;
|
|
3497
|
-
return /* @__PURE__ */
|
|
3530
|
+
return /* @__PURE__ */ import_react48.default.createElement(import_react48.default.Fragment, null, /* @__PURE__ */ import_react48.default.createElement(
|
|
3498
3531
|
"input",
|
|
3499
3532
|
{
|
|
3500
3533
|
ref,
|
|
@@ -3518,10 +3551,10 @@ Slider.displayName = "Slider";
|
|
|
3518
3551
|
var Slider_default = Slider;
|
|
3519
3552
|
|
|
3520
3553
|
// app/components/SplitButton.tsx
|
|
3521
|
-
var
|
|
3522
|
-
var SplitButton = (0,
|
|
3554
|
+
var import_react49 = __toESM(require("react"), 1);
|
|
3555
|
+
var SplitButton = (0, import_react49.forwardRef)(
|
|
3523
3556
|
({ children, className = "", size = "md", appearance = "primary", compact = false, ...props }, ref) => {
|
|
3524
|
-
return /* @__PURE__ */
|
|
3557
|
+
return /* @__PURE__ */ import_react49.default.createElement(
|
|
3525
3558
|
"div",
|
|
3526
3559
|
{
|
|
3527
3560
|
ref,
|
|
@@ -3536,8 +3569,8 @@ SplitButton.displayName = "SplitButton";
|
|
|
3536
3569
|
var SplitButton_default = SplitButton;
|
|
3537
3570
|
|
|
3538
3571
|
// app/components/Stepper.tsx
|
|
3539
|
-
var
|
|
3540
|
-
var
|
|
3572
|
+
var import_react50 = __toESM(require("react"), 1);
|
|
3573
|
+
var import_react51 = require("@remixicon/react");
|
|
3541
3574
|
var Stepper = ({
|
|
3542
3575
|
stepsConfig,
|
|
3543
3576
|
currentStep,
|
|
@@ -3547,19 +3580,19 @@ var Stepper = ({
|
|
|
3547
3580
|
position = "horizontal"
|
|
3548
3581
|
}) => {
|
|
3549
3582
|
var _a, _b;
|
|
3550
|
-
const stepRef = (0,
|
|
3583
|
+
const stepRef = (0, import_react50.useRef)([]);
|
|
3551
3584
|
if (!stepsConfig.length) {
|
|
3552
3585
|
return null;
|
|
3553
3586
|
}
|
|
3554
3587
|
const ActiveComponent = (_a = stepsConfig[currentStep - 1]) == null ? void 0 : _a.Component;
|
|
3555
|
-
return /* @__PURE__ */
|
|
3588
|
+
return /* @__PURE__ */ import_react50.default.createElement(
|
|
3556
3589
|
"div",
|
|
3557
3590
|
{
|
|
3558
3591
|
role: "region",
|
|
3559
3592
|
"aria-label": "Step Progress",
|
|
3560
3593
|
className: cn(position !== "horizontal" && "flex")
|
|
3561
3594
|
},
|
|
3562
|
-
/* @__PURE__ */
|
|
3595
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
3563
3596
|
"div",
|
|
3564
3597
|
{
|
|
3565
3598
|
className: cn(
|
|
@@ -3569,7 +3602,7 @@ var Stepper = ({
|
|
|
3569
3602
|
role: "list",
|
|
3570
3603
|
"aria-label": `Progress: ${currentStep} of ${stepsConfig.length} steps`
|
|
3571
3604
|
},
|
|
3572
|
-
stepsConfig == null ? void 0 : stepsConfig.map((step, index) => /* @__PURE__ */
|
|
3605
|
+
stepsConfig == null ? void 0 : stepsConfig.map((step, index) => /* @__PURE__ */ import_react50.default.createElement(
|
|
3573
3606
|
"div",
|
|
3574
3607
|
{
|
|
3575
3608
|
key: index,
|
|
@@ -3584,7 +3617,7 @@ var Stepper = ({
|
|
|
3584
3617
|
"aria-current": currentStep === index + 1 ? "step" : void 0,
|
|
3585
3618
|
"aria-label": `${step.name}${step.helperName ? `, ${step.helperName}` : ""}, ${currentStep > index + 1 || isComplete ? "completed" : currentStep === index + 1 ? "current step" : "pending"}`
|
|
3586
3619
|
},
|
|
3587
|
-
/* @__PURE__ */
|
|
3620
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
3588
3621
|
"div",
|
|
3589
3622
|
{
|
|
3590
3623
|
className: cn(
|
|
@@ -3592,23 +3625,23 @@ var Stepper = ({
|
|
|
3592
3625
|
position === "horizontal" ? "flex items-center" : "flex flex-col"
|
|
3593
3626
|
)
|
|
3594
3627
|
},
|
|
3595
|
-
/* @__PURE__ */
|
|
3628
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
3596
3629
|
"div",
|
|
3597
3630
|
{
|
|
3598
3631
|
className: `w-[20px] h-[20px] rounded-full bg-gray-100 flex justify-center items-center ${currentStep === index + 1 ? "border border-primary-600" : "border border-gray-200"} ${currentStep > index + 1 || isComplete ? "bg-primary-600 border-none" : ""}`,
|
|
3599
3632
|
role: "status",
|
|
3600
3633
|
"aria-label": `Step ${index + 1} ${currentStep > index + 1 || isComplete ? "completed" : currentStep === index + 1 ? "current" : "pending"}`
|
|
3601
3634
|
},
|
|
3602
|
-
currentStep === index + 1 && !isComplete && /* @__PURE__ */
|
|
3635
|
+
currentStep === index + 1 && !isComplete && /* @__PURE__ */ import_react50.default.createElement(
|
|
3603
3636
|
"span",
|
|
3604
3637
|
{
|
|
3605
3638
|
"aria-hidden": "true",
|
|
3606
3639
|
className: "w-[10px] h-[10px] rounded-full bg-primary-600"
|
|
3607
3640
|
}
|
|
3608
3641
|
),
|
|
3609
|
-
(currentStep > index + 1 || isComplete) && /* @__PURE__ */
|
|
3642
|
+
(currentStep > index + 1 || isComplete) && /* @__PURE__ */ import_react50.default.createElement("span", { "aria-hidden": "true" }, /* @__PURE__ */ import_react50.default.createElement(import_react51.RiCheckLine, { size: 12, color: "#fff" }))
|
|
3610
3643
|
),
|
|
3611
|
-
index !== stepsConfig.length - 1 && /* @__PURE__ */
|
|
3644
|
+
index !== stepsConfig.length - 1 && /* @__PURE__ */ import_react50.default.createElement(
|
|
3612
3645
|
"div",
|
|
3613
3646
|
{
|
|
3614
3647
|
className: cn(
|
|
@@ -3617,7 +3650,7 @@ var Stepper = ({
|
|
|
3617
3650
|
),
|
|
3618
3651
|
"aria-hidden": "true"
|
|
3619
3652
|
},
|
|
3620
|
-
/* @__PURE__ */
|
|
3653
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
3621
3654
|
"p",
|
|
3622
3655
|
{
|
|
3623
3656
|
className: cn(
|
|
@@ -3628,7 +3661,7 @@ var Stepper = ({
|
|
|
3628
3661
|
)
|
|
3629
3662
|
)
|
|
3630
3663
|
),
|
|
3631
|
-
/* @__PURE__ */
|
|
3664
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
3632
3665
|
"div",
|
|
3633
3666
|
{
|
|
3634
3667
|
"aria-hidden": currentStep !== index + 1,
|
|
@@ -3637,7 +3670,7 @@ var Stepper = ({
|
|
|
3637
3670
|
position === "vertical" || (step == null ? void 0 : step.helperName) ? "-mt-1" : ""
|
|
3638
3671
|
)
|
|
3639
3672
|
},
|
|
3640
|
-
/* @__PURE__ */
|
|
3673
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
3641
3674
|
"span",
|
|
3642
3675
|
{
|
|
3643
3676
|
"aria-label": "Helper text",
|
|
@@ -3645,27 +3678,27 @@ var Stepper = ({
|
|
|
3645
3678
|
},
|
|
3646
3679
|
step == null ? void 0 : step.helperName
|
|
3647
3680
|
),
|
|
3648
|
-
/* @__PURE__ */
|
|
3681
|
+
/* @__PURE__ */ import_react50.default.createElement("p", null, step == null ? void 0 : step.name)
|
|
3649
3682
|
)
|
|
3650
3683
|
))
|
|
3651
3684
|
),
|
|
3652
|
-
ActiveComponent && /* @__PURE__ */
|
|
3685
|
+
ActiveComponent && /* @__PURE__ */ import_react50.default.createElement(
|
|
3653
3686
|
"div",
|
|
3654
3687
|
{
|
|
3655
3688
|
role: "tabpanel",
|
|
3656
3689
|
"aria-label": `Current step: ${(_b = stepsConfig[currentStep - 1]) == null ? void 0 : _b.name}`,
|
|
3657
3690
|
tabIndex: 0
|
|
3658
3691
|
},
|
|
3659
|
-
/* @__PURE__ */
|
|
3692
|
+
/* @__PURE__ */ import_react50.default.createElement(ActiveComponent, null)
|
|
3660
3693
|
)
|
|
3661
3694
|
);
|
|
3662
3695
|
};
|
|
3663
3696
|
var Stepper_default = Stepper;
|
|
3664
3697
|
|
|
3665
3698
|
// app/components/TableComponents.tsx
|
|
3666
|
-
var
|
|
3699
|
+
var import_react52 = __toESM(require("react"), 1);
|
|
3667
3700
|
var Table = ({ children, className, dense, ...props }) => {
|
|
3668
|
-
return /* @__PURE__ */
|
|
3701
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
3669
3702
|
"table",
|
|
3670
3703
|
{
|
|
3671
3704
|
...props,
|
|
@@ -3683,7 +3716,7 @@ var TableHead = ({
|
|
|
3683
3716
|
className,
|
|
3684
3717
|
...props
|
|
3685
3718
|
}) => {
|
|
3686
|
-
return /* @__PURE__ */
|
|
3719
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
3687
3720
|
"thead",
|
|
3688
3721
|
{
|
|
3689
3722
|
...props,
|
|
@@ -3697,7 +3730,7 @@ var TableBody = ({
|
|
|
3697
3730
|
className,
|
|
3698
3731
|
...props
|
|
3699
3732
|
}) => {
|
|
3700
|
-
return /* @__PURE__ */
|
|
3733
|
+
return /* @__PURE__ */ import_react52.default.createElement("tbody", { ...props, className: cn(className) }, children);
|
|
3701
3734
|
};
|
|
3702
3735
|
var TableRow = ({
|
|
3703
3736
|
children,
|
|
@@ -3705,7 +3738,7 @@ var TableRow = ({
|
|
|
3705
3738
|
indent,
|
|
3706
3739
|
...props
|
|
3707
3740
|
}) => {
|
|
3708
|
-
return /* @__PURE__ */
|
|
3741
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
3709
3742
|
"tr",
|
|
3710
3743
|
{
|
|
3711
3744
|
...props,
|
|
@@ -3729,7 +3762,7 @@ var TableHeadCell = ({
|
|
|
3729
3762
|
right,
|
|
3730
3763
|
...props
|
|
3731
3764
|
}) => {
|
|
3732
|
-
return /* @__PURE__ */
|
|
3765
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
3733
3766
|
"th",
|
|
3734
3767
|
{
|
|
3735
3768
|
...props,
|
|
@@ -3747,7 +3780,7 @@ var TableHeadCell = ({
|
|
|
3747
3780
|
right
|
|
3748
3781
|
}
|
|
3749
3782
|
},
|
|
3750
|
-
/* @__PURE__ */
|
|
3783
|
+
/* @__PURE__ */ import_react52.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react52.default.createElement("span", { className: "font-medium text-xs" }, children), icon && /* @__PURE__ */ import_react52.default.createElement(
|
|
3751
3784
|
"span",
|
|
3752
3785
|
{
|
|
3753
3786
|
className: "hover:bg-gray-200 w-5 h-5 flex items-center justify-center p-1 rounded focus:bg-gray-300 active:bg-gray-300"
|
|
@@ -3767,7 +3800,7 @@ var TableDataCell = ({
|
|
|
3767
3800
|
right,
|
|
3768
3801
|
...props
|
|
3769
3802
|
}) => {
|
|
3770
|
-
return /* @__PURE__ */
|
|
3803
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
3771
3804
|
"td",
|
|
3772
3805
|
{
|
|
3773
3806
|
...props,
|
|
@@ -3785,8 +3818,8 @@ var TableDataCell = ({
|
|
|
3785
3818
|
right
|
|
3786
3819
|
}
|
|
3787
3820
|
},
|
|
3788
|
-
/* @__PURE__ */
|
|
3789
|
-
icon && /* @__PURE__ */
|
|
3821
|
+
/* @__PURE__ */ import_react52.default.createElement("span", { className: "font-medium text-sm" }, children),
|
|
3822
|
+
icon && /* @__PURE__ */ import_react52.default.createElement(
|
|
3790
3823
|
"span",
|
|
3791
3824
|
{
|
|
3792
3825
|
className: "hover:bg-gray-200 w-5 h-5 flex items-center justify-center p-1 rounded focus:bg-gray-300 active:bg-gray-300"
|
|
@@ -3798,13 +3831,13 @@ var TableDataCell = ({
|
|
|
3798
3831
|
var TableComponents_default = Table;
|
|
3799
3832
|
|
|
3800
3833
|
// app/components/Tabs.tsx
|
|
3801
|
-
var
|
|
3834
|
+
var import_react53 = __toESM(require("react"), 1);
|
|
3802
3835
|
var TabsContainer = ({
|
|
3803
3836
|
children,
|
|
3804
3837
|
className,
|
|
3805
3838
|
position = "horizontal"
|
|
3806
3839
|
}) => {
|
|
3807
|
-
return /* @__PURE__ */
|
|
3840
|
+
return /* @__PURE__ */ import_react53.default.createElement("div", { className: cn(position === "vertical" ? "flex" : "block", className) }, children);
|
|
3808
3841
|
};
|
|
3809
3842
|
var TabList = ({
|
|
3810
3843
|
onChange,
|
|
@@ -3815,11 +3848,11 @@ var TabList = ({
|
|
|
3815
3848
|
className,
|
|
3816
3849
|
position = "horizontal"
|
|
3817
3850
|
}) => {
|
|
3818
|
-
const [focusIndex, setFocusIndex] =
|
|
3819
|
-
const tabRefs =
|
|
3851
|
+
const [focusIndex, setFocusIndex] = import_react53.default.useState(0);
|
|
3852
|
+
const tabRefs = import_react53.default.useRef([]);
|
|
3820
3853
|
const handleKeyDown = (e, index) => {
|
|
3821
3854
|
var _a, _b, _c, _d, _e, _f;
|
|
3822
|
-
const tabCount =
|
|
3855
|
+
const tabCount = import_react53.default.Children.count(children);
|
|
3823
3856
|
switch (e.key) {
|
|
3824
3857
|
case "ArrowRight":
|
|
3825
3858
|
if (position === "horizontal") {
|
|
@@ -3866,7 +3899,7 @@ var TabList = ({
|
|
|
3866
3899
|
break;
|
|
3867
3900
|
}
|
|
3868
3901
|
};
|
|
3869
|
-
return /* @__PURE__ */
|
|
3902
|
+
return /* @__PURE__ */ import_react53.default.createElement(
|
|
3870
3903
|
"div",
|
|
3871
3904
|
{
|
|
3872
3905
|
className: cn(
|
|
@@ -3878,8 +3911,8 @@ var TabList = ({
|
|
|
3878
3911
|
"aria-label": ariaLabel,
|
|
3879
3912
|
"aria-orientation": position
|
|
3880
3913
|
},
|
|
3881
|
-
|
|
3882
|
-
if (
|
|
3914
|
+
import_react53.default.Children.map(children, (child, index) => {
|
|
3915
|
+
if (import_react53.default.isValidElement(child)) {
|
|
3883
3916
|
const childProps = {
|
|
3884
3917
|
onChange,
|
|
3885
3918
|
box,
|
|
@@ -3889,7 +3922,7 @@ var TabList = ({
|
|
|
3889
3922
|
onKeyDown: (e) => handleKeyDown(e, index),
|
|
3890
3923
|
tabIndex: index === focusIndex ? 0 : -1
|
|
3891
3924
|
};
|
|
3892
|
-
return
|
|
3925
|
+
return import_react53.default.cloneElement(child, {
|
|
3893
3926
|
...childProps,
|
|
3894
3927
|
ref: (el) => {
|
|
3895
3928
|
tabRefs.current[index] = el;
|
|
@@ -3908,7 +3941,7 @@ var TabList = ({
|
|
|
3908
3941
|
})
|
|
3909
3942
|
);
|
|
3910
3943
|
};
|
|
3911
|
-
var Tab =
|
|
3944
|
+
var Tab = import_react53.default.forwardRef(
|
|
3912
3945
|
({
|
|
3913
3946
|
label,
|
|
3914
3947
|
value,
|
|
@@ -3924,7 +3957,7 @@ var Tab = import_react54.default.forwardRef(
|
|
|
3924
3957
|
position = "horizontal"
|
|
3925
3958
|
}, ref) => {
|
|
3926
3959
|
const isSelected = value === selectedTabValue;
|
|
3927
|
-
return /* @__PURE__ */
|
|
3960
|
+
return /* @__PURE__ */ import_react53.default.createElement(
|
|
3928
3961
|
"button",
|
|
3929
3962
|
{
|
|
3930
3963
|
ref,
|
|
@@ -3965,9 +3998,9 @@ var Tab = import_react54.default.forwardRef(
|
|
|
3965
3998
|
),
|
|
3966
3999
|
onClick: () => onChange(value)
|
|
3967
4000
|
},
|
|
3968
|
-
icon && /* @__PURE__ */
|
|
4001
|
+
icon && /* @__PURE__ */ import_react53.default.createElement("span", { "aria-hidden": "true" }, icon),
|
|
3969
4002
|
label,
|
|
3970
|
-
content && /* @__PURE__ */
|
|
4003
|
+
content && /* @__PURE__ */ import_react53.default.createElement("span", { "aria-hidden": "true" }, content)
|
|
3971
4004
|
);
|
|
3972
4005
|
}
|
|
3973
4006
|
);
|
|
@@ -3977,7 +4010,7 @@ var TabPanel = ({
|
|
|
3977
4010
|
children,
|
|
3978
4011
|
className
|
|
3979
4012
|
}) => {
|
|
3980
|
-
return value === currentValue ? /* @__PURE__ */
|
|
4013
|
+
return value === currentValue ? /* @__PURE__ */ import_react53.default.createElement(
|
|
3981
4014
|
"div",
|
|
3982
4015
|
{
|
|
3983
4016
|
role: "tabpanel",
|
|
@@ -3993,20 +4026,10 @@ var Tabs_default = TabsContainer;
|
|
|
3993
4026
|
Tab.displayName = "Tab";
|
|
3994
4027
|
|
|
3995
4028
|
// app/components/Textarea.tsx
|
|
3996
|
-
var
|
|
3997
|
-
var Textarea = (0,
|
|
3998
|
-
({
|
|
3999
|
-
|
|
4000
|
-
className,
|
|
4001
|
-
rows,
|
|
4002
|
-
cols,
|
|
4003
|
-
disabled,
|
|
4004
|
-
error,
|
|
4005
|
-
children,
|
|
4006
|
-
id,
|
|
4007
|
-
...props
|
|
4008
|
-
}, ref) => {
|
|
4009
|
-
return /* @__PURE__ */ import_react55.default.createElement(
|
|
4029
|
+
var import_react54 = __toESM(require("react"), 1);
|
|
4030
|
+
var Textarea = (0, import_react54.forwardRef)(
|
|
4031
|
+
({ size, className, rows, cols, disabled, error, children, id, ...props }, ref) => {
|
|
4032
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
4010
4033
|
"textarea",
|
|
4011
4034
|
{
|
|
4012
4035
|
...props,
|
|
@@ -4015,7 +4038,7 @@ var Textarea = (0, import_react55.forwardRef)(
|
|
|
4015
4038
|
rows,
|
|
4016
4039
|
cols,
|
|
4017
4040
|
className: cn(
|
|
4018
|
-
"group flex items-center gap-2 border border-gray-200 rounded-lg bg-gray-
|
|
4041
|
+
"group flex items-center gap-2 border border-gray-200 rounded-lg bg-gray-25 shadow-xs hover:bg-gray-50 hover:border-gray-300 text-sm focus-within:border-primary-600 focus-within:bg-gray-25 focus-within:hover:bg-gray-50 focus-within:hover:border-primary-600 outline-none disabled:bg-gray-300 disabled:select-none disabled:pointer-events-none disabled:opacity-30 w-full placeholder:text-gray-500 hover:placeholder:text-gray-500 shadow-[0px_1px_2px_0px_#1018280D]",
|
|
4019
4042
|
size === "sm" ? "py-2.5 px-3.5" : "p-2.5",
|
|
4020
4043
|
error && "border-error-500 hover:border-error-600 focus-within:hover:border-error-500 focus-within:border-error-500",
|
|
4021
4044
|
className,
|
|
@@ -4030,8 +4053,8 @@ Textarea.displayName = "Textarea";
|
|
|
4030
4053
|
var Textarea_default = Textarea;
|
|
4031
4054
|
|
|
4032
4055
|
// app/components/TextInputWithLabel.tsx
|
|
4033
|
-
var
|
|
4034
|
-
var
|
|
4056
|
+
var import_react55 = require("@remixicon/react");
|
|
4057
|
+
var import_react56 = __toESM(require("react"), 1);
|
|
4035
4058
|
var TextInputWithLabel = ({
|
|
4036
4059
|
intent = "primary",
|
|
4037
4060
|
placeholder = "Enter tags",
|
|
@@ -4063,7 +4086,7 @@ var TextInputWithLabel = ({
|
|
|
4063
4086
|
const pasteData = e.clipboardData.getData("text");
|
|
4064
4087
|
handleAddTags(pasteData);
|
|
4065
4088
|
};
|
|
4066
|
-
return /* @__PURE__ */
|
|
4089
|
+
return /* @__PURE__ */ import_react56.default.createElement("div", null, /* @__PURE__ */ import_react56.default.createElement(
|
|
4067
4090
|
Input_default,
|
|
4068
4091
|
{
|
|
4069
4092
|
type,
|
|
@@ -4074,14 +4097,14 @@ var TextInputWithLabel = ({
|
|
|
4074
4097
|
className: "w-full",
|
|
4075
4098
|
...props
|
|
4076
4099
|
}
|
|
4077
|
-
), /* @__PURE__ */
|
|
4100
|
+
), /* @__PURE__ */ import_react56.default.createElement("div", { className: "flex flex-wrap items-center gap-2 mt-2 transition-all duration-300" }, tags == null ? void 0 : tags.map((tag, idx) => /* @__PURE__ */ import_react56.default.createElement(
|
|
4078
4101
|
Chip_default,
|
|
4079
4102
|
{
|
|
4080
4103
|
size: "md",
|
|
4081
4104
|
intent,
|
|
4082
4105
|
key: `${tag}-${idx}`,
|
|
4083
|
-
endIcon: /* @__PURE__ */
|
|
4084
|
-
|
|
4106
|
+
endIcon: /* @__PURE__ */ import_react56.default.createElement(
|
|
4107
|
+
import_react55.RiCloseCircleLine,
|
|
4085
4108
|
{
|
|
4086
4109
|
size: 14,
|
|
4087
4110
|
className: "cursor-pointer hover:text-red-500",
|
|
@@ -4096,7 +4119,7 @@ var TextInputWithLabel_default = TextInputWithLabel;
|
|
|
4096
4119
|
|
|
4097
4120
|
// app/components/Toggle.tsx
|
|
4098
4121
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
4099
|
-
var
|
|
4122
|
+
var import_react57 = __toESM(require("react"), 1);
|
|
4100
4123
|
var toggleVariants = (0, import_class_variance_authority8.cva)("", {
|
|
4101
4124
|
variants: {
|
|
4102
4125
|
size: {
|
|
@@ -4114,9 +4137,9 @@ var toggleVariants = (0, import_class_variance_authority8.cva)("", {
|
|
|
4114
4137
|
intent: "primary"
|
|
4115
4138
|
}
|
|
4116
4139
|
});
|
|
4117
|
-
var Toggle = (0,
|
|
4140
|
+
var Toggle = (0, import_react57.forwardRef)(
|
|
4118
4141
|
({ size, className, intent, disabled, children, id, ...props }, ref) => {
|
|
4119
|
-
return /* @__PURE__ */
|
|
4142
|
+
return /* @__PURE__ */ import_react57.default.createElement(
|
|
4120
4143
|
"label",
|
|
4121
4144
|
{
|
|
4122
4145
|
className: cn(
|
|
@@ -4125,7 +4148,7 @@ var Toggle = (0, import_react58.forwardRef)(
|
|
|
4125
4148
|
),
|
|
4126
4149
|
htmlFor: id
|
|
4127
4150
|
},
|
|
4128
|
-
/* @__PURE__ */
|
|
4151
|
+
/* @__PURE__ */ import_react57.default.createElement(
|
|
4129
4152
|
"input",
|
|
4130
4153
|
{
|
|
4131
4154
|
type: "checkbox",
|
|
@@ -4138,7 +4161,7 @@ var Toggle = (0, import_react58.forwardRef)(
|
|
|
4138
4161
|
className: "sr-only peer"
|
|
4139
4162
|
}
|
|
4140
4163
|
),
|
|
4141
|
-
/* @__PURE__ */
|
|
4164
|
+
/* @__PURE__ */ import_react57.default.createElement(
|
|
4142
4165
|
"span",
|
|
4143
4166
|
{
|
|
4144
4167
|
className: cn(
|
|
@@ -4161,7 +4184,7 @@ var Toggle_default = Toggle;
|
|
|
4161
4184
|
|
|
4162
4185
|
// app/components/Tooltip.tsx
|
|
4163
4186
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
4164
|
-
var
|
|
4187
|
+
var import_react58 = __toESM(require("react"), 1);
|
|
4165
4188
|
var tooltipVariants = (0, import_class_variance_authority9.cva)(
|
|
4166
4189
|
"bg-white shadow-lg rounded-lg absolute hidden group-hover:block p-3 z-10 max-w-[328px] w-max whitespace-normal opacity-0 group-hover:opacity-100 transform transition-all duration-1000 ease-in-out group-hover:delay-[2000ms]",
|
|
4167
4190
|
{
|
|
@@ -4195,13 +4218,13 @@ var Tooltip = ({
|
|
|
4195
4218
|
className,
|
|
4196
4219
|
...props
|
|
4197
4220
|
}) => {
|
|
4198
|
-
return /* @__PURE__ */
|
|
4221
|
+
return /* @__PURE__ */ import_react58.default.createElement("div", { ...props, className: "relative cursor-pointer text-sm group w-fit" }, /* @__PURE__ */ import_react58.default.createElement("div", null, children), /* @__PURE__ */ import_react58.default.createElement("div", { className: cn(tooltipVariants({ position }), className) }, content, /* @__PURE__ */ import_react58.default.createElement("div", { className: cn(arrowVariants({ position })) })));
|
|
4199
4222
|
};
|
|
4200
4223
|
var Tooltip_default = Tooltip;
|
|
4201
4224
|
|
|
4202
4225
|
// app/components/TreeView.tsx
|
|
4203
|
-
var
|
|
4204
|
-
var
|
|
4226
|
+
var import_react59 = __toESM(require("react"), 1);
|
|
4227
|
+
var import_react60 = require("@remixicon/react");
|
|
4205
4228
|
var TreeView = ({
|
|
4206
4229
|
children,
|
|
4207
4230
|
"aria-label": ariaLabel,
|
|
@@ -4213,16 +4236,16 @@ var TreeView = ({
|
|
|
4213
4236
|
allowMultiple = true,
|
|
4214
4237
|
expandTopLevelByDefault = false
|
|
4215
4238
|
}) => {
|
|
4216
|
-
const topLevelIds =
|
|
4217
|
-
(child) =>
|
|
4239
|
+
const topLevelIds = import_react59.default.Children.toArray(children).map(
|
|
4240
|
+
(child) => import_react59.default.isValidElement(child) ? child.props.id : null
|
|
4218
4241
|
).filter(Boolean);
|
|
4219
|
-
const [internalExpanded, setInternalExpanded] = (0,
|
|
4242
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react59.useState)(
|
|
4220
4243
|
() => new Set(
|
|
4221
4244
|
defaultExpandedIds.length ? defaultExpandedIds : expandTopLevelByDefault ? topLevelIds : []
|
|
4222
4245
|
)
|
|
4223
4246
|
);
|
|
4224
4247
|
const expandedNodes = expandedIds ? new Set(expandedIds) : internalExpanded;
|
|
4225
|
-
const [selectedId, setSelectedId] = (0,
|
|
4248
|
+
const [selectedId, setSelectedId] = (0, import_react59.useState)(null);
|
|
4226
4249
|
const toggleNode = (id) => {
|
|
4227
4250
|
const updateSet = (set) => {
|
|
4228
4251
|
const next = new Set(set);
|
|
@@ -4242,9 +4265,9 @@ var TreeView = ({
|
|
|
4242
4265
|
}
|
|
4243
4266
|
};
|
|
4244
4267
|
const handleSelect = (id) => setSelectedId(id);
|
|
4245
|
-
const enhanceChildren = (nodes, level = 0) =>
|
|
4246
|
-
if (
|
|
4247
|
-
return
|
|
4268
|
+
const enhanceChildren = (nodes, level = 0) => import_react59.default.Children.map(nodes, (child) => {
|
|
4269
|
+
if (import_react59.default.isValidElement(child)) {
|
|
4270
|
+
return import_react59.default.cloneElement(child, {
|
|
4248
4271
|
level,
|
|
4249
4272
|
expanded: expandedNodes.has(child.props.id),
|
|
4250
4273
|
onToggle: toggleNode,
|
|
@@ -4256,7 +4279,7 @@ var TreeView = ({
|
|
|
4256
4279
|
}
|
|
4257
4280
|
return child;
|
|
4258
4281
|
});
|
|
4259
|
-
return /* @__PURE__ */
|
|
4282
|
+
return /* @__PURE__ */ import_react59.default.createElement(
|
|
4260
4283
|
"ul",
|
|
4261
4284
|
{
|
|
4262
4285
|
role: "tree",
|
|
@@ -4266,7 +4289,7 @@ var TreeView = ({
|
|
|
4266
4289
|
enhanceChildren(children)
|
|
4267
4290
|
);
|
|
4268
4291
|
};
|
|
4269
|
-
var DefaultExpandIcon = ({ expanded }) => /* @__PURE__ */
|
|
4292
|
+
var DefaultExpandIcon = ({ expanded }) => /* @__PURE__ */ import_react59.default.createElement("span", { className: "transition-transform duration-200" }, expanded ? /* @__PURE__ */ import_react59.default.createElement(import_react60.RiArrowDownSFill, { size: 18 }) : /* @__PURE__ */ import_react59.default.createElement(import_react60.RiArrowRightSFill, { size: 18 }));
|
|
4270
4293
|
var TreeViewItem = ({
|
|
4271
4294
|
id,
|
|
4272
4295
|
children,
|
|
@@ -4283,8 +4306,8 @@ var TreeViewItem = ({
|
|
|
4283
4306
|
const trailing = [];
|
|
4284
4307
|
const content = [];
|
|
4285
4308
|
let subTree = null;
|
|
4286
|
-
|
|
4287
|
-
if (
|
|
4309
|
+
import_react59.default.Children.forEach(children, (child) => {
|
|
4310
|
+
if (import_react59.default.isValidElement(child)) {
|
|
4288
4311
|
if (child.type === TreeViewLeadingVisual)
|
|
4289
4312
|
leading.push(child);
|
|
4290
4313
|
else if (child.type === TreeViewTrailingVisual)
|
|
@@ -4325,8 +4348,8 @@ var TreeViewItem = ({
|
|
|
4325
4348
|
break;
|
|
4326
4349
|
}
|
|
4327
4350
|
};
|
|
4328
|
-
const processedSubTree = subTree &&
|
|
4329
|
-
return /* @__PURE__ */
|
|
4351
|
+
const processedSubTree = subTree && import_react59.default.isValidElement(subTree) ? import_react59.default.cloneElement(subTree, { expanded, flat }) : null;
|
|
4352
|
+
return /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, /* @__PURE__ */ import_react59.default.createElement(
|
|
4330
4353
|
"li",
|
|
4331
4354
|
{
|
|
4332
4355
|
role: "treeitem",
|
|
@@ -4344,8 +4367,8 @@ var TreeViewItem = ({
|
|
|
4344
4367
|
onKeyDown: handleKeyDown,
|
|
4345
4368
|
tabIndex: 0
|
|
4346
4369
|
},
|
|
4347
|
-
/* @__PURE__ */
|
|
4348
|
-
/* @__PURE__ */
|
|
4370
|
+
/* @__PURE__ */ import_react59.default.createElement("span", { className: "flex items-center gap-1" }, !leading.length && hasSubTree && !flat && /* @__PURE__ */ import_react59.default.createElement(DefaultExpandIcon, { expanded }), leading),
|
|
4371
|
+
/* @__PURE__ */ import_react59.default.createElement("span", { className: "flex-1" }, content),
|
|
4349
4372
|
trailing
|
|
4350
4373
|
), processedSubTree);
|
|
4351
4374
|
};
|
|
@@ -4360,9 +4383,9 @@ var TreeViewSubTree = ({
|
|
|
4360
4383
|
if (flat)
|
|
4361
4384
|
return null;
|
|
4362
4385
|
if (state === "loading") {
|
|
4363
|
-
return /* @__PURE__ */
|
|
4386
|
+
return /* @__PURE__ */ import_react59.default.createElement("ul", { role: "group", className: cn("list-none m-0", className) }, /* @__PURE__ */ import_react59.default.createElement("li", { className: "text-gray-500 italic p-1 pl-6" }, "Loading", count ? ` ${count} items...` : "..."));
|
|
4364
4387
|
}
|
|
4365
|
-
return /* @__PURE__ */
|
|
4388
|
+
return /* @__PURE__ */ import_react59.default.createElement(
|
|
4366
4389
|
"ul",
|
|
4367
4390
|
{
|
|
4368
4391
|
role: "group",
|
|
@@ -4375,8 +4398,8 @@ var TreeViewSubTree = ({
|
|
|
4375
4398
|
children
|
|
4376
4399
|
);
|
|
4377
4400
|
};
|
|
4378
|
-
var TreeViewLeadingVisual = ({ children, className }) => /* @__PURE__ */
|
|
4379
|
-
var TreeViewTrailingVisual = ({ children, label, className }) => /* @__PURE__ */
|
|
4401
|
+
var TreeViewLeadingVisual = ({ children, className }) => /* @__PURE__ */ import_react59.default.createElement("span", { className: cn("flex items-center flex-shrink-0", className) }, children);
|
|
4402
|
+
var TreeViewTrailingVisual = ({ children, label, className }) => /* @__PURE__ */ import_react59.default.createElement(
|
|
4380
4403
|
"span",
|
|
4381
4404
|
{
|
|
4382
4405
|
className: cn("flex items-center ml-auto flex-shrink-0", className),
|
|
@@ -4392,7 +4415,7 @@ var TreeView_default = TreeView;
|
|
|
4392
4415
|
|
|
4393
4416
|
// app/components/Typography.tsx
|
|
4394
4417
|
var import_class_variance_authority10 = require("class-variance-authority");
|
|
4395
|
-
var
|
|
4418
|
+
var import_react61 = __toESM(require("react"), 1);
|
|
4396
4419
|
var typographyVariant = (0, import_class_variance_authority10.cva)("text-dark", {
|
|
4397
4420
|
variants: {
|
|
4398
4421
|
variant: {
|
|
@@ -4430,7 +4453,7 @@ var Typography = ({
|
|
|
4430
4453
|
...props
|
|
4431
4454
|
}) => {
|
|
4432
4455
|
const Component = as || ((variant == null ? void 0 : variant.startsWith("b")) ? "p" : variant);
|
|
4433
|
-
return /* @__PURE__ */
|
|
4456
|
+
return /* @__PURE__ */ import_react61.default.createElement(
|
|
4434
4457
|
Component,
|
|
4435
4458
|
{
|
|
4436
4459
|
className: cn(typographyVariant({ variant, intent, className })),
|
|
@@ -4479,9 +4502,9 @@ var Typography_default = Typography;
|
|
|
4479
4502
|
FileUploadPreview,
|
|
4480
4503
|
GlobalNavigation,
|
|
4481
4504
|
HelperText,
|
|
4505
|
+
ImageUploadControlled,
|
|
4482
4506
|
Input,
|
|
4483
4507
|
Label,
|
|
4484
|
-
ListItem,
|
|
4485
4508
|
ListPagination,
|
|
4486
4509
|
Loading,
|
|
4487
4510
|
Modal,
|
|
@@ -4490,7 +4513,6 @@ var Typography_default = Typography;
|
|
|
4490
4513
|
Pagination,
|
|
4491
4514
|
ProgressBar,
|
|
4492
4515
|
Radio,
|
|
4493
|
-
RazorPayFileUpload,
|
|
4494
4516
|
Sidebar,
|
|
4495
4517
|
Skeleton,
|
|
4496
4518
|
Slider,
|