@m5kdev/web-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +621 -0
- package/README.md +17 -0
- package/package.json +169 -0
- package/src/animations/card.motion.ts +9 -0
- package/src/components/AvatarUpload.tsx +133 -0
- package/src/components/Button.tsx +14 -0
- package/src/components/Calendar.css +684 -0
- package/src/components/Calendar.tsx +32 -0
- package/src/components/CardsSelect.tsx +155 -0
- package/src/components/CollapsibleSidebarMenuItem.tsx +57 -0
- package/src/components/ColorPicker.tsx +56 -0
- package/src/components/CopyButton.tsx +45 -0
- package/src/components/CropDialog.tsx +154 -0
- package/src/components/DialogProvider.tsx +105 -0
- package/src/components/ErrorFallback.tsx +17 -0
- package/src/components/FileDropzone.tsx +120 -0
- package/src/components/MultiSelectDropdown.tsx +233 -0
- package/src/components/Orb.tsx +288 -0
- package/src/components/PageAlert.tsx +121 -0
- package/src/components/SelectChips.tsx +40 -0
- package/src/components/SidebarItem.tsx +26 -0
- package/src/components/Steps.tsx +340 -0
- package/src/components/TablerIconPicker.tsx +4260 -0
- package/src/components/app-header.tsx +40 -0
- package/src/components/blur-card.tsx +132 -0
- package/src/components/features-section-demo-1.tsx +127 -0
- package/src/components/features-section-demo-2.tsx +102 -0
- package/src/components/features-section-demo-3.tsx +272 -0
- package/src/components/mode-toggle.tsx +31 -0
- package/src/components/nav-main.tsx +69 -0
- package/src/components/pricing-cards.tsx +133 -0
- package/src/components/shared/ButtonCopy.tsx +50 -0
- package/src/components/team-switcher.tsx +83 -0
- package/src/components/theme-provider.tsx +74 -0
- package/src/components/typewriter.tsx +90 -0
- package/src/components/ui/alert-dialog.tsx +133 -0
- package/src/components/ui/alert.tsx +60 -0
- package/src/components/ui/avatar.tsx +47 -0
- package/src/components/ui/badge.tsx +33 -0
- package/src/components/ui/bento-grid.tsx +54 -0
- package/src/components/ui/bento-grid2.tsx +66 -0
- package/src/components/ui/breadcrumb.tsx +101 -0
- package/src/components/ui/button.tsx +50 -0
- package/src/components/ui/card.tsx +55 -0
- package/src/components/ui/checkbox.tsx +26 -0
- package/src/components/ui/collapsible.tsx +9 -0
- package/src/components/ui/dialog.tsx +119 -0
- package/src/components/ui/dropdown-menu.tsx +186 -0
- package/src/components/ui/floating-navbar.tsx +78 -0
- package/src/components/ui/form.tsx +167 -0
- package/src/components/ui/image.tsx +55 -0
- package/src/components/ui/input.tsx +22 -0
- package/src/components/ui/label.tsx +19 -0
- package/src/components/ui/pagination.tsx +105 -0
- package/src/components/ui/progress.tsx +23 -0
- package/src/components/ui/resizable-navbar.tsx +260 -0
- package/src/components/ui/segment-control.tsx +143 -0
- package/src/components/ui/select.tsx +153 -0
- package/src/components/ui/separator.tsx +24 -0
- package/src/components/ui/sheet.tsx +121 -0
- package/src/components/ui/sidebar.tsx +736 -0
- package/src/components/ui/skeleton.tsx +7 -0
- package/src/components/ui/slider.tsx +23 -0
- package/src/components/ui/sonner.tsx +27 -0
- package/src/components/ui/spinner.tsx +45 -0
- package/src/components/ui/switch.tsx +27 -0
- package/src/components/ui/table.tsx +90 -0
- package/src/components/ui/tabs.tsx +52 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/timeline.tsx +95 -0
- package/src/components/ui/toast.tsx +126 -0
- package/src/components/ui/tooltip.tsx +55 -0
- package/src/components/ui/typewriter-effect.tsx +181 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/useDialog.ts +25 -0
- package/src/icons/GoogleIcon.tsx +32 -0
- package/src/icons/LinkedInIcon.tsx +30 -0
- package/src/icons/MicrosoftIcon.tsx +21 -0
- package/src/lib/chatwoot.ts +51 -0
- package/src/lib/utils.ts +6 -0
- package/src/modules/app/components/AppLoader.tsx +9 -0
- package/src/modules/app/components/AppShell.tsx +21 -0
- package/src/modules/app/components/AppSidebar.tsx +26 -0
- package/src/modules/app/components/AppSidebarContent.tsx +73 -0
- package/src/modules/app/components/AppSidebarHeader.tsx +57 -0
- package/src/modules/app/components/AppSidebarInvites.tsx +32 -0
- package/src/modules/app/components/AppSidebarUser.tsx +128 -0
- package/src/modules/auth/components/AdminUserManagement.tsx +1136 -0
- package/src/modules/auth/components/AdminWaitlist.tsx +358 -0
- package/src/modules/auth/components/AuthLayout.tsx +13 -0
- package/src/modules/auth/components/AuthProviders.tsx +105 -0
- package/src/modules/auth/components/AuthRouter.tsx +29 -0
- package/src/modules/auth/components/ClaimAccountRoute.tsx +242 -0
- package/src/modules/auth/components/ErrorAuthRoute.tsx +121 -0
- package/src/modules/auth/components/ForgotPasswordForm.tsx +58 -0
- package/src/modules/auth/components/ForgotPasswordRoute.tsx +27 -0
- package/src/modules/auth/components/InviteFriends.tsx +273 -0
- package/src/modules/auth/components/LastUsedBadge.tsx +22 -0
- package/src/modules/auth/components/LoginForm.tsx +104 -0
- package/src/modules/auth/components/LoginRoute.tsx +31 -0
- package/src/modules/auth/components/LogoutRoute.tsx +21 -0
- package/src/modules/auth/components/OrganizationAcceptInvitationRoute.tsx +161 -0
- package/src/modules/auth/components/OrganizationMembersRoute.tsx +730 -0
- package/src/modules/auth/components/OrganizationSettingsRoute.tsx +280 -0
- package/src/modules/auth/components/OrganizationSwitcher.tsx +148 -0
- package/src/modules/auth/components/ProfileRoute.tsx +104 -0
- package/src/modules/auth/components/RangeNuqsDatePicker.tsx +365 -0
- package/src/modules/auth/components/ResetPasswordForm.tsx +103 -0
- package/src/modules/auth/components/ResetPasswordRoute.tsx +27 -0
- package/src/modules/auth/components/SignupFormRoute.tsx +189 -0
- package/src/modules/auth/components/SignupRoute.tsx +53 -0
- package/src/modules/auth/components/UserPreferences.tsx +144 -0
- package/src/modules/auth/components/WaitlistCard.tsx +78 -0
- package/src/modules/auth/components/WaitlistCodeValidation.tsx +79 -0
- package/src/modules/billing/components/BillingBetaPage.tsx +124 -0
- package/src/modules/billing/components/BillingInvoicePage.tsx +180 -0
- package/src/modules/billing/components/BillingPlanSelect.tsx +14 -0
- package/src/modules/billing/components/BillingRouter.tsx +20 -0
- package/src/modules/billing/components/BillingSinglePlanSelect.tsx +172 -0
- package/src/modules/table/components/ColumnOrderAndVisibility.tsx +127 -0
- package/src/modules/table/components/NuqsTable.tsx +396 -0
- package/src/modules/table/components/TableFiltering.tsx +520 -0
- package/src/modules/table/components/TablePagination.tsx +59 -0
- package/src/modules/table/components/table.types.ts +11 -0
- package/src/modules/table/filterTransformers.ts +323 -0
- package/src/types.ts +4 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { Building2, ChevronsUpDown, CreditCard, LogOut, Settings, Sparkles, User } from "lucide-react";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import { Link } from "react-router";
|
|
4
|
+
import { Avatar, AvatarFallback, AvatarImage } from "#components/ui/avatar";
|
|
5
|
+
import {
|
|
6
|
+
DropdownMenu,
|
|
7
|
+
DropdownMenuContent,
|
|
8
|
+
DropdownMenuGroup,
|
|
9
|
+
DropdownMenuItem,
|
|
10
|
+
DropdownMenuLabel,
|
|
11
|
+
DropdownMenuSeparator,
|
|
12
|
+
DropdownMenuTrigger,
|
|
13
|
+
} from "#components/ui/dropdown-menu";
|
|
14
|
+
import {
|
|
15
|
+
SidebarMenu,
|
|
16
|
+
SidebarMenuButton,
|
|
17
|
+
SidebarMenuItem,
|
|
18
|
+
useSidebar,
|
|
19
|
+
} from "#components/ui/sidebar";
|
|
20
|
+
|
|
21
|
+
export type AppSidebarUserProps = {
|
|
22
|
+
user?: {
|
|
23
|
+
name: string;
|
|
24
|
+
email: string;
|
|
25
|
+
image?: string | null;
|
|
26
|
+
role?: string | null;
|
|
27
|
+
};
|
|
28
|
+
onSignOut: () => void;
|
|
29
|
+
organizationSettingsPath?: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export function AppSidebarUser({ user, onSignOut, organizationSettingsPath }: AppSidebarUserProps) {
|
|
33
|
+
const { name = "User", email = "email@example.com", image, role } = user || {};
|
|
34
|
+
const isAdmin = role === "admin";
|
|
35
|
+
const { isMobile } = useSidebar();
|
|
36
|
+
const { t } = useTranslation("web-ui");
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<SidebarMenu>
|
|
40
|
+
<SidebarMenuItem>
|
|
41
|
+
<DropdownMenu>
|
|
42
|
+
<DropdownMenuTrigger asChild>
|
|
43
|
+
<SidebarMenuButton
|
|
44
|
+
size="lg"
|
|
45
|
+
className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
|
|
46
|
+
>
|
|
47
|
+
<Avatar className="h-8 w-8 rounded-lg">
|
|
48
|
+
<AvatarImage src={image ?? undefined} alt={name} />
|
|
49
|
+
<AvatarFallback className="rounded-lg">CN</AvatarFallback>
|
|
50
|
+
</Avatar>
|
|
51
|
+
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
52
|
+
<span className="truncate font-semibold">{name}</span>
|
|
53
|
+
<span className="truncate text-xs">{email}</span>
|
|
54
|
+
</div>
|
|
55
|
+
<ChevronsUpDown className="ml-auto size-4" />
|
|
56
|
+
</SidebarMenuButton>
|
|
57
|
+
</DropdownMenuTrigger>
|
|
58
|
+
<DropdownMenuContent
|
|
59
|
+
className="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg"
|
|
60
|
+
side={isMobile ? "bottom" : "right"}
|
|
61
|
+
align="end"
|
|
62
|
+
sideOffset={4}
|
|
63
|
+
>
|
|
64
|
+
<DropdownMenuLabel className="p-0 font-normal">
|
|
65
|
+
<div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
|
|
66
|
+
<Avatar className="h-8 w-8 rounded-lg">
|
|
67
|
+
<AvatarImage src={image ?? undefined} alt={name} />
|
|
68
|
+
<AvatarFallback className="rounded-lg">CN</AvatarFallback>
|
|
69
|
+
</Avatar>
|
|
70
|
+
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
71
|
+
<span className="truncate font-semibold">{name}</span>
|
|
72
|
+
<span className="truncate text-xs">{email}</span>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</DropdownMenuLabel>
|
|
76
|
+
<DropdownMenuSeparator />
|
|
77
|
+
<DropdownMenuGroup>
|
|
78
|
+
<Link to="/billing">
|
|
79
|
+
<DropdownMenuItem className="cursor-pointer">
|
|
80
|
+
<Sparkles />
|
|
81
|
+
{t("web-ui:sidebar.user.upgradeToPro")}
|
|
82
|
+
</DropdownMenuItem>
|
|
83
|
+
</Link>
|
|
84
|
+
</DropdownMenuGroup>
|
|
85
|
+
<DropdownMenuSeparator />
|
|
86
|
+
<DropdownMenuGroup>
|
|
87
|
+
{isAdmin && (
|
|
88
|
+
<Link to="/admin">
|
|
89
|
+
<DropdownMenuItem className="cursor-pointer">
|
|
90
|
+
<Settings />
|
|
91
|
+
{t("web-ui:sidebar.user.adminDashboard")}
|
|
92
|
+
</DropdownMenuItem>
|
|
93
|
+
</Link>
|
|
94
|
+
)}
|
|
95
|
+
{organizationSettingsPath && (
|
|
96
|
+
<Link to={organizationSettingsPath}>
|
|
97
|
+
<DropdownMenuItem className="cursor-pointer">
|
|
98
|
+
<Building2 />
|
|
99
|
+
{t("web-ui:sidebar.user.organizationSettings", {
|
|
100
|
+
defaultValue: "Organization settings",
|
|
101
|
+
})}
|
|
102
|
+
</DropdownMenuItem>
|
|
103
|
+
</Link>
|
|
104
|
+
)}
|
|
105
|
+
<Link to="/profile">
|
|
106
|
+
<DropdownMenuItem className="cursor-pointer">
|
|
107
|
+
<User />
|
|
108
|
+
{t("web-ui:sidebar.user.account")}
|
|
109
|
+
</DropdownMenuItem>
|
|
110
|
+
</Link>
|
|
111
|
+
<Link to="/billing">
|
|
112
|
+
<DropdownMenuItem className="cursor-pointer">
|
|
113
|
+
<CreditCard />
|
|
114
|
+
{t("web-ui:sidebar.user.billing")}
|
|
115
|
+
</DropdownMenuItem>
|
|
116
|
+
</Link>
|
|
117
|
+
</DropdownMenuGroup>
|
|
118
|
+
<DropdownMenuSeparator />
|
|
119
|
+
<DropdownMenuItem className="cursor-pointer" onClick={onSignOut}>
|
|
120
|
+
<LogOut />
|
|
121
|
+
{t("web-ui:sidebar.user.logout")}
|
|
122
|
+
</DropdownMenuItem>
|
|
123
|
+
</DropdownMenuContent>
|
|
124
|
+
</DropdownMenu>
|
|
125
|
+
</SidebarMenuItem>
|
|
126
|
+
</SidebarMenu>
|
|
127
|
+
);
|
|
128
|
+
}
|