Skip to content

Commit a911a62

Browse files
committed
chore(i18n): add user profile translations and error messages
1 parent 61c1e5e commit a911a62

File tree

6 files changed

+46
-9
lines changed

6 files changed

+46
-9
lines changed

packages/javascript/src/i18n/en-US.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ const translations: I18nTranslations = {
7878
'username.password.title': 'Sign In',
7979
'username.password.subtitle': 'Enter your username and password to continue.',
8080

81+
/* |---------------------------------------------------------------| */
82+
/* | User Profile | */
83+
/* |---------------------------------------------------------------| */
84+
85+
'user.profile.title': 'Profile',
86+
'user.profile.update.generic.error': 'An error occurred while updating your profile. Please try again.',
87+
8188
/* |---------------------------------------------------------------| */
8289
/* | Organization Switcher | */
8390
/* |---------------------------------------------------------------| */

packages/javascript/src/models/i18n.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ export interface I18nTranslations {
7676
'username.password.title': string;
7777
'username.password.subtitle': string;
7878

79+
/* |---------------------------------------------------------------| */
80+
/* | User Profile | */
81+
/* |---------------------------------------------------------------| */
82+
83+
'user.profile.title': string;
84+
'user.profile.update.generic.error': string;
85+
7986
/* |---------------------------------------------------------------| */
8087
/* | Organization Switcher | */
8188
/* |---------------------------------------------------------------| */

packages/javascript/src/utils/transformBrandingPreferenceToTheme.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import createTheme from '../theme/createTheme';
2323
/**
2424
* Safely extracts a color value from the branding preference structure
2525
*/
26-
type ColorVariant = { main?: string; dark?: string; contrastText?: string };
27-
type TextColors = { primary?: string; secondary?: string; dark?: string };
26+
type ColorVariant = {main?: string; dark?: string; contrastText?: string};
27+
type TextColors = {primary?: string; secondary?: string; dark?: string};
2828

2929
const extractColorValue = (colorVariant?: ColorVariant, preferDark = false): string | undefined => {
3030
if (preferDark && colorVariant?.dark && colorVariant.dark.trim()) {
@@ -77,7 +77,8 @@ const transformThemeVariant = (themeVariant: ThemeVariant, isDark = false): Part
7777
background: {
7878
surface: extractColorValue(colors?.background?.surface as ColorVariant, isDark),
7979
disabled: extractColorValue(colors?.background?.surface as ColorVariant, isDark),
80-
dark: (colors?.background?.surface as ColorVariant)?.dark || (colors?.background?.surface as ColorVariant)?.main,
80+
dark:
81+
(colors?.background?.surface as ColorVariant)?.dark || (colors?.background?.surface as ColorVariant)?.main,
8182
body: {
8283
main: extractColorValue(colors?.background?.body as ColorVariant, isDark),
8384
dark: (colors?.background?.body as ColorVariant)?.dark || (colors?.background?.body as ColorVariant)?.main,

packages/react/src/components/presentation/UserDropdown/BaseUserDropdown.styles.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ const useStyles = (theme: Theme, colorScheme: string) => {
3737
border: none;
3838
cursor: pointer;
3939
border-radius: ${theme.vars.borderRadius.medium};
40-
transition: background-color 0.15s ease-in-out;
40+
transition: none;
41+
box-shadow: none;
42+
background-color: transparent;
4143
4244
&:hover {
4345
background-color: ${theme.vars.colors.action?.hover || 'rgba(0, 0, 0, 0.05)'};
@@ -47,6 +49,11 @@ const useStyles = (theme: Theme, colorScheme: string) => {
4749
outline: 2px solid ${theme.vars.colors.primary};
4850
outline-offset: 2px;
4951
}
52+
53+
&:hover, &:focus, &:active, &:focus-visible {
54+
transition: none;
55+
box-shadow: none;
56+
}
5057
`;
5158

5259
const userName = css`
@@ -86,16 +93,23 @@ const useStyles = (theme: Theme, colorScheme: string) => {
8693
color: ${theme.vars.colors.text.primary};
8794
text-decoration: none;
8895
border: none;
89-
background: none;
9096
cursor: pointer;
9197
font-size: 0.875rem;
9298
text-align: left;
9399
border-radius: ${theme.vars.borderRadius.medium};
94-
transition: background-color 0.15s ease-in-out;
100+
transition: none;
101+
box-shadow: none;
102+
background: transparent;
103+
95104
96105
&:hover {
97106
background-color: ${theme.vars.colors.action?.hover || 'rgba(0, 0, 0, 0.05)'};
98107
}
108+
109+
&:hover, &:focus, &:active, &:focus-visible {
110+
transition: none;
111+
box-shadow: none;
112+
}
99113
`;
100114

101115
const menuItemAnchor = css`

packages/react/src/components/presentation/UserProfile/BaseUserProfile.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const useStyles = (theme: Theme, colorScheme: string) => {
113113
`;
114114

115115
const info = css`
116-
padding: calc(${theme.vars.spacing.unit} * 2) 0;
116+
padding: calc(${theme.vars.spacing.unit} * 1.5) 0;
117117
border-bottom: 1px solid ${theme.vars.colors.border};
118118
`;
119119

packages/react/src/components/primitives/Dialog/Dialog.styles.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,16 @@ const useStyles = (theme: Theme, colorScheme: string) => {
4141
border-radius: ${theme.vars.borderRadius.large};
4242
box-shadow: 0 2px 8px ${colorScheme === 'dark' ? 'rgba(0, 0, 0, 0.3)' : 'rgba(0, 0, 0, 0.15)'};
4343
outline: none;
44-
max-width: 50vw;
45-
min-width: 50vw;
44+
max-width: 35vw;
45+
min-width: 35vw;
46+
@media (max-width: 900px) {
47+
max-width: 80vw;
48+
min-width: 80vw;
49+
}
50+
@media (max-width: 600px) {
51+
max-width: 95vw;
52+
min-width: 95vw;
53+
}
4654
max-height: 90vh;
4755
overflow-y: auto;
4856
z-index: 10000;

0 commit comments

Comments
 (0)