create-einja-app 0.2.17 → 0.2.19
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/README.md +1 -0
- package/dist/cli.js +685 -1715
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
- package/templates/default/.claude/hooks/einja/playwright-resize.sh +12 -2
- package/templates/default/.claude/settings.json +16 -0
- package/templates/default/.cursor/commands/task-vibe-kanban-loop.md +107 -42
- package/templates/default/.env.develop +0 -4
- package/templates/default/.env.example +1 -0
- package/templates/default/.env.preview +0 -4
- package/templates/default/.env.staging +19 -0
- package/templates/default/.github/actions/ci/action.yml +39 -0
- package/templates/default/.github/actions/migrate/action.yml +39 -0
- package/templates/default/.github/actions/neon-export-env/action.yml +28 -0
- package/templates/default/.github/actions/setup/action.yml +20 -0
- package/templates/default/.github/workflows/claude.yml +1 -0
- package/templates/default/.github/workflows/{cleanup-neon-branches.yml → cleanup-pr-preview-db.yml} +28 -24
- package/templates/default/.github/workflows/cleanup-pr-preview-on-close.yml +50 -0
- package/templates/default/.github/workflows/deploy-pr-preview.yml +398 -0
- package/templates/default/.github/workflows/deploy-stable-branches.yml +259 -0
- package/templates/default/.github/workflows/release-create-einja-app.yml +95 -0
- package/templates/default/.mcp.json +29 -11
- package/templates/default/.serena/project.yml +4 -0
- package/templates/default/.vscode/settings.json +18 -0
- package/templates/default/CLAUDE.md +129 -353
- package/templates/default/README.md +5 -14
- package/templates/default/apps/admin/next.config.ts +11 -0
- package/templates/default/apps/admin/package.json +55 -0
- package/templates/default/apps/admin/postcss.config.cjs +5 -0
- package/templates/default/apps/admin/src/app/(auth)/forgot-password/page.tsx +97 -0
- package/templates/default/apps/admin/src/app/(auth)/layout.tsx +18 -0
- package/templates/default/apps/admin/src/app/(auth)/otp/page.tsx +121 -0
- package/templates/default/apps/admin/src/app/(auth)/sign-in/page.tsx +145 -0
- package/templates/default/apps/admin/src/app/(auth)/sign-up/page.tsx +199 -0
- package/templates/default/apps/admin/src/app/(errors)/401/page.tsx +27 -0
- package/templates/default/apps/admin/src/app/(errors)/403/page.tsx +28 -0
- package/templates/default/apps/admin/src/app/(errors)/500/page.tsx +29 -0
- package/templates/default/apps/admin/src/app/(errors)/layout.tsx +7 -0
- package/templates/default/apps/admin/src/app/(errors)/maintenance/page.tsx +25 -0
- package/templates/default/apps/admin/src/app/dashboard/_components/analytics-chart.tsx +68 -0
- package/templates/default/apps/admin/src/app/dashboard/_components/analytics.tsx +182 -0
- package/templates/default/apps/admin/src/app/dashboard/_components/dashboard-page.tsx +74 -0
- package/templates/default/apps/admin/src/app/dashboard/_components/metric-cards.tsx +49 -0
- package/templates/default/apps/admin/src/app/dashboard/_components/overview-chart.tsx +73 -0
- package/templates/default/apps/admin/src/app/dashboard/_components/recent-sales.tsx +75 -0
- package/templates/default/apps/admin/src/app/dashboard/apps/_components/apps-page.tsx +135 -0
- package/templates/default/apps/admin/src/app/dashboard/apps/page.tsx +10 -0
- package/templates/default/apps/admin/src/app/dashboard/chats/_components/chat-list.tsx +82 -0
- package/templates/default/apps/admin/src/app/dashboard/chats/_components/chat-messages.tsx +194 -0
- package/templates/default/apps/admin/src/app/dashboard/chats/_components/chats-page.tsx +99 -0
- package/templates/default/apps/admin/src/app/dashboard/chats/_components/new-chat.tsx +118 -0
- package/templates/default/apps/admin/src/app/dashboard/chats/page.tsx +10 -0
- package/templates/default/apps/admin/src/app/dashboard/layout.tsx +9 -0
- package/templates/default/apps/admin/src/app/dashboard/not-found.tsx +14 -0
- package/templates/default/apps/admin/src/app/dashboard/page.tsx +10 -0
- package/templates/default/apps/admin/src/app/dashboard/settings/_components/content-section.tsx +20 -0
- package/templates/default/apps/admin/src/app/dashboard/settings/_components/sidebar-nav.tsx +66 -0
- package/templates/default/apps/admin/src/app/dashboard/settings/account/page.tsx +173 -0
- package/templates/default/apps/admin/src/app/dashboard/settings/appearance/page.tsx +156 -0
- package/templates/default/apps/admin/src/app/dashboard/settings/display/page.tsx +125 -0
- package/templates/default/apps/admin/src/app/dashboard/settings/layout.tsx +30 -0
- package/templates/default/apps/admin/src/app/dashboard/settings/notifications/page.tsx +196 -0
- package/templates/default/apps/admin/src/app/dashboard/settings/page.tsx +5 -0
- package/templates/default/apps/admin/src/app/dashboard/settings/profile/page.tsx +176 -0
- package/templates/default/apps/admin/src/app/dashboard/tasks/_components/data-table-bulk-actions.tsx +183 -0
- package/templates/default/apps/admin/src/app/dashboard/tasks/_components/data-table-row-actions.tsx +79 -0
- package/templates/default/apps/admin/src/app/dashboard/tasks/_components/tasks-columns.tsx +107 -0
- package/templates/default/apps/admin/src/app/dashboard/tasks/_components/tasks-dialogs.tsx +71 -0
- package/templates/default/apps/admin/src/app/dashboard/tasks/_components/tasks-import-dialog.tsx +106 -0
- package/templates/default/apps/admin/src/app/dashboard/tasks/_components/tasks-multi-delete-dialog.tsx +90 -0
- package/templates/default/apps/admin/src/app/dashboard/tasks/_components/tasks-mutate-drawer.tsx +207 -0
- package/templates/default/apps/admin/src/app/dashboard/tasks/_components/tasks-page.tsx +31 -0
- package/templates/default/apps/admin/src/app/dashboard/tasks/_components/tasks-primary-buttons.tsx +19 -0
- package/templates/default/apps/admin/src/app/dashboard/tasks/_components/tasks-provider.tsx +37 -0
- package/templates/default/apps/admin/src/app/dashboard/tasks/_components/tasks-table.tsx +155 -0
- package/templates/default/apps/admin/src/app/dashboard/tasks/page.tsx +14 -0
- package/templates/default/apps/admin/src/app/dashboard/users/_components/data-table-bulk-actions.tsx +136 -0
- package/templates/default/apps/admin/src/app/dashboard/users/_components/data-table-row-actions.tsx +62 -0
- package/templates/default/apps/admin/src/app/dashboard/users/_components/users-action-dialog.tsx +297 -0
- package/templates/default/apps/admin/src/app/dashboard/users/_components/users-columns.tsx +121 -0
- package/templates/default/apps/admin/src/app/dashboard/users/_components/users-delete-dialog.tsx +72 -0
- package/templates/default/apps/admin/src/app/dashboard/users/_components/users-dialogs.tsx +49 -0
- package/templates/default/apps/admin/src/app/dashboard/users/_components/users-invite-dialog.tsx +139 -0
- package/templates/default/apps/admin/src/app/dashboard/users/_components/users-multi-delete-dialog.tsx +89 -0
- package/templates/default/apps/admin/src/app/dashboard/users/_components/users-page.tsx +30 -0
- package/templates/default/apps/admin/src/app/dashboard/users/_components/users-primary-buttons.tsx +19 -0
- package/templates/default/apps/admin/src/app/dashboard/users/_components/users-provider.tsx +35 -0
- package/templates/default/apps/admin/src/app/dashboard/users/_components/users-table.tsx +157 -0
- package/templates/default/apps/admin/src/app/dashboard/users/page.tsx +10 -0
- package/templates/default/apps/admin/src/app/globals.css +109 -0
- package/templates/default/apps/admin/src/app/layout.tsx +32 -0
- package/templates/default/apps/admin/src/app/not-found.tsx +14 -0
- package/templates/default/apps/admin/src/app/page.tsx +5 -0
- package/templates/default/apps/admin/src/components/layout/admin-layout.tsx +16 -0
- package/templates/default/apps/admin/src/components/layout/app-sidebar.tsx +52 -0
- package/templates/default/apps/admin/src/components/layout/nav-config.ts +131 -0
- package/templates/default/apps/admin/src/components/providers/theme-provider.tsx +10 -0
- package/templates/default/apps/admin/src/components/shared/long-text.tsx +78 -0
- package/templates/default/apps/admin/src/components/shared/search-input.tsx +16 -0
- package/templates/default/apps/admin/src/components/shared/select-dropdown.tsx +64 -0
- package/templates/default/apps/admin/src/data/apps.tsx +116 -0
- package/templates/default/apps/admin/src/data/chats.ts +114 -0
- package/templates/default/apps/admin/src/data/tasks.ts +114 -0
- package/templates/default/apps/admin/src/data/users.ts +90 -0
- package/templates/default/apps/admin/src/hooks/use-dialog-state.ts +17 -0
- package/templates/default/apps/admin/src/hooks/use-table-url-state.ts +243 -0
- package/templates/default/apps/admin/src/lib/show-submitted-data.tsx +12 -0
- package/templates/default/apps/admin/src/types/table.d.ts +9 -0
- package/templates/default/apps/admin/tsconfig.json +32 -0
- package/templates/default/apps/web/next.config.ts +1 -0
- package/templates/default/apps/web/package.json +0 -22
- package/templates/default/apps/web/postcss.config.cjs +0 -1
- package/templates/default/apps/web/src/app/(authenticated)/dashboard/page.tsx +4 -20
- package/templates/default/apps/web/src/app/(authenticated)/data/_components/UserTable.tsx +4 -4
- package/templates/default/apps/web/src/app/(authenticated)/data/page.tsx +1 -1
- package/templates/default/apps/web/src/app/(authenticated)/profile/page.tsx +1 -1
- package/templates/default/apps/web/src/app/error.tsx +8 -70
- package/templates/default/apps/web/src/app/global-error.tsx +8 -70
- package/templates/default/apps/web/src/app/globals.css +20 -0
- package/templates/default/apps/web/src/app/not-found.tsx +5 -39
- package/templates/default/apps/web/src/app/page.tsx +27 -203
- package/templates/default/apps/web/src/app/signin/page.tsx +27 -191
- package/templates/default/apps/web/src/app/signup/page.tsx +33 -240
- package/templates/default/apps/web/src/components/dashboard/dashboard-stats.tsx +11 -75
- package/templates/default/apps/web/src/components/shared/Sidebar.tsx +3 -3
- package/templates/default/apps/web/src/components/shared/header.tsx +17 -112
- package/templates/default/apps/web/tsconfig.json +0 -6
- package/templates/default/biome.json +1 -2
- package/templates/default/components.json +2 -2
- package/templates/default/docker-compose.yml +1 -1
- package/templates/default/gitignore +4 -0
- package/templates/default/package.json +1 -0
- package/templates/default/packages/admin-ui/catalog/catalog.css +54 -0
- package/templates/default/packages/admin-ui/catalog/catalog.tsx +401 -0
- package/templates/default/packages/admin-ui/catalog/index.html +12 -0
- package/templates/default/packages/admin-ui/catalog/main.tsx +9 -0
- package/templates/default/packages/admin-ui/components.json +21 -0
- package/templates/default/packages/admin-ui/package.json +105 -0
- package/templates/default/packages/admin-ui/src/command-menu/index.tsx +174 -0
- package/templates/default/packages/admin-ui/src/data-table/bulk-actions.tsx +215 -0
- package/templates/default/packages/admin-ui/src/data-table/column-header.tsx +73 -0
- package/templates/default/packages/admin-ui/src/data-table/data-table.tsx +127 -0
- package/templates/default/packages/admin-ui/src/data-table/faceted-filter.tsx +148 -0
- package/templates/default/packages/admin-ui/src/data-table/index.tsx +9 -0
- package/templates/default/packages/admin-ui/src/data-table/pagination.tsx +101 -0
- package/templates/default/packages/admin-ui/src/data-table/toolbar.tsx +87 -0
- package/templates/default/packages/admin-ui/src/data-table/view-options.tsx +57 -0
- package/templates/default/packages/admin-ui/src/hooks/use-mobile.tsx +23 -0
- package/templates/default/packages/admin-ui/src/layout/header.tsx +55 -0
- package/templates/default/packages/admin-ui/src/layout/index.ts +10 -0
- package/templates/default/packages/admin-ui/src/layout/main.tsx +23 -0
- package/templates/default/packages/admin-ui/src/layout/nav-group.tsx +111 -0
- package/templates/default/packages/admin-ui/src/layout/nav-user.tsx +114 -0
- package/templates/default/packages/admin-ui/src/layout/theme-switch.tsx +40 -0
- package/templates/default/packages/admin-ui/src/layout/types.ts +21 -0
- package/templates/default/packages/admin-ui/src/lib/utils.ts +6 -0
- package/templates/default/packages/admin-ui/src/styles/base.css +65 -0
- package/templates/default/packages/admin-ui/src/styles/tokens.css +91 -0
- package/templates/default/packages/admin-ui/src/tanstack-table.d.ts +10 -0
- package/templates/default/packages/admin-ui/src/ui/alert-dialog.tsx +157 -0
- package/templates/default/packages/admin-ui/src/ui/alert.tsx +66 -0
- package/templates/default/packages/admin-ui/src/ui/avatar.tsx +53 -0
- package/templates/default/packages/admin-ui/src/ui/badge.tsx +46 -0
- package/templates/default/packages/admin-ui/src/ui/breadcrumb.tsx +108 -0
- package/templates/default/packages/admin-ui/src/ui/button.tsx +59 -0
- package/templates/default/packages/admin-ui/src/ui/calendar.tsx +69 -0
- package/templates/default/packages/admin-ui/src/ui/card.tsx +92 -0
- package/templates/default/packages/admin-ui/src/ui/chart.tsx +345 -0
- package/templates/default/packages/admin-ui/src/ui/checkbox.tsx +32 -0
- package/templates/default/packages/admin-ui/src/ui/collapsible.tsx +27 -0
- package/templates/default/packages/admin-ui/src/ui/command.tsx +161 -0
- package/templates/default/packages/admin-ui/src/ui/confirm-dialog.tsx +72 -0
- package/templates/default/packages/admin-ui/src/ui/date-picker.tsx +53 -0
- package/templates/default/packages/admin-ui/src/ui/dialog.tsx +143 -0
- package/templates/default/packages/admin-ui/src/ui/dropdown-menu.tsx +257 -0
- package/templates/default/packages/admin-ui/src/ui/form.tsx +168 -0
- package/templates/default/packages/admin-ui/src/ui/input-otp.tsx +84 -0
- package/templates/default/packages/admin-ui/src/ui/input.tsx +21 -0
- package/templates/default/packages/admin-ui/src/ui/label.tsx +24 -0
- package/templates/default/packages/admin-ui/src/ui/pagination.tsx +126 -0
- package/templates/default/packages/admin-ui/src/ui/password-input.tsx +46 -0
- package/templates/default/packages/admin-ui/src/ui/popover.tsx +48 -0
- package/templates/default/packages/admin-ui/src/ui/progress.tsx +31 -0
- package/templates/default/packages/admin-ui/src/ui/radio-group.tsx +45 -0
- package/templates/default/packages/admin-ui/src/ui/scroll-area.tsx +52 -0
- package/templates/default/packages/admin-ui/src/ui/select.tsx +185 -0
- package/templates/default/packages/admin-ui/src/ui/separator.tsx +28 -0
- package/templates/default/packages/admin-ui/src/ui/sheet.tsx +149 -0
- package/templates/default/packages/admin-ui/src/ui/sidebar.tsx +728 -0
- package/templates/default/packages/admin-ui/src/ui/skeleton.tsx +13 -0
- package/templates/default/packages/admin-ui/src/ui/sonner.tsx +25 -0
- package/templates/default/packages/admin-ui/src/ui/switch.tsx +31 -0
- package/templates/default/packages/admin-ui/src/ui/table.tsx +116 -0
- package/templates/default/packages/admin-ui/src/ui/tabs.tsx +66 -0
- package/templates/default/packages/admin-ui/src/ui/textarea.tsx +18 -0
- package/templates/default/packages/admin-ui/src/ui/toggle-group.tsx +60 -0
- package/templates/default/packages/admin-ui/src/ui/toggle.tsx +44 -0
- package/templates/default/packages/admin-ui/src/ui/tooltip.tsx +61 -0
- package/templates/default/packages/admin-ui/tsconfig.json +8 -0
- package/templates/default/packages/admin-ui/vite.config.ts +11 -0
- package/templates/default/packages/config/package.json +0 -2
- package/templates/default/packages/server-core/package.json +1 -0
- package/templates/default/packages/ui/components.json +21 -0
- package/templates/default/packages/ui/package.json +42 -5
- package/templates/default/packages/ui/src/accordion.tsx +1 -1
- package/templates/default/packages/ui/src/alert-dialog.tsx +4 -4
- package/templates/default/packages/ui/src/alert.tsx +1 -1
- package/templates/default/packages/ui/src/avatar.tsx +1 -1
- package/templates/default/packages/ui/src/badge.tsx +1 -1
- package/templates/default/packages/ui/src/breadcrumb.tsx +1 -1
- package/templates/default/packages/ui/src/button.tsx +1 -1
- package/templates/default/packages/ui/src/card.tsx +1 -1
- package/templates/default/packages/ui/src/checkbox.tsx +1 -1
- package/templates/default/packages/ui/src/dialog.tsx +3 -3
- package/templates/default/packages/ui/src/drawer.tsx +3 -3
- package/templates/default/packages/ui/src/dropdown-menu.tsx +3 -3
- package/templates/default/packages/ui/src/form.tsx +2 -2
- package/templates/default/packages/ui/src/hover-card.tsx +2 -2
- package/templates/default/packages/ui/src/input.tsx +1 -1
- package/templates/default/packages/ui/src/label.tsx +1 -1
- package/templates/default/packages/ui/src/pagination.tsx +2 -2
- package/templates/default/packages/ui/src/popover.tsx +2 -2
- package/templates/default/packages/ui/src/progress.tsx +1 -1
- package/templates/default/packages/ui/src/select.tsx +2 -2
- package/templates/default/packages/ui/src/separator.tsx +1 -1
- package/templates/default/packages/ui/src/skeleton.tsx +1 -1
- package/templates/default/packages/ui/src/table.tsx +1 -1
- package/templates/default/packages/ui/src/tabs.tsx +1 -1
- package/templates/default/packages/ui/src/textarea.tsx +1 -1
- package/templates/default/packages/ui/src/tooltip.tsx +3 -3
- package/templates/default/packages/ui/src/typography.tsx +1 -1
- package/templates/default/packages/ui/tsconfig.json +1 -6
- package/templates/default/pnpm-lock.yaml +1319 -936
- package/templates/default/postcss.config.cjs +0 -1
- package/templates/default/turbo.json +11 -5
- package/templates/default/worktree.config.json +5 -0
- package/templates/default/.env.ci +0 -32
- package/templates/default/.github/workflows/ci.yml +0 -96
- package/templates/default/.github/workflows/preview-db.yml +0 -134
- package/templates/default/.playwright-mcp/dashboard.png +0 -0
- package/templates/default/.playwright-mcp/web-home.png +0 -0
- package/templates/default/apps/web/panda.config.ts +0 -114
- package/templates/default/apps/web/src/components/ui/accordion.tsx +0 -64
- package/templates/default/apps/web/src/components/ui/alert-dialog.tsx +0 -135
- package/templates/default/apps/web/src/components/ui/alert.tsx +0 -60
- package/templates/default/apps/web/src/components/ui/aspect-ratio.tsx +0 -9
- package/templates/default/apps/web/src/components/ui/avatar.tsx +0 -41
- package/templates/default/apps/web/src/components/ui/badge.tsx +0 -39
- package/templates/default/apps/web/src/components/ui/breadcrumb.tsx +0 -101
- package/templates/default/apps/web/src/components/ui/button.tsx +0 -56
- package/templates/default/apps/web/src/components/ui/card.tsx +0 -75
- package/templates/default/apps/web/src/components/ui/checkbox.tsx +0 -29
- package/templates/default/apps/web/src/components/ui/data-table.tsx +0 -189
- package/templates/default/apps/web/src/components/ui/dialog-hook.tsx +0 -210
- package/templates/default/apps/web/src/components/ui/dialog.tsx +0 -129
- package/templates/default/apps/web/src/components/ui/drawer.tsx +0 -124
- package/templates/default/apps/web/src/components/ui/dropdown-menu.tsx +0 -228
- package/templates/default/apps/web/src/components/ui/form.tsx +0 -152
- package/templates/default/apps/web/src/components/ui/hover-card.tsx +0 -38
- package/templates/default/apps/web/src/components/ui/input.tsx +0 -21
- package/templates/default/apps/web/src/components/ui/label.tsx +0 -21
- package/templates/default/apps/web/src/components/ui/pagination.tsx +0 -105
- package/templates/default/apps/web/src/components/ui/popover.tsx +0 -42
- package/templates/default/apps/web/src/components/ui/progress.tsx +0 -28
- package/templates/default/apps/web/src/components/ui/select.tsx +0 -170
- package/templates/default/apps/web/src/components/ui/separator.tsx +0 -28
- package/templates/default/apps/web/src/components/ui/skeleton.tsx +0 -13
- package/templates/default/apps/web/src/components/ui/sonner.tsx +0 -25
- package/templates/default/apps/web/src/components/ui/table.tsx +0 -92
- package/templates/default/apps/web/src/components/ui/tabs.tsx +0 -54
- package/templates/default/apps/web/src/components/ui/textarea.tsx +0 -18
- package/templates/default/apps/web/src/components/ui/tooltip.tsx +0 -57
- package/templates/default/apps/web/src/components/ui/typography.tsx +0 -158
- package/templates/default/packages/config/panda.config.ts +0 -114
- package/templates/default/panda.config.ts +0 -114
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
BadgeCheckIcon,
|
|
5
|
+
BellIcon,
|
|
6
|
+
ChevronsUpDownIcon,
|
|
7
|
+
LogOutIcon,
|
|
8
|
+
} from "lucide-react";
|
|
9
|
+
import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";
|
|
10
|
+
import {
|
|
11
|
+
DropdownMenu,
|
|
12
|
+
DropdownMenuContent,
|
|
13
|
+
DropdownMenuGroup,
|
|
14
|
+
DropdownMenuItem,
|
|
15
|
+
DropdownMenuLabel,
|
|
16
|
+
DropdownMenuSeparator,
|
|
17
|
+
DropdownMenuTrigger,
|
|
18
|
+
} from "../ui/dropdown-menu";
|
|
19
|
+
import {
|
|
20
|
+
SidebarMenu,
|
|
21
|
+
SidebarMenuButton,
|
|
22
|
+
SidebarMenuItem,
|
|
23
|
+
useSidebar,
|
|
24
|
+
} from "../ui/sidebar";
|
|
25
|
+
|
|
26
|
+
interface NavUserProps {
|
|
27
|
+
user: {
|
|
28
|
+
name: string;
|
|
29
|
+
email: string;
|
|
30
|
+
avatar?: string;
|
|
31
|
+
};
|
|
32
|
+
onSignOut?: () => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function NavUser({ user, onSignOut }: NavUserProps) {
|
|
36
|
+
const { isMobile } = useSidebar();
|
|
37
|
+
const initials = user.name
|
|
38
|
+
.split(" ")
|
|
39
|
+
.map((n) => n[0])
|
|
40
|
+
.join("")
|
|
41
|
+
.toUpperCase()
|
|
42
|
+
.slice(0, 2);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<SidebarMenu>
|
|
46
|
+
<SidebarMenuItem>
|
|
47
|
+
<DropdownMenu>
|
|
48
|
+
<DropdownMenuTrigger asChild>
|
|
49
|
+
<SidebarMenuButton
|
|
50
|
+
size="lg"
|
|
51
|
+
className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
|
|
52
|
+
>
|
|
53
|
+
<Avatar className="h-8 w-8 rounded-lg">
|
|
54
|
+
{user.avatar && (
|
|
55
|
+
<AvatarImage src={user.avatar} alt={user.name} />
|
|
56
|
+
)}
|
|
57
|
+
<AvatarFallback className="rounded-lg">
|
|
58
|
+
{initials}
|
|
59
|
+
</AvatarFallback>
|
|
60
|
+
</Avatar>
|
|
61
|
+
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
62
|
+
<span className="truncate font-semibold">{user.name}</span>
|
|
63
|
+
<span className="truncate text-xs">{user.email}</span>
|
|
64
|
+
</div>
|
|
65
|
+
<ChevronsUpDownIcon className="ml-auto size-4" />
|
|
66
|
+
</SidebarMenuButton>
|
|
67
|
+
</DropdownMenuTrigger>
|
|
68
|
+
<DropdownMenuContent
|
|
69
|
+
className="w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg"
|
|
70
|
+
side={isMobile ? "bottom" : "right"}
|
|
71
|
+
align="end"
|
|
72
|
+
sideOffset={4}
|
|
73
|
+
>
|
|
74
|
+
<DropdownMenuLabel className="p-0 font-normal">
|
|
75
|
+
<div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
|
|
76
|
+
<Avatar className="h-8 w-8 rounded-lg">
|
|
77
|
+
{user.avatar && (
|
|
78
|
+
<AvatarImage src={user.avatar} alt={user.name} />
|
|
79
|
+
)}
|
|
80
|
+
<AvatarFallback className="rounded-lg">
|
|
81
|
+
{initials}
|
|
82
|
+
</AvatarFallback>
|
|
83
|
+
</Avatar>
|
|
84
|
+
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
85
|
+
<span className="truncate font-semibold">{user.name}</span>
|
|
86
|
+
<span className="truncate text-xs">{user.email}</span>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</DropdownMenuLabel>
|
|
90
|
+
<DropdownMenuSeparator />
|
|
91
|
+
<DropdownMenuGroup>
|
|
92
|
+
<DropdownMenuItem>
|
|
93
|
+
<BadgeCheckIcon />
|
|
94
|
+
Account
|
|
95
|
+
</DropdownMenuItem>
|
|
96
|
+
<DropdownMenuItem>
|
|
97
|
+
<BellIcon />
|
|
98
|
+
Notifications
|
|
99
|
+
</DropdownMenuItem>
|
|
100
|
+
</DropdownMenuGroup>
|
|
101
|
+
<DropdownMenuSeparator />
|
|
102
|
+
<DropdownMenuItem onClick={onSignOut}>
|
|
103
|
+
<LogOutIcon />
|
|
104
|
+
Log out
|
|
105
|
+
</DropdownMenuItem>
|
|
106
|
+
</DropdownMenuContent>
|
|
107
|
+
</DropdownMenu>
|
|
108
|
+
</SidebarMenuItem>
|
|
109
|
+
</SidebarMenu>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export { NavUser };
|
|
114
|
+
export type { NavUserProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { MoonIcon, SunIcon } from "lucide-react";
|
|
4
|
+
import { useTheme } from "next-themes";
|
|
5
|
+
import { Button } from "../ui/button";
|
|
6
|
+
import {
|
|
7
|
+
DropdownMenu,
|
|
8
|
+
DropdownMenuContent,
|
|
9
|
+
DropdownMenuItem,
|
|
10
|
+
DropdownMenuTrigger,
|
|
11
|
+
} from "../ui/dropdown-menu";
|
|
12
|
+
|
|
13
|
+
function ThemeSwitch() {
|
|
14
|
+
const { setTheme } = useTheme();
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<DropdownMenu>
|
|
18
|
+
<DropdownMenuTrigger asChild>
|
|
19
|
+
<Button variant="ghost" size="icon">
|
|
20
|
+
<SunIcon className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
|
|
21
|
+
<MoonIcon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
|
|
22
|
+
<span className="sr-only">Toggle theme</span>
|
|
23
|
+
</Button>
|
|
24
|
+
</DropdownMenuTrigger>
|
|
25
|
+
<DropdownMenuContent align="end">
|
|
26
|
+
<DropdownMenuItem onClick={() => setTheme("light")}>
|
|
27
|
+
Light
|
|
28
|
+
</DropdownMenuItem>
|
|
29
|
+
<DropdownMenuItem onClick={() => setTheme("dark")}>
|
|
30
|
+
Dark
|
|
31
|
+
</DropdownMenuItem>
|
|
32
|
+
<DropdownMenuItem onClick={() => setTheme("system")}>
|
|
33
|
+
System
|
|
34
|
+
</DropdownMenuItem>
|
|
35
|
+
</DropdownMenuContent>
|
|
36
|
+
</DropdownMenu>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { ThemeSwitch };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
|
+
|
|
3
|
+
export interface NavItem {
|
|
4
|
+
title: string;
|
|
5
|
+
url?: string;
|
|
6
|
+
icon?: LucideIcon;
|
|
7
|
+
badge?: string;
|
|
8
|
+
isActive?: boolean;
|
|
9
|
+
items?: NavSubItem[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface NavSubItem {
|
|
13
|
+
title: string;
|
|
14
|
+
url: string;
|
|
15
|
+
badge?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface NavGroup {
|
|
19
|
+
title: string;
|
|
20
|
+
items: NavItem[];
|
|
21
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* packages/admin-ui/src/styles/base.css */
|
|
2
|
+
/* Tailwind v4 統合 + admin-uiデフォルトトークン */
|
|
3
|
+
/* アプリ側はこのファイルをインポートしてトークンを利用する */
|
|
4
|
+
/*
|
|
5
|
+
* 使い方:
|
|
6
|
+
* apps/admin/src/app/globals.css で:
|
|
7
|
+
* @import "@repo/admin-ui/styles/base.css";
|
|
8
|
+
*
|
|
9
|
+
* トークンをオーバーライドする場合:
|
|
10
|
+
* @import "@repo/admin-ui/styles/base.css";
|
|
11
|
+
* :root { --primary: oklch(0.6 0.2 260); }
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
@import "tailwindcss";
|
|
15
|
+
@import "tw-animate-css";
|
|
16
|
+
@import "./tokens.css";
|
|
17
|
+
|
|
18
|
+
@custom-variant dark (&:is(.dark *));
|
|
19
|
+
|
|
20
|
+
@theme inline {
|
|
21
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
22
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
23
|
+
--radius-lg: var(--radius);
|
|
24
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
25
|
+
--color-background: var(--background);
|
|
26
|
+
--color-foreground: var(--foreground);
|
|
27
|
+
--color-card: var(--card);
|
|
28
|
+
--color-card-foreground: var(--card-foreground);
|
|
29
|
+
--color-popover: var(--popover);
|
|
30
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
31
|
+
--color-primary: var(--primary);
|
|
32
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
33
|
+
--color-secondary: var(--secondary);
|
|
34
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
35
|
+
--color-muted: var(--muted);
|
|
36
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
37
|
+
--color-accent: var(--accent);
|
|
38
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
39
|
+
--color-destructive: var(--destructive);
|
|
40
|
+
--color-border: var(--border);
|
|
41
|
+
--color-input: var(--input);
|
|
42
|
+
--color-ring: var(--ring);
|
|
43
|
+
--color-chart-1: var(--chart-1);
|
|
44
|
+
--color-chart-2: var(--chart-2);
|
|
45
|
+
--color-chart-3: var(--chart-3);
|
|
46
|
+
--color-chart-4: var(--chart-4);
|
|
47
|
+
--color-chart-5: var(--chart-5);
|
|
48
|
+
--color-sidebar: var(--sidebar);
|
|
49
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
50
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
51
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
52
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
53
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
54
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
55
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@layer base {
|
|
59
|
+
* {
|
|
60
|
+
@apply border-border outline-ring/50;
|
|
61
|
+
}
|
|
62
|
+
body {
|
|
63
|
+
@apply bg-background text-foreground;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/* packages/admin-ui/src/styles/tokens.css */
|
|
2
|
+
/* admin系デザインシステムのデフォルトトークン値 */
|
|
3
|
+
/* アプリ側(apps/admin/src/app/globals.css)で上書き可能 */
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--radius: 0.625rem;
|
|
7
|
+
--background: oklch(1 0 0);
|
|
8
|
+
--foreground: oklch(0.145 0 0);
|
|
9
|
+
--card: oklch(1 0 0);
|
|
10
|
+
--card-foreground: oklch(0.145 0 0);
|
|
11
|
+
--popover: oklch(1 0 0);
|
|
12
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
13
|
+
--primary: oklch(0.205 0.042 265.755);
|
|
14
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
15
|
+
--secondary: oklch(0.97 0 0);
|
|
16
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
17
|
+
--muted: oklch(0.97 0 0);
|
|
18
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
19
|
+
--accent: oklch(0.97 0 0);
|
|
20
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
21
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
22
|
+
--border: oklch(0.922 0 0);
|
|
23
|
+
--input: oklch(0.922 0 0);
|
|
24
|
+
--ring: oklch(0.708 0 0);
|
|
25
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
26
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
27
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
28
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
29
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
30
|
+
--sidebar: oklch(0.985 0 0);
|
|
31
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
32
|
+
--sidebar-primary: oklch(0.205 0.042 265.755);
|
|
33
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
34
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
35
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
36
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
37
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
38
|
+
|
|
39
|
+
/* z-index階層トークン */
|
|
40
|
+
--z-base: 0;
|
|
41
|
+
/* コンポーネント内部レイヤー(低優先度のローカルスタッキング) */
|
|
42
|
+
--z-sticky: 10; /* sticky要素(テーブルカラム、セクションヘッダー) */
|
|
43
|
+
--z-sidebar: 10; /* サイドバー本体 */
|
|
44
|
+
--z-sidebar-rail: 20; /* サイドバーリサイズハンドル */
|
|
45
|
+
--z-mobile-panel: 30; /* モバイルスライドインパネル */
|
|
46
|
+
--z-header: 40;
|
|
47
|
+
--z-dropdown: 50;
|
|
48
|
+
--z-drawer-overlay: 59;
|
|
49
|
+
--z-drawer: 60;
|
|
50
|
+
--z-dialog-overlay: 69;
|
|
51
|
+
--z-dialog: 70;
|
|
52
|
+
--z-alert-dialog-overlay: 79;
|
|
53
|
+
--z-alert-dialog: 80;
|
|
54
|
+
/* 最上位レイヤー */
|
|
55
|
+
--z-toast: 90; /* トースト通知 */
|
|
56
|
+
--z-tooltip: 100; /* ツールチップ */
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.dark {
|
|
60
|
+
--background: oklch(0.145 0 0);
|
|
61
|
+
--foreground: oklch(0.985 0 0);
|
|
62
|
+
--card: oklch(0.205 0 0);
|
|
63
|
+
--card-foreground: oklch(0.985 0 0);
|
|
64
|
+
--popover: oklch(0.205 0 0);
|
|
65
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
66
|
+
--primary: oklch(0.922 0 0);
|
|
67
|
+
--primary-foreground: oklch(0.205 0.042 265.755);
|
|
68
|
+
--secondary: oklch(0.269 0 0);
|
|
69
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
70
|
+
--muted: oklch(0.269 0 0);
|
|
71
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
72
|
+
--accent: oklch(0.269 0 0);
|
|
73
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
74
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
75
|
+
--border: oklch(1 0 0 / 10%);
|
|
76
|
+
--input: oklch(1 0 0 / 15%);
|
|
77
|
+
--ring: oklch(0.556 0 0);
|
|
78
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
79
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
80
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
81
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
82
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
83
|
+
--sidebar: oklch(0.205 0 0);
|
|
84
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
85
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
86
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
87
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
88
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
89
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
90
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
91
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "@tanstack/react-table";
|
|
2
|
+
|
|
3
|
+
declare module "@tanstack/react-table" {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
+
interface ColumnMeta<TData, TValue> {
|
|
6
|
+
className?: string; // apply to both th and td
|
|
7
|
+
tdClassName?: string;
|
|
8
|
+
thClassName?: string;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
+
import type * as React from "react";
|
|
5
|
+
|
|
6
|
+
import { buttonVariants } from "./button";
|
|
7
|
+
import { cn } from "../lib/utils";
|
|
8
|
+
|
|
9
|
+
function AlertDialog({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
12
|
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function AlertDialogTrigger({
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
18
|
+
return (
|
|
19
|
+
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function AlertDialogPortal({
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
26
|
+
return (
|
|
27
|
+
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function AlertDialogOverlay({
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
|
|
35
|
+
return (
|
|
36
|
+
<AlertDialogPrimitive.Overlay
|
|
37
|
+
data-slot="alert-dialog-overlay"
|
|
38
|
+
className={cn(
|
|
39
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[var(--z-alert-dialog-overlay)] bg-black/50",
|
|
40
|
+
className,
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function AlertDialogContent({
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
|
|
51
|
+
return (
|
|
52
|
+
<AlertDialogPortal>
|
|
53
|
+
<AlertDialogOverlay />
|
|
54
|
+
<AlertDialogPrimitive.Content
|
|
55
|
+
data-slot="alert-dialog-content"
|
|
56
|
+
className={cn(
|
|
57
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-[var(--z-alert-dialog)] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
58
|
+
className,
|
|
59
|
+
)}
|
|
60
|
+
{...props}
|
|
61
|
+
/>
|
|
62
|
+
</AlertDialogPortal>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function AlertDialogHeader({
|
|
67
|
+
className,
|
|
68
|
+
...props
|
|
69
|
+
}: React.ComponentProps<"div">) {
|
|
70
|
+
return (
|
|
71
|
+
<div
|
|
72
|
+
data-slot="alert-dialog-header"
|
|
73
|
+
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
74
|
+
{...props}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function AlertDialogFooter({
|
|
80
|
+
className,
|
|
81
|
+
...props
|
|
82
|
+
}: React.ComponentProps<"div">) {
|
|
83
|
+
return (
|
|
84
|
+
<div
|
|
85
|
+
data-slot="alert-dialog-footer"
|
|
86
|
+
className={cn(
|
|
87
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
88
|
+
className,
|
|
89
|
+
)}
|
|
90
|
+
{...props}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function AlertDialogTitle({
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
99
|
+
return (
|
|
100
|
+
<AlertDialogPrimitive.Title
|
|
101
|
+
data-slot="alert-dialog-title"
|
|
102
|
+
className={cn("text-lg font-semibold", className)}
|
|
103
|
+
{...props}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function AlertDialogDescription({
|
|
109
|
+
className,
|
|
110
|
+
...props
|
|
111
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
112
|
+
return (
|
|
113
|
+
<AlertDialogPrimitive.Description
|
|
114
|
+
data-slot="alert-dialog-description"
|
|
115
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
116
|
+
{...props}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function AlertDialogAction({
|
|
122
|
+
className,
|
|
123
|
+
...props
|
|
124
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
|
|
125
|
+
return (
|
|
126
|
+
<AlertDialogPrimitive.Action
|
|
127
|
+
className={cn(buttonVariants(), className)}
|
|
128
|
+
{...props}
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function AlertDialogCancel({
|
|
134
|
+
className,
|
|
135
|
+
...props
|
|
136
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
|
|
137
|
+
return (
|
|
138
|
+
<AlertDialogPrimitive.Cancel
|
|
139
|
+
className={cn(buttonVariants({ variant: "outline" }), className)}
|
|
140
|
+
{...props}
|
|
141
|
+
/>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export {
|
|
146
|
+
AlertDialog,
|
|
147
|
+
AlertDialogPortal,
|
|
148
|
+
AlertDialogOverlay,
|
|
149
|
+
AlertDialogTrigger,
|
|
150
|
+
AlertDialogContent,
|
|
151
|
+
AlertDialogHeader,
|
|
152
|
+
AlertDialogFooter,
|
|
153
|
+
AlertDialogTitle,
|
|
154
|
+
AlertDialogDescription,
|
|
155
|
+
AlertDialogAction,
|
|
156
|
+
AlertDialogCancel,
|
|
157
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type VariantProps, cva } from "class-variance-authority";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
|
|
6
|
+
const alertVariants = cva(
|
|
7
|
+
"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-card text-card-foreground",
|
|
12
|
+
destructive:
|
|
13
|
+
"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
function Alert({
|
|
23
|
+
className,
|
|
24
|
+
variant,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
data-slot="alert"
|
|
30
|
+
role="alert"
|
|
31
|
+
className={cn(alertVariants({ variant }), className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
data-slot="alert-title"
|
|
41
|
+
className={cn(
|
|
42
|
+
"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
|
|
43
|
+
className,
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function AlertDescription({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}: React.ComponentProps<"div">) {
|
|
54
|
+
return (
|
|
55
|
+
<div
|
|
56
|
+
data-slot="alert-description"
|
|
57
|
+
className={cn(
|
|
58
|
+
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
59
|
+
className,
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
4
|
+
import type * as React from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../lib/utils";
|
|
7
|
+
|
|
8
|
+
function Avatar({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<AvatarPrimitive.Root
|
|
14
|
+
data-slot="avatar"
|
|
15
|
+
className={cn(
|
|
16
|
+
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function AvatarImage({
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
|
28
|
+
return (
|
|
29
|
+
<AvatarPrimitive.Image
|
|
30
|
+
data-slot="avatar-image"
|
|
31
|
+
className={cn("aspect-square size-full", className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function AvatarFallback({
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
|
|
41
|
+
return (
|
|
42
|
+
<AvatarPrimitive.Fallback
|
|
43
|
+
data-slot="avatar-fallback"
|
|
44
|
+
className={cn(
|
|
45
|
+
"bg-muted flex size-full items-center justify-center rounded-full",
|
|
46
|
+
className,
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
+
import { type VariantProps, cva } from "class-variance-authority";
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
|
|
7
|
+
const badgeVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default:
|
|
13
|
+
"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
14
|
+
secondary:
|
|
15
|
+
"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
16
|
+
destructive:
|
|
17
|
+
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
18
|
+
outline:
|
|
19
|
+
"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "default",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
function Badge({
|
|
29
|
+
className,
|
|
30
|
+
variant,
|
|
31
|
+
asChild = false,
|
|
32
|
+
...props
|
|
33
|
+
}: React.ComponentProps<"span"> &
|
|
34
|
+
VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
|
|
35
|
+
const Comp = asChild ? Slot : "span";
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Comp
|
|
39
|
+
data-slot="badge"
|
|
40
|
+
className={cn(badgeVariants({ variant }), className)}
|
|
41
|
+
{...props}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { Badge, badgeVariants };
|