Skip to content

Email for professionals and teams

Improve inputs

Hieu Nguyen (Jack)eaed0d6b3f6d
diff --git a/src/app/(admin)/accounts/[id]/page.tsx b/src/app/(admin)/accounts/[id]/page.tsx
index 9ac30a1..a094670 100644
--- a/src/app/(admin)/accounts/[id]/page.tsx
+++ b/src/app/(admin)/accounts/[id]/page.tsx
@@ -4,8 +4,10 @@ import { useEffect, useState } from "react";
import { useParams } from "next/navigation";
import { Plus, Trash2, Upload } from "lucide-react";
import { Button } from "@/components/ui/button";
+import { Checkbox } from "@/components/ui/checkbox";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
+import { Select } from "@/components/ui/select";
import { authFetch } from "@/lib/auth/client";
import type { ManagedAccount, ManagedDomain, ManagedMailbox } from "./types";
@@ -77,14 +79,14 @@ export default function AccountDetailsPage() {
return <div className="space-y-6">
<div><h1 className="text-3xl font-medium">{account.name}</h1><p className="mt-2 text-sm text-neutral-500">{account.email}</p></div>
<section className="space-y-5 rounded-3xl bg-white p-6">
- <div className="flex items-center gap-4"><span className="relative flex h-16 w-16 items-center justify-center overflow-hidden rounded-full bg-blue-100 text-xl font-semibold text-blue-700">{account.name.charAt(0).toUpperCase()}{account.hasAvatar && <img src={`/api/accounts/${id}/avatar?v=${avatarVersion}`} alt="" className="absolute inset-0 h-full w-full object-cover" />}</span><Label className="cursor-pointer"><span className="inline-flex h-9 items-center gap-2 rounded-md border border-neutral-200 px-3 text-sm"><Upload className="h-4 w-4" />Change avatar</span><input type="file" accept="image/jpeg,image/png,image/webp,image/gif" className="sr-only" onChange={(event) => void uploadAvatar(event.target.files?.[0])} /></Label></div>
+ <div className="flex items-center gap-4"><span className="relative flex h-16 w-16 items-center justify-center overflow-hidden rounded-full bg-blue-100 text-xl font-semibold text-blue-700">{account.name.charAt(0).toUpperCase()}{account.hasAvatar && <img src={`/api/accounts/${id}/avatar?v=${avatarVersion}`} alt="" className="absolute inset-0 h-full w-full object-cover" />}</span><Label className="cursor-pointer"><span className="inline-flex h-9 items-center gap-2 rounded-md border border-neutral-200 px-3 text-sm"><Upload className="h-4 w-4" />Change avatar</span><Input type="file" accept="image/jpeg,image/png,image/webp,image/gif" className="sr-only" onChange={(event) => void uploadAvatar(event.target.files?.[0])} /></Label></div>
<div className="space-y-2"><Label htmlFor="account-name">Name</Label><Input id="account-name" value={account.name} onChange={(event) => setAccount({ ...account, name: event.target.value })} /></div>
- <div className="space-y-2"><Label htmlFor="account-role">Role</Label><select id="account-role" value={account.role} onChange={(event) => setAccount({ ...account, role: event.target.value as "admin" | "user" })} className="h-10 w-full rounded-md border border-neutral-200 bg-white px-3 text-sm"><option value="user">User</option><option value="admin">Admin</option></select></div>
- <label className="flex items-center gap-3 text-sm"><input type="checkbox" checked={account.canManageMailboxes} onChange={(event) => setAccount({ ...account, canManageMailboxes: event.target.checked })} />Allow this account to add and remove inboxes</label>
- <label className="flex items-center gap-3 text-sm"><input type="checkbox" checked={!account.disabled} onChange={(event) => setAccount({ ...account, disabled: !event.target.checked })} />Account enabled</label>
+ <div className="space-y-2"><Label htmlFor="account-role">Role</Label><Select id="account-role" value={account.role} onChange={(event) => setAccount({ ...account, role: event.target.value as "admin" | "user" })} className="h-10 w-full rounded-md border border-neutral-200 bg-white px-3 text-sm"><option value="user">User</option><option value="admin">Admin</option></Select></div>
+ <label className="flex items-center gap-3 text-sm"><Checkbox checked={account.canManageMailboxes} onChange={(event) => setAccount({ ...account, canManageMailboxes: event.target.checked })} />Allow this account to add and remove inboxes</label>
+ <label className="flex items-center gap-3 text-sm"><Checkbox checked={!account.disabled} onChange={(event) => setAccount({ ...account, disabled: !event.target.checked })} />Account enabled</label>
<Button onClick={() => void saveAccount()} disabled={saving}>{saving ? "Saving..." : "Save changes"}</Button>
</section>
- <section className="space-y-4 rounded-3xl bg-white p-6"><div><h2 className="font-semibold">Inboxes</h2><p className="text-sm text-neutral-500">Mailboxes owned by this account.</p></div><div className="space-y-2">{mailboxes.map((mailbox) => <div key={mailbox.id} className="flex items-center justify-between rounded-2xl bg-neutral-50 px-4 py-3"><span><span className="block font-medium">{mailbox.displayName || mailbox.localPart}</span><span className="block text-sm text-neutral-500">{mailbox.localPart}@{mailbox.hostname}</span></span><Button type="button" variant="ghost" size="icon" onClick={() => void removeMailbox(mailbox.id)} aria-label="Remove inbox"><Trash2 className="h-4 w-4" /></Button></div>)}</div><form onSubmit={addMailbox} className="flex gap-2"><Input value={localPart} onChange={(event) => setLocalPart(event.target.value)} placeholder="inbox" required /><select value={domainId} onChange={(event) => setDomainId(event.target.value)} className="rounded-md border border-neutral-200 bg-white px-3 text-sm">{domains.map((domain) => <option key={domain.id} value={domain.id}>@{domain.hostname}</option>)}</select><Button type="submit"><Plus className="h-4 w-4" />Add inbox</Button></form></section>
+ <section className="space-y-4 rounded-3xl bg-white p-6"><div><h2 className="font-semibold">Inboxes</h2><p className="text-sm text-neutral-500">Mailboxes owned by this account.</p></div><div className="space-y-2">{mailboxes.map((mailbox) => <div key={mailbox.id} className="flex items-center justify-between rounded-2xl bg-neutral-50 px-4 py-3"><span><span className="block font-medium">{mailbox.displayName || mailbox.localPart}</span><span className="block text-sm text-neutral-500">{mailbox.localPart}@{mailbox.hostname}</span></span><Button type="button" variant="ghost" size="icon" onClick={() => void removeMailbox(mailbox.id)} aria-label="Remove inbox"><Trash2 className="h-4 w-4" /></Button></div>)}</div><form onSubmit={addMailbox} className="flex gap-2"><Input value={localPart} onChange={(event) => setLocalPart(event.target.value)} placeholder="inbox" required /><Select value={domainId} onChange={(event) => setDomainId(event.target.value)} className="rounded-md border border-neutral-200 bg-white px-3 text-sm">{domains.map((domain) => <option key={domain.id} value={domain.id}>@{domain.hostname}</option>)}</Select><Button type="submit"><Plus className="h-4 w-4" />Add inbox</Button></form></section>
{message && <p className="text-sm text-neutral-500">{message}</p>}
</div>;
}
diff --git a/src/app/(admin)/accounts/page.tsx b/src/app/(admin)/accounts/page.tsx
index 17dc5d2..d471977 100644
--- a/src/app/(admin)/accounts/page.tsx
+++ b/src/app/(admin)/accounts/page.tsx
@@ -7,6 +7,7 @@ import { Button } from "@/components/ui/button";
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
+import { Select } from "@/components/ui/select";
import { authFetch } from "@/lib/auth/client";
import type { Account, AccountResponse, Domain } from "./types";
@@ -70,9 +71,9 @@ export default function AccountsPage() {
{accounts.map((account) => <Link key={account.id} href={`/accounts/${account.id}`} className="flex items-center gap-4 rounded-3xl bg-white p-5 transition-colors hover:bg-blue-50/40"><span className="relative flex h-12 w-12 shrink-0 items-center justify-center overflow-hidden rounded-full bg-blue-100 font-semibold text-blue-700">{account.name.charAt(0).toUpperCase()}{account.hasAvatar && <img src={`/api/accounts/${account.id}/avatar`} alt="" className="absolute inset-0 h-full w-full object-cover" />}</span><span className="min-w-0"><span className="flex items-center gap-2"><span className="truncate font-semibold text-neutral-900">{account.name}</span><span className="rounded-full bg-neutral-100 px-2 py-0.5 text-xs font-medium capitalize text-neutral-600">{account.role}</span></span><span className="block truncate text-sm text-neutral-500">{account.email}</span></span></Link>)}
</div>}
<Dialog open={createOpen} onOpenChange={setCreateOpen}><DialogContent><DialogHeader><DialogTitle>Add user account</DialogTitle><DialogDescription>The user can sign in with this email and password.</DialogDescription></DialogHeader><form onSubmit={createAccount} className="space-y-4">
- <div className="space-y-2"><Label htmlFor="account-username">Email</Label><div className="flex h-10 overflow-hidden rounded-md border border-neutral-200 bg-white"><Input id="account-username" value={username} onChange={(event) => setUsername(event.target.value)} placeholder="username" className="min-w-0 flex-1 rounded-none border-0 shadow-none" required /><span className="flex items-center text-sm text-neutral-400">@</span><select aria-label="Domain" value={domainId} onChange={(event) => setDomainId(event.target.value)} className="max-w-[55%] bg-transparent px-3 text-sm" required><option value="">Select domain</option>{domains.map((domain) => <option key={domain.id} value={domain.id}>{domain.hostname}</option>)}</select></div></div>
+ <div className="space-y-2"><Label htmlFor="account-username">Email</Label><div className="flex h-10 overflow-hidden rounded-md border border-neutral-200 bg-white"><Input id="account-username" value={username} onChange={(event) => setUsername(event.target.value)} placeholder="username" className="min-w-0 flex-1 rounded-none border-0 shadow-none" required /><span className="flex items-center text-sm text-neutral-400">@</span><Select aria-label="Domain" value={domainId} onChange={(event) => setDomainId(event.target.value)} className="max-w-[55%] bg-transparent px-3 text-sm" required><option value="">Select domain</option>{domains.map((domain) => <option key={domain.id} value={domain.id}>{domain.hostname}</option>)}</Select></div></div>
<div className="space-y-2"><Label htmlFor="account-password">Password</Label><Input id="account-password" type="password" minLength={8} value={password} onChange={(event) => setPassword(event.target.value)} required /></div>
- <div className="space-y-2"><Label htmlFor="account-role">Role</Label><select id="account-role" value={role} onChange={(event) => setRole(event.target.value as "admin" | "user")} className="h-10 w-full rounded-md border border-neutral-200 bg-white px-3 text-sm"><option value="user">User</option><option value="admin">Admin</option></select></div>
+ <div className="space-y-2"><Label htmlFor="account-role">Role</Label><Select id="account-role" value={role} onChange={(event) => setRole(event.target.value as "admin" | "user")} className="h-10 w-full rounded-md border border-neutral-200 bg-white px-3 text-sm"><option value="user">User</option><option value="admin">Admin</option></Select></div>
{message && <p className="text-sm text-red-600">{message}</p>}<Button type="submit" disabled={saving || !domainId}>{saving ? "Creating..." : "Create account"}</Button>
</form></DialogContent></Dialog>
</div>;
diff --git a/src/app/(admin)/backups/page.tsx b/src/app/(admin)/backups/page.tsx
index 1ea20ce..9f49152 100644
--- a/src/app/(admin)/backups/page.tsx
+++ b/src/app/(admin)/backups/page.tsx
@@ -14,6 +14,7 @@ import {
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
+import { Select } from "@/components/ui/select";
import { SkeletonRows } from "@/components/ui/skeleton";
import { Switch } from "@/components/ui/switch";
import type { BackupItem, BackupSettings } from "./types";
@@ -127,7 +128,7 @@ export default function BackupsPage() {
<div className="grid gap-4">
<div className="space-y-2">
<Label htmlFor="schedule-type">Frequency</Label>
- <select
+ <Select
id="schedule-type"
value={settings.scheduleType}
onChange={(event) => {
@@ -149,13 +150,13 @@ export default function BackupsPage() {
<option value="daily">Daily</option>
<option value="weekly">Selected day of week</option>
<option value="monthly">Selected day of month</option>
- </select>
+ </Select>
</div>
{settings.scheduleType === "weekly" && (
<div className="space-y-2">
<Label htmlFor="weekday">Day of week</Label>
- <select
+ <Select
id="weekday"
value={settings.scheduleValue ?? 1}
onChange={(event) =>
@@ -171,7 +172,7 @@ export default function BackupsPage() {
{day.label}
</option>
))}
- </select>
+ </Select>
</div>
)}
diff --git a/src/app/(admin)/branding/page.tsx b/src/app/(admin)/branding/page.tsx
index d10fef5..9563438 100644
--- a/src/app/(admin)/branding/page.tsx
+++ b/src/app/(admin)/branding/page.tsx
@@ -84,7 +84,7 @@ export default function BrandingPage() {
</div>
<div className="space-y-2">
<Label>App icon</Label>
- <input ref={inputRef} type="file" accept={BRANDING_ICON_ACCEPT} className="hidden" onChange={(event) => pickIcon(event.target.files?.[0] ?? null)} />
+ <Input ref={inputRef} type="file" accept={BRANDING_ICON_ACCEPT} className="hidden" onChange={(event) => pickIcon(event.target.files?.[0] ?? null)} />
<button type="button" onClick={() => inputRef.current?.click()} className="flex items-center gap-4 rounded-2xl border border-dashed border-neutral-300 p-4 text-left hover:bg-neutral-50">
<img src={preview ?? branding.iconUrl} alt="App icon preview" className="h-16 w-16 rounded-2xl object-cover" />
<span className="text-sm text-neutral-600"><ImagePlus className="mb-1 h-5 w-5" />Choose PNG, JPEG, WebP, or GIF<br /><span className="text-xs text-neutral-400">Maximum 2 MB</span></span>
diff --git a/src/app/(admin)/licenses/license-activation.tsx b/src/app/(admin)/licenses/license-activation.tsx
index 4e3afc0..cc9e368 100644
--- a/src/app/(admin)/licenses/license-activation.tsx
+++ b/src/app/(admin)/licenses/license-activation.tsx
@@ -7,6 +7,7 @@ import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
+import { Select } from "@/components/ui/select";
import { Skeleton } from "@/components/ui/skeleton";
import type { LicenseStatus } from "@/lib/licenses/types";
import type { ActivatableLicensePlan, LicenseAction } from "./types";
@@ -111,7 +112,7 @@ export function LicenseActivation() {
{!hasActivation && (
<div className="space-y-2">
<Label htmlFor="licensePlan">Product</Label>
- <select
+ <Select
id="licensePlan"
value={selectedPlan}
onChange={(event) => setSelectedPlan(event.target.value as ActivatableLicensePlan)}
@@ -120,7 +121,7 @@ export function LicenseActivation() {
>
<option value="pro">Pro</option>
<option value="team">Team</option>
- </select>
+ </Select>
</div>
)}
<div className="space-y-2">
diff --git a/src/app/(admin)/mailboxes/[id]/MailboxAvatarForm.tsx b/src/app/(admin)/mailboxes/[id]/MailboxAvatarForm.tsx
index fd98b0d..ab23bf3 100644
--- a/src/app/(admin)/mailboxes/[id]/MailboxAvatarForm.tsx
+++ b/src/app/(admin)/mailboxes/[id]/MailboxAvatarForm.tsx
@@ -4,6 +4,7 @@ import { useEffect, useRef, useState } from "react";
import { useQueryClient } from "@tanstack/react-query";
import { Camera, LoaderCircle, User } from "lucide-react";
import { dispatchMailboxAvatarChanged } from "@/lib/mailboxes/avatar-client";
+import { Input } from "@/components/ui/input";
import type { MailboxAvatarFormProps } from "./types";
import {
getMailboxAvatarUrl,
@@ -58,7 +59,7 @@ export default function MailboxAvatarForm({
return (
<div className="flex flex-col items-start gap-2">
- <input
+ <Input
ref={inputRef}
type="file"
accept={MAILBOX_AVATAR_ACCEPT}
diff --git a/src/app/(admin)/mailboxes/page.tsx b/src/app/(admin)/mailboxes/page.tsx
index ca75a69..c4f07b4 100644
--- a/src/app/(admin)/mailboxes/page.tsx
+++ b/src/app/(admin)/mailboxes/page.tsx
@@ -15,6 +15,7 @@ import {
} from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
+import { Select } from "@/components/ui/select";
import { CardGridSkeleton } from "@/components/page-skeletons";
import { clearMailboxesCache } from "@/components/mailbox-provider-utils";
import { authFetch } from "@/lib/auth/client";
@@ -122,7 +123,7 @@ export default function MailboxesPage() {
<div className="space-y-4">
<div className="space-y-2">
<Label htmlFor="mailbox-owner">Account</Label>
- <select
+ <Select
id="mailbox-owner"
value={ownerUserId}
onChange={(event) => {
@@ -137,7 +138,7 @@ export default function MailboxesPage() {
{owner.name} ({owner.email})
</option>
))}
- </select>
+ </Select>
</div>
<div className="space-y-2">
<Label htmlFor="mailbox-name">Name</Label>
@@ -159,7 +160,7 @@ export default function MailboxesPage() {
className="min-w-0 flex-1 rounded-none border-0 shadow-none focus-visible:border-0"
/>
<span className="flex items-center text-sm text-neutral-400">@</span>
- <select
+ <Select
aria-label="Domain"
className="min-w-0 max-w-[55%] bg-transparent px-3 text-sm text-neutral-700 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50"
value={domainId}
@@ -171,7 +172,7 @@ export default function MailboxesPage() {
{domain.hostname}
</option>
))}
- </select>
+ </Select>
</div>
</div>
{create.isError && (
diff --git a/src/app/(dashboard)/layout.tsx b/src/app/(dashboard)/layout.tsx
index 6b17f42..3608181 100644
--- a/src/app/(dashboard)/layout.tsx
+++ b/src/app/(dashboard)/layout.tsx
@@ -24,8 +24,8 @@ export default function DashboardLayout({
<MailboxProvider>
<ComposeProvider>
<MailSearchProvider>
- <div className="grid h-[100dvh] grid-cols-[var(--sidebar-width)_minmax(0,1fr)] overflow-hidden bg-[#f6f8fc] transition-[grid-template-columns] duration-200">
- <aside className="min-h-0 overflow-y-auto overscroll-contain px-3 py-4 [scrollbar-gutter:stable]">
+ <div className="grid h-dvh grid-cols-[var(--sidebar-width)_minmax(0,1fr)] overflow-hidden bg-[#f6f8fc] transition-[grid-template-columns] duration-200">
+ <aside className="min-h-0 overflow-y-auto overscroll-contain px-3 py-4 scrollbar-gutter-stable">
<DashboardNav />
</aside>
<div className="flex min-h-0 min-w-0 flex-col">
@@ -40,7 +40,7 @@ export default function DashboardLayout({
<LicenseIndicator />
<MailboxSelector />
</header>
- <main className="min-h-0 flex-1 overflow-y-auto overscroll-contain rounded-tl-3xl bg-white [scrollbar-gutter:stable]">
+ <main className="min-h-0 flex-1 overflow-y-auto overscroll-contain rounded-tl-3xl bg-white scrollbar-gutter-stable">
{children}
</main>
</div>
diff --git a/src/app/(settings)/settings/import/page.tsx b/src/app/(settings)/settings/import/page.tsx
index 8cb9bf6..80e71d1 100644
--- a/src/app/(settings)/settings/import/page.tsx
+++ b/src/app/(settings)/settings/import/page.tsx
@@ -5,6 +5,7 @@ import { useMemo, useState } from "react";
import { Folder, Server, Upload } from "lucide-react";
import { useSelectedMailbox } from "@/components/mailbox-provider";
import { Button } from "@/components/ui/button";
+import { Checkbox } from "@/components/ui/checkbox";
import {
Card,
CardContent,
@@ -14,6 +15,7 @@ import {
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
+import { Select } from "@/components/ui/select";
import { importMessageFiles } from "@/components/settings/import-messages-utils";
import type {
ImapFormState,
@@ -168,7 +170,7 @@ export default function SettingsImportPage() {
<div className="space-y-6 rounded-3xl bg-white p-6">
<div className="space-y-2">
<Label htmlFor="import-source">Import source</Label>
- <select
+ <Select
id="import-source"
value={activeTab}
onChange={(event) => setActiveTab(event.target.value as ImportTab)}
@@ -176,7 +178,7 @@ export default function SettingsImportPage() {
>
<option value="file">Backup File</option>
<option value="imap">IMAP</option>
- </select>
+ </Select>
</div>
{/* <Card className="m-2">
<CardContent className="space-y-2 py-4"> */}
@@ -200,8 +202,7 @@ export default function SettingsImportPage() {
key={option.value}
className="flex items-center gap-2 rounded-lg px-3 py-2 text-sm text-neutral-700 hover:bg-neutral-50"
>
- <input
- type="checkbox"
+ <Checkbox
checked={selectedSections.includes(option.value)}
onChange={(event) =>
toggleSection(option.value, event.target.checked)
@@ -227,7 +228,7 @@ export default function SettingsImportPage() {
<form onSubmit={onFileSubmit} className="space-y-4">
<div className="space-y-2">
<Label>Select Backup File</Label>
- <input
+ <Input
id="import-files"
type="file"
accept=".eml,.mbox,.mbx,message/rfc822,application/mbox"
@@ -349,8 +350,7 @@ export default function SettingsImportPage() {
/>
</div>
<label className="flex items-end gap-2 pb-2 text-sm text-neutral-700">
- <input
- type="checkbox"
+ <Checkbox
checked={imapForm.secure}
onChange={(event) =>
setImapForm({
diff --git a/src/components/auth/auth-shell.tsx b/src/components/auth/auth-shell.tsx
index 8f8ad29..7403705 100644
--- a/src/components/auth/auth-shell.tsx
+++ b/src/components/auth/auth-shell.tsx
@@ -23,7 +23,7 @@ export function AuthShell({
return (
<div className="min-h-dvh bg-[#f1f4fa] px-4 py-6 text-neutral-900 sm:px-6 lg:flex lg:items-center lg:px-10 lg:py-10">
- <main className="mx-auto grid w-full max-w-6xl overflow-hidden rounded-[2rem] bg-white lg:grid-cols-[minmax(0,0.92fr)_minmax(0,1.08fr)]">
+ <main className="mx-auto grid w-full max-w-6xl overflow-hidden rounded-4xl bg-white lg:grid-cols-[minmax(0,0.92fr)_minmax(0,1.08fr)]">
<section className="flex flex-col p-7 sm:p-10 lg:p-14">
<div className="flex items-center gap-2">
<span className="flex items-center justify-center overflow-hidden">
diff --git a/src/components/auth/turnstile.tsx b/src/components/auth/turnstile.tsx
index 674fd14..975ea03 100644
--- a/src/components/auth/turnstile.tsx
+++ b/src/components/auth/turnstile.tsx
@@ -1,6 +1,7 @@
"use client";
import { useEffect, useRef, useState } from "react";
+import { Input } from "@/components/ui/input";
type TurnstileWindow = Window & {
turnstile?: {
@@ -89,7 +90,7 @@ export function TurnstileField({
return (
<div className="space-y-2">
<div ref={containerRef} />
- <input type="hidden" name={name} value={token} />
+ <Input type="hidden" name={name} value={token} />
</div>
);
}
diff --git a/src/components/compose/compose-form.tsx b/src/components/compose/compose-form.tsx
index 800248d..1330c75 100644
--- a/src/components/compose/compose-form.tsx
+++ b/src/components/compose/compose-form.tsx
@@ -291,7 +291,7 @@ export function ComposeForm({
</div>
)}
<div className="flex items-center gap-3 border-t border-neutral-100 px-4 py-3">
- <input
+ <Input
ref={attachmentInput}
type="file"
multiple
diff --git a/src/components/license-indicator.tsx b/src/components/license-indicator.tsx
index 39d4584..c592cc2 100644
--- a/src/components/license-indicator.tsx
+++ b/src/components/license-indicator.tsx
@@ -3,9 +3,9 @@
import Link from "next/link";
import { useEffect, useState } from "react";
import { Button } from "@/components/ui/button";
-import { LICENSE_STATUS_CHANGED_EVENT } from "@/lib/licenses/constants";
import type { LicenseStatus } from "@/lib/licenses/types";
import { loadLicenseIndicatorStatus } from "./license-indicator-utils";
+import { LICENSE_STATUS_CHANGED_EVENT } from "@/lib/licenses/constants";
export function LicenseIndicator() {
const [license, setLicense] = useState<LicenseStatus | null>(null);
@@ -27,22 +27,14 @@ export function LicenseIndicator() {
};
}, []);
- if (!license) return null;
+ if (!license || license.active) return null;
- if (license.active) {
- return (
- <Link
+ return (
+ <Link
href="/licenses"
- className="rounded-full bg-blue-100 px-3 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-blue-800 hover:bg-blue-200"
+ className="rounded-full bg-blue-100 px-4 py-2 text-[11px] font-semibold uppercase tracking-wide text-blue-900 hover:bg-blue-200"
>
- {license.plan}
+ Upgrade
</Link>
- );
- }
-
- return (
- <Button asChild size="sm">
- <Link href="/licenses">Upgrade</Link>
- </Button>
);
}
diff --git a/src/components/mail-search/mail-search-input.tsx b/src/components/mail-search/mail-search-input.tsx
index b2f86b9..44a03b1 100644
--- a/src/components/mail-search/mail-search-input.tsx
+++ b/src/components/mail-search/mail-search-input.tsx
@@ -1,6 +1,7 @@
"use client";
import { Search, X } from "lucide-react";
+import { Input } from "@/components/ui/input";
import { useMailSearch } from "./mail-search-context";
export function MailSearchInput() {
@@ -9,11 +10,11 @@ export function MailSearchInput() {
return (
<div className="flex h-12 flex-1 items-center gap-3 rounded-full bg-[#eaf1fb] px-4 text-neutral-600">
<Search className="h-5 w-5 shrink-0" />
- <input
+ <Input
value={query}
onChange={(event) => setQuery(event.target.value)}
placeholder='Search mail'
- className="h-full min-w-0 flex-1 bg-transparent text-[15px] text-neutral-800 outline-none placeholder:text-neutral-500"
+ className="h-full min-w-0 flex-1 bg-transparent text-[15px] text-neutral-800 outline-none! shadow-none! border-none! placeholder:text-neutral-500"
/>
{query && (
<button
diff --git a/src/components/messages/bulk-message-toolbar.tsx b/src/components/messages/bulk-message-toolbar.tsx
index 1d68c97..f7486e6 100644
--- a/src/components/messages/bulk-message-toolbar.tsx
+++ b/src/components/messages/bulk-message-toolbar.tsx
@@ -2,6 +2,7 @@
import { Archive, Mail, MailOpen, ShieldAlert, Trash2, X } from "lucide-react";
import { Button } from "@/components/ui/button";
+import { Select } from "@/components/ui/select";
import { Tooltip } from "@/components/ui/tooltip";
import type { BulkMessageAction } from "@/app/api/messages/bulk/types";
import type { BulkMessageToolbarProps } from "./types";
@@ -49,9 +50,8 @@ export function BulkMessageToolbar({
</Tooltip>
<span className="flex-1" />
<Tooltip label="Move selected messages">
- <span className="rounded-lg border border-neutral-200 px-2">
- <select
- className="bg-white text-xs font-medium pb-1 text-neutral-700 outline-none pr-2"
+ <Select
+ className="bg-white text-xs font-medium py-2 text-neutral-700 outline-none"
disabled={pending}
defaultValue=""
aria-label="Move selected messages"
@@ -65,8 +65,7 @@ export function BulkMessageToolbar({
<option value="archive">Archived</option>
<option value="spam">Spam</option>
<option value="trash">Trash</option>
- </select>
- </span>
+ </Select>
</Tooltip>
<Tooltip label="Clear selection">
<Button variant="ghost" size="sm" onClick={onClearSelection} disabled={pending} aria-label="Clear selection">
diff --git a/src/components/messages/message-folder-page.tsx b/src/components/messages/message-folder-page.tsx
index d8c3206..012e65a 100644
--- a/src/components/messages/message-folder-page.tsx
+++ b/src/components/messages/message-folder-page.tsx
@@ -4,6 +4,7 @@ import Link from "next/link";
import { useEffect, useMemo, useState } from "react";
import { ChevronLeft, ChevronRight } from "lucide-react";
import { Button } from "@/components/ui/button";
+import { Checkbox } from "@/components/ui/checkbox";
import { Tooltip } from "@/components/ui/tooltip";
import { SkeletonRows } from "@/components/ui/skeleton";
import { useCompose } from "@/components/compose/compose-context";
@@ -66,8 +67,7 @@ function MessageListRow({
}}
>
<MessageNavigationProgress progress={navigation.progress} />
- <input
- type="checkbox"
+ <Checkbox
checked={selected}
onChange={(event) => onSelectedChange(message.id, event.target.checked)}
className="mt-1 h-4 w-4 rounded border-neutral-300"
@@ -127,8 +127,7 @@ function MessageListRow({
if (config.folder === "drafts") {
return (
<div className={className}>
- <input
- type="checkbox"
+ <Checkbox
checked={selected}
onChange={(event) => onSelectedChange(message.id, event.target.checked)}
className="h-4 w-4 rounded border-neutral-300"
@@ -151,8 +150,7 @@ function MessageListRow({
}}
>
<MessageNavigationProgress progress={navigation.progress} />
- <input
- type="checkbox"
+ <Checkbox
checked={selected}
onChange={(event) => onSelectedChange(message.id, event.target.checked)}
className="h-4 w-4 rounded border-neutral-300"
@@ -267,8 +265,7 @@ export function MessageFolderPage({
<div className={`flex h-14 shrink-0 items-center justify-between border-b border-neutral-200 ${compact ? "px-4" : "px-6"}`}>
<div className="flex items-center gap-3 w-full">
<Tooltip label="Select all visible messages">
- <input
- type="checkbox"
+ <Checkbox
checked={allVisibleSelected}
disabled={messages.length === 0}
onChange={(event) => toggleAllVisible(event.target.checked)}
diff --git a/src/components/settings/import-messages.tsx b/src/components/settings/import-messages.tsx
index 060980a..212ccb7 100644
--- a/src/components/settings/import-messages.tsx
+++ b/src/components/settings/import-messages.tsx
@@ -7,6 +7,7 @@ import { useSelectedMailbox } from "@/components/mailbox-provider";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Label } from "@/components/ui/label";
+import { Input } from "@/components/ui/input";
import type { ImportMessagesProps, ImportMessagesResult } from "./import-messages-types";
import { getImportSummary, importMessageFiles } from "./import-messages-utils";
@@ -51,7 +52,7 @@ export function ImportMessages({ destination, sourceLabel }: ImportMessagesProps
<form onSubmit={onSubmit} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="mail-import">Mail export files</Label>
- <input
+ <Input
id="mail-import"
type="file"
accept=".eml,.mbox,.mbx,message/rfc822,application/mbox"
diff --git a/src/components/settings/inbox-rules.tsx b/src/components/settings/inbox-rules.tsx
index 1b9cfef..dd6ee7a 100644
--- a/src/components/settings/inbox-rules.tsx
+++ b/src/components/settings/inbox-rules.tsx
@@ -16,6 +16,7 @@ import {
} from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
+import { Select } from "@/components/ui/select";
import type { InboxRule, InboxRuleInput } from "./inbox-rules-types";
import {
createInboxRule,
@@ -206,7 +207,7 @@ export function InboxRules() {
<div className="grid gap-3 sm:grid-cols-2">
<div className="space-y-2">
<Label htmlFor="matchField">Field</Label>
- <select
+ <Select
id="matchField"
className="h-10 w-full rounded-md border border-neutral-200 px-3 text-sm"
value={matchField}
@@ -219,11 +220,11 @@ export function InboxRules() {
<option value="email">Email address</option>
<option value="content">Content</option>
<option value="title">Title</option>
- </select>
+ </Select>
</div>
<div className="space-y-2">
<Label htmlFor="matchOperator">Match</Label>
- <select
+ <Select
id="matchOperator"
className="h-10 w-full rounded-md border border-neutral-200 px-3 text-sm"
value={matchOperator}
@@ -233,7 +234,7 @@ export function InboxRules() {
>
<option value="contains">Contains</option>
<option value="exact">Exact match</option>
- </select>
+ </Select>
</div>
</div>
<div className="space-y-2">
@@ -249,7 +250,7 @@ export function InboxRules() {
</div>
<div className="space-y-2">
<Label htmlFor="destination">Destination</Label>
- <select
+ <Select
id="destination"
className="h-10 w-full rounded-md border border-neutral-200 px-3 text-sm"
value={destination}
@@ -263,7 +264,7 @@ export function InboxRules() {
{folder.name}
</option>
))}
- </select>
+ </Select>
</div>
{save.isError && (
<p className="text-sm text-red-600">{save.error.message}</p>
diff --git a/src/components/settings/profile-avatar-form.tsx b/src/components/settings/profile-avatar-form.tsx
index 41fe83a..867d2d2 100644
--- a/src/components/settings/profile-avatar-form.tsx
+++ b/src/components/settings/profile-avatar-form.tsx
@@ -8,6 +8,7 @@ import {
getProfileAvatarUrl,
} from "@/lib/profile/avatar-client";
import { dispatchMailboxAvatarChanged } from "@/lib/mailboxes/avatar-client";
+import { Input } from "@/components/ui/input";
import type { ProfileAvatarFormProps, ProfileAvatarSessionResponse } from "./types";
import {
getMailboxProfileAvatarUrl,
@@ -84,7 +85,7 @@ export function ProfileAvatarForm({
return (
<div className="flex flex-col items-start gap-2">
- <input
+ <Input
ref={inputRef}
type="file"
accept={PROFILE_AVATAR_ACCEPT}
diff --git a/src/components/ui/checkbox-types.d.ts b/src/components/ui/checkbox-types.d.ts
new file mode 100644
index 0000000..9f463ae
--- /dev/null
+++ b/src/components/ui/checkbox-types.d.ts
@@ -0,0 +1,3 @@
+import type * as React from "react";
+
+export type CheckboxProps = Omit<React.ComponentProps<"input">, "type">;
diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx
new file mode 100644
index 0000000..703c2bc
--- /dev/null
+++ b/src/components/ui/checkbox.tsx
@@ -0,0 +1,18 @@
+import * as React from "react";
+import { cn } from "@/lib/utils";
+import type { CheckboxProps } from "./checkbox-types";
+
+export const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(
+ ({ className, ...props }, ref) => (
+ <input
+ type="checkbox"
+ className={cn(
+ "h-4 w-4 shrink-0 rounded border-neutral-300 text-blue-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
+ className,
+ )}
+ ref={ref}
+ {...props}
+ />
+ ),
+);
+Checkbox.displayName = "Checkbox";
diff --git a/src/components/ui/select-types.d.ts b/src/components/ui/select-types.d.ts
new file mode 100644
index 0000000..7962a51
--- /dev/null
+++ b/src/components/ui/select-types.d.ts
@@ -0,0 +1,3 @@
+import type * as React from "react";
+
+export type SelectProps = React.ComponentProps<"select">;
diff --git a/src/components/ui/select.tsx b/src/components/ui/select.tsx
new file mode 100644
index 0000000..fdf4cad
--- /dev/null
+++ b/src/components/ui/select.tsx
@@ -0,0 +1,19 @@
+import * as React from "react";
+import { cn } from "@/lib/utils";
+import type { SelectProps } from "./select-types";
+
+export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
+ ({ className, ...props }, ref) => (
+ <span className="rounded-lg border border-neutral-200 px-2">
+ <select
+ className={cn(
+ "flex w-full rounded-md bg-transparent focus-visible:border-blue-600 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
+ className,
+ )}
+ ref={ref}
+ {...props}
+ />
+ </span>
+ ),
+);
+Select.displayName = "Select";