diff --git a/.changeset/forty-rabbits-leave.md b/.changeset/forty-rabbits-leave.md
new file mode 100644
index 000000000..329a3693a
--- /dev/null
+++ b/.changeset/forty-rabbits-leave.md
@@ -0,0 +1,6 @@
+---
+'@asgardeo/javascript': minor
+'@asgardeo/react': minor
+---
+
+Add Emoji support for Image + Fix issues in component generation
diff --git a/packages/__legacy__/core/.editorconfig b/packages/__legacy__/core/.editorconfig
deleted file mode 100644
index 54a161112..000000000
--- a/packages/__legacy__/core/.editorconfig
+++ /dev/null
@@ -1 +0,0 @@
-../../.editorconfig
diff --git a/packages/__legacy__/core/.eslintignore b/packages/__legacy__/core/.eslintignore
deleted file mode 100644
index 99b0b518a..000000000
--- a/packages/__legacy__/core/.eslintignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/dist
-/build
-/node_modules
-/coverage
diff --git a/packages/__legacy__/core/.eslintrc.cjs b/packages/__legacy__/core/.eslintrc.cjs
deleted file mode 100644
index ae06f6220..000000000
--- a/packages/__legacy__/core/.eslintrc.cjs
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-const path = require('path');
-
-module.exports = {
- extends: ['plugin:@wso2/typescript', 'plugin:@wso2/strict', 'plugin:@wso2/internal', 'plugin:@wso2/prettier'],
- parserOptions: {
- project: [path.resolve(__dirname, 'tsconfig.eslint.json')],
- },
- plugins: ['@wso2'],
- rules: {
- // In `getBrandingCSS` we are using non dot notation to access the object properties.
- // TODO: Refactor the code to use dot notation.
- '@typescript-eslint/dot-notation': 'off',
- '@typescript-eslint/no-empty-function': [
- 'error',
- {
- allow: ['constructors'],
- },
- ],
- // We are throwing custom exceptions in the codebase.
- // Hence, turning this off to avoid linting errors. (https://eslint.org/docs/latest/rules/no-throw-literal#known-limitations)
- '@typescript-eslint/no-throw-literal': 'off',
- // We need to use private constructors in some classes.
- // Hence, turning this off to avoid linting errors.
- // TODO: Ideally suppression should be done inline for these cases. But it seems to not work ATM.
- '@typescript-eslint/no-useless-constructor': 'off',
- },
-};
diff --git a/packages/__legacy__/core/.gitignore b/packages/__legacy__/core/.gitignore
deleted file mode 100644
index f20a8a8c1..000000000
--- a/packages/__legacy__/core/.gitignore
+++ /dev/null
@@ -1,134 +0,0 @@
-# Logs
-logs
-*.log
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-lerna-debug.log*
-.pnpm-debug.log*
-
-# Diagnostic reports (https://nodejs.org/api/report.html)
-report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
-
-# Runtime data
-pids
-*.pid
-*.seed
-*.pid.lock
-
-# Directory for instrumented libs generated by jscoverage/JSCover
-lib-cov
-
-# Coverage directory used by tools like istanbul
-coverage
-*.lcov
-
-# nyc test coverage
-.nyc_output
-
-# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
-.grunt
-
-# Bower dependency directory (https://bower.io/)
-bower_components
-
-# node-waf configuration
-.lock-wscript
-
-# Compiled binary addons (https://nodejs.org/api/addons.html)
-build/Release
-
-# Dependency directories
-node_modules/
-jspm_packages/
-
-# Snowpack dependency directory (https://snowpack.dev/)
-web_modules/
-
-# TypeScript cache
-*.tsbuildinfo
-
-# Optional npm cache directory
-.npm
-
-# Optional eslint cache
-.eslintcache
-
-# Optional stylelint cache
-.stylelintcache
-
-# Microbundle cache
-.rpt2_cache/
-.rts2_cache_cjs/
-.rts2_cache_es/
-.rts2_cache_umd/
-
-# Optional REPL history
-.node_repl_history
-
-# Output of 'npm pack'
-*.tgz
-
-# Yarn Integrity file
-.yarn-integrity
-
-# dotenv environment variable files
-.env
-.env.development.local
-.env.test.local
-.env.production.local
-.env.local
-
-# parcel-bundler cache (https://parceljs.org/)
-.cache
-.parcel-cache
-
-# Next.js build output
-.next
-out
-
-# Nuxt.js build / generate output
-.nuxt
-dist
-
-# Gatsby files
-.cache/
-# Comment in the public line in if your project uses Gatsby and not Next.js
-# https://nextjs.org/blog/next-9-1#public-directory-support
-# public
-
-# vuepress build output
-.vuepress/dist
-
-# vuepress v2.x temp and cache directory
-.temp
-.cache
-
-# Docusaurus cache and generated files
-.docusaurus
-
-# Serverless directories
-.serverless/
-
-# FuseBox cache
-.fusebox/
-
-# DynamoDB Local files
-.dynamodb/
-
-# TernJS port file
-.tern-port
-
-# Stores VSCode versions used for testing VSCode extensions
-.vscode-test
-
-# yarn v2
-.yarn/cache
-.yarn/unplugged
-.yarn/build-state.yml
-.yarn/install-state.gz
-.pnp.*
-
-# misc
-.DS_Store
-*.pem
diff --git a/packages/__legacy__/core/.prettierignore b/packages/__legacy__/core/.prettierignore
deleted file mode 100644
index c925c21d5..000000000
--- a/packages/__legacy__/core/.prettierignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/dist
-/node_modules
diff --git a/packages/__legacy__/core/CHANGELOG.md b/packages/__legacy__/core/CHANGELOG.md
deleted file mode 100644
index 445767589..000000000
--- a/packages/__legacy__/core/CHANGELOG.md
+++ /dev/null
@@ -1,49 +0,0 @@
-# @asgardeo/js
-
-## 0.1.3
-
-### Patch Changes
-
-- [#47](https://github.com/asgardeo/javascript/pull/47)
- [`3d3af92`](https://github.com/asgardeo/javascript/commit/3d3af92338dec2d4b8aff09f9ba9da7d68781108) Thanks
- [@dasuni-30](https://github.com/dasuni-30)! - Add support to esm in core package
-
-## 0.1.2
-
-### Patch Changes
-
-- [#34](https://github.com/asgardeo/javascript/pull/34)
- [`4344408`](https://github.com/asgardeo/javascript/commit/43444087466db1c12fdb97e283192d5e2ccc00f1) Thanks
- [@DonOmalVindula](https://github.com/DonOmalVindula)! - Improvements to Identifier first authenticator in the React
- SDK
-
-## 0.1.1
-
-### Patch Changes
-
-- [#20](https://github.com/asgardeo/javascript/pull/20)
- [`8eef064`](https://github.com/asgardeo/javascript/commit/8eef0641c01de02aa7c4a6d75f059136fcfdb489) Thanks
- [@movinsilva](https://github.com/movinsilva)! - Add readme files and update build scripts
-
-## 0.1.0
-
-### Minor Changes
-
-- [#17](https://github.com/asgardeo/javascript/pull/17)
- [`0be3e48`](https://github.com/asgardeo/javascript/commit/0be3e48a2896e10eea2f4c74ccc24eb1ddab09bd) Thanks
- [@movinsilva](https://github.com/movinsilva)! - Initial release of @asgardeo/js and @asgardeo/react
-
- - Drop in components
-
- - SignIn
- - SignOut
- - SignedIn
- - SignedOut
-
- - Custom hooks
-
- - useAuthentication
- - useOn
-
- - api function calls in js
- - branding and i18n support
diff --git a/packages/__legacy__/core/LICENSE b/packages/__legacy__/core/LICENSE
deleted file mode 100644
index 261eeb9e9..000000000
--- a/packages/__legacy__/core/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/packages/__legacy__/core/README.md b/packages/__legacy__/core/README.md
deleted file mode 100644
index 230d09b8c..000000000
--- a/packages/__legacy__/core/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
- )}
-
-
- );
-};
-
-export default SignIn;
diff --git a/packages/__legacy__/react/src/components/SignIn/fragments/BasicAuth.tsx b/packages/__legacy__/react/src/components/SignIn/fragments/BasicAuth.tsx
deleted file mode 100644
index bc1baadf3..000000000
--- a/packages/__legacy__/react/src/components/SignIn/fragments/BasicAuth.tsx
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {ScreenType, keys} from '@asgardeo/js';
-import {CircularProgress, Grid, Skeleton} from '@oxygen-ui/react';
-import {PropsWithChildren, ReactElement, useContext, useState} from 'react';
-import AsgardeoContext from '../../../contexts/asgardeo-context';
-import useTranslations from '../../../hooks/use-translations';
-import BasicAuthProps from '../../../models/basic-auth-props';
-import {SignIn as UISignIn} from '../../../oxygen-ui-react-auth-components';
-import './basic-auth.scss';
-
-/**
- * This component renders the basic authentication form.
- *
- * @param {BasicAuthProps} props - Props injected to the basic authentication component.
- * @param {BrandingProps} props.brandingProps - Branding props.
- * @param {Function} props.handleAuthenticate - Callback to handle authentication.
- * @param {Authenticator} props.authenticator - Authenticator.
- * @param {AlertType} props.alert - Alert type.
- * @param {ReactElement[]} props.renderLoginOptions - Login options.
- * @param {boolean} props.showSelfSignUp - Show self sign up.
- *
- * @return {ReactElement}
- */
-const BasicAuth = ({
- handleAuthenticate,
- authenticator,
- children,
- alert,
- brandingProps,
- showSelfSignUp,
- renderLoginOptions,
-}: PropsWithChildren): ReactElement => {
- const [password, setPassword] = useState('');
-
- const {isAuthLoading, username, setUsername} = useContext(AsgardeoContext);
-
- const {t, isLoading} = useTranslations({
- componentLocaleOverride: brandingProps?.locale,
- componentTextOverrides: brandingProps?.preference?.text,
- screen: ScreenType.Login,
- });
-
- if (isLoading) {
- return (
-
-
-
-
-
-
-
-
- );
- }
-
- return (
-
-
- {t(keys.login.login.heading)}
-
-
- {alert && (
-
- {t(alert.key)}
-
- )}
-
- ): void => setUsername(e.target.value)}
- />
-
- ): void => setPassword(e.target.value)}
- />
-
- {children}
-
- {
- handleAuthenticate(authenticator.authenticatorId, {
- password,
- username,
- });
- }}
- >
- {t(keys.login.button)}
-
-
- {isAuthLoading && (
-
-
-
- )}
-
- {showSelfSignUp && (
-
- {t(keys.common.prefix.register)}
-
- {t(keys.common.register)}
-
-
- )}
-
- {renderLoginOptions.length !== 0 && {t(keys.common.or)} }
-
- {renderLoginOptions}
-
- );
-};
-
-export default BasicAuth;
diff --git a/packages/__legacy__/react/src/components/SignIn/fragments/EmailOtp.tsx b/packages/__legacy__/react/src/components/SignIn/fragments/EmailOtp.tsx
deleted file mode 100644
index 113961143..000000000
--- a/packages/__legacy__/react/src/components/SignIn/fragments/EmailOtp.tsx
+++ /dev/null
@@ -1,138 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {ScreenType, keys} from '@asgardeo/js';
-import {CircularProgress, Skeleton} from '@oxygen-ui/react';
-import {PropsWithChildren, ReactElement, useContext, useState} from 'react';
-import AsgardeoContext from '../../../contexts/asgardeo-context';
-import useTranslations from '../../../hooks/use-translations';
-import EmailOtpProps from '../../../models/email-otp-props';
-import {SignIn as UISignIn} from '../../../oxygen-ui-react-auth-components';
-import './email-otp.scss';
-
-/**
- * Email OTP component.
- *
- * @param {EmailOtpProps} props - Props injected to the component.
- * @param {BrandingProps} props.brandingProps - Branding props.
- * @param {Authenticator} props.authenticator - Authenticator.
- * @param {Function} props.handleAuthenticate - Callback to handle authentication.
- * @param {AlertType} props.alert - Alert type.
- * @return {ReactElement}
- */
-const EmailOtp = ({
- alert,
- brandingProps,
- authenticator,
- children,
- handleAuthenticate,
-}: PropsWithChildren): ReactElement => {
- const [inputValue, setInputValue] = useState();
- const [isContinueLoading, setIsContinueLoading] = useState(false);
- const [isResendLoading, setIsResendLoading] = useState(false);
-
- const {isAuthLoading} = useContext(AsgardeoContext);
-
- const param: string = authenticator?.metadata?.params[0]?.param;
- /**
- * Temporary i18n mapping.
- * TODO: Remove once the i18n keys are implemented correctly in the API response.
- */
- const i18nMapping: {[key: string]: {heading: string; inputLabel: string; placeholder?: string}} = {
- OTPCode: {heading: keys.emailOtp.email.heading, inputLabel: keys.emailOtp.enter.verification.code.got.by.device},
- username: {
- heading: keys.emailOtp.email.otp.heading,
- inputLabel: keys.emailOtp.username.label,
- placeholder: keys.emailOtp.username.placeholder,
- },
- };
-
- const {isLoading, t} = useTranslations({
- componentLocaleOverride: brandingProps?.locale,
- componentTextOverrides: brandingProps?.preference?.text,
- screen: ScreenType.EmailOTP,
- });
-
- if (isLoading) {
- return (
-
-
-
-
-
-
- );
- }
-
- return (
-
- {t(i18nMapping[param].heading)}
-
- {alert && {alert.key}}
-
- ): void => setInputValue(e.target.value)}
- />
-
- {children}
-
- {
- handleAuthenticate(authenticator.authenticatorId, {[authenticator.requiredParams[0]]: inputValue});
- setInputValue('');
- setIsResendLoading(false);
- setIsContinueLoading(true);
- }}
- >
- {t(keys.emailOtp.continue)}
- {isAuthLoading && isContinueLoading && }
-
-
- {param === 'OTPCode' && (
- {
- handleAuthenticate(authenticator.authenticatorId);
- setInputValue('');
- setIsContinueLoading(false);
- setIsResendLoading(true);
- }}
- >
- {t(keys.emailOtp.resend.code)}
- {isAuthLoading && isResendLoading && }
-
- )}
-
- );
-};
-
-export default EmailOtp;
diff --git a/packages/__legacy__/react/src/components/SignIn/fragments/IdentifierFirst.tsx b/packages/__legacy__/react/src/components/SignIn/fragments/IdentifierFirst.tsx
deleted file mode 100644
index edf7388f9..000000000
--- a/packages/__legacy__/react/src/components/SignIn/fragments/IdentifierFirst.tsx
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {ScreenType, keys} from '@asgardeo/js';
-import {CircularProgress, Grid, Skeleton} from '@oxygen-ui/react';
-import {PropsWithChildren, ReactElement, useContext} from 'react';
-import AsgardeoContext from '../../../contexts/asgardeo-context';
-import useTranslations from '../../../hooks/use-translations';
-import BasicAuthProps from '../../../models/basic-auth-props';
-import {SignIn as UISignIn} from '../../../oxygen-ui-react-auth-components';
-import './basic-auth.scss';
-
-/**
- * This component renders the IdentifierFirst authentication form.
- *
- * @param {IdentifierFirstProps} props - Props injected to the IdentifierFirst authentication component.
- * @param {BrandingProps} props.brandingProps - Branding props.
- * @param {Function} props.handleAuthenticate - Callback to handle authentication.
- * @param {Authenticator} props.authenticator - Authenticator.
- * @param {AlertType} props.alert - Alert type.
- * @param {ReactElement[]} props.renderLoginOptions - Login options.
- * @param {boolean} props.showSelfSignUp - Show self sign up.
- *
- * @return {ReactElement}
- */
-const IdentifierFirst = ({
- handleAuthenticate,
- authenticator,
- alert,
- brandingProps,
- children,
- showSelfSignUp,
- renderLoginOptions,
-}: PropsWithChildren): ReactElement => {
- const {isAuthLoading, username, setUsername} = useContext(AsgardeoContext);
-
- const {t, isLoading} = useTranslations({
- componentLocaleOverride: brandingProps?.locale,
- componentTextOverrides: brandingProps?.preference?.text,
- screen: ScreenType.Login,
- });
-
- if (isLoading) {
- return (
-
-
-
-
-
-
-
-
- );
- }
-
- return (
-
-
- {t(keys.login.login.heading)}
-
-
- {alert && (
-
- {t(alert.key)}
-
- )}
-
- ): void => setUsername(e.target.value)}
- />
-
- {children}
-
- {
- handleAuthenticate(authenticator.authenticatorId, {
- username,
- });
- }}
- >
- {t(keys.login.button)}
-
-
- {isAuthLoading && (
-
-
-
- )}
-
- {showSelfSignUp && (
-
- {t(keys.common.prefix.register)}
-
- {t(keys.common.register)}
-
-
- )}
-
- {renderLoginOptions.length !== 0 && {t(keys.common.or)} }
-
- {renderLoginOptions}
-
- );
-};
-
-export default IdentifierFirst;
diff --git a/packages/__legacy__/react/src/components/SignIn/fragments/LoginOptionsBox.tsx b/packages/__legacy__/react/src/components/SignIn/fragments/LoginOptionsBox.tsx
deleted file mode 100644
index a6b5a844b..000000000
--- a/packages/__legacy__/react/src/components/SignIn/fragments/LoginOptionsBox.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {ReactElement} from 'react';
-import buildingIcon from '../../../assets/building-icon.svg';
-import emailSolid from '../../../assets/email-solid.svg';
-import smsIcon from '../../../assets/sms-icon.svg';
-import facebook from '../../../assets/social-logins/facebook.svg';
-import github from '../../../assets/social-logins/github.svg';
-import google from '../../../assets/social-logins/google.svg';
-import microsoft from '../../../assets/social-logins/microsoft.svg';
-import totp from '../../../assets/totp.svg';
-import LoginOptionsBoxProps from '../../../models/login-options-box-props';
-import {SignIn as UISignIn} from '../../../oxygen-ui-react-auth-components';
-
-const images: {[key: string]: string} = {
- 'Email OTP': emailSolid,
- Github: github,
- Google: google,
- Microsoft: microsoft,
- 'SMS OTP': smsIcon,
- TOTP: totp,
- facebook,
-};
-
-/**
- * This component renders the login options box.
- *
- * @param {LoginOptionsBoxProps} props - Props injected to the component.
- * @param {string} props.socialName - Name of the social login.
- * @param {string} props.displayName - Display name of the social login.
- * @param {Function} props.handleOnClick - On click handler.
- * @return {ReactElement}
- */
-const LoginOptionsBox = ({
- isAuthLoading,
- socialName,
- displayName,
- handleOnClick,
-}: LoginOptionsBoxProps): ReactElement => (
- }
- onClick={handleOnClick}
- disabled={isAuthLoading}
- >
- {displayName}
-
-);
-
-export default LoginOptionsBox;
diff --git a/packages/__legacy__/react/src/components/SignIn/fragments/SmsOtp.tsx b/packages/__legacy__/react/src/components/SignIn/fragments/SmsOtp.tsx
deleted file mode 100644
index 6f3c5fe8d..000000000
--- a/packages/__legacy__/react/src/components/SignIn/fragments/SmsOtp.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {ScreenType, keys} from '@asgardeo/js';
-import {CircularProgress} from '@oxygen-ui/react';
-import {PropsWithChildren, ReactElement, useState} from 'react';
-import useTranslations from '../../../hooks/use-translations';
-import EmailOtpProps from '../../../models/email-otp-props';
-import {SignIn as UISignIn} from '../../../oxygen-ui-react-auth-components';
-
-const SmsOtp = ({
- alert,
- brandingProps,
- authenticator,
- children,
- handleAuthenticate,
-}: PropsWithChildren): ReactElement => {
- const [otp, setOtp] = useState();
-
- const {isLoading, t} = useTranslations({
- componentLocaleOverride: brandingProps?.locale,
- componentTextOverrides: brandingProps?.preference?.text,
- screen: ScreenType.SMSOTP,
- });
-
- if (isLoading) {
- return (
-
-
-
- );
- }
-
- return (
-
- {t(keys.smsOtp.sms.otp.heading)}
-
- {t(keys.smsOtp.sms.otp.subheading)}
-
- {alert && {alert.key}}
-
-
-
- {children}
-
- {
- handleAuthenticate(authenticator.authenticatorId, {OTPCode: otp});
- setOtp('');
- }}
- >
- {t(keys.smsOtp.continue)}
-
-
- handleAuthenticate(authenticator.authenticatorId)}
- color="secondary"
- variant="contained"
- >
- {t(keys.smsOtp.resend.code)}
-
-
- );
-};
-
-export default SmsOtp;
diff --git a/packages/__legacy__/react/src/components/SignIn/fragments/Totp.tsx b/packages/__legacy__/react/src/components/SignIn/fragments/Totp.tsx
deleted file mode 100644
index 9a17c3b63..000000000
--- a/packages/__legacy__/react/src/components/SignIn/fragments/Totp.tsx
+++ /dev/null
@@ -1,120 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {ScreenType, keys} from '@asgardeo/js';
-import {CircularProgress, Grid, Skeleton} from '@oxygen-ui/react';
-import {useState, ReactElement, useContext, PropsWithChildren} from 'react';
-import AsgardeoContext from '../../../contexts/asgardeo-context';
-import useTranslations from '../../../hooks/use-translations';
-import TotpProps from '../../../models/totp-props';
-import {SignIn as UISignIn} from '../../../oxygen-ui-react-auth-components';
-import './totp.scss';
-
-/**
- * This component renders the TOTP authentication screen.
- *
- * @param {TotpProps} props - Props injected to the component.
- * @param {AlertType} props.alert - Alert type.
- * @param {string} props.authenticator - Authenticator.
- * @param {BrandingProps} props.brandingProps - Branding props.
- * @param {Function} props.handleAuthenticate - Callback to handle authentication.
- *
- * @return {ReactElement}
- */
-const Totp = ({
- brandingProps,
- authenticator,
- children,
- handleAuthenticate,
- alert,
-}: PropsWithChildren): ReactElement => {
- const [totp, setTotp] = useState();
-
- const {isAuthLoading} = useContext(AsgardeoContext);
-
- const {isLoading, t} = useTranslations({
- componentLocaleOverride: brandingProps?.locale,
- componentTextOverrides: brandingProps?.preference?.text,
- screen: ScreenType.TOTP,
- });
-
- if (isLoading) {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
- return (
-
- {t(keys.totp.heading)}
-
- {alert && (
-
- {t(alert.key)}
-
- )}
-
- {t(keys.totp.enter.verification.code.got.by.device)}
-
-
-
- {children}
-
- {
- handleAuthenticate(authenticator.authenticatorId, {token: totp});
- setTotp('');
- }}
- >
- {t(keys.totp.continue)}
-
-
- {isAuthLoading && (
-
-
-
- )}
-
-
- {t(keys.totp.enroll.message1)}
-
- {t(keys.totp.enroll.message2)}
-
-
- );
-};
-
-export default Totp;
diff --git a/packages/__legacy__/react/src/components/SignIn/fragments/basic-auth.scss b/packages/__legacy__/react/src/components/SignIn/fragments/basic-auth.scss
deleted file mode 100644
index 50a8fac34..000000000
--- a/packages/__legacy__/react/src/components/SignIn/fragments/basic-auth.scss
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.asgardeo-basic-auth-skeleton {
- display: flex;
- flex-flow: column nowrap;
- padding: 32px;
- row-gap: 8px;
-
- .skeleton-title {
- margin: 0 auto;
- }
-
- .skeleton-text-field-label {
- margin-top: 12px;
- }
-
- .skeleton-submit-button {
- margin: 20px auto 0;
- border-radius: 20px;
- }
-}
-
-.Paper-basicAuth {
- opacity: 0.5;
- animation: fade-in 0.9s ease-in-out forwards;
-
- .asgardeo-basic-auth-alert {
- margin-top: 12px;
- }
-}
-
-.asgardeo-register-link {
- margin-left: 3px;
-}
-
-@keyframes fade-in {
- to {
- opacity: 1;
- }
-}
diff --git a/packages/__legacy__/react/src/components/SignIn/fragments/email-otp.scss b/packages/__legacy__/react/src/components/SignIn/fragments/email-otp.scss
deleted file mode 100644
index 67a168882..000000000
--- a/packages/__legacy__/react/src/components/SignIn/fragments/email-otp.scss
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.asgardeo-email-otp-skeleton {
- display: flex;
- flex-flow: column nowrap;
- padding: 32px;
- row-gap: 8px;
-
- .skeleton-title {
- margin: 0 auto;
- }
-
- .skeleton-text-field-label {
- margin-top: 12px;
- }
-
- .skeleton-submit-button {
- margin: 20px auto 0;
- border-radius: 20px;
- }
-}
-
-.asgardeo-email-otp-paper {
- opacity: 0.5;
- animation: fade-in 0.9s ease-in-out forwards;
-}
-
-@keyframes fade-in {
- to {
- opacity: 1;
- }
-}
diff --git a/packages/__legacy__/react/src/components/SignIn/fragments/totp.scss b/packages/__legacy__/react/src/components/SignIn/fragments/totp.scss
deleted file mode 100644
index db7e0bf0a..000000000
--- a/packages/__legacy__/react/src/components/SignIn/fragments/totp.scss
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.asgardeo-totp-skeleton {
- display: flex;
- flex-flow: column nowrap;
- padding: 32px;
- row-gap: 8px;
- min-width: 330px;
-
- .skeleton-title {
- margin: 0 auto;
- }
-
- .skeleton-pin-box {
- margin: 0 4px;
- }
-
- .skeleton-submit-button {
- margin: 20px auto 0;
- border-radius: 20px;
- }
-}
-
-.asgardeo-totp-alert {
- margin: 20px 0;
-}
diff --git a/packages/__legacy__/react/src/components/SignIn/sign-in.scss b/packages/__legacy__/react/src/components/SignIn/sign-in.scss
deleted file mode 100644
index 40f68abb1..000000000
--- a/packages/__legacy__/react/src/components/SignIn/sign-in.scss
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-$--min-height: 75vh;
-
-.Box-asgardeoSignIn {
- min-width: 350px;
- min-height: $--min-height;
-
- .email-otp-resend-button {
- margin-top: 0;
- }
-
- .multiple-otions-title {
- margin: 16px 0 34px;
- }
-
- .asgardeo-multiple-options-paper {
- padding-bottom: 64px;
-
- .asgardeo-sign-in-alert {
- margin-bottom: 24px;
- }
- }
-}
-
-.Box-circularProgressHolder {
- display: flex;
- justify-content: center;
- align-items: center;
- min-height: $--min-height;
-
- .circular-progress {
- color: rgb(214 211 211) !important;
- }
-}
-
-.asgardeo-sign-in-footer,
-.asgardeo-sign-in-logo {
- opacity: 0.5;
- animation: fade-in 0.7s ease-in-out forwards;
-}
-
-@keyframes fade-in {
- to {
- opacity: 1;
- }
-}
-
-.circular-progress-holder-authn {
- display: flex;
- justify-content: center;
- align-items: center;
- flex-grow: 1;
-
- .sign-in-button-progress {
- color: var(--oxygen-palette-primary-main);
- margin: 0 auto !important;
- max-height: 25px;
- max-width: 25px;
- margin-left: 12px;
- }
-}
diff --git a/packages/__legacy__/react/src/components/SignInButton/SignInButton.tsx b/packages/__legacy__/react/src/components/SignInButton/SignInButton.tsx
deleted file mode 100644
index bc52077af..000000000
--- a/packages/__legacy__/react/src/components/SignInButton/SignInButton.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
- *
- * 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.
- */
-
-import {Box, Button, CircularProgress} from '@oxygen-ui/react';
-import React, {ReactElement, useContext, useState} from 'react';
-import './sign-in-button.scss';
-import AsgardeoContext from '../../contexts/asgardeo-context';
-import AuthContext from '../../models/auth-context';
-import {SignInButtonProps} from '../../models/sign-in';
-import SignIn from '../SignIn/SignIn';
-
-/**
- * SignInButton component. This button will render a modal with the SignIn component when clicked.
- *
- * @param {Object} props - Component props.
- * @param {ReactElement} props.customComponent - Optional custom component to be rendered.
- * @returns {ReactElement} Rendered SignInButton component.
- */
-const SignInButton = (props: SignInButtonProps): ReactElement => {
- const {customComponent, showFooter = false, showLogo = false, showSignUp = false} = props;
-
- const [modalVisible, setModalVisible] = useState(false);
-
- const authContext: AuthContext | undefined = useContext(AsgardeoContext);
-
- const openModal = (): void => {
- setModalVisible(true);
- };
-
- const closeModal = (): void => {
- setModalVisible(false);
- };
-
- if (authContext.isBrandingLoading) {
- return (
-
- );
- }
-
- return (
-
- );
-};
-
-export default SignInButton;
diff --git a/packages/__legacy__/react/src/components/SignInButton/sign-in-button.scss b/packages/__legacy__/react/src/components/SignInButton/sign-in-button.scss
deleted file mode 100644
index 7a59663c6..000000000
--- a/packages/__legacy__/react/src/components/SignInButton/sign-in-button.scss
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
- *
- * 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.
- */
-
-.asgardeo {
- .asgardeo-sign-in-button {
- color: var(--oxygen-palette-text-primary);
- }
-
- .OxygenSignInImage {
- height: 45px;
- }
-
- .popup-box {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- z-index: 1000;
- min-height: 65%;
- min-width: 35%;
- max-height: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- overflow: auto;
- padding-top: 40px;
-
- /* Hide scrollbar for Chrome, Safari and Opera */
- ::-webkit-scrollbar {
- display: none;
- }
-
- /* Hide scrollbar for IE, Edge and Firefox */
- -ms-overflow-style: none; /* IE and Edge */
- scrollbar-width: none; /* Firefox */
- }
-
- .popup-box-overlay {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgb(0 0 0 / 76.8%);
- z-index: 100;
- }
-}
diff --git a/packages/__legacy__/react/src/components/SignOutButton/SignOutButton.tsx b/packages/__legacy__/react/src/components/SignOutButton/SignOutButton.tsx
deleted file mode 100644
index bd5292092..000000000
--- a/packages/__legacy__/react/src/components/SignOutButton/SignOutButton.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
- *
- * 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.
- */
-
-import {Button} from '@oxygen-ui/react';
-import {ReactElement} from 'react';
-import useAuthentication from '../../hooks/use-authentication';
-
-/**
- * SignOutButton component.
- *
- * This component renders a sign out button. When clicked, it triggers the sign out process.
- *
- * @returns {ReactElement} Rendered SignOutButton component.
- */
-const SignOutButton = (): ReactElement => {
- const {signOut} = useAuthentication();
-
- return (
-
-
-
- );
-};
-
-export default SignOutButton;
diff --git a/packages/__legacy__/react/src/components/SignedIn/SignedIn.tsx b/packages/__legacy__/react/src/components/SignedIn/SignedIn.tsx
deleted file mode 100644
index 58dabe2a8..000000000
--- a/packages/__legacy__/react/src/components/SignedIn/SignedIn.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {FC, PropsWithChildren} from 'react';
-import useAuthentication from '../../hooks/use-authentication';
-import SignedProps from '../../models/signed-props';
-
-/**
- * This component renders its children if the user is signed out.
- *
- * @param {PropsWithChildren} props - Props injected to the component.
- * @param {ReactElement} props.fallback - Fallback element to render.
- *
- * @return {JSX.Element}
- */
-const SignedIn: FC> = (props: PropsWithChildren) => {
- const {fallback = null, children} = props;
- const {isSignedIn} = useAuthentication();
-
- return isSignedIn ? children : fallback;
-};
-
-export default SignedIn;
diff --git a/packages/__legacy__/react/src/components/SignedOut/SignedOut.tsx b/packages/__legacy__/react/src/components/SignedOut/SignedOut.tsx
deleted file mode 100644
index 1e5825a4b..000000000
--- a/packages/__legacy__/react/src/components/SignedOut/SignedOut.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {FC, PropsWithChildren} from 'react';
-import useAuthentication from '../../hooks/use-authentication';
-import SignedProps from '../../models/signed-props';
-
-/**
- * This component renders its children if the user is signed out.
- *
- * @param {PropsWithChildren} props - Props injected to the component.
- * @param {ReactElement} props.fallback - Fallback element to render.
- *
- * @return {JSX.Element}
- */
-const SignedOut: FC> = (props: PropsWithChildren) => {
- const {fallback = null, children} = props;
- const {isSignedIn} = useAuthentication();
-
- return !isSignedIn ? children : fallback;
-};
-
-export default SignedOut;
diff --git a/packages/__legacy__/react/src/components/public-components.ts b/packages/__legacy__/react/src/components/public-components.ts
deleted file mode 100644
index 5e518d199..000000000
--- a/packages/__legacy__/react/src/components/public-components.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-export {default as SignIn} from './SignIn/SignIn';
-export {default as SignedIn} from './SignedIn/SignedIn';
-export {default as SignedOut} from './SignedOut/SignedOut';
-export {default as SignInButton} from './SignInButton/SignInButton';
-export {default as SignOutButton} from './SignOutButton/SignOutButton';
diff --git a/packages/__legacy__/react/src/contexts/asgardeo-context.ts b/packages/__legacy__/react/src/contexts/asgardeo-context.ts
deleted file mode 100644
index d04644ef7..000000000
--- a/packages/__legacy__/react/src/contexts/asgardeo-context.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Context, createContext} from 'react';
-import AuthContext from '../models/auth-context';
-
-const AsgardeoContext: Context = createContext(undefined);
-
-export default AsgardeoContext;
diff --git a/packages/__legacy__/react/src/contexts/branding-preference-context.ts b/packages/__legacy__/react/src/contexts/branding-preference-context.ts
deleted file mode 100644
index 1e4e96e9f..000000000
--- a/packages/__legacy__/react/src/contexts/branding-preference-context.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Branding} from '@asgardeo/js';
-import {Context, createContext} from 'react';
-
-const BrandingPreferenceContext: Context = createContext(undefined);
-
-export default BrandingPreferenceContext;
diff --git a/packages/__legacy__/react/src/contexts/i18n-context.ts b/packages/__legacy__/react/src/contexts/i18n-context.ts
deleted file mode 100644
index e826ae174..000000000
--- a/packages/__legacy__/react/src/contexts/i18n-context.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Context, createContext} from 'react';
-import {I18n} from '../models/i18n';
-
-const I18nContext: Context = createContext(undefined);
-
-export default I18nContext;
diff --git a/packages/__legacy__/react/src/hooks/use-authentication.ts b/packages/__legacy__/react/src/hooks/use-authentication.ts
deleted file mode 100644
index 08e753957..000000000
--- a/packages/__legacy__/react/src/hooks/use-authentication.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {signOut as signOutApiCall} from '@asgardeo/js';
-import {useContext} from 'react';
-import AsgardeoContext from '../contexts/asgardeo-context';
-import AuthContext from '../models/auth-context';
-import UseAuthentication from '../models/use-authentication';
-
-/**
- * `useAuthentication` is a custom hook that provides access to the authentication context.
- * It returns an object containing the current user, the authentication status, the access token, and a sign out function.
- *
- * @returns {UseAuthentication} An object containing the current user (`user`), the authentication status (`isSignedIn`),
- * the access token (`accessToken`), and a sign out function (`signOut`).
- */
-const useAuthentication = (): UseAuthentication => {
- const contextValue: AuthContext = useContext(AsgardeoContext);
-
- const {accessToken, authResponse, isSignedIn, isGlobalLoading, setUsername, user, username} = contextValue;
-
- const signOut: () => void = () => {
- signOutApiCall().then(() => {
- sessionStorage.clear();
- if (contextValue.onSignOutRef.current) {
- contextValue.onSignOutRef.current();
- }
- });
- };
-
- return {
- accessToken,
- authResponse,
- isSignedIn,
- isGlobalLoading,
- setUsername,
- signOut,
- user,
- username,
- };
-};
-
-export default useAuthentication;
diff --git a/packages/__legacy__/react/src/hooks/use-config.ts b/packages/__legacy__/react/src/hooks/use-config.ts
deleted file mode 100644
index 1611d6a6d..000000000
--- a/packages/__legacy__/react/src/hooks/use-config.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {UIAuthConfig} from '@asgardeo/js';
-import {useContext} from 'react';
-import AsgardeoContext from '../contexts/asgardeo-context';
-import UseConfig from '../models/use-config';
-
-/**
- * Custom hook to access the authentication configuration from the AsgardeoProviderContext.
- * @returns An object containing the authentication configuration.
- */
-export const useConfig = (): UseConfig => {
- const {config} = useContext(AsgardeoContext) as {
- config: UIAuthConfig;
- };
-
- return {config};
-};
diff --git a/packages/__legacy__/react/src/hooks/use-on.ts b/packages/__legacy__/react/src/hooks/use-on.ts
deleted file mode 100644
index 9e259bba8..000000000
--- a/packages/__legacy__/react/src/hooks/use-on.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {AsgardeoUIException} from '@asgardeo/js';
-import {useContext, useEffect} from 'react';
-import AsgardeoContext from '../contexts/asgardeo-context';
-import AuthContext from '../models/auth-context';
-import {Hooks, UseOnProps} from '../models/use-on';
-
-const useOn = (props: UseOnProps): void => {
- const {callback, event} = props;
-
- const contextValue: AuthContext = useContext(AsgardeoContext);
-
- useEffect(() => {
- switch (event) {
- case Hooks.SignIn:
- contextValue.setOnSignIn(callback);
- break;
- case Hooks.SignOut:
- contextValue.setOnSignOut(callback);
- break;
- default:
- throw new AsgardeoUIException('REACT-USE_ON-UO-IV-01', 'Invalid event type provided.');
- }
- }, [callback, contextValue, event]);
-};
-
-export default useOn;
diff --git a/packages/__legacy__/react/src/hooks/use-translations.ts b/packages/__legacy__/react/src/hooks/use-translations.ts
deleted file mode 100644
index 21f0ccda1..000000000
--- a/packages/__legacy__/react/src/hooks/use-translations.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {useContext, useEffect, useState} from 'react';
-import AsgardeoContext from '../contexts/asgardeo-context';
-import I18nContext from '../contexts/i18n-context';
-import {I18n, SetTranslationsProps} from '../models/i18n';
-import UseTranslations from '../models/use-translations';
-
-/**
- * `useTranslations` is a custom hook that fetches translations.
- * It takes an object of type `SetTranslationsProps` as an argument, which includes the screen type,
- * and optional locale and text overrides.
- *
- * @param {SetTranslationsProps} props - The properties used to fetch the translations.
- * @param {ScreenType} props.screen - The screen type for which to fetch translations.
- * @param {string} [props.componentLocaleOverride] - Optional locale override.
- * @param {BrandingPreferenceTextProps} [props.componentTextOverrides] - Optional text overrides.
- *
- * @returns {UseTranslations} An object containing the translations (`t`) and a loading state (`isLoading`).
- */
-const useTranslations = (props: SetTranslationsProps): UseTranslations => {
- const {componentLocaleOverride, componentTextOverrides, screen} = props;
-
- const [isLoading, setIsLoading] = useState(true);
-
- const {setIsTextLoading} = useContext(AsgardeoContext);
-
- const contextValue: I18n = useContext(I18nContext);
- const {text, setTranslations} = contextValue;
-
- useEffect(() => {
- setTranslations({componentLocaleOverride, componentTextOverrides, screen}).then((response: boolean) => {
- setIsLoading(!response);
- setIsTextLoading(!response);
- });
- }, [componentLocaleOverride, componentTextOverrides, screen, setIsTextLoading, setTranslations]);
-
- useEffect(() => {
- setIsTextLoading(isLoading);
- }, [isLoading, setIsTextLoading]);
-
- /**
- * `t` is a function that retrieves a specific translation from the fetched translations.
- * It takes a key as an argument, which is a string that represents a path to the desired translation.
- *
- * @param {string} key - The key of the translation to retrieve. This is a string that represents
- * a path in the translations object, with parts separated by '.'.
- *
- * @returns {string} The requested translation.
- */
- const t = (key: string): string => {
- const keySegments: string[] = key.split('.');
-
- const screenKey: string = keySegments[0];
- const rightPart: string = keySegments.slice(1).join('.');
-
- return text[screenKey][rightPart];
- };
-
- return {isLoading, t};
-};
-
-export default useTranslations;
diff --git a/packages/__legacy__/react/src/index.ts b/packages/__legacy__/react/src/index.ts
deleted file mode 100644
index 98f497c95..000000000
--- a/packages/__legacy__/react/src/index.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-export * from './components/public-components';
-export * from './models/public-models';
-export {default as AsgardeoProvider} from './providers/AsgardeoProvider';
-export {default as useAuthentication} from './hooks/use-authentication';
-export {default as useOn} from './hooks/use-on';
diff --git a/packages/__legacy__/react/src/models/asgardeo-provider-props.ts b/packages/__legacy__/react/src/models/asgardeo-provider-props.ts
deleted file mode 100644
index 38f0174c7..000000000
--- a/packages/__legacy__/react/src/models/asgardeo-provider-props.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {BrandingProps, Store, UIAuthConfig} from '@asgardeo/js';
-
-interface AsgardeoProviderProps {
- branding?: BrandingProps;
- config: UIAuthConfig;
- store?: Store;
-}
-
-export default AsgardeoProviderProps;
diff --git a/packages/__legacy__/react/src/models/auth-context.ts b/packages/__legacy__/react/src/models/auth-context.ts
deleted file mode 100644
index 4a1e1f932..000000000
--- a/packages/__legacy__/react/src/models/auth-context.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {UIAuthConfig, MeAPIResponse, AuthApiResponse} from '@asgardeo/js';
-
-interface AuthContext {
- accessToken: string;
- authResponse: AuthApiResponse;
- config: UIAuthConfig;
- isAuthLoading: boolean;
- isSignedIn: boolean | undefined;
- isBrandingLoading: boolean;
- isComponentLoading: boolean;
- isGlobalLoading: boolean;
- isTextLoading: boolean;
- onSignOutRef: React.MutableRefObject;
- setAuthResponse: (response: AuthApiResponse) => void;
- setAuthentication: () => void;
- setIsAuthLoading: (value: boolean) => void;
- setIsBrandingLoading: (value: boolean) => void;
- setIsComponentLoading: (value: boolean) => void;
- setIsTextLoading: (value: boolean) => void;
- setOnSignIn: (response?: any) => void | Promise;
- setOnSignOut: (response?: any) => void | Promise;
- setUsername: (username: string) => void;
- user: MeAPIResponse;
- username: string;
-}
-
-export default AuthContext;
diff --git a/packages/__legacy__/react/src/models/basic-auth-props.ts b/packages/__legacy__/react/src/models/basic-auth-props.ts
deleted file mode 100644
index 28f79c8e0..000000000
--- a/packages/__legacy__/react/src/models/basic-auth-props.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Authenticator, BrandingProps} from '@asgardeo/js';
-import {ReactElement} from 'react';
-import {AlertType} from './sign-in';
-
-interface BasicAuthProps {
- alert?: AlertType;
- authenticator: Authenticator;
- brandingProps?: BrandingProps;
- handleAuthenticate: Function;
- renderLoginOptions?: ReactElement[];
- showSelfSignUp: boolean;
-}
-
-export default BasicAuthProps;
diff --git a/packages/__legacy__/react/src/models/branding-preference-provider-props.ts b/packages/__legacy__/react/src/models/branding-preference-provider-props.ts
deleted file mode 100644
index 621dc38b4..000000000
--- a/packages/__legacy__/react/src/models/branding-preference-provider-props.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {BrandingProps} from '@asgardeo/js';
-
-interface BrandingPreferenceProviderProps {
- branding?: BrandingProps;
-}
-
-export default BrandingPreferenceProviderProps;
diff --git a/packages/__legacy__/react/src/models/email-otp-props.ts b/packages/__legacy__/react/src/models/email-otp-props.ts
deleted file mode 100644
index 87a269a7a..000000000
--- a/packages/__legacy__/react/src/models/email-otp-props.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Authenticator, BrandingProps} from '@asgardeo/js';
-import {AlertType} from './sign-in';
-
-interface EmailOtpProps {
- alert?: AlertType;
- authenticator?: Authenticator;
- brandingProps?: BrandingProps;
- handleAuthenticate: Function;
-}
-
-export default EmailOtpProps;
diff --git a/packages/__legacy__/react/src/models/i18n.ts b/packages/__legacy__/react/src/models/i18n.ts
deleted file mode 100644
index 4a9c27089..000000000
--- a/packages/__legacy__/react/src/models/i18n.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {BrandingPreferenceTextProps, ScreenType, TextObject} from '@asgardeo/js';
-
-export type I18nLocalization =
- | {
- [key in ScreenType]: TextObject;
- }
- | {};
-
-export interface SetTranslationsProps {
- componentLocaleOverride?: string;
- componentTextOverrides?: BrandingPreferenceTextProps;
- screen?: ScreenType;
-}
-export interface I18n {
- setTranslations: (props: SetTranslationsProps) => Promise;
- text: I18nLocalization;
-}
-
-export interface I18nProviderProps {
- providerLocaleOverride?: string;
- providerTextOverrides?: BrandingPreferenceTextProps;
-}
diff --git a/packages/__legacy__/react/src/models/jwt-verify-options.ts b/packages/__legacy__/react/src/models/jwt-verify-options.ts
deleted file mode 100644
index bb1bc2078..000000000
--- a/packages/__legacy__/react/src/models/jwt-verify-options.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-interface JwtVerifyOptions {
- algorithms: string[];
- audience: string;
- clockTolerance: number;
- issuer: string;
- subject: string;
-}
-
-export default JwtVerifyOptions;
diff --git a/packages/__legacy__/react/src/models/login-options-box-props.ts b/packages/__legacy__/react/src/models/login-options-box-props.ts
deleted file mode 100644
index ff6e4e3a2..000000000
--- a/packages/__legacy__/react/src/models/login-options-box-props.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-interface LoginOptionsBoxProps {
- displayName: string;
- handleOnClick: () => void;
- isAuthLoading: boolean;
- socialName: string;
-}
-
-export default LoginOptionsBoxProps;
diff --git a/packages/__legacy__/react/src/models/public-models.ts b/packages/__legacy__/react/src/models/public-models.ts
deleted file mode 100644
index 31797683a..000000000
--- a/packages/__legacy__/react/src/models/public-models.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-export type {UIAuthConfig} from '@asgardeo/js';
-export {Hooks} from './use-on';
diff --git a/packages/__legacy__/react/src/models/sign-in.ts b/packages/__legacy__/react/src/models/sign-in.ts
deleted file mode 100644
index fecde462e..000000000
--- a/packages/__legacy__/react/src/models/sign-in.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {BrandingProps} from '@asgardeo/js';
-import {ReactElement} from 'react';
-
-export interface SignInProps {
- basicAuthChildren?: ReactElement;
- brandingProps?: BrandingProps;
- emailOtpChildren?: ReactElement;
- identifierFirstChildren?: ReactElement;
- showFooter?: boolean;
- showLogo?: boolean;
- showSignUp?: boolean;
- smsOtpChildren?: ReactElement;
- totpChildren?: ReactElement;
-}
-
-export type AlertType = {
- alertType:
- | {error?: boolean; info?: never; warning?: never}
- | {error?: never; info?: boolean; warning?: never}
- | {error?: never; infor?: never; warning?: boolean};
- key: string;
-};
-
-export interface SignInButtonProps extends SignInProps {
- customComponent?: ReactElement;
-}
diff --git a/packages/__legacy__/react/src/models/signed-props.ts b/packages/__legacy__/react/src/models/signed-props.ts
deleted file mode 100644
index acc02059a..000000000
--- a/packages/__legacy__/react/src/models/signed-props.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {ReactElement} from 'react';
-
-interface SignedProps {
- fallback?: ReactElement;
-}
-
-export default SignedProps;
diff --git a/packages/__legacy__/react/src/models/totp-props.ts b/packages/__legacy__/react/src/models/totp-props.ts
deleted file mode 100644
index 1a819de84..000000000
--- a/packages/__legacy__/react/src/models/totp-props.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Authenticator, BrandingProps} from '@asgardeo/js';
-import {AlertType} from './sign-in';
-
-interface TotpProps {
- alert?: AlertType;
- authenticator: Authenticator;
- brandingProps?: BrandingProps;
- handleAuthenticate: Function;
-}
-
-export default TotpProps;
diff --git a/packages/__legacy__/react/src/models/use-authentication.ts b/packages/__legacy__/react/src/models/use-authentication.ts
deleted file mode 100644
index d48692d88..000000000
--- a/packages/__legacy__/react/src/models/use-authentication.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {AuthApiResponse, MeAPIResponse} from '@asgardeo/js';
-
-interface UseAuthentication {
- accessToken: string;
- authResponse: AuthApiResponse;
- isSignedIn: Promise | boolean;
- isGlobalLoading: boolean;
- setUsername: (username: string) => void;
- signOut: () => void;
- user: MeAPIResponse;
- username: string;
-}
-
-export default UseAuthentication;
diff --git a/packages/__legacy__/react/src/models/use-config.ts b/packages/__legacy__/react/src/models/use-config.ts
deleted file mode 100644
index 116aa189a..000000000
--- a/packages/__legacy__/react/src/models/use-config.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {UIAuthConfig} from '@asgardeo/js';
-
-interface UseConfig {
- config: UIAuthConfig;
-}
-
-export default UseConfig;
diff --git a/packages/__legacy__/react/src/models/use-on.ts b/packages/__legacy__/react/src/models/use-on.ts
deleted file mode 100644
index aee2af97b..000000000
--- a/packages/__legacy__/react/src/models/use-on.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-export enum Hooks {
- SignIn,
- SignOut,
-}
-
-export interface UseOnProps {
- /**
- * The callback to be executed when the event is triggered.
- */
- callback: (response?: any) => void | Promise;
- /**
- * The event to listen to.
- */
- event: Hooks;
-}
diff --git a/packages/__legacy__/react/src/models/use-translations.ts b/packages/__legacy__/react/src/models/use-translations.ts
deleted file mode 100644
index ed53fe5b7..000000000
--- a/packages/__legacy__/react/src/models/use-translations.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-interface UseTranslations {
- isLoading: boolean;
- t: (key: string) => string;
-}
-
-export default UseTranslations;
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignIn/SignIn.tsx b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignIn/SignIn.tsx
deleted file mode 100644
index 0eef4fb4d..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignIn/SignIn.tsx
+++ /dev/null
@@ -1,224 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Box, BoxProps} from '@oxygen-ui/react';
-import clsx from 'clsx';
-import {
- ElementType,
- ForwardRefExoticComponent,
- MutableRefObject,
- ReactElement,
- forwardRef,
- isValidElement,
-} from 'react';
-import {WithWrapperProps} from '../models/component';
-import SignInAlert from '../SignInAlert/SignInAlert';
-import SignInButton, {SignInButtonProps} from '../SignInButton/SignInButton';
-import SignInDivider from '../SignInDivider/SignInDivider';
-import SignInFooter from '../SignInFooter/SignInFooter';
-import SignInImage from '../SignInImage/SignInImage';
-import SignInLink, {SignInLinkProps} from '../SignInLink/SignInLink';
-import SignInPaper from '../SignInPaper/SignInPaper';
-import SignInPinInput from '../SignInPinInput/SignInPinInput';
-import SignInTextField, {SignInTextFieldProps} from '../SignInTextField/SignInTextField';
-import SignInTypography, {SignInTypographyProps} from '../SignInTypography/SignInTypography';
-import './sign-in.scss';
-
-type Footer =
- | ReactElement
- | {
- copyrights?: {
- link?: string;
- text: string;
- };
- locale?: {
- text: string;
- };
- privacyPolicy?: {
- link?: string;
- text: string;
- };
- termsOfUse?: {
- link?: string;
- text: string;
- };
- };
-
-export type SignInProps = {
- component?: C;
- footer?: Footer;
- links?: SignInLinkProps[];
- loginOptions?: SignInButtonProps[];
- logo?: string;
- submitButton?: {text: string} & SignInButtonProps;
- subtitle?: {text: string} & SignInTypographyProps;
- textFields?: SignInTextFieldProps[];
- title?: {text: string} & SignInTypographyProps;
-} & Omit;
-
-type SignInCompoundProps = {
- Alert: typeof SignInAlert;
- Button: typeof SignInButton;
- Divider: typeof SignInDivider;
- Footer: typeof SignInFooter;
- Image: typeof SignInImage;
- Link: typeof SignInLink;
- Paper: typeof SignInPaper;
- PinInput: typeof SignInPinInput;
- TextField: typeof SignInTextField;
- Typography: typeof SignInTypography;
-};
-
-const COMPONENT_NAME: string = 'SignIn';
-
-const SignIn: ForwardRefExoticComponent & WithWrapperProps & SignInCompoundProps = forwardRef(
- (props: SignInProps, ref: MutableRefObject): ReactElement => {
- const {
- children,
- className,
- title,
- subtitle,
- textFields = [
- {
- label: 'username',
- name: 'text',
- placeholder: 'Enter your username',
- },
- {
- label: 'Password',
- name: 'password',
- placeholder: 'Enter your password',
- type: 'password',
- },
- ],
- links,
- loginOptions,
- logo,
- submitButton,
- footer,
- ...rest
- } = props;
-
- const classes: string = clsx(`Oxygen${COMPONENT_NAME}`, className);
-
- /**
- * Destructure the title and subtitle props to extract the title and subtitle as both cannot be passed.
- */
- const {
- children: titleChildren,
- text: titleText,
- title: titleTitle,
- subtitle: titleSubtitle,
- ...restTitleProps
- } = title ?? {};
-
- const {
- children: subtitleChildren,
- text: subtitleText,
- title: subtitleTitle,
- subtitle: subtitleSubtitle,
- ...restSubtitleProps
- } = subtitle ?? {};
-
- const {children: submitButtonChildren, text: submitButtonText, ...restSubmitButtonTextProps} = submitButton ?? {};
-
- /**
- * If SignIn component contains any children render only the outer box.
- * Otherwise render the default SignIn component.
- */
- if (children) {
- return (
-
- {children}
-
- );
- }
-
- return (
-
- {logo && }
-
-
-
- {titleChildren ?? titleText ?? 'Sign In'}
-
-
- {subtitle && (
-
- {subtitleChildren ?? subtitleText}
-
- )}
-
- {textFields.map((textFieldProps: SignInTextFieldProps, index: number) => (
-
- ))}
-
-
- {submitButtonChildren ?? submitButtonText ?? 'Sign In'}
-
-
- {links &&
- links.map((linkProps: SignInLinkProps, index: number) => (
-
-
-
-
- ))}
-
- {loginOptions && (
- <>
- OR
- {loginOptions.map((loginOptionProps: SignInButtonProps, index: number) => (
-
- ))}
- >
- )}
-
-
- {footer && isValidElement(footer) ? (
- footer
- ) : (
- {footer?.copyrights?.text}}}
- items={[
- {children: {footer?.termsOfUse?.text}},
- {children: {footer?.privacyPolicy?.text}},
- {children: {footer?.locale?.text}},
- ]}
- />
- )}
-
- );
- },
-) as ForwardRefExoticComponent & WithWrapperProps & SignInCompoundProps;
-
-SignIn.displayName = COMPONENT_NAME;
-SignIn.muiName = COMPONENT_NAME;
-
-SignIn.Typography = SignInTypography;
-SignIn.Paper = SignInPaper;
-SignIn.Alert = SignInAlert;
-SignIn.Divider = SignInDivider;
-SignIn.Link = SignInLink;
-SignIn.Button = SignInButton;
-SignIn.TextField = SignInTextField;
-SignIn.PinInput = SignInPinInput;
-SignIn.Image = SignInImage;
-SignIn.Footer = SignInFooter;
-
-export default SignIn;
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignIn/sign-in.scss b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignIn/sign-in.scss
deleted file mode 100644
index 609fac01b..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignIn/sign-in.scss
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.OxygenSignIn {
- display: flex;
- flex-flow: column nowrap;
- align-content: center;
- justify-content: center;
- align-items: center;
- text-align: left;
- padding: 20px;
- max-width: fit-content;
-}
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInAlert/SignInAlert.tsx b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInAlert/SignInAlert.tsx
deleted file mode 100644
index 0cef75cd4..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInAlert/SignInAlert.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Alert} from '@oxygen-ui/react';
-import clsx from 'clsx';
-import {ElementType, ForwardRefExoticComponent, MutableRefObject, ReactElement, forwardRef} from 'react';
-import {WithWrapperProps} from '../models/component';
-import './sign-in-alert.scss';
-
-// TODO: AlertProps is not available in oxygen-ui/react
-export type SignInAlertProps = {
- component?: C;
-} & (
- | {error?: boolean; info?: never; warning?: never}
- | {error?: never; info?: boolean; warning?: never}
- | {error?: never; info?: never; warning?: boolean}
-);
-
-const COMPONENT_NAME: string = 'SignInAlert';
-
-enum Color {
- Error = 'error',
- Info = 'info',
- Warning = 'warning',
-}
-
-const SignInAlert: ForwardRefExoticComponent & WithWrapperProps = forwardRef(
- (props: SignInAlertProps, ref: MutableRefObject): ReactElement => {
- const {className, error, info, warning, color, icon, ...rest} = props;
-
- const classes: string = clsx(`Oxygen${COMPONENT_NAME}`, className);
-
- let extendedColor: string = color;
- if (!color) {
- if (error) {
- extendedColor = Color.Error;
- } else if (warning) {
- extendedColor = Color.Warning;
- } else {
- extendedColor = Color.Info;
- }
- }
-
- const extendedIcon: Node | boolean = icon || false;
-
- return ;
- },
-) as ForwardRefExoticComponent & WithWrapperProps;
-
-SignInAlert.displayName = COMPONENT_NAME;
-SignInAlert.muiName = COMPONENT_NAME;
-
-export default SignInAlert;
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInAlert/sign-in-alert.scss b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInAlert/sign-in-alert.scss
deleted file mode 100644
index 10154369f..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInAlert/sign-in-alert.scss
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.OxygenSignInAlert {
- border-radius: 12px;
-}
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInButton/SignInButton.tsx b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInButton/SignInButton.tsx
deleted file mode 100644
index 51a8fb983..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInButton/SignInButton.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Button, ButtonProps} from '@oxygen-ui/react';
-import clsx from 'clsx';
-import {ElementType, ForwardRefExoticComponent, MutableRefObject, ReactElement, forwardRef} from 'react';
-import {WithWrapperProps} from '../models/component';
-import './sign-in-button.scss';
-
-export type SignInButtonProps = {
- component?: C;
- social?: boolean;
-} & Omit;
-
-const COMPONENT_NAME: string = 'SignInButton';
-
-const SignInButton: ForwardRefExoticComponent & WithWrapperProps = forwardRef(
- (props: SignInButtonProps, ref: MutableRefObject): ReactElement => {
- const {className, variant, social, ...rest} = props;
-
- let classes: string = clsx(`Oxygen${COMPONENT_NAME}`, className);
- if (social) {
- classes = clsx(classes, `Oxygen${COMPONENT_NAME}-social`);
- }
-
- return ;
- },
-) as ForwardRefExoticComponent & WithWrapperProps;
-
-SignInButton.displayName = COMPONENT_NAME;
-SignInButton.muiName = COMPONENT_NAME;
-
-export default SignInButton;
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInButton/sign-in-button.scss b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInButton/sign-in-button.scss
deleted file mode 100644
index 315220b9e..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInButton/sign-in-button.scss
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.OxygenSignInButton {
- margin: 16px 0;
-}
-
-.OxygenSignInButton-social {
- background: white;
- color: black;
- margin: 0;
- padding: 8px 0;
- box-shadow: 0 1px 1px 2px rgb(0 0 0 / 12%), 0 1px 1px 0 rgb(0 0 0 / 24%);
-
- img {
- max-height: 22px;
- }
-
- &:hover {
- background: rgb(213 212 212);
- box-shadow: 0 1px 1px 2px rgb(0 0 0 / 12%), 0 1px 1px 0 rgb(0 0 0 / 24%);
- }
-
- &:not(:last-child) {
- margin-bottom: 16px;
- }
-}
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInDivider/SignInDivider.tsx b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInDivider/SignInDivider.tsx
deleted file mode 100644
index ae55a7809..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInDivider/SignInDivider.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Divider, DividerProps} from '@oxygen-ui/react';
-import clsx from 'clsx';
-import {ElementType, ForwardRefExoticComponent, MutableRefObject, ReactElement, forwardRef} from 'react';
-import {WithWrapperProps} from '../models/component';
-import './sign-in-divider.scss';
-
-export type SignInDividerProps = {
- component?: C;
-} & Omit;
-
-const COMPONENT_NAME: string = 'SignInDivider';
-
-const SignInDivider: ForwardRefExoticComponent & WithWrapperProps = forwardRef(
- (props: SignInDividerProps, ref: MutableRefObject): ReactElement => {
- const {className, ...rest} = props;
-
- const classes: string = clsx(`Oxygen${COMPONENT_NAME}`, className);
-
- return ;
- },
-) as ForwardRefExoticComponent & WithWrapperProps;
-
-SignInDivider.displayName = COMPONENT_NAME;
-SignInDivider.muiName = COMPONENT_NAME;
-
-export default SignInDivider;
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInDivider/sign-in-divider.scss b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInDivider/sign-in-divider.scss
deleted file mode 100644
index d8ad2ab3e..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInDivider/sign-in-divider.scss
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.OxygenSignInDivider {
- margin: 16px 0;
-}
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInFooter/SignInFooter.tsx b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInFooter/SignInFooter.tsx
deleted file mode 100644
index 31294fe0b..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInFooter/SignInFooter.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Grid, GridProps} from '@oxygen-ui/react';
-import clsx from 'clsx';
-import {ElementType, ForwardRefExoticComponent, MutableRefObject, ReactElement, forwardRef} from 'react';
-import {WithWrapperProps} from '../models/component';
-import SignInTypography, {SignInTypographyProps} from '../SignInTypography/SignInTypography';
-import './sign-in-footer.scss';
-
-const COMPONENT_NAME: string = 'SignInFooter';
-
-export type SignInFooterProps = {
- component?: C;
- copyrights?: SignInTypographyProps;
- items?: GridProps[];
-} & Omit;
-
-const SignInFooter: ForwardRefExoticComponent & WithWrapperProps = forwardRef(
- (props: SignInFooterProps, ref: MutableRefObject): ReactElement => {
- const {className, copyrights, items, ...rest} = props;
-
- const classes: string = clsx(`Oxygen${COMPONENT_NAME}`, className);
-
- return (
-
-
-
-
-
- {items && items.map((item: GridProps, index: number) => )}
-
-
- );
- },
-) as ForwardRefExoticComponent & WithWrapperProps;
-
-export default SignInFooter;
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInFooter/sign-in-footer.scss b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInFooter/sign-in-footer.scss
deleted file mode 100644
index 2800c95c4..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInFooter/sign-in-footer.scss
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.OxygenSignInFooter {
- width: 100%;
- margin: 16px 0;
- color: var(--oxygen-palette-text-secondary);
-
- .OxygenSignInLink {
- color: var(--oxygen-palette-text-secondary);
-
- &:hover {
- color: var(--oxygen-palette-primary-main);
- cursor: pointer;
- }
- }
-}
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInImage/SignInImage.tsx b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInImage/SignInImage.tsx
deleted file mode 100644
index 117e0c27d..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInImage/SignInImage.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import clsx from 'clsx';
-import {ForwardRefExoticComponent, ImgHTMLAttributes, MutableRefObject, ReactElement, forwardRef} from 'react';
-import {WithWrapperProps} from '../models/component';
-import './sign-in-image.scss';
-
-export type SignInImageProps = ImgHTMLAttributes;
-
-const COMPONENT_NAME: string = 'SignInImage';
-
-const SignInImage: ForwardRefExoticComponent & WithWrapperProps = forwardRef(
- (props: SignInImageProps, ref: MutableRefObject): ReactElement => {
- const {className, alt, ...rest} = props;
-
- const classes: string = clsx(`Oxygen${COMPONENT_NAME}`, className);
-
- return ;
- },
-) as ForwardRefExoticComponent & WithWrapperProps;
-
-SignInImage.displayName = COMPONENT_NAME;
-SignInImage.muiName = COMPONENT_NAME;
-
-export default SignInImage;
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInImage/sign-in-image.scss b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInImage/sign-in-image.scss
deleted file mode 100644
index 1a7851787..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInImage/sign-in-image.scss
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.OxygenSignInImage {
- margin: 16px 0;
- min-height: 40px;
- max-height: 85px;
-}
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInLink/SignInLink.tsx b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInLink/SignInLink.tsx
deleted file mode 100644
index 456a29a11..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInLink/SignInLink.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Link, LinkProps} from '@oxygen-ui/react';
-import clsx from 'clsx';
-import {ElementType, ForwardRefExoticComponent, MutableRefObject, ReactElement, forwardRef} from 'react';
-import {WithWrapperProps} from '../models/component';
-
-export type SignInLinkProps = {
- component?: C;
-} & Omit;
-
-const COMPONENT_NAME: string = 'SignInLink';
-
-const SignInLink: ForwardRefExoticComponent & WithWrapperProps = forwardRef(
- (props: SignInLinkProps, ref: MutableRefObject): ReactElement => {
- const {className, ...rest} = props;
-
- const classes: string = clsx(`Oxygen${COMPONENT_NAME}`, className);
-
- return ;
- },
-) as ForwardRefExoticComponent & WithWrapperProps;
-
-SignInLink.displayName = COMPONENT_NAME;
-SignInLink.muiName = COMPONENT_NAME;
-
-export default SignInLink;
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInPaper/SignInPaper.tsx b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInPaper/SignInPaper.tsx
deleted file mode 100644
index 891008680..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInPaper/SignInPaper.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Paper, PaperProps} from '@oxygen-ui/react';
-import clsx from 'clsx';
-import {ElementType, ForwardRefExoticComponent, MutableRefObject, ReactElement, forwardRef} from 'react';
-import {WithWrapperProps} from '../models/component';
-import './sign-in-paper.scss';
-
-export type SignInPaperProps = {
- component?: C;
-} & Omit;
-
-const COMPONENT_NAME: string = 'SignInPaper';
-
-const SignInPaper: ForwardRefExoticComponent & WithWrapperProps = forwardRef(
- (props: SignInPaperProps, ref: MutableRefObject): ReactElement => {
- const {className, variant, ...rest} = props;
-
- const classes: string = clsx(`Oxygen${COMPONENT_NAME}`, className);
-
- const extendedVariant: string = variant || 'outlined';
-
- return ;
- },
-) as ForwardRefExoticComponent & WithWrapperProps;
-
-SignInPaper.displayName = COMPONENT_NAME;
-SignInPaper.muiName = COMPONENT_NAME;
-
-export default SignInPaper;
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInPaper/sign-in-paper.scss b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInPaper/sign-in-paper.scss
deleted file mode 100644
index be98e68d1..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInPaper/sign-in-paper.scss
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.OxygenSignInPaper {
- padding: 52px;
- min-width: 350px;
- max-width: 420px;
- padding-bottom: 35px;
-}
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInPinInput/SignInPinInput.tsx b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInPinInput/SignInPinInput.tsx
deleted file mode 100644
index ab0e61cd1..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInPinInput/SignInPinInput.tsx
+++ /dev/null
@@ -1,139 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Box, BoxProps, TextField, TextFieldProps} from '@oxygen-ui/react';
-import clsx from 'clsx';
-import React, {
- useState,
- useRef,
- useEffect,
- MutableRefObject,
- ForwardRefExoticComponent,
- forwardRef,
- ElementType,
- ReactElement,
-} from 'react';
-import {WithWrapperProps} from '../models/component';
-import './sign-in-pin-input.scss';
-
-const COMPONENT_NAME: string = 'SignInPinInput';
-
-export type SignInPinInputProps = {
- component?: C;
- itemProps?: TextFieldProps;
- length: number;
- onPinChange?: (pin: string) => void;
- pinValue: string;
-} & Omit;
-
-const SignInPinInput: ForwardRefExoticComponent & WithWrapperProps = forwardRef(
- (props: SignInPinInputProps, ref: MutableRefObject): ReactElement => {
- const {length, onPinChange, className, itemProps, pinValue, ...rest} = props;
-
- const classes: string = clsx(`Oxygen${COMPONENT_NAME}`, className);
-
- const [totp, setTotp] = useState(Array(length).fill('')); // Initialize a state variable for the TOTP
-
- const refs: MutableRefObject[]> = useRef(
- totp.map(() => React.createRef()),
- );
-
- useEffect(() => {
- if (pinValue) {
- setTotp(pinValue.split(''));
- } else {
- setTotp(Array(length).fill(''));
- }
- }, [length, pinValue]);
-
- useEffect(() => {
- /**
- * If all fields are filled, call onPinChange
- */
- if (onPinChange && totp.every((value: string) => value !== '')) {
- onPinChange(totp.join(''));
- }
- }, [totp, onPinChange]);
-
- const handleChange =
- (index: number) =>
- (event: React.ChangeEvent): void => {
- const newTotp: string[] = [...totp];
- newTotp[index] = event.target.value;
- setTotp(newTotp);
-
- /**
- * If a character is entered and there's a next TextField, focus it
- */
- if (event.target.value && index < totp.length - 1) {
- refs.current[index + 1].current?.focus();
- }
- };
-
- const handleKeyDown =
- (index: number) =>
- (event: React.KeyboardEvent): void => {
- /**
- * If the backspace key is pressed and the current field is empty
- */
- if (event.key === 'Backspace' && totp[index] === '') {
- /**
- * Prevent the default action to stop deleting characters in the previous field
- */
- event.preventDefault();
-
- /**
- * If there's a previous field, focus it
- */
- if (index > 0) {
- refs.current[index - 1].current?.focus();
-
- /**
- * Clear the value of the previous field
- */
- const newTotp: string[] = [...totp];
- newTotp[index - 1] = '';
- setTotp(newTotp);
- }
- }
- };
-
- return (
-
- {[...Array(length)].map((_: number, index: number) => (
-
- ))}
-
- );
- },
-) as ForwardRefExoticComponent & WithWrapperProps;
-
-SignInPinInput.muiName = COMPONENT_NAME;
-export default SignInPinInput;
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInPinInput/sign-in-pin-input.scss b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInPinInput/sign-in-pin-input.scss
deleted file mode 100644
index 121aae46c..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInPinInput/sign-in-pin-input.scss
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.OxygenSignInPinInput {
- display: flex;
- flex-flow: row nowrap;
- align-content: center;
- justify-content: center;
- align-items: center;
- gap: 12px;
- text-align: center;
- margin: 16px 0;
-
- .MuiInputBase-input {
- text-align: center;
- }
-
- input {
- padding: 16px 0;
- width: 45px;
- }
-}
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInTextField/SignInTextField.tsx b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInTextField/SignInTextField.tsx
deleted file mode 100644
index cba166964..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInTextField/SignInTextField.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {TextField, TextFieldProps} from '@oxygen-ui/react';
-import clsx from 'clsx';
-import {ElementType, ForwardRefExoticComponent, MutableRefObject, ReactElement, forwardRef} from 'react';
-import {WithWrapperProps} from '../models/component';
-import './sign-in-text-field.scss';
-
-export type SignInTextFieldProps = {
- component?: C;
-} & Omit;
-
-const COMPONENT_NAME: string = 'SignInTextField';
-
-const SignInTextField: ForwardRefExoticComponent & WithWrapperProps = forwardRef(
- (props: SignInTextFieldProps, ref: MutableRefObject): ReactElement => {
- const {className, variant, ...rest} = props;
-
- const classes: string = clsx(`Oxygen${COMPONENT_NAME}`, className);
-
- return ;
- },
-) as ForwardRefExoticComponent & WithWrapperProps;
-
-SignInTextField.displayName = COMPONENT_NAME;
-SignInTextField.muiName = COMPONENT_NAME;
-
-export default SignInTextField;
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInTextField/sign-in-text-field.scss b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInTextField/sign-in-text-field.scss
deleted file mode 100644
index 49225b9db..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInTextField/sign-in-text-field.scss
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.OxygenSignInTextField {
- margin: 16px 0;
-
- .MuiInputLabel-root {
- color: var(--oxygen-palette-text-primary);
- }
-}
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInTypography/SignInTypography.tsx b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInTypography/SignInTypography.tsx
deleted file mode 100644
index c974f759e..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInTypography/SignInTypography.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Typography, TypographyProps} from '@oxygen-ui/react';
-import clsx from 'clsx';
-import {ElementType, ForwardRefExoticComponent, MutableRefObject, ReactElement, forwardRef} from 'react';
-import {WithWrapperProps} from '../models/component';
-import './sign-in-typography.scss';
-
-export type SignInTypographyProps = {
- component?: C;
-} & Omit &
- ({subtitle?: never; title?: boolean} | {subtitle?: boolean; title?: never});
-
-const COMPONENT_NAME: string = 'SignInTypography';
-
-const SignInTypography: ForwardRefExoticComponent & WithWrapperProps = forwardRef(
- (props: SignInTypographyProps, ref: MutableRefObject): ReactElement => {
- const {className, title, subtitle, variant, align, ...rest} = props;
-
- let classes: string = clsx(`Oxygen${COMPONENT_NAME}`, className);
-
- let extendedVariant: string = variant || 'body1';
- let extendedAlign: string = align || 'left';
-
- if (!variant) {
- if (title) {
- extendedVariant = 'h5';
- } else if (subtitle) {
- extendedVariant = 'body1';
- classes = clsx(classes, `Oxygen${COMPONENT_NAME}-subtitle`);
- }
- }
-
- if (!align) {
- if (title || subtitle) {
- extendedAlign = 'center';
- }
- }
-
- return ;
- },
-) as ForwardRefExoticComponent & WithWrapperProps;
-
-SignInTypography.displayName = COMPONENT_NAME;
-SignInTypography.muiName = COMPONENT_NAME;
-
-export default SignInTypography;
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInTypography/sign-in-typography.scss b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInTypography/sign-in-typography.scss
deleted file mode 100644
index 86e3d249f..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/SignInTypography/sign-in-typography.scss
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-.OxygenSignInTypography-subtitle {
- color: var(--oxygen-palette-text-secondary);
-}
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/index.ts b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/index.ts
deleted file mode 100644
index 017b05112..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/index.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-export {default as SignIn} from './SignIn/SignIn';
-export * from './SignIn/SignIn';
diff --git a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/models/component.ts b/packages/__legacy__/react/src/oxygen-ui-react-auth-components/models/component.ts
deleted file mode 100644
index f7bc9657a..000000000
--- a/packages/__legacy__/react/src/oxygen-ui-react-auth-components/models/component.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-export type WithWrapperProps = MuiWrapperProps;
-
-export interface MuiWrapperProps {
- /**
- * Component name with `Mui` prefix.
- * To provide maximum flexibility and performance, MUI needs a way to know the nature
- * of the child elements a component receives.
- * @see {@link https://mui.com/material-ui/guides/composition/#wrapping-components}
- */
- muiName: string;
-}
diff --git a/packages/__legacy__/react/src/providers/AsgardeoProvider.tsx b/packages/__legacy__/react/src/providers/AsgardeoProvider.tsx
deleted file mode 100644
index 971dcc98b..000000000
--- a/packages/__legacy__/react/src/providers/AsgardeoProvider.tsx
+++ /dev/null
@@ -1,187 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {
- AuthApiResponse,
- AuthClient,
- Crypto,
- MeAPIResponse,
- Store,
- UIAuthClient,
- getProfileInformation,
-} from '@asgardeo/js';
-import {FC, PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState} from 'react';
-import BrandingPreferenceProvider from './BrandingPreferenceProvider';
-import I18nProvider from './I18nProvider';
-import AsgardeoContext from '../contexts/asgardeo-context';
-import AsgardeoProviderProps from '../models/asgardeo-provider-props';
-import AuthContext from '../models/auth-context';
-import SPACryptoUtils from '../utils/crypto-utils';
-import SessionStore from '../utils/session-store';
-
-/**
- * `AsgardeoProvider` is a component that provides an Asgardeo context to all its children.
- * It takes an object of type `AsgardeProviderProps` as props, which includes the children to render,
- * a configuration object, a store instance, and a branding object.
- *
- * @param {PropsWithChildren} props - The properties passed to the component.
- * @param {ReactNode} props.children - The children to render inside the provider.
- * @param {Config} props.config - The configuration object for the Asgardeo context.
- * @param {Store} [props.store] - An optional store instance. If not provided, a new SessionStore will be created.
- * @param {Branding} props.branding - The branding object for the Asgardeo context.
- *
- * @returns {ReactElement} A React element that provides the Asgardeo context to all its children.
- */
-const AsgardeoProvider: FC> = (
- props: PropsWithChildren,
-) => {
- const {children, config, store, branding} = props;
-
- const [accessToken, setAccessToken] = useState('');
- const [isSignedIn, setIsAuthenticated] = useState();
- const [user, setUser] = useState();
- const [isBrandingLoading, setIsBrandingLoading] = useState(true);
- const [isTextLoading, setIsTextLoading] = useState(true);
- const [isAuthLoading, setIsAuthLoading] = useState(false);
- const [isComponentLoading, setIsComponentLoading] = useState(true);
- const [authResponse, setAuthResponse] = useState();
- const [username, setUsername] = useState('');
-
- const onSignInRef: React.MutableRefObject = useRef();
- const onSignOutRef: React.MutableRefObject = useRef();
-
- const setOnSignIn: (newOnSignIn: Function) => void = useCallback(
- (newOnSignIn: Function): void => {
- onSignInRef.current = newOnSignIn;
- },
- [], // Add any dependencies here...
- );
-
- const setOnSignOut: (newOnSignOut: Function) => void = useCallback(
- (newOnSignOut: Function): void => {
- onSignOutRef.current = newOnSignOut;
- },
- [], // Add any dependencies here...
- );
-
- const storeInstance: Store = store || new SessionStore();
-
- const spaUtils: Crypto = new SPACryptoUtils();
-
- const authClient: UIAuthClient = AuthClient.getInstance(config, storeInstance, spaUtils);
-
- /**
- * Sets the authentication status and access token.
- */
- const setAuthentication: () => void = useCallback((): void => {
- authClient.isSignedIn().then((isAuth: boolean) => {
- setIsAuthenticated(isAuth);
-
- if (isAuth) {
- authClient.getAccessToken().then((accessTokenFromClient: string) => {
- if (accessTokenFromClient) {
- setAccessToken(accessTokenFromClient);
-
- getProfileInformation().then((response: MeAPIResponse) => {
- setUser(response);
- });
-
- if (onSignInRef.current) {
- onSignInRef.current();
- }
- }
- });
- }
- });
- }, [authClient]);
-
- useEffect(() => {
- setAuthentication();
-
- /**
- * This script is added so that the popup window can send the code and state to the parent window
- */
- const url: URL = new URL(window.location.href);
- if (url.searchParams.has('code') && url.searchParams.has('state')) {
- const code: string = url.searchParams.get('code');
- const state: string = url.searchParams.get('state');
-
- /**
- * Send the 'code' and 'state' to the parent window and close the current window (popup)
- */
- window.opener.postMessage({code, state}, config.afterSignInUrl);
- window.close();
- }
- }, [config.afterSignInUrl, setAuthentication]);
-
- const value: AuthContext = useMemo(
- () => ({
- accessToken,
- authResponse,
- config,
- isAuthLoading,
- isSignedIn,
- isBrandingLoading,
- isComponentLoading,
- isGlobalLoading: isAuthLoading || isBrandingLoading || isComponentLoading || isTextLoading,
- isTextLoading,
- onSignOutRef,
- setAuthResponse,
- setAuthentication,
- setIsAuthLoading,
- setIsBrandingLoading,
- setIsComponentLoading,
- setIsTextLoading,
- setOnSignIn,
- setOnSignOut,
- setUsername,
- user,
- username,
- }),
- [
- accessToken,
- authResponse,
- config,
- isAuthLoading,
- isSignedIn,
- isBrandingLoading,
- isComponentLoading,
- isTextLoading,
- setAuthResponse,
- setAuthentication,
- setIsComponentLoading,
- setOnSignIn,
- setOnSignOut,
- setUsername,
- user,
- username,
- ],
- );
-
- return (
-
-
-
- {children}
-
-
-
- );
-};
-
-export default AsgardeoProvider;
diff --git a/packages/__legacy__/react/src/providers/BrandingPreferenceProvider.tsx b/packages/__legacy__/react/src/providers/BrandingPreferenceProvider.tsx
deleted file mode 100644
index d9439a605..000000000
--- a/packages/__legacy__/react/src/providers/BrandingPreferenceProvider.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Branding, getBranding} from '@asgardeo/js';
-import {ThemeProvider} from '@oxygen-ui/react';
-import {FC, PropsWithChildren, useContext, useEffect, useState} from 'react';
-import AsgardeoContext from '../contexts/asgardeo-context';
-import BrandingPreferenceContext from '../contexts/branding-preference-context';
-import BrandingPreferenceProviderProps from '../models/branding-preference-provider-props';
-import generateTheme from '../theme/generate-theme';
-
-/**
- * `BrandingPreferenceProvider` is a component that provides a branding context to all its children.
- * It takes an object of type `BrandingPreferenceProviderProps` as props, which includes the children to render,
- * and a branding object.
- *
- * @param {PropsWithChildren} props - The properties passed to the component.
- * @param {ReactNode} props.children - The children to render inside the provider.
- * @param {Branding} props.branding - The branding object for the context.
- *
- * @returns {ReactElement} A React element that provides the branding context to all its children.
- */
-const BrandingPreferenceProvider: FC> = (
- props: PropsWithChildren,
-) => {
- const {children, branding} = props;
-
- const [brandingPreference, setBrandingPreference] = useState();
-
- const {setIsBrandingLoading} = useContext(AsgardeoContext);
-
- useEffect(() => {
- setIsBrandingLoading(true);
- getBranding({branding}).then((response: Branding) => {
- setBrandingPreference(response);
- setIsBrandingLoading(false);
- });
- }, [branding, setIsBrandingLoading]);
-
- return (
-
- {children}
-
- );
-};
-
-export default BrandingPreferenceProvider;
diff --git a/packages/__legacy__/react/src/providers/I18nProvider.tsx b/packages/__legacy__/react/src/providers/I18nProvider.tsx
deleted file mode 100644
index 4ef0cb60d..000000000
--- a/packages/__legacy__/react/src/providers/I18nProvider.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {TextObject, getLocalization} from '@asgardeo/js';
-import {FC, PropsWithChildren, useCallback, useContext, useMemo, useState} from 'react';
-import AsgardeoContext from '../contexts/asgardeo-context';
-import I18nContext from '../contexts/i18n-context';
-import {I18n, I18nLocalization, I18nProviderProps, SetTranslationsProps} from '../models/i18n';
-
-/**
- * `I18nProvider` is a component that provides an internationalization context to all its children.
- * It takes an object of type `I18nProviderProps` as props, which includes the children to render,
- * a locale override, and text overrides.
- *
- * @param {PropsWithChildren} props - The properties passed to the component.
- * @param {ReactNode} props.children - The children to render inside the provider.
- * @param {string} [props.providerLocaleOverride] - Optional locale override.
- * @param {TextObject} [props.providerTextOverrides] - Optional text overrides.
- *
- * @returns {ReactElement} A React element that provides the internationalization context to all its children.
- */
-const I18nProvider: FC> = (props: PropsWithChildren) => {
- const {children, providerLocaleOverride, providerTextOverrides} = props;
-
- const [text, setText] = useState({});
-
- const {setIsTextLoading} = useContext(AsgardeoContext);
-
- /**
- * `setTranslations` is a function that fetches and sets the translations for a specific screen.
- * It takes an object of type `SetTranslationsProps` as an argument, which includes the screen type,
- * and optional locale and text overrides.
- *
- * @param {SetTranslationsProps} setTranslationProps - The properties used to fetch and set the translations.
- *
- * @returns {Promise} A promise that resolves to `true` when the translations have been set.
- */
- const setTranslations: (setTranslationProps: SetTranslationsProps) => Promise = useCallback(
- async (setTranslationProps: SetTranslationsProps): Promise => {
- const {componentLocaleOverride, componentTextOverrides, screen} = setTranslationProps;
-
- if (!Object.prototype.hasOwnProperty.call(text, screen)) {
- setIsTextLoading(true);
- const newText: TextObject = await getLocalization({
- componentTextOverrides,
- locale: componentLocaleOverride ?? providerLocaleOverride ?? 'en-US',
- providerTextOverrides,
- screen,
- });
-
- setText({...text, [screen]: newText});
- setIsTextLoading(false);
- }
- return true;
- },
- [providerLocaleOverride, providerTextOverrides, setIsTextLoading, text],
- );
-
- const value: I18n = useMemo(() => ({setTranslations, text}), [setTranslations, text]);
-
- return {children};
-};
-
-export default I18nProvider;
diff --git a/packages/__legacy__/react/src/theme/generate-theme-sign-in.ts b/packages/__legacy__/react/src/theme/generate-theme-sign-in.ts
deleted file mode 100644
index 6785c41c9..000000000
--- a/packages/__legacy__/react/src/theme/generate-theme-sign-in.ts
+++ /dev/null
@@ -1,159 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {BrandingPreferenceTheme, ThemeConfig} from '@asgardeo/js';
-import {extendTheme, Theme} from '@oxygen-ui/react';
-
-/**
- * This function generates the theme for the sign-in component.
- *
- * @param {BrandingPreferenceTheme} brandingPreferenceTheme - The branding preference theme.
- *
- * @return {Theme} The generated theme.
- */
-const generateThemeSignIn: (brandingPreferenceTheme: BrandingPreferenceTheme) => Theme = (
- brandingPreferenceTheme: BrandingPreferenceTheme,
-) => {
- const mode: string = brandingPreferenceTheme?.activeTheme.toLowerCase() ?? 'light';
- const brandingTheme: ThemeConfig = brandingPreferenceTheme[mode.toUpperCase()];
-
- return extendTheme({
- colorSchemes: {
- dark: {
- brand: {
- logo: {
- main: brandingTheme?.images?.myAccountLogo?.imgURL ?? `../assets/asgardeo-logo.svg`,
- },
- },
- palette: {
- primary: {
- main: brandingTheme?.colors?.primary?.main ?? 'var(--oxygen-palette-primary-main)',
- },
- },
- },
- light: {
- brand: {
- logo: {
- main: brandingTheme?.images?.myAccountLogo?.imgURL ?? `../assets/asgardeo-logo.svg`,
- },
- },
- palette: {
- primary: {
- main: brandingTheme?.colors?.primary?.main ?? 'var(--oxygen-palette-primary-main)',
- },
- },
- },
- },
- components: {
- MuiButton: {
- styleOverrides: {
- root: {
- borderRadius: brandingTheme?.buttons?.primary?.base?.border?.borderRadius,
- color: brandingTheme?.buttons?.primary?.base?.font?.color,
- },
- },
- },
- MuiFormControl: {
- styleOverrides: {
- root: {
- background: brandingTheme?.inputs?.base?.background?.backgroundColor,
- borderColor: brandingTheme?.inputs?.base?.border?.borderColor,
- borderRadius: brandingTheme?.inputs?.base?.border?.borderRadius,
- color: brandingTheme?.inputs?.base?.font?.color,
- },
- },
- },
- MuiInputBase: {
- styleOverrides: {
- root: {
- borderRadius: `${brandingTheme?.inputs?.base?.border?.borderRadius} !important`,
- color: brandingTheme?.inputs?.base?.font?.color,
- },
- },
- },
- MuiInputLabel: {
- styleOverrides: {
- root: {
- color: `${
- brandingTheme?.inputs?.base?.labels?.font?.color !== ''
- ? brandingTheme?.inputs?.base?.labels?.font?.color
- : brandingTheme?.colors?.text?.primary
- } !important`,
- },
- },
- },
- MuiLink: {
- styleOverrides: {
- root: {
- color: `${brandingTheme?.colors?.text?.primary} !important`,
- },
- },
- },
- MuiOutlinedInput: {
- styleOverrides: {
- input: {
- '&::placeholder': {
- color: 'var(--oxygen-palette-text-secondary)',
- },
- padding: '0.67857143em 1em',
- },
- },
- },
- MuiPaper: {
- styleOverrides: {
- root: {
- '.OxygenSignInButton-social': {
- backgroundColor: brandingTheme?.buttons.externalConnection.base.background.backgroundColor,
- borderRadius: brandingTheme?.buttons.externalConnection.base.border.borderRadius,
- color: brandingTheme?.buttons.externalConnection.base.font.color,
- },
- background: brandingTheme?.colors?.background?.surface?.main,
- borderColor: brandingTheme?.loginBox?.border?.borderColor ?? brandingTheme?.colors?.outlined?.default,
- borderRadius: brandingTheme?.loginBox?.border?.borderRadius,
- borderWidth: brandingTheme?.loginBox?.border?.borderWidth,
- },
- },
- },
- MuiTextField: {
- styleOverrides: {
- root: {
- color: 'purple',
- },
- },
- },
- MuiTypography: {
- styleOverrides: {
- root: {
- color: brandingTheme?.colors?.text?.primary,
- },
- },
- },
- },
- shape: {
- borderRadius: 4,
- },
- typography: {
- fontFamily: brandingTheme?.typography.font.fontFamily ?? 'Gilmer, sans-serif',
- h1: {
- fontWeight: 700,
- },
- },
- });
-};
-
-export default generateThemeSignIn;
diff --git a/packages/__legacy__/react/src/theme/generate-theme.ts b/packages/__legacy__/react/src/theme/generate-theme.ts
deleted file mode 100644
index 4706d3f70..000000000
--- a/packages/__legacy__/react/src/theme/generate-theme.ts
+++ /dev/null
@@ -1,162 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {BrandingPreferenceTheme, ThemeConfig} from '@asgardeo/js';
-import {extendTheme, Theme} from '@oxygen-ui/react';
-
-/**
- * `generateTheme` is a function that generates a theme based on the provided branding preferences.
- * It takes an object of type `BrandingPreferenceTheme` as an argument, which includes the active
- * theme and configurations for different themes.
- *
- * @param {BrandingPreferenceTheme} brandingPreferenceTheme - The branding preferences used to generate the theme.
- *
- * @returns {Theme} A theme object that can be used with the `extendTheme` function from `@oxygen-ui/react`.
- */
-const generateTheme: (brandingPreferenceTheme: BrandingPreferenceTheme) => Theme = (
- brandingPreferenceTheme: BrandingPreferenceTheme,
-) => {
- if (!brandingPreferenceTheme) {
- return null;
- }
-
- const mode: string = brandingPreferenceTheme?.activeTheme.toLowerCase() ?? 'light';
- const brandingTheme: ThemeConfig = brandingPreferenceTheme[mode.toUpperCase()];
-
- return extendTheme({
- colorSchemes: {
- dark: {
- brand: {
- logo: {
- main: brandingTheme?.images?.myAccountLogo?.imgURL ?? `../assets/asgardeo-logo.svg`,
- },
- },
- palette: {
- gradients: {
- primary: {
- stop1: brandingTheme.colors.primary.main,
- stop2: brandingTheme.colors.primary.main,
- },
- },
- primary: {
- main: brandingTheme?.colors?.primary?.main ?? 'var(--oxygen-palette-primary-main)',
- },
- },
- },
- light: {
- brand: {
- logo: {
- main: brandingTheme?.images?.myAccountLogo?.imgURL ?? `../assets/asgardeo-logo.svg`,
- },
- },
- palette: {
- gradients: {
- primary: {
- stop1: brandingTheme.colors.primary.main,
- stop2: brandingTheme.colors.primary.main,
- },
- },
- primary: {
- main: brandingTheme?.colors?.primary?.main ?? 'var(--oxygen-palette-primary-main)',
- },
- },
- },
- },
- components: {
- MuiButton: {
- styleOverrides: {
- root: {
- borderRadius: brandingTheme?.buttons?.primary?.base?.border?.borderRadius,
- color: brandingTheme?.buttons?.primary?.base?.font?.color,
- },
- },
- },
- MuiCircularProgress: {
- styleOverrides: {
- root: {
- color: `${brandingTheme?.colors?.primary?.main} !important`,
- },
- },
- },
- MuiFormControl: {
- styleOverrides: {
- root: {
- background: brandingTheme?.inputs?.base?.background?.backgroundColor,
- borderColor: brandingTheme?.inputs?.base?.border?.borderColor,
- borderRadius: brandingTheme?.inputs?.base?.border?.borderRadius,
- color: brandingTheme?.inputs?.base?.font?.color,
- },
- },
- },
- MuiInputLabel: {
- styleOverrides: {
- root: {
- color: `${
- brandingTheme?.inputs?.base?.labels?.font?.color ?? brandingTheme?.colors?.text?.primary
- } !important`,
- },
- },
- },
- MuiOutlinedInput: {
- styleOverrides: {
- input: {
- padding: '0.67857143em 1em',
- },
- },
- },
- MuiPaper: {
- styleOverrides: {
- root: {
- '.OxygenSignInButton-social': {
- backgroundColor: brandingTheme?.buttons.externalConnection.base.background.backgroundColor,
- borderRadius: brandingTheme?.buttons.externalConnection.base.border.borderRadius,
- color: brandingTheme?.buttons.externalConnection.base.font.color,
- },
- background: brandingTheme?.colors?.background?.surface?.main,
- borderColor: brandingTheme?.colors?.outlined?.default,
- },
- },
- },
- MuiTextField: {
- styleOverrides: {
- root: {
- borderColor: `${brandingTheme?.colors?.outlined?.default} !important`,
- },
- },
- },
- MuiTypography: {
- styleOverrides: {
- root: {
- color: brandingTheme?.colors?.text?.primary,
- },
- },
- },
- },
- shape: {
- borderRadius: 4,
- },
- typography: {
- fontFamily: brandingTheme?.typography.font.fontFamily ?? 'Gilmer, sans-serif',
- h1: {
- fontWeight: 700,
- },
- },
- });
-};
-
-export default generateTheme;
diff --git a/packages/__legacy__/react/src/utils/crypto-utils.ts b/packages/__legacy__/react/src/utils/crypto-utils.ts
deleted file mode 100644
index b351a9e37..000000000
--- a/packages/__legacy__/react/src/utils/crypto-utils.ts
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Buffer} from 'buffer';
-import {Crypto, JWKInterface, AsgardeoUIException} from '@asgardeo/js';
-import base64url from 'base64url';
-import sha256 from 'fast-sha256';
-import {createLocalJWKSet, jwtVerify} from 'jose';
-import randombytes from 'randombytes';
-import JwtVerifyOptions from '../models/jwt-verify-options';
-
-export default class SPACryptoUtils implements Crypto {
- /**
- * Get URL encoded string.
- *
- * @returns {string} base 64 url encoded value.
- */
- public base64URLEncode(value: Buffer | string): string {
- return base64url.encode(value).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
- }
-
- /**
- * Get URL decoded string.
- *
- * @returns {string} base 64 url decoded value.
- */
- public base64URLDecode(value: string): string {
- return base64url.decode(value).toString();
- }
-
- /**
- * Get SHA256 hash of the given data.
- *
- * @returns {string | Buffer} SHA256 hash of the data.
- */
- public hashSha256(data: string): string | Buffer {
- return Buffer.from(sha256(new TextEncoder().encode(data)));
- }
-
- /**
- * Generate random bytes.
- *
- * @returns {string | Buffer} Random bytes.
- */
- public generateRandomBytes(length: number): string | Buffer {
- return randombytes(length);
- }
-
- /**
- * Verify the given JWT.
- *
- * @returns {Promise} Promise containing the verification status.
- */
- public verifyJwt(
- idToken: string,
- jwk: Partial,
- algorithms: string[],
- clientId: string,
- issuer: string,
- subject: string,
- clockTolerance?: number,
- validateJwtIssuer?: boolean,
- ): Promise {
- const jwtVerifyOptions: JwtVerifyOptions = {
- algorithms,
- audience: clientId,
- clockTolerance,
- issuer,
- subject,
- };
-
- if (validateJwtIssuer ?? true) {
- jwtVerifyOptions.issuer = issuer;
- }
-
- return jwtVerify(
- idToken,
- createLocalJWKSet({
- keys: [jwk],
- }),
- jwtVerifyOptions,
- )
- .then(() => Promise.resolve(true))
- .catch((error: Error & {claim?: string; code?: string; reason?: string}) =>
- Promise.reject(
- new AsgardeoUIException(
- 'REACT_UI-CRYPTO-UTILS-VJ-IV01',
- error?.reason ?? JSON.stringify(error),
- `${error?.code} ${error?.claim}`,
- ),
- ),
- );
- }
-}
diff --git a/packages/__legacy__/react/src/utils/session-store.ts b/packages/__legacy__/react/src/utils/session-store.ts
deleted file mode 100644
index 9f6552907..000000000
--- a/packages/__legacy__/react/src/utils/session-store.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-import {Store} from '@asgardeo/js';
-
-export default class SessionStore implements Store {
- private storage: Storage;
-
- constructor() {
- this.storage = sessionStorage;
- }
-
- public async setData(key: string, value: string): Promise {
- this.storage.setItem(key, value);
- }
-
- public async getData(key: string): Promise {
- return this.storage.getItem(key) ?? '{}';
- }
-
- public async removeData(key: string): Promise {
- this.storage.removeItem(key);
- }
-}
diff --git a/packages/__legacy__/react/stylelint.config.cjs b/packages/__legacy__/react/stylelint.config.cjs
deleted file mode 100644
index 37f2d279d..000000000
--- a/packages/__legacy__/react/stylelint.config.cjs
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Copyright (c) 2024, 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.
- */
-
-module.exports = {
- extends: ['@wso2/stylelint-config'],
- ignoreFiles: ['**/*.ts', '**/*.cjs'],
-};
diff --git a/packages/__legacy__/react/tsconfig.eslint.json b/packages/__legacy__/react/tsconfig.eslint.json
deleted file mode 100644
index bdaa69d4b..000000000
--- a/packages/__legacy__/react/tsconfig.eslint.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "extends": "./tsconfig.json",
- "compilerOptions": {
- "module": "ESNext",
- "types": ["jest", "node"]
- },
- "include": [
- "**/*.cjs",
- "**/*.js",
- "**/*.jsx",
- "**/*.ts",
- "**/*.tsx",
- ]
- }
diff --git a/packages/__legacy__/react/tsconfig.json b/packages/__legacy__/react/tsconfig.json
deleted file mode 100644
index cb627bf60..000000000
--- a/packages/__legacy__/react/tsconfig.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "compileOnSave": false,
- "compilerOptions": {
- "jsx": "react-jsx",
- "target": "es2016",
- "module": "ESNext",
- "emitDecoratorMetadata": true,
- "esModuleInterop": true,
- "experimentalDecorators": true,
- "forceConsistentCasingInFileNames": true,
- "strict": false,
- "skipLibCheck": true,
- "skipDefaultLibCheck": true,
- "allowJs": true,
- "allowSyntheticDefaultImports": true,
- "declaration": true,
- "declarationDir": "dist/types",
- "outDir": "dist",
- "moduleResolution": "node",
- "importHelpers": true,
- "resolveJsonModule": true,
- "noImplicitOverride": true,
- "noPropertyAccessFromIndexSignature": true,
- "noImplicitReturns": true,
- "noFallthroughCasesInSwitch": true,
- },
- "include": [],
- "files": [],
- "exclude": ["node_modules", "tmp"],
- "references": [
- {
- "path": "./tsconfig.lib.json"
- }
- ]
-}
diff --git a/packages/__legacy__/react/tsconfig.lib.json b/packages/__legacy__/react/tsconfig.lib.json
deleted file mode 100644
index 7f9476b9b..000000000
--- a/packages/__legacy__/react/tsconfig.lib.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "extends": "./tsconfig.json",
- "compilerOptions": {
- "declaration": true,
- "outDir": "dist",
- "declarationDir": "types",
- "types": ["node"],
- "emitDeclarationOnly": true
- },
- "files": [],
- "exclude": [
- "test-configs",
- "jest.config.ts",
- "**/*.spec.ts",
- "**/*.test.ts",
- "**/*.spec.tsx",
- "**/*.test.tsx",
- "**/*.spec.js",
- "**/*.test.js",
- "**/*.spec.jsx",
- "**/*.test.jsx",
- "scripts",
- "dist"
- ],
- "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "rollup.config.cjs", "declarations.d.ts"]
- }
diff --git a/packages/javascript/src/index.ts b/packages/javascript/src/index.ts
index fe2b363f0..6dbd2ffc2 100644
--- a/packages/javascript/src/index.ts
+++ b/packages/javascript/src/index.ts
@@ -170,7 +170,7 @@ export {User, UserProfile} from './models/user';
export {SessionData} from './models/session';
export {Organization} from './models/organization';
export {TranslationFn} from './models/v2/translation';
-export {ResolveVarsOptions} from './models/v2/vars';
+export {ResolveFlowTemplateLiteralsOptions} from './models/v2/vars';
export {
BrandingPreference,
BrandingPreferenceConfig,
@@ -209,13 +209,15 @@ export {default as generateFlattenedUserProfile} from './utils/generateFlattened
export {default as getRedirectBasedSignUpUrl} from './utils/getRedirectBasedSignUpUrl';
export {default as identifyPlatform} from './utils/identifyPlatform';
export {default as isEmpty} from './utils/isEmpty';
+export {default as isEmojiUri, EMOJI_URI_SCHEME} from './utils/v2/isEmojiUri';
+export {default as extractEmojiFromUri} from './utils/v2/extractEmojiFromUri';
export {default as set} from './utils/set';
export {default as get} from './utils/get';
export {default as removeTrailingSlash} from './utils/removeTrailingSlash';
export {default as resolveFieldType} from './utils/resolveFieldType';
export {default as resolveFieldName} from './utils/resolveFieldName';
export {default as resolveMeta} from './utils/v2/resolveMeta';
-export {default as resolveVars} from './utils/v2/resolveVars';
+export {default as resolveFlowTemplateLiterals} from './utils/v2/resolveFlowTemplateLiterals';
export {default as countryCodeToFlagEmoji} from './utils/v2/countryCodeToFlagEmoji';
export {default as resolveLocaleDisplayName} from './utils/v2/resolveLocaleDisplayName';
export {default as resolveLocaleEmoji} from './utils/v2/resolveLocaleEmoji';
diff --git a/packages/javascript/src/models/v2/vars.ts b/packages/javascript/src/models/v2/vars.ts
index 6d68138e7..ceaf5030b 100644
--- a/packages/javascript/src/models/v2/vars.ts
+++ b/packages/javascript/src/models/v2/vars.ts
@@ -20,12 +20,12 @@ import {FlowMetadataResponse} from './flow-meta-v2';
import {TranslationFn} from './translation';
/**
- * Options for the resolveVars function.
+ * Options for the resolveFlowTemplateLiterals function.
*
* @template TFn - The concrete translation function type.
* Defaults to the SDK-native {@link TranslationFn} signature.
*/
-export interface ResolveVarsOptions {
+export interface ResolveFlowTemplateLiteralsOptions {
/**
* Optional flow metadata for resolving `{{ meta(path) }}` expressions.
*/
diff --git a/packages/javascript/src/utils/v2/containsMetaFlowTemplateLiteral.ts b/packages/javascript/src/utils/v2/containsMetaFlowTemplateLiteral.ts
new file mode 100644
index 000000000..a6ecc9ddb
--- /dev/null
+++ b/packages/javascript/src/utils/v2/containsMetaFlowTemplateLiteral.ts
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2026, 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.
+ */
+
+/**
+ * Build a regex that matches `{{ meta(key) }}` (with optional whitespace) anywhere
+ * within a string, escaping any special regex characters in `key`.
+ */
+function buildMetaFlowTemplateLiteralRegex(key: string): RegExp {
+ const escapedKey: string = key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+
+ return new RegExp(`\\{\\{\\s*meta\\(${escapedKey}\\)\\s*\\}\\}`);
+}
+
+/**
+ * Check whether a string contains a `{{ meta(key) }}` flow template literal anywhere within it.
+ *
+ * Unlike {@link isMetaFlowTemplateLiteral}, which requires the **entire** string to be the
+ * template, this function detects the pattern embedded inside a larger string such as an
+ * HTML label or sentence.
+ *
+ * Whitespace around `{{` / `}}` is allowed, e.g. `{{ meta(application.signUpUrl) }}`.
+ *
+ * @param str - The string to search (may be a plain value or an HTML fragment).
+ * @param key - The meta path to look for, e.g. `"application.signUpUrl"`.
+ * @returns `true` if the pattern is found anywhere in `str`, `false` otherwise.
+ *
+ * @example
+ * ```typescript
+ * containsMetaFlowTemplateLiteral('Sign up', 'application.signUpUrl')
+ * // true
+ *
+ * containsMetaFlowTemplateLiteral('Sign up', 'application.signUpUrl')
+ * // false
+ * ```
+ */
+export default function containsMetaFlowTemplateLiteral(str: string, key: string): boolean {
+ return buildMetaFlowTemplateLiteralRegex(key).test(str);
+}
+
+/**
+ * Replace all occurrences of `{{ meta(key) }}` (with optional whitespace) in `str`
+ * with `replacement`.
+ *
+ * @param str - The source string.
+ * @param key - The meta path to replace, e.g. `"application.signUpUrl"`.
+ * @param replacement - The value to substitute for each match.
+ * @returns A new string with all occurrences replaced.
+ *
+ * @example
+ * ```typescript
+ * replaceMetaFlowTemplateLiteral('Sign up at {{ meta(application.signUpUrl) }}', 'application.signUpUrl', 'https://example.com')
+ * // 'Sign up at https://example.com'
+ * ```
+ */
+export function replaceMetaFlowTemplateLiteral(str: string, key: string, replacement: string): string {
+ const escapedKey: string = key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ const regex: RegExp = new RegExp(`\\{\\{\\s*meta\\(${escapedKey}\\)\\s*\\}\\}`, 'g');
+
+ return str.replace(regex, replacement);
+}
diff --git a/packages/javascript/src/utils/v2/extractEmojiFromUri.ts b/packages/javascript/src/utils/v2/extractEmojiFromUri.ts
new file mode 100644
index 000000000..d156a9c70
--- /dev/null
+++ b/packages/javascript/src/utils/v2/extractEmojiFromUri.ts
@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2026, 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.
+ */
+
+import isEmojiUri, {EMOJI_URI_SCHEME} from './isEmojiUri';
+
+/**
+ * Extracts the emoji character from an `emoji:` URI.
+ *
+ * @param uri - A URI string in the form `"emoji:"`.
+ * @returns The emoji character, or an empty string if the URI is not a valid emoji URI.
+ *
+ * @example
+ * ```typescript
+ * extractEmojiFromUri("emoji:🐯"); // "🐯"
+ * extractEmojiFromUri("https://example.com"); // ""
+ * ```
+ */
+const extractEmojiFromUri = (uri: string): string => {
+ if (!isEmojiUri(uri)) {
+ return '';
+ }
+
+ return uri.slice(EMOJI_URI_SCHEME.length);
+};
+
+export default extractEmojiFromUri;
diff --git a/packages/javascript/src/utils/v2/isEmojiUri.ts b/packages/javascript/src/utils/v2/isEmojiUri.ts
new file mode 100644
index 000000000..0f73c72ef
--- /dev/null
+++ b/packages/javascript/src/utils/v2/isEmojiUri.ts
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2026, 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.
+ */
+
+export const EMOJI_URI_SCHEME: string = 'emoji:';
+
+/**
+ * Checks whether a given URI uses the `emoji:` scheme (e.g. `"emoji:🐯"`).
+ *
+ * @param uri - The URI string to check.
+ * @returns `true` if the URI starts with `"emoji:"`, `false` otherwise.
+ *
+ * @example
+ * ```typescript
+ * isEmojiUri("emoji:🐯"); // true
+ * isEmojiUri("https://example.com/logo.png"); // false
+ * isEmojiUri(""); // false
+ * ```
+ */
+const isEmojiUri = (uri: string): boolean => typeof uri === 'string' && uri.startsWith(EMOJI_URI_SCHEME);
+
+export default isEmojiUri;
diff --git a/packages/javascript/src/utils/v2/isMetaFlowTemplateLiteral.ts b/packages/javascript/src/utils/v2/isMetaFlowTemplateLiteral.ts
new file mode 100644
index 000000000..f6c2b93a5
--- /dev/null
+++ b/packages/javascript/src/utils/v2/isMetaFlowTemplateLiteral.ts
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2026, 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.
+ */
+
+/**
+ * Regular expression to match a meta flow template literal `{{meta(key)}}` (exact, full-string match).
+ * Optional whitespace around `{{` / `}}` is allowed.
+ */
+export const META_FLOW_TEMPLATE_LITERAL_PATTERN: RegExp = /^\{\{\s*meta\([^)]+\)\s*\}\}$/;
+
+/**
+ * Regular expression to extract the path from a meta flow template literal `{{meta(path)}}`.
+ */
+export const META_FLOW_TEMPLATE_LITERAL_KEY_PATTERN: RegExp = /^\{\{\s*meta\(([^)]+)\)\s*\}\}$/;
+
+/**
+ * Check if a string is exactly a meta flow template literal (`{{ meta(path) }}`).
+ *
+ * This checks that the **entire** string is the template pattern. Use
+ * {@link FLOW_TEMPLATE_LITERAL_REGEX} from `parseFlowTemplateLiteral` to detect
+ * templates embedded inside a larger string.
+ *
+ * @param value - The string to test.
+ * @returns `true` if the trimmed value matches the pattern, `false` otherwise.
+ *
+ * @example
+ * ```typescript
+ * isMetaFlowTemplateLiteral('{{ meta(application.name) }}') // true
+ * isMetaFlowTemplateLiteral('hello world') // false
+ * isMetaFlowTemplateLiteral('Login to {{ meta(app.name) }}') // false — embedded, not exact
+ * ```
+ */
+export default function isMetaFlowTemplateLiteral(value: string): boolean {
+ return META_FLOW_TEMPLATE_LITERAL_PATTERN.test(value.trim());
+}
diff --git a/packages/javascript/src/utils/v2/isTranslationFlowTemplateLiteral.ts b/packages/javascript/src/utils/v2/isTranslationFlowTemplateLiteral.ts
new file mode 100644
index 000000000..e5afc33cc
--- /dev/null
+++ b/packages/javascript/src/utils/v2/isTranslationFlowTemplateLiteral.ts
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2026, 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.
+ */
+
+/**
+ * Regular expression to match a translation flow template literal `{{t(key)}}` (exact, full-string match).
+ * Optional whitespace around `{{` / `}}` is allowed.
+ */
+export const TRANSLATION_FLOW_TEMPLATE_LITERAL_PATTERN: RegExp = /^\{\{\s*t\([^)]+\)\s*\}\}$/;
+
+/**
+ * Regular expression to extract the key from a translation flow template literal `{{t(key)}}`.
+ */
+export const TRANSLATION_FLOW_TEMPLATE_LITERAL_KEY_PATTERN: RegExp = /^\{\{\s*t\(([^)]+)\)\s*\}\}$/;
+
+/**
+ * Check if a string is exactly a translation flow template literal (`{{ t(key) }}`).
+ *
+ * This checks that the **entire** string is the template pattern. Use
+ * {@link FLOW_TEMPLATE_LITERAL_REGEX} from `parseFlowTemplateLiteral` to detect
+ * templates embedded inside a larger string.
+ *
+ * @param value - The string to test.
+ * @returns `true` if the trimmed value matches the pattern, `false` otherwise.
+ *
+ * @example
+ * ```typescript
+ * isTranslationFlowTemplateLiteral('{{ t(signin:heading) }}') // true
+ * isTranslationFlowTemplateLiteral('hello world') // false
+ * isTranslationFlowTemplateLiteral('Login via {{ t(key) }}') // false — embedded, not exact
+ * ```
+ */
+export default function isTranslationFlowTemplateLiteral(value: string): boolean {
+ return TRANSLATION_FLOW_TEMPLATE_LITERAL_PATTERN.test(value.trim());
+}
diff --git a/packages/javascript/src/utils/v2/parseFlowTemplateLiteral.ts b/packages/javascript/src/utils/v2/parseFlowTemplateLiteral.ts
new file mode 100644
index 000000000..a2755ea42
--- /dev/null
+++ b/packages/javascript/src/utils/v2/parseFlowTemplateLiteral.ts
@@ -0,0 +1,120 @@
+/**
+ * Copyright (c) 2026, 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.
+ */
+
+/**
+ * Regular expression to detect a flow template literal wrapped in double braces.
+ * Matches patterns like `{{ t(key) }}`, `{{ meta(key) }}`, etc.
+ *
+ * Note: this regex has no `g` flag — use `new RegExp(FLOW_TEMPLATE_LITERAL_REGEX.source, 'g')`
+ * when global replacement is needed (e.g. in resolveFlowTemplateLiterals).
+ */
+export const FLOW_TEMPLATE_LITERAL_REGEX: RegExp = /\{\{\s*([^}]+)\s*\}\}/;
+
+/**
+ * Regular expression to parse a function-call expression inside flow template braces.
+ * Matches `funcName(arg)` and captures the function name and argument.
+ */
+export const FLOW_TEMPLATE_FUNCTION_REGEX: RegExp = /^(\w+)\(([^)]+)\)$/;
+
+/**
+ * Flow template literal types supported by the SDK.
+ *
+ * Values correspond to the function name used in the template expression,
+ * so that a `{ t }` object from `useTranslation()` can be passed directly
+ * as a handler map.
+ */
+export enum FlowTemplateLiteralType {
+ /** Meta template literal — `{{ meta(path) }}` — resolves against flow/page metadata */
+ META = 'meta',
+ /** Translation template literal — `{{ t(key) }}` */
+ TRANSLATION = 't',
+ /** Unknown or unsupported template literal format */
+ UNKNOWN = 'unknown',
+}
+
+/**
+ * Result of parsing a flow template literal.
+ */
+export interface FlowTemplateLiteralResult {
+ /**
+ * The extracted key or path from the template literal.
+ * e.g. `"signin:heading"` from `"{{ t(signin:heading) }}"`.
+ */
+ key?: string;
+ /** The original template literal content before parsing */
+ originalValue: string;
+ /** The type of flow template literal that was detected */
+ type: FlowTemplateLiteralType;
+}
+
+/**
+ * Map of handler functions keyed by {@link FlowTemplateLiteralType}.
+ *
+ * When provided to a resolver, the matching handler is called with the extracted key.
+ * Because `FlowTemplateLiteralType.TRANSLATION === 't'`, you can pass the `{ t }` object
+ * from `useTranslation()` directly.
+ *
+ * @example
+ * ```typescript
+ * const { t } = useTranslation();
+ * // handler map: { t: (key) => string }
+ * ```
+ */
+export type FlowTemplateLiteralHandlers = Partial string>>;
+
+/**
+ * Parse a flow template literal content string and extract its type and key.
+ *
+ * Supports function-call expressions like:
+ * - `t(signin:heading)` → type `TRANSLATION`, key `"signin:heading"`
+ * - `meta(application.name)` → type `META`, key `"application.name"`
+ *
+ * Surrounding quotes on the key argument are stripped automatically.
+ *
+ * @param content - The content inside the template literal braces (without `{{ }}`).
+ * @returns Parsed flow template literal information.
+ *
+ * @example
+ * ```typescript
+ * parseFlowTemplateLiteral('t(signin:heading)')
+ * // { type: FlowTemplateLiteralType.TRANSLATION, key: 'signin:heading', originalValue: 't(signin:heading)' }
+ *
+ * parseFlowTemplateLiteral('meta(application.name)')
+ * // { type: FlowTemplateLiteralType.META, key: 'application.name', originalValue: 'meta(application.name)' }
+ * ```
+ */
+export default function parseFlowTemplateLiteral(content: string): FlowTemplateLiteralResult {
+ const originalValue: string = content;
+ const match: RegExpExecArray | null = FLOW_TEMPLATE_FUNCTION_REGEX.exec(content);
+
+ if (!match) {
+ return {originalValue, type: FlowTemplateLiteralType.UNKNOWN};
+ }
+
+ const [, functionName, rawKey] = match;
+ const key: string = rawKey.trim().replace(/^['"]|['"]$/g, '');
+
+ switch (functionName as FlowTemplateLiteralType) {
+ case FlowTemplateLiteralType.TRANSLATION:
+ return {key, originalValue, type: FlowTemplateLiteralType.TRANSLATION};
+ case FlowTemplateLiteralType.META:
+ return {key, originalValue, type: FlowTemplateLiteralType.META};
+ default:
+ return {originalValue, type: FlowTemplateLiteralType.UNKNOWN};
+ }
+}
diff --git a/packages/javascript/src/utils/v2/resolveVars.ts b/packages/javascript/src/utils/v2/resolveFlowTemplateLiterals.ts
similarity index 58%
rename from packages/javascript/src/utils/v2/resolveVars.ts
rename to packages/javascript/src/utils/v2/resolveFlowTemplateLiterals.ts
index e72f87ff5..726204b2c 100644
--- a/packages/javascript/src/utils/v2/resolveVars.ts
+++ b/packages/javascript/src/utils/v2/resolveFlowTemplateLiterals.ts
@@ -16,12 +16,22 @@
* under the License.
*/
+import parseFlowTemplateLiteral, {
+ FLOW_TEMPLATE_LITERAL_REGEX,
+ FlowTemplateLiteralResult,
+ FlowTemplateLiteralType,
+} from './parseFlowTemplateLiteral';
import resolveMeta from './resolveMeta';
import {TranslationFn} from '../../models/v2/translation';
-import {ResolveVarsOptions} from '../../models/v2/vars';
+import {ResolveFlowTemplateLiteralsOptions} from '../../models/v2/vars';
/**
- * Resolves all template expressions in a string.
+ * Global version of {@link FLOW_TEMPLATE_LITERAL_REGEX} for use with `String.prototype.replace`.
+ */
+const FLOW_TEMPLATE_LITERAL_REGEX_GLOBAL: RegExp = new RegExp(FLOW_TEMPLATE_LITERAL_REGEX.source, 'g');
+
+/**
+ * Resolves all flow template literal expressions in a string.
*
* Supported patterns:
* - `{{ t(key) }}` — resolved via the i18n translation function.
@@ -30,51 +40,36 @@ import {ResolveVarsOptions} from '../../models/v2/vars';
* - `{{ meta(path) }}` — resolved via a dot-path lookup on FlowMetadataResponse.
* `{{ meta(application.name) }}` → `meta.application?.name`
*
- * Template expressions can be embedded inside larger strings:
+ * Flow template literals can be embedded inside larger strings:
* `"Login using {{ meta(application.name) }}"` → `"Login using My App"`
*
- * Unrecognised expressions are left unchanged.
+ * Unrecognized expressions are left unchanged.
*
* @template TFn - The concrete translation function type.
*
- * @param text - The string to resolve (may contain zero or more template expressions)
+ * @param text - The string to resolve (may contain zero or more flow template literals)
* @param options - Resolution context: translation function and optional flow metadata
* @returns The resolved string
*/
-export default function resolveVars(
+export default function resolveFlowTemplateLiterals(
text: string | undefined,
- {t, meta}: ResolveVarsOptions,
+ {t, meta}: ResolveFlowTemplateLiteralsOptions,
): string {
if (!text) {
return '';
}
- return text.replace(/\{\{(.+?)\}\}/g, (match: string, content: string): string => {
- const trimmed: string = content.trim();
-
- const tMatch: RegExpMatchArray | null = trimmed.match(/^t\((.+)\)$/);
- if (tMatch) {
- let key: string = tMatch[1].trim();
- // Strip surrounding quotes if present
- if ((key.startsWith('"') && key.endsWith('"')) || (key.startsWith("'") && key.endsWith("'"))) {
- key = key.slice(1, -1);
- }
+ return text.replace(FLOW_TEMPLATE_LITERAL_REGEX_GLOBAL, (match: string, content: string): string => {
+ const parsed: FlowTemplateLiteralResult = parseFlowTemplateLiteral(content.trim());
+ if (parsed.type === FlowTemplateLiteralType.TRANSLATION && parsed.key) {
// Convert colon-separated namespace to dot-separated key
// e.g. "signin:fields.password.label" → "signin.fields.password.label"
- return t(key.replace(/:/g, '.'));
+ return t(parsed.key.replace(/:/g, '.'));
}
- if (meta) {
- const metaMatch: RegExpMatchArray | null = trimmed.match(/^meta\((.+)\)$/);
- if (metaMatch) {
- let path: string = metaMatch[1].trim();
- // Strip surrounding quotes if present
- if ((path.startsWith('"') && path.endsWith('"')) || (path.startsWith("'") && path.endsWith("'"))) {
- path = path.slice(1, -1);
- }
- return resolveMeta(path, meta);
- }
+ if (parsed.type === FlowTemplateLiteralType.META && parsed.key && meta) {
+ return resolveMeta(parsed.key, meta);
}
return match;
diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json
index af5fced58..7103f2207 100644
--- a/packages/nextjs/package.json
+++ b/packages/nextjs/package.json
@@ -51,7 +51,7 @@
"dependencies": {
"@asgardeo/node": "workspace:*",
"@asgardeo/react": "workspace:*",
- "@types/react": "19.1.4",
+ "@types/react": "catalog:",
"jose": "5.10.0",
"tslib": "2.8.1"
},
@@ -64,14 +64,14 @@
"eslint": "8.57.0",
"next": "15.5.12",
"prettier": "2.6.2",
- "react": "19.1.4",
+ "react": "catalog:",
"rimraf": "6.1.0",
"typescript": "5.7.2",
"vitest": "3.1.3"
},
"peerDependencies": {
"next": ">=15.3.8",
- "react": ">=19.1.4"
+ "react": ">=16.8.0"
},
"publishConfig": {
"access": "public"
diff --git a/packages/react-router/package.json b/packages/react-router/package.json
index f51f5f209..10e31865c 100644
--- a/packages/react-router/package.json
+++ b/packages/react-router/package.json
@@ -45,21 +45,22 @@
"devDependencies": {
"@asgardeo/react": "workspace:*",
"@types/node": "22.15.3",
- "@types/react": "19.1.4",
+ "@types/react": "catalog:",
"@wso2/eslint-plugin": "catalog:",
"@wso2/prettier-config": "catalog:",
"esbuild-plugin-preserve-directives": "0.0.11",
"esbuild": "0.25.9",
"eslint": "8.57.0",
"prettier": "2.6.2",
- "react": "19.1.4",
+ "react": "catalog:",
"react-router": "7.12.0",
"rimraf": "6.1.0",
"typescript": "5.7.2",
"vitest": "3.1.3"
},
"peerDependencies": {
- "react": ">=19.1.4",
+ "@asgardeo/react": ">=0.1.0",
+ "react": ">=16.8.0",
"react-router": ">=6.30.1"
},
"dependencies": {
diff --git a/packages/react/package.json b/packages/react/package.json
index a17178fe4..e5831fa7a 100644
--- a/packages/react/package.json
+++ b/packages/react/package.json
@@ -44,31 +44,31 @@
"@testing-library/dom": "10.4.0",
"@testing-library/react": "16.3.0",
"@types/node": "22.15.3",
- "@types/react": "19.1.5",
+ "@types/react": "catalog:",
"@wso2/eslint-plugin": "catalog:",
"@wso2/prettier-config": "catalog:",
"esbuild-plugin-preserve-directives": "0.0.11",
+ "esbuild": "0.25.9",
"eslint": "8.57.0",
"jsdom": "26.1.0",
"prettier": "2.6.2",
- "react": "19.1.4",
+ "react": "catalog:",
"rimraf": "6.1.0",
"typescript": "5.7.2",
"vitest": "3.1.3"
},
"peerDependencies": {
- "@types/react": ">=19.1.5",
- "react": ">=19.1.4"
+ "@types/react": ">=16.8.0",
+ "react": ">=16.8.0"
},
"dependencies": {
"@asgardeo/browser": "workspace:*",
"@asgardeo/i18n": "workspace:*",
"@emotion/css": "11.13.5",
"@floating-ui/react": "0.27.12",
- "@types/react-dom": "19.1.5",
+ "@types/react-dom": "catalog:",
"dompurify": "catalog:",
- "esbuild": "0.25.9",
- "react-dom": "19.1.4",
+ "react-dom": "catalog:",
"tslib": "2.8.1"
},
"publishConfig": {
diff --git a/packages/react/src/components/adapters/ImageComponent.tsx b/packages/react/src/components/adapters/ImageComponent.tsx
index 0764973e8..948173473 100644
--- a/packages/react/src/components/adapters/ImageComponent.tsx
+++ b/packages/react/src/components/adapters/ImageComponent.tsx
@@ -16,10 +16,13 @@
* under the License.
*/
+import {extractEmojiFromUri, isEmojiUri} from '@asgardeo/browser';
import {CSSProperties, FC, SyntheticEvent} from 'react';
import useTheme from '../../contexts/Theme/useTheme';
import {AdapterProps} from '../../models/adapters';
+const DEFAULT_EMOJI_CONTAINER_HEIGHT: string = '4em';
+
/**
* Image component for sign-up forms.
*/
@@ -42,6 +45,51 @@ const ImageComponent: FC = ({component}: AdapterProps) => {
return null;
}
+ if (isEmojiUri(src)) {
+ // Bare numbers (e.g. "48") are valid for width/height attributes but
+ // are unit-less and ignored as CSS properties — normalize them to px.
+ const toCSSLength = (value: string): string => (/^\d+(\.\d+)?$/.test(value) ? `${value}px` : value);
+ const cssWidth: string = toCSSLength(width);
+ const cssHeight: string = toCSSLength(height);
+
+ // container-type: size needs a concrete block dimension — percentage and
+ // 'auto' values both collapse to 0 when the parent has no defined height.
+ // Priority: explicit height → explicit width (square) → fallback constant.
+ const isConcrete = (v: string): boolean => v !== 'auto' && !v.endsWith('%');
+ let containerHeight: string;
+ if (isConcrete(cssHeight)) {
+ containerHeight = cssHeight;
+ } else if (isConcrete(cssWidth)) {
+ containerHeight = cssWidth;
+ } else {
+ containerHeight = DEFAULT_EMOJI_CONTAINER_HEIGHT;
+ }
+
+ return (
+
+ {/*
+ * container-type: size lets the inner span use cqmin (= min(cqw, cqh))
+ * so the emoji font-size tracks the rendered container dimensions
+ * rather than the parent's font-size.
+ */}
+
+
+ {extractEmojiFromUri(src)}
+
+
+
+ );
+ }
+
return (
= createPackageCom
'AuthOptionFactory',
);
+/**
+ * Replaces `emoji:` URIs embedded in HTML before DOMPurify sanitization.
+ *
+ * DOMPurify strips unknown URI schemes from attributes (e.g. `src="emoji:🦊"` → `src=""`).
+ * This function converts:
+ * - `` → `X`
+ * - Any remaining `emoji:X` text occurrences → `X`
+ */
+const resolveEmojiUrisInHtml = (html: string): string => {
+ const withEmojiImages: string = html.replace(
+ /]*)src="(emoji:[^"]+)"([^>]*)\/?>/gi,
+ (_match: string, pre: string, src: string, post: string): string => {
+ const emoji: string = extractEmojiFromUri(src);
+ if (!emoji) {
+ return _match;
+ }
+ const altMatch: RegExpMatchArray | null = (pre + post).match(/alt="([^"]*)"/i);
+ const label: string = altMatch ? altMatch[1] : emoji;
+ return `${emoji}`;
+ },
+ );
+ return withEmojiImages.replace(/emoji:([^\s"<>&]+)/g, (_: string, rest: string): string =>
+ isEmojiUri(`emoji:${rest}`) ? rest : `emoji:${rest}`,
+ );
+};
+
/** Ensures rich-text content (including all inner elements from the server) always word-wraps. */
const richTextClass: string = css`
overflow-wrap: anywhere;
@@ -66,6 +94,25 @@ const richTextClass: string = css`
overflow-wrap: anywhere;
word-break: break-word;
}
+ & .rich-text-align-left {
+ text-align: left;
+ }
+ & .rich-text-align-center {
+ text-align: center;
+ }
+ & .rich-text-align-right {
+ text-align: right;
+ }
+ & .rich-text-align-justify {
+ text-align: justify;
+ }
+ & a,
+ & .rich-text-link {
+ text-decoration: underline;
+ }
+ & span[role='img'] {
+ display: inline-block;
+ }
`;
export type AuthType = 'signin' | 'signup';
@@ -177,7 +224,7 @@ const createAuthComponentFromFlow = (
if (!text || (!options.t && !options.meta)) {
return text || '';
}
- return resolveVars(text, {meta: options.meta, t: options.t || ((k: string): string => k)});
+ return resolveFlowTemplateLiterals(text, {meta: options.meta, t: options.t || ((k: string): string => k)});
};
switch (component.type) {
@@ -323,7 +370,17 @@ const createAuthComponentFromFlow = (
case EmbeddedFlowComponentType.Text: {
const variant: any = getTypographyVariant(component.variant);
return (
-
+
{resolve(component.label)}
);
@@ -399,7 +456,7 @@ const createAuthComponentFromFlow = (
className={richTextClass}
// Manually sanitizes with `DOMPurify`.
// IMPORTANT: DO NOT REMOVE OR MODIFY THIS SANITIZATION STEP.
- dangerouslySetInnerHTML={{__html: DOMPurify.sanitize(resolve(component.label))}}
+ dangerouslySetInnerHTML={{__html: DOMPurify.sanitize(resolveEmojiUrisInHtml(resolve(component.label)))}}
/>
);
}
diff --git a/packages/react/src/components/presentation/auth/SignIn/v2/BaseSignIn.tsx b/packages/react/src/components/presentation/auth/SignIn/v2/BaseSignIn.tsx
index 9dd16049f..fac015267 100644
--- a/packages/react/src/components/presentation/auth/SignIn/v2/BaseSignIn.tsx
+++ b/packages/react/src/components/presentation/auth/SignIn/v2/BaseSignIn.tsx
@@ -22,7 +22,6 @@ import {
EmbeddedFlowComponentV2 as EmbeddedFlowComponent,
FlowMetadataResponse,
Preferences,
- resolveVars,
} from '@asgardeo/browser';
import {cx} from '@emotion/css';
import {FC, useState, useCallback, ReactElement, ReactNode} from 'react';
@@ -34,11 +33,9 @@ import useTheme from '../../../../../contexts/Theme/useTheme';
import {FormField, useForm} from '../../../../../hooks/useForm';
import useTranslation from '../../../../../hooks/useTranslation';
import {extractErrorMessage} from '../../../../../utils/v2/flowTransformer';
-import getAuthComponentHeadings from '../../../../../utils/v2/getAuthComponentHeadings';
import AlertPrimitive from '../../../../primitives/Alert/Alert';
// eslint-disable-next-line import/no-named-as-default
import CardPrimitive, {CardProps} from '../../../../primitives/Card/Card';
-import Logo from '../../../../primitives/Logo/Logo';
import Spinner from '../../../../primitives/Spinner/Spinner';
import Typography from '../../../../primitives/Typography/Typography';
import {renderSignInComponents} from '../../AuthOptionFactory';
@@ -209,21 +206,6 @@ export interface BaseSignInProps {
*/
preferences?: Preferences;
- /**
- * Whether to show the logo.
- */
- showLogo?: boolean;
-
- /**
- * Whether to show the subtitle.
- */
- showSubtitle?: boolean;
-
- /**
- * Whether to show the title.
- */
- showTitle?: boolean;
-
/**
* Size variant for the component.
*/
@@ -251,8 +233,6 @@ const BaseSignInContent: FC = ({
variant = 'outlined',
isLoading: externalIsLoading,
children,
- showTitle = true,
- showSubtitle = true,
additionalData = {},
isTimeoutDisabled = false,
}: BaseSignInProps): ReactElement => {
@@ -558,32 +538,8 @@ const BaseSignInContent: FC = ({
);
}
- // Extract heading and subheading components and filter them from the main components
- const {
- title: rawTitle,
- subtitle: rawSubtitle,
- componentsWithoutHeadings,
- } = getAuthComponentHeadings(components as any, flowTitle, flowSubtitle, undefined, undefined);
- // Resolve any remaining {{meta()}} or {{t()}} expressions in the title/subtitle at render time
- const title: string = resolveVars(rawTitle, {meta, t});
- const subtitle: string = resolveVars(rawSubtitle, {meta, t});
-
return (
- {(showTitle || showSubtitle) && (
-
- {showTitle && (
-
- {title}
-
- )}
- {showSubtitle && (
-
- {subtitle}
-
- )}
-
- )}
{externalError && (
@@ -605,9 +561,7 @@ const BaseSignInContent: FC = ({
))}
-
-
- >
- );
-}
-
-export default App;
diff --git a/samples/__legacy__/react-vite/src/main.tsx b/samples/__legacy__/react-vite/src/main.tsx
deleted file mode 100644
index 381370202..000000000
--- a/samples/__legacy__/react-vite/src/main.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import ReactDOM from 'react-dom/client';
-import App from './App.js';
-import {AsgardeoProvider, UIAuthConfig} from '@asgardeo/react';
-
-const envVariables = import.meta.env;
-
-const config: UIAuthConfig = {
- baseUrl: envVariables.VITE_BASE_URL,
- clientId: envVariables.VITE_CLIENT_ID,
- scope: envVariables.VITE_SCOPE?.split(','),
- afterSignInUrl: envVariables.VITE_SIGN_IN_REDIRECT_URL,
-};
-
-ReactDOM.createRoot(document.getElementById('root')!).render(
-
-
- ,
-);
diff --git a/samples/__legacy__/react-vite/src/vite-env.d.ts b/samples/__legacy__/react-vite/src/vite-env.d.ts
deleted file mode 100644
index 11f02fe2a..000000000
--- a/samples/__legacy__/react-vite/src/vite-env.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-///
diff --git a/samples/__legacy__/react-vite/tsconfig.json b/samples/__legacy__/react-vite/tsconfig.json
deleted file mode 100644
index a7fc6fbf2..000000000
--- a/samples/__legacy__/react-vite/tsconfig.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "compilerOptions": {
- "target": "ES2020",
- "useDefineForClassFields": true,
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
- "module": "ESNext",
- "skipLibCheck": true,
-
- /* Bundler mode */
- "moduleResolution": "bundler",
- "allowImportingTsExtensions": true,
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
-
- /* Linting */
- "strict": true,
- "noUnusedLocals": true,
- "noUnusedParameters": true,
- "noFallthroughCasesInSwitch": true
- },
- "include": ["src"],
- "references": [{ "path": "./tsconfig.node.json" }]
-}
diff --git a/samples/__legacy__/react-vite/tsconfig.node.json b/samples/__legacy__/react-vite/tsconfig.node.json
deleted file mode 100644
index 97ede7ee6..000000000
--- a/samples/__legacy__/react-vite/tsconfig.node.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "compilerOptions": {
- "composite": true,
- "skipLibCheck": true,
- "module": "ESNext",
- "moduleResolution": "bundler",
- "allowSyntheticDefaultImports": true,
- "strict": true
- },
- "include": ["vite.config.ts"]
-}
diff --git a/samples/__legacy__/react-vite/vite.config.ts b/samples/__legacy__/react-vite/vite.config.ts
deleted file mode 100644
index 1c59cea31..000000000
--- a/samples/__legacy__/react-vite/vite.config.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { defineConfig } from 'vite'
-import react from '@vitejs/plugin-react'
-import basicSsl from "@vitejs/plugin-basic-ssl";
-import { nodePolyfills } from "vite-plugin-node-polyfills";
-
-// https://vitejs.dev/config/
-export default defineConfig({
- plugins: [react(), basicSsl(), nodePolyfills()],
-})
diff --git a/samples/__legacy__/vue-vite/.editorconfig b/samples/__legacy__/vue-vite/.editorconfig
deleted file mode 100644
index 7f5b23fc3..000000000
--- a/samples/__legacy__/vue-vite/.editorconfig
+++ /dev/null
@@ -1,9 +0,0 @@
-[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
-charset = utf-8
-indent_size = 2
-indent_style = space
-insert_final_newline = true
-trim_trailing_whitespace = true
-
-end_of_line = lf
-max_line_length = 100
diff --git a/samples/__legacy__/vue-vite/.eslintrc.cjs b/samples/__legacy__/vue-vite/.eslintrc.cjs
deleted file mode 100644
index 7784fa4c6..000000000
--- a/samples/__legacy__/vue-vite/.eslintrc.cjs
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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.
- */
-
-const path = require('path');
-
-module.exports = {
- extends: [
- 'plugin:@wso2/typescript',
- // 'plugin:@wso2/vue',
- 'plugin:@wso2/strict',
- 'plugin:@wso2/internal',
- 'plugin:@wso2/prettier',
- ],
- parserOptions: {
- project: [path.resolve(__dirname, 'tsconfig.json'), path.resolve(__dirname, 'tsconfig.eslint.json')],
- },
- plugins: ['@wso2'],
- rules: {
- 'no-underscore-dangle': ['error', {allow: ['_client', '_authState', '_context']}],
- },
-};
diff --git a/samples/__legacy__/vue-vite/.gitattributes b/samples/__legacy__/vue-vite/.gitattributes
deleted file mode 100644
index 6313b56c5..000000000
--- a/samples/__legacy__/vue-vite/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* text=auto eol=lf
diff --git a/samples/__legacy__/vue-vite/.gitignore b/samples/__legacy__/vue-vite/.gitignore
deleted file mode 100644
index 8ee54e8d3..000000000
--- a/samples/__legacy__/vue-vite/.gitignore
+++ /dev/null
@@ -1,30 +0,0 @@
-# Logs
-logs
-*.log
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-pnpm-debug.log*
-lerna-debug.log*
-
-node_modules
-.DS_Store
-dist
-dist-ssr
-coverage
-*.local
-
-/cypress/videos/
-/cypress/screenshots/
-
-# Editor directories and files
-.vscode/*
-!.vscode/extensions.json
-.idea
-*.suo
-*.ntvs*
-*.njsproj
-*.sln
-*.sw?
-
-*.tsbuildinfo
diff --git a/samples/__legacy__/vue-vite/.prettierrc.json b/samples/__legacy__/vue-vite/.prettierrc.json
deleted file mode 100644
index 17a23d07d..000000000
--- a/samples/__legacy__/vue-vite/.prettierrc.json
+++ /dev/null
@@ -1,7 +0,0 @@
-
-{
- "$schema": "https://json.schemastore.org/prettierrc",
- "semi": false,
- "singleQuote": true,
- "printWidth": 100
-}
diff --git a/samples/__legacy__/vue-vite/.vscode/extensions.json b/samples/__legacy__/vue-vite/.vscode/extensions.json
deleted file mode 100644
index a06a8c699..000000000
--- a/samples/__legacy__/vue-vite/.vscode/extensions.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "recommendations": [
- "Vue.volar",
- "vitest.explorer",
- "dbaeumer.vscode-eslint",
- "EditorConfig.EditorConfig",
- "esbenp.prettier-vscode"
- ]
-}
diff --git a/samples/__legacy__/vue-vite/CHANGELOG.md b/samples/__legacy__/vue-vite/CHANGELOG.md
deleted file mode 100644
index 2a7e19fec..000000000
--- a/samples/__legacy__/vue-vite/CHANGELOG.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# vue-vite
-
-## 0.0.1
-
-### Patch Changes
-
-- Updated dependencies [[`74afcc5`](https://github.com/asgardeo/javascript/commit/74afcc5bbf3dcfd8a2ec0c0026b709eafbe609a1)]:
- - @asgardeo/vue@0.0.1
diff --git a/samples/__legacy__/vue-vite/README.md b/samples/__legacy__/vue-vite/README.md
deleted file mode 100644
index c4e437429..000000000
--- a/samples/__legacy__/vue-vite/README.md
+++ /dev/null
@@ -1,105 +0,0 @@
-# Asgardeo Auth Vue.js SDK Usage Example (Single Page Application)
-
-This sample is developed to demonstrate the basic usage of the Asgardeo Auth Vue.js SDK.
-
-## Getting Started
-
-### Prerequisites
-- `Node.js` (version 20 or above).
-
-### Register an Application
-//TODO
-
-Make sure to add `http://localhost:5173` as a Redirect URL and also add it under allowed origins.
-
-### Download the Sample
-//TODO
-
-### Configure the Sample
-
-Update the authentication configuration in your `main.ts` file with your registered app details.
-
-**Note:** You will need to paste in the `client ID` generated for the application you registered.
-
-```typescript
-import "./assets/main.css";
-import { createApp } from "vue";
-import App from "./App.vue";
-import router from "./router";
-import { asgardeoPlugin } from "./auth/authprovider";
-
-const app = createApp(App);
-
-app.use(router);
-app.use(asgardeoPlugin, {
- afterSignInUrl: "http://localhost:5173/",
- afterSignOutUrl: "http://localhost:5173/",
- clientId: "",
- baseUrl: "https://api.asgardeo.io/t/",
-});
-
-app.mount("#app");
-```
-
-### Run the Application
-
-```bash
-npm install && npm run dev
-```
-
-The app should open at [`http://localhost:5173`](http://localhost:5173)
-
-### Change the Application's Development Server Port
-
-By default, the Vite development server runs on port `5173`. In case you wish to change this to something else, follow the steps below.
-
-1. Update the port in your Vite configuration file (`vite.config.js` or `vite.config.ts`):
- ```javascript
- export default defineConfig({
- // Other config options...
- server: {
- port: YOUR_PREFERRED_PORT
- }
- })
- ```
-
-2. Update the `afterSignInUrl` & `afterSignOutUrl` in `main.ts` to match your new port.
-
-3. Go to the Asgardeo Console and navigate to the protocol tab of your application:
- - Update the Authorized Redirect URL.
- - Update the Allowed Origins.
-
-## Using the Auth Plugin
-
-The Asgardeo Auth plugin is available throughout your Vue application. Here's how to use it in your components:
-
-```vue
-
-
-
-
-
-
-
-
-```
-
-//TODO
-
-## Contribute
-
-Please read [Contributing to the Code Base](../../CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
-
-### Reporting Issues
-
-We encourage you to report issues, improvements, and feature requests by creating [Github Issues](https://github.com/asgardeo/javascript/issues).
-
-Important: Please be advised that security issues must be reported to security@wso2.com, not as GitHub issues, in order to reach the proper audience. We strongly advise following the WSO2 Security Vulnerability Reporting Guidelines when reporting security issues.
-
-## License
-
-This project is licensed under the Apache License 2.0. See the [LICENSE](../../LICENSE) file for details.
diff --git a/samples/__legacy__/vue-vite/env.d.ts b/samples/__legacy__/vue-vite/env.d.ts
deleted file mode 100644
index 7879aed0d..000000000
--- a/samples/__legacy__/vue-vite/env.d.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * 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.
- */
-
-///
-
-interface ImportMetaEnv {
- readonly VITE_ASGARDEO_BASE_URL: string
- readonly VITE_ASGARDEO_CLIENT_ID: string
- readonly VITE_ASGARDEO_DISABLE_TRY_SIGN_IN_SILENTLY: boolean
- readonly VITE_ASGARDEO_SCOPE: string
- readonly VITE_ASGARDEO_SIGN_IN_REDIRECT_URL: string
- readonly VITE_ASGARDEO_SIGN_OUT_REDIRECT_URL: string
-}
-
-interface ImportMeta {
- readonly env: ImportMetaEnv
-}
diff --git a/samples/__legacy__/vue-vite/index.html b/samples/__legacy__/vue-vite/index.html
deleted file mode 100644
index ec77f85eb..000000000
--- a/samples/__legacy__/vue-vite/index.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
- Vue Sample
-
-
-
-
-
-
diff --git a/samples/__legacy__/vue-vite/package.json b/samples/__legacy__/vue-vite/package.json
deleted file mode 100644
index 7ddfc530c..000000000
--- a/samples/__legacy__/vue-vite/package.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "private": true,
- "name": "@asgardeo/vue-vite",
- "version": "0.0.0",
- "type": "module",
- "scripts": {
- "dev": "vite",
- "build": "run-p type-check \"build-only {@}\" --",
- "preview": "vite preview",
- "test:unit": "vitest",
- "build-only": "vite build",
- "type-check": "vue-tsc --build",
- "lint": "eslint .",
- "format": "prettier --write src/"
- },
- "dependencies": {
- "@asgardeo/vue": "workspace:*",
- "vue": "3.5.13",
- "vue-router": "4.5.0",
- "vitest": "3.0.5",
- "vite": "6.1.0",
- "vite-plugin-vue-devtools": "7.7.2",
- "@vitejs/plugin-vue": "5.2.1"
- },
- "devDependencies": {
- "@eslint/js": "9.22.0",
- "@tsconfig/node22": "22.0.0",
- "@types/jsdom": "21.1.7",
- "@types/node": "22.13.4",
- "@typescript-eslint/eslint-plugin": "7.2.0",
- "@typescript-eslint/parser": "7.2.0",
- "@vitest/eslint-plugin": "1.1.31",
- "@vue/eslint-config-prettier": "10.2.0",
- "@vue/eslint-config-typescript": "14.4.0",
- "@vue/test-utils": "2.4.6",
- "@vue/tsconfig": "0.7.0",
- "eslint": "8.57.0",
- "eslint-plugin-vue": "9.33.0",
- "jiti": "2.4.2",
- "jsdom": "26.0.0",
- "npm-run-all2": "7.0.2",
- "prettier": "3.5.1",
- "typescript": "5.1.6",
- "vue-tsc": "2.2.2"
- }
-}
diff --git a/samples/__legacy__/vue-vite/public/favicon.ico b/samples/__legacy__/vue-vite/public/favicon.ico
deleted file mode 100644
index 67b0e598d..000000000
Binary files a/samples/__legacy__/vue-vite/public/favicon.ico and /dev/null differ
diff --git a/samples/__legacy__/vue-vite/src/App.vue b/samples/__legacy__/vue-vite/src/App.vue
deleted file mode 100644
index 85e026b85..000000000
--- a/samples/__legacy__/vue-vite/src/App.vue
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
diff --git a/samples/__legacy__/vue-vite/src/assets/asgardeo.svg b/samples/__legacy__/vue-vite/src/assets/asgardeo.svg
deleted file mode 100644
index 0ddce269c..000000000
--- a/samples/__legacy__/vue-vite/src/assets/asgardeo.svg
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
diff --git a/samples/__legacy__/vue-vite/src/assets/logo.svg b/samples/__legacy__/vue-vite/src/assets/logo.svg
deleted file mode 100644
index 756566035..000000000
--- a/samples/__legacy__/vue-vite/src/assets/logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/samples/__legacy__/vue-vite/src/assets/main.css b/samples/__legacy__/vue-vite/src/assets/main.css
deleted file mode 100644
index fbf6c2543..000000000
--- a/samples/__legacy__/vue-vite/src/assets/main.css
+++ /dev/null
@@ -1,48 +0,0 @@
-/* General Styles */
-body {
- font-family: Arial, sans-serif;
- margin: 0;
- padding: 0;
- background-color: #f4f4f4;
- color: #333;
- text-align: center;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100vh;
-}
-
-/* Logo Styles */
-.logo {
- width: 100px;
- margin: 10px;
-}
-
-/* Button Styles */
-button {
- padding: 10px 15px;
- font-size: 16px;
- cursor: pointer;
- background-color: #007bff;
- color: white;
- border: none;
- border-radius: 5px;
- transition: background-color 0.3s;
-}
-
-button:hover {
- background-color: #0056b3;
-}
-
-/* Container Styles */
-.button-container {
- margin-top: 20px;
-}
-
-/* Center Content */
-.container {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
-}
diff --git a/samples/__legacy__/vue-vite/src/components/AuthLayout.vue b/samples/__legacy__/vue-vite/src/components/AuthLayout.vue
deleted file mode 100644
index 5d165b904..000000000
--- a/samples/__legacy__/vue-vite/src/components/AuthLayout.vue
+++ /dev/null
@@ -1,345 +0,0 @@
-
-
-
-
-
-
-
-
-
Asgardeo Authentication Demo
-
-
-
-
-
-
- Practical demonstration of authentication for Single Page Applications using the OpenID
- Connect Authorization Code flow with the
- Asgardeo Auth Vue SDK.
-
-
-
-
Checking authentication status...
-
-
-
-
Welcome, {{ state.displayName }}
-
Welcome, loading user data...
-
{{ state.email }}
-
-
-
-
-
-
-
-
Access Token
-
-
{{ tokenInfo }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/__legacy__/vue-vite/src/components/SignInBtn.vue b/samples/__legacy__/vue-vite/src/components/SignInBtn.vue
deleted file mode 100644
index 90c08db69..000000000
--- a/samples/__legacy__/vue-vite/src/components/SignInBtn.vue
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
diff --git a/samples/__legacy__/vue-vite/src/images/footer.png b/samples/__legacy__/vue-vite/src/images/footer.png
deleted file mode 100644
index ac178abd0..000000000
Binary files a/samples/__legacy__/vue-vite/src/images/footer.png and /dev/null differ
diff --git a/samples/__legacy__/vue-vite/src/main.ts b/samples/__legacy__/vue-vite/src/main.ts
deleted file mode 100644
index 3e5e82f29..000000000
--- a/samples/__legacy__/vue-vite/src/main.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * 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.
- */
-
-import './assets/main.css'
-
-import { asgardeoPlugin, type AuthVueConfig } from '@asgardeo/vue'
-import { createApp, type App as VueApp } from 'vue'
-import App from './App.vue'
-import router from './router'
-
-const app: VueApp = createApp(App)
-
-const config: AuthVueConfig = {
- baseUrl: import.meta.env.VITE_ASGARDEO_BASE_URL,
- clientId: import.meta.env.VITE_ASGARDEO_CLIENT_ID,
- scope: ['openid', 'profile', 'email'],
- afterSignInUrl: import.meta.env.VITE_ASGARDEO_SIGN_IN_REDIRECT_URL,
- afterSignOutUrl: import.meta.env.VITE_ASGARDEO_SIGN_OUT_REDIRECT_URL,
-}
-
-app.use(router)
-app.use(asgardeoPlugin, config)
-
-app.mount('#app')
diff --git a/samples/__legacy__/vue-vite/src/router/index.ts b/samples/__legacy__/vue-vite/src/router/index.ts
deleted file mode 100644
index c9dd98986..000000000
--- a/samples/__legacy__/vue-vite/src/router/index.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * 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.
- */
-
-import { useAsgardeo, type AuthStateInterface } from '@asgardeo/vue'
-import { watch } from 'vue'
-import { createRouter, createWebHistory, type Router } from 'vue-router'
-import HomeView from '../views/HomeView.vue'
-import LandingView from '@/views/LandingView.vue'
-
-/**
- * Wait for Asgardeo loading state to complete before proceeding
- * @param state - The Asgardeo state containing isLoading property
- * @returns A promise that resolves when loading is complete
- */
-async function waitForAsgardeoLoaded(state: AuthStateInterface): Promise {
- return new Promise((resolve: () => void) => {
- // If already not loading, resolve immediately
- if (!state.isLoading) {
- resolve()
- return
- }
-
- // Watch for changes in loading state
- const unwatch: () => void = watch(
- () => state.isLoading,
- (isLoading: boolean) => {
- if (!isLoading) {
- unwatch()
- resolve()
- }
- },
- )
- })
-}
-
-const router: Router = createRouter({
- history: createWebHistory(import.meta.env.BASE_URL),
- routes: [
- {
- component: LandingView,
- name: 'landing',
- path: '/',
- },
- {
- beforeEnter: async (): Promise => {
- const { state, isSignedIn, signIn } = useAsgardeo()
-
- // Wait for loading to complete if still in progress
- if (state.isLoading) {
- await waitForAsgardeoLoaded(state)
- }
-
- try {
- const auth: boolean = await isSignedIn()
- if (!auth) {
- await signIn()
- return false // Prevent navigation until sign-in completes
- }
- return true
- } catch {
- return false // Prevent navigation on error
- }
- },
- component: HomeView,
- name: 'home',
- path: '/home',
- },
- ],
-})
-
-export default router
diff --git a/samples/__legacy__/vue-vite/src/shims-vue.d.ts b/samples/__legacy__/vue-vite/src/shims-vue.d.ts
deleted file mode 100644
index 6fd657571..000000000
--- a/samples/__legacy__/vue-vite/src/shims-vue.d.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * 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.
- */
-
-declare module '*.vue' {
- import { DefineComponent } from 'vue'
-
- const component: DefineComponent<{}, {}, any>
- export default component
-}
diff --git a/samples/__legacy__/vue-vite/src/views/HomeView.vue b/samples/__legacy__/vue-vite/src/views/HomeView.vue
deleted file mode 100644
index 571165d1a..000000000
--- a/samples/__legacy__/vue-vite/src/views/HomeView.vue
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-