Skip to content

Commit c8e19d6

Browse files
committed
chore: add base support for editing the profile
1 parent eea4d92 commit c8e19d6

File tree

9 files changed

+743
-151
lines changed

9 files changed

+743
-151
lines changed

packages/javascript/src/theme/createTheme.ts

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,21 @@ import {Theme, ThemeConfig} from './types';
2020

2121
const lightTheme: ThemeConfig = {
2222
colors: {
23-
primary: '#1a73e8',
24-
background: '#ffffff',
23+
primary: {
24+
main: '#1a73e8',
25+
contrastText: '#ffffff',
26+
},
27+
background: {
28+
surface: '#f5f5f5',
29+
disabled: '#f0f0f0',
30+
body: {
31+
main: '#1a1a1a',
32+
},
33+
},
34+
error: {
35+
main: '#d32f2f',
36+
contrastText: '#ffffff',
37+
},
2538
surface: '#f5f5f5',
2639
text: {
2740
primary: '#1a1a1a',
@@ -41,8 +54,21 @@ const lightTheme: ThemeConfig = {
4154

4255
const darkTheme: ThemeConfig = {
4356
colors: {
44-
primary: '#3ea6ff',
45-
background: '#1a1a1a',
57+
primary: {
58+
main: '#1a73e8',
59+
contrastText: '#ffffff',
60+
},
61+
background: {
62+
surface: '#121212',
63+
disabled: '#1f1f1f',
64+
body: {
65+
main: '#ffffff',
66+
},
67+
},
68+
error: {
69+
main: '#d32f2f',
70+
contrastText: '#ffffff',
71+
},
4672
surface: '#2d2d2d',
4773
text: {
4874
primary: '#ffffff',
@@ -64,8 +90,13 @@ const toCssVariables = (theme: ThemeConfig): Record<string, string> => {
6490
const cssVars: Record<string, string> = {};
6591

6692
// Colors
67-
cssVars['--asgardeo-color-primary'] = theme.colors.primary;
68-
cssVars['--asgardeo-color-background'] = theme.colors.background;
93+
cssVars['--asgardeo-color-primary-main'] = theme.colors.primary.main;
94+
cssVars['--asgardeo-color-primary-contrastText'] = theme.colors.primary.contrastText;
95+
cssVars['--asgardeo-color-background-surface'] = theme.colors.background.surface;
96+
cssVars['--asgardeo-color-background-disabled'] = theme.colors.background.disabled;
97+
cssVars['--asgardeo-color-background-body-main'] = theme.colors.background.body.main;
98+
cssVars['--asgardeo-color-error-main'] = theme.colors.error.main;
99+
cssVars['--asgardeo-color-error-contrastText'] = theme.colors.error.contrastText;
69100
cssVars['--asgardeo-color-surface'] = theme.colors.surface;
70101
cssVars['--asgardeo-color-text-primary'] = theme.colors.text.primary;
71102
cssVars['--asgardeo-color-text-secondary'] = theme.colors.text.secondary;

packages/javascript/src/theme/types.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,27 @@
1717
*/
1818

1919
export interface ThemeColors {
20-
primary: string;
21-
background: string;
20+
primary: {
21+
main: string;
22+
contrastText: string;
23+
};
24+
background: {
25+
surface: string;
26+
disabled: string;
27+
body: {
28+
main: string;
29+
};
30+
};
2231
surface: string;
2332
text: {
2433
primary: string;
2534
secondary: string;
2635
};
2736
border: string;
37+
error: {
38+
main: string;
39+
contrastText: string;
40+
};
2841
}
2942

3043
export interface ThemeConfig {

packages/javascript/src/utils/getUserProfile.ts

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)