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.
- package/README.md +139 -2
- package/index.js +399 -0
- package/lib/features.js +358 -0
- package/lib/scaffold.js +471 -0
- package/package.json +40 -4
- 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/templates/common/_prettierignore +15 -0
- package/templates/common/commitlint.config.mjs +10 -0
- package/templates/next/AGENTS.md +9 -0
- package/templates/next/Dockerfile +48 -0
- package/templates/next/README.md +328 -0
- package/templates/next/_dockerignore +13 -0
- package/templates/next/_env.example +20 -0
- package/templates/next/_gitignore +50 -0
- package/templates/next/docker-compose.yml +33 -0
- package/templates/next/e2e/rbac.spec.ts +69 -0
- package/templates/next/e2e/server.mjs +35 -0
- package/templates/next/eslint.config.mjs +33 -0
- package/templates/next/next.config.ts +47 -0
- package/templates/next/package.json +68 -0
- package/templates/next/playwright.config.ts +30 -0
- package/templates/next/public/robots.txt +6 -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/templates/next/src/app/(app)/dashboard/page.tsx +120 -0
- package/templates/next/src/app/(app)/error.tsx +28 -0
- package/templates/next/src/app/(app)/layout.tsx +58 -0
- package/templates/next/src/app/(app)/loading.tsx +5 -0
- 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/templates/next/src/app/(auth)/login/page.tsx +18 -0
- package/templates/next/src/app/(auth)/register/page.tsx +18 -0
- 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/templates/next/src/app/api/admin/users/[id]/route.ts +61 -0
- package/templates/next/src/app/api/admin/users/route.ts +18 -0
- package/templates/next/src/app/api/auth/forgot-password/route.ts +47 -0
- package/templates/next/src/app/api/auth/login/route.ts +43 -0
- package/templates/next/src/app/api/auth/logout/route.ts +21 -0
- package/templates/next/src/app/api/auth/me/route.ts +21 -0
- package/templates/next/src/app/api/auth/register/route.ts +74 -0
- 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/templates/next/src/app/api/health/route.ts +27 -0
- package/templates/next/src/app/favicon.ico +0 -0
- package/templates/next/src/app/forbidden/page.tsx +47 -0
- package/templates/next/src/app/layout.tsx +55 -0
- 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/templates/next/src/components/auth/auth-card.tsx +41 -0
- package/templates/next/src/components/auth/can.tsx +34 -0
- package/templates/next/src/components/auth/forgot-password-form.tsx +76 -0
- package/templates/next/src/components/auth/form-field.tsx +40 -0
- package/templates/next/src/components/auth/login-form.tsx +87 -0
- package/templates/next/src/components/auth/password-input.tsx +43 -0
- package/templates/next/src/components/auth/register-form.tsx +117 -0
- package/templates/next/src/components/auth/reset-password-form.tsx +80 -0
- package/templates/next/src/components/auth/session-refresher.tsx +44 -0
- 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/templates/next/src/components/logo.tsx +16 -0
- package/templates/next/src/components/motion/fade-in.tsx +19 -0
- package/templates/next/src/components/providers/user-provider.tsx +60 -0
- package/templates/next/src/components/reports/animated-bar.tsx +24 -0
- 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/templates/next/src/config/rbac.ts +170 -0
- package/templates/next/src/config/site.ts +4 -0
- package/templates/next/src/lib/api.ts +179 -0
- package/templates/next/src/lib/audit.ts +66 -0
- package/templates/next/src/lib/auth.ts +50 -0
- package/templates/next/src/lib/dal.ts +63 -0
- package/templates/next/src/lib/db.ts +35 -0
- 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/http.ts +57 -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/templates/next/src/lib/redirect.ts +21 -0
- package/templates/next/src/lib/session.ts +71 -0
- package/templates/next/src/lib/theme.ts +32 -0
- package/templates/next/src/lib/tokens.ts +63 -0
- package/templates/next/src/lib/users.ts +196 -0
- package/templates/next/src/lib/validations/account.ts +20 -0
- package/templates/next/src/lib/validations/auth.test.ts +39 -0
- package/templates/next/src/lib/validations/auth.ts +66 -0
- package/templates/next/src/lib/validations/user.ts +13 -0
- package/templates/next/src/models/audit-log.ts +33 -0
- package/templates/next/src/models/auth-token.ts +26 -0
- package/templates/next/src/models/user.ts +35 -0
- package/templates/next/src/proxy.ts +57 -0
- package/templates/next/src/styles/app.css +1092 -0
- package/templates/next/src/types/user.ts +13 -0
- package/templates/next/tsconfig.json +34 -0
- package/templates/next/vitest.config.mts +13 -0
- package/templates/styles/css.css +580 -0
- package/templates/styles/shadcn.css +142 -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/badge.tsx +44 -0
- package/templates/ui/shadcn/components/button.tsx +66 -0
- package/templates/ui/shadcn/components/card.tsx +87 -0
- package/templates/ui/shadcn/components/dropdown-menu.tsx +268 -0
- package/templates/ui/shadcn/components/input.tsx +18 -0
- package/templates/ui/shadcn/components/label.tsx +20 -0
- package/templates/ui/shadcn/components/native-select.tsx +54 -0
- package/templates/ui/shadcn/components/skeleton.tsx +13 -0
- package/templates/ui/shadcn/components/table.tsx +115 -0
- package/templates/ui/shadcn/utils.ts +1 -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
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* App layout & page styles. Plain CSS on top of the theme tokens defined in
|
|
3
|
+
* src/index.css, so it works with Tailwind + shadcn/ui, Tailwind only, or
|
|
4
|
+
* no Tailwind at all. UI primitives live in src/components/ui.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--page-width: 64rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
html {
|
|
12
|
+
font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
13
|
+
-webkit-font-smoothing: antialiased;
|
|
14
|
+
-moz-osx-font-smoothing: grayscale;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
body {
|
|
18
|
+
min-height: 100dvh;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#root {
|
|
22
|
+
min-height: 100dvh;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Helpers */
|
|
26
|
+
.muted {
|
|
27
|
+
color: var(--muted-foreground);
|
|
28
|
+
}
|
|
29
|
+
.code {
|
|
30
|
+
padding: 0.1rem 0.375rem;
|
|
31
|
+
border-radius: 0.375rem;
|
|
32
|
+
background: var(--muted);
|
|
33
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
34
|
+
font-size: 0.875em;
|
|
35
|
+
}
|
|
36
|
+
.menu-grow {
|
|
37
|
+
flex: 1;
|
|
38
|
+
}
|
|
39
|
+
.dark .theme-icon-light,
|
|
40
|
+
:root:not(.dark) .theme-icon-dark {
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Shell */
|
|
45
|
+
.app {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
min-height: 100dvh;
|
|
49
|
+
}
|
|
50
|
+
.main {
|
|
51
|
+
flex: 1;
|
|
52
|
+
width: 100%;
|
|
53
|
+
max-width: var(--page-width);
|
|
54
|
+
margin: 0 auto;
|
|
55
|
+
padding: 2rem 1rem 4rem;
|
|
56
|
+
}
|
|
57
|
+
.site-header {
|
|
58
|
+
position: sticky;
|
|
59
|
+
top: 0;
|
|
60
|
+
z-index: 40;
|
|
61
|
+
border-bottom: 1px solid var(--border);
|
|
62
|
+
background: color-mix(in oklch, var(--background) 85%, transparent);
|
|
63
|
+
backdrop-filter: blur(8px);
|
|
64
|
+
}
|
|
65
|
+
.site-header-inner {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: 1.5rem;
|
|
69
|
+
max-width: var(--page-width);
|
|
70
|
+
height: 3.5rem;
|
|
71
|
+
margin: 0 auto;
|
|
72
|
+
padding: 0 1rem;
|
|
73
|
+
}
|
|
74
|
+
.site-header-actions {
|
|
75
|
+
margin-left: auto;
|
|
76
|
+
}
|
|
77
|
+
.site-nav {
|
|
78
|
+
display: flex;
|
|
79
|
+
gap: 0.25rem;
|
|
80
|
+
}
|
|
81
|
+
.nav-link {
|
|
82
|
+
padding: 0.375rem 0.75rem;
|
|
83
|
+
border-radius: 0.5rem;
|
|
84
|
+
font-size: 0.875rem;
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
color: var(--muted-foreground);
|
|
87
|
+
text-decoration: none;
|
|
88
|
+
}
|
|
89
|
+
.nav-link:hover {
|
|
90
|
+
color: var(--foreground);
|
|
91
|
+
}
|
|
92
|
+
.nav-link.active {
|
|
93
|
+
background: var(--secondary);
|
|
94
|
+
color: var(--foreground);
|
|
95
|
+
}
|
|
96
|
+
.logo {
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
gap: 0.5rem;
|
|
100
|
+
font-weight: 600;
|
|
101
|
+
color: inherit;
|
|
102
|
+
text-decoration: none;
|
|
103
|
+
}
|
|
104
|
+
.logo-mark {
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
width: 1.75rem;
|
|
109
|
+
height: 1.75rem;
|
|
110
|
+
border-radius: 0.5rem;
|
|
111
|
+
background: var(--primary);
|
|
112
|
+
color: var(--primary-foreground);
|
|
113
|
+
}
|
|
114
|
+
.site-footer {
|
|
115
|
+
display: flex;
|
|
116
|
+
justify-content: space-between;
|
|
117
|
+
gap: 1rem;
|
|
118
|
+
width: 100%;
|
|
119
|
+
max-width: var(--page-width);
|
|
120
|
+
margin: 0 auto;
|
|
121
|
+
padding: 1.5rem 1rem;
|
|
122
|
+
border-top: 1px solid var(--border);
|
|
123
|
+
font-size: 0.875rem;
|
|
124
|
+
color: var(--muted-foreground);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Pages */
|
|
128
|
+
.page {
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
gap: 1.5rem;
|
|
132
|
+
}
|
|
133
|
+
.page-title {
|
|
134
|
+
margin: 0;
|
|
135
|
+
font-size: 1.75rem;
|
|
136
|
+
font-weight: 600;
|
|
137
|
+
letter-spacing: -0.01em;
|
|
138
|
+
}
|
|
139
|
+
.page > p {
|
|
140
|
+
margin: 0;
|
|
141
|
+
}
|
|
142
|
+
.hero {
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
align-items: center;
|
|
146
|
+
gap: 1.25rem;
|
|
147
|
+
padding: 3rem 0 1rem;
|
|
148
|
+
text-align: center;
|
|
149
|
+
}
|
|
150
|
+
.hero-title {
|
|
151
|
+
margin: 0;
|
|
152
|
+
font-size: clamp(2rem, 6vw, 3.25rem);
|
|
153
|
+
font-weight: 600;
|
|
154
|
+
line-height: 1.1;
|
|
155
|
+
letter-spacing: -0.02em;
|
|
156
|
+
text-wrap: balance;
|
|
157
|
+
}
|
|
158
|
+
.hero-lead {
|
|
159
|
+
max-width: 34rem;
|
|
160
|
+
margin: 0;
|
|
161
|
+
font-size: 1.125rem;
|
|
162
|
+
color: var(--muted-foreground);
|
|
163
|
+
}
|
|
164
|
+
.feature-grid {
|
|
165
|
+
display: grid;
|
|
166
|
+
gap: 1rem;
|
|
167
|
+
}
|
|
168
|
+
@media (min-width: 640px) {
|
|
169
|
+
.feature-grid {
|
|
170
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
.feature-icon {
|
|
174
|
+
display: inline-flex;
|
|
175
|
+
align-items: center;
|
|
176
|
+
justify-content: center;
|
|
177
|
+
width: 2.25rem;
|
|
178
|
+
height: 2.25rem;
|
|
179
|
+
margin-bottom: 0.5rem;
|
|
180
|
+
border-radius: 0.5rem;
|
|
181
|
+
background: var(--secondary);
|
|
182
|
+
}
|
|
183
|
+
.counter-card {
|
|
184
|
+
max-width: 28rem;
|
|
185
|
+
}
|
|
186
|
+
.counter {
|
|
187
|
+
display: flex;
|
|
188
|
+
align-items: center;
|
|
189
|
+
gap: 0.75rem;
|
|
190
|
+
}
|
|
191
|
+
.counter-value {
|
|
192
|
+
min-width: 3ch;
|
|
193
|
+
font-size: 1.5rem;
|
|
194
|
+
font-weight: 600;
|
|
195
|
+
font-variant-numeric: tabular-nums;
|
|
196
|
+
text-align: center;
|
|
197
|
+
}
|
|
198
|
+
.definition-list {
|
|
199
|
+
display: grid;
|
|
200
|
+
gap: 0.75rem;
|
|
201
|
+
margin: 0;
|
|
202
|
+
}
|
|
203
|
+
.definition-list dt {
|
|
204
|
+
font-weight: 500;
|
|
205
|
+
}
|
|
206
|
+
.definition-list dd {
|
|
207
|
+
margin: 0;
|
|
208
|
+
}
|
|
209
|
+
.status {
|
|
210
|
+
display: flex;
|
|
211
|
+
flex-direction: column;
|
|
212
|
+
align-items: center;
|
|
213
|
+
gap: 1rem;
|
|
214
|
+
padding: 4rem 0;
|
|
215
|
+
text-align: center;
|
|
216
|
+
}
|
|
217
|
+
.status p {
|
|
218
|
+
margin: 0;
|
|
219
|
+
}
|
|
220
|
+
.status-code {
|
|
221
|
+
font-family: ui-monospace, monospace;
|
|
222
|
+
color: var(--muted-foreground);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* Used when the project was created without the UI components */
|
|
226
|
+
.panel {
|
|
227
|
+
display: flex;
|
|
228
|
+
flex-direction: column;
|
|
229
|
+
gap: 0.5rem;
|
|
230
|
+
padding: 1.25rem;
|
|
231
|
+
border: 1px solid var(--border);
|
|
232
|
+
border-radius: calc(var(--radius) * 1.4);
|
|
233
|
+
background: var(--card);
|
|
234
|
+
}
|
|
235
|
+
.panel p {
|
|
236
|
+
margin: 0;
|
|
237
|
+
}
|
|
238
|
+
.panel-title {
|
|
239
|
+
margin: 0;
|
|
240
|
+
font-size: 1rem;
|
|
241
|
+
font-weight: 600;
|
|
242
|
+
}
|
|
243
|
+
.pill {
|
|
244
|
+
padding: 0.125rem 0.625rem;
|
|
245
|
+
border: 1px solid var(--border);
|
|
246
|
+
border-radius: 999px;
|
|
247
|
+
font-size: 0.75rem;
|
|
248
|
+
font-weight: 500;
|
|
249
|
+
}
|
|
250
|
+
.plain-button,
|
|
251
|
+
.icon-button {
|
|
252
|
+
display: inline-flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
justify-content: center;
|
|
255
|
+
gap: 0.375rem;
|
|
256
|
+
height: 2rem;
|
|
257
|
+
padding: 0 0.75rem;
|
|
258
|
+
border: 1px solid var(--border);
|
|
259
|
+
border-radius: calc(var(--radius) * 0.8);
|
|
260
|
+
background: var(--background);
|
|
261
|
+
color: var(--foreground);
|
|
262
|
+
font: inherit;
|
|
263
|
+
font-size: 0.875rem;
|
|
264
|
+
font-weight: 500;
|
|
265
|
+
text-decoration: none;
|
|
266
|
+
cursor: pointer;
|
|
267
|
+
}
|
|
268
|
+
.plain-button:hover,
|
|
269
|
+
.icon-button:hover {
|
|
270
|
+
background: var(--muted);
|
|
271
|
+
}
|
|
272
|
+
.plain-button:disabled {
|
|
273
|
+
cursor: not-allowed;
|
|
274
|
+
opacity: 0.5;
|
|
275
|
+
}
|
|
276
|
+
.icon-button {
|
|
277
|
+
width: 2rem;
|
|
278
|
+
padding: 0;
|
|
279
|
+
border-color: transparent;
|
|
280
|
+
background: transparent;
|
|
281
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "@testing-library/jest-dom/vitest";
|
|
2
|
+
|
|
3
|
+
import { cleanup } from "@testing-library/react";
|
|
4
|
+
import { afterEach } from "vitest";
|
|
5
|
+
|
|
6
|
+
// jsdom doesn't implement matchMedia; the theme helpers need it.
|
|
7
|
+
if (!window.matchMedia) {
|
|
8
|
+
window.matchMedia = (query: string) =>
|
|
9
|
+
({
|
|
10
|
+
matches: false,
|
|
11
|
+
media: query,
|
|
12
|
+
onchange: null,
|
|
13
|
+
addEventListener: () => {},
|
|
14
|
+
removeEventListener: () => {},
|
|
15
|
+
addListener: () => {},
|
|
16
|
+
removeListener: () => {},
|
|
17
|
+
dispatchEvent: () => false,
|
|
18
|
+
}) as MediaQueryList;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
afterEach(() => cleanup());
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"target": "es2023",
|
|
5
|
+
"lib": ["ES2023", "DOM"],
|
|
6
|
+
"module": "esnext",
|
|
7
|
+
"types": ["vite/client"],
|
|
8
|
+
"allowArbitraryExtensions": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
|
|
11
|
+
/* Bundler mode */
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"moduleDetection": "force",
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
|
|
19
|
+
/* Linting */
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": true,
|
|
22
|
+
"erasableSyntaxOnly": true,
|
|
23
|
+
"noFallthroughCasesInSwitch": true,
|
|
24
|
+
|
|
25
|
+
/* Path alias (also set in vite.config.ts) */
|
|
26
|
+
"paths": {
|
|
27
|
+
"@/*": ["./src/*"]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"include": ["src"]
|
|
31
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "es2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"types": ["node"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"module": "nodenext",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"verbatimModuleSyntax": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"noUnusedParameters": true,
|
|
19
|
+
"erasableSyntaxOnly": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true
|
|
21
|
+
},
|
|
22
|
+
"include": ["vite.config.ts", "playwright.config.ts", "e2e"]
|
|
23
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// @feature vitest
|
|
2
|
+
/// <reference types="vitest/config" />
|
|
3
|
+
// @end vitest
|
|
4
|
+
// @feature tailwind
|
|
5
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
6
|
+
// @end tailwind
|
|
7
|
+
import react from "@vitejs/plugin-react";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
import { defineConfig } from "vite";
|
|
10
|
+
|
|
11
|
+
// https://vite.dev/config/
|
|
12
|
+
export default defineConfig({
|
|
13
|
+
plugins: [
|
|
14
|
+
react(),
|
|
15
|
+
// @feature tailwind
|
|
16
|
+
tailwindcss(),
|
|
17
|
+
// @end tailwind
|
|
18
|
+
],
|
|
19
|
+
resolve: {
|
|
20
|
+
alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) },
|
|
21
|
+
},
|
|
22
|
+
// @feature vitest
|
|
23
|
+
test: {
|
|
24
|
+
environment: "jsdom",
|
|
25
|
+
setupFiles: ["./src/test/setup"],
|
|
26
|
+
include: ["src/**/*.test.{ts,tsx,js,jsx}"],
|
|
27
|
+
css: false,
|
|
28
|
+
},
|
|
29
|
+
// @end vitest
|
|
30
|
+
});
|