@stacksjs/defaults 0.75.672 → 0.75.683

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 (69) hide show
  1. package/ai/skills/stacks-ai/SKILL.md +7 -2
  2. package/ai/skills/stacks-api/SKILL.md +1 -1
  3. package/ai/skills/stacks-dashboard/SKILL.md +26 -5
  4. package/ai/skills/stacks-deploy/SKILL.md +8 -0
  5. package/ai/skills/stacks-desktop/SKILL.md +31 -0
  6. package/ai/skills/stacks-development/SKILL.md +5 -7
  7. package/ai/skills/stacks-health/SKILL.md +19 -9
  8. package/ai/skills/stacks-native/CATALOG.md +24 -24
  9. package/ai/skills/stacks-newsletter/SKILL.md +10 -4
  10. package/ai/skills/stacks-router/SKILL.md +2 -2
  11. package/ai/skills/stacks-routes/SKILL.md +2 -2
  12. package/ai/skills/stacks-scheduler/SKILL.md +16 -2
  13. package/ai/skills/stacks-security/SKILL.md +24 -0
  14. package/ai/skills/stacks-socials/SKILL.md +17 -1
  15. package/ai/skills/stacks-storage/SKILL.md +34 -15
  16. package/app/Actions/SubscriberEmailAction.ts +26 -10
  17. package/app/Jobs/Inspire.ts +33 -0
  18. package/functions/dashboard-sidebar-order.ts +3 -0
  19. package/ide/vscode/package.json +1 -1
  20. package/package.json +8 -7
  21. package/project/storage/framework/types/request-context.d.ts +3 -0
  22. package/resources/components/Dashboard/Billing/BillingPaymentMethodsPanel.stx +3 -10
  23. package/resources/components/Dashboard/Billing/BillingPlanSummary.stx +3 -10
  24. package/resources/components/Dashboard/Billing/BillingSettings.stx +13 -15
  25. package/resources/components/Dashboard/Billing/BillingTransactionHistory.stx +2 -9
  26. package/resources/components/Dashboard/DashboardSectionLanding.stx +72 -0
  27. package/resources/components/Dashboard/DashboardSectionSidebar.stx +78 -0
  28. package/resources/components/Dashboard/GlobalSearch.stx +3 -1
  29. package/resources/components/Dashboard/Home/DashboardHome.stx +22 -9
  30. package/resources/components/Dashboard/MobileSidebar.stx +1 -1
  31. package/resources/components/Dashboard/Settings/AppearanceSettingsDashboard.stx +37 -92
  32. package/resources/components/Dashboard/Settings/DashboardSettingsFrame.stx +98 -0
  33. package/resources/components/Dashboard/Settings/DashboardThemePicker.stx +213 -0
  34. package/resources/components/Dashboard/Settings/MailSettingsDashboard.stx +162 -167
  35. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +34 -30
  36. package/resources/components/Dashboard/Settings/SoftwareUpdateDashboard.stx +229 -0
  37. package/resources/components/Dashboard/UI/ActivityTable.stx +7 -7
  38. package/resources/components/Dashboard/UI/Button.stx +6 -3
  39. package/resources/components/Dashboard/UI/Card.stx +1 -1
  40. package/resources/components/Dashboard/UI/DashboardNavigationCards.stx +44 -0
  41. package/resources/components/Dashboard/UI/Drawer.stx +1 -1
  42. package/resources/components/Dashboard/UI/Input.stx +1 -0
  43. package/resources/components/Dashboard/UI/Modal.stx +1 -0
  44. package/resources/components/Dashboard/UI/PageHeader.stx +1 -1
  45. package/resources/components/Dashboard/UI/QuickLinks.stx +7 -5
  46. package/resources/components/Dashboard/UI/Select.stx +1 -0
  47. package/resources/components/Dashboard/UI/ServiceHealth.stx +6 -6
  48. package/resources/components/Dashboard/UI/StatsCard.stx +5 -5
  49. package/resources/components/Dashboard/UI/Table.stx +2 -1
  50. package/resources/components/Dashboard/UI/Textarea.stx +1 -0
  51. package/resources/components/Marketing/SubscribeForm.stx +29 -8
  52. package/resources/functions/dashboard/section-landing.ts +201 -0
  53. package/resources/functions/dashboard/section-navigation.ts +95 -0
  54. package/styles/dashboard-theme.css +1017 -0
  55. package/views/dashboard/composables/dashboard-theme-bootstrap.ts +11 -0
  56. package/views/dashboard/composables/dashboard-themes.ts +180 -0
  57. package/views/dashboard/composables/settings-window.ts +116 -0
  58. package/views/dashboard/composables/useAppearance.ts +34 -13
  59. package/views/dashboard/composables/useDashboardThemes.ts +80 -0
  60. package/views/dashboard/composables/useSettingsWindow.ts +23 -0
  61. package/views/dashboard/layouts/default.stx +74 -59
  62. package/views/dashboard/layouts/guest.stx +11 -1
  63. package/views/dashboard/layouts/settings.stx +48 -0
  64. package/views/dashboard/sections/[section].stx +19 -0
  65. package/views/dashboard/settings/appearance.stx +4 -2
  66. package/views/dashboard/settings/billing.stx +3 -4
  67. package/views/dashboard/settings/index.stx +4 -2
  68. package/views/dashboard/settings/mail.stx +3 -3
  69. package/views/dashboard/settings/software-update.stx +9 -0
@@ -191,32 +191,37 @@ void loadFiles()
191
191
  </script>
192
192
 
