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: 'Theme applied on a visitor’s first visit. System = the visitor’s device setting.', }, defaultValue: 'light', options: [ { label: 'Light', value: 'light' }, { label: 'Dark', value: 'dark' }, { label: 'System', value: 'system' }, ], required: true, }, { name: 'allowThemeToggle', type: 'checkbox', admin: { description: 'Show a light/dark switch on the site.', }, defaultValue: true, }, { name: 'themeToggleLabel', type: 'text', admin: { condition: (data) => Boolean(data?.allowThemeToggle), description: 'Name of the switch read by screen readers, e.g. "Dark mode".', }, label: 'Toggle label', localized: true, }, ]