create-mohit-next 0.0.0-stage → 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.
Files changed (202) hide show
  1. package/README.md +139 -2
  2. package/index.js +399 -0
  3. package/lib/features.js +358 -0
  4. package/lib/scaffold.js +471 -0
  5. package/package.json +40 -4
  6. package/templates/common/_editorconfig +12 -0
  7. package/templates/common/_gitattributes +5 -0
  8. package/templates/common/_github/dependabot.yml +14 -0
  9. package/templates/common/_github/workflows/ci.yml +66 -0
  10. package/templates/common/_husky/commit-msg +1 -0
  11. package/templates/common/_husky/pre-commit +1 -0
  12. package/templates/common/_nvmrc +1 -0
  13. package/templates/common/_prettierignore +15 -0
  14. package/templates/common/commitlint.config.mjs +10 -0
  15. package/templates/next/AGENTS.md +9 -0
  16. package/templates/next/Dockerfile +48 -0
  17. package/templates/next/README.md +328 -0
  18. package/templates/next/_dockerignore +13 -0
  19. package/templates/next/_env.example +20 -0
  20. package/templates/next/_gitignore +50 -0
  21. package/templates/next/docker-compose.yml +33 -0
  22. package/templates/next/e2e/rbac.spec.ts +69 -0
  23. package/templates/next/e2e/server.mjs +35 -0
  24. package/templates/next/eslint.config.mjs +33 -0
  25. package/templates/next/next.config.ts +47 -0
  26. package/templates/next/package.json +68 -0
  27. package/templates/next/playwright.config.ts +30 -0
  28. package/templates/next/public/robots.txt +6 -0
  29. package/templates/next/scripts/seed.ts +111 -0
  30. package/templates/next/src/app/(app)/admin/audit/page.tsx +99 -0
  31. package/templates/next/src/app/(app)/admin/page.tsx +92 -0
  32. package/templates/next/src/app/(app)/dashboard/page.tsx +120 -0
  33. package/templates/next/src/app/(app)/error.tsx +28 -0
  34. package/templates/next/src/app/(app)/layout.tsx +58 -0
  35. package/templates/next/src/app/(app)/loading.tsx +5 -0
  36. package/templates/next/src/app/(app)/reports/page.tsx +128 -0
  37. package/templates/next/src/app/(app)/settings/page.tsx +66 -0
  38. package/templates/next/src/app/(auth)/forgot-password/page.tsx +17 -0
  39. package/templates/next/src/app/(auth)/layout.tsx +18 -0
  40. package/templates/next/src/app/(auth)/login/page.tsx +18 -0
  41. package/templates/next/src/app/(auth)/register/page.tsx +18 -0
  42. package/templates/next/src/app/(auth)/reset-password/page.tsx +18 -0
  43. package/templates/next/src/app/api/account/password/route.ts +45 -0
  44. package/templates/next/src/app/api/account/route.ts +25 -0
  45. package/templates/next/src/app/api/account/sessions/route.ts +12 -0
  46. package/templates/next/src/app/api/admin/audit/route.ts +13 -0
  47. package/templates/next/src/app/api/admin/users/[id]/route.ts +61 -0
  48. package/templates/next/src/app/api/admin/users/route.ts +18 -0
  49. package/templates/next/src/app/api/auth/forgot-password/route.ts +47 -0
  50. package/templates/next/src/app/api/auth/login/route.ts +43 -0
  51. package/templates/next/src/app/api/auth/logout/route.ts +21 -0
  52. package/templates/next/src/app/api/auth/me/route.ts +21 -0
  53. package/templates/next/src/app/api/auth/register/route.ts +74 -0
  54. package/templates/next/src/app/api/auth/resend-verification/route.ts +25 -0
  55. package/templates/next/src/app/api/auth/reset-password/route.ts +43 -0
  56. package/templates/next/src/app/api/auth/verify-email/route.ts +29 -0
  57. package/templates/next/src/app/api/health/route.ts +27 -0
  58. package/templates/next/src/app/favicon.ico +0 -0
  59. package/templates/next/src/app/forbidden/page.tsx +47 -0
  60. package/templates/next/src/app/layout.tsx +55 -0
  61. package/templates/next/src/app/not-found.tsx +20 -0
  62. package/templates/next/src/app/opengraph-image.tsx +49 -0
  63. package/templates/next/src/app/page.tsx +165 -0
  64. package/templates/next/src/app/robots.ts +15 -0
  65. package/templates/next/src/app/sitemap.ts +13 -0
  66. package/templates/next/src/app/verify-email/page.tsx +23 -0
  67. package/templates/next/src/components/admin/user-actions.tsx +124 -0
  68. package/templates/next/src/components/admin/users-data-table.tsx +221 -0
  69. package/templates/next/src/components/admin/users-table.tsx +67 -0
  70. package/templates/next/src/components/auth/auth-card.tsx +41 -0
  71. package/templates/next/src/components/auth/can.tsx +34 -0
  72. package/templates/next/src/components/auth/forgot-password-form.tsx +76 -0
  73. package/templates/next/src/components/auth/form-field.tsx +40 -0
  74. package/templates/next/src/components/auth/login-form.tsx +87 -0
  75. package/templates/next/src/components/auth/password-input.tsx +43 -0
  76. package/templates/next/src/components/auth/register-form.tsx +117 -0
  77. package/templates/next/src/components/auth/reset-password-form.tsx +80 -0
  78. package/templates/next/src/components/auth/session-refresher.tsx +44 -0
  79. package/templates/next/src/components/auth/verify-email-banner.tsx +43 -0
  80. package/templates/next/src/components/auth/verify-email-status.tsx +44 -0
  81. package/templates/next/src/components/layout/nav-links.tsx +37 -0
  82. package/templates/next/src/components/layout/navbar.tsx +27 -0
  83. package/templates/next/src/components/layout/page-header.tsx +21 -0
  84. package/templates/next/src/components/layout/sidebar.tsx +83 -0
  85. package/templates/next/src/components/layout/skeletons.tsx +57 -0
  86. package/templates/next/src/components/layout/user-menu.tsx +118 -0
  87. package/templates/next/src/components/logo.tsx +16 -0
  88. package/templates/next/src/components/motion/fade-in.tsx +19 -0
  89. package/templates/next/src/components/providers/user-provider.tsx +60 -0
  90. package/templates/next/src/components/reports/animated-bar.tsx +24 -0
  91. package/templates/next/src/components/reports/role-chart.tsx +61 -0
  92. package/templates/next/src/components/reports/signups-chart.tsx +64 -0
  93. package/templates/next/src/components/role-badge.tsx +11 -0
  94. package/templates/next/src/components/settings/password-form.tsx +80 -0
  95. package/templates/next/src/components/settings/profile-form.tsx +63 -0
  96. package/templates/next/src/components/settings/sessions-card.tsx +70 -0
  97. package/templates/next/src/components/theme-toggle.tsx +61 -0
  98. package/templates/next/src/config/rbac.test.ts +89 -0
  99. package/templates/next/src/config/rbac.ts +170 -0
  100. package/templates/next/src/config/site.ts +4 -0
  101. package/templates/next/src/lib/api.ts +179 -0
  102. package/templates/next/src/lib/audit.ts +66 -0
  103. package/templates/next/src/lib/auth.ts +50 -0
  104. package/templates/next/src/lib/dal.ts +63 -0
  105. package/templates/next/src/lib/db.ts +35 -0
  106. package/templates/next/src/lib/email-templates.ts +55 -0
  107. package/templates/next/src/lib/email.ts +53 -0
  108. package/templates/next/src/lib/env.ts +90 -0
  109. package/templates/next/src/lib/http.ts +57 -0
  110. package/templates/next/src/lib/password-strength.test.ts +20 -0
  111. package/templates/next/src/lib/password-strength.ts +24 -0
  112. package/templates/next/src/lib/rate-limit.test.ts +47 -0
  113. package/templates/next/src/lib/rate-limit.ts +70 -0
  114. package/templates/next/src/lib/redirect.test.ts +23 -0
  115. package/templates/next/src/lib/redirect.ts +21 -0
  116. package/templates/next/src/lib/session.ts +71 -0
  117. package/templates/next/src/lib/theme.ts +32 -0
  118. package/templates/next/src/lib/tokens.ts +63 -0
  119. package/templates/next/src/lib/users.ts +196 -0
  120. package/templates/next/src/lib/validations/account.ts +20 -0
  121. package/templates/next/src/lib/validations/auth.test.ts +39 -0
  122. package/templates/next/src/lib/validations/auth.ts +66 -0
  123. package/templates/next/src/lib/validations/user.ts +13 -0
  124. package/templates/next/src/models/audit-log.ts +33 -0
  125. package/templates/next/src/models/auth-token.ts +26 -0
  126. package/templates/next/src/models/user.ts +35 -0
  127. package/templates/next/src/proxy.ts +57 -0
  128. package/templates/next/src/styles/app.css +1092 -0
  129. package/templates/next/src/types/user.ts +13 -0
  130. package/templates/next/tsconfig.json +34 -0
  131. package/templates/next/vitest.config.mts +13 -0
  132. package/templates/styles/css.css +580 -0
  133. package/templates/styles/shadcn.css +142 -0
  134. package/templates/styles/tailwind.css +140 -0
  135. package/templates/ui/css/components/alert-dialog.tsx +172 -0
  136. package/templates/ui/css/components/avatar.tsx +17 -0
  137. package/templates/ui/css/components/badge.tsx +18 -0
  138. package/templates/ui/css/components/button.tsx +41 -0
  139. package/templates/ui/css/components/card.tsx +33 -0
  140. package/templates/ui/css/components/dropdown-menu.tsx +230 -0
  141. package/templates/ui/css/components/input.tsx +7 -0
  142. package/templates/ui/css/components/label.tsx +7 -0
  143. package/templates/ui/css/components/native-select.tsx +23 -0
  144. package/templates/ui/css/components/skeleton.tsx +7 -0
  145. package/templates/ui/css/components/slot.tsx +30 -0
  146. package/templates/ui/css/components/table.tsx +31 -0
  147. package/templates/ui/css/utils.ts +16 -0
  148. package/templates/ui/shadcn/components/alert-dialog.tsx +199 -0
  149. package/templates/ui/shadcn/components/avatar.tsx +111 -0
  150. package/templates/ui/shadcn/components/badge.tsx +44 -0
  151. package/templates/ui/shadcn/components/button.tsx +66 -0
  152. package/templates/ui/shadcn/components/card.tsx +87 -0
  153. package/templates/ui/shadcn/components/dropdown-menu.tsx +268 -0
  154. package/templates/ui/shadcn/components/input.tsx +18 -0
  155. package/templates/ui/shadcn/components/label.tsx +20 -0
  156. package/templates/ui/shadcn/components/native-select.tsx +54 -0
  157. package/templates/ui/shadcn/components/skeleton.tsx +13 -0
  158. package/templates/ui/shadcn/components/table.tsx +115 -0
  159. package/templates/ui/shadcn/utils.ts +1 -0
  160. package/templates/ui/tailwind/components/alert-dialog.tsx +177 -0
  161. package/templates/ui/tailwind/components/avatar.tsx +36 -0
  162. package/templates/ui/tailwind/components/badge.tsx +29 -0
  163. package/templates/ui/tailwind/components/button.tsx +65 -0
  164. package/templates/ui/tailwind/components/card.tsx +70 -0
  165. package/templates/ui/tailwind/components/dropdown-menu.tsx +236 -0
  166. package/templates/ui/tailwind/components/input.tsx +17 -0
  167. package/templates/ui/tailwind/components/label.tsx +16 -0
  168. package/templates/ui/tailwind/components/native-select.tsx +32 -0
  169. package/templates/ui/tailwind/components/skeleton.tsx +13 -0
  170. package/templates/ui/tailwind/components/slot.tsx +34 -0
  171. package/templates/ui/tailwind/components/table.tsx +56 -0
  172. package/templates/ui/tailwind/utils.ts +1 -0
  173. package/templates/vite/Dockerfile +29 -0
  174. package/templates/vite/README.md +142 -0
  175. package/templates/vite/_dockerignore +14 -0
  176. package/templates/vite/_env.example +8 -0
  177. package/templates/vite/_gitignore +37 -0
  178. package/templates/vite/e2e/app.spec.ts +41 -0
  179. package/templates/vite/index.html +32 -0
  180. package/templates/vite/nginx.conf +26 -0
  181. package/templates/vite/package.json +61 -0
  182. package/templates/vite/playwright.config.ts +27 -0
  183. package/templates/vite/public/favicon.svg +1 -0
  184. package/templates/vite/src/App.test.tsx +28 -0
  185. package/templates/vite/src/App.tsx +26 -0
  186. package/templates/vite/src/components/home.tsx +121 -0
  187. package/templates/vite/src/components/layout/root-layout.tsx +18 -0
  188. package/templates/vite/src/components/layout/site-footer.tsx +10 -0
  189. package/templates/vite/src/components/layout/site-header.tsx +49 -0
  190. package/templates/vite/src/components/theme-toggle.tsx +90 -0
  191. package/templates/vite/src/env.ts +36 -0
  192. package/templates/vite/src/lib/theme.ts +26 -0
  193. package/templates/vite/src/main.tsx +13 -0
  194. package/templates/vite/src/pages/about.tsx +52 -0
  195. package/templates/vite/src/pages/not-found.tsx +33 -0
  196. package/templates/vite/src/router.ts +24 -0
  197. package/templates/vite/src/styles/app.css +281 -0
  198. package/templates/vite/src/test/setup.ts +21 -0
  199. package/templates/vite/tsconfig.app.json +31 -0
  200. package/templates/vite/tsconfig.json +7 -0
  201. package/templates/vite/tsconfig.node.json +23 -0
  202. package/templates/vite/vite.config.ts +30 -0
@@ -0,0 +1,13 @@
1
+ import type { Role } from "@/config/rbac";
2
+
3
+ /** A user as it is safe to send to the client (never includes the password hash). */
4
+ export type PublicUser = {
5
+ id: string;
6
+ name: string;
7
+ email: string;
8
+ role: Role;
9
+ createdAt: string;
10
+ // @feature email
11
+ emailVerified: boolean;
12
+ // @end email
13
+ };
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2017",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": true,
6
+ "skipLibCheck": true,
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "esModuleInterop": true,
10
+ "module": "esnext",
11
+ "moduleResolution": "bundler",
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "jsx": "react-jsx",
15
+ "incremental": true,
16
+ "plugins": [
17
+ {
18
+ "name": "next"
19
+ }
20
+ ],
21
+ "paths": {
22
+ "@/*": ["./src/*"]
23
+ }
24
+ },
25
+ "include": [
26
+ "next-env.d.ts",
27
+ "**/*.ts",
28
+ "**/*.tsx",
29
+ ".next/types/**/*.ts",
30
+ ".next/dev/types/**/*.ts",
31
+ "**/*.mts"
32
+ ],
33
+ "exclude": ["node_modules"]
34
+ }
@@ -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
+ }