Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
dcde365
feat(react): add Loading component and update exports in index file
brionmario Jul 7, 2025
98cd771
chore(react): add Loading, SignedIn, and SignedOut components with up…
brionmario Jul 7, 2025
9dc1a5c
feat(react): add Loading component and update exports in index file
brionmario Jul 7, 2025
5a3523f
fix(react): correct import path for useAsgardeo in SignedOut component
brionmario Jul 7, 2025
a1a6afe
chore(react): add changeset for import path fix and component rename
brionmario Jul 7, 2025
3607845
feat(javascript): add bem utility function for BEM-style class name g…
brionmario Jul 8, 2025
91e17cf
chore(react): implement BEM-style styling for BaseCreateOrganization …
brionmario Jul 8, 2025
0fa5c7b
chore(react): implement BEM-style styling for OrganizationList and Ba…
brionmario Jul 8, 2025
eac859c
chore(react): replace clsx with cx for class name handling in SignIn,…
brionmario Jul 8, 2025
5699aab
chore(react): replace clsx with cx for class name handling in Popover…
brionmario Jul 8, 2025
3b305b1
chore(react): rename `Popover` to `Dialog`
brionmario Jul 8, 2025
e382eb5
chore(react): replace clsx with cx for class name handling across mul…
brionmario Jul 8, 2025
7717e12
chore(react): update @types/react to version 19.1.5 and remove clsx d…
brionmario Jul 8, 2025
fdd1bab
chore(react): implement Button styles using BEM methodology and refac…
brionmario Jul 9, 2025
ccd3e72
chore(react): enhance Alert component with new styles and add info va…
brionmario Jul 9, 2025
3226d61
chore(react): implement Avatar component styles using BEM methodology…
brionmario Jul 9, 2025
ca32420
chore(react): add Card component styles using BEM methodology and ref…
brionmario Jul 9, 2025
621b9fc
chore(react): remove transition effect from Button component styles
brionmario Jul 9, 2025
7819ed2
chore(react): add Checkbox component styles using BEM methodology and…
brionmario Jul 9, 2025
401806b
chore(react): add DatePicker component styles using BEM methodology a…
brionmario Jul 9, 2025
30c9f56
chore(react): add Dialog component styles using BEM methodology and r…
brionmario Jul 9, 2025
64d2400
chore(react): refactor Dialog component to use subcomponents and upda…
brionmario Jul 9, 2025
f221ffc
chore(react): implement Divider component styles using BEM methodolog…
brionmario Jul 9, 2025
20e8c25
chore(react): add FormControl component styles using BEM methodology …
brionmario Jul 9, 2025
4b488e0
chore(react): add InputLabel component styles using BEM methodology a…
brionmario Jul 9, 2025
9d6ad41
chore(react): add KeyValueInput component styles using BEM methodolog…
brionmario Jul 9, 2025
24a2adc
chore(react): implement Logo component styles using BEM methodology a…
brionmario Jul 9, 2025
b82d1e2
chore(react): add MultiInput component styles using BEM methodology a…
brionmario Jul 9, 2025
a66b609
chore(react): add OtpField component styles using BEM methodology and…
brionmario Jul 9, 2025
456b066
chore(react): add PasswordField component styles using BEM methodolog…
brionmario Jul 9, 2025
07f2133
chore(react): create Select component styles using BEM methodology an…
brionmario Jul 9, 2025
9725aad
chore(react): implement Spinner component styles using BEM methodolog…
brionmario Jul 9, 2025
4eaffd1
chore(react): add TextField component styles using BEM methodology an…
brionmario Jul 9, 2025
7a59d1d
chore(react): implement Typography component styles using BEM methodo…
brionmario Jul 9, 2025
9c6c0e9
chore(react): refactor FormControl, MultiInput, and PasswordField com…
brionmario Jul 9, 2025
c35b2de
chore(react): refactor TextField styles to use theme vars for consist…
brionmario Jul 9, 2025
0fcb2dc
chore(react): refactor BaseCreateOrganization styles to use consisten…
brionmario Jul 9, 2025
3fd9452
chore(react): add BaseOrganizationSwitcher styles using BEM methodolo…
brionmario Jul 9, 2025
b22ac66
chore(react): refactor BaseCreateOrganization component styles to use…
brionmario Jul 9, 2025
f42543c
chore(react): add formatDate utility function for improved date forma…
brionmario Jul 9, 2025
18a7e3e
chore(react): add BaseSignIn styles using Emotion for improved stylin…
brionmario Jul 9, 2025
bec7aa5
chore(react): add BaseSignUp styles using Emotion for improved stylin…
brionmario Jul 9, 2025
b5eedf8
chore(react): implement BaseUserDropdown styles using Emotion for imp…
brionmario Jul 9, 2025
95e9b3c
chore(javascript): add info color properties to theme configuration f…
brionmario Jul 13, 2025
716d910
chore(react): use BEM
brionmario Jul 13, 2025
148b273
chore(react): add support for organization SSO in BaseSignIn component
brionmario Jul 13, 2025
7c2ae80
chore(samples): remove unused transition and focus styles for cleaner…
brionmario Jul 14, 2025
a175ecf
chore: add changeset 🦋
brionmario Jul 14, 2025
61c1e5e
chore(react): fix profile update
brionmario Jul 24, 2025
a911a62
chore(i18n): add user profile translations and error messages
brionmario Jul 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/five-geese-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@asgardeo/react': patch
---

