@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
@@ -0,0 +1,213 @@
1
+ <script client>
2
+ import type { DashboardTheme } from '@stacksjs/defaults/views/dashboard/composables/dashboard-themes'
3
+ import {
4
+ BUNDLED_DASHBOARD_THEMES,
5
+ dashboardThemeColor,
6
+ MAX_THEME_FILE_SIZE,
7
+ ORIGINAL_DASHBOARD_THEME,
8
+ SYSTEM_CLEANER_THEME,
9
+ } from '@stacksjs/defaults/views/dashboard/composables/dashboard-themes'
10
+ import { useDashboardThemes } from '@stacksjs/defaults/views/dashboard/composables/useDashboardThemes'
11
+
12
+ const themes = useDashboardThemes()
13
+ const active = themes.active
14
+ const installed = themes.installed
15
+ const themeFile = useRef('dashboardThemeFile')
16
+ const feedback = state('')
17
+ const failure = state('')
18
+
19
+ const themesToShow = derived(() => [
20
+ {
21
+ id: ORIGINAL_DASHBOARD_THEME,
22
+ name: 'The Original',
23
+ description: 'The classic Stacks dashboard with your choice of sidebar style.',
24
+ preview: '',
25
+ overview: 'panel',
26
+ },
27
+ ...[...BUNDLED_DASHBOARD_THEMES, ...installed()].map(theme => ({
28
+ id: theme.id,
29
+ name: theme.name,
30
+ description: theme.description ?? '',
31
+ preview: previewStyle(theme),
32
+ overview: theme.overview,
33
+ })),
34
+ ])
35
+
36
+ const selectedInstallation = derived(() => installed().find(theme => theme.id === active()))
37
+ const downloadable = derived(() => selectedInstallation() || {
38
+ ...SYSTEM_CLEANER_THEME,
39
+ id: 'my-dashboard',
40
+ name: 'My Dashboard',
41
+ })
42
+
43
+ function previewStyle(theme: DashboardTheme): string {
44
+ return [
45
+ `--preview-window:${dashboardThemeColor(theme, 'window')}`,
46
+ `--preview-canvas:${dashboardThemeColor(theme, 'canvas')}`,
47
+ `--preview-surface:${dashboardThemeColor(theme, 'surface')}`,
48
+ `--preview-accent:${dashboardThemeColor(theme, 'accentFill')}`,
49
+ `--preview-hero-start:${dashboardThemeColor(theme, 'heroStart')}`,
50
+ `--preview-hero-end:${dashboardThemeColor(theme, 'heroEnd')}`,
51
+ `--preview-gap:${theme.layout === 'inset' ? '4px' : '0'}`,
52
+ ].join(';')
53
+ }
54
+
55
+ function downloadHref(): string {
56
+ return `data:application/json;charset=utf-8,${encodeURIComponent(JSON.stringify(downloadable(), null, 2))}`
57
+ }
58
+
59
+ function selectTheme(id: string): void {
60
+ feedback.set('')
61
+ failure.set('')
62
+ try {
63
+ themes.select(id)
64
+ }
65
+ catch (error) {
66
+ failure.set((error as Error).message)
67
+ }
68
+ }
69
+
70
+ async function importTheme(event: Event): Promise<void> {
71
+ const input = event.currentTarget as HTMLInputElement
72
+ const file = input.files?.[0]
73
+ if (!file)
74
+ return
75
+ input.value = ''
76
+ feedback.set('')
77
+ failure.set('')
78
+ try {
79
+ if (file.size > MAX_THEME_FILE_SIZE)
80
+ throw new Error('Choose a theme JSON file smaller than 16 KB.')
81
+ let manifest: unknown
82
+ try {
83
+ manifest = JSON.parse(await file.text())
84
+ }
85
+ catch {
86
+ throw new Error('Choose a valid theme JSON file.')
87
+ }
88
+ const name = themes.install(manifest)
89
+ feedback.set(`${name} is installed and active.`)
90
+ }
91
+ catch (error) {
92
+ failure.set((error as Error).message)
93
+ }
94
+ }
95
+
96
+ function removeTheme(): void {
97
+ const theme = selectedInstallation()
98
+ if (!theme)
99
+ return
100
+ feedback.set('')
101
+ failure.set('')
102
+ try {
103
+ themes.remove(theme.id)
104
+ feedback.set(`${theme.name} was removed. The Original is active.`)
105
+ }
106
+ catch (error) {
107
+ failure.set((error as Error).message)
108
+ }
109
+ }
110
+ </script>
111
+
112
+ <style>
113
+ .dashboard-theme-choice {
114
+ border-color: var(--dashboard-border, light-dark(#e7e5e4, #ffffff24));
115
+ background: var(--dashboard-surface, light-dark(#fff, #262626));
116
+ }
117
+ .dashboard-theme-choice:hover {
118
+ background: var(--dashboard-surface-muted, light-dark(#fafaf9, #333));
119
+ }
120
+ .dashboard-theme-choice[aria-pressed="true"] {
121
+ border-color: var(--dashboard-accent, light-dark(#2563eb, #60a5fa));
122
+ box-shadow: 0 0 0 1px var(--dashboard-accent, light-dark(#2563eb, #60a5fa));
123
+ }
124
+ .dashboard-theme-choice:focus-visible {
125
+ outline: 2px solid var(--dashboard-accent, light-dark(#2563eb, #60a5fa));
126
+ outline-offset: 3px;
127
+ }
128
+ .dashboard-theme-preview {
129
+ color-scheme: light;
130
+ height: 5.25rem;
131
+ background: var(--preview-window, light-dark(#e7e7ec, #1c1c1e));
132
+ box-shadow: inset 0 0 0 1px rgb(127 127 127 / .18);
133
+ }
134
+ .dark .dashboard-theme-preview {
135
+ color-scheme: dark;
136
+ }
137
+ .dashboard-theme-preview[data-overview="immersive"] {
138
+ background: linear-gradient(155deg, var(--preview-hero-start), var(--preview-hero-end));
139
+ }
140
+ .dashboard-theme-preview[data-overview="immersive"] .dashboard-theme-preview-page {
141
+ background: transparent;
142
+ }
143
+ .dashboard-theme-preview[data-overview="immersive"] .dashboard-theme-preview-page > span {
144
+ background: rgb(255 255 255 / .15);
145
+ }
146
+ .dashboard-theme-preview-nav {
147
+ width: 30%;
148
+ display: grid;
149
+ align-content: start;
150
+ gap: 4px;
151
+ padding: 9px 5px;
152
+ }
153
+ .dashboard-theme-preview-nav > span {
154
+ height: 5px;
155
+ border-radius: 2px;
156
+ background: rgb(127 127 127 / .25);
157
+ }
158
+ .dashboard-theme-preview-nav > span:first-child {
159
+ background: var(--preview-accent, #007aff);
160
+ }
161
+ .dashboard-theme-preview-page {
162
+ display: grid;
163
+ flex: 1;
164
+ grid-template: 2fr 1fr / repeat(3, 1fr);
165
+ gap: 4px;
166
+ padding: 7px;
167
+ margin: var(--preview-gap, 0) var(--preview-gap, 0) var(--preview-gap, 0) 0;
168
+ border-radius: var(--preview-gap, 0);
169
+ background: var(--preview-canvas, light-dark(#f6f6f9, #121318));
170
+ }
171
+ .dashboard-theme-preview-page > span {
172
+ border-radius: 3px;
173
+ background: var(--preview-surface, light-dark(#fff, #27272a));
174
+ }
175
+ .dashboard-theme-preview-page > span:first-child {
176
+ grid-column: 1 / -1;
177
+ background: linear-gradient(155deg, var(--preview-hero-start, light-dark(#e4e4eb, #2d2e36)), var(--preview-hero-end, light-dark(#ececf1, #23242b)));
178
+ }
179
+ </style>
180
+
181
+ <template>
182
+ <SettingsGroup header="Dashboard theme" footer="Download the starter JSON to build and install your own theme.">
183
+ <div class="grid gap-4 sm:grid-cols-2 p-3" role="group" aria-label="Dashboard theme">
184
+ <button
185
+ :for="theme in themesToShow()"
186
+ type="button"
187
+ class="flex flex-col gap-2 p-3 text-left border rounded-xl dashboard-theme-choice"
188
+ :data-theme-id="theme.id"
189
+ :aria-pressed="String(active() === theme.id)"
190
+ @click="selectTheme(theme.id)"
191
+ >
192
+ <span class="flex overflow-hidden w-full rounded-lg dashboard-theme-preview" :style="theme.preview" :data-overview="theme.overview" aria-hidden="true">
193
+ <span class="dashboard-theme-preview-nav"><span></span><span></span><span></span></span>
194
+ <span class="dashboard-theme-preview-page"><span></span><span></span><span></span><span></span></span>
195
+ </span>
196
+ <span class="font-medium text-neutral-900 text-sm dark:text-white" :text="theme.name"></span>
197
+ <span :if="theme.description" class="text-neutral-500 text-xs dark:text-neutral-400" :text="theme.description"></span>
198
+ </button>
199
+ </div>
200
+ <div class="pb-3 px-3">
201
+ <div class="flex flex-wrap gap-2">
202
+ <input ref="dashboardThemeFile" hidden type="file" accept=".json,application/json" @change="importTheme($event)" />
203
+ <Button variant="secondary" size="sm" @click="themeFile.current?.click()">Install theme</Button>
204
+ <Button tag="a" variant="outline" size="sm" :href="downloadHref()" :download="downloadable().id + '.json'">
205
+ {{ selectedInstallation() ? 'Export theme' : 'Download starter theme' }}
206
+ </Button>
207
+ <Button :if="selectedInstallation()" variant="outline" size="sm" @click="removeTheme()">Remove theme</Button>
208
+ </div>
209
+ <p :if="feedback()" class="mt-2 text-neutral-700 text-sm dark:text-neutral-200" role="status" :text="feedback()"></p>
210
+ <p :if="failure()" class="mt-2 text-red-700 text-sm dark:text-red-300" role="alert" :text="failure()"></p>
211
+ </div>
212
+ </SettingsGroup>
213
+ </template>
@@ -303,26 +303,18 @@ async function saveSettings(): Promise<void> {
303
303
  onMount(() => void loadSettings())
304
304
  </script>
305
305
 
306
- <div class="flex flex-col gap-6">
307
- <PageHeader
308
- title="Mail Settings"
309
- description="Configure the framework mail driver and its environment-backed credentials."
310
- />
311
-
312
- <div class="grid gap-3 sm:grid-cols-3">
313
- <div class="p-4 bg-white dark:bg-neutral-900 border border-stone-200 rounded-xl dark:border-neutral-700">
314
- <p class="font-medium text-stone-500 text-xs tracking-wide uppercase dark:text-neutral-400">Driver</p>
315
- <p class="mt-1 font-semibold text-sm text-stone-900 dark:text-white" :text="selectedDriverLabel()"></p>
316
- </div>
317
- <div class="p-4 bg-white dark:bg-neutral-900 border border-stone-200 rounded-xl dark:border-neutral-700">
318
- <p class="font-medium text-stone-500 text-xs tracking-wide uppercase dark:text-neutral-400">Source</p>
319
- <p class="mt-1 font-mono text-sm text-stone-900 dark:text-white" :text="sources().join(', ')"></p>
320
- </div>
321
- <div class="p-4 bg-white dark:bg-neutral-900 border border-stone-200 rounded-xl dark:border-neutral-700">
322
- <p class="font-medium text-stone-500 text-xs tracking-wide uppercase dark:text-neutral-400">Configuration</p>
323
- <p class="mt-1 font-medium text-sm" :class="driverReady() ? 'text-emerald-600 dark:text-emerald-400' : 'text-amber-600 dark:text-amber-400'" :text="driverReady() ? 'Ready' : 'Needs attention'"></p>
324
- </div>
325
- </div>
306
+ <div class="dashboard-settings-stack">
307
+ <SettingsGroup header="Delivery status">
308
+ <SettingsRow label="Driver" setting="mail-driver">
309
+ <span :text="selectedDriverLabel()"></span>
310
+ </SettingsRow>
311
+ <SettingsRow label="Source" setting="mail-source">
312
+ <code data-mail-source :text="sources().join(', ')"></code>
313
+ </SettingsRow>
314
+ <SettingsRow label="Configuration" setting="mail-status">
315
+ <span class="font-medium" :class="driverReady() ? 'text-emerald-700 dark:text-emerald-400' : 'text-amber-700 dark:text-amber-400'" :text="driverReady() ? 'Ready' : 'Needs attention'"></span>
316
+ </SettingsRow>
317
+ </SettingsGroup>
326
318
 
327
319
  <div :if="errorMessage()" class="p-4 text-red-700 text-sm dark:text-red-300 bg-red-50 dark:bg-red-950/30 border border-red-200 rounded-xl dark:border-red-900" role="alert">
328
320
  <p :text="errorMessage()"></p>
@@ -337,170 +329,173 @@ onMount(() => void loadSettings())
337
329
 
338
330
  <div :if="successMessage()" class="p-4 text-emerald-700 text-sm dark:text-emerald-300 bg-emerald-50 dark:bg-emerald-950/30 border border-emerald-200 rounded-xl dark:border-emerald-900" role="status" :text="successMessage()"></div>
339
331
 
340
- <form :if="revision()" class="space-y-6" @submit.prevent="saveSettings">
341
- <section class="p-5 bg-white dark:bg-neutral-900 border border-stone-200 rounded-xl dark:border-neutral-700">
342
- <div class="mb-5">
343
- <h2 class="font-semibold text-stone-900 dark:text-white">Sender and driver</h2>
344
- <p class="mt-1 text-sm text-stone-500 dark:text-neutral-400">These values control every mail sent through the framework singleton.</p>
345
- </div>
346
- <div class="grid gap-4 md:grid-cols-2">
347
- <Select
348
- v-model:value="driver"
349
- :options="driverOptions"
350
- label="Mail driver"
351
- placeholder=""
352
- required
353
- :error="fieldError('driver')"
354
- />
355
- <Input
356
- v-model:value="fromName"
357
- label="Sender name"
358
- placeholder="Stacks"
359
- :error="fieldError('fromName')"
360
- />
361
- <div class="md:col-span-2">
362
- <Input
363
- v-model:value="fromAddress"
364
- type="email"
365
- label="Sender email address"
366
- placeholder="no-reply@example.com"
332
+ <form :if="revision()" class="dashboard-settings-stack" @submit.prevent="saveSettings">
333
+ <SettingsGroup header="Sender and driver">
334
+ <div class="p-3">
335
+ <div class="grid gap-4 md:grid-cols-2">
336
+ <Select
337
+ v-model:value="driver"
338
+ :options="driverOptions"
339
+ label="Mail driver"
340
+ placeholder=""
367
341
  required
368
- :error="fieldError('fromAddress')"
342
+ :error="fieldError('driver')"
369
343
  />
370
- </div>
371
- </div>
372
- </section>
373
-
374
- <section :if="driver() === 'smtp'" class="p-5 bg-white dark:bg-neutral-900 border border-stone-200 rounded-xl dark:border-neutral-700">
375
- <div class="mb-5">
376
- <h2 class="font-semibold text-stone-900 dark:text-white">SMTP transport</h2>
377
- <p class="mt-1 text-sm text-stone-500 dark:text-neutral-400">SMTP (Simple Mail Transfer Protocol) is the standard way servers send email. Use any SMTP server: the local catcher from <code>buddy mail:dev</code>, Postmark SMTP, or a hosted mail server.</p>
378
- </div>
379
- <div class="grid gap-4 md:grid-cols-2">
380
- <Input v-model:value="smtpHost" label="Host" placeholder="smtp.example.com" required :error="fieldError('smtp.host')" />
381
- <Input v-model:value="smtpPort" type="number" label="Port" placeholder="587" required :error="fieldError('smtp.port')" />
382
- <Input v-model:value="smtpUsername" label="Username" placeholder="mailer@example.com" :error="fieldError('smtp.username')" />
383
- <Select v-model:value="smtpEncryption" :options="encryptionOptions" label="Encryption" placeholder="" hint="Match what your mail server expects. Most use STARTTLS on port 587." :error="fieldError('smtp.encryption')" />
384
- <div class="md:col-span-2">
385
344
  <Input
386
- v-model:value="smtpPassword"
387
- type="password"
388
- label="Password"
389
- autocomplete="new-password"
390
- :disabled="clearSmtpPassword()"
391
- :placeholder="smtpPasswordConfigured() ? 'Stored secret' : 'Enter a password'"
392
- :hint="secretHint(smtpPasswordConfigured(), clearSmtpPassword())"
393
- :error="fieldError('smtp.password')"
345
+ v-model:value="fromName"
346
+ label="Sender name"
347
+ placeholder="Stacks"
348
+ :error="fieldError('fromName')"
394
349
  />
395
- <label :if="smtpPasswordConfigured()" class="inline-flex gap-2 items-center mt-3 text-sm text-stone-600 dark:text-neutral-300">
396
- <input x-model="clearSmtpPassword" type="checkbox" class="h-4 w-4 text-red-600 border-stone-300 rounded dark:border-neutral-600" />
397
- Clear stored SMTP password
398
- </label>
350
+ <div class="md:col-span-2">
351
+ <Input
352
+ v-model:value="fromAddress"
353
+ type="email"
354
+ label="Sender email address"
355
+ placeholder="no-reply@example.com"
356
+ required
357
+ :error="fieldError('fromAddress')"
358
+ />
359
+ </div>
399
360
  </div>
400
361
  </div>
401
- </section>
402
-
403
- <section :if="driver() === 'ses'" class="p-5 bg-white dark:bg-neutral-900 border border-stone-200 rounded-xl dark:border-neutral-700">
404
- <div class="mb-5">
405
- <h2 class="font-semibold text-stone-900 dark:text-white">Amazon SES</h2>
406
- <p class="mt-1 text-sm text-stone-500 dark:text-neutral-400">Amazon SES (Simple Email Service) sends email through your AWS account. The access keys are optional when the server already has AWS credentials, from a local AWS profile or the role of the server it runs on.</p>
407
- </div>
408
- <div class="grid gap-4 md:grid-cols-2">
409
- <Input v-model:value="sesRegion" label="AWS region" placeholder="us-east-1" required :error="fieldError('ses.region')" />
410
- <Input v-model:value="sesAccessKeyId" label="Access key ID" placeholder="AKIA..." :error="fieldError('ses.accessKeyId')" />
411
- <div class="md:col-span-2">
412
- <Input
413
- v-model:value="sesSecretAccessKey"
414
- type="password"
415
- label="Secret access key"
416
- autocomplete="new-password"
417
- :disabled="clearSesSecretAccessKey()"
418
- :placeholder="sesSecretAccessKeyConfigured() ? 'Stored secret' : 'Optional with AWS profile or role'"
419
- :hint="secretHint(sesSecretAccessKeyConfigured(), clearSesSecretAccessKey())"
420
- :error="fieldError('ses.secretAccessKey')"
421
- />
422
- <label :if="sesSecretAccessKeyConfigured()" class="inline-flex gap-2 items-center mt-3 text-sm text-stone-600 dark:text-neutral-300">
423
- <input x-model="clearSesSecretAccessKey" type="checkbox" class="h-4 w-4 text-red-600 border-stone-300 rounded dark:border-neutral-600" />
424
- Clear stored AWS secret access key
425
- </label>
362
+ </SettingsGroup>
363
+
364
+ <div :if="driver() === 'smtp'">
365
+ <SettingsGroup header="SMTP transport">
366
+ <div class="p-3">
367
+ <p class="mb-3 mt-1 text-sm text-stone-500 dark:text-neutral-400">SMTP (Simple Mail Transfer Protocol) is the standard way servers send email. Use any SMTP server: the local catcher from <code>buddy mail:dev</code>, Postmark SMTP, or a hosted mail server.</p>
368
+ <div class="grid gap-4 md:grid-cols-2">
369
+ <Input v-model:value="smtpHost" label="Host" placeholder="smtp.example.com" required :error="fieldError('smtp.host')" />
370
+ <Input v-model:value="smtpPort" type="number" label="Port" placeholder="587" required :error="fieldError('smtp.port')" />
371
+ <Input v-model:value="smtpUsername" label="Username" placeholder="mailer@example.com" :error="fieldError('smtp.username')" />
372
+ <Select v-model:value="smtpEncryption" :options="encryptionOptions" label="Encryption" placeholder="" hint="Match what your mail server expects. Most use STARTTLS on port 587." :error="fieldError('smtp.encryption')" />
373
+ <div class="md:col-span-2">
374
+ <Input
375
+ v-model:value="smtpPassword"
376
+ type="password"
377
+ label="Password"
378
+ autocomplete="new-password"
379
+ :disabled="clearSmtpPassword()"
380
+ :placeholder="smtpPasswordConfigured() ? 'Stored secret' : 'Enter a password'"
381
+ :hint="secretHint(smtpPasswordConfigured(), clearSmtpPassword())"
382
+ :error="fieldError('smtp.password')"
383
+ />
384
+ <label :if="smtpPasswordConfigured()" class="inline-flex gap-2 items-center mt-3 text-sm text-stone-600 dark:text-neutral-300">
385
+ <input x-model="clearSmtpPassword" type="checkbox" class="h-4 w-4 text-red-600 border-stone-300 rounded dark:border-neutral-600" />
386
+ Clear stored SMTP password
387
+ </label>
388
+ </div>
389
+ </div>
426
390
  </div>
427
- </div>
428
- </section>
391
+ </SettingsGroup>
392
+ </div>
429
393
 
430
- <section :if="driver() === 'sendgrid'" class="p-5 bg-white dark:bg-neutral-900 border border-stone-200 rounded-xl dark:border-neutral-700">
431
- <div class="mb-5">
432
- <h2 class="font-semibold text-stone-900 dark:text-white">SendGrid</h2>
433
- <p class="mt-1 text-sm text-stone-500 dark:text-neutral-400">The API key is write-only and is never returned to the browser.</p>
434
- </div>
435
- <Input
436
- v-model:value="sendgridApiKey"
437
- type="password"
438
- label="API key"
439
- autocomplete="new-password"
440
- :disabled="clearSendgridApiKey()"
441
- :placeholder="sendgridApiKeyConfigured() ? 'Stored secret' : 'SG...'"
442
- :hint="secretHint(sendgridApiKeyConfigured(), clearSendgridApiKey())"
443
- :error="fieldError('sendgrid.apiKey')"
444
- />
445
- <label :if="sendgridApiKeyConfigured()" class="inline-flex gap-2 items-center mt-3 text-sm text-stone-600 dark:text-neutral-300">
446
- <input x-model="clearSendgridApiKey" type="checkbox" class="h-4 w-4 text-red-600 border-stone-300 rounded dark:border-neutral-600" />
447
- Clear stored SendGrid API key
448
- </label>
449
- </section>
394
+ <div :if="driver() === 'ses'">
395
+ <SettingsGroup header="Amazon SES">
396
+ <div class="p-3">
397
+ <p class="mb-3 mt-1 text-sm text-stone-500 dark:text-neutral-400">Amazon SES (Simple Email Service) sends email through your AWS account. The access keys are optional when the server already has AWS credentials, from a local AWS profile or the role of the server it runs on.</p>
398
+ <div class="grid gap-4 md:grid-cols-2">
399
+ <Input v-model:value="sesRegion" label="AWS region" placeholder="us-east-1" required :error="fieldError('ses.region')" />
400
+ <Input v-model:value="sesAccessKeyId" label="Access key ID" placeholder="AKIA..." :error="fieldError('ses.accessKeyId')" />
401
+ <div class="md:col-span-2">
402
+ <Input
403
+ v-model:value="sesSecretAccessKey"
404
+ type="password"
405
+ label="Secret access key"
406
+ autocomplete="new-password"
407
+ :disabled="clearSesSecretAccessKey()"
408
+ :placeholder="sesSecretAccessKeyConfigured() ? 'Stored secret' : 'Optional with AWS profile or role'"
409
+ :hint="secretHint(sesSecretAccessKeyConfigured(), clearSesSecretAccessKey())"
410
+ :error="fieldError('ses.secretAccessKey')"
411
+ />
412
+ <label :if="sesSecretAccessKeyConfigured()" class="inline-flex gap-2 items-center mt-3 text-sm text-stone-600 dark:text-neutral-300">
413
+ <input x-model="clearSesSecretAccessKey" type="checkbox" class="h-4 w-4 text-red-600 border-stone-300 rounded dark:border-neutral-600" />
414
+ Clear stored AWS secret access key
415
+ </label>
416
+ </div>
417
+ </div>
418
+ </div>
419
+ </SettingsGroup>
420
+ </div>
450
421
 
451
- <section :if="driver() === 'mailgun'" class="p-5 bg-white dark:bg-neutral-900 border border-stone-200 rounded-xl dark:border-neutral-700">
452
- <div class="mb-5">
453
- <h2 class="font-semibold text-stone-900 dark:text-white">Mailgun</h2>
454
- <p class="mt-1 text-sm text-stone-500 dark:text-neutral-400">Configure the verified sending domain and regional API host.</p>
455
- </div>
456
- <div class="grid gap-4 md:grid-cols-2">
457
- <Input v-model:value="mailgunDomain" label="Domain" placeholder="mg.example.com" required :error="fieldError('mailgun.domain')" />
458
- <Input v-model:value="mailgunEndpoint" label="API host" placeholder="api.mailgun.net" required :error="fieldError('mailgun.endpoint')" />
459
- <div class="md:col-span-2">
422
+ <div :if="driver() === 'sendgrid'">
423
+ <SettingsGroup header="SendGrid">
424
+ <div class="p-3">
425
+ <p class="mb-3 mt-1 text-sm text-stone-500 dark:text-neutral-400">The API key is write-only and is never returned to the browser.</p>
460
426
  <Input
461
- v-model:value="mailgunApiKey"
427
+ v-model:value="sendgridApiKey"
462
428
  type="password"
463
429
  label="API key"
464
430
  autocomplete="new-password"
465
- :disabled="clearMailgunApiKey()"
466
- :placeholder="mailgunApiKeyConfigured() ? 'Stored secret' : 'key-...'"
467
- :hint="secretHint(mailgunApiKeyConfigured(), clearMailgunApiKey())"
468
- :error="fieldError('mailgun.apiKey')"
431
+ :disabled="clearSendgridApiKey()"
432
+ :placeholder="sendgridApiKeyConfigured() ? 'Stored secret' : 'SG...'"
433
+ :hint="secretHint(sendgridApiKeyConfigured(), clearSendgridApiKey())"
434
+ :error="fieldError('sendgrid.apiKey')"
469
435
  />
470
- <label :if="mailgunApiKeyConfigured()" class="inline-flex gap-2 items-center mt-3 text-sm text-stone-600 dark:text-neutral-300">
471
- <input x-model="clearMailgunApiKey" type="checkbox" class="h-4 w-4 text-red-600 border-stone-300 rounded dark:border-neutral-600" />
472
- Clear stored Mailgun API key
436
+ <label :if="sendgridApiKeyConfigured()" class="inline-flex gap-2 items-center mt-3 text-sm text-stone-600 dark:text-neutral-300">
437
+ <input x-model="clearSendgridApiKey" type="checkbox" class="h-4 w-4 text-red-600 border-stone-300 rounded dark:border-neutral-600" />
438
+ Clear stored SendGrid API key
473
439
  </label>
474
440
  </div>
475
- </div>
476
- </section>
441
+ </SettingsGroup>
442
+ </div>
477
443
 
478
- <section :if="driver() === 'mailtrap'" class="p-5 bg-white dark:bg-neutral-900 border border-stone-200 rounded-xl dark:border-neutral-700">
479
- <div class="mb-5">
480
- <h2 class="font-semibold text-stone-900 dark:text-white">Mailtrap</h2>
481
- <p class="mt-1 text-sm text-stone-500 dark:text-neutral-400">With an inbox ID, mail is captured in that testing inbox. Without one, it is delivered through the Sending API.</p>
482
- </div>
483
- <div class="grid gap-4 md:grid-cols-2">
484
- <div class="md:col-span-2">
485
- <Input v-model:value="mailtrapHost" type="url" label="API base URL (optional)" placeholder="Mailtrap's own host" :error="fieldError('mailtrap.host')" />
444
+ <div :if="driver() === 'mailgun'">
445
+ <SettingsGroup header="Mailgun">
446
+ <div class="p-3">
447
+ <p class="mb-3 mt-1 text-sm text-stone-500 dark:text-neutral-400">Configure the verified sending domain and regional API host.</p>
448
+ <div class="grid gap-4 md:grid-cols-2">
449
+ <Input v-model:value="mailgunDomain" label="Domain" placeholder="mg.example.com" required :error="fieldError('mailgun.domain')" />
450
+ <Input v-model:value="mailgunEndpoint" label="API host" placeholder="api.mailgun.net" required :error="fieldError('mailgun.endpoint')" />
451
+ <div class="md:col-span-2">
452
+ <Input
453
+ v-model:value="mailgunApiKey"
454
+ type="password"
455
+ label="API key"
456
+ autocomplete="new-password"
457
+ :disabled="clearMailgunApiKey()"
458
+ :placeholder="mailgunApiKeyConfigured() ? 'Stored secret' : 'key-...'"
459
+ :hint="secretHint(mailgunApiKeyConfigured(), clearMailgunApiKey())"
460
+ :error="fieldError('mailgun.apiKey')"
461
+ />
462
+ <label :if="mailgunApiKeyConfigured()" class="inline-flex gap-2 items-center mt-3 text-sm text-stone-600 dark:text-neutral-300">
463
+ <input x-model="clearMailgunApiKey" type="checkbox" class="h-4 w-4 text-red-600 border-stone-300 rounded dark:border-neutral-600" />
464
+ Clear stored Mailgun API key
465
+ </label>
466
+ </div>
467
+ </div>
486
468
  </div>
487
- <Input v-model:value="mailtrapInboxId" label="Testing inbox ID (optional)" placeholder="123456" :error="fieldError('mailtrap.inboxId')" />
488
- <Input
489
- v-model:value="mailtrapToken"
490
- type="password"
491
- label="API token"
492
- autocomplete="new-password"
493
- :disabled="clearMailtrapToken()"
494
- :placeholder="mailtrapTokenConfigured() ? 'Stored secret' : 'Enter a token'"
495
- :hint="secretHint(mailtrapTokenConfigured(), clearMailtrapToken())"
496
- :error="fieldError('mailtrap.token')"
497
- />
498
- <label :if="mailtrapTokenConfigured()" class="inline-flex gap-2 items-center md:col-span-2 text-sm text-stone-600 dark:text-neutral-300">
499
- <input x-model="clearMailtrapToken" type="checkbox" class="h-4 w-4 text-red-600 border-stone-300 rounded dark:border-neutral-600" />
500
- Clear stored Mailtrap API token
501
- </label>
502
- </div>
503
- </section>
469
+ </SettingsGroup>
470
+ </div>
471
+
472
+ <div :if="driver() === 'mailtrap'">
473
+ <SettingsGroup header="Mailtrap">
474
+ <div class="p-3">
475
+ <p class="mb-3 mt-1 text-sm text-stone-500 dark:text-neutral-400">With an inbox ID, mail is captured in that testing inbox. Without one, it is delivered through the Sending API.</p>
476
+ <div class="grid gap-4 md:grid-cols-2">
477
+ <div class="md:col-span-2">
478
+ <Input v-model:value="mailtrapHost" type="url" label="API base URL (optional)" placeholder="Mailtrap's own host" :error="fieldError('mailtrap.host')" />
479
+ </div>
480
+ <Input v-model:value="mailtrapInboxId" label="Testing inbox ID (optional)" placeholder="123456" :error="fieldError('mailtrap.inboxId')" />
481
+ <Input
482
+ v-model:value="mailtrapToken"
483
+ type="password"
484
+ label="API token"
485
+ autocomplete="new-password"
486
+ :disabled="clearMailtrapToken()"
487
+ :placeholder="mailtrapTokenConfigured() ? 'Stored secret' : 'Enter a token'"
488
+ :hint="secretHint(mailtrapTokenConfigured(), clearMailtrapToken())"
489
+ :error="fieldError('mailtrap.token')"
490
+ />
491
+ <label :if="mailtrapTokenConfigured()" class="inline-flex gap-2 items-center md:col-span-2 text-sm text-stone-600 dark:text-neutral-300">
492
+ <input x-model="clearMailtrapToken" type="checkbox" class="h-4 w-4 text-red-600 border-stone-300 rounded dark:border-neutral-600" />
493
+ Clear stored Mailtrap API token
494
+ </label>
495
+ </div>
496
+ </div>
497
+ </SettingsGroup>
498
+ </div>
504
499
 
505
500
  <section :if="driver() === 'log' || driver() === 'capture'" class="p-5 text-sm text-stone-600 dark:text-neutral-300 bg-stone-50 dark:bg-neutral-900 border border-stone-200 rounded-xl dark:border-neutral-700">
506
501
  <div class="flex gap-3 items-start">
@@ -514,7 +509,7 @@ onMount(() => void loadSettings())
514
509
 
515
510
  <div class="flex flex-col gap-3 items-start justify-between sm:flex-row sm:items-center">
516
511
  <p class="text-stone-500 text-xs dark:text-neutral-400">Saving writes each value to the file it comes from, and keeps a machine-local backup of the previous .env content.</p>
517
- <Button type="submit" :loading="isSaving()" :disabled="isBusy() || !isDirty()">Save mail settings</Button>
512
+ <Button type="submit" class="shrink-0 whitespace-nowrap" :loading="isSaving()" :disabled="isBusy() || !isDirty()">Save mail settings</Button>
518
513
  </div>
519
514
  </form>
520
515
  </div>