@propknot/shared-ui 1.0.24 → 1.0.26
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.js +402 -64
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +454 -140
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -0
- package/package.json +21 -5
- package/src/styles/globals.css +59 -0
package/dist/index.mjs
CHANGED
|
@@ -173,6 +173,13 @@ var require_notificationTypes = __commonJS({
|
|
|
173
173
|
}
|
|
174
174
|
});
|
|
175
175
|
|
|
176
|
+
// src/lib/utils.js
|
|
177
|
+
import { clsx } from "clsx";
|
|
178
|
+
import { twMerge } from "tailwind-merge";
|
|
179
|
+
function cn(...inputs) {
|
|
180
|
+
return twMerge(clsx(inputs));
|
|
181
|
+
}
|
|
182
|
+
|
|
176
183
|
// src/components/Navigation/Navbar.js
|
|
177
184
|
import React5, { useState as useState4, useEffect as useEffect3 } from "react";
|
|
178
185
|
import {
|
|
@@ -3180,15 +3187,290 @@ var ModernCardContent = ({ children, sx = {}, ...props }) => {
|
|
|
3180
3187
|
ModernCard.Content = ModernCardContent;
|
|
3181
3188
|
var ModernCard_default = ModernCard;
|
|
3182
3189
|
|
|
3190
|
+
// src/components/UI/button.jsx
|
|
3191
|
+
import * as React13 from "react";
|
|
3192
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3193
|
+
import { cva } from "class-variance-authority";
|
|
3194
|
+
var buttonVariants = cva(
|
|
3195
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
3196
|
+
{
|
|
3197
|
+
variants: {
|
|
3198
|
+
variant: {
|
|
3199
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
3200
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
3201
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
3202
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
3203
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
3204
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
3205
|
+
},
|
|
3206
|
+
size: {
|
|
3207
|
+
default: "h-10 px-4 py-2",
|
|
3208
|
+
sm: "h-9 rounded-md px-3",
|
|
3209
|
+
lg: "h-11 rounded-md px-8",
|
|
3210
|
+
icon: "h-10 w-10"
|
|
3211
|
+
}
|
|
3212
|
+
},
|
|
3213
|
+
defaultVariants: {
|
|
3214
|
+
variant: "default",
|
|
3215
|
+
size: "default"
|
|
3216
|
+
}
|
|
3217
|
+
}
|
|
3218
|
+
);
|
|
3219
|
+
var Button2 = React13.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
3220
|
+
const Comp = asChild ? Slot : "button";
|
|
3221
|
+
return /* @__PURE__ */ React13.createElement(
|
|
3222
|
+
Comp,
|
|
3223
|
+
{
|
|
3224
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
3225
|
+
ref,
|
|
3226
|
+
...props
|
|
3227
|
+
}
|
|
3228
|
+
);
|
|
3229
|
+
});
|
|
3230
|
+
Button2.displayName = "Button";
|
|
3231
|
+
|
|
3232
|
+
// src/components/UI/card.jsx
|
|
3233
|
+
import * as React14 from "react";
|
|
3234
|
+
var Card2 = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
3235
|
+
"div",
|
|
3236
|
+
{
|
|
3237
|
+
ref,
|
|
3238
|
+
className: cn(
|
|
3239
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
3240
|
+
className
|
|
3241
|
+
),
|
|
3242
|
+
...props
|
|
3243
|
+
}
|
|
3244
|
+
));
|
|
3245
|
+
Card2.displayName = "Card";
|
|
3246
|
+
var CardHeader = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
3247
|
+
"div",
|
|
3248
|
+
{
|
|
3249
|
+
ref,
|
|
3250
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
3251
|
+
...props
|
|
3252
|
+
}
|
|
3253
|
+
));
|
|
3254
|
+
CardHeader.displayName = "CardHeader";
|
|
3255
|
+
var CardTitle = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
3256
|
+
"h3",
|
|
3257
|
+
{
|
|
3258
|
+
ref,
|
|
3259
|
+
className: cn(
|
|
3260
|
+
"text-2xl font-semibold leading-none tracking-tight",
|
|
3261
|
+
className
|
|
3262
|
+
),
|
|
3263
|
+
...props
|
|
3264
|
+
}
|
|
3265
|
+
));
|
|
3266
|
+
CardTitle.displayName = "CardTitle";
|
|
3267
|
+
var CardDescription = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
3268
|
+
"p",
|
|
3269
|
+
{
|
|
3270
|
+
ref,
|
|
3271
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
3272
|
+
...props
|
|
3273
|
+
}
|
|
3274
|
+
));
|
|
3275
|
+
CardDescription.displayName = "CardDescription";
|
|
3276
|
+
var CardContent2 = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
3277
|
+
CardContent2.displayName = "CardContent";
|
|
3278
|
+
var CardFooter = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
3279
|
+
"div",
|
|
3280
|
+
{
|
|
3281
|
+
ref,
|
|
3282
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
3283
|
+
...props
|
|
3284
|
+
}
|
|
3285
|
+
));
|
|
3286
|
+
CardFooter.displayName = "CardFooter";
|
|
3287
|
+
|
|
3288
|
+
// src/components/UI/input.jsx
|
|
3289
|
+
import * as React15 from "react";
|
|
3290
|
+
var Input = React15.forwardRef(({ className, type, ...props }, ref) => {
|
|
3291
|
+
return /* @__PURE__ */ React15.createElement(
|
|
3292
|
+
"input",
|
|
3293
|
+
{
|
|
3294
|
+
type,
|
|
3295
|
+
className: cn(
|
|
3296
|
+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
3297
|
+
className
|
|
3298
|
+
),
|
|
3299
|
+
ref,
|
|
3300
|
+
...props
|
|
3301
|
+
}
|
|
3302
|
+
);
|
|
3303
|
+
});
|
|
3304
|
+
Input.displayName = "Input";
|
|
3305
|
+
|
|
3306
|
+
// src/components/UI/label.jsx
|
|
3307
|
+
import * as React16 from "react";
|
|
3308
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3309
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
3310
|
+
var labelVariants = cva2(
|
|
3311
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
3312
|
+
);
|
|
3313
|
+
var Label = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React16.createElement(
|
|
3314
|
+
LabelPrimitive.Root,
|
|
3315
|
+
{
|
|
3316
|
+
ref,
|
|
3317
|
+
className: cn(labelVariants(), className),
|
|
3318
|
+
...props
|
|
3319
|
+
}
|
|
3320
|
+
));
|
|
3321
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
3322
|
+
|
|
3323
|
+
// src/components/UI/typography.jsx
|
|
3324
|
+
import * as React17 from "react";
|
|
3325
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
3326
|
+
var headingVariants = cva3("scroll-m-20 tracking-tight", {
|
|
3327
|
+
variants: {
|
|
3328
|
+
level: {
|
|
3329
|
+
h1: "text-4xl font-extrabold lg:text-5xl",
|
|
3330
|
+
h2: "text-3xl font-semibold",
|
|
3331
|
+
h3: "text-2xl font-semibold",
|
|
3332
|
+
h4: "text-xl font-semibold",
|
|
3333
|
+
h5: "text-lg font-semibold",
|
|
3334
|
+
h6: "text-base font-semibold"
|
|
3335
|
+
}
|
|
3336
|
+
},
|
|
3337
|
+
defaultVariants: {
|
|
3338
|
+
level: "h2"
|
|
3339
|
+
}
|
|
3340
|
+
});
|
|
3341
|
+
var Heading = React17.forwardRef(({ className, level = "h2", ...props }, ref) => {
|
|
3342
|
+
const Comp = level;
|
|
3343
|
+
return /* @__PURE__ */ React17.createElement(
|
|
3344
|
+
Comp,
|
|
3345
|
+
{
|
|
3346
|
+
ref,
|
|
3347
|
+
className: cn(headingVariants({ level, className })),
|
|
3348
|
+
...props
|
|
3349
|
+
}
|
|
3350
|
+
);
|
|
3351
|
+
});
|
|
3352
|
+
Heading.displayName = "Heading";
|
|
3353
|
+
var H1 = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3354
|
+
"h1",
|
|
3355
|
+
{
|
|
3356
|
+
ref,
|
|
3357
|
+
className: cn("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl", className),
|
|
3358
|
+
...props
|
|
3359
|
+
}
|
|
3360
|
+
));
|
|
3361
|
+
H1.displayName = "H1";
|
|
3362
|
+
var H2 = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3363
|
+
"h2",
|
|
3364
|
+
{
|
|
3365
|
+
ref,
|
|
3366
|
+
className: cn("scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0", className),
|
|
3367
|
+
...props
|
|
3368
|
+
}
|
|
3369
|
+
));
|
|
3370
|
+
H2.displayName = "H2";
|
|
3371
|
+
var H3 = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3372
|
+
"h3",
|
|
3373
|
+
{
|
|
3374
|
+
ref,
|
|
3375
|
+
className: cn("scroll-m-20 text-2xl font-semibold tracking-tight", className),
|
|
3376
|
+
...props
|
|
3377
|
+
}
|
|
3378
|
+
));
|
|
3379
|
+
H3.displayName = "H3";
|
|
3380
|
+
var H4 = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3381
|
+
"h4",
|
|
3382
|
+
{
|
|
3383
|
+
ref,
|
|
3384
|
+
className: cn("scroll-m-20 text-xl font-semibold tracking-tight", className),
|
|
3385
|
+
...props
|
|
3386
|
+
}
|
|
3387
|
+
));
|
|
3388
|
+
H4.displayName = "H4";
|
|
3389
|
+
var P = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3390
|
+
"p",
|
|
3391
|
+
{
|
|
3392
|
+
ref,
|
|
3393
|
+
className: cn("leading-7 [&:not(:first-child)]:mt-6", className),
|
|
3394
|
+
...props
|
|
3395
|
+
}
|
|
3396
|
+
));
|
|
3397
|
+
P.displayName = "P";
|
|
3398
|
+
var Blockquote = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3399
|
+
"blockquote",
|
|
3400
|
+
{
|
|
3401
|
+
ref,
|
|
3402
|
+
className: cn("mt-6 border-l-2 pl-6 italic", className),
|
|
3403
|
+
...props
|
|
3404
|
+
}
|
|
3405
|
+
));
|
|
3406
|
+
Blockquote.displayName = "Blockquote";
|
|
3407
|
+
var List2 = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3408
|
+
"ul",
|
|
3409
|
+
{
|
|
3410
|
+
ref,
|
|
3411
|
+
className: cn("my-6 ml-6 list-disc [&>li]:mt-2", className),
|
|
3412
|
+
...props
|
|
3413
|
+
}
|
|
3414
|
+
));
|
|
3415
|
+
List2.displayName = "List";
|
|
3416
|
+
var InlineCode = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3417
|
+
"code",
|
|
3418
|
+
{
|
|
3419
|
+
ref,
|
|
3420
|
+
className: cn(
|
|
3421
|
+
"relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",
|
|
3422
|
+
className
|
|
3423
|
+
),
|
|
3424
|
+
...props
|
|
3425
|
+
}
|
|
3426
|
+
));
|
|
3427
|
+
InlineCode.displayName = "InlineCode";
|
|
3428
|
+
var Lead = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3429
|
+
"p",
|
|
3430
|
+
{
|
|
3431
|
+
ref,
|
|
3432
|
+
className: cn("text-xl text-muted-foreground", className),
|
|
3433
|
+
...props
|
|
3434
|
+
}
|
|
3435
|
+
));
|
|
3436
|
+
Lead.displayName = "Lead";
|
|
3437
|
+
var Large = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3438
|
+
"div",
|
|
3439
|
+
{
|
|
3440
|
+
ref,
|
|
3441
|
+
className: cn("text-lg font-semibold", className),
|
|
3442
|
+
...props
|
|
3443
|
+
}
|
|
3444
|
+
));
|
|
3445
|
+
Large.displayName = "Large";
|
|
3446
|
+
var Small = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3447
|
+
"small",
|
|
3448
|
+
{
|
|
3449
|
+
ref,
|
|
3450
|
+
className: cn("text-sm font-medium leading-none", className),
|
|
3451
|
+
...props
|
|
3452
|
+
}
|
|
3453
|
+
));
|
|
3454
|
+
Small.displayName = "Small";
|
|
3455
|
+
var Muted = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3456
|
+
"p",
|
|
3457
|
+
{
|
|
3458
|
+
ref,
|
|
3459
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
3460
|
+
...props
|
|
3461
|
+
}
|
|
3462
|
+
));
|
|
3463
|
+
Muted.displayName = "Muted";
|
|
3464
|
+
|
|
3183
3465
|
// src/components/Notifications/NotificationManager.js
|
|
3184
|
-
import
|
|
3466
|
+
import React18 from "react";
|
|
3185
3467
|
import {
|
|
3186
3468
|
Box as Box8,
|
|
3187
3469
|
Snackbar,
|
|
3188
3470
|
Alert,
|
|
3189
3471
|
AlertTitle,
|
|
3190
3472
|
IconButton as IconButton2,
|
|
3191
|
-
Button as
|
|
3473
|
+
Button as Button3,
|
|
3192
3474
|
LinearProgress,
|
|
3193
3475
|
Typography as Typography6,
|
|
3194
3476
|
Slide,
|
|
@@ -3214,12 +3496,12 @@ var NotificationItem = ({ notification, onClose, onAction }) => {
|
|
|
3214
3496
|
}
|
|
3215
3497
|
const getSeverityIcon = (type) => {
|
|
3216
3498
|
const icons = {
|
|
3217
|
-
success: /* @__PURE__ */
|
|
3218
|
-
error: /* @__PURE__ */
|
|
3219
|
-
warning: /* @__PURE__ */
|
|
3220
|
-
info: /* @__PURE__ */
|
|
3499
|
+
success: /* @__PURE__ */ React18.createElement(CheckCircle, null),
|
|
3500
|
+
error: /* @__PURE__ */ React18.createElement(Error2, null),
|
|
3501
|
+
warning: /* @__PURE__ */ React18.createElement(Warning, null),
|
|
3502
|
+
info: /* @__PURE__ */ React18.createElement(Info, null)
|
|
3221
3503
|
};
|
|
3222
|
-
return icons[type] || /* @__PURE__ */
|
|
3504
|
+
return icons[type] || /* @__PURE__ */ React18.createElement(Info, null);
|
|
3223
3505
|
};
|
|
3224
3506
|
const handleActionClick = (action) => {
|
|
3225
3507
|
if (action && action.onClick) {
|
|
@@ -3234,13 +3516,13 @@ var NotificationItem = ({ notification, onClose, onAction }) => {
|
|
|
3234
3516
|
onClose();
|
|
3235
3517
|
}
|
|
3236
3518
|
};
|
|
3237
|
-
return /* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ React18.createElement(
|
|
3238
3520
|
Alert,
|
|
3239
3521
|
{
|
|
3240
3522
|
severity: notification.type,
|
|
3241
3523
|
icon: getSeverityIcon(notification.type),
|
|
3242
|
-
action: /* @__PURE__ */
|
|
3243
|
-
|
|
3524
|
+
action: /* @__PURE__ */ React18.createElement(Box8, { display: "flex", alignItems: "center", gap: 1 }, (_a = notification.actions) == null ? void 0 : _a.map((action, index) => /* @__PURE__ */ React18.createElement(
|
|
3525
|
+
Button3,
|
|
3244
3526
|
{
|
|
3245
3527
|
key: index,
|
|
3246
3528
|
size: "small",
|
|
@@ -3255,14 +3537,14 @@ var NotificationItem = ({ notification, onClose, onAction }) => {
|
|
|
3255
3537
|
}
|
|
3256
3538
|
},
|
|
3257
3539
|
action.label
|
|
3258
|
-
)), typeof notification.progress === "number" && /* @__PURE__ */
|
|
3540
|
+
)), typeof notification.progress === "number" && /* @__PURE__ */ React18.createElement(Box8, { sx: { minWidth: 120 } }, /* @__PURE__ */ React18.createElement(
|
|
3259
3541
|
LinearProgress,
|
|
3260
3542
|
{
|
|
3261
3543
|
variant: "determinate",
|
|
3262
3544
|
value: notification.progress,
|
|
3263
3545
|
sx: { height: 6, borderRadius: 3 }
|
|
3264
3546
|
}
|
|
3265
|
-
), /* @__PURE__ */
|
|
3547
|
+
), /* @__PURE__ */ React18.createElement(Typography6, { variant: "caption", sx: { fontSize: "0.7rem" } }, Math.round(notification.progress), "%")), notification.timestamp && /* @__PURE__ */ React18.createElement(
|
|
3266
3548
|
Chip,
|
|
3267
3549
|
{
|
|
3268
3550
|
label: (() => {
|
|
@@ -3280,14 +3562,14 @@ var NotificationItem = ({ notification, onClose, onAction }) => {
|
|
|
3280
3562
|
opacity: 0.7
|
|
3281
3563
|
}
|
|
3282
3564
|
}
|
|
3283
|
-
), notification.dismissible && /* @__PURE__ */
|
|
3565
|
+
), notification.dismissible && /* @__PURE__ */ React18.createElement(
|
|
3284
3566
|
IconButton2,
|
|
3285
3567
|
{
|
|
3286
3568
|
size: "small",
|
|
3287
3569
|
onClick: safeOnClose,
|
|
3288
3570
|
sx: { ml: 1 }
|
|
3289
3571
|
},
|
|
3290
|
-
/* @__PURE__ */
|
|
3572
|
+
/* @__PURE__ */ React18.createElement(Close, { fontSize: "small" })
|
|
3291
3573
|
)),
|
|
3292
3574
|
sx: {
|
|
3293
3575
|
mb: 1,
|
|
@@ -3297,8 +3579,8 @@ var NotificationItem = ({ notification, onClose, onAction }) => {
|
|
|
3297
3579
|
}
|
|
3298
3580
|
}
|
|
3299
3581
|
},
|
|
3300
|
-
notification.title && /* @__PURE__ */
|
|
3301
|
-
/* @__PURE__ */
|
|
3582
|
+
notification.title && /* @__PURE__ */ React18.createElement(AlertTitle, { sx: { fontSize: "0.875rem", mb: 0.5 } }, notification.title),
|
|
3583
|
+
/* @__PURE__ */ React18.createElement(Typography6, { variant: "body2", sx: { fontSize: "0.8rem" } }, notification.message)
|
|
3302
3584
|
);
|
|
3303
3585
|
};
|
|
3304
3586
|
var NotificationManager = () => {
|
|
@@ -3309,7 +3591,7 @@ var NotificationManager = () => {
|
|
|
3309
3591
|
if (notifications.length === 0) {
|
|
3310
3592
|
return null;
|
|
3311
3593
|
}
|
|
3312
|
-
return /* @__PURE__ */
|
|
3594
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, persistentNotifications.length > 0 && /* @__PURE__ */ React18.createElement(
|
|
3313
3595
|
Box8,
|
|
3314
3596
|
{
|
|
3315
3597
|
sx: {
|
|
@@ -3323,8 +3605,8 @@ var NotificationManager = () => {
|
|
|
3323
3605
|
overflow: "auto"
|
|
3324
3606
|
}
|
|
3325
3607
|
},
|
|
3326
|
-
/* @__PURE__ */
|
|
3327
|
-
|
|
3608
|
+
/* @__PURE__ */ React18.createElement(Stack5, { spacing: 1 }, persistentNotifications.length > 1 && /* @__PURE__ */ React18.createElement(Box8, { display: "flex", justifyContent: "flex-end", mb: 1 }, /* @__PURE__ */ React18.createElement(
|
|
3609
|
+
Button3,
|
|
3328
3610
|
{
|
|
3329
3611
|
size: "small",
|
|
3330
3612
|
variant: "outlined",
|
|
@@ -3336,7 +3618,7 @@ var NotificationManager = () => {
|
|
|
3336
3618
|
")"
|
|
3337
3619
|
)), persistentNotifications.map((notification) => {
|
|
3338
3620
|
if (!notification || !notification.id) return null;
|
|
3339
|
-
return /* @__PURE__ */
|
|
3621
|
+
return /* @__PURE__ */ React18.createElement(Fade, { key: `notification-${notification.id}`, in: true, timeout: 300 }, /* @__PURE__ */ React18.createElement(Box8, null, /* @__PURE__ */ React18.createElement(
|
|
3340
3622
|
NotificationItem,
|
|
3341
3623
|
{
|
|
3342
3624
|
notification,
|
|
@@ -3344,7 +3626,7 @@ var NotificationManager = () => {
|
|
|
3344
3626
|
}
|
|
3345
3627
|
)));
|
|
3346
3628
|
}))
|
|
3347
|
-
), latestTemporary && /* @__PURE__ */
|
|
3629
|
+
), latestTemporary && /* @__PURE__ */ React18.createElement(
|
|
3348
3630
|
Snackbar,
|
|
3349
3631
|
{
|
|
3350
3632
|
key: `temp-notification-${latestTemporary.id}`,
|
|
@@ -3360,7 +3642,7 @@ var NotificationManager = () => {
|
|
|
3360
3642
|
}
|
|
3361
3643
|
}
|
|
3362
3644
|
},
|
|
3363
|
-
/* @__PURE__ */
|
|
3645
|
+
/* @__PURE__ */ React18.createElement(Box8, null, /* @__PURE__ */ React18.createElement(
|
|
3364
3646
|
NotificationItem,
|
|
3365
3647
|
{
|
|
3366
3648
|
notification: latestTemporary,
|
|
@@ -3372,7 +3654,7 @@ var NotificationManager = () => {
|
|
|
3372
3654
|
var NotificationManager_default = NotificationManager;
|
|
3373
3655
|
|
|
3374
3656
|
// src/components/Notifications/NotificationBell.js
|
|
3375
|
-
import
|
|
3657
|
+
import React19, { useState as useState6, useEffect as useEffect5, useCallback as useCallback2 } from "react";
|
|
3376
3658
|
import {
|
|
3377
3659
|
IconButton as IconButton3,
|
|
3378
3660
|
Badge as Badge2,
|
|
@@ -3384,9 +3666,9 @@ import {
|
|
|
3384
3666
|
Avatar as Avatar2,
|
|
3385
3667
|
ListItemText as ListItemText2,
|
|
3386
3668
|
ListItemAvatar,
|
|
3387
|
-
List as
|
|
3669
|
+
List as List3,
|
|
3388
3670
|
ListItem as ListItem2,
|
|
3389
|
-
Button as
|
|
3671
|
+
Button as Button4,
|
|
3390
3672
|
Chip as Chip2,
|
|
3391
3673
|
CircularProgress as CircularProgress3,
|
|
3392
3674
|
Alert as Alert2
|
|
@@ -3467,7 +3749,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3467
3749
|
};
|
|
3468
3750
|
const handleNotificationRead = (notificationId) => {
|
|
3469
3751
|
setNotifications(
|
|
3470
|
-
(prev) => prev.map((n) => n._id === notificationId ? { ...n, read: true } : n)
|
|
3752
|
+
(prev) => prev.map((n) => (n.id || n._id) === notificationId ? { ...n, is_read: true, read: true } : n)
|
|
3471
3753
|
);
|
|
3472
3754
|
setUnreadCount((prev) => Math.max(0, prev - 1));
|
|
3473
3755
|
};
|
|
@@ -3492,7 +3774,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3492
3774
|
try {
|
|
3493
3775
|
await api2.put(`/notifications/${notificationId}/read`);
|
|
3494
3776
|
setNotifications(
|
|
3495
|
-
(prev) => prev.map((n) => n._id === notificationId ? { ...n, read: true, readAt: /* @__PURE__ */ new Date() } : n)
|
|
3777
|
+
(prev) => prev.map((n) => (n.id || n._id) === notificationId ? { ...n, is_read: true, read: true, read_at: /* @__PURE__ */ new Date(), readAt: /* @__PURE__ */ new Date() } : n)
|
|
3496
3778
|
);
|
|
3497
3779
|
setUnreadCount((prev) => Math.max(0, prev - 1));
|
|
3498
3780
|
} catch (err) {
|
|
@@ -3504,7 +3786,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3504
3786
|
try {
|
|
3505
3787
|
await api2.put("/notifications/mark-all-read");
|
|
3506
3788
|
setNotifications(
|
|
3507
|
-
(prev) => prev.map((n) => ({ ...n, read: true, readAt: /* @__PURE__ */ new Date() }))
|
|
3789
|
+
(prev) => prev.map((n) => ({ ...n, is_read: true, read: true, read_at: /* @__PURE__ */ new Date(), readAt: /* @__PURE__ */ new Date() }))
|
|
3508
3790
|
);
|
|
3509
3791
|
setUnreadCount(0);
|
|
3510
3792
|
} catch (err) {
|
|
@@ -3512,11 +3794,14 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3512
3794
|
}
|
|
3513
3795
|
};
|
|
3514
3796
|
const handleNotificationClick = async (notification) => {
|
|
3515
|
-
|
|
3516
|
-
|
|
3797
|
+
const isRead = notification.is_read || notification.read;
|
|
3798
|
+
const notifId = notification.id || notification._id;
|
|
3799
|
+
if (!isRead) {
|
|
3800
|
+
await handleMarkAsRead(notifId);
|
|
3517
3801
|
}
|
|
3518
|
-
|
|
3519
|
-
|
|
3802
|
+
const actionUrl = notification.action_url || notification.actionUrl;
|
|
3803
|
+
if (actionUrl) {
|
|
3804
|
+
window.location.href = actionUrl;
|
|
3520
3805
|
}
|
|
3521
3806
|
handleClose();
|
|
3522
3807
|
};
|
|
@@ -3534,30 +3819,30 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3534
3819
|
case "TICKET_RESOLVED":
|
|
3535
3820
|
case "TICKET_COMMENTED":
|
|
3536
3821
|
case "TICKET_STATUS_CHANGED":
|
|
3537
|
-
return /* @__PURE__ */
|
|
3822
|
+
return /* @__PURE__ */ React19.createElement(Assignment, { ...iconProps });
|
|
3538
3823
|
case "MESSAGE_RECEIVED":
|
|
3539
3824
|
case "MENTION_RECEIVED":
|
|
3540
|
-
return /* @__PURE__ */
|
|
3825
|
+
return /* @__PURE__ */ React19.createElement(Message, { ...iconProps });
|
|
3541
3826
|
case "PAYMENT_DUE":
|
|
3542
3827
|
case "PAYMENT_OVERDUE":
|
|
3543
|
-
return /* @__PURE__ */
|
|
3828
|
+
return /* @__PURE__ */ React19.createElement(Payment, { ...iconProps });
|
|
3544
3829
|
case "PROPERTY_UPDATED":
|
|
3545
3830
|
case "LEASE_EXPIRING":
|
|
3546
|
-
return /* @__PURE__ */
|
|
3831
|
+
return /* @__PURE__ */ React19.createElement(Home, { ...iconProps });
|
|
3547
3832
|
case "APPLIANCE_MAINTENANCE_DUE":
|
|
3548
3833
|
case "MAINTENANCE_SCHEDULED":
|
|
3549
|
-
return /* @__PURE__ */
|
|
3834
|
+
return /* @__PURE__ */ React19.createElement(Build, { ...iconProps });
|
|
3550
3835
|
case "SYSTEM_ALERT":
|
|
3551
|
-
return /* @__PURE__ */
|
|
3836
|
+
return /* @__PURE__ */ React19.createElement(Warning2, { ...iconProps });
|
|
3552
3837
|
case "SUCCESS":
|
|
3553
|
-
return /* @__PURE__ */
|
|
3838
|
+
return /* @__PURE__ */ React19.createElement(CheckCircle2, { ...iconProps });
|
|
3554
3839
|
case "ERROR":
|
|
3555
|
-
return /* @__PURE__ */
|
|
3840
|
+
return /* @__PURE__ */ React19.createElement(ErrorIcon, { ...iconProps });
|
|
3556
3841
|
case "WARNING":
|
|
3557
|
-
return /* @__PURE__ */
|
|
3842
|
+
return /* @__PURE__ */ React19.createElement(Warning2, { ...iconProps });
|
|
3558
3843
|
case "INFO":
|
|
3559
3844
|
default:
|
|
3560
|
-
return /* @__PURE__ */
|
|
3845
|
+
return /* @__PURE__ */ React19.createElement(Info2, { ...iconProps });
|
|
3561
3846
|
}
|
|
3562
3847
|
};
|
|
3563
3848
|
const getNotificationColor = (type) => {
|
|
@@ -3572,7 +3857,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3572
3857
|
HIGH: "warning",
|
|
3573
3858
|
URGENT: "error"
|
|
3574
3859
|
};
|
|
3575
|
-
return /* @__PURE__ */
|
|
3860
|
+
return /* @__PURE__ */ React19.createElement(
|
|
3576
3861
|
Chip2,
|
|
3577
3862
|
{
|
|
3578
3863
|
label: priority,
|
|
@@ -3582,7 +3867,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3582
3867
|
}
|
|
3583
3868
|
);
|
|
3584
3869
|
};
|
|
3585
|
-
return /* @__PURE__ */
|
|
3870
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
|
|
3586
3871
|
IconButton3,
|
|
3587
3872
|
{
|
|
3588
3873
|
color: "inherit",
|
|
@@ -3594,16 +3879,16 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3594
3879
|
}
|
|
3595
3880
|
}
|
|
3596
3881
|
},
|
|
3597
|
-
/* @__PURE__ */
|
|
3882
|
+
/* @__PURE__ */ React19.createElement(
|
|
3598
3883
|
Badge2,
|
|
3599
3884
|
{
|
|
3600
3885
|
badgeContent: unreadCount,
|
|
3601
3886
|
color: "error",
|
|
3602
3887
|
max: 99
|
|
3603
3888
|
},
|
|
3604
|
-
unreadCount > 0 ? /* @__PURE__ */
|
|
3889
|
+
unreadCount > 0 ? /* @__PURE__ */ React19.createElement(NotificationsIcon, null) : /* @__PURE__ */ React19.createElement(NotificationsNone, null)
|
|
3605
3890
|
)
|
|
3606
|
-
), /* @__PURE__ */
|
|
3891
|
+
), /* @__PURE__ */ React19.createElement(
|
|
3607
3892
|
Menu2,
|
|
3608
3893
|
{
|
|
3609
3894
|
anchorEl,
|
|
@@ -3621,7 +3906,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3621
3906
|
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
3622
3907
|
anchorOrigin: { horizontal: "right", vertical: "bottom" }
|
|
3623
3908
|
},
|
|
3624
|
-
/* @__PURE__ */
|
|
3909
|
+
/* @__PURE__ */ React19.createElement(
|
|
3625
3910
|
Box9,
|
|
3626
3911
|
{
|
|
3627
3912
|
sx: {
|
|
@@ -3634,7 +3919,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3634
3919
|
borderColor: "divider"
|
|
3635
3920
|
}
|
|
3636
3921
|
},
|
|
3637
|
-
/* @__PURE__ */
|
|
3922
|
+
/* @__PURE__ */ React19.createElement(Box9, { sx: { display: "flex", alignItems: "center", gap: 1 } }, /* @__PURE__ */ React19.createElement(NotificationsIcon, { color: "primary" }), /* @__PURE__ */ React19.createElement(Typography7, { variant: "h6", sx: { fontWeight: 600 } }, "Notifications"), unreadCount > 0 && /* @__PURE__ */ React19.createElement(
|
|
3638
3923
|
Chip2,
|
|
3639
3924
|
{
|
|
3640
3925
|
label: unreadCount,
|
|
@@ -3643,19 +3928,19 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3643
3928
|
sx: { height: 22, fontSize: "0.75rem" }
|
|
3644
3929
|
}
|
|
3645
3930
|
)),
|
|
3646
|
-
/* @__PURE__ */
|
|
3647
|
-
|
|
3931
|
+
/* @__PURE__ */ React19.createElement(Box9, null, unreadCount > 0 && /* @__PURE__ */ React19.createElement(
|
|
3932
|
+
Button4,
|
|
3648
3933
|
{
|
|
3649
3934
|
size: "small",
|
|
3650
|
-
startIcon: /* @__PURE__ */
|
|
3935
|
+
startIcon: /* @__PURE__ */ React19.createElement(DoneAll, null),
|
|
3651
3936
|
onClick: handleMarkAllAsRead,
|
|
3652
3937
|
sx: { textTransform: "none", fontSize: "0.75rem" }
|
|
3653
3938
|
},
|
|
3654
3939
|
"Mark all read"
|
|
3655
|
-
), /* @__PURE__ */
|
|
3940
|
+
), /* @__PURE__ */ React19.createElement(IconButton3, { size: "small", onClick: handleClose }, /* @__PURE__ */ React19.createElement(Close2, { fontSize: "small" })))
|
|
3656
3941
|
),
|
|
3657
|
-
error && /* @__PURE__ */
|
|
3658
|
-
/* @__PURE__ */
|
|
3942
|
+
error && /* @__PURE__ */ React19.createElement(Alert2, { severity: "error", sx: { m: 2 } }, error),
|
|
3943
|
+
/* @__PURE__ */ React19.createElement(
|
|
3659
3944
|
Box9,
|
|
3660
3945
|
{
|
|
3661
3946
|
sx: {
|
|
@@ -3664,7 +3949,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3664
3949
|
maxHeight: 450
|
|
3665
3950
|
}
|
|
3666
3951
|
},
|
|
3667
|
-
loading && notifications.length === 0 ? /* @__PURE__ */
|
|
3952
|
+
loading && notifications.length === 0 ? /* @__PURE__ */ React19.createElement(Box9, { sx: { display: "flex", justifyContent: "center", p: 4 } }, /* @__PURE__ */ React19.createElement(CircularProgress3, { size: 32 })) : notifications.length === 0 ? /* @__PURE__ */ React19.createElement(
|
|
3668
3953
|
Box9,
|
|
3669
3954
|
{
|
|
3670
3955
|
sx: {
|
|
@@ -3676,71 +3961,76 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3676
3961
|
textAlign: "center"
|
|
3677
3962
|
}
|
|
3678
3963
|
},
|
|
3679
|
-
/* @__PURE__ */
|
|
3680
|
-
/* @__PURE__ */
|
|
3681
|
-
/* @__PURE__ */
|
|
3682
|
-
) : /* @__PURE__ */
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
py: 1.5,
|
|
3689
|
-
px: 2,
|
|
3690
|
-
bgcolor: notification.read ? "transparent" : "action.hover",
|
|
3691
|
-
"&:hover": {
|
|
3692
|
-
bgcolor: notification.read ? "action.hover" : "action.selected"
|
|
3693
|
-
},
|
|
3694
|
-
borderLeft: notification.read ? "none" : "3px solid",
|
|
3695
|
-
borderLeftColor: getNotificationColor(notification.type),
|
|
3696
|
-
transition: "all 0.2s"
|
|
3697
|
-
}
|
|
3698
|
-
},
|
|
3699
|
-
/* @__PURE__ */ React14.createElement(ListItemAvatar, null, /* @__PURE__ */ React14.createElement(
|
|
3700
|
-
Avatar2,
|
|
3964
|
+
/* @__PURE__ */ React19.createElement(NotificationsNone, { sx: { fontSize: 64, color: "text.secondary", mb: 2 } }),
|
|
3965
|
+
/* @__PURE__ */ React19.createElement(Typography7, { variant: "body1", color: "text.secondary", sx: { fontWeight: 500 } }, "No notifications yet"),
|
|
3966
|
+
/* @__PURE__ */ React19.createElement(Typography7, { variant: "body2", color: "text.secondary" }, "You're all caught up!")
|
|
3967
|
+
) : /* @__PURE__ */ React19.createElement(List3, { sx: { p: 0 } }, notifications.map((notification, index) => {
|
|
3968
|
+
const isRead = notification.is_read || notification.read;
|
|
3969
|
+
const notifId = notification.id || notification._id;
|
|
3970
|
+
const createdAt = notification.created_at || notification.createdAt;
|
|
3971
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, { key: notifId }, /* @__PURE__ */ React19.createElement(
|
|
3972
|
+
ListItem2,
|
|
3701
3973
|
{
|
|
3974
|
+
button: true,
|
|
3975
|
+
onClick: () => handleNotificationClick(notification),
|
|
3702
3976
|
sx: {
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3977
|
+
py: 1.5,
|
|
3978
|
+
px: 2,
|
|
3979
|
+
bgcolor: isRead ? "transparent" : "action.hover",
|
|
3980
|
+
"&:hover": {
|
|
3981
|
+
bgcolor: isRead ? "action.hover" : "action.selected"
|
|
3982
|
+
},
|
|
3983
|
+
borderLeft: isRead ? "none" : "3px solid",
|
|
3984
|
+
borderLeftColor: getNotificationColor(notification.type),
|
|
3985
|
+
transition: "all 0.2s"
|
|
3706
3986
|
}
|
|
3707
3987
|
},
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3988
|
+
/* @__PURE__ */ React19.createElement(ListItemAvatar, null, /* @__PURE__ */ React19.createElement(
|
|
3989
|
+
Avatar2,
|
|
3990
|
+
{
|
|
3991
|
+
sx: {
|
|
3992
|
+
bgcolor: isRead ? "grey.300" : getNotificationColor(notification.type),
|
|
3993
|
+
width: 40,
|
|
3994
|
+
height: 40
|
|
3995
|
+
}
|
|
3996
|
+
},
|
|
3997
|
+
getNotificationIcon(notification.type)
|
|
3998
|
+
)),
|
|
3999
|
+
/* @__PURE__ */ React19.createElement(
|
|
4000
|
+
ListItemText2,
|
|
4001
|
+
{
|
|
4002
|
+
primary: /* @__PURE__ */ React19.createElement(Box9, { sx: { display: "flex", alignItems: "center", mb: 0.5 } }, /* @__PURE__ */ React19.createElement(
|
|
4003
|
+
Typography7,
|
|
4004
|
+
{
|
|
4005
|
+
variant: "body2",
|
|
4006
|
+
sx: {
|
|
4007
|
+
fontWeight: isRead ? 400 : 600,
|
|
4008
|
+
flex: 1
|
|
4009
|
+
}
|
|
4010
|
+
},
|
|
4011
|
+
notification.title
|
|
4012
|
+
), getPriorityChip(notification.priority)),
|
|
4013
|
+
secondary: /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
|
|
4014
|
+
Typography7,
|
|
4015
|
+
{
|
|
4016
|
+
variant: "body2",
|
|
4017
|
+
color: "text.secondary",
|
|
4018
|
+
sx: {
|
|
4019
|
+
display: "-webkit-box",
|
|
4020
|
+
WebkitLineClamp: 2,
|
|
4021
|
+
WebkitBoxOrient: "vertical",
|
|
4022
|
+
overflow: "hidden",
|
|
4023
|
+
mb: 0.5
|
|
4024
|
+
}
|
|
4025
|
+
},
|
|
4026
|
+
notification.message
|
|
4027
|
+
), /* @__PURE__ */ React19.createElement(Typography7, { variant: "caption", color: "text.secondary" }, formatDistanceToNow(new Date(createdAt), { addSuffix: true })))
|
|
4028
|
+
}
|
|
4029
|
+
)
|
|
4030
|
+
), index < notifications.length - 1 && /* @__PURE__ */ React19.createElement(Divider2, null));
|
|
4031
|
+
})),
|
|
4032
|
+
hasMore && notifications.length > 0 && /* @__PURE__ */ React19.createElement(Box9, { sx: { p: 2, textAlign: "center", borderTop: "1px solid", borderColor: "divider" } }, /* @__PURE__ */ React19.createElement(
|
|
4033
|
+
Button4,
|
|
3744
4034
|
{
|
|
3745
4035
|
onClick: handleLoadMore,
|
|
3746
4036
|
disabled: loading,
|
|
@@ -3750,7 +4040,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3750
4040
|
loading ? "Loading..." : "Load more"
|
|
3751
4041
|
))
|
|
3752
4042
|
),
|
|
3753
|
-
/* @__PURE__ */
|
|
4043
|
+
/* @__PURE__ */ React19.createElement(
|
|
3754
4044
|
Box9,
|
|
3755
4045
|
{
|
|
3756
4046
|
sx: {
|
|
@@ -3760,11 +4050,11 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3760
4050
|
textAlign: "center"
|
|
3761
4051
|
}
|
|
3762
4052
|
},
|
|
3763
|
-
/* @__PURE__ */
|
|
3764
|
-
|
|
4053
|
+
/* @__PURE__ */ React19.createElement(
|
|
4054
|
+
Button4,
|
|
3765
4055
|
{
|
|
3766
4056
|
size: "small",
|
|
3767
|
-
startIcon: /* @__PURE__ */
|
|
4057
|
+
startIcon: /* @__PURE__ */ React19.createElement(SettingsIcon, null),
|
|
3768
4058
|
onClick: () => {
|
|
3769
4059
|
window.location.href = "/settings?tab=general";
|
|
3770
4060
|
handleClose();
|
|
@@ -3779,13 +4069,13 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3779
4069
|
var NotificationBell_default = NotificationBell;
|
|
3780
4070
|
|
|
3781
4071
|
// src/components/ErrorBoundary/ErrorBoundary.js
|
|
3782
|
-
import
|
|
4072
|
+
import React20 from "react";
|
|
3783
4073
|
import {
|
|
3784
4074
|
Box as Box10,
|
|
3785
4075
|
Typography as Typography8,
|
|
3786
|
-
Button as
|
|
3787
|
-
Card as
|
|
3788
|
-
CardContent as
|
|
4076
|
+
Button as Button5,
|
|
4077
|
+
Card as Card3,
|
|
4078
|
+
CardContent as CardContent3,
|
|
3789
4079
|
Alert as Alert3,
|
|
3790
4080
|
Stack as Stack6
|
|
3791
4081
|
} from "@mui/material";
|
|
@@ -3794,7 +4084,7 @@ import {
|
|
|
3794
4084
|
BugReport,
|
|
3795
4085
|
Home as Home2
|
|
3796
4086
|
} from "@mui/icons-material";
|
|
3797
|
-
var ErrorBoundary = class extends
|
|
4087
|
+
var ErrorBoundary = class extends React20.Component {
|
|
3798
4088
|
constructor(props) {
|
|
3799
4089
|
super(props);
|
|
3800
4090
|
this.state = {
|
|
@@ -3835,7 +4125,7 @@ var ErrorBoundary = class extends React15.Component {
|
|
|
3835
4125
|
if (this.state.hasError) {
|
|
3836
4126
|
const isNavigationError = (_b = (_a = this.state.error) == null ? void 0 : _a.message) == null ? void 0 : _b.includes("getBoundingClientRect");
|
|
3837
4127
|
const isDOMError = ((_d = (_c = this.state.error) == null ? void 0 : _c.message) == null ? void 0 : _d.includes("null")) || ((_f = (_e = this.state.error) == null ? void 0 : _e.message) == null ? void 0 : _f.includes("undefined"));
|
|
3838
|
-
return /* @__PURE__ */
|
|
4128
|
+
return /* @__PURE__ */ React20.createElement(
|
|
3839
4129
|
Box10,
|
|
3840
4130
|
{
|
|
3841
4131
|
sx: {
|
|
@@ -3847,32 +4137,32 @@ var ErrorBoundary = class extends React15.Component {
|
|
|
3847
4137
|
p: 3
|
|
3848
4138
|
}
|
|
3849
4139
|
},
|
|
3850
|
-
/* @__PURE__ */
|
|
3851
|
-
|
|
4140
|
+
/* @__PURE__ */ React20.createElement(Card3, { sx: { maxWidth: 600, width: "100%" } }, /* @__PURE__ */ React20.createElement(CardContent3, null, /* @__PURE__ */ React20.createElement(Stack6, { spacing: 3, alignItems: "center" }, /* @__PURE__ */ React20.createElement(BugReport, { sx: { fontSize: 64, color: "error.main" } }), /* @__PURE__ */ React20.createElement(Typography8, { variant: "h5", component: "h2", textAlign: "center" }, "Oops! Something went wrong"), /* @__PURE__ */ React20.createElement(Alert3, { severity: "error", sx: { width: "100%" } }, /* @__PURE__ */ React20.createElement(Typography8, { variant: "body2" }, isNavigationError && /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("strong", null, "UI Component Error:"), " A component tried to access an element before it was ready. This is usually temporary."), isDOMError && !isNavigationError && /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("strong", null, "DOM Error:"), " A component couldn't find an expected element. This might be due to rapid state changes."), !isNavigationError && !isDOMError && /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("strong", null, "Application Error:"), " An unexpected error occurred while rendering the component."))), process.env.NODE_ENV === "development" && this.state.error && /* @__PURE__ */ React20.createElement(Alert3, { severity: "warning", sx: { width: "100%" } }, /* @__PURE__ */ React20.createElement(Typography8, { variant: "body2", component: "div" }, /* @__PURE__ */ React20.createElement("strong", null, "Debug Info:"), /* @__PURE__ */ React20.createElement("br", null), /* @__PURE__ */ React20.createElement("code", { style: { fontSize: "0.75rem", wordBreak: "break-word" } }, this.state.error.toString()))), /* @__PURE__ */ React20.createElement(Stack6, { direction: "row", spacing: 2 }, /* @__PURE__ */ React20.createElement(
|
|
4141
|
+
Button5,
|
|
3852
4142
|
{
|
|
3853
4143
|
variant: "contained",
|
|
3854
|
-
startIcon: /* @__PURE__ */
|
|
4144
|
+
startIcon: /* @__PURE__ */ React20.createElement(Refresh2, null),
|
|
3855
4145
|
onClick: this.handleRetry,
|
|
3856
4146
|
color: "primary"
|
|
3857
4147
|
},
|
|
3858
4148
|
"Try Again"
|
|
3859
|
-
), /* @__PURE__ */
|
|
3860
|
-
|
|
4149
|
+
), /* @__PURE__ */ React20.createElement(
|
|
4150
|
+
Button5,
|
|
3861
4151
|
{
|
|
3862
4152
|
variant: "outlined",
|
|
3863
|
-
startIcon: /* @__PURE__ */
|
|
4153
|
+
startIcon: /* @__PURE__ */ React20.createElement(Refresh2, null),
|
|
3864
4154
|
onClick: this.handleReload
|
|
3865
4155
|
},
|
|
3866
4156
|
"Reload Page"
|
|
3867
|
-
), this.props.onNavigateHome && /* @__PURE__ */
|
|
3868
|
-
|
|
4157
|
+
), this.props.onNavigateHome && /* @__PURE__ */ React20.createElement(
|
|
4158
|
+
Button5,
|
|
3869
4159
|
{
|
|
3870
4160
|
variant: "outlined",
|
|
3871
|
-
startIcon: /* @__PURE__ */
|
|
4161
|
+
startIcon: /* @__PURE__ */ React20.createElement(Home2, null),
|
|
3872
4162
|
onClick: this.props.onNavigateHome
|
|
3873
4163
|
},
|
|
3874
4164
|
"Go Home"
|
|
3875
|
-
)), /* @__PURE__ */
|
|
4165
|
+
)), /* @__PURE__ */ React20.createElement(Typography8, { variant: "body2", color: "text.secondary", textAlign: "center" }, "If this problem persists, try refreshing the page or clearing your browser cache. The error has been logged for debugging."))))
|
|
3876
4166
|
);
|
|
3877
4167
|
}
|
|
3878
4168
|
return this.props.children;
|
|
@@ -3881,7 +4171,7 @@ var ErrorBoundary = class extends React15.Component {
|
|
|
3881
4171
|
var ErrorBoundary_default = ErrorBoundary;
|
|
3882
4172
|
|
|
3883
4173
|
// src/contexts/SocketContext.js
|
|
3884
|
-
import
|
|
4174
|
+
import React21, { createContext as createContext5, useContext as useContext5, useEffect as useEffect6, useState as useState7 } from "react";
|
|
3885
4175
|
import { io } from "socket.io-client";
|
|
3886
4176
|
var SocketContext = createContext5();
|
|
3887
4177
|
var useSocket = () => {
|
|
@@ -3904,7 +4194,7 @@ var SocketProvider = ({ children }) => {
|
|
|
3904
4194
|
if (user || tenantToken) {
|
|
3905
4195
|
const userType = user ? "property_manager" : "tenant";
|
|
3906
4196
|
const authToken = user ? localStorage.getItem("token") : tenantToken;
|
|
3907
|
-
const socketUrl = process.env.REACT_APP_API_URL ? process.env.REACT_APP_API_URL.replace("/api", "") :
|
|
4197
|
+
const socketUrl = process.env.REACT_APP_API_URL ? process.env.REACT_APP_API_URL.replace("/api", "") : `${window.location.protocol}//${window.location.hostname}:5000`;
|
|
3908
4198
|
const newSocket = io(socketUrl, {
|
|
3909
4199
|
auth: {
|
|
3910
4200
|
token: authToken,
|
|
@@ -3927,7 +4217,7 @@ var SocketProvider = ({ children }) => {
|
|
|
3927
4217
|
socket,
|
|
3928
4218
|
isConnected
|
|
3929
4219
|
};
|
|
3930
|
-
return /* @__PURE__ */
|
|
4220
|
+
return /* @__PURE__ */ React21.createElement(SocketContext.Provider, { value }, children);
|
|
3931
4221
|
};
|
|
3932
4222
|
|
|
3933
4223
|
// src/hooks/useNotifications.js
|
|
@@ -5397,10 +5687,30 @@ var isTenantAuthenticated = () => {
|
|
|
5397
5687
|
export {
|
|
5398
5688
|
AuthLayout_default as AuthLayout,
|
|
5399
5689
|
AuthProvider,
|
|
5690
|
+
Blockquote,
|
|
5691
|
+
Button2 as Button,
|
|
5692
|
+
Card2 as Card,
|
|
5693
|
+
CardContent2 as CardContent,
|
|
5694
|
+
CardDescription,
|
|
5695
|
+
CardFooter,
|
|
5696
|
+
CardHeader,
|
|
5697
|
+
CardTitle,
|
|
5400
5698
|
CustomThemeProvider,
|
|
5401
5699
|
ErrorBoundary_default as ErrorBoundary,
|
|
5700
|
+
H1,
|
|
5701
|
+
H2,
|
|
5702
|
+
H3,
|
|
5703
|
+
H4,
|
|
5704
|
+
Heading,
|
|
5705
|
+
InlineCode,
|
|
5706
|
+
Input,
|
|
5707
|
+
Label,
|
|
5708
|
+
Large,
|
|
5709
|
+
Lead,
|
|
5710
|
+
List2 as List,
|
|
5402
5711
|
LoadingSpinner_default as LoadingSpinner,
|
|
5403
5712
|
ModernCard_default as ModernCard,
|
|
5713
|
+
Muted,
|
|
5404
5714
|
NOTIFICATION_CHANNELS,
|
|
5405
5715
|
NOTIFICATION_TYPES,
|
|
5406
5716
|
Navbar_default as Navbar,
|
|
@@ -5408,13 +5718,17 @@ export {
|
|
|
5408
5718
|
NotificationManager_default as NotificationManager,
|
|
5409
5719
|
NotificationPatterns,
|
|
5410
5720
|
NotificationProvider,
|
|
5721
|
+
P,
|
|
5411
5722
|
PageHeader_default as PageHeader,
|
|
5412
5723
|
PageLayout_default as PageLayout,
|
|
5724
|
+
Small,
|
|
5413
5725
|
SocketProvider,
|
|
5414
5726
|
TenantLayout_default as TenantLayout,
|
|
5415
5727
|
TenantThemeProvider,
|
|
5416
5728
|
api,
|
|
5417
5729
|
auditNotifications,
|
|
5730
|
+
buttonVariants,
|
|
5731
|
+
cn,
|
|
5418
5732
|
createContrastEnhancedComponents,
|
|
5419
5733
|
createNotificationAwareAPI,
|
|
5420
5734
|
darkenColor,
|