import type { Field } from 'payload' /** * Theme behavior configuration. * * These are decisions, not visuals — the plugin stores them, the client * template reads them and decides whether to render a toggle and which * mode to start in. Appearance itself stays in the template. */ export const themeFields: Field[] = [ { name: 'defaultTheme', type: 'select', admin: { description: { en: 'Used on a visitor’s first visit.', pl: 'Używany przy pierwszej wizycie.', }, }, defaultValue: 'light', label: { en: 'Default theme', pl: 'Domyślny motyw' }, options: [ { label: { en: 'Light', pl: 'Jasny' }, value: 'light' }, { label: { en: 'Dark', pl: 'Ciemny' }, value: 'dark' }, { label: { en: 'Device setting', pl: 'Ustawienie urządzenia' }, value: 'system' }, ], required: true, }, { name: 'allowThemeToggle', type: 'checkbox', defaultValue: true, label: { en: 'Show theme switch', pl: 'Pokaż przełącznik motywu' }, }, { name: 'themeToggleLabel', type: 'text', admin: { condition: (data) => Boolean(data?.allowThemeToggle), description: { en: 'Read aloud by screen readers.', pl: 'Odczytywana przez czytniki ekranu.', }, placeholder: { en: 'Dark mode', pl: 'Tryb ciemny' }, }, label: { en: 'Switch label', pl: 'Etykieta przełącznika' }, localized: true, }, ]