create-mohit-next 1.0.0 → 2.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 +96 -65
- package/index.js +195 -195
- package/lib/features.js +358 -0
- package/lib/scaffold.js +471 -0
- package/package.json +10 -6
- package/templates/common/_editorconfig +12 -0
- package/templates/common/_gitattributes +5 -0
- package/templates/common/_github/dependabot.yml +14 -0
- package/templates/common/_github/workflows/ci.yml +66 -0
- package/templates/common/_husky/commit-msg +1 -0
- package/templates/common/_husky/pre-commit +1 -0
- package/templates/common/_nvmrc +1 -0
- package/{template → templates/common}/_prettierignore +4 -0
- package/templates/common/commitlint.config.mjs +10 -0
- package/templates/next/README.md +328 -0
- package/{template → templates/next}/_env.example +10 -1
- package/{template → templates/next}/_gitignore +8 -0
- package/templates/next/e2e/rbac.spec.ts +69 -0
- package/templates/next/e2e/server.mjs +35 -0
- package/{template → templates/next}/eslint.config.mjs +12 -0
- package/{template → templates/next}/next.config.ts +2 -0
- package/{template → templates/next}/package.json +18 -3
- package/templates/next/playwright.config.ts +30 -0
- package/templates/next/scripts/seed.ts +111 -0
- package/templates/next/src/app/(app)/admin/audit/page.tsx +99 -0
- package/templates/next/src/app/(app)/admin/page.tsx +92 -0
- package/{template → templates/next}/src/app/(app)/dashboard/page.tsx +22 -29
- package/{template → templates/next}/src/app/(app)/error.tsx +7 -7
- package/{template → templates/next}/src/app/(app)/layout.tsx +25 -2
- package/templates/next/src/app/(app)/reports/page.tsx +128 -0
- package/templates/next/src/app/(app)/settings/page.tsx +66 -0
- package/templates/next/src/app/(auth)/forgot-password/page.tsx +17 -0
- package/templates/next/src/app/(auth)/layout.tsx +18 -0
- package/{template → templates/next}/src/app/(auth)/register/page.tsx +2 -4
- package/templates/next/src/app/(auth)/reset-password/page.tsx +18 -0
- package/templates/next/src/app/api/account/password/route.ts +45 -0
- package/templates/next/src/app/api/account/route.ts +25 -0
- package/templates/next/src/app/api/account/sessions/route.ts +12 -0
- package/templates/next/src/app/api/admin/audit/route.ts +13 -0
- package/{template → templates/next}/src/app/api/admin/users/[id]/route.ts +25 -4
- package/templates/next/src/app/api/auth/forgot-password/route.ts +47 -0
- package/{template → templates/next}/src/app/api/auth/login/route.ts +19 -2
- package/{template → templates/next}/src/app/api/auth/me/route.ts +4 -2
- package/{template → templates/next}/src/app/api/auth/register/route.ts +38 -4
- package/templates/next/src/app/api/auth/resend-verification/route.ts +25 -0
- package/templates/next/src/app/api/auth/reset-password/route.ts +43 -0
- package/templates/next/src/app/api/auth/verify-email/route.ts +29 -0
- package/{template → templates/next}/src/app/forbidden/page.tsx +11 -13
- package/{template → templates/next}/src/app/layout.tsx +9 -6
- package/templates/next/src/app/not-found.tsx +20 -0
- package/templates/next/src/app/opengraph-image.tsx +49 -0
- package/templates/next/src/app/page.tsx +165 -0
- package/templates/next/src/app/robots.ts +15 -0
- package/templates/next/src/app/sitemap.ts +13 -0
- package/templates/next/src/app/verify-email/page.tsx +23 -0
- package/templates/next/src/components/admin/user-actions.tsx +124 -0
- package/templates/next/src/components/admin/users-data-table.tsx +221 -0
- package/templates/next/src/components/admin/users-table.tsx +67 -0
- package/{template → templates/next}/src/components/auth/auth-card.tsx +8 -8
- package/templates/next/src/components/auth/forgot-password-form.tsx +76 -0
- package/templates/next/src/components/auth/form-field.tsx +40 -0
- package/{template → templates/next}/src/components/auth/login-form.tsx +14 -9
- package/templates/next/src/components/auth/password-input.tsx +43 -0
- package/{template → templates/next}/src/components/auth/register-form.tsx +22 -19
- package/templates/next/src/components/auth/reset-password-form.tsx +80 -0
- package/{template → templates/next}/src/components/auth/session-refresher.tsx +1 -1
- package/templates/next/src/components/auth/verify-email-banner.tsx +43 -0
- package/templates/next/src/components/auth/verify-email-status.tsx +44 -0
- package/templates/next/src/components/layout/nav-links.tsx +37 -0
- package/templates/next/src/components/layout/navbar.tsx +27 -0
- package/templates/next/src/components/layout/page-header.tsx +21 -0
- package/templates/next/src/components/layout/sidebar.tsx +83 -0
- package/templates/next/src/components/layout/skeletons.tsx +57 -0
- package/templates/next/src/components/layout/user-menu.tsx +118 -0
- package/{template → templates/next}/src/components/logo.tsx +3 -6
- package/{template → templates/next}/src/components/reports/animated-bar.tsx +1 -5
- package/templates/next/src/components/reports/role-chart.tsx +61 -0
- package/templates/next/src/components/reports/signups-chart.tsx +64 -0
- package/templates/next/src/components/role-badge.tsx +11 -0
- package/templates/next/src/components/settings/password-form.tsx +80 -0
- package/templates/next/src/components/settings/profile-form.tsx +63 -0
- package/templates/next/src/components/settings/sessions-card.tsx +70 -0
- package/templates/next/src/components/theme-toggle.tsx +61 -0
- package/templates/next/src/config/rbac.test.ts +89 -0
- package/{template → templates/next}/src/config/rbac.ts +35 -5
- package/{template → templates/next}/src/lib/api.ts +40 -4
- package/templates/next/src/lib/audit.ts +66 -0
- package/{template → templates/next}/src/lib/auth.ts +10 -2
- package/{template → templates/next}/src/lib/dal.ts +8 -5
- package/templates/next/src/lib/email-templates.ts +55 -0
- package/templates/next/src/lib/email.ts +53 -0
- package/templates/next/src/lib/env.ts +90 -0
- package/templates/next/src/lib/password-strength.test.ts +20 -0
- package/templates/next/src/lib/password-strength.ts +24 -0
- package/templates/next/src/lib/rate-limit.test.ts +47 -0
- package/templates/next/src/lib/rate-limit.ts +70 -0
- package/templates/next/src/lib/redirect.test.ts +23 -0
- package/{template → templates/next}/src/lib/session.ts +5 -1
- package/templates/next/src/lib/theme.ts +32 -0
- package/templates/next/src/lib/tokens.ts +63 -0
- package/{template → templates/next}/src/lib/users.ts +49 -12
- package/templates/next/src/lib/validations/account.ts +20 -0
- package/templates/next/src/lib/validations/auth.test.ts +39 -0
- package/{template → templates/next}/src/lib/validations/auth.ts +24 -2
- package/templates/next/src/models/audit-log.ts +33 -0
- package/templates/next/src/models/auth-token.ts +26 -0
- package/{template → templates/next}/src/models/user.ts +5 -0
- package/{template → templates/next}/src/proxy.ts +1 -1
- package/templates/next/src/styles/app.css +1092 -0
- package/{template → templates/next}/src/types/user.ts +3 -0
- package/templates/next/vitest.config.mts +13 -0
- package/templates/styles/css.css +580 -0
- package/templates/styles/tailwind.css +140 -0
- package/templates/ui/css/components/alert-dialog.tsx +172 -0
- package/templates/ui/css/components/avatar.tsx +17 -0
- package/templates/ui/css/components/badge.tsx +18 -0
- package/templates/ui/css/components/button.tsx +41 -0
- package/templates/ui/css/components/card.tsx +33 -0
- package/templates/ui/css/components/dropdown-menu.tsx +230 -0
- package/templates/ui/css/components/input.tsx +7 -0
- package/templates/ui/css/components/label.tsx +7 -0
- package/templates/ui/css/components/native-select.tsx +23 -0
- package/templates/ui/css/components/skeleton.tsx +7 -0
- package/templates/ui/css/components/slot.tsx +30 -0
- package/templates/ui/css/components/table.tsx +31 -0
- package/templates/ui/css/utils.ts +16 -0
- package/templates/ui/shadcn/components/alert-dialog.tsx +199 -0
- package/templates/ui/shadcn/components/avatar.tsx +111 -0
- package/templates/ui/shadcn/components/dropdown-menu.tsx +268 -0
- package/templates/ui/shadcn/components/table.tsx +115 -0
- package/templates/ui/tailwind/components/alert-dialog.tsx +177 -0
- package/templates/ui/tailwind/components/avatar.tsx +36 -0
- package/templates/ui/tailwind/components/badge.tsx +29 -0
- package/templates/ui/tailwind/components/button.tsx +65 -0
- package/templates/ui/tailwind/components/card.tsx +70 -0
- package/templates/ui/tailwind/components/dropdown-menu.tsx +236 -0
- package/templates/ui/tailwind/components/input.tsx +17 -0
- package/templates/ui/tailwind/components/label.tsx +16 -0
- package/templates/ui/tailwind/components/native-select.tsx +32 -0
- package/templates/ui/tailwind/components/skeleton.tsx +13 -0
- package/templates/ui/tailwind/components/slot.tsx +34 -0
- package/templates/ui/tailwind/components/table.tsx +56 -0
- package/templates/ui/tailwind/utils.ts +1 -0
- package/templates/vite/Dockerfile +29 -0
- package/templates/vite/README.md +142 -0
- package/templates/vite/_dockerignore +14 -0
- package/templates/vite/_env.example +8 -0
- package/templates/vite/_gitignore +37 -0
- package/templates/vite/e2e/app.spec.ts +41 -0
- package/templates/vite/index.html +32 -0
- package/templates/vite/nginx.conf +26 -0
- package/templates/vite/package.json +61 -0
- package/templates/vite/playwright.config.ts +27 -0
- package/templates/vite/public/favicon.svg +1 -0
- package/templates/vite/src/App.test.tsx +28 -0
- package/templates/vite/src/App.tsx +26 -0
- package/templates/vite/src/components/home.tsx +121 -0
- package/templates/vite/src/components/layout/root-layout.tsx +18 -0
- package/templates/vite/src/components/layout/site-footer.tsx +10 -0
- package/templates/vite/src/components/layout/site-header.tsx +49 -0
- package/templates/vite/src/components/theme-toggle.tsx +90 -0
- package/templates/vite/src/env.ts +36 -0
- package/templates/vite/src/lib/theme.ts +26 -0
- package/templates/vite/src/main.tsx +13 -0
- package/templates/vite/src/pages/about.tsx +52 -0
- package/templates/vite/src/pages/not-found.tsx +33 -0
- package/templates/vite/src/router.ts +24 -0
- package/templates/vite/src/styles/app.css +281 -0
- package/templates/vite/src/test/setup.ts +21 -0
- package/templates/vite/tsconfig.app.json +31 -0
- package/templates/vite/tsconfig.json +7 -0
- package/templates/vite/tsconfig.node.json +23 -0
- package/templates/vite/vite.config.ts +30 -0
- package/template/README.md +0 -262
- package/template/_prettierrc +0 -9
- package/template/components.json +0 -25
- package/template/src/app/(app)/admin/page.tsx +0 -53
- package/template/src/app/(app)/reports/page.tsx +0 -109
- package/template/src/app/(auth)/layout.tsx +0 -22
- package/template/src/app/not-found.tsx +0 -18
- package/template/src/app/page.tsx +0 -187
- package/template/src/components/admin/users-table.tsx +0 -162
- package/template/src/components/auth/form-field.tsx +0 -32
- package/template/src/components/layout/logout-button.tsx +0 -34
- package/template/src/components/layout/navbar.tsx +0 -67
- package/template/src/components/layout/page-header.tsx +0 -21
- package/template/src/components/layout/skeletons.tsx +0 -35
- package/template/src/components/role-badge.tsx +0 -17
- package/template/src/components/theme-toggle.tsx +0 -25
- package/template/src/lib/env.ts +0 -36
- package/template/src/lib/theme.ts +0 -8
- /package/{template → templates/next}/AGENTS.md +0 -0
- /package/{template → templates/next}/Dockerfile +0 -0
- /package/{template → templates/next}/_dockerignore +0 -0
- /package/{template → templates/next}/docker-compose.yml +0 -0
- /package/{template → templates/next}/public/robots.txt +0 -0
- /package/{template → templates/next}/src/app/(app)/loading.tsx +0 -0
- /package/{template → templates/next}/src/app/(auth)/login/page.tsx +0 -0
- /package/{template → templates/next}/src/app/api/admin/users/route.ts +0 -0
- /package/{template → templates/next}/src/app/api/auth/logout/route.ts +0 -0
- /package/{template → templates/next}/src/app/api/health/route.ts +0 -0
- /package/{template → templates/next}/src/app/favicon.ico +0 -0
- /package/{template → templates/next}/src/components/auth/can.tsx +0 -0
- /package/{template → templates/next}/src/components/motion/fade-in.tsx +0 -0
- /package/{template → templates/next}/src/components/providers/user-provider.tsx +0 -0
- /package/{template → templates/next}/src/config/site.ts +0 -0
- /package/{template → templates/next}/src/lib/db.ts +0 -0
- /package/{template → templates/next}/src/lib/http.ts +0 -0
- /package/{template → templates/next}/src/lib/redirect.ts +0 -0
- /package/{template → templates/next}/src/lib/validations/user.ts +0 -0
- /package/{template → templates/next}/tsconfig.json +0 -0
- /package/{template/src/app/globals.css → templates/styles/shadcn.css} +0 -0
- /package/{template/src/components/ui → templates/ui/shadcn/components}/badge.tsx +0 -0
- /package/{template/src/components/ui → templates/ui/shadcn/components}/button.tsx +0 -0
- /package/{template/src/components/ui → templates/ui/shadcn/components}/card.tsx +0 -0
- /package/{template/src/components/ui → templates/ui/shadcn/components}/input.tsx +0 -0
- /package/{template/src/components/ui → templates/ui/shadcn/components}/label.tsx +0 -0
- /package/{template/src/components/ui → templates/ui/shadcn/components}/native-select.tsx +0 -0
- /package/{template/src/components/ui → templates/ui/shadcn/components}/skeleton.tsx +0 -0
- /package/{template/src/lib → templates/ui/shadcn}/utils.ts +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
|
|
3
|
+
import { defineConfig } from "vitest/config";
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
resolve: {
|
|
7
|
+
alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) },
|
|
8
|
+
},
|
|
9
|
+
test: {
|
|
10
|
+
environment: "node",
|
|
11
|
+
include: ["src/**/*.test.{ts,tsx,js,jsx}"],
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Theme tokens, a small reset, and the styles for src/components/ui.
|
|
3
|
+
* Plain CSS: no Tailwind, no preprocessor. Toggle dark mode with the
|
|
4
|
+
* `dark` class on <html> (handled by the theme script).
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--radius: 0.625rem;
|
|
9
|
+
--background: oklch(1 0 0);
|
|
10
|
+
--foreground: oklch(0.145 0 0);
|
|
11
|
+
--card: oklch(1 0 0);
|
|
12
|
+
--card-foreground: oklch(0.145 0 0);
|
|
13
|
+
--popover: oklch(1 0 0);
|
|
14
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
15
|
+
--primary: oklch(0.205 0 0);
|
|
16
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
17
|
+
--secondary: oklch(0.97 0 0);
|
|
18
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
19
|
+
--muted: oklch(0.97 0 0);
|
|
20
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
21
|
+
--accent: oklch(0.97 0 0);
|
|
22
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
23
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
24
|
+
--border: oklch(0.922 0 0);
|
|
25
|
+
--input: oklch(0.922 0 0);
|
|
26
|
+
--ring: oklch(0.708 0 0);
|
|
27
|
+
--chart-1: oklch(0.87 0 0);
|
|
28
|
+
--chart-2: oklch(0.556 0 0);
|
|
29
|
+
--chart-3: oklch(0.439 0 0);
|
|
30
|
+
--chart-4: oklch(0.371 0 0);
|
|
31
|
+
--chart-5: oklch(0.269 0 0);
|
|
32
|
+
--sidebar: oklch(0.985 0 0);
|
|
33
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
34
|
+
color-scheme: light;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.dark {
|
|
38
|
+
--background: oklch(0.145 0 0);
|
|
39
|
+
--foreground: oklch(0.985 0 0);
|
|
40
|
+
--card: oklch(0.205 0 0);
|
|
41
|
+
--card-foreground: oklch(0.985 0 0);
|
|
42
|
+
--popover: oklch(0.205 0 0);
|
|
43
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
44
|
+
--primary: oklch(0.922 0 0);
|
|
45
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
46
|
+
--secondary: oklch(0.269 0 0);
|
|
47
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
48
|
+
--muted: oklch(0.269 0 0);
|
|
49
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
50
|
+
--accent: oklch(0.269 0 0);
|
|
51
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
52
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
53
|
+
--border: oklch(1 0 0 / 10%);
|
|
54
|
+
--input: oklch(1 0 0 / 15%);
|
|
55
|
+
--ring: oklch(0.556 0 0);
|
|
56
|
+
--sidebar: oklch(0.205 0 0);
|
|
57
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
58
|
+
color-scheme: dark;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* ---------------------------------------------------------------------------
|
|
62
|
+
* Reset
|
|
63
|
+
* ------------------------------------------------------------------------ */
|
|
64
|
+
|
|
65
|
+
*,
|
|
66
|
+
*::before,
|
|
67
|
+
*::after {
|
|
68
|
+
box-sizing: border-box;
|
|
69
|
+
border-color: var(--border);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
* {
|
|
73
|
+
margin: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
body {
|
|
77
|
+
background: var(--background);
|
|
78
|
+
color: var(--foreground);
|
|
79
|
+
line-height: 1.5;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
img,
|
|
83
|
+
svg,
|
|
84
|
+
video,
|
|
85
|
+
canvas {
|
|
86
|
+
display: block;
|
|
87
|
+
max-width: 100%;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
svg {
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
input,
|
|
95
|
+
button,
|
|
96
|
+
textarea,
|
|
97
|
+
select {
|
|
98
|
+
font: inherit;
|
|
99
|
+
color: inherit;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
a {
|
|
103
|
+
color: inherit;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:focus-visible {
|
|
107
|
+
outline: 2px solid color-mix(in oklch, var(--ring) 70%, transparent);
|
|
108
|
+
outline-offset: 2px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* ---------------------------------------------------------------------------
|
|
112
|
+
* Button
|
|
113
|
+
* ------------------------------------------------------------------------ */
|
|
114
|
+
|
|
115
|
+
.btn {
|
|
116
|
+
display: inline-flex;
|
|
117
|
+
flex-shrink: 0;
|
|
118
|
+
align-items: center;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
gap: 0.375rem;
|
|
121
|
+
height: 2rem;
|
|
122
|
+
padding: 0 0.625rem;
|
|
123
|
+
border: 1px solid transparent;
|
|
124
|
+
border-radius: calc(var(--radius) * 0.8);
|
|
125
|
+
font-size: 0.875rem;
|
|
126
|
+
font-weight: 500;
|
|
127
|
+
line-height: 1;
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
text-decoration: none;
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
user-select: none;
|
|
132
|
+
transition:
|
|
133
|
+
background-color 0.15s,
|
|
134
|
+
color 0.15s,
|
|
135
|
+
border-color 0.15s;
|
|
136
|
+
}
|
|
137
|
+
.btn svg {
|
|
138
|
+
width: 1rem;
|
|
139
|
+
height: 1rem;
|
|
140
|
+
pointer-events: none;
|
|
141
|
+
}
|
|
142
|
+
.btn:disabled,
|
|
143
|
+
.btn[aria-disabled="true"] {
|
|
144
|
+
opacity: 0.5;
|
|
145
|
+
pointer-events: none;
|
|
146
|
+
}
|
|
147
|
+
.btn--default {
|
|
148
|
+
background: var(--primary);
|
|
149
|
+
color: var(--primary-foreground);
|
|
150
|
+
}
|
|
151
|
+
.btn--default:hover {
|
|
152
|
+
background: color-mix(in oklch, var(--primary) 85%, transparent);
|
|
153
|
+
}
|
|
154
|
+
.btn--outline {
|
|
155
|
+
border-color: var(--border);
|
|
156
|
+
background: var(--background);
|
|
157
|
+
}
|
|
158
|
+
.btn--outline:hover,
|
|
159
|
+
.btn--ghost:hover {
|
|
160
|
+
background: var(--muted);
|
|
161
|
+
}
|
|
162
|
+
.btn--secondary {
|
|
163
|
+
background: var(--secondary);
|
|
164
|
+
color: var(--secondary-foreground);
|
|
165
|
+
}
|
|
166
|
+
.btn--secondary:hover {
|
|
167
|
+
background: color-mix(in oklch, var(--secondary) 80%, var(--foreground));
|
|
168
|
+
}
|
|
169
|
+
.btn--ghost {
|
|
170
|
+
background: transparent;
|
|
171
|
+
}
|
|
172
|
+
.btn--destructive {
|
|
173
|
+
background: color-mix(in oklch, var(--destructive) 12%, transparent);
|
|
174
|
+
color: var(--destructive);
|
|
175
|
+
}
|
|
176
|
+
.btn--destructive:hover {
|
|
177
|
+
background: color-mix(in oklch, var(--destructive) 20%, transparent);
|
|
178
|
+
}
|
|
179
|
+
.btn--link {
|
|
180
|
+
height: auto;
|
|
181
|
+
padding: 0;
|
|
182
|
+
background: none;
|
|
183
|
+
color: var(--primary);
|
|
184
|
+
text-underline-offset: 4px;
|
|
185
|
+
}
|
|
186
|
+
.btn--link:hover {
|
|
187
|
+
text-decoration: underline;
|
|
188
|
+
}
|
|
189
|
+
.btn--size-xs {
|
|
190
|
+
height: 1.5rem;
|
|
191
|
+
padding: 0 0.5rem;
|
|
192
|
+
font-size: 0.75rem;
|
|
193
|
+
}
|
|
194
|
+
.btn--size-sm {
|
|
195
|
+
height: 1.75rem;
|
|
196
|
+
padding: 0 0.625rem;
|
|
197
|
+
font-size: 0.8rem;
|
|
198
|
+
}
|
|
199
|
+
.btn--size-lg {
|
|
200
|
+
height: 2.25rem;
|
|
201
|
+
padding: 0 0.75rem;
|
|
202
|
+
}
|
|
203
|
+
.btn--size-icon,
|
|
204
|
+
.btn--size-icon-xs,
|
|
205
|
+
.btn--size-icon-sm,
|
|
206
|
+
.btn--size-icon-lg {
|
|
207
|
+
width: 2rem;
|
|
208
|
+
padding: 0;
|
|
209
|
+
}
|
|
210
|
+
.btn--size-icon-xs {
|
|
211
|
+
width: 1.5rem;
|
|
212
|
+
height: 1.5rem;
|
|
213
|
+
}
|
|
214
|
+
.btn--size-icon-sm {
|
|
215
|
+
width: 1.75rem;
|
|
216
|
+
height: 1.75rem;
|
|
217
|
+
}
|
|
218
|
+
.btn--size-icon-lg {
|
|
219
|
+
width: 2.25rem;
|
|
220
|
+
height: 2.25rem;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* ---------------------------------------------------------------------------
|
|
224
|
+
* Form controls
|
|
225
|
+
* ------------------------------------------------------------------------ */
|
|
226
|
+
|
|
227
|
+
.input,
|
|
228
|
+
.select-control {
|
|
229
|
+
width: 100%;
|
|
230
|
+
min-width: 0;
|
|
231
|
+
height: 2rem;
|
|
232
|
+
padding: 0.25rem 0.625rem;
|
|
233
|
+
border: 1px solid var(--input);
|
|
234
|
+
border-radius: calc(var(--radius) * 0.8);
|
|
235
|
+
background: transparent;
|
|
236
|
+
font-size: 0.875rem;
|
|
237
|
+
outline: none;
|
|
238
|
+
transition:
|
|
239
|
+
border-color 0.15s,
|
|
240
|
+
box-shadow 0.15s;
|
|
241
|
+
}
|
|
242
|
+
.dark .input,
|
|
243
|
+
.dark .select-control {
|
|
244
|
+
background: color-mix(in oklch, var(--input) 30%, transparent);
|
|
245
|
+
}
|
|
246
|
+
.input::placeholder {
|
|
247
|
+
color: var(--muted-foreground);
|
|
248
|
+
}
|
|
249
|
+
.input:focus-visible,
|
|
250
|
+
.select-control:focus-visible {
|
|
251
|
+
border-color: var(--ring);
|
|
252
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent);
|
|
253
|
+
}
|
|
254
|
+
.input[aria-invalid="true"] {
|
|
255
|
+
border-color: var(--destructive);
|
|
256
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--destructive) 20%, transparent);
|
|
257
|
+
}
|
|
258
|
+
.input:disabled,
|
|
259
|
+
.select-control:disabled {
|
|
260
|
+
cursor: not-allowed;
|
|
261
|
+
opacity: 0.5;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.label {
|
|
265
|
+
display: flex;
|
|
266
|
+
align-items: center;
|
|
267
|
+
gap: 0.5rem;
|
|
268
|
+
font-size: 0.875rem;
|
|
269
|
+
font-weight: 500;
|
|
270
|
+
line-height: 1;
|
|
271
|
+
user-select: none;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.select {
|
|
275
|
+
position: relative;
|
|
276
|
+
width: fit-content;
|
|
277
|
+
}
|
|
278
|
+
.select-control {
|
|
279
|
+
padding-right: 2rem;
|
|
280
|
+
appearance: none;
|
|
281
|
+
cursor: pointer;
|
|
282
|
+
}
|
|
283
|
+
.select-control--sm {
|
|
284
|
+
height: 1.75rem;
|
|
285
|
+
}
|
|
286
|
+
.select-control option {
|
|
287
|
+
background: Canvas;
|
|
288
|
+
color: CanvasText;
|
|
289
|
+
}
|
|
290
|
+
.select-icon {
|
|
291
|
+
position: absolute;
|
|
292
|
+
top: 50%;
|
|
293
|
+
right: 0.625rem;
|
|
294
|
+
color: var(--muted-foreground);
|
|
295
|
+
transform: translateY(-50%);
|
|
296
|
+
pointer-events: none;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/* ---------------------------------------------------------------------------
|
|
300
|
+
* Card, badge, avatar, skeleton
|
|
301
|
+
* ------------------------------------------------------------------------ */
|
|
302
|
+
|
|
303
|
+
.card {
|
|
304
|
+
display: flex;
|
|
305
|
+
flex-direction: column;
|
|
306
|
+
gap: 1rem;
|
|
307
|
+
overflow: hidden;
|
|
308
|
+
padding: 1rem 0;
|
|
309
|
+
border-radius: calc(var(--radius) * 1.4);
|
|
310
|
+
background: var(--card);
|
|
311
|
+
color: var(--card-foreground);
|
|
312
|
+
box-shadow: 0 0 0 1px color-mix(in oklch, var(--foreground) 10%, transparent);
|
|
313
|
+
font-size: 0.875rem;
|
|
314
|
+
}
|
|
315
|
+
.card-header {
|
|
316
|
+
display: grid;
|
|
317
|
+
gap: 0.25rem;
|
|
318
|
+
padding: 0 1rem;
|
|
319
|
+
}
|
|
320
|
+
.card-title {
|
|
321
|
+
font-size: 1rem;
|
|
322
|
+
font-weight: 500;
|
|
323
|
+
line-height: 1.375;
|
|
324
|
+
}
|
|
325
|
+
.card-description {
|
|
326
|
+
font-size: 0.875rem;
|
|
327
|
+
color: var(--muted-foreground);
|
|
328
|
+
}
|
|
329
|
+
.card-content {
|
|
330
|
+
padding: 0 1rem;
|
|
331
|
+
}
|
|
332
|
+
.card-footer {
|
|
333
|
+
display: flex;
|
|
334
|
+
align-items: center;
|
|
335
|
+
margin-bottom: -1rem;
|
|
336
|
+
padding: 1rem;
|
|
337
|
+
border-top: 1px solid var(--border);
|
|
338
|
+
background: color-mix(in oklch, var(--muted) 50%, transparent);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.badge {
|
|
342
|
+
display: inline-flex;
|
|
343
|
+
flex-shrink: 0;
|
|
344
|
+
align-items: center;
|
|
345
|
+
gap: 0.25rem;
|
|
346
|
+
width: fit-content;
|
|
347
|
+
height: 1.25rem;
|
|
348
|
+
padding: 0 0.5rem;
|
|
349
|
+
border: 1px solid transparent;
|
|
350
|
+
border-radius: 999px;
|
|
351
|
+
font-size: 0.75rem;
|
|
352
|
+
font-weight: 500;
|
|
353
|
+
white-space: nowrap;
|
|
354
|
+
}
|
|
355
|
+
.badge svg {
|
|
356
|
+
width: 0.75rem;
|
|
357
|
+
height: 0.75rem;
|
|
358
|
+
}
|
|
359
|
+
.badge--default {
|
|
360
|
+
background: var(--primary);
|
|
361
|
+
color: var(--primary-foreground);
|
|
362
|
+
}
|
|
363
|
+
.badge--secondary {
|
|
364
|
+
background: var(--secondary);
|
|
365
|
+
color: var(--secondary-foreground);
|
|
366
|
+
}
|
|
367
|
+
.badge--destructive {
|
|
368
|
+
background: color-mix(in oklch, var(--destructive) 12%, transparent);
|
|
369
|
+
color: var(--destructive);
|
|
370
|
+
}
|
|
371
|
+
.badge--outline {
|
|
372
|
+
border-color: var(--border);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.avatar {
|
|
376
|
+
position: relative;
|
|
377
|
+
display: flex;
|
|
378
|
+
flex-shrink: 0;
|
|
379
|
+
width: 2rem;
|
|
380
|
+
height: 2rem;
|
|
381
|
+
overflow: hidden;
|
|
382
|
+
border-radius: 999px;
|
|
383
|
+
font-size: 0.875rem;
|
|
384
|
+
user-select: none;
|
|
385
|
+
}
|
|
386
|
+
.avatar--sm {
|
|
387
|
+
width: 1.5rem;
|
|
388
|
+
height: 1.5rem;
|
|
389
|
+
font-size: 0.75rem;
|
|
390
|
+
}
|
|
391
|
+
.avatar--lg {
|
|
392
|
+
width: 2.5rem;
|
|
393
|
+
height: 2.5rem;
|
|
394
|
+
font-size: 1rem;
|
|
395
|
+
}
|
|
396
|
+
.avatar-fallback {
|
|
397
|
+
display: flex;
|
|
398
|
+
align-items: center;
|
|
399
|
+
justify-content: center;
|
|
400
|
+
width: 100%;
|
|
401
|
+
height: 100%;
|
|
402
|
+
background: var(--muted);
|
|
403
|
+
color: var(--muted-foreground);
|
|
404
|
+
font-weight: 500;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.skeleton {
|
|
408
|
+
border-radius: 0.375rem;
|
|
409
|
+
background: var(--muted);
|
|
410
|
+
animation: skeleton-pulse 2s ease-in-out infinite;
|
|
411
|
+
}
|
|
412
|
+
@keyframes skeleton-pulse {
|
|
413
|
+
50% {
|
|
414
|
+
opacity: 0.5;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/* ---------------------------------------------------------------------------
|
|
419
|
+
* Table
|
|
420
|
+
* ------------------------------------------------------------------------ */
|
|
421
|
+
|
|
422
|
+
.table-container {
|
|
423
|
+
position: relative;
|
|
424
|
+
width: 100%;
|
|
425
|
+
overflow-x: auto;
|
|
426
|
+
}
|
|
427
|
+
.table {
|
|
428
|
+
width: 100%;
|
|
429
|
+
border-collapse: collapse;
|
|
430
|
+
font-size: 0.875rem;
|
|
431
|
+
}
|
|
432
|
+
.table th {
|
|
433
|
+
height: 2.5rem;
|
|
434
|
+
padding: 0 0.5rem;
|
|
435
|
+
font-weight: 500;
|
|
436
|
+
text-align: left;
|
|
437
|
+
white-space: nowrap;
|
|
438
|
+
}
|
|
439
|
+
.table td {
|
|
440
|
+
padding: 0.5rem;
|
|
441
|
+
vertical-align: middle;
|
|
442
|
+
}
|
|
443
|
+
.table thead tr,
|
|
444
|
+
.table tbody tr:not(:last-child) {
|
|
445
|
+
border-bottom: 1px solid var(--border);
|
|
446
|
+
}
|
|
447
|
+
.table tbody tr:hover {
|
|
448
|
+
background: color-mix(in oklch, var(--muted) 50%, transparent);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/* ---------------------------------------------------------------------------
|
|
452
|
+
* Dropdown menu
|
|
453
|
+
* ------------------------------------------------------------------------ */
|
|
454
|
+
|
|
455
|
+
.menu {
|
|
456
|
+
position: relative;
|
|
457
|
+
display: inline-flex;
|
|
458
|
+
}
|
|
459
|
+
.menu-content {
|
|
460
|
+
position: absolute;
|
|
461
|
+
z-index: 50;
|
|
462
|
+
min-width: 10rem;
|
|
463
|
+
padding: 0.25rem;
|
|
464
|
+
overflow: hidden;
|
|
465
|
+
border-radius: calc(var(--radius) * 0.8);
|
|
466
|
+
background: var(--popover);
|
|
467
|
+
color: var(--popover-foreground);
|
|
468
|
+
box-shadow:
|
|
469
|
+
0 0 0 1px color-mix(in oklch, var(--foreground) 10%, transparent),
|
|
470
|
+
0 8px 24px rgb(0 0 0 / 0.12);
|
|
471
|
+
outline: none;
|
|
472
|
+
}
|
|
473
|
+
.menu-content--start {
|
|
474
|
+
left: 0;
|
|
475
|
+
}
|
|
476
|
+
.menu-content--end {
|
|
477
|
+
right: 0;
|
|
478
|
+
}
|
|
479
|
+
.menu-content--bottom {
|
|
480
|
+
top: 100%;
|
|
481
|
+
margin-top: 0.25rem;
|
|
482
|
+
}
|
|
483
|
+
.menu-content--top {
|
|
484
|
+
bottom: 100%;
|
|
485
|
+
margin-bottom: 0.25rem;
|
|
486
|
+
}
|
|
487
|
+
.menu-item {
|
|
488
|
+
display: flex;
|
|
489
|
+
align-items: center;
|
|
490
|
+
gap: 0.375rem;
|
|
491
|
+
width: 100%;
|
|
492
|
+
padding: 0.25rem 0.375rem;
|
|
493
|
+
border: 0;
|
|
494
|
+
border-radius: 0.375rem;
|
|
495
|
+
background: none;
|
|
496
|
+
font-size: 0.875rem;
|
|
497
|
+
text-align: left;
|
|
498
|
+
text-decoration: none;
|
|
499
|
+
cursor: pointer;
|
|
500
|
+
outline: none;
|
|
501
|
+
}
|
|
502
|
+
.menu-item svg {
|
|
503
|
+
width: 1rem;
|
|
504
|
+
height: 1rem;
|
|
505
|
+
}
|
|
506
|
+
.menu-item:hover,
|
|
507
|
+
.menu-item:focus {
|
|
508
|
+
background: var(--accent);
|
|
509
|
+
color: var(--accent-foreground);
|
|
510
|
+
}
|
|
511
|
+
.menu-item[data-variant="destructive"] {
|
|
512
|
+
color: var(--destructive);
|
|
513
|
+
}
|
|
514
|
+
.menu-item[data-variant="destructive"]:hover,
|
|
515
|
+
.menu-item[data-variant="destructive"]:focus {
|
|
516
|
+
background: color-mix(in oklch, var(--destructive) 10%, transparent);
|
|
517
|
+
}
|
|
518
|
+
.menu-item[aria-disabled="true"] {
|
|
519
|
+
opacity: 0.5;
|
|
520
|
+
pointer-events: none;
|
|
521
|
+
}
|
|
522
|
+
.menu-label {
|
|
523
|
+
padding: 0.25rem 0.375rem;
|
|
524
|
+
font-size: 0.75rem;
|
|
525
|
+
font-weight: 500;
|
|
526
|
+
color: var(--muted-foreground);
|
|
527
|
+
}
|
|
528
|
+
.menu-separator {
|
|
529
|
+
height: 1px;
|
|
530
|
+
margin: 0.25rem -0.25rem;
|
|
531
|
+
background: var(--border);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/* ---------------------------------------------------------------------------
|
|
535
|
+
* Dialog (native <dialog>)
|
|
536
|
+
* ------------------------------------------------------------------------ */
|
|
537
|
+
|
|
538
|
+
.dialog {
|
|
539
|
+
width: calc(100% - 2rem);
|
|
540
|
+
max-width: 28rem;
|
|
541
|
+
padding: 0;
|
|
542
|
+
border: 0;
|
|
543
|
+
border-radius: calc(var(--radius) * 1.4);
|
|
544
|
+
background: var(--popover);
|
|
545
|
+
color: var(--popover-foreground);
|
|
546
|
+
box-shadow:
|
|
547
|
+
0 0 0 1px color-mix(in oklch, var(--foreground) 10%, transparent),
|
|
548
|
+
0 16px 48px rgb(0 0 0 / 0.2);
|
|
549
|
+
}
|
|
550
|
+
.dialog::backdrop {
|
|
551
|
+
background: rgb(0 0 0 / 0.4);
|
|
552
|
+
}
|
|
553
|
+
.dialog-inner {
|
|
554
|
+
display: grid;
|
|
555
|
+
gap: 1rem;
|
|
556
|
+
padding: 1.25rem;
|
|
557
|
+
}
|
|
558
|
+
.dialog-header {
|
|
559
|
+
display: grid;
|
|
560
|
+
gap: 0.375rem;
|
|
561
|
+
}
|
|
562
|
+
.dialog-title {
|
|
563
|
+
font-size: 1rem;
|
|
564
|
+
font-weight: 600;
|
|
565
|
+
}
|
|
566
|
+
.dialog-description {
|
|
567
|
+
font-size: 0.875rem;
|
|
568
|
+
color: var(--muted-foreground);
|
|
569
|
+
}
|
|
570
|
+
.dialog-footer {
|
|
571
|
+
display: flex;
|
|
572
|
+
flex-direction: column-reverse;
|
|
573
|
+
gap: 0.5rem;
|
|
574
|
+
}
|
|
575
|
+
@media (min-width: 640px) {
|
|
576
|
+
.dialog-footer {
|
|
577
|
+
flex-direction: row;
|
|
578
|
+
justify-content: flex-end;
|
|
579
|
+
}
|
|
580
|
+
}
|