- Fix import path for useAsgardeo in SignedOut component
- Rename `AsgardeoLoading` -> `Loading`
8 changes: 8 additions & 0 deletions .changeset/public-donkeys-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@asgardeo/javascript': patch
'@asgardeo/nextjs': patch
'@asgardeo/node': patch
'@asgardeo/react': patch
---

Fix `getAccessToken` imperative usage
5 changes: 3 additions & 2 deletions packages/javascript/src/api/updateMeProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ const updateMeProfile = async ({
}

throw new AsgardeoAPIError(
`Network or parsing error: ${error instanceof Error ? error.message : 'Unknown error'}`,
error?.response?.data?.detail ||
'An error occurred while updating the user profile. Please try again.',
'updateMeProfile-NetworkError-001',
'javascript',
0,
error?.data?.status,
'Network Error',
);
}
Expand Down
10 changes: 3 additions & 7 deletions packages/javascript/src/errors/AsgardeoError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@ export default class AsgardeoError extends Error {

constructor(message: string, code: string, origin: string) {
const _origin: string = AsgardeoError.resolveOrigin(origin);
const prefix: string = `🛡️ Asgardeo - ${_origin}:`;
const regex: RegExp = new RegExp(`🛡️\\s*Asgardeo\\s*-\\s*${_origin}:`, 'i');
const sanitized: string = message.replace(regex, '');
const _message: string = `${prefix} ${sanitized.trim()}\n\n(code="${code}")\n`;

super(_message);
super(message);

this.name = new.target.name;
this.code = code;
Expand All @@ -72,6 +67,7 @@ export default class AsgardeoError extends Error {
}

public override toString(): string {
return `[${this.name}]\nMessage: ${this.message}`;
const prefix: string = `🛡️ Asgardeo - ${this.origin}:`;
return `[${this.name}]\n${prefix} ${this.message}\n(code=\"${this.code}\")`;
}
}
7 changes: 7 additions & 0 deletions packages/javascript/src/i18n/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ const translations: I18nTranslations = {
'username.password.title': 'Sign In',
'username.password.subtitle': 'Enter your username and password to continue.',

/* |---------------------------------------------------------------| */
/* | User Profile | */
/* |---------------------------------------------------------------| */

'user.profile.title': 'Profile',
'user.profile.update.generic.error': 'An error occurred while updating your profile. Please try again.',

/* |---------------------------------------------------------------| */
/* | Organization Switcher | */
/* |---------------------------------------------------------------| */
Expand Down
2 changes: 2 additions & 0 deletions packages/javascript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ export {default as AsgardeoJavaScriptClient} from './AsgardeoJavaScriptClient';
export {default as createTheme} from './theme/createTheme';
export {ThemeColors, ThemeConfig, Theme, ThemeMode, ThemeDetection} from './theme/types';

export {default as bem} from './utils/bem';
export {default as formatDate} from './utils/formatDate';
export {default as processUsername} from './utils/processUsername';
export {default as deepMerge} from './utils/deepMerge';
export {default as deriveOrganizationHandleFromBaseUrl} from './utils/deriveOrganizationHandleFromBaseUrl';
Expand Down
7 changes: 7 additions & 0 deletions packages/javascript/src/models/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ export interface I18nTranslations {
'username.password.title': string;
'username.password.subtitle': string;

/* |---------------------------------------------------------------| */
/* | User Profile | */
/* |---------------------------------------------------------------| */

'user.profile.title': string;
'user.profile.update.generic.error': string;

/* |---------------------------------------------------------------| */
/* | Organization Switcher | */
/* |---------------------------------------------------------------| */
Expand Down
50 changes: 44 additions & 6 deletions packages/javascript/src/theme/createTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,46 @@ const lightTheme: ThemeConfig = {
primary: {
main: '#1a73e8',
contrastText: '#ffffff',
dark: '#174ea6',
},
secondary: {
main: '#424242',
contrastText: '#ffffff',
dark: '#212121',
},
background: {
surface: '#ffffff',
disabled: '#f0f0f0',
dark: '#212121',
body: {
main: '#1a1a1a',
dark: '#212121',
},
},
error: {
main: '#d32f2f',
contrastText: '#ffffff',
contrastText: '#d52828',
dark: '#b71c1c',
},
info: {
main: '#bbebff',
contrastText: '#43aeda',
dark: '#01579b',
},
success: {
main: '#4caf50',
contrastText: '#ffffff',
contrastText: '#00a807',
dark: '#388e3c',
},
warning: {
main: '#ff9800',
contrastText: '#ffffff',
contrastText: '#be7100',
dark: '#f57c00',
},
text: {
primary: '#1a1a1a',
secondary: '#666666',
dark: '#212121',
},
border: '#e0e0e0',
},
Expand Down Expand Up @@ -144,33 +157,46 @@ const darkTheme: ThemeConfig = {
primary: {
main: '#1a73e8',
contrastText: '#ffffff',
dark: '#174ea6',
},
secondary: {
main: '#424242',
contrastText: '#ffffff',
dark: '#212121',
},
background: {
surface: '#121212',
disabled: '#1f1f1f',
dark: '#212121',
body: {
main: '#ffffff',
dark: '#212121',
},
},
error: {
main: '#d32f2f',
contrastText: '#ffffff',
contrastText: '#d52828',
dark: '#b71c1c',
},
info: {
main: '#bbebff',
contrastText: '#43aeda',
dark: '#01579b',
},
success: {
main: '#4caf50',
contrastText: '#ffffff',
contrastText: '#00a807',
dark: '#388e3c',
},
warning: {
main: '#ff9800',
contrastText: '#ffffff',
contrastText: '#be7100',
dark: '#f57c00',
},
text: {
primary: '#ffffff',
secondary: '#b3b3b3',
dark: '#212121',
},
border: '#404040',
},
Expand Down Expand Up @@ -306,6 +332,14 @@ const toCssVariables = (theme: ThemeConfig): Record<string, string> => {
cssVars[`--${prefix}-color-warning-contrastText`] = theme.colors.warning.contrastText;
}

// Colors - Info
if (theme.colors?.info?.main) {
cssVars[`--${prefix}-color-info-main`] = theme.colors.info.main;
}
if (theme.colors?.info?.contrastText) {
cssVars[`--${prefix}-color-info-contrastText`] = theme.colors.info.contrastText;
}

// Colors - Text
if (theme.colors?.text?.primary) {
cssVars[`--${prefix}-color-text-primary`] = theme.colors.text.primary;
Expand Down Expand Up @@ -455,6 +489,10 @@ const toThemeVars = (theme: ThemeConfig): ThemeVars => {
main: `var(--${prefix}-color-error-main)`,
contrastText: `var(--${prefix}-color-error-contrastText)`,
},
info: {
contrastText: `var(--${prefix}-color-info-contrastText)`,
main: `var(--${prefix}-color-info-main)`,
},
success: {
main: `var(--${prefix}-color-success-main)`,
contrastText: `var(--${prefix}-color-success-contrastText)`,
Expand Down
26 changes: 26 additions & 0 deletions packages/javascript/src/theme/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,34 +57,47 @@ export interface ThemeColors {
background: {
body: {
main: string;
dark?: string;
};
disabled: string;
surface: string;
dark?: string;
};
border: string;
error: {
contrastText: string;
main: string;
dark?: string;
};
info: {
contrastText: string;
main: string;
dark?: string;
};
primary: {
contrastText: string;
main: string;
dark?: string;
};
secondary: {
contrastText: string;
main: string;
dark?: string;
};
success: {
contrastText: string;
main: string;
dark?: string;
};
text: {
primary: string;
secondary: string;
dark?: string;
};
warning: {
contrastText: string;
main: string;
dark?: string;
};
}

Expand Down Expand Up @@ -155,33 +168,46 @@ export interface ThemeVars {
primary: {
main: string;
contrastText: string;
dark?: string;
};
secondary: {
main: string;
contrastText: string;
dark?: string;
};
background: {
surface: string;
disabled: string;
dark?: string;
body: {
main: string;
dark?: string;
};
};
error: {
main: string;
contrastText: string;
dark?: string;
};
info: {
contrastText: string;
main: string;
dark?: string;
};
success: {
main: string;
contrastText: string;
dark?: string;
};
warning: {
main: string;
contrastText: string;
dark?: string;
};
text: {
primary: string;
secondary: string;
dark?: string;
};
border: string;
};
Expand Down
60 changes: 60 additions & 0 deletions packages/javascript/src/utils/bem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/**
* Creates a BEM-style class name by combining a base class with element and/or modifier
*
* @param baseClass - The base CSS class string (usually from emotion's css function)
* @param element - The BEM element name (optional)
* @param modifier - The BEM modifier name (optional)
* @returns The combined class name string
*
* @example
* ```tsx
* const baseClass = css`
* display: flex;
* &__element {
* color: red;
* }
* &--modifier {
* background: blue;
* }
* `;
*
* import bem from './utils/bem';
*
* const elementClass = bem(baseClass, 'element');
* const modifierClass = bem(baseClass, null, 'modifier');
* const elementWithModifierClass = bem(baseClass, 'element', 'modifier');
* ```
*/
const bem = (baseClass: string, element?: string | null, modifier?: string | null): string => {
let className = baseClass;

if (element) {
className += `__${element}`;
}

if (modifier) {
className += `--${modifier}`;
}

return className;
};

export default bem;
Loading
Loading