From 7a445583d7a72e5004e5cf8d4ca3c320de66c515 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 29 Mar 2026 01:41:57 +0100 Subject: [PATCH] style: replace native color picker and text input with TREK-style components in holiday calendars --- client/src/components/Vacay/VacaySettings.tsx | 64 ++++++++++++------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/client/src/components/Vacay/VacaySettings.tsx b/client/src/components/Vacay/VacaySettings.tsx index 9c53c01..8513ada 100644 --- a/client/src/components/Vacay/VacaySettings.tsx +++ b/client/src/components/Vacay/VacaySettings.tsx @@ -238,26 +238,35 @@ function CalendarRow({ cal, countries, onUpdate, onDelete }: { fetchRegionOptions(selectedCountry).then(setRegions) }, [selectedCountry]) + const PRESET_COLORS = ['#fecaca', '#fed7aa', '#fde68a', '#bbf7d0', '#a5f3fc', '#c7d2fe', '#e9d5ff', '#fda4af', '#6366f1', '#ef4444', '#22c55e', '#3b82f6'] + const [showColorPicker, setShowColorPicker] = useState(false) + return ( -
- setLocalColor(e.target.value)} - onBlur={() => { if (localColor !== cal.color) onUpdate({ color: localColor }) }} - className="w-7 h-7 shrink-0 rounded cursor-pointer p-0" - style={{ border: 'none', background: 'transparent' }} - title={t('vacay.calendarColor')} - /> +
+
+
+ )} +
setLocalLabel(e.target.value)} onBlur={() => { const v = localLabel.trim() || null; if (v !== cal.label) onUpdate({ label: v }) }} + onKeyDown={e => { if (e.key === 'Enter') (e.target as HTMLInputElement).blur() }} placeholder={t('vacay.calendarLabel')} - className="w-full text-xs px-2 py-1 rounded" - style={{ background: 'var(--bg-card)', border: '1px solid var(--border-primary)', color: 'var(--text-primary)' }} + style={{ width: '100%', fontSize: 12, padding: '6px 10px', borderRadius: 8, background: 'var(--bg-input)', border: '1px solid var(--border-primary)', color: 'var(--text-primary)', fontFamily: 'inherit', outline: 'none' }} /> - setColor(e.target.value)} - className="w-7 h-7 shrink-0 rounded cursor-pointer p-0" - style={{ border: 'none', background: 'transparent' }} - title={t('vacay.calendarColor')} - /> +
+
+
+ )} +
setLabel(e.target.value)} placeholder={t('vacay.calendarLabel')} - className="w-full text-xs px-2 py-1 rounded" - style={{ background: 'var(--bg-card)', border: '1px solid var(--border-primary)', color: 'var(--text-primary)' }} + style={{ width: '100%', fontSize: 12, padding: '6px 10px', borderRadius: 8, background: 'var(--bg-input)', border: '1px solid var(--border-primary)', color: 'var(--text-primary)', fontFamily: 'inherit', outline: 'none' }} />