193
193
  <template>
194
- <div class="flex flex-col gap-6 mx-auto pb-12 pt-6 px-6 max-w-7xl">
195
- <PageHeader
196
- title="Settings"
197
- description="Review and edit project configuration without losing comments or environment bindings"
198
- />
199
-
200
- <div class="grid gap-6 lg:grid-cols-[17rem_minmax(0,1fr)]">
201
- <Card variant="default" padding="none">
202
- <div class="p-4 border-b border-neutral-200/60 dark:border-white/5">
203
- <SearchFilter v-model:searchValue="configQuery" placeholder="Search config" ariaLabel="Search configuration" />
204
- </div>
194
+ <div class="dashboard-settings-stack">
195
+ <div :if="files().length > 0">
196
+ <SettingsGroup header="Project configuration">
197
+ <details class="dashboard-settings-config-picker">
198
+ <summary>
199
+ <span>Configuration file</span>
200
+ <span class="dashboard-settings-config-selection">
201
+ <span :text="selectedFile()?.title"></span>
202
+ <span class="i-f7-chevron-down" aria-hidden="true"></span>
203
+ </span>
204
+ </summary>
205
+ <div class="pt-2 px-2">
206
+ <SearchFilter v-model:searchValue="configQuery" placeholder="Search config" ariaLabel="Search configuration" />
207
+ </div>
205
208
 
206
- <nav class="overflow-y-auto p-2 max-h-[68vh]" aria-label="Configuration files">
207
- <button :for="file in filteredFiles"
208
- type="button"
209
- :class="selected() === file.name ? 'flex items-center gap-3 px-3 py-2.5 w-full text-left text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-500/10 rounded-lg' : 'flex items-center gap-3 px-3 py-2.5 w-full text-left text-neutral-700 dark:text-neutral-300 hover:bg-neutral-100 dark:hover:bg-white/5 rounded-lg'"
210
- @click="requestSelectFile(file.name)"
211
- >
212
- <span class="flex-none h-4 w-4 i-hugeicons-settings-02"></span>
213
- <span class="flex-1 font-medium text-sm truncate">{{ file.title }}</span>
214
- <span class="text-[10px] text-neutral-500 dark:text-neutral-400">{{ file.size < 1024 ? file.size + ' B' : Math.round(file.size / 1024) + ' KB' }}</span>
215
- </button>
216
- </nav>
217
- </Card>
209
+ <nav class="overflow-y-auto p-2 max-h-[68vh]" aria-label="Configuration files">
210
+ <button :for="file in filteredFiles"
211
+ type="button"
212
+ :class="selected() === file.name ? 'flex items-center gap-3 px-3 py-2.5 w-full text-left text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-500/10 rounded-lg' : 'flex items-center gap-3 px-3 py-2.5 w-full text-left text-neutral-700 dark:text-neutral-300 hover:bg-neutral-100 dark:hover:bg-white/5 rounded-lg'"
213
+ @click="requestSelectFile(file.name)"
214
+ >
215
+ <span class="flex-none h-4 w-4 i-hugeicons-settings-02"></span>
216
+ <span class="flex-1 font-medium text-sm truncate">{{ file.title }}</span>
217
+ <span class="text-[10px] text-neutral-500 dark:text-neutral-400">{{ file.size < 1024 ? file.size + ' B' : Math.round(file.size / 1024) + ' KB' }}</span>
218
+ </button>
219
+ </nav>
220
+ </details>
221
+ </SettingsGroup>
222
+ </div>
218
223
 
219
- <Card variant="default" padding="none">
224
+ <SettingsGroup>
220
225
  @if(loading())
221
226
  <div class="flex items-center justify-center min-h-80 text-neutral-500 dark:text-neutral-400">
222
227
  <span class="mr-2 h-5 w-5 animate-spin i-hugeicons-loading-03"></span>
@@ -235,7 +240,7 @@ void loadFiles()
235
240
  <p class="mt-1 text-neutral-500 text-sm dark:text-neutral-400">Add a TypeScript config file under config to manage it here.</p>
236
241
  </div>
237
242
  @elseif(selectedFile())
238
- <div class="flex flex-wrap gap-4 items-center justify-between px-6 py-5 border-b border-neutral-200/60 dark:border-white/5">
243
+ <div class="flex flex-wrap gap-4 items-center justify-between px-4 py-3 border-b border-neutral-200/60 dark:border-white/5">
239
244
  <div>
240
245
  <h2 class="font-semibold text-lg text-neutral-900 dark:text-white">{{ selectedFile()?.title }}</h2>
241
246
  <p class="mt-1 font-mono text-neutral-500 text-xs dark:text-neutral-400">config/{{ selectedFile()?.name }}.ts</p>
@@ -250,18 +255,18 @@ void loadFiles()
250
255
  </div>
251
256
 
252
257
  @if(message())
253
- <div class="mt-5 mx-6 px-4 py-3 text-green-700 text-sm dark:text-green-300 bg-green-50 dark:bg-green-500/10 border border-green-200 rounded-lg dark:border-green-500/20">
258
+ <div class="mt-3 mx-4 px-4 py-3 text-green-700 text-sm dark:text-green-300 bg-green-50 dark:bg-green-500/10 border border-green-200 rounded-lg dark:border-green-500/20">
254
259
  {{ message() }}
255
260
  </div>
256
261
  @endif
257
262
  @if(error())
