/** * Starter Theme - Dashboard Configuration * * Controls dashboard UI behavior: topbar, sidebar, settings pages, entity views. * Customize the dashboard experience for your theme. */ export const DASHBOARD_CONFIG = { // ============================================================================= // TOPBAR CONFIGURATION // ============================================================================= topbar: { /** * Global search */ search: { enabled: true, placeholder: 'dashboard.search.placeholder', maxResults: 8, }, /** * Notifications */ notifications: { enabled: true, }, /** * Theme mode toggle (light/dark) */ themeToggle: { enabled: true, }, /** * Help/Support dropdown */ support: { enabled: true, type: 'dropdown', // 'dropdown' | 'link' | 'modal' links: [ { label: 'common.help.documentation', url: '/docs', icon: 'book-open', external: false, }, { label: 'common.help.support', url: '/support', icon: 'help-circle', external: false, }, { label: 'common.help.keyboard', action: 'showKeyboardShortcuts', icon: 'keyboard', }, ], }, /** * Quick create button */ quickCreate: { enabled: true, }, /** * Admin access button (Super Admin area) */ adminAccess: { enabled: true, showToDevelopers: true, }, /** * Dev Zone access button (Developer area) */ devtoolsAccess: { enabled: true, }, /** * User menu */ userMenu: { enabled: true, showAvatar: true, showEmail: true, showRole: false, items: [ { type: 'link', label: 'navigation.profile', href: '/dashboard/settings/profile', icon: 'user', }, { type: 'link', label: 'navigation.settings', href: '/dashboard/settings', icon: 'settings', }, { type: 'divider' }, { type: 'action', label: 'buttons.signOut', action: 'signOut', icon: 'log-out', }, ], }, }, // ============================================================================= // SIDEBAR CONFIGURATION // ============================================================================= sidebar: { defaultCollapsed: false, rememberState: true, collapsedWidth: '60px', expandedWidth: '240px', toggle: { enabled: true, showInTopbar: true, hideOnMobile: false, }, navigation: { showEntityCounts: true, groupEntities: true, showRecents: true, maxRecents: 5, /** * Custom navigation sections * These are added to the sidebar in addition to entity navigation */ sections: [ { id: 'analytics', label: 'common.navigation.analytics', icon: 'BarChart3', href: '/analytics', enabled: true, }, ], }, }, // ============================================================================= // SETTINGS PAGES // ============================================================================= settings: { pages: { profile: { enabled: true, label: 'settings.pages.profile', description: 'settings.pages.profileDescription', icon: 'user', order: 1, features: { avatarUpload: true, nameChange: true, emailChange: true, localeChange: true, timezoneChange: false, }, }, password: { enabled: true, label: 'settings.pages.password', description: 'settings.pages.passwordDescription', icon: 'key', order: 2, features: { passwordChange: true, passwordStrength: true, passwordHistory: false, }, }, 'api-keys': { enabled: true, label: 'settings.pages.apiKeys', description: 'settings.pages.apiKeysDescription', icon: 'key', order: 3, features: { createKeys: true, revokeKeys: true, scopeManagement: true, usageAnalytics: true, }, }, billing: { enabled: true, label: 'settings.pages.billing', description: 'settings.pages.billingDescription', icon: 'credit-card', order: 4, features: { subscriptionManagement: true, paymentMethods: true, invoiceHistory: true, usageMetrics: true, }, requiredRole: 'admin', }, teams: { enabled: true, label: 'settings.pages.teams', description: 'settings.pages.teamsDescription', icon: 'users', order: 5, features: { createTeams: true, manageMembers: true, inviteMembers: true, teamSettings: true, }, }, }, layout: { showDescription: true, showIcons: true, groupByCategory: false, enableSearch: true, }, }, // ============================================================================= // ENTITY PAGES DEFAULTS // ============================================================================= entities: { defaultListView: { pagination: { defaultPageSize: 20, allowedPageSizes: [10, 20, 50, 100], showSizeSelector: true, }, sorting: { enabled: true, defaultSort: { field: 'createdAt', direction: 'desc' }, rememberSort: true, }, filtering: { enabled: true, quickFilters: true, advancedFilters: true, rememberFilters: false, }, search: { enabled: true, placeholder: 'dashboard.entities.searchPlaceholder', searchableFields: ['name', 'title', 'description', 'email'], instantSearch: true, debounceMs: 300, }, }, defaultFormView: { validation: { validateOnBlur: true, validateOnChange: false, showFieldErrors: true, showFormErrors: true, }, autosave: { enabled: false, intervalMs: 30000, showIndicator: true, }, confirmation: { showOnCreate: false, showOnUpdate: true, showOnDelete: true, }, }, /** * Per-entity customizations * Override defaults for specific entities */ customizations: { tasks: { listView: { defaultSort: { field: 'priority', direction: 'desc' }, quickFilters: ['status', 'priority', 'assignee'], }, }, }, }, // ============================================================================= // HOMEPAGE WIDGETS // ============================================================================= homepage: { widgets: { welcome: { enabled: true, showUserName: true, showLastLogin: true, showQuickActions: true, }, stats: { enabled: true, entities: ['tasks'], timeframe: '30days', showTrends: true, }, recentActivity: { enabled: true, maxItems: 10, entities: ['tasks'], showTimestamps: true, }, quickActions: { enabled: true, actions: [ { entity: 'tasks', action: 'create', label: 'dashboard.quickActions.createTask' }, ], }, }, layout: { columns: 3, gutter: 'medium', responsive: true, }, }, // ============================================================================= // PERFORMANCE & BEHAVIOR // ============================================================================= performance: { cache: { entityConfigs: { enabled: true, duration: 5 * 60 * 1000 }, entityData: { enabled: true, duration: 2 * 60 * 1000 }, }, loading: { showSkeletons: true, showProgressBars: true, minimumLoadingTime: 300, }, errors: { showErrorBoundaries: true, logErrors: true, enableRetry: true, maxRetries: 3, }, }, // ============================================================================= // ACCESSIBILITY // ============================================================================= accessibility: { keyboard: { enabled: true, showShortcuts: true, customShortcuts: { 'Ctrl+K': 'openSearch', 'Ctrl+Shift+N': 'quickCreate', 'Ctrl+B': 'toggleSidebar', Esc: 'closeModals', }, }, screenReader: { announceNavigation: true, announceActions: true, announceErrors: true, }, visual: { showFocusOutlines: true, highContrastMode: false, reducedMotion: false, }, }, } as const // ============================================================================= // CONVENIENCE EXPORTS // ============================================================================= export const TOPBAR_CONFIG = DASHBOARD_CONFIG.topbar export const SIDEBAR_CONFIG = DASHBOARD_CONFIG.sidebar export const SETTINGS_CONFIG = DASHBOARD_CONFIG.settings export const ENTITIES_CONFIG = DASHBOARD_CONFIG.entities export const HOMEPAGE_CONFIG = DASHBOARD_CONFIG.homepage export const isSettingsPageEnabled = ( pageKey: keyof typeof DASHBOARD_CONFIG.settings.pages ): boolean => { return DASHBOARD_CONFIG.settings.pages[pageKey]?.enabled ?? false } export const getEnabledSettingsPages = () => { return Object.entries(DASHBOARD_CONFIG.settings.pages) .filter(([_, config]) => config.enabled) .sort((a, b) => a[1].order - b[1].order) .map(([key, config]) => ({ key, ...config })) } export const isTopbarFeatureEnabled = ( feature: keyof typeof DASHBOARD_CONFIG.topbar ): boolean => { return DASHBOARD_CONFIG.topbar[feature]?.enabled ?? false } export default DASHBOARD_CONFIG