kreftjs 0.0.0-stage → 0.0.2-beta
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 +103 -2
- package/bin/add.js +1074 -0
- package/bin/artisan-more.js +994 -0
- package/bin/artisan.js +1877 -0
- package/bin/backend/app.js +161 -0
- package/bin/backend/cache.js +196 -0
- package/bin/backend/collection.js +117 -0
- package/bin/backend/command.js +45 -0
- package/bin/backend/config.js +234 -0
- package/bin/backend/error-page.js +773 -0
- package/bin/backend/events.js +49 -0
- package/bin/backend/factory.js +223 -0
- package/bin/backend/fake.js +180 -0
- package/bin/backend/form.js +102 -0
- package/bin/backend/gate.js +79 -0
- package/bin/backend/gc.js +69 -0
- package/bin/backend/html.js +322 -0
- package/bin/backend/http.js +652 -0
- package/bin/backend/index.js +452 -0
- package/bin/backend/mail.js +77 -0
- package/bin/backend/mcp.js +433 -0
- package/bin/backend/migrator.js +370 -0
- package/bin/backend/model.js +781 -0
- package/bin/backend/namespace.js +213 -0
- package/bin/backend/notifications.js +68 -0
- package/bin/backend/qr.js +164 -0
- package/bin/backend/query.js +387 -0
- package/bin/backend/queue.js +412 -0
- package/bin/backend/redis.js +479 -0
- package/bin/backend/schedule.js +112 -0
- package/bin/backend/schema.js +321 -0
- package/bin/backend/seo-pages.js +100 -0
- package/bin/backend/storage.js +153 -0
- package/bin/backend/support.js +567 -0
- package/bin/backend/typescript.js +166 -0
- package/bin/build.js +540 -0
- package/bin/db-api.js +249 -0
- package/bin/db.js +275 -0
- package/bin/deps.js +138 -0
- package/bin/electron.js +509 -0
- package/bin/env.js +97 -0
- package/bin/guard.js +80 -0
- package/bin/kreftjs-config.js +40 -0
- package/bin/kreftjs.js +1373 -0
- package/bin/lang.js +241 -0
- package/bin/layout.js +74 -0
- package/bin/no-auth.js +162 -0
- package/bin/prerender.js +258 -0
- package/bin/safe-json.js +24 -0
- package/bin/server-routes.js +154 -0
- package/bin/ssr.js +133 -0
- package/bin/terminal.js +195 -0
- package/bin/to-ts.js +36 -0
- package/bin/update.js +237 -0
- package/bin/urls-file.js +27 -0
- package/bin/vite.js +228 -0
- package/docs/Docs.kreftjs +557 -0
- package/docs/README.md +2302 -0
- package/docs/markdown.js +186 -0
- package/editors/vscode/README.md +13 -0
- package/editors/vscode/extension.js +183 -0
- package/editors/vscode/language-configuration.json +17 -0
- package/editors/vscode/package.json +57 -0
- package/editors/vscode/snippets/kreftjs.json +21 -0
- package/editors/vscode/syntaxes/kreftjs.tmLanguage.json +207 -0
- package/kreftjs.d.ts +579 -0
- package/kreftjs.js +5108 -0
- package/package.json +97 -4
- package/server.d.ts +1028 -0
- package/server.js +8 -0
- package/templates/app/README.md +127 -0
- package/templates/app/_env.example +64 -0
- package/templates/app/_gitignore +5 -0
- package/templates/app/_vscode/settings.json +9 -0
- package/templates/app/backend/app/Auth/Session.js +177 -0
- package/templates/app/backend/app/Auth/Throttle.js +29 -0
- package/templates/app/backend/app/Console/Commands/.gitkeep +0 -0
- package/templates/app/backend/app/Events/.gitkeep +0 -0
- package/templates/app/backend/app/Http/Controllers/Admin/DashboardController.js +34 -0
- package/templates/app/backend/app/Http/Controllers/Admin/UserController.js +53 -0
- package/templates/app/backend/app/Http/Controllers/Auth/ApiTokenController.js +47 -0
- package/templates/app/backend/app/Http/Controllers/Auth/AuthenticatedSessionController.js +41 -0
- package/templates/app/backend/app/Http/Controllers/Auth/ConfirmablePasswordController.js +14 -0
- package/templates/app/backend/app/Http/Controllers/Auth/EmailVerificationController.js +23 -0
- package/templates/app/backend/app/Http/Controllers/Auth/NewPasswordController.js +29 -0
- package/templates/app/backend/app/Http/Controllers/Auth/PasswordResetLinkController.js +20 -0
- package/templates/app/backend/app/Http/Controllers/Auth/RegisteredUserController.js +19 -0
- package/templates/app/backend/app/Http/Controllers/Auth/SessionController.js +36 -0
- package/templates/app/backend/app/Http/Controllers/Auth/TwoFactorChallengeController.js +41 -0
- package/templates/app/backend/app/Http/Controllers/Auth/TwoFactorController.js +63 -0
- package/templates/app/backend/app/Http/Controllers/ProfileController.js +66 -0
- package/templates/app/backend/app/Http/Kernel.js +8 -0
- package/templates/app/backend/app/Http/Middleware/Authenticate.js +84 -0
- package/templates/app/backend/app/Http/Middleware/CheckAbilities.js +17 -0
- package/templates/app/backend/app/Http/Middleware/CheckForAnyAbility.js +12 -0
- package/templates/app/backend/app/Http/Middleware/EnsureEmailIsVerified.js +11 -0
- package/templates/app/backend/app/Http/Middleware/EnsureHasRole.js +11 -0
- package/templates/app/backend/app/Http/Middleware/EnsureIsAdmin.js +11 -0
- package/templates/app/backend/app/Http/Middleware/RequirePassword.js +15 -0
- package/templates/app/backend/app/Http/Requests/Auth/LoginRequest.js +45 -0
- package/templates/app/backend/app/Http/Resources/.gitkeep +1 -0
- package/templates/app/backend/app/Jobs/.gitkeep +0 -0
- package/templates/app/backend/app/Listeners/.gitkeep +0 -0
- package/templates/app/backend/app/Mail/.gitkeep +0 -0
- package/templates/app/backend/app/Models/PersonalAccessToken.js +21 -0
- package/templates/app/backend/app/Models/User.js +64 -0
- package/templates/app/backend/app/Notifications/.gitkeep +0 -0
- package/templates/app/backend/app/Observers/.gitkeep +0 -0
- package/templates/app/backend/app/Policies/.gitkeep +0 -0
- package/templates/app/backend/app/Providers/AppServiceProvider.js +12 -0
- package/templates/app/backend/app/Rules/.gitkeep +1 -0
- package/templates/app/backend/config/app.js +16 -0
- package/templates/app/backend/config/auth.js +34 -0
- package/templates/app/backend/config/database.js +38 -0
- package/templates/app/backend/config/redis.js +28 -0
- package/templates/app/backend/config/session.js +36 -0
- package/templates/app/backend/database/migrations/0001_01_01_000000_create_users_table.js +49 -0
- package/templates/app/backend/database/migrations/0001_01_01_000001_create_cache_table.js +13 -0
- package/templates/app/backend/database/migrations/0001_01_01_000002_create_jobs_table.js +26 -0
- package/templates/app/backend/database/migrations/0001_01_01_000003_create_notifications_table.js +18 -0
- package/templates/app/backend/database/seeders/DatabaseSeeder.js +15 -0
- package/templates/app/backend/lang/ar/messages.json +10 -0
- package/templates/app/backend/lang/ar/validation.json +21 -0
- package/templates/app/backend/lang/en/messages.json +10 -0
- package/templates/app/backend/lang/en/validation.json +19 -0
- package/templates/app/backend/routes/api.js +25 -0
- package/templates/app/backend/routes/auth.js +52 -0
- package/templates/app/backend/routes/console.js +15 -0
- package/templates/app/frontend/App.kreftjs +4 -0
- package/templates/app/frontend/components/Field.kreftjs +19 -0
- package/templates/app/frontend/components/StatCard.kreftjs +47 -0
- package/templates/app/frontend/components/profile/ApiTokens.kreftjs +70 -0
- package/templates/app/frontend/components/profile/Sessions.kreftjs +42 -0
- package/templates/app/frontend/components/profile/TwoFactor.kreftjs +90 -0
- package/templates/app/frontend/errors/ErrorMonitor.kreftjs +264 -0
- package/templates/app/frontend/index.html +79 -0
- package/templates/app/frontend/kreftjs.d.ts +579 -0
- package/templates/app/frontend/kreftjs.js +5108 -0
- package/templates/app/frontend/layouts/app.kreftjs +718 -0
- package/templates/app/frontend/layouts/docs.kreftjs +37 -0
- package/templates/app/frontend/layouts/guest.kreftjs +18 -0
- package/templates/app/frontend/pages/Dashboard.kreftjs +273 -0
- package/templates/app/frontend/pages/ErrorMonitor.kreftjs +96 -0
- package/templates/app/frontend/pages/Home.kreftjs +617 -0
- package/templates/app/frontend/pages/Profile.kreftjs +104 -0
- package/templates/app/frontend/pages/Users.kreftjs +240 -0
- package/templates/app/frontend/pages/auth/ConfirmPassword.kreftjs +33 -0
- package/templates/app/frontend/pages/auth/ForgotPassword.kreftjs +36 -0
- package/templates/app/frontend/pages/auth/Login.kreftjs +89 -0
- package/templates/app/frontend/pages/auth/Register.kreftjs +48 -0
- package/templates/app/frontend/pages/auth/ResetPassword.kreftjs +45 -0
- package/templates/app/frontend/pages/auth/VerifyEmail.kreftjs +59 -0
- package/templates/app/frontend/routes/web.kreftjs +34 -0
- package/templates/app/frontend/tests/components/Counter.kreftjs +15 -0
- package/templates/app/frontend/tests/pages/About.kreftjs +12 -0
- package/templates/app/frontend/tests/pages/Test.kreftjs +31 -0
- package/templates/app/frontend/ui.css +517 -0
- package/templates/app/lang/ar/auth.json +6 -0
- package/templates/app/lang/ar/messages.json +6 -0
- package/templates/app/lang/ar/pagination.json +5 -0
- package/templates/app/lang/ar/passwords.json +8 -0
- package/templates/app/lang/ar/validation.json +22 -0
- package/templates/app/lang/ar.json +10 -0
- package/templates/app/lang/en/auth.json +6 -0
- package/templates/app/lang/en/messages.json +6 -0
- package/templates/app/lang/en/pagination.json +5 -0
- package/templates/app/lang/en/passwords.json +8 -0
- package/templates/app/lang/en/validation.json +22 -0
- package/templates/app/lang/en.json +10 -0
- package/templates/errors/401.kreftjs +11 -0
- package/templates/errors/402.kreftjs +11 -0
- package/templates/errors/403.kreftjs +11 -0
- package/templates/errors/404.kreftjs +11 -0
- package/templates/errors/419.kreftjs +11 -0
- package/templates/errors/429.kreftjs +11 -0
- package/templates/errors/500.kreftjs +11 -0
- package/templates/errors/503.kreftjs +11 -0
- package/templates/errors/ErrorMonitor.kreftjs +502 -0
- package/templates/errors/error.kreftjs +11 -0
- package/templates/errors/minimal.kreftjs +25 -0
- package/tools/dev-client.js +125 -0
- package/tools/devtools.js +172 -0
- package/tools/vite-plugin-kreftjs.d.ts +52 -0
- package/tools/vite-plugin-kreftjs.js +466 -0
|
@@ -0,0 +1,718 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Default Application Shell: Dashboard layout with collapsible sidebar, technical navigation,
|
|
3
|
+
theme toggle, and user profile management.
|
|
4
|
+
Strictly zero border-radius and zero shadows across all elements.
|
|
5
|
+
-->
|
|
6
|
+
saved collapsed = false
|
|
7
|
+
state open = false
|
|
8
|
+
state userMenuOpen = false
|
|
9
|
+
state sessionWarning = false
|
|
10
|
+
state remainingMinutes = 5
|
|
11
|
+
state inactivityTimer = null
|
|
12
|
+
|
|
13
|
+
// SVG vector icon paths (24x24)
|
|
14
|
+
state icons = {
|
|
15
|
+
dashboard: 'M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z',
|
|
16
|
+
users: 'M16 19v-1a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v1M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7M21 19v-1a4 4 0 0 0-3-3.87M15.5 3.13a3.5 3.5 0 0 1 0 6.75',
|
|
17
|
+
profile: 'M20 21v-1a5 5 0 0 0-5-5H9a5 5 0 0 0-5 5v1M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8',
|
|
18
|
+
showcase: 'M3 10.5 12 3l9 7.5V21h-6v-6H9v6H3z',
|
|
19
|
+
docs: 'M4 19.5A2.5 2.5 0 0 1 6.5 17H20V3H6.5A2.5 2.5 0 0 0 4 5.5zM4 19.5A2.5 2.5 0 0 0 6.5 22H20v-5',
|
|
20
|
+
tests: 'M14 3h7v7M10 14 21 3M19 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5',
|
|
21
|
+
panel: 'M3 4h18v16H3zM9 4v16',
|
|
22
|
+
logout: 'M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9',
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
state navGroups = [
|
|
26
|
+
{ label: 'Management', links: [
|
|
27
|
+
{ to: 'dashboard', label: 'Dashboard', icon: 'dashboard', exact: true },
|
|
28
|
+
{ to: 'users', label: 'Users', icon: 'users' },
|
|
29
|
+
] },
|
|
30
|
+
{ label: 'Account', links: [
|
|
31
|
+
{ to: 'profile', label: 'Profile Settings', icon: 'profile' },
|
|
32
|
+
] },
|
|
33
|
+
{ label: 'Platform', links: [
|
|
34
|
+
{ to: 'welcome', label: 'Showcase', icon: 'showcase' },
|
|
35
|
+
{ to: 'error-monitor', label: 'Error Monitor', icon: 'panel' },
|
|
36
|
+
{ to: 'docs', label: 'Documentation', icon: 'docs' },
|
|
37
|
+
{ to: 'tests.index', label: 'Test Suite', icon: 'tests' },
|
|
38
|
+
] },
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
derive user = $store.auth.user || {}
|
|
42
|
+
derive initials = (user.name || 'Admin').split(/\s+/).filter(Boolean).slice(0, 2).map((w) => w[0].toUpperCase()).join('')
|
|
43
|
+
|
|
44
|
+
action toggleTheme() { theme.toggle() }
|
|
45
|
+
|
|
46
|
+
action toggleSidebar() {
|
|
47
|
+
if (window.matchMedia('(max-width: 768px)').matches) open = !open
|
|
48
|
+
else collapsed = !collapsed
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
action logout() {
|
|
52
|
+
userMenuOpen = false
|
|
53
|
+
await $store.auth.logout()
|
|
54
|
+
$router.replace('/login')
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Close drawer & menu on route change
|
|
58
|
+
watch $route.path {
|
|
59
|
+
open = false
|
|
60
|
+
userMenuOpen = false
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Keyboard shortcuts: Ctrl+B / Cmd+B toggles sidebar
|
|
64
|
+
action onKeydown(e) {
|
|
65
|
+
if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'b') {
|
|
66
|
+
e.preventDefault()
|
|
67
|
+
toggleSidebar()
|
|
68
|
+
}
|
|
69
|
+
if (e.key === 'Escape') {
|
|
70
|
+
open = false
|
|
71
|
+
userMenuOpen = false
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
on ready {
|
|
76
|
+
window.addEventListener('keydown', onKeydown)
|
|
77
|
+
const timeoutMin = Number(env.PUBLIC_SESSION_TIMEOUT) || 30
|
|
78
|
+
const warnMin = Number(env.PUBLIC_SESSION_WARNING) || 5
|
|
79
|
+
if (Kreftjs.useInactivityTimer && timeoutMin > 0) {
|
|
80
|
+
inactivityTimer = Kreftjs.useInactivityTimer({
|
|
81
|
+
timeoutMinutes: timeoutMin,
|
|
82
|
+
warningMinutes: warnMin,
|
|
83
|
+
onWarning(mins) {
|
|
84
|
+
remainingMinutes = mins
|
|
85
|
+
sessionWarning = true
|
|
86
|
+
},
|
|
87
|
+
onReset() {
|
|
88
|
+
sessionWarning = false
|
|
89
|
+
},
|
|
90
|
+
async onTimeout() {
|
|
91
|
+
sessionWarning = false
|
|
92
|
+
await logout()
|
|
93
|
+
},
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
on destroy {
|
|
98
|
+
window.removeEventListener('keydown', onKeydown)
|
|
99
|
+
if (inactivityTimer && inactivityTimer.stop) inactivityTimer.stop()
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
action extendSession() {
|
|
103
|
+
sessionWarning = false
|
|
104
|
+
if (inactivityTimer && inactivityTimer.reset) inactivityTimer.reset()
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
<view>
|
|
108
|
+
<div class={'dash-shell' + (collapsed ? ' collapsed' : '') + (open ? ' open' : '')}>
|
|
109
|
+
<!-- Mobile overlay -->
|
|
110
|
+
<div class="dash-overlay" @click="open = false" aria-hidden="true"></div>
|
|
111
|
+
|
|
112
|
+
<!-- Sidebar -->
|
|
113
|
+
<aside id="main-sidebar" class="dash-sidebar" aria-label="Dashboard Sidebar Navigation">
|
|
114
|
+
<div class="sidebar-brand-box">
|
|
115
|
+
<kreft-link to="dashboard" class="sidebar-brand">
|
|
116
|
+
<span class="brand-glyph-sq" aria-hidden="true">
|
|
117
|
+
<span class="glyph-core"></span>
|
|
118
|
+
</span>
|
|
119
|
+
<span class="brand-copy">
|
|
120
|
+
<strong>{env.PUBLIC_APP_NAME || 'Kreft'}</strong>
|
|
121
|
+
<small>Console</small>
|
|
122
|
+
</span>
|
|
123
|
+
</kreft-link>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<nav class="sidebar-nav">
|
|
127
|
+
{for group in navGroups}
|
|
128
|
+
<div class="nav-group">
|
|
129
|
+
<p class="group-heading">{group.label}</p>
|
|
130
|
+
<ul class="nav-list">
|
|
131
|
+
{for link in group.links}
|
|
132
|
+
<li>
|
|
133
|
+
<kreft-link
|
|
134
|
+
to={link.to}
|
|
135
|
+
exact-class={link.exact ? 'active-link' : 'kreft-link-exact'}
|
|
136
|
+
active-class={link.exact ? 'kreft-link-active' : 'active-link'}
|
|
137
|
+
title={collapsed ? link.label : null}
|
|
138
|
+
class="nav-item">
|
|
139
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" class="nav-icon"><path d={icons[link.icon] || icons.panel}></path></svg>
|
|
140
|
+
<span class="nav-label">{link.label}</span>
|
|
141
|
+
</kreft-link>
|
|
142
|
+
</li>
|
|
143
|
+
{/for}
|
|
144
|
+
</ul>
|
|
145
|
+
</div>
|
|
146
|
+
{/for}
|
|
147
|
+
</nav>
|
|
148
|
+
|
|
149
|
+
<!-- User Profile bar at sidebar bottom -->
|
|
150
|
+
<div class="sidebar-footer">
|
|
151
|
+
<div k-if="userMenuOpen" class="user-popup-menu" role="menu">
|
|
152
|
+
<div class="popup-user-info">
|
|
153
|
+
<strong>{user.name || 'Administrator'}</strong>
|
|
154
|
+
<span>{user.email || 'Admin Account'}</span>
|
|
155
|
+
</div>
|
|
156
|
+
<kreft-link to="profile" role="menuitem" class="popup-item">
|
|
157
|
+
Profile Settings
|
|
158
|
+
</kreft-link>
|
|
159
|
+
<button role="menuitem" @click={logout} class="popup-item logout-action">
|
|
160
|
+
Sign Out
|
|
161
|
+
</button>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<button
|
|
165
|
+
class="user-profile-button"
|
|
166
|
+
@click="userMenuOpen = !userMenuOpen"
|
|
167
|
+
aria-haspopup="menu"
|
|
168
|
+
aria-expanded={userMenuOpen ? 'true' : 'false'}
|
|
169
|
+
title={collapsed ? (user.name || 'Account') : null}>
|
|
170
|
+
<span class="user-avatar-initial" aria-hidden="true">{initials}</span>
|
|
171
|
+
<span class="user-info-text">
|
|
172
|
+
<strong>{user.name || 'Administrator'}</strong>
|
|
173
|
+
<small>{user.email || 'Admin'}</small>
|
|
174
|
+
</span>
|
|
175
|
+
<span class="user-role-badge">{user.is_admin ? 'Admin' : 'Active'}</span>
|
|
176
|
+
</button>
|
|
177
|
+
</div>
|
|
178
|
+
</aside>
|
|
179
|
+
|
|
180
|
+
<!-- Main Container -->
|
|
181
|
+
<div class="dash-viewport">
|
|
182
|
+
<header class="dash-topbar">
|
|
183
|
+
<button
|
|
184
|
+
class="btn ghost sm toggle-sidebar-btn"
|
|
185
|
+
@click={toggleSidebar}
|
|
186
|
+
aria-controls="main-sidebar"
|
|
187
|
+
aria-expanded={(open || !collapsed) ? 'true' : 'false'}
|
|
188
|
+
title="Toggle Sidebar (Ctrl+B)">
|
|
189
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" class="topbar-icon"><path d={icons.panel}></path></svg>
|
|
190
|
+
<span class="sr-only">Toggle Sidebar</span>
|
|
191
|
+
</button>
|
|
192
|
+
|
|
193
|
+
<span class="topbar-divider" aria-hidden="true"></span>
|
|
194
|
+
|
|
195
|
+
<!-- Breadcrumbs -->
|
|
196
|
+
<div class="breadcrumbs">
|
|
197
|
+
<span class="crumb-root">Console</span>
|
|
198
|
+
<span class="crumb-sep">/</span>
|
|
199
|
+
<strong class="crumb-current">{$route.title || 'Dashboard'}</strong>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<div class="topbar-spacer"></div>
|
|
203
|
+
|
|
204
|
+
<!-- Page Actions Slot -->
|
|
205
|
+
<kreft-yield name="actions"></kreft-yield>
|
|
206
|
+
|
|
207
|
+
<!-- Theme Toggle -->
|
|
208
|
+
<button class="theme-switch-btn" @click={toggleTheme} aria-label="Toggle Theme" title="Toggle theme">
|
|
209
|
+
<span k-if="theme.dark">☀ Light</span>
|
|
210
|
+
<span k-else>🌙 Dark</span>
|
|
211
|
+
</button>
|
|
212
|
+
</header>
|
|
213
|
+
|
|
214
|
+
<div k-if="sessionWarning" class="session-warning-banner" role="alert">
|
|
215
|
+
<span>Your session will expire in {remainingMinutes} min due to inactivity.</span>
|
|
216
|
+
<button class="btn sm" @click={extendSession}>Stay Signed In</button>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
<main class="dash-content-area">
|
|
220
|
+
<slot></slot>
|
|
221
|
+
</main>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</view>
|
|
225
|
+
|
|
226
|
+
<style scoped>
|
|
227
|
+
.dash-shell {
|
|
228
|
+
--sidebar-w: 240px;
|
|
229
|
+
--sidebar-w-collapsed: 58px;
|
|
230
|
+
display: grid;
|
|
231
|
+
grid-template-columns: var(--sidebar-w) 1fr;
|
|
232
|
+
min-height: 100vh;
|
|
233
|
+
transition: grid-template-columns .15s ease;
|
|
234
|
+
background: var(--background);
|
|
235
|
+
color: var(--foreground);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.dash-shell.collapsed {
|
|
239
|
+
grid-template-columns: var(--sidebar-w-collapsed) 1fr;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* Sidebar Styling */
|
|
243
|
+
.dash-sidebar {
|
|
244
|
+
position: sticky;
|
|
245
|
+
top: 0;
|
|
246
|
+
height: 100vh;
|
|
247
|
+
display: flex;
|
|
248
|
+
flex-direction: column;
|
|
249
|
+
background: var(--card);
|
|
250
|
+
border-inline-end: 1px solid var(--border);
|
|
251
|
+
overflow: hidden;
|
|
252
|
+
z-index: 40;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.sidebar-brand-box {
|
|
256
|
+
padding: 12px 14px;
|
|
257
|
+
border-bottom: 1px solid var(--border);
|
|
258
|
+
height: 52px;
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.sidebar-brand {
|
|
264
|
+
display: flex;
|
|
265
|
+
align-items: center;
|
|
266
|
+
gap: 10px;
|
|
267
|
+
color: var(--foreground);
|
|
268
|
+
text-decoration: none;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.brand-glyph-sq {
|
|
272
|
+
width: 22px;
|
|
273
|
+
height: 22px;
|
|
274
|
+
border: 1px solid var(--foreground);
|
|
275
|
+
display: flex;
|
|
276
|
+
align-items: center;
|
|
277
|
+
justify-content: center;
|
|
278
|
+
background: var(--background);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.glyph-core {
|
|
282
|
+
width: 8px;
|
|
283
|
+
height: 8px;
|
|
284
|
+
background: var(--foreground);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.brand-copy {
|
|
288
|
+
display: grid;
|
|
289
|
+
line-height: 1.15;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.brand-copy strong {
|
|
293
|
+
font-size: 14px;
|
|
294
|
+
letter-spacing: -0.02em;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.brand-copy small {
|
|
298
|
+
font-size: 11px;
|
|
299
|
+
font-family: var(--mono);
|
|
300
|
+
color: var(--muted);
|
|
301
|
+
text-transform: uppercase;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.sidebar-nav {
|
|
305
|
+
flex: 1;
|
|
306
|
+
overflow-y: auto;
|
|
307
|
+
padding: 12px 10px;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.nav-group {
|
|
311
|
+
margin-bottom: 16px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.group-heading {
|
|
315
|
+
margin: 0 0 4px;
|
|
316
|
+
padding: 4px 8px;
|
|
317
|
+
font-size: 11px;
|
|
318
|
+
font-family: var(--mono);
|
|
319
|
+
font-weight: 800;
|
|
320
|
+
text-transform: uppercase;
|
|
321
|
+
letter-spacing: 0.06em;
|
|
322
|
+
color: var(--foreground);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.nav-list {
|
|
326
|
+
list-style: none;
|
|
327
|
+
margin: 0;
|
|
328
|
+
padding: 0;
|
|
329
|
+
display: grid;
|
|
330
|
+
gap: 2px;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.nav-item {
|
|
334
|
+
display: flex;
|
|
335
|
+
align-items: center;
|
|
336
|
+
gap: 10px;
|
|
337
|
+
height: 36px;
|
|
338
|
+
padding: 0 10px;
|
|
339
|
+
color: var(--foreground);
|
|
340
|
+
text-decoration: none;
|
|
341
|
+
font-family: var(--font);
|
|
342
|
+
font-size: 13.5px;
|
|
343
|
+
font-weight: 600;
|
|
344
|
+
transition: all .12s ease;
|
|
345
|
+
border: 1px solid transparent;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.nav-item:hover {
|
|
349
|
+
background: var(--accent);
|
|
350
|
+
border-color: var(--foreground);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.nav-item.active-link {
|
|
354
|
+
background: var(--primary);
|
|
355
|
+
color: var(--primary-foreground);
|
|
356
|
+
border-color: var(--primary);
|
|
357
|
+
font-weight: 700;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.nav-icon {
|
|
361
|
+
width: 16px;
|
|
362
|
+
height: 16px;
|
|
363
|
+
flex: none;
|
|
364
|
+
fill: none;
|
|
365
|
+
stroke: currentColor;
|
|
366
|
+
stroke-width: 1.8;
|
|
367
|
+
stroke-linecap: round;
|
|
368
|
+
stroke-linejoin: round;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/* User Footer Section */
|
|
372
|
+
.sidebar-footer {
|
|
373
|
+
position: relative;
|
|
374
|
+
padding: 10px;
|
|
375
|
+
border-top: 1px solid var(--border);
|
|
376
|
+
background: var(--card);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.user-profile-button {
|
|
380
|
+
display: flex;
|
|
381
|
+
align-items: center;
|
|
382
|
+
gap: 10px;
|
|
383
|
+
width: 100%;
|
|
384
|
+
height: auto;
|
|
385
|
+
padding: 8px;
|
|
386
|
+
border: 1px solid transparent;
|
|
387
|
+
background: transparent;
|
|
388
|
+
text-align: left;
|
|
389
|
+
color: var(--foreground);
|
|
390
|
+
cursor: pointer;
|
|
391
|
+
transition: all .15s ease;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.user-profile-button:hover {
|
|
395
|
+
background: var(--accent);
|
|
396
|
+
border-color: var(--border);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.user-avatar-initial {
|
|
400
|
+
flex: none;
|
|
401
|
+
display: inline-flex;
|
|
402
|
+
align-items: center;
|
|
403
|
+
justify-content: center;
|
|
404
|
+
width: 28px;
|
|
405
|
+
height: 28px;
|
|
406
|
+
background: var(--primary);
|
|
407
|
+
color: var(--primary-foreground);
|
|
408
|
+
font-family: var(--mono);
|
|
409
|
+
font-size: 12px;
|
|
410
|
+
font-weight: 700;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.user-info-text {
|
|
414
|
+
flex: 1;
|
|
415
|
+
min-width: 0;
|
|
416
|
+
display: grid;
|
|
417
|
+
line-height: 1.2;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.user-info-text strong {
|
|
421
|
+
font-size: 13px;
|
|
422
|
+
overflow: hidden;
|
|
423
|
+
text-overflow: ellipsis;
|
|
424
|
+
white-space: nowrap;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.user-info-text small {
|
|
428
|
+
font-size: 11px;
|
|
429
|
+
color: var(--muted);
|
|
430
|
+
overflow: hidden;
|
|
431
|
+
text-overflow: ellipsis;
|
|
432
|
+
white-space: nowrap;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.user-role-badge {
|
|
436
|
+
flex: none;
|
|
437
|
+
font-size: 10px;
|
|
438
|
+
font-family: var(--mono);
|
|
439
|
+
font-weight: 700;
|
|
440
|
+
text-transform: uppercase;
|
|
441
|
+
padding: 2px 6px;
|
|
442
|
+
background: var(--accent);
|
|
443
|
+
border: 1px solid var(--border);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.user-popup-menu {
|
|
447
|
+
position: absolute;
|
|
448
|
+
left: 10px;
|
|
449
|
+
right: 10px;
|
|
450
|
+
bottom: calc(100% + 4px);
|
|
451
|
+
background: var(--card);
|
|
452
|
+
border: 1px solid var(--border);
|
|
453
|
+
padding: 4px;
|
|
454
|
+
display: grid;
|
|
455
|
+
z-index: 60;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.popup-user-info {
|
|
459
|
+
display: grid;
|
|
460
|
+
padding: 8px 10px;
|
|
461
|
+
border-bottom: 1px solid var(--border);
|
|
462
|
+
margin-bottom: 4px;
|
|
463
|
+
line-height: 1.3;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.popup-user-info strong {
|
|
467
|
+
font-size: 13px;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.popup-user-info span {
|
|
471
|
+
font-size: 11px;
|
|
472
|
+
color: var(--muted);
|
|
473
|
+
font-family: var(--mono);
|
|
474
|
+
overflow: hidden;
|
|
475
|
+
text-overflow: ellipsis;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.popup-item {
|
|
479
|
+
display: flex;
|
|
480
|
+
align-items: center;
|
|
481
|
+
width: 100%;
|
|
482
|
+
height: 32px;
|
|
483
|
+
padding: 0 10px;
|
|
484
|
+
border: 0;
|
|
485
|
+
background: transparent;
|
|
486
|
+
color: var(--foreground);
|
|
487
|
+
text-decoration: none;
|
|
488
|
+
font-size: 13px;
|
|
489
|
+
cursor: pointer;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.popup-item:hover {
|
|
493
|
+
background: var(--accent);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.logout-action {
|
|
497
|
+
color: var(--destructive);
|
|
498
|
+
border-top: 1px solid var(--border);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/* Collapsed State */
|
|
502
|
+
.collapsed .brand-copy,
|
|
503
|
+
.collapsed .group-heading,
|
|
504
|
+
.collapsed .nav-label,
|
|
505
|
+
.collapsed .user-info-text,
|
|
506
|
+
.collapsed .user-role-badge {
|
|
507
|
+
display: none;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.collapsed .sidebar-brand {
|
|
511
|
+
justify-content: center;
|
|
512
|
+
width: 100%;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
.collapsed .nav-item {
|
|
516
|
+
justify-content: center;
|
|
517
|
+
padding: 0;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.collapsed .user-profile-button {
|
|
521
|
+
justify-content: center;
|
|
522
|
+
padding: 6px 0;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.collapsed .user-popup-menu {
|
|
526
|
+
left: 6px;
|
|
527
|
+
width: 200px;
|
|
528
|
+
right: auto;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
/* Topbar & Viewport */
|
|
532
|
+
.dash-viewport {
|
|
533
|
+
min-width: 0;
|
|
534
|
+
display: flex;
|
|
535
|
+
flex-direction: column;
|
|
536
|
+
background: var(--background);
|
|
537
|
+
color: var(--foreground);
|
|
538
|
+
min-height: 100vh;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.dash-topbar {
|
|
542
|
+
position: sticky;
|
|
543
|
+
top: 0;
|
|
544
|
+
z-index: 30;
|
|
545
|
+
display: flex;
|
|
546
|
+
align-items: center;
|
|
547
|
+
gap: 12px;
|
|
548
|
+
height: 52px;
|
|
549
|
+
padding: 0 20px;
|
|
550
|
+
border-bottom: 1px solid var(--border);
|
|
551
|
+
background: var(--background);
|
|
552
|
+
backdrop-filter: blur(8px);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.toggle-sidebar-btn {
|
|
556
|
+
width: 32px;
|
|
557
|
+
height: 32px;
|
|
558
|
+
padding: 0;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.topbar-icon {
|
|
562
|
+
width: 16px;
|
|
563
|
+
height: 16px;
|
|
564
|
+
fill: none;
|
|
565
|
+
stroke: currentColor;
|
|
566
|
+
stroke-width: 1.8;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
.topbar-divider {
|
|
570
|
+
width: 1px;
|
|
571
|
+
height: 18px;
|
|
572
|
+
background: var(--border);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.breadcrumbs {
|
|
576
|
+
display: flex;
|
|
577
|
+
align-items: center;
|
|
578
|
+
gap: 8px;
|
|
579
|
+
font-size: 13px;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.crumb-root {
|
|
583
|
+
color: var(--muted);
|
|
584
|
+
font-family: var(--mono);
|
|
585
|
+
font-size: 12px;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.crumb-sep {
|
|
589
|
+
color: var(--border);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.crumb-current {
|
|
593
|
+
color: var(--foreground);
|
|
594
|
+
font-weight: 600;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.topbar-spacer {
|
|
598
|
+
flex: 1;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.theme-switch-btn {
|
|
602
|
+
height: 30px;
|
|
603
|
+
padding: 0 10px;
|
|
604
|
+
font-size: 11px;
|
|
605
|
+
font-family: var(--mono);
|
|
606
|
+
background: var(--accent);
|
|
607
|
+
border: 1px solid var(--border);
|
|
608
|
+
color: var(--foreground);
|
|
609
|
+
cursor: pointer;
|
|
610
|
+
white-space: nowrap;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
.theme-switch-btn:hover {
|
|
614
|
+
border-color: var(--foreground);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.dash-content-area {
|
|
618
|
+
padding: 28px var(--container-pad, 28px) 64px;
|
|
619
|
+
max-width: calc(var(--container, 1240px) + var(--container-pad, 28px) * 2);
|
|
620
|
+
width: 100%;
|
|
621
|
+
background: var(--background);
|
|
622
|
+
color: var(--foreground);
|
|
623
|
+
flex: 1;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.sr-only {
|
|
627
|
+
position: absolute;
|
|
628
|
+
width: 1px;
|
|
629
|
+
height: 1px;
|
|
630
|
+
padding: 0;
|
|
631
|
+
margin: -1px;
|
|
632
|
+
overflow: hidden;
|
|
633
|
+
clip: rect(0, 0, 0, 0);
|
|
634
|
+
border: 0;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.dash-overlay {
|
|
638
|
+
display: none;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.session-warning-banner {
|
|
642
|
+
display: flex;
|
|
643
|
+
align-items: center;
|
|
644
|
+
justify-content: space-between;
|
|
645
|
+
gap: 12px;
|
|
646
|
+
padding: 10px 24px;
|
|
647
|
+
background: var(--card);
|
|
648
|
+
border-bottom: 1px solid var(--destructive);
|
|
649
|
+
color: var(--destructive);
|
|
650
|
+
font-size: 13px;
|
|
651
|
+
font-weight: 500;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/* Responsive Phone Drawer */
|
|
655
|
+
@media (max-width: 768px) {
|
|
656
|
+
.dash-shell,
|
|
657
|
+
.dash-shell.collapsed {
|
|
658
|
+
grid-template-columns: 1fr;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
.dash-sidebar {
|
|
662
|
+
position: fixed;
|
|
663
|
+
inset-inline-start: 0;
|
|
664
|
+
top: 0;
|
|
665
|
+
bottom: 0;
|
|
666
|
+
width: 260px;
|
|
667
|
+
height: 100%;
|
|
668
|
+
transform: translateX(-100%);
|
|
669
|
+
transition: transform .2s ease;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
[dir="rtl"] .dash-sidebar {
|
|
673
|
+
transform: translateX(100%);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.open .dash-sidebar {
|
|
677
|
+
transform: none;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
.collapsed .brand-copy,
|
|
681
|
+
.collapsed .group-heading,
|
|
682
|
+
.collapsed .nav-label,
|
|
683
|
+
.collapsed .user-info-text,
|
|
684
|
+
.collapsed .user-role-badge {
|
|
685
|
+
display: revert;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.collapsed .sidebar-brand {
|
|
689
|
+
justify-content: flex-start;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.collapsed .nav-item {
|
|
693
|
+
justify-content: flex-start;
|
|
694
|
+
padding: 0 10px;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.collapsed .user-profile-button {
|
|
698
|
+
justify-content: flex-start;
|
|
699
|
+
padding: 8px;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.open .dash-overlay {
|
|
703
|
+
display: block;
|
|
704
|
+
position: fixed;
|
|
705
|
+
inset: 0;
|
|
706
|
+
background: rgba(9, 9, 11, .5);
|
|
707
|
+
z-index: 35;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
.dash-topbar {
|
|
711
|
+
padding: 0 14px;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
.dash-content-area {
|
|
715
|
+
padding: 20px 16px 48px;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
</style>
|