258
- <div class="mt-5 mx-6 px-4 py-3 text-red-700 text-sm dark:text-red-300 bg-red-50 dark:bg-red-500/10 border border-red-200 rounded-lg dark:border-red-500/20">
263
+ <div class="mt-3 mx-4 px-4 py-3 text-red-700 text-sm dark:text-red-300 bg-red-50 dark:bg-red-500/10 border border-red-200 rounded-lg dark:border-red-500/20">
259
264
  {{ error() }}
260
265
  </div>
261
266
  @endif
262
267
 
263
268
  <form class="divide-neutral-200/60 divide-y dark:divide-white/5" @submit.prevent="save()">
264
- <div :for="field in fields" class="grid gap-3 sm:grid-cols-[minmax(10rem,0.8fr)_minmax(0,1.2fr)] sm:items-start px-6 py-5">
269
+ <div :for="field in fields" class="grid gap-3 sm:grid-cols-[minmax(10rem,0.8fr)_minmax(0,1.2fr)] sm:items-start px-4 py-3">
265
270
  <div>
266
271
  <label :for="'config-' + field.key" class="font-medium text-neutral-900 text-sm dark:text-white">{{ field.key }}</label>
267
272
  <p class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">{{ field.type }}</p>
@@ -299,8 +304,7 @@ void loadFiles()
299
304
  </div>
300
305
  </form>
301
306
  @endif
302
- </Card>
303
- </div>
307
+ </SettingsGroup>
304
308
 
305
309
  <ConfirmDialog
306
310
  :isOpen="Boolean(pendingSelection())"
