Merge remote-tracking branch 'origin/master' into feature/media-library-screen

This commit is contained in:
2026-11-17 16:58:24 +01:00
2 changed files with 21 additions and 28 deletions
@@ -2,6 +2,8 @@ import { useRef, useState, type KeyboardEvent, type PointerEvent } from 'react';
import { useTranslation } from 'react-i18next';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { CheckboxField } from '@/components/ui/checkbox';
import { RadioField } from '@/components/ui/radio';
import { Label } from '@/components/ui/label';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { mediaUrl } from '../lib/media';
@@ -101,29 +103,24 @@ function FocusEditor({ image, onApply, onClose }: { image: HeroImageDto; onApply
<fieldset className="flex flex-wrap gap-4">
<legend className="sr-only">{t('hero.focus.targetLegend')}</legend>
{(['general', 'wide', 'tall'] as const).map((value) => (
<label key={value} className="flex items-center gap-2 text-sm">
<input
type="radio"
name="focus-target"
checked={target === value}
onChange={() => setTarget(value)}
data-testid={`focus-target-${value}`}
/>
{t(`hero.focus.target.${value}`)}
</label>
<RadioField
key={value}
name="focus-target"
checked={target === value}
onChange={() => setTarget(value)}
data-testid={`focus-target-${value}`}
label={t(`hero.focus.target.${value}`)}
/>
))}
</fieldset>
{target !== 'general' && (
<label className="flex items-center gap-2 text-sm">
<input
type="checkbox"
checked={editable}
onChange={(event) => toggleOverride(event.target.checked)}
data-testid={`focus-override-${target}`}
/>
{t('hero.focus.override')}
</label>
<CheckboxField
checked={editable}
onChange={(event) => toggleOverride(event.target.checked)}
data-testid={`focus-override-${target}`}
label={t('hero.focus.override')}
/>
)}
<div className="grid gap-4 md:grid-cols-[2fr_1fr]">
@@ -205,7 +202,7 @@ function FocusEditor({ image, onApply, onClose }: { image: HeroImageDto; onApply
disabled={!editable}
value={active.zoom}
onChange={(event) => update({ ...active, zoom: Number(event.target.value) })}
className="w-full"
className="w-full accent-primary disabled:cursor-not-allowed disabled:opacity-50"
data-testid="focus-zoom"
/>
</div>