UNPKG

792 BPlain TextView Raw
1import { UI, DayFlag, SelectionState } from "../UI.js";
2import type { ClassNames } from "../types/index.js";
3
4/**
5 * Get the default class names for the UI elements.
6 *
7 * @group Utilities
8 */
9export function getDefaultClassNames(): ClassNames {
10 const classNames: Partial<Required<ClassNames>> = {};
11
12 for (const key in UI) {
13 classNames[UI[key as keyof typeof UI]] =
14 `rdp-${UI[key as keyof typeof UI]}`;
15 }
16
17 for (const key in DayFlag) {
18 classNames[DayFlag[key as keyof typeof DayFlag]] =
19 `rdp-${DayFlag[key as keyof typeof DayFlag]}`;
20 }
21
22 for (const key in SelectionState) {
23 classNames[SelectionState[key as keyof typeof SelectionState]] =
24 `rdp-${SelectionState[key as keyof typeof SelectionState]}`;
25 }
26
27 return classNames as Required<ClassNames>;
28}