evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a small UI module that mounts a date selection control and a paginated list into a provided DOM element. All visible text and accessibility labels for these controls must come from the UI dependency's global localization and accessibility configuration, with runtime switching between English and Spanish.
export type SupportedLocale = 'en' | 'es';
export interface LocaleBundle {
name: SupportedLocale;
calendarLabels: {
monthNames: string[];
dayNamesShort: string[];
today: string;
};
paginationLabels: {
previous: string;
next: string;
pageLabel: (page: number) => string;
};
accessibility?: {
close?: string;
nextPage?: string;
previousPage?: string;
};
}
export interface SetupOptions {
target: HTMLElement;
defaultLocale?: SupportedLocale;
overrides?: {
accessibility?: {
close?: string;
nextPage?: string;
previousPage?: string;
};
};
items: string[];
pageSize: number;
}
export interface LocalizationRuntime {
currentLocale: SupportedLocale;
switchLocale(next: SupportedLocale): void;
formatDate(date: Date): string;
formatPagination(page: number): string;
}
export function createLocalizedUi(locales: LocaleBundle[], options: SetupOptions): LocalizationRuntime;Provides UI components with built-in localization and accessibility configuration.