@myrjfa/ui 1.0.8 → 1.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/chat/ChatMain.d.ts +9 -0
- package/dist/chat/ChatMain.d.ts.map +1 -0
- package/dist/chat/ChatMain.js +239 -0
- package/dist/chat/ChatSidebar.d.ts +13 -0
- package/dist/chat/ChatSidebar.d.ts.map +1 -0
- package/dist/chat/ChatSidebar.js +24 -0
- package/dist/chat/ConversationList.d.ts +12 -0
- package/dist/chat/ConversationList.d.ts.map +1 -0
- package/dist/chat/ConversationList.js +68 -0
- package/dist/chat/ExpensePanel.d.ts +8 -0
- package/dist/chat/ExpensePanel.d.ts.map +1 -0
- package/dist/chat/ExpensePanel.js +215 -0
- package/dist/chat/MessageBubble.d.ts +15 -0
- package/dist/chat/MessageBubble.d.ts.map +1 -0
- package/dist/chat/MessageBubble.js +197 -0
- package/dist/chat/MessageInput.d.ts +14 -0
- package/dist/chat/MessageInput.d.ts.map +1 -0
- package/dist/chat/MessageInput.js +235 -0
- package/dist/chat/MilestonePanel.d.ts +8 -0
- package/dist/chat/MilestonePanel.d.ts.map +1 -0
- package/dist/chat/MilestonePanel.js +173 -0
- package/dist/chat/dialogs/AddMemberDialog.d.ts +10 -0
- package/dist/chat/dialogs/AddMemberDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/AddMemberDialog.js +110 -0
- package/dist/chat/dialogs/CameraDialog.d.ts +8 -0
- package/dist/chat/dialogs/CameraDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/CameraDialog.js +128 -0
- package/dist/chat/dialogs/GroupInfoDialog.d.ts +10 -0
- package/dist/chat/dialogs/GroupInfoDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/GroupInfoDialog.js +108 -0
- package/dist/chat/dialogs/GroupInfoViewDialog.d.ts +9 -0
- package/dist/chat/dialogs/GroupInfoViewDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/GroupInfoViewDialog.js +16 -0
- package/dist/chat/dialogs/NewChatDialog.d.ts +2 -0
- package/dist/chat/dialogs/NewChatDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/NewChatDialog.js +127 -0
- package/dist/chat/dialogs/NewGroupDialog.d.ts +2 -0
- package/dist/chat/dialogs/NewGroupDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/NewGroupDialog.js +112 -0
- package/dist/chat/dialogs/ParticipantsDialog.d.ts +11 -0
- package/dist/chat/dialogs/ParticipantsDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/ParticipantsDialog.js +143 -0
- package/dist/chat/index.d.ts +8 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +7 -0
- package/dist/header/nav-item.d.ts +2 -1
- package/dist/header/nav-item.d.ts.map +1 -1
- package/dist/header/nav-item.js +2 -2
- package/dist/main/navbar.d.ts.map +1 -1
- package/dist/main/navbar.js +2 -2
- package/dist/misc/command.d.ts +3 -1
- package/dist/misc/command.d.ts.map +1 -1
- package/dist/misc/form.d.ts +1 -1
- package/dist/misc/form.d.ts.map +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
39
|
+
import { useState } from "react";
|
|
40
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../../misc/dialog";
|
|
41
|
+
import { Button } from "../../misc/button";
|
|
42
|
+
import { Avatar, AvatarFallback, AvatarImage } from "../../misc/avatar";
|
|
43
|
+
import { Search, UserPlus, UserMinus, Shield, ShieldCheck } from "lucide-react";
|
|
44
|
+
import { chatApi } from "@myrjfa/state/dist/lib/actions/chat";
|
|
45
|
+
import { Input } from "../../misc/input";
|
|
46
|
+
import { Badge } from "../../misc/badge";
|
|
47
|
+
import { AddMemberDialog } from "./AddMemberDialog";
|
|
48
|
+
import { useRouter } from "next/navigation";
|
|
49
|
+
export function ParticipantsDialog(_a) {
|
|
50
|
+
var _this = this;
|
|
51
|
+
var _b;
|
|
52
|
+
var open = _a.open, onOpenChange = _a.onOpenChange, conversation = _a.conversation, currentUserId = _a.currentUserId, onUpdate = _a.onUpdate;
|
|
53
|
+
var _c = useState(""), search = _c[0], setSearch = _c[1];
|
|
54
|
+
var _d = useState([]), selectedUsers = _d[0], setSelectedUsers = _d[1];
|
|
55
|
+
var router = useRouter();
|
|
56
|
+
var isAdmin = ((_b = conversation.participants.find(function (p) { return p.userId === currentUserId; })) === null || _b === void 0 ? void 0 : _b.chatRole) === "admin";
|
|
57
|
+
// Filter participants based on search query
|
|
58
|
+
var filteredParticipants = conversation.participants.filter(function (p) {
|
|
59
|
+
var _a;
|
|
60
|
+
return p.userId.toLowerCase().includes(search.toLowerCase()) ||
|
|
61
|
+
((_a = p.role) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(search.toLowerCase()));
|
|
62
|
+
});
|
|
63
|
+
var handleRemoveMember = function (userId) { return __awaiter(_this, void 0, void 0, function () {
|
|
64
|
+
var res, err_1;
|
|
65
|
+
return __generator(this, function (_a) {
|
|
66
|
+
switch (_a.label) {
|
|
67
|
+
case 0:
|
|
68
|
+
if (!window.confirm("Are you sure you want to remove this member?")) return [3 /*break*/, 4];
|
|
69
|
+
_a.label = 1;
|
|
70
|
+
case 1:
|
|
71
|
+
_a.trys.push([1, 3, , 4]);
|
|
72
|
+
return [4 /*yield*/, chatApi.removeParticipant(conversation._id, userId)];
|
|
73
|
+
case 2:
|
|
74
|
+
res = _a.sent();
|
|
75
|
+
if (res) {
|
|
76
|
+
onUpdate();
|
|
77
|
+
}
|
|
78
|
+
return [3 /*break*/, 4];
|
|
79
|
+
case 3:
|
|
80
|
+
err_1 = _a.sent();
|
|
81
|
+
console.error("Failed to remove member:", err_1);
|
|
82
|
+
return [3 /*break*/, 4];
|
|
83
|
+
case 4: return [2 /*return*/];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}); };
|
|
87
|
+
function handleCancel() {
|
|
88
|
+
setSelectedUsers([]);
|
|
89
|
+
}
|
|
90
|
+
var handleToggleAdmin = function (userId, currentRole) { return __awaiter(_this, void 0, void 0, function () {
|
|
91
|
+
var newRole, actionText, res, err_2;
|
|
92
|
+
return __generator(this, function (_a) {
|
|
93
|
+
switch (_a.label) {
|
|
94
|
+
case 0:
|
|
95
|
+
newRole = currentRole === "admin" ? "member" : "admin";
|
|
96
|
+
actionText = newRole === "admin" ? "make admin" : "remove admin privileges from";
|
|
97
|
+
if (!window.confirm("Are you sure you want to ".concat(actionText, " this user?"))) return [3 /*break*/, 4];
|
|
98
|
+
_a.label = 1;
|
|
99
|
+
case 1:
|
|
100
|
+
_a.trys.push([1, 3, , 4]);
|
|
101
|
+
return [4 /*yield*/, chatApi.updateParticipant(conversation._id, userId, { chatRole: newRole })];
|
|
102
|
+
case 2:
|
|
103
|
+
res = _a.sent();
|
|
104
|
+
if (res) {
|
|
105
|
+
onUpdate();
|
|
106
|
+
}
|
|
107
|
+
return [3 /*break*/, 4];
|
|
108
|
+
case 3:
|
|
109
|
+
err_2 = _a.sent();
|
|
110
|
+
console.error("Failed to update user role:", err_2);
|
|
111
|
+
return [3 /*break*/, 4];
|
|
112
|
+
case 4: return [2 /*return*/];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}); };
|
|
116
|
+
var handleMembersSelected = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
117
|
+
var userIds, res, err_3;
|
|
118
|
+
return __generator(this, function (_a) {
|
|
119
|
+
switch (_a.label) {
|
|
120
|
+
case 0:
|
|
121
|
+
_a.trys.push([0, 2, , 3]);
|
|
122
|
+
userIds = selectedUsers.map(function (u) { return u.username || ""; }).filter(Boolean);
|
|
123
|
+
return [4 /*yield*/, chatApi.addParticipants(conversation._id, userIds)];
|
|
124
|
+
case 1:
|
|
125
|
+
res = _a.sent();
|
|
126
|
+
if (res) {
|
|
127
|
+
onUpdate();
|
|
128
|
+
}
|
|
129
|
+
router.refresh();
|
|
130
|
+
return [3 /*break*/, 3];
|
|
131
|
+
case 2:
|
|
132
|
+
err_3 = _a.sent();
|
|
133
|
+
console.error("Failed to add members:", err_3);
|
|
134
|
+
return [3 /*break*/, 3];
|
|
135
|
+
case 3: return [2 /*return*/];
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}); };
|
|
139
|
+
var existingUsernames = conversation.participants.map(function (p) { return p.userId; });
|
|
140
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "sm:max-w-[500px]", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: isAdmin ? "Manage Participants" : "Group Members" }) }), _jsxs("div", { className: "space-y-4 py-4", children: [_jsxs("div", { className: "relative", children: [_jsx(Search, { className: "absolute left-3 top-3 w-4 h-4 text-gray-400" }), _jsx(Input, { value: search, onChange: function (e) { return setSearch(e.target.value); }, placeholder: "Search members by name or role..." })] }), _jsxs("div", { className: "max-h-64 overflow-y-auto space-y-2 pr-2 custom-scrollbar border rounded-lg p-3 bg-gray-50 dark:bg-gray-900/30", children: [_jsxs("p", { className: "text-[10px] font-bold text-gray-400 uppercase tracking-widest pl-1 sticky top-0", children: [isAdmin ? "Manage Members" : "Members", " (", filteredParticipants.length, ")"] }), filteredParticipants.map(function (p) { return (_jsxs("div", { className: "flex items-center justify-between p-2 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800/70 transition-colors", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsxs(Avatar, { className: "w-8 h-8", children: [_jsx(AvatarImage, { src: p.profilePic }), _jsx(AvatarFallback, { className: "bg-indigo-100 text-indigo-600 text-xs", children: p.userId.charAt(0).toUpperCase() })] }), _jsxs("div", { children: [_jsxs("p", { className: "text-sm font-medium text-gray-900 dark:text-white flex items-center gap-1", children: [p.userId, p.chatRole === "admin" && _jsx(ShieldCheck, { className: "w-3 h-3 text-indigo-500" }), p.userId === currentUserId && _jsx(Badge, { variant: "secondary", className: "text-[10px] px-1.5 py-0.5 ml-1", children: "You" })] }), _jsx("p", { className: "text-[10px] text-gray-400 capitalize", children: p.role })] })] }), isAdmin && p.userId !== currentUserId && (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Button, { variant: "ghost", size: "icon", className: "".concat(p.chatRole === "admin"
|
|
141
|
+
? "text-yellow-500 hover:text-yellow-600 hover:bg-yellow-50 dark:hover:bg-yellow-900/20"
|
|
142
|
+
: "text-blue-400 hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20"), onClick: function () { return handleToggleAdmin(p.userId, p.chatRole); }, title: p.chatRole === "admin" ? "Remove admin" : "Make admin", children: p.chatRole === "admin" ? (_jsx(ShieldCheck, { className: "w-4 h-4" })) : (_jsx(Shield, { className: "w-4 h-4" })) }), _jsx(Button, { variant: "ghost", size: "icon", className: "text-red-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20", onClick: function () { return handleRemoveMember(p.userId); }, title: "Remove member", children: _jsx(UserMinus, { className: "w-4 h-4" }) })] }))] }, p.userId)); })] }), isAdmin && (_jsxs("div", { className: "border-t pt-4", children: [_jsxs("p", { className: "text-sm font-medium mb-3 flex items-center gap-2", children: [_jsx(UserPlus, { className: "w-4 h-4" }), "Add New Members"] }), _jsx(AddMemberDialog, { selectedUsers: selectedUsers, setSelectedUsers: setSelectedUsers, excludeUsernames: existingUsernames }), _jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [_jsx(Button, { variant: "outline", onClick: handleCancel, children: "Cancel" }), _jsx(Button, { onClick: handleMembersSelected, disabled: selectedUsers.length === 0, children: "Add Members" })] })] }))] })] }) }));
|
|
143
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './ConversationList';
|
|
2
|
+
export * from './ChatSidebar';
|
|
3
|
+
export * from './dialogs/NewChatDialog';
|
|
4
|
+
export * from './dialogs/NewGroupDialog';
|
|
5
|
+
export * from './MessageBubble';
|
|
6
|
+
export * from './MessageInput';
|
|
7
|
+
export * from './ChatMain';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chat/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
|
|
@@ -3,7 +3,8 @@ interface NavItemProps {
|
|
|
3
3
|
href: string;
|
|
4
4
|
className?: string;
|
|
5
5
|
icon?: React.ReactNode;
|
|
6
|
+
external?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare function NavItem({ label, href, className, icon }: NavItemProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function NavItem({ label, href, className, icon, external }: NavItemProps): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=nav-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-item.d.ts","sourceRoot":"","sources":["../../src/header/nav-item.tsx"],"names":[],"mappings":"AAGA,UAAU,YAAY;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"nav-item.d.ts","sourceRoot":"","sources":["../../src/header/nav-item.tsx"],"names":[],"mappings":"AAGA,UAAU,YAAY;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,YAAY,2CAe/E"}
|
package/dist/header/nav-item.js
CHANGED
|
@@ -2,6 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn } from "@myrjfa/state/dist/lib/utils";
|
|
3
3
|
import Link from "next/link";
|
|
4
4
|
export function NavItem(_a) {
|
|
5
|
-
var label = _a.label, href = _a.href, className = _a.className, icon = _a.icon;
|
|
6
|
-
return (_jsxs(Link, { href: href, className: cn("text-muted-foreground hover:text-foreground flex cursor-pointer items-center text-sm font-medium transition-colors gap-1", className), children: [icon && _jsx("span", { children: icon }), label] }));
|
|
5
|
+
var label = _a.label, href = _a.href, className = _a.className, icon = _a.icon, external = _a.external;
|
|
6
|
+
return (_jsxs(Link, { href: href, target: external ? "_blank" : undefined, rel: external ? "noopener noreferrer" : undefined, className: cn("text-muted-foreground hover:text-foreground flex cursor-pointer items-center text-sm font-medium transition-colors gap-1", className), children: [icon && _jsx("span", { children: icon }), label] }));
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../../src/main/navbar.tsx"],"names":[],"mappings":"AAoBA,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,IAAY,EAAE,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../../src/main/navbar.tsx"],"names":[],"mappings":"AAoBA,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,IAAY,EAAE,EAAE,WAAW,2CA6P3D"}
|
package/dist/main/navbar.js
CHANGED
|
@@ -42,7 +42,7 @@ import { logoutUser } from "@myrjfa/state/dist/lib/auth";
|
|
|
42
42
|
import { isLoggedInAtom, userAtom, userLoadingAtom } from "@myrjfa/state/dist/lib/userAtom";
|
|
43
43
|
import { opportunityTypeOptions } from "@myrjfa/state/dist/lib/models/opportunities/opportunity";
|
|
44
44
|
import { useAtom, useAtomValue } from "jotai";
|
|
45
|
-
import { ChevronDown, Globe, Heart, LayoutDashboardIcon, Store, Target, Luggage } from "lucide-react";
|
|
45
|
+
import { ChevronDown, Globe, Heart, LayoutDashboardIcon, Store, Target, Luggage, MessageCircle } from "lucide-react";
|
|
46
46
|
import Link from "next/link";
|
|
47
47
|
import { useRouter } from "next/navigation";
|
|
48
48
|
import { useEffect, useState } from "react";
|
|
@@ -112,7 +112,7 @@ export default function Navbar(_a) {
|
|
|
112
112
|
var navItemColor = dark
|
|
113
113
|
? "hover:text-white text-gray-250"
|
|
114
114
|
: "hover:text-foreground text-gray-750";
|
|
115
|
-
return (_jsx("header", { className: "fixed top-0 left-0 z-[100] mx-auto transition-all duration-300 w-full ".concat(navbarBg, " ").concat(textColor, " ").concat(navbarBorder), children: _jsxs("div", { className: "mx-auto flex items-center justify-between gap-10 py-4 px-4 lg:px-8", children: [_jsxs(Link, { href: "/", className: "flex items-center gap-3", children: [_jsxs(Avatar, { className: "ml-2 -mr-4.5", children: [_jsx(AvatarImage, { src: "/images/logoicon.webp" }), _jsxs(AvatarFallback, { children: [(currentUser === null || currentUser === void 0 ? void 0 : currentUser.firstName.charAt(0)) || "D", (currentUser === null || currentUser === void 0 ? void 0 : currentUser.lastName.charAt(0)) || "P"] })] }), _jsx("span", { className: "font-heading text-xl font-bold", children: "rippeaze" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("nav", { className: "hidden md:flex items-center gap-10 justify-end", children: [_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { className: "flex items-center gap-1 text-sm font-medium cursor-pointer ".concat(navItemColor), children: [_jsx(Target, { className: "h-5 w-5" }), _jsx("span", { children: "Opportunities" }), _jsx(ChevronDown, { className: "h-4 w-4" })] }) }), _jsx(PopoverContent, { className: "w-56 p-2 mt-3 bg-white rounded-lg shadow-lg border", align: "start", sideOffset: 5, children: _jsx("div", { className: "flex flex-col", children: opportunityTypeOptions.map(function (opt) { return (_jsxs(Link, { href: "/opportunities?type=".concat(opt.value), className: "px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-md flex flex-col", children: [_jsx("span", { className: "font-medium", children: opt.label }), _jsx("span", { className: "text-xs text-gray-500", children: opt.description })] }, opt.value)); }) }) })] }), _jsx(NavItem, { icon: _jsx(Luggage, { className: "h-5 w-5" }), label: "Packages", href: "/packages", className: navItemColor }), _jsx(NavItem, { icon: _jsx(Globe, { className: "h-5 w-5" }), label: "Blogs", href: "/blogs", className: navItemColor }), currentUser ? _jsx(NavItem, { icon: _jsx(Store, { className: "h-5 w-5" }), label: "Become a Partner", href: "/contact", className: navItemColor })
|
|
115
|
+
return (_jsx("header", { className: "fixed top-0 left-0 z-[100] mx-auto transition-all duration-300 w-full ".concat(navbarBg, " ").concat(textColor, " ").concat(navbarBorder), children: _jsxs("div", { className: "mx-auto flex items-center justify-between gap-10 py-4 px-4 lg:px-8", children: [_jsxs(Link, { href: "/", className: "flex items-center gap-3", children: [_jsxs(Avatar, { className: "ml-2 -mr-4.5", children: [_jsx(AvatarImage, { src: "/images/logoicon.webp" }), _jsxs(AvatarFallback, { children: [(currentUser === null || currentUser === void 0 ? void 0 : currentUser.firstName.charAt(0)) || "D", (currentUser === null || currentUser === void 0 ? void 0 : currentUser.lastName.charAt(0)) || "P"] })] }), _jsx("span", { className: "font-heading text-xl font-bold", children: "rippeaze" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("nav", { className: "hidden md:flex items-center gap-10 justify-end", children: [_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { className: "flex items-center gap-1 text-sm font-medium cursor-pointer ".concat(navItemColor), children: [_jsx(Target, { className: "h-5 w-5" }), _jsx("span", { children: "Opportunities" }), _jsx(ChevronDown, { className: "h-4 w-4" })] }) }), _jsx(PopoverContent, { className: "w-56 p-2 mt-3 bg-white rounded-lg shadow-lg border", align: "start", sideOffset: 5, children: _jsx("div", { className: "flex flex-col", children: opportunityTypeOptions.map(function (opt) { return (_jsxs(Link, { href: "/opportunities?type=".concat(opt.value), className: "px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-md flex flex-col", children: [_jsx("span", { className: "font-medium", children: opt.label }), _jsx("span", { className: "text-xs text-gray-500", children: opt.description })] }, opt.value)); }) }) })] }), _jsx(NavItem, { icon: _jsx(Luggage, { className: "h-5 w-5" }), label: "Packages", href: "/packages", className: navItemColor }), _jsx(NavItem, { icon: _jsx(Globe, { className: "h-5 w-5" }), label: "Blogs", href: "/blogs", className: navItemColor }), isLoggedIn && _jsx(NavItem, { icon: _jsx(MessageCircle, { className: "h-5 w-5" }), label: "Chat", href: "/chat", className: navItemColor, external: true }), currentUser ? _jsx(NavItem, { icon: _jsx(Store, { className: "h-5 w-5" }), label: "Become a Partner", href: "/contact", className: navItemColor })
|
|
116
116
|
: _jsx(NavItem, { icon: _jsx(Store, { className: "h-5 w-5" }), label: "Register as Business", href: "/auth/register?role=host", className: navItemColor }), isLoggedIn && _jsx(NotificationBell, { id: (_b = currentUser === null || currentUser === void 0 ? void 0 : currentUser.username) !== null && _b !== void 0 ? _b : null, navItemColor: navItemColor })] }), _jsx("div", { className: "hidden md:flex items-center gap-2", children: _jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(Button, { variant: "link", className: "flex w-full gap-1 cursor-pointer", children: _jsxs(Avatar, { className: "ml-5 mr-4.5", children: [_jsx(AvatarImage, { src: (_c = currentUser === null || currentUser === void 0 ? void 0 : currentUser.profilePic) !== null && _c !== void 0 ? _c : "/images/profile_placeholder.webp" }), _jsxs(AvatarFallback, { children: [(currentUser === null || currentUser === void 0 ? void 0 : currentUser.firstName.charAt(0)) || "D", (currentUser === null || currentUser === void 0 ? void 0 : currentUser.lastName.charAt(0)) || "P"] })] }) }) }), _jsx(PopoverContent, { className: "w-full p-0 mt-3 bg-".concat(dark ? "primary" : "white", " rounded-lg shadow-lg"), align: "end", sideOffset: 5, children: _jsxs("div", { className: "py-2 w-full", children: [_jsxs("div", { className: "px-4 py-3 border-b w-full", children: [_jsx("p", { className: "text-sm font-medium", children: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.username) || "Guest" }), _jsx("p", { className: "text-xs text-gray-500", children: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.email) || "user@example.com" })] }), _jsxs("div", { className: "flex flex-col", children: [isLoggedIn ?
|
|
117
117
|
_jsxs(Link, { href: "/profile/".concat((currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) || "user", "/").concat((currentUser === null || currentUser === void 0 ? void 0 : currentUser.username) || "Guest"), className: "w-full py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2", children: [_jsxs(Avatar, { className: "w-4 h-4", children: [_jsx(AvatarImage, { src: (_d = currentUser === null || currentUser === void 0 ? void 0 : currentUser.profilePic) !== null && _d !== void 0 ? _d : "/images/profile_placeholder.webp" }), _jsx(AvatarFallback, { children: "U" })] }), "Profile"] }) :
|
|
118
118
|
_jsxs(Button, { variant: "ghost", onClick: function () { return router.push('/auth/login?role=user'); }, className: "w-full py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2 justify-start", children: [_jsxs(Avatar, { className: "w-4 h-4", children: [_jsx(AvatarImage, { src: "/images/profile_placeholder.webp" }), _jsx(AvatarFallback, { children: "U" })] }), "Login As Volunteer"] }), isLoggedIn && _jsxs(Link, { href: "/overview/".concat((currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) || 'user'), className: "w-full py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2", children: [_jsx(LayoutDashboardIcon, { className: "h-4 w-4" }), "Dashboard"] }), isLoggedIn && ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === "user" || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) == null) &&
|
package/dist/misc/command.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Command as CommandPrimitive } from "cmdk";
|
|
2
2
|
import { Dialog } from "./dialog";
|
|
3
|
-
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>
|
|
3
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive> & {
|
|
4
|
+
className?: string;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
4
6
|
declare function CommandDialog({ title, description, children, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
5
7
|
title?: string;
|
|
6
8
|
description?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/misc/command.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAA;AAGlD,OAAO,EACL,MAAM,EAKP,MAAM,UAAU,CAAA;AAEjB,iBAAS,OAAO,CAAC,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cA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,CAAC,2CAQzD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAWpD;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAW9B;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,CAAA"}
|
package/dist/misc/form.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as LabelPrimitive from "@radix-ui/react-label";
|
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
|
|
5
|
-
declare const Form: <
|
|
5
|
+
declare const Form: React.FC<any>;
|
|
6
6
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
declare const useFormField: () => {
|
|
8
8
|
invalid: boolean;
|
package/dist/misc/form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/misc/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EAIjB,MAAM,iBAAiB,CAAA;AAIxB,QAAA,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"form.d.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,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACV,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrjfa/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Shared UI components for my apps",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"class-variance-authority": "^0.7.1",
|
|
36
36
|
"cmdk": "1.1.1",
|
|
37
37
|
"embla-carousel-react": "^8.5.2",
|
|
38
|
+
"emoji-picker-react": "^4.18.0",
|
|
38
39
|
"pnpm": "^10.14.0",
|
|
39
40
|
"react-hook-form": "^7.54.2",
|
|
40
41
|
"react-icons": "^5.5.0",
|
|
@@ -51,8 +52,8 @@
|
|
|
51
52
|
"zod": "*"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
|
-
"@myrjfa/state": "
|
|
55
|
-
"@types/react": "
|
|
55
|
+
"@myrjfa/state": "1.0.8",
|
|
56
|
+
"@types/react": "19.0.10",
|
|
56
57
|
"@types/react-dom": "^19.0.4",
|
|
57
58
|
"date-fns": "^3.0.0",
|
|
58
59
|
"jotai": "^2.12.2",
|