create-ej-app 26.0.0 → 28.0.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/README.md +125 -226
- package/cli.ts +79 -29
- package/package.json +2 -2
- package/template/api/.vscode/settings.json +1 -1
- package/template/api/{.github/copilot-instructions.md → AGENTS.md} +0 -2
- package/template/api/CLAUDE.md +1 -0
- package/template/api/package.json +10 -10
- package/template/nextjs/.dockerignore +1 -0
- package/template/nextjs/AGENTS.md +260 -0
- package/template/nextjs/CLAUDE.md +1 -0
- package/template/nextjs/README.md +109 -0
- package/template/nextjs/bunfig.toml +3 -0
- package/template/nextjs/eslint.config.mjs +6 -5
- package/template/nextjs/gitignore +6 -1
- package/template/nextjs/next.config.ts +8 -1
- package/template/nextjs/package.json +47 -39
- package/template/nextjs/public/logo-dark.svg +4 -0
- package/template/nextjs/public/logo.svg +4 -0
- package/template/nextjs/src/app/(admin)/actions/users.ts +183 -0
- package/template/nextjs/src/app/(admin)/admin/_components/admin-header.tsx +24 -0
- package/template/nextjs/src/app/(admin)/admin/_components/admin-search.tsx +16 -0
- package/template/nextjs/src/app/(admin)/admin/_components/admin-sidebar.tsx +42 -0
- package/template/nextjs/src/app/(admin)/admin/layout.tsx +53 -0
- package/template/nextjs/src/app/(admin)/admin/page.tsx +11 -2
- package/template/nextjs/src/app/(admin)/admin/settings/layout.tsx +24 -0
- package/template/nextjs/src/app/(admin)/admin/settings/users/[userId]/page.tsx +43 -0
- package/template/nextjs/src/app/(admin)/admin/settings/users/new/page.tsx +16 -0
- package/template/nextjs/src/app/(admin)/admin/settings/users/page.tsx +377 -0
- package/template/nextjs/src/app/(admin)/admin/settings/users/user-form.tsx +138 -0
- package/template/nextjs/src/app/(admin)/admin/settings/users/validation.ts +23 -0
- package/template/nextjs/src/app/(app)/app/layout.tsx +44 -0
- package/template/nextjs/src/app/(app)/app/page.tsx +14 -2
- package/template/nextjs/src/app/(auth)/(account)/layout.tsx +64 -0
- package/template/nextjs/src/app/(auth)/(account)/profile/page.tsx +16 -0
- package/template/nextjs/src/app/(auth)/(account)/profile/profile-form.tsx +247 -0
- package/template/nextjs/src/app/(auth)/login/email-login-form.tsx +56 -29
- package/template/nextjs/src/app/(auth)/login/page.tsx +45 -12
- package/template/nextjs/src/app/(auth)/login/social-login-buttons.tsx +85 -17
- package/template/nextjs/src/app/(marketing)/layout.tsx +35 -4
- package/template/nextjs/src/app/(marketing)/legal.tsx +56 -0
- package/template/nextjs/src/app/(marketing)/page.tsx +20 -2
- package/template/nextjs/src/app/(marketing)/privacy/page.tsx +43 -2
- package/template/nextjs/src/app/(marketing)/terms/page.tsx +33 -2
- package/template/nextjs/src/app/error.tsx +37 -0
- package/template/nextjs/src/app/fonts/geist-mono/GeistMono-Variable.woff2 +0 -0
- package/template/nextjs/src/app/fonts/geist-sans/Geist-Variable.woff2 +0 -0
- package/template/nextjs/src/app/fonts/index.ts +60 -0
- package/template/nextjs/src/app/global-error.tsx +38 -0
- package/template/nextjs/src/app/globals.css +29 -0
- package/template/nextjs/src/app/layout.tsx +45 -18
- package/template/nextjs/src/app/not-found.tsx +25 -3
- package/template/nextjs/src/app/robots.ts +29 -0
- package/template/nextjs/src/app/sitemap.ts +21 -0
- package/template/nextjs/src/components/confirm-dialog.tsx +79 -0
- package/template/nextjs/src/components/dashboard-header.tsx +70 -0
- package/template/nextjs/src/components/data-table/enum.ts +5 -0
- package/template/nextjs/src/components/data-table/features.ts +49 -0
- package/template/nextjs/src/components/data-table/index.tsx +961 -0
- package/template/nextjs/src/components/data-table/types.ts +76 -0
- package/template/nextjs/src/components/error.tsx +71 -0
- package/template/nextjs/src/components/loader.tsx +18 -2
- package/template/nextjs/src/components/logo.tsx +49 -0
- package/template/nextjs/src/components/navigation-search.tsx +140 -0
- package/template/nextjs/src/components/navigation-sidebar.tsx +241 -0
- package/template/nextjs/src/components/page-heading.tsx +38 -0
- package/template/nextjs/src/components/react-query-provider.tsx +41 -2
- package/template/nextjs/src/components/route-error.tsx +55 -0
- package/template/nextjs/src/components/screen-size.tsx +36 -0
- package/template/nextjs/src/components/site-footer.tsx +20 -4
- package/template/nextjs/src/components/theme-provider.tsx +48 -0
- package/template/nextjs/src/components/theme-toggle.tsx +58 -5
- package/template/nextjs/src/components/ui/alert-dialog.tsx +199 -0
- package/template/nextjs/src/components/ui/avatar.tsx +112 -0
- package/template/nextjs/src/components/ui/badge.tsx +54 -0
- package/template/nextjs/src/components/ui/button.tsx +3 -1
- package/template/nextjs/src/components/ui/card.tsx +4 -4
- package/template/nextjs/src/components/ui/collapsible.tsx +33 -0
- package/template/nextjs/src/components/ui/command.tsx +192 -0
- package/template/nextjs/src/components/ui/dialog.tsx +164 -0
- package/template/nextjs/src/components/ui/dropdown-menu.tsx +273 -0
- package/template/nextjs/src/components/ui/input-group.tsx +156 -0
- package/template/nextjs/src/components/ui/select.tsx +195 -0
- package/template/nextjs/src/components/ui/sheet.tsx +143 -0
- package/template/nextjs/src/components/ui/sidebar.tsx +702 -0
- package/template/nextjs/src/components/ui/skeleton.tsx +13 -0
- package/template/nextjs/src/components/ui/table.tsx +116 -0
- package/template/nextjs/src/components/ui/textarea.tsx +18 -0
- package/template/nextjs/src/components/ui/tooltip.tsx +57 -0
- package/template/nextjs/src/components/user-menu.tsx +206 -0
- package/template/nextjs/src/db/common.ts +10 -0
- package/template/nextjs/src/db/index.ts +16 -6
- package/template/nextjs/src/db/relations.ts +21 -0
- package/template/nextjs/src/db/schema.ts +85 -46
- package/template/nextjs/src/emails/components/email-layout.tsx +27 -11
- package/template/nextjs/src/emails/magic-link.tsx +15 -13
- package/template/nextjs/src/emails/test.tsx +11 -9
- package/template/nextjs/src/emails/welcome.tsx +12 -9
- package/template/nextjs/src/env.ts +1 -1
- package/template/nextjs/src/hooks/use-mobile.ts +14 -12
- package/template/nextjs/src/instrumentation.ts +20 -2
- package/template/nextjs/src/lib/actions.ts +55 -0
- package/template/nextjs/src/lib/admin-navigation.ts +43 -0
- package/template/nextjs/src/lib/auth-client.ts +20 -9
- package/template/nextjs/src/lib/auth-permissions.ts +61 -0
- package/template/nextjs/src/lib/auth.ts +33 -3
- package/template/nextjs/src/lib/callback-url.ts +28 -0
- package/template/nextjs/src/lib/constants.ts +21 -0
- package/template/nextjs/src/lib/delay.ts +10 -0
- package/template/nextjs/src/lib/email-service.ts +21 -0
- package/template/nextjs/src/lib/errors.ts +74 -0
- package/template/nextjs/src/lib/format-currency.ts +22 -24
- package/template/nextjs/src/lib/format-date.ts +69 -6
- package/template/nextjs/src/lib/nodemailer.ts +27 -3
- package/template/nextjs/src/lib/otel.ts +92 -2
- package/template/nextjs/src/lib/safe-action-client.ts +60 -9
- package/template/nextjs/src/lib/safe-action.ts +152 -16
- package/template/nextjs/src/lib/search.ts +16 -0
- package/template/nextjs/src/lib/seo.ts +7 -0
- package/template/nextjs/src/lib/siteConfig.ts +17 -1
- package/template/nextjs/src/lib/toast-message.ts +87 -1
- package/template/nextjs/src/lib/validations.ts +30 -0
- package/template/nextjs/src/proxy.ts +48 -0
- package/template/nextjs/src/scripts/reset-db.ts +22 -0
- package/template/nextjs/src/scripts/seed.ts +59 -8
- package/template/nextjs/src/scripts/test-mail.ts +28 -20
- package/template/nextjs/tests/admin/users.test.ts +64 -0
- package/template/nextjs/tests/db/fk-indexes.test.ts +62 -0
- package/template/nextjs/tests/db/seed.test.ts +49 -0
- package/template/nextjs/tests/helpers/action.ts +71 -0
- package/template/nextjs/tests/helpers/fixtures.ts +78 -0
- package/template/nextjs/tests/helpers/index.ts +2 -0
- package/template/nextjs/tests/lib/callback-url.test.ts +48 -0
- package/template/nextjs/tests/lib/client-server-boundary.test.ts +57 -0
- package/template/nextjs/tests/lib/errors.test.ts +10 -0
- package/template/nextjs/tests/lib/search.test.ts +23 -0
- package/template/nextjs/tests/setup/pglite-db.ts +63 -0
- package/template/nextjs/tests/setup/preload.ts +95 -0
- package/template/nextjs/tsconfig.json +1 -0
- package/template/saas-starter/.dockerignore +1 -0
- package/template/saas-starter/.env.example +15 -15
- package/template/saas-starter/AGENTS.md +302 -0
- package/template/saas-starter/CLAUDE.md +1 -0
- package/template/saas-starter/README.md +124 -2
- package/template/saas-starter/bunfig.toml +3 -0
- package/template/saas-starter/eslint.config.mjs +6 -5
- package/template/saas-starter/gitignore +6 -1
- package/template/saas-starter/next.config.ts +19 -1
- package/template/saas-starter/package.json +50 -44
- package/template/saas-starter/public/logo-dark.svg +4 -0
- package/template/saas-starter/public/logo.svg +4 -0
- package/template/saas-starter/src/app/(admin)/actions/contact-leads.ts +51 -0
- package/template/saas-starter/src/app/(admin)/actions/feedbacks.ts +91 -0
- package/template/saas-starter/src/app/(admin)/actions/users.ts +145 -59
- package/template/saas-starter/src/app/(admin)/admin/_components/admin-header.tsx +4 -1
- package/template/saas-starter/src/app/(admin)/admin/_components/admin-sidebar.tsx +12 -10
- package/template/saas-starter/src/app/(admin)/admin/contact-leads/page.tsx +123 -0
- package/template/saas-starter/src/app/(admin)/admin/feedbacks/page.tsx +161 -0
- package/template/saas-starter/src/app/(admin)/admin/layout.tsx +24 -28
- package/template/saas-starter/src/app/(admin)/admin/page.tsx +59 -2
- package/template/saas-starter/src/app/(admin)/admin/settings/layout.tsx +24 -0
- package/template/saas-starter/src/app/(admin)/admin/settings/users/[userId]/page.tsx +43 -0
- package/template/saas-starter/src/app/(admin)/admin/settings/users/new/page.tsx +16 -0
- package/template/saas-starter/src/app/(admin)/admin/settings/users/page.tsx +372 -10
- package/template/saas-starter/src/app/(admin)/admin/settings/users/user-form.tsx +138 -0
- package/template/saas-starter/src/app/(admin)/admin/settings/users/validation.ts +23 -0
- package/template/saas-starter/src/app/(admin)/admin/support-tickets/[ticketId]/page.tsx +17 -0
- package/template/saas-starter/src/app/(admin)/admin/support-tickets/page.tsx +5 -0
- package/template/saas-starter/src/app/(app)/actions/billing.ts +171 -107
- package/template/saas-starter/src/app/(app)/actions/feedbacks.ts +28 -0
- package/template/saas-starter/src/app/(app)/actions/feedbacks.validation.ts +12 -0
- package/template/saas-starter/src/app/(app)/actions/members.ts +149 -123
- package/template/saas-starter/src/app/(app)/actions/organizations.ts +230 -0
- package/template/saas-starter/src/app/(app)/actions/organizations.validation.ts +17 -0
- package/template/saas-starter/src/app/(app)/app/[orgId]/dashboard/page.tsx +6 -9
- package/template/saas-starter/src/app/(app)/app/[orgId]/layout.tsx +6 -9
- package/template/saas-starter/src/app/(app)/app/[orgId]/settings/_components/billing-email-form.tsx +45 -53
- package/template/saas-starter/src/app/(app)/app/[orgId]/settings/_components/danger-zone.tsx +40 -47
- package/template/saas-starter/src/app/(app)/app/[orgId]/settings/_components/general-settings-form.tsx +80 -105
- package/template/saas-starter/src/app/(app)/app/[orgId]/settings/_components/plans-section.tsx +72 -82
- package/template/saas-starter/src/app/(app)/app/[orgId]/settings/billing/page.tsx +51 -52
- package/template/saas-starter/src/app/(app)/app/[orgId]/settings/layout.tsx +24 -0
- package/template/saas-starter/src/app/(app)/app/[orgId]/settings/members/_components/invite-member-dialog.tsx +15 -16
- package/template/saas-starter/src/app/(app)/app/[orgId]/settings/members/_components/members-tabs.tsx +77 -44
- package/template/saas-starter/src/app/(app)/app/[orgId]/settings/members/page.tsx +11 -18
- package/template/saas-starter/src/app/(app)/app/[orgId]/settings/page.tsx +14 -28
- package/template/saas-starter/src/app/(app)/app/[orgId]/support-tickets/[ticketId]/page.tsx +25 -0
- package/template/saas-starter/src/app/(app)/app/[orgId]/support-tickets/page.tsx +25 -0
- package/template/saas-starter/src/app/(app)/app/_components/app-header.tsx +15 -13
- package/template/saas-starter/src/app/(app)/app/_components/app-search.tsx +15 -6
- package/template/saas-starter/src/app/(app)/app/_components/app-sidebar.tsx +6 -3
- package/template/saas-starter/src/app/(app)/app/_components/feedback-dialog.tsx +108 -0
- package/template/saas-starter/src/app/(app)/app/_components/organization-context.tsx +5 -9
- package/template/saas-starter/src/app/(app)/app/_components/organization-switcher.tsx +68 -8
- package/template/saas-starter/src/app/(app)/app/layout.tsx +44 -32
- package/template/saas-starter/src/app/(app)/app/onboarding/_components/create-organization-form.tsx +75 -87
- package/template/saas-starter/src/app/(app)/app/onboarding/page.tsx +10 -12
- package/template/saas-starter/src/app/(app)/app/page.tsx +16 -21
- package/template/saas-starter/src/app/(auth)/(account)/layout.tsx +64 -0
- package/template/saas-starter/src/app/(auth)/(account)/profile/page.tsx +16 -0
- package/template/saas-starter/src/app/(auth)/(account)/profile/profile-form.tsx +247 -0
- package/template/saas-starter/src/app/(auth)/(account)/support/[ticketId]/page.tsx +19 -0
- package/template/saas-starter/src/app/(auth)/(account)/support/page.tsx +9 -0
- package/template/saas-starter/src/app/(auth)/login/email-login-form.tsx +49 -27
- package/template/saas-starter/src/app/(auth)/login/page.tsx +39 -21
- package/template/saas-starter/src/app/(auth)/login/social-login-buttons.tsx +80 -18
- package/template/saas-starter/src/app/(invitation)/accept-invitation/[id]/accept-invitation-form.tsx +16 -10
- package/template/saas-starter/src/app/(invitation)/accept-invitation/[id]/page.tsx +28 -42
- package/template/saas-starter/src/app/(invitation)/actions/invitations.ts +32 -0
- package/template/saas-starter/src/app/(marketing)/contact-us/actions.ts +23 -0
- package/template/saas-starter/src/app/(marketing)/contact-us/contact-form.tsx +118 -0
- package/template/saas-starter/src/app/(marketing)/contact-us/page.tsx +20 -0
- package/template/saas-starter/src/app/(marketing)/contact-us/validation.ts +22 -0
- package/template/saas-starter/src/app/(marketing)/layout.tsx +38 -4
- package/template/saas-starter/src/app/(marketing)/legal.tsx +66 -0
- package/template/saas-starter/src/app/(marketing)/page.tsx +23 -2
- package/template/saas-starter/src/app/(marketing)/privacy/page.tsx +62 -2
- package/template/saas-starter/src/app/(marketing)/terms/page.tsx +40 -2
- package/template/saas-starter/src/app/actions/support-tickets.ts +510 -0
- package/template/saas-starter/src/app/actions/support-tickets.validation.ts +112 -0
- package/template/saas-starter/src/app/actions/uploads.ts +36 -0
- package/template/saas-starter/src/app/actions/uploads.validation.ts +24 -0
- package/template/saas-starter/src/app/error.tsx +37 -0
- package/template/saas-starter/src/app/fonts/geist-mono/GeistMono-Variable.woff2 +0 -0
- package/template/saas-starter/src/app/fonts/geist-sans/Geist-Variable.woff2 +0 -0
- package/template/saas-starter/src/app/fonts/index.ts +60 -0
- package/template/saas-starter/src/app/global-error.tsx +38 -0
- package/template/saas-starter/src/app/globals.css +29 -0
- package/template/saas-starter/src/app/layout.tsx +43 -19
- package/template/saas-starter/src/app/not-found.tsx +25 -3
- package/template/saas-starter/src/app/robots.ts +14 -10
- package/template/saas-starter/src/app/sitemap.ts +2 -1
- package/template/saas-starter/src/components/confirm-dialog.tsx +79 -0
- package/template/saas-starter/src/components/dashboard-header.tsx +7 -1
- package/template/saas-starter/src/components/data-table/features.ts +49 -0
- package/template/saas-starter/src/components/data-table/index.tsx +65 -64
- package/template/saas-starter/src/components/data-table/types.ts +5 -4
- package/template/saas-starter/src/components/error.tsx +45 -0
- package/template/saas-starter/src/components/file-upload.tsx +65 -26
- package/template/saas-starter/src/components/loader.tsx +18 -2
- package/template/saas-starter/src/components/logo.tsx +49 -0
- package/template/saas-starter/src/components/navigation-search.tsx +2 -2
- package/template/saas-starter/src/components/page-heading.tsx +6 -0
- package/template/saas-starter/src/components/react-query-provider.tsx +41 -2
- package/template/saas-starter/src/components/route-error.tsx +55 -0
- package/template/saas-starter/src/components/screen-size.tsx +36 -0
- package/template/saas-starter/src/components/site-footer.tsx +20 -4
- package/template/saas-starter/src/components/support/create-support-ticket-dialog.tsx +122 -0
- package/template/saas-starter/src/components/support/support-ticket-conversation.tsx +236 -0
- package/template/saas-starter/src/components/support/support-ticket-shared.tsx +58 -0
- package/template/saas-starter/src/components/support/support-tickets-table.tsx +281 -0
- package/template/saas-starter/src/components/theme-provider.tsx +48 -0
- package/template/saas-starter/src/components/theme-toggle.tsx +58 -5
- package/template/saas-starter/src/components/ui/alert-dialog.tsx +199 -0
- package/template/saas-starter/src/components/ui/badge.tsx +6 -1
- package/template/saas-starter/src/components/ui/button.tsx +2 -0
- package/template/saas-starter/src/components/ui/command.tsx +1 -1
- package/template/saas-starter/src/components/user-menu.tsx +147 -24
- package/template/saas-starter/src/db/common.ts +33 -1
- package/template/saas-starter/src/db/enums.ts +24 -0
- package/template/saas-starter/src/db/index.ts +14 -5
- package/template/saas-starter/src/db/relations.ts +40 -3
- package/template/saas-starter/src/db/schema.ts +186 -35
- package/template/saas-starter/src/emails/components/email-layout.tsx +27 -11
- package/template/saas-starter/src/emails/invitation.tsx +34 -21
- package/template/saas-starter/src/emails/magic-link.tsx +15 -13
- package/template/saas-starter/src/emails/test.tsx +11 -9
- package/template/saas-starter/src/emails/welcome.tsx +12 -9
- package/template/saas-starter/src/env.ts +1 -1
- package/template/saas-starter/src/hooks/use-mobile.ts +14 -12
- package/template/saas-starter/src/instrumentation.ts +20 -2
- package/template/saas-starter/src/lib/actions.ts +34 -0
- package/template/saas-starter/src/lib/admin-navigation.ts +33 -1
- package/template/saas-starter/src/lib/app-navigation.ts +45 -41
- package/template/saas-starter/src/lib/auth-client.ts +8 -3
- package/template/saas-starter/src/lib/auth-permissions.ts +50 -11
- package/template/saas-starter/src/lib/auth.ts +122 -21
- package/template/saas-starter/src/lib/billing.ts +59 -24
- package/template/saas-starter/src/lib/callback-url.ts +28 -0
- package/template/saas-starter/src/lib/constants.ts +78 -9
- package/template/saas-starter/src/lib/delay.ts +10 -0
- package/template/saas-starter/src/lib/email-service.ts +30 -1
- package/template/saas-starter/src/lib/errors.ts +74 -0
- package/template/saas-starter/src/lib/format-currency.ts +22 -24
- package/template/saas-starter/src/lib/format-date.ts +69 -6
- package/template/saas-starter/src/lib/image-url.ts +54 -0
- package/template/saas-starter/src/lib/nodemailer.ts +27 -3
- package/template/saas-starter/src/lib/organization-access.ts +56 -76
- package/template/saas-starter/src/lib/otel.ts +92 -2
- package/template/saas-starter/src/lib/plan-limits.ts +37 -0
- package/template/saas-starter/src/lib/plans.ts +40 -13
- package/template/saas-starter/src/lib/rbac.ts +44 -0
- package/template/saas-starter/src/lib/safe-action-client.ts +60 -9
- package/template/saas-starter/src/lib/safe-action.ts +137 -17
- package/template/saas-starter/src/lib/search.ts +16 -0
- package/template/saas-starter/src/lib/seo.ts +7 -0
- package/template/saas-starter/src/lib/siteConfig.ts +17 -1
- package/template/saas-starter/src/lib/storage.ts +176 -46
- package/template/saas-starter/src/lib/stripe.ts +4 -1
- package/template/saas-starter/src/lib/toast-message.ts +87 -1
- package/template/saas-starter/src/lib/validations.ts +85 -2
- package/template/saas-starter/src/proxy.ts +48 -0
- package/template/saas-starter/src/scripts/cleanup-temp-uploads.ts +24 -0
- package/template/saas-starter/src/scripts/seed.ts +82 -8
- package/template/saas-starter/src/scripts/setup-db.ts +72 -0
- package/template/saas-starter/src/scripts/setup-stripe-plans.ts +13 -7
- package/template/saas-starter/src/scripts/test-mail.ts +28 -20
- package/template/saas-starter/tests/admin/users.test.ts +64 -0
- package/template/saas-starter/tests/db/fk-indexes.test.ts +62 -0
- package/template/saas-starter/tests/db/seed.test.ts +57 -0
- package/template/saas-starter/tests/helpers/action.ts +71 -0
- package/template/saas-starter/tests/helpers/fixtures.ts +151 -0
- package/template/saas-starter/tests/helpers/index.ts +2 -0
- package/template/saas-starter/tests/lib/callback-url.test.ts +48 -0
- package/template/saas-starter/tests/lib/client-server-boundary.test.ts +57 -0
- package/template/saas-starter/tests/lib/errors.test.ts +10 -0
- package/template/saas-starter/tests/lib/image-url.test.ts +31 -0
- package/template/saas-starter/tests/lib/search.test.ts +23 -0
- package/template/saas-starter/tests/marketing/contact-and-feedback.test.ts +86 -0
- package/template/saas-starter/tests/organizations/organizations.test.ts +175 -0
- package/template/saas-starter/tests/setup/pglite-db.ts +67 -0
- package/template/saas-starter/tests/setup/preload.ts +108 -0
- package/template/saas-starter/tests/support/support-tickets.test.ts +145 -0
- package/template/saas-starter/tsconfig.json +1 -0
- package/cli.js +0 -147
- package/template/nextjs/src/app/(admin)/layout.tsx +0 -20
- package/template/nextjs/src/app/(app)/layout.tsx +0 -20
- package/template/nextjs/terraform/artifact-registry.tf +0 -5
- package/template/nextjs/terraform/backend-service.tf +0 -13
- package/template/nextjs/terraform/cleanup.sh +0 -9
- package/template/nextjs/terraform/cloudbuild.tf +0 -70
- package/template/nextjs/terraform/cloudrun.tf +0 -68
- package/template/nextjs/terraform/database.tf +0 -60
- package/template/nextjs/terraform/forwarding-rule.tf +0 -43
- package/template/nextjs/terraform/gitignore +0 -4
- package/template/nextjs/terraform/ip-address.tf +0 -11
- package/template/nextjs/terraform/network-endpoint-group.tf +0 -11
- package/template/nextjs/terraform/network.tf +0 -21
- package/template/nextjs/terraform/pre.sh +0 -3
- package/template/nextjs/terraform/providers.tf +0 -18
- package/template/nextjs/terraform/secret.txt +0 -11
- package/template/nextjs/terraform/setup.sh +0 -25
- package/template/nextjs/terraform/ssl-certs.tf +0 -32
- package/template/nextjs/terraform/target-https-proxy copy.tf +0 -14
- package/template/nextjs/terraform/target-https-proxy.tf +0 -14
- package/template/nextjs/terraform/terraform.tfvars +0 -4
- package/template/nextjs/terraform/url-map.tf +0 -23
- package/template/nextjs/terraform/variables.tf +0 -21
- package/template/saas-starter/next-env.d.ts +0 -6
- package/template/saas-starter/src/actions/uploads.ts +0 -28
- package/template/saas-starter/src/actions/uploads.validation.ts +0 -14
- package/template/saas-starter/src/app/(admin)/admin/settings/users/_components/create-user-dialog.tsx +0 -183
- package/template/saas-starter/src/app/(admin)/admin/settings/users/_components/edit-name-dialog.tsx +0 -129
- package/template/saas-starter/src/app/(admin)/admin/settings/users/_components/users-table.tsx +0 -415
- package/template/saas-starter/src/app/(app)/actions/organization.ts +0 -92
- package/template/saas-starter/src/app/proxy.ts +0 -28
- package/template/saas-starter/src/components/impersonation-banner.tsx +0 -44
- package/template/saas-starter/src/lib/organization-plan-limits.ts +0 -38
|
@@ -1,12 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview React Query Provider Component
|
|
3
|
+
*
|
|
4
|
+
* Wraps the application with TanStack Query's QueryClientProvider.
|
|
5
|
+
* Enables data fetching, caching, and server state management.
|
|
6
|
+
*
|
|
7
|
+
* **Features Enabled:**
|
|
8
|
+
* - Automatic background refetching
|
|
9
|
+
* - Request deduplication
|
|
10
|
+
* - Cache management
|
|
11
|
+
* - Optimistic updates
|
|
12
|
+
* - useSafeActionQuery/useSafeActionMutation hooks
|
|
13
|
+
*
|
|
14
|
+
* @module components/react-query-provider
|
|
15
|
+
* @see https://tanstack.com/query/latest
|
|
16
|
+
*/
|
|
17
|
+
|
|
1
18
|
'use client'
|
|
2
19
|
|
|
3
20
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
4
|
-
import { FC, ReactNode } from 'react'
|
|
21
|
+
import { FC, ReactNode, useState } from 'react'
|
|
22
|
+
|
|
23
|
+
/** Default: treat list/admin data as fresh for 30s so focus does not re-hit every action. */
|
|
24
|
+
const DEFAULT_STALE_TIME_MS = 30_000
|
|
25
|
+
|
|
26
|
+
function createQueryClient() {
|
|
27
|
+
return new QueryClient({
|
|
28
|
+
defaultOptions: {
|
|
29
|
+
queries: {
|
|
30
|
+
staleTime: DEFAULT_STALE_TIME_MS
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
}
|
|
5
35
|
|
|
36
|
+
/**
|
|
37
|
+
* React Query Provider Component
|
|
38
|
+
*
|
|
39
|
+
* Creates one QueryClient for the provider lifetime and wraps children.
|
|
40
|
+
* Place near the root of the client tree.
|
|
41
|
+
*
|
|
42
|
+
* Global `staleTime` is 30s. Live surfaces should pass `staleTime: 0`;
|
|
43
|
+
* heavy dashboards and static options can pass a longer value.
|
|
44
|
+
*/
|
|
6
45
|
export const ReactQueryProvider: FC<{
|
|
7
46
|
children?: ReactNode
|
|
8
47
|
}> = ({ children }) => {
|
|
9
|
-
const client =
|
|
48
|
+
const [client] = useState(createQueryClient)
|
|
10
49
|
|
|
11
50
|
return <QueryClientProvider client={client}>{children}</QueryClientProvider>
|
|
12
51
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { AlertTriangle } from 'lucide-react'
|
|
4
|
+
import Link from 'next/link'
|
|
5
|
+
import { Button } from '~/components/ui/button'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Shared UI for App Router error boundaries (`error.tsx`, `global-error.tsx`).
|
|
9
|
+
* Keeps recovery actions and support reference copy consistent.
|
|
10
|
+
*/
|
|
11
|
+
export function RouteError({
|
|
12
|
+
error,
|
|
13
|
+
onRetry,
|
|
14
|
+
homeHref = '/',
|
|
15
|
+
homeLabel = 'Go Home'
|
|
16
|
+
}: {
|
|
17
|
+
error: Error & { digest?: string }
|
|
18
|
+
onRetry: () => void
|
|
19
|
+
homeHref?: string
|
|
20
|
+
homeLabel?: string
|
|
21
|
+
}) {
|
|
22
|
+
return (
|
|
23
|
+
<main className="bg-background text-foreground flex min-h-screen flex-col">
|
|
24
|
+
<section className="flex min-h-[60vh] flex-col items-center justify-center px-4 py-16">
|
|
25
|
+
<div className="max-w-md text-center">
|
|
26
|
+
<AlertTriangle
|
|
27
|
+
className="text-muted-foreground/50 mx-auto size-16"
|
|
28
|
+
aria-hidden
|
|
29
|
+
/>
|
|
30
|
+
<h1 className="mt-4 text-2xl font-semibold tracking-tight">
|
|
31
|
+
This Page Failed to Load
|
|
32
|
+
</h1>
|
|
33
|
+
<p className="text-muted-foreground mt-3 text-base">
|
|
34
|
+
Refresh the page or go home and try again. If it keeps happening,
|
|
35
|
+
contact support
|
|
36
|
+
{error.digest ? ' with the reference below' : ''}.
|
|
37
|
+
</p>
|
|
38
|
+
{error.digest ? (
|
|
39
|
+
<p className="text-muted-foreground mt-4 font-mono text-xs break-all">
|
|
40
|
+
Reference: {error.digest}
|
|
41
|
+
</p>
|
|
42
|
+
) : null}
|
|
43
|
+
<div className="mt-8 flex flex-wrap items-center justify-center gap-3">
|
|
44
|
+
<Button type="button" onClick={onRetry}>
|
|
45
|
+
Try Again
|
|
46
|
+
</Button>
|
|
47
|
+
<Button type="button" variant="outline" asChild>
|
|
48
|
+
<Link href={homeHref}>{homeLabel}</Link>
|
|
49
|
+
</Button>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</section>
|
|
53
|
+
</main>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
@@ -1,7 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Screen Size Indicator (Development Tool)
|
|
3
|
+
*
|
|
4
|
+
* Displays current viewport dimensions and Tailwind breakpoint.
|
|
5
|
+
* Useful during development for responsive design debugging.
|
|
6
|
+
*
|
|
7
|
+
* **Displayed Info:**
|
|
8
|
+
* - Viewport width x height in pixels
|
|
9
|
+
* - Current Tailwind breakpoint (XS, SM, MD, LG, XL, 2XL)
|
|
10
|
+
*
|
|
11
|
+
* **Positioning:**
|
|
12
|
+
* - Fixed to bottom-right corner
|
|
13
|
+
* - Always visible overlay
|
|
14
|
+
*
|
|
15
|
+
* Render this component conditionally.
|
|
16
|
+
* only in development environment.
|
|
17
|
+
*
|
|
18
|
+
* @module components/screen-size
|
|
19
|
+
*/
|
|
20
|
+
|
|
1
21
|
'use client'
|
|
2
22
|
|
|
3
23
|
import { FC, useEffect, useState } from 'react'
|
|
4
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Screen Size Indicator Component
|
|
27
|
+
*
|
|
28
|
+
* Fixed position badge showing viewport dimensions and breakpoint.
|
|
29
|
+
* Updates on window resize.
|
|
30
|
+
*
|
|
31
|
+
* **Breakpoint Display:**
|
|
32
|
+
* - XS: < 640px (default, no sm: prefix)
|
|
33
|
+
* - SM: 640px - 767px
|
|
34
|
+
* - MD: 768px - 1023px
|
|
35
|
+
* - LG: 1024px - 1279px
|
|
36
|
+
* - XL: 1280px - 1535px
|
|
37
|
+
* - 2XL: ≥ 1536px
|
|
38
|
+
*
|
|
39
|
+
* @returns {JSX.Element} Fixed position size indicator
|
|
40
|
+
*/
|
|
5
41
|
export const ScreenSize: FC = () => {
|
|
6
42
|
const [dimensions, setDimensions] = useState({ width: 0, height: 0 })
|
|
7
43
|
|
|
@@ -1,13 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Site Footer Component
|
|
3
|
+
*
|
|
4
|
+
* Global footer displayed on all pages.
|
|
5
|
+
* Contains copyright notice and links to legal pages.
|
|
6
|
+
*
|
|
7
|
+
* @module components/site-footer
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
import Link from 'next/link'
|
|
2
|
-
import { siteConfig } from '~/lib/siteConfig'
|
|
3
11
|
|
|
4
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Site Footer Component
|
|
14
|
+
*
|
|
15
|
+
* Displays copyright and legal navigation links.
|
|
16
|
+
*
|
|
17
|
+
* @param {Object} props - Component props
|
|
18
|
+
* @param {string} props.name - Company name for copyright
|
|
19
|
+
* @returns {JSX.Element} Footer element with copyright and links
|
|
20
|
+
*/
|
|
21
|
+
export const SiteFooter = ({ name }: { name: string }) => {
|
|
5
22
|
return (
|
|
6
23
|
<footer className="border-t">
|
|
7
24
|
<div className="text-muted-foreground container flex flex-col items-center justify-between gap-4 py-6 text-sm sm:flex-row">
|
|
8
25
|
<p>
|
|
9
|
-
© {new Date().getUTCFullYear()} {
|
|
10
|
-
reserved.
|
|
26
|
+
© {new Date().getUTCFullYear()} {name}. All rights reserved.
|
|
11
27
|
</p>
|
|
12
28
|
<div className="flex gap-4">
|
|
13
29
|
<Link href="/terms" className="hover:text-foreground">
|
|
@@ -1,8 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Theme provider for light/dark mode and theme hotkeys.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the application with Next Themes provider and manages theme switching.
|
|
5
|
+
* Includes a hotkey component (D key) to toggle the theme.
|
|
6
|
+
*
|
|
7
|
+
* **Features:**
|
|
8
|
+
* - System-aware default theme preference
|
|
9
|
+
* - Light/dark/system theme options
|
|
10
|
+
* - Keyboard shortcut (D key) for theme toggle
|
|
11
|
+
* - No theme transitions on page load
|
|
12
|
+
*
|
|
13
|
+
* @module components/theme-provider
|
|
14
|
+
*/
|
|
15
|
+
|
|
1
16
|
'use client'
|
|
2
17
|
|
|
3
18
|
import { ThemeProvider as NextThemesProvider, useTheme } from 'next-themes'
|
|
4
19
|
import { FC, useEffect } from 'react'
|
|
5
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Determines if the target element is a text input field.
|
|
23
|
+
* Used to avoid triggering theme hotkey when typing in inputs.
|
|
24
|
+
*
|
|
25
|
+
* @param target - DOM event target to check
|
|
26
|
+
* @returns true if target is a contenteditable, input, textarea, or select element
|
|
27
|
+
*/
|
|
6
28
|
function isTypingTarget(target: EventTarget | null) {
|
|
7
29
|
if (!(target instanceof HTMLElement)) {
|
|
8
30
|
return false
|
|
@@ -16,10 +38,27 @@ function isTypingTarget(target: EventTarget | null) {
|
|
|
16
38
|
)
|
|
17
39
|
}
|
|
18
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Theme Hotkey Component
|
|
43
|
+
*
|
|
44
|
+
* Listens for the 'D' key and toggles between light and dark themes.
|
|
45
|
+
* Ignores hotkey when user is typing in an input field.
|
|
46
|
+
*
|
|
47
|
+
* **Behavior:**
|
|
48
|
+
* - Press 'D' anywhere to toggle light ↔ dark
|
|
49
|
+
* - No effect if typing in input, textarea, or contenteditable element
|
|
50
|
+
* - Requires modifier keys (Ctrl, Cmd, Alt) to NOT be pressed
|
|
51
|
+
*
|
|
52
|
+
* @returns {null} Does not render any elements
|
|
53
|
+
*/
|
|
19
54
|
function ThemeHotkey() {
|
|
20
55
|
const { resolvedTheme, setTheme } = useTheme()
|
|
21
56
|
|
|
22
57
|
useEffect(() => {
|
|
58
|
+
/**
|
|
59
|
+
* Handles keyboard down events for theme toggle.
|
|
60
|
+
* Checks conditions and prevents default if hotkey is triggered.
|
|
61
|
+
*/
|
|
23
62
|
function onKeyDown(event: KeyboardEvent) {
|
|
24
63
|
if (event.defaultPrevented || event.repeat) {
|
|
25
64
|
return
|
|
@@ -50,6 +89,15 @@ function ThemeHotkey() {
|
|
|
50
89
|
return null
|
|
51
90
|
}
|
|
52
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Theme Provider Component
|
|
94
|
+
*
|
|
95
|
+
* Wraps application with Next Themes provider and mounts theme hotkey.
|
|
96
|
+
*
|
|
97
|
+
* @param {Object} props - Component props
|
|
98
|
+
* @param {React.ReactNode} props.children - Child components to wrap
|
|
99
|
+
* @returns {JSX.Element} Provider wrapping children with theme support
|
|
100
|
+
*/
|
|
53
101
|
export const ThemeProvider: FC<{
|
|
54
102
|
children: React.ReactNode
|
|
55
103
|
}> = ({ children }) => {
|
|
@@ -1,22 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Theme Toggle Button Component
|
|
3
|
+
*
|
|
4
|
+
* Cycles through light, dark, and system themes.
|
|
5
|
+
* Uses next-themes for theme state management.
|
|
6
|
+
*
|
|
7
|
+
* **Theme Cycle:**
|
|
8
|
+
* light → dark → system → light…
|
|
9
|
+
*
|
|
10
|
+
* **Icons:**
|
|
11
|
+
* - Sun: Light mode
|
|
12
|
+
* - Moon: Dark mode
|
|
13
|
+
* - Monitor: System preference
|
|
14
|
+
*
|
|
15
|
+
* **Hydration:**
|
|
16
|
+
* - Waits for client mount before rendering icons
|
|
17
|
+
* - Prevents hydration mismatch
|
|
18
|
+
*
|
|
19
|
+
* @module components/theme-toggle
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
'use client'
|
|
2
23
|
|
|
3
|
-
import { Moon, Sun } from 'lucide-react'
|
|
24
|
+
import { Monitor, Moon, Sun } from 'lucide-react'
|
|
4
25
|
import { useTheme } from 'next-themes'
|
|
5
|
-
import { FC } from 'react'
|
|
26
|
+
import { FC, useSyncExternalStore } from 'react'
|
|
6
27
|
import { Button } from './ui/button'
|
|
7
28
|
|
|
29
|
+
const emptySubscribe = () => () => {}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Theme Toggle Button
|
|
33
|
+
*
|
|
34
|
+
* Ghost button that cycles through available themes.
|
|
35
|
+
* Shows appropriate icon for current theme state.
|
|
36
|
+
*
|
|
37
|
+
* **Behavior:**
|
|
38
|
+
* - Click cycles: light → dark → system → light
|
|
39
|
+
* - Shows nothing until mounted (prevents hydration issues)
|
|
40
|
+
*
|
|
41
|
+
* @returns {JSX.Element} Icon button for theme switching
|
|
42
|
+
*/
|
|
8
43
|
export const ThemeToggle: FC = () => {
|
|
9
44
|
const { theme, setTheme } = useTheme()
|
|
45
|
+
// Client-only: server snapshot is false so SSR and the first client paint match.
|
|
46
|
+
const mounted = useSyncExternalStore(
|
|
47
|
+
emptySubscribe,
|
|
48
|
+
() => true,
|
|
49
|
+
() => false
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
const cycleTheme = () => {
|
|
53
|
+
const themes = ['light', 'dark', 'system']
|
|
54
|
+
const currentIndex = themes.indexOf(theme || 'system')
|
|
55
|
+
const nextIndex = (currentIndex + 1) % themes.length
|
|
56
|
+
setTheme(themes[nextIndex]!)
|
|
57
|
+
}
|
|
10
58
|
|
|
11
59
|
return (
|
|
12
60
|
<Button
|
|
13
61
|
variant="ghost"
|
|
14
62
|
size="icon"
|
|
63
|
+
onClick={cycleTheme}
|
|
15
64
|
aria-label="Toggle theme"
|
|
16
|
-
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
|
|
17
65
|
>
|
|
18
|
-
|
|
19
|
-
|
|
66
|
+
{!mounted ? null : (
|
|
67
|
+
<>
|
|
68
|
+
{theme === 'light' && <Sun className="size-4" />}
|
|
69
|
+
{theme === 'dark' && <Moon className="size-4" />}
|
|
70
|
+
{theme === 'system' && <Monitor className="size-4" />}
|
|
71
|
+
</>
|
|
72
|
+
)}
|
|
20
73
|
</Button>
|
|
21
74
|
)
|
|
22
75
|
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { AlertDialog as AlertDialogPrimitive } from 'radix-ui'
|
|
4
|
+
import * as React from 'react'
|
|
5
|
+
|
|
6
|
+
import { Button } from '~/components/ui/button'
|
|
7
|
+
import { cn } from '~/lib/cn'
|
|
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-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs',
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function AlertDialogContent({
|
|
48
|
+
className,
|
|
49
|
+
size = 'default',
|
|
50
|
+
...props
|
|
51
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
|
|
52
|
+
size?: 'default' | 'sm'
|
|
53
|
+
}) {
|
|
54
|
+
return (
|
|
55
|
+
<AlertDialogPortal>
|
|
56
|
+
<AlertDialogOverlay />
|
|
57
|
+
<AlertDialogPrimitive.Content
|
|
58
|
+
data-slot="alert-dialog-content"
|
|
59
|
+
data-size={size}
|
|
60
|
+
className={cn(
|
|
61
|
+
'group/alert-dialog-content bg-popover text-popover-foreground ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl p-6 ring-1 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg',
|
|
62
|
+
className
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
</AlertDialogPortal>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function AlertDialogHeader({
|
|
71
|
+
className,
|
|
72
|
+
...props
|
|
73
|
+
}: React.ComponentProps<'div'>) {
|
|
74
|
+
return (
|
|
75
|
+
<div
|
|
76
|
+
data-slot="alert-dialog-header"
|
|
77
|
+
className={cn(
|
|
78
|
+
'grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]',
|
|
79
|
+
className
|
|
80
|
+
)}
|
|
81
|
+
{...props}
|
|
82
|
+
/>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function AlertDialogFooter({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: React.ComponentProps<'div'>) {
|
|
90
|
+
return (
|
|
91
|
+
<div
|
|
92
|
+
data-slot="alert-dialog-footer"
|
|
93
|
+
className={cn(
|
|
94
|
+
'flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end',
|
|
95
|
+
className
|
|
96
|
+
)}
|
|
97
|
+
{...props}
|
|
98
|
+
/>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function AlertDialogMedia({
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}: React.ComponentProps<'div'>) {
|
|
106
|
+
return (
|
|
107
|
+
<div
|
|
108
|
+
data-slot="alert-dialog-media"
|
|
109
|
+
className={cn(
|
|
110
|
+
"bg-muted mb-2 inline-flex size-16 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",
|
|
111
|
+
className
|
|
112
|
+
)}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function AlertDialogTitle({
|
|
119
|
+
className,
|
|
120
|
+
...props
|
|
121
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
122
|
+
return (
|
|
123
|
+
<AlertDialogPrimitive.Title
|
|
124
|
+
data-slot="alert-dialog-title"
|
|
125
|
+
className={cn(
|
|
126
|
+
'font-heading text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2',
|
|
127
|
+
className
|
|
128
|
+
)}
|
|
129
|
+
{...props}
|
|
130
|
+
/>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function AlertDialogDescription({
|
|
135
|
+
className,
|
|
136
|
+
...props
|
|
137
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
138
|
+
return (
|
|
139
|
+
<AlertDialogPrimitive.Description
|
|
140
|
+
data-slot="alert-dialog-description"
|
|
141
|
+
className={cn(
|
|
142
|
+
'text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3',
|
|
143
|
+
className
|
|
144
|
+
)}
|
|
145
|
+
{...props}
|
|
146
|
+
/>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function AlertDialogAction({
|
|
151
|
+
className,
|
|
152
|
+
variant = 'default',
|
|
153
|
+
size = 'default',
|
|
154
|
+
...props
|
|
155
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Action> &
|
|
156
|
+
Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {
|
|
157
|
+
return (
|
|
158
|
+
<Button variant={variant} size={size} asChild>
|
|
159
|
+
<AlertDialogPrimitive.Action
|
|
160
|
+
data-slot="alert-dialog-action"
|
|
161
|
+
className={cn(className)}
|
|
162
|
+
{...props}
|
|
163
|
+
/>
|
|
164
|
+
</Button>
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function AlertDialogCancel({
|
|
169
|
+
className,
|
|
170
|
+
variant = 'outline',
|
|
171
|
+
size = 'default',
|
|
172
|
+
...props
|
|
173
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> &
|
|
174
|
+
Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {
|
|
175
|
+
return (
|
|
176
|
+
<Button variant={variant} size={size} asChild>
|
|
177
|
+
<AlertDialogPrimitive.Cancel
|
|
178
|
+
data-slot="alert-dialog-cancel"
|
|
179
|
+
className={cn(className)}
|
|
180
|
+
{...props}
|
|
181
|
+
/>
|
|
182
|
+
</Button>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export {
|
|
187
|
+
AlertDialog,
|
|
188
|
+
AlertDialogAction,
|
|
189
|
+
AlertDialogCancel,
|
|
190
|
+
AlertDialogContent,
|
|
191
|
+
AlertDialogDescription,
|
|
192
|
+
AlertDialogFooter,
|
|
193
|
+
AlertDialogHeader,
|
|
194
|
+
AlertDialogMedia,
|
|
195
|
+
AlertDialogOverlay,
|
|
196
|
+
AlertDialogPortal,
|
|
197
|
+
AlertDialogTitle,
|
|
198
|
+
AlertDialogTrigger
|
|
199
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Avatar as AvatarPrimitive } from 'radix-ui'
|
|
4
|
+
import * as React from 'react'
|
|
5
|
+
|
|
6
|
+
import { cn } from '~/lib/cn'
|
|
7
|
+
|
|
8
|
+
function Avatar({
|
|
9
|
+
className,
|
|
10
|
+
size = 'default',
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Root> & {
|
|
13
|
+
size?: 'default' | 'sm' | 'lg'
|
|
14
|
+
}) {
|
|
15
|
+
return (
|
|
16
|
+
<AvatarPrimitive.Root
|
|
17
|
+
data-slot="avatar"
|
|
18
|
+
data-size={size}
|
|
19
|
+
className={cn(
|
|
20
|
+
'group/avatar after:border-border relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten',
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function AvatarImage({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
|
32
|
+
return (
|
|
33
|
+
<AvatarPrimitive.Image
|
|
34
|
+
data-slot="avatar-image"
|
|
35
|
+
className={cn(
|
|
36
|
+
'aspect-square size-full rounded-full object-cover',
|
|
37
|
+
className
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function AvatarFallback({
|
|
45
|
+
className,
|
|
46
|
+
...props
|
|
47
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
|
|
48
|
+
return (
|
|
49
|
+
<AvatarPrimitive.Fallback
|
|
50
|
+
data-slot="avatar-fallback"
|
|
51
|
+
className={cn(
|
|
52
|
+
'bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs',
|
|
53
|
+
className
|
|
54
|
+
)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function AvatarBadge({ className, ...props }: React.ComponentProps<'span'>) {
|
|
61
|
+
return (
|
|
62
|
+
<span
|
|
63
|
+
data-slot="avatar-badge"
|
|
64
|
+
className={cn(
|
|
65
|
+
'bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none',
|
|
66
|
+
'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',
|
|
67
|
+
'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2',
|
|
68
|
+
'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',
|
|
69
|
+
className
|
|
70
|
+
)}
|
|
71
|
+
{...props}
|
|
72
|
+
/>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function AvatarGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
77
|
+
return (
|
|
78
|
+
<div
|
|
79
|
+
data-slot="avatar-group"
|
|
80
|
+
className={cn(
|
|
81
|
+
'group/avatar-group *:data-[slot=avatar]:ring-background flex -space-x-2 *:data-[slot=avatar]:ring-2',
|
|
82
|
+
className
|
|
83
|
+
)}
|
|
84
|
+
{...props}
|
|
85
|
+
/>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function AvatarGroupCount({
|
|
90
|
+
className,
|
|
91
|
+
...props
|
|
92
|
+
}: React.ComponentProps<'div'>) {
|
|
93
|
+
return (
|
|
94
|
+
<div
|
|
95
|
+
data-slot="avatar-group-count"
|
|
96
|
+
className={cn(
|
|
97
|
+
'bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',
|
|
98
|
+
className
|
|
99
|
+
)}
|
|
100
|
+
{...props}
|
|
101
|
+
/>
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export {
|
|
106
|
+
Avatar,
|
|
107
|
+
AvatarBadge,
|
|
108
|
+
AvatarFallback,
|
|
109
|
+
AvatarGroup,
|
|
110
|
+
AvatarGroupCount,
|
|
111
|
+
AvatarImage
|
|
112
|
+
}
|