fix(tts): tighten Card section spacing so titles sit close to content

Card primitive uses `flex flex-col gap-6` which adds 24px between
header and content regardless of `pb-3` on CardHeader. Override the
flex-gap to `gap-3` on each TTS section so the section number/title
visually attaches to its body.

Affects: provider-setup, credentials-section, voice/model card on
tts-page, test-playground, behavior-section.
This commit is contained in:
viettranx
2026-04-20 07:22:32 +07:00
parent 82ca0f117b
commit 5b009caa95
5 changed files with 11 additions and 11 deletions
@@ -27,8 +27,8 @@ export function BehaviorSection({ draft, onUpdate }: Props) {
const [open, setOpen] = useState(true);
return (
<Card>
<CardHeader className="pb-0">
<Card className="gap-3">
<CardHeader>
<button
type="button"
className="flex w-full items-center justify-between py-1 text-left"
@@ -48,7 +48,7 @@ export function BehaviorSection({ draft, onUpdate }: Props) {
</CardHeader>
{open && (
<CardContent className="space-y-4 pt-4">
<CardContent className="space-y-4">
{/* Auto mode */}
<div className="grid gap-1.5">
<Label>{t("general.autoApplyMode")}</Label>
@@ -60,8 +60,8 @@ export function CredentialsSection({ provider, draft, onUpdate, testConnection,
};
return (
<Card>
<CardHeader className="pb-3">
<Card className="gap-3">
<CardHeader>
<CardTitle className="text-base">
2. {t("providerSettings", { provider: t(`providers.${provider}`) })}
</CardTitle>
@@ -22,8 +22,8 @@ export function ProviderSetup({ provider, onChange }: Props) {
const hint = provider === "edge" ? t("edge.hint") : null;
return (
<Card>
<CardHeader className="pb-3">
<Card className="gap-3">
<CardHeader>
<CardTitle className="text-base">
1. {t("general.primaryProvider")}
</CardTitle>
@@ -117,8 +117,8 @@ export function TestPlayground({ provider, voiceId, modelId, synthesize, showAud
const canPlayNow = canPlay({ text, provider }) && !loading;
return (
<Card>
<CardHeader className="pb-3">
<Card className="gap-3">
<CardHeader>
<CardTitle className="text-base">4. {t("playground.title", "Test Playground")}</CardTitle>
</CardHeader>
<CardContent className="space-y-3">
+2 -2
View File
@@ -200,8 +200,8 @@ export function TtsPage() {
)}
{draft.provider && isCredentialsSaved(draft.provider, tts) && (
<Card>
<CardHeader className="pb-3">
<Card className="gap-3">
<CardHeader>
<CardTitle className="text-base">3. {t("voice_label")} &amp; {t("general.title", "Settings")}</CardTitle>
</CardHeader>
<CardContent className="space-y-4">