chore(react): improve components & error messages #147
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request introduces notable improvements to theme handling, error management, and sign-in option flexibility across the codebase. The changes add a new
getActiveTheme
utility for consistent theme resolution, update button styling and props for sign-in options, and enhance error handling and accessibility in several components. Additionally, exports are refined for better clarity and usage.Theme Handling Improvements
getActiveTheme
utility (packages/browser/src/theme/getActiveTheme.ts
) to consistently determine the active theme mode based on user preference or system settings. This is now exported and used in both browser and Next.js packages for unified theme resolution. [1] [2] [3] [4]DEFAULT_THEME
constant for theme mode defaults; updated theme color values for dark mode to improve visual consistency. [1] [2] [3] [4]AsgardeoProvider
to useuseMemo
for determining dark mode, improving performance and reliability.Sign-In Option Component Enhancements
createSignInOption
and related props to makeauthenticator
andonSubmit
optional, and improved prop passing for federated and local authenticators for greater flexibility and type safety. [1] [2] [3]EmailOtp
,IdentifierFirst
,MultiOptionButton
) to ensure consistent appearance and behavior. [1] [2] [3]Error Handling and Accessibility
SignInButton
by stringifying error objects for clearer runtime messages.BaseOrganizationSwitcher
by settinginitialFocus={-1}
inFloatingFocusManager
.AsgardeoSPAClient
for better error propagation.Export and API Surface Refinements
packages/javascript/src/index.ts
for clarity, switching from wildcard to named exports for key client and model types.DEFAULT_THEME
and improved type exports for better developer experience. [1] [2]These updates collectively improve the consistency, reliability, and maintainability of theme management, sign-in flows, and error handling throughout the codebase.
Related Issues
@asgardeo/react
&@asgardeo/nextjs
#81Related PRs
Checklist
Security checks