@@ -0,0 +1,229 @@
1
+ <script server>
2
+ import { dashboardProjectIdentity } from '@stacksjs/defaults/resources/functions/dashboard/project-switcher'
3
+
4
+ export const localUpdates = dashboardProjectIdentity().enabled
5
+ defineClientPayload({ localUpdates })
6
+ </script>
7
+
8
+ <script client>
9
+ import { dashboardApi, DashboardApiError } from '@stacksjs/defaults/functions/dashboard-api'
10
+
11
+ interface UpdateProject {
12
+ id: string
13
+ name: string
14
+ current: boolean
15
+ installed: string | null
16
+ latest: string | null
17
+ available: boolean
18
+ supported: boolean
19
+ }
20
+
21
+ type RestartStatus = 'queued' | 'restarting' | 'complete' | 'failed' | 'interrupted'
22
+
23
+ interface UpdateReport {
24
+ id: string
25
+ running: boolean
26
+ restarting?: boolean
27
+ restartAvailable?: boolean
28
+ projects: Array<{ id: string, name: string, version: string, restartStatus?: RestartStatus, restartMessage?: string, status: 'queued' | 'updating' | 'complete' | 'failed' | 'interrupted', message?: string }>
29
+ logFile: string
30
+ }
31
+
32
+ interface UpdateStatus {
33
+ checked: boolean
34
+ projects: UpdateProject[]
35
+ update: UpdateReport | null
36
+ }
37
+
38
+ const endpoint = '/__buddy/software-update'
39
+ const enabled = {{ localUpdates }}
40
+ const snapshot = state<UpdateStatus | null>(null)
41
+ const selection = state<string[]>([])
42
+ const checking = state(false)
43
+ const starting = state(false)
44
+ const requestingRestart = state(false)
45
+ const failure = state('')
46
+ const report = derived(() => snapshot()?.update ?? null)
47
+ const running = derived(() => Boolean(report()?.running))
48
+ const restarting = derived(() => Boolean(report()?.restarting))
49
+ const busy = derived(() => checking() || starting() || requestingRestart() || running())
50
+ const projects = derived(() => snapshot()?.projects ?? [])
51
+ const current = derived(() => projects().find(project => project.current))
52
+ const selectedProjects = derived(() => projects().filter(project => project.available && selection().includes(project.id)))
53
+ const availableCount = derived(() => projects().filter(project => project.available).length)
54
+
55
+ const restartAvailable = derived(() => report()?.restartAvailable === true)
56
+ const updatesInstalled = derived(() => report()?.projects.some(project => project.status === 'complete') === true)
57
+ const projectsRestarted = derived(() => report()?.projects.some(project => project.restartStatus === 'complete') === true)
58
+ const restartFailed = derived(() => report()?.projects.some(project => project.restartStatus === 'failed' || project.restartStatus === 'interrupted') === true)
59
+ const reportHasErrors = derived(() => report()?.projects.some(project => project.status === 'failed' || project.status === 'interrupted') === true)
60
+ const reportProjects = derived(() => report()?.projects ?? [])
61
+ const statuses = { queued: 'Waiting', updating: 'Updating…', complete: 'Updated', failed: 'Failed', interrupted: 'Interrupted' }
62
+ const restartStatuses = { queued: 'Waiting', restarting: 'Restarting…', complete: 'Restarted', failed: 'Restart failed', interrupted: 'Restart interrupted' }
63
+
64
+ function statusLabel(project: UpdateReport['projects'][number]): string {
65
+ return project.restartStatus ? restartStatuses[project.restartStatus] : statuses[project.status]
66
+ }
67
+
68
+ let initialized = false
69
+
70
+ async function refresh(check = false): Promise<void> {
71
+ const next = await dashboardApi<UpdateStatus>(endpoint + (check ? '?check=1' : ''))
72
+ snapshot.set(next)
73
+ if (!initialized) {
74
+ selection.set(next.projects.filter(project => project.current && project.available).map(project => project.id))
75
+ initialized = true
76
+ }
77
+ }
78
+
79
+ async function checkUpdates(): Promise<void> {
80
+ checking.set(true)
81
+ failure.set('')
82
+ try {
83
+ await refresh(true)
84
+ }
85
+ catch (error) {
86
+ failure.set(error instanceof Error ? error.message : 'Could not check for updates.')
87
+ }
88
+ finally {
89
+ checking.set(false)
90
+ }
91
+ }
92
+
93
+ async function pollUpdate(): Promise<void> {
94
+ if (!running() || checking() || starting() || requestingRestart())
95
+ return
96
+ try {
97
+ await refresh()
98
+ }
99
+ catch {
100
+ // The Buddy worker continues while a dashboard restarts or reconnects.
101
+ }
102
+ }
103
+
104
+ function selectProject(id: string, checked: boolean): void {
105
+ const next = selection().filter(project => project !== id)
106
+ selection.set(checked ? [...next, id] : next)
107
+ }
108
+
109
+ async function installUpdates(): Promise<void> {
110
+ const ids = selectedProjects().map(project => project.id)
111
+ if (!ids.length || busy())
112
+ return
113
+ starting.set(true)
114
+ failure.set('')
115
+ try {
116
+ const result = await dashboardApi<{ update: UpdateReport }>(endpoint + '/install', { method: 'POST', body: { projects: ids } })
117
+ const previous = snapshot()
118
+ if (previous)
119
+ snapshot.set({ ...previous, update: result.update })
120
+ }
121
+ catch (error) {
122
+ failure.set(error instanceof Error ? error.message : 'Buddy could not start the update.')
123
+ }
124
+ finally {
125
+ starting.set(false)
126
+ }
127
+ }
128
+
129
+ async function restartProjects(): Promise<void> {
130
+ const previous = snapshot()
131
+ const update = previous?.update
132
+ if (!update || !restartAvailable() || busy())
133
+ return
134
+ requestingRestart.set(true)
135
+ failure.set('')
136
+ try {
137
+ const result = await dashboardApi<{ update: UpdateReport }>(endpoint + '/restart', { method: 'POST', body: { updateId: update.id } })
138
+ snapshot.set({ ...previous, update: result.update })
139
+ }
140
+ catch (error) {
141
+ if (error instanceof DashboardApiError) {
142
+ failure.set(error.message)
143
+ }
144
+ else {
145
+ // Buddy can accept the restart just before this connection goes down.
146
+ // Keep polling until the dashboard can report what happened.
147
+ snapshot.set({ ...previous, update: { ...update, running: true, restarting: true } })
148
+ }
149
+ }
150
+ finally {
151
+ requestingRestart.set(false)
152
+ }
153
+ }
154
+
155
+ function projectDescription(project: UpdateProject): string {
156
+ const installed = project.installed ? `Stacks ${project.installed}` : 'Installed version unavailable'
157
+ if (project.available)
158
+ return project.installed === project.latest ? `${installed} · Retry available` : `${installed} → ${project.latest}`
159
+ if (!project.supported)
160
+ return `${installed} · Buddy could not identify a Stacks installation`
161
+ if (!project.latest)
162
+ return `${installed} · Release check unavailable`
163
+ return project.installed === project.latest
164
+ ? `${installed} · Up to date`
165
+ : `${installed} · Latest stable is ${project.latest}`
166
+ }
167
+
168
+ useInterval(() => { void pollUpdate() }, 1800)
169
+ onMount(() => {
170
+ if (enabled)
171
+ void checkUpdates()
172
+ })
173
+ </script>
174
+
175
+ <div class="dashboard-settings-stack">
176
+ @if(!localUpdates)
177
+ <SettingsGroup>
178
+ <SettingsRow label="Software Update is available in your local dashboard" description="Open this project through Buddy to check for and install updates." multiline />
179
+ </SettingsGroup>
180
+ @else
181
+ <SettingsGroup header="Stacks Framework">
182
+ <SettingsRow label="Latest stable release" description="Buddy updates Stacks, installs the project’s framework dependencies, and runs its upgrade hooks." setting="check-for-updates" multiline>
183
+ <Button variant="secondary" size="sm" :loading="checking()" :disabled="busy()" @click="checkUpdates()">Check for Updates</Button>
184
+ </SettingsRow>
185
+ <SettingsRow label="Installed version" setting="installed-framework">
186
+ <span :text="current()?.installed || 'Unavailable'"></span>
187
+ </SettingsRow>
188
+ <SettingsRow label="Available version" setting="available-framework">
189
+ <span :text="checking() ? 'Checking…' : current()?.latest || 'Unavailable'"></span>
190
+ </SettingsRow>
191
+ </SettingsGroup>
192
+
193
+ <p :if="failure()" class="px-3 text-red-700 text-sm dark:text-red-300" role="alert" :text="failure()"></p>
194
+
195
+ <div :if="projects().length > 0">
196
+ <SettingsGroup header="Projects" footer="Your current project runs first when selected. Select any other registered projects to update their Stacks installations too.">
197
+ <div :for="project in projects()" :key="project.id" class="dashboard-settings-section-toggle">
198
+ <SettingsRow :label="project.current ? project.name + ' (Current project)' : project.name" :description="projectDescription(project)" multiline>
199
+ <Switch :if="project.available" :checked="selection().includes(project.id)" :disabled="busy()" :label="'Update ' + project.name" variant="mac" @change="selectProject(project.id, $event)" />
200
+ </SettingsRow>
201
+ </div>
202
+ <SettingsRow :if="availableCount() > 0" label="Install updates" setting="install-updates">
203
+ <Button size="sm" :loading="starting()" :disabled="busy() || selectedProjects().length === 0" @click="installUpdates()">Update Now</Button>
204
+ </SettingsRow>
205
+ </SettingsGroup>
206
+ </div>
207
+
208
+ <div :if="report()">
209
+ <SettingsGroup header="Update progress">
210
+ <div :for="project in reportProjects()" :key="project.id" class="dashboard-settings-section-toggle">
211
+ <SettingsRow :label="project.name" :description="project.restartMessage || project.message || 'Stacks ' + project.version" multiline>
212
+ <span :text="statusLabel(project)"></span>
213
+ </SettingsRow>
214
+ </div>
215
+ <p :if="running() && !restarting()" class="p-3 text-neutral-600 text-xs dark:text-neutral-300" role="status">Buddy is installing updates. You can close this window.</p>
216
+ <div :if="restartAvailable() || restarting()" class="dashboard-settings-section-toggle">
217
+ <SettingsRow label="Restart required" description="Restart the running app services and dashboards to load the new framework." setting="restart-updated-projects">
218
+ <Button size="sm" class="whitespace-nowrap" :loading="requestingRestart() || restarting()" :disabled="busy()" @click="restartProjects()">
219
+ {{ restarting() ? 'Restarting…' : 'Restart Now' }}
220
+ </Button>
221
+ </SettingsRow>
222
+ </div>
223
+ <p :if="!running() && !restartAvailable() && updatesInstalled() && !projectsRestarted() && !restartFailed()" class="p-3 text-neutral-600 text-xs dark:text-neutral-300" role="status">The updated framework will load the next time these projects start.</p>
224
+ <p :if="!running() && projectsRestarted() && !restartFailed()" class="p-3 text-neutral-600 text-xs dark:text-neutral-300" role="status">The updated projects restarted.</p>
225
+ <p :if="reportHasErrors() || restartFailed()" class="p-3 break-all text-red-700 text-xs dark:text-red-300" role="alert">Buddy log <code :text="report()?.logFile"></code></p>
226
+ </SettingsGroup>
227
+ </div>
228
+ @endif
229
+ </div>
@@ -34,11 +34,11 @@ function statusIcon(status: string): string {
34
34
  }
35
35
  </script>
36
36
 
37
- <section class="bg-white dark:bg-neutral-800/90 border border-black/5 rounded-xl dark:border-white/5">
37
+ <section data-dashboard-card="default" class="bg-white dark:bg-neutral-800/90 border border-black/5 rounded-xl dark:border-white/5">
38
38
  <header class="flex items-center justify-between p-5 border-b border-neutral-200/60 dark:border-white/5">
39
39
  <div>
40
- <h2 class="font-semibold text-[14px] text-neutral-900 tracking-tight dark:text-white">{{ title() }}</h2>
41
- <p class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">{{ description() }}</p>
40
+ <h2 data-dashboard-ink class="font-semibold text-[14px] text-neutral-900 tracking-tight dark:text-white">{{ title() }}</h2>
41
+ <p data-dashboard-muted class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">{{ description() }}</p>
42
42
  </div>
43
43
  <slot name="actions" />
44
44
  </header>
@@ -59,8 +59,8 @@ function statusIcon(status: string): string {
59
59
  <span :class="'h-4 w-4 ' + statusIcon(activity.status)" aria-hidden="true"></span>
60
60
  </div>
61
61
  <div class="flex-1 min-w-0">
62
- <p class="font-medium text-neutral-900 text-sm truncate dark:text-white">{{ activity.title }}</p>
63
- <p class="text-neutral-500 text-xs dark:text-neutral-400">
62
+ <p data-dashboard-ink class="font-medium text-neutral-900 text-sm truncate dark:text-white">{{ activity.title }}</p>
63
+ <p data-dashboard-muted class="text-neutral-500 text-xs dark:text-neutral-400">
64
64
  <span :if="activity.source">{{ activity.source }} · </span>{{ activity.time }}
65
65
  </p>
66
66
  </div>
@@ -70,7 +70,7 @@ function statusIcon(status: string): string {
70
70
 
71
71
  <div :if="!loading() && activities().length === 0" class="py-12 text-center">
72
72
  <span aria-hidden="true" class="inline-block h-7 w-7 text-neutral-300 dark:text-neutral-600 i-hugeicons-activity-01"></span>
73
- <p class="mt-2 font-medium text-neutral-900 text-sm dark:text-white">No recent activity</p>
74
- <p class="mt-1 text-[12px] text-neutral-500 dark:text-neutral-400">Persisted activity will appear here.</p>
73
+ <p data-dashboard-ink class="mt-2 font-medium text-neutral-900 text-sm dark:text-white">No recent activity</p>
74
+ <p data-dashboard-muted class="mt-1 text-[12px] text-neutral-500 dark:text-neutral-400">Persisted activity will appear here.</p>
75
75
  </div>
76
76
  </section>
@@ -116,7 +116,8 @@ const liveAriaExpanded = useReactiveProp('ariaExpanded', '')
116
116
  :aria-label="liveAriaLabel() || undefined"
117
117
  :title="hoverTitle()"
118
118
  class="{{ buttonClass }}"
119
- :class="variantToggles()"
119
+ :class="variantToggles()"
120
+ :data-dashboard-button="liveVariant()"
120
121
  :target="liveTarget() || undefined"
121
122
  :rel="liveRel() || undefined"
122
123
  :aria-busy="liveLoading() ? 'true' : 'false'"
@@ -134,7 +135,8 @@ const liveAriaExpanded = useReactiveProp('ariaExpanded', '')
134
135
  :type="liveType()"
135
136
  :form="liveForm() || undefined"
136
137
  class="{{ buttonClass }}"
137
- :class="variantToggles()"
138
+ :class="variantToggles()"
139
+ :data-dashboard-button="liveVariant()"
138
140
  :aria-label="liveAriaLabel() || undefined"
139
141
  :title="hoverTitle()"
140
142
  :aria-busy="liveLoading() ? 'true' : 'false'"
@@ -151,7 +153,8 @@ const liveAriaExpanded = useReactiveProp('ariaExpanded', '')
151
153
  :type="liveType()"
152
154
  :form="liveForm() || undefined"
153
155
  class="{{ buttonClass }}"
154
- :class="variantToggles()"
156
+ :class="variantToggles()"
157
+ :data-dashboard-button="liveVariant()"
155
158
  :aria-label="liveAriaLabel() || undefined"
156
159
  :title="hoverTitle()"
157
160
  :aria-haspopup="liveAriaHasPopup() || undefined"
@@ -63,7 +63,7 @@ const cardClass = [
63
63
  const liveSubtitle = useReactiveProp('subtitle', '')
64
64
  </script>
65
65
 
66
- <article class="{{ cardClass }}" @if(clickable) role="button" tabindex="0" @endif>
66
+ <article data-dashboard-card="{{ variant }}" class="{{ cardClass }}" @if(clickable) role="button" tabindex="0" @endif>
67
67
  @if($slots.header)
68
68
  <header class="px-5 py-4 border-b border-stone-200/80 dark:border-white/5">
69
69
  <slot name="header" />
@@ -0,0 +1,44 @@
1
+ <script server>
2
+ import type { DashboardNavigationCard } from '@stacksjs/defaults/resources/functions/dashboard/section-navigation'
3
+
4
+ const { navigationCards = [], emptyLabel = '' } = defineProps<{
5
+ navigationCards: DashboardNavigationCard[]
6
+ emptyLabel?: string
7
+ }>()
8
+ defineClientPayload({ navigationCards, emptyLabel })
9
+ </script>
10
+
11
+ <script client>
12
+ import { canSeeDashboardCard } from '@stacksjs/defaults/resources/functions/dashboard/section-navigation'
13
+ import { authStore } from '@stacksjs/defaults/views/dashboard/stores/auth'
14
+
15
+ const cards = {{ navigationCards }}
16
+ const emptyMessage = {{ emptyLabel }}
17
+ const visibleCards = derived(() => {
18
+ const roles = authStore.roles()
19
+ const localViewer = authStore.unauthenticated()
20
+ return cards.filter(card => canSeeDashboardCard(card, roles, localViewer))
21
+ })
22
+ </script>
23
+
24
+ <div class="grid gap-3 sm:grid-cols-2 lg:grid-cols-3" data-dashboard-navigation-cards>
25
+ <a
26
+ data-stx-link
27
+ :for="card in visibleCards()"
28
+ :href="card.href"
29
+ :data-section-id="card.section"
30
+ data-dashboard-card="default"
31
+ data-dashboard-navigation-card
32
+ class="flex overflow-hidden relative gap-3 items-start p-4 min-w-0 no-underline bg-white dark:bg-neutral-900 border border-neutral-200 rounded-xl dark:border-neutral-800"
33
+ >
34
+ <span class="dashboard-section-icon" aria-hidden="true">
35
+ <span :class="card.icon"></span>
36
+ </span>
37
+ <span class="flex flex-1 flex-col gap-1 min-w-0">
38
+ <span data-dashboard-ink class="font-semibold text-neutral-900 text-sm dark:text-white" :text="card.label"></span>
39
+ <span data-dashboard-muted :if="card.description" class="text-neutral-600 text-xs dark:text-neutral-400" :text="card.description"></span>
40
+ </span>
41
+ <span aria-hidden="true" class="shrink-0 h-4 w-4 i-f7-chevron-right" data-dashboard-muted></span>
42
+ </a>
43
+ </div>
44
+ <p :if="emptyMessage && !authStore.loading() && visibleCards().length === 0" class="text-neutral-600 text-sm dark:text-neutral-400" :text="emptyMessage"></p>
@@ -81,7 +81,7 @@ effect(() => {
81
81
  @cancel="handleCancel"
82
82
  >
83
83
  <div class="flex justify-end min-h-full" @click="handleBackdropClick">
84
- <section class="flex relative flex-col h-dvh w-full bg-white dark:bg-neutral-950 border-neutral-200 border-l dark:border-neutral-800 shadow-2xl {{ sizeClasses[size] }}" @click.stop>
84
+ <section data-dashboard-overlay="drawer" class="flex relative flex-col h-dvh w-full bg-white dark:bg-neutral-950 border-neutral-200 border-l dark:border-neutral-800 shadow-2xl {{ sizeClasses[size] }}" @click.stop>
85
85
  <header class="flex gap-4 items-start px-5 py-4 border-b border-neutral-200 dark:border-neutral-800">
86
86
  <slot name="header-leading" />
87
87
  <div class="flex-1 min-w-0">
@@ -115,6 +115,7 @@ function handleKeydown(event: KeyboardEvent): void {
115
115
  </div>
116
116
  @endif
117
117
  <input
118
+ data-dashboard-field
118
119
  :id="inputId()"
119
120
  :type="liveType()"
120
121
  x-model="liveValue"
@@ -117,6 +117,7 @@ effect(() => {
117
117
  <!-- Modal container -->
118
118
  <div class="flex min-h-full {{ positionClasses[position] }}" @click="handleBackdropClick">
119
119
  <div
120
+ data-dashboard-overlay="modal"
120
121
  class="relative w-full rounded-xl bg-white dark:bg-neutral-900 shadow-2xl {{ sizeClasses[size] }} {{ panelClassName }}"
121
122
  >
122
123
  <!-- Header -->
@@ -19,7 +19,7 @@ const title = useReactiveProp('title', '')
19
19
  const description = useReactiveProp('description', '')
20
20
  </script>
21
21
 
22
- <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
22
+ <header data-dashboard-page-heading class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
23
23
  <div>
24
24
  <h1 class="font-bold text-2xl text-gray-900 dark:text-white">{{ title() }}</h1>
25
25
  <p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">{{ description() }}</p>
@@ -33,10 +33,11 @@ function toneClass(link: QuickLink): string {
33
33
  </script>
34
34
 
35
35
  <section :class="customClass()">
36
- <h2 class="mb-4 font-semibold text-base text-neutral-900 dark:text-white">{{ title() }}</h2>
36
+ <h2 data-dashboard-ink class="mb-4 font-semibold text-base text-neutral-900 dark:text-white">{{ title() }}</h2>
37
37
  <div class="grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-4">
38
38
  <div :for="link in validLinks()" class="contents">
39
39
  <a
40
+ data-dashboard-card="default"
40
41
  :if="isExternal(link.href)"
41
42
  :href="link.href"
42
43
  target="_blank"
@@ -48,12 +49,13 @@ function toneClass(link: QuickLink): string {
48
49
  <span :class="iconClass(link)" aria-hidden="true"></span>
49
50
  </div>
50
51
  <div class="flex-1 min-w-0">
51
- <p class="font-medium text-neutral-900 text-sm dark:text-white">{{ link.title }}</p>
52
- <p :if="link.description" class="mt-0.5 text-neutral-500 text-xs truncate dark:text-neutral-400">{{ link.description }}</p>
52
+ <p data-dashboard-ink class="font-medium text-neutral-900 text-sm dark:text-white">{{ link.title }}</p>
53
+ <p data-dashboard-muted :if="link.description" class="mt-0.5 text-neutral-500 text-xs truncate dark:text-neutral-400">{{ link.description }}</p>
53
54
  </div>
54
55
  </div>
55
56
  </a>
56
57
  <StxLink
58
+ data-dashboard-card="default"
57
59
  :else
58
60
  :to="link.href"
59
61
  class="block p-5 no-underline bg-white dark:bg-neutral-800 border border-neutral-200 rounded-xl dark:border-neutral-700 hover:shadow-md transition-shadow"
@@ -63,8 +65,8 @@ function toneClass(link: QuickLink): string {
63
65
  <span :class="iconClass(link)" aria-hidden="true"></span>
64
66
  </div>
65
67
  <div class="flex-1 min-w-0">
66
- <p class="font-medium text-neutral-900 text-sm dark:text-white">{{ link.title }}</p>
67
- <p :if="link.description" class="mt-0.5 text-neutral-500 text-xs truncate dark:text-neutral-400">{{ link.description }}</p>
68
+ <p data-dashboard-ink class="font-medium text-neutral-900 text-sm dark:text-white">{{ link.title }}</p>
69
+ <p data-dashboard-muted :if="link.description" class="mt-0.5 text-neutral-500 text-xs truncate dark:text-neutral-400">{{ link.description }}</p>
68
70
  </div>
69
71
  </div>
70
72
  </StxLink>
@@ -83,6 +83,7 @@ function handleChange(event: Event): void {
83
83
  <div class="relative">
84
84
  <select
85
85
  data-ui-select
86
+ data-dashboard-field
86
87
  :id="selectId()"
87
88
  :name="liveName() || null"
88
89
  :aria-label="liveAriaLabel() || liveLabel() || null"
@@ -21,11 +21,11 @@ function statusClass(status: string): string {
21
21
  }
22
22
  </script>
23
23
 
24
- <section class="bg-white dark:bg-neutral-800/90 border border-black/5 rounded-xl dark:border-white/5">
24
+ <section data-dashboard-card="default" class="bg-white dark:bg-neutral-800/90 border border-black/5 rounded-xl dark:border-white/5">
25
25
  <header class="flex items-center justify-between p-5 border-b border-neutral-200/60 dark:border-white/5">
26
26
  <div>
27
- <h2 class="font-semibold text-[14px] text-neutral-900 tracking-tight dark:text-white">System health</h2>
28
- <p class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">Native application health probes.</p>
27
+ <h2 data-dashboard-ink class="font-semibold text-[14px] text-neutral-900 tracking-tight dark:text-white">System health</h2>
28
+ <p data-dashboard-muted class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">Native application health probes.</p>
29
29
  </div>
30
30
  <Badge :if="allHealthy()" variant="success" size="xs" dot>All systems operational</Badge>
31
31
  <Badge :if="!loading() && services().length > 0 && !allHealthy()" variant="warning" size="xs" dot>Attention required</Badge>
@@ -42,8 +42,8 @@ function statusClass(status: string): string {
42
42
  <article :for="service in services()" class="px-5 py-3.5">
43
43
  <div class="flex gap-4 items-center justify-between">
44
44
  <div>
45
- <p class="font-medium text-[13px] text-neutral-900 dark:text-white">{{ service.name }}</p>
46
- <p class="mt-0.5 text-[12px] text-neutral-500 dark:text-neutral-400">{{ service.latency }}</p>
45
+ <p data-dashboard-ink class="font-medium text-[13px] text-neutral-900 dark:text-white">{{ service.name }}</p>
46
+ <p data-dashboard-muted class="mt-0.5 text-[12px] text-neutral-500 dark:text-neutral-400">{{ service.latency }}</p>
47
47
  </div>
48
48
  <span :class="'px-2 py-0.5 font-medium text-[11px] rounded-full capitalize ' + statusClass(service.status)">
49
49
  {{ service.status }}
@@ -55,6 +55,6 @@ function statusClass(status: string): string {
55
55
 
56
56
  <div :if="!loading() && services().length === 0" class="px-5 py-12 text-center">
57
57
  <span aria-hidden="true" class="inline-block h-7 w-7 text-neutral-300 dark:text-neutral-600 i-hugeicons-health"></span>
58
- <p class="mt-2 text-neutral-500 text-sm dark:text-neutral-400">No health checks were returned.</p>
58
+ <p data-dashboard-muted class="mt-2 text-neutral-500 text-sm dark:text-neutral-400">No health checks were returned.</p>
59
59
  </div>
60
60
  </section>
@@ -39,17 +39,17 @@ const iconBackgroundClass = derived(() => iconBgClasses[liveIconBg() || 'primary
39
39
  const trendDirection = derived(() => liveTrend() === null || liveTrend() === 0 ? 'neutral' : (Number(liveTrend()) > 0 ? 'up' : 'down'))
40
40
  const trendClass = derived(() => trendClasses[trendDirection()])
41
41
  </script>
42
- <div class="p-3 sm:p-5 bg-white dark:bg-neutral-800/90 border border-black/5 rounded-xl dark:border-white/5 hover:shadow-black/5 hover:shadow-md dark:hover:shadow-black/20 duration-150 transition-all">
42
+ <div data-dashboard-card="default" class="p-3 sm:p-5 bg-white dark:bg-neutral-800/90 border border-black/5 rounded-xl dark:border-white/5 hover:shadow-black/5 hover:shadow-md dark:hover:shadow-black/20 duration-150 transition-all">
43
43
  <div class="flex gap-2 items-start justify-between">
44
44
  <div class="flex-1 min-w-0">
45
- <p class="font-medium leading-snug text-[13px] text-neutral-500 tracking-tight dark:text-neutral-400">
45
+ <p data-dashboard-muted class="font-medium leading-snug text-[13px] text-neutral-500 tracking-tight dark:text-neutral-400">
46
46
  {{ liveTitle() }}
47
47
  </p>
48
48
 
49
49
  <div class="flex gap-2 items-baseline mt-1.5">
50
50
  <div :if="liveLoading()" class="h-7 w-20 bg-black/5 dark:bg-white/10 rounded-md animate-pulse"></div>
51
51
  <div :else class="flex gap-2 items-baseline">
52
- <p class="font-semibold text-[22px] text-neutral-900 tracking-tight dark:text-white">
52
+ <p data-dashboard-ink class="font-semibold text-[22px] text-neutral-900 tracking-tight dark:text-white">
53
53
  @if($slots.value)
54
54
  <slot name="value" />
55
55
  @else
@@ -70,11 +70,11 @@ const trendClass = derived(() => trendClasses[trendDirection()])
70
70
  </div>
71
71
 
72
72
  @if($slots.subtitle)
73
- <p class="mt-1 text-[12px] text-neutral-500 dark:text-neutral-400">
73
+ <p data-dashboard-muted class="mt-1 text-[12px] text-neutral-500 dark:text-neutral-400">
74
74
  <slot name="subtitle" />
75
75
  </p>
76
76
  @else
77
- <p :if="supportText()" class="mt-1 text-[12px] text-neutral-500 dark:text-neutral-400">
77
+ <p data-dashboard-muted :if="supportText()" class="mt-1 text-[12px] text-neutral-500 dark:text-neutral-400">
78
78
  {{ supportText() }}
79
79
  </p>
80
80
  @endif
@@ -772,7 +772,7 @@ function cellClass(column: DashboardTableColumn, index: number): string {
772
772
  }
773
773
  </script>
774
774
 
775
- <div class="overflow-hidden relative bg-white dark:bg-neutral-900" :class="framed() ? 'border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm' : ''">
775
+ <div data-dashboard-table :data-dashboard-framed="String(framed())" class="overflow-hidden relative bg-white dark:bg-neutral-900" :class="framed() ? 'border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm' : ''">
776
776
  <div :if="loading()" class="flex absolute inset-0 z-30 items-center justify-center bg-white/80 dark:bg-neutral-900/80 backdrop-blur-sm" role="status">
777
777
  <span aria-hidden="true" class="mr-2 h-5 w-5 text-blue-500 animate-spin i-hugeicons-loading-03"></span>
778
778
  <span class="text-neutral-500 text-sm dark:text-neutral-400">Loading</span>
@@ -792,6 +792,7 @@ function cellClass(column: DashboardTableColumn, index: number): string {
792
792
  <div :if="searchable()" class="relative">
793
793
  <span aria-hidden="true" class="absolute left-2.5 top-1/2 h-4 w-4 text-neutral-400 -translate-y-1/2 i-hugeicons-search-01"></span>
794
794
  <input
795
+ data-dashboard-field
795
796
  type="search"
796
797
  :placeholder="searchPlaceholder()"
797
798
  :aria-label="searchPlaceholder()"