2022-11-28 04:44:31 +00:00
|
|
|
type DefaultStylesheet = {
|
|
|
|
|
[key: string]: string | DefaultStylesheet;
|
|
|
|
|
} & {
|
|
|
|
|
childStylesheet?: AppThemeStylesheet;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type Stylesheet<T = void> = T extends void
|
|
|
|
|
? DefaultStylesheet
|
|
|
|
|
: T & DefaultStylesheet;
|
|
|
|
|
|
2023-10-11 07:35:24 +00:00
|
|
|
export interface AppThemeStylesheet {
|
2022-11-28 04:44:31 +00:00
|
|
|
[key: string]: Stylesheet;
|
2023-10-11 07:35:24 +00:00
|
|
|
}
|
2022-11-28 04:44:31 +00:00
|
|
|
|
2023-10-11 07:35:24 +00:00
|
|
|
export interface ButtonStyles {
|
2022-11-28 04:44:31 +00:00
|
|
|
resetButtonStyles: {
|
|
|
|
|
[key: string]: string;
|
|
|
|
|
};
|
|
|
|
|
submitButtonStyles: {
|
2022-05-04 09:45:57 +00:00
|
|
|
[key: string]: string;
|
|
|
|
|
};
|
2023-10-11 07:35:24 +00:00
|
|
|
}
|
2022-05-04 09:45:57 +00:00
|
|
|
|
2023-10-11 07:35:24 +00:00
|
|
|
export interface ChildStylesheet {
|
2022-11-28 04:44:31 +00:00
|
|
|
childStylesheet: AppThemeStylesheet;
|
2023-10-11 07:35:24 +00:00
|
|
|
}
|
2022-11-28 04:44:31 +00:00
|
|
|
|
2023-10-11 07:35:24 +00:00
|
|
|
export interface AppTheme {
|
2022-05-04 09:45:57 +00:00
|
|
|
id: string;
|
|
|
|
|
name: string;
|
|
|
|
|
displayName: string;
|
|
|
|
|
created_by: string;
|
|
|
|
|
created_at: string;
|
|
|
|
|
isSystemTheme?: boolean;
|
|
|
|
|
// available values for particular type
|
|
|
|
|
// NOTE: config represents options available and
|
|
|
|
|
// properties represents the selected option
|
|
|
|
|
config: {
|
2023-09-21 06:54:31 +00:00
|
|
|
order: number;
|
|
|
|
|
isDeprecated?: boolean;
|
2022-05-04 09:45:57 +00:00
|
|
|
colors: {
|
|
|
|
|
primaryColor: string;
|
|
|
|
|
backgroundColor: string;
|
|
|
|
|
[key: string]: string;
|
|
|
|
|
};
|
|
|
|
|
borderRadius: {
|
|
|
|
|
[key: string]: {
|
|
|
|
|
[key: string]: string;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
boxShadow: {
|
|
|
|
|
[key: string]: {
|
|
|
|
|
[key: string]: string;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
fontFamily: {
|
|
|
|
|
[key: string]: string[];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
// styles for specific widgets
|
2022-11-28 04:44:31 +00:00
|
|
|
stylesheet: AppThemeStylesheet;
|
2022-05-04 09:45:57 +00:00
|
|
|
// current values for the theme
|
2023-12-28 06:46:28 +00:00
|
|
|
properties: AppThemeProperties;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface AppThemeProperties {
|
|
|
|
|
colors: {
|
|
|
|
|
primaryColor: string;
|
|
|
|
|
backgroundColor: string;
|
2024-09-06 07:16:51 +00:00
|
|
|
[key: Exclude<string, number>]: string;
|
2023-12-28 06:46:28 +00:00
|
|
|
};
|
|
|
|
|
borderRadius: {
|
|
|
|
|
[key: string]: string;
|
|
|
|
|
};
|
|
|
|
|
boxShadow: {
|
|
|
|
|
[key: string]: string;
|
|
|
|
|
};
|
|
|
|
|
fontFamily: {
|
|
|
|
|
[key: string]: string;
|
2022-05-04 09:45:57 +00:00
|
|
|
};
|
2023-10-11 07:35:24 +00:00
|
|
|
}
|
2023-07-08 14:07:26 +00:00
|
|
|
|
2023-10-11 07:35:24 +00:00
|
|
|
export interface SetterConfig {
|
2023-07-08 14:07:26 +00:00
|
|
|
__setters: {
|
|
|
|
|
[key: string]: {
|
|
|
|
|
path: string;
|
|
|
|
|
type: string;
|
|
|
|
|
disabled?: string;
|
2023-07-24 06:53:45 +00:00
|
|
|
accessor?: string;
|
2023-07-08 14:07:26 +00:00
|
|
|
};
|
|
|
|
|
};
|
2023-10-11 07:35:24 +00:00
|
|
|
}
|