diff --git a/.circleci/config.yml b/.circleci/config.yml index 1686eeb047b..11a1e3d0c89 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,7 +171,7 @@ commands: name: 'Run cypress test << parameters.spec >>' command: | cd ~/amplify-js-samples-staging - yarn cypress run --headless --spec ./cypress/integration/auth/<< parameters.spec >>.spec.js --config baseUrl=https://aws.amazon.com/ + ~/amplify-js/.circleci/retry-yarn-script.sh -s 'cypress run --headless --spec ./cypress/integration/auth/<< parameters.spec >>.spec.js --config baseUrl=https://aws.amazon.com/' -n 3 - store_artifacts: path: ~/amplify-js-samples-staging/cypress/videos - store_artifacts: @@ -369,8 +369,7 @@ jobs: # https://github.com/TryGhost/node-sqlite3#source-install command: | cd packages/datastore-storage-adapter - npm install --build-from-source - rm -rf node_modules/@aws-amplify node_modules/@aws-sdk + npm install sqlite3 --build-from-source - run: name: 'Run Amplify JS unit tests' command: | @@ -388,6 +387,7 @@ jobs: echo $SSH_HOST_PUBLIC_KEY >> ~/.ssh/known_hosts git clone $AMPLIFY_JS_SAMPLES_STAGING_URL cd amplify-js-samples-staging + git checkout next-major-version/5 yarn - save_cache: key: amplify-js-{{ .Branch }}-{{ checksum "amplify-js-samples-staging/yarn.lock" }} @@ -398,7 +398,7 @@ jobs: paths: - amplify-js-samples-staging - integ_react_auth: + integ_react_auth_1: #break react auth test to 2 sections to save time parameters: browser: type: string @@ -407,19 +407,12 @@ jobs: working_directory: ~/amplify-js-samples-staging/samples steps: - prepare_test_env - - integ_test_js: - test_name: 'React Authenticator' - framework: react - category: auth - sample_name: with-authenticator-legacy - spec: authenticator - browser: << parameters.browser >> - integ_test_js: test_name: 'React Authenticator' framework: react category: auth sample_name: amplify-authenticator - spec: ui-amplify-authenticator + spec: new-ui-authenticator browser: << parameters.browser >> - integ_test_js: test_name: 'Guest to Authenticated User"' @@ -433,21 +426,30 @@ jobs: framework: react category: auth sample_name: typescript-amplify-authenticator - spec: ui-amplify-authenticator + spec: new-ui-authenticator browser: << parameters.browser >> + integ_react_auth_2: + parameters: + browser: + type: string + executor: js-test-executor + <<: *test_env_vars + working_directory: ~/amplify-js-samples-staging/samples + steps: + - prepare_test_env - integ_test_js: test_name: 'React Custom Authenticator' framework: react category: auth sample_name: amplify-authenticator - spec: custom-authenticator + spec: new-ui-custom-authenticator browser: << parameters.browser >> - integ_test_js: test_name: 'React Custom Authenticator' framework: react category: auth sample_name: with-authenticator - spec: ui-amplify-authenticator + spec: new-ui-authenticator browser: << parameters.browser >> - integ_test_js: test_name: 'Sign In after Sign Up' @@ -465,13 +467,6 @@ jobs: working_directory: ~/amplify-js-samples-staging/samples steps: - prepare_test_env - - integ_test_js: - test_name: 'Angular Authenticator' - framework: angular - category: auth - sample_name: amplify-authenticator-legacy - spec: authenticator - browser: << parameters.browser >> - integ_test_js: test_name: 'Angular Authenticator' framework: angular @@ -502,19 +497,12 @@ jobs: sample_name: amplify-authenticator-legacy spec: authenticator browser: << parameters.browser >> - - integ_test_js: - test_name: 'Vue 2 Authenticator' - framework: vue - category: auth - sample_name: amplify-authenticator - spec: ui-amplify-authenticator - browser: << parameters.browser >> - integ_test_js: test_name: 'Vue 3 Authenticator' framework: vue category: auth sample_name: authenticator-vue3 - spec: ui-amplify-authenticator + spec: new-ui-authenticator browser: << parameters.browser >> - integ_test_js: test_name: 'Vue Custom Authenticator' @@ -930,18 +918,6 @@ jobs: sample_name: graphql spec: graphql browser: << parameters.browser >> - integ_react_storage_ui: - executor: js-test-executor - <<: *test_env_vars - working_directory: ~/amplify-js-samples-staging/samples/react/storage/storageComp - steps: - - prepare_test_env - - integ_test_js: - test_name: 'React Storage UI Components' - framework: react - category: storage - sample_name: storageComp - spec: storage-comp integ_react_amazon_cognito_identity_js_cookie_storage: parameters: browser: @@ -1242,6 +1218,53 @@ jobs: spec: background-process-manager browser: << parameters.browser >> + integ_react_datastore_related_models: + parameters: + browser: + type: string + executor: js-test-executor + <<: *test_env_vars + working_directory: ~/amplify-js-samples-staging/samples/react/datastore/related-models + steps: + - prepare_test_env + - integ_test_js: + test_name: 'DataStore - Related Models' + framework: react + category: datastore + sample_name: related-models + spec: related-models + browser: << parameters.browser >> + + integ_react_iot_reconnect: + executor: js-test-executor + <<: *test_env_vars + working_directory: ~/amplify-js-samples-staging/samples/react/pubsub/reconnection-iot + steps: + - prepare_test_env + - integ_test_js: + test_name: 'PubSub - Reconnection for IoT' + framework: react + category: pubsub + sample_name: reconnection-iot + spec: reconnection + # Firefox doesn't support network state management in cypress + browser: chrome + + integ_react_api_reconnect: + executor: js-test-executor + <<: *test_env_vars + working_directory: ~/amplify-js-samples-staging/samples/react/pubsub/reconnection-api + steps: + - prepare_test_env + - integ_test_js: + test_name: 'PubSub - Reconnection for API' + framework: react + category: pubsub + sample_name: reconnection-api + spec: reconnection + # Firefox doesn't support network state management in cypress + browser: chrome + deploy: executor: macos-executor working_directory: ~/amplify-js @@ -1288,6 +1311,8 @@ releasable_branches: &releasable_branches - ui-components/main - 1.0-stable - geo/main + - in-app-messaging/main + - next-major-version/5 test_browsers: &test_browsers browser: [chrome, firefox] @@ -1326,7 +1351,16 @@ workflows: - unit_test: requires: - build - - integ_react_auth: + - integ_react_auth_1: + requires: + - integ_setup + - build + filters: + <<: *releasable_branches + matrix: + parameters: + <<: *test_browsers + - integ_react_auth_2: requires: - integ_setup - build @@ -1566,12 +1600,6 @@ workflows: matrix: parameters: <<: *test_browsers - - integ_react_storage_ui: - requires: - - integ_setup - - build - filters: - <<: *releasable_branches - integ_react_amazon_cognito_identity_js_cookie_storage: requires: - integ_setup @@ -1722,6 +1750,7 @@ workflows: matrix: parameters: <<: *test_browsers + - integ_react_datastore_background_process_manager: requires: - integ_setup @@ -1731,6 +1760,28 @@ workflows: matrix: parameters: <<: *test_browsers + - integ_react_datastore_related_models: + requires: + - integ_setup + - build + filters: + <<: *releasable_branches + matrix: + parameters: + <<: *test_browsers + - integ_react_iot_reconnect: + requires: + - integ_setup + - build + filters: + <<: *releasable_branches + - integ_react_api_reconnect: + requires: + - integ_setup + - build + filters: + <<: *releasable_branches + - deploy: filters: <<: *releasable_branches @@ -1756,14 +1807,14 @@ workflows: - integ_react_storage - integ_react_storage_multipart_progress - integ_react_storage_copy - - integ_react_storage_ui - integ_react_interactions - integ_angular_interactions - integ_vue_interactions - integ_react_amazon_cognito_identity_js_cookie_storage - integ_react_amazon_cognito_identity_js - integ_node_amazon_cognito_identity_js - - integ_react_auth + - integ_react_auth_1 + - integ_react_auth_2 - integ_angular_auth - integ_vue_auth - integ_rn_ios_storage @@ -1783,6 +1834,9 @@ workflows: - integ_react_datastore_custom_pk_has_one - integ_react_datastore_custom_pk_has_many_many_to_many - integ_react_datastore_background_process_manager + - integ_react_datastore_related_models + - integ_react_iot_reconnect + - integ_react_api_reconnect - post_release: filters: branches: @@ -1963,7 +2017,7 @@ orbs: exit 1 fi } - eval << parameters.pre-command >> + eval << parameters.pre-command >> retry "<< parameters.command >>" no_output_timeout: << parameters.no_output_timeout >> diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 040cc30f388..5c3eaae0267 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,17 +1,8 @@ * @aws-amplify/amplify-js -/packages/amplify-ui @aws-amplify/amplify-js @aws-amplify/amplify-ui -/packages/amplify-ui-angular @aws-amplify/amplify-js @aws-amplify/amplify-ui -/packages/amplify-ui-components @aws-amplify/amplify-js @aws-amplify/amplify-ui -/packages/amplify-ui-react @aws-amplify/amplify-js @aws-amplify/amplify-ui -/packages/amplify-ui-storybook @aws-amplify/amplify-js @aws-amplify/amplify-ui -/packages/amplify-ui-vue @aws-amplify/amplify-js @aws-amplify/amplify-ui /packages/api @aws-amplify/amplify-js @aws-amplify/amplify-data /packages/api-graphql @aws-amplify/amplify-data /packages/api-rest @aws-amplify/amplify-js @aws-amplify/amplify-data -/packages/aws-amplify-angular @aws-amplify/amplify-js @aws-amplify/amplify-ui -/packages/aws-amplify-react @aws-amplify/amplify-js @aws-amplify/amplify-ui /packages/aws-amplify-react-native @aws-amplify/amplify-js @aws-amplify/amplify-ui -/packages/aws-amplify-vue @aws-amplify/amplify-js @aws-amplify/amplify-ui /packages/core @aws-amplify/amplify-js @aws-amplify/amplify-data /packages/datastore @aws-amplify/amplify-data /packages/datastore-storage-adapter @aws-amplify/amplify-data diff --git a/.gitignore b/.gitignore index 2ee59f2d934..cf575daa4a7 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,5 @@ packages/**/cjs/ packages/**/cypress/videos/ yarn.lock package-lock.json -packages/*/.watchmanconfig \ No newline at end of file +packages/*/.watchmanconfig +coverage-ts/ \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6a906e27206..55f9729826e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -89,7 +89,6 @@ yarn build --scope @aws-amplify/auth ``` yarn run test --scope @aws-amplify/auth -yarn run test --scope @aws-amplify/ui-components ``` > Note: There is a commit hook that will run the tests prior to committing. Please make sure if you are going to provide a pull request to be sure you include unit tests with your functionality and that all tests pass. diff --git a/package.json b/package.json index 0c570d86dd7..34748edcc98 100644 --- a/package.json +++ b/package.json @@ -22,12 +22,15 @@ "link-all": "yarn unlink-all && lerna exec --no-bail --parallel yarn link", "unlink-all": "lerna exec --no-bail --parallel -- yarn unlink; exit 0", "publish:main": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=unstable --preid=unstable --exact --no-verify-access", + "publish:next-major-version/5": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=next --preid=next --exact --no-verify-access", "publish:beta": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=beta --preid=beta --exact --no-verify-access", - "publish:release": "lerna publish --conventional-commits --yes --message 'chore(release): Publish [ci skip]' --no-verify-access", + "publish:release": "lerna exec npm publish", "publish:1.0-stable": "lerna publish --conventional-commits --yes --dist-tag=stable-1.0 --message 'chore(release): Publish [ci skip]' --no-verify-access", "publish:ui-components/main": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=ui-preview --preid=ui-preview --exact --no-verify-access", "publish:verdaccio": "lerna publish --no-push --canary minor --dist-tag=unstable --preid=unstable --exact --force-publish --yes --no-verify-access", - "publish:geo/main": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=geo --preid=geo --exact --no-verify-access" + "publish:geo/main": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=geo --preid=geo --exact --no-verify-access", + "publish:in-app-messaging/main": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=in-app-messaging --preid=in-app-messaging --exact --no-verify-access", + "ts-coverage": "lerna run ts-coverage" }, "husky": { "hooks": { @@ -89,6 +92,7 @@ "tslint-config-airbnb": "^5.8.0", "typedoc": "^0.16.9", "typescript": "~3.8.3", + "typescript-coverage-report": "^0.6.4", "uglifyjs-webpack-plugin": "^0.4.6", "uuid-validate": "^0.0.3", "webpack": "^4.32.0", diff --git a/packages/amazon-cognito-identity-js/__tests__/AuthenticationHelper.test.js b/packages/amazon-cognito-identity-js/__tests__/AuthenticationHelper.test.js index 5cb61b4bafa..723f0d89d77 100644 --- a/packages/amazon-cognito-identity-js/__tests__/AuthenticationHelper.test.js +++ b/packages/amazon-cognito-identity-js/__tests__/AuthenticationHelper.test.js @@ -1,7 +1,7 @@ import AuthenticationHelper from '../src/AuthenticationHelper'; import BigInteger from '../src/BigInteger'; -import { SHA256 } from 'crypto-js'; +import { Sha256 } from '@aws-crypto/sha256-js'; import { promisifyCallback } from './util'; import { bigIntError } from './constants'; const instance = new AuthenticationHelper('TestPoolName'); @@ -738,8 +738,12 @@ describe('calculateU()', () => { describe('hexhash() and hash()', () => { test('Test hexHash function produces a valid hex string with regex', () => { const regEx = /[0-9a-f]/g; - const hexStr = SHA256('testString').toString(); - expect(regEx.test(instance.hexHash(hexStr))).toBe(true); + const awsCryptoHash = new Sha256(); + awsCryptoHash.update('testString'); + const resultFromAWSCrypto = awsCryptoHash.digestSync(); + const hashHex = Buffer.from(resultFromAWSCrypto).toString('hex'); + + expect(regEx.test(instance.hexHash(hashHex))).toBe(true); }); test('Hashing a buffer returns a string', () => { diff --git a/packages/amazon-cognito-identity-js/package.json b/packages/amazon-cognito-identity-js/package.json index 4d2ebdfd0a9..847797f7d6e 100644 --- a/packages/amazon-cognito-identity-js/package.json +++ b/packages/amazon-cognito-identity-js/package.json @@ -1,7 +1,7 @@ { "name": "amazon-cognito-identity-js", "description": "Amazon Cognito Identity Provider JavaScript SDK", - "version": "5.2.12", + "version": "6.0.0", "author": { "name": "Amazon Web Services", "email": "aws@amazon.com", @@ -48,7 +48,8 @@ "lint": "eslint src", "lint2": "eslint enhance-rn.js", "test": "jest --config ./jest.config.js", - "format": "echo \"Not implemented\"" + "format": "echo \"Not implemented\"", + "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json" }, "main": "lib/index.js", "react-native": { @@ -62,8 +63,8 @@ "jsnext:main": "es/index.js", "types": "./index.d.ts", "dependencies": { + "@aws-crypto/sha256-js": "1.2.2", "buffer": "4.9.2", - "crypto-js": "^4.1.1", "fast-base64-decode": "^1.0.0", "isomorphic-unfetch": "^3.0.0", "js-cookie": "^2.2.1" @@ -88,6 +89,7 @@ "jsdoc": "3.4.0", "react": "^16.0.0", "rimraf": "^2.5.4", - "webpack": "^3.5.5" + "webpack": "^3.5.5", + "uglifyjs-webpack-plugin": "^1.0.0" } } diff --git a/packages/amazon-cognito-identity-js/src/AuthenticationHelper.js b/packages/amazon-cognito-identity-js/src/AuthenticationHelper.js index 4bc355af5ad..57920af2548 100644 --- a/packages/amazon-cognito-identity-js/src/AuthenticationHelper.js +++ b/packages/amazon-cognito-identity-js/src/AuthenticationHelper.js @@ -4,11 +4,8 @@ */ import { Buffer } from 'buffer'; -import CryptoJS from 'crypto-js/core'; -import 'crypto-js/lib-typedarrays'; // necessary for crypto js -import SHA256 from 'crypto-js/sha256'; -import HmacSHA256 from 'crypto-js/hmac-sha256'; import WordArray from './utils/WordArray'; +import { Sha256 } from '@aws-crypto/sha256-js'; /** * Returns a Buffer with a sequence of random nBytes @@ -216,9 +213,11 @@ export default class AuthenticationHelper { * @private */ hash(buf) { - const str = - buf instanceof Buffer ? CryptoJS.lib.WordArray.create(buf) : buf; - const hashHex = SHA256(str).toString(); + const awsCryptoHash = new Sha256(); + awsCryptoHash.update(buf); + + const resultFromAWSCrypto = awsCryptoHash.digestSync(); + const hashHex = Buffer.from(resultFromAWSCrypto).toString('hex'); return new Array(64 - hashHex.length).join('0') + hashHex; } @@ -241,20 +240,23 @@ export default class AuthenticationHelper { * @private */ computehkdf(ikm, salt) { - const infoBitsWordArray = CryptoJS.lib.WordArray.create( - Buffer.concat([ - this.infoBits, - Buffer.from(String.fromCharCode(1), 'utf8'), - ]) - ); - const ikmWordArray = - ikm instanceof Buffer ? CryptoJS.lib.WordArray.create(ikm) : ikm; - const saltWordArray = - salt instanceof Buffer ? CryptoJS.lib.WordArray.create(salt) : salt; - - const prk = HmacSHA256(ikmWordArray, saltWordArray); - const hmac = HmacSHA256(infoBitsWordArray, prk); - return Buffer.from(hmac.toString(), 'hex').slice(0, 16); + const infoBitsBuffer = Buffer.concat([ + this.infoBits, + Buffer.from(String.fromCharCode(1), 'utf8'), + ]); + + const awsCryptoHash = new Sha256(salt); + awsCryptoHash.update(ikm); + + const resultFromAWSCryptoPrk = awsCryptoHash.digestSync(); + const awsCryptoHashHmac = new Sha256(resultFromAWSCryptoPrk); + awsCryptoHashHmac.update(infoBitsBuffer); + + const resultFromAWSCryptoHmac = awsCryptoHashHmac.digestSync(); + const hashHexFromAWSCrypto = resultFromAWSCryptoHmac; + const currentHex = hashHexFromAWSCrypto.slice(0, 16); + + return currentHex; } /** diff --git a/packages/amazon-cognito-identity-js/src/CognitoUser.js b/packages/amazon-cognito-identity-js/src/CognitoUser.js index 5f4bc7c792b..afeaf7c4c8c 100644 --- a/packages/amazon-cognito-identity-js/src/CognitoUser.js +++ b/packages/amazon-cognito-identity-js/src/CognitoUser.js @@ -4,10 +4,7 @@ */ import { Buffer } from 'buffer'; -import CryptoJS from 'crypto-js/core'; -import TypedArrays from 'crypto-js/lib-typedarrays'; // necessary for crypto js -import Base64 from 'crypto-js/enc-base64'; -import HmacSHA256 from 'crypto-js/hmac-sha256'; +import { Sha256 } from '@aws-crypto/sha256-js'; import BigInteger from './BigInteger'; import AuthenticationHelper from './AuthenticationHelper'; @@ -293,16 +290,19 @@ export default class CognitoUser { const dateNow = dateHelper.getNowString(); - const message = CryptoJS.lib.WordArray.create( - Buffer.concat([ - Buffer.from(this.pool.getUserPoolName(), 'utf8'), - Buffer.from(this.username, 'utf8'), - Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), - Buffer.from(dateNow, 'utf8'), - ]) - ); - const key = CryptoJS.lib.WordArray.create(hkdf); - const signatureString = Base64.stringify(HmacSHA256(message, key)); + const concatBuffer = Buffer.concat([ + Buffer.from(this.pool.getUserPoolName(), 'utf8'), + Buffer.from(this.username, 'utf8'), + Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), + Buffer.from(dateNow, 'utf8'), + ]); + + const awsCryptoHash = new Sha256(hkdf); + awsCryptoHash.update(concatBuffer); + + const resultFromAWSCrypto = awsCryptoHash.digestSync(); + const signatureString = + Buffer.from(resultFromAWSCrypto).toString('base64'); const challengeResponses = {}; @@ -691,16 +691,19 @@ export default class CognitoUser { const dateNow = dateHelper.getNowString(); - const message = CryptoJS.lib.WordArray.create( - Buffer.concat([ - Buffer.from(this.deviceGroupKey, 'utf8'), - Buffer.from(this.deviceKey, 'utf8'), - Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), - Buffer.from(dateNow, 'utf8'), - ]) - ); - const key = CryptoJS.lib.WordArray.create(hkdf); - const signatureString = Base64.stringify(HmacSHA256(message, key)); + const concatBuffer = Buffer.concat([ + Buffer.from(this.deviceGroupKey, 'utf8'), + Buffer.from(this.deviceKey, 'utf8'), + Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), + Buffer.from(dateNow, 'utf8'), + ]); + + const awsCryptoHash = new Sha256(hkdf); + awsCryptoHash.update(concatBuffer); + + const resultFromAWSCrypto = awsCryptoHash.digestSync(); + const signatureString = + Buffer.from(resultFromAWSCrypto).toString('base64'); const challengeResponses = {}; diff --git a/packages/amazon-cognito-identity-js/tsconfig.build.json b/packages/amazon-cognito-identity-js/tsconfig.build.json new file mode 100644 index 00000000000..c92f6cecd53 --- /dev/null +++ b/packages/amazon-cognito-identity-js/tsconfig.build.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": {}, + "include": ["index.d.ts"] +} diff --git a/packages/amazon-cognito-identity-js/webpack.config.js b/packages/amazon-cognito-identity-js/webpack.config.js index 23c7fd54d53..026f7d21034 100644 --- a/packages/amazon-cognito-identity-js/webpack.config.js +++ b/packages/amazon-cognito-identity-js/webpack.config.js @@ -31,7 +31,6 @@ var config = { new webpack.optimize.OccurrenceOrderPlugin(), new webpack.BannerPlugin({ banner, raw: true }), new UglifyJsPlugin({ - minimize: true, sourceMap: true, include: /\.min\.js$/, }), diff --git a/packages/amplify-ui-angular/.gitignore b/packages/amplify-ui-angular/.gitignore deleted file mode 100644 index f33eb4eeb77..00000000000 --- a/packages/amplify-ui-angular/.gitignore +++ /dev/null @@ -1 +0,0 @@ -src/directives/proxies.ts diff --git a/packages/amplify-ui-angular/CHANGELOG.md b/packages/amplify-ui-angular/CHANGELOG.md deleted file mode 100644 index d1851105823..00000000000 --- a/packages/amplify-ui-angular/CHANGELOG.md +++ /dev/null @@ -1,616 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [1.0.70](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.69...@aws-amplify/ui-angular@1.0.70) (2022-11-04) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.69](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.68...@aws-amplify/ui-angular@1.0.69) (2022-10-27) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.68](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.67...@aws-amplify/ui-angular@1.0.68) (2022-10-26) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.67](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.66...@aws-amplify/ui-angular@1.0.67) (2022-10-25) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.66](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.65...@aws-amplify/ui-angular@1.0.66) (2022-10-14) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.65](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.64...@aws-amplify/ui-angular@1.0.65) (2022-10-14) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.64](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.62...@aws-amplify/ui-angular@1.0.64) (2022-09-30) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.63](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.62...@aws-amplify/ui-angular@1.0.63) (2022-09-20) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.62](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.61...@aws-amplify/ui-angular@1.0.62) (2022-09-08) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.61](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.60...@aws-amplify/ui-angular@1.0.61) (2022-09-01) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.60](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.59...@aws-amplify/ui-angular@1.0.60) (2022-08-23) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.59](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.58...@aws-amplify/ui-angular@1.0.59) (2022-08-18) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.58](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.57...@aws-amplify/ui-angular@1.0.58) (2022-08-16) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.57](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.56...@aws-amplify/ui-angular@1.0.57) (2022-08-01) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.56](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.55...@aws-amplify/ui-angular@1.0.56) (2022-07-28) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.55](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.54...@aws-amplify/ui-angular@1.0.55) (2022-07-21) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.54](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.53...@aws-amplify/ui-angular@1.0.54) (2022-07-07) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.53](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.52...@aws-amplify/ui-angular@1.0.53) (2022-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.52](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.51...@aws-amplify/ui-angular@1.0.52) (2022-06-15) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.51](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.50...@aws-amplify/ui-angular@1.0.51) (2022-05-24) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.50](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.49...@aws-amplify/ui-angular@1.0.50) (2022-05-23) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.49](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.48...@aws-amplify/ui-angular@1.0.49) (2022-05-12) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.48](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.47...@aws-amplify/ui-angular@1.0.48) (2022-05-03) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.47](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.46...@aws-amplify/ui-angular@1.0.47) (2022-04-14) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.46](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.45...@aws-amplify/ui-angular@1.0.46) (2022-04-04) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.45](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.44...@aws-amplify/ui-angular@1.0.45) (2022-03-28) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.44](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.43...@aws-amplify/ui-angular@1.0.44) (2022-03-22) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.43](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.42...@aws-amplify/ui-angular@1.0.43) (2022-03-10) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.42](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.41...@aws-amplify/ui-angular@1.0.42) (2022-02-28) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.41](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.40...@aws-amplify/ui-angular@1.0.41) (2022-02-03) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.40](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.39...@aws-amplify/ui-angular@1.0.40) (2022-01-27) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.39](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.38...@aws-amplify/ui-angular@1.0.39) (2022-01-07) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.38](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.37...@aws-amplify/ui-angular@1.0.38) (2021-12-16) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.37](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.36...@aws-amplify/ui-angular@1.0.37) (2021-12-03) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.36](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.35...@aws-amplify/ui-angular@1.0.36) (2021-12-02) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.35](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.34...@aws-amplify/ui-angular@1.0.35) (2021-11-18) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.34](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.33...@aws-amplify/ui-angular@1.0.34) (2021-11-16) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.33](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.32...@aws-amplify/ui-angular@1.0.33) (2021-11-12) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.32](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.31...@aws-amplify/ui-angular@1.0.32) (2021-11-09) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.31](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.30...@aws-amplify/ui-angular@1.0.31) (2021-10-28) - -**Note:** Version bump only for package @aws-amplify/ui-angular - - - - - -## [1.0.30](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.29...@aws-amplify/ui-angular@1.0.30) (2021-10-21) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.29](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.28...@aws-amplify/ui-angular@1.0.29) (2021-10-07) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.28](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.27...@aws-amplify/ui-angular@1.0.28) (2021-09-30) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.27](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.26...@aws-amplify/ui-angular@1.0.27) (2021-09-24) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.26](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.25...@aws-amplify/ui-angular@1.0.26) (2021-09-22) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.25](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.24...@aws-amplify/ui-angular@1.0.25) (2021-09-17) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.24](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.23...@aws-amplify/ui-angular@1.0.24) (2021-09-09) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.23](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.22...@aws-amplify/ui-angular@1.0.23) (2021-09-07) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.22](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.21...@aws-amplify/ui-angular@1.0.22) (2021-09-04) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.21](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.20...@aws-amplify/ui-angular@1.0.21) (2021-09-02) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.20](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.19...@aws-amplify/ui-angular@1.0.20) (2021-08-26) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.19](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.18...@aws-amplify/ui-angular@1.0.19) (2021-08-19) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.18](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.17...@aws-amplify/ui-angular@1.0.18) (2021-08-12) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.17](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.16...@aws-amplify/ui-angular@1.0.17) (2021-07-28) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.16](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.15...@aws-amplify/ui-angular@1.0.16) (2021-07-22) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.14...@aws-amplify/ui-angular@1.0.15) (2021-07-16) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.13...@aws-amplify/ui-angular@1.0.14) (2021-07-08) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.12...@aws-amplify/ui-angular@1.0.13) (2021-06-24) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.11...@aws-amplify/ui-angular@1.0.12) (2021-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.10...@aws-amplify/ui-angular@1.0.11) (2021-06-10) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.9...@aws-amplify/ui-angular@1.0.10) (2021-05-26) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.8...@aws-amplify/ui-angular@1.0.9) (2021-05-14) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.7...@aws-amplify/ui-angular@1.0.8) (2021-05-06) - -### Bug Fixes - -- **@aws-amplify/ui-angular:** Add missing angular module ([bb1b01a](https://github.com/aws-amplify/amplify-js/commit/bb1b01aaa64364c183db4ef938d61526499c2c3c)) - -## [1.0.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.6...@aws-amplify/ui-angular@1.0.7) (2021-04-15) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.5...@aws-amplify/ui-angular@1.0.6) (2021-03-25) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.4...@aws-amplify/ui-angular@1.0.5) (2021-03-12) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.3...@aws-amplify/ui-angular@1.0.4) (2021-03-08) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.2...@aws-amplify/ui-angular@1.0.3) (2021-02-25) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@1.0.1...@aws-amplify/ui-angular@1.0.2) (2021-02-18) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [1.0.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.21...@aws-amplify/ui-angular@1.0.1) (2021-02-15) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.21](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.20...@aws-amplify/ui-angular@0.4.21) (2021-02-09) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.20](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.19...@aws-amplify/ui-angular@0.4.20) (2021-02-03) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.19](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.18...@aws-amplify/ui-angular@0.4.19) (2021-02-01) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.18](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.17...@aws-amplify/ui-angular@0.4.18) (2021-01-29) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.17](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.16...@aws-amplify/ui-angular@0.4.17) (2021-01-07) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.16](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.15...@aws-amplify/ui-angular@0.4.16) (2020-12-17) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.14...@aws-amplify/ui-angular@0.4.15) (2020-12-10) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.13...@aws-amplify/ui-angular@0.4.14) (2020-11-30) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.12...@aws-amplify/ui-angular@0.4.13) (2020-11-23) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.11...@aws-amplify/ui-angular@0.4.12) (2020-11-20) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.10...@aws-amplify/ui-angular@0.4.11) (2020-11-13) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.9...@aws-amplify/ui-angular@0.4.10) (2020-11-03) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.8...@aws-amplify/ui-angular@0.4.9) (2020-10-31) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.7...@aws-amplify/ui-angular@0.4.8) (2020-10-29) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.6...@aws-amplify/ui-angular@0.4.7) (2020-10-15) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.5...@aws-amplify/ui-angular@0.4.6) (2020-10-01) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.4...@aws-amplify/ui-angular@0.4.5) (2020-09-25) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.3...@aws-amplify/ui-angular@0.4.4) (2020-09-16) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.2...@aws-amplify/ui-angular@0.4.3) (2020-09-15) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.1...@aws-amplify/ui-angular@0.4.2) (2020-09-10) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.4.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.0...@aws-amplify/ui-angular@0.4.1) (2020-09-03) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -# [0.4.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.3.0...@aws-amplify/ui-angular@0.4.0) (2020-09-03) - -### Features - -- **SSR:** withSSRContext ([#6146](https://github.com/aws-amplify/amplify-js/issues/6146)) ([1cb1afd](https://github.com/aws-amplify/amplify-js/commit/1cb1afd1e56135908dceb2ef6403f0b3e78067fe)) - -# [0.3.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.15...@aws-amplify/ui-angular@0.3.0) (2020-09-01) - -### Features - -- **@aws-amplify/ui-components:** Add Chatbot UI to main ([#6684](https://github.com/aws-amplify/amplify-js/issues/6684)) ([4e25f92](https://github.com/aws-amplify/amplify-js/commit/4e25f923723441c6fb705584fcc3349214806558)), closes [#5024](https://github.com/aws-amplify/amplify-js/issues/5024) [#6648](https://github.com/aws-amplify/amplify-js/issues/6648) [#6652](https://github.com/aws-amplify/amplify-js/issues/6652) [#6678](https://github.com/aws-amplify/amplify-js/issues/6678) - -## [0.2.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.14...@aws-amplify/ui-angular@0.2.15) (2020-08-19) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.13...@aws-amplify/ui-angular@0.2.14) (2020-08-06) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.12...@aws-amplify/ui-angular@0.2.13) (2020-07-27) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.11...@aws-amplify/ui-angular@0.2.12) (2020-07-22) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.10...@aws-amplify/ui-angular@0.2.11) (2020-07-09) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.9...@aws-amplify/ui-angular@0.2.10) (2020-07-07) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.8...@aws-amplify/ui-angular@0.2.9) (2020-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.7...@aws-amplify/ui-angular@0.2.8) (2020-06-09) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.6...@aws-amplify/ui-angular@0.2.7) (2020-06-02) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.5...@aws-amplify/ui-angular@0.2.6) (2020-05-22) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.4...@aws-amplify/ui-angular@0.2.5) (2020-05-14) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.3...@aws-amplify/ui-angular@0.2.4) (2020-04-30) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.2...@aws-amplify/ui-angular@0.2.3) (2020-04-24) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.1...@aws-amplify/ui-angular@0.2.2) (2020-04-08) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -## [0.2.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.2.0...@aws-amplify/ui-angular@0.2.1) (2020-04-07) - -**Note:** Version bump only for package @aws-amplify/ui-angular - -# 0.2.0 (2020-04-02) - -### Features - -- **@aws-amplify/ui-components:** Framework Bindings for Authen… ([#4676](https://github.com/aws-amplify/amplify-js/issues/4676)) ([407089f](https://github.com/aws-amplify/amplify-js/commit/407089fb4f93afc79ff77b4926e0285dff3ad335)), closes [/github.com/yarnpkg/yarn/issues/5225#issuecomment-490462853](https://github.com//github.com/yarnpkg/yarn/issues/5225/issues/issuecomment-490462853) [#4706](https://github.com/aws-amplify/amplify-js/issues/4706) -- **@aws-amplify/ui-components:** Use Shadow DOM, use Sass css, authenticator slots ([#4872](https://github.com/aws-amplify/amplify-js/issues/4872)) ([538ca66](https://github.com/aws-amplify/amplify-js/commit/538ca667296568fc58d77ce5c45f201b59e085ea)) - -# 0.1.0 (2020-03-31) - -### Features - -- **@aws-amplify/ui-components:** Framework Bindings for Authen… ([#4676](https://github.com/aws-amplify/amplify-js/issues/4676)) ([407089f](https://github.com/aws-amplify/amplify-js/commit/407089fb4f93afc79ff77b4926e0285dff3ad335)), closes [/github.com/yarnpkg/yarn/issues/5225#issuecomment-490462853](https://github.com//github.com/yarnpkg/yarn/issues/5225/issues/issuecomment-490462853) [#4706](https://github.com/aws-amplify/amplify-js/issues/4706) -- **@aws-amplify/ui-components:** Use Shadow DOM, use Sass css, authenticator slots ([#4872](https://github.com/aws-amplify/amplify-js/issues/4872)) ([538ca66](https://github.com/aws-amplify/amplify-js/commit/538ca667296568fc58d77ce5c45f201b59e085ea)) diff --git a/packages/amplify-ui-angular/README.md b/packages/amplify-ui-angular/README.md deleted file mode 100644 index ca10c3859d4..00000000000 --- a/packages/amplify-ui-angular/README.md +++ /dev/null @@ -1 +0,0 @@ -# Amplify UI Angular diff --git a/packages/amplify-ui-angular/package.json b/packages/amplify-ui-angular/package.json deleted file mode 100644 index 6333fa8c462..00000000000 --- a/packages/amplify-ui-angular/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "@aws-amplify/ui-angular", - "private": "true", - "version": "1.0.70", - "description": "Angular specific wrapper for @aws-amplify/ui-components", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/aws-amplify/amplify-js.git" - }, - "scripts": { - "build": "npm run build.ng", - "build.link": "npm run build && node scripts/link-copy.js", - "build.fesm": "rollup --config ./scripts/rollup.config.js", - "build.ng": "npm run build.es2015 && npm run build.es5", - "build.es2015": "ngc -p tsconfig.json && rollup --config ./scripts/rollup.config.js", - "build.es5": "ngc -p tsconfig.legacy.json && rollup --config ./scripts/rollup.config.legacy.js", - "lint": "npm run lint.ts", - "lint.ts": "tslint --project .", - "lint.fix": "tslint --project . --fix", - "prerelease": "npm run validate && np prerelease --yolo --any-branch --tag next", - "test": "echo 'angular no tests yet'", - "tsc": "tsc -p .", - "validate": "npm i && npm run lint && npm run test && npm run build" - }, - "module": "dist/fesm5.js", - "main": "dist/fesm5.js", - "types": "dist/core.d.ts", - "files": [ - "dist/" - ], - "dependencies": { - "@aws-amplify/ui-components": "1.9.41" - }, - "devDependencies": { - "@angular/compiler-cli": "^7.2.1", - "@angular/core": "^7.2.1", - "@types/node": "12.12.47", - "rollup": "^1.1.2", - "rollup-plugin-node-resolve": "^4.0.0", - "rxjs": "^6.2.0", - "tsickle": "^0.34.0", - "tslib": "^1.9.3", - "tslint": "^5.12.1", - "typescript": "3.2.4", - "zone.js": "^0.8.28" - } -} diff --git a/packages/amplify-ui-angular/scripts/rollup.config.js b/packages/amplify-ui-angular/scripts/rollup.config.js deleted file mode 100755 index c6e93abab96..00000000000 --- a/packages/amplify-ui-angular/scripts/rollup.config.js +++ /dev/null @@ -1,24 +0,0 @@ -import resolve from 'rollup-plugin-node-resolve'; - -export default { - input: 'build/es2015/core.js', - output: { - file: 'dist/fesm2015.js', - format: 'es' - }, - external: (id) => { - // inline @ionic/core deps - if (id === '@ionic/core') { - return false; - } - // anything else is external - // Windows: C:\xxxxxx\xxx - const colonPosition = 1; - return !(id.startsWith('.') || id.startsWith('/') || id.charAt(colonPosition) === ':'); - }, - plugins: [ - resolve({ - module: true, - }) - ] -}; diff --git a/packages/amplify-ui-angular/scripts/rollup.config.legacy.js b/packages/amplify-ui-angular/scripts/rollup.config.legacy.js deleted file mode 100755 index 5fbe12a1b40..00000000000 --- a/packages/amplify-ui-angular/scripts/rollup.config.legacy.js +++ /dev/null @@ -1,9 +0,0 @@ -import config from './rollup.config'; - -const newConfig = { - ...config, - input: 'build/es5/core.js', -}; -newConfig.output.file = 'dist/fesm5.js'; - -export { newConfig as default }; diff --git a/packages/amplify-ui-angular/src/amplify-module.ts b/packages/amplify-ui-angular/src/amplify-module.ts deleted file mode 100644 index a15de27e7a1..00000000000 --- a/packages/amplify-ui-angular/src/amplify-module.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { NgModule } from '@angular/core'; -import { defineCustomElements } from '@aws-amplify/ui-components/loader'; - -import { - AmplifyAmazonButton, - AmplifyAuth0Button, - AmplifyAuthenticator, - AmplifyAuthContainer, - AmplifyAuthFields, - AmplifyButton, - AmplifyChatbot, - AmplifyCheckbox, - AmplifyCodeField, - AmplifyConfirmSignIn, - AmplifyConfirmSignUp, - AmplifyContainer, - AmplifyCountryDialCode, - AmplifyEmailField, - AmplifyFacebookButton, - AmplifyFederatedButtons, - AmplifyFederatedSignIn, - AmplifyForgotPassword, - AmplifyFormField, - AmplifyFormSection, - AmplifyGoogleButton, - AmplifyGreetings, - AmplifyHint, - AmplifyIcon, - AmplifyIconButton, - AmplifyInput, - AmplifyLabel, - AmplifyLink, - AmplifyLoadingSpinner, - AmplifyNav, - AmplifyOauthButton, - AmplifyPasswordField, - AmplifyPhoneField, - AmplifyPhotoPicker, - AmplifyPicker, - AmplifyRadioButton, - AmplifyRequireNewPassword, - AmplifyS3Album, - AmplifyS3Image, - AmplifyS3ImagePicker, - AmplifyS3Text, - AmplifyS3TextPicker, - AmplifySection, - AmplifySelect, - AmplifySelectMfaType, - AmplifySignIn, - AmplifySignInButton, - AmplifySignOut, - AmplifySignUp, - AmplifyStrike, - AmplifyToast, - AmplifyTooltip, - AmplifyTotpSetup, - AmplifyUsernameField, - AmplifyVerifyContact, -} from './directives/proxies'; - -defineCustomElements(window); - -const DECLARATIONS = [ - AmplifyAmazonButton, - AmplifyAuth0Button, - AmplifyAuthenticator, - AmplifyAuthContainer, - AmplifyAuthFields, - AmplifyButton, - AmplifyChatbot, - AmplifyCheckbox, - AmplifyCodeField, - AmplifyConfirmSignIn, - AmplifyConfirmSignUp, - AmplifyContainer, - AmplifyCountryDialCode, - AmplifyEmailField, - AmplifyFacebookButton, - AmplifyFederatedButtons, - AmplifyFederatedSignIn, - AmplifyForgotPassword, - AmplifyFormField, - AmplifyFormSection, - AmplifyGoogleButton, - AmplifyGreetings, - AmplifyHint, - AmplifyIcon, - AmplifyIconButton, - AmplifyInput, - AmplifyLabel, - AmplifyLink, - AmplifyLoadingSpinner, - AmplifyNav, - AmplifyOauthButton, - AmplifyPasswordField, - AmplifyPhoneField, - AmplifyPhotoPicker, - AmplifyPicker, - AmplifyRadioButton, - AmplifyRequireNewPassword, - AmplifyS3Album, - AmplifyS3Image, - AmplifyS3ImagePicker, - AmplifyS3Text, - AmplifyS3TextPicker, - AmplifySection, - AmplifySelect, - AmplifySelectMfaType, - AmplifySignIn, - AmplifySignInButton, - AmplifySignOut, - AmplifySignUp, - AmplifyStrike, - AmplifyToast, - AmplifyTooltip, - AmplifyTotpSetup, - AmplifyUsernameField, - AmplifyVerifyContact, -]; - -@NgModule({ - declarations: DECLARATIONS, - exports: DECLARATIONS, - imports: [], - providers: [], -}) -export class AmplifyUIAngularModule {} diff --git a/packages/amplify-ui-angular/src/index.ts b/packages/amplify-ui-angular/src/index.ts deleted file mode 100644 index ef4a3d6cd17..00000000000 --- a/packages/amplify-ui-angular/src/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// DIRECTIVES -export * from './directives/proxies'; - -// PACKAGE MODULE -export { AmplifyUIAngularModule } from './amplify-module'; diff --git a/packages/amplify-ui-angular/tsconfig.json b/packages/amplify-ui-angular/tsconfig.json deleted file mode 100644 index 6aabea2a22d..00000000000 --- a/packages/amplify-ui-angular/tsconfig.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "angularCompilerOptions": { - "annotateForClosureCompiler": true, - "strictMetadataEmit": true, - "flatModuleOutFile": "core.js", - "flatModuleId": "@aws-amplify/ui-angular", - "skipTemplateCodegen": true, - "fullTemplateTypeCheck": false - }, - "compilerOptions": { - "skipLibCheck": true, - "alwaysStrict": true, - "strict": true, - "allowSyntheticDefaultImports": true, - "allowUnreachableCode": false, - "declaration": true, - "declarationDir": "dist", - "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true, - "lib": ["dom", "es2017"], - "module": "es2015", - "moduleResolution": "node", - "noImplicitAny": true, - "noImplicitReturns": true, - "noUnusedLocals": false, - "noUnusedParameters": true, - "outDir": "build/es2015", - "pretty": true, - "removeComments": false, - "importHelpers": true, - "rootDir": "src", - "strictPropertyInitialization": false, - "target": "es2015" - }, - "exclude": ["node_modules"], - "files": ["src/index.ts"] -} diff --git a/packages/amplify-ui-angular/tsconfig.legacy.json b/packages/amplify-ui-angular/tsconfig.legacy.json deleted file mode 100755 index 14a366b0771..00000000000 --- a/packages/amplify-ui-angular/tsconfig.legacy.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "target": "es5", - "declarationDir": "build/es5", - "outDir": "build/es5" - } - } \ No newline at end of file diff --git a/packages/amplify-ui-components/.eslintignore b/packages/amplify-ui-components/.eslintignore deleted file mode 100644 index 60eec4be55f..00000000000 --- a/packages/amplify-ui-components/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -dist -www -.stencil -../../node_modules diff --git a/packages/amplify-ui-components/.eslintrc.js b/packages/amplify-ui-components/.eslintrc.js deleted file mode 100644 index 22b39156866..00000000000 --- a/packages/amplify-ui-components/.eslintrc.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - parser: '@typescript-eslint/parser', // Specifies the ESLint parser - extends: [ - 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin - 'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier - 'plugin:@stencil/recommended', - ], - parserOptions: { - ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features - sourceType: 'module', // Allows for the use of imports - project: './tsconfig.json', - }, - overrides: [ - { - files: ['*.stories.tsx'], - rules: { - '@stencil/ban-side-effects': 'off', - }, - }, - { - files: ['*.tsx', '*.ts', '*.js'], - rules: { - '@stencil/strict-boolean-conditions': 'off', - }, - }, - ], - rules: { - '@typescript-eslint/explicit-function-return-type': 0, - '@typescript-eslint/explicit-member-accessibility': 0, - '@typescript-eslint/no-empty-interface': 0, - '@typescript-eslint/no-explicit-any': 0, - '@typescript-eslint/no-unused-vars': 0, - '@typescript-eslint/camelcase': 0, - '@typescript-eslint/no-inferrable-types': 0, - '@typescript-eslint/explicit-module-boundary-types': 0, - '@typescript-eslint/no-empty-function': 0, - '@typescript-eslint/ban-ts-comment': 0, - '@typescript-eslint/ban-types': 0, - '@stencil/decorators-style': 0 - }, -}; diff --git a/packages/amplify-ui-components/.gitattributes b/packages/amplify-ui-components/.gitattributes deleted file mode 100644 index 64bcd457f8e..00000000000 --- a/packages/amplify-ui-components/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -src/components/**/readme.md linguist-generated=true diff --git a/packages/amplify-ui-components/.gitignore b/packages/amplify-ui-components/.gitignore deleted file mode 100644 index 6384ebe1bb1..00000000000 --- a/packages/amplify-ui-components/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -dist/ -www/ - -*~ -*.sw[mnpcod] -*.log -*.lock -*.tmp -*.tmp.* -log.txt -*.sublime-project -*.sublime-workspace - -.stencil/ -.idea/ -.vscode -.sass-cache/ -.versions/ -node_modules/ -$RECYCLE.BIN/ - -.DS_Store -Thumbs.db -UserInterfaceState.xcuserstate -.env - -aws-exports.* \ No newline at end of file diff --git a/packages/amplify-ui-components/.storybook/addons.js b/packages/amplify-ui-components/.storybook/addons.js deleted file mode 100644 index a4137c5c21e..00000000000 --- a/packages/amplify-ui-components/.storybook/addons.js +++ /dev/null @@ -1,3 +0,0 @@ -import '@storybook/addon-actions/register'; -import '@storybook/addon-knobs/register'; -import '@storybook/addon-a11y/register'; diff --git a/packages/amplify-ui-components/.storybook/config.ts b/packages/amplify-ui-components/.storybook/config.ts deleted file mode 100644 index d467817efb8..00000000000 --- a/packages/amplify-ui-components/.storybook/config.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { configure, addDecorator } from '@storybook/html'; -import { withKnobs } from '@storybook/addon-knobs'; -import { withA11y } from '@storybook/addon-a11y'; -import { setConsoleOptions } from '@storybook/addon-console'; - -addDecorator((storyFn, context) => { - setConsoleOptions({ - log: `${context.kind}/${context.story}`, - warn: `${context.kind}/${context.story}/warn`, - error: `${context.kind}/${context.story}/error`, - }); - - return storyFn(context); -}); - -addDecorator(withKnobs); -addDecorator(withA11y); - -configure(require.context('../src/components', true, /.stories.tsx$/), module); - -if (module.hot) { - // Listening for `dispose` indicates when a build has taken place so that - // we can reload the iframe `window` with changes from stencil's build process. - // (`module.hot.accept` will refresh the sidebar as well, since `req.id`). - module.hot.dispose(() => { - window.history.pushState(null, null, window.location.href); - window.location.reload(); - }); -} diff --git a/packages/amplify-ui-components/.storybook/preview-head.html b/packages/amplify-ui-components/.storybook/preview-head.html deleted file mode 100644 index a045adf011d..00000000000 --- a/packages/amplify-ui-components/.storybook/preview-head.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/packages/amplify-ui-components/.storybook/stencil-jsx.js b/packages/amplify-ui-components/.storybook/stencil-jsx.js deleted file mode 100644 index 2bd6aa86f4c..00000000000 --- a/packages/amplify-ui-components/.storybook/stencil-jsx.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Instead of programmatically creating web components, - * convert JSX to a DOM node with Array/Object/Function support. - * - * (Other `h` utilities create vDOM trees.) - * - * @param tag string - * @param props object | null - * @param children array - */ - -export const h = (tag, props, ...children) => { - const node = document.createElement(tag); - - if (props) { - Object.entries(props).forEach(([key, value]) => { - if (key.match(/^on[A-Z]/)) { - const eventName = key.charAt(2).toLowerCase() + key.slice(3); - - if (typeof value === 'function') { - node.addEventListener(eventName, value); - } - } - - node[key] = value; - }); - } - - children.forEach(child => { - if (['number', 'string'].includes(typeof child)) { - node.appendChild(document.createTextNode(child)); - } else if (child === null) { - node.appendChild(document.createComment('')); - } else { - node.appendChild(child); - } - }); - - return node; -}; diff --git a/packages/amplify-ui-components/.storybook/webpack.config.js b/packages/amplify-ui-components/.storybook/webpack.config.js deleted file mode 100644 index 4e51edfa2e6..00000000000 --- a/packages/amplify-ui-components/.storybook/webpack.config.js +++ /dev/null @@ -1,27 +0,0 @@ -const path = require('path'); -const webpack = require('webpack'); - -module.exports = ({ config, mode }) => { - config = Object.assign( - { - module: { - rules: [], - }, - plugins: [], - }, - config || {} - ); - - config.module.rules.push({ - test: /\.(ts|tsx)$/, - include: path.resolve(__dirname, '../src'), - loader: require.resolve('ts-loader'), - }); - - config.resolve.extensions.push('.ts', '.tsx'); - - // Stencil requires a build step, stories using JSX will create DOM nodes instead. - config.resolve.alias['@stencil/core$'] = require.resolve('./stencil-jsx'); - - return config; -}; diff --git a/packages/amplify-ui-components/CHANGELOG.md b/packages/amplify-ui-components/CHANGELOG.md deleted file mode 100644 index f025763b00e..00000000000 --- a/packages/amplify-ui-components/CHANGELOG.md +++ /dev/null @@ -1,774 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [1.9.41](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.40...@aws-amplify/ui-components@1.9.41) (2022-11-04) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.40](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.39...@aws-amplify/ui-components@1.9.40) (2022-10-27) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.39](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.38...@aws-amplify/ui-components@1.9.39) (2022-10-26) - - -### Bug Fixes - -* remove dep on es2020.promise lib additions ([#10532](https://github.com/aws-amplify/amplify-js/issues/10532)) ([8ad200e](https://github.com/aws-amplify/amplify-js/commit/8ad200e7b98967d565e7abe29c2dfb971b9f52a1)) - - - - - -## [1.9.38](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.37...@aws-amplify/ui-components@1.9.38) (2022-10-25) - - -### Bug Fixes - -* **@aws-amplify/datastore:** introduce "settlement" guarantees to stop() and clear() ([#10450](https://github.com/aws-amplify/amplify-js/issues/10450)) ([16c535b](https://github.com/aws-amplify/amplify-js/commit/16c535beda9386a027c2805f29a359fbeb8bac15)), closes [#10449](https://github.com/aws-amplify/amplify-js/issues/10449) - - - - - -## [1.9.37](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.36...@aws-amplify/ui-components@1.9.37) (2022-10-14) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.36](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.35...@aws-amplify/ui-components@1.9.36) (2022-10-14) - - -### Bug Fixes - -* **@aws-amplify/datastore:** introduce "settlement" guarantees to stop() and clear() ([#10055](https://github.com/aws-amplify/amplify-js/issues/10055)) ([c64d7d6](https://github.com/aws-amplify/amplify-js/commit/c64d7d6284bc7b41a5a65b4b47d35ea274aed6b3)) - - -### Reverts - -* "fix(@aws-amplify/datastore): introduce "settlement" guarantees to stop() and clear()" ([#10449](https://github.com/aws-amplify/amplify-js/issues/10449)) ([d726bcc](https://github.com/aws-amplify/amplify-js/commit/d726bccca9712b8f43bc273052f970f8f931dd8c)), closes [aws-amplify/amplify-js#10055](https://github.com/aws-amplify/amplify-js/issues/10055) - - - - - -## [1.9.35](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.33...@aws-amplify/ui-components@1.9.35) (2022-09-30) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.34](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.33...@aws-amplify/ui-components@1.9.34) (2022-09-20) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.33](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.32...@aws-amplify/ui-components@1.9.33) (2022-09-08) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.32](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.31...@aws-amplify/ui-components@1.9.32) (2022-09-01) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.31](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.30...@aws-amplify/ui-components@1.9.31) (2022-08-23) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.30](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.29...@aws-amplify/ui-components@1.9.30) (2022-08-18) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.29](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.28...@aws-amplify/ui-components@1.9.29) (2022-08-16) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.28](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.27...@aws-amplify/ui-components@1.9.28) (2022-08-01) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.27](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.26...@aws-amplify/ui-components@1.9.27) (2022-07-28) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.26](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.25...@aws-amplify/ui-components@1.9.26) (2022-07-21) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.25](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.24...@aws-amplify/ui-components@1.9.25) (2022-07-07) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.24](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.23...@aws-amplify/ui-components@1.9.24) (2022-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.23](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.22...@aws-amplify/ui-components@1.9.23) (2022-06-15) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.22](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.21...@aws-amplify/ui-components@1.9.22) (2022-05-24) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.21](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.20...@aws-amplify/ui-components@1.9.21) (2022-05-23) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.20](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.19...@aws-amplify/ui-components@1.9.20) (2022-05-12) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.19](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.18...@aws-amplify/ui-components@1.9.19) (2022-05-03) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.18](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.17...@aws-amplify/ui-components@1.9.18) (2022-04-14) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.17](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.16...@aws-amplify/ui-components@1.9.17) (2022-04-04) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.16](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.15...@aws-amplify/ui-components@1.9.16) (2022-03-28) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.14...@aws-amplify/ui-components@1.9.15) (2022-03-22) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.13...@aws-amplify/ui-components@1.9.14) (2022-03-10) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.12...@aws-amplify/ui-components@1.9.13) (2022-02-28) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.11...@aws-amplify/ui-components@1.9.12) (2022-02-03) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.10...@aws-amplify/ui-components@1.9.11) (2022-01-27) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.9...@aws-amplify/ui-components@1.9.10) (2022-01-07) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.8...@aws-amplify/ui-components@1.9.9) (2021-12-16) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.7...@aws-amplify/ui-components@1.9.8) (2021-12-03) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.6...@aws-amplify/ui-components@1.9.7) (2021-12-02) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.5...@aws-amplify/ui-components@1.9.6) (2021-11-18) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.4...@aws-amplify/ui-components@1.9.5) (2021-11-16) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.3...@aws-amplify/ui-components@1.9.4) (2021-11-12) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.2...@aws-amplify/ui-components@1.9.3) (2021-11-09) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.1...@aws-amplify/ui-components@1.9.2) (2021-10-28) - -**Note:** Version bump only for package @aws-amplify/ui-components - - - - - -## [1.9.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.9.0...@aws-amplify/ui-components@1.9.1) (2021-10-21) - -**Note:** Version bump only for package @aws-amplify/ui-components - -# [1.9.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.8.2...@aws-amplify/ui-components@1.9.0) (2021-10-07) - -### Features - -- adding translation for skip text ([#8993](https://github.com/aws-amplify/amplify-js/issues/8993)) ([3402060](https://github.com/aws-amplify/amplify-js/commit/3402060a040c89ef90199f61d1eae77b0a2830c1)) - -## [1.8.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.8.1...@aws-amplify/ui-components@1.8.2) (2021-09-30) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.8.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.8.0...@aws-amplify/ui-components@1.8.1) (2021-09-24) - -**Note:** Version bump only for package @aws-amplify/ui-components - -# [1.8.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.7.9...@aws-amplify/ui-components@1.8.0) (2021-09-22) - -### Features - -- **@aws-amplify/storage:** Storage category public API Typescript improvement ([1c3b281](https://github.com/aws-amplify/amplify-js/commit/1c3b281d564db8745d3085489643bb33ac067177)) - -## [1.7.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.7.8...@aws-amplify/ui-components@1.7.9) (2021-09-17) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.7.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.7.7...@aws-amplify/ui-components@1.7.8) (2021-09-09) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.7.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.7.6...@aws-amplify/ui-components@1.7.7) (2021-09-07) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.7.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.7.5...@aws-amplify/ui-components@1.7.6) (2021-09-04) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.7.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.7.4...@aws-amplify/ui-components@1.7.5) (2021-09-02) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.7.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.7.3...@aws-amplify/ui-components@1.7.4) (2021-08-26) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.7.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.7.2...@aws-amplify/ui-components@1.7.3) (2021-08-19) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.7.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.7.1...@aws-amplify/ui-components@1.7.2) (2021-08-12) - -### Bug Fixes - -- **@aws-amplify/ui-components:** Remove local storage check ([#8730](https://github.com/aws-amplify/amplify-js/issues/8730)) ([fc7f8ab](https://github.com/aws-amplify/amplify-js/commit/fc7f8ab6c965b980b87d9a0d47583672813162bf)) - -## [1.7.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.7.0...@aws-amplify/ui-components@1.7.1) (2021-07-28) - -### Bug Fixes - -- **@aws-amplify/ui-components:** Empty `newFormfFields` array on rebuild ([#8633](https://github.com/aws-amplify/amplify-js/issues/8633)) ([908cd16](https://github.com/aws-amplify/amplify-js/commit/908cd166779fd40f09d8034c05c3bb2590ba3771)) - -# [1.7.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.6.2...@aws-amplify/ui-components@1.7.0) (2021-07-22) - -### Features - -- **@aws-amplify/ui-components:** Let `amplify-totp-setup` work outside authenticator ([#8592](https://github.com/aws-amplify/amplify-js/issues/8592)) ([cb0e3d4](https://github.com/aws-amplify/amplify-js/commit/cb0e3d46791fc1da6e5b7810f3d6c37db9688355)) - -## [1.6.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.6.1...@aws-amplify/ui-components@1.6.2) (2021-07-16) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.6.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.6.0...@aws-amplify/ui-components@1.6.1) (2021-07-08) - -**Note:** Version bump only for package @aws-amplify/ui-components - -# [1.6.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.5.0...@aws-amplify/ui-components@1.6.0) (2021-06-24) - -### Bug Fixes - -- **@aws-amplify/ui-components:** Handle loading in signUp & confirmSignup ([#7189](https://github.com/aws-amplify/amplify-js/issues/7189)) ([988a29b](https://github.com/aws-amplify/amplify-js/commit/988a29bb48a632ab46b6a63878c33a27a5554a30)), closes [#7032](https://github.com/aws-amplify/amplify-js/issues/7032) -- **@aws-amplify/ui-components:** including handleInputChange in amplify-confirm-sign-in fields only when not specified ([#8492](https://github.com/aws-amplify/amplify-js/issues/8492)) ([06d0d13](https://github.com/aws-amplify/amplify-js/commit/06d0d13057e5885806dbf4715321dcc1700bfe5e)), closes [#8255](https://github.com/aws-amplify/amplify-js/issues/8255) [/github.com/aws-amplify/amplify-js/pull/8255#issuecomment-866642875](https://github.com//github.com/aws-amplify/amplify-js/pull/8255/issues/issuecomment-866642875) - -### Features - -- **@aws-amplify/ui-components:** Trim inputs before submit [#7408](https://github.com/aws-amplify/amplify-js/issues/7408) ([#8468](https://github.com/aws-amplify/amplify-js/issues/8468)) ([05a5481](https://github.com/aws-amplify/amplify-js/commit/05a5481109167bca892c8ac0fc6155bda9d1edbb)) -- add handleSignUp prop to override auth signup method ([#8474](https://github.com/aws-amplify/amplify-js/issues/8474)) ([a5f2466](https://github.com/aws-amplify/amplify-js/commit/a5f2466454f0cc1e0223fb03e78142209cf1f033)) - -# [1.5.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.4.0...@aws-amplify/ui-components@1.5.0) (2021-06-18) - -### Bug Fixes - -- fix bug where required fields were not being enforced ([#8455](https://github.com/aws-amplify/amplify-js/issues/8455)) ([e8f9e5a](https://github.com/aws-amplify/amplify-js/commit/e8f9e5a9d754853b29e7bf9789973b055a517bbc)) - -### Features - -- adding border radius to amplify-button ([#8465](https://github.com/aws-amplify/amplify-js/issues/8465)) ([9549090](https://github.com/aws-amplify/amplify-js/commit/9549090ff534edc8e9df448a60848ed9d20083a6)) -- adding hint text props to our auth form field mappings ([a22ac3a](https://github.com/aws-amplify/amplify-js/commit/a22ac3aa108dd35f4230f1741afb33aa83edd5fb)) -- make sign in button full width if not sign up button present ([#8447](https://github.com/aws-amplify/amplify-js/issues/8447)) ([d333997](https://github.com/aws-amplify/amplify-js/commit/d3339978e2f4d4eef41ae0bb80daef5ee7ce0791)) - -# [1.4.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.3.2...@aws-amplify/ui-components@1.4.0) (2021-06-10) - -### Bug Fixes - -- **@aws-amplify/ui-components:** handle custom formFields in amplify-confirm-sign-in fields ([#8255](https://github.com/aws-amplify/amplify-js/issues/8255)) ([07e91fb](https://github.com/aws-amplify/amplify-js/commit/07e91fb3900ccc27e2cc750db000447df11a98cd)) -- **@aws-amplify/ui-components:** Place `formField` comment right above the variable ([#8348](https://github.com/aws-amplify/amplify-js/issues/8348)) ([56deb45](https://github.com/aws-amplify/amplify-js/commit/56deb453a2b31ac8c7f53741507dca7df8ef7fa8)) -- **@aws-amplify/ui-components:** remove hostedui check ([#8357](https://github.com/aws-amplify/amplify-js/issues/8357)) ([94f25ec](https://github.com/aws-amplify/amplify-js/commit/94f25ec91af020dd72e17e9a9e52a1822923e93a)) - -### Features - -- adding toast notification when selecting an MFA type ([#8394](https://github.com/aws-amplify/amplify-js/issues/8394)) ([4d39773](https://github.com/aws-amplify/amplify-js/commit/4d39773b0c174538d0d7c1b770bc276700bcf953)) - -## [1.3.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.3.1...@aws-amplify/ui-components@1.3.2) (2021-05-26) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.3.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.3.0...@aws-amplify/ui-components@1.3.1) (2021-05-14) - -### Bug Fixes - -- **@aws-amplify/ui-components:** Prioritize using `user.username` whenever provided ([#8050](https://github.com/aws-amplify/amplify-js/issues/8050)) ([c48ad83](https://github.com/aws-amplify/amplify-js/commit/c48ad83beaac019281b735fc54d7a98b0a1a4d2e)) - -# [1.3.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.2.0...@aws-amplify/ui-components@1.3.0) (2021-05-06) - -### Bug Fixes - -- **@aws-amplify/ui-components:** Add empty function as the default input handler for sigin form ([#8192](https://github.com/aws-amplify/amplify-js/issues/8192)) ([0d94c97](https://github.com/aws-amplify/amplify-js/commit/0d94c972a1b3d63dd224adffe2f4c7f5ffa73d1a)) -- **@aws-amplify/ui-components:** Get autofill data on `componentDidLoad` ([#8194](https://github.com/aws-amplify/amplify-js/issues/8194)) ([14db4a0](https://github.com/aws-amplify/amplify-js/commit/14db4a0dd99694823b4fe8c94c4df92a4329178c)) -- **@aws-amplify/ui-components:** use correct unmount lifecycle for authenticator ([#8227](https://github.com/aws-amplify/amplify-js/issues/8227)) ([9314112](https://github.com/aws-amplify/amplify-js/commit/9314112a4522b31cb24e523cfa5d3de4b06c8c8b)) - -### Features - -- **@aws-amplify/ui-components:** partial shadow DOM removal + pw manager workaround ([#8181](https://github.com/aws-amplify/amplify-js/issues/8181)) ([721596f](https://github.com/aws-amplify/amplify-js/commit/721596fc7e22fa86512ba9fa7ea5d83652ada4eb)) - -# [1.2.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.1.1...@aws-amplify/ui-components@1.2.0) (2021-04-15) - -### Bug Fixes - -- **@aws-amplify/ui-components:** fix required attributes translations in require new password component ([#7998](https://github.com/aws-amplify/amplify-js/issues/7998)) ([1f25f23](https://github.com/aws-amplify/amplify-js/commit/1f25f238ef5efe66e714e59042d58fd2a5334534)) - -### Features - -- **@aws-amplify/ui-components:** AmplifyAuthFields accept type for default fields ([#6690](https://github.com/aws-amplify/amplify-js/issues/6690)) ([c4ccc17](https://github.com/aws-amplify/amplify-js/commit/c4ccc17db78521d8650fe91fc77587d9ddfbe162)) - -## [1.1.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.1.0...@aws-amplify/ui-components@1.1.1) (2021-03-25) - -### Bug Fixes - -- **@aws-amplify/ui-components:** update required attributes given name placeholder ([#7961](https://github.com/aws-amplify/amplify-js/issues/7961)) ([dd98afb](https://github.com/aws-amplify/amplify-js/commit/dd98afb272e0ffe39c1b9e6a9ca08e6b15ae53fb)) - -# [1.1.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.0.4...@aws-amplify/ui-components@1.1.0) (2021-03-12) - -### Features - -- **@aws-amplify/ui-components:** add hideToast prop to authenticator ([#7129](https://github.com/aws-amplify/amplify-js/issues/7129)) ([bf2f048](https://github.com/aws-amplify/amplify-js/commit/bf2f04888ea7e1e5364e1f669bb2847040fde684)) - -## [1.0.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.0.3...@aws-amplify/ui-components@1.0.4) (2021-03-08) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.0.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.0.2...@aws-amplify/ui-components@1.0.3) (2021-02-25) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.0.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@1.0.1...@aws-amplify/ui-components@1.0.2) (2021-02-18) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [1.0.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.10.4...@aws-amplify/ui-components@1.0.1) (2021-02-15) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.10.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.10.3...@aws-amplify/ui-components@0.10.4) (2021-02-09) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.10.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.10.2...@aws-amplify/ui-components@0.10.3) (2021-02-03) - -### Bug Fixes - -- **@aws-amplify/ui-components:** handle non-username alias ([#7663](https://github.com/aws-amplify/amplify-js/issues/7663)) ([651c3b2](https://github.com/aws-amplify/amplify-js/commit/651c3b29f39dd5beb563b5084ff74f7cbcc94368)) - -## [0.10.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.10.1...@aws-amplify/ui-components@0.10.2) (2021-02-01) - -### Reverts - -- Revert "Test out explicit `bundles`" ([0a3cf4b](https://github.com/aws-amplify/amplify-js/commit/0a3cf4b5fcb25bee97a8fc744c87e61171b8fadb)) - -## [0.10.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.10.0...@aws-amplify/ui-components@0.10.1) (2021-01-29) - -### Bug Fixes - -- **@aws-amplify/ui-components:** exit early for invalid inputs ([#7543](https://github.com/aws-amplify/amplify-js/issues/7543)) ([760374e](https://github.com/aws-amplify/amplify-js/commit/760374ee94e740d8772db9913eebb5019d0d7c97)) -- **@aws-amplify/ui-components:** handle federated user in checkContact ([#7562](https://github.com/aws-amplify/amplify-js/issues/7562)) ([537c9c5](https://github.com/aws-amplify/amplify-js/commit/537c9c5e27372e02e220069456f6cabbc95e7fc8)) -- **@aws-amplify/ui-components:** handle slotted elements properly ([#7522](https://github.com/aws-amplify/amplify-js/issues/7522)) ([286c9e8](https://github.com/aws-amplify/amplify-js/commit/286c9e8fbec3ccdc5bf24edf3cbfb2bae370d751)) -- **@aws-amplify/ui-components:** revise word mfa=> MFA ([#7359](https://github.com/aws-amplify/amplify-js/issues/7359)) ([843183b](https://github.com/aws-amplify/amplify-js/commit/843183b094281b42ec829b010dd41d214899c23d)) - -# [0.10.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.9.8...@aws-amplify/ui-components@0.10.0) (2021-01-07) - -### Bug Fixes - -- **@aws-amplify/ui-components:** display spinner during submission of sign-up and confirm-sign-up form ([#7436](https://github.com/aws-amplify/amplify-js/issues/7436)) ([2a53bef](https://github.com/aws-amplify/amplify-js/commit/2a53beff4ffbeeb9857dd8c144fcf950ba09f7e8)) -- **@aws-amplify/ui-components:** fix typo ([#7485](https://github.com/aws-amplify/amplify-js/issues/7485)) ([9baa022](https://github.com/aws-amplify/amplify-js/commit/9baa02212d4e99f723e431f54e857dd0523dfe84)) -- watch for user prop update ([#7442](https://github.com/aws-amplify/amplify-js/issues/7442)) ([06bfecb](https://github.com/aws-amplify/amplify-js/commit/06bfecbd32751dee61d5abb6d5be9430ecaeca5a)) - -### Features - -- **@aws-amplify/ui-components:** Trim inputs before submit ([#7408](https://github.com/aws-amplify/amplify-js/issues/7408)) ([b5de2c9](https://github.com/aws-amplify/amplify-js/commit/b5de2c99a6aafbafe961849c8066631c2a03151a)) - -## [0.9.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.9.7...@aws-amplify/ui-components@0.9.8) (2020-12-17) - -### Bug Fixes - -- **@aws-amplify/ui-components:** display friendly error for empty password ([#7401](https://github.com/aws-amplify/amplify-js/issues/7401)) ([72997e8](https://github.com/aws-amplify/amplify-js/commit/72997e863f0e508904a2ea9ee485e75359e3fed7)) -- **@aws-amplify/ui-components:** fixes typo Ancilliary => Ancillary ([#7355](https://github.com/aws-amplify/amplify-js/issues/7355)) ([547d88b](https://github.com/aws-amplify/amplify-js/commit/547d88b61c240c2418fc815c902670f52b386c1d)) -- **@aws-amplify/ui-componets:** Use constant for empty password error ([#7403](https://github.com/aws-amplify/amplify-js/issues/7403)) ([1ee7ebc](https://github.com/aws-amplify/amplify-js/commit/1ee7ebcce75fd2076fa69c970e5a0c538a16e737)) - -## [0.9.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.9.6...@aws-amplify/ui-components@0.9.7) (2020-12-10) - -### Bug Fixes - -- **@aws-amplify/ui-components:** flatten `injectGlobalPaths` array ([ccd7c2e](https://github.com/aws-amplify/amplify-js/commit/ccd7c2e5c8320fac0e01d59a509c7c9a08f65b9f)) - -## [0.9.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.9.5...@aws-amplify/ui-components@0.9.6) (2020-11-30) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.9.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.9.4...@aws-amplify/ui-components@0.9.5) (2020-11-23) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.9.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.9.3...@aws-amplify/ui-components@0.9.4) (2020-11-20) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.9.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.9.2...@aws-amplify/ui-components@0.9.3) (2020-11-13) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.9.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.9.1...@aws-amplify/ui-components@0.9.2) (2020-11-03) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.9.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.9.0...@aws-amplify/ui-components@0.9.1) (2020-10-31) - -### Bug Fixes - -- **@aws-amplify/ui-components:** center amplify-authenticator ([#7041](https://github.com/aws-amplify/amplify-js/issues/7041)) ([f9f7c2d](https://github.com/aws-amplify/amplify-js/commit/f9f7c2d0fd363c1a26dbb580f36e73bb6bb166fe)) - -# [0.9.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.8.7...@aws-amplify/ui-components@0.9.0) (2020-10-29) - -### Features - -- **@aws-amplify/ui-components:** auto-document slots and css variables ([#6914](https://github.com/aws-amplify/amplify-js/issues/6914)) ([5b00c91](https://github.com/aws-amplify/amplify-js/commit/5b00c9143f8250d9d64d7e1cb14a4f1c2a93d166)) - -## [0.8.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.8.6...@aws-amplify/ui-components@0.8.7) (2020-10-15) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.8.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.8.5...@aws-amplify/ui-components@0.8.6) (2020-10-01) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.8.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.8.4...@aws-amplify/ui-components@0.8.5) (2020-09-25) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.8.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.8.3...@aws-amplify/ui-components@0.8.4) (2020-09-16) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.8.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.8.2...@aws-amplify/ui-components@0.8.3) (2020-09-15) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.8.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.8.1...@aws-amplify/ui-components@0.8.2) (2020-09-10) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.8.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.8.0...@aws-amplify/ui-components@0.8.1) (2020-09-03) - -**Note:** Version bump only for package @aws-amplify/ui-components - -# [0.8.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.7.0...@aws-amplify/ui-components@0.8.0) (2020-09-03) - -### Features - -- **SSR:** withSSRContext ([#6146](https://github.com/aws-amplify/amplify-js/issues/6146)) ([1cb1afd](https://github.com/aws-amplify/amplify-js/commit/1cb1afd1e56135908dceb2ef6403f0b3e78067fe)) - -# [0.7.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.6.2...@aws-amplify/ui-components@0.7.0) (2020-09-01) - -### Features - -- **@aws-amplify/ui-components:** Add Chatbot UI to main ([#6684](https://github.com/aws-amplify/amplify-js/issues/6684)) ([4e25f92](https://github.com/aws-amplify/amplify-js/commit/4e25f923723441c6fb705584fcc3349214806558)), closes [#5024](https://github.com/aws-amplify/amplify-js/issues/5024) [#6648](https://github.com/aws-amplify/amplify-js/issues/6648) [#6652](https://github.com/aws-amplify/amplify-js/issues/6652) [#6678](https://github.com/aws-amplify/amplify-js/issues/6678) - -## [0.6.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.6.1...@aws-amplify/ui-components@0.6.2) (2020-08-19) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.6.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.6.0...@aws-amplify/ui-components@0.6.1) (2020-08-06) - -**Note:** Version bump only for package @aws-amplify/ui-components - -# [0.6.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.5.5...@aws-amplify/ui-components@0.6.0) (2020-07-27) - -### Features - -- add branding prop for customise QR branding ([#6333](https://github.com/aws-amplify/amplify-js/issues/6333)) ([28efe52](https://github.com/aws-amplify/amplify-js/commit/28efe520ec6e6f2f8518ab7ce7b1d9a0c00534ad)) - -## [0.5.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.5.4...@aws-amplify/ui-components@0.5.5) (2020-07-22) - -### Bug Fixes - -- **aws-amplify-react-native:** Update authState after a successful Auth.signIn call ([#6276](https://github.com/aws-amplify/amplify-js/issues/6276)) ([e79a805](https://github.com/aws-amplify/amplify-js/commit/e79a805534c25dcd52ea4e55ef8b4fbd0f5dce36)) - -## [0.5.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.5.3...@aws-amplify/ui-components@0.5.4) (2020-07-09) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.5.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.5.2...@aws-amplify/ui-components@0.5.3) (2020-07-07) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.5.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.5.1...@aws-amplify/ui-components@0.5.2) (2020-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.5.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.5.0...@aws-amplify/ui-components@0.5.1) (2020-06-02) - -**Note:** Version bump only for package @aws-amplify/ui-components - -# [0.5.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.4.1...@aws-amplify/ui-components@0.5.0) (2020-05-22) - -### Features - -- **@aws-amplify/ui-react:** Export more types ([#5792](https://github.com/aws-amplify/amplify-js/issues/5792)) ([e8b63af](https://github.com/aws-amplify/amplify-js/commit/e8b63af76498ff88c0c2be43024487adaef6fe42)) - -## [0.4.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.4.0...@aws-amplify/ui-components@0.4.1) (2020-05-14) - -### Bug Fixes - -- **@aws-amplify/ui-components:** keypress on form ([#5586](https://github.com/aws-amplify/amplify-js/issues/5586)) ([0f17ddd](https://github.com/aws-amplify/amplify-js/commit/0f17ddd4052d329c40efa1d1ea4ac2b9c82fb0f9)) -- **@aws-amplify/ui-components:** amplify-container component, use dispatch auth event on check user ([#5727](https://github.com/aws-amplify/amplify-js/issues/5727)) ([31709c0](https://github.com/aws-amplify/amplify-js/commit/31709c0a75f11e085f7fd8729653451d9cc9d488)) -- **@aws-amplify/ui-components:** Check for 'amplify-redirected-from-hosted-ui' instead of 'amplify-signin-with-hostedUI' ([#5678](https://github.com/aws-amplify/amplify-js/issues/5678)) ([af7c9ef](https://github.com/aws-amplify/amplify-js/commit/af7c9ef10285bc682bee0e95532c829c72d0929d)), closes [#4258](https://github.com/aws-amplify/amplify-js/issues/4258) -- **@aws-amplify/ui-components:** formFields hint handle ([#5682](https://github.com/aws-amplify/amplify-js/issues/5682)) ([7ba5647](https://github.com/aws-amplify/amplify-js/commit/7ba56478f8da4ce538198615d73474da618c8b31)) -- **@aws-amplify/ui-components:** Styling fixes ([#5725](https://github.com/aws-amplify/amplify-js/issues/5725)) ([4914145](https://github.com/aws-amplify/amplify-js/commit/491414523cf81d3fe07f4b86aaf5c0e3540be561)) -- **@aws-amplify/ui-components:** Watch for formFields changes ([#5691](https://github.com/aws-amplify/amplify-js/issues/5691)) ([b67c6d0](https://github.com/aws-amplify/amplify-js/commit/b67c6d0a78aead904c90ca930c245ffb15a51afd)) - -# [0.4.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.3.3...@aws-amplify/ui-components@0.4.0) (2020-04-30) - -### Features - -- **@aws-amplify/ui-components:** Open up slot for sign-in/up footer ([#5603](https://github.com/aws-amplify/amplify-js/issues/5603)) ([5ebdab7](https://github.com/aws-amplify/amplify-js/commit/5ebdab74e145c4de51d759d9f6dd536ccf6bd787)) - -## [0.3.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.3.2...@aws-amplify/ui-components@0.3.3) (2020-04-24) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.3.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.3.1...@aws-amplify/ui-components@0.3.2) (2020-04-08) - -**Note:** Version bump only for package @aws-amplify/ui-components - -## [0.3.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.3.0...@aws-amplify/ui-components@0.3.1) (2020-04-07) - -**Note:** Version bump only for package @aws-amplify/ui-components - -# [0.3.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.1.0...@aws-amplify/ui-components@0.3.0) (2020-04-02) - -### Bug Fixes - -- **@aws-amplify/ui-components:** federated button styling ([#4945](https://github.com/aws-amplify/amplify-js/issues/4945)) ([f42ceb7](https://github.com/aws-amplify/amplify-js/commit/f42ceb7081bb433de67e7e6defc40598150bcb0c)) -- **@aws-amplify/ui-components:** Fix shadow dom form submit ([#5160](https://github.com/aws-amplify/amplify-js/issues/5160)) ([766c5ac](https://github.com/aws-amplify/amplify-js/commit/766c5ac5bdcf22f772340f78f5d45790f3142b71)) -- **@aws-amplify/ui-components:** Listen to auth channel for man… ([#5244](https://github.com/aws-amplify/amplify-js/issues/5244)) ([8cfcd02](https://github.com/aws-amplify/amplify-js/commit/8cfcd02e20aa0ae3037c97b363feff7c5bae7c37)) -- **@aws-amplify/ui-components:** Move Auth & Core to externals ([#4767](https://github.com/aws-amplify/amplify-js/issues/4767)) ([e0ec550](https://github.com/aws-amplify/amplify-js/commit/e0ec550dc500c76518426a70f2a79db74e35daf7)) -- **@aws-amplify/ui-components:** Remove when using scope… ([#4997](https://github.com/aws-amplify/amplify-js/issues/4997)) ([6e3805b](https://github.com/aws-amplify/amplify-js/commit/6e3805b600a5c8dd4eb1c09f000a660504003e8c)) -- **@aws-amplify/ui-components:** SVG type fix ([#5152](https://github.com/aws-amplify/amplify-js/issues/5152)) ([8cb188b](https://github.com/aws-amplify/amplify-js/commit/8cb188b705b0d56f59fb1a5f43b04e79742e6bff)) - -### Features - -- **@aws-amplify/ui-components:** amplify-authenticator data-test attributes ([#4732](https://github.com/aws-amplify/amplify-js/issues/4732)) ([85a8994](https://github.com/aws-amplify/amplify-js/commit/85a8994a3bec287510de4b579afeec8c089bad05)) -- **@aws-amplify/ui-components:** amplify-loading-spinner, loading state, minor form input tweaks ([#4929](https://github.com/aws-amplify/amplify-js/issues/4929)) ([bd37a7c](https://github.com/aws-amplify/amplify-js/commit/bd37a7cff285e87f3098f9552a2c9025059a8b3b)) -- **@aws-amplify/ui-components:** amplify-toast component ([#4858](https://github.com/aws-amplify/amplify-js/issues/4858)) ([4008e25](https://github.com/aws-amplify/amplify-js/commit/4008e25b7b63bf7650c7ffb39c12fcc8c0b05fd2)) -- **@aws-amplify/ui-components:** Framework Bindings for Authen… ([#4676](https://github.com/aws-amplify/amplify-js/issues/4676)) ([407089f](https://github.com/aws-amplify/amplify-js/commit/407089fb4f93afc79ff77b4926e0285dff3ad335)), closes [/github.com/yarnpkg/yarn/issues/5225#issuecomment-490462853](https://github.com//github.com/yarnpkg/yarn/issues/5225/issues/issuecomment-490462853) [#4706](https://github.com/aws-amplify/amplify-js/issues/4706) -- **@aws-amplify/ui-components:** I18n Support ([#4979](https://github.com/aws-amplify/amplify-js/issues/4979)) ([6f3e37c](https://github.com/aws-amplify/amplify-js/commit/6f3e37cf1d764455475bc4aee689bd3fbe71dd3e)) -- **@aws-amplify/ui-components:** IE 11 Support ([#5089](https://github.com/aws-amplify/amplify-js/issues/5089)) ([6a4556f](https://github.com/aws-amplify/amplify-js/commit/6a4556f51b28c863182bd5ff549a5ff15b02a00f)) -- **@aws-amplify/ui-components:** Inject css variables for root theme ([#4842](https://github.com/aws-amplify/amplify-js/issues/4842)) ([3f72911](https://github.com/aws-amplify/amplify-js/commit/3f72911156ed9ff0dd46608fe3b0449c70f7cc87)) -- **@aws-amplify/ui-components:** Storybook ([#4973](https://github.com/aws-amplify/amplify-js/issues/4973)) ([bfbb46a](https://github.com/aws-amplify/amplify-js/commit/bfbb46af6be247a9aebd934e0f88227f621d7d8a)) -- **@aws-amplify/ui-components:** UI Components theming ([#4947](https://github.com/aws-amplify/amplify-js/issues/4947)) ([73ef849](https://github.com/aws-amplify/amplify-js/commit/73ef849cb6fde32a63d1ddef7a535d4ad02f98a5)) -- **@aws-amplify/ui-components:** Use Shadow DOM, use Sass css, authenticator slots ([#4872](https://github.com/aws-amplify/amplify-js/issues/4872)) ([538ca66](https://github.com/aws-amplify/amplify-js/commit/538ca667296568fc58d77ce5c45f201b59e085ea)) -- **@aws-amplify/ui-components:** User agent tracking for UI component packages ([#4804](https://github.com/aws-amplify/amplify-js/issues/4804)) ([15a0a2f](https://github.com/aws-amplify/amplify-js/commit/15a0a2fadeb96543721a6733faeb509efc26e1e2)) -- **@aws-amplify/ui-react:** withAuthenticator(Component[, props]) ([#5204](https://github.com/aws-amplify/amplify-js/issues/5204)) ([39d84e7](https://github.com/aws-amplify/amplify-js/commit/39d84e713dcbb1569877b299f251071fe1ceb3b1)) -- **@ui-components/ui-components:** node resolve browser: true ([#5151](https://github.com/aws-amplify/amplify-js/issues/5151)) ([bfe916c](https://github.com/aws-amplify/amplify-js/commit/bfe916c5dc70b63f6ba043a79f2722096b3acf86)) -- **@ui-components/username-attributes:** Add usernameAlias support ([#5065](https://github.com/aws-amplify/amplify-js/issues/5065)) ([3a5322a](https://github.com/aws-amplify/amplify-js/commit/3a5322afecd47737be385c441091ed0fdb1db05d)) - -# [0.2.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.1.0...@aws-amplify/ui-components@0.2.0) (2020-03-31) - -### Bug Fixes - -- **@aws-amplify/ui-components:** federated button styling ([#4945](https://github.com/aws-amplify/amplify-js/issues/4945)) ([f42ceb7](https://github.com/aws-amplify/amplify-js/commit/f42ceb7081bb433de67e7e6defc40598150bcb0c)) -- **@aws-amplify/ui-components:** Fix shadow dom form submit ([#5160](https://github.com/aws-amplify/amplify-js/issues/5160)) ([766c5ac](https://github.com/aws-amplify/amplify-js/commit/766c5ac5bdcf22f772340f78f5d45790f3142b71)) -- **@aws-amplify/ui-components:** Move Auth & Core to externals ([#4767](https://github.com/aws-amplify/amplify-js/issues/4767)) ([e0ec550](https://github.com/aws-amplify/amplify-js/commit/e0ec550dc500c76518426a70f2a79db74e35daf7)) -- **@aws-amplify/ui-components:** Remove when using scope… ([#4997](https://github.com/aws-amplify/amplify-js/issues/4997)) ([6e3805b](https://github.com/aws-amplify/amplify-js/commit/6e3805b600a5c8dd4eb1c09f000a660504003e8c)) -- **@aws-amplify/ui-components:** SVG type fix ([#5152](https://github.com/aws-amplify/amplify-js/issues/5152)) ([8cb188b](https://github.com/aws-amplify/amplify-js/commit/8cb188b705b0d56f59fb1a5f43b04e79742e6bff)) - -### Features - -- **@aws-amplify/ui-components:** amplify-authenticator data-test attributes ([#4732](https://github.com/aws-amplify/amplify-js/issues/4732)) ([85a8994](https://github.com/aws-amplify/amplify-js/commit/85a8994a3bec287510de4b579afeec8c089bad05)) -- **@aws-amplify/ui-components:** amplify-loading-spinner, loading state, minor form input tweaks ([#4929](https://github.com/aws-amplify/amplify-js/issues/4929)) ([bd37a7c](https://github.com/aws-amplify/amplify-js/commit/bd37a7cff285e87f3098f9552a2c9025059a8b3b)) -- **@aws-amplify/ui-components:** amplify-toast component ([#4858](https://github.com/aws-amplify/amplify-js/issues/4858)) ([4008e25](https://github.com/aws-amplify/amplify-js/commit/4008e25b7b63bf7650c7ffb39c12fcc8c0b05fd2)) -- **@aws-amplify/ui-components:** Framework Bindings for Authen… ([#4676](https://github.com/aws-amplify/amplify-js/issues/4676)) ([407089f](https://github.com/aws-amplify/amplify-js/commit/407089fb4f93afc79ff77b4926e0285dff3ad335)), closes [/github.com/yarnpkg/yarn/issues/5225#issuecomment-490462853](https://github.com//github.com/yarnpkg/yarn/issues/5225/issues/issuecomment-490462853) [#4706](https://github.com/aws-amplify/amplify-js/issues/4706) -- **@aws-amplify/ui-components:** I18n Support ([#4979](https://github.com/aws-amplify/amplify-js/issues/4979)) ([6f3e37c](https://github.com/aws-amplify/amplify-js/commit/6f3e37cf1d764455475bc4aee689bd3fbe71dd3e)) -- **@aws-amplify/ui-components:** IE 11 Support ([#5089](https://github.com/aws-amplify/amplify-js/issues/5089)) ([6a4556f](https://github.com/aws-amplify/amplify-js/commit/6a4556f51b28c863182bd5ff549a5ff15b02a00f)) -- **@aws-amplify/ui-components:** Inject css variables for root theme ([#4842](https://github.com/aws-amplify/amplify-js/issues/4842)) ([3f72911](https://github.com/aws-amplify/amplify-js/commit/3f72911156ed9ff0dd46608fe3b0449c70f7cc87)) -- **@aws-amplify/ui-components:** Storybook ([#4973](https://github.com/aws-amplify/amplify-js/issues/4973)) ([bfbb46a](https://github.com/aws-amplify/amplify-js/commit/bfbb46af6be247a9aebd934e0f88227f621d7d8a)) -- **@aws-amplify/ui-components:** UI Components theming ([#4947](https://github.com/aws-amplify/amplify-js/issues/4947)) ([73ef849](https://github.com/aws-amplify/amplify-js/commit/73ef849cb6fde32a63d1ddef7a535d4ad02f98a5)) -- **@aws-amplify/ui-components:** Use Shadow DOM, use Sass css, authenticator slots ([#4872](https://github.com/aws-amplify/amplify-js/issues/4872)) ([538ca66](https://github.com/aws-amplify/amplify-js/commit/538ca667296568fc58d77ce5c45f201b59e085ea)) -- **@aws-amplify/ui-components:** User agent tracking for UI component packages ([#4804](https://github.com/aws-amplify/amplify-js/issues/4804)) ([15a0a2f](https://github.com/aws-amplify/amplify-js/commit/15a0a2fadeb96543721a6733faeb509efc26e1e2)) -- **@aws-amplify/ui-react:** withAuthenticator(Component[, props]) ([#5204](https://github.com/aws-amplify/amplify-js/issues/5204)) ([39d84e7](https://github.com/aws-amplify/amplify-js/commit/39d84e713dcbb1569877b299f251071fe1ceb3b1)) -- **@ui-components/ui-components:** node resolve browser: true ([#5151](https://github.com/aws-amplify/amplify-js/issues/5151)) ([bfe916c](https://github.com/aws-amplify/amplify-js/commit/bfe916c5dc70b63f6ba043a79f2722096b3acf86)) -- **@ui-components/username-attributes:** Add usernameAlias support ([#5065](https://github.com/aws-amplify/amplify-js/issues/5065)) ([3a5322a](https://github.com/aws-amplify/amplify-js/commit/3a5322afecd47737be385c441091ed0fdb1db05d)) - -# 0.1.0 (2020-01-10) - -### Features - -- **@aws-amplify/ui-components:** amplify-auth0-button ([#4559](https://github.com/aws-amplify/amplify-js/issues/4559)) ([4e9f5ad](https://github.com/aws-amplify/amplify-js/commit/4e9f5ad8760db472f06e9c7389197ab9a8702de2)) -- **@aws-amplify/ui-components:** amplify-greetings/amplify-nav ([#4412](https://github.com/aws-amplify/amplify-js/issues/4412)) ([58e26c9](https://github.com/aws-amplify/amplify-js/commit/58e26c9c4f741d4421d02573f22eecadcea94c74)) -- **@aws-amplify/ui-components:** amplify-require-new-password component ([#4421](https://github.com/aws-amplify/amplify-js/issues/4421)) ([076788f](https://github.com/aws-amplify/amplify-js/commit/076788f7427bd63d07e4eaf52a20763ad68a8f04)) -- (@aws-amplify/ui-components) Toast Component ([#4596](https://github.com/aws-amplify/amplify-js/issues/4596)) ([aa9799e](https://github.com/aws-amplify/amplify-js/commit/aa9799e650124e93de14ab0b264fca1d47593827)) -- (@aws-amplify/ui-components) TOTP / Select MFA Type Components ([#4548](https://github.com/aws-amplify/amplify-js/issues/4548)) ([dc5755e](https://github.com/aws-amplify/amplify-js/commit/dc5755eb6565277745b604f00c20673cba006bf7)) -- Add country dial code component with select comp base ([#3999](https://github.com/aws-amplify/amplify-js/issues/3999)) ([d7ef678](https://github.com/aws-amplify/amplify-js/commit/d7ef678725d4174e6f361fbe6c27621dbd4a4b78)) -- Sign-In Component (WC/UI) ([#4026](https://github.com/aws-amplify/amplify-js/issues/4026)) ([d5f3d17](https://github.com/aws-amplify/amplify-js/commit/d5f3d1779b4f34ef9b30dda23759f1a6ef66719c)) -- **@aws-amplify/ui-components:** amplify-verify-contact ([#4583](https://github.com/aws-amplify/amplify-js/issues/4583)) ([228f056](https://github.com/aws-amplify/amplify-js/commit/228f056586e02cef7f7a44be1e9d854b831ca01b)) diff --git a/packages/amplify-ui-components/LICENSE b/packages/amplify-ui-components/LICENSE deleted file mode 100644 index 00acba9b711..00000000000 --- a/packages/amplify-ui-components/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 2017 - 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - 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. \ No newline at end of file diff --git a/packages/amplify-ui-components/Readme.md b/packages/amplify-ui-components/Readme.md deleted file mode 100644 index 91d1d244eee..00000000000 --- a/packages/amplify-ui-components/Readme.md +++ /dev/null @@ -1,542 +0,0 @@ -# Amplify UI Components - -[Amplify UI Components](#) is an open-source UI component library that encapsulates cloud-connected workflows inside of framework-agnostic UI components. - -## Frameworks - -| Framework | Package | Version | READMEs | Quick Start | -| ------------------ | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------: | ----------------------------------- | -| **React** | [`@aws-amplify/ui-react`](https://www.npmjs.com/package/@aws-amplify/ui-react) | [![version](https://img.shields.io/npm/v/@aws-amplify/ui-react/latest.svg)](https://www.npmjs.com/package/@aws-amplify/ui-react) | [`README.md`](../amplify-ui-react/README.md) | [`React`](#react) | -| **Angular** | [`@aws-amplify/ui-angular`](https://www.npmjs.com/package/@aws-amplify/ui-angular) | [![version](https://img.shields.io/npm/v/@aws-amplify/ui-angular/latest.svg)](https://www.npmjs.com/package/@aws-amplify/ui-angular) | [`README.md`](../amplify-ui-angular/README.md) | [`Angular`](#angular) | -| **Vue** | [`@aws-amplify/ui-vue`](https://www.npmjs.com/package/@aws-amplify/ui-vue) | [![version](https://img.shields.io/npm/v/@aws-amplify/ui-vue/latest.svg)](https://www.npmjs.com/package/@aws-amplify/ui-vue) | [`README.md`](../amplify-ui-vue/README.md) | [`Vue`](#vue) | -| **Web Components** | [`@aws-amplify/ui-components`](https://www.npmjs.com/package/@aws-amplify/ui-components) | [![version](https://img.shields.io/npm/v/@aws-amplify/ui-components/latest.svg)](https://www.npmjs.com/package/@aws-amplify/ui-components) | [`README.md`](README.md) | [`Web Components`](#web-components) | - -## Quick Start - -In this Quick Start guide you will set up an Authenticator component and the cloud resources required to use it inside of your app. - -**Prerequisites** - -- Follow [Get Started](https://aws-amplify.github.io/docs/) on Amplify Docs. -- Use [Amplify CLI](https://aws-amplify.github.io/docs/cli-toolchain/quickstart#auth-examples) to initialize your project set up Auth cloud resources. - -**Frameworks** - -- [React](#react) -- [Angular](#angular) -- [Vue](#vue) -- [Web Components](#web-components) - -#### React - -##### Installation - -``` -yarn add aws-amplify @aws-amplify/ui-react -``` - -##### Usage - -```js -import React from 'react'; -import Amplify from 'aws-amplify'; -import { AmplifyAuthenticator, AmplifySignOut } from '@aws-amplify/ui-react'; -import awsconfig from './aws-exports'; - -Amplify.configure(awsconfig); - -const App = () => { - -
- My App - -
-
; -}; -``` - -#### Angular - -##### Installation - -``` -yarn add aws-amplify @aws-amplify/ui-angular -``` - -##### Usage - -_app.module.ts_ - -```js -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; -import { AppComponent } from './app.component'; - -import { AmplifyUIAngularModule } from '@aws-amplify/ui-angular'; -import Amplify from 'aws-amplify'; -import awsconfig from './aws-exports'; - -Amplify.configure(awsconfig); - -@NgModule({ - declarations: [AppComponent], - imports: [AmplifyUIAngularModule, BrowserModule], - providers: [], - bootstrap: [AppComponent], -}) -export class AppModule {} -``` - -_app.component.html_ - -```html - -
- My App - -
-
-``` - -#### Vue - -##### Installation - -``` -yarn add aws-amplify @aws-amplify/ui-vue -``` - -##### Usage - -_main.ts_ - -```js -import Vue from 'vue'; -import App from './App.vue'; -import '@aws-amplify/ui-vue'; -import Amplify from 'aws-amplify'; -import awsconfig from './aws-exports'; - -Amplify.configure(awsconfig); - -new Vue({ - render: h => h(App), -}).$mount('#app'); -``` - -_App.vue_ - -```html - -``` - -#### Web Components - -##### Installation - -``` -yarn add aws-amplify @aws-amplify/ui-components -``` - -##### Usage - -_app.js_ - -```js -import Amplify from 'aws-amplify'; -import awsconfig from './aws-exports'; -Amplify.configure(awsconfig); -import { - applyPolyfills, - defineCustomElements, -} from '@aws-amplify/ui-components/loader'; - -applyPolyfills().then(() => { - defineCustomElements(window); -}); -``` - -_index.html_ - -```html - - - - -
- My App - -
-
- - - - -``` - -## Components - -- #### [amplify-authenticator](src/components/amplify-authenticator/readme.md) - -amplify-authenticator - -- [amplify-sign-in](src/components/amplify-sign-in/readme.md) - -- [amplify-sign-up](src/components/amplify-sign-up/readme.md) - -- [amplify-sign-out](src/components/amplify-sign-out/readme.md) - -- [amplify-confirm-sign-up](src/components/amplify-confirm-sign-up/readme.md) - -- [amplify-forgot-password](src/components/amplify-forgot-password/readme.md) - -- [amplify-require-new-password](src/components/amplify-require-new-password/readme.md) - -- [amplify-verify-contact](src/components/amplify-verify-contact/readme.md) - -- [amplify-totp-setup](src/components/amplify-totp-setup/readme.md) - -- [amplify-greetings](src/components/amplify-greetings/readme.md) - -## Customization - -Amplify UI Components use [slots](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) to allow for component customization. Component customization and slot usage is exemplified below. - -### Amplify Authenticator - -**Slots** - -> You can override the [components listed above](#components) and pass them into these slots to preserve the authenticator state flow. - -| Name | Description | -| ------------------------ | ---------------------------------------------------------------------------------------------------------------------- | -| `"sign-in"` | Content placed inside of the sign in workflow for when a user wants to sign into their account | -| `"confirm-sign-in"` | Content placed inside of the confirm sign in workflow for when a user needs to confirm the account they signed in with | -| `"sign-up"` | Content placed inside of the sign up workflow for when a user wants to register a new account | -| `"confirm-sign-up"` | Content placed inside of the confirm sign up workflow for when a user needs to confirm the account they signed up with | -| `"forgot-password"` | Content placed inside of the forgot password workflow for when a user wants to reset their password | -| `"require-new-password"` | Content placed inside of the require new password workflow for when a user is required to update their password | -| `"verify-contact"` | Content placed inside of the verify-contact workflow for when a user must verify their contact information | -| `"totp-setup"` | Content placed inside of the totp-setup workflow for when a user opts to use TOTP MFA | -| `"greetings"` | Content placed inside of the greetings navigation for when a user is signed in | - -**Frameworks** - -- [React](#react-1) -- [Angular](#angular-1) -- [Vue](#vue-1) -- [Web Components](#web-components-1) - -#### React - -```js -import { - AmplifyAuthenticator, - AmplifySignIn, - AmplifySignUp, -} from '@aws-amplify/ui-react'; - -const App = () => { - - - - -
- My App - -
-
; -}; -``` - -Alternatively, you can use the `withAuthenticator` higher-order component (HoC): - -```js -import { withAuthenticator } from '@aws-amplify/ui-react'; - -... - -export default withAuthenticator(App); -// or -export default withAuthenticator(App, { /* ...amplifyAuthenticatorSettings */ }) -}); -``` - -#### Angular - -```html - - - - -
- My App - -
-
-``` - -#### Vue - -```html - - - - -
- My App - -
-
-``` - -#### Web Components - -```html - - - - -
- My App - -
-
-``` - -## Theming - -Theming for the UI components can be achieved by using [CSS Variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties). You can enable theming in your app by overriding the below mentioned CSS variable values. To do that, add the following code in root css file. - -``` -:root{ - - --amplify-primary-color: #ff6347; - --amplify-primary-tint: #ff7359; - --amplify-primary-shade: #e0573e; - - } - -``` - -### Supported CSS Custom properties - -#### For Typography - -| Custom Properties | Default Value | -| ----------------------- | -------------------------------------------------------------------------------------------- | -| `--amplify-font-family` | 'Amazon Ember', 'Helvetica Neue Light', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif' | -| `--amplify-text-xxs` | 0.75rem | -| `--amplify-text-xs` | 0.81rem | -| `--amplify-text-sm` | 0.875rem | -| `--amplify-text-md` | 1rem | -| `--amplify-text-lg` | 1.5rem | -| `--amplify-text-xl` | 2rem | -| `--amplify-text-xxl` | 2.5rem | - -#### For Colors - -| Custom Properties | Default Value | -| ------------------------------ | -------------------- | -| `--amplify-primary-color` | #ff9900 | -| `--amplify-primary-contrast` | var(--amplify-white) | -| `--amplify-primary-tint` | #ffac31 | -| `--amplify-primary-shade` | #e88b01 | -| `--amplify-secondary-color` | #152939 | -| `--amplify-secondary-contrast` | var(--amplify-white) | -| `--amplify-secondary-tint` | #31465f | -| `--amplify-secondary-shade` | #1F2A37 | -| `--amplify-tertiary-color` | #5d8aff | -| `--amplify-tertiary-contrast` | var(--amplify-white) | -| `--amplify-tertiary-tint` | #7da1ff | -| `--amplify-tertiary-shade` | #537BE5 | -| `--amplify-grey` | #828282 | -| `--amplify-light-grey` | #c4c4c4 | -| `--amplify-white` | #ffffff | -| `--amplify-red` | #dd3f5b | -| `--amplify-blue` | #099ac8 | - -## Amplify Authenticator `usernameAlias` - -The `amplify-authenticator` component has the ability to sign in or sign up with `email` or `phone_number` instead of default `username`. To achieve this, you first need to setup the userpool to allow email or phone number as the username [using the cli workflow](https://aws-amplify.github.io/docs/cli-toolchain/quickstart#configuring-auth-without-social-providers) or through the [Cognito Console](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#user-pool-settings-aliases-settings-option-2). To reflect this in the `amplify-authenticator` component, you can use the `usernameAlias` property. It can take one of the three values - `email`, `phone_number` or `username`. Default is set to `username`. - -**Usage:** - -```js -// react - - -// angular, vue or web components - -``` - -## Amplify Authenticator `federated` - -The `amplify-authenticator` component supports Federated Sign In through Cognito Identity Pools (IDP) with external providers like Amazon, Auth0, Facebook, & Google. - -The `federated` prop implements the `FederatedConfig`: - -```ts -export interface FederatedConfig { - auth0Config?: { - audience?: string; - clientID: string; - domain: string; - responseType: string; - redirectUri: string; - returnTo?: string; - scope?: string; - }; - amazonClientId?: string; - facebookAppId?: string; - googleClientId?: string; - oauthConfig?: { - [key: string]: any; - }; -} -``` - -**Usage:** - -```js -const federated = { - amazonClientId: "your_amazon_client_id", - facebookAppId: "your_facebook_app_id", - googleClientId: "your_google_client_id", - oauthConfig: { - redirectSignIn: "http://localhost:1234/", - redirectSignOut: "http://localhost:1234/", - } -} - -// react - - -// angular, vue, or web components - -``` - -## Migration Guide - -- [React](#react-2) -- [Angular](#angular-2) -- [Vue](#vue-2) -- [Web Components](#web-components-2) - -#### React - -##### Installation - -```diff -- yarn add aws-amplify-react -+ yarn add @aws-amplify/ui-react -``` - -##### Usage - -```diff -- import { Authenticator } from 'aws-amplify-react'; -+ import { AmplifyAuthenticator } from '@aws-amplify/ui-react'; - -const App = () => ( - -+ -- -
- My App -+ -
-+
; -- -); -``` - -If you're using the [`withAuthenticator`](https://aws-amplify.github.io/docs/js/authentication#using-withauthenticator-hoc) higher-order component (HoC): - -```diff -- import { withAuthenticator } from 'aws-amplify-react'; -+ import { withAuthenticator } from '@aws-amplify/ui-react'; - -... - -export default withAuthenticator(App); -``` - -**Note:** If you were providing additional options to `withAuthenticator` (e.g. `includeGreetings`, `authenticatorComponents`, `federated`, `theme`), these have changed: - -> [amplify-authenticator#properties](src/components/amplify-authenticator/readme.md#properties) - -#### Angular - -##### Installation - -```diff -- yarn add aws-amplify-angular -+ yarn add @aws-amplify/ui-angular -``` - -##### Usage - -_app.module.ts_ - -```diff -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; -import { AppComponent } from './app.component'; -- import { AmplifyAngularModule, AmplifyService } from 'aws-amplify-angular'; -+ import { AmplifyUIAngularModule } from '@aws-amplify/ui-angular'; -import Amplify from 'aws-amplify'; -import awsconfig from './aws-exports'; - -Amplify.configure(awsconfig); - -@NgModule({ - declarations: [AppComponent], -- imports: [AmplifyAngularModule, BrowserModule], -+ imports: [AmplifyUIAngularModule, BrowserModule], -- providers: [AmplifyService], -+ providers: [], - bootstrap: [AppComponent], -}) -export class AppModule {} -``` - -#### Vue - -##### Installation - -```diff -- yarn add aws-amplify-vue -+ yarn add @aws-amplify/ui-vue -``` - -##### Usage - -_main.ts_ - -```diff -import Vue from 'vue'; -import App from "./App.vue"; -- import Amplify, * as AmplifyModules from 'aws-amplify' -- import { AmplifyPlugin } from 'aws-amplify-vue' -+ import '@aws-amplify/ui-vue'; -+ import Amplify from 'aws-amplify'; -+ import awsconfig from './aws-exports'; - -Amplify.configure(awsconfig); - -new Vue({ - render: h => h(App), -}).$mount('#app'); -``` - ---- - -![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d&style=flat-square) diff --git a/packages/amplify-ui-components/loader/package.json b/packages/amplify-ui-components/loader/package.json deleted file mode 100644 index a8c1da26737..00000000000 --- a/packages/amplify-ui-components/loader/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "amplify-ui-components-loader", - "typings": "../dist/loader/index.d.ts", - "module": "../dist/loader/index.mjs", - "main": "../dist/loader/index.cjs.js", - "node:main": "../dist/loader/node-main.js", - "jsnext:main": "../dist/loader/index.es2017.mjs", - "es2015": "../dist/loader/index.es2017.mjs", - "es2017": "../dist/loader/index.es2017.mjs", - "unpkg": "../dist/loader/cdn.js" -} diff --git a/packages/amplify-ui-components/package.json b/packages/amplify-ui-components/package.json deleted file mode 100644 index d987d32aa73..00000000000 --- a/packages/amplify-ui-components/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "name": "@aws-amplify/ui-components", - "private": "true", - "version": "1.9.41", - "description": "Core Amplify UI Component Library", - "module": "dist/index.mjs", - "main": "dist/index.js", - "es2015": "dist/esm/index.mjs", - "es2017": "dist/esm/index.mjs", - "unpkg": "dist/amplify-ui-components/amplify-ui-components.js", - "types": "dist/types/index.d.ts", - "collection": "dist/collection/collection-manifest.json", - "files": [ - "dist/", - "loader" - ], - "publishConfig": { - "access": "public" - }, - "scripts": { - "lint": "eslint --ext .js,.ts,.tsx .", - "format": "eslint --fix --ext .js,.ts,.tsx .", - "pretest": "npm run lint", - "test": "stencil test --spec", - "test:screenshot": "stencil test --spec --screenshot", - "test:update-screenshot": "rm -f screenshot/builds/master.json && rm -f screenshot/images/* && stencil test --spec --screenshot --update-screenshot", - "test:watch": "stencil test --spec --watchAll", - "stencil": "stencil build --docs-readme", - "stencil:watch": "stencil build --watch", - "start": "stencil build --watch --serve --dev", - "storybook": "concurrently 'start-storybook -p 3000 -s ./www' 'yarn:stencil:watch' --raw", - "build-with-test": "npm run clean && npm test && npm run stencil", - "build": "npm run clean && npm run stencil --ci", - "build:esm:watch": "npm run clean && npm run stencil:watch", - "build:watch": "npm run clean && npm run stencil:watch", - "clean": "rimraf dist .stencil" - }, - "peerDependencies": { - "aws-amplify": "3.x.x || 4.x.x" - }, - "dependencies": { - "qrcode": "^1.4.4", - "uuid": "^8.2.0" - }, - "devDependencies": { - "@aws-amplify/auth": "4.6.14", - "@stencil/angular-output-target": "^0.0.2", - "@stencil/core": "1.15.0", - "@stencil/eslint-plugin": "0.2.1", - "@stencil/react-output-target": "^0.0.6", - "@stencil/sass": "1.5.2", - "@storybook/addon-a11y": "^5.2.5", - "@storybook/addon-actions": "^5.2.5", - "@storybook/addon-console": "^1.2.1", - "@storybook/addon-knobs": "^5.2.5", - "@storybook/html": "^5.2.5", - "@types/jest": "24.9.1", - "@types/node": "^12.6.3", - "@types/puppeteer": "1.19.1", - "@types/webpack": "^4.4.35", - "@types/webpack-env": "^1.14.0", - "@typescript-eslint/eslint-plugin": "^4.11.0", - "@typescript-eslint/parser": "^1.12.0", - "babel-loader": "^8.0.6", - "concurrently": "^5.0.0", - "eslint": "^7.16.0", - "eslint-config-prettier": "^7.1.0", - "eslint-plugin-prettier": "^3.3.0", - "eslint-plugin-react": "^7.19.0", - "jest": "24.9.0", - "jest-cli": "24.9.0", - "prettier": "^1.17.1", - "puppeteer": "1.19.0", - "rimraf": "^3.0.0", - "rollup-plugin-node-externals": "^2.1.3", - "rollup-plugin-node-polyfills": "^0.2.1" - }, - "license": "Apache-2.0" -} diff --git a/packages/amplify-ui-components/screenshot/.gitignore b/packages/amplify-ui-components/screenshot/.gitignore deleted file mode 100644 index ddd166e06e5..00000000000 --- a/packages/amplify-ui-components/screenshot/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -builds -compare.html \ No newline at end of file diff --git a/packages/amplify-ui-components/screenshot/images/0374a2f92c37e23352d4ba32891b9978.png b/packages/amplify-ui-components/screenshot/images/0374a2f92c37e23352d4ba32891b9978.png deleted file mode 100644 index fa5eadd4da9..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/0374a2f92c37e23352d4ba32891b9978.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/1161cbbe1e2d3c992003499e21cdedb2.png b/packages/amplify-ui-components/screenshot/images/1161cbbe1e2d3c992003499e21cdedb2.png deleted file mode 100644 index 8cfb9b1ddd2..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/1161cbbe1e2d3c992003499e21cdedb2.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/12777362bac028288672876483fca576.png b/packages/amplify-ui-components/screenshot/images/12777362bac028288672876483fca576.png deleted file mode 100644 index c429b9d85da..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/12777362bac028288672876483fca576.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/1a34440146bbb797234e53ad2b34244c.png b/packages/amplify-ui-components/screenshot/images/1a34440146bbb797234e53ad2b34244c.png deleted file mode 100644 index e1fc3d64aec..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/1a34440146bbb797234e53ad2b34244c.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/1c63f11daa573b0614811915101df5dd.png b/packages/amplify-ui-components/screenshot/images/1c63f11daa573b0614811915101df5dd.png deleted file mode 100644 index 52c6e84edf3..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/1c63f11daa573b0614811915101df5dd.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/2df45ad4d9aaaedb8e3b78593c91045c.png b/packages/amplify-ui-components/screenshot/images/2df45ad4d9aaaedb8e3b78593c91045c.png deleted file mode 100644 index 84bd109b73f..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/2df45ad4d9aaaedb8e3b78593c91045c.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/34d82a07eb2754e028b49687690b60c6.png b/packages/amplify-ui-components/screenshot/images/34d82a07eb2754e028b49687690b60c6.png deleted file mode 100644 index 5b0b7c9d75e..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/34d82a07eb2754e028b49687690b60c6.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/356dcc4b04beafe3f7d686cc59a17f40.png b/packages/amplify-ui-components/screenshot/images/356dcc4b04beafe3f7d686cc59a17f40.png deleted file mode 100644 index da7fdffaf9e..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/356dcc4b04beafe3f7d686cc59a17f40.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/35e3e3e064a7efa77138fb4c8f260ee7.png b/packages/amplify-ui-components/screenshot/images/35e3e3e064a7efa77138fb4c8f260ee7.png deleted file mode 100644 index 058a01203f7..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/35e3e3e064a7efa77138fb4c8f260ee7.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/460d03576290efeeb3316878500e4915.png b/packages/amplify-ui-components/screenshot/images/460d03576290efeeb3316878500e4915.png deleted file mode 100644 index 272d42a1b45..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/460d03576290efeeb3316878500e4915.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/50007375e88fbb9a88ec6252d444ed13.png b/packages/amplify-ui-components/screenshot/images/50007375e88fbb9a88ec6252d444ed13.png deleted file mode 100644 index 12bcc7e3b27..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/50007375e88fbb9a88ec6252d444ed13.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/5495926577b0d6c08811c15a53d52d83.png b/packages/amplify-ui-components/screenshot/images/5495926577b0d6c08811c15a53d52d83.png deleted file mode 100644 index d62528901aa..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/5495926577b0d6c08811c15a53d52d83.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/5627785835e4aba3b8e6185324e411df.png b/packages/amplify-ui-components/screenshot/images/5627785835e4aba3b8e6185324e411df.png deleted file mode 100644 index cf541cd3bb4..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/5627785835e4aba3b8e6185324e411df.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/613a267f8169934a3b39f480d959f2b5.png b/packages/amplify-ui-components/screenshot/images/613a267f8169934a3b39f480d959f2b5.png deleted file mode 100644 index 87626914204..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/613a267f8169934a3b39f480d959f2b5.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/640c79601d7f464afe622af04ceac511.png b/packages/amplify-ui-components/screenshot/images/640c79601d7f464afe622af04ceac511.png deleted file mode 100644 index 52072395690..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/640c79601d7f464afe622af04ceac511.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/7d5d34e2d6a1fd1cb8f4b133f09b2919.png b/packages/amplify-ui-components/screenshot/images/7d5d34e2d6a1fd1cb8f4b133f09b2919.png deleted file mode 100644 index 474d77b4750..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/7d5d34e2d6a1fd1cb8f4b133f09b2919.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/8da97462c3d2f37dd585d809d19690b3.png b/packages/amplify-ui-components/screenshot/images/8da97462c3d2f37dd585d809d19690b3.png deleted file mode 100644 index 64ebb692f8c..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/8da97462c3d2f37dd585d809d19690b3.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/903d95a69f0f6c914ade046071921a69.png b/packages/amplify-ui-components/screenshot/images/903d95a69f0f6c914ade046071921a69.png deleted file mode 100644 index 16a6ef733e8..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/903d95a69f0f6c914ade046071921a69.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/9107e60230b052ff51117366ecb0d28c.png b/packages/amplify-ui-components/screenshot/images/9107e60230b052ff51117366ecb0d28c.png deleted file mode 100644 index a2b3b59ab38..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/9107e60230b052ff51117366ecb0d28c.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/94cb417e5aba7cd1df349d2b81527239.png b/packages/amplify-ui-components/screenshot/images/94cb417e5aba7cd1df349d2b81527239.png deleted file mode 100644 index e5a773badce..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/94cb417e5aba7cd1df349d2b81527239.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/9759de3aca627e766e9ad3ca3cc32b84.png b/packages/amplify-ui-components/screenshot/images/9759de3aca627e766e9ad3ca3cc32b84.png deleted file mode 100644 index 9cf7a6ba812..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/9759de3aca627e766e9ad3ca3cc32b84.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/a035967149f9e5e7f9945f9d05d7ceb5.png b/packages/amplify-ui-components/screenshot/images/a035967149f9e5e7f9945f9d05d7ceb5.png deleted file mode 100644 index a14f653799c..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/a035967149f9e5e7f9945f9d05d7ceb5.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/a07a33827f103ffd1adb77013a301755.png b/packages/amplify-ui-components/screenshot/images/a07a33827f103ffd1adb77013a301755.png deleted file mode 100644 index 944106ac21f..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/a07a33827f103ffd1adb77013a301755.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/a8d76dd46de5df38871c7854964af6b4.png b/packages/amplify-ui-components/screenshot/images/a8d76dd46de5df38871c7854964af6b4.png deleted file mode 100644 index d7cf5fdc956..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/a8d76dd46de5df38871c7854964af6b4.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/ac3b7e4efddee6617e80134e65651d99.png b/packages/amplify-ui-components/screenshot/images/ac3b7e4efddee6617e80134e65651d99.png deleted file mode 100644 index bce51c13257..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/ac3b7e4efddee6617e80134e65651d99.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/ad7ac2628290789ba2bcb435683240ca.png b/packages/amplify-ui-components/screenshot/images/ad7ac2628290789ba2bcb435683240ca.png deleted file mode 100644 index 59153c4cdb2..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/ad7ac2628290789ba2bcb435683240ca.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/b458030c88be8e5dc63714271d1e927a.png b/packages/amplify-ui-components/screenshot/images/b458030c88be8e5dc63714271d1e927a.png deleted file mode 100644 index e944372f1fc..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/b458030c88be8e5dc63714271d1e927a.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/b92d09176393d360497325b7e3323542.png b/packages/amplify-ui-components/screenshot/images/b92d09176393d360497325b7e3323542.png deleted file mode 100644 index 7c1a47de667..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/b92d09176393d360497325b7e3323542.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/da11ed75ded1925766e3276de228cebf.png b/packages/amplify-ui-components/screenshot/images/da11ed75ded1925766e3276de228cebf.png deleted file mode 100644 index 942c8b78194..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/da11ed75ded1925766e3276de228cebf.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/e613e1f95eade960c78b4b89ea45657a.png b/packages/amplify-ui-components/screenshot/images/e613e1f95eade960c78b4b89ea45657a.png deleted file mode 100644 index 30541787eb6..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/e613e1f95eade960c78b4b89ea45657a.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/f458aad20e6d1a417fb952e4a03636aa.png b/packages/amplify-ui-components/screenshot/images/f458aad20e6d1a417fb952e4a03636aa.png deleted file mode 100644 index 3e4841dcce1..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/f458aad20e6d1a417fb952e4a03636aa.png and /dev/null differ diff --git a/packages/amplify-ui-components/screenshot/images/ffaacae3a1e3cf3d515f8c36362f77d6.png b/packages/amplify-ui-components/screenshot/images/ffaacae3a1e3cf3d515f8c36362f77d6.png deleted file mode 100644 index f1f33c50bec..00000000000 Binary files a/packages/amplify-ui-components/screenshot/images/ffaacae3a1e3cf3d515f8c36362f77d6.png and /dev/null differ diff --git a/packages/amplify-ui-components/src/common/Translations.ts b/packages/amplify-ui-components/src/common/Translations.ts deleted file mode 100644 index e432d3abc30..00000000000 --- a/packages/amplify-ui-components/src/common/Translations.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { AuthErrorStrings } from '@aws-amplify/auth'; - -export enum AuthStrings { - BACK_TO_SIGN_IN = 'Back to Sign In', - CHANGE_PASSWORD_ACTION = 'Change', - CHANGE_PASSWORD = 'Change Password', - CODE_LABEL = 'Verification code', - CODE_PLACEHOLDER = 'Enter code', - CONFIRM_SIGN_UP_CODE_LABEL = 'Confirmation Code', - CONFIRM_SIGN_UP_CODE_PLACEHOLDER = 'Enter your code', - CONFIRM_SIGN_UP_HEADER_TEXT = 'Confirm Sign up', - CONFIRM_SIGN_UP_LOST_CODE = 'Lost your code?', - CONFIRM_SIGN_UP_RESEND_CODE = 'Resend Code', - CONFIRM_SIGN_UP_SUBMIT_BUTTON_TEXT = 'Confirm', - CONFIRM_SMS_CODE = 'Confirm SMS Code', - CONFIRM_TOTP_CODE = 'Confirm TOTP Code', - CONFIRM = 'Confirm', - CREATE_ACCOUNT_TEXT = 'Create account', - EMAIL_LABEL = 'Email Address *', - EMAIL_PLACEHOLDER = 'Enter your email address', - FORGOT_PASSWORD_TEXT = 'Forgot your password?', - LESS_THAN_TWO_MFA_VALUES_MESSAGE = 'Less than two MFA types available', - NEW_PASSWORD_LABEL = 'New password', - NEW_PASSWORD_PLACEHOLDER = 'Enter your new password', - NO_ACCOUNT_TEXT = 'No account?', - USERNAME_REMOVE_WHITESPACE = 'Username cannot contain whitespace', - PASSWORD_REMOVE_WHITESPACE = 'Password cannot start or end with whitespace', - PASSWORD_LABEL = 'Password *', - PASSWORD_PLACEHOLDER = 'Enter your password', - PHONE_LABEL = 'Phone Number *', - PHONE_PLACEHOLDER = '(555) 555-1212', - QR_CODE_ALT = 'qrcode', - RESET_PASSWORD_TEXT = 'Reset password', - RESET_YOUR_PASSWORD = 'Reset your password', - SELECT_MFA_TYPE_HEADER_TEXT = 'Select MFA Type', - SELECT_MFA_TYPE_SUBMIT_BUTTON_TEXT = 'Verify', - SEND_CODE = 'Send Code', - SUBMIT = 'Submit', - SETUP_TOTP_REQUIRED = 'TOTP needs to be configured', - SIGN_IN_ACTION = 'Sign In', - SIGN_IN_HEADER_TEXT = 'Sign in to your account', - SIGN_IN_TEXT = 'Sign in', - SIGN_IN_WITH_AMAZON = 'Sign in with Amazon', - SIGN_IN_WITH_AUTH0 = 'Sign in with Auth0', - SIGN_IN_WITH_AWS = 'Sign in with AWS', - SIGN_IN_WITH_FACEBOOK = 'Sign in with Facebook', - SIGN_IN_WITH_GOOGLE = 'Sign in with Google', - SIGN_OUT = 'Sign Out', - SIGN_UP_EMAIL_PLACEHOLDER = 'Email', - SIGN_UP_HAVE_ACCOUNT_TEXT = 'Have an account?', - SIGN_UP_HEADER_TEXT = 'Create a new account', - SIGN_UP_PASSWORD_PLACEHOLDER = 'Password', - SIGN_UP_SUBMIT_BUTTON_TEXT = 'Create Account', - SIGN_UP_USERNAME_PLACEHOLDER = 'Username', - SKIP = 'Skip', - SUCCESS_MFA_TYPE = 'Success! Your MFA Type is now:', - TOTP_HEADER_TEXT = 'Scan then enter verification code', - TOTP_LABEL = 'Enter Security Code:', - TOTP_ISSUER = 'AWSCognito', - TOTP_SETUP_FAILURE = 'TOTP Setup has failed', - TOTP_SUBMIT_BUTTON_TEXT = 'Verify Security Token', - TOTP_SUCCESS_MESSAGE = 'Setup TOTP successfully!', - UNABLE_TO_SETUP_MFA_AT_THIS_TIME = 'Failed! Unable to configure MFA at this time', - USERNAME_LABEL = 'Username *', - USERNAME_PLACEHOLDER = 'Enter your username', - VERIFY_CONTACT_EMAIL_LABEL = 'Email', - VERIFY_CONTACT_HEADER_TEXT = 'Account recovery requires verified contact information', - VERIFY_CONTACT_PHONE_LABEL = 'Phone Number', - VERIFY_CONTACT_SUBMIT_LABEL = 'Submit', - VERIFY_CONTACT_VERIFY_LABEL = 'Verify', - ADDRESS_LABEL = 'Address', - ADDRESS_PLACEHOLDER = 'Enter your address', - NICKNAME_LABEL = 'Nickname', - NICKNAME_PLACEHOLDER = 'Enter your nickname', - BIRTHDATE_LABEL = 'Birthday', - BIRTHDATE_PLACEHOLDER = 'Enter your birthday', - PICTURE_LABEL = 'Picture URL', - PICTURE_PLACEHOLDER = 'Enter your picture URL', - FAMILY_NAME_LABEL = 'Family Name', - FAMILY_NAME_PLACEHOLDER = 'Enter your family name', - PREFERRED_USERNAME_LABEL = 'Preferred Username', - PREFERRED_USERNAME_PLACEHOLDER = 'Enter your preferred username', - GENDER_LABEL = 'Gender', - GENDER_PLACEHOLDER = 'Enter your gender', - PROFILE_LABEL = 'Profile URL', - PROFILE_PLACEHOLDER = 'Enter your profile URL', - GIVEN_NAME_LABEL = 'First Name', - GIVEN_NAME_PLACEHOLDER = 'Enter your first name', - ZONEINFO_LABEL = 'Time zone', - ZONEINFO_PLACEHOLDER = 'Enter your time zone', - LOCALE_LABEL = 'Locale', - LOCALE_PLACEHOLDER = 'Enter your locale', - UPDATED_AT_LABEL = 'Updated At', - UPDATED_AT_PLACEHOLDER = 'Enter the time the information was last updated', - MIDDLE_NAME_LABEL = 'Middle Name', - MIDDLE_NAME_PLACEHOLDER = 'Enter your middle name', - WEBSITE_LABEL = 'Website', - WEBSITE_PLACEHOLDER = 'Enter your website', - NAME_LABEL = 'Full Name', - NAME_PLACEHOLDER = 'Enter your full name', - PHOTO_PICKER_TITLE = 'Picker Title', - PHOTO_PICKER_HINT = 'Ancillary text or content may occupy this space here', - PHOTO_PICKER_PLACEHOLDER_HINT = 'Placeholder hint', - PHOTO_PICKER_BUTTON_TEXT = 'Button', - IMAGE_PICKER_TITLE = 'Add Profile Photo', - IMAGE_PICKER_HINT = 'Preview the image before upload', - IMAGE_PICKER_PLACEHOLDER_HINT = 'Tap to image select', - IMAGE_PICKER_BUTTON_TEXT = 'Upload', - PICKER_TEXT = 'Pick a file', - TEXT_FALLBACK_CONTENT = 'Fallback Content', - CONFIRM_SIGN_UP_FAILED = 'Confirm Sign Up Failed', - SIGN_UP_FAILED = 'Sign Up Failed', -} - -export enum InteractionsStrings { - CHATBOT_TITLE = 'ChatBot Lex', - TEXT_INPUT_PLACEHOLDER = 'Write a message', - VOICE_INPUT_PLACEHOLDER = 'Click mic to speak', - CHAT_DISABLED_ERROR = 'Error: Either voice or text must be enabled for the chatbot', - NO_BOT_NAME_ERROR = 'Error: Bot name must be provided to ChatBot', -} - -type Translations = AuthErrorStrings | AuthStrings | InteractionsStrings; -export const Translations = { - ...AuthStrings, - ...AuthErrorStrings, - ...InteractionsStrings, -}; diff --git a/packages/amplify-ui-components/src/common/audio-control/helper.ts b/packages/amplify-ui-components/src/common/audio-control/helper.ts deleted file mode 100644 index cee1d515d3e..00000000000 --- a/packages/amplify-ui-components/src/common/audio-control/helper.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { RECORDER_EXPORT_MIME_TYPE } from './settings'; - -/** - * Merges multiple buffers into one. - */ -const mergeBuffers = (bufferArray: Float32Array[], recLength: number) => { - const result = new Float32Array(recLength); - let offset = 0; - for (let i = 0; i < bufferArray.length; i++) { - result.set(bufferArray[i], offset); - offset += bufferArray[i].length; - } - return result; -}; - -/** - * Downsamples audio to desired export sample rate. - */ -const downsampleBuffer = ( - buffer: Float32Array, - recordSampleRate: number, - exportSampleRate: number -) => { - if (exportSampleRate === recordSampleRate) { - return buffer; - } - const sampleRateRatio = recordSampleRate / exportSampleRate; - const newLength = Math.round(buffer.length / sampleRateRatio); - const result = new Float32Array(newLength); - let offsetResult = 0; - let offsetBuffer = 0; - while (offsetResult < result.length) { - const nextOffsetBuffer = Math.round((offsetResult + 1) * sampleRateRatio); - let accum = 0, - count = 0; - for (let i = offsetBuffer; i < nextOffsetBuffer && i < buffer.length; i++) { - accum += buffer[i]; - count++; - } - result[offsetResult] = accum / count; - offsetResult++; - offsetBuffer = nextOffsetBuffer; - } - return result; -}; - -/** - * converts raw audio values to 16 bit pcm. - */ -const floatTo16BitPCM = ( - output: DataView, - offset: number, - input: Float32Array -) => { - let byteOffset = offset; - for (let i = 0; i < input.length; i++, byteOffset += 2) { - const s = Math.max(-1, Math.min(1, input[i])); - output.setInt16(byteOffset, s < 0 ? s * 0x8000 : s * 0x7fff, true); - } -}; - -/** - * Write given strings in big-endian order. - */ -const writeString = (view: DataView, offset: number, string: string) => { - for (let i = 0; i < string.length; i++) { - view.setUint8(offset + i, string.charCodeAt(i)); - } -}; - -/** - * Encodes raw pcm audio into a wav file. - */ -const encodeWAV = (samples: Float32Array, exportSampleRate?: number) => { - /** - * WAV file consists of three parts: RIFF header, WAVE subchunk, and data subchunk. We precompute the size of them. - */ - - const audioSize = samples.length * 2; // We use 16-bit samples, so we have (2 * sampleLength) bytes. - const fmtSize = 24; // Byte size of the fmt subchunk: 24 bytes that the audio information that we'll set below. - const dataSize = 8 + audioSize; // Byte size of the data subchunk: raw sound data plus 8 bytes for the subchunk descriptions. - - const totalByteSize = 12 + fmtSize + dataSize; // Byte size of the whole file, including the chunk header / descriptor. - - // create DataView object to write byte values into - const buffer = new ArrayBuffer(totalByteSize); // buffer to write the chunk values in. - const view = new DataView(buffer); - - /** - * Start writing the .wav file. We write top to bottom, so byte offset (first numeric argument) increases strictly. - */ - // RIFF header - writeString(view, 0, 'RIFF'); // At offset 0, write the letters "RIFF" - view.setUint32(4, fmtSize + dataSize, true); // At offset 4, write the size of fmt and data chunk size combined. - writeString(view, 8, 'WAVE'); // At offset 8, write the format type "WAVE" - - // fmt subchunk - writeString(view, 12, 'fmt '); //chunkdId 'fmt ' - view.setUint32(16, fmtSize - 8, true); // fmt subchunk size below this value. We set 8 bytes already, so subtract 8 bytes from fmtSize. - view.setUint16(20, 1, true); // Audio format code, which is 1 for PCM. - view.setUint16(22, 1, true); // Number of audio channels. We use mono, ie 1. - view.setUint32(24, exportSampleRate, true); // Sample rate of the audio file. - view.setUint32(28, exportSampleRate * 2, true); // Data rate, or # of data bytes per second. Since each sample is 2 bytes, this is 2 * sampleRate. - view.setUint16(32, 2, true); // block align, # of bytes per sample including all channels, ie. 2 bytes. - view.setUint16(34, 16, true); // bits per sample, ie. 16 bits - - // data subchunk - writeString(view, 36, 'data'); // write the chunkId 'data' - view.setUint32(40, audioSize, true); // Audio byte size - floatTo16BitPCM(view, 44, samples); // raw pcm values then go here. - return view; -}; - -/** - * Given arrays of raw pcm audio, downsamples the audio to desired sample rate and encodes it to a wav audio file. - * - * @param recBuffer {Float32Array[]} - 2d float array containing the recorded raw audio - * @param recLength {number} - total length of recorded audio - * @param recordSampleRate {number} - sample rate of the recorded audio - * @param exportSampleRate {number} - desired sample rate of the exported file - */ -export const exportBuffer = ( - recBuffer: Float32Array[], - recLength: number, - recordSampleRate: number, - exportSampleRate: number -) => { - const mergedBuffers = mergeBuffers(recBuffer, recLength); - const downsampledBuffer = downsampleBuffer( - mergedBuffers, - recordSampleRate, - exportSampleRate - ); - const encodedWav = encodeWAV(downsampledBuffer, exportSampleRate); - const audioBlob = new Blob([encodedWav], { - type: RECORDER_EXPORT_MIME_TYPE, - }); - return audioBlob; -}; diff --git a/packages/amplify-ui-components/src/common/audio-control/index.ts b/packages/amplify-ui-components/src/common/audio-control/index.ts deleted file mode 100644 index 80bcda15afb..00000000000 --- a/packages/amplify-ui-components/src/common/audio-control/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './recorder'; -export * from './helper'; -export * from './visualizer'; diff --git a/packages/amplify-ui-components/src/common/audio-control/recorder.ts b/packages/amplify-ui-components/src/common/audio-control/recorder.ts deleted file mode 100644 index c9de9b9e780..00000000000 --- a/packages/amplify-ui-components/src/common/audio-control/recorder.ts +++ /dev/null @@ -1,236 +0,0 @@ -import { exportBuffer } from './helper'; -import { browserOrNode, Logger } from '@aws-amplify/core'; -import { - DEFAULT_EXPORT_SAMPLE_RATE, - FFT_MAX_DECIBELS, - FFT_MIN_DECIBELS, - FFT_SIZE, - FFT_SMOOTHING_TIME_CONSTANT, -} from './settings'; - -interface SilenceDetectionConfig { - time: number; - amplitude: number; -} - -type SilenceHandler = () => void; -type Visualizer = (dataArray: Uint8Array, bufferLength: number) => void; -const logger = new Logger('AudioRecorder'); - -export class AudioRecorder { - private options: SilenceDetectionConfig; - private audioContext: AudioContext; - private audioSupported: boolean; - - private analyserNode: AnalyserNode; - private playbackSource: AudioBufferSourceNode; - private onSilence: SilenceHandler; - private visualizer: Visualizer; - - // input mic stream is stored in a buffer - private streamBuffer: Float32Array[] = []; - private streamBufferLength = 0; - - // recording props - private start: number; - private recording = false; - - constructor(options: SilenceDetectionConfig) { - this.options = options; - } - - /** - * This must be called first to enable audio context and request microphone access. - * Once access granted, it connects all the necessary audio nodes to the context so that it can begin recording or playing. - */ - async init() { - if (browserOrNode().isBrowser) { - window.AudioContext = - window.AudioContext || (window as any).webkitAudioContext; - this.audioContext = new AudioContext(); - await navigator.mediaDevices - .getUserMedia({ audio: true }) - .then(stream => { - this.audioSupported = true; - this.setupAudioNodes(stream); - }) - .catch(() => { - this.audioSupported = false; - return Promise.reject('Audio is not supported'); - }); - } else { - this.audioSupported = false; - return Promise.reject('Audio is not supported'); - } - } - - /** - * Setup audio nodes after successful `init`. - */ - private async setupAudioNodes(stream: MediaStream) { - try { - await this.audioContext.resume(); - } catch (err) { - logger.error(err); - } - const sourceNode = this.audioContext.createMediaStreamSource(stream); - const processorNode = this.audioContext.createScriptProcessor(4096, 1, 1); - - processorNode.onaudioprocess = audioProcessingEvent => { - if (!this.recording) return; - const stream = audioProcessingEvent.inputBuffer.getChannelData(0); - this.streamBuffer.push(new Float32Array(stream)); // set to a copy of the stream - this.streamBufferLength += stream.length; - this.analyse(); - }; - - const analyserNode = this.audioContext.createAnalyser(); - analyserNode.minDecibels = FFT_MIN_DECIBELS; - analyserNode.maxDecibels = FFT_MAX_DECIBELS; - analyserNode.smoothingTimeConstant = FFT_SMOOTHING_TIME_CONSTANT; - - sourceNode.connect(analyserNode); - analyserNode.connect(processorNode); - processorNode.connect(sourceNode.context.destination); - - this.analyserNode = analyserNode; - } - - /** - * Start recording audio and listen for silence. - * - * @param onSilence {SilenceHandler} - called whenever silence is detected - * @param visualizer {Visualizer} - called with audio data on each audio process to be used for visualization. - */ - public async startRecording( - onSilence?: SilenceHandler, - visualizer?: Visualizer - ) { - if (this.recording || !this.audioSupported) return; - this.onSilence = onSilence || function() {}; - this.visualizer = visualizer || function() {}; - - const context = this.audioContext; - try { - await context.resume(); - } catch (err) { - logger.error(err); - } - this.start = Date.now(); - this.recording = true; - } - - /** - * Pause recording - */ - public stopRecording() { - if (!this.audioSupported) return; - this.recording = false; - } - - /** - * Pause recording and clear audio buffer - */ - public clear() { - this.stopRecording(); - this.streamBufferLength = 0; - this.streamBuffer = []; - } - - /** - * Plays given audioStream with audioContext - * - * @param buffer {Uint8Array} - audioStream to be played - */ - public play(buffer: Uint8Array) { - if (!buffer || !this.audioSupported) return; - const myBlob = new Blob([buffer]); - - return new Promise((res, rej) => { - const fileReader = new FileReader(); - fileReader.onload = () => { - if (this.playbackSource) this.playbackSource.disconnect(); // disconnect previous playback source - this.playbackSource = this.audioContext.createBufferSource(); - - const successCallback = (buf: AudioBuffer) => { - this.playbackSource.buffer = buf; - this.playbackSource.connect(this.audioContext.destination); - this.playbackSource.onended = () => { - return res(); - }; - this.playbackSource.start(0); - }; - const errorCallback = err => { - return rej(err); - }; - - this.audioContext.decodeAudioData( - fileReader.result as ArrayBuffer, - successCallback, - errorCallback - ); - }; - fileReader.onerror = () => rej(); - fileReader.readAsArrayBuffer(myBlob); - }); - } - - /** - * Stops playing audio if there's a playback source connected. - */ - public stop() { - if (this.playbackSource) { - this.playbackSource.stop(); - } - } - - /** - * Called after each audioProcess. Check for silence and give fft time domain data to visualizer. - */ - private analyse() { - if (!this.audioSupported) return; - const analyser = this.analyserNode; - analyser.fftSize = FFT_SIZE; - - const bufferLength = analyser.fftSize; - const dataArray = new Uint8Array(bufferLength); - const amplitude = this.options.amplitude; - const time = this.options.time; - - analyser.getByteTimeDomainData(dataArray); - this.visualizer(dataArray, bufferLength); - - for (let i = 0; i < bufferLength; i++) { - // Normalize between -1 and 1. - const curr_value_time = dataArray[i] / 128 - 1.0; - if (curr_value_time > amplitude || curr_value_time < -1 * amplitude) { - this.start = Date.now(); - } - } - const newtime = Date.now(); - const elapsedTime = newtime - this.start; - if (elapsedTime > time) { - this.onSilence(); - } - } - - /** - * Encodes recorded buffer to a wav file and exports it to a blob. - * - * @param exportSampleRate {number} - desired sample rate of the exported buffer - */ - public async exportWAV( - exportSampleRate: number = DEFAULT_EXPORT_SAMPLE_RATE - ) { - if (!this.audioSupported) return; - const recordSampleRate = this.audioContext.sampleRate; - const blob = exportBuffer( - this.streamBuffer, - this.streamBufferLength, - recordSampleRate, - exportSampleRate - ); - this.clear(); - return blob; - } -} diff --git a/packages/amplify-ui-components/src/common/audio-control/settings.ts b/packages/amplify-ui-components/src/common/audio-control/settings.ts deleted file mode 100644 index ab6075b9104..00000000000 --- a/packages/amplify-ui-components/src/common/audio-control/settings.ts +++ /dev/null @@ -1,8 +0,0 @@ -// AudioRecorder settings -export const RECORDER_EXPORT_MIME_TYPE = 'application/octet-stream'; -export const DEFAULT_EXPORT_SAMPLE_RATE = 16000; - -export const FFT_SIZE = 2048; // window size in samples for Fast Fourier Transform (FFT) -export const FFT_MAX_DECIBELS = -10; // maximum power value in the scaling range for the FFT analysis data -export const FFT_MIN_DECIBELS = -90; // minimum power value in the scaling range for the FFT analysis data -export const FFT_SMOOTHING_TIME_CONSTANT = 0.85; // averaging constant with the last analysis frame diff --git a/packages/amplify-ui-components/src/common/audio-control/visualizer.ts b/packages/amplify-ui-components/src/common/audio-control/visualizer.ts deleted file mode 100644 index afdcc116a64..00000000000 --- a/packages/amplify-ui-components/src/common/audio-control/visualizer.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { browserOrNode } from '@aws-amplify/core'; - -export const visualize = ( - dataArray: Uint8Array, - bufferLength: number, - canvas: HTMLCanvasElement -) => { - if (!canvas) return; - if (!browserOrNode().isBrowser) - throw new Error('Visualization is not supported on non-browsers.'); - const { width, height } = canvas.getBoundingClientRect(); - - // need to update the default canvas width and height - canvas.width = width; - canvas.height = height; - - const canvasCtx = canvas.getContext('2d'); - - canvasCtx.fillStyle = 'white'; - canvasCtx.clearRect(0, 0, width, height); - - const draw = () => { - canvasCtx.fillRect(0, 0, width, height); - canvasCtx.lineWidth = 1; - const color = getComputedStyle(document.documentElement).getPropertyValue( - '--amplify-primary-color' - ); - canvasCtx.strokeStyle = !color || color === '' ? '#ff9900' : color; // TODO: try separate css variable - canvasCtx.beginPath(); - - const sliceWidth = (width * 1.0) / bufferLength; - let x = 0; - - for (let i = 0; i < bufferLength || i % 3 === 0; i++) { - const value = dataArray[i] / 128.0; - const y = (value * height) / 2; - if (i === 0) { - canvasCtx.moveTo(x, y); - } else { - canvasCtx.lineTo(x, y); - } - x += sliceWidth; - } - - canvasCtx.lineTo(canvas.width, canvas.height / 2); - canvasCtx.stroke(); - }; - - // Register our draw function with requestAnimationFrame. - requestAnimationFrame(draw); -}; diff --git a/packages/amplify-ui-components/src/common/auth-helpers.ts b/packages/amplify-ui-components/src/common/auth-helpers.ts deleted file mode 100644 index 9b6b57e5eef..00000000000 --- a/packages/amplify-ui-components/src/common/auth-helpers.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { Auth, CognitoUser } from '@aws-amplify/auth'; -import { Logger, isEmpty } from '@aws-amplify/core'; -import { - AuthState, - ChallengeName, - CognitoUserInterface, - AuthStateHandler, - UsernameAlias, - UsernameAliasStrings, -} from './types/auth-types'; -import { dispatchToastHubEvent } from './helpers'; -import { NO_AUTH_MODULE_FOUND } from '../common/constants'; -import { Translations } from '../common/Translations'; - -const logger = new Logger('auth-helpers'); - -export async function checkContact( - user: CognitoUserInterface, - handleAuthStateChange: AuthStateHandler -) { - if (!Auth || typeof Auth.verifiedContact !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - // If `user` is a federated user, we shouldn't call `verifiedContact` - // since `user` isn't `CognitoUser` - if (!isCognitoUser(user)) { - handleAuthStateChange(AuthState.SignedIn, user); - return; - } - - try { - const data = await Auth.verifiedContact(user); - if (!isEmpty(data.verified) || isEmpty(data.unverified)) { - handleAuthStateChange(AuthState.SignedIn, user); - } else { - const newUser = Object.assign(user, data); - handleAuthStateChange(AuthState.VerifyContact, newUser); - } - } catch (error) { - dispatchToastHubEvent(error); - } -} - -export const handleSignIn = async ( - username: string, - password: string, - handleAuthStateChange: AuthStateHandler, - usernameAlias?: UsernameAliasStrings -) => { - if (!Auth || typeof Auth.signIn !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - try { - const user = await Auth.signIn(username, password); - logger.debug(user); - if ( - user.challengeName === ChallengeName.SMSMFA || - user.challengeName === ChallengeName.SoftwareTokenMFA - ) { - logger.debug('confirm user with ' + user.challengeName); - handleAuthStateChange(AuthState.ConfirmSignIn, user); - } else if (user.challengeName === ChallengeName.NewPasswordRequired) { - logger.debug('require new password', user.challengeParam); - handleAuthStateChange(AuthState.ResetPassword, user); - } else if (user.challengeName === ChallengeName.MFASetup) { - logger.debug('TOTP setup', user.challengeParam); - handleAuthStateChange(AuthState.TOTPSetup, user); - } else if ( - user.challengeName === ChallengeName.CustomChallenge && - user.challengeParam && - user.challengeParam.trigger === 'true' - ) { - logger.debug('custom challenge', user.challengeParam); - handleAuthStateChange(AuthState.CustomConfirmSignIn, user); - } else { - await checkContact(user, handleAuthStateChange); - } - } catch (error) { - if (error.code === 'UserNotConfirmedException') { - logger.debug('the user is not confirmed'); - handleAuthStateChange(AuthState.ConfirmSignUp, { username }); - } else if (error.code === 'PasswordResetRequiredException') { - logger.debug('the user requires a new password'); - handleAuthStateChange(AuthState.ForgotPassword, { username }); - } else if (error.code === 'InvalidParameterException' && password === '') { - logger.debug('Password cannot be empty'); - error.message = Translations.EMPTY_PASSWORD; - } else if (error.message === Translations.EMPTY_USERNAME) { - if (usernameAlias === UsernameAlias.email) { - error.message = Translations.EMPTY_EMAIL; - } - - if (usernameAlias === UsernameAlias.phone_number) { - error.message = Translations.EMPTY_PHONE; - } - } - dispatchToastHubEvent(error); - } -}; - -export const isCognitoUser = (user: CognitoUserInterface) => { - return user instanceof CognitoUser; -}; diff --git a/packages/amplify-ui-components/src/common/constants.ts b/packages/amplify-ui-components/src/common/constants.ts deleted file mode 100644 index 375d780aa1d..00000000000 --- a/packages/amplify-ui-components/src/common/constants.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Dictionaries - -// fieldId constants -export const USERNAME_SUFFIX = 'username'; -export const EMAIL_SUFFIX = 'email'; -export const CODE_SUFFIX = 'code'; -export const PHONE_SUFFIX = 'phone'; -export const PASSWORD_SUFFIX = 'password'; - -// Country Dial Code common constants -export const COUNTRY_DIAL_CODE_SUFFIX = 'country-dial-code-select'; -export const COUNTRY_DIAL_CODE_DEFAULT = '+1'; - -// Auth Keys -export const AUTH_SOURCE_KEY = 'amplify-auth-source'; -export const REDIRECTED_FROM_HOSTED_UI = 'amplify-redirected-from-hosted-ui'; -export const AUTHENTICATOR_AUTHSTATE = 'amplify-authenticator-authState'; - -// Error message Common Constants -export const PHONE_EMPTY_ERROR_MESSAGE = 'Phone number can not be empty'; -export const NO_AUTH_MODULE_FOUND = - 'No Auth module found, please ensure @aws-amplify/auth is imported'; -export const NO_STORAGE_MODULE_FOUND = - 'No Storage module found, please ensure @aws-amplify/storage is imported'; -export const NO_INTERACTIONS_MODULE_FOUND = - 'No Interactions module found, please ensure @aws-amplify/interactions is imported'; - -// TOTP Messages -export const SETUP_TOTP = 'SETUP_TOTP'; - -// Select MFA Types Messages -export const USER_NOT_SETUP_SOFTWARE_TOKEN_MFA = - 'User has not set up software token mfa'; -export const USER_NOT_VERIFIED_SOFTWARE_TOKEN_MFA = - 'User has not verified software token mfa'; - -// Common events -export const SUCCESS = 'SUCCESS'; -export const FAILURE = 'FAILURE'; - -// Hub Events and Channels -export const AUTH_CHANNEL = 'auth'; -export const UI_AUTH_CHANNEL = 'UI Auth'; -export const TOAST_AUTH_ERROR_EVENT = 'ToastAuthError'; -export const AUTH_STATE_CHANGE_EVENT = 'AuthStateChange'; diff --git a/packages/amplify-ui-components/src/common/country-dial-codes.ts b/packages/amplify-ui-components/src/common/country-dial-codes.ts deleted file mode 100644 index e485e551597..00000000000 --- a/packages/amplify-ui-components/src/common/country-dial-codes.ts +++ /dev/null @@ -1,210 +0,0 @@ -const countryDialCodes = [ - { label: '+1', value: '+1' }, - { label: '+7', value: '+7' }, - { label: '+20', value: '+20' }, - { label: '+27', value: '+27' }, - { label: '+30', value: '+30' }, - { label: '+31', value: '+31' }, - { label: '+32', value: '+32' }, - { label: '+33', value: '+33' }, - { label: '+34', value: '+34' }, - { label: '+36', value: '+36' }, - { label: '+39', value: '+39' }, - { label: '+40', value: '+40' }, - { label: '+41', value: '+41' }, - { label: '+43', value: '+43' }, - { label: '+44', value: '+44' }, - { label: '+45', value: '+45' }, - { label: '+46', value: '+46' }, - { label: '+47', value: '+47' }, - { label: '+48', value: '+48' }, - { label: '+49', value: '+49' }, - { label: '+51', value: '+51' }, - { label: '+52', value: '+52' }, - { label: '+53', value: '+53' }, - { label: '+54', value: '+54' }, - { label: '+55', value: '+55' }, - { label: '+56', value: '+56' }, - { label: '+57', value: '+57' }, - { label: '+58', value: '+58' }, - { label: '+60', value: '+60' }, - { label: '+61', value: '+61' }, - { label: '+62', value: '+62' }, - { label: '+63', value: '+63' }, - { label: '+64', value: '+64' }, - { label: '+65', value: '+65' }, - { label: '+66', value: '+66' }, - { label: '+81', value: '+81' }, - { label: '+82', value: '+82' }, - { label: '+84', value: '+84' }, - { label: '+86', value: '+86' }, - { label: '+90', value: '+90' }, - { label: '+91', value: '+91' }, - { label: '+92', value: '+92' }, - { label: '+93', value: '+93' }, - { label: '+94', value: '+94' }, - { label: '+95', value: '+95' }, - { label: '+98', value: '+98' }, - { label: '+212', value: '+212' }, - { label: '+213', value: '+213' }, - { label: '+216', value: '+216' }, - { label: '+218', value: '+218' }, - { label: '+220', value: '+220' }, - { label: '+221', value: '+221' }, - { label: '+222', value: '+222' }, - { label: '+223', value: '+223' }, - { label: '+224', value: '+224' }, - { label: '+225', value: '+225' }, - { label: '+226', value: '+226' }, - { label: '+227', value: '+227' }, - { label: '+228', value: '+228' }, - { label: '+229', value: '+229' }, - { label: '+230', value: '+230' }, - { label: '+231', value: '+231' }, - { label: '+232', value: '+232' }, - { label: '+233', value: '+233' }, - { label: '+234', value: '+234' }, - { label: '+235', value: '+235' }, - { label: '+236', value: '+236' }, - { label: '+237', value: '+237' }, - { label: '+238', value: '+238' }, - { label: '+239', value: '+239' }, - { label: '+240', value: '+240' }, - { label: '+241', value: '+241' }, - { label: '+242', value: '+242' }, - { label: '+243', value: '+243' }, - { label: '+244', value: '+244' }, - { label: '+245', value: '+245' }, - { label: '+246', value: '+246' }, - { label: '+248', value: '+248' }, - { label: '+249', value: '+249' }, - { label: '+250', value: '+250' }, - { label: '+251', value: '+251' }, - { label: '+252', value: '+252' }, - { label: '+253', value: '+253' }, - { label: '+254', value: '+254' }, - { label: '+255', value: '+255' }, - { label: '+256', value: '+256' }, - { label: '+257', value: '+257' }, - { label: '+258', value: '+258' }, - { label: '+260', value: '+260' }, - { label: '+261', value: '+261' }, - { label: '+262', value: '+262' }, - { label: '+263', value: '+263' }, - { label: '+264', value: '+264' }, - { label: '+265', value: '+265' }, - { label: '+266', value: '+266' }, - { label: '+267', value: '+267' }, - { label: '+268', value: '+268' }, - { label: '+269', value: '+269' }, - { label: '+290', value: '+290' }, - { label: '+291', value: '+291' }, - { label: '+297', value: '+297' }, - { label: '+298', value: '+298' }, - { label: '+299', value: '+299' }, - { label: '+345', value: '+345' }, - { label: '+350', value: '+350' }, - { label: '+351', value: '+351' }, - { label: '+352', value: '+352' }, - { label: '+353', value: '+353' }, - { label: '+354', value: '+354' }, - { label: '+355', value: '+355' }, - { label: '+356', value: '+356' }, - { label: '+357', value: '+357' }, - { label: '+358', value: '+358' }, - { label: '+359', value: '+359' }, - { label: '+370', value: '+370' }, - { label: '+371', value: '+371' }, - { label: '+372', value: '+372' }, - { label: '+373', value: '+373' }, - { label: '+374', value: '+374' }, - { label: '+375', value: '+375' }, - { label: '+376', value: '+376' }, - { label: '+377', value: '+377' }, - { label: '+378', value: '+378' }, - { label: '+379', value: '+379' }, - { label: '+380', value: '+380' }, - { label: '+381', value: '+381' }, - { label: '+382', value: '+382' }, - { label: '+385', value: '+385' }, - { label: '+386', value: '+386' }, - { label: '+387', value: '+387' }, - { label: '+389', value: '+389' }, - { label: '+420', value: '+420' }, - { label: '+421', value: '+421' }, - { label: '+423', value: '+423' }, - { label: '+500', value: '+500' }, - { label: '+501', value: '+501' }, - { label: '+502', value: '+502' }, - { label: '+503', value: '+503' }, - { label: '+504', value: '+504' }, - { label: '+505', value: '+505' }, - { label: '+506', value: '+506' }, - { label: '+507', value: '+507' }, - { label: '+508', value: '+508' }, - { label: '+509', value: '+509' }, - { label: '+537', value: '+537' }, - { label: '+590', value: '+590' }, - { label: '+591', value: '+591' }, - { label: '+593', value: '+593' }, - { label: '+594', value: '+594' }, - { label: '+595', value: '+595' }, - { label: '+596', value: '+596' }, - { label: '+597', value: '+597' }, - { label: '+598', value: '+598' }, - { label: '+599', value: '+599' }, - { label: '+670', value: '+670' }, - { label: '+672', value: '+672' }, - { label: '+673', value: '+673' }, - { label: '+674', value: '+674' }, - { label: '+675', value: '+675' }, - { label: '+676', value: '+676' }, - { label: '+677', value: '+677' }, - { label: '+678', value: '+678' }, - { label: '+679', value: '+679' }, - { label: '+680', value: '+680' }, - { label: '+681', value: '+681' }, - { label: '+682', value: '+682' }, - { label: '+683', value: '+683' }, - { label: '+685', value: '+685' }, - { label: '+686', value: '+686' }, - { label: '+687', value: '+687' }, - { label: '+688', value: '+688' }, - { label: '+689', value: '+689' }, - { label: '+690', value: '+690' }, - { label: '+691', value: '+691' }, - { label: '+692', value: '+692' }, - { label: '+850', value: '+850' }, - { label: '+852', value: '+852' }, - { label: '+853', value: '+853' }, - { label: '+855', value: '+855' }, - { label: '+856', value: '+856' }, - { label: '+872', value: '+872' }, - { label: '+880', value: '+880' }, - { label: '+886', value: '+886' }, - { label: '+960', value: '+960' }, - { label: '+961', value: '+961' }, - { label: '+962', value: '+962' }, - { label: '+963', value: '+963' }, - { label: '+964', value: '+964' }, - { label: '+965', value: '+965' }, - { label: '+966', value: '+966' }, - { label: '+967', value: '+967' }, - { label: '+968', value: '+968' }, - { label: '+970', value: '+970' }, - { label: '+971', value: '+971' }, - { label: '+972', value: '+972' }, - { label: '+973', value: '+973' }, - { label: '+974', value: '+974' }, - { label: '+975', value: '+975' }, - { label: '+976', value: '+976' }, - { label: '+977', value: '+977' }, - { label: '+992', value: '+992' }, - { label: '+993', value: '+993' }, - { label: '+994', value: '+994' }, - { label: '+995', value: '+995' }, - { label: '+996', value: '+996' }, - { label: '+998', value: '+998' }, -]; - -export default countryDialCodes; diff --git a/packages/amplify-ui-components/src/common/helpers.ts b/packages/amplify-ui-components/src/common/helpers.ts deleted file mode 100644 index 1ccdcfb250b..00000000000 --- a/packages/amplify-ui-components/src/common/helpers.ts +++ /dev/null @@ -1,218 +0,0 @@ -import { Hub, I18n, Logger } from '@aws-amplify/core'; -import { - UI_AUTH_CHANNEL, - TOAST_AUTH_ERROR_EVENT, - AUTH_STATE_CHANGE_EVENT, - PHONE_EMPTY_ERROR_MESSAGE, - COUNTRY_DIAL_CODE_SUFFIX, - PHONE_SUFFIX, -} from './constants'; -import { - AuthState, - AuthStateHandler, - UsernameAlias, -} from '../common/types/auth-types'; -import { PhoneNumberInterface } from '../components/amplify-auth-fields/amplify-auth-fields-interface'; -import { Translations } from './Translations'; -import Auth from '@aws-amplify/auth'; - -const logger = new Logger('helpers'); - -export interface ToastError { - code?: string; - name?: string; - message: string; -} - -export const hasShadowDom = (el: HTMLElement) => { - return !!el.shadowRoot && !!(el as any).attachShadow; -}; - -/** - * Finds closest element that matches the selector from the ancestor tree. - * Trasverses through shadow DOM and slots. - * - * Adpated from: https://stackoverflow.com/a/56105394 - */ -export const closestElement = (selector: string, base: Element) => { - function _closestFrom(el): Element { - if (!el || el === document || el === window) return null; - if (el.matches(selector)) return base; // return if current element matches the selector - - if (el.assignedSlot) el = el.assignedSlot; // traverse up slots if slotted - const found = el.closest(selector); - return found ? found : _closestFrom(el.getRootNode().host); // try to traverse up shadows - } - return _closestFrom(base); -}; - -export const dispatchToastHubEvent = (error: ToastError) => { - Hub.dispatch(UI_AUTH_CHANNEL, { - event: TOAST_AUTH_ERROR_EVENT, - message: I18n.get(error.message), - }); -}; - -export const dispatchAuthStateChangeEvent: AuthStateHandler = ( - nextAuthState: AuthState, - data?: object -) => { - Hub.dispatch(UI_AUTH_CHANNEL, { - event: AUTH_STATE_CHANGE_EVENT, - message: nextAuthState, - data, - }); -}; - -export const composePhoneNumberInput = (phoneNumber: PhoneNumberInterface) => { - if (!phoneNumber.phoneNumberValue) { - throw new Error(PHONE_EMPTY_ERROR_MESSAGE); - } - - const sanitizedPhoneNumberValue = phoneNumber.phoneNumberValue.replace( - /[-()\s]/g, - '' - ); - - return `${phoneNumber.countryDialCodeValue}${sanitizedPhoneNumberValue}`; -}; - -export const checkUsernameAlias = (usernameAlias: any) => { - if (!(usernameAlias in UsernameAlias)) { - throw new Error( - `Invalid username Alias - ${usernameAlias}. Instead use ${Object.values( - UsernameAlias - )}` - ); - } -}; - -export const onAuthUIStateChange = (authStateHandler: AuthStateHandler) => { - const authUIStateHandler = async data => { - const { payload } = data; - switch (payload.event) { - case AUTH_STATE_CHANGE_EVENT: - if (payload.message) { - if (payload.message === AuthState.SignedIn) { - // for AuthState.SignedIn, use an Auth Guard - try { - const user = await Auth.currentAuthenticatedUser(); - authStateHandler(payload.message as AuthState, user); - } catch (e) { - logger.error('User is not authenticated'); - } - } else { - authStateHandler(payload.message as AuthState, payload.data); - } - } - break; - } - }; - Hub.listen(UI_AUTH_CHANNEL, authUIStateHandler); - - const unsubscribe = () => { - // Replace user's `authStateHandler` with a noop so that we don't trigger side-effects during the async `authUIStateHandler` when unsubscribed - authStateHandler = () => {}; - - Hub.remove(UI_AUTH_CHANNEL, authUIStateHandler); - } - - return unsubscribe; -}; - -export const isHintValid = field => { - return !(field['hint'] === null || typeof field['hint'] === 'string'); -}; - -// Required attributes come from https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims -export const getRequiredAttributesMap = () => ({ - address: { - label: I18n.get(Translations.ADDRESS_LABEL), - placeholder: I18n.get(Translations.ADDRESS_PLACEHOLDER), - }, - nickname: { - label: I18n.get(Translations.NICKNAME_LABEL), - placeholder: I18n.get(Translations.NICKNAME_PLACEHOLDER), - }, - birthdate: { - label: I18n.get(Translations.BIRTHDATE_LABEL), - placeholder: I18n.get(Translations.BIRTHDATE_PLACEHOLDER), - }, - phone_number: { - label: I18n.get(Translations.PHONE_LABEL), - placeholder: I18n.get(Translations.PHONE_PLACEHOLDER), - }, - email: { - lable: I18n.get(Translations.EMAIL_LABEL), - placeholder: I18n.get(Translations.EMAIL_PLACEHOLDER), - }, - picture: { - label: I18n.get(Translations.PICTURE_LABEL), - placeholder: I18n.get(Translations.PICTURE_PLACEHOLDER), - }, - family_name: { - label: I18n.get(Translations.FAMILY_NAME_LABEL), - placeholder: I18n.get(Translations.FAMILY_NAME_PLACEHOLDER), - }, - preferred_username: { - label: I18n.get(Translations.PREFERRED_USERNAME_LABEL), - placeholder: I18n.get(Translations.PREFERRED_USERNAME_PLACEHOLDER), - }, - gender: { - label: I18n.get(Translations.GENDER_LABEL), - placeholder: I18n.get(Translations.GENDER_PLACEHOLDER), - }, - profile: { - label: I18n.get(Translations.PROFILE_LABEL), - placeholder: I18n.get(Translations.PROFILE_PLACEHOLDER), - }, - given_name: { - label: I18n.get(Translations.GIVEN_NAME_LABEL), - placeholder: I18n.get(Translations.GIVEN_NAME_PLACEHOLDER), - }, - zoneinfo: { - label: I18n.get(Translations.ZONEINFO_LABEL), - placeholder: I18n.get(Translations.ZONEINFO_PLACEHOLDER), - }, - locale: { - label: I18n.get(Translations.LOCALE_LABEL), - placeholder: I18n.get(Translations.LOCALE_PLACEHOLDER), - }, - updated_at: { - label: I18n.get(Translations.UPDATED_AT_LABEL), - placeholder: I18n.get(Translations.UPDATED_AT_PLACEHOLDER), - }, - middle_name: { - label: I18n.get(Translations.MIDDLE_NAME_LABEL), - placeholder: I18n.get(Translations.MIDDLE_NAME_PLACEHOLDER), - }, - website: { - label: I18n.get(Translations.WEBSITE_LABEL), - placeholder: I18n.get(Translations.WEBSITE_PLACEHOLDER), - }, - name: { - label: I18n.get(Translations.NAME_LABEL), - placeholder: I18n.get(Translations.NAME_PLACEHOLDER), - }, -}); - -export function handlePhoneNumberChange( - event, - phoneNumber: PhoneNumberInterface -) { - const name = event.target.name; - const value = event.target.value; - - /** Cognito expects to have a string be passed when signing up. Since the Select input is separate - * input from the phone number input, we need to first capture both components values and combined - * them together. - */ - - if (name === COUNTRY_DIAL_CODE_SUFFIX) { - phoneNumber.countryDialCodeValue = value; - } - - if (name === PHONE_SUFFIX) { - phoneNumber.phoneNumberValue = value; - } -} diff --git a/packages/amplify-ui-components/src/common/storage-helpers.ts b/packages/amplify-ui-components/src/common/storage-helpers.ts deleted file mode 100644 index 36df538e7fd..00000000000 --- a/packages/amplify-ui-components/src/common/storage-helpers.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { Storage } from '@aws-amplify/storage'; -import { NO_STORAGE_MODULE_FOUND } from './constants'; -import { Logger } from '@aws-amplify/core'; -import { AccessLevel } from './types/storage-types'; - -export const imageFileType = new Set([ - 'apng', - 'bmp', - 'gif', - 'ico', - 'cur', - 'jpg', - 'jpeg', - 'jfif', - 'pjpeg', - 'pjp', - 'png', - 'svg', - 'tif', - 'tiff', - 'webp', -]); - -export const calcKey = (file: File, fileToKey: string | Function) => { - const { name, size, type } = file; - let key = encodeURI(name); - if (fileToKey) { - if (typeof fileToKey === 'string') { - key = fileToKey; - } else if (typeof fileToKey === 'function') { - key = fileToKey({ name, size, type }); - } else { - key = encodeURI(JSON.stringify(fileToKey)); - } - if (!key) { - key = 'empty_key'; - } - } - - return key.replace(/\s/g, '_'); -}; - -export const getStorageObject = async ( - key: string, - level: AccessLevel, - track: boolean, - identityId: string, - logger: Logger -) => { - if (!Storage || typeof Storage.get !== 'function') { - throw new Error(NO_STORAGE_MODULE_FOUND); - } - - try { - const src = await Storage.get(key, { level, track, identityId }); - logger.debug('Storage image get', src); - return src; - } catch (error) { - throw new Error(error); - } -}; - -const readFileAsync = (blob: Blob) => { - return new Promise((resolve, reject) => { - const reader = new FileReader(); - - reader.onload = () => { - resolve(reader.result as string); - }; - - reader.onerror = () => { - reject('Failed to read file!'); - reader.abort(); - }; - - reader.readAsText(blob); - }); -}; - -export const getTextSource = async ( - key: string, - level: AccessLevel, - track: boolean, - identityId: string, - logger: Logger -) => { - if (!Storage || typeof Storage.get !== 'function') { - throw new Error(NO_STORAGE_MODULE_FOUND); - } - try { - const textSrc = await Storage.get(key, { - download: true, - level, - track, - identityId, - }); - logger.debug(textSrc); - const text = (await readFileAsync(textSrc['Body'] as Blob)) as string; - return text; - } catch (error) { - throw new Error(error); - } -}; - -export const putStorageObject = async ( - key: string, - body: object, - level: AccessLevel, - track: boolean, - contentType: string, - logger: Logger -) => { - if (!Storage || typeof Storage.put !== 'function') { - throw new Error(NO_STORAGE_MODULE_FOUND); - } - - try { - const data = await Storage.put(key, body, { - contentType, - level, - track, - }); - logger.debug('Upload data', data); - } catch (error) { - throw new Error(error); - } -}; diff --git a/packages/amplify-ui-components/src/common/testing.ts b/packages/amplify-ui-components/src/common/testing.ts deleted file mode 100644 index e2b95a36937..00000000000 --- a/packages/amplify-ui-components/src/common/testing.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { - boolean as booleanKnob, - select as selectKnob, - text as textKnob, -} from '@storybook/addon-knobs'; - -export const pixelThreshold = 10; - -export const selectors = { - // amplify-form-field - formFieldDescription: '[data-test=form-field-description]', -}; - -export const knobs = { - labelKnob(labelPlaceholder: string) { - return textKnob('Label', labelPlaceholder); - }, - - descriptionKnob(descriptionPlaceholder: string) { - return textKnob('Description', descriptionPlaceholder); - }, - - hintKnob(hintPlaceholder: string) { - return textKnob('Hint', hintPlaceholder); - }, - - inputTypeKnob(inputTypePlaceholder: string) { - return selectKnob( - 'Type', - [ - 'date', - 'email', - 'number', - 'password', - 'search', - 'tel', - 'text', - 'url', - 'time', - ], - inputTypePlaceholder - ); - }, - - placeholderKnob(placeholderPlaceholder: string) { - return textKnob('Placeholder', placeholderPlaceholder); - }, - - buttonTypeKnob(buttonTypePlaceholder: string) { - return selectKnob( - 'Button type', - ['button', 'submit', 'reset'], - buttonTypePlaceholder - ); - }, - - buttonTextKnob(buttonTextPlaceholder: string) { - return textKnob('Button text', buttonTextPlaceholder); - }, - - toggleKnob(toggleDefault: boolean) { - return booleanKnob('Toggle', toggleDefault); - }, - - disabledKnob(disabledDefault: boolean) { - return booleanKnob('Disabled', disabledDefault); - }, - - formSectionHeaderKnob(headerPlaceholder: string) { - return textKnob('Header text', headerPlaceholder); - }, - - formSectionSubmitKnob(submitPlaceholder: string) { - return textKnob('Submit button text', submitPlaceholder); - }, - - tooltipAutoShowKnob(autoShowDefault: boolean) { - return booleanKnob('Tooltip autoshow', autoShowDefault); - }, -}; diff --git a/packages/amplify-ui-components/src/common/types/auth-types.ts b/packages/amplify-ui-components/src/common/types/auth-types.ts deleted file mode 100644 index 39bf035e8e4..00000000000 --- a/packages/amplify-ui-components/src/common/types/auth-types.ts +++ /dev/null @@ -1,120 +0,0 @@ -// TODO: Move these values to or extract them from the Cognito Provider in the Auth category for Auth V2 - -export enum AuthState { - SignUp = 'signup', - SignOut = 'signout', - SignIn = 'signin', - Loading = 'loading', - SignedOut = 'signedout', - SignedIn = 'signedin', - SigningUp = 'signingup', - ConfirmSignUp = 'confirmSignUp', - confirmingSignUpCustomFlow = 'confirmsignupcustomflow', - ConfirmSignIn = 'confirmSignIn', - confirmingSignInCustomFlow = 'confirmingsignincustomflow', - VerifyingAttributes = 'verifyingattributes', - ForgotPassword = 'forgotpassword', - ResetPassword = 'resettingpassword', - SettingMFA = 'settingMFA', - TOTPSetup = 'TOTPSetup', - CustomConfirmSignIn = 'customConfirmSignIn', - VerifyContact = 'verifyContact', -} - -export interface FederatedConfig { - auth0Config?: { - audience?: string; - clientID: string; - domain: string; - responseType: string; - redirectUri: string; - returnTo?: string; - scope?: string; - }; - amazonClientId?: string; - facebookAppId?: string; - googleClientId?: string; - oauthConfig?: { - [key: string]: any; - }; -} - -export interface SignUpResponseInterface { - codeDeliveryDetails?: { - AttributeName?: string; - DeliveryMedium?: string; - Destination?: string; - }; - user?: CognitoUserInterface; - username?: string; -} - -export interface CognitoUserInterface { - Session?: string | null; - authenticationFlowType?: string; - client?: { - endpoint?: string; - userAgent?: string; - }; - keyPrefix?: string; - pool?: { - advancedSecurityDataCollectionFlag?: boolean; - clientId?: string; - userPoolId?: string; - }; - username?: string; - userConfirmed?: boolean; - userSub?: string; - challengeName: string; - challengeParam: { [key: string]: any }; - unverified?: { - email?: string; - phone_number?: string; - }; - [attributes: string]: any; -} - -export interface SignUpAttributes { - username: string; - password: string; - attributes?: { - [userAttributes: string]: string; - }; -} - -export type AuthStateHandler = ( - nextAuthState: AuthState, - data?: object -) => void; - -export enum MfaOption { - TOTP = 'TOTP', - SMS = 'SMS', - NOMFA = 'NOMFA', -} - -export interface MFATypesInterface { - TOTP?: boolean; - SMS?: boolean; - Optional?: boolean; -} - -export enum ChallengeName { - SoftwareTokenMFA = 'SOFTWARE_TOKEN_MFA', - SMSMFA = 'SMS_MFA', - NewPasswordRequired = 'NEW_PASSWORD_REQUIRED', - MFASetup = 'MFA_SETUP', - CustomChallenge = 'CUSTOM_CHALLENGE', -} - -export enum AuthFormField { - Password = 'password', -} - -export enum UsernameAlias { - username = 'username', - email = 'email', - phone_number = 'phone_number', -} - -export type UsernameAliasStrings = keyof typeof UsernameAlias; diff --git a/packages/amplify-ui-components/src/common/types/interactions-types.ts b/packages/amplify-ui-components/src/common/types/interactions-types.ts deleted file mode 100644 index c4d27babc12..00000000000 --- a/packages/amplify-ui-components/src/common/types/interactions-types.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface ChatResult { - data?: object; - err?: string; -} diff --git a/packages/amplify-ui-components/src/common/types/storage-types.ts b/packages/amplify-ui-components/src/common/types/storage-types.ts deleted file mode 100644 index 9e92a22acc9..00000000000 --- a/packages/amplify-ui-components/src/common/types/storage-types.ts +++ /dev/null @@ -1,13 +0,0 @@ -export enum AccessLevel { - Public = 'public', - Private = 'private', - Protected = 'protected', -} - -export interface StorageObject { - key: string; - contentType?: string; - eTag?: string; - lastModified?: Date; - size?: number; -} diff --git a/packages/amplify-ui-components/src/common/types/ui-types.ts b/packages/amplify-ui-components/src/common/types/ui-types.ts deleted file mode 100644 index c8509081b7c..00000000000 --- a/packages/amplify-ui-components/src/common/types/ui-types.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface InputEvent extends Event {} -export type TextFieldTypes = - | 'date' - | 'email' - | 'number' - | 'password' - | 'search' - | 'tel' - | 'text' - | 'url' - | 'time'; -export type ButtonTypes = 'button' | 'submit' | 'reset'; -export type ButtonVariant = 'button' | 'anchor' | 'icon'; diff --git a/packages/amplify-ui-components/src/components.d.ts b/packages/amplify-ui-components/src/components.d.ts deleted file mode 100644 index 4105e2b9816..00000000000 --- a/packages/amplify-ui-components/src/components.d.ts +++ /dev/null @@ -1,2856 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/** - * This is an autogenerated file created by the Stencil compiler. - * It contains typing information for all components that exist in this project. - */ -import { HTMLStencilElement, JSXBase } from "@stencil/core/internal"; -import { AuthState, AuthStateHandler, CognitoUserInterface, FederatedConfig, MFATypesInterface, UsernameAliasStrings } from "./common/types/auth-types"; -import { FormFieldTypes } from "./components/amplify-auth-fields/amplify-auth-fields-interface"; -import { ButtonTypes, ButtonVariant, InputEvent, TextFieldTypes } from "./common/types/ui-types"; -import { IconNameType } from "./components/amplify-icon/icons"; -import { ChatResult } from "./common/types/interactions-types"; -import { FunctionalComponent } from "@stencil/core"; -import { CountryCodeDialOptions } from "./components/amplify-country-dial-code/amplify-country-dial-code-interface"; -import { AccessLevel, StorageObject } from "./common/types/storage-types"; -import { SelectOptionsNumber, SelectOptionsString } from "./components/amplify-select/amplify-select-interface"; -import { SignUpParams } from "@aws-amplify/auth"; -import { ISignUpResult } from "amazon-cognito-identity-js"; -export namespace Components { - interface AmplifyAmazonButton { - /** - * App-specific client ID from Google - */ - "clientId": FederatedConfig['amazonClientId']; - /** - * Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp - */ - "handleAuthStateChange": AuthStateHandler; - } - interface AmplifyAuthContainer { - } - interface AmplifyAuthFields { - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string | Functional Component | null, required: boolean } ] ``` - */ - "formFields": FormFieldTypes | string[]; - } - interface AmplifyAuth0Button { - /** - * See: https://auth0.com/docs/libraries/auth0js/v9#available-parameters - */ - "config": FederatedConfig['auth0Config']; - /** - * Auth state change handler for this component - */ - "handleAuthStateChange": AuthStateHandler; - } - interface AmplifyAuthenticator { - /** - * Federated credentials & configuration. - */ - "federated": FederatedConfig; - /** - * Callback for Authenticator state machine changes - */ - "handleAuthStateChange": AuthStateHandler; - /** - * Hide amplify-toast for auth errors - */ - "hideToast": boolean; - /** - * Initial starting state of the Authenticator component. E.g. If `signup` is passed the default component is set to AmplifySignUp - */ - "initialAuthState": | AuthState.SignIn - | AuthState.SignUp - | AuthState.ForgotPassword; - /** - * Username Alias is used to setup authentication with `username`, `email` or `phone_number` - */ - "usernameAlias": UsernameAliasStrings; - } - interface AmplifyButton { - /** - * Disabled state of the button - */ - "disabled"?: boolean; - /** - * (Optional) Callback called when a user clicks on the button - */ - "handleButtonClick": (evt: Event) => void; - /** - * Name of icon to be placed inside the button - */ - "icon"?: IconNameType; - /** - * Type of the button: 'button', 'submit' or 'reset' - */ - "type": ButtonTypes; - /** - * Variant of a button: 'button' | 'anchor | 'icon' - */ - "variant": ButtonVariant; - } - interface AmplifyChatbot { - /** - * Name of the bot - */ - "botName": string; - /** - * Text placed in the top header - */ - "botTitle": string; - /** - * Clear messages when conversation finishes - */ - "clearOnComplete": boolean; - /** - * Continue listening to users after they send the message - */ - "conversationModeOn": boolean; - /** - * Noise threshold between -1 and 1. Anything below is considered a silence. - */ - "silenceThreshold": number; - /** - * Amount of silence (in ms) to wait for - */ - "silenceTime": number; - /** - * Whether text chat is enabled - */ - "textEnabled": boolean; - /** - * Whether voice chat is enabled - */ - "voiceEnabled": boolean; - /** - * Greeting message displayed to users - */ - "welcomeMessage": string; - } - interface AmplifyCheckbox { - /** - * If `true`, the checkbox is selected. - */ - "checked": boolean; - /** - * If `true`, the checkbox is disabled - */ - "disabled": boolean; - /** - * Field ID used for the 'htmlFor' in the label - */ - "fieldId": string; - /** - * Label for the checkbox - */ - "label": string; - /** - * Name of the checkbox - */ - "name"?: string; - /** - * Value of the checkbox - */ - "value"?: string; - } - interface AmplifyCodeField { - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * Based on the type of field e.g. sign in, sign up, forgot password, etc. - */ - "fieldId": string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * Used as the hint in case you forgot your confirmation code, etc. - */ - "hint": string | FunctionalComponent | null; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * Used for the code label - */ - "label": string; - /** - * Used for the placeholder label - */ - "placeholder": string; - /** - * The required flag in order to make an input required prior to submitting a form - */ - "required": boolean; - /** - * The value of the content inside of the input field - */ - "value"?: string; - } - interface AmplifyConfirmSignIn { - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string | Functional Component | null, required: boolean } ] ``` - */ - "formFields": FormFieldTypes | string[]; - /** - * Auth state change handler for this component - */ - "handleAuthStateChange": AuthStateHandler; - /** - * Fires when confirm sign in form is submitted - */ - "handleSubmit": (event: Event) => void; - /** - * Used for header text in confirm sign in component - */ - "headerText": string; - /** - * Used for the submit button text in confirm sign in component - */ - "submitButtonText": string; - /** - * Cognito user signing in - */ - "user": CognitoUserInterface; - } - interface AmplifyConfirmSignUp { - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string | Functional Component | null, required: boolean } ] ``` - */ - "formFields": FormFieldTypes | string[]; - /** - * Auth state change handler for this components e.g. SignIn -> 'Create Account' link -> SignUp - */ - "handleAuthStateChange": AuthStateHandler; - /** - * Fires when sign up form is submitted - */ - "handleSubmit": (submitEvent: Event) => void; - /** - * Used for header text in confirm sign up component - */ - "headerText": string; - /** - * Used for the submit button text in confirm sign up component - */ - "submitButtonText": string; - /** - * Used for the username to be passed to resend code - */ - "user": CognitoUserInterface; - /** - * Username Alias is used to setup authentication with `username`, `email` or `phone_number` - */ - "usernameAlias": UsernameAliasStrings; - } - interface AmplifyContainer { - } - interface AmplifyCountryDialCode { - /** - * Default selected dial code - */ - "dialCode": string | number; - /** - * The ID of the field. Should match with its corresponding input's ID. - */ - "fieldId": string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * The options of the country dial code select input. - */ - "options": CountryCodeDialOptions; - } - interface AmplifyEmailField { - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * Based on the type of field e.g. sign in, sign up, forgot password, etc. - */ - "fieldId": string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * Used for the hint text that displays underneath the input field - */ - "hint"?: string | FunctionalComponent | null; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * Used for the EMAIL label - */ - "label": string; - /** - * Used for the placeholder label - */ - "placeholder": string; - /** - * The required flag in order to make an input required prior to submitting a form - */ - "required": boolean; - /** - * The value of the content inside of the input field - */ - "value"?: string; - } - interface AmplifyFacebookButton { - /** - * App-specific client ID from Facebook - */ - "appId": FederatedConfig['facebookAppId']; - /** - * Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp - */ - "handleAuthStateChange": AuthStateHandler; - } - interface AmplifyFederatedButtons { - /** - * The current authentication state. - */ - "authState": AuthState; - /** - * Federated credentials & configuration. - */ - "federated": FederatedConfig; - /** - * Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp - */ - "handleAuthStateChange": AuthStateHandler; - } - interface AmplifyFederatedSignIn { - /** - * The current authentication state. - */ - "authState": AuthState; - /** - * Federated credentials & configuration. - */ - "federated": any; - } - interface AmplifyForgotPassword { - /** - * The form fields displayed inside of the forgot password form - */ - "formFields": FormFieldTypes | string[]; - /** - * Auth state change handler for this component - */ - "handleAuthStateChange": AuthStateHandler; - /** - * The function called when making a request to reset password - */ - "handleSend": (event: Event) => void; - /** - * The function called when submitting a new password - */ - "handleSubmit": (event: Event) => void; - /** - * The header text of the forgot password section - */ - "headerText": string; - /** - * The text displayed inside of the send code button for the form - */ - "sendButtonText": string; - /** - * The text displayed inside of the submit button for the form - */ - "submitButtonText": string; - /** - * Username Alias is used to setup authentication with `username`, `email` or `phone_number` - */ - "usernameAlias": UsernameAliasStrings; - } - interface AmplifyFormField { - /** - * The text of the description. Goes between the label and the input. - */ - "description": string | null; - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * The ID of the field. Should match with its corresponding input's ID. - */ - "fieldId": string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * The text of a hint to the user as to how to fill out the input. Goes just below the input. - */ - "hint": string | FunctionalComponent | null; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * The text of the label. Goes above the input. Ex: 'First name' - */ - "label": string | null; - /** - * (Optional) String value for the name of the input. - */ - "name"?: string; - /** - * (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. - */ - "placeholder"?: string; - /** - * The required flag in order to make an input required prior to submitting a form - */ - "required": boolean; - /** - * The input type. Can be any HTML input type. - */ - "type"?: TextFieldTypes; - /** - * The value of the content inside of the input field - */ - "value": string; - } - interface AmplifyFormSection { - /** - * (Required) Function called upon submission of form - */ - "handleSubmit": (event: Event) => void; - /** - * Used for form section header - */ - "headerText": string; - /** - * Loading state for the form - */ - "loading"?: boolean; - /** - * Secondary footer component or text - */ - "secondaryFooterContent": string | FunctionalComponent | null; - /** - * (Optional) Used as a the default value within the default footer slot - */ - "submitButtonText"?: string; - /** - * String prefix for the data-test attributes in this component primarily used for testing purposes - */ - "testDataPrefix"?: string; - } - interface AmplifyGoogleButton { - /** - * App-specific client ID from Google - */ - "clientId": FederatedConfig['googleClientId']; - /** - * Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp - */ - "handleAuthStateChange": AuthStateHandler; - } - interface AmplifyGreetings { - /** - * Auth state change handler for this component - */ - "handleAuthStateChange": AuthStateHandler; - /** - * Logo displayed inside of the header - */ - "logo": FunctionalComponent | null; - /** - * Username displayed in the greetings - */ - "username": string; - } - interface AmplifyHint { - } - interface AmplifyIcon { - /** - * (Required) Name of icon used to determine the icon rendered - */ - "name": IconNameType; - } - interface AmplifyIconButton { - /** - * (Optional) Whether or not to show the tooltip automatically - */ - "autoShowTooltip": boolean; - /** - * The name of the icon used inside of the button - */ - "name": IconNameType; - /** - * (Optional) The tooltip that will show on hover of the button - */ - "tooltip": string | null; - } - interface AmplifyInput { - /** - * The text of the description. Goes just below the label. - */ - "description": string | null; - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * The ID of the field. Should match with its corresponding input's ID. - */ - "fieldId": string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: InputEvent) => void; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * (Optional) String value for the name of the input. - */ - "name"?: string; - /** - * (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. - */ - "placeholder"?: string; - /** - * Whether the input is a required field - */ - "required"?: boolean; - /** - * The input type. Can be any HTML input type. - */ - "type"?: TextFieldTypes; - /** - * The value of the content inside of the input field - */ - "value": string; - } - interface AmplifyLabel { - /** - * Reflects the value of the for content property of html element - */ - "htmlFor": string; - } - interface AmplifyLink { - /** - * The link role is used to identify an element that creates a hyperlink to a resource that is in the application or external - */ - "role": string; - } - interface AmplifyLoadingSpinner { - } - interface AmplifyNav { - } - interface AmplifyOauthButton { - /** - * Federated credentials & configuration. - */ - "config": FederatedConfig['oauthConfig']; - } - interface AmplifyPasswordField { - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * Based on the type of field e.g. sign in, sign up, forgot password, etc. - */ - "fieldId": string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * Used as the hint in case you forgot your password, etc. - */ - "hint": string | FunctionalComponent | null; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * Used for the password label - */ - "label": string; - /** - * Used for the placeholder label - */ - "placeholder": string; - /** - * The required flag in order to make an input required prior to submitting a form - */ - "required": boolean; - /** - * The value of the content inside of the input field - */ - "value"?: string; - } - interface AmplifyPhoneField { - /** - * Default dial code in the phone field - */ - "dialCode"?: string | number; - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * Based on the type of field e.g. sign in, sign up, forgot password, etc. - */ - "fieldId": string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * Used as the hint in case you forgot your confirmation code, etc. - */ - "hint": string | FunctionalComponent | null; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * Used for the Phone label - */ - "label": string; - /** - * Used for the placeholder label - */ - "placeholder": string; - /** - * The required flag in order to make an input required prior to submitting a form - */ - "required": boolean; - /** - * The value of the content inside of the input field - */ - "value": string; - } - interface AmplifyPhotoPicker { - /** - * Picker button text as string - */ - "buttonText"?: string; - /** - * Function that handles file pick onClick - */ - "handleClick"?: (file: File) => void; - /** - * Header Hint value in string - */ - "headerHint"?: string; - /** - * Title string value - */ - "headerTitle"?: string; - /** - * Placeholder hint that goes under the placeholder image - */ - "placeholderHint"?: string; - /** - * Source of the image to be previewed - */ - "previewSrc"?: string | object; - } - interface AmplifyPicker { - /** - * File input accept value - */ - "acceptValue": string; - /** - * File input onChange handler - */ - "inputHandler": (e: Event) => void; - /** - * Picker button text - */ - "pickerText": string; - } - interface AmplifyRadioButton { - /** - * If `true`, the radio button is selected. - */ - "checked": boolean; - /** - * If `true`, the checkbox is disabled - */ - "disabled": boolean; - /** - * Field ID used for the 'for' in the label - */ - "fieldId": string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * Label for the radio button - */ - "label": string; - /** - * (Optional) Name of radio button - */ - "name"?: string; - /** - * (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. - */ - "placeholder"?: string; - /** - * (Optional) Value of radio button - */ - "value"?: string; - } - interface AmplifyRequireNewPassword { - /** - * The form fields displayed inside of the forgot password form - */ - "formFields": FormFieldTypes; - /** - * Auth state change handler for this component - */ - "handleAuthStateChange": AuthStateHandler; - /** - * The function called when submitting a new password - */ - "handleSubmit": (event: Event) => void; - /** - * The header text of the forgot password section - */ - "headerText": string; - /** - * The text displayed inside of the submit button for the form - */ - "submitButtonText": string; - /** - * Used for the username to be passed to resend code - */ - "user": CognitoUserInterface; - } - interface AmplifyS3Album { - /** - * The content type header used when uploading to S3 - */ - "contentType": string; - /** - * Callback used to generate custom key value - */ - "fileToKey": (data: object) => string | string; - /** - * Filter to be applied on album list - */ - "filter": (list: StorageObject[]) => StorageObject[]; - /** - * Function executed when error occurs for the s3-image - */ - "handleOnError": (event: Event) => void; - /** - * Function executed when s3-image loads - */ - "handleOnLoad": (event: Event) => void; - /** - * Cognito identity id of the another user's image list - */ - "identityId": string; - /** - * The access level of the files - */ - "level": AccessLevel; - /** - * String representing directory location of image files to be listed - */ - "path": string; - /** - * Boolean to enable or disable picker - */ - "picker": boolean; - /** - * Picker button text - */ - "pickerText": string; - /** - * Sort to be applied on album list - */ - "sort": (list: StorageObject[]) => StorageObject[]; - /** - * Whether or not to use track the get/put of the listing of images - */ - "track": boolean; - } - interface AmplifyS3Image { - /** - * String representing the alternate image text - */ - "alt": string; - /** - * Image body content to be uploaded - */ - "body": object; - /** - * The content type header used when uploading to S3 - */ - "contentType": string; - /** - * Function executed when error occurs for the image - */ - "handleOnError": (event: Event) => void; - /** - * Function executed when image loads - */ - "handleOnLoad": (event: Event) => void; - /** - * Cognito identity id of the another user's image - */ - "identityId": string; - /** - * The key of the image object in S3 - */ - "imgKey": string; - /** - * Attributes to be placed on the img element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes - */ - "imgProps"?: Record; - /** - * The access level of the image - */ - "level": AccessLevel; - /** - * String representing directory location to image file - */ - "path": string; - /** - * Whether or not to use track on get/put of the image - */ - "track": boolean; - } - interface AmplifyS3ImagePicker { - /** - * Upload Button Text as string - */ - "buttonText"?: string; - /** - * The content type header used when uploading to S3 - */ - "contentType": string; - /** - * Callback used to generate custom key value - */ - "fileToKey": (data: object) => string | string; - /** - * Header Hint value in string - */ - "headerHint"?: string; - /** - * Title string value - */ - "headerTitle"?: string; - /** - * Cognito identity id of the another user's image - */ - "identityId": string; - /** - * The access level of the image - */ - "level": AccessLevel; - /** - * String representing directory location to image file - */ - "path": string; - /** - * Placeholder hint that goes under the placeholder image - */ - "placeholderHint"?: string; - /** - * Whether or not to use track the get/put of the image - */ - "track": boolean; - } - interface AmplifyS3Text { - /** - * Text body content to be uploaded - */ - "body": object; - /** - * The content type header used when uploading to S3 - */ - "contentType": string; - /** - * Fallback content - */ - "fallbackText": string; - /** - * Cognito identity id of the another user's text file - */ - "identityId": string; - /** - * The access level of the text file - */ - "level": AccessLevel; - /** - * String representing directory location to text file - */ - "path": string; - /** - * The key of the text object in S3 - */ - "textKey": string; - /** - * Whether or not to use track the get/put of the text file - */ - "track": boolean; - } - interface AmplifyS3TextPicker { - /** - * The content type header used when uploading to S3 - */ - "contentType": string; - /** - * Fallback content for aplify-s3-text - */ - "fallbackText": string; - /** - * Callback used to generate custom key value - */ - "fileToKey": (data: object) => string | string; - /** - * Cognito identity id of the another user's text file - */ - "identityId": string; - /** - * The access level of the text file - */ - "level": AccessLevel; - /** - * String representing directory location to text file - */ - "path": string; - /** - * Whether or not to use track the get/put of the text file - */ - "track": boolean; - } - interface AmplifySection { - /** - * Equivalent to html section role - */ - "role": string; - } - interface AmplifySelect { - /** - * Used for id field - */ - "fieldId": string; - /** - * The callback, called when the select is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * The options of the select input. Must be an Array of Objects with an Object shape of {label: string, value: string|number} - */ - "options": | SelectOptionsString - | SelectOptionsNumber; - /** - * Default selected option - */ - "selected"?: string | number; - } - interface AmplifySelectMfaType { - /** - * Types of MFA options - */ - "MFATypes": MFATypesInterface; - /** - * Current authenticated user in order to sign requests properly for TOTP - */ - "authData": CognitoUserInterface; - /** - * Fires when Verify is clicked - */ - "handleSubmit": (event: Event) => void; - } - interface AmplifySignIn { - /** - * Federated credentials & configuration. - */ - "federated": FederatedConfig; - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string | Functional Component | null, required: boolean } ] ``` - */ - "formFields": FormFieldTypes | string[]; - /** - * Auth state change handler for this component - */ - "handleAuthStateChange": AuthStateHandler; - /** - * Fires when sign in form is submitted - */ - "handleSubmit": (event: Event) => void; - /** - * Used for header text in sign in component - */ - "headerText": string; - /** - * Hides the sign up link - */ - "hideSignUp": boolean; - /** - * Used for the submit button text in sign in component - */ - "submitButtonText": string; - /** - * Username Alias is used to setup authentication with `username`, `email` or `phone_number` - */ - "usernameAlias": UsernameAliasStrings; - } - interface AmplifySignInButton { - /** - * Specifies the federation provider. - */ - "provider": 'amazon' | 'auth0' | 'facebook' | 'google' | 'oauth'; - } - interface AmplifySignOut { - /** - * Text inside of the Sign Out button - */ - "buttonText": string; - /** - * Auth state change handler for this component - */ - "handleAuthStateChange": AuthStateHandler; - } - interface AmplifySignUp { - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string | Functional Component | null, required: boolean } ] ``` - */ - "formFields": FormFieldTypes | string[]; - /** - * Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp - */ - "handleAuthStateChange": AuthStateHandler; - /** - * Override for handling the Auth.SignUp API call - */ - "handleSignUp": ( - params: SignUpParams - ) => Promise; - /** - * Fires when sign up form is submitted - */ - "handleSubmit": (event: Event) => void; - /** - * Used for the submit button text in sign up component - */ - "haveAccountText": string; - /** - * Used for header text in sign up component - */ - "headerText": string; - /** - * Text used for the sign in hyperlink - */ - "signInText": string; - /** - * Used for the submit button text in sign up component - */ - "submitButtonText": string; - /** - * Username Alias is used to setup authentication with `username`, `email` or `phone_number` - */ - "usernameAlias": UsernameAliasStrings; - /** - * Engages when invalid actions occur, such as missing field, etc. - */ - "validationErrors": string; - } - interface AmplifyStrike { - } - interface AmplifyToast { - /** - * Used in order to add a dismissable `x` for the Toast component - */ - "handleClose": () => void; - /** - * Message to be displayed inside the toast - */ - "message": string; - } - interface AmplifyTooltip { - /** - * (Optional) Whether or not the tooltip should be automatically shown, i.e. not disappear when not hovered - */ - "shouldAutoShow": boolean; - /** - * (Required) The text in the tooltip - */ - "text": string; - } - interface AmplifyTotpSetup { - /** - * Auth state change handler for this component - */ - "handleAuthStateChange": AuthStateHandler; - /** - * This is run after totp setup is complete. Useful if using this as standalone. - */ - "handleComplete": ( - user: CognitoUserInterface - ) => void | Promise; - /** - * Used for header text in totp setup component - */ - "headerText": string; - /** - * Used for customizing the issuer string in the qr code image - */ - "issuer": string; - /** - * Set this to true if this component is running outside the default `amplify-authenticator` usage - */ - "standalone": boolean; - /** - * Used in order to configure TOTP for a user - */ - "user": CognitoUserInterface; - } - interface AmplifyUsernameField { - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * Based on the type of field e.g. sign in, sign up, forgot password, etc. - */ - "fieldId": string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * Used for the hint text that displays underneath the input field - */ - "hint"?: string | FunctionalComponent | null; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * Used for the username label - */ - "label": string; - /** - * Used for the placeholder label - */ - "placeholder": string; - /** - * The required flag in order to make an input required prior to submitting a form - */ - "required": boolean; - /** - * The value of the content inside of the input field - */ - "value"?: string; - } - interface AmplifyVerifyContact { - /** - * Authentication state handler - */ - "handleAuthStateChange": AuthStateHandler; - /** - * User with unverified contact information - */ - "user": CognitoUserInterface; - } -} -declare global { - interface HTMLAmplifyAmazonButtonElement extends Components.AmplifyAmazonButton, HTMLStencilElement { - } - var HTMLAmplifyAmazonButtonElement: { - prototype: HTMLAmplifyAmazonButtonElement; - new (): HTMLAmplifyAmazonButtonElement; - }; - interface HTMLAmplifyAuthContainerElement extends Components.AmplifyAuthContainer, HTMLStencilElement { - } - var HTMLAmplifyAuthContainerElement: { - prototype: HTMLAmplifyAuthContainerElement; - new (): HTMLAmplifyAuthContainerElement; - }; - interface HTMLAmplifyAuthFieldsElement extends Components.AmplifyAuthFields, HTMLStencilElement { - } - var HTMLAmplifyAuthFieldsElement: { - prototype: HTMLAmplifyAuthFieldsElement; - new (): HTMLAmplifyAuthFieldsElement; - }; - interface HTMLAmplifyAuth0ButtonElement extends Components.AmplifyAuth0Button, HTMLStencilElement { - } - var HTMLAmplifyAuth0ButtonElement: { - prototype: HTMLAmplifyAuth0ButtonElement; - new (): HTMLAmplifyAuth0ButtonElement; - }; - interface HTMLAmplifyAuthenticatorElement extends Components.AmplifyAuthenticator, HTMLStencilElement { - } - var HTMLAmplifyAuthenticatorElement: { - prototype: HTMLAmplifyAuthenticatorElement; - new (): HTMLAmplifyAuthenticatorElement; - }; - interface HTMLAmplifyButtonElement extends Components.AmplifyButton, HTMLStencilElement { - } - var HTMLAmplifyButtonElement: { - prototype: HTMLAmplifyButtonElement; - new (): HTMLAmplifyButtonElement; - }; - interface HTMLAmplifyChatbotElement extends Components.AmplifyChatbot, HTMLStencilElement { - } - var HTMLAmplifyChatbotElement: { - prototype: HTMLAmplifyChatbotElement; - new (): HTMLAmplifyChatbotElement; - }; - interface HTMLAmplifyCheckboxElement extends Components.AmplifyCheckbox, HTMLStencilElement { - } - var HTMLAmplifyCheckboxElement: { - prototype: HTMLAmplifyCheckboxElement; - new (): HTMLAmplifyCheckboxElement; - }; - interface HTMLAmplifyCodeFieldElement extends Components.AmplifyCodeField, HTMLStencilElement { - } - var HTMLAmplifyCodeFieldElement: { - prototype: HTMLAmplifyCodeFieldElement; - new (): HTMLAmplifyCodeFieldElement; - }; - interface HTMLAmplifyConfirmSignInElement extends Components.AmplifyConfirmSignIn, HTMLStencilElement { - } - var HTMLAmplifyConfirmSignInElement: { - prototype: HTMLAmplifyConfirmSignInElement; - new (): HTMLAmplifyConfirmSignInElement; - }; - interface HTMLAmplifyConfirmSignUpElement extends Components.AmplifyConfirmSignUp, HTMLStencilElement { - } - var HTMLAmplifyConfirmSignUpElement: { - prototype: HTMLAmplifyConfirmSignUpElement; - new (): HTMLAmplifyConfirmSignUpElement; - }; - interface HTMLAmplifyContainerElement extends Components.AmplifyContainer, HTMLStencilElement { - } - var HTMLAmplifyContainerElement: { - prototype: HTMLAmplifyContainerElement; - new (): HTMLAmplifyContainerElement; - }; - interface HTMLAmplifyCountryDialCodeElement extends Components.AmplifyCountryDialCode, HTMLStencilElement { - } - var HTMLAmplifyCountryDialCodeElement: { - prototype: HTMLAmplifyCountryDialCodeElement; - new (): HTMLAmplifyCountryDialCodeElement; - }; - interface HTMLAmplifyEmailFieldElement extends Components.AmplifyEmailField, HTMLStencilElement { - } - var HTMLAmplifyEmailFieldElement: { - prototype: HTMLAmplifyEmailFieldElement; - new (): HTMLAmplifyEmailFieldElement; - }; - interface HTMLAmplifyFacebookButtonElement extends Components.AmplifyFacebookButton, HTMLStencilElement { - } - var HTMLAmplifyFacebookButtonElement: { - prototype: HTMLAmplifyFacebookButtonElement; - new (): HTMLAmplifyFacebookButtonElement; - }; - interface HTMLAmplifyFederatedButtonsElement extends Components.AmplifyFederatedButtons, HTMLStencilElement { - } - var HTMLAmplifyFederatedButtonsElement: { - prototype: HTMLAmplifyFederatedButtonsElement; - new (): HTMLAmplifyFederatedButtonsElement; - }; - interface HTMLAmplifyFederatedSignInElement extends Components.AmplifyFederatedSignIn, HTMLStencilElement { - } - var HTMLAmplifyFederatedSignInElement: { - prototype: HTMLAmplifyFederatedSignInElement; - new (): HTMLAmplifyFederatedSignInElement; - }; - interface HTMLAmplifyForgotPasswordElement extends Components.AmplifyForgotPassword, HTMLStencilElement { - } - var HTMLAmplifyForgotPasswordElement: { - prototype: HTMLAmplifyForgotPasswordElement; - new (): HTMLAmplifyForgotPasswordElement; - }; - interface HTMLAmplifyFormFieldElement extends Components.AmplifyFormField, HTMLStencilElement { - } - var HTMLAmplifyFormFieldElement: { - prototype: HTMLAmplifyFormFieldElement; - new (): HTMLAmplifyFormFieldElement; - }; - interface HTMLAmplifyFormSectionElement extends Components.AmplifyFormSection, HTMLStencilElement { - } - var HTMLAmplifyFormSectionElement: { - prototype: HTMLAmplifyFormSectionElement; - new (): HTMLAmplifyFormSectionElement; - }; - interface HTMLAmplifyGoogleButtonElement extends Components.AmplifyGoogleButton, HTMLStencilElement { - } - var HTMLAmplifyGoogleButtonElement: { - prototype: HTMLAmplifyGoogleButtonElement; - new (): HTMLAmplifyGoogleButtonElement; - }; - interface HTMLAmplifyGreetingsElement extends Components.AmplifyGreetings, HTMLStencilElement { - } - var HTMLAmplifyGreetingsElement: { - prototype: HTMLAmplifyGreetingsElement; - new (): HTMLAmplifyGreetingsElement; - }; - interface HTMLAmplifyHintElement extends Components.AmplifyHint, HTMLStencilElement { - } - var HTMLAmplifyHintElement: { - prototype: HTMLAmplifyHintElement; - new (): HTMLAmplifyHintElement; - }; - interface HTMLAmplifyIconElement extends Components.AmplifyIcon, HTMLStencilElement { - } - var HTMLAmplifyIconElement: { - prototype: HTMLAmplifyIconElement; - new (): HTMLAmplifyIconElement; - }; - interface HTMLAmplifyIconButtonElement extends Components.AmplifyIconButton, HTMLStencilElement { - } - var HTMLAmplifyIconButtonElement: { - prototype: HTMLAmplifyIconButtonElement; - new (): HTMLAmplifyIconButtonElement; - }; - interface HTMLAmplifyInputElement extends Components.AmplifyInput, HTMLStencilElement { - } - var HTMLAmplifyInputElement: { - prototype: HTMLAmplifyInputElement; - new (): HTMLAmplifyInputElement; - }; - interface HTMLAmplifyLabelElement extends Components.AmplifyLabel, HTMLStencilElement { - } - var HTMLAmplifyLabelElement: { - prototype: HTMLAmplifyLabelElement; - new (): HTMLAmplifyLabelElement; - }; - interface HTMLAmplifyLinkElement extends Components.AmplifyLink, HTMLStencilElement { - } - var HTMLAmplifyLinkElement: { - prototype: HTMLAmplifyLinkElement; - new (): HTMLAmplifyLinkElement; - }; - interface HTMLAmplifyLoadingSpinnerElement extends Components.AmplifyLoadingSpinner, HTMLStencilElement { - } - var HTMLAmplifyLoadingSpinnerElement: { - prototype: HTMLAmplifyLoadingSpinnerElement; - new (): HTMLAmplifyLoadingSpinnerElement; - }; - interface HTMLAmplifyNavElement extends Components.AmplifyNav, HTMLStencilElement { - } - var HTMLAmplifyNavElement: { - prototype: HTMLAmplifyNavElement; - new (): HTMLAmplifyNavElement; - }; - interface HTMLAmplifyOauthButtonElement extends Components.AmplifyOauthButton, HTMLStencilElement { - } - var HTMLAmplifyOauthButtonElement: { - prototype: HTMLAmplifyOauthButtonElement; - new (): HTMLAmplifyOauthButtonElement; - }; - interface HTMLAmplifyPasswordFieldElement extends Components.AmplifyPasswordField, HTMLStencilElement { - } - var HTMLAmplifyPasswordFieldElement: { - prototype: HTMLAmplifyPasswordFieldElement; - new (): HTMLAmplifyPasswordFieldElement; - }; - interface HTMLAmplifyPhoneFieldElement extends Components.AmplifyPhoneField, HTMLStencilElement { - } - var HTMLAmplifyPhoneFieldElement: { - prototype: HTMLAmplifyPhoneFieldElement; - new (): HTMLAmplifyPhoneFieldElement; - }; - interface HTMLAmplifyPhotoPickerElement extends Components.AmplifyPhotoPicker, HTMLStencilElement { - } - var HTMLAmplifyPhotoPickerElement: { - prototype: HTMLAmplifyPhotoPickerElement; - new (): HTMLAmplifyPhotoPickerElement; - }; - interface HTMLAmplifyPickerElement extends Components.AmplifyPicker, HTMLStencilElement { - } - var HTMLAmplifyPickerElement: { - prototype: HTMLAmplifyPickerElement; - new (): HTMLAmplifyPickerElement; - }; - interface HTMLAmplifyRadioButtonElement extends Components.AmplifyRadioButton, HTMLStencilElement { - } - var HTMLAmplifyRadioButtonElement: { - prototype: HTMLAmplifyRadioButtonElement; - new (): HTMLAmplifyRadioButtonElement; - }; - interface HTMLAmplifyRequireNewPasswordElement extends Components.AmplifyRequireNewPassword, HTMLStencilElement { - } - var HTMLAmplifyRequireNewPasswordElement: { - prototype: HTMLAmplifyRequireNewPasswordElement; - new (): HTMLAmplifyRequireNewPasswordElement; - }; - interface HTMLAmplifyS3AlbumElement extends Components.AmplifyS3Album, HTMLStencilElement { - } - var HTMLAmplifyS3AlbumElement: { - prototype: HTMLAmplifyS3AlbumElement; - new (): HTMLAmplifyS3AlbumElement; - }; - interface HTMLAmplifyS3ImageElement extends Components.AmplifyS3Image, HTMLStencilElement { - } - var HTMLAmplifyS3ImageElement: { - prototype: HTMLAmplifyS3ImageElement; - new (): HTMLAmplifyS3ImageElement; - }; - interface HTMLAmplifyS3ImagePickerElement extends Components.AmplifyS3ImagePicker, HTMLStencilElement { - } - var HTMLAmplifyS3ImagePickerElement: { - prototype: HTMLAmplifyS3ImagePickerElement; - new (): HTMLAmplifyS3ImagePickerElement; - }; - interface HTMLAmplifyS3TextElement extends Components.AmplifyS3Text, HTMLStencilElement { - } - var HTMLAmplifyS3TextElement: { - prototype: HTMLAmplifyS3TextElement; - new (): HTMLAmplifyS3TextElement; - }; - interface HTMLAmplifyS3TextPickerElement extends Components.AmplifyS3TextPicker, HTMLStencilElement { - } - var HTMLAmplifyS3TextPickerElement: { - prototype: HTMLAmplifyS3TextPickerElement; - new (): HTMLAmplifyS3TextPickerElement; - }; - interface HTMLAmplifySectionElement extends Components.AmplifySection, HTMLStencilElement { - } - var HTMLAmplifySectionElement: { - prototype: HTMLAmplifySectionElement; - new (): HTMLAmplifySectionElement; - }; - interface HTMLAmplifySelectElement extends Components.AmplifySelect, HTMLStencilElement { - } - var HTMLAmplifySelectElement: { - prototype: HTMLAmplifySelectElement; - new (): HTMLAmplifySelectElement; - }; - interface HTMLAmplifySelectMfaTypeElement extends Components.AmplifySelectMfaType, HTMLStencilElement { - } - var HTMLAmplifySelectMfaTypeElement: { - prototype: HTMLAmplifySelectMfaTypeElement; - new (): HTMLAmplifySelectMfaTypeElement; - }; - interface HTMLAmplifySignInElement extends Components.AmplifySignIn, HTMLStencilElement { - } - var HTMLAmplifySignInElement: { - prototype: HTMLAmplifySignInElement; - new (): HTMLAmplifySignInElement; - }; - interface HTMLAmplifySignInButtonElement extends Components.AmplifySignInButton, HTMLStencilElement { - } - var HTMLAmplifySignInButtonElement: { - prototype: HTMLAmplifySignInButtonElement; - new (): HTMLAmplifySignInButtonElement; - }; - interface HTMLAmplifySignOutElement extends Components.AmplifySignOut, HTMLStencilElement { - } - var HTMLAmplifySignOutElement: { - prototype: HTMLAmplifySignOutElement; - new (): HTMLAmplifySignOutElement; - }; - interface HTMLAmplifySignUpElement extends Components.AmplifySignUp, HTMLStencilElement { - } - var HTMLAmplifySignUpElement: { - prototype: HTMLAmplifySignUpElement; - new (): HTMLAmplifySignUpElement; - }; - interface HTMLAmplifyStrikeElement extends Components.AmplifyStrike, HTMLStencilElement { - } - var HTMLAmplifyStrikeElement: { - prototype: HTMLAmplifyStrikeElement; - new (): HTMLAmplifyStrikeElement; - }; - interface HTMLAmplifyToastElement extends Components.AmplifyToast, HTMLStencilElement { - } - var HTMLAmplifyToastElement: { - prototype: HTMLAmplifyToastElement; - new (): HTMLAmplifyToastElement; - }; - interface HTMLAmplifyTooltipElement extends Components.AmplifyTooltip, HTMLStencilElement { - } - var HTMLAmplifyTooltipElement: { - prototype: HTMLAmplifyTooltipElement; - new (): HTMLAmplifyTooltipElement; - }; - interface HTMLAmplifyTotpSetupElement extends Components.AmplifyTotpSetup, HTMLStencilElement { - } - var HTMLAmplifyTotpSetupElement: { - prototype: HTMLAmplifyTotpSetupElement; - new (): HTMLAmplifyTotpSetupElement; - }; - interface HTMLAmplifyUsernameFieldElement extends Components.AmplifyUsernameField, HTMLStencilElement { - } - var HTMLAmplifyUsernameFieldElement: { - prototype: HTMLAmplifyUsernameFieldElement; - new (): HTMLAmplifyUsernameFieldElement; - }; - interface HTMLAmplifyVerifyContactElement extends Components.AmplifyVerifyContact, HTMLStencilElement { - } - var HTMLAmplifyVerifyContactElement: { - prototype: HTMLAmplifyVerifyContactElement; - new (): HTMLAmplifyVerifyContactElement; - }; - interface HTMLElementTagNameMap { - "amplify-amazon-button": HTMLAmplifyAmazonButtonElement; - "amplify-auth-container": HTMLAmplifyAuthContainerElement; - "amplify-auth-fields": HTMLAmplifyAuthFieldsElement; - "amplify-auth0-button": HTMLAmplifyAuth0ButtonElement; - "amplify-authenticator": HTMLAmplifyAuthenticatorElement; - "amplify-button": HTMLAmplifyButtonElement; - "amplify-chatbot": HTMLAmplifyChatbotElement; - "amplify-checkbox": HTMLAmplifyCheckboxElement; - "amplify-code-field": HTMLAmplifyCodeFieldElement; - "amplify-confirm-sign-in": HTMLAmplifyConfirmSignInElement; - "amplify-confirm-sign-up": HTMLAmplifyConfirmSignUpElement; - "amplify-container": HTMLAmplifyContainerElement; - "amplify-country-dial-code": HTMLAmplifyCountryDialCodeElement; - "amplify-email-field": HTMLAmplifyEmailFieldElement; - "amplify-facebook-button": HTMLAmplifyFacebookButtonElement; - "amplify-federated-buttons": HTMLAmplifyFederatedButtonsElement; - "amplify-federated-sign-in": HTMLAmplifyFederatedSignInElement; - "amplify-forgot-password": HTMLAmplifyForgotPasswordElement; - "amplify-form-field": HTMLAmplifyFormFieldElement; - "amplify-form-section": HTMLAmplifyFormSectionElement; - "amplify-google-button": HTMLAmplifyGoogleButtonElement; - "amplify-greetings": HTMLAmplifyGreetingsElement; - "amplify-hint": HTMLAmplifyHintElement; - "amplify-icon": HTMLAmplifyIconElement; - "amplify-icon-button": HTMLAmplifyIconButtonElement; - "amplify-input": HTMLAmplifyInputElement; - "amplify-label": HTMLAmplifyLabelElement; - "amplify-link": HTMLAmplifyLinkElement; - "amplify-loading-spinner": HTMLAmplifyLoadingSpinnerElement; - "amplify-nav": HTMLAmplifyNavElement; - "amplify-oauth-button": HTMLAmplifyOauthButtonElement; - "amplify-password-field": HTMLAmplifyPasswordFieldElement; - "amplify-phone-field": HTMLAmplifyPhoneFieldElement; - "amplify-photo-picker": HTMLAmplifyPhotoPickerElement; - "amplify-picker": HTMLAmplifyPickerElement; - "amplify-radio-button": HTMLAmplifyRadioButtonElement; - "amplify-require-new-password": HTMLAmplifyRequireNewPasswordElement; - "amplify-s3-album": HTMLAmplifyS3AlbumElement; - "amplify-s3-image": HTMLAmplifyS3ImageElement; - "amplify-s3-image-picker": HTMLAmplifyS3ImagePickerElement; - "amplify-s3-text": HTMLAmplifyS3TextElement; - "amplify-s3-text-picker": HTMLAmplifyS3TextPickerElement; - "amplify-section": HTMLAmplifySectionElement; - "amplify-select": HTMLAmplifySelectElement; - "amplify-select-mfa-type": HTMLAmplifySelectMfaTypeElement; - "amplify-sign-in": HTMLAmplifySignInElement; - "amplify-sign-in-button": HTMLAmplifySignInButtonElement; - "amplify-sign-out": HTMLAmplifySignOutElement; - "amplify-sign-up": HTMLAmplifySignUpElement; - "amplify-strike": HTMLAmplifyStrikeElement; - "amplify-toast": HTMLAmplifyToastElement; - "amplify-tooltip": HTMLAmplifyTooltipElement; - "amplify-totp-setup": HTMLAmplifyTotpSetupElement; - "amplify-username-field": HTMLAmplifyUsernameFieldElement; - "amplify-verify-contact": HTMLAmplifyVerifyContactElement; - } -} -declare namespace LocalJSX { - interface AmplifyAmazonButton { - /** - * App-specific client ID from Google - */ - "clientId"?: FederatedConfig['amazonClientId']; - /** - * Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp - */ - "handleAuthStateChange"?: AuthStateHandler; - } - interface AmplifyAuthContainer { - } - interface AmplifyAuthFields { - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string | Functional Component | null, required: boolean } ] ``` - */ - "formFields"?: FormFieldTypes | string[]; - } - interface AmplifyAuth0Button { - /** - * See: https://auth0.com/docs/libraries/auth0js/v9#available-parameters - */ - "config"?: FederatedConfig['auth0Config']; - /** - * Auth state change handler for this component - */ - "handleAuthStateChange"?: AuthStateHandler; - } - interface AmplifyAuthenticator { - /** - * Federated credentials & configuration. - */ - "federated"?: FederatedConfig; - /** - * Callback for Authenticator state machine changes - */ - "handleAuthStateChange"?: AuthStateHandler; - /** - * Hide amplify-toast for auth errors - */ - "hideToast"?: boolean; - /** - * Initial starting state of the Authenticator component. E.g. If `signup` is passed the default component is set to AmplifySignUp - */ - "initialAuthState"?: | AuthState.SignIn - | AuthState.SignUp - | AuthState.ForgotPassword; - /** - * Username Alias is used to setup authentication with `username`, `email` or `phone_number` - */ - "usernameAlias"?: UsernameAliasStrings; - } - interface AmplifyButton { - /** - * Disabled state of the button - */ - "disabled"?: boolean; - /** - * (Optional) Callback called when a user clicks on the button - */ - "handleButtonClick"?: (evt: Event) => void; - /** - * Name of icon to be placed inside the button - */ - "icon"?: IconNameType; - /** - * Type of the button: 'button', 'submit' or 'reset' - */ - "type"?: ButtonTypes; - /** - * Variant of a button: 'button' | 'anchor | 'icon' - */ - "variant"?: ButtonVariant; - } - interface AmplifyChatbot { - /** - * Name of the bot - */ - "botName"?: string; - /** - * Text placed in the top header - */ - "botTitle"?: string; - /** - * Clear messages when conversation finishes - */ - "clearOnComplete"?: boolean; - /** - * Continue listening to users after they send the message - */ - "conversationModeOn"?: boolean; - /** - * Event emitted when conversation is completed - */ - "onChatCompleted"?: (event: CustomEvent) => void; - /** - * Noise threshold between -1 and 1. Anything below is considered a silence. - */ - "silenceThreshold"?: number; - /** - * Amount of silence (in ms) to wait for - */ - "silenceTime"?: number; - /** - * Whether text chat is enabled - */ - "textEnabled"?: boolean; - /** - * Whether voice chat is enabled - */ - "voiceEnabled"?: boolean; - /** - * Greeting message displayed to users - */ - "welcomeMessage"?: string; - } - interface AmplifyCheckbox { - /** - * If `true`, the checkbox is selected. - */ - "checked"?: boolean; - /** - * If `true`, the checkbox is disabled - */ - "disabled"?: boolean; - /** - * Field ID used for the 'htmlFor' in the label - */ - "fieldId"?: string; - /** - * Label for the checkbox - */ - "label"?: string; - /** - * Name of the checkbox - */ - "name"?: string; - /** - * Value of the checkbox - */ - "value"?: string; - } - interface AmplifyCodeField { - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * Based on the type of field e.g. sign in, sign up, forgot password, etc. - */ - "fieldId"?: string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * Used as the hint in case you forgot your confirmation code, etc. - */ - "hint"?: string | FunctionalComponent | null; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * Used for the code label - */ - "label"?: string; - /** - * Used for the placeholder label - */ - "placeholder"?: string; - /** - * The required flag in order to make an input required prior to submitting a form - */ - "required"?: boolean; - /** - * The value of the content inside of the input field - */ - "value"?: string; - } - interface AmplifyConfirmSignIn { - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string | Functional Component | null, required: boolean } ] ``` - */ - "formFields"?: FormFieldTypes | string[]; - /** - * Auth state change handler for this component - */ - "handleAuthStateChange"?: AuthStateHandler; - /** - * Fires when confirm sign in form is submitted - */ - "handleSubmit"?: (event: Event) => void; - /** - * Used for header text in confirm sign in component - */ - "headerText"?: string; - /** - * Used for the submit button text in confirm sign in component - */ - "submitButtonText"?: string; - /** - * Cognito user signing in - */ - "user"?: CognitoUserInterface; - } - interface AmplifyConfirmSignUp { - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string | Functional Component | null, required: boolean } ] ``` - */ - "formFields"?: FormFieldTypes | string[]; - /** - * Auth state change handler for this components e.g. SignIn -> 'Create Account' link -> SignUp - */ - "handleAuthStateChange"?: AuthStateHandler; - /** - * Fires when sign up form is submitted - */ - "handleSubmit"?: (submitEvent: Event) => void; - /** - * Used for header text in confirm sign up component - */ - "headerText"?: string; - /** - * Used for the submit button text in confirm sign up component - */ - "submitButtonText"?: string; - /** - * Used for the username to be passed to resend code - */ - "user"?: CognitoUserInterface; - /** - * Username Alias is used to setup authentication with `username`, `email` or `phone_number` - */ - "usernameAlias"?: UsernameAliasStrings; - } - interface AmplifyContainer { - } - interface AmplifyCountryDialCode { - /** - * Default selected dial code - */ - "dialCode"?: string | number; - /** - * The ID of the field. Should match with its corresponding input's ID. - */ - "fieldId"?: string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * The options of the country dial code select input. - */ - "options"?: CountryCodeDialOptions; - } - interface AmplifyEmailField { - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * Based on the type of field e.g. sign in, sign up, forgot password, etc. - */ - "fieldId"?: string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * Used for the hint text that displays underneath the input field - */ - "hint"?: string | FunctionalComponent | null; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * Used for the EMAIL label - */ - "label"?: string; - /** - * Used for the placeholder label - */ - "placeholder"?: string; - /** - * The required flag in order to make an input required prior to submitting a form - */ - "required"?: boolean; - /** - * The value of the content inside of the input field - */ - "value"?: string; - } - interface AmplifyFacebookButton { - /** - * App-specific client ID from Facebook - */ - "appId"?: FederatedConfig['facebookAppId']; - /** - * Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp - */ - "handleAuthStateChange"?: AuthStateHandler; - } - interface AmplifyFederatedButtons { - /** - * The current authentication state. - */ - "authState"?: AuthState; - /** - * Federated credentials & configuration. - */ - "federated"?: FederatedConfig; - /** - * Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp - */ - "handleAuthStateChange"?: AuthStateHandler; - } - interface AmplifyFederatedSignIn { - /** - * The current authentication state. - */ - "authState"?: AuthState; - /** - * Federated credentials & configuration. - */ - "federated"?: any; - } - interface AmplifyForgotPassword { - /** - * The form fields displayed inside of the forgot password form - */ - "formFields"?: FormFieldTypes | string[]; - /** - * Auth state change handler for this component - */ - "handleAuthStateChange"?: AuthStateHandler; - /** - * The function called when making a request to reset password - */ - "handleSend"?: (event: Event) => void; - /** - * The function called when submitting a new password - */ - "handleSubmit"?: (event: Event) => void; - /** - * The header text of the forgot password section - */ - "headerText"?: string; - /** - * The text displayed inside of the send code button for the form - */ - "sendButtonText"?: string; - /** - * The text displayed inside of the submit button for the form - */ - "submitButtonText"?: string; - /** - * Username Alias is used to setup authentication with `username`, `email` or `phone_number` - */ - "usernameAlias"?: UsernameAliasStrings; - } - interface AmplifyFormField { - /** - * The text of the description. Goes between the label and the input. - */ - "description"?: string | null; - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * The ID of the field. Should match with its corresponding input's ID. - */ - "fieldId"?: string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * The text of a hint to the user as to how to fill out the input. Goes just below the input. - */ - "hint"?: string | FunctionalComponent | null; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * The text of the label. Goes above the input. Ex: 'First name' - */ - "label"?: string | null; - /** - * (Optional) String value for the name of the input. - */ - "name"?: string; - /** - * (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. - */ - "placeholder"?: string; - /** - * The required flag in order to make an input required prior to submitting a form - */ - "required"?: boolean; - /** - * The input type. Can be any HTML input type. - */ - "type"?: TextFieldTypes; - /** - * The value of the content inside of the input field - */ - "value"?: string; - } - interface AmplifyFormSection { - /** - * (Required) Function called upon submission of form - */ - "handleSubmit"?: (event: Event) => void; - /** - * Used for form section header - */ - "headerText"?: string; - /** - * Loading state for the form - */ - "loading"?: boolean; - /** - * Secondary footer component or text - */ - "secondaryFooterContent"?: string | FunctionalComponent | null; - /** - * (Optional) Used as a the default value within the default footer slot - */ - "submitButtonText"?: string; - /** - * String prefix for the data-test attributes in this component primarily used for testing purposes - */ - "testDataPrefix"?: string; - } - interface AmplifyGoogleButton { - /** - * App-specific client ID from Google - */ - "clientId"?: FederatedConfig['googleClientId']; - /** - * Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp - */ - "handleAuthStateChange"?: AuthStateHandler; - } - interface AmplifyGreetings { - /** - * Auth state change handler for this component - */ - "handleAuthStateChange"?: AuthStateHandler; - /** - * Logo displayed inside of the header - */ - "logo"?: FunctionalComponent | null; - /** - * Username displayed in the greetings - */ - "username"?: string; - } - interface AmplifyHint { - } - interface AmplifyIcon { - /** - * (Required) Name of icon used to determine the icon rendered - */ - "name"?: IconNameType; - } - interface AmplifyIconButton { - /** - * (Optional) Whether or not to show the tooltip automatically - */ - "autoShowTooltip"?: boolean; - /** - * The name of the icon used inside of the button - */ - "name"?: IconNameType; - /** - * (Optional) The tooltip that will show on hover of the button - */ - "tooltip"?: string | null; - } - interface AmplifyInput { - /** - * The text of the description. Goes just below the label. - */ - "description"?: string | null; - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * The ID of the field. Should match with its corresponding input's ID. - */ - "fieldId"?: string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: InputEvent) => void; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * (Optional) String value for the name of the input. - */ - "name"?: string; - /** - * (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. - */ - "placeholder"?: string; - /** - * Whether the input is a required field - */ - "required"?: boolean; - /** - * The input type. Can be any HTML input type. - */ - "type"?: TextFieldTypes; - /** - * The value of the content inside of the input field - */ - "value"?: string; - } - interface AmplifyLabel { - /** - * Reflects the value of the for content property of html element - */ - "htmlFor"?: string; - } - interface AmplifyLink { - /** - * The link role is used to identify an element that creates a hyperlink to a resource that is in the application or external - */ - "role"?: string; - } - interface AmplifyLoadingSpinner { - } - interface AmplifyNav { - } - interface AmplifyOauthButton { - /** - * Federated credentials & configuration. - */ - "config"?: FederatedConfig['oauthConfig']; - } - interface AmplifyPasswordField { - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * Based on the type of field e.g. sign in, sign up, forgot password, etc. - */ - "fieldId"?: string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * Used as the hint in case you forgot your password, etc. - */ - "hint"?: string | FunctionalComponent | null; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * Used for the password label - */ - "label"?: string; - /** - * Used for the placeholder label - */ - "placeholder"?: string; - /** - * The required flag in order to make an input required prior to submitting a form - */ - "required"?: boolean; - /** - * The value of the content inside of the input field - */ - "value"?: string; - } - interface AmplifyPhoneField { - /** - * Default dial code in the phone field - */ - "dialCode"?: string | number; - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * Based on the type of field e.g. sign in, sign up, forgot password, etc. - */ - "fieldId"?: string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * Used as the hint in case you forgot your confirmation code, etc. - */ - "hint"?: string | FunctionalComponent | null; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * Used for the Phone label - */ - "label"?: string; - /** - * Used for the placeholder label - */ - "placeholder"?: string; - /** - * The required flag in order to make an input required prior to submitting a form - */ - "required"?: boolean; - /** - * The value of the content inside of the input field - */ - "value"?: string; - } - interface AmplifyPhotoPicker { - /** - * Picker button text as string - */ - "buttonText"?: string; - /** - * Function that handles file pick onClick - */ - "handleClick"?: (file: File) => void; - /** - * Header Hint value in string - */ - "headerHint"?: string; - /** - * Title string value - */ - "headerTitle"?: string; - /** - * Placeholder hint that goes under the placeholder image - */ - "placeholderHint"?: string; - /** - * Source of the image to be previewed - */ - "previewSrc"?: string | object; - } - interface AmplifyPicker { - /** - * File input accept value - */ - "acceptValue"?: string; - /** - * File input onChange handler - */ - "inputHandler"?: (e: Event) => void; - /** - * Picker button text - */ - "pickerText"?: string; - } - interface AmplifyRadioButton { - /** - * If `true`, the radio button is selected. - */ - "checked"?: boolean; - /** - * If `true`, the checkbox is disabled - */ - "disabled"?: boolean; - /** - * Field ID used for the 'for' in the label - */ - "fieldId"?: string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * Label for the radio button - */ - "label"?: string; - /** - * (Optional) Name of radio button - */ - "name"?: string; - /** - * (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. - */ - "placeholder"?: string; - /** - * (Optional) Value of radio button - */ - "value"?: string; - } - interface AmplifyRequireNewPassword { - /** - * The form fields displayed inside of the forgot password form - */ - "formFields"?: FormFieldTypes; - /** - * Auth state change handler for this component - */ - "handleAuthStateChange"?: AuthStateHandler; - /** - * The function called when submitting a new password - */ - "handleSubmit"?: (event: Event) => void; - /** - * The header text of the forgot password section - */ - "headerText"?: string; - /** - * The text displayed inside of the submit button for the form - */ - "submitButtonText"?: string; - /** - * Used for the username to be passed to resend code - */ - "user"?: CognitoUserInterface; - } - interface AmplifyS3Album { - /** - * The content type header used when uploading to S3 - */ - "contentType"?: string; - /** - * Callback used to generate custom key value - */ - "fileToKey"?: (data: object) => string | string; - /** - * Filter to be applied on album list - */ - "filter"?: (list: StorageObject[]) => StorageObject[]; - /** - * Function executed when error occurs for the s3-image - */ - "handleOnError"?: (event: Event) => void; - /** - * Function executed when s3-image loads - */ - "handleOnLoad"?: (event: Event) => void; - /** - * Cognito identity id of the another user's image list - */ - "identityId"?: string; - /** - * The access level of the files - */ - "level"?: AccessLevel; - /** - * String representing directory location of image files to be listed - */ - "path"?: string; - /** - * Boolean to enable or disable picker - */ - "picker"?: boolean; - /** - * Picker button text - */ - "pickerText"?: string; - /** - * Sort to be applied on album list - */ - "sort"?: (list: StorageObject[]) => StorageObject[]; - /** - * Whether or not to use track the get/put of the listing of images - */ - "track"?: boolean; - } - interface AmplifyS3Image { - /** - * String representing the alternate image text - */ - "alt"?: string; - /** - * Image body content to be uploaded - */ - "body"?: object; - /** - * The content type header used when uploading to S3 - */ - "contentType"?: string; - /** - * Function executed when error occurs for the image - */ - "handleOnError"?: (event: Event) => void; - /** - * Function executed when image loads - */ - "handleOnLoad"?: (event: Event) => void; - /** - * Cognito identity id of the another user's image - */ - "identityId"?: string; - /** - * The key of the image object in S3 - */ - "imgKey"?: string; - /** - * Attributes to be placed on the img element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes - */ - "imgProps"?: Record; - /** - * The access level of the image - */ - "level"?: AccessLevel; - /** - * String representing directory location to image file - */ - "path"?: string; - /** - * Whether or not to use track on get/put of the image - */ - "track"?: boolean; - } - interface AmplifyS3ImagePicker { - /** - * Upload Button Text as string - */ - "buttonText"?: string; - /** - * The content type header used when uploading to S3 - */ - "contentType"?: string; - /** - * Callback used to generate custom key value - */ - "fileToKey"?: (data: object) => string | string; - /** - * Header Hint value in string - */ - "headerHint"?: string; - /** - * Title string value - */ - "headerTitle"?: string; - /** - * Cognito identity id of the another user's image - */ - "identityId"?: string; - /** - * The access level of the image - */ - "level"?: AccessLevel; - /** - * String representing directory location to image file - */ - "path"?: string; - /** - * Placeholder hint that goes under the placeholder image - */ - "placeholderHint"?: string; - /** - * Whether or not to use track the get/put of the image - */ - "track"?: boolean; - } - interface AmplifyS3Text { - /** - * Text body content to be uploaded - */ - "body"?: object; - /** - * The content type header used when uploading to S3 - */ - "contentType"?: string; - /** - * Fallback content - */ - "fallbackText"?: string; - /** - * Cognito identity id of the another user's text file - */ - "identityId"?: string; - /** - * The access level of the text file - */ - "level"?: AccessLevel; - /** - * String representing directory location to text file - */ - "path"?: string; - /** - * The key of the text object in S3 - */ - "textKey"?: string; - /** - * Whether or not to use track the get/put of the text file - */ - "track"?: boolean; - } - interface AmplifyS3TextPicker { - /** - * The content type header used when uploading to S3 - */ - "contentType"?: string; - /** - * Fallback content for aplify-s3-text - */ - "fallbackText"?: string; - /** - * Callback used to generate custom key value - */ - "fileToKey"?: (data: object) => string | string; - /** - * Cognito identity id of the another user's text file - */ - "identityId"?: string; - /** - * The access level of the text file - */ - "level"?: AccessLevel; - /** - * String representing directory location to text file - */ - "path"?: string; - /** - * Whether or not to use track the get/put of the text file - */ - "track"?: boolean; - } - interface AmplifySection { - /** - * Equivalent to html section role - */ - "role"?: string; - } - interface AmplifySelect { - /** - * Used for id field - */ - "fieldId"?: string; - /** - * The callback, called when the select is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * The options of the select input. Must be an Array of Objects with an Object shape of {label: string, value: string|number} - */ - "options"?: | SelectOptionsString - | SelectOptionsNumber; - /** - * Default selected option - */ - "selected"?: string | number; - } - interface AmplifySelectMfaType { - /** - * Types of MFA options - */ - "MFATypes"?: MFATypesInterface; - /** - * Current authenticated user in order to sign requests properly for TOTP - */ - "authData"?: CognitoUserInterface; - /** - * Fires when Verify is clicked - */ - "handleSubmit"?: (event: Event) => void; - } - interface AmplifySignIn { - /** - * Federated credentials & configuration. - */ - "federated"?: FederatedConfig; - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string | Functional Component | null, required: boolean } ] ``` - */ - "formFields"?: FormFieldTypes | string[]; - /** - * Auth state change handler for this component - */ - "handleAuthStateChange"?: AuthStateHandler; - /** - * Fires when sign in form is submitted - */ - "handleSubmit"?: (event: Event) => void; - /** - * Used for header text in sign in component - */ - "headerText"?: string; - /** - * Hides the sign up link - */ - "hideSignUp"?: boolean; - /** - * Used for the submit button text in sign in component - */ - "submitButtonText"?: string; - /** - * Username Alias is used to setup authentication with `username`, `email` or `phone_number` - */ - "usernameAlias"?: UsernameAliasStrings; - } - interface AmplifySignInButton { - /** - * Specifies the federation provider. - */ - "provider"?: 'amazon' | 'auth0' | 'facebook' | 'google' | 'oauth'; - } - interface AmplifySignOut { - /** - * Text inside of the Sign Out button - */ - "buttonText"?: string; - /** - * Auth state change handler for this component - */ - "handleAuthStateChange"?: AuthStateHandler; - } - interface AmplifySignUp { - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string | Functional Component | null, required: boolean } ] ``` - */ - "formFields"?: FormFieldTypes | string[]; - /** - * Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp - */ - "handleAuthStateChange"?: AuthStateHandler; - /** - * Override for handling the Auth.SignUp API call - */ - "handleSignUp"?: ( - params: SignUpParams - ) => Promise; - /** - * Fires when sign up form is submitted - */ - "handleSubmit"?: (event: Event) => void; - /** - * Used for the submit button text in sign up component - */ - "haveAccountText"?: string; - /** - * Used for header text in sign up component - */ - "headerText"?: string; - /** - * Text used for the sign in hyperlink - */ - "signInText"?: string; - /** - * Used for the submit button text in sign up component - */ - "submitButtonText"?: string; - /** - * Username Alias is used to setup authentication with `username`, `email` or `phone_number` - */ - "usernameAlias"?: UsernameAliasStrings; - /** - * Engages when invalid actions occur, such as missing field, etc. - */ - "validationErrors"?: string; - } - interface AmplifyStrike { - } - interface AmplifyToast { - /** - * Used in order to add a dismissable `x` for the Toast component - */ - "handleClose"?: () => void; - /** - * Message to be displayed inside the toast - */ - "message"?: string; - } - interface AmplifyTooltip { - /** - * (Optional) Whether or not the tooltip should be automatically shown, i.e. not disappear when not hovered - */ - "shouldAutoShow"?: boolean; - /** - * (Required) The text in the tooltip - */ - "text"?: string; - } - interface AmplifyTotpSetup { - /** - * Auth state change handler for this component - */ - "handleAuthStateChange"?: AuthStateHandler; - /** - * This is run after totp setup is complete. Useful if using this as standalone. - */ - "handleComplete"?: ( - user: CognitoUserInterface - ) => void | Promise; - /** - * Used for header text in totp setup component - */ - "headerText"?: string; - /** - * Used for customizing the issuer string in the qr code image - */ - "issuer"?: string; - /** - * Set this to true if this component is running outside the default `amplify-authenticator` usage - */ - "standalone"?: boolean; - /** - * Used in order to configure TOTP for a user - */ - "user"?: CognitoUserInterface; - } - interface AmplifyUsernameField { - /** - * Will disable the input if set to true - */ - "disabled"?: boolean; - /** - * Based on the type of field e.g. sign in, sign up, forgot password, etc. - */ - "fieldId"?: string; - /** - * The callback, called when the input is modified by the user. - */ - "handleInputChange"?: (inputEvent: Event) => void; - /** - * Used for the hint text that displays underneath the input field - */ - "hint"?: string | FunctionalComponent | null; - /** - * Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes - */ - "inputProps"?: object; - /** - * Used for the username label - */ - "label"?: string; - /** - * Used for the placeholder label - */ - "placeholder"?: string; - /** - * The required flag in order to make an input required prior to submitting a form - */ - "required"?: boolean; - /** - * The value of the content inside of the input field - */ - "value"?: string; - } - interface AmplifyVerifyContact { - /** - * Authentication state handler - */ - "handleAuthStateChange"?: AuthStateHandler; - /** - * User with unverified contact information - */ - "user"?: CognitoUserInterface; - } - interface IntrinsicElements { - "amplify-amazon-button": AmplifyAmazonButton; - "amplify-auth-container": AmplifyAuthContainer; - "amplify-auth-fields": AmplifyAuthFields; - "amplify-auth0-button": AmplifyAuth0Button; - "amplify-authenticator": AmplifyAuthenticator; - "amplify-button": AmplifyButton; - "amplify-chatbot": AmplifyChatbot; - "amplify-checkbox": AmplifyCheckbox; - "amplify-code-field": AmplifyCodeField; - "amplify-confirm-sign-in": AmplifyConfirmSignIn; - "amplify-confirm-sign-up": AmplifyConfirmSignUp; - "amplify-container": AmplifyContainer; - "amplify-country-dial-code": AmplifyCountryDialCode; - "amplify-email-field": AmplifyEmailField; - "amplify-facebook-button": AmplifyFacebookButton; - "amplify-federated-buttons": AmplifyFederatedButtons; - "amplify-federated-sign-in": AmplifyFederatedSignIn; - "amplify-forgot-password": AmplifyForgotPassword; - "amplify-form-field": AmplifyFormField; - "amplify-form-section": AmplifyFormSection; - "amplify-google-button": AmplifyGoogleButton; - "amplify-greetings": AmplifyGreetings; - "amplify-hint": AmplifyHint; - "amplify-icon": AmplifyIcon; - "amplify-icon-button": AmplifyIconButton; - "amplify-input": AmplifyInput; - "amplify-label": AmplifyLabel; - "amplify-link": AmplifyLink; - "amplify-loading-spinner": AmplifyLoadingSpinner; - "amplify-nav": AmplifyNav; - "amplify-oauth-button": AmplifyOauthButton; - "amplify-password-field": AmplifyPasswordField; - "amplify-phone-field": AmplifyPhoneField; - "amplify-photo-picker": AmplifyPhotoPicker; - "amplify-picker": AmplifyPicker; - "amplify-radio-button": AmplifyRadioButton; - "amplify-require-new-password": AmplifyRequireNewPassword; - "amplify-s3-album": AmplifyS3Album; - "amplify-s3-image": AmplifyS3Image; - "amplify-s3-image-picker": AmplifyS3ImagePicker; - "amplify-s3-text": AmplifyS3Text; - "amplify-s3-text-picker": AmplifyS3TextPicker; - "amplify-section": AmplifySection; - "amplify-select": AmplifySelect; - "amplify-select-mfa-type": AmplifySelectMfaType; - "amplify-sign-in": AmplifySignIn; - "amplify-sign-in-button": AmplifySignInButton; - "amplify-sign-out": AmplifySignOut; - "amplify-sign-up": AmplifySignUp; - "amplify-strike": AmplifyStrike; - "amplify-toast": AmplifyToast; - "amplify-tooltip": AmplifyTooltip; - "amplify-totp-setup": AmplifyTotpSetup; - "amplify-username-field": AmplifyUsernameField; - "amplify-verify-contact": AmplifyVerifyContact; - } -} -export { LocalJSX as JSX }; -declare module "@stencil/core" { - export namespace JSX { - interface IntrinsicElements { - "amplify-amazon-button": LocalJSX.AmplifyAmazonButton & JSXBase.HTMLAttributes; - "amplify-auth-container": LocalJSX.AmplifyAuthContainer & JSXBase.HTMLAttributes; - "amplify-auth-fields": LocalJSX.AmplifyAuthFields & JSXBase.HTMLAttributes; - "amplify-auth0-button": LocalJSX.AmplifyAuth0Button & JSXBase.HTMLAttributes; - "amplify-authenticator": LocalJSX.AmplifyAuthenticator & JSXBase.HTMLAttributes; - "amplify-button": LocalJSX.AmplifyButton & JSXBase.HTMLAttributes; - "amplify-chatbot": LocalJSX.AmplifyChatbot & JSXBase.HTMLAttributes; - "amplify-checkbox": LocalJSX.AmplifyCheckbox & JSXBase.HTMLAttributes; - "amplify-code-field": LocalJSX.AmplifyCodeField & JSXBase.HTMLAttributes; - "amplify-confirm-sign-in": LocalJSX.AmplifyConfirmSignIn & JSXBase.HTMLAttributes; - "amplify-confirm-sign-up": LocalJSX.AmplifyConfirmSignUp & JSXBase.HTMLAttributes; - "amplify-container": LocalJSX.AmplifyContainer & JSXBase.HTMLAttributes; - "amplify-country-dial-code": LocalJSX.AmplifyCountryDialCode & JSXBase.HTMLAttributes; - "amplify-email-field": LocalJSX.AmplifyEmailField & JSXBase.HTMLAttributes; - "amplify-facebook-button": LocalJSX.AmplifyFacebookButton & JSXBase.HTMLAttributes; - "amplify-federated-buttons": LocalJSX.AmplifyFederatedButtons & JSXBase.HTMLAttributes; - "amplify-federated-sign-in": LocalJSX.AmplifyFederatedSignIn & JSXBase.HTMLAttributes; - "amplify-forgot-password": LocalJSX.AmplifyForgotPassword & JSXBase.HTMLAttributes; - "amplify-form-field": LocalJSX.AmplifyFormField & JSXBase.HTMLAttributes; - "amplify-form-section": LocalJSX.AmplifyFormSection & JSXBase.HTMLAttributes; - "amplify-google-button": LocalJSX.AmplifyGoogleButton & JSXBase.HTMLAttributes; - "amplify-greetings": LocalJSX.AmplifyGreetings & JSXBase.HTMLAttributes; - "amplify-hint": LocalJSX.AmplifyHint & JSXBase.HTMLAttributes; - "amplify-icon": LocalJSX.AmplifyIcon & JSXBase.HTMLAttributes; - "amplify-icon-button": LocalJSX.AmplifyIconButton & JSXBase.HTMLAttributes; - "amplify-input": LocalJSX.AmplifyInput & JSXBase.HTMLAttributes; - "amplify-label": LocalJSX.AmplifyLabel & JSXBase.HTMLAttributes; - "amplify-link": LocalJSX.AmplifyLink & JSXBase.HTMLAttributes; - "amplify-loading-spinner": LocalJSX.AmplifyLoadingSpinner & JSXBase.HTMLAttributes; - "amplify-nav": LocalJSX.AmplifyNav & JSXBase.HTMLAttributes; - "amplify-oauth-button": LocalJSX.AmplifyOauthButton & JSXBase.HTMLAttributes; - "amplify-password-field": LocalJSX.AmplifyPasswordField & JSXBase.HTMLAttributes; - "amplify-phone-field": LocalJSX.AmplifyPhoneField & JSXBase.HTMLAttributes; - "amplify-photo-picker": LocalJSX.AmplifyPhotoPicker & JSXBase.HTMLAttributes; - "amplify-picker": LocalJSX.AmplifyPicker & JSXBase.HTMLAttributes; - "amplify-radio-button": LocalJSX.AmplifyRadioButton & JSXBase.HTMLAttributes; - "amplify-require-new-password": LocalJSX.AmplifyRequireNewPassword & JSXBase.HTMLAttributes; - "amplify-s3-album": LocalJSX.AmplifyS3Album & JSXBase.HTMLAttributes; - "amplify-s3-image": LocalJSX.AmplifyS3Image & JSXBase.HTMLAttributes; - "amplify-s3-image-picker": LocalJSX.AmplifyS3ImagePicker & JSXBase.HTMLAttributes; - "amplify-s3-text": LocalJSX.AmplifyS3Text & JSXBase.HTMLAttributes; - "amplify-s3-text-picker": LocalJSX.AmplifyS3TextPicker & JSXBase.HTMLAttributes; - "amplify-section": LocalJSX.AmplifySection & JSXBase.HTMLAttributes; - "amplify-select": LocalJSX.AmplifySelect & JSXBase.HTMLAttributes; - "amplify-select-mfa-type": LocalJSX.AmplifySelectMfaType & JSXBase.HTMLAttributes; - "amplify-sign-in": LocalJSX.AmplifySignIn & JSXBase.HTMLAttributes; - "amplify-sign-in-button": LocalJSX.AmplifySignInButton & JSXBase.HTMLAttributes; - "amplify-sign-out": LocalJSX.AmplifySignOut & JSXBase.HTMLAttributes; - "amplify-sign-up": LocalJSX.AmplifySignUp & JSXBase.HTMLAttributes; - "amplify-strike": LocalJSX.AmplifyStrike & JSXBase.HTMLAttributes; - "amplify-toast": LocalJSX.AmplifyToast & JSXBase.HTMLAttributes; - "amplify-tooltip": LocalJSX.AmplifyTooltip & JSXBase.HTMLAttributes; - "amplify-totp-setup": LocalJSX.AmplifyTotpSetup & JSXBase.HTMLAttributes; - "amplify-username-field": LocalJSX.AmplifyUsernameField & JSXBase.HTMLAttributes; - "amplify-verify-contact": LocalJSX.AmplifyVerifyContact & JSXBase.HTMLAttributes; - } - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-amazon-button/__snapshots__/amplify-amazon-button.spec.tsx.snap b/packages/amplify-ui-components/src/components/amplify-amazon-button/__snapshots__/amplify-amazon-button.spec.tsx.snap deleted file mode 100644 index 2b4b67d0474..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-amazon-button/__snapshots__/amplify-amazon-button.spec.tsx.snap +++ /dev/null @@ -1,12 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-amazon-button stories defaults 1`] = ` - - - - - Sign in with Amazon - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-amazon-button/amplify-amazon-button.spec.tsx b/packages/amplify-ui-components/src/components/amplify-amazon-button/amplify-amazon-button.spec.tsx deleted file mode 100644 index c7ab150b13e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-amazon-button/amplify-amazon-button.spec.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; - -import { AmplifyAmazonButton } from './amplify-amazon-button'; -import * as stories from './amplify-amazon-button.stories'; - -const { - default: { title }, - ...specs -} = stories; - -const components = [AmplifyAmazonButton]; - -describe(title, () => { - describe('stories', () => { - Object.entries(specs).forEach(([name, spec]) => { - it(name, async () => { - const page = await newSpecPage({ components, html: spec() }); - - expect(page.root).toMatchSnapshot(); - }); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-amazon-button/amplify-amazon-button.stories.tsx b/packages/amplify-ui-components/src/components/amplify-amazon-button/amplify-amazon-button.stories.tsx deleted file mode 100644 index 0a60213fe72..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-amazon-button/amplify-amazon-button.stories.tsx +++ /dev/null @@ -1,5 +0,0 @@ -export default { - title: 'amplify-amazon-button', -}; - -export const defaults = () => ``; diff --git a/packages/amplify-ui-components/src/components/amplify-amazon-button/amplify-amazon-button.tsx b/packages/amplify-ui-components/src/components/amplify-amazon-button/amplify-amazon-button.tsx deleted file mode 100644 index 09d7d0c303b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-amazon-button/amplify-amazon-button.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { Auth } from '@aws-amplify/auth'; -import { ConsoleLogger as Logger } from '@aws-amplify/core'; -import { Component, h, Prop } from '@stencil/core'; -import { dispatchAuthStateChangeEvent } from '../../common/helpers'; -import { AUTH_SOURCE_KEY, NO_AUTH_MODULE_FOUND } from '../../common/constants'; -import { - AuthState, - FederatedConfig, - AuthStateHandler, -} from '../../common/types/auth-types'; -import { Translations } from '../../common/Translations'; - -const logger = new Logger('amplify-amazon-button'); - -@Component({ - tag: 'amplify-amazon-button', - shadow: true, -}) -export class AmplifyAmazonButton { - /** App-specific client ID from Google */ - @Prop() clientId: FederatedConfig['amazonClientId']; - /** Auth state change handler for this component - * e.g. SignIn -> 'Create Account' link -> SignUp - */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - private federatedSignIn = response => { - const { access_token, expires_in } = response; - - if (!access_token) { - return; - } - - if ( - !Auth || - typeof Auth.federatedSignIn !== 'function' || - typeof Auth.currentAuthenticatedUser !== 'function' - ) { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - const date = new Date(); - const expires_at = expires_in * 1000 + date.getTime(); - - window['amazon'].Login.retrieveProfile(async userInfo => { - if (!userInfo.success) { - return logger.debug('Get user Info failed'); - } - - const user = { - name: userInfo.profile.Name, - email: userInfo.profile.PrimaryEmail, - }; - - await Auth.federatedSignIn( - 'amazon', - { token: access_token, expires_at }, - user - ); - - const authenticatedUser = await Auth.currentAuthenticatedUser(); - - this.handleAuthStateChange(AuthState.SignedIn, authenticatedUser); - }); - }; - - /** - * @see https://developer.amazon.com/docs/login-with-amazon/install-sdk-javascript.html - */ - private signInWithAmazon(event) { - event.preventDefault(); - - window['amazon'].Login.setClientId(this.clientId); - - window['amazon'].Login.authorize({ scope: 'profile' }, response => { - if (response.error) { - return logger.debug('Failed to login with amazon: ' + response.error); - } - - try { - window.localStorage.setItem( - AUTH_SOURCE_KEY, - JSON.stringify({ provider: 'amazon' }) - ); - } catch (e) { - logger.debug('Failed to cache auth source into localStorage', e); - } - - this.federatedSignIn(response); - }); - } - - render() { - return ( - this.signInWithAmazon(event)} - provider="amazon" - > - - {I18n.get(Translations.SIGN_IN_WITH_AMAZON)} - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-amazon-button/readme.md b/packages/amplify-ui-components/src/components/amplify-amazon-button/readme.md deleted file mode 100644 index f8cf4953976..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-amazon-button/readme.md +++ /dev/null @@ -1,35 +0,0 @@ -# amplify-amazon-button - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | ----------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------- | ------------------------------ | -| `clientId` | `client-id` | App-specific client ID from Google | `string` | `undefined` | -| `handleAuthStateChange` | -- | Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | - - -## Dependencies - -### Used by - - - [amplify-federated-buttons](../amplify-federated-buttons) - -### Depends on - -- [amplify-sign-in-button](../amplify-sign-in-button) - -### Graph -```mermaid -graph TD; - amplify-amazon-button --> amplify-sign-in-button - amplify-sign-in-button --> amplify-icon - amplify-federated-buttons --> amplify-amazon-button - style amplify-amazon-button fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-auth-container/__snapshots__/amplify-auth-container.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-auth-container/__snapshots__/amplify-auth-container.spec.ts.snap deleted file mode 100644 index 18b22d42de0..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth-container/__snapshots__/amplify-auth-container.spec.ts.snap +++ /dev/null @@ -1,12 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-auth-container spec: Render logic -> should render with an empty slot 1`] = ` - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-auth-container/amplify-auth-container.spec.ts b/packages/amplify-ui-components/src/components/amplify-auth-container/amplify-auth-container.spec.ts deleted file mode 100644 index 8e5d549207e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth-container/amplify-auth-container.spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyAuthContainer } from './amplify-auth-container'; - -describe('amplify-auth-container spec:', () => { - describe('Render logic ->', () => { - it('should render with an empty slot', async () => { - const page = await newSpecPage({ - components: [AmplifyAuthContainer], - html: ``, - }); - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-auth-container/amplify-auth-container.tsx b/packages/amplify-ui-components/src/components/amplify-auth-container/amplify-auth-container.tsx deleted file mode 100644 index 2685268d8d1..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth-container/amplify-auth-container.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { Component, h, Host } from '@stencil/core'; - -/** - * @slot (default) - Content placed within the container - */ -@Component({ - tag: 'amplify-auth-container', -}) -export class AmplifyAuthContainer { - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - render() { - return ( - - - - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-auth-container/readme.md b/packages/amplify-ui-components/src/components/amplify-auth-container/readme.md deleted file mode 100644 index a8092ecaf95..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth-container/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# amplify-auth-container - - - - - - -## Slots - -| Slot | Description | -| ------------- | ----------------------------------- | -| `"(default)"` | Content placed within the container | - - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-auth-fields/__snapshots__/amplify-auth-fields.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-auth-fields/__snapshots__/amplify-auth-fields.spec.ts.snap deleted file mode 100644 index c84d523997b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth-fields/__snapshots__/amplify-auth-fields.spec.ts.snap +++ /dev/null @@ -1,24 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-auth-fields spec: Render logic -> should render custom type fields 1`] = ` - -
- -
-
-`; - -exports[`amplify-auth-fields spec: Render logic -> should render with a \`username\` and \`password\` field 1`] = ` - -
- - -
-
-`; - -exports[`amplify-auth-fields spec: Render logic -> should render with no default values and a empty string 1`] = ` - -
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-auth-fields/amplify-auth-fields-interface.ts b/packages/amplify-ui-components/src/components/amplify-auth-fields/amplify-auth-fields-interface.ts deleted file mode 100644 index 0aa25642305..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth-fields/amplify-auth-fields-interface.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { FunctionalComponent } from '@stencil/core'; - -export interface FormFieldType { - type: string; - label?: string; - placeholder?: string; - hint?: string | FunctionalComponent | null; - required?: boolean; - handleInputChange?: (inputEvent: Event) => void; - value?: string; - inputProps?: object; - disabled?: boolean; -} - -export interface PhoneFormFieldType extends FormFieldType { - dialCode?: string; -} - -export interface FormFieldTypes extends Array {} - -export interface PhoneNumberInterface { - countryDialCodeValue?: string; - phoneNumberValue?: string; -} diff --git a/packages/amplify-ui-components/src/components/amplify-auth-fields/amplify-auth-fields.scss b/packages/amplify-ui-components/src/components/amplify-auth-fields/amplify-auth-fields.scss deleted file mode 100644 index 23f7eaff044..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth-fields/amplify-auth-fields.scss +++ /dev/null @@ -1,3 +0,0 @@ -.auth-fields { - margin-bottom: 2rem; -} diff --git a/packages/amplify-ui-components/src/components/amplify-auth-fields/amplify-auth-fields.spec.ts b/packages/amplify-ui-components/src/components/amplify-auth-fields/amplify-auth-fields.spec.ts deleted file mode 100644 index 96e20404bbc..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth-fields/amplify-auth-fields.spec.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyAuthFields } from './amplify-auth-fields'; - -describe('amplify-auth-fields spec:', () => { - describe('Component logic ->', () => { - let authFields; - - beforeEach(() => { - authFields = new AmplifyAuthFields(); - }); - - it('should return form fields as being defined when passing FormFieldTypes', () => { - const constructFormFieldOptionsMock = jest.spyOn( - authFields, - 'constructFormFieldOptions' - ); - const result = [ - { type: 'username', label: 'New username' }, - { type: 'password', label: 'New password' }, - ]; - - authFields.formFields = [ - { type: 'username', label: 'New username' }, - { type: 'password', label: 'New password' }, - ]; - - authFields.constructFormFieldOptions(); - - expect(authFields.formFields).toEqual(result); - expect(constructFormFieldOptionsMock).toHaveBeenCalledTimes(1); - }); - - it('should return form fields as being defined when passing `username` and `password` as parameter', () => { - const constructFormFieldOptionsMock = jest.spyOn( - authFields, - 'constructFormFieldOptions' - ); - const result = ['username', 'password']; - - authFields.formFields = ['username', 'password']; - - authFields.constructFormFieldOptions(); - - expect(authFields.formFields).toEqual(result); - expect(constructFormFieldOptionsMock).toHaveBeenCalledTimes(1); - }); - - it('should return the formFields as undefined by default', () => { - expect(authFields.formFields).toBeUndefined(); - }); - }); - describe('Render logic ->', () => { - it('should render with a `username` and `password` field', async () => { - const usernameField = ['username', 'password']; - - const page = await newSpecPage({ - components: [AmplifyAuthFields], - }); - - const component = page.doc.createElement('amplify-auth-fields'); - (component as any).formFields = usernameField; - page.body.appendChild(component); - await page.waitForChanges(); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render with no default values and a empty string', async () => { - const page = await newSpecPage({ - components: [AmplifyAuthFields], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render custom type fields', async () => { - const customField = [{ label: 'date', type: 'date' }]; - - const page = await newSpecPage({ - components: [AmplifyAuthFields], - }); - - const component = page.doc.createElement('amplify-auth-fields'); - (component as any).formFields = customField; - page.body.appendChild(component); - await page.waitForChanges(); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-auth-fields/amplify-auth-fields.tsx b/packages/amplify-ui-components/src/components/amplify-auth-fields/amplify-auth-fields.tsx deleted file mode 100644 index 73584bb3de8..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth-fields/amplify-auth-fields.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { Component, Prop, h } from '@stencil/core'; -import { FormFieldType, FormFieldTypes } from './amplify-auth-fields-interface'; -import componentFieldMapping from './component-field-mapping'; - -@Component({ - tag: 'amplify-auth-fields', - styleUrl: 'amplify-auth-fields.scss', -}) -export class AmplifyAuthFields { - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. - * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing - * text for a label or adjust a placeholder, you can follow the structure below in order to do just that. - * ``` - * [ - * { - * type: string, - * label: string, - * placeholder: string, - * hint: string | Functional Component | null, - * required: boolean - * } - * ] - * ``` - */ - @Prop() formFields: FormFieldTypes | string[]; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - private constructFormFieldOptions(formFields: FormFieldTypes | string[]) { - const content = []; - - if (formFields === undefined) return ''; - - formFields.forEach((formField: FormFieldType | string) => { - if (typeof formField === 'string') { - content.push(componentFieldMapping[formField](formField)); - } else if (Object.keys(componentFieldMapping).includes(formField.type)) { - content.push(componentFieldMapping[formField.type](formField)); - } else { - content.push(componentFieldMapping['default'](formField)); - } - }); - - return content; - } - - render() { - return ( -
- {this.constructFormFieldOptions(this.formFields)} -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-auth-fields/component-field-mapping.tsx b/packages/amplify-ui-components/src/components/amplify-auth-fields/component-field-mapping.tsx deleted file mode 100644 index 5b80830c28d..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth-fields/component-field-mapping.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import { h } from '@stencil/core'; -import { - FormFieldType, - PhoneFormFieldType, -} from './amplify-auth-fields-interface'; -import { TextFieldTypes } from '../../common/types/ui-types'; - -const componentFieldMapping = { - username: (ff: FormFieldType) => ( - - ), - password: (ff: FormFieldType) => ( - - ), - email: (ff: FormFieldType) => ( - - ), - code: (ff: FormFieldType) => ( - - ), - // TODO: Will create a phone field component once the dial country code component is in - phone_number: (ff: PhoneFormFieldType) => ( - - ), - default: (ff: FormFieldType) => ( - - ), -}; - -export default componentFieldMapping; diff --git a/packages/amplify-ui-components/src/components/amplify-auth-fields/readme.md b/packages/amplify-ui-components/src/components/amplify-auth-fields/readme.md deleted file mode 100644 index ab1b5bff3ff..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth-fields/readme.md +++ /dev/null @@ -1,64 +0,0 @@ -# amplify-auth-fields - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | ----------- | -| `formFields` | -- | Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string \| Functional Component \| null, required: boolean } ] ``` | `FormFieldTypes \| string[]` | `undefined` | - - -## Dependencies - -### Used by - - - [amplify-confirm-sign-in](../amplify-confirm-sign-in) - - [amplify-confirm-sign-up](../amplify-confirm-sign-up) - - [amplify-forgot-password](../amplify-forgot-password) - - [amplify-require-new-password](../amplify-require-new-password) - - [amplify-sign-in](../amplify-sign-in) - - [amplify-sign-up](../amplify-sign-up) - -### Depends on - -- [amplify-username-field](../amplify-username-field) -- [amplify-password-field](../amplify-password-field) -- [amplify-email-field](../amplify-email-field) -- [amplify-code-field](../amplify-code-field) -- [amplify-phone-field](../amplify-phone-field) -- [amplify-form-field](../amplify-form-field) - -### Graph -```mermaid -graph TD; - amplify-auth-fields --> amplify-username-field - amplify-auth-fields --> amplify-password-field - amplify-auth-fields --> amplify-email-field - amplify-auth-fields --> amplify-code-field - amplify-auth-fields --> amplify-phone-field - amplify-auth-fields --> amplify-form-field - amplify-username-field --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-password-field --> amplify-form-field - amplify-email-field --> amplify-form-field - amplify-code-field --> amplify-form-field - amplify-phone-field --> amplify-form-field - amplify-phone-field --> amplify-country-dial-code - amplify-phone-field --> amplify-input - amplify-country-dial-code --> amplify-select - amplify-confirm-sign-in --> amplify-auth-fields - amplify-confirm-sign-up --> amplify-auth-fields - amplify-forgot-password --> amplify-auth-fields - amplify-require-new-password --> amplify-auth-fields - amplify-sign-in --> amplify-auth-fields - amplify-sign-up --> amplify-auth-fields - style amplify-auth-fields fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-auth0-button/__snapshots__/amplify-auth0-button.spec.tsx.snap b/packages/amplify-ui-components/src/components/amplify-auth0-button/__snapshots__/amplify-auth0-button.spec.tsx.snap deleted file mode 100644 index 19b1808dc41..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth0-button/__snapshots__/amplify-auth0-button.spec.tsx.snap +++ /dev/null @@ -1,12 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-auth0-button stories defaults 1`] = ` - - - - - Sign in with Auth0 - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-auth0-button/amplify-auth0-button.spec.tsx b/packages/amplify-ui-components/src/components/amplify-auth0-button/amplify-auth0-button.spec.tsx deleted file mode 100644 index 003f22e47bc..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth0-button/amplify-auth0-button.spec.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; - -import { AmplifyAuth0Button } from './amplify-auth0-button'; -import * as stories from './amplify-auth0-button.stories'; - -const { - default: { title }, - ...templates -} = stories; - -const components = [AmplifyAuth0Button]; - -describe(title, () => { - describe('stories', () => { - Object.entries(templates).forEach(([name, template]) => { - it(name, async () => { - const page = await newSpecPage({ components, template }); - - expect(page.root).toMatchSnapshot(); - }); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-auth0-button/amplify-auth0-button.stories.tsx b/packages/amplify-ui-components/src/components/amplify-auth0-button/amplify-auth0-button.stories.tsx deleted file mode 100644 index cc3b50dcc5d..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth0-button/amplify-auth0-button.stories.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { h } from '@stencil/core'; -import * as knobs from '@storybook/addon-knobs'; - -export default { - title: 'amplify-auth0-button', -}; - -export const defaults = () => ( - -); diff --git a/packages/amplify-ui-components/src/components/amplify-auth0-button/amplify-auth0-button.tsx b/packages/amplify-ui-components/src/components/amplify-auth0-button/amplify-auth0-button.tsx deleted file mode 100644 index e7bf6340c50..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth0-button/amplify-auth0-button.tsx +++ /dev/null @@ -1,127 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { I18n, ConsoleLogger as Logger } from '@aws-amplify/core'; -import { Component, h, Prop } from '@stencil/core'; -import { AUTH_SOURCE_KEY } from '../../common/constants'; -import { - AuthStateHandler, - FederatedConfig, - AuthState, -} from '../../common/types/auth-types'; -import { dispatchAuthStateChangeEvent } from '../../common/helpers'; -import { Translations } from '../../common/Translations'; - -const logger = new Logger('amplify-auth0-button'); - -@Component({ - tag: 'amplify-auth0-button', - shadow: true, -}) -export class AmplifyAuth0Button { - /** See: https://auth0.com/docs/libraries/auth0js/v9#available-parameters */ - @Prop() config: FederatedConfig['auth0Config']; - /** Auth state change handler for this component */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - - private _auth0: any; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - private handleLoad = () => { - // @ts-ignore Property 'auth0' does not exist on type '{}'. - const { oauth = {} } = Auth.configure(); - // @ts-ignore Property 'auth0' does not exist on type '{}'. - const { config = oauth.auth0 } = this; - - if (!config) { - logger.debug('Auth0 is not configured'); - return; - } - - logger.debug('auth0 configuration', config); - - if (!this._auth0) { - this._auth0 = new window['auth0'].WebAuth(config); - } - - this._auth0.parseHash((err, authResult) => { - if (err) { - logger.debug('Failed to parse the url for Auth0', err); - return; - } - - if (!authResult) { - logger.debug('Auth0 found no authResult in hash'); - return; - } - - const payload = { - provider: 'auth0', - opts: { - returnTo: config.returnTo, - clientID: config.clientID, - federated: config.federated, - }, - }; - - try { - localStorage.setItem(AUTH_SOURCE_KEY, JSON.stringify(payload)); - } catch (e) { - logger.debug('Failed to cache auth source into localStorage', e); - } - - this._auth0.client.userInfo(authResult.accessToken, async (err, user) => { - let username = undefined; - let email = undefined; - if (err) { - logger.debug('Failed to get the user info', err); - } else { - username = user.name; - email = user.email; - } - - await Auth.federatedSignIn( - config.domain, - { - token: authResult.idToken, - expires_at: authResult.expiresIn * 1000 + new Date().getTime(), - }, - { name: username, email } - ); - - const authenticatedUser = await Auth.currentAuthenticatedUser(); - - this.handleAuthStateChange(AuthState.SignedIn, authenticatedUser); - }); - }); - }; - - private signInWithAuth0(event) { - event.preventDefault(); - - if (!this._auth0) { - throw new Error('the auth0 client is not configured'); - } - - this._auth0.authorize(); - } - - render() { - return ( - this.signInWithAuth0(event)} - provider="auth0" - > - - {I18n.get(Translations.SIGN_IN_WITH_AUTH0)} - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-auth0-button/readme.md b/packages/amplify-ui-components/src/components/amplify-auth0-button/readme.md deleted file mode 100644 index 927abc8aa40..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-auth0-button/readme.md +++ /dev/null @@ -1,35 +0,0 @@ -# amplify-auth0-button - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | --------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | -| `config` | -- | See: https://auth0.com/docs/libraries/auth0js/v9#available-parameters | `{ audience?: string; clientID: string; domain: string; responseType: string; redirectUri: string; returnTo?: string; scope?: string; }` | `undefined` | -| `handleAuthStateChange` | -- | Auth state change handler for this component | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | - - -## Dependencies - -### Used by - - - [amplify-federated-buttons](../amplify-federated-buttons) - -### Depends on - -- [amplify-sign-in-button](../amplify-sign-in-button) - -### Graph -```mermaid -graph TD; - amplify-auth0-button --> amplify-sign-in-button - amplify-sign-in-button --> amplify-icon - amplify-federated-buttons --> amplify-auth0-button - style amplify-auth0-button fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-authenticator/__snapshots__/amplify-authenticator.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-authenticator/__snapshots__/amplify-authenticator.spec.ts.snap deleted file mode 100644 index aef75c5f35b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-authenticator/__snapshots__/amplify-authenticator.spec.ts.snap +++ /dev/null @@ -1,37 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-authenticator spec: Render logic -> should render a \`forgot password\` if initialAuthState is \`forgotpassword\` 1`] = ` - - -
- - - -
-
-
-`; - -exports[`amplify-authenticator spec: Render logic -> should render a \`sign in\` by default 1`] = ` - - -
- - - -
-
-
-`; - -exports[`amplify-authenticator spec: Render logic -> should render a \`sign up\` if initialAuthState is \`signup\` 1`] = ` - - -
- - - -
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-authenticator/amplify-authenticator.scss b/packages/amplify-ui-components/src/components/amplify-authenticator/amplify-authenticator.scss deleted file mode 100644 index 5d5a3870ae4..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-authenticator/amplify-authenticator.scss +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @prop --background-color: Background color of the container - * @prop --width: Width of the container - * @prop --min-width: Minimum width of the container - * @prop --box-shadow: Bow shadow of the container - * @prop --border-radius: Border radius of the container - * @prop --padding: Padding within the component - * @prop --margin-bottom: Margin below the component - * @prop --container-height: Height of the container. Defaults to 100vh. - * @prop --container-display: Display option of the container. Defaults to flex. - * @prop --container-justify: `justify-content` property of a flex container - * @prop --container-align: `align-items` property of a flex container - */ -:host { - --background-color: var(--amplify-background-color); - --width: 28.75rem; - --min-width: 20rem; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - --box-shadow: 1px 1px 4px 0 rgba(0, 0, 0, 0.15); - --border-radius: 6px; - --padding: 35px 40px; - --margin-bottom: 20px; - - --container-height: 100vh; - --container-display: flex; - --container-justify: center; - --container-align: center; -} - -.auth-container { - display: var(--container-display); - justify-content: var(--container-justify); - align-items: var(--container-align); - min-height: var(--container-height); -} diff --git a/packages/amplify-ui-components/src/components/amplify-authenticator/amplify-authenticator.spec.ts b/packages/amplify-ui-components/src/components/amplify-authenticator/amplify-authenticator.spec.ts deleted file mode 100644 index 9c579cd34d9..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-authenticator/amplify-authenticator.spec.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyAuthenticator } from './amplify-authenticator'; - -describe('amplify-authenticator spec:', () => { - describe('Component logic ->', () => { - let authenticator; - - beforeEach(() => { - authenticator = new AmplifyAuthenticator(); - }); - - it('should render `authState` as `loading` by default', () => { - expect(authenticator.authState).toEqual('loading'); - }); - }); - describe('Render logic ->', () => { - it('should render a `sign up` if initialAuthState is `signup`', async () => { - const page = await newSpecPage({ - components: [AmplifyAuthenticator], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - it('should render a `forgot password` if initialAuthState is `forgotpassword`', async () => { - const page = await newSpecPage({ - components: [AmplifyAuthenticator], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render a `sign in` by default', async () => { - const page = await newSpecPage({ - components: [AmplifyAuthenticator], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-authenticator/amplify-authenticator.stories.tsx b/packages/amplify-ui-components/src/components/amplify-authenticator/amplify-authenticator.stories.tsx deleted file mode 100644 index c99996213ff..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-authenticator/amplify-authenticator.stories.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { h } from '@stencil/core'; -import * as knobs from '@storybook/addon-knobs'; - -export default { - title: 'amplify-authenticator', -}; - -export const defaults = () => ; - -export const withFederated = () => ( - -); diff --git a/packages/amplify-ui-components/src/components/amplify-authenticator/amplify-authenticator.tsx b/packages/amplify-ui-components/src/components/amplify-authenticator/amplify-authenticator.tsx deleted file mode 100644 index 267794dd19f..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-authenticator/amplify-authenticator.tsx +++ /dev/null @@ -1,223 +0,0 @@ -import { Component, State, Prop, h, Host, Element } from '@stencil/core'; -import { - AuthState, - CognitoUserInterface, - FederatedConfig, - UsernameAliasStrings, - AuthStateHandler, -} from '../../common/types/auth-types'; -import { - AUTH_CHANNEL, - NO_AUTH_MODULE_FOUND, - UI_AUTH_CHANNEL, - TOAST_AUTH_ERROR_EVENT, -} from '../../common/constants'; -import { authSlotNames } from './auth-slot-names'; -import { Auth, appendToCognitoUserAgent } from '@aws-amplify/auth'; -import { Hub, Logger } from '@aws-amplify/core'; -import { - dispatchAuthStateChangeEvent, - onAuthUIStateChange, -} from '../../common/helpers'; -import { checkContact } from '../../common/auth-helpers'; -import { JSXBase } from '@stencil/core/internal'; - -const logger = new Logger('Authenticator'); - -/** - * @slot sign-in - Content placed inside of the sign in workflow for when a user wants to sign into their account - * @slot confirm-sign-in - Content placed inside of the confirm sign in workflow for when a user needs to confirm the account they signed in with - * @slot sign-up - Content placed inside of the sign up workflow for when a user wants to register a new account - * @slot confirm-sign-up - Content placed inside of the confirm sign up workflow for when a user needs to confirm the account they signed up with - * @slot forgot-password - Content placed inside of the forgot password workflow for when a user wants to reset their password - * @slot require-new-password - Content placed inside of the require new password workflow for when a user is required to update their password - * @slot verify-contact - Content placed inside of the verify-contact workflow for when a user must verify their contact information - * @slot totp-setup - Content placed inside of the totp-setup workflow for when a user opts to use TOTP MFA - * @slot greetings - Content placed inside of the greetings navigation for when a user is signed in - * @slot loading - Content placed inside of the loading workflow for when the app is loading - */ -@Component({ - tag: 'amplify-authenticator', - styleUrl: 'amplify-authenticator.scss', - shadow: true, -}) -export class AmplifyAuthenticator { - /** Initial starting state of the Authenticator component. E.g. If `signup` is passed the default component is set to AmplifySignUp */ - @Prop() initialAuthState: - | AuthState.SignIn - | AuthState.SignUp - | AuthState.ForgotPassword = AuthState.SignIn; - /** Federated credentials & configuration. */ - @Prop() federated: FederatedConfig; - /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */ - @Prop() usernameAlias: UsernameAliasStrings; - /** Callback for Authenticator state machine changes */ - @Prop() handleAuthStateChange: AuthStateHandler = () => {}; - /** Hide amplify-toast for auth errors */ - @Prop() hideToast: boolean = false; - - @State() authState: AuthState = AuthState.Loading; - @State() authData: CognitoUserInterface; - @State() toastMessage: string = ''; - - @Element() el: HTMLAmplifyAuthenticatorElement; - - private handleExternalAuthEvent = ({ payload }) => { - switch (payload.event) { - case 'cognitoHostedUI': - case 'signIn': - checkContact(payload.data, dispatchAuthStateChangeEvent); - break; - case 'cognitoHostedUI_failure': - case 'parsingUrl_failure': - case 'signOut': - case 'customGreetingSignOut': - return dispatchAuthStateChangeEvent(this.initialAuthState); - } - }; - - private handleToastEvent = ({ payload }) => { - switch (payload.event) { - case TOAST_AUTH_ERROR_EVENT: - if (payload.message) this.toastMessage = payload.message; - break; - } - }; - - async componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - onAuthUIStateChange((authState, authData) => { - this.onAuthStateChange(authState, authData as CognitoUserInterface); - this.toastMessage = ''; - }); - if (!this.hideToast) Hub.listen(UI_AUTH_CHANNEL, this.handleToastEvent); - Hub.listen(AUTH_CHANNEL, this.handleExternalAuthEvent); - - appendToCognitoUserAgent('amplify-authenticator'); - await this.checkUser(); - } - - private async checkUser(): Promise { - if (!Auth || typeof Auth.currentAuthenticatedUser !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - return Auth.currentAuthenticatedUser() - .then(user => { - dispatchAuthStateChangeEvent(AuthState.SignedIn, user); - }) - .catch(() => { - dispatchAuthStateChangeEvent(this.initialAuthState); - }); - } - - private async onAuthStateChange( - nextAuthState: AuthState, - data?: CognitoUserInterface - ) { - if (nextAuthState === undefined) - return logger.error('nextAuthState cannot be undefined'); - - logger.info( - 'Inside onAuthStateChange Method current authState:', - this.authState - ); - - if (nextAuthState === AuthState.SignedOut) { - this.authState = this.initialAuthState; - } else { - this.authState = nextAuthState; - } - - this.authData = data; - if (this.authData) logger.log('Auth Data was set:', this.authData); - - if (this.authState === nextAuthState) { - this.handleAuthStateChange(this.authState, this.authData); - logger.info(`authState has been updated to ${this.authState}`); - } - } - - // Returns the auth component corresponding to the given authState. - private getAuthComponent(authState: AuthState): JSXBase.IntrinsicElements { - switch (authState) { - case AuthState.SignIn: - return ( - - ); - case AuthState.ConfirmSignIn: - return ; - case AuthState.SignUp: - return ; - case AuthState.ConfirmSignUp: - return ( - - ); - case AuthState.ForgotPassword: - return ; - case AuthState.ResetPassword: - return ; - case AuthState.VerifyContact: - return ; - case AuthState.TOTPSetup: - return ; - case AuthState.Loading: - return
Loading...
; - default: - throw new Error(`Unhandled auth state: ${authState}`); - } - } - - // Returns a slot containing the Auth component corresponding to the given authState - private getSlotWithAuthComponent( - authState: AuthState - ): JSXBase.IntrinsicElements { - const authComponent = this.getAuthComponent(authState); - const slotName = authSlotNames[authState]; - const slotIsEmpty = this.el.querySelector(`[slot="${slotName}"]`) === null; // true if no element has been inserted to the slot - - /** - * Connect the inner auth component to DOM only if the slot hasn't been overwritten. This prevents - * the overwritten component from calling its lifecycle methods. - */ - return {slotIsEmpty && authComponent}; - } - - disconnectedCallback() { - Hub.remove(AUTH_CHANNEL, this.handleExternalAuthEvent); - if (!this.hideToast) Hub.remove(UI_AUTH_CHANNEL, this.handleToastEvent); - return onAuthUIStateChange; - } - - render() { - return ( - - {!this.hideToast && this.toastMessage && ( - { - this.toastMessage = ''; - }} - data-test="authenticator-error" - /> - )} - {this.authState === AuthState.SignedIn ? ( - [, ] - ) : ( -
- {this.getSlotWithAuthComponent(this.authState)} -
- )} -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-authenticator/auth-slot-names.ts b/packages/amplify-ui-components/src/components/amplify-authenticator/auth-slot-names.ts deleted file mode 100644 index 277be547a8b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-authenticator/auth-slot-names.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AuthState } from '../../common/types/auth-types'; - -export const authSlotNames: Partial> = { - [AuthState.SignIn]: 'sign-in', - [AuthState.ConfirmSignIn]: 'confirm-sign-in', - [AuthState.SignUp]: 'sign-up', - [AuthState.ConfirmSignUp]: 'confirm-sign-up', - [AuthState.ForgotPassword]: 'forgot-password', - [AuthState.ResetPassword]: 'require-new-password', - [AuthState.VerifyContact]: 'verify-contact', - [AuthState.TOTPSetup]: 'totp-setup', - [AuthState.Loading]: 'loading', -}; diff --git a/packages/amplify-ui-components/src/components/amplify-authenticator/readme.md b/packages/amplify-ui-components/src/components/amplify-authenticator/readme.md deleted file mode 100644 index 94458b8c6b1..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-authenticator/readme.md +++ /dev/null @@ -1,144 +0,0 @@ -# amplify-authenticator - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | ------------------ | -| `federated` | -- | Federated credentials & configuration. | `FederatedConfig` | `undefined` | -| `handleAuthStateChange` | -- | Callback for Authenticator state machine changes | `(nextAuthState: AuthState, data?: object) => void` | `() => {}` | -| `hideToast` | `hide-toast` | Hide amplify-toast for auth errors | `boolean` | `false` | -| `initialAuthState` | `initial-auth-state` | Initial starting state of the Authenticator component. E.g. If `signup` is passed the default component is set to AmplifySignUp | `AuthState.ForgotPassword \| AuthState.SignIn \| AuthState.SignUp` | `AuthState.SignIn` | -| `usernameAlias` | `username-alias` | Username Alias is used to setup authentication with `username`, `email` or `phone_number` | `"email" \| "phone_number" \| "username"` | `undefined` | - - -## Slots - -| Slot | Description | -| ------------------------ | ---------------------------------------------------------------------------------------------------------------------- | -| `"confirm-sign-in"` | Content placed inside of the confirm sign in workflow for when a user needs to confirm the account they signed in with | -| `"confirm-sign-up"` | Content placed inside of the confirm sign up workflow for when a user needs to confirm the account they signed up with | -| `"forgot-password"` | Content placed inside of the forgot password workflow for when a user wants to reset their password | -| `"greetings"` | Content placed inside of the greetings navigation for when a user is signed in | -| `"loading"` | Content placed inside of the loading workflow for when the app is loading | -| `"require-new-password"` | Content placed inside of the require new password workflow for when a user is required to update their password | -| `"sign-in"` | Content placed inside of the sign in workflow for when a user wants to sign into their account | -| `"sign-up"` | Content placed inside of the sign up workflow for when a user wants to register a new account | -| `"totp-setup"` | Content placed inside of the totp-setup workflow for when a user opts to use TOTP MFA | -| `"verify-contact"` | Content placed inside of the verify-contact workflow for when a user must verify their contact information | - - -## CSS Custom Properties - -| Name | Description | -| --------------------- | -------------------------------------------------- | -| `--background-color` | Background color of the container | -| `--border-radius` | Border radius of the container | -| `--box-shadow` | Bow shadow of the container | -| `--container-align` | `align-items` property of a flex container | -| `--container-display` | Display option of the container. Defaults to flex. | -| `--container-height` | Height of the container. Defaults to 100vh. | -| `--container-justify` | `justify-content` property of a flex container | -| `--margin-bottom` | Margin below the component | -| `--min-width` | Minimum width of the container | -| `--padding` | Padding within the component | -| `--width` | Width of the container | - - -## Dependencies - -### Depends on - -- [amplify-sign-in](../amplify-sign-in) -- [amplify-confirm-sign-in](../amplify-confirm-sign-in) -- [amplify-sign-up](../amplify-sign-up) -- [amplify-confirm-sign-up](../amplify-confirm-sign-up) -- [amplify-forgot-password](../amplify-forgot-password) -- [amplify-require-new-password](../amplify-require-new-password) -- [amplify-verify-contact](../amplify-verify-contact) -- [amplify-totp-setup](../amplify-totp-setup) -- [amplify-toast](../amplify-toast) - -### Graph -```mermaid -graph TD; - amplify-authenticator --> amplify-sign-in - amplify-authenticator --> amplify-confirm-sign-in - amplify-authenticator --> amplify-sign-up - amplify-authenticator --> amplify-confirm-sign-up - amplify-authenticator --> amplify-forgot-password - amplify-authenticator --> amplify-require-new-password - amplify-authenticator --> amplify-verify-contact - amplify-authenticator --> amplify-totp-setup - amplify-authenticator --> amplify-toast - amplify-sign-in --> amplify-button - amplify-sign-in --> amplify-form-section - amplify-sign-in --> amplify-federated-buttons - amplify-sign-in --> amplify-strike - amplify-sign-in --> amplify-auth-fields - amplify-sign-in --> amplify-loading-spinner - amplify-button --> amplify-icon - amplify-form-section --> amplify-section - amplify-form-section --> amplify-button - amplify-form-section --> amplify-loading-spinner - amplify-loading-spinner --> amplify-icon - amplify-federated-buttons --> amplify-google-button - amplify-federated-buttons --> amplify-facebook-button - amplify-federated-buttons --> amplify-amazon-button - amplify-federated-buttons --> amplify-oauth-button - amplify-federated-buttons --> amplify-auth0-button - amplify-google-button --> amplify-sign-in-button - amplify-sign-in-button --> amplify-icon - amplify-facebook-button --> amplify-sign-in-button - amplify-amazon-button --> amplify-sign-in-button - amplify-oauth-button --> amplify-sign-in-button - amplify-auth0-button --> amplify-sign-in-button - amplify-auth-fields --> amplify-username-field - amplify-auth-fields --> amplify-password-field - amplify-auth-fields --> amplify-email-field - amplify-auth-fields --> amplify-code-field - amplify-auth-fields --> amplify-phone-field - amplify-auth-fields --> amplify-form-field - amplify-username-field --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-password-field --> amplify-form-field - amplify-email-field --> amplify-form-field - amplify-code-field --> amplify-form-field - amplify-phone-field --> amplify-form-field - amplify-phone-field --> amplify-country-dial-code - amplify-phone-field --> amplify-input - amplify-country-dial-code --> amplify-select - amplify-confirm-sign-in --> amplify-form-section - amplify-confirm-sign-in --> amplify-button - amplify-confirm-sign-in --> amplify-auth-fields - amplify-sign-up --> amplify-form-section - amplify-sign-up --> amplify-auth-fields - amplify-sign-up --> amplify-button - amplify-sign-up --> amplify-loading-spinner - amplify-confirm-sign-up --> amplify-button - amplify-confirm-sign-up --> amplify-form-section - amplify-confirm-sign-up --> amplify-auth-fields - amplify-forgot-password --> amplify-form-section - amplify-forgot-password --> amplify-button - amplify-forgot-password --> amplify-auth-fields - amplify-require-new-password --> amplify-form-section - amplify-require-new-password --> amplify-button - amplify-require-new-password --> amplify-auth-fields - amplify-verify-contact --> amplify-input - amplify-verify-contact --> amplify-radio-button - amplify-verify-contact --> amplify-form-section - amplify-verify-contact --> amplify-button - amplify-radio-button --> amplify-label - amplify-totp-setup --> amplify-form-section - amplify-totp-setup --> amplify-form-field - amplify-toast --> amplify-icon - style amplify-authenticator fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-button/__snapshots__/amplify-button.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-button/__snapshots__/amplify-button.spec.ts.snap deleted file mode 100644 index 5b27dcd51af..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-button/__snapshots__/amplify-button.spec.ts.snap +++ /dev/null @@ -1,26 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-button spec: Render logic -> renders with button text FOO 1`] = ` - - - - -`; - -exports[`amplify-button spec: Render logic -> renders with danger class when button type is reset 1`] = ` - - - - -`; - -exports[`amplify-button spec: Render logic -> renders with no button text 1`] = ` - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-button/amplify-button.e2e.ts b/packages/amplify-ui-components/src/components/amplify-button/amplify-button.e2e.ts deleted file mode 100644 index 5c5ae872cfb..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-button/amplify-button.e2e.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { E2EPage, newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-button e2e:', () => { - let page: E2EPage; - - beforeEach(async () => { - page = await newE2EPage(); - await page.setContent('FOO'); - }); - - it(`renders with text 'FOO'`, async () => { - const element = await page.find('amplify-button'); - expect(element).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-form-section', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); - - it('fires its onButtonClick callback upon being clicked', async () => { - const buttonElement = await page.find('amplify-button'); - expect(buttonElement).not.toBeNull(); - - const func = jest.fn(); - await page.exposeFunction('exposedfunc', func); - - // This block here, and the .exposeFunction() above, are both necessary - // if you ever want to pass a function into an object's props - await page.$eval('amplify-button', (componentElement: any) => { - componentElement.handleButtonClick = this.exposedfunc; - }); - await page.waitForChanges(); - - const button = await buttonElement.find('button'); - expect(func).not.toHaveBeenCalled(); - await button.click(); - expect(func).toHaveBeenCalledTimes(1); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-button/amplify-button.scss b/packages/amplify-ui-components/src/components/amplify-button/amplify-button.scss deleted file mode 100644 index 1dc22b02f6b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-button/amplify-button.scss +++ /dev/null @@ -1,120 +0,0 @@ -/** - * @prop --background-color: Background color of the button - * @prop --background-color-active: Background color of the button when it's active - * @prop --background-color-disable: Background color of the button when it's disabled - * @prop --color: Text color within the button - * @prop --border-width: Border width of the button - * @prop --border-color: Border color of the button - * @prop --border-radius: Border radius of the button - * @prop --border-style: Border style of the button - * @prop --link-color: Text color within an anchor variant button - * @prop --link-hover: Text color within an anchor variant button when hovering - * @prop --link-active: Text color within the anchor variant button when active - * @prop --text-transform: Text capitalization transform within the button - * @prop --icon-fill: Icon fill color within an icon variant button - * @prop --icon-height: Icon height within an icon variant button - * @prop --padding: Padding within the button - * @prop --width: Width of the button - */ -amplify-button { - --background-color: var(--amplify-primary-color); - --background-color-active: var(--amplify-primary-shade); - --background-color-disable: var(--amplify-primary-tint); - --color: var(--amplify-primary-contrast); - --border-width: 0; - --border-color: initial; - --border-style: initial; - --border-radius: initial; - --link-color: var(--amplify-primary-color); - --link-hover: var(--amplify-primary-tint); - --link-active: var(--amplify-primary-shade); - --text-transform: uppercase; - --icon-fill: var(--amplify-white); - --icon-height: 1.25rem; - --padding: 1rem; - --width: 100%; - - width: var(--width); - text-align: center; - - @include md { - width: inherit; - } -} - -.button { - width: 100%; - min-width: 153px; - display: inline-block; - margin-bottom: 0; - font-size: var(--amplify-text-sm); - font-family: var(--amplify-font-family); - font-weight: 600; - text-align: center; - white-space: nowrap; - vertical-align: middle; - touch-action: manipulation; - cursor: pointer; - user-select: none; - background-image: none; - color: var(--color); - padding: var(--padding); - letter-spacing: 0.75px; - text-transform: var(--text-transform); - background-color: var(--background-color); - border-width: var(--border-width); - border-color: var(--border-color); - border-style: var(--border-style); - border-radius: var(--border-radius); - - &:active { - opacity: 1; - background-color: var(--background-color-active); - } - - &:hover { - opacity: 0.8; - } - - &:disabled { - opacity: 0.65; - cursor: auto; - background-color: var(--background-color-disable); - } -} - -.icon { - background-color: inherit; - border: none; - font: inherit; - cursor: pointer; - padding: var(--padding); - amplify-icon { - --icon-fill-color: var(--icon-fill); - --height: var(--icon-height); - } -} - -.anchor { - color: var(--link-color); - background-color: inherit; - padding: 0; - border: none; - font: inherit; - cursor: pointer; - - &:link { - color: var(--link-color); - text-decoration: none; - } - - &:hover { - color: var(--link-hover); - text-decoration: underline; - } - - &:active { - color: var(--link-active); - text-decoration: underline; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-button/amplify-button.spec.ts b/packages/amplify-ui-components/src/components/amplify-button/amplify-button.spec.ts deleted file mode 100644 index 8b1aa6faec5..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-button/amplify-button.spec.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyButton } from './amplify-button'; - -describe('amplify-button spec:', () => { - describe('Render logic ->', () => { - it('renders with no button text', async () => { - const page = await newSpecPage({ - components: [AmplifyButton], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - it('renders with button text FOO', async () => { - const page = await newSpecPage({ - components: [AmplifyButton], - html: `FOO`, - }); - - expect(page.root).toMatchSnapshot(); - }); - it('renders with danger class when button type is reset', async () => { - const page = await newSpecPage({ - components: [AmplifyButton], - html: `FOO`, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); - describe('Component logic ->', () => { - it(`should have type 'button' by default`, async () => { - const button = new AmplifyButton(); - expect(button.type).toBe('button'); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-button/amplify-button.stories.tsx b/packages/amplify-ui-components/src/components/amplify-button/amplify-button.stories.tsx deleted file mode 100644 index c342aac0c72..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-button/amplify-button.stories.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { storiesOf } from '@storybook/html'; -import { knobs } from '../../common/testing'; - -const buttonStories = storiesOf('amplify-button', module); - -buttonStories.add('with text', () => { - const text = knobs.buttonTextKnob('Foo'); - const type = knobs.buttonTypeKnob('button'); - return `${text}`; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-button/amplify-button.tsx b/packages/amplify-ui-components/src/components/amplify-button/amplify-button.tsx deleted file mode 100644 index c838a1ed984..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-button/amplify-button.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { Element, Component, Prop, h, Host } from '@stencil/core'; -import { ButtonTypes, ButtonVariant } from '../../common/types/ui-types'; -import { IconNameType } from '../amplify-icon/icons'; - -/** - * @slot (default) - content placed within the button - */ -@Component({ - tag: 'amplify-button', - styleUrl: 'amplify-button.scss', -}) -export class AmplifyButton { - @Element() el!: HTMLAmplifyButtonElement; - /** Type of the button: 'button', 'submit' or 'reset' */ - @Prop() type: ButtonTypes = 'button'; - /** Variant of a button: 'button' | 'anchor | 'icon' */ - @Prop() variant: ButtonVariant = 'button'; - /** (Optional) Callback called when a user clicks on the button */ - @Prop() handleButtonClick: (evt: Event) => void; - /** Disabled state of the button */ - @Prop() disabled?: boolean = false; - /** Name of icon to be placed inside the button */ - @Prop() icon?: IconNameType; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-button/readme.md b/packages/amplify-ui-components/src/components/amplify-button/readme.md deleted file mode 100644 index b331dea4ebe..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-button/readme.md +++ /dev/null @@ -1,88 +0,0 @@ -# amplify-button - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------------- | ---------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -| `disabled` | `disabled` | Disabled state of the button | `boolean` | `false` | -| `handleButtonClick` | -- | (Optional) Callback called when a user clicks on the button | `(evt: Event) => void` | `undefined` | -| `icon` | `icon` | Name of icon to be placed inside the button | `"amazon" \| "auth0" \| "ban" \| "enter-vr" \| "exit-vr" \| "facebook" \| "google" \| "loading" \| "maximize" \| "microphone" \| "minimize" \| "photoPlaceholder" \| "send" \| "sound" \| "sound-mute" \| "warning"` | `undefined` | -| `type` | `type` | Type of the button: 'button', 'submit' or 'reset' | `"button" \| "reset" \| "submit"` | `'button'` | -| `variant` | `variant` | Variant of a button: 'button' \| 'anchor \| 'icon' | `"anchor" \| "button" \| "icon"` | `'button'` | - - -## Slots - -| Slot | Description | -| ------------- | -------------------------------- | -| `"(default)"` | content placed within the button | - - -## CSS Custom Properties - -| Name | Description | -| ---------------------------- | -------------------------------------------------------- | -| `--background-color` | Background color of the button | -| `--background-color-active` | Background color of the button when it's active | -| `--background-color-disable` | Background color of the button when it's disabled | -| `--border-color` | Border color of the button | -| `--border-radius` | Border radius of the button | -| `--border-style` | Border style of the button | -| `--border-width` | Border width of the button | -| `--color` | Text color within the button | -| `--icon-fill` | Icon fill color within an icon variant button | -| `--icon-height` | Icon height within an icon variant button | -| `--link-active` | Text color within the anchor variant button when active | -| `--link-color` | Text color within an anchor variant button | -| `--link-hover` | Text color within an anchor variant button when hovering | -| `--padding` | Padding within the button | -| `--text-transform` | Text capitalization transform within the button | -| `--width` | Width of the button | - - -## Dependencies - -### Used by - - - [amplify-chatbot](../amplify-chatbot) - - [amplify-confirm-sign-in](../amplify-confirm-sign-in) - - [amplify-confirm-sign-up](../amplify-confirm-sign-up) - - [amplify-forgot-password](../amplify-forgot-password) - - [amplify-form-section](../amplify-form-section) - - [amplify-photo-picker](../amplify-photo-picker) - - [amplify-picker](../amplify-picker) - - [amplify-require-new-password](../amplify-require-new-password) - - [amplify-sign-in](../amplify-sign-in) - - [amplify-sign-out](../amplify-sign-out) - - [amplify-sign-up](../amplify-sign-up) - - [amplify-verify-contact](../amplify-verify-contact) - -### Depends on - -- [amplify-icon](../amplify-icon) - -### Graph -```mermaid -graph TD; - amplify-button --> amplify-icon - amplify-chatbot --> amplify-button - amplify-confirm-sign-in --> amplify-button - amplify-confirm-sign-up --> amplify-button - amplify-forgot-password --> amplify-button - amplify-form-section --> amplify-button - amplify-photo-picker --> amplify-button - amplify-picker --> amplify-button - amplify-require-new-password --> amplify-button - amplify-sign-in --> amplify-button - amplify-sign-out --> amplify-button - amplify-sign-up --> amplify-button - amplify-verify-contact --> amplify-button - style amplify-button fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-chatbot/__snapshots__/amplify-chatbot.spec.tsx.snap b/packages/amplify-ui-components/src/components/amplify-chatbot/__snapshots__/amplify-chatbot.spec.tsx.snap deleted file mode 100644 index 4c909a41d11..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-chatbot/__snapshots__/amplify-chatbot.spec.tsx.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-chatbot renders chatbot 1`] = ` - - -
- -
- ChatBot Lex -
-
-
-
- -
- -
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-chatbot/amplify-chatbot.scss b/packages/amplify-ui-components/src/components/amplify-chatbot/amplify-chatbot.scss deleted file mode 100644 index 714e8db75ff..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-chatbot/amplify-chatbot.scss +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @prop --width: Width of the container - * @prop --height: Height of the container - * @prop --header-color: Text color within the header - * @prop --header-size: Text size within the header - * @prop --bot-background-color: Background color of bot messages - * @prop --bot-text-color: Text color of bot messages - * @prop --bot-dot-color: Base color of bot loading message animation - * @prop --user-background-color: Background color of user messages - * @prop --user-text-color: Text color of user messages - * @prop --user-dot-color: Base color of user loading message animation - */ -@import 'animation.scss'; -:host { - --width: 28.75rem; - --height: 37.5rem; - --header-color: var(--amplify-secondary-color); - --header-size: var(--amplify-text-lg); - --bot-background-color: rgb(230, 230, 230); - --bot-text-color: black; - --bot-dot-color: var(--bot-text-color); - --user-background-color: var(--amplify-blue); - --user-text-color: var(--amplify-white); - --user-dot-color: var(--user-text-color); -} -.amplify-chatbot { - display: inline-flex; - flex-direction: column; - background-color: var(--background-color); - border-radius: 0.375rem; - box-shadow: 0.0625rem 0rem 0.25rem 0 rgba(0, 0, 0, 0.15); - box-sizing: border-box; - font-family: var(--amplify-font-family); - margin-bottom: 1rem; - width: 100%; - height: var(--height); - @include md { - width: var(--width); - } - max-width: var(--width); -} -.header { - padding: 1.25rem 0.375rem 1.25rem 0.375rem; - color: var(--header-color); - font-size: var(--header-size); - font-weight: bold; - text-align: center; - word-wrap: break-word; -} -.body { - border-top: 0.0625rem solid rgba(0, 0, 0, 0.05); - padding: 1.5rem 1rem 0 1rem; - display: flex; - flex-grow: 1; - flex-direction: column; - overflow: auto; -} -.bubble { - max-width: 100%; - padding: 0.8em 1.4em; - text-align: left; - word-wrap: break-word; - margin-bottom: 0.625rem; -} -.bot { - margin-right: auto; - background-color: var(--bot-background-color); - color: var(--bot-text-color); - border-radius: 1.5rem 1.5rem 1.5rem 0; -} -.user { - margin-left: auto; - background-color: var(--user-background-color); - color: var(--user-text-color); - border-radius: 1.5rem 1.5rem 0 1.5rem; -} -.footer { - display: flex; - align-items: center; - border-top: 0.062rem solid rgba(0, 0, 0, 0.05); - padding-right: 0.625rem; - min-height: 3.125rem; - amplify-input { - --border: none; - --margin: 0; - flex-grow: 1; - } -} -canvas { - margin-left: 0.625rem; - margin-right: 0.625rem; - flex-grow: 1; - height: 3.125rem; -} -.icon-button { - --icon-height: 1.25rem; - --icon-fill: var(--amplify-primary-color); - --padding: 0.625rem; - --width: auto; -} diff --git a/packages/amplify-ui-components/src/components/amplify-chatbot/amplify-chatbot.spec.tsx b/packages/amplify-ui-components/src/components/amplify-chatbot/amplify-chatbot.spec.tsx deleted file mode 100644 index ff1ebad4695..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-chatbot/amplify-chatbot.spec.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyChatbot } from './amplify-chatbot'; - -describe('amplify-chatbot', () => { - it('renders chatbot', async () => { - const page = await newSpecPage({ - components: [AmplifyChatbot], - html: ``, - }); - expect(page.root).toMatchSnapshot(); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-chatbot/amplify-chatbot.tsx b/packages/amplify-ui-components/src/components/amplify-chatbot/amplify-chatbot.tsx deleted file mode 100644 index 846d4049d32..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-chatbot/amplify-chatbot.tsx +++ /dev/null @@ -1,432 +0,0 @@ -import { - Component, - Host, - h, - Prop, - State, - Listen, - Event, - EventEmitter, - Element, -} from '@stencil/core'; -import { I18n } from '@aws-amplify/core'; -import { Interactions } from '@aws-amplify/interactions'; -import { JSXBase } from '@stencil/core/internal'; -import { AudioRecorder, visualize } from '../../common/audio-control'; -import { ChatResult } from '../../common/types/interactions-types'; -import { NO_INTERACTIONS_MODULE_FOUND } from '../../common/constants'; -import { Translations } from '../../common/Translations'; -import { InteractionsResponse } from '@aws-amplify/interactions'; - -// enum for possible bot states -enum ChatState { - Initial, - Listening, - SendingText, - SendingVoice, - Error, -} - -// Message types -enum MessageFrom { - Bot = 'bot', - User = 'user', -} -interface Message { - content: string; - from: MessageFrom; -} - -// Error types -enum ChatErrorType { - Recoverable, - Unrecoverable, -} -interface ChatError { - message: string; - errorType: ChatErrorType; -} - -/** - * @slot header - Title content placed at the top - */ -@Component({ - tag: 'amplify-chatbot', - styleUrl: 'amplify-chatbot.scss', - shadow: true, -}) -export class AmplifyChatbot { - /** Name of the bot */ - @Prop() botName: string; - /** Clear messages when conversation finishes */ - @Prop() clearOnComplete: boolean = false; - /** Continue listening to users after they send the message */ - @Prop() conversationModeOn: boolean = false; - /** Greeting message displayed to users */ - @Prop() welcomeMessage: string; - /** Text placed in the top header */ - @Prop() botTitle: string = Translations.CHATBOT_TITLE; - /** Whether voice chat is enabled */ - @Prop() voiceEnabled: boolean = false; - /** Whether text chat is enabled */ - @Prop() textEnabled: boolean = true; - /** Amount of silence (in ms) to wait for */ - @Prop() silenceTime: number = 1500; - /** Noise threshold between -1 and 1. Anything below is considered a silence. */ - @Prop() silenceThreshold: number = 0.2; - - /** Messages in current session */ - @State() messages: Message[] = []; - /** Text input box value */ - @State() text: string = ''; - /** Current app state */ - @State() chatState: ChatState = ChatState.Initial; - /** Toast error */ - @State() error: ChatError; - - @Element() element: HTMLAmplifyChatbotElement; - - private audioRecorder: AudioRecorder; - - // Occurs when user presses enter in input box - @Listen('formSubmit') - submitHandler(_event: CustomEvent) { - this.sendTextMessage(); - } - - /** Event emitted when conversation is completed */ - @Event() chatCompleted: EventEmitter; - - /** - * Lifecycle functions - */ - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - if (!Interactions || typeof Interactions.onComplete !== 'function') { - throw new Error(NO_INTERACTIONS_MODULE_FOUND); - } - this.validateProps(); - } - - componentDidRender() { - // scroll to the bottom if necessary - const body = this.element.shadowRoot.querySelector('.body'); - body.scrollTop = body.scrollHeight; - } - - private validateProps() { - if (!this.voiceEnabled && !this.textEnabled) { - this.setError( - Translations.CHAT_DISABLED_ERROR, - ChatErrorType.Unrecoverable - ); - return; - } else if (!this.botName) { - this.setError( - Translations.NO_BOT_NAME_ERROR, - ChatErrorType.Unrecoverable - ); - return; - } - - if (this.welcomeMessage) - this.appendToChat(this.welcomeMessage, MessageFrom.Bot); - // Initialize AudioRecorder if voice is enabled - if (this.voiceEnabled) { - this.audioRecorder = new AudioRecorder({ - time: this.silenceTime, - amplitude: this.silenceThreshold, - }); - this.audioRecorder.init().catch(err => { - this.setError(err, ChatErrorType.Recoverable); - }); - } - - // Callback function to be called after chat is completed - const onComplete = (err: string, data: object) => { - this.chatCompleted.emit({ - data, - err, - }); - if (this.clearOnComplete) { - this.reset(); - } else { - this.chatState = ChatState.Initial; - } - }; - - try { - Interactions.onComplete(this.botName, onComplete); - } catch (err) { - this.setError(err, ChatErrorType.Unrecoverable); - } - } - - /** - * Handlers - */ - private handleSubmit(event) { - event.preventDefault(); - this.sendTextMessage(); - } - - private handleMicButton() { - if (this.chatState !== ChatState.Initial) return; - this.audioRecorder.stop(); - this.chatState = ChatState.Listening; - this.audioRecorder.startRecording( - () => this.handleSilence(), - (data, length) => this.visualizer(data, length) - ); - } - - private handleSilence() { - this.chatState = ChatState.SendingVoice; - this.audioRecorder.stopRecording(); - this.audioRecorder.exportWAV().then(blob => { - this.sendVoiceMessage(blob); - }); - } - - private handleTextChange(event: Event) { - const target = event.target as HTMLInputElement; - this.text = target.value; - } - - private handleCancelButton() { - this.audioRecorder.clear(); - this.chatState = ChatState.Initial; - } - - private handleToastClose(errorType: ChatErrorType) { - this.error = undefined; // clear error - // if error is recoverable, reset the app state to initial - if (errorType === ChatErrorType.Recoverable) { - this.chatState = ChatState.Initial; - } - } - - /** - * Visualization - */ - private visualizer(dataArray: Uint8Array, bufferLength: number) { - const canvas = this.element.shadowRoot.querySelector('canvas'); - visualize(dataArray, bufferLength, canvas); - } - - /** - * Interactions helpers - */ - private async sendTextMessage() { - if (this.text.length === 0 || this.chatState !== ChatState.Initial) return; - const text = this.text; - this.text = ''; - this.appendToChat(text, MessageFrom.User); - this.chatState = ChatState.SendingText; - - let response: InteractionsResponse; - try { - response = await Interactions.send(this.botName, text); - } catch (err) { - this.setError(err, ChatErrorType.Recoverable); - return; - } - if (response.message) { - this.appendToChat(response.message, MessageFrom.Bot); - } - this.chatState = ChatState.Initial; - } - - private async sendVoiceMessage(audioInput: Blob) { - const interactionsMessage = { - content: audioInput, - options: { - messageType: 'voice', - }, - }; - - let response: InteractionsResponse; - try { - response = await Interactions.send(this.botName, interactionsMessage); - } catch (err) { - this.setError(err, ChatErrorType.Recoverable); - return; - } - - this.chatState = ChatState.Initial; - const dialogState = response.dialogState; - if (response.inputTranscript) - this.appendToChat(response.inputTranscript, MessageFrom.User); - this.appendToChat(response.message, MessageFrom.Bot); - - await this.audioRecorder - .play(response.audioStream) - .then(() => { - // if conversationMode is on, chat is incomplete, and mic button isn't pressed yet, resume listening. - if ( - this.conversationModeOn && - dialogState !== 'Fulfilled' && - dialogState !== 'Failed' && - this.chatState === ChatState.Initial - ) { - this.handleMicButton(); - } - }) - .catch(err => this.setError(err, ChatErrorType.Recoverable)); - } - - private appendToChat(content: string, from: MessageFrom) { - this.messages = [ - ...this.messages, - { - content, - from, - }, - ]; - } - - /** - * State control methods - */ - private setError(error: string | Error, errorType: ChatErrorType) { - const message = typeof error === 'string' ? error : error.message; - this.chatState = ChatState.Error; - this.error = { message, errorType }; - } - - private reset() { - this.chatState = ChatState.Initial; - this.text = ''; - this.error = undefined; - this.messages = []; - if (this.welcomeMessage) - this.appendToChat(this.welcomeMessage, MessageFrom.Bot); - this.audioRecorder && this.audioRecorder.clear(); - } - - /** - * Rendering methods - */ - private messageJSX = (messages: Message[]) => { - const messageList = messages.map(message => ( -
{message.content}
- )); - if ( - this.chatState === ChatState.SendingText || - this.chatState === ChatState.SendingVoice - ) { - // if waiting for voice message, show animation on user side because app is waiting for transcript. Else put it on bot side. - const client = - this.chatState === ChatState.SendingText - ? MessageFrom.Bot - : MessageFrom.User; - - messageList.push( -
-
- - - -
-
- ); - } - return messageList; - }; - - private listeningFooterJSX(): JSXBase.IntrinsicElements[] { - const visualization = ; - const cancelButton = ( - this.handleCancelButton()} - class="icon-button" - variant="icon" - icon="ban" - /> - ); - return [visualization, cancelButton]; - } - - private footerJSX(): JSXBase.IntrinsicElements[] { - if (this.chatState === ChatState.Listening) - return this.listeningFooterJSX(); - - const inputPlaceholder = this.textEnabled - ? Translations.TEXT_INPUT_PLACEHOLDER - : Translations.VOICE_INPUT_PLACEHOLDER; - const textInput = ( - this.handleTextChange(evt)} - value={this.text} - disabled={this.chatState === ChatState.Error || !this.textEnabled} - /> - ); - const micButton = this.voiceEnabled && ( - this.handleMicButton()} - class="icon-button" - variant="icon" - icon="microphone" - disabled={ - this.chatState === ChatState.Error || - this.chatState !== ChatState.Initial - } - /> - ); - const sendButton = this.textEnabled && ( - this.sendTextMessage()} - disabled={ - this.chatState === ChatState.Error || - this.chatState !== ChatState.Initial - } - /> - ); - return [textInput, micButton, sendButton]; - } - - private errorToast() { - if (!this.error) return; - const { message, errorType } = this.error; - return ( - this.handleToastClose(errorType)} - /> - ); - } - - render() { - return ( - -
- -
- {I18n.get(this.botTitle)} -
-
-
- {this.messageJSX(this.messages)} -
-
this.handleSubmit(e)}> - -
- {this.errorToast()} -
-
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-chatbot/animation.scss b/packages/amplify-ui-components/src/components/amplify-chatbot/animation.scss deleted file mode 100644 index ba9ac08db35..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-chatbot/animation.scss +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Loading animation adapted from: https://github.com/nzbin/three-dots. - */ - -// set dot color for bot -.bot .dot { - background-color: var(--bot-dot-color); -} - -// set dot color for user -.user .dot { - background-color: var(--user-dot-color); -} - -.dot-flashing { - width: 2.625rem; - .dot { - display: inline-block; - width: 0.625rem; - height: 0.625rem; - border-radius: 10rem; - opacity: 0.65; - } - .left { - animation: dot-flashing 1s infinite alternate; - animation-delay: 0s; - } - .middle { - margin-left: 0.375rem; - margin-right: 0.375rem; - animation: dot-flashing 1s infinite linear alternate; - animation-delay: 0.5s; - } - .right { - animation: dot-flashing 1s infinite alternate; - animation-delay: 1s; - } -} - -@keyframes dot-flashing { - 0% { - opacity: 0.65; - } - 50%, - 100% { - opacity: 0.1; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-chatbot/readme.md b/packages/amplify-ui-components/src/components/amplify-chatbot/readme.md deleted file mode 100644 index b35360e0933..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-chatbot/readme.md +++ /dev/null @@ -1,74 +0,0 @@ -# amplify-chatbot - - - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| -------------------- | ---------------------- | ------------------------------------------------------------------------- | --------- | ---------------------------- | -| `botName` | `bot-name` | Name of the bot | `string` | `undefined` | -| `botTitle` | `bot-title` | Text placed in the top header | `string` | `Translations.CHATBOT_TITLE` | -| `clearOnComplete` | `clear-on-complete` | Clear messages when conversation finishes | `boolean` | `false` | -| `conversationModeOn` | `conversation-mode-on` | Continue listening to users after they send the message | `boolean` | `false` | -| `silenceThreshold` | `silence-threshold` | Noise threshold between -1 and 1. Anything below is considered a silence. | `number` | `0.2` | -| `silenceTime` | `silence-time` | Amount of silence (in ms) to wait for | `number` | `1500` | -| `textEnabled` | `text-enabled` | Whether text chat is enabled | `boolean` | `true` | -| `voiceEnabled` | `voice-enabled` | Whether voice chat is enabled | `boolean` | `false` | -| `welcomeMessage` | `welcome-message` | Greeting message displayed to users | `string` | `undefined` | - - -## Events - -| Event | Description | Type | -| --------------- | -------------------------------------------- | ------------------------- | -| `chatCompleted` | Event emitted when conversation is completed | `CustomEvent` | - - -## Slots - -| Slot | Description | -| ---------- | ------------------------------- | -| `"header"` | Title content placed at the top | - - -## CSS Custom Properties - -| Name | Description | -| ------------------------- | -------------------------------------------- | -| `--bot-background-color` | Background color of bot messages | -| `--bot-dot-color` | Base color of bot loading message animation | -| `--bot-text-color` | Text color of bot messages | -| `--header-color` | Text color within the header | -| `--header-size` | Text size within the header | -| `--height` | Height of the container | -| `--user-background-color` | Background color of user messages | -| `--user-dot-color` | Base color of user loading message animation | -| `--user-text-color` | Text color of user messages | -| `--width` | Width of the container | - - -## Dependencies - -### Depends on - -- [amplify-button](../amplify-button) -- [amplify-input](../amplify-input) -- [amplify-toast](../amplify-toast) - -### Graph -```mermaid -graph TD; - amplify-chatbot --> amplify-button - amplify-chatbot --> amplify-input - amplify-chatbot --> amplify-toast - amplify-button --> amplify-icon - amplify-toast --> amplify-icon - style amplify-chatbot fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-checkbox/__snapshots__/amplify-checkbox.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-checkbox/__snapshots__/amplify-checkbox.spec.ts.snap deleted file mode 100644 index 86c34e77465..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-checkbox/__snapshots__/amplify-checkbox.spec.ts.snap +++ /dev/null @@ -1,36 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-checkbox spec: Render logic -> should render a checkbox with an input type of checkbox and empty label by default 1`] = ` - - - - - - - - -`; - -exports[`amplify-checkbox spec: Render logic -> should render a checkbox with an input type of checkbox and label 1`] = ` - - - - - - Seattle - - - - -`; - -exports[`amplify-checkbox spec: Render logic -> should render with only a class of \`amplify-ui--checkbox\` 1`] = ` - - - - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.e2e.ts b/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.e2e.ts deleted file mode 100644 index ec762c6af1f..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.e2e.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-checkbox e2e:', () => { - it('should render amplify-checkbox with no label', async () => { - const page = await newE2EPage(); - await page.setContent(``); - const el = await page.find('amplify-checkbox'); - expect(el).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-checkbox', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); - - it('should render amplify-checkbox with label', async () => { - const page = await newE2EPage(); - await page.setContent( - `` - ); - const el = await page.find('amplify-checkbox'); - expect(el).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-checkbox-label', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); - - it('should have a checkbox checked', async () => { - const page = await newE2EPage(); - await page.setContent( - `` - ); - - const checkboxEl = await page.find('amplify-checkbox'); - expect(checkboxEl).not.toBeNull(); - - checkboxEl.setProperty('checked', true); - - await page.waitForChanges(); - - const checked = await checkboxEl.getProperty('checked'); - - expect(checked).toBe(true); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.scss b/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.scss deleted file mode 100644 index dc042c9de66..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.scss +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @prop --font-family: Text font family - */ -:host { - --font-family: var(--amplify-font-family); -} - -.checkbox { - margin-bottom: 22px; - display: block; - width: 100%; - padding: 16px; - font-size: var(--amplify-text-sm); - font-family: var(--font-family); - - input { - margin-right: 12px; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.spec.ts b/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.spec.ts deleted file mode 100644 index f16aba1249e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.spec.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyCheckbox } from './amplify-checkbox'; - -describe('amplify-checkbox spec:', () => { - describe('Component logic ->', () => { - let checkbox; - - beforeEach(() => { - checkbox = new AmplifyCheckbox(); - }); - - it('should have checked prop set to false by default', () => { - expect(checkbox.checked).toBe(false); - }); - - it('should have disabled prop set to false by default', () => { - expect(checkbox.disabled).toBe(false); - }); - }); - describe('Render logic ->', () => { - it('should render a checkbox with an input type of checkbox and empty label by default', async () => { - const page = await newSpecPage({ - components: [AmplifyCheckbox], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render with only a class of `amplify-ui--checkbox`', async () => { - const page = await newSpecPage({ - components: [AmplifyCheckbox], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render a checkbox with an input type of checkbox and label', async () => { - const page = await newSpecPage({ - components: [AmplifyCheckbox], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.stories.tsx b/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.stories.tsx deleted file mode 100644 index 3525e8a3c4c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.stories.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { storiesOf } from '@storybook/html'; -import { knobs } from '../../common/testing'; - -const checkboxStories = storiesOf('amplify-checkbox', module); - -checkboxStories.add('with label', () => { - const label = knobs.labelKnob('Boise'); - - return ``; -}); - -checkboxStories.add('toggle check box', () => { - const label = knobs.labelKnob('Boise'); - const toggle = knobs.toggleKnob(false); - - return ``; -}); - -checkboxStories.add('disabled', () => { - const label = knobs.labelKnob('Portland'); - const disabled = knobs.disabledKnob(true); - - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.tsx b/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.tsx deleted file mode 100644 index 6db33fbd336..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-checkbox/amplify-checkbox.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { Component, Prop, h } from '@stencil/core'; - -@Component({ - tag: 'amplify-checkbox', - styleUrl: 'amplify-checkbox.scss', - shadow: true, -}) -export class AmplifyCheckbox { - /** Name of the checkbox */ - @Prop() name?: string; - /** Value of the checkbox */ - @Prop() value?: string; - /** Field ID used for the 'htmlFor' in the label */ - @Prop() fieldId: string; - /** Label for the checkbox */ - @Prop() label: string; - /** If `true`, the checkbox is selected. */ - @Prop() checked: boolean = false; - /** If `true`, the checkbox is disabled */ - @Prop() disabled: boolean = false; - - private onClick = () => { - this.checked = !this.checked; - }; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - - {this.label} - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-checkbox/readme.md b/packages/amplify-ui-components/src/components/amplify-checkbox/readme.md deleted file mode 100644 index 44f8a7b49af..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-checkbox/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# amplify-checkbox - - - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ---------- | ---------- | -------------------------------------------- | --------- | ----------- | -| `checked` | `checked` | If `true`, the checkbox is selected. | `boolean` | `false` | -| `disabled` | `disabled` | If `true`, the checkbox is disabled | `boolean` | `false` | -| `fieldId` | `field-id` | Field ID used for the 'htmlFor' in the label | `string` | `undefined` | -| `label` | `label` | Label for the checkbox | `string` | `undefined` | -| `name` | `name` | Name of the checkbox | `string` | `undefined` | -| `value` | `value` | Value of the checkbox | `string` | `undefined` | - - -## CSS Custom Properties - -| Name | Description | -| --------------- | ---------------- | -| `--font-family` | Text font family | - - -## Dependencies - -### Depends on - -- [amplify-label](../amplify-label) - -### Graph -```mermaid -graph TD; - amplify-checkbox --> amplify-label - style amplify-checkbox fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-code-field/__snapshots__/amplify-code-field.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-code-field/__snapshots__/amplify-code-field.spec.ts.snap deleted file mode 100644 index 4dfac1b0bda..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-code-field/__snapshots__/amplify-code-field.spec.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-code-field spec: Render logic -> should render \`placeholder\` and \`label values 1`] = ` - - - -`; - -exports[`amplify-code-field spec: Render logic -> should render default values by default 1`] = ` - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-code-field/amplify-code-field.e2e.ts b/packages/amplify-ui-components/src/components/amplify-code-field/amplify-code-field.e2e.ts deleted file mode 100644 index 581681a2eb8..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-code-field/amplify-code-field.e2e.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-code-field e2e:', () => { - it('should render a amplify-code-field', async () => { - const page = await newE2EPage(); - await page.setContent(``); - const el = await page.find('amplify-code-field'); - expect(el).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-code-field', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-code-field/amplify-code-field.spec.ts b/packages/amplify-ui-components/src/components/amplify-code-field/amplify-code-field.spec.ts deleted file mode 100644 index 2a13367fb38..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-code-field/amplify-code-field.spec.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyCodeField } from './amplify-code-field'; - -describe('amplify-code-field spec:', () => { - describe('Component logic ->', () => { - let codeField; - - beforeEach(() => { - codeField = new AmplifyCodeField(); - }); - - it('should render `code` for the field id', () => { - expect(codeField.fieldId).toEqual('code'); - }); - - it('should have `label` render to `Verification code` by default', () => { - expect(codeField.label).toEqual('Verification code'); - }); - - it('should have `placeholder` render to `Enter code` by default', () => { - expect(codeField.placeholder).toEqual('Enter code'); - }); - - it('should have `required` set to `false` by default', () => { - expect(codeField.required).toBe(false); - }); - }); - describe('Render logic ->', () => { - it('should render `placeholder` and `label values', async () => { - const page = await newSpecPage({ - components: [AmplifyCodeField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render default values by default', async () => { - const page = await newSpecPage({ - components: [AmplifyCodeField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-code-field/amplify-code-field.tsx b/packages/amplify-ui-components/src/components/amplify-code-field/amplify-code-field.tsx deleted file mode 100644 index 90ba4a62b6d..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-code-field/amplify-code-field.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { Component, Prop, FunctionalComponent, h } from '@stencil/core'; -import { CODE_SUFFIX } from '../../common/constants'; -import { Translations } from '../../common/Translations'; - -@Component({ - tag: 'amplify-code-field', -}) -export class AmplifyCodeField { - /** Based on the type of field e.g. sign in, sign up, forgot password, etc. */ - @Prop() fieldId: string = CODE_SUFFIX; - /** Used for the code label */ - @Prop() label: string = Translations.CODE_LABEL; - /** Used for the placeholder label */ - @Prop() placeholder: string = Translations.CODE_PLACEHOLDER; - /** Used as the hint in case you forgot your confirmation code, etc. */ - @Prop() hint: string | FunctionalComponent | null; - /** The required flag in order to make an input required prior to submitting a form */ - @Prop() required: boolean = false; - /** The callback, called when the input is modified by the user. */ - @Prop() handleInputChange?: (inputEvent: Event) => void; - /** The value of the content inside of the input field */ - @Prop() value?: string; - /** Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes */ - @Prop() inputProps?: object; - /** Will disable the input if set to true */ - @Prop() disabled?: boolean; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-code-field/readme.md b/packages/amplify-ui-components/src/components/amplify-code-field/readme.md deleted file mode 100644 index 155749b3e53..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-code-field/readme.md +++ /dev/null @@ -1,44 +0,0 @@ -# amplify-code-field - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------- | ------------------------------- | -| `disabled` | `disabled` | Will disable the input if set to true | `boolean` | `undefined` | -| `fieldId` | `field-id` | Based on the type of field e.g. sign in, sign up, forgot password, etc. | `string` | `CODE_SUFFIX` | -| `handleInputChange` | -- | The callback, called when the input is modified by the user. | `(inputEvent: Event) => void` | `undefined` | -| `hint` | `hint` | Used as the hint in case you forgot your confirmation code, etc. | `FunctionalComponent<{}> \| string` | `undefined` | -| `inputProps` | -- | Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes | `object` | `undefined` | -| `label` | `label` | Used for the code label | `string` | `Translations.CODE_LABEL` | -| `placeholder` | `placeholder` | Used for the placeholder label | `string` | `Translations.CODE_PLACEHOLDER` | -| `required` | `required` | The required flag in order to make an input required prior to submitting a form | `boolean` | `false` | -| `value` | `value` | The value of the content inside of the input field | `string` | `undefined` | - - -## Dependencies - -### Used by - - - [amplify-auth-fields](../amplify-auth-fields) - -### Depends on - -- [amplify-form-field](../amplify-form-field) - -### Graph -```mermaid -graph TD; - amplify-code-field --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-auth-fields --> amplify-code-field - style amplify-code-field fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/__snapshots__/amplify-confirm-sign-in.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/__snapshots__/amplify-confirm-sign-in.spec.ts.snap deleted file mode 100644 index 72ba0785aad..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/__snapshots__/amplify-confirm-sign-in.spec.ts.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-confirm-sign-in spec: Render logic -> should render a \`confirm sign in\` form by default 1`] = ` - - - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/amplify-confirm-sign-in.spec.ts b/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/amplify-confirm-sign-in.spec.ts deleted file mode 100644 index af760635ed4..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/amplify-confirm-sign-in.spec.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyConfirmSignIn } from './amplify-confirm-sign-in'; -import { Translations } from '../../common/Translations'; - -describe('amplify-confirm-sign-in spec:', () => { - describe('Component logic ->', () => { - let confirmSignIn; - - beforeEach(() => { - confirmSignIn = new AmplifyConfirmSignIn(); - }); - - it('should render `handleSubmit` as defined by default', () => { - expect(confirmSignIn.handleSubmit).toBeDefined(); - }); - - it('should render `validationErrors` as undefined by default', () => { - expect(confirmSignIn.validationErrors).toBeUndefined(); - }); - - it('should render `headerText` to `Confirm SMS Code` by default', () => { - expect(confirmSignIn.headerText).toEqual(Translations.CONFIRM_SMS_CODE); - }); - - it('should render `submitButtonText` to `Confirm` by default', () => { - expect(confirmSignIn.submitButtonText).toEqual(Translations.CONFIRM); - }); - - it('should have default formFields by default', () => { - expect(confirmSignIn.formFields).toHaveLength(1); - expect(confirmSignIn.formFields[0].type).toBe('code'); - expect(confirmSignIn.formFields[0].required).toBe(true); - expect(confirmSignIn.formFields[0].handleInputChange).toBeDefined(); - expect(typeof confirmSignIn.formFields[0].handleInputChange).toBe('function'); - }); - - it('setup should have been called on componentWillLoad', () => { - jest.spyOn(confirmSignIn, 'setup'); - confirmSignIn.componentWillLoad(); - expect(confirmSignIn.setup).toHaveBeenCalledWith(); - }); - - it('constructFormFieldOptions should have been called during setup', () => { - jest.spyOn(confirmSignIn, 'constructFormFieldOptions'); - expect(confirmSignIn.constructedFormFieldOptions).toBeUndefined(); - confirmSignIn.setup(); - expect(confirmSignIn.constructFormFieldOptions) - .toHaveBeenCalledWith(confirmSignIn.formFields); - expect(confirmSignIn.constructedFormFieldOptions).toBeDefined(); - }); - - it('constructFormFieldOptions should work as expected', () => { - expect(confirmSignIn.constructFormFieldOptions()).toBeUndefined(); - expect(confirmSignIn.constructFormFieldOptions([])) - .toEqual(confirmSignIn.defaultFormFields); - expect(confirmSignIn.constructFormFieldOptions(['foo', 'bar'])) - .toEqual(['foo', 'bar']); - - let retVal = confirmSignIn.constructFormFieldOptions([{ - type: 'text', - }]); - expect(retVal).toHaveLength(1); - expect(retVal[0].type).toBe('text'); - expect(retVal[0].handleInputChange).not.toBeDefined(); - - retVal = confirmSignIn.constructFormFieldOptions([{ - type: 'code', - }]); - expect(retVal).toHaveLength(1); - expect(retVal[0].type).toBe('code'); - expect(retVal[0].handleInputChange).toBeDefined(); - expect(typeof retVal[0].handleInputChange).toBe('function'); - - const formFields = [{ - type: 'code', - handleInputChange: () => {}, - }]; - retVal = confirmSignIn.constructFormFieldOptions(formFields); - expect(retVal).toHaveLength(1); - expect(retVal[0].type).toBe('code'); - expect(retVal[0].handleInputChange).toBeDefined(); - expect(typeof retVal[0].handleInputChange).toBe('function'); - expect(retVal[0].handleInputChange).toBe(formFields[0].handleInputChange); - }); - }); - describe('Render logic ->', () => { - it('should render a `confirm sign in` form by default', async () => { - const page = await newSpecPage({ - components: [AmplifyConfirmSignIn], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/amplify-confirm-sign-in.stories.tsx b/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/amplify-confirm-sign-in.stories.tsx deleted file mode 100644 index 4e3f191ad14..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/amplify-confirm-sign-in.stories.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { storiesOf } from '@storybook/html'; - -const confirmSignInStories = storiesOf('amplify-confirm-sign-in', module); - -confirmSignInStories.add('default', () => { - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/amplify-confirm-sign-in.tsx b/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/amplify-confirm-sign-in.tsx deleted file mode 100644 index 2bf96b41f97..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/amplify-confirm-sign-in.tsx +++ /dev/null @@ -1,176 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { I18n } from '@aws-amplify/core'; -import { Component, Prop, State, h, Host, Watch } from '@stencil/core'; -import { - FormFieldType, - FormFieldTypes, -} from '../../components/amplify-auth-fields/amplify-auth-fields-interface'; -import { - AuthState, - MfaOption, - CognitoUserInterface, - ChallengeName, - AuthStateHandler, -} from '../../common/types/auth-types'; -import { NO_AUTH_MODULE_FOUND } from '../../common/constants'; -import { - dispatchToastHubEvent, - dispatchAuthStateChangeEvent, -} from '../../common/helpers'; -import { Translations } from '../../common/Translations'; -import { checkContact } from '../../common/auth-helpers'; - -@Component({ - tag: 'amplify-confirm-sign-in', - shadow: true, -}) -export class AmplifyConfirmSignIn { - /** Fires when confirm sign in form is submitted */ - @Prop() handleSubmit: (event: Event) => void = event => this.confirm(event); - /** Used for header text in confirm sign in component */ - @Prop() headerText: string = Translations.CONFIRM_SMS_CODE; - /** Used for the submit button text in confirm sign in component */ - @Prop() submitButtonText: string = Translations.CONFIRM; - /** Auth state change handler for this component */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - /** Default form field */ - private defaultFormFields: FormFieldTypes = [ - { - type: 'code', - required: true, - handleInputChange: event => this.handleCodeChange(event), - }, - ]; - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. - * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing - * text for a label or adjust a placeholder, you can follow the structure below in order to do just that. - * ``` - * [ - * { - * type: string, - * label: string, - * placeholder: string, - * hint: string | Functional Component | null, - * required: boolean - * } - * ] - * ``` - */ - @Prop() formFields: FormFieldTypes | string[] = this.defaultFormFields; - /** Cognito user signing in */ - @Prop() user: CognitoUserInterface; - /** The MFA option to confirm with */ - @State() mfaOption: MfaOption = MfaOption.SMS; - /* Whether or not the confirm-sign-in component is loading */ - @State() loading: boolean = false; - /* The code value in the confirm-sign-in form */ - @State() code: string; - /* The constructed form field options */ - private constructedFormFieldOptions: FormFieldTypes | string[]; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - this.setup(); - } - - @Watch('user') - userHandler() { - this.setup(); - } - - private setup() { - if ( - this.user && - this.user['challengeName'] === ChallengeName.SoftwareTokenMFA - ) { - this.mfaOption = MfaOption.TOTP; - // If header text is using default use TOTP string - if (this.headerText === Translations.CONFIRM_SMS_CODE) { - this.headerText = Translations.CONFIRM_TOTP_CODE; - } - } - this.constructedFormFieldOptions = this.constructFormFieldOptions( - this.formFields - ); - } - - private handleCodeChange(event) { - this.code = event.target.value; - } - - private async confirm(event: Event) { - if (event) { - event.preventDefault(); - } - const mfaType = - this.user['challengeName'] === ChallengeName.SoftwareTokenMFA - ? ChallengeName.SoftwareTokenMFA - : null; - if (!Auth || typeof Auth.confirmSignIn !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - this.loading = true; - try { - await Auth.confirmSignIn(this.user, this.code, mfaType); - await checkContact(this.user, this.handleAuthStateChange); - } catch (error) { - dispatchToastHubEvent(error); - } finally { - this.loading = false; - } - } - - private constructFormFieldOptions( - formFields: FormFieldTypes | string[] - ): FormFieldTypes | string[] { - const content = []; - - if (formFields === undefined) return undefined; - if (formFields.length <= 0) return this.defaultFormFields; - - formFields.forEach((formField: FormFieldType | string) => { - if (typeof formField === 'string' || formField.type !== 'code') { - // This is either a `string`, and/or a custom field that isn't `code`. Pass this directly. - content.push(formField); - } else { - // This is a code input field. Attach input handler. - content.push({ - handleInputChange: event => this.handleCodeChange(event), - ...(formField as FormFieldType), // `inputProps` will be passed over here. - }); - } - }); - - return content; - } - - render() { - return ( - - - this.handleAuthStateChange(AuthState.SignIn)} - > - {I18n.get(Translations.BACK_TO_SIGN_IN)} - - - } - > - - - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/readme.md b/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/readme.md deleted file mode 100644 index 6dc7c9bfbe8..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-confirm-sign-in/readme.md +++ /dev/null @@ -1,64 +0,0 @@ -# amplify-sign-in - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ------------------------------- | -| `formFields` | -- | Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string \| Functional Component \| null, required: boolean } ] ``` | `FormFieldTypes \| string[]` | `this.defaultFormFields` | -| `handleAuthStateChange` | -- | Auth state change handler for this component | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | -| `handleSubmit` | -- | Fires when confirm sign in form is submitted | `(event: Event) => void` | `event => this.confirm(event)` | -| `headerText` | `header-text` | Used for header text in confirm sign in component | `string` | `Translations.CONFIRM_SMS_CODE` | -| `submitButtonText` | `submit-button-text` | Used for the submit button text in confirm sign in component | `string` | `Translations.CONFIRM` | -| `user` | -- | Cognito user signing in | `CognitoUserInterface` | `undefined` | - - -## Dependencies - -### Used by - - - [amplify-authenticator](../amplify-authenticator) - -### Depends on - -- [amplify-form-section](../amplify-form-section) -- [amplify-button](../amplify-button) -- [amplify-auth-fields](../amplify-auth-fields) - -### Graph -```mermaid -graph TD; - amplify-confirm-sign-in --> amplify-form-section - amplify-confirm-sign-in --> amplify-button - amplify-confirm-sign-in --> amplify-auth-fields - amplify-form-section --> amplify-section - amplify-form-section --> amplify-button - amplify-form-section --> amplify-loading-spinner - amplify-button --> amplify-icon - amplify-loading-spinner --> amplify-icon - amplify-auth-fields --> amplify-username-field - amplify-auth-fields --> amplify-password-field - amplify-auth-fields --> amplify-email-field - amplify-auth-fields --> amplify-code-field - amplify-auth-fields --> amplify-phone-field - amplify-auth-fields --> amplify-form-field - amplify-username-field --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-password-field --> amplify-form-field - amplify-email-field --> amplify-form-field - amplify-code-field --> amplify-form-field - amplify-phone-field --> amplify-form-field - amplify-phone-field --> amplify-country-dial-code - amplify-phone-field --> amplify-input - amplify-country-dial-code --> amplify-select - amplify-authenticator --> amplify-confirm-sign-in - style amplify-confirm-sign-in fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/__snapshots__/amplify-confirm-sign-up.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/__snapshots__/amplify-confirm-sign-up.spec.ts.snap deleted file mode 100644 index 11759cc6608..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/__snapshots__/amplify-confirm-sign-up.spec.ts.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-confirm-sign-up spec: Render logic -> should render a \`confirm sign up\` form by default 1`] = ` - - - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/amplify-confirm-sign-up.spec.ts b/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/amplify-confirm-sign-up.spec.ts deleted file mode 100644 index b0460919825..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/amplify-confirm-sign-up.spec.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyConfirmSignUp } from './amplify-confirm-sign-up'; -import { Translations } from '../../common/Translations'; - -describe('amplify-confirm-sign-up spec:', () => { - describe('Component logic ->', () => { - let confirmSignUp; - - beforeEach(() => { - confirmSignUp = new AmplifyConfirmSignUp(); - }); - - it('should render `handleSubmit` as defined by default', () => { - expect(confirmSignUp.handleSubmit).toBeDefined(); - }); - - it('should render `validationErrors` as undefined by default', () => { - expect(confirmSignUp.validationErrors).toBeUndefined(); - }); - - it('should render `headerText` to `Confirm Sign up` by default', () => { - expect(confirmSignUp.headerText).toEqual( - Translations.CONFIRM_SIGN_UP_HEADER_TEXT - ); - }); - - it('should render `submitButtonText` to `Confirm` by default', () => { - expect(confirmSignUp.submitButtonText).toEqual( - Translations.CONFIRM_SIGN_UP_SUBMIT_BUTTON_TEXT - ); - }); - - it('should render `usernameAlias` as `username` by default', () => { - expect(confirmSignUp.usernameAlias).toEqual('username'); - }); - }); - describe('Render logic ->', () => { - it('should render a `confirm sign up` form by default', async () => { - const page = await newSpecPage({ - components: [AmplifyConfirmSignUp], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/amplify-confirm-sign-up.stories.tsx b/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/amplify-confirm-sign-up.stories.tsx deleted file mode 100644 index e6643a780d1..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/amplify-confirm-sign-up.stories.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { storiesOf } from '@storybook/html'; - -const confirmSignUpStories = storiesOf('amplify-confirm-sign-up', module); - -confirmSignUpStories.add('default', () => { - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/amplify-confirm-sign-up.tsx b/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/amplify-confirm-sign-up.tsx deleted file mode 100644 index 2eb36ca8476..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/amplify-confirm-sign-up.tsx +++ /dev/null @@ -1,316 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { Component, Prop, h, State, Watch, Host } from '@stencil/core'; -import { - FormFieldTypes, - FormFieldType, - PhoneNumberInterface, - PhoneFormFieldType, -} from '../amplify-auth-fields/amplify-auth-fields-interface'; -import { - NO_AUTH_MODULE_FOUND, - COUNTRY_DIAL_CODE_DEFAULT, -} from '../../common/constants'; -import { Translations } from '../../common/Translations'; -import { - AuthState, - CognitoUserInterface, - AuthStateHandler, - UsernameAliasStrings, - SignUpAttributes, -} from '../../common/types/auth-types'; - -import { Auth } from '@aws-amplify/auth'; -import { - dispatchToastHubEvent, - dispatchAuthStateChangeEvent, - checkUsernameAlias, - isHintValid, - composePhoneNumberInput, - handlePhoneNumberChange, -} from '../../common/helpers'; -import { handleSignIn } from '../../common/auth-helpers'; - -@Component({ - tag: 'amplify-confirm-sign-up', - shadow: true, -}) -export class AmplifyConfirmSignUp { - /** Fires when sign up form is submitted */ - @Prop() handleSubmit: (submitEvent: Event) => void = event => - this.confirmSignUp(event); - /** Used for header text in confirm sign up component */ - @Prop() headerText: string = Translations.CONFIRM_SIGN_UP_HEADER_TEXT; - /** Used for the submit button text in confirm sign up component */ - @Prop() submitButtonText: string = - Translations.CONFIRM_SIGN_UP_SUBMIT_BUTTON_TEXT; - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. - * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing - * text for a label or adjust a placeholder, you can follow the structure below in order to do just that. - * ``` - * [ - * { - * type: string, - * label: string, - * placeholder: string, - * hint: string | Functional Component | null, - * required: boolean - * } - * ] - * ``` - */ - @Prop() formFields: FormFieldTypes | string[] = []; - /** Auth state change handler for this components - * e.g. SignIn -> 'Create Account' link -> SignUp - */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - /** Used for the username to be passed to resend code */ - @Prop() user: CognitoUserInterface; - /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */ - @Prop() usernameAlias: UsernameAliasStrings = 'username'; - - @State() code: string; - @State() loading: boolean = false; - @State() userInput: string; - - private _signUpAttrs: SignUpAttributes; - private newFormFields: FormFieldTypes | string[] = []; - private phoneNumber: PhoneNumberInterface = { - countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT, - phoneNumberValue: null, - }; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - this.setup(); - } - - @Watch('formFields') - formFieldsHandler() { - this.buildFormFields(); - } - - @Watch('user') - userHandler() { - this.setup(); - } - - private setup() { - // TODO: Use optional chaining instead - this.userInput = this.user && this.user.username; - this._signUpAttrs = this.user && this.user.signUpAttrs; - checkUsernameAlias(this.usernameAlias); - this.buildFormFields(); - } - - private buildDefaultFormFields() { - this.newFormFields = [ - { - type: `${this.usernameAlias}`, - required: true, - handleInputChange: this.handleFormFieldInputChange( - `${this.usernameAlias}` - ), - value: this.userInput, - disabled: this.userInput ? true : false, - inputProps: { autocomplete: 'username' }, - }, - { - type: 'code', - label: I18n.get(Translations.CONFIRM_SIGN_UP_CODE_LABEL), - placeholder: I18n.get(Translations.CONFIRM_SIGN_UP_CODE_PLACEHOLDER), - required: true, - hint: ( -
- {I18n.get(Translations.CONFIRM_SIGN_UP_LOST_CODE)}{' '} - this.resendConfirmCode()} - > - {I18n.get(Translations.CONFIRM_SIGN_UP_RESEND_CODE)} - -
- ), - handleInputChange: this.handleFormFieldInputChange('code'), - }, - ]; - } - - private buildFormFields() { - if (this.formFields.length === 0) { - this.buildDefaultFormFields(); - } else { - const newFields = []; - this.formFields.forEach(field => { - const newField = { ...field }; - if (newField.type === 'code') { - newField['hint'] = isHintValid(newField) ? ( -
- {I18n.get(Translations.CONFIRM_SIGN_UP_LOST_CODE)}{' '} - this.resendConfirmCode()} - > - {I18n.get(Translations.CONFIRM_SIGN_UP_RESEND_CODE)} - -
- ) : ( - newField['hint'] - ); - } - newField['handleInputChange'] = event => - this.handleFormFieldInputWithCallback(event, field); - newFields.push(newField); - }); - this.newFormFields = newFields; - } - } - - private handleFormFieldInputChange(fieldType) { - switch (fieldType) { - case 'username': - case 'email': - return event => (this.userInput = event.target.value); - case 'phone_number': - return event => handlePhoneNumberChange(event, this.phoneNumber); - case 'code': - return event => (this.code = event.target.value); - default: - return; - } - } - - setFieldValue(field: PhoneFormFieldType | FormFieldType) { - switch (field.type) { - case 'username': - case 'email': - if (field.value === undefined) { - this.userInput = ''; - } else { - this.userInput = field.value; - } - break; - case 'phone_number': - if ((field as PhoneFormFieldType).dialCode) { - this.phoneNumber.countryDialCodeValue = (field as PhoneFormFieldType).dialCode; - } - this.phoneNumber.phoneNumberValue = field.value; - break; - } - } - - private handleFormFieldInputWithCallback(event, field) { - const fnToCall = field['handleInputChange'] - ? field['handleInputChange'] - : (event, cb) => { - cb(event); - }; - const callback = this.handleFormFieldInputChange(field.type); - fnToCall(event, callback.bind(this)); - } - - /** - * Returns the username of the user to confirm. If a valid `user.username` has been passed as a prop, we return that. - * Otherwise, we return the `userInput` on the form. - */ - private getUsername(): string { - if (this.user && this.user.username) return this.user.username; - switch (this.usernameAlias) { - case 'username': - case 'email': - return this.userInput; - case 'phone_number': - return composePhoneNumberInput(this.phoneNumber); - } - } - - private async resendConfirmCode() { - if (event) { - event.preventDefault(); - } - if (!Auth || typeof Auth.resendSignUp !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - try { - const username = this.getUsername(); - if (!username) throw new Error(Translations.EMPTY_USERNAME); - await Auth.resendSignUp(username.trim()); - } catch (error) { - dispatchToastHubEvent(error); - } - } - - // TODO: Add validation - // TODO: Prefix - private async confirmSignUp(event: Event) { - if (event) { - event.preventDefault(); - } - if (!Auth || typeof Auth.confirmSignUp !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - this.loading = true; - - try { - let username = this.getUsername(); - if (!username) throw new Error(Translations.EMPTY_USERNAME); - username = username.trim(); - - const confirmSignUpResult = await Auth.confirmSignUp(username, this.code); - - if (!confirmSignUpResult) { - throw new Error(I18n.get(Translations.CONFIRM_SIGN_UP_FAILED)); - } - if ( - this._signUpAttrs && - this._signUpAttrs.password && - this._signUpAttrs.password !== '' - ) { - // Auto sign in user if password is available from previous workflow - await handleSignIn( - username, - this._signUpAttrs.password, - this.handleAuthStateChange - ); - } else { - this.handleAuthStateChange(AuthState.SignIn); - } - } catch (error) { - dispatchToastHubEvent(error); - } finally { - this.loading = false; - } - } - - render() { - return ( - - - - this.handleAuthStateChange(AuthState.SignIn)} - > - {I18n.get(Translations.BACK_TO_SIGN_IN)} - - - - } - > - - - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/readme.md b/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/readme.md deleted file mode 100644 index 557ca73616a..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-confirm-sign-up/readme.md +++ /dev/null @@ -1,65 +0,0 @@ -# amplify-sign-up - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ------------------------------------------------- | -| `formFields` | -- | Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string \| Functional Component \| null, required: boolean } ] ``` | `FormFieldTypes \| string[]` | `[]` | -| `handleAuthStateChange` | -- | Auth state change handler for this components e.g. SignIn -> 'Create Account' link -> SignUp | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | -| `handleSubmit` | -- | Fires when sign up form is submitted | `(submitEvent: Event) => void` | `event => this.confirmSignUp(event)` | -| `headerText` | `header-text` | Used for header text in confirm sign up component | `string` | `Translations.CONFIRM_SIGN_UP_HEADER_TEXT` | -| `submitButtonText` | `submit-button-text` | Used for the submit button text in confirm sign up component | `string` | `Translations.CONFIRM_SIGN_UP_SUBMIT_BUTTON_TEXT` | -| `user` | -- | Used for the username to be passed to resend code | `CognitoUserInterface` | `undefined` | -| `usernameAlias` | `username-alias` | Username Alias is used to setup authentication with `username`, `email` or `phone_number` | `"email" \| "phone_number" \| "username"` | `'username'` | - - -## Dependencies - -### Used by - - - [amplify-authenticator](../amplify-authenticator) - -### Depends on - -- [amplify-button](../amplify-button) -- [amplify-form-section](../amplify-form-section) -- [amplify-auth-fields](../amplify-auth-fields) - -### Graph -```mermaid -graph TD; - amplify-confirm-sign-up --> amplify-button - amplify-confirm-sign-up --> amplify-form-section - amplify-confirm-sign-up --> amplify-auth-fields - amplify-button --> amplify-icon - amplify-form-section --> amplify-section - amplify-form-section --> amplify-button - amplify-form-section --> amplify-loading-spinner - amplify-loading-spinner --> amplify-icon - amplify-auth-fields --> amplify-username-field - amplify-auth-fields --> amplify-password-field - amplify-auth-fields --> amplify-email-field - amplify-auth-fields --> amplify-code-field - amplify-auth-fields --> amplify-phone-field - amplify-auth-fields --> amplify-form-field - amplify-username-field --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-password-field --> amplify-form-field - amplify-email-field --> amplify-form-field - amplify-code-field --> amplify-form-field - amplify-phone-field --> amplify-form-field - amplify-phone-field --> amplify-country-dial-code - amplify-phone-field --> amplify-input - amplify-country-dial-code --> amplify-select - amplify-authenticator --> amplify-confirm-sign-up - style amplify-confirm-sign-up fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-container/__snapshots__/amplify-container.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-container/__snapshots__/amplify-container.spec.ts.snap deleted file mode 100644 index 6e28796d378..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-container/__snapshots__/amplify-container.spec.ts.snap +++ /dev/null @@ -1,16 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-container spec: Render logic -> should render with an empty slot 1`] = ` - - - -`; - -exports[`amplify-container spec: Render logic -> should render with contained content when content is passed in 1`] = ` - - -
- My App -
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-container/amplify-container.scss b/packages/amplify-ui-components/src/components/amplify-container/amplify-container.scss deleted file mode 100644 index a523e60c4e1..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-container/amplify-container.scss +++ /dev/null @@ -1,6 +0,0 @@ -amplify-container { - display: flex; - align-items: center; - justify-content: center; - height: 100vh; -} diff --git a/packages/amplify-ui-components/src/components/amplify-container/amplify-container.spec.ts b/packages/amplify-ui-components/src/components/amplify-container/amplify-container.spec.ts deleted file mode 100644 index dbf146d9196..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-container/amplify-container.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyContainer } from './amplify-container'; - -describe('amplify-container spec:', () => { - describe('Render logic ->', () => { - it('should render with an empty slot', async () => { - const page = await newSpecPage({ - components: [AmplifyContainer], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render with contained content when content is passed in', async () => { - const page = await newSpecPage({ - components: [AmplifyContainer], - html: `
My App
`, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-container/amplify-container.tsx b/packages/amplify-ui-components/src/components/amplify-container/amplify-container.tsx deleted file mode 100644 index a5011bd4bc2..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-container/amplify-container.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Component, h, Host } from '@stencil/core'; - -/** - * @slot (default) - Content placed within the container - */ -@Component({ - tag: 'amplify-container', - styleUrl: 'amplify-container.scss', -}) -export class AmplifyContainer { - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-container/readme.md b/packages/amplify-ui-components/src/components/amplify-container/readme.md deleted file mode 100644 index 585f60f9611..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-container/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# amplify-container - - - - - - -## Slots - -| Slot | Description | -| ------------- | ----------------------------------- | -| `"(default)"` | Content placed within the container | - - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-country-dial-code/__snapshots__/amplify-country-dial-code.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-country-dial-code/__snapshots__/amplify-country-dial-code.spec.ts.snap deleted file mode 100644 index dacd1d61dcc..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-country-dial-code/__snapshots__/amplify-country-dial-code.spec.ts.snap +++ /dev/null @@ -1,9 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-country-dial-code spec: Render logic -> shoulder render a \`amplif-select\` component with country dial codes as default 1`] = ` - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code-interface.ts b/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code-interface.ts deleted file mode 100644 index 4d7ca7be7c9..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code-interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -interface CountryCodeDialOption { - label: string; - value: string; -} - -export interface CountryCodeDialOptions extends Array {} diff --git a/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code.e2e.ts b/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code.e2e.ts deleted file mode 100644 index de582b472e6..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code.e2e.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-country-dial-code e2e:', () => { - it('should render a amplify-country-dial-code', async () => { - const page = await newE2EPage(); - await page.setContent( - `` - ); - const el = await page.find('amplify-country-dial-code'); - expect(el).not.toBeNull(); - - const screenshot = await page.compareScreenshot( - 'amplify-country-dial-code', - { fullPage: true } - ); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code.spec.ts b/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code.spec.ts deleted file mode 100644 index cfc2f935e6b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code.spec.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyCountryDialCode } from './amplify-country-dial-code'; - -describe('amplify-country-dial-code spec:', () => { - describe('Component logic ->', () => { - let countryDialCode; - - beforeEach(() => { - countryDialCode = new AmplifyCountryDialCode(); - }); - - it('should have options be defined by default', () => { - expect(countryDialCode.options).toBeDefined(); - }); - }); - describe('Render logic ->', () => { - it('shoulder render a `amplif-select` component with country dial codes as default', async () => { - const page = await newSpecPage({ - components: [AmplifyCountryDialCode], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code.stories.tsx b/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code.stories.tsx deleted file mode 100644 index ad6cd578d9f..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code.stories.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { storiesOf } from '@storybook/html'; - -const coutnryDialCodeStories = storiesOf('amplify-country-dial-code', module); - -coutnryDialCodeStories.add( - 'default with country dial code select options', - () => { - return ``; - } -); diff --git a/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code.tsx b/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code.tsx deleted file mode 100644 index 9b9350b3c14..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-country-dial-code/amplify-country-dial-code.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { Component, Prop, Watch, h } from '@stencil/core'; -import countryDialCodes from '../../common/country-dial-codes'; -import { CountryCodeDialOptions } from './amplify-country-dial-code-interface'; -import { COUNTRY_DIAL_CODE_SUFFIX } from '../../common/constants'; - -@Component({ - tag: 'amplify-country-dial-code', - shadow: true, -}) -export class AmplifyCountryDialCode { - /** The ID of the field. Should match with its corresponding input's ID. */ - @Prop() fieldId: string = COUNTRY_DIAL_CODE_SUFFIX; - /** The options of the country dial code select input. */ - @Prop() options: CountryCodeDialOptions = countryDialCodes; - /** The callback, called when the input is modified by the user. */ - @Prop() handleInputChange?: (inputEvent: Event) => void; - /** Default selected dial code */ - @Prop() dialCode: string | number = '+1'; - - private selectedDialCode: string; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - this.setSelectedDialCode(); - } - - @Watch('dialCode') - watchDialCodeHandler() { - this.setSelectedDialCode(); - } - - setSelectedDialCode() { - if (typeof this.dialCode === 'number') { - this.selectedDialCode = `+${this.dialCode}`; - } else { - this.selectedDialCode = this.dialCode; - } - } - - render() { - return ( - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-country-dial-code/readme.md b/packages/amplify-ui-components/src/components/amplify-country-dial-code/readme.md deleted file mode 100644 index 230b41861d0..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-country-dial-code/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# amplify-country-dial-code - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------------- | ----------- | --------------------------------------------------------------------- | ----------------------------- | -------------------------- | -| `dialCode` | `dial-code` | Default selected dial code | `number \| string` | `'+1'` | -| `fieldId` | `field-id` | The ID of the field. Should match with its corresponding input's ID. | `string` | `COUNTRY_DIAL_CODE_SUFFIX` | -| `handleInputChange` | -- | The callback, called when the input is modified by the user. | `(inputEvent: Event) => void` | `undefined` | -| `options` | -- | The options of the country dial code select input. | `CountryCodeDialOptions` | `countryDialCodes` | - - -## Dependencies - -### Used by - - - [amplify-phone-field](../amplify-phone-field) - -### Depends on - -- [amplify-select](../amplify-select) - -### Graph -```mermaid -graph TD; - amplify-country-dial-code --> amplify-select - amplify-phone-field --> amplify-country-dial-code - style amplify-country-dial-code fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-email-field/__snapshots__/amplify-email-field.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-email-field/__snapshots__/amplify-email-field.spec.ts.snap deleted file mode 100644 index 11d556c6367..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-email-field/__snapshots__/amplify-email-field.spec.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-email-field spec: Render logic -> should render \`placeholder\` and \`label values 1`] = ` - - - -`; - -exports[`amplify-email-field spec: Render logic -> should render default values by default 1`] = ` - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-email-field/amplify-email-field.e2e.ts b/packages/amplify-ui-components/src/components/amplify-email-field/amplify-email-field.e2e.ts deleted file mode 100644 index 22a7d9fb4d5..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-email-field/amplify-email-field.e2e.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-email-field e2e:', () => { - it('should render a amplify-email-field', async () => { - const page = await newE2EPage(); - await page.setContent(``); - const el = await page.find('amplify-email-field'); - expect(el).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-email-field', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-email-field/amplify-email-field.spec.ts b/packages/amplify-ui-components/src/components/amplify-email-field/amplify-email-field.spec.ts deleted file mode 100644 index 3a9490a794c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-email-field/amplify-email-field.spec.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyEmailField } from './amplify-email-field'; - -describe('amplify-email-field spec:', () => { - describe('Component logic ->', () => { - let emailField; - - beforeEach(() => { - emailField = new AmplifyEmailField(); - }); - - it('should render `email` for the field id', () => { - expect(emailField.fieldId).toEqual('email'); - }); - - it('should have `label` render to `Email Address *` by default', () => { - expect(emailField.label).toEqual('Email Address *'); - }); - - it('should have `placeholder` render to `Enter your email address` by default', () => { - expect(emailField.placeholder).toEqual('Enter your email address'); - }); - - it('should have `required` set to `false` by default', () => { - expect(emailField.required).toBe(false); - }); - }); - describe('Render logic ->', () => { - it('should render `placeholder` and `label values', async () => { - const page = await newSpecPage({ - components: [AmplifyEmailField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render default values by default', async () => { - const page = await newSpecPage({ - components: [AmplifyEmailField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-email-field/amplify-email-field.tsx b/packages/amplify-ui-components/src/components/amplify-email-field/amplify-email-field.tsx deleted file mode 100644 index 06ec4deacbd..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-email-field/amplify-email-field.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { Component, Prop, FunctionalComponent, h } from '@stencil/core'; -import { EMAIL_SUFFIX } from '../../common/constants'; -import { Translations } from '../../common/Translations'; - -@Component({ - tag: 'amplify-email-field', -}) -export class AmplifyEmailField { - /** Based on the type of field e.g. sign in, sign up, forgot password, etc. */ - @Prop() fieldId: string = EMAIL_SUFFIX; - /** Used for the EMAIL label */ - @Prop() label: string = Translations.EMAIL_LABEL; - /** Used for the placeholder label */ - @Prop() placeholder: string = Translations.EMAIL_PLACEHOLDER; - /** The required flag in order to make an input required prior to submitting a form */ - @Prop() required: boolean = false; - /** The callback, called when the input is modified by the user. */ - @Prop() handleInputChange?: (inputEvent: Event) => void; - /** The value of the content inside of the input field */ - @Prop() value?: string; - /** Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes */ - @Prop() inputProps?: object; - /** Will disable the input if set to true */ - @Prop() disabled?: boolean; - /** Used for the hint text that displays underneath the input field */ - @Prop() hint?: string | FunctionalComponent | null; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-email-field/readme.md b/packages/amplify-ui-components/src/components/amplify-email-field/readme.md deleted file mode 100644 index 64a5d76c925..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-email-field/readme.md +++ /dev/null @@ -1,44 +0,0 @@ -# amplify-email-field - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------- | -------------------------------- | -| `disabled` | `disabled` | Will disable the input if set to true | `boolean` | `undefined` | -| `fieldId` | `field-id` | Based on the type of field e.g. sign in, sign up, forgot password, etc. | `string` | `EMAIL_SUFFIX` | -| `handleInputChange` | -- | The callback, called when the input is modified by the user. | `(inputEvent: Event) => void` | `undefined` | -| `hint` | `hint` | Used for the hint text that displays underneath the input field | `FunctionalComponent<{}> \| string` | `undefined` | -| `inputProps` | -- | Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes | `object` | `undefined` | -| `label` | `label` | Used for the EMAIL label | `string` | `Translations.EMAIL_LABEL` | -| `placeholder` | `placeholder` | Used for the placeholder label | `string` | `Translations.EMAIL_PLACEHOLDER` | -| `required` | `required` | The required flag in order to make an input required prior to submitting a form | `boolean` | `false` | -| `value` | `value` | The value of the content inside of the input field | `string` | `undefined` | - - -## Dependencies - -### Used by - - - [amplify-auth-fields](../amplify-auth-fields) - -### Depends on - -- [amplify-form-field](../amplify-form-field) - -### Graph -```mermaid -graph TD; - amplify-email-field --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-auth-fields --> amplify-email-field - style amplify-email-field fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-facebook-button/__snapshots__/amplify-facebook-button.spec.tsx.snap b/packages/amplify-ui-components/src/components/amplify-facebook-button/__snapshots__/amplify-facebook-button.spec.tsx.snap deleted file mode 100644 index 9d0657beb5f..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-facebook-button/__snapshots__/amplify-facebook-button.spec.tsx.snap +++ /dev/null @@ -1,12 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-facebook-button stories defaults 1`] = ` - - - - - Sign in with Facebook - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-facebook-button/amplify-facebook-button.spec.tsx b/packages/amplify-ui-components/src/components/amplify-facebook-button/amplify-facebook-button.spec.tsx deleted file mode 100644 index b564d537a06..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-facebook-button/amplify-facebook-button.spec.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; - -import { AmplifyFacebookButton } from './amplify-facebook-button'; -import * as stories from './amplify-facebook-button.stories'; - -const { - default: { title }, - ...specs -} = stories; - -const components = [AmplifyFacebookButton]; - -describe(title, () => { - describe('stories', () => { - Object.entries(specs).forEach(([name, spec]) => { - it(name, async () => { - const page = await newSpecPage({ components, html: spec() }); - - expect(page.root).toMatchSnapshot(); - }); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-facebook-button/amplify-facebook-button.stories.tsx b/packages/amplify-ui-components/src/components/amplify-facebook-button/amplify-facebook-button.stories.tsx deleted file mode 100644 index 0e4cf820c0c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-facebook-button/amplify-facebook-button.stories.tsx +++ /dev/null @@ -1,5 +0,0 @@ -export default { - title: 'amplify-facebook-button', -}; - -export const defaults = () => ``; diff --git a/packages/amplify-ui-components/src/components/amplify-facebook-button/amplify-facebook-button.tsx b/packages/amplify-ui-components/src/components/amplify-facebook-button/amplify-facebook-button.tsx deleted file mode 100644 index 371b3498848..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-facebook-button/amplify-facebook-button.tsx +++ /dev/null @@ -1,135 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { I18n, ConsoleLogger as Logger } from '@aws-amplify/core'; -import { Component, h, Prop } from '@stencil/core'; - -import { AUTH_SOURCE_KEY, NO_AUTH_MODULE_FOUND } from '../../common/constants'; -import { - AuthState, - FederatedConfig, - AuthStateHandler, -} from '../../common/types/auth-types'; -import { dispatchAuthStateChangeEvent } from '../../common/helpers'; -import { Translations } from '../../common/Translations'; - -const logger = new Logger('amplify-facebook-button'); - -@Component({ - tag: 'amplify-facebook-button', - shadow: true, -}) -export class AmplifyFacebookButton { - /** App-specific client ID from Facebook */ - @Prop() appId: FederatedConfig['facebookAppId']; - /** Auth state change handler for this component - * e.g. SignIn -> 'Create Account' link -> SignUp - */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - private federatedSignIn = authResponse => { - const { accessToken, expiresIn } = authResponse; - - if (!accessToken) { - return; - } - - if ( - !Auth || - typeof Auth.federatedSignIn !== 'function' || - typeof Auth.currentAuthenticatedUser !== 'function' - ) { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - const date = new Date(); - const expires_at = expiresIn * 1000 + date.getTime(); - const fields = 'name,email'; - - window['FB'].api('/me', { fields }, async response => { - const user = { - name: response.name, - email: response.email, - }; - - await Auth.federatedSignIn( - 'facebook', - { token: accessToken, expires_at }, - user - ); - - const authenticatedUser = await Auth.currentAuthenticatedUser(); - - this.handleAuthStateChange(AuthState.SignedIn, authenticatedUser); - }); - }; - - private getLoginStatus = () => { - window['FB'].getLoginStatus(response => { - try { - window.localStorage.setItem( - AUTH_SOURCE_KEY, - JSON.stringify({ provider: 'facebook' }) - ); - } catch (e) { - logger.debug('Failed to cache auth source into localStorage', e); - } - - if (response.status === 'connected') { - return this.federatedSignIn(response.authResponse); - } - - this.login(); - }); - }; - - /** - * @see https://developers.facebook.com/docs/javascript/reference/FB.init/v5.0 - */ - private signInWithFacebook(event) { - event.preventDefault(); - - window['FB'].init({ - appId: this.appId, - cookie: true, - xfbml: false, - version: 'v5.0', - }); - - this.getLoginStatus(); - } - - private login = () => { - const scope = 'public_profile,email'; - - window['FB'].login( - response => { - if (response && response.authResponse) { - this.federatedSignIn(response.authResponse); - } - }, - { scope } - ); - }; - - render() { - return ( - this.signInWithFacebook(event)} - provider="facebook" - > - - {I18n.get(Translations.SIGN_IN_WITH_FACEBOOK)} - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-facebook-button/readme.md b/packages/amplify-ui-components/src/components/amplify-facebook-button/readme.md deleted file mode 100644 index d9c0c3e9f2a..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-facebook-button/readme.md +++ /dev/null @@ -1,35 +0,0 @@ -# amplify-facebook-button - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | --------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------- | ------------------------------ | -| `appId` | `app-id` | App-specific client ID from Facebook | `string` | `undefined` | -| `handleAuthStateChange` | -- | Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | - - -## Dependencies - -### Used by - - - [amplify-federated-buttons](../amplify-federated-buttons) - -### Depends on - -- [amplify-sign-in-button](../amplify-sign-in-button) - -### Graph -```mermaid -graph TD; - amplify-facebook-button --> amplify-sign-in-button - amplify-sign-in-button --> amplify-icon - amplify-federated-buttons --> amplify-facebook-button - style amplify-facebook-button fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-federated-buttons/__snapshots__/amplify-federated-buttons.spec.tsx.snap b/packages/amplify-ui-components/src/components/amplify-federated-buttons/__snapshots__/amplify-federated-buttons.spec.tsx.snap deleted file mode 100644 index 337d1ba8dab..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-federated-buttons/__snapshots__/amplify-federated-buttons.spec.tsx.snap +++ /dev/null @@ -1,52 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-federated-buttons stories renderNothingWithIncorrectAuthState 1`] = ` - - - -`; - -exports[`amplify-federated-buttons stories renderNothingWithNoFederatedProp 1`] = ` - - - -`; - -exports[`amplify-federated-buttons stories renderWithCorrectAuthState 1`] = ` - - -
-
- -
-
- -
-
-
-
-`; - -exports[`amplify-federated-buttons stories renderWithCorrectAuthStateAndOnlyFacebookId 1`] = ` - - -
-
- -
-
-
-
-`; - -exports[`amplify-federated-buttons stories renderWithCorrectAuthStateAndOnlyGoogleId 1`] = ` - - -
-
- -
-
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-federated-buttons/amplify-federated-buttons.spec.tsx b/packages/amplify-ui-components/src/components/amplify-federated-buttons/amplify-federated-buttons.spec.tsx deleted file mode 100644 index 0aa9d645cf2..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-federated-buttons/amplify-federated-buttons.spec.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; - -import { AmplifyFederatedButtons } from './amplify-federated-buttons'; -import * as stories from './amplify-federated-buttons.stories'; - -const { - default: { title }, - ...templates -} = stories; - -const components = [AmplifyFederatedButtons]; - -describe(title, () => { - describe('stories', () => { - Object.entries(templates).forEach(([name, template]) => { - it(name, async () => { - const page = await newSpecPage({ components, template }); - - expect(page.root).toMatchSnapshot(); - }); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-federated-buttons/amplify-federated-buttons.stories.tsx b/packages/amplify-ui-components/src/components/amplify-federated-buttons/amplify-federated-buttons.stories.tsx deleted file mode 100644 index ec234a91b0f..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-federated-buttons/amplify-federated-buttons.stories.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { h } from '@stencil/core'; -import { AuthState } from '../../common/types/auth-types'; - -const handleStateChange = (...args) => { - console.log('handleStateChange', ...args); -}; - -export default { - title: 'amplify-federated-buttons', -}; - -export const renderWithCorrectAuthState = () => ( - -); - -export const renderWithCorrectAuthStateAndOnlyFacebookId = () => ( - -); - -export const renderWithCorrectAuthStateAndOnlyGoogleId = () => ( - -); - -export const renderNothingWithIncorrectAuthState = () => ( - -); - -export const renderNothingWithNoFederatedProp = () => ( - -); diff --git a/packages/amplify-ui-components/src/components/amplify-federated-buttons/amplify-federated-buttons.tsx b/packages/amplify-ui-components/src/components/amplify-federated-buttons/amplify-federated-buttons.tsx deleted file mode 100644 index eb0af3a048e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-federated-buttons/amplify-federated-buttons.tsx +++ /dev/null @@ -1,119 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { isEmpty } from '@aws-amplify/core'; -import { Component, h, Prop } from '@stencil/core'; -import { dispatchAuthStateChangeEvent } from '../../common/helpers'; -import { NO_AUTH_MODULE_FOUND } from '../../common/constants'; -import { - AuthState, - FederatedConfig, - AuthStateHandler, -} from '../../common/types/auth-types'; - -@Component({ - tag: 'amplify-federated-buttons', - shadow: true, -}) -export class AmplifyFederatedButtons { - /** The current authentication state. */ - @Prop() authState: AuthState = AuthState.SignIn; - /** Federated credentials & configuration. */ - @Prop() federated: FederatedConfig = {}; - /** Auth state change handler for this component - * e.g. SignIn -> 'Create Account' link -> SignUp - */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - if (!Auth || typeof Auth.configure !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - const { oauth = {} } = Auth.configure(); - - // backward compatibility - if (oauth['domain']) { - this.federated.oauthConfig = { ...this.federated.oauthConfig, ...oauth }; - } else if (oauth['awsCognito']) { - this.federated.oauthConfig = { - ...this.federated.oauthConfig, - ...oauth['awsCognito'], - }; - } - - if (oauth['auth0']) { - this.federated.auth0Config = { - ...this.federated.auth0Config, - ...oauth['auth0'], - }; - } - } - - render() { - if (!Object.values(AuthState).includes(this.authState)) { - return null; - } - - if (isEmpty(this.federated)) { - return null; - } - - const { - amazonClientId, - auth0Config, - facebookAppId, - googleClientId, - oauthConfig, - } = this.federated; - - return ( -
- {googleClientId && ( -
- -
- )} - - {facebookAppId && ( -
- -
- )} - - {amazonClientId && ( -
- -
- )} - - {oauthConfig && ( -
- -
- )} - - {auth0Config && ( -
- -
- )} -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-federated-buttons/readme.md b/packages/amplify-ui-components/src/components/amplify-federated-buttons/readme.md deleted file mode 100644 index bdcb85f092a..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-federated-buttons/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# amplify-federated-buttons - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | ------------ | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | -| `authState` | `auth-state` | The current authentication state. | `AuthState.ConfirmSignIn \| AuthState.ConfirmSignUp \| AuthState.CustomConfirmSignIn \| AuthState.ForgotPassword \| AuthState.Loading \| AuthState.ResetPassword \| AuthState.SettingMFA \| AuthState.SignIn \| AuthState.SignOut \| AuthState.SignUp \| AuthState.SignedIn \| AuthState.SignedOut \| AuthState.SigningUp \| AuthState.TOTPSetup \| AuthState.VerifyContact \| AuthState.VerifyingAttributes \| AuthState.confirmingSignInCustomFlow \| AuthState.confirmingSignUpCustomFlow` | `AuthState.SignIn` | -| `federated` | -- | Federated credentials & configuration. | `FederatedConfig` | `{}` | -| `handleAuthStateChange` | -- | Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | - - -## Dependencies - -### Used by - - - [amplify-federated-sign-in](../amplify-federated-sign-in) - - [amplify-sign-in](../amplify-sign-in) - -### Depends on - -- [amplify-google-button](../amplify-google-button) -- [amplify-facebook-button](../amplify-facebook-button) -- [amplify-amazon-button](../amplify-amazon-button) -- [amplify-oauth-button](../amplify-oauth-button) -- [amplify-auth0-button](../amplify-auth0-button) - -### Graph -```mermaid -graph TD; - amplify-federated-buttons --> amplify-google-button - amplify-federated-buttons --> amplify-facebook-button - amplify-federated-buttons --> amplify-amazon-button - amplify-federated-buttons --> amplify-oauth-button - amplify-federated-buttons --> amplify-auth0-button - amplify-google-button --> amplify-sign-in-button - amplify-sign-in-button --> amplify-icon - amplify-facebook-button --> amplify-sign-in-button - amplify-amazon-button --> amplify-sign-in-button - amplify-oauth-button --> amplify-sign-in-button - amplify-auth0-button --> amplify-sign-in-button - amplify-federated-sign-in --> amplify-federated-buttons - amplify-sign-in --> amplify-federated-buttons - style amplify-federated-buttons fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-federated-sign-in/__snapshots__/amplify-federated-sign-in.spec.tsx.snap b/packages/amplify-ui-components/src/components/amplify-federated-sign-in/__snapshots__/amplify-federated-sign-in.spec.tsx.snap deleted file mode 100644 index 1b6ec4ed827..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-federated-sign-in/__snapshots__/amplify-federated-sign-in.spec.tsx.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-federated-sign-in stories defaults 1`] = ` - - - - - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-federated-sign-in/amplify-federated-sign-in.spec.tsx b/packages/amplify-ui-components/src/components/amplify-federated-sign-in/amplify-federated-sign-in.spec.tsx deleted file mode 100644 index 8621a01544b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-federated-sign-in/amplify-federated-sign-in.spec.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; - -import { AmplifyFederatedSignIn } from './amplify-federated-sign-in'; -import * as stories from './amplify-federated-sign-in.stories'; - -const { - default: { title }, - ...specs -} = stories; - -const components = [AmplifyFederatedSignIn]; - -describe(title, () => { - describe('stories', () => { - Object.entries(specs).forEach(([name, spec]) => { - it(name, async () => { - const page = await newSpecPage({ components, html: spec() }); - - expect(page.root).toMatchSnapshot(); - }); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-federated-sign-in/amplify-federated-sign-in.stories.ts b/packages/amplify-ui-components/src/components/amplify-federated-sign-in/amplify-federated-sign-in.stories.ts deleted file mode 100644 index 121612f86de..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-federated-sign-in/amplify-federated-sign-in.stories.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - title: 'amplify-federated-sign-in', -}; - -export const defaults = () => ``; diff --git a/packages/amplify-ui-components/src/components/amplify-federated-sign-in/amplify-federated-sign-in.tsx b/packages/amplify-ui-components/src/components/amplify-federated-sign-in/amplify-federated-sign-in.tsx deleted file mode 100644 index 48102472c42..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-federated-sign-in/amplify-federated-sign-in.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { ConsoleLogger as Logger } from '@aws-amplify/core'; -import { Component, h, Prop } from '@stencil/core'; - -import { NO_AUTH_MODULE_FOUND } from '../../common/constants'; -import { AuthState } from '../../common/types/auth-types'; - -const logger = new Logger('amplify-federated-sign-in'); - -@Component({ - tag: 'amplify-federated-sign-in', - shadow: true, -}) -export class AmplifyFederatedSignIn { - /** The current authentication state. */ - @Prop() authState: AuthState = AuthState.SignIn; - /** Federated credentials & configuration. */ - @Prop() federated: any = {}; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - if (!Auth || typeof Auth.configure !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - const { oauth = {} } = Auth.configure(); - - // backward compatibility - if (oauth['domain']) { - this.federated.oauth_config = { - ...this.federated.oauth_config, - ...oauth, - }; - } else if (oauth['awsCognito']) { - this.federated.oauth_config = { - ...this.federated.oauth_config, - ...oauth['awsCognito'], - }; - } - - if (oauth['auth0']) { - this.federated.auth0 = { ...this.federated.auth0, ...oauth['auth0'] }; - } - } - - render() { - if (!this.federated) { - logger.debug('federated prop is empty. show nothing'); - logger.debug( - 'federated={google_client_id: , facebook_app_id: , amazon_client_id}' - ); - - return null; - } - - if (!Object.values(AuthState).includes(this.authState)) { - return null; - } - - logger.debug('federated Config is', this.federated); - - return ( - - - - - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-federated-sign-in/readme.md b/packages/amplify-ui-components/src/components/amplify-federated-sign-in/readme.md deleted file mode 100644 index 327164f9c40..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-federated-sign-in/readme.md +++ /dev/null @@ -1,49 +0,0 @@ -# amplify-federated-sign-in - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------- | ------------ | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | -| `authState` | `auth-state` | The current authentication state. | `AuthState.ConfirmSignIn \| AuthState.ConfirmSignUp \| AuthState.CustomConfirmSignIn \| AuthState.ForgotPassword \| AuthState.Loading \| AuthState.ResetPassword \| AuthState.SettingMFA \| AuthState.SignIn \| AuthState.SignOut \| AuthState.SignUp \| AuthState.SignedIn \| AuthState.SignedOut \| AuthState.SigningUp \| AuthState.TOTPSetup \| AuthState.VerifyContact \| AuthState.VerifyingAttributes \| AuthState.confirmingSignInCustomFlow \| AuthState.confirmingSignUpCustomFlow` | `AuthState.SignIn` | -| `federated` | `federated` | Federated credentials & configuration. | `any` | `{}` | - - -## Dependencies - -### Depends on - -- [amplify-form-section](../amplify-form-section) -- [amplify-section](../amplify-section) -- [amplify-federated-buttons](../amplify-federated-buttons) - -### Graph -```mermaid -graph TD; - amplify-federated-sign-in --> amplify-form-section - amplify-federated-sign-in --> amplify-section - amplify-federated-sign-in --> amplify-federated-buttons - amplify-form-section --> amplify-section - amplify-form-section --> amplify-button - amplify-form-section --> amplify-loading-spinner - amplify-button --> amplify-icon - amplify-loading-spinner --> amplify-icon - amplify-federated-buttons --> amplify-google-button - amplify-federated-buttons --> amplify-facebook-button - amplify-federated-buttons --> amplify-amazon-button - amplify-federated-buttons --> amplify-oauth-button - amplify-federated-buttons --> amplify-auth0-button - amplify-google-button --> amplify-sign-in-button - amplify-sign-in-button --> amplify-icon - amplify-facebook-button --> amplify-sign-in-button - amplify-amazon-button --> amplify-sign-in-button - amplify-oauth-button --> amplify-sign-in-button - amplify-auth0-button --> amplify-sign-in-button - style amplify-federated-sign-in fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-forgot-password/__snapshots__/amplify-forgot-password.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-forgot-password/__snapshots__/amplify-forgot-password.spec.ts.snap deleted file mode 100644 index e72fb62cb44..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-forgot-password/__snapshots__/amplify-forgot-password.spec.ts.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-forgot-password spec: Render logic -> should render 1`] = ` - - - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-forgot-password/amplify-forgot-password-interface.ts b/packages/amplify-ui-components/src/components/amplify-forgot-password/amplify-forgot-password-interface.ts deleted file mode 100644 index 7e4e56b8d5b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-forgot-password/amplify-forgot-password-interface.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type CodeDeliveryType = 'SMS' | 'EMAIL'; - -export interface ForgotPasswordAttributes { - userInput: string; - password: string; - code: string; -} diff --git a/packages/amplify-ui-components/src/components/amplify-forgot-password/amplify-forgot-password.spec.ts b/packages/amplify-ui-components/src/components/amplify-forgot-password/amplify-forgot-password.spec.ts deleted file mode 100644 index 7e820749349..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-forgot-password/amplify-forgot-password.spec.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyForgotPassword } from './amplify-forgot-password'; -import { Translations } from '../../common/Translations'; - -describe('amplify-forgot-password spec:', () => { - describe('Component logic ->', () => { - let amplifyForgotPassword; - - beforeEach(() => { - Auth.forgotPassword = jest.fn().mockResolvedValue({ - CodeDeliveryDetails: 'CodeDeliveryDetails mocked value', - }); - Auth.forgotPasswordSubmit = jest.fn().mockResolvedValue({}); - amplifyForgotPassword = new AmplifyForgotPassword(); - }); - - it('`headerText` should be set by default', () => { - expect(amplifyForgotPassword.headerText).toBe( - Translations.RESET_YOUR_PASSWORD - ); - }); - - it('`sendButtonText` should be set by default', () => { - expect(amplifyForgotPassword.sendButtonText).toBe(Translations.SEND_CODE); - }); - - it('`submitButtonText` should be set by default', () => { - expect(amplifyForgotPassword.submitButtonText).toBe(Translations.SUBMIT); - }); - - it('should render `usernameAlias` as `username` by default', () => { - expect(amplifyForgotPassword.usernameAlias).toEqual('username'); - }); - - it('should trim the `userInput` text on `send`', async () => { - const event = { preventDefault: jest.fn() }; - amplifyForgotPassword.forgotPasswordAttrs.userInput = 'foo '; - const promise = amplifyForgotPassword.send(event); - expect(event.preventDefault).toHaveBeenCalledWith(); - expect(amplifyForgotPassword.loading).toBe(true); - expect(Auth.forgotPassword).toHaveBeenCalledWith( - amplifyForgotPassword.forgotPasswordAttrs.userInput.trim()); - expect(amplifyForgotPassword.delivery).toBe(null); - await promise; - expect(amplifyForgotPassword.delivery).toBe('CodeDeliveryDetails mocked value'); - expect(amplifyForgotPassword.loading).toBe(false); - }); - - it('should trim the `userInput` text on `submit`', async () => { - const event = { preventDefault: jest.fn() }; - amplifyForgotPassword.forgotPasswordAttrs.userInput = 'foo '; - amplifyForgotPassword.delivery = 'bar'; - const promise = amplifyForgotPassword.submit(event); - expect(event.preventDefault).toHaveBeenCalledWith(); - expect(amplifyForgotPassword.loading).toBe(true); - expect(Auth.forgotPasswordSubmit).toHaveBeenCalledWith( - amplifyForgotPassword.forgotPasswordAttrs.userInput.trim(), - amplifyForgotPassword.forgotPasswordAttrs.code, - amplifyForgotPassword.forgotPasswordAttrs.password); - expect(amplifyForgotPassword.delivery).toBe('bar'); - await promise; - expect(amplifyForgotPassword.delivery).toBeNull(); - expect(amplifyForgotPassword.loading).toBe(false); - }); - }); - describe('Render logic ->', () => { - it(`should render`, async () => { - const page = await newSpecPage({ - components: [AmplifyForgotPassword], - html: ``, - }); - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-forgot-password/amplify-forgot-password.stories.tsx b/packages/amplify-ui-components/src/components/amplify-forgot-password/amplify-forgot-password.stories.tsx deleted file mode 100644 index 59ca08d6a5f..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-forgot-password/amplify-forgot-password.stories.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { storiesOf } from '@storybook/html'; - -const forgotPasswordStories = storiesOf('amplify-forgot-password', module); - -forgotPasswordStories.add('default', () => { - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-forgot-password/amplify-forgot-password.tsx b/packages/amplify-ui-components/src/components/amplify-forgot-password/amplify-forgot-password.tsx deleted file mode 100644 index b9366509ca0..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-forgot-password/amplify-forgot-password.tsx +++ /dev/null @@ -1,309 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { I18n, Logger } from '@aws-amplify/core'; -import { Component, Prop, State, h, Watch, Host } from '@stencil/core'; - -import { - FormFieldTypes, - FormFieldType, - PhoneNumberInterface, - PhoneFormFieldType, -} from '../amplify-auth-fields/amplify-auth-fields-interface'; -import { - AuthState, - AuthStateHandler, - UsernameAliasStrings, -} from '../../common/types/auth-types'; -import { - NO_AUTH_MODULE_FOUND, - COUNTRY_DIAL_CODE_DEFAULT, -} from '../../common/constants'; -import { Translations } from '../../common/Translations'; -import { - CodeDeliveryType, - ForgotPasswordAttributes, -} from './amplify-forgot-password-interface'; - -import { - dispatchToastHubEvent, - dispatchAuthStateChangeEvent, - composePhoneNumberInput, - checkUsernameAlias, - handlePhoneNumberChange, -} from '../../common/helpers'; - -const logger = new Logger('ForgotPassword'); - -@Component({ - tag: 'amplify-forgot-password', - shadow: true, -}) -export class AmplifyForgotPassword { - /** The header text of the forgot password section */ - @Prop() headerText: string = Translations.RESET_YOUR_PASSWORD; - /** The text displayed inside of the send code button for the form */ - @Prop() sendButtonText: string = Translations.SEND_CODE; - /** The text displayed inside of the submit button for the form */ - @Prop() submitButtonText: string = Translations.SUBMIT; - /** The form fields displayed inside of the forgot password form */ - @Prop() formFields: FormFieldTypes | string[] = []; - /** The function called when making a request to reset password */ - @Prop() handleSend: (event: Event) => void = event => this.send(event); - /** The function called when submitting a new password */ - @Prop() handleSubmit: (event: Event) => void = event => this.submit(event); - /** Auth state change handler for this component */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */ - @Prop() usernameAlias: UsernameAliasStrings = 'username'; - @State() delivery: CodeDeliveryType | null = null; - @State() loading: boolean = false; - - private phoneNumber: PhoneNumberInterface = { - countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT, - phoneNumberValue: null, - }; - private newFormFields: FormFieldTypes | string[] = []; - - @State() forgotPasswordAttrs: ForgotPasswordAttributes = { - userInput: '', - password: '', - code: '', - }; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - checkUsernameAlias(this.usernameAlias); - this.buildFormFields(); - } - - @Watch('formFields') - formFieldsHandler() { - this.buildFormFields(); - } - - private buildFormFields() { - if (this.formFields.length === 0) { - this.buildDefaultFormFields(); - } else { - const newFields = []; - this.formFields.forEach(field => { - const newField = { ...field }; - newField['handleInputChange'] = event => - this.handleFormFieldInputWithCallback(event, field); - newFields.push(newField); - }); - this.newFormFields = newFields; - } - } - - private buildDefaultFormFields() { - switch (this.usernameAlias) { - case 'email': - this.newFormFields = [ - { - type: 'email', - required: true, - handleInputChange: this.handleFormFieldInputChange('email'), - inputProps: { - 'data-test': 'forgot-password-email-input', - }, - }, - ]; - break; - case 'phone_number': - this.newFormFields = [ - { - type: 'phone_number', - required: true, - handleInputChange: this.handleFormFieldInputChange('phone_number'), - inputProps: { - 'data-test': 'forgot-password-phone-number-input', - }, - }, - ]; - break; - case 'username': - default: - this.newFormFields = [ - { - type: 'username', - required: true, - handleInputChange: this.handleFormFieldInputChange('username'), - inputProps: { - 'data-test': 'forgot-password-username-input', - }, - }, - ]; - break; - } - } - - private handleFormFieldInputChange(fieldType) { - switch (fieldType) { - case 'username': - case 'email': - return event => - (this.forgotPasswordAttrs.userInput = event.target.value); - case 'phone_number': - return event => handlePhoneNumberChange(event, this.phoneNumber); - case 'password': - case 'code': - return event => - (this.forgotPasswordAttrs[fieldType] = event.target.value); - default: - return; - } - } - - setFieldValue( - field: PhoneFormFieldType | FormFieldType, - formAttributes: ForgotPasswordAttributes - ) { - switch (field.type) { - case 'username': - case 'email': - if (field.value === undefined) { - formAttributes.userInput = ''; - } else { - formAttributes.userInput = field.value; - } - break; - case 'phone_number': - if ((field as PhoneFormFieldType).dialCode) { - this.phoneNumber.countryDialCodeValue = (field as PhoneFormFieldType).dialCode; - } - this.phoneNumber.phoneNumberValue = field.value; - break; - case 'password': - case 'code': - if (field.value === undefined) { - formAttributes[field.type] = ''; - } else { - formAttributes[field.type] = field.value; - } - break; - } - } - - private handleFormFieldInputWithCallback(event, field) { - const fnToCall = field['handleInputChange'] - ? field['handleInputChange'] - : (event, cb) => { - cb(event); - }; - const callback = this.handleFormFieldInputChange(field.type); - fnToCall(event, callback.bind(this)); - } - - private async send(event) { - if (event) { - event.preventDefault(); - } - if (!Auth || typeof Auth.forgotPassword !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - this.loading = true; - - switch (this.usernameAlias) { - case 'phone_number': - try { - this.forgotPasswordAttrs.userInput = composePhoneNumberInput( - this.phoneNumber - ); - } catch (error) { - dispatchToastHubEvent(error); - } - break; - default: - break; - } - - try { - const data = await Auth.forgotPassword( - this.forgotPasswordAttrs.userInput.trim() - ); - logger.debug(data); - this.newFormFields = [ - { - type: 'code', - required: true, - handleInputChange: this.handleFormFieldInputChange('code'), - inputProps: { - 'data-test': 'forgot-password-code-input', - }, - }, - { - type: 'password', - required: true, - handleInputChange: this.handleFormFieldInputChange('password'), - label: I18n.get(Translations.NEW_PASSWORD_LABEL), - placeholder: I18n.get(Translations.NEW_PASSWORD_PLACEHOLDER), - }, - ]; - this.delivery = data.CodeDeliveryDetails; - } catch (error) { - dispatchToastHubEvent(error); - } finally { - this.loading = false; - } - } - - private async submit(event: Event) { - if (event) { - event.preventDefault(); - } - if (!Auth || typeof Auth.forgotPasswordSubmit !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - this.loading = true; - try { - const { userInput, code, password } = this.forgotPasswordAttrs; - const data = await Auth.forgotPasswordSubmit( - userInput.trim(), - code, - password - ); - logger.debug(data); - this.handleAuthStateChange(AuthState.SignIn); - this.delivery = null; - } catch (error) { - dispatchToastHubEvent(error); - } finally { - this.loading = false; - } - } - - render() { - const submitFn = this.delivery - ? event => this.handleSubmit(event) - : event => this.handleSend(event); - const submitButtonText = this.delivery - ? this.submitButtonText - : this.sendButtonText; - return ( - - this.handleAuthStateChange(AuthState.SignIn)} - data-test="forgot-password-back-to-sign-in-link" - > - {I18n.get(Translations.BACK_TO_SIGN_IN)} -
- } - testDataPrefix={'forgot-password'} - submitButtonText={I18n.get(submitButtonText)} - > - - -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-forgot-password/readme.md b/packages/amplify-ui-components/src/components/amplify-forgot-password/readme.md deleted file mode 100644 index ec2cab7812a..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-forgot-password/readme.md +++ /dev/null @@ -1,66 +0,0 @@ -# amplify-forgot-password - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | -------------------- | ----------------------------------------------------------------------------------------- | --------------------------------------------------- | ---------------------------------- | -| `formFields` | -- | The form fields displayed inside of the forgot password form | `FormFieldTypes \| string[]` | `[]` | -| `handleAuthStateChange` | -- | Auth state change handler for this component | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | -| `handleSend` | -- | The function called when making a request to reset password | `(event: Event) => void` | `event => this.send(event)` | -| `handleSubmit` | -- | The function called when submitting a new password | `(event: Event) => void` | `event => this.submit(event)` | -| `headerText` | `header-text` | The header text of the forgot password section | `string` | `Translations.RESET_YOUR_PASSWORD` | -| `sendButtonText` | `send-button-text` | The text displayed inside of the send code button for the form | `string` | `Translations.SEND_CODE` | -| `submitButtonText` | `submit-button-text` | The text displayed inside of the submit button for the form | `string` | `Translations.SUBMIT` | -| `usernameAlias` | `username-alias` | Username Alias is used to setup authentication with `username`, `email` or `phone_number` | `"email" \| "phone_number" \| "username"` | `'username'` | - - -## Dependencies - -### Used by - - - [amplify-authenticator](../amplify-authenticator) - -### Depends on - -- [amplify-form-section](../amplify-form-section) -- [amplify-button](../amplify-button) -- [amplify-auth-fields](../amplify-auth-fields) - -### Graph -```mermaid -graph TD; - amplify-forgot-password --> amplify-form-section - amplify-forgot-password --> amplify-button - amplify-forgot-password --> amplify-auth-fields - amplify-form-section --> amplify-section - amplify-form-section --> amplify-button - amplify-form-section --> amplify-loading-spinner - amplify-button --> amplify-icon - amplify-loading-spinner --> amplify-icon - amplify-auth-fields --> amplify-username-field - amplify-auth-fields --> amplify-password-field - amplify-auth-fields --> amplify-email-field - amplify-auth-fields --> amplify-code-field - amplify-auth-fields --> amplify-phone-field - amplify-auth-fields --> amplify-form-field - amplify-username-field --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-password-field --> amplify-form-field - amplify-email-field --> amplify-form-field - amplify-code-field --> amplify-form-field - amplify-phone-field --> amplify-form-field - amplify-phone-field --> amplify-country-dial-code - amplify-phone-field --> amplify-input - amplify-country-dial-code --> amplify-select - amplify-authenticator --> amplify-forgot-password - style amplify-forgot-password fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-form-field/__snapshots__/amplify-form-field.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-form-field/__snapshots__/amplify-form-field.spec.ts.snap deleted file mode 100644 index c600158c8a5..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-field/__snapshots__/amplify-form-field.spec.ts.snap +++ /dev/null @@ -1,120 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-form-field spec: Render logic -> renders a label and description, if they are provided, and no id 1`] = ` - - -
-
- - label - -
-
- description -
-
- - - -
-
-
-`; - -exports[`amplify-form-field spec: Render logic -> renders no label or description if none are provided 1`] = ` - - -
-
- - - -
-
-
-`; - -exports[`amplify-form-field spec: Render logic -> renders with an id, if it is provided 1`] = ` - - -
-
- - label - -
-
- description -
-
- - - -
-
-
-`; - -exports[`amplify-form-field spec: Render logic -> renders with an name, if it is provided 1`] = ` - - -
-
- - label - -
-
- description -
-
- - - -
-
-
-`; - -exports[`amplify-form-field spec: Render logic -> renders without Emotion CSS classes 1`] = ` - - -
-
- - label - -
-
- description -
-
- - - -
-
-
-`; - -exports[`amplify-form-field spec: Render logic -> replaces the input component, if a new one is provided 1`] = ` - - -
-
- - label - -
-
- description -
-
- - - - -
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.e2e.ts b/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.e2e.ts deleted file mode 100644 index 1fdb657f073..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.e2e.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { newE2EPage, E2EPage } from '@stencil/core/testing'; -import { pixelThreshold, selectors } from '../../common/testing'; - -describe('amplify-form-field e2e:', () => { - let page: E2EPage; - - beforeEach(async () => { - page = await newE2EPage(); - }); - - it('renders with label, description, and hint', async () => { - await page.setContent( - `` - ); - const screenshot = await page.compareScreenshot('Amplify Form Field', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - - const fieldElement = await page.find('amplify-form-field'); - expect(fieldElement).not.toBeNull(); - - const labelElement = await page.find('label'); - expect(labelElement).toEqualText('Label test'); - expect(labelElement).toEqualAttribute('for', 'id'); - - const descriptionElement = await page.find(selectors.formFieldDescription); - expect(descriptionElement).toEqualText('Description test'); - }); - - it('renders no label, description, or hint if none are provided', async () => { - await page.setContent(``); - - const labelElement = await page.find('label'); - expect(labelElement).toBeNull(); - - const descriptionElement = await page.find(selectors.formFieldDescription); - expect(descriptionElement).toBeNull(); - }); - - it('fires an onInputChange event when the contents of the box are changed', async () => { - await page.setContent(``); - - const func = jest.fn(); - await page.exposeFunction('exposedfunc', func); - - await page.$eval('amplify-form-field', (fieldElement: any) => { - fieldElement.handleInputChange = this.exposedfunc; - fieldElement.label = 'adding a label so that the component rerenders'; - }); - await page.waitForChanges(); - - const input = await page.find('input'); - await input.press('8'); - expect(func).toBeCalledTimes(1); - expect(func.mock.calls[0][0].isTrusted).toBe(true); - const value = await input.getProperty('value'); - expect(value).toBe('8'); - }); - - it('can have a checkbox input', async () => { - await page.setContent( - `` - ); - await page.waitForChanges(); - - const input = await page.find('input'); - expect(input).toEqualAttribute('type', 'checkbox'); - }); - - it('can have a number input', async () => { - await page.setContent( - `` - ); - await page.waitForChanges(); - - const input = await page.find('input'); - expect(input).toEqualAttribute('type', 'number'); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.scss b/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.scss deleted file mode 100644 index f510e51f915..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.scss +++ /dev/null @@ -1,19 +0,0 @@ -amplify-form-field { - --label-font-size: var(--amplify-text-md); - --description-font-size: var(--amplify-text-sm); -} - -.form-field { - margin-bottom: 15px; -} - -.form-field-label { - display: block; - font-size: var(--label-font-size); - padding-bottom: 0.5em; -} - -.form-field-description { - font-size: var(--description-font-size); - padding-top: 0.5em; -} diff --git a/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.spec.ts b/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.spec.ts deleted file mode 100644 index 09faea34314..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.spec.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyFormField } from './amplify-form-field'; - -describe('amplify-form-field spec:', () => { - describe('Component logic ->', () => { - let formField; - - beforeEach(() => { - formField = new AmplifyFormField(); - }); - - it('should have fieldId prop be undefined by default', () => { - expect(formField.fieldId).toBeUndefined(); - }); - - it('should have label prop be undefined by default', () => { - expect(formField.label).toBeUndefined(); - }); - - it('should have description prop be undefined by default', () => { - expect(formField.description).toBeUndefined(); - }); - - it('should have type set to `text` by default', () => { - expect(formField.type).toEqual('text'); - }); - - it('should have required set to false by default', () => { - expect(formField.required).toBe(false); - }); - - it('should have placeholder prop set to an empty string by default', () => { - expect(formField.placeholder).toEqual(''); - }); - - it('should have name prop be undefined by default', () => { - expect(formField.name).toBeUndefined(); - }); - }); - describe('Render logic ->', () => { - it('renders no label or description if none are provided', async () => { - const page = await newSpecPage({ - components: [AmplifyFormField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('renders a label and description, if they are provided, and no id', async () => { - const page = await newSpecPage({ - components: [AmplifyFormField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('renders with an id, if it is provided', async () => { - const page = await newSpecPage({ - components: [AmplifyFormField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('renders with an name, if it is provided', async () => { - const page = await newSpecPage({ - components: [AmplifyFormField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('replaces the input component, if a new one is provided', async () => { - const page = await newSpecPage({ - components: [AmplifyFormField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('renders without Emotion CSS classes', async () => { - const page = await newSpecPage({ - components: [AmplifyFormField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.stories.tsx b/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.stories.tsx deleted file mode 100644 index b050ba503c1..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.stories.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { storiesOf } from '@storybook/html'; -import { knobs } from '../../common/testing'; - -const formFieldStories = storiesOf('amplify-form-field', module); - -formFieldStories.add('generalized', () => { - const label = knobs.labelKnob('Label placeholder'); - const description = knobs.descriptionKnob('Description placeholder'); - const hint = knobs.hintKnob('Hint placeholder'); - const type = knobs.inputTypeKnob('text'); - const placeholder = knobs.placeholderKnob('Placeholder placeholder'); - return ``; -}); - -formFieldStories.add('password example', () => { - const label = knobs.labelKnob('Enter your password'); - const description = knobs.descriptionKnob('Passwords should be kept safe!'); - const hint = knobs.hintKnob('Click here to reset your password'); - const type = knobs.inputTypeKnob('password'); - const placeholder = knobs.placeholderKnob('Type here!'); - return ``; -}); - -formFieldStories.add('number example', () => { - const label = knobs.labelKnob('Enter in some numbers!'); - const description = knobs.descriptionKnob( - `Don't you dare try to enter text here` - ); - const hint = knobs.hintKnob( - 'It turns out you can type e and . in number inputs' - ); - const type = knobs.inputTypeKnob('number'); - const placeholder = knobs.placeholderKnob('12345'); - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.tsx b/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.tsx deleted file mode 100644 index 594942b7474..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-field/amplify-form-field.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { Component, Prop, h, FunctionalComponent } from '@stencil/core'; -import { TextFieldTypes } from '../../common/types/ui-types'; - -/** - * @slot input - Content for the input within the form field - */ -@Component({ - tag: 'amplify-form-field', - styleUrl: 'amplify-form-field.scss', -}) -export class AmplifyFormField { - /** The ID of the field. Should match with its corresponding input's ID. */ - @Prop() fieldId: string; - /** The text of the label. Goes above the input. Ex: 'First name' */ - @Prop() label: string | null; - /** The text of the description. Goes between the label and the input. */ - @Prop() description: string | null; - /** The text of a hint to the user as to how to fill out the input. Goes just below the input. */ - @Prop() hint: string | FunctionalComponent | null; - /** The input type. Can be any HTML input type. */ - @Prop() type?: TextFieldTypes = 'text'; - /** The required flag in order to make an input required prior to submitting a form */ - @Prop() required: boolean = false; - /** The callback, called when the input is modified by the user. */ - @Prop() handleInputChange?: (inputEvent: Event) => void; - /** (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. */ - @Prop() placeholder?: string = ''; - /** (Optional) String value for the name of the input. */ - @Prop() name?: string; - /** The value of the content inside of the input field */ - @Prop() value: string; - /** Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes */ - @Prop() inputProps?: object; - /** Will disable the input if set to true */ - @Prop() disabled?: boolean; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( -
- {this.label && ( -
- {this.label} -
- )} - {this.description && ( -
- {this.description} -
- )} -
- - - -
- {this.hint && ( - {this.hint} - )} -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-form-field/readme.md b/packages/amplify-ui-components/src/components/amplify-form-field/readme.md deleted file mode 100644 index 3c2e43b3c9e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-field/readme.md +++ /dev/null @@ -1,67 +0,0 @@ -# amplify-form-field - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------- | -| `description` | `description` | The text of the description. Goes between the label and the input. | `string` | `undefined` | -| `disabled` | `disabled` | Will disable the input if set to true | `boolean` | `undefined` | -| `fieldId` | `field-id` | The ID of the field. Should match with its corresponding input's ID. | `string` | `undefined` | -| `handleInputChange` | -- | The callback, called when the input is modified by the user. | `(inputEvent: Event) => void` | `undefined` | -| `hint` | `hint` | The text of a hint to the user as to how to fill out the input. Goes just below the input. | `FunctionalComponent<{}> \| string` | `undefined` | -| `inputProps` | -- | Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes | `object` | `undefined` | -| `label` | `label` | The text of the label. Goes above the input. Ex: 'First name' | `string` | `undefined` | -| `name` | `name` | (Optional) String value for the name of the input. | `string` | `undefined` | -| `placeholder` | `placeholder` | (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. | `string` | `''` | -| `required` | `required` | The required flag in order to make an input required prior to submitting a form | `boolean` | `false` | -| `type` | `type` | The input type. Can be any HTML input type. | `"date" \| "email" \| "number" \| "password" \| "search" \| "tel" \| "text" \| "time" \| "url"` | `'text'` | -| `value` | `value` | The value of the content inside of the input field | `string` | `undefined` | - - -## Slots - -| Slot | Description | -| --------- | ------------------------------------------- | -| `"input"` | Content for the input within the form field | - - -## Dependencies - -### Used by - - - [amplify-auth-fields](../amplify-auth-fields) - - [amplify-code-field](../amplify-code-field) - - [amplify-email-field](../amplify-email-field) - - [amplify-password-field](../amplify-password-field) - - [amplify-phone-field](../amplify-phone-field) - - [amplify-totp-setup](../amplify-totp-setup) - - [amplify-username-field](../amplify-username-field) - -### Depends on - -- [amplify-label](../amplify-label) -- [amplify-input](../amplify-input) -- [amplify-hint](../amplify-hint) - -### Graph -```mermaid -graph TD; - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-auth-fields --> amplify-form-field - amplify-code-field --> amplify-form-field - amplify-email-field --> amplify-form-field - amplify-password-field --> amplify-form-field - amplify-phone-field --> amplify-form-field - amplify-totp-setup --> amplify-form-field - amplify-username-field --> amplify-form-field - style amplify-form-field fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-form-section/__snapshots__/amplify-form-section.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-form-section/__snapshots__/amplify-form-section.spec.ts.snap deleted file mode 100644 index 07f4a5f6058..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-section/__snapshots__/amplify-form-section.spec.ts.snap +++ /dev/null @@ -1,88 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-form-section spec: Render logic -> should render a form section with a default button of \`Submit\` 1`] = ` - - -
- -
- -
-

-
-
-
-
-
- - - -
-
-
-
-`; - -exports[`amplify-form-section spec: Render logic -> should render a form section with a submit button text of \`Go\` 1`] = ` - - -
- -
- -
-

-
-
-
-
-
- - - -
-
-
-
-`; - -exports[`amplify-form-section spec: Render logic -> should render form section 1`] = ` - - -
- -
- -
-

-
-
-
-
-
- - - -
-
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.e2e.ts b/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.e2e.ts deleted file mode 100644 index 0a6feb0687b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.e2e.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { newE2EPage, E2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-form-section e2e:', () => { - let page: E2EPage; - - beforeEach(async () => { - page = await newE2EPage(); - await page.setContent(``); - }); - - it('should render amplify-form-section with a button text of `Submit`', async () => { - const el = await page.find('amplify-form-section'); - expect(el).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-form-section', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); - - it('should change `button label` to `Enter`', async () => { - const formSectionEl = await page.find('amplify-form-section'); - expect(formSectionEl).not.toBeNull(); - - formSectionEl.setProperty('button-label', 'Enter'); - - await page.waitForChanges(); - - const buttonLabel = await formSectionEl.getProperty('button-label'); - - expect(buttonLabel).toEqual('Enter'); - }); - - it('should trigger a submit when `Submit` button is clicked', async () => { - const formSectionEl = await page.find('amplify-form-section'); - const mockFunc = jest.fn(); - await page.exposeFunction('exposedFunc', mockFunc); - - await page.$eval('amplify-form-section', (componentElement: any) => { - componentElement.handleSubmit = this.exposedFunc; - }); - await page.waitForChanges(); - - const button = await formSectionEl.find('button'); - expect(mockFunc).not.toHaveBeenCalled(); - - await button.click(); - - expect(mockFunc).toHaveBeenCalledTimes(1); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.scss b/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.scss deleted file mode 100644 index 31c36e902e4..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.scss +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @prop --header-color: Text color within the form header - * @prop --header-size: Text size within the form header - * @prop --subtitle-color: Text color within the subtitle - * @prop --subtitle-size: Text size within the subtitle - * @prop --footer-color: Text color within the footer - * @prop --footer-size: Text size within the footer - * @prop --font-family: Text font family within the footer - * @prop --font-weight: Text weight within the footer - */ -amplify-form-section { - --header-color: var(--amplify-secondary-color); - --header-size: var(--amplify-text-md-sub); - --subtitle-size: var(--amplify-grey); - --subtitle-color: var(--amplify-grey); - --footer-color: var(--amplify-grey); - --footer-size: var(--amplify-text-sm); - --font-family: var(--amplify-font-family); - --font-weight: var(--amplify-font-weight); -} - -.form-section-header { - .header { - color: var(--header-color); - font-size: var(--header-size); - font-weight: 700; - margin-bottom: 0.75rem; - } - .subtitle { - font-weight: 400; - font-size: var(--amplify-text-sm); - color: var(--subtitle-color); - } - margin: 1rem 0 1.5rem 0; -} - -.form-section-footer { - font-family: var(--font-family); - font-weight: var(--font-weight); - font-size: var(--footer-size); - color: var(--footer-color); - display: flex; - flex-direction: column; - justify-content: space-around; - - @include md { - display: flex; - flex-direction: row-reverse; - justify-content: space-between; - align-items: baseline; - } - - * + * { - margin-top: 15px; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.spec.ts b/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.spec.ts deleted file mode 100644 index ae7227edb95..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyFormSection } from './amplify-form-section'; - -describe('amplify-form-section spec:', () => { - describe('Component logic ->', () => { - let formSection; - - beforeEach(() => { - formSection = new AmplifyFormSection(); - }); - - it('should render `Submit` for the button text', () => { - expect(formSection.submitButtonText).toEqual('Submit'); - }); - }); - describe('Render logic ->', () => { - it('should render a form section with a submit button text of `Go`', async () => { - const page = await newSpecPage({ - components: [AmplifyFormSection], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render a form section with a default button of `Submit`', async () => { - const page = await newSpecPage({ - components: [AmplifyFormSection], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render form section', async () => { - const page = await newSpecPage({ - components: [AmplifyFormSection], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.stories.tsx b/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.stories.tsx deleted file mode 100644 index 8db0329b577..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.stories.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { storiesOf } from '@storybook/html'; -import { knobs } from '../../common/testing'; - -const formSectionStories = storiesOf('amplify-form-section', module); - -formSectionStories.add('default', () => { - return ``; -}); - -formSectionStories.add('custom text', () => { - const submitButtonText = knobs.formSectionSubmitKnob('Go'); - const headerText = knobs.formSectionHeaderKnob('Amplify'); - - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.tsx b/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.tsx deleted file mode 100644 index 666087da7bc..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-section/amplify-form-section.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { Component, Prop, h, FunctionalComponent, Listen } from '@stencil/core'; - -/** - * @slot amplify-form-section-header - Content for the header section - * @slot subtitle - Content for the subtitle. This is inside of `amplify-form-section-header`. - * @slot amplify-form-section-footer - Content for the footer section. - */ -@Component({ - tag: 'amplify-form-section', - styleUrl: 'amplify-form-section.scss', -}) -export class AmplifyFormSection { - /** (Required) Function called upon submission of form */ - @Prop() handleSubmit: (event: Event) => void; - /** (Optional) Used as a the default value within the default footer slot */ - @Prop() submitButtonText?: string = 'Submit'; - /** Used for form section header */ - @Prop() headerText: string; - /** String prefix for the data-test attributes in this component primarily used for testing purposes */ - @Prop() testDataPrefix?: string = 'form-section'; - /** Loading state for the form */ - @Prop() loading?: boolean = false; - /** Secondary footer component or text */ - @Prop() secondaryFooterContent: string | FunctionalComponent | null = null; - - // eslint-disable-next-line - @Listen('formSubmit') - handleFormSubmit(ev) { - this.handleSubmit(ev.detail); - } - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( -
- -
- -
-

- {this.headerText} -

-
- -
-
-
-
- - -
- - - -
-
-
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-form-section/readme.md b/packages/amplify-ui-components/src/components/amplify-form-section/readme.md deleted file mode 100644 index 5c62286bd74..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-form-section/readme.md +++ /dev/null @@ -1,85 +0,0 @@ -# amplify-form-section - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------------------ | -------------------------- | ------------------------------------------------------------------------------------------------ | ----------------------------------- | ---------------- | -| `handleSubmit` | -- | (Required) Function called upon submission of form | `(event: Event) => void` | `undefined` | -| `headerText` | `header-text` | Used for form section header | `string` | `undefined` | -| `loading` | `loading` | Loading state for the form | `boolean` | `false` | -| `secondaryFooterContent` | `secondary-footer-content` | Secondary footer component or text | `FunctionalComponent<{}> \| string` | `null` | -| `submitButtonText` | `submit-button-text` | (Optional) Used as a the default value within the default footer slot | `string` | `'Submit'` | -| `testDataPrefix` | `test-data-prefix` | String prefix for the data-test attributes in this component primarily used for testing purposes | `string` | `'form-section'` | - - -## Slots - -| Slot | Description | -| ------------------------------- | -------------------------------------------------------------------------- | -| `"amplify-form-section-footer"` | Content for the footer section. | -| `"amplify-form-section-header"` | Content for the header section | -| `"subtitle"` | Content for the subtitle. This is inside of `amplify-form-section-header`. | - - -## CSS Custom Properties - -| Name | Description | -| ------------------ | ---------------------------------- | -| `--font-family` | Text font family within the footer | -| `--font-weight` | Text weight within the footer | -| `--footer-color` | Text color within the footer | -| `--footer-size` | Text size within the footer | -| `--header-color` | Text color within the form header | -| `--header-size` | Text size within the form header | -| `--subtitle-color` | Text color within the subtitle | -| `--subtitle-size` | Text size within the subtitle | - - -## Dependencies - -### Used by - - - [amplify-confirm-sign-in](../amplify-confirm-sign-in) - - [amplify-confirm-sign-up](../amplify-confirm-sign-up) - - [amplify-federated-sign-in](../amplify-federated-sign-in) - - [amplify-forgot-password](../amplify-forgot-password) - - [amplify-require-new-password](../amplify-require-new-password) - - [amplify-select-mfa-type](../amplify-select-mfa-type) - - [amplify-sign-in](../amplify-sign-in) - - [amplify-sign-up](../amplify-sign-up) - - [amplify-totp-setup](../amplify-totp-setup) - - [amplify-verify-contact](../amplify-verify-contact) - -### Depends on - -- [amplify-section](../amplify-section) -- [amplify-button](../amplify-button) -- [amplify-loading-spinner](../amplify-loading-spinner) - -### Graph -```mermaid -graph TD; - amplify-form-section --> amplify-section - amplify-form-section --> amplify-button - amplify-form-section --> amplify-loading-spinner - amplify-button --> amplify-icon - amplify-loading-spinner --> amplify-icon - amplify-confirm-sign-in --> amplify-form-section - amplify-confirm-sign-up --> amplify-form-section - amplify-federated-sign-in --> amplify-form-section - amplify-forgot-password --> amplify-form-section - amplify-require-new-password --> amplify-form-section - amplify-select-mfa-type --> amplify-form-section - amplify-sign-in --> amplify-form-section - amplify-sign-up --> amplify-form-section - amplify-totp-setup --> amplify-form-section - amplify-verify-contact --> amplify-form-section - style amplify-form-section fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-google-button/__snapshots__/amplify-google-button.spec.tsx.snap b/packages/amplify-ui-components/src/components/amplify-google-button/__snapshots__/amplify-google-button.spec.tsx.snap deleted file mode 100644 index 144fa70419b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-google-button/__snapshots__/amplify-google-button.spec.tsx.snap +++ /dev/null @@ -1,12 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-google-button stories defaults 1`] = ` - - - - - Sign in with Google - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-google-button/amplify-google-button.spec.tsx b/packages/amplify-ui-components/src/components/amplify-google-button/amplify-google-button.spec.tsx deleted file mode 100644 index 701f1551af4..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-google-button/amplify-google-button.spec.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; - -import { AmplifyGoogleButton } from './amplify-google-button'; -import * as stories from './amplify-google-button.stories'; - -const { - default: { title }, - ...specs -} = stories; - -const components = [AmplifyGoogleButton]; - -describe(title, () => { - describe('stories', () => { - Object.entries(specs).forEach(([name, spec]) => { - it(name, async () => { - const page = await newSpecPage({ components, html: spec() }); - - expect(page.root).toMatchSnapshot(); - }); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-google-button/amplify-google-button.stories.tsx b/packages/amplify-ui-components/src/components/amplify-google-button/amplify-google-button.stories.tsx deleted file mode 100644 index 8bf2cb77c66..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-google-button/amplify-google-button.stories.tsx +++ /dev/null @@ -1,5 +0,0 @@ -export default { - title: 'amplify-google-button', -}; - -export const defaults = () => ``; diff --git a/packages/amplify-ui-components/src/components/amplify-google-button/amplify-google-button.tsx b/packages/amplify-ui-components/src/components/amplify-google-button/amplify-google-button.tsx deleted file mode 100644 index 2784b102142..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-google-button/amplify-google-button.tsx +++ /dev/null @@ -1,123 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { I18n, ConsoleLogger as Logger } from '@aws-amplify/core'; -import { Component, h, Prop } from '@stencil/core'; -import { dispatchAuthStateChangeEvent } from '../../common/helpers'; -import { AUTH_SOURCE_KEY, NO_AUTH_MODULE_FOUND } from '../../common/constants'; -import { Translations } from '../../common/Translations'; -import { - AuthState, - FederatedConfig, - AuthStateHandler, -} from '../../common/types/auth-types'; - -const logger = new Logger('amplify-google-button'); - -@Component({ - tag: 'amplify-google-button', - shadow: true, -}) -export class AmplifyGoogleButton { - /** Auth state change handler for this component - * e.g. SignIn -> 'Create Account' link -> SignUp - */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - /** App-specific client ID from Google */ - @Prop() clientId: FederatedConfig['googleClientId']; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - private getAuthInstance() { - if (window['gapi'] && window['gapi'].auth2) { - return ( - window['gapi'].auth2.getAuthInstance() || - window['gapi'].auth2.init({ - client_id: this.clientId, - cookiepolicy: 'single_host_origin', - scope: 'profile email openid', - }) - ); - } - - return null; - } - - private signInWithGoogle(event) { - event.preventDefault(); - - this.getAuthInstance() - .signIn() - .then(this.handleUser) - .catch(this.handleError); - } - - private handleError = error => { - console.error(error); - }; - - /** - * @see https://developers.google.com/identity/sign-in/web/build-button#building_a_button_with_a_custom_graphic - */ - private handleLoad = () => { - window['gapi'].load('auth2'); - }; - - private handleUser = async user => { - if ( - !Auth || - typeof Auth.federatedSignIn !== 'function' || - typeof Auth.currentAuthenticatedUser !== 'function' - ) { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - try { - window.localStorage.setItem( - AUTH_SOURCE_KEY, - JSON.stringify({ provider: 'google' }) - ); - } catch (e) { - logger.debug('Failed to cache auth source into localStorage', e); - } - - const { id_token, expires_at } = user.getAuthResponse(); - const profile = user.getBasicProfile(); - - await Auth.federatedSignIn( - 'google', - { token: id_token, expires_at }, - { - email: profile.getEmail(), - name: profile.getName(), - picture: profile.getImageUrl(), - } - ); - - const authenticatedUser = await Auth.currentAuthenticatedUser(); - - try { - this.handleAuthStateChange(AuthState.SignedIn, authenticatedUser); - } catch (error) { - this.handleError(error); - } - }; - - render() { - return ( - this.signInWithGoogle(event)} - provider="google" - > - - {I18n.get(Translations.SIGN_IN_WITH_GOOGLE)} - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-google-button/readme.md b/packages/amplify-ui-components/src/components/amplify-google-button/readme.md deleted file mode 100644 index 14caa2bcb61..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-google-button/readme.md +++ /dev/null @@ -1,35 +0,0 @@ -# amplify-google-button - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | ----------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------- | ------------------------------ | -| `clientId` | `client-id` | App-specific client ID from Google | `string` | `undefined` | -| `handleAuthStateChange` | -- | Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | - - -## Dependencies - -### Used by - - - [amplify-federated-buttons](../amplify-federated-buttons) - -### Depends on - -- [amplify-sign-in-button](../amplify-sign-in-button) - -### Graph -```mermaid -graph TD; - amplify-google-button --> amplify-sign-in-button - amplify-sign-in-button --> amplify-icon - amplify-federated-buttons --> amplify-google-button - style amplify-google-button fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-greetings/__snapshots__/amplify-greetings.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-greetings/__snapshots__/amplify-greetings.spec.ts.snap deleted file mode 100644 index 8253e470976..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-greetings/__snapshots__/amplify-greetings.spec.ts.snap +++ /dev/null @@ -1,20 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-greetings spec: Render logic -> should render 1`] = ` - - -
- - - - - - - - -
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-greetings/amplify-greetings.scss b/packages/amplify-ui-components/src/components/amplify-greetings/amplify-greetings.scss deleted file mode 100644 index d0e60a873eb..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-greetings/amplify-greetings.scss +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @prop --background-color: Background color of the container - * @prop --border-color: Border color of the container - * @prop --font-family: Font family of the text - */ -:host { - --background-color: var(--amplify-white); - --border-color: var(--amplify-light-grey); - --font-family: var(--amplify-font-family); -} - -.greetings { - display: flex; - border: 1px solid transparent; - background-color: var(--background-color); - border-color: var(--border-color); - padding: 0.625rem; - font-family: var(--font-family); - justify-content: space-between; -} - -.nav { - display: flex; - align-self: center; -} - -.logo { - display: flex; - align-self: center; - justify-self: flex-start; -} - -amplify-sign-out { - margin-left: 1rem; -} diff --git a/packages/amplify-ui-components/src/components/amplify-greetings/amplify-greetings.spec.ts b/packages/amplify-ui-components/src/components/amplify-greetings/amplify-greetings.spec.ts deleted file mode 100644 index 64595a7b84d..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-greetings/amplify-greetings.spec.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyGreetings } from './amplify-greetings'; - -describe('amplify-greetings spec:', () => { - describe('Component logic ->', () => { - let greetings; - - beforeEach(() => { - greetings = new AmplifyGreetings(); - }); - - it('should have username prop set to null by default', () => { - expect(greetings.username).toBe(null); - }); - - it('should have logo prop set to null by default', () => { - expect(greetings.logo).toBe(null); - }); - }); - describe('Render logic ->', () => { - it('should render', async () => { - const page = await newSpecPage({ - components: [AmplifyGreetings], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-greetings/amplify-greetings.stories.tsx b/packages/amplify-ui-components/src/components/amplify-greetings/amplify-greetings.stories.tsx deleted file mode 100644 index 4f4817822e3..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-greetings/amplify-greetings.stories.tsx +++ /dev/null @@ -1,5 +0,0 @@ -export default { - title: 'amplify-greetings', -}; - -export const defaults = () => ``; diff --git a/packages/amplify-ui-components/src/components/amplify-greetings/amplify-greetings.tsx b/packages/amplify-ui-components/src/components/amplify-greetings/amplify-greetings.tsx deleted file mode 100644 index 14c338a8252..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-greetings/amplify-greetings.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { Component, h, Prop, FunctionalComponent } from '@stencil/core'; -import { AuthStateHandler } from '../../common/types/auth-types'; -import { dispatchAuthStateChangeEvent } from '../../common/helpers'; - -/** - * @slot logo - Left-justified content placed at the start of the greetings bar - * @slot nav - Right-justified content placed at the end of the greetings bar - * @slot greetings-message - Content placed in the greetings text - */ -@Component({ - tag: 'amplify-greetings', - styleUrl: 'amplify-greetings.scss', - shadow: true, -}) -export class AmplifyGreetings { - /** Username displayed in the greetings */ - @Prop() username: string = null; - /** Logo displayed inside of the header */ - @Prop() logo: FunctionalComponent | null = null; - /** Auth state change handler for this component */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( -
- - - - - {this.username && ( - - Hello, {this.username} - - )} - - - - -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-greetings/readme.md b/packages/amplify-ui-components/src/components/amplify-greetings/readme.md deleted file mode 100644 index ee0c38fdb0a..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-greetings/readme.md +++ /dev/null @@ -1,54 +0,0 @@ -# amplify-greetings - - - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | ---------- | -------------------------------------------- | --------------------------------------------------- | ------------------------------ | -| `handleAuthStateChange` | -- | Auth state change handler for this component | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | -| `logo` | -- | Logo displayed inside of the header | `FunctionalComponent<{}>` | `null` | -| `username` | `username` | Username displayed in the greetings | `string` | `null` | - - -## Slots - -| Slot | Description | -| --------------------- | --------------------------------------------------------------- | -| `"greetings-message"` | Content placed in the greetings text | -| `"logo"` | Left-justified content placed at the start of the greetings bar | -| `"nav"` | Right-justified content placed at the end of the greetings bar | - - -## CSS Custom Properties - -| Name | Description | -| -------------------- | --------------------------------- | -| `--background-color` | Background color of the container | -| `--border-color` | Border color of the container | -| `--font-family` | Font family of the text | - - -## Dependencies - -### Depends on - -- [amplify-nav](../amplify-nav) -- [amplify-sign-out](../amplify-sign-out) - -### Graph -```mermaid -graph TD; - amplify-greetings --> amplify-nav - amplify-greetings --> amplify-sign-out - amplify-sign-out --> amplify-button - amplify-button --> amplify-icon - style amplify-greetings fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-hint/__snapshots__/amplify-hint.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-hint/__snapshots__/amplify-hint.spec.ts.snap deleted file mode 100644 index 7c443d8f46f..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-hint/__snapshots__/amplify-hint.spec.ts.snap +++ /dev/null @@ -1,22 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-hint spec: Render logic -> renders with hint text FOO 1`] = ` - - -
- -
-
- FOO -
-`; - -exports[`amplify-hint spec: Render logic -> renders with no hint text 1`] = ` - - -
- -
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.e2e.ts b/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.e2e.ts deleted file mode 100644 index 7a149b6f7b2..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.e2e.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { E2EPage, newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-hint e2e:', () => { - let page: E2EPage; - - beforeEach(async () => { - page = await newE2EPage(); - await page.setContent('This is a hint'); - }); - - it('renders with text `This is a hint`', async () => { - const element = await page.find('amplify-hint'); - expect(element).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-hint', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.scss b/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.scss deleted file mode 100644 index 391da16205c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.scss +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @prop --color: Color of the text - * @prop --font-family: Font family of the text - * @prop --font-size: Font size of the text - * @prop --font-weight: Font weight of the text - */ -:host { - --color: var(--amplify-grey); - --font-family: var(--amplify-font-family); - --font-size: var(--amplify-text-xs); - --font-weight: var(--amplify-font-weight); -} - -.hint { - color: var(--color); - font-family: var(--font-family); - font-weight: var(--font-weight); - font-size: var(--font-size); - margin-bottom: 2.625rem; -} diff --git a/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.spec.ts b/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.spec.ts deleted file mode 100644 index cf4c7eeb31a..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyHint } from './amplify-hint'; - -describe('amplify-hint spec:', () => { - describe('Render logic ->', () => { - it('renders with no hint text', async () => { - const page = await newSpecPage({ - components: [AmplifyHint], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - it('renders with hint text FOO', async () => { - const page = await newSpecPage({ - components: [AmplifyHint], - html: `FOO`, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.stories.tsx b/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.stories.tsx deleted file mode 100644 index 3299d9f8bbb..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.stories.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { storiesOf } from '@storybook/html'; -import { knobs } from '../../common/testing'; - -const hintStories = storiesOf('amplify-hint', module); - -hintStories.add('with text', () => { - const text = knobs.hintKnob('Hint placeholder'); - return `${text}`; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.tsx b/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.tsx deleted file mode 100644 index df0c88cdd06..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-hint/amplify-hint.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Component, h } from '@stencil/core'; - -/** - * @slot (default) - Content for the hint - */ -@Component({ - tag: 'amplify-hint', - styleUrl: 'amplify-hint.scss', - shadow: true, -}) -export class AmplifyHint { - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( -
- -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-hint/readme.md b/packages/amplify-ui-components/src/components/amplify-hint/readme.md deleted file mode 100644 index 2e98af315af..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-hint/readme.md +++ /dev/null @@ -1,40 +0,0 @@ -# amplify-hint - - - - - - -## Slots - -| Slot | Description | -| ------------- | -------------------- | -| `"(default)"` | Content for the hint | - - -## CSS Custom Properties - -| Name | Description | -| --------------- | ----------------------- | -| `--color` | Color of the text | -| `--font-family` | Font family of the text | -| `--font-size` | Font size of the text | -| `--font-weight` | Font weight of the text | - - -## Dependencies - -### Used by - - - [amplify-form-field](../amplify-form-field) - -### Graph -```mermaid -graph TD; - amplify-form-field --> amplify-hint - style amplify-hint fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-icon-button/__snapshots__/amplify-icon-button.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-icon-button/__snapshots__/amplify-icon-button.spec.ts.snap deleted file mode 100644 index 377e91ef6c2..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon-button/__snapshots__/amplify-icon-button.spec.ts.snap +++ /dev/null @@ -1,225 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-icon-button spec: Render logic -> renders amazon icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders auth0 icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders ban icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders enter-vr icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders exit-vr icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders facebook icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders google icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders loading icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders maximize icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders microphone icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders minimize icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders photoPlaceholder icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders send icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders sound icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders sound-mute icon button correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon-button spec: Render logic -> renders warning icon button correctly 1`] = ` - - - - - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.e2e.ts b/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.e2e.ts deleted file mode 100644 index 99c691adecb..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.e2e.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; -import { icons } from '../amplify-icon/icons'; - -/** Helper functions */ -async function matchIcon(iconName: string) { - const page = await newE2EPage(); - - await page.setContent(``); - const screenshot = await page.compareScreenshot('Amplify Icon Button', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - - const iconButtonElement = await page.find('amplify-icon-button'); - expect(iconButtonElement).not.toBeNull(); -} - -/** Tests */ -describe('amplify-icon-button e2e:', () => { - Object.keys(icons).map(name => { - it(`renders with the ${name} icon`, async () => matchIcon(name)); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.scss b/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.scss deleted file mode 100644 index 7ad9a8d1468..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.scss +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @prop --button-color: Text color of the button - * @prop --button-background-hover: Background color of the button when it's hovered - */ -:host { - --button-color: var(--amplify-secondary-contrast); - --button-background-hover: var(--amplify-secondary-color); -} - -.action-button { - button { - position: relative; - padding: 0; - background: none; - height: 54px; - width: 54px; - cursor: pointer; - outline: none; - text-decoration: none; - border: none; - border-radius: 30px; - transition: all 0.3s ease-in-out; - color: var(--button-color); - fill: currentColor; - - &:hover { - background-color: var(--button-background-hover); - box-shadow: 0.3px 0.3px 0.3px rgba(0, 0, 0, 0.3); - } - - &:hover > .tooltip { - display: block; - } - - &:hover > svg { - -webkit-filter: none; - filter: none; - } - - &:focus { - outline: none; - } - - & svg { - width: 1.8em; - height: 1.8em; - -webkit-filter: drop-shadow(1px 1px 1px var(--amplify-grey)); - filter: drop-shadow(1px 1px 1px var(--amplify-grey)); - } - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.spec.ts b/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.spec.ts deleted file mode 100644 index 2e681d54f74..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyIconButton } from './amplify-icon-button'; -import { icons } from '../amplify-icon/icons'; - -/** Helper functions */ -async function snapshotTestIconButton(iconName: string) { - const page = await newSpecPage({ - components: [AmplifyIconButton], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); -} - -describe('amplify-icon-button spec:', () => { - describe('Render logic ->', () => { - Object.keys(icons).map(name => { - it(`renders ${name} icon button correctly`, async () => - snapshotTestIconButton(name)); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.stories.tsx b/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.stories.tsx deleted file mode 100644 index d81bd69584c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.stories.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { storiesOf } from '@storybook/html'; -import { select } from '@storybook/addon-knobs'; -import { icons } from '../amplify-icon/icons'; - -const buttonStories = storiesOf('amplify-icon-button', module); - -buttonStories.add('with sound icon', () => { - const label = 'Icon Name'; - const iconNames = Object.keys(icons); - const defaultValue = 'sound'; - - const name = select(label, iconNames, defaultValue); - - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.tsx b/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.tsx deleted file mode 100644 index 79a3be587b9..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon-button/amplify-icon-button.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Component, Prop, h } from '@stencil/core'; -import { IconNameType } from '../amplify-icon/icons'; - -@Component({ - tag: 'amplify-icon-button', - styleUrl: 'amplify-icon-button.scss', - shadow: true, -}) -export class AmplifyIconButton { - /** The name of the icon used inside of the button */ - @Prop() name: IconNameType; - /** (Optional) The tooltip that will show on hover of the button */ - @Prop() tooltip: string | null = null; - /** (Optional) Whether or not to show the tooltip automatically */ - @Prop() autoShowTooltip: boolean = false; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - - - - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-icon-button/readme.md b/packages/amplify-ui-components/src/components/amplify-icon-button/readme.md deleted file mode 100644 index 7eb3c378830..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon-button/readme.md +++ /dev/null @@ -1,40 +0,0 @@ -# amplify-icon-button - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------- | ------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -| `autoShowTooltip` | `auto-show-tooltip` | (Optional) Whether or not to show the tooltip automatically | `boolean` | `false` | -| `name` | `name` | The name of the icon used inside of the button | `"amazon" \| "auth0" \| "ban" \| "enter-vr" \| "exit-vr" \| "facebook" \| "google" \| "loading" \| "maximize" \| "microphone" \| "minimize" \| "photoPlaceholder" \| "send" \| "sound" \| "sound-mute" \| "warning"` | `undefined` | -| `tooltip` | `tooltip` | (Optional) The tooltip that will show on hover of the button | `string` | `null` | - - -## CSS Custom Properties - -| Name | Description | -| --------------------------- | ------------------------------------------------ | -| `--button-background-hover` | Background color of the button when it's hovered | -| `--button-color` | Text color of the button | - - -## Dependencies - -### Depends on - -- [amplify-tooltip](../amplify-tooltip) -- [amplify-icon](../amplify-icon) - -### Graph -```mermaid -graph TD; - amplify-icon-button --> amplify-tooltip - amplify-icon-button --> amplify-icon - style amplify-icon-button fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-icon/__snapshots__/amplify-icon.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-icon/__snapshots__/amplify-icon.spec.ts.snap deleted file mode 100644 index d64b1e08809..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon/__snapshots__/amplify-icon.spec.ts.snap +++ /dev/null @@ -1,167 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-icon spec: Render logic -> renders amazon correctly 1`] = ` - - - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders auth0 correctly 1`] = ` - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders ban correctly 1`] = ` - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders enter-vr correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders exit-vr correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders facebook correctly 1`] = ` - - - - - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders google correctly 1`] = ` - - - - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders loading correctly 1`] = ` - - - - - - - - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders maximize correctly 1`] = ` - - - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders microphone correctly 1`] = ` - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders minimize correctly 1`] = ` - - - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders photoPlaceholder correctly 1`] = ` - - - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders send correctly 1`] = ` - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders sound correctly 1`] = ` - - - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders sound-mute correctly 1`] = ` - - - - - - - -`; - -exports[`amplify-icon spec: Render logic -> renders warning correctly 1`] = ` - - - - - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.e2e.ts b/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.e2e.ts deleted file mode 100644 index 7eac7f79e6b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.e2e.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; -import { icons } from './icons'; - -/** Helper functions */ -async function matchIcon(iconName: string) { - const page = await newE2EPage(); - - await page.setContent(``); - const screenshot = await page.compareScreenshot('Amplify icon', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - - const iconElement = await page.find('amplify-icon'); - expect(iconElement).not.toBeNull(); -} - -/** Tests */ -describe('amplify-icon e2e:', () => { - Object.keys(icons).map(name => { - it(`renders with the ${name} icon`, async () => matchIcon(name)); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.scss b/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.scss deleted file mode 100644 index 080c21ddcc7..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.scss +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @prop --width: Width of the icon - * @prop --height: Height of the icon - * @prop --icon-fill-color: Fill color of the icon - */ -:host { - --width: auto; - --height: auto; - --icon-fill-color: var(--amplify-white); -} - -svg { - fill: var(--icon-fill-color); - width: var(--width); - height: var(--height); -} diff --git a/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.spec.ts b/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.spec.ts deleted file mode 100644 index 5f6c11ac984..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyIcon } from './amplify-icon'; -import { icons } from './icons'; - -/** Helper functions */ -async function snapshotTestIcon(iconName: string) { - const page = await newSpecPage({ - components: [AmplifyIcon], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); -} - -/** Tests */ -describe('amplify-icon spec:', () => { - describe('Render logic ->', () => { - Object.keys(icons).map(name => { - it(`renders ${name} correctly`, async () => snapshotTestIcon(name)); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.stories.tsx b/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.stories.tsx deleted file mode 100644 index 96e3b19f4fb..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.stories.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { storiesOf } from '@storybook/html'; -import { select } from '@storybook/addon-knobs'; -import { icons } from './icons'; - -const amplifyIcon = storiesOf('amplify-icon', module); - -amplifyIcon.add('with icon', () => { - const label = 'Icon Name'; - const iconNames = Object.keys(icons); - const defaultValue = 'sound-mute'; - - const name = select(label, iconNames, defaultValue); - - return ``; -}); - -amplifyIcon.add('with two icons', () => { - const label = 'Icon Name'; - const iconNames = Object.keys(icons); - const defaultValue = 'sound-mute'; - - const name1 = select(label, iconNames, defaultValue); - const name2 = select('test', ['sound-mute', 'sound'], 'sound'); - - return `
`; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.tsx b/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.tsx deleted file mode 100644 index 579d2e700d1..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon/amplify-icon.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { Component, Prop, Watch } from '@stencil/core'; -import { icons, IconNameType } from './icons'; - -@Component({ - tag: 'amplify-icon', - styleUrl: 'amplify-icon.scss', - scoped: true, -}) -export class AmplifyIcon { - /** (Required) Name of icon used to determine the icon rendered */ - @Prop() name: IconNameType; - - @Watch('name') - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - validateName(newValue: string) { - const isBlank = typeof newValue == null; - if (isBlank) { - throw new Error('name: required'); - } - } - - // https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes - render() { - return icons[this.name](); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-icon/icons.tsx b/packages/amplify-ui-components/src/components/amplify-icon/icons.tsx deleted file mode 100644 index 3e6884b1a8e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon/icons.tsx +++ /dev/null @@ -1,288 +0,0 @@ -import { h } from '@stencil/core'; - -export const icons = { - amazon() { - return ( - - - - - - ); - }, - auth0() { - return ( - - - - ); - }, - facebook() { - return ( - - - - - - - - ); - }, - google() { - return ( - - - - - - - ); - }, - 'sound-mute'() { - return ( - - - - - - ); - }, - sound() { - return ( - - - - - - ); - }, - maximize() { - return ( - - - - - - ); - }, - minimize() { - return ( - - - - - - ); - }, - 'enter-vr'() { - return ( - - - - - - - - ); - }, - 'exit-vr'() { - return ( - - - - - - - - ); - }, - warning() { - return ( - - - - - - - - ); - }, - loading() { - return ( - - - - - - - - - - - ); - }, - photoPlaceholder() { - return ( - - - - - - ); - }, - - microphone() { - return ( - - - - ); - }, - - send() { - return ( - - - - ); - }, - - ban() { - return ( - - - - ); - }, -}; - -export type IconNameType = keyof typeof icons; diff --git a/packages/amplify-ui-components/src/components/amplify-icon/readme.md b/packages/amplify-ui-components/src/components/amplify-icon/readme.md deleted file mode 100644 index e81c731b4df..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-icon/readme.md +++ /dev/null @@ -1,47 +0,0 @@ -# amplify-icon - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| -------- | --------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -| `name` | `name` | (Required) Name of icon used to determine the icon rendered | `"amazon" \| "auth0" \| "ban" \| "enter-vr" \| "exit-vr" \| "facebook" \| "google" \| "loading" \| "maximize" \| "microphone" \| "minimize" \| "photoPlaceholder" \| "send" \| "sound" \| "sound-mute" \| "warning"` | `undefined` | - - -## CSS Custom Properties - -| Name | Description | -| ------------------- | ---------------------- | -| `--height` | Height of the icon | -| `--icon-fill-color` | Fill color of the icon | -| `--width` | Width of the icon | - - -## Dependencies - -### Used by - - - [amplify-button](../amplify-button) - - [amplify-icon-button](../amplify-icon-button) - - [amplify-loading-spinner](../amplify-loading-spinner) - - [amplify-photo-picker](../amplify-photo-picker) - - [amplify-sign-in-button](../amplify-sign-in-button) - - [amplify-toast](../amplify-toast) - -### Graph -```mermaid -graph TD; - amplify-button --> amplify-icon - amplify-icon-button --> amplify-icon - amplify-loading-spinner --> amplify-icon - amplify-photo-picker --> amplify-icon - amplify-sign-in-button --> amplify-icon - amplify-toast --> amplify-icon - style amplify-icon fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-input/__snapshots__/amplify-input.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-input/__snapshots__/amplify-input.spec.ts.snap deleted file mode 100644 index 4594482b1c7..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-input/__snapshots__/amplify-input.spec.ts.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-input spec: Render logic -> renders correct HTML 1`] = ` - - - -`; - -exports[`amplify-input spec: Render logic -> renders with a name for the input 1`] = ` - - - -`; - -exports[`amplify-input spec: Render logic -> renders with complex prop: inputProps spread on the input element 1`] = ` - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-input/amplify-input.e2e.ts b/packages/amplify-ui-components/src/components/amplify-input/amplify-input.e2e.ts deleted file mode 100644 index 5013bbda7b6..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-input/amplify-input.e2e.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-input e2e:', () => { - it('renders with placeholder', async () => { - const page = await newE2EPage(); - - await page.setContent( - `` - ); - const screenshot = await page.compareScreenshot('Amplify Input', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - - const inputElement = await page.find('amplify-input'); - expect(inputElement).not.toBeNull(); - }); - - it('fires an onInputChange event when the contents of the box are changed', async () => { - const page = await newE2EPage(); - - await page.setContent(``); - - const func = jest.fn(); - await page.exposeFunction('exposedfunc', func); - - await page.$eval('amplify-input', (inputElement: any) => { - inputElement.handleInputChange = this.exposedfunc; - inputElement.label = 'adding a label so that the component rerenders'; - }); - await page.waitForChanges(); - - const input = await page.find('input'); - await input.press('8'); - await input.press('a'); - await input.press('$'); - expect(func).toBeCalledTimes(3); - expect(func.mock.calls[0][0].isTrusted).toBe(true); - const value = await input.getProperty('value'); - expect(value).toBe('8a$'); - }); - - it('prevents adding text to a numeric input', async () => { - const page = await newE2EPage(); - - await page.setContent(``); - - const func = jest.fn(); - await page.exposeFunction('exposedfunc', func); - - await page.$eval('amplify-input', (inputElement: any) => { - inputElement.handleInputChange = this.exposedfunc; - inputElement.label = 'adding a label so that the component rerenders'; - }); - await page.waitForChanges(); - - const input = await page.find('input'); - await input.press('8'); - await input.press('a'); - await input.press('$'); - expect(func).toBeCalledTimes(1); - expect(func.mock.calls[0][0].isTrusted).toBe(true); - const value = await input.getProperty('value'); - expect(value).toBe('8'); - }); - - it('can have a checkbox input', async () => { - const page = await newE2EPage(); - - await page.setContent(``); - await page.waitForChanges(); - - const input = await page.find('input'); - expect(input).toEqualAttribute('type', 'checkbox'); - }); - - it('can have a number input', async () => { - const page = await newE2EPage(); - - await page.setContent(``); - await page.waitForChanges(); - - const input = await page.find('input'); - expect(input).toEqualAttribute('type', 'number'); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-input/amplify-input.scss b/packages/amplify-ui-components/src/components/amplify-input/amplify-input.scss deleted file mode 100644 index 25255ae4b2b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-input/amplify-input.scss +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @prop --color: Text color within the input - * @prop --background-color: Background color of the input - * @prop --border-color: Border color of the input - * @prop --border-color-focus: Border color of the input when focused on - * @prop --margin: Margin around the input - */ -amplify-input { - --color: var(--amplify-secondary-color); - --background-color: var(--amplify-secondary-contrast); - --border-color: var(--amplify-light-grey); - --border-color-focus: var(--amplify-primary-color); - --border: 1px solid var(--border-color); - --margin: 0 0 0.625rem 0; -} - -[data-autocompleted] { - background-color: rgb(232, 240, 254) !important; -} - -.input-host { - width: 100%; -} - -.input { - display: block; - width: 100%; - padding: 1rem; - font-size: var(--amplify-text-sm); - color: var(--color); - background-color: var(--background-color); - background-image: none; - border: var(--border); - border-radius: 3px; - box-sizing: border-box; - margin: var(--margin); - height: 3.125rem; - line-height: 1.1; - box-shadow: none; // to disable red outline when input is empty on firefox - - &:focus { - outline: none; - border-color: var(--border-color-focus); - } - - &:disabled { - opacity: 0.5; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-input/amplify-input.spec.ts b/packages/amplify-ui-components/src/components/amplify-input/amplify-input.spec.ts deleted file mode 100644 index 1f6ed2946ee..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-input/amplify-input.spec.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyInput } from './amplify-input'; - -describe('amplify-input spec:', () => { - describe('Render logic ->', () => { - it('renders correct HTML', async () => { - const page = await newSpecPage({ - components: [AmplifyInput], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('renders with a name for the input', async () => { - const page = await newSpecPage({ - components: [AmplifyInput], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('renders with complex prop: inputProps spread on the input element', async () => { - const page = await newSpecPage({ - components: [AmplifyInput], - html: `
`, - }); - - const cmp = page.doc.createElement('amplify-input'); - (cmp as any).inputProps = { - autocomplete: 'off', - min: '3', - max: '10', - }; - page.root.appendChild(cmp); - await page.waitForChanges(); - expect(page.root).toMatchSnapshot(); - }); - }); - describe('Component logic ->', () => { - let input; - - beforeEach(() => { - input = new AmplifyInput(); - }); - - it('should have `name` set to undefined by default', () => { - expect(input.name).toBeUndefined(); - }); - - it('should have `description` set to undefined by default', () => { - expect(input.description).toBeUndefined(); - }); - - it('should have `placeholder` set to an empty string by default', () => { - expect(input.placeholder).toEqual(''); - }); - - it('should have `type` set to `text` by default', () => { - expect(input.type).toEqual('text'); - }); - - it('should have `required` set to `false` by default', () => { - expect(input.required).toBe(false); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-input/amplify-input.tsx b/packages/amplify-ui-components/src/components/amplify-input/amplify-input.tsx deleted file mode 100644 index 9ad8ebd24f4..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-input/amplify-input.tsx +++ /dev/null @@ -1,147 +0,0 @@ -import { Component, Prop, Host, h, Element, State } from '@stencil/core'; -import { closestElement, onAuthUIStateChange } from '../../common/helpers'; -import { TextFieldTypes, InputEvent } from '../../common/types/ui-types'; - -@Component({ - tag: 'amplify-input', - styleUrl: 'amplify-input.scss', -}) -export class AmplifyInput { - /** The ID of the field. Should match with its corresponding input's ID. */ - @Prop() fieldId: string; - /** The text of the description. Goes just below the label. */ - @Prop() description: string | null; - /** The input type. Can be any HTML input type. */ - @Prop() type?: TextFieldTypes = 'text'; - /** The callback, called when the input is modified by the user. */ - @Prop() handleInputChange?: (inputEvent: InputEvent) => void = () => void 0; - /** (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. */ - @Prop() placeholder?: string = ''; - /** (Optional) String value for the name of the input. */ - @Prop() name?: string; - /** The value of the content inside of the input field */ - @Prop() value: string; - /** Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes */ - @Prop() inputProps?: object; - /** Will disable the input if set to true */ - @Prop() disabled?: boolean; - /** Whether the input is a required field */ - @Prop() required?: boolean = false; - /** Whether the input has been autocompleted */ - @State() autoCompleted = false; - private removeHubListener: () => void; - - @Element() el: HTMLAmplifyInputElement; - - /** - * Sets the value of this input to the value in autofill input event. - */ - private setAutoCompleteValue(value: string) { - const input = this.el.querySelector('input'); - if (!input) return; - input.value = value; - // dispatch an input event from this element to the parent form - input.dispatchEvent(new Event('input')); - this.autoCompleted = true; - } - - /** - * Checks if the target dummy input in `amplify-auth-container` is present have been autofilled. - * If so, we update this.value with the autofilled value. - */ - private checkAutoCompletion(targetInput: HTMLInputElement) { - if (!targetInput) return; - if (targetInput.value) { - // if value is already set, we set the value directly - this.setAutoCompleteValue(targetInput.value); - } else { - // if value is not set, we start listening for it - targetInput.addEventListener('input', e => { - const value = (e.target as HTMLInputElement).value; - this.setAutoCompleteValue(value); - }); - } - } - - disconnectedCallback() { - this.removeHubListener && this.removeHubListener(); // stop listening to `onAuthUIStateChange` - } - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - // the below behaviors are only applicable if `amplify-input` is used by `amplify-authenticator`. - if (!closestElement('amplify-authenticator', this.el)) return; - - this.removeHubListener = onAuthUIStateChange(() => { - /** - * When we're using slots, autofilled data will persist between different authState, - * even though input events are not triggered. This ends up in parent components - * not picking up input values. For now, we're emptying the input on authState change - * which is the existing behavior. - */ - const input = this.el.querySelector('input'); - if (input) input.value = ''; - this.autoCompleted = false; - }); - } - - componentDidLoad() { - // no-op if this field already has been autofilled or already has an value - if (this.autoCompleted || this.value) return; - - if (/Firefox/.test(navigator.userAgent)) return; // firefox autofill works - const container = closestElement('amplify-auth-container', this.el); - const signIn = closestElement('amplify-sign-in', this.el); - - // only autocomplete if `amplify-auth-container` is present and input is under `sign-in`. - if (!container || !signIn) return; - - const username: HTMLInputElement = container.querySelector( - "input[name='username']" - ); - const password: HTMLInputElement = container.querySelector( - "input[name='password']" - ); - - if ( - this.name === 'username' || - this.name === 'email' || - this.name === 'phone' - ) { - this.checkAutoCompletion(username); - } else if (this.name === 'password') { - this.checkAutoCompletion(password); - } - } - - render() { - return ( - - { - this.autoCompleted = false; - this.handleInputChange(event); - }} - placeholder={this.placeholder} - name={this.name} - class="input" - value={this.value} - disabled={this.disabled} - required={this.required} - {...this.inputProps} - /> - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-input/readme.md b/packages/amplify-ui-components/src/components/amplify-input/readme.md deleted file mode 100644 index 47240de6c0c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-input/readme.md +++ /dev/null @@ -1,54 +0,0 @@ -# amplify-input - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -------------- | -| `description` | `description` | The text of the description. Goes just below the label. | `string` | `undefined` | -| `disabled` | `disabled` | Will disable the input if set to true | `boolean` | `undefined` | -| `fieldId` | `field-id` | The ID of the field. Should match with its corresponding input's ID. | `string` | `undefined` | -| `handleInputChange` | -- | The callback, called when the input is modified by the user. | `(inputEvent: InputEvent) => void` | `() => void 0` | -| `inputProps` | -- | Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes | `object` | `undefined` | -| `name` | `name` | (Optional) String value for the name of the input. | `string` | `undefined` | -| `placeholder` | `placeholder` | (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. | `string` | `''` | -| `required` | `required` | Whether the input is a required field | `boolean` | `false` | -| `type` | `type` | The input type. Can be any HTML input type. | `"date" \| "email" \| "number" \| "password" \| "search" \| "tel" \| "text" \| "time" \| "url"` | `'text'` | -| `value` | `value` | The value of the content inside of the input field | `string` | `undefined` | - - -## CSS Custom Properties - -| Name | Description | -| ---------------------- | ----------------------------------------- | -| `--background-color` | Background color of the input | -| `--border-color` | Border color of the input | -| `--border-color-focus` | Border color of the input when focused on | -| `--color` | Text color within the input | -| `--margin` | Margin around the input | - - -## Dependencies - -### Used by - - - [amplify-chatbot](../amplify-chatbot) - - [amplify-form-field](../amplify-form-field) - - [amplify-phone-field](../amplify-phone-field) - - [amplify-verify-contact](../amplify-verify-contact) - -### Graph -```mermaid -graph TD; - amplify-chatbot --> amplify-input - amplify-form-field --> amplify-input - amplify-phone-field --> amplify-input - amplify-verify-contact --> amplify-input - style amplify-input fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-label/__snapshots__/amplify-label.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-label/__snapshots__/amplify-label.spec.ts.snap deleted file mode 100644 index 1f83c0fbe49..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-label/__snapshots__/amplify-label.spec.ts.snap +++ /dev/null @@ -1,15 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-label spec: Render logic -> should render a label by default 1`] = ` - - - - -`; - -exports[`amplify-label spec: Render logic -> should render only class \`amplify-ui--label\` 1`] = ` - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-label/amplify-label.e2e.ts b/packages/amplify-ui-components/src/components/amplify-label/amplify-label.e2e.ts deleted file mode 100644 index b6b20154345..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-label/amplify-label.e2e.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { E2EPage, newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-label e2e:', () => { - let page: E2EPage; - - beforeEach(async () => { - page = await newE2EPage(); - await page.setContent('This is a label'); - }); - - it('renders with text `This is a label`', async () => { - const element = await page.find('amplify-label'); - expect(element).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-label', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-label/amplify-label.scss b/packages/amplify-ui-components/src/components/amplify-label/amplify-label.scss deleted file mode 100644 index f52449057ea..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-label/amplify-label.scss +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @prop --label-color: Text color within the label - */ -:host { - --label-color: var(--amplify-secondary-color); -} - -.label { - color: var(--label-color); - font-size: var(--amplify-text-sm); - margin-bottom: 16px; -} diff --git a/packages/amplify-ui-components/src/components/amplify-label/amplify-label.spec.ts b/packages/amplify-ui-components/src/components/amplify-label/amplify-label.spec.ts deleted file mode 100644 index fdccafe8416..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-label/amplify-label.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyLabel } from './amplify-label'; - -describe('amplify-label spec:', () => { - describe('Render logic ->', () => { - it('should render a label by default', async () => { - const page = await newSpecPage({ - components: [AmplifyLabel], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render only class `amplify-ui--label`', async () => { - const page = await newSpecPage({ - components: [AmplifyLabel], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-label/amplify-label.stories.tsx b/packages/amplify-ui-components/src/components/amplify-label/amplify-label.stories.tsx deleted file mode 100644 index 188f888ee24..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-label/amplify-label.stories.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { storiesOf } from '@storybook/html'; -import { knobs } from '../../common/testing'; - -const labelStories = storiesOf('amplify-label', module); - -labelStories.add('with text', () => { - const label = knobs.labelKnob('Label text'); - return `${label}`; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-label/amplify-label.tsx b/packages/amplify-ui-components/src/components/amplify-label/amplify-label.tsx deleted file mode 100644 index 050af1d1c31..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-label/amplify-label.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { Component, Prop, h } from '@stencil/core'; - -/** - * @slot (default) - Label content - */ -@Component({ - tag: 'amplify-label', - styleUrl: 'amplify-label.scss', -}) -export class AmplifyLabel { - /** Reflects the value of the for content property of html element */ - @Prop() htmlFor: string; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-label/readme.md b/packages/amplify-ui-components/src/components/amplify-label/readme.md deleted file mode 100644 index c69efaac44c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-label/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# amplify-label - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| --------- | ---------- | -------------------------------------------------------------- | -------- | ----------- | -| `htmlFor` | `html-for` | Reflects the value of the for content property of html element | `string` | `undefined` | - - -## Slots - -| Slot | Description | -| ------------- | ------------- | -| `"(default)"` | Label content | - - -## CSS Custom Properties - -| Name | Description | -| --------------- | --------------------------- | -| `--label-color` | Text color within the label | - - -## Dependencies - -### Used by - - - [amplify-checkbox](../amplify-checkbox) - - [amplify-form-field](../amplify-form-field) - - [amplify-radio-button](../amplify-radio-button) - -### Graph -```mermaid -graph TD; - amplify-checkbox --> amplify-label - amplify-form-field --> amplify-label - amplify-radio-button --> amplify-label - style amplify-label fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-link/__snapshots__/amplify-link.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-link/__snapshots__/amplify-link.spec.ts.snap deleted file mode 100644 index 3357c3b9804..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-link/__snapshots__/amplify-link.spec.ts.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-link spec: Render logic -> should render a link by default 1`] = ` - - - - - - - -`; - -exports[`amplify-link spec: Render logic -> should render only class \`amplify-ui--link\` 1`] = ` - - - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-link/amplify-link.e2e.ts b/packages/amplify-ui-components/src/components/amplify-link/amplify-link.e2e.ts deleted file mode 100644 index 6e5669197e1..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-link/amplify-link.e2e.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { E2EPage, newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-link e2e:', () => { - let page: E2EPage; - - beforeEach(async () => { - page = await newE2EPage(); - await page.setContent('This is a link'); - }); - - it('renders with text `This is a link`', async () => { - const element = await page.find('amplify-link'); - expect(element).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-link', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-link/amplify-link.scss b/packages/amplify-ui-components/src/components/amplify-link/amplify-link.scss deleted file mode 100644 index 8ed2be779cd..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-link/amplify-link.scss +++ /dev/null @@ -1,25 +0,0 @@ -:host { - --link-color: var(--amplify-primary-color); - --link-hover: var(--amplify-primary-tint); - --link-active: var(--amplify-primary-shade); -} - -.link { - color: var(--link-color); - cursor: pointer; - - &:link { - color: var(--link-color); - text-decoration: none; - } - - &:hover { - color: var(--link-hover); - text-decoration: underline; - } - - &:active { - color: var(--link-active); - text-decoration: underline; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-link/amplify-link.spec.ts b/packages/amplify-ui-components/src/components/amplify-link/amplify-link.spec.ts deleted file mode 100644 index 9b7f3cea850..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-link/amplify-link.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyLink } from './amplify-link'; - -describe('amplify-link spec:', () => { - describe('Render logic ->', () => { - it('should render a link by default', async () => { - const page = await newSpecPage({ - components: [AmplifyLink], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render only class `amplify-ui--link`', async () => { - const page = await newSpecPage({ - components: [AmplifyLink], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-link/amplify-link.tsx b/packages/amplify-ui-components/src/components/amplify-link/amplify-link.tsx deleted file mode 100644 index f3242f7f2a6..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-link/amplify-link.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { Component, Element, Prop, h } from '@stencil/core'; - -@Component({ - tag: 'amplify-link', - styleUrl: 'amplify-link.scss', - shadow: true, -}) -export class AmplifyLink { - @Element() el: HTMLAmplifyLinkElement; - /** The link role is used to identify an element that creates a hyperlink to a resource that is in the application or external */ - @Prop() role: string = 'navigation'; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-link/readme.md b/packages/amplify-ui-components/src/components/amplify-link/readme.md deleted file mode 100644 index 9167fe7236a..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-link/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# amplify-link - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| -------- | --------- | -------------------------------------------------------------------------------------------------------------------------- | -------- | -------------- | -| `role` | `role` | The link role is used to identify an element that creates a hyperlink to a resource that is in the application or external | `string` | `'navigation'` | - - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-loading-spinner/amplify-loading-spinner.scss b/packages/amplify-ui-components/src/components/amplify-loading-spinner/amplify-loading-spinner.scss deleted file mode 100644 index 4710c51c6f8..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-loading-spinner/amplify-loading-spinner.scss +++ /dev/null @@ -1,28 +0,0 @@ -:host { - --spinner-circle-fill: var(--amplify-smoke-white); - --spinner-bar-fill: var(--amplify-primary-color); - --width: 0.875rem; - --height: 0.875rem; -} - -.loading-spinner { - svg { - animation: loading-spinner 1s linear infinite; - width: var(--width); - height: var(--height); - #spinner-circle { - fill: var(--spinner-circle-fill); - } - #spinner-bar { - fill: var(--spinner-bar-fill); - } - } - @keyframes loading-spinner { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-loading-spinner/amplify-loading-spinner.tsx b/packages/amplify-ui-components/src/components/amplify-loading-spinner/amplify-loading-spinner.tsx deleted file mode 100644 index 9adf4e69463..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-loading-spinner/amplify-loading-spinner.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { Component, h } from '@stencil/core'; - -@Component({ - tag: 'amplify-loading-spinner', - styleUrl: 'amplify-loading-spinner.scss', - shadow: true, -}) -export class AmplifyLoadingSpinner { - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - render() { - return ; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-loading-spinner/readme.md b/packages/amplify-ui-components/src/components/amplify-loading-spinner/readme.md deleted file mode 100644 index 5f8e60e823b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-loading-spinner/readme.md +++ /dev/null @@ -1,32 +0,0 @@ -# amplify-loading-spinner - - - - - - -## Dependencies - -### Used by - - - [amplify-form-section](../amplify-form-section) - - [amplify-sign-in](../amplify-sign-in) - - [amplify-sign-up](../amplify-sign-up) - -### Depends on - -- [amplify-icon](../amplify-icon) - -### Graph -```mermaid -graph TD; - amplify-loading-spinner --> amplify-icon - amplify-form-section --> amplify-loading-spinner - amplify-sign-in --> amplify-loading-spinner - amplify-sign-up --> amplify-loading-spinner - style amplify-loading-spinner fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-nav/__snapshots__/amplify-nav.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-nav/__snapshots__/amplify-nav.spec.ts.snap deleted file mode 100644 index c3d1063e6d8..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-nav/__snapshots__/amplify-nav.spec.ts.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-nav spec: Render logic -> should render 1`] = ` - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-nav/amplify-nav.scss b/packages/amplify-ui-components/src/components/amplify-nav/amplify-nav.scss deleted file mode 100644 index b7df6a4e47e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-nav/amplify-nav.scss +++ /dev/null @@ -1,9 +0,0 @@ -.nav { - display: flex; - flex: 1 1 0%; - justify-content: flex-end; - align-items: center; - > * { - margin: 0 0.5em; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-nav/amplify-nav.spec.ts b/packages/amplify-ui-components/src/components/amplify-nav/amplify-nav.spec.ts deleted file mode 100644 index 8722f307b8b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-nav/amplify-nav.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyNav } from './amplify-nav'; - -describe('amplify-nav spec:', () => { - describe('Render logic ->', () => { - it('should render', async () => { - const page = await newSpecPage({ - components: [AmplifyNav], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-nav/amplify-nav.stories.tsx b/packages/amplify-ui-components/src/components/amplify-nav/amplify-nav.stories.tsx deleted file mode 100644 index 4ac5f3889a2..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-nav/amplify-nav.stories.tsx +++ /dev/null @@ -1,5 +0,0 @@ -export default { - title: 'amplify-nav', -}; - -export const defaults = () => ``; diff --git a/packages/amplify-ui-components/src/components/amplify-nav/amplify-nav.tsx b/packages/amplify-ui-components/src/components/amplify-nav/amplify-nav.tsx deleted file mode 100644 index 72160cce1f9..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-nav/amplify-nav.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { Component, h } from '@stencil/core'; - -@Component({ - tag: 'amplify-nav', - styleUrl: 'amplify-nav.scss', - shadow: true, -}) -export class AmplifyNav { - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - render() { - return ( - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-nav/readme.md b/packages/amplify-ui-components/src/components/amplify-nav/readme.md deleted file mode 100644 index a5ee27ce439..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-nav/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# amplify-nav - - - - - - -## Dependencies - -### Used by - - - [amplify-greetings](../amplify-greetings) - -### Graph -```mermaid -graph TD; - amplify-greetings --> amplify-nav - style amplify-nav fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-oauth-button/__snapshots__/amplify-oauth-button.spec.tsx.snap b/packages/amplify-ui-components/src/components/amplify-oauth-button/__snapshots__/amplify-oauth-button.spec.tsx.snap deleted file mode 100644 index 713c8146f1c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-oauth-button/__snapshots__/amplify-oauth-button.spec.tsx.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-oauth-button stories defaults 1`] = ` - - - - Sign in with AWS - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-oauth-button/amplify-oauth-button.spec.tsx b/packages/amplify-ui-components/src/components/amplify-oauth-button/amplify-oauth-button.spec.tsx deleted file mode 100644 index 94a80c83975..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-oauth-button/amplify-oauth-button.spec.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; - -import { AmplifyOAuthButton } from './amplify-oauth-button'; -import * as stories from './amplify-oauth-button.stories'; - -const { - default: { title }, - ...specs -} = stories; - -const components = [AmplifyOAuthButton]; - -describe(title, () => { - describe('stories', () => { - Object.entries(specs).forEach(([name, spec]) => { - it(name, async () => { - const page = await newSpecPage({ components, html: spec() }); - - expect(page.root).toMatchSnapshot(); - }); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-oauth-button/amplify-oauth-button.stories.tsx b/packages/amplify-ui-components/src/components/amplify-oauth-button/amplify-oauth-button.stories.tsx deleted file mode 100644 index 9707c167446..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-oauth-button/amplify-oauth-button.stories.tsx +++ /dev/null @@ -1,5 +0,0 @@ -export default { - title: 'amplify-oauth-button', -}; - -export const defaults = () => ``; diff --git a/packages/amplify-ui-components/src/components/amplify-oauth-button/amplify-oauth-button.tsx b/packages/amplify-ui-components/src/components/amplify-oauth-button/amplify-oauth-button.tsx deleted file mode 100644 index 3dc8903e3d4..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-oauth-button/amplify-oauth-button.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { I18n } from '@aws-amplify/core'; -import { Component, h, Prop } from '@stencil/core'; - -import { FederatedConfig } from '../../common/types/auth-types'; -import { Translations } from '../../common/Translations'; - -@Component({ - tag: 'amplify-oauth-button', - shadow: true, -}) -export class AmplifyOAuthButton { - /** Federated credentials & configuration. */ - @Prop() config: FederatedConfig['oauthConfig'] = {}; - - private signInWithOAuth(event) { - event.preventDefault(); - Auth.federatedSignIn(); - } - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - this.signInWithOAuth(event)} - provider="oauth" - > - {this.config.label || I18n.get(Translations.SIGN_IN_WITH_AWS)} - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-oauth-button/readme.md b/packages/amplify-ui-components/src/components/amplify-oauth-button/readme.md deleted file mode 100644 index 15fb87929ac..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-oauth-button/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# amplify-oauth-button - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| -------- | --------- | -------------------------------------- | ------------------------- | ------- | -| `config` | -- | Federated credentials & configuration. | `{ [key: string]: any; }` | `{}` | - - -## Dependencies - -### Used by - - - [amplify-federated-buttons](../amplify-federated-buttons) - -### Depends on - -- [amplify-sign-in-button](../amplify-sign-in-button) - -### Graph -```mermaid -graph TD; - amplify-oauth-button --> amplify-sign-in-button - amplify-sign-in-button --> amplify-icon - amplify-federated-buttons --> amplify-oauth-button - style amplify-oauth-button fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-password-field/__snapshots__/amplify-password-field.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-password-field/__snapshots__/amplify-password-field.spec.ts.snap deleted file mode 100644 index 7575ad612d8..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-password-field/__snapshots__/amplify-password-field.spec.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-password-field spec: Render logic -> should render with \`label\` and \`placeholder\` values changed 1`] = ` - - - -`; - -exports[`amplify-password-field spec: Render logic -> should render with default values 1`] = ` - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-password-field/amplify-password-field.e2e.ts b/packages/amplify-ui-components/src/components/amplify-password-field/amplify-password-field.e2e.ts deleted file mode 100644 index b99df4d9aea..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-password-field/amplify-password-field.e2e.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-password-field e2e:', () => { - it('should render a amplify-password-field', async () => { - const page = await newE2EPage(); - await page.setContent(``); - const el = await page.find('amplify-password-field'); - expect(el).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-password-field', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-password-field/amplify-password-field.spec.ts b/packages/amplify-ui-components/src/components/amplify-password-field/amplify-password-field.spec.ts deleted file mode 100644 index 49882c82b8d..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-password-field/amplify-password-field.spec.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyPasswordField } from './amplify-password-field'; - -describe('amplify-password-field spec:', () => { - describe('Component logic ->', () => { - let passwordField; - - beforeEach(() => { - passwordField = new AmplifyPasswordField(); - }); - - it('should render hint to `undefined` by default', () => { - expect(passwordField.hint).toBeUndefined(); - }); - - it('should render placeholder to `Enter your password` by default', () => { - expect(passwordField.placeholder).toEqual('Enter your password'); - }); - - it('should render label to `Password *` by default', () => { - expect(passwordField.label).toEqual('Password *'); - }); - - it('should render fieldId to `password` by default', () => { - expect(passwordField.fieldId).toEqual('password'); - }); - - it('should render required to `false` by default', () => { - expect(passwordField.required).toBe(false); - }); - }); - describe('Render logic ->', () => { - it('should render with `label` and `placeholder` values changed', async () => { - const page = await newSpecPage({ - components: [AmplifyPasswordField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render with default values', async () => { - const page = await newSpecPage({ - components: [AmplifyPasswordField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-password-field/amplify-password-field.tsx b/packages/amplify-ui-components/src/components/amplify-password-field/amplify-password-field.tsx deleted file mode 100644 index 55d80f1b9c4..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-password-field/amplify-password-field.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { Component, Prop, FunctionalComponent, h } from '@stencil/core'; -import { PASSWORD_SUFFIX } from '../../common/constants'; -import { Translations } from '../../common/Translations'; - -@Component({ - tag: 'amplify-password-field', -}) -export class AmplifyPasswordField { - /** Based on the type of field e.g. sign in, sign up, forgot password, etc. */ - @Prop() fieldId: string = PASSWORD_SUFFIX; - /** Used for the password label */ - @Prop() label: string = Translations.PASSWORD_LABEL; - /** Used for the placeholder label */ - @Prop() placeholder: string = Translations.PASSWORD_PLACEHOLDER; - /** Used as the hint in case you forgot your password, etc. */ - @Prop() hint: string | FunctionalComponent | null; - /** The required flag in order to make an input required prior to submitting a form */ - @Prop() required: boolean = false; - /** The callback, called when the input is modified by the user. */ - @Prop() handleInputChange?: (inputEvent: Event) => void; - /** The value of the content inside of the input field */ - @Prop() value?: string; - /** Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes */ - @Prop() inputProps?: object; - /** Will disable the input if set to true */ - @Prop() disabled?: boolean; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-password-field/readme.md b/packages/amplify-ui-components/src/components/amplify-password-field/readme.md deleted file mode 100644 index 4e987065ab4..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-password-field/readme.md +++ /dev/null @@ -1,44 +0,0 @@ -# amplify-password-field - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------- | ----------------------------------- | -| `disabled` | `disabled` | Will disable the input if set to true | `boolean` | `undefined` | -| `fieldId` | `field-id` | Based on the type of field e.g. sign in, sign up, forgot password, etc. | `string` | `PASSWORD_SUFFIX` | -| `handleInputChange` | -- | The callback, called when the input is modified by the user. | `(inputEvent: Event) => void` | `undefined` | -| `hint` | `hint` | Used as the hint in case you forgot your password, etc. | `FunctionalComponent<{}> \| string` | `undefined` | -| `inputProps` | -- | Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes | `object` | `undefined` | -| `label` | `label` | Used for the password label | `string` | `Translations.PASSWORD_LABEL` | -| `placeholder` | `placeholder` | Used for the placeholder label | `string` | `Translations.PASSWORD_PLACEHOLDER` | -| `required` | `required` | The required flag in order to make an input required prior to submitting a form | `boolean` | `false` | -| `value` | `value` | The value of the content inside of the input field | `string` | `undefined` | - - -## Dependencies - -### Used by - - - [amplify-auth-fields](../amplify-auth-fields) - -### Depends on - -- [amplify-form-field](../amplify-form-field) - -### Graph -```mermaid -graph TD; - amplify-password-field --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-auth-fields --> amplify-password-field - style amplify-password-field fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-phone-field/__snapshots__/amplify-phone-field.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-phone-field/__snapshots__/amplify-phone-field.spec.ts.snap deleted file mode 100644 index 7ad897a4fbf..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-phone-field/__snapshots__/amplify-phone-field.spec.ts.snap +++ /dev/null @@ -1,27 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-phone-field spec: Render logic -> should render \`placeholder\` and \`label values 1`] = ` - -
- -
- - -
-
-
-
-`; - -exports[`amplify-phone-field spec: Render logic -> should render default values by default 1`] = ` - -
- -
- - -
-
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-phone-field/amplify-phone-field.e2e.ts b/packages/amplify-ui-components/src/components/amplify-phone-field/amplify-phone-field.e2e.ts deleted file mode 100644 index 6583657633a..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-phone-field/amplify-phone-field.e2e.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-phone-field e2e:', () => { - it('should render a amplify-phone-field', async () => { - const page = await newE2EPage(); - await page.setContent(``); - const el = await page.find('amplify-phone-field'); - expect(el).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-phone-field', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-phone-field/amplify-phone-field.scss b/packages/amplify-ui-components/src/components/amplify-phone-field/amplify-phone-field.scss deleted file mode 100644 index 8381b58671c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-phone-field/amplify-phone-field.scss +++ /dev/null @@ -1,9 +0,0 @@ -.phone-field { - display: inline-flex; - align-items: flex-start; - width: 100%; - input { - border-left: none; - border-radius: 0 3px 3px 0; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-phone-field/amplify-phone-field.spec.ts b/packages/amplify-ui-components/src/components/amplify-phone-field/amplify-phone-field.spec.ts deleted file mode 100644 index 4fa0c8f3b58..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-phone-field/amplify-phone-field.spec.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyPhoneField } from './amplify-phone-field'; -import { PHONE_SUFFIX } from '../../common/constants'; -import { Translations } from '../../common/Translations'; - -describe('amplify-phone-field spec:', () => { - describe('Component logic ->', () => { - let phoneField; - - beforeEach(() => { - phoneField = new AmplifyPhoneField(); - }); - - it('should render `phone` for the field id', () => { - expect(phoneField.fieldId).toEqual(PHONE_SUFFIX); - }); - - it('should have `label` render to `Verification phone` by default', () => { - expect(phoneField.label).toEqual(I18n.get(Translations.PHONE_LABEL)); - }); - - it('should have `placeholder` render to `Enter phone` by default', () => { - expect(phoneField.placeholder).toEqual( - I18n.get(Translations.PHONE_PLACEHOLDER) - ); - }); - - it('should have `required` set to `false` by default', () => { - expect(phoneField.required).toBe(false); - }); - }); - describe('Render logic ->', () => { - it('should render `placeholder` and `label values', async () => { - const page = await newSpecPage({ - components: [AmplifyPhoneField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render default values by default', async () => { - const page = await newSpecPage({ - components: [AmplifyPhoneField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-phone-field/amplify-phone-field.tsx b/packages/amplify-ui-components/src/components/amplify-phone-field/amplify-phone-field.tsx deleted file mode 100644 index e5b1d802fbb..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-phone-field/amplify-phone-field.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { Component, Prop, FunctionalComponent, h } from '@stencil/core'; -import { Translations } from '../../common/Translations'; -import { PHONE_SUFFIX } from '../../common/constants'; - -@Component({ - tag: 'amplify-phone-field', - styleUrl: 'amplify-phone-field.scss', -}) -export class AmplifyPhoneField { - /** Based on the type of field e.g. sign in, sign up, forgot password, etc. */ - @Prop() fieldId: string = PHONE_SUFFIX; - /** Used for the Phone label */ - @Prop() label: string = Translations.PHONE_LABEL; - /** Used for the placeholder label */ - @Prop() placeholder: string = Translations.PHONE_PLACEHOLDER; - /** Used as the hint in case you forgot your confirmation code, etc. */ - @Prop() hint: string | FunctionalComponent | null; - /** The required flag in order to make an input required prior to submitting a form */ - @Prop() required: boolean = false; - /** The callback, called when the input is modified by the user. */ - @Prop() handleInputChange?: (inputEvent: Event) => void; - /** The value of the content inside of the input field */ - @Prop() value: string; - /** Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes */ - @Prop() inputProps?: object; - /** Will disable the input if set to true */ - @Prop() disabled?: boolean; - /** Default dial code in the phone field */ - @Prop() dialCode?: string | number; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( -
- -
- - -
-
-
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-phone-field/readme.md b/packages/amplify-ui-components/src/components/amplify-phone-field/readme.md deleted file mode 100644 index 4c4330887fa..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-phone-field/readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# amplify-code-field - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------- | -------------------------------- | -| `dialCode` | `dial-code` | Default dial code in the phone field | `number \| string` | `undefined` | -| `disabled` | `disabled` | Will disable the input if set to true | `boolean` | `undefined` | -| `fieldId` | `field-id` | Based on the type of field e.g. sign in, sign up, forgot password, etc. | `string` | `PHONE_SUFFIX` | -| `handleInputChange` | -- | The callback, called when the input is modified by the user. | `(inputEvent: Event) => void` | `undefined` | -| `hint` | `hint` | Used as the hint in case you forgot your confirmation code, etc. | `FunctionalComponent<{}> \| string` | `undefined` | -| `inputProps` | -- | Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes | `object` | `undefined` | -| `label` | `label` | Used for the Phone label | `string` | `Translations.PHONE_LABEL` | -| `placeholder` | `placeholder` | Used for the placeholder label | `string` | `Translations.PHONE_PLACEHOLDER` | -| `required` | `required` | The required flag in order to make an input required prior to submitting a form | `boolean` | `false` | -| `value` | `value` | The value of the content inside of the input field | `string` | `undefined` | - - -## Dependencies - -### Used by - - - [amplify-auth-fields](../amplify-auth-fields) - -### Depends on - -- [amplify-form-field](../amplify-form-field) -- [amplify-country-dial-code](../amplify-country-dial-code) -- [amplify-input](../amplify-input) - -### Graph -```mermaid -graph TD; - amplify-phone-field --> amplify-form-field - amplify-phone-field --> amplify-country-dial-code - amplify-phone-field --> amplify-input - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-country-dial-code --> amplify-select - amplify-auth-fields --> amplify-phone-field - style amplify-phone-field fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-photo-picker/__snapshots__/amplify-photo-picker.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-photo-picker/__snapshots__/amplify-photo-picker.spec.ts.snap deleted file mode 100644 index 3d0a7ad56dc..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-photo-picker/__snapshots__/amplify-photo-picker.spec.ts.snap +++ /dev/null @@ -1,29 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-photo-picker spec: Render logic -> should render a picker by default 1`] = ` - - -
- -
- Picker Title -
-
- Ancillary text or content may occupy this space here -
- -
- -
-
-
- Placeholder hint -
- - Button - -
-
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-photo-picker/amplify-photo-picker.scss b/packages/amplify-ui-components/src/components/amplify-photo-picker/amplify-photo-picker.scss deleted file mode 100644 index 13d9a1540e1..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-photo-picker/amplify-photo-picker.scss +++ /dev/null @@ -1,66 +0,0 @@ -:host { - --object-fit: cover; - --hint-color: var(--amplify-grey); - --header-color: var(--amplify-secondary-color); - --header-size: var(--amplify-text-lg); - --header-hint-size: var(--amplify-text-md); - --placeholder-hint-size: var(--amplify-text-sm); - --placeholder-border-color: var(--amplify-grey); -} - -.photo-picker-container { - max-width: 50rem; -} - -img { - object-fit: var(--object-fit); - width: 100%; - height: 100%; -} - -input[type='file'] { - width: 100%; - height: 100%; - display: inline-block; - position: absolute; - left: 0; - top: 0; - opacity: 0; - cursor: pointer; -} - -.header { - color: var(--header-color); - font-size: var(--header-size); - font-weight: bold; - margin-bottom: 24px; -} - -.header-hint { - color: var(--hint-color); - font-size: var(--header-hint-size); - word-break: break-word; - margin-bottom: 24px; -} - -.picker-body { - position: relative; - width: 25rem; - height: 16rem; - border: 2px dotted var(--placeholder-border-color); - padding: 10px; - margin-bottom: 8px; - display: flex; - justify-content: center; - align-items: center; - overflow: hidden; -} - -.placeholder-hint { - color: var(--hint-color); - font-family: Helvetica; - font-style: italic; - font-size: var(--placeholder-hint-size); - word-break: break-word; - margin-bottom: 30px; -} diff --git a/packages/amplify-ui-components/src/components/amplify-photo-picker/amplify-photo-picker.spec.ts b/packages/amplify-ui-components/src/components/amplify-photo-picker/amplify-photo-picker.spec.ts deleted file mode 100644 index d0429a93298..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-photo-picker/amplify-photo-picker.spec.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyPhotoPicker } from './amplify-photo-picker'; -import { I18n } from '@aws-amplify/core'; -import { Translations } from '../../common/Translations'; - -describe('amplify-photo-picker spec:', () => { - describe('Component logic ->', () => { - let amplifyPhotoPicker; - - beforeEach(() => { - amplifyPhotoPicker = new AmplifyPhotoPicker(); - }); - - it('`headerTitle` should be defined by default', () => { - expect(amplifyPhotoPicker.headerTitle).toBe( - I18n.get(Translations.PHOTO_PICKER_TITLE) - ); - }); - - it('`headerHint` should be defined by default', () => { - expect(amplifyPhotoPicker.headerHint).toBe( - I18n.get(Translations.PHOTO_PICKER_HINT) - ); - }); - - it('`placeholderHint` should be defined by default', () => { - expect(amplifyPhotoPicker.placeholderHint).toBe( - I18n.get(Translations.PHOTO_PICKER_PLACEHOLDER_HINT) - ); - }); - - it('`buttonText` should be defined by default', () => { - expect(amplifyPhotoPicker.buttonText).toBe( - I18n.get(Translations.PHOTO_PICKER_BUTTON_TEXT) - ); - }); - - it('`previewSrc` should be undefined by default', () => { - expect(amplifyPhotoPicker.previewSrc).toBeUndefined(); - }); - }); - - describe('Render logic ->', () => { - it('should render a picker by default', async () => { - const page = await newSpecPage({ - components: [AmplifyPhotoPicker], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-photo-picker/amplify-photo-picker.tsx b/packages/amplify-ui-components/src/components/amplify-photo-picker/amplify-photo-picker.tsx deleted file mode 100644 index 90db8f8973d..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-photo-picker/amplify-photo-picker.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import { Component, Prop, h, State } from '@stencil/core'; -import { I18n } from '@aws-amplify/core'; -import { Translations } from '../../common/Translations'; - -@Component({ - tag: 'amplify-photo-picker', - styleUrl: 'amplify-photo-picker.scss', - shadow: true, -}) -export class AmplifyPhotoPicker { - /** Title string value */ - @Prop() headerTitle?: string = Translations.PHOTO_PICKER_TITLE; - /** Header Hint value in string */ - @Prop() headerHint?: string = Translations.PHOTO_PICKER_HINT; - /** Placeholder hint that goes under the placeholder image */ - @Prop() placeholderHint?: string = Translations.PHOTO_PICKER_PLACEHOLDER_HINT; - /** Picker button text as string */ - @Prop() buttonText?: string = Translations.PHOTO_PICKER_BUTTON_TEXT; - /** Source of the image to be previewed */ - @Prop() previewSrc?: string | object; - /** Function that handles file pick onClick */ - @Prop() handleClick?: (file: File) => void = () => {}; - /** Preview State tracks the change in preview source */ - @State() previewState: string; - /** File slected through picker */ - @State() file: File; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - this.previewState = this.previewSrc as string; - } - - private handleInput = (ev: Event) => { - this.file = (ev.target as HTMLInputElement).files[0]; - - const reader = new FileReader(); - reader.onload = (_e: Event) => { - const url = reader.result; - this.previewState = url as string; - }; - reader.readAsDataURL(this.file); - }; - - render() { - return ( -
- -
{I18n.get(this.headerTitle)}
-
{I18n.get(this.headerHint)}
- - -
- {this.previewState ? ( - - ) : ( - - )} -
-
- -
{I18n.get(this.placeholderHint)}
- - this.handleClick(this.file)}> - {I18n.get(this.buttonText)} - -
-
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-photo-picker/readme.md b/packages/amplify-ui-components/src/components/amplify-photo-picker/readme.md deleted file mode 100644 index 973a8e794d7..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-photo-picker/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# amplify-photo-picker - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------- | ------------------ | ------------------------------------------------------ | ---------------------- | -------------------------------------------- | -| `buttonText` | `button-text` | Picker button text as string | `string` | `Translations.PHOTO_PICKER_BUTTON_TEXT` | -| `handleClick` | -- | Function that handles file pick onClick | `(file: File) => void` | `() => {}` | -| `headerHint` | `header-hint` | Header Hint value in string | `string` | `Translations.PHOTO_PICKER_HINT` | -| `headerTitle` | `header-title` | Title string value | `string` | `Translations.PHOTO_PICKER_TITLE` | -| `placeholderHint` | `placeholder-hint` | Placeholder hint that goes under the placeholder image | `string` | `Translations.PHOTO_PICKER_PLACEHOLDER_HINT` | -| `previewSrc` | `preview-src` | Source of the image to be previewed | `object \| string` | `undefined` | - - -## Dependencies - -### Used by - - - [amplify-s3-image-picker](../amplify-s3-image-picker) - -### Depends on - -- [amplify-section](../amplify-section) -- [amplify-picker](../amplify-picker) -- [amplify-icon](../amplify-icon) -- [amplify-button](../amplify-button) - -### Graph -```mermaid -graph TD; - amplify-photo-picker --> amplify-section - amplify-photo-picker --> amplify-picker - amplify-photo-picker --> amplify-icon - amplify-photo-picker --> amplify-button - amplify-picker --> amplify-button - amplify-button --> amplify-icon - amplify-s3-image-picker --> amplify-photo-picker - style amplify-photo-picker fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-picker/__snapshots__/amplify-picker.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-picker/__snapshots__/amplify-picker.spec.ts.snap deleted file mode 100644 index cc65b8ed851..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-picker/__snapshots__/amplify-picker.spec.ts.snap +++ /dev/null @@ -1,16 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-picker spec: Render logic -> should render a picker by default 1`] = ` - - -
- - - Pick a file - - - -
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-picker/amplify-picker.scss b/packages/amplify-ui-components/src/components/amplify-picker/amplify-picker.scss deleted file mode 100644 index cf20dbf22e9..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-picker/amplify-picker.scss +++ /dev/null @@ -1,17 +0,0 @@ -.picker { - position: relative; - display: flex; - justify-content: center; - align-items: center; -} - -input[type='file'] { - width: 100%; - height: 100%; - display: inline-block; - position: absolute; - left: 0; - top: 0; - opacity: 0; - cursor: pointer; -} diff --git a/packages/amplify-ui-components/src/components/amplify-picker/amplify-picker.spec.ts b/packages/amplify-ui-components/src/components/amplify-picker/amplify-picker.spec.ts deleted file mode 100644 index 4966a7bc4d0..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-picker/amplify-picker.spec.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyPicker } from './amplify-picker'; -import { I18n } from '@aws-amplify/core'; -import { Translations } from '../../common/Translations'; - -describe('amplify-picker spec:', () => { - describe('Component logic ->', () => { - let amplifyPicker; - - beforeEach(() => { - amplifyPicker = new AmplifyPicker(); - }); - - it('`pickerText` should be defined by default', () => { - expect(amplifyPicker.pickerText).toBe(I18n.get(Translations.PICKER_TEXT)); - }); - - it('`acceptValue` should be `*/*` by default', () => { - expect(amplifyPicker.acceptValue).toBe('*/*'); - }); - }); - - describe('Render logic ->', () => { - it('should render a picker by default', async () => { - const page = await newSpecPage({ - components: [AmplifyPicker], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-picker/amplify-picker.tsx b/packages/amplify-ui-components/src/components/amplify-picker/amplify-picker.tsx deleted file mode 100644 index e0114704da6..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-picker/amplify-picker.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { Component, Prop, h } from '@stencil/core'; -import { I18n } from '@aws-amplify/core'; -import { Translations } from '../../common/Translations'; - -@Component({ - tag: 'amplify-picker', - styleUrl: 'amplify-picker.scss', - shadow: true, -}) -export class AmplifyPicker { - /** Picker button text */ - @Prop() pickerText: string = Translations.PICKER_TEXT; - /** File input accept value */ - @Prop() acceptValue: string = '*/*'; - /** File input onChange handler */ - @Prop() inputHandler: (e: Event) => void; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( -
- - {I18n.get(this.pickerText)} - - this.inputHandler(e)} - /> -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-picker/readme.md b/packages/amplify-ui-components/src/components/amplify-picker/readme.md deleted file mode 100644 index 9b3c57e8181..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-picker/readme.md +++ /dev/null @@ -1,40 +0,0 @@ -# amplify-picker - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| -------------- | -------------- | --------------------------- | -------------------- | -------------------------- | -| `acceptValue` | `accept-value` | File input accept value | `string` | `'*/*'` | -| `inputHandler` | -- | File input onChange handler | `(e: Event) => void` | `undefined` | -| `pickerText` | `picker-text` | Picker button text | `string` | `Translations.PICKER_TEXT` | - - -## Dependencies - -### Used by - - - [amplify-photo-picker](../amplify-photo-picker) - - [amplify-s3-album](../amplify-s3-album) - - [amplify-s3-text-picker](../amplify-s3-text-picker) - -### Depends on - -- [amplify-button](../amplify-button) - -### Graph -```mermaid -graph TD; - amplify-picker --> amplify-button - amplify-button --> amplify-icon - amplify-photo-picker --> amplify-picker - amplify-s3-album --> amplify-picker - amplify-s3-text-picker --> amplify-picker - style amplify-picker fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-radio-button/__snapshots__/amplify-radio-button.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-radio-button/__snapshots__/amplify-radio-button.spec.ts.snap deleted file mode 100644 index ae03079e2c1..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-radio-button/__snapshots__/amplify-radio-button.spec.ts.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-radio-button spec: Render logic -> should render a radio button with no label and a type of radio for input by default 1`] = ` - - - - - - -`; - -exports[`amplify-radio-button spec: Render logic -> should render only class \`amplify-ui--radio-button\` 1`] = ` - - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.e2e.ts b/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.e2e.ts deleted file mode 100644 index 3983f3defe7..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.e2e.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-radio-button e2e:', () => { - it('should render a amplify-radio-button', async () => { - const page = await newE2EPage(); - await page.setContent( - `` - ); - - const el = await page.find('amplify-radio-button'); - expect(el).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-radio-button', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.scss b/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.scss deleted file mode 100644 index fe0edb837ab..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.scss +++ /dev/null @@ -1,15 +0,0 @@ -:host { - --font-family: var(--amplify-font-family); -} - -.radio-button { - display: block; - width: 100%; - padding: 16px; - font-size: var(--amplify-text-sm); - font-family: var(--font-family); - - input { - margin-right: 12px; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.spec.ts b/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.spec.ts deleted file mode 100644 index 88bd7a39e34..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.spec.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyRadioButton } from './amplify-radio-button'; - -describe('amplify-radio-button spec:', () => { - describe('Component logic ->', () => { - let radio; - - beforeEach(() => { - radio = new AmplifyRadioButton(); - }); - - it('should render false for checked prop by default', () => { - expect(radio.checked).toBe(false); - }); - - it('should render false for disabled prop by default', () => { - expect(radio.disabled).toBe(false); - }); - }); - describe('Render logic ->', () => { - it('should render a radio button with no label and a type of radio for input by default', async () => { - const page = await newSpecPage({ - components: [AmplifyRadioButton], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render only class `amplify-ui--radio-button`', async () => { - const page = await newSpecPage({ - components: [AmplifyRadioButton], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.stories.tsx b/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.stories.tsx deleted file mode 100644 index f977945b769..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.stories.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { storiesOf } from '@storybook/html'; -import { knobs } from '../../common/testing'; - -const radioButtonStories = storiesOf('amplify-radio-button', module); - -radioButtonStories.add('with label', () => { - const label = knobs.labelKnob('Seattle'); - - return ``; -}); - -radioButtonStories.add('checkable radio button', () => { - const label = knobs.labelKnob('Oceanside'); - const toggle = knobs.toggleKnob(false); - - return ``; -}); - -radioButtonStories.add('disabled', () => { - const label = knobs.labelKnob('Moscow'); - const disabled = knobs.disabledKnob(true); - - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.tsx b/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.tsx deleted file mode 100644 index 52215d66000..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-radio-button/amplify-radio-button.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { Component, Prop, h } from '@stencil/core'; - -@Component({ - tag: 'amplify-radio-button', - styleUrl: 'amplify-radio-button.scss', -}) -export class AmplifyRadioButton { - /** The callback, called when the input is modified by the user. */ - @Prop() handleInputChange?: (inputEvent: Event) => void; - /** (Optional) Name of radio button */ - @Prop() name?: string; - /** (Optional) Value of radio button */ - @Prop() value?: string; - /** (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. */ - @Prop() placeholder?: string = ''; - /** Field ID used for the 'for' in the label */ - @Prop() fieldId: string; - /** Label for the radio button */ - @Prop() label: string; - /** If `true`, the radio button is selected. */ - @Prop() checked: boolean = false; - /** If `true`, the checkbox is disabled */ - @Prop() disabled: boolean = false; - /** Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes */ - @Prop() inputProps?: object; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - - {this.label} - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-radio-button/readme.md b/packages/amplify-ui-components/src/components/amplify-radio-button/readme.md deleted file mode 100644 index b5c19b06305..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-radio-button/readme.md +++ /dev/null @@ -1,43 +0,0 @@ -# amplify-radio-button - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | ----------- | -| `checked` | `checked` | If `true`, the radio button is selected. | `boolean` | `false` | -| `disabled` | `disabled` | If `true`, the checkbox is disabled | `boolean` | `false` | -| `fieldId` | `field-id` | Field ID used for the 'for' in the label | `string` | `undefined` | -| `handleInputChange` | -- | The callback, called when the input is modified by the user. | `(inputEvent: Event) => void` | `undefined` | -| `inputProps` | -- | Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes | `object` | `undefined` | -| `label` | `label` | Label for the radio button | `string` | `undefined` | -| `name` | `name` | (Optional) Name of radio button | `string` | `undefined` | -| `placeholder` | `placeholder` | (Optional) The placeholder for the input element. Using hints is recommended, but placeholders can also be useful to convey information to users. | `string` | `''` | -| `value` | `value` | (Optional) Value of radio button | `string` | `undefined` | - - -## Dependencies - -### Used by - - - [amplify-select-mfa-type](../amplify-select-mfa-type) - - [amplify-verify-contact](../amplify-verify-contact) - -### Depends on - -- [amplify-label](../amplify-label) - -### Graph -```mermaid -graph TD; - amplify-radio-button --> amplify-label - amplify-select-mfa-type --> amplify-radio-button - amplify-verify-contact --> amplify-radio-button - style amplify-radio-button fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-require-new-password/__snapshots__/amplify-require-new-password.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-require-new-password/__snapshots__/amplify-require-new-password.spec.ts.snap deleted file mode 100644 index b7c1455ed0e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-require-new-password/__snapshots__/amplify-require-new-password.spec.ts.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-require-new-password spec: Render logic -> should render default \`require new password\` form 1`] = ` - - - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-require-new-password/amplify-require-new-password.spec.ts b/packages/amplify-ui-components/src/components/amplify-require-new-password/amplify-require-new-password.spec.ts deleted file mode 100644 index eb74c5039ac..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-require-new-password/amplify-require-new-password.spec.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyRequireNewPassword } from './amplify-require-new-password'; -import { Translations } from '../../common/Translations'; -import { COUNTRY_DIAL_CODE_DEFAULT } from '../../common/constants'; - -describe('amplify-require-new-password spec:', () => { - describe('Component logic ->', () => { - let requireNewPassword; - - beforeEach(() => { - requireNewPassword = new AmplifyRequireNewPassword(); - }); - - it('should evaluate `handleSubmit` as defined by default', () => { - expect(requireNewPassword.handleSubmit).toBeDefined(); - }); - - it('should evaluate `user` as undefined by default', () => { - expect(requireNewPassword.user).toBeUndefined(); - }); - - it('should evaluate `headerText` to `Change Password` by default', () => { - expect(requireNewPassword.headerText).toEqual( - I18n.get(Translations.CHANGE_PASSWORD) - ); - }); - - it('should evaluate `submitButtonText` to `Change` by default', () => { - expect(requireNewPassword.submitButtonText).toEqual( - I18n.get(Translations.CHANGE_PASSWORD_ACTION) - ); - }); - - it('should evaluate `phoneNumber` with a valid country code by default', () => { - expect(requireNewPassword.phoneNumber.countryDialCodeValue).toEqual( - COUNTRY_DIAL_CODE_DEFAULT - ); - }); - }); - describe('Render logic ->', () => { - it('should render default `require new password` form', async () => { - const page = await newSpecPage({ - components: [AmplifyRequireNewPassword], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-require-new-password/amplify-require-new-password.stories.tsx b/packages/amplify-ui-components/src/components/amplify-require-new-password/amplify-require-new-password.stories.tsx deleted file mode 100644 index 1a95288d5f2..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-require-new-password/amplify-require-new-password.stories.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { storiesOf } from '@storybook/html'; - -const requireNewPasswordStories = storiesOf( - 'amplify-require-new-password', - module -); - -requireNewPasswordStories.add('default', () => { - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-require-new-password/amplify-require-new-password.tsx b/packages/amplify-ui-components/src/components/amplify-require-new-password/amplify-require-new-password.tsx deleted file mode 100644 index f7a8d57bd61..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-require-new-password/amplify-require-new-password.tsx +++ /dev/null @@ -1,217 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { Component, Prop, State, Watch, h, Host } from '@stencil/core'; -import { - FormFieldTypes, - PhoneNumberInterface, -} from '../amplify-auth-fields/amplify-auth-fields-interface'; -import { - AuthState, - ChallengeName, - CognitoUserInterface, - AuthFormField, - AuthStateHandler, -} from '../../common/types/auth-types'; -import { - COUNTRY_DIAL_CODE_DEFAULT, - NO_AUTH_MODULE_FOUND, - PHONE_SUFFIX, -} from '../../common/constants'; -import { Translations } from '../../common/Translations'; - -import { Auth } from '@aws-amplify/auth'; -import { ConsoleLogger as Logger } from '@aws-amplify/core'; -import { - dispatchToastHubEvent, - dispatchAuthStateChangeEvent, - getRequiredAttributesMap, - handlePhoneNumberChange, - composePhoneNumberInput, -} from '../../common/helpers'; -import { checkContact } from '../../common/auth-helpers'; - -const logger = new Logger('amplify-require-new-password'); - -@Component({ - tag: 'amplify-require-new-password', - shadow: true, -}) -export class AmplifyRequireNewPassword { - /** The header text of the forgot password section */ - @Prop() headerText: string = Translations.CHANGE_PASSWORD; - /** The text displayed inside of the submit button for the form */ - @Prop() submitButtonText: string = Translations.CHANGE_PASSWORD_ACTION; - /** The function called when submitting a new password */ - @Prop() handleSubmit: (event: Event) => void = event => - this.completeNewPassword(event); - /** Auth state change handler for this component */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - /** Used for the username to be passed to resend code */ - @Prop() user: CognitoUserInterface; - /** The form fields displayed inside of the forgot password form */ - @Prop() formFields: FormFieldTypes = [ - { - type: AuthFormField.Password, - required: true, - handleInputChange: event => this.handlePasswordChange(event), - label: I18n.get(Translations.NEW_PASSWORD_LABEL), - placeholder: I18n.get(Translations.NEW_PASSWORD_PLACEHOLDER), - inputProps: { - 'data-test': 'require-new-password-password-input', - }, - }, - ]; - - @State() password: string; - @State() loading: boolean = false; - - @Watch('user') - userHandler() { - this.setCurrentUser(); - } - - private requiredAttributes: Record = {}; - private newFormFields: FormFieldTypes = this.formFields; - private currentUser: CognitoUserInterface; - private phoneNumber: PhoneNumberInterface = { - countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT, - phoneNumberValue: ' ', - }; - - private handleRequiredAttributeInputChange(attribute, event) { - if (attribute === 'phone_number') { - this.formatPhoneNumber(event); - } else { - this.requiredAttributes[attribute] = event.target.value; - } - } - - async setCurrentUser(): Promise { - if (!this.user) { - // Check for authenticated user - try { - const user = await Auth.currentAuthenticatedUser(); - if (user) this.currentUser = user; - } catch (error) { - dispatchToastHubEvent(error); - } - } else { - this.currentUser = this.user; - } - if ( - this.currentUser && - this.currentUser.challengeParam && - this.currentUser.challengeParam.requiredAttributes - ) { - const userRequiredAttributes = this.currentUser.challengeParam - .requiredAttributes; - const requiredAttributesMap = getRequiredAttributesMap(); - userRequiredAttributes.forEach((attribute: string) => { - const formField = { - type: attribute, - required: true, - label: requiredAttributesMap[attribute].label, - placeholder: requiredAttributesMap[attribute].placeholder, - handleInputChange: event => - this.handleRequiredAttributeInputChange(attribute, event), - inputProps: { - 'data-test': `require-new-password-${attribute}-input`, - }, - }; - this.newFormFields = [...this.newFormFields, formField]; - }); - } - } - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - return this.setCurrentUser(); - } - - private handlePasswordChange(event) { - this.password = event.target.value; - } - - private formatPhoneNumber(event): void { - handlePhoneNumberChange(event, this.phoneNumber); - - /** - * composePhoneNumberInput will throw an error if the phoneNumberValue it receives - * is empty. Adding a check here to try and make sure that doesn't happen...but will - * wrap it in a try/catch block just in case as well - */ - try { - if ( - event.target.name === PHONE_SUFFIX && - this.phoneNumber.phoneNumberValue - ) { - const composedInput = composePhoneNumberInput(this.phoneNumber); - this.requiredAttributes['phone_number'] = composedInput; - } - } catch (err) { - logger.error(`error in phone number field - ${err}`); - } - } - - private async completeNewPassword(event: Event) { - if (event) { - event.preventDefault(); - } - - if (!Auth || typeof Auth.completeNewPassword !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - this.loading = true; - try { - const user = await Auth.completeNewPassword( - this.currentUser, - this.password, - this.requiredAttributes - ); - - logger.debug('complete new password', user); - switch (user.challengeName) { - case ChallengeName.SMSMFA: - this.handleAuthStateChange(AuthState.ConfirmSignIn, user); - break; - case ChallengeName.MFASetup: - logger.debug('TOTP setup', user.challengeParam); - this.handleAuthStateChange(AuthState.TOTPSetup, user); - break; - default: - await checkContact(user, this.handleAuthStateChange); - } - } catch (error) { - dispatchToastHubEvent(error); - } finally { - this.loading = false; - } - } - - render() { - return ( - - this.handleAuthStateChange(AuthState.SignIn)} - > - {I18n.get(Translations.BACK_TO_SIGN_IN)} - - } - submitButtonText={I18n.get(this.submitButtonText)} - > - - - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-require-new-password/readme.md b/packages/amplify-ui-components/src/components/amplify-require-new-password/readme.md deleted file mode 100644 index 7a1fe1f4b2e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-require-new-password/readme.md +++ /dev/null @@ -1,64 +0,0 @@ -# amplify-require-new-password - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | -------------------- | ------------------------------------------------------------ | --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `formFields` | -- | The form fields displayed inside of the forgot password form | `FormFieldTypes` | `[ { type: AuthFormField.Password, required: true, handleInputChange: event => this.handlePasswordChange(event), label: I18n.get(Translations.NEW_PASSWORD_LABEL), placeholder: I18n.get(Translations.NEW_PASSWORD_PLACEHOLDER), inputProps: { 'data-test': 'require-new-password-password-input', }, }, ]` | -| `handleAuthStateChange` | -- | Auth state change handler for this component | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | -| `handleSubmit` | -- | The function called when submitting a new password | `(event: Event) => void` | `event => this.completeNewPassword(event)` | -| `headerText` | `header-text` | The header text of the forgot password section | `string` | `Translations.CHANGE_PASSWORD` | -| `submitButtonText` | `submit-button-text` | The text displayed inside of the submit button for the form | `string` | `Translations.CHANGE_PASSWORD_ACTION` | -| `user` | -- | Used for the username to be passed to resend code | `CognitoUserInterface` | `undefined` | - - -## Dependencies - -### Used by - - - [amplify-authenticator](../amplify-authenticator) - -### Depends on - -- [amplify-form-section](../amplify-form-section) -- [amplify-button](../amplify-button) -- [amplify-auth-fields](../amplify-auth-fields) - -### Graph -```mermaid -graph TD; - amplify-require-new-password --> amplify-form-section - amplify-require-new-password --> amplify-button - amplify-require-new-password --> amplify-auth-fields - amplify-form-section --> amplify-section - amplify-form-section --> amplify-button - amplify-form-section --> amplify-loading-spinner - amplify-button --> amplify-icon - amplify-loading-spinner --> amplify-icon - amplify-auth-fields --> amplify-username-field - amplify-auth-fields --> amplify-password-field - amplify-auth-fields --> amplify-email-field - amplify-auth-fields --> amplify-code-field - amplify-auth-fields --> amplify-phone-field - amplify-auth-fields --> amplify-form-field - amplify-username-field --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-password-field --> amplify-form-field - amplify-email-field --> amplify-form-field - amplify-code-field --> amplify-form-field - amplify-phone-field --> amplify-form-field - amplify-phone-field --> amplify-country-dial-code - amplify-phone-field --> amplify-input - amplify-country-dial-code --> amplify-select - amplify-authenticator --> amplify-require-new-password - style amplify-require-new-password fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-s3-album/__snapshots__/amplify-s3-album.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-s3-album/__snapshots__/amplify-s3-album.spec.ts.snap deleted file mode 100644 index d24d238a4e9..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-album/__snapshots__/amplify-s3-album.spec.ts.snap +++ /dev/null @@ -1,14 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-s3-album spec: Render logic -> should render album 1`] = ` - - -
-
-
-
- -
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-s3-album/amplify-s3-album.scss b/packages/amplify-ui-components/src/components/amplify-s3-album/amplify-s3-album.scss deleted file mode 100644 index 3fd8ec03a7c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-album/amplify-s3-album.scss +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @prop --overlay-bg-color: Image overlay color on hover - */ -:host { - --overlay-bg-color: rgba(0, 0, 0, 0.15); -} - -.album-container { - box-sizing: border-box; - max-width: 100%; - margin: 0 auto; - padding: 0 2rem; -} - -.grid-row { - display: flex; - flex-wrap: wrap; - margin: -1rem -1rem; - padding-bottom: 3rem; -} - -.grid-item { - position: relative; - flex: 1 0 22rem; - flex-grow: 1; - margin: 1rem; - display: flex; - justify-content: center; -} - -amplify-s3-image { - --width: 22rem; - --height: 20rem; - border-radius: 5px; - object-fit: cover; -} - -.img-overlay { - display: none; - width: 100%; - height: 21rem; - position: absolute; - top: 0; - left: 0; - background-color: var(--overlay-bg-color); -} - -.grid-item:hover .img-overlay { - display: block; -} diff --git a/packages/amplify-ui-components/src/components/amplify-s3-album/amplify-s3-album.spec.ts b/packages/amplify-ui-components/src/components/amplify-s3-album/amplify-s3-album.spec.ts deleted file mode 100644 index f1ed1e1655c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-album/amplify-s3-album.spec.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyS3Album } from './amplify-s3-album'; -import { AccessLevel } from '../../common/types/storage-types'; -import { I18n } from '@aws-amplify/core'; -import { Translations } from '../../common/Translations'; - -describe('amplify-s3-album spec:', () => { - describe('Component logic ->', () => { - let amplifyS3Album; - - beforeEach(() => { - amplifyS3Album = new AmplifyS3Album(); - }); - - it('`path` should be undefined by default', () => { - expect(amplifyS3Album.path).toBeUndefined(); - }); - - it('`contentType` should be set to `binary/octet-stream` by default', () => { - expect(amplifyS3Album.contentType).toBe('binary/octet-stream'); - }); - - it('`level` should be set to `public` by default', () => { - expect(amplifyS3Album.level).toBe(AccessLevel.Public); - }); - - it('`track` should be undefined by default', () => { - expect(amplifyS3Album.track).toBeUndefined(); - }); - - it('`identityId` should be undefined by default', () => { - expect(amplifyS3Album.identityId).toBeUndefined(); - }); - - it('`fileToKey` should be undefined by default', () => { - expect(amplifyS3Album.fileToKey).toBeUndefined(); - }); - - it('`filter` should be undefined by default', () => { - expect(amplifyS3Album.filter).toBeUndefined(); - }); - - it('`sort` should be undefined by default', () => { - expect(amplifyS3Album.sort).toBeUndefined(); - }); - - it('`picker` should be true by default', () => { - expect(amplifyS3Album.picker).toBe(true); - }); - - it('`handleOnLoad` should be undefined by default', () => { - expect(amplifyS3Album.handleOnLoad).toBeUndefined(); - }); - - it('`handleOnError` should be undefined by default', () => { - expect(amplifyS3Album.handleOnError).toBeUndefined(); - }); - - it('`pickerText` should be defined by default', () => { - expect(amplifyS3Album.pickerText).toBe( - I18n.get(Translations.PICKER_TEXT) - ); - }); - }); - - describe('Render logic ->', () => { - it(`should render album`, async () => { - const page = await newSpecPage({ - components: [AmplifyS3Album], - html: ``, - }); - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-s3-album/amplify-s3-album.tsx b/packages/amplify-ui-components/src/components/amplify-s3-album/amplify-s3-album.tsx deleted file mode 100644 index 8a0f90356b3..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-album/amplify-s3-album.tsx +++ /dev/null @@ -1,171 +0,0 @@ -import { Component, Prop, h, State } from '@stencil/core'; -import { AccessLevel, StorageObject } from '../../common/types/storage-types'; -import { Storage } from '@aws-amplify/storage'; -import { Logger, filenameToContentType, I18n } from '@aws-amplify/core'; -import { NO_STORAGE_MODULE_FOUND } from '../../common/constants'; -import { - calcKey, - imageFileType, - putStorageObject, -} from '../../common/storage-helpers'; -import { v4 as uuid } from 'uuid'; -import { Translations } from '../../common/Translations'; - -const logger = new Logger('S3Album'); - -@Component({ - tag: 'amplify-s3-album', - styleUrl: 'amplify-s3-album.scss', - shadow: true, -}) -export class AmplifyS3Album { - /** String representing directory location of image files to be listed */ - @Prop() path: string; - /** The content type header used when uploading to S3 */ - @Prop() contentType: string = 'binary/octet-stream'; - /** The access level of the files */ - @Prop() level: AccessLevel = AccessLevel.Public; - /** Whether or not to use track the get/put of the listing of images */ - @Prop() track: boolean; - /** Cognito identity id of the another user's image list */ - @Prop() identityId: string; - /** Callback used to generate custom key value */ - @Prop() fileToKey: (data: object) => string | string; - /** Filter to be applied on album list */ - @Prop() filter: (list: StorageObject[]) => StorageObject[]; - /** Sort to be applied on album list */ - @Prop() sort: (list: StorageObject[]) => StorageObject[]; - /** Boolean to enable or disable picker */ - @Prop() picker: boolean = true; - /** Function executed when s3-image loads */ - @Prop() handleOnLoad: (event: Event) => void; - /** Function executed when error occurs for the s3-image */ - @Prop() handleOnError: (event: Event) => void; - /** Picker button text */ - @Prop() pickerText: string = Translations.PICKER_TEXT; - - @State() albumItems: StorageObject[] = []; - - private imgArr = {}; - - private list = async () => { - const { path = '', level, track, identityId } = this; - logger.debug('Album path: ' + path); - if (!Storage || typeof Storage.list !== 'function') { - throw new Error(NO_STORAGE_MODULE_FOUND); - } - - try { - const data = await Storage.list(path, { - level, - track, - identityId, - }); - this.marshal(data); - } catch (error) { - logger.warn(error); - } - }; - - private marshal = (list: StorageObject[]) => { - list.forEach((item: StorageObject) => { - const name = item.key.toLowerCase(); - const ext = name.split('.')[1]; - if (imageFileType.has(ext)) { - if ( - !item.contentType || - (item.contentType && item.contentType === 'binary/octet-stream') - ) { - item.contentType = this.getContentType(item); - } - } - }); - const filtered = list.filter( - (item: StorageObject) => - item.contentType && item.contentType.startsWith('image/') - ); - let items = this.filter ? this.filter(filtered) : filtered; - items = this.sort ? this.sort(items) : items; - this.albumItems = items; - logger.debug('album items', this.albumItems); - this.constructImgArray(this.albumItems); - }; - - private getContentType(item: StorageObject) { - return filenameToContentType(item.key, 'image/*'); - } - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - this.list(); - } - - private constructImgArray = (list: StorageObject[]) => { - list.map(item => { - this.imgArr[`${item['key']}`] = item['key']; - }); - }; - - private handlePick = async (event: Event) => { - const file = (event.target as HTMLInputElement).files[0]; - const { path = '', level, track, fileToKey } = this; - const key = path + calcKey(file, fileToKey); - - try { - await putStorageObject(key, file, level, track, file['type'], logger); - } catch (error) { - logger.error(error); - throw new Error(error); - } - - if (Object.keys(this.imgArr).includes(key)) { - this.albumItems = [...this.albumItems]; - this.imgArr[key] = `${key}-${uuid()}`; - } else { - const filtered = [ - ...this.albumItems, - ...(this.filter ? this.filter([{ key }]) : [{ key }]), - ]; - this.albumItems = this.sort ? this.sort(filtered) : filtered; - } - }; - - render() { - return ( -
-
-
- {this.albumItems.map(item => { - return ( -
- - -
- ); - })} -
-
- - {this.picker && ( - this.handlePick(e)} - acceptValue="image/*" - /> - )} -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-s3-album/readme.md b/packages/amplify-ui-components/src/components/amplify-s3-album/readme.md deleted file mode 100644 index 69b3304e27c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-album/readme.md +++ /dev/null @@ -1,52 +0,0 @@ -# amplify-s3-album - - - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| --------------- | -------------- | ------------------------------------------------------------------ | -------------------------------------------------------------------- | -------------------------- | -| `contentType` | `content-type` | The content type header used when uploading to S3 | `string` | `'binary/octet-stream'` | -| `fileToKey` | -- | Callback used to generate custom key value | `(data: object) => string` | `undefined` | -| `filter` | -- | Filter to be applied on album list | `(list: StorageObject[]) => StorageObject[]` | `undefined` | -| `handleOnError` | -- | Function executed when error occurs for the s3-image | `(event: Event) => void` | `undefined` | -| `handleOnLoad` | -- | Function executed when s3-image loads | `(event: Event) => void` | `undefined` | -| `identityId` | `identity-id` | Cognito identity id of the another user's image list | `string` | `undefined` | -| `level` | `level` | The access level of the files | `AccessLevel.Private \| AccessLevel.Protected \| AccessLevel.Public` | `AccessLevel.Public` | -| `path` | `path` | String representing directory location of image files to be listed | `string` | `undefined` | -| `picker` | `picker` | Boolean to enable or disable picker | `boolean` | `true` | -| `pickerText` | `picker-text` | Picker button text | `string` | `Translations.PICKER_TEXT` | -| `sort` | -- | Sort to be applied on album list | `(list: StorageObject[]) => StorageObject[]` | `undefined` | -| `track` | `track` | Whether or not to use track the get/put of the listing of images | `boolean` | `undefined` | - - -## CSS Custom Properties - -| Name | Description | -| -------------------- | ---------------------------- | -| `--overlay-bg-color` | Image overlay color on hover | - - -## Dependencies - -### Depends on - -- [amplify-s3-image](../amplify-s3-image) -- [amplify-picker](../amplify-picker) - -### Graph -```mermaid -graph TD; - amplify-s3-album --> amplify-s3-image - amplify-s3-album --> amplify-picker - amplify-picker --> amplify-button - amplify-button --> amplify-icon - style amplify-s3-album fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-s3-image-picker/__snapshots__/amplify-s3-image-picker.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-s3-image-picker/__snapshots__/amplify-s3-image-picker.spec.ts.snap deleted file mode 100644 index 213b4551b26..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-image-picker/__snapshots__/amplify-s3-image-picker.spec.ts.snap +++ /dev/null @@ -1,10 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-s3-image spec: Render logic -> should render no photo picker without 'path' 1`] = ` - - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-s3-image-picker/amplify-s3-image-picker.spec.ts b/packages/amplify-ui-components/src/components/amplify-s3-image-picker/amplify-s3-image-picker.spec.ts deleted file mode 100644 index 4637879a917..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-image-picker/amplify-s3-image-picker.spec.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { I18n } from '@aws-amplify/core'; -import { AmplifyS3ImagePicker } from './amplify-s3-image-picker'; -import { AccessLevel } from '../../common/types/storage-types'; -import { Translations } from '../../common/Translations'; - -describe('amplify-s3-image spec:', () => { - describe('Component logic ->', () => { - let amplifyS3ImagePicker; - - beforeEach(() => { - amplifyS3ImagePicker = new AmplifyS3ImagePicker(); - }); - - it('`path` should be undefined by default', () => { - expect(amplifyS3ImagePicker.path).toBeUndefined(); - }); - - it('`contentType` should be set to `binary/octet-stream` by default', () => { - expect(amplifyS3ImagePicker.contentType).toBe('binary/octet-stream'); - }); - - it('`level` should be set to `public` by default', () => { - expect(amplifyS3ImagePicker.level).toBe(AccessLevel.Public); - }); - - it('`track` should be undefined by default', () => { - expect(amplifyS3ImagePicker.track).toBeUndefined(); - }); - - it('`identityId` should be undefined by default', () => { - expect(amplifyS3ImagePicker.identityId).toBeUndefined(); - }); - - it('`fileToKey` should be undefined by default', () => { - expect(amplifyS3ImagePicker.fileToKey).toBeUndefined(); - }); - - it('`headerTitle` should have value by default', () => { - expect(amplifyS3ImagePicker.headerTitle).toBe( - I18n.get(Translations.IMAGE_PICKER_TITLE) - ); - }); - - it('`headerHint` should have value by default', () => { - expect(amplifyS3ImagePicker.headerHint).toBe( - I18n.get(Translations.IMAGE_PICKER_HINT) - ); - }); - - it('`placeholderHint` should have value by default', () => { - expect(amplifyS3ImagePicker.placeholderHint).toBe( - I18n.get(Translations.IMAGE_PICKER_PLACEHOLDER_HINT) - ); - }); - - it('`buttonText` should have value by default', () => { - expect(amplifyS3ImagePicker.buttonText).toBe( - I18n.get(Translations.IMAGE_PICKER_BUTTON_TEXT) - ); - }); - }); - - describe('Render logic ->', () => { - it(`should render no photo picker without 'path'`, async () => { - const page = await newSpecPage({ - components: [AmplifyS3ImagePicker], - html: ``, - }); - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-s3-image-picker/amplify-s3-image-picker.tsx b/packages/amplify-ui-components/src/components/amplify-s3-image-picker/amplify-s3-image-picker.tsx deleted file mode 100644 index 1c9152e2431..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-image-picker/amplify-s3-image-picker.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import { Component, Prop, h, State, Host } from '@stencil/core'; -import { Logger, I18n } from '@aws-amplify/core'; -import { AccessLevel } from '../../common/types/storage-types'; -import { - calcKey, - getStorageObject, - putStorageObject, -} from '../../common/storage-helpers'; -import { Translations } from '../../common/Translations'; - -const logger = new Logger('S3ImagePicker'); - -@Component({ - tag: 'amplify-s3-image-picker', -}) -export class AmplifyS3ImagePicker { - /** String representing directory location to image file */ - @Prop() path: string; - /** The content type header used when uploading to S3 */ - @Prop() contentType: string = 'binary/octet-stream'; - /** The access level of the image */ - @Prop() level: AccessLevel = AccessLevel.Public; - /** Whether or not to use track the get/put of the image */ - @Prop() track: boolean; - /** Cognito identity id of the another user's image */ - @Prop() identityId: string; - /** Callback used to generate custom key value */ - @Prop() fileToKey: (data: object) => string | string; - /** Title string value */ - @Prop() headerTitle?: string = Translations.IMAGE_PICKER_TITLE; - /** Header Hint value in string */ - @Prop() headerHint?: string = Translations.IMAGE_PICKER_HINT; - /** Placeholder hint that goes under the placeholder image */ - @Prop() placeholderHint?: string = Translations.IMAGE_PICKER_PLACEHOLDER_HINT; - /** Upload Button Text as string */ - @Prop() buttonText?: string = Translations.IMAGE_PICKER_BUTTON_TEXT; - /** Source for the image */ - @State() src: string | object; - - private handlePick = async (file: File) => { - const { path = '', level, track, identityId, fileToKey } = this; - const key = path + calcKey(file, fileToKey); - - try { - await putStorageObject(key, file, level, track, file['type'], logger); - - this.src = await getStorageObject(key, level, track, identityId, logger); - } catch (error) { - logger.error(error); - throw new Error(error); - } - }; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - - - - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-s3-image-picker/readme.md b/packages/amplify-ui-components/src/components/amplify-s3-image-picker/readme.md deleted file mode 100644 index c5d8ef319fa..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-image-picker/readme.md +++ /dev/null @@ -1,45 +0,0 @@ -# amplify-s3-image-picker - - - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------- | ------------------ | ------------------------------------------------------ | -------------------------------------------------------------------- | -------------------------------------------- | -| `buttonText` | `button-text` | Upload Button Text as string | `string` | `Translations.IMAGE_PICKER_BUTTON_TEXT` | -| `contentType` | `content-type` | The content type header used when uploading to S3 | `string` | `'binary/octet-stream'` | -| `fileToKey` | -- | Callback used to generate custom key value | `(data: object) => string` | `undefined` | -| `headerHint` | `header-hint` | Header Hint value in string | `string` | `Translations.IMAGE_PICKER_HINT` | -| `headerTitle` | `header-title` | Title string value | `string` | `Translations.IMAGE_PICKER_TITLE` | -| `identityId` | `identity-id` | Cognito identity id of the another user's image | `string` | `undefined` | -| `level` | `level` | The access level of the image | `AccessLevel.Private \| AccessLevel.Protected \| AccessLevel.Public` | `AccessLevel.Public` | -| `path` | `path` | String representing directory location to image file | `string` | `undefined` | -| `placeholderHint` | `placeholder-hint` | Placeholder hint that goes under the placeholder image | `string` | `Translations.IMAGE_PICKER_PLACEHOLDER_HINT` | -| `track` | `track` | Whether or not to use track the get/put of the image | `boolean` | `undefined` | - - -## Dependencies - -### Depends on - -- [amplify-photo-picker](../amplify-photo-picker) - -### Graph -```mermaid -graph TD; - amplify-s3-image-picker --> amplify-photo-picker - amplify-photo-picker --> amplify-section - amplify-photo-picker --> amplify-picker - amplify-photo-picker --> amplify-icon - amplify-photo-picker --> amplify-button - amplify-picker --> amplify-button - amplify-button --> amplify-icon - style amplify-s3-image-picker fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-s3-image/__snapshots__/amplify-s3-image.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-s3-image/__snapshots__/amplify-s3-image.spec.ts.snap deleted file mode 100644 index 8dfa5b4b712..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-image/__snapshots__/amplify-s3-image.spec.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-s3-image spec: Render logic -> should render img element with 'imgKey' or 'path' 1`] = ` - - - -`; - -exports[`amplify-s3-image spec: Render logic -> should render no img element without 'imgKey' or 'path' 1`] = ` - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-s3-image/amplify-s3-image.scss b/packages/amplify-ui-components/src/components/amplify-s3-image/amplify-s3-image.scss deleted file mode 100644 index a636a5c4647..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-image/amplify-s3-image.scss +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @prop --height: Image height - * @prop --width: Image width - */ -:host { - height: inherit; - width: inherit; - - --height: inherit; - --width: inherit; -} - -img { - height: var(--height); - width: var(--width); -} diff --git a/packages/amplify-ui-components/src/components/amplify-s3-image/amplify-s3-image.spec.ts b/packages/amplify-ui-components/src/components/amplify-s3-image/amplify-s3-image.spec.ts deleted file mode 100644 index 195c8720718..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-image/amplify-s3-image.spec.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyS3Image } from './amplify-s3-image'; -import { AccessLevel } from '../../common/types/storage-types'; - -describe('amplify-s3-image spec:', () => { - describe('Component logic ->', () => { - let amplifyS3Image; - - beforeEach(() => { - amplifyS3Image = new AmplifyS3Image(); - }); - - it('`imgKey` should be undefined by default', () => { - expect(amplifyS3Image.imgKey).toBeUndefined(); - }); - - it('`path` should be undefined by default', () => { - expect(amplifyS3Image.path).toBeUndefined(); - }); - - it('`alt` should be undefined by default', () => { - expect(amplifyS3Image.alt).toBeUndefined(); - }); - - it('`body` should be undefined by default', () => { - expect(amplifyS3Image.body).toBeUndefined(); - }); - - it('`contentType` should be set to `binary/octet-stream` by default', () => { - expect(amplifyS3Image.contentType).toBe('binary/octet-stream'); - }); - - it('`level` should be set to `public` by default', () => { - expect(amplifyS3Image.level).toBe(AccessLevel.Public); - }); - - it('`track` should be undefined by default', () => { - expect(amplifyS3Image.track).toBeUndefined(); - }); - - it('`identityId` should be undefined by default', () => { - expect(amplifyS3Image.identityId).toBeUndefined(); - }); - - it('`handleOnLoad` should be undefined by default', () => { - expect(amplifyS3Image.handleOnLoad).toBeUndefined(); - }); - - it('`handleOnError` should be undefined by default', () => { - expect(amplifyS3Image.handleOnError).toBeUndefined(); - }); - - it('`imgProps` should be undefined by default', () => { - expect(amplifyS3Image.imgProps).toBeUndefined(); - }); - }); - - describe('Render logic ->', () => { - it(`should render no img element without 'imgKey' or 'path'`, async () => { - const page = await newSpecPage({ - components: [AmplifyS3Image], - html: ``, - }); - expect(page.root).toMatchSnapshot(); - }); - - it(`should render img element with 'imgKey' or 'path'`, async () => { - const page = await newSpecPage({ - components: [AmplifyS3Image], - html: ``, - }); - page.rootInstance.imgKey = 'abc.jpg'; - await page.waitForChanges(); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-s3-image/amplify-s3-image.stories.tsx b/packages/amplify-ui-components/src/components/amplify-s3-image/amplify-s3-image.stories.tsx deleted file mode 100644 index 8aadf59d99e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-image/amplify-s3-image.stories.tsx +++ /dev/null @@ -1,5 +0,0 @@ -export default { - title: 'amplify-s3-image', -}; - -export const defaults = () => ``; diff --git a/packages/amplify-ui-components/src/components/amplify-s3-image/amplify-s3-image.tsx b/packages/amplify-ui-components/src/components/amplify-s3-image/amplify-s3-image.tsx deleted file mode 100644 index e779f7c1226..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-image/amplify-s3-image.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import { Component, Prop, h, State, Host, Watch } from '@stencil/core'; -import { Logger } from '@aws-amplify/core'; -import { AccessLevel } from '../../common/types/storage-types'; -import { - getStorageObject, - putStorageObject, -} from '../../common/storage-helpers'; - -const logger = new Logger('S3Image'); - -@Component({ - tag: 'amplify-s3-image', - styleUrl: 'amplify-s3-image.scss', - shadow: true, -}) -export class AmplifyS3Image { - /** The key of the image object in S3 */ - @Prop() imgKey: string; - /** String representing directory location to image file */ - @Prop() path: string; - /** String representing the alternate image text */ - @Prop() alt: string; - /** Image body content to be uploaded */ - @Prop() body: object; - /** The content type header used when uploading to S3 */ - @Prop() contentType: string = 'binary/octet-stream'; - /** The access level of the image */ - @Prop() level: AccessLevel = AccessLevel.Public; - /** Whether or not to use track on get/put of the image */ - @Prop() track: boolean; - /** Cognito identity id of the another user's image */ - @Prop() identityId: string; - /** Function executed when image loads */ - @Prop() handleOnLoad: (event: Event) => void; - /** Function executed when error occurs for the image */ - @Prop() handleOnError: (event: Event) => void; - /** Attributes to be placed on the img element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes */ - @Prop() imgProps?: Record; - /** Source for the image */ - @State() src: string | object; - - @Watch('body') - async watchHandler() { - await this.load(); - } - - async componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - await this.load(); - } - - private async load() { - const { imgKey, path, body, contentType, level, track, identityId } = this; - if (!imgKey && !path) { - logger.debug('empty imgKey and path'); - return; - } - - const key = imgKey || path; - logger.debug('loading ' + key + '...'); - - try { - if (body) { - await putStorageObject(imgKey, body, level, track, contentType, logger); - } - this.src = await getStorageObject(key, level, track, identityId, logger); - } catch (err) { - logger.debug(err); - throw new Error(err); - } - } - - render() { - return ( - - {this.src && ( - {this.alt} - )} - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-s3-image/readme.md b/packages/amplify-ui-components/src/components/amplify-s3-image/readme.md deleted file mode 100644 index ca21e6f9119..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-image/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# amplify-s3-image - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| --------------- | -------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | ----------------------- | -| `alt` | `alt` | String representing the alternate image text | `string` | `undefined` | -| `body` | -- | Image body content to be uploaded | `object` | `undefined` | -| `contentType` | `content-type` | The content type header used when uploading to S3 | `string` | `'binary/octet-stream'` | -| `handleOnError` | -- | Function executed when error occurs for the image | `(event: Event) => void` | `undefined` | -| `handleOnLoad` | -- | Function executed when image loads | `(event: Event) => void` | `undefined` | -| `identityId` | `identity-id` | Cognito identity id of the another user's image | `string` | `undefined` | -| `imgKey` | `img-key` | The key of the image object in S3 | `string` | `undefined` | -| `imgProps` | -- | Attributes to be placed on the img element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes | `{ [x: string]: any; [x: number]: any; }` | `undefined` | -| `level` | `level` | The access level of the image | `AccessLevel.Private \| AccessLevel.Protected \| AccessLevel.Public` | `AccessLevel.Public` | -| `path` | `path` | String representing directory location to image file | `string` | `undefined` | -| `track` | `track` | Whether or not to use track on get/put of the image | `boolean` | `undefined` | - - -## CSS Custom Properties - -| Name | Description | -| ---------- | ------------ | -| `--height` | Image height | -| `--width` | Image width | - - -## Dependencies - -### Used by - - - [amplify-s3-album](../amplify-s3-album) - -### Graph -```mermaid -graph TD; - amplify-s3-album --> amplify-s3-image - style amplify-s3-image fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-s3-text-picker/__snapshots__/amplify-s3-text-picker.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-s3-text-picker/__snapshots__/amplify-s3-text-picker.spec.ts.snap deleted file mode 100644 index c364979f9f9..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-text-picker/__snapshots__/amplify-s3-text-picker.spec.ts.snap +++ /dev/null @@ -1,10 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-s3-image spec: Render logic -> should render no pre tag without 'path' 1`] = ` - - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-s3-text-picker/amplify-s3-text-picker.spec.ts b/packages/amplify-ui-components/src/components/amplify-s3-text-picker/amplify-s3-text-picker.spec.ts deleted file mode 100644 index 92adb47b805..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-text-picker/amplify-s3-text-picker.spec.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyS3TextPicker } from './amplify-s3-text-picker'; -import { AccessLevel } from '../../common/types/storage-types'; - -describe('amplify-s3-image spec:', () => { - describe('Component logic ->', () => { - let amplifyS3TextPicker; - - beforeEach(() => { - amplifyS3TextPicker = new AmplifyS3TextPicker(); - }); - - it('`path` should be undefined by default', () => { - expect(amplifyS3TextPicker.path).toBeUndefined(); - }); - - it('`contentType` should be set to `text/*` by default', () => { - expect(amplifyS3TextPicker.contentType).toBe('text/*'); - }); - - it('`level` should be set to `public` by default', () => { - expect(amplifyS3TextPicker.level).toBe(AccessLevel.Public); - }); - - it('`track` should be undefined by default', () => { - expect(amplifyS3TextPicker.track).toBeUndefined(); - }); - - it('`identityId` should be undefined by default', () => { - expect(amplifyS3TextPicker.identityId).toBeUndefined(); - }); - - it('`fileToKey` should be undefined by default', () => { - expect(amplifyS3TextPicker.fileToKey).toBeUndefined(); - }); - }); - - describe('Render logic ->', () => { - it(`should render no pre tag without 'path'`, async () => { - const page = await newSpecPage({ - components: [AmplifyS3TextPicker], - html: ``, - }); - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-s3-text-picker/amplify-s3-text-picker.tsx b/packages/amplify-ui-components/src/components/amplify-s3-text-picker/amplify-s3-text-picker.tsx deleted file mode 100644 index 3cbd206e0dd..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-text-picker/amplify-s3-text-picker.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import { Component, Prop, h, State, Host } from '@stencil/core'; -import { Logger, I18n } from '@aws-amplify/core'; -import { AccessLevel } from '../../common/types/storage-types'; -import { calcKey, putStorageObject } from '../../common/storage-helpers'; -import { Translations } from '../../common/Translations'; - -const logger = new Logger('S3TextPicker'); - -@Component({ - tag: 'amplify-s3-text-picker', - shadow: true, -}) -export class AmplifyS3TextPicker { - /** String representing directory location to text file */ - @Prop() path: string; - /** The content type header used when uploading to S3 */ - @Prop() contentType: string = 'text/*'; - /** The access level of the text file */ - @Prop() level: AccessLevel = AccessLevel.Public; - /** Whether or not to use track the get/put of the text file */ - @Prop() track: boolean; - /** Cognito identity id of the another user's text file */ - @Prop() identityId: string; - /** Callback used to generate custom key value */ - @Prop() fileToKey: (data: object) => string | string; - /** Fallback content for aplify-s3-text */ - @Prop() fallbackText: string = Translations.PICKER_TEXT; - /** Source content of text */ - @State() src: string; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - private async handleInput(event: Event) { - const file = (event.target as HTMLInputElement).files[0]; - - const { path = '', level, fileToKey, track } = this; - const key = path + calcKey(file, fileToKey); - - if (!file) { - throw new Error('No file was selected'); - } - - try { - await putStorageObject(key, file, level, track, file['type'], logger); - this.src = key; - } catch (error) { - logger.debug(error); - throw new Error(error); - } - } - - render() { - return ( - - - this.handleInput(e)} - acceptValue={'text/*'} - > - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-s3-text-picker/readme.md b/packages/amplify-ui-components/src/components/amplify-s3-text-picker/readme.md deleted file mode 100644 index d62c09969ad..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-text-picker/readme.md +++ /dev/null @@ -1,40 +0,0 @@ -# amplify-s3-text-picker - - - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| -------------- | --------------- | -------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------- | -| `contentType` | `content-type` | The content type header used when uploading to S3 | `string` | `'text/*'` | -| `fallbackText` | `fallback-text` | Fallback content for aplify-s3-text | `string` | `Translations.PICKER_TEXT` | -| `fileToKey` | -- | Callback used to generate custom key value | `(data: object) => string` | `undefined` | -| `identityId` | `identity-id` | Cognito identity id of the another user's text file | `string` | `undefined` | -| `level` | `level` | The access level of the text file | `AccessLevel.Private \| AccessLevel.Protected \| AccessLevel.Public` | `AccessLevel.Public` | -| `path` | `path` | String representing directory location to text file | `string` | `undefined` | -| `track` | `track` | Whether or not to use track the get/put of the text file | `boolean` | `undefined` | - - -## Dependencies - -### Depends on - -- [amplify-s3-text](../amplify-s3-text) -- [amplify-picker](../amplify-picker) - -### Graph -```mermaid -graph TD; - amplify-s3-text-picker --> amplify-s3-text - amplify-s3-text-picker --> amplify-picker - amplify-picker --> amplify-button - amplify-button --> amplify-icon - style amplify-s3-text-picker fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-s3-text/__snapshots__/amplify-s3-text.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-s3-text/__snapshots__/amplify-s3-text.spec.ts.snap deleted file mode 100644 index b17b99c7064..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-text/__snapshots__/amplify-s3-text.spec.ts.snap +++ /dev/null @@ -1,15 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-s3-image spec: Render logic -> should render no pre tag without 'textKey' or 'path' 1`] = ` - - -
-
-
-          Fallback Content
-        
-
-
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-s3-text/amplify-s3-text.scss b/packages/amplify-ui-components/src/components/amplify-s3-text/amplify-s3-text.scss deleted file mode 100644 index 55bfa20bfa2..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-text/amplify-s3-text.scss +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @prop --container-color: Background color of the text container - * @prop --border-color: Border color of the text container - * @prop --text-color: Font color of the text - * @prop --font-size: Font size of the text - */ -:host { - --container-color: var(--amplify-smoke-white); - --border-color: var(--amplify-light-grey); - --font-size: var(--amplify-text-md); - --text-color: var(--amplify-secondary-color); -} - -.text-container { - background-color: var(--container-color); - border: 1px solid var(--border-color); - border-radius: 5px; - margin-bottom: 10px; -} - -pre { - display: block; - margin: 0.5rem 0; - padding: 0.5rem; - line-height: 1rem; - max-height: 50rem; - font-size: var(--font-size); - color: var(--text-color); - word-break: break-all; - overflow-y: scroll; - overflow-x: auto; -} diff --git a/packages/amplify-ui-components/src/components/amplify-s3-text/amplify-s3-text.spec.ts b/packages/amplify-ui-components/src/components/amplify-s3-text/amplify-s3-text.spec.ts deleted file mode 100644 index d4051d2d953..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-text/amplify-s3-text.spec.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyS3Text } from './amplify-s3-text'; -import { AccessLevel } from '../../common/types/storage-types'; - -describe('amplify-s3-image spec:', () => { - describe('Component logic ->', () => { - let amplifyS3Text; - - beforeEach(() => { - amplifyS3Text = new AmplifyS3Text(); - }); - - it('`textKey` should be undefined by default', () => { - expect(amplifyS3Text.textKey).toBeUndefined(); - }); - - it('`path` should be undefined by default', () => { - expect(amplifyS3Text.path).toBeUndefined(); - }); - - it('`contentType` should be set to `text/*` by default', () => { - expect(amplifyS3Text.contentType).toBe('text/*'); - }); - - it('`level` should be set to `public` by default', () => { - expect(amplifyS3Text.level).toBe(AccessLevel.Public); - }); - - it('`track` should be undefined by default', () => { - expect(amplifyS3Text.track).toBeUndefined(); - }); - - it('`identityId` should be undefined by default', () => { - expect(amplifyS3Text.identityId).toBeUndefined(); - }); - }); - - describe('Render logic ->', () => { - it(`should render no pre tag without 'textKey' or 'path'`, async () => { - const page = await newSpecPage({ - components: [AmplifyS3Text], - html: ``, - }); - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-s3-text/amplify-s3-text.tsx b/packages/amplify-ui-components/src/components/amplify-s3-text/amplify-s3-text.tsx deleted file mode 100644 index 6647c346d25..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-text/amplify-s3-text.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { Component, Prop, h, State, Watch } from '@stencil/core'; -import { Logger, I18n } from '@aws-amplify/core'; -import { AccessLevel } from '../../common/types/storage-types'; -import { getTextSource, putStorageObject } from '../../common/storage-helpers'; -import { Translations } from '../../common/Translations'; - -const logger = new Logger('S3Text'); - -@Component({ - tag: 'amplify-s3-text', - styleUrl: 'amplify-s3-text.scss', - shadow: true, -}) -export class AmplifyS3Text { - /** The key of the text object in S3 */ - @Prop() textKey: string; - /** String representing directory location to text file */ - @Prop() path: string; - /** Text body content to be uploaded */ - @Prop() body: object; - /** The content type header used when uploading to S3 */ - @Prop() contentType: string = 'text/*'; - /** The access level of the text file */ - @Prop() level: AccessLevel = AccessLevel.Public; - /** Whether or not to use track the get/put of the text file */ - @Prop() track: boolean; - /** Cognito identity id of the another user's text file */ - @Prop() identityId: string; - /** Fallback content */ - @Prop() fallbackText: string = Translations.TEXT_FALLBACK_CONTENT; - /** Source content of text */ - @State() src: string; - - @Watch('textKey') - @Watch('body') - async watchHandler() { - await this.load(); - } - - async componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - await this.load(); - } - - private async load() { - const { path, textKey, body, contentType, level, track, identityId } = this; - if (!textKey && !path) { - logger.debug('empty textKey and path'); - return; - } - - const key = textKey || path; - logger.debug('loading ' + key + '...'); - - if (body) { - await putStorageObject(textKey, body, level, track, contentType, logger); - } - try { - this.src = await getTextSource(key, level, track, identityId, logger); - } catch (err) { - logger.debug(err); - throw new Error(err); - } - } - - render() { - return ( -
-
- {this.src ? ( -
{this.src}
- ) : ( -
{I18n.get(this.fallbackText)}
- )} -
-
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-s3-text/readme.md b/packages/amplify-ui-components/src/components/amplify-s3-text/readme.md deleted file mode 100644 index 1fcc6901f54..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-s3-text/readme.md +++ /dev/null @@ -1,47 +0,0 @@ -# amplify-s3-text - - - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| -------------- | --------------- | -------------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------------ | -| `body` | -- | Text body content to be uploaded | `object` | `undefined` | -| `contentType` | `content-type` | The content type header used when uploading to S3 | `string` | `'text/*'` | -| `fallbackText` | `fallback-text` | Fallback content | `string` | `Translations.TEXT_FALLBACK_CONTENT` | -| `identityId` | `identity-id` | Cognito identity id of the another user's text file | `string` | `undefined` | -| `level` | `level` | The access level of the text file | `AccessLevel.Private \| AccessLevel.Protected \| AccessLevel.Public` | `AccessLevel.Public` | -| `path` | `path` | String representing directory location to text file | `string` | `undefined` | -| `textKey` | `text-key` | The key of the text object in S3 | `string` | `undefined` | -| `track` | `track` | Whether or not to use track the get/put of the text file | `boolean` | `undefined` | - - -## CSS Custom Properties - -| Name | Description | -| ------------------- | -------------------------------------- | -| `--border-color` | Border color of the text container | -| `--container-color` | Background color of the text container | -| `--font-size` | Font size of the text | -| `--text-color` | Font color of the text | - - -## Dependencies - -### Used by - - - [amplify-s3-text-picker](../amplify-s3-text-picker) - -### Graph -```mermaid -graph TD; - amplify-s3-text-picker --> amplify-s3-text - style amplify-s3-text fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-section/amplify-section.scss b/packages/amplify-ui-components/src/components/amplify-section/amplify-section.scss deleted file mode 100644 index 58d47fc22e6..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-section/amplify-section.scss +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @prop --font-family: Font family of the text within the container - * @prop --background-color: Background color of the container - */ -amplify-section { - --font-family: var(--amplify-font-family); - --background-color: var(--amplify-background-color); -} - -.section { - position: relative; - margin-bottom: var(--margin-bottom, 20px); - background-color: var(--background-color); - padding: var(--padding, 35px 40px); - text-align: left; - display: inline-block; - border-radius: var(--border-radius, 6px); - box-shadow: var(--box-shadow, 1px 1px 4px 0 rgba(0, 0, 0, 0.15)); - box-sizing: border-box; - font-family: var(--font-family); - - width: 100%; - min-width: var(--min-width, 20rem); - - @include md { - width: var(--width, 28.75rem); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-section/amplify-section.tsx b/packages/amplify-ui-components/src/components/amplify-section/amplify-section.tsx deleted file mode 100644 index 3e1b80ec13a..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-section/amplify-section.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Component, Element, Prop, h } from '@stencil/core'; - -@Component({ - tag: 'amplify-section', - styleUrl: 'amplify-section.scss', -}) -export class AmplifySection { - @Element() el: HTMLAmplifySectionElement; - /** Equivalent to html section role */ - @Prop() role: string = 'application'; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( -
- -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-section/readme.md b/packages/amplify-ui-components/src/components/amplify-section/readme.md deleted file mode 100644 index 6e04109e1b3..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-section/readme.md +++ /dev/null @@ -1,40 +0,0 @@ -# amplify-section - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| -------- | --------- | ------------------------------- | -------- | --------------- | -| `role` | `role` | Equivalent to html section role | `string` | `'application'` | - - -## CSS Custom Properties - -| Name | Description | -| -------------------- | -------------------------------------------- | -| `--background-color` | Background color of the container | -| `--font-family` | Font family of the text within the container | - - -## Dependencies - -### Used by - - - [amplify-federated-sign-in](../amplify-federated-sign-in) - - [amplify-form-section](../amplify-form-section) - - [amplify-photo-picker](../amplify-photo-picker) - -### Graph -```mermaid -graph TD; - amplify-federated-sign-in --> amplify-section - amplify-form-section --> amplify-section - amplify-photo-picker --> amplify-section - style amplify-section fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-select-mfa-type/__snapshots__/amplify-select-mfa-type.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-select-mfa-type/__snapshots__/amplify-select-mfa-type.spec.ts.snap deleted file mode 100644 index 26cff344411..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select-mfa-type/__snapshots__/amplify-select-mfa-type.spec.ts.snap +++ /dev/null @@ -1,29 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-select-mfa-type spec: Render logic -> should render \`TOTP, SMS, No MFA\` values 1`] = ` - - -
- - - - - -
-
-
-`; - -exports[`amplify-select-mfa-type spec: Render logic -> should render a \`less than 2 MFA types available\` message by default 1`] = ` - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-select-mfa-type/amplify-select-mfa-type.spec.ts b/packages/amplify-ui-components/src/components/amplify-select-mfa-type/amplify-select-mfa-type.spec.ts deleted file mode 100644 index e06646c2444..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select-mfa-type/amplify-select-mfa-type.spec.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { MfaOption } from '../../common/types/auth-types'; -import { AmplifySelectMFAType } from './amplify-select-mfa-type'; - -describe('amplify-select-mfa-type spec:', () => { - describe('Component logic ->', () => { - let selectMFAType; - - beforeEach(() => { - selectMFAType = new AmplifySelectMFAType(); - }); - - it('should render authData to undefined by default', () => { - expect(selectMFAType.authData).toBeUndefined(); - }); - - it('should render `MFATypes` to undefined by default', () => { - expect(selectMFAType.MFATypes).toBeUndefined(); - }); - - it('should set the isToastVisible property to true when the Verify function is run', async () => { - selectMFAType.MFATypes = { - SMS: true, - Optional: true, - TOTP: true, - }; - - expect(selectMFAType.isToastVisible).toBe(false); - - await selectMFAType.verify({ - preventDefault: jest.fn(), - }); - - expect(selectMFAType.isToastVisible).toBe(true); - }); - - it('should reset isToastVisible to false when a new radio button is selected', async () => { - selectMFAType.MFATypes = { - SMS: true, - Optional: true, - TOTP: true, - }; - - expect(selectMFAType.isToastVisible).toBe(false); - - await selectMFAType.verify({ - preventDefault: jest.fn(), - }); - - expect(selectMFAType.isToastVisible).toBe(true); - - selectMFAType.handleRadioButtonChange({ - target: { - value: MfaOption.SMS, - type: 'radio', - checked: true, - }, - }); - - expect(selectMFAType.isToastVisible).toBe(false); - }); - }); - describe('Render logic ->', () => { - it('should render a `less than 2 MFA types available` message by default', async () => { - const page = await newSpecPage({ - components: [AmplifySelectMFAType], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render `TOTP, SMS, No MFA` values', async () => { - const page = await newSpecPage({ - components: [AmplifySelectMFAType], - html: `
`, - }); - - const component = page.doc.createElement('amplify-select-mfa-type'); - (component as any).MFATypes = { - SMS: true, - Optional: true, - TOTP: true, - }; - - page.root.appendChild(component); - await page.waitForChanges(); - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-select-mfa-type/amplify-select-mfa-type.stories.tsx b/packages/amplify-ui-components/src/components/amplify-select-mfa-type/amplify-select-mfa-type.stories.tsx deleted file mode 100644 index ef78c275a41..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select-mfa-type/amplify-select-mfa-type.stories.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { storiesOf } from '@storybook/html'; - -const selectMfaTypeStories = storiesOf('amplify-select-mfa-type', module); - -selectMfaTypeStories.add('default', () => { - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-select-mfa-type/amplify-select-mfa-type.tsx b/packages/amplify-ui-components/src/components/amplify-select-mfa-type/amplify-select-mfa-type.tsx deleted file mode 100644 index b17a2457f1d..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select-mfa-type/amplify-select-mfa-type.tsx +++ /dev/null @@ -1,205 +0,0 @@ -import { Component, Prop, State, h } from '@stencil/core'; -import { I18n, Logger } from '@aws-amplify/core'; -import { Auth } from '@aws-amplify/auth'; -import { - CognitoUserInterface, - MFATypesInterface, - MfaOption, -} from '../../common/types/auth-types'; -import { - NO_AUTH_MODULE_FOUND, - USER_NOT_SETUP_SOFTWARE_TOKEN_MFA, - USER_NOT_VERIFIED_SOFTWARE_TOKEN_MFA, -} from '../../common/constants'; -import { Translations } from '../../common/Translations'; - -const logger = new Logger('SelectMFAType'); - -@Component({ - tag: 'amplify-select-mfa-type', - shadow: true, -}) -export class AmplifySelectMFAType { - /** Types of MFA options */ - @Prop() MFATypes: MFATypesInterface; - /** Current authenticated user in order to sign requests properly for TOTP */ - @Prop() authData: CognitoUserInterface; - /** Fires when Verify is clicked */ - @Prop() handleSubmit: (event: Event) => void = event => this.verify(event); - - @State() TOTPSetup: boolean = false; - @State() selectMessage: string = null; - @State() MFAMethod: MfaOption = null; - - @State() isTOTP: boolean = false; - @State() isNoMFA: boolean = false; - @State() isSMS: boolean = false; - @State() loading: boolean = false; - - @State() isToastVisible: boolean = false; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - private handleRadioButtonChange(event) { - this.TOTPSetup = false; - this.selectMessage = null; - - // Reseting state values to default - this.isNoMFA = false; - this.isTOTP = false; - this.isSMS = false; - this.isToastVisible = false; - - const { value, type, checked } = event.target; - const checkType = ['radio', 'checkbox'].includes(type); - - if (value === MfaOption.SMS && checkType) { - this.isSMS = checked; - } - - if (value === MfaOption.TOTP && checkType) { - this.isTOTP = checked; - } - - if (value === MfaOption.NOMFA && checkType) { - this.isNoMFA = checked; - } - } - - private async verify(event: Event) { - // avoid submitting the form - if (event) { - event.preventDefault(); - } - - logger.debug('MFA Type Values', { - TOTP: this.isTOTP, - SMS: this.isSMS, - 'No MFA': this.isNoMFA, - }); - - if (this.isTOTP) { - this.MFAMethod = MfaOption.TOTP; - } else if (this.isSMS) { - this.MFAMethod = MfaOption.SMS; - } else if (this.isNoMFA) { - this.MFAMethod = MfaOption.NOMFA; - } - - const user = this.authData; - - if (!Auth || typeof Auth.setPreferredMFA !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - this.loading = true; - try { - const preferredMFAData = await Auth.setPreferredMFA(user, this.MFAMethod); - - logger.debug('Set Preferred MFA Succeeded', preferredMFAData); - this.selectMessage = `${I18n.get(Translations.SUCCESS_MFA_TYPE)} ${ - this.MFAMethod - }`; - } catch (error) { - const { message } = error; - - if ( - message === USER_NOT_SETUP_SOFTWARE_TOKEN_MFA || - message === USER_NOT_VERIFIED_SOFTWARE_TOKEN_MFA - ) { - this.TOTPSetup = true; - this.selectMessage = I18n.get(Translations.SETUP_TOTP_REQUIRED); - } else { - logger.debug('Set Preferred MFA failed', error); - this.selectMessage = I18n.get( - Translations.UNABLE_TO_SETUP_MFA_AT_THIS_TIME - ); - } - } finally { - this.loading = false; - this.isToastVisible = true; - } - } - - private contentBuilder() { - if (!this.MFATypes || Object.keys(this.MFATypes).length < 2) { - logger.debug(I18n.get(Translations.LESS_THAN_TWO_MFA_VALUES_MESSAGE)); - return ( - - ); - } - - const { SMS, TOTP, Optional } = this.MFATypes; - - return ( - this.handleSubmit(event)} - loading={this.loading} - > - {SMS ? ( - this.handleRadioButtonChange(event)} - /> - ) : null} - {TOTP ? ( - this.handleRadioButtonChange(event)} - /> - ) : null} - {Optional ? ( - this.handleRadioButtonChange(event)} - /> - ) : null} - - ); - } - - private renderToast() { - if (this.isToastVisible && this.selectMessage) { - return ( - { - this.selectMessage = null; - this.isToastVisible = false; - }} - /> - ); - } - - return null; - } - - render() { - return ( -
- {this.contentBuilder()} - {this.TOTPSetup ? : null} - {this.renderToast()} -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-select-mfa-type/readme.md b/packages/amplify-ui-components/src/components/amplify-select-mfa-type/readme.md deleted file mode 100644 index d4f8a13d894..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select-mfa-type/readme.md +++ /dev/null @@ -1,48 +0,0 @@ -# amplify-totp - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| -------------- | --------- | ---------------------------------------------------------------------- | ------------------------ | ----------------------------- | -| `MFATypes` | -- | Types of MFA options | `MFATypesInterface` | `undefined` | -| `authData` | -- | Current authenticated user in order to sign requests properly for TOTP | `CognitoUserInterface` | `undefined` | -| `handleSubmit` | -- | Fires when Verify is clicked | `(event: Event) => void` | `event => this.verify(event)` | - - -## Dependencies - -### Depends on - -- [amplify-form-section](../amplify-form-section) -- [amplify-radio-button](../amplify-radio-button) -- [amplify-toast](../amplify-toast) -- [amplify-totp-setup](../amplify-totp-setup) - -### Graph -```mermaid -graph TD; - amplify-select-mfa-type --> amplify-form-section - amplify-select-mfa-type --> amplify-radio-button - amplify-select-mfa-type --> amplify-toast - amplify-select-mfa-type --> amplify-totp-setup - amplify-form-section --> amplify-section - amplify-form-section --> amplify-button - amplify-form-section --> amplify-loading-spinner - amplify-button --> amplify-icon - amplify-loading-spinner --> amplify-icon - amplify-radio-button --> amplify-label - amplify-toast --> amplify-icon - amplify-totp-setup --> amplify-form-section - amplify-totp-setup --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - style amplify-select-mfa-type fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-select/__snapshots__/amplify-select.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-select/__snapshots__/amplify-select.spec.ts.snap deleted file mode 100644 index 7f1f22aa6fd..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select/__snapshots__/amplify-select.spec.ts.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-select spec: Render logic -> should render an empty \`placeholder\` label and value of \`1\` by default 1`] = ` - - - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-select/amplify-select-interface.ts b/packages/amplify-ui-components/src/components/amplify-select/amplify-select-interface.ts deleted file mode 100644 index 544903cdff2..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select/amplify-select-interface.ts +++ /dev/null @@ -1,13 +0,0 @@ -interface SelectOption { - label: string; - value: T; -} - -interface SelectOptions - extends Array> {} - -export type SelectOptionsString = SelectOptions; -export type SelectOptionsNumber = SelectOptions; - -export type SelectOptionString = SelectOption; -export type SelectOptionNumber = SelectOption; diff --git a/packages/amplify-ui-components/src/components/amplify-select/amplify-select.e2e.ts b/packages/amplify-ui-components/src/components/amplify-select/amplify-select.e2e.ts deleted file mode 100644 index c967722543b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select/amplify-select.e2e.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-select e2e:', () => { - it('should render a amplify-select', async () => { - const page = await newE2EPage(); - await page.setContent(``); - const el = await page.find('amplify-select'); - expect(el).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-select', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-select/amplify-select.scss b/packages/amplify-ui-components/src/components/amplify-select/amplify-select.scss deleted file mode 100644 index 1c3716789f8..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select/amplify-select.scss +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @prop --color: Text color of the select choices - * @prop --background-color: Background color of the input container - * @prop --border-color: Border color of the input container - * @prop --border-focus: Border color of the input container when focused on - * @prop --background-image: Image of the icon displayed next to text. Defaults to an upside down triangle. - */ -:host { - --color: var(--amplify-secondary-color); - --background-color: var(--amplify-secondary-contrast); - --border-color: var(--amplify-light-grey); - --border-focus: var(--amplify-primary-color); - --background-image: linear-gradient(45deg, transparent 50%, gray 50%), - linear-gradient(135deg, gray 50%, transparent 50%), - linear-gradient(to right, #ccc, #ccc); -} - -.select { - padding: 1rem 1.75rem 1rem 1rem; - font-size: var(--amplify-text-sm); - color: var(--color); - background-color: var(--background-color); - border: 1px solid var(--border-color); - border-radius: 3px 0 0 3px; - box-sizing: border-box; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - flex-basis: auto; - width: fit-content; - margin: 0; - height: 3.125rem; - - background-image: var(--background-image); - background-position: calc(100% - 1rem) calc(1em + 0.5rem), - calc(100% - 0.7rem) calc(1em + 0.5rem), calc(100% - 2.5em) 0.5em; - background-size: 6px 5px, 6px 5px, 0px 1.5em; - background-repeat: no-repeat; - - :focus { - outline: none; - border-color: var(--border-focus); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-select/amplify-select.spec.ts b/packages/amplify-ui-components/src/components/amplify-select/amplify-select.spec.ts deleted file mode 100644 index 8c2dc1fe2bd..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select/amplify-select.spec.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifySelect } from './amplify-select'; - -describe('amplify-select spec:', () => { - describe('Component logic ->', () => { - let select; - - beforeEach(() => { - select = new AmplifySelect(); - }); - - it('should have options be defined by default', () => { - expect(select.options).toBeDefined(); - }); - - it('should throw an error when there is a mixture of `string` and `number` values', () => { - const options = [ - { label: 'us-east-1', value: '1' }, - { label: 'us-west-2', value: '2' }, - { label: 'us-west-1', value: 3 }, - ]; - - select.options = options; - - expect(select.options).toBeDefined(); - expect(select.contructSelectOptions).toThrowError(); - }); - - it('should use custom options when passed from parent', () => { - const options = [ - { label: 'Gogi', value: '1' }, - { label: 'Gucci', value: '2' }, - { label: 'Foooci', value: '3' }, - ]; - - select.options = options; - - expect(select.options).toBeDefined(); - expect(select.options).toEqual(options); - }); - - it('should throw an error if label from options is not a string', () => { - const options = [{ label: 1, value: 1 }]; - - select.options = options; - - expect(select.options).toBeDefined(); - expect(select.contructSelectOptions).toThrowError(); - }); - }); - - describe('Render logic ->', () => { - it('should render an empty `placeholder` label and value of `1` by default', async () => { - const page = await newSpecPage({ - components: [AmplifySelect], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-select/amplify-select.stories.tsx b/packages/amplify-ui-components/src/components/amplify-select/amplify-select.stories.tsx deleted file mode 100644 index 5a79f239f4e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select/amplify-select.stories.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { storiesOf } from '@storybook/html'; - -const selectStories = storiesOf('amplify-select', module); - -selectStories.add('default with empty select', () => { - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-select/amplify-select.tsx b/packages/amplify-ui-components/src/components/amplify-select/amplify-select.tsx deleted file mode 100644 index c36b65ad97d..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select/amplify-select.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { Component, Prop, h, Watch } from '@stencil/core'; -import { - SelectOptionsString, - SelectOptionsNumber, - SelectOptionNumber, - SelectOptionString, -} from './amplify-select-interface'; -import { Logger } from '@aws-amplify/core'; - -const DEFAULT_SELECT_OPTION = [{ label: '', value: 1 }]; -const logger = new Logger('amplify-select'); - -@Component({ - tag: 'amplify-select', - styleUrl: 'amplify-select.scss', - shadow: true, -}) -export class AmplifySelect { - /** The options of the select input. Must be an Array of Objects with an Object shape of {label: string, value: string|number} */ - @Prop() options: - | SelectOptionsString - | SelectOptionsNumber = DEFAULT_SELECT_OPTION; - /** Used for id field */ - @Prop() fieldId: string; - /** The callback, called when the select is modified by the user. */ - @Prop() handleInputChange?: (inputEvent: Event) => void; - /** Default selected option */ - @Prop() selected?: string | number; - - private selectOptions; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - this.selectOptions = this.contructSelectOptions(this.options); - } - - @Watch('options') - @Watch('selected') - handleSelectOptionsChange() { - this.selectOptions = this.contructSelectOptions(this.options); - } - - isSelectedOptionValid(selected) { - if (selected && !this.options.some(option => option.value === selected)) { - logger.warn( - 'Selected option does not exist in options values, falling back to initial option' - ); - return false; - } - return true; - } - - private contructSelectOptions( - opts: SelectOptionsString | SelectOptionsNumber - ) { - this.isSelectedOptionValid(this.selected); - - const content = []; - opts.forEach((opt: SelectOptionString | SelectOptionNumber) => { - content.push( - - ); - }); - - return content; - } - - render() { - return ( - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-select/readme.md b/packages/amplify-ui-components/src/components/amplify-select/readme.md deleted file mode 100644 index cd7c50d6bc6..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-select/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# amplify-select - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ----------------------- | -| `fieldId` | `field-id` | Used for id field | `string` | `undefined` | -| `handleInputChange` | -- | The callback, called when the select is modified by the user. | `(inputEvent: Event) => void` | `undefined` | -| `options` | -- | The options of the select input. Must be an Array of Objects with an Object shape of {label: string, value: string\|number} | `SelectOptions \| SelectOptions` | `DEFAULT_SELECT_OPTION` | -| `selected` | `selected` | Default selected option | `number \| string` | `undefined` | - - -## CSS Custom Properties - -| Name | Description | -| -------------------- | ------------------------------------------------------------------------------ | -| `--background-color` | Background color of the input container | -| `--background-image` | Image of the icon displayed next to text. Defaults to an upside down triangle. | -| `--border-color` | Border color of the input container | -| `--border-focus` | Border color of the input container when focused on | -| `--color` | Text color of the select choices | - - -## Dependencies - -### Used by - - - [amplify-country-dial-code](../amplify-country-dial-code) - -### Graph -```mermaid -graph TD; - amplify-country-dial-code --> amplify-select - style amplify-select fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-sign-in-button/amplify-sign-in-button.scss b/packages/amplify-ui-components/src/components/amplify-sign-in-button/amplify-sign-in-button.scss deleted file mode 100644 index 9e6e09fc0c7..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-in-button/amplify-sign-in-button.scss +++ /dev/null @@ -1,111 +0,0 @@ -:host { - --button-color: var(--amplify-secondary-color); - --amazon-button-background: var(--amplify-primary-color); - --amazon-button-color: var(--amplify-primary-contrast); - --auth0-button-background: #eb5424; - --auth0--button-border-color: #e14615; - --auth0-button-color: var(--amplify-white); - --facebook-button-background: #4267b2; - --facebook--button-border-color: #4267b2; - --facebook-button-color: var(--amplify-white); - --google-button-background: #4285f4; - --google--button-border-color: #4285f4; - --google-button-color: var(--amplify-white); - --oauth-button-background: var(--amplify-white); - --oauth--button-color: #152939; -} - -.sign-in-button { - button { - position: relative; - width: 100%; - border-radius: 4px; - margin-bottom: 10px; - cursor: pointer; - padding: 0; - color: var(--button-color); - font-size: var(--amplify-text-sm); - box-sizing: content-box; - - &:hover { - opacity: 0.8; - } - } - - &.amazon button { - background-color: var(--amazon-button-background); - border: none; - color: var(--amazon-button-color); - font-family: 'Amazon Ember'; - } - - &.auth0 button { - background-color: var(--auth0-button-background); - font-family: Roboto; - border: 1px solid var(--auth0--button-border-color); - color: var(--auth0-button-color); - } - - &.facebook button { - background-color: var(--facebook-button-background); - border-color: var(--facebook--button-border-color); - font-family: 'Helvetica Neue'; - color: var(--facebook-button-color); - } - - &.google button { - background-color: var(--google-button-background); - font-family: Roboto; - border: 1px solid var(--google--button-border-color); - color: var(--google-button-color); - } - - &.oauth button { - background-color: var(--oauth-button-background); - color: var(--oauth--button-color); - } - - .icon { - position: absolute; - left: 0; - } - - &.amazon .icon { - padding: 10px; - height: 32px; - width: 32px; - } - - &.auth0 .icon { - border-radius: 4px 0 0 4px; - height: 28px; - width: 28px; - padding: 12px; - color: #fff; - } - - &.facebook .icon { - height: 33px; - width: 18px; - padding: 10px 14px; - } - - &.google .icon { - background-color: #fff; - border-radius: 4px 0 0 4px; - height: 28px; - width: 28px; - padding: 12px; - } - - .content { - text-align: center; - display: block; - padding: 18px 0; - text-align: left; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - text-align: center; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-sign-in-button/amplify-sign-in-button.tsx b/packages/amplify-ui-components/src/components/amplify-sign-in-button/amplify-sign-in-button.tsx deleted file mode 100644 index f68a0ee27bb..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-in-button/amplify-sign-in-button.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { Component, h, Prop } from '@stencil/core'; -import { icons, IconNameType } from '../amplify-icon/icons'; - -/** - * @slot (default) - Content placed inside the button - */ -@Component({ - tag: 'amplify-sign-in-button', - styleUrl: 'amplify-sign-in-button.scss', - scoped: true, -}) -export class AmplifySignInButton { - /** Specifies the federation provider.*/ - @Prop() provider: 'amazon' | 'auth0' | 'facebook' | 'google' | 'oauth'; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( -
- -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-sign-in-button/readme.md b/packages/amplify-ui-components/src/components/amplify-sign-in-button/readme.md deleted file mode 100644 index 2e648f8e265..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-in-button/readme.md +++ /dev/null @@ -1,48 +0,0 @@ -# amplify-sign-in-button - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ---------- | ---------- | ---------------------------------- | ---------------------------------------------------------- | ----------- | -| `provider` | `provider` | Specifies the federation provider. | `"amazon" \| "auth0" \| "facebook" \| "google" \| "oauth"` | `undefined` | - - -## Slots - -| Slot | Description | -| ------------- | -------------------------------- | -| `"(default)"` | Content placed inside the button | - - -## Dependencies - -### Used by - - - [amplify-amazon-button](../amplify-amazon-button) - - [amplify-auth0-button](../amplify-auth0-button) - - [amplify-facebook-button](../amplify-facebook-button) - - [amplify-google-button](../amplify-google-button) - - [amplify-oauth-button](../amplify-oauth-button) - -### Depends on - -- [amplify-icon](../amplify-icon) - -### Graph -```mermaid -graph TD; - amplify-sign-in-button --> amplify-icon - amplify-amazon-button --> amplify-sign-in-button - amplify-auth0-button --> amplify-sign-in-button - amplify-facebook-button --> amplify-sign-in-button - amplify-google-button --> amplify-sign-in-button - amplify-oauth-button --> amplify-sign-in-button - style amplify-sign-in-button fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-sign-in/__snapshots__/amplify-sign-in.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-sign-in/__snapshots__/amplify-sign-in.spec.ts.snap deleted file mode 100644 index 0fc97d9f148..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-in/__snapshots__/amplify-sign-in.spec.ts.snap +++ /dev/null @@ -1,115 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-sign-in spec: Render logic -> should render a \`sign in\` form by default 1`] = ` - - - -
- -
- - - - - -
-
-
-`; - -exports[`amplify-sign-in spec: amplify-sign-in stories stories withEmptyFederatedObject 1`] = ` - - - -
- -
- - - - - -
-
-
-`; - -exports[`amplify-sign-in spec: amplify-sign-in stories stories withFederated 1`] = ` - - - -
- -
- - - - - or - - - -
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in-interface.ts b/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in-interface.ts deleted file mode 100644 index cc3357f6d49..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in-interface.ts +++ /dev/null @@ -1,17 +0,0 @@ -export interface AmplifyForgotPasswordHintProps { - forgotPasswordText: string; - resetPasswordText: string; - onAuthStateChange?: any; -} - -export interface AmplifySignInFormFooterProps { - submitButtonText: string; - noAccountText: string; - createAccountText: string; - onAuthStateChange?: any; -} - -export interface SignInAttributes { - userInput: string; - password: string; -} diff --git a/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.scss b/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.scss deleted file mode 100644 index ad8f18bfa9a..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.scss +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @prop --footer-font-family: Font family of the footer - * @prop --footer-font-size: Font size of the footer - * @prop --footer-color: Font color of the footer - * @prop --footer-weight: Font weight of the footer - */ -:host { - --footer-size: var(--amplify-text-sm); - --footer-color: var(--amplify-grey); - --footer-font-family: var(--amplify-font-family); - --font-weight: var(--amplify-font-weight); -} - -.sign-in-form-footer { - font-family: var(--footer-font-family); - font-size: var(--footer-size); - color: var(--footer-color); - font-weight: (--font-weight); - - amplify-button { - margin-bottom: 0.625rem; - } - - display: flex; - flex-direction: column-reverse; - align-items: center; - justify-content: space-around; - - @include md { - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: baseline; - amplify-button { - margin-bottom: 0; - } - } - - * + * { - margin-bottom: 15px; - } -} - -.full-width-footer-content { - width: 100%; -} diff --git a/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.spec.ts b/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.spec.ts deleted file mode 100644 index c2fcc3ad0d9..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.spec.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifySignIn } from './amplify-sign-in'; -import * as stories from './amplify-sign-in.stories'; -// import { AmplifyForgotPasswordHint } from './amplify-forgot-password-hint'; - -const { - default: { title }, - ...templates -} = stories; - -describe('amplify-sign-in spec:', () => { - describe(`${title} stories`, () => { - const components = [AmplifySignIn]; - - describe('stories', () => { - Object.entries(templates).forEach(([name, template]) => { - it(name, async () => { - const page = await newSpecPage({ components, template }); - - expect(page.root).toMatchSnapshot(); - }); - }); - }); - }); - - describe('Component logic ->', () => { - let signIn; - - beforeEach(() => { - signIn = new AmplifySignIn(); - }); - - // https://github.com/facebook/jest/issues/8475 - // it('should render `SIGN IN COMPONENTS` on form fields by default', () => { - // const result = [ - // { - // type: 'username', - // required: true, - // }, - // { - // type: 'password', - // hint: { - // "$attrs$": null, - // "$children$": [AmplifyForgotPasswordHint], - // "$elm$": undefined, - // "$flags$": 0, - // "$tag$": Tunnel.Consumer - // }, - // required: true, - // } - // ]; - - // expect(signIn.formFields).toEqual(result); - // }); - - it('should render `handleSubmit` as defined by default', () => { - expect(signIn.handleSubmit).toBeDefined(); - }); - - it('should render `validationErrors` as undefined by default', () => { - expect(signIn.validationErrors).toBeUndefined(); - }); - - it('should render `headerText` to `Sign into your account` by default', () => { - expect(signIn.headerText).toEqual('Sign in to your account'); - }); - - it('should render `submitButtonText` to `Sign in` by default', () => { - expect(signIn.submitButtonText).toEqual('Sign In'); - }); - - it('should render `usernameAlias` as `username` by default', () => { - expect(signIn.usernameAlias).toEqual('username'); - }); - }); - describe('Render logic ->', () => { - it('should render a `sign in` form by default', async () => { - const page = await newSpecPage({ - components: [AmplifySignIn], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.stories.tsx b/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.stories.tsx deleted file mode 100644 index 9f5ceb9781b..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.stories.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { h } from '@stencil/core'; -import * as knobs from '@storybook/addon-knobs'; - -export default { - title: 'amplify-sign-in', -}; - -export const withEmptyFederatedObject = () => ( - -); - -export const withFederated = () => ( - -); diff --git a/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.tsx b/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.tsx deleted file mode 100644 index c7ce7dfceb5..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-in/amplify-sign-in.tsx +++ /dev/null @@ -1,344 +0,0 @@ -import { I18n, isEmpty } from '@aws-amplify/core'; -import { Component, Prop, State, h, Watch, Host } from '@stencil/core'; -import { - FormFieldTypes, - FormFieldType, - PhoneNumberInterface, - PhoneFormFieldType, -} from '../../components/amplify-auth-fields/amplify-auth-fields-interface'; -import { - AuthState, - FederatedConfig, - AuthStateHandler, - UsernameAliasStrings, -} from '../../common/types/auth-types'; -import { Translations } from '../../common/Translations'; -import { COUNTRY_DIAL_CODE_DEFAULT } from '../../common/constants'; - -import { - dispatchToastHubEvent, - dispatchAuthStateChangeEvent, - composePhoneNumberInput, - checkUsernameAlias, - isHintValid, - handlePhoneNumberChange, -} from '../../common/helpers'; -import { handleSignIn } from '../../common/auth-helpers'; -import { SignInAttributes } from './amplify-sign-in-interface'; - -/** - * @slot header-subtitle - Subtitle content placed below header text - * @slot federated-buttons - Content above form fields used for sign in federation buttons - * @slot footer - Content is place in the footer of the component - * @slot primary-footer-content - Content placed on the right side of the footer - * @slot secondary-footer-content - Content placed on the left side of the footer - */ -@Component({ - tag: 'amplify-sign-in', - styleUrl: 'amplify-sign-in.scss', - shadow: true, -}) -export class AmplifySignIn { - /** Fires when sign in form is submitted */ - @Prop() handleSubmit: (event: Event) => void = event => this.signIn(event); - /** Used for header text in sign in component */ - @Prop() headerText: string = Translations.SIGN_IN_HEADER_TEXT; - /** Used for the submit button text in sign in component */ - @Prop() submitButtonText: string = Translations.SIGN_IN_ACTION; - /** Federated credentials & configuration. */ - @Prop() federated: FederatedConfig; - /** Auth state change handler for this component */ - // prettier-ignore - @Prop() handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */ - @Prop() usernameAlias: UsernameAliasStrings = 'username'; - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. - * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing - * text for a label or adjust a placeholder, you can follow the structure below in order to do just that. - * ``` - * [ - * { - * type: string, - * label: string, - * placeholder: string, - * hint: string | Functional Component | null, - * required: boolean - * } - * ] - * ``` - */ - @Prop() formFields: FormFieldTypes | string[] = []; - /** Hides the sign up link */ - @Prop() hideSignUp: boolean = false; - private newFormFields: FormFieldTypes | string[] = []; - - /* Whether or not the sign-in component is loading */ - @State() loading: boolean = false; - - private phoneNumber: PhoneNumberInterface = { - countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT, - phoneNumberValue: null, - }; - - @State() signInAttributes: SignInAttributes = { - userInput: '', - password: '', - }; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - checkUsernameAlias(this.usernameAlias); - this.buildFormFields(); - } - - @Watch('formFields') - formFieldsHandler() { - this.buildFormFields(); - } - - private handleFormFieldInputChange(fieldType) { - switch (fieldType) { - case 'username': - case 'email': - return event => (this.signInAttributes.userInput = event.target.value); - case 'phone_number': - return event => handlePhoneNumberChange(event, this.phoneNumber); - case 'password': - return event => (this.signInAttributes.password = event.target.value); - default: - return () => {}; - } - } - - private handleFormFieldInputWithCallback(event, field) { - const fnToCall = field['handleInputChange'] - ? field['handleInputChange'] - : (event, cb) => { - cb(event); - }; - const callback = this.handleFormFieldInputChange(field.type); - fnToCall(event, callback.bind(this)); - } - - private async signIn(event: Event) { - // avoid submitting the form - if (event) { - event.preventDefault(); - } - - this.loading = true; - - switch (this.usernameAlias) { - case 'phone_number': - try { - this.signInAttributes.userInput = composePhoneNumberInput( - this.phoneNumber - ); - } catch (error) { - dispatchToastHubEvent(error); - } - default: - break; - } - const username = this.signInAttributes.userInput.trim(); - await handleSignIn( - username, - this.signInAttributes.password, - this.handleAuthStateChange, - this.usernameAlias - ); - this.loading = false; - } - - buildDefaultFormFields() { - const formFieldInputs = []; - switch (this.usernameAlias) { - case 'email': - formFieldInputs.push({ - type: 'email', - required: true, - handleInputChange: this.handleFormFieldInputChange('email'), - inputProps: { - 'data-test': 'sign-in-email-input', - autocomplete: 'username', - }, - }); - break; - case 'phone_number': - formFieldInputs.push({ - type: 'phone_number', - required: true, - handleInputChange: this.handleFormFieldInputChange('phone_number'), - inputProps: { - 'data-test': 'sign-in-phone-number-input', - autocomplete: 'username', - }, - }); - break; - case 'username': - default: - formFieldInputs.push({ - type: 'username', - required: true, - handleInputChange: this.handleFormFieldInputChange('username'), - inputProps: { - 'data-test': 'sign-in-username-input', - autocomplete: 'username', - }, - }); - break; - } - - formFieldInputs.push({ - type: 'password', - hint: ( -
- {I18n.get(Translations.FORGOT_PASSWORD_TEXT)}{' '} - this.handleAuthStateChange(AuthState.ForgotPassword)} - data-test="sign-in-forgot-password-link" - > - {I18n.get(Translations.RESET_PASSWORD_TEXT)} - -
- ), - required: true, - handleInputChange: this.handleFormFieldInputChange('password'), - inputProps: { - 'data-test': 'sign-in-password-input', - }, - }); - this.newFormFields = [...formFieldInputs]; - } - - buildFormFields() { - if (this.formFields.length === 0) { - this.buildDefaultFormFields(); - } else { - const newFields = []; - this.formFields.forEach(field => { - const newField = { ...field }; - // TODO: handle hint better - if (newField.type === 'password') { - newField['hint'] = isHintValid(newField) ? ( -
- {I18n.get(Translations.FORGOT_PASSWORD_TEXT)}{' '} - - this.handleAuthStateChange(AuthState.ForgotPassword) - } - data-test="sign-in-forgot-password-link" - > - {I18n.get(Translations.RESET_PASSWORD_TEXT)} - -
- ) : ( - newField['hint'] - ); - } - newField['handleInputChange'] = event => - this.handleFormFieldInputWithCallback(event, field); - this.setFieldValue(newField, this.signInAttributes); - newFields.push(newField); - }); - this.newFormFields = newFields; - } - } - - setFieldValue( - field: PhoneFormFieldType | FormFieldType, - formAttributes: SignInAttributes - ) { - switch (field.type) { - case 'username': - case 'email': - if (field.value === undefined) { - formAttributes.userInput = ''; - } else { - formAttributes.userInput = field.value; - } - break; - case 'phone_number': - if ((field as PhoneFormFieldType).dialCode) { - this.phoneNumber.countryDialCodeValue = (field as PhoneFormFieldType).dialCode; - } - this.phoneNumber.phoneNumberValue = field.value; - break; - case 'password': - if (field.value === undefined) { - formAttributes.password = ''; - } else { - formAttributes.password = field.value; - } - break; - } - } - - render() { - return ( - - -
- -
- - - - - {!isEmpty(this.federated) && or} - - - -
-
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-sign-in/readme.md b/packages/amplify-ui-components/src/components/amplify-sign-in/readme.md deleted file mode 100644 index 0c89248849d..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-in/readme.md +++ /dev/null @@ -1,104 +0,0 @@ -# amplify-sign-in - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ---------------------------------- | -| `federated` | -- | Federated credentials & configuration. | `FederatedConfig` | `undefined` | -| `formFields` | -- | Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string \| Functional Component \| null, required: boolean } ] ``` | `FormFieldTypes \| string[]` | `[]` | -| `handleAuthStateChange` | -- | Auth state change handler for this component | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | -| `handleSubmit` | -- | Fires when sign in form is submitted | `(event: Event) => void` | `event => this.signIn(event)` | -| `headerText` | `header-text` | Used for header text in sign in component | `string` | `Translations.SIGN_IN_HEADER_TEXT` | -| `hideSignUp` | `hide-sign-up` | Hides the sign up link | `boolean` | `false` | -| `submitButtonText` | `submit-button-text` | Used for the submit button text in sign in component | `string` | `Translations.SIGN_IN_ACTION` | -| `usernameAlias` | `username-alias` | Username Alias is used to setup authentication with `username`, `email` or `phone_number` | `"email" \| "phone_number" \| "username"` | `'username'` | - - -## Slots - -| Slot | Description | -| ---------------------------- | ------------------------------------------------------------- | -| `"federated-buttons"` | Content above form fields used for sign in federation buttons | -| `"footer"` | Content is place in the footer of the component | -| `"header-subtitle"` | Subtitle content placed below header text | -| `"primary-footer-content"` | Content placed on the right side of the footer | -| `"secondary-footer-content"` | Content placed on the left side of the footer | - - -## CSS Custom Properties - -| Name | Description | -| ---------------------- | ------------------------- | -| `--footer-color` | Font color of the footer | -| `--footer-font-family` | Font family of the footer | -| `--footer-font-size` | Font size of the footer | -| `--footer-weight` | Font weight of the footer | - - -## Dependencies - -### Used by - - - [amplify-authenticator](../amplify-authenticator) - -### Depends on - -- [amplify-button](../amplify-button) -- [amplify-form-section](../amplify-form-section) -- [amplify-federated-buttons](../amplify-federated-buttons) -- [amplify-strike](../amplify-strike) -- [amplify-auth-fields](../amplify-auth-fields) -- [amplify-loading-spinner](../amplify-loading-spinner) - -### Graph -```mermaid -graph TD; - amplify-sign-in --> amplify-button - amplify-sign-in --> amplify-form-section - amplify-sign-in --> amplify-federated-buttons - amplify-sign-in --> amplify-strike - amplify-sign-in --> amplify-auth-fields - amplify-sign-in --> amplify-loading-spinner - amplify-button --> amplify-icon - amplify-form-section --> amplify-section - amplify-form-section --> amplify-button - amplify-form-section --> amplify-loading-spinner - amplify-loading-spinner --> amplify-icon - amplify-federated-buttons --> amplify-google-button - amplify-federated-buttons --> amplify-facebook-button - amplify-federated-buttons --> amplify-amazon-button - amplify-federated-buttons --> amplify-oauth-button - amplify-federated-buttons --> amplify-auth0-button - amplify-google-button --> amplify-sign-in-button - amplify-sign-in-button --> amplify-icon - amplify-facebook-button --> amplify-sign-in-button - amplify-amazon-button --> amplify-sign-in-button - amplify-oauth-button --> amplify-sign-in-button - amplify-auth0-button --> amplify-sign-in-button - amplify-auth-fields --> amplify-username-field - amplify-auth-fields --> amplify-password-field - amplify-auth-fields --> amplify-email-field - amplify-auth-fields --> amplify-code-field - amplify-auth-fields --> amplify-phone-field - amplify-auth-fields --> amplify-form-field - amplify-username-field --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-password-field --> amplify-form-field - amplify-email-field --> amplify-form-field - amplify-code-field --> amplify-form-field - amplify-phone-field --> amplify-form-field - amplify-phone-field --> amplify-country-dial-code - amplify-phone-field --> amplify-input - amplify-country-dial-code --> amplify-select - amplify-authenticator --> amplify-sign-in - style amplify-sign-in fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-sign-out/__snapshots__/amplify-sign-out.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-sign-out/__snapshots__/amplify-sign-out.spec.ts.snap deleted file mode 100644 index 4439641e935..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-out/__snapshots__/amplify-sign-out.spec.ts.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-sign-out spec: Render logic -> should render a \`sign out\` button by default 1`] = ` - - - - Sign Out - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-sign-out/amplify-sign-out.spec.ts b/packages/amplify-ui-components/src/components/amplify-sign-out/amplify-sign-out.spec.ts deleted file mode 100644 index 0224bea63cf..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-out/amplify-sign-out.spec.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifySignOut } from './amplify-sign-out'; -import { Translations } from '../../common/Translations'; - -describe('amplify-sign-out spec:', () => { - describe('Component logic ->', () => { - let signOut; - - beforeEach(() => { - signOut = new AmplifySignOut(); - }); - - it('should render default `buttonText`', () => { - expect(signOut.buttonText).toEqual(I18n.get(Translations.SIGN_OUT)); - }); - }); - describe('Render logic ->', () => { - it('should render a `sign out` button by default', async () => { - const page = await newSpecPage({ - components: [AmplifySignOut], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-sign-out/amplify-sign-out.stories.tsx b/packages/amplify-ui-components/src/components/amplify-sign-out/amplify-sign-out.stories.tsx deleted file mode 100644 index 2b8987f8b08..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-out/amplify-sign-out.stories.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { storiesOf } from '@storybook/html'; - -const signOutStories = storiesOf('amplify-sign-out', module); - -signOutStories.add('default', () => { - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-sign-out/amplify-sign-out.tsx b/packages/amplify-ui-components/src/components/amplify-sign-out/amplify-sign-out.tsx deleted file mode 100644 index 4391ca9a142..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-out/amplify-sign-out.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { I18n } from '@aws-amplify/core'; -import { Component, Prop, h } from '@stencil/core'; -import { NO_AUTH_MODULE_FOUND } from '../../common/constants'; -import { AuthState, AuthStateHandler } from '../../common/types/auth-types'; -import { - dispatchToastHubEvent, - dispatchAuthStateChangeEvent, -} from '../../common/helpers'; -import { Translations } from '../../common/Translations'; - -/** - * @slot sign-out - The sign out button element - */ -@Component({ - tag: 'amplify-sign-out', - shadow: true, -}) -export class AmplifySignOut { - /** Auth state change handler for this component */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - /** Text inside of the Sign Out button */ - @Prop() buttonText: string = Translations.SIGN_OUT; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - private async signOut(event) { - if (event) event.preventDefault(); - - // TODO: Federated Sign Out - - if (!Auth || typeof Auth.signOut !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - try { - await Auth.signOut(); - this.handleAuthStateChange(AuthState.SignedOut); - } catch (error) { - dispatchToastHubEvent(error); - } - } - - render() { - return ( - this.signOut(event)} - data-test="sign-out-button" - > - {I18n.get(this.buttonText)} - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-sign-out/readme.md b/packages/amplify-ui-components/src/components/amplify-sign-out/readme.md deleted file mode 100644 index 21a93e93cac..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-out/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# amplify-sign-out - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | ------------- | -------------------------------------------- | --------------------------------------------------- | ------------------------------ | -| `buttonText` | `button-text` | Text inside of the Sign Out button | `string` | `Translations.SIGN_OUT` | -| `handleAuthStateChange` | -- | Auth state change handler for this component | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | - - -## Slots - -| Slot | Description | -| ------------ | --------------------------- | -| `"sign-out"` | The sign out button element | - - -## Dependencies - -### Used by - - - [amplify-greetings](../amplify-greetings) - -### Depends on - -- [amplify-button](../amplify-button) - -### Graph -```mermaid -graph TD; - amplify-sign-out --> amplify-button - amplify-button --> amplify-icon - amplify-greetings --> amplify-sign-out - style amplify-sign-out fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-sign-up/__snapshots__/amplify-sign-up.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-sign-up/__snapshots__/amplify-sign-up.spec.ts.snap deleted file mode 100644 index 3cb252739b2..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-up/__snapshots__/amplify-sign-up.spec.ts.snap +++ /dev/null @@ -1,33 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-sign-up spec: Render logic -> should render a \`sign up\` form by default 1`] = ` - - - -
- -
- - -
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.scss b/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.scss deleted file mode 100644 index ce434f39ea0..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.scss +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @prop --footer-font-family: Font family of the footer - * @prop --footer-font-size: Font size of the footer - * @prop --footer-color: Font color of the footer - * @prop --footer-weight: Font weight of the footer - */ -amplify-sign-up { - --footer-font-family: var(--amplify-font-family); - --footer-font-size: var(--amplify-text-sm); - --footer-color: var(--amplify-grey); - --font-weight: var(--amplify-font-weight); -} - -.sign-up-form-footer { - font-family: var(--footer-font-family); - font-size: var(--footer-font-size); - color: var(--footer-color); - font-weight: (--font-weight); - - amplify-button { - margin-bottom: 0.625rem; - } - - display: flex; - flex-direction: column-reverse; - align-items: center; - justify-content: space-around; - - @include md { - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: baseline; - amplify-button { - margin-bottom: 0; - } - } - - * + * { - margin-bottom: 15px; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.spec.ts b/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.spec.ts deleted file mode 100644 index df4fda4fe75..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.spec.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifySignUp } from './amplify-sign-up'; -import { Translations } from '../../common/Translations'; - -describe('amplify-sign-up spec:', () => { - describe('Component logic ->', () => { - let signUp; - - beforeEach(() => { - signUp = new AmplifySignUp(); - }); - - it('should render `handleSubmit` as undefined by default', () => { - expect(signUp.handleSubmit).toBeDefined(); - }); - - it('should render `validationErrors` as undefined by default', () => { - expect(signUp.validationErrors).toBeUndefined(); - }); - - it('should render `headerText` to `Create a new account` by default', () => { - expect(signUp.headerText).toEqual( - I18n.get(Translations.SIGN_UP_HEADER_TEXT) - ); - }); - - it('should render `submitButtonText` to `Create account` by default', () => { - expect(signUp.submitButtonText).toEqual( - I18n.get(Translations.SIGN_UP_SUBMIT_BUTTON_TEXT) - ); - }); - - it('should render `usernameAlias` as `username` by default', () => { - expect(signUp.usernameAlias).toEqual('username'); - }); - - it('should render `handleSignUp` as defined by default', () => { - expect(signUp.handleSignUp).toBeDefined(); - }); - }); - - describe('Render logic ->', () => { - it('should render a `sign up` form by default', async () => { - const page = await newSpecPage({ - components: [AmplifySignUp], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.stories.tsx b/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.stories.tsx deleted file mode 100644 index cffa054f955..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.stories.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { storiesOf } from '@storybook/html'; - -const signUpStories = storiesOf('amplify-sign-up', module); - -signUpStories.add('default', () => { - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.tsx b/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.tsx deleted file mode 100644 index 41a2d8719f3..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.tsx +++ /dev/null @@ -1,443 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { Auth, SignUpParams } from '@aws-amplify/auth'; -import { ISignUpResult } from 'amazon-cognito-identity-js'; -import { Component, Prop, h, State, Watch, Host } from '@stencil/core'; -import { - FormFieldTypes, - PhoneNumberInterface, - FormFieldType, - PhoneFormFieldType, -} from '../../components/amplify-auth-fields/amplify-auth-fields-interface'; -import { - COUNTRY_DIAL_CODE_DEFAULT, - NO_AUTH_MODULE_FOUND, -} from '../../common/constants'; -import { - AuthState, - AuthStateHandler, - UsernameAlias, - UsernameAliasStrings, -} from '../../common/types/auth-types'; -import { SignUpAttributes } from '../../common/types/auth-types'; -import { - dispatchAuthStateChangeEvent, - dispatchToastHubEvent, - composePhoneNumberInput, - checkUsernameAlias, - handlePhoneNumberChange, -} from '../../common/helpers'; -import { Translations } from '../../common/Translations'; -import { handleSignIn } from '../../common/auth-helpers'; - -/** - * @slot header-subtitle - Subtitle content placed below header text - * @slot footer - Content placed in the footer of the component - * @slot primary-footer-content - Content placed on the right side of the footer - * @slot secondary-footer-content - Content placed on the left side of the footer - */ -@Component({ - tag: 'amplify-sign-up', - styleUrl: 'amplify-sign-up.scss', - shadow: true, -}) -export class AmplifySignUp { - /** Fires when sign up form is submitted */ - @Prop() handleSubmit: (event: Event) => void = event => this.signUp(event); - /** Override for handling the Auth.SignUp API call */ - @Prop() handleSignUp: ( - params: SignUpParams - ) => Promise = params => this.authSignUp(params); - /** Engages when invalid actions occur, such as missing field, etc. */ - @Prop() validationErrors: string; - /** Used for header text in sign up component */ - @Prop() headerText: string = Translations.SIGN_UP_HEADER_TEXT; - /** Used for the submit button text in sign up component */ - @Prop() submitButtonText: string = Translations.SIGN_UP_SUBMIT_BUTTON_TEXT; - /** Used for the submit button text in sign up component */ - @Prop() haveAccountText: string = Translations.SIGN_UP_HAVE_ACCOUNT_TEXT; - /** Text used for the sign in hyperlink */ - @Prop() signInText: string = Translations.SIGN_IN_TEXT; - /** - * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. - * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing - * text for a label or adjust a placeholder, you can follow the structure below in order to do just that. - * ``` - * [ - * { - * type: string, - * label: string, - * placeholder: string, - * hint: string | Functional Component | null, - * required: boolean - * } - * ] - * ``` - */ - @Prop() formFields: FormFieldTypes | string[] = []; - /** Auth state change handler for this component - * e.g. SignIn -> 'Create Account' link -> SignUp - */ - // prettier-ignore - @Prop() handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */ - @Prop() usernameAlias: UsernameAliasStrings = 'username'; - // private userInput: string | PhoneNumberInterface; - private newFormFields: FormFieldTypes | string[] = []; - private phoneNumber: PhoneNumberInterface = { - countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT, - phoneNumberValue: null, - }; - - @State() loading: boolean = false; - @State() signUpAttributes: SignUpAttributes = { - username: '', - password: '', - attributes: {}, - }; - - private handleFormFieldInputChange(fieldType) { - switch (fieldType) { - case 'username': - return event => (this.signUpAttributes.username = event.target.value); - case 'password': - return event => (this.signUpAttributes.password = event.target.value); - case 'email': - return event => - (this.signUpAttributes.attributes.email = event.target.value); - case 'phone_number': - return event => handlePhoneNumberChange(event, this.phoneNumber); - default: - return event => - (this.signUpAttributes.attributes[fieldType] = event.target.value); - } - } - - private handleFormFieldInputWithCallback(event, field) { - const fnToCall = field['handleInputChange'] - ? field['handleInputChange'] - : (event, cb) => { - cb(event); - }; - const callback = this.handleFormFieldInputChange(field.type); - fnToCall(event, callback.bind(this)); - } - - private async authSignUp(params: SignUpParams): Promise { - const data = await Auth.signUp(params); - if (!data) { - throw new Error(Translations.SIGN_UP_FAILED); - } - - return data; - } - - private assignPhoneNumberToSignUpAttributes(): void { - if (this.phoneNumber.phoneNumberValue) { - try { - this.signUpAttributes.attributes.phone_number = composePhoneNumberInput( - this.phoneNumber - ); - } catch (error) { - dispatchToastHubEvent(error); - } - } - } - - private assignUserNameAliasToSignUpAttributes(): void { - switch (this.usernameAlias) { - case 'email': - case 'phone_number': - this.signUpAttributes.username = this.signUpAttributes.attributes[ - this.usernameAlias - ]; - break; - case 'username': - default: - break; - } - } - - private assignFormInputToSignUpAttributes(): void { - this.assignPhoneNumberToSignUpAttributes(); - this.assignUserNameAliasToSignUpAttributes(); - } - - private validateSignUpAttributes(): void { - if (!this.signUpAttributes.username) { - if (this.usernameAlias === UsernameAlias.email) { - throw new Error(Translations.EMPTY_EMAIL); - } else if (this.usernameAlias === UsernameAlias.phone_number) { - throw new Error(Translations.EMPTY_PHONE); - } else { - throw new Error(Translations.EMPTY_USERNAME); - } - } - if (this.signUpAttributes.username.indexOf(' ') >= 0) { - throw new Error(Translations.USERNAME_REMOVE_WHITESPACE); - } - if ( - this.signUpAttributes.password !== this.signUpAttributes.password.trim() - ) { - throw new Error(Translations.PASSWORD_REMOVE_WHITESPACE); - } - } - - // TODO: Add validation - // TODO: Prefix - private async signUp(event: Event) { - if (event) { - event.preventDefault(); - } - if (!Auth || typeof Auth.signUp !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - this.loading = true; - this.assignFormInputToSignUpAttributes(); - - try { - this.validateSignUpAttributes(); - - const data = await this.handleSignUp(this.signUpAttributes); - if (data.userConfirmed) { - await handleSignIn( - this.signUpAttributes.username, - this.signUpAttributes.password, - this.handleAuthStateChange - ); - } else { - const signUpAttrs = { ...this.signUpAttributes }; - this.handleAuthStateChange(AuthState.ConfirmSignUp, { - ...data.user, - signUpAttrs, - }); - } - } catch (error) { - dispatchToastHubEvent(error); - } finally { - this.loading = false; - } - } - - private buildDefaultFormFields() { - switch (this.usernameAlias) { - case 'email': - this.newFormFields = [ - { - type: 'email', - placeholder: I18n.get(Translations.SIGN_UP_EMAIL_PLACEHOLDER), - required: true, - handleInputChange: this.handleFormFieldInputChange('email'), - inputProps: { - 'data-test': 'sign-up-email-input', - autocomplete: 'username', - }, - }, - { - type: 'password', - placeholder: I18n.get(Translations.SIGN_UP_PASSWORD_PLACEHOLDER), - required: true, - handleInputChange: this.handleFormFieldInputChange('password'), - inputProps: { - 'data-test': 'sign-up-password-input', - autocomplete: 'new-password', - }, - }, - { - type: 'phone_number', - required: true, - handleInputChange: this.handleFormFieldInputChange('phone_number'), - inputProps: { - 'data-test': 'sign-up-phone-number-input', - autocomplete: 'tel-national', - }, - }, - ]; - break; - case 'phone_number': - this.newFormFields = [ - { - type: 'phone_number', - required: true, - handleInputChange: this.handleFormFieldInputChange('phone_number'), - inputProps: { - 'data-test': 'sign-up-phone-number-input', - autocomplete: 'username', - }, - }, - { - type: 'password', - placeholder: I18n.get(Translations.SIGN_UP_PASSWORD_PLACEHOLDER), - required: true, - handleInputChange: this.handleFormFieldInputChange('password'), - inputProps: { - 'data-test': 'sign-up-password-input', - autocomplete: 'new-password', - }, - }, - { - type: 'email', - placeholder: I18n.get(Translations.SIGN_UP_EMAIL_PLACEHOLDER), - required: true, - handleInputChange: this.handleFormFieldInputChange('email'), - inputProps: { - 'data-test': 'sign-up-email-input', - autocomplete: 'email', - }, - }, - ]; - break; - case 'username': - default: - this.newFormFields = [ - { - type: 'username', - placeholder: I18n.get(Translations.SIGN_UP_USERNAME_PLACEHOLDER), - required: true, - handleInputChange: this.handleFormFieldInputChange('username'), - inputProps: { - 'data-test': 'sign-up-username-input', - autocomplete: 'username', - }, - }, - { - type: 'password', - placeholder: I18n.get(Translations.SIGN_UP_PASSWORD_PLACEHOLDER), - required: true, - handleInputChange: this.handleFormFieldInputChange('password'), - inputProps: { - 'data-test': 'sign-up-password-input', - autocomplete: 'new-password', - }, - }, - { - type: 'email', - placeholder: I18n.get(Translations.SIGN_UP_EMAIL_PLACEHOLDER), - required: true, - handleInputChange: this.handleFormFieldInputChange('email'), - inputProps: { - 'data-test': 'sign-up-email-input', - }, - }, - { - type: 'phone_number', - required: true, - handleInputChange: this.handleFormFieldInputChange('phone_number'), - inputProps: { - 'data-test': 'sign-up-phone-number-input', - }, - }, - ]; - break; - } - } - - private buildFormFields() { - if (this.formFields.length === 0) { - this.buildDefaultFormFields(); - } else { - const newFields = []; - this.formFields.forEach(field => { - const newField = { ...field }; - newField['handleInputChange'] = event => - this.handleFormFieldInputWithCallback(event, field); - this.setFieldValue(field, this.signUpAttributes); - newFields.push(newField); - }); - this.newFormFields = newFields; - } - } - - setFieldValue( - field: PhoneFormFieldType | FormFieldType, - formAttributes: SignUpAttributes - ) { - switch (field.type) { - case 'username': - if (field.value === undefined) { - formAttributes.username = ''; - } else { - formAttributes.username = field.value; - } - break; - case 'password': - if (field.value === undefined) { - formAttributes.password = ''; - } else { - formAttributes.password = field.value; - } - break; - case 'email': - formAttributes.attributes.email = field.value; - break; - case 'phone_number': - if ((field as PhoneFormFieldType).dialCode) { - this.phoneNumber.countryDialCodeValue = (field as PhoneFormFieldType).dialCode; - } - this.phoneNumber.phoneNumberValue = field.value; - break; - default: - formAttributes.attributes[field.type] = field.value; - break; - } - } - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - checkUsernameAlias(this.usernameAlias); - this.buildFormFields(); - } - - @Watch('formFields') - formFieldsHandler() { - this.buildFormFields(); - } - - render() { - return ( - - -
- -
- - -
-
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-sign-up/readme.md b/packages/amplify-ui-components/src/components/amplify-sign-up/readme.md deleted file mode 100644 index ce40a3ff9f6..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-sign-up/readme.md +++ /dev/null @@ -1,90 +0,0 @@ -# amplify-sign-up - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ----------------------------------------- | -| `formFields` | -- | Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc. by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing text for a label or adjust a placeholder, you can follow the structure below in order to do just that. ``` [ { type: string, label: string, placeholder: string, hint: string \| Functional Component \| null, required: boolean } ] ``` | `FormFieldTypes \| string[]` | `[]` | -| `handleAuthStateChange` | -- | Auth state change handler for this component e.g. SignIn -> 'Create Account' link -> SignUp | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | -| `handleSignUp` | -- | Override for handling the Auth.SignUp API call | `(params: SignUpParams) => Promise` | `params => this.authSignUp(params)` | -| `handleSubmit` | -- | Fires when sign up form is submitted | `(event: Event) => void` | `event => this.signUp(event)` | -| `haveAccountText` | `have-account-text` | Used for the submit button text in sign up component | `string` | `Translations.SIGN_UP_HAVE_ACCOUNT_TEXT` | -| `headerText` | `header-text` | Used for header text in sign up component | `string` | `Translations.SIGN_UP_HEADER_TEXT` | -| `signInText` | `sign-in-text` | Text used for the sign in hyperlink | `string` | `Translations.SIGN_IN_TEXT` | -| `submitButtonText` | `submit-button-text` | Used for the submit button text in sign up component | `string` | `Translations.SIGN_UP_SUBMIT_BUTTON_TEXT` | -| `usernameAlias` | `username-alias` | Username Alias is used to setup authentication with `username`, `email` or `phone_number` | `"email" \| "phone_number" \| "username"` | `'username'` | -| `validationErrors` | `validation-errors` | Engages when invalid actions occur, such as missing field, etc. | `string` | `undefined` | - - -## Slots - -| Slot | Description | -| ---------------------------- | ---------------------------------------------- | -| `"footer"` | Content placed in the footer of the component | -| `"header-subtitle"` | Subtitle content placed below header text | -| `"primary-footer-content"` | Content placed on the right side of the footer | -| `"secondary-footer-content"` | Content placed on the left side of the footer | - - -## CSS Custom Properties - -| Name | Description | -| ---------------------- | ------------------------- | -| `--footer-color` | Font color of the footer | -| `--footer-font-family` | Font family of the footer | -| `--footer-font-size` | Font size of the footer | -| `--footer-weight` | Font weight of the footer | - - -## Dependencies - -### Used by - - - [amplify-authenticator](../amplify-authenticator) - -### Depends on - -- [amplify-form-section](../amplify-form-section) -- [amplify-auth-fields](../amplify-auth-fields) -- [amplify-button](../amplify-button) -- [amplify-loading-spinner](../amplify-loading-spinner) - -### Graph -```mermaid -graph TD; - amplify-sign-up --> amplify-form-section - amplify-sign-up --> amplify-auth-fields - amplify-sign-up --> amplify-button - amplify-sign-up --> amplify-loading-spinner - amplify-form-section --> amplify-section - amplify-form-section --> amplify-button - amplify-form-section --> amplify-loading-spinner - amplify-button --> amplify-icon - amplify-loading-spinner --> amplify-icon - amplify-auth-fields --> amplify-username-field - amplify-auth-fields --> amplify-password-field - amplify-auth-fields --> amplify-email-field - amplify-auth-fields --> amplify-code-field - amplify-auth-fields --> amplify-phone-field - amplify-auth-fields --> amplify-form-field - amplify-username-field --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-password-field --> amplify-form-field - amplify-email-field --> amplify-form-field - amplify-code-field --> amplify-form-field - amplify-phone-field --> amplify-form-field - amplify-phone-field --> amplify-country-dial-code - amplify-phone-field --> amplify-input - amplify-country-dial-code --> amplify-select - amplify-authenticator --> amplify-sign-up - style amplify-sign-up fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-strike/__snapshots__/amplify-strike.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-strike/__snapshots__/amplify-strike.spec.ts.snap deleted file mode 100644 index 53c5ae76158..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-strike/__snapshots__/amplify-strike.spec.ts.snap +++ /dev/null @@ -1,10 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-strike stories withText 1`] = ` - - - - or - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-strike/amplify-strike.scss b/packages/amplify-ui-components/src/components/amplify-strike/amplify-strike.scss deleted file mode 100644 index 97371ae0f35..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-strike/amplify-strike.scss +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @prop --color: Text color of the content placed between the horizontal rules - * @prop --border-color: Color of the horizontal rules - * @prop --content-background: Background color of the container placed between the horizontal rules - */ -:host { - --color: var(--amplify-grey); - --border-color: var(--amplify-light-grey); - --content-background: var(--amplify-white); - display: block; - width: 100%; - text-align: center; - border-bottom: 1px solid var(--border-color); - line-height: 0.1em; - margin: 32px 0; - color: var(--color); -} - -.strike-content { - background: var(--content-background); - padding: 0 25px; - font-size: var(--amplify-text-sm); - font-weight: 500; -} diff --git a/packages/amplify-ui-components/src/components/amplify-strike/amplify-strike.spec.ts b/packages/amplify-ui-components/src/components/amplify-strike/amplify-strike.spec.ts deleted file mode 100644 index 852e5e17390..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-strike/amplify-strike.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; - -import { AmplifyStrike } from './amplify-strike'; -import * as stories from './amplify-strike.stories'; - -const { - default: { title }, - ...templates -} = stories; - -const components = [AmplifyStrike]; - -describe(title, () => { - describe('stories', () => { - Object.entries(templates).forEach(([name, template]) => { - it(name, async () => { - const page = await newSpecPage({ components, template }); - - expect(page.root).toMatchSnapshot(); - }); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-strike/amplify-strike.stories.tsx b/packages/amplify-ui-components/src/components/amplify-strike/amplify-strike.stories.tsx deleted file mode 100644 index 69143b1d7b2..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-strike/amplify-strike.stories.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { h } from '@stencil/core'; - -export default { - title: 'amplify-strike', -}; - -export const withText = () => or; diff --git a/packages/amplify-ui-components/src/components/amplify-strike/amplify-strike.tsx b/packages/amplify-ui-components/src/components/amplify-strike/amplify-strike.tsx deleted file mode 100644 index f43bb7b9e9e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-strike/amplify-strike.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Component, h } from '@stencil/core'; - -/** - * @slot (default) - Content placed between the two horizontal rules - */ -@Component({ - tag: 'amplify-strike', - styleUrl: 'amplify-strike.scss', - scoped: true, -}) -export class AmplifyStrike { - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-strike/readme.md b/packages/amplify-ui-components/src/components/amplify-strike/readme.md deleted file mode 100644 index d8434d5cef1..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-strike/readme.md +++ /dev/null @@ -1,37 +0,0 @@ -# amplify-strike - - - - -## Slots - -| Slot | Description | -| ------------- | ----------------------------------------------- | -| `"(default)"` | Content placed between the two horizontal rules | - - -## CSS Custom Properties - -| Name | Description | -| ---------------------- | --------------------------------------------------------------------- | -| `--border-color` | Color of the horizontal rules | -| `--color` | Text color of the content placed between the horizontal rules | -| `--content-background` | Background color of the container placed between the horizontal rules | - - -## Dependencies - -### Used by - - - [amplify-sign-in](../amplify-sign-in) - -### Graph -```mermaid -graph TD; - amplify-sign-in --> amplify-strike - style amplify-strike fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-toast/__snapshots__/amplify-toast.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-toast/__snapshots__/amplify-toast.spec.ts.snap deleted file mode 100644 index 9c248761a5c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-toast/__snapshots__/amplify-toast.spec.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-toast spec: Render logic -> should render an empty link tag by default with a warning icon 1`] = ` - - -
- - - -
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-toast/amplify-toast.scss b/packages/amplify-ui-components/src/components/amplify-toast/amplify-toast.scss deleted file mode 100644 index c91c7d87489..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-toast/amplify-toast.scss +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @prop --background-color: Background color of the container - * @prop --color: Text color within the toast - * @prop --font-size: Font size of the text within the toast - * @prop --close-icon-color: Fill color of the close icon - * @prop --close-icon-hover: Fill color of the close icon when hovering - */ -:host { - --background-color: var(--amplify-secondary-tint); - --color: var(--amplify-white); - --font-size: var(--amplify-text-sm); - --font-family: var(--amplify-font-family); - --close-icon-color: var(--amplify-white); - --close-icon-hover: var(--amplify-red); -} - -.toast-icon { - padding-right: 5px; -} - -.toast { - display: flex; - justify-content: space-between; - position: absolute; - top: 0; - left: 0; - width: 100%; - z-index: 99; - box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3); - padding: 16px; - background-color: var(--background-color); - font-size: var(--font-size); - color: var(--color); - box-sizing: border-box; - border-radius: 5px; - font-family: var(--font-family); - - > span { - margin-right: 10px; - } -} - -.toast-close { - margin-left: auto; - align-self: center; - position: relative; - width: 18px; - height: 18px; - overflow: hidden; - cursor: pointer; - background: transparent; - border: none; - - &::before, - &::after { - content: ''; - position: absolute; - height: 2px; - width: 100%; - top: 50%; - left: 0; - margin-top: -1px; - background: var(--close-icon-color); - } - - &:hover::before, - &:hover::after { - background: var(--close-icon-hover); - } - - &::before { - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -ms-transform: rotate(45deg); - -o-transform: rotate(45deg); - transform: rotate(45deg); - } - - &::after { - -webkit-transform: rotate(-45deg); - -moz-transform: rotate(-45deg); - -ms-transform: rotate(-45deg); - -o-transform: rotate(-45deg); - transform: rotate(-45deg); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-toast/amplify-toast.spec.ts b/packages/amplify-ui-components/src/components/amplify-toast/amplify-toast.spec.ts deleted file mode 100644 index db3544136b2..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-toast/amplify-toast.spec.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyToast } from './amplify-toast'; - -describe('amplify-toast spec:', () => { - describe('Component logic ->', () => { - let toast; - - beforeEach(() => { - toast = new AmplifyToast(); - }); - - it('should have `onClose` be undefined by default', () => { - expect(toast.onClose).toBeUndefined(); - }); - }); - describe('Render logic ->', () => { - it('should render an empty link tag by default with a warning icon', async () => { - const page = await newSpecPage({ - components: [AmplifyToast], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-toast/amplify-toast.stories.tsx b/packages/amplify-ui-components/src/components/amplify-toast/amplify-toast.stories.tsx deleted file mode 100644 index ddba7ae37bc..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-toast/amplify-toast.stories.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { storiesOf } from '@storybook/html'; - -const toastStories = storiesOf('amplify-toast', module); - -toastStories.add('default no message', () => { - return ``; -}); - -toastStories.add('Error message', () => { - return `Oops! Something has gone wrong. Please try again later`; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-toast/amplify-toast.tsx b/packages/amplify-ui-components/src/components/amplify-toast/amplify-toast.tsx deleted file mode 100644 index 87e85c7dbbc..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-toast/amplify-toast.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Component, Prop, h } from '@stencil/core'; - -/** - * @slot (default) - Content placed inside the toast. If `message` prop is already set, then this content will be displayed to the right of the `message`. - */ -@Component({ - tag: 'amplify-toast', - styleUrl: 'amplify-toast.scss', - shadow: true, -}) -export class AmplifyToast { - /** Used in order to add a dismissable `x` for the Toast component */ - @Prop() handleClose: () => void; - /** Message to be displayed inside the toast*/ - @Prop() message: string = ''; - - /* - TODO #170365145: Work on a helper function that will populate and - update class colors for success / warning / failure messages - */ - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( -
- - {this.message ? {this.message} : null} - -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-toast/readme.md b/packages/amplify-ui-components/src/components/amplify-toast/readme.md deleted file mode 100644 index 7e445c563c3..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-toast/readme.md +++ /dev/null @@ -1,56 +0,0 @@ -# amplify-toast - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------- | --------- | -------------------------------------------------------------- | ------------ | ----------- | -| `handleClose` | -- | Used in order to add a dismissable `x` for the Toast component | `() => void` | `undefined` | -| `message` | `message` | Message to be displayed inside the toast | `string` | `''` | - - -## Slots - -| Slot | Description | -| ------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| `"(default)"` | Content placed inside the toast. If `message` prop is already set, then this content will be displayed to the right of the `message`. | - - -## CSS Custom Properties - -| Name | Description | -| -------------------- | ------------------------------------------ | -| `--background-color` | Background color of the container | -| `--close-icon-color` | Fill color of the close icon | -| `--close-icon-hover` | Fill color of the close icon when hovering | -| `--color` | Text color within the toast | -| `--font-size` | Font size of the text within the toast | - - -## Dependencies - -### Used by - - - [amplify-authenticator](../amplify-authenticator) - - [amplify-chatbot](../amplify-chatbot) - - [amplify-select-mfa-type](../amplify-select-mfa-type) - -### Depends on - -- [amplify-icon](../amplify-icon) - -### Graph -```mermaid -graph TD; - amplify-toast --> amplify-icon - amplify-authenticator --> amplify-toast - amplify-chatbot --> amplify-toast - amplify-select-mfa-type --> amplify-toast - style amplify-toast fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-tooltip/__snapshots__/amplify-tooltip.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-tooltip/__snapshots__/amplify-tooltip.spec.ts.snap deleted file mode 100644 index ce5222bf2f1..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-tooltip/__snapshots__/amplify-tooltip.spec.ts.snap +++ /dev/null @@ -1,31 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-tooltip spec: Render logic -> should render a normal tooltip by default 1`] = ` - - -
- -
-
-
-`; - -exports[`amplify-tooltip spec: Render logic -> should render an automatically-shown tooltip 1`] = ` - - -
- -
-
-
-`; - -exports[`amplify-tooltip spec: Render logic -> should render without Emotion CSS classes 1`] = ` - - -
- -
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.e2e.ts b/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.e2e.ts deleted file mode 100644 index c64cf81d152..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.e2e.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { E2EPage, newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-tooltip e2e:', () => { - let page: E2EPage; - - beforeEach(async () => { - page = await newE2EPage(); - }); - - it('renders a tooltip correctly', async () => { - await page.setContent( - '
FOO' - ); - const tooltip = await page.find('amplify-tooltip'); - expect(tooltip).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-tooltip', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); - - it(`renders an always-visible tooltip if 'shouldAutoShow' is true`, async () => { - await page.setContent(` - -
FOO
-
- `); - - const tooltip = await page.find('amplify-tooltip'); - - // Move mouse away from div with tooltip -- should still be visible - await page.mouse.move(500, 500); - await page.waitFor(1500); - const tooltipInnerDiv = await tooltip.find('div'); - const opacityNoHover = (await tooltipInnerDiv.getComputedStyle(':after')) - .opacity; - expect(opacityNoHover).toEqual('1'); - - // Hover div with tooltip -- should still be visible - await page.hover('#toHover'); - await page.waitFor(1500); - const opacityHover = (await tooltipInnerDiv.getComputedStyle(':after')) - .opacity; - expect(opacityHover).toEqual('1'); - }); - - it(`renders a tooltip that is only visible on hover if 'shouldAutoShow' is false`, async () => { - await page.setContent(` - -
FOO
-
- `); - - const tooltip = await page.find('amplify-tooltip'); - - // Move mouse away from div with tooltip -- should not be visible - await page.mouse.move(500, 500); - await page.waitFor(1500); - const tooltipInnerDiv = await tooltip.find('div'); - const opacityNoHover = (await tooltipInnerDiv.getComputedStyle(':after')) - .opacity; - expect(opacityNoHover).toEqual('0'); - - // Hover div with tooltip -- should become visible - await page.hover('#toHover'); - await page.waitFor(1500); - const opacityHover = (await tooltipInnerDiv.getComputedStyle(':after')) - .opacity; - expect(opacityHover).toEqual('1'); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.scss b/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.scss deleted file mode 100644 index acfcaafced9..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.scss +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @prop --font-family: Font family of the text placed within the tooltip - * @prop --background-color: Background color of the tooltip - * @prop --color: Text color within the tooltip - * @prop --border-color: Border color of the tooltip - */ -:host { - --font-family: var(--amplify-font-family); - --background-color: var(--amplify-secondary-color); - --color: var(--amplify-secondary-contrast); - --border-color: var(--amplify-secondary-color); -} - -.tooltip { - display: inline; - position: relative; - font-size: var(--amplify-text-xxs); - font-family: var(--font-family); - margin: 0 0 0 16px; - - :after { - background-color: var(--background-color); - border-radius: 2px; - bottom: 46px; - color: var(--color); - content: attr(data-text); - text-decoration: none; - padding: 10px; - left: 50%; - -webkit-transform: translateX(-50%); - -moz-transform: translateX(-50%); - -ms-transform: translateX(-50%); - -o-transform: translateX(-50%); - transform: translateX(-50%); - position: absolute; - white-space: nowrap; - opacity: 0; - transition: all 0.3s ease-in-out; - } - - :before { - border: solid; - border-color: var(--border-color) transparent transparent transparent; - border-width: 5px; - bottom: 36px; - content: ''; - left: 50%; - -webkit-transform: translateX(-50%); - -moz-transform: translateX(-50%); - -ms-transform: translateX(-50%); - -o-transform: translateX(-50%); - transform: translateX(-50%); - position: absolute; - font-size: var(--amplify-text-sm); - opacity: 0; - transition: all 0.3s ease-in-out; - } - - :hover:after { - opacity: 1; - transition-delay: 1s; - } - - :hover:before { - opacity: 1; - transition-delay: 1s; - } -} - -.auto-show-tooltip { - :after { - opacity: 1; - transition-delay: 1s; - } - - :before { - opacity: 1; - transition-delay: 1s; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.spec.ts b/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.spec.ts deleted file mode 100644 index 68e5179a186..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyTooltip } from './amplify-tooltip'; - -describe('amplify-tooltip spec:', () => { - describe('Component logic ->', () => { - let tooltip; - - beforeEach(() => { - tooltip = new AmplifyTooltip(); - }); - - it('should have automatically shown prop set to false by default', () => { - expect(tooltip.shouldAutoShow).toBe(false); - }); - }); - describe('Render logic ->', () => { - it('should render an automatically-shown tooltip', async () => { - const page = await newSpecPage({ - components: [AmplifyTooltip], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render a normal tooltip by default', async () => { - const page = await newSpecPage({ - components: [AmplifyTooltip], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render without Emotion CSS classes', async () => { - const page = await newSpecPage({ - components: [AmplifyTooltip], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.stories.tsx b/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.stories.tsx deleted file mode 100644 index 3f0dcc7a616..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.stories.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { storiesOf } from '@storybook/html'; -import { knobs } from '../../common/testing'; - -const tooltipStories = storiesOf('amplify-tooltip', module); - -tooltipStories.add('with text', () => { - const text = knobs.buttonTextKnob('Foo'); - const autoShow = knobs.tooltipAutoShowKnob(true); - return `
Tooltip test`; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.tsx b/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.tsx deleted file mode 100644 index 1bfbeaa66c3..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-tooltip/amplify-tooltip.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { Component, h, Prop } from '@stencil/core'; - -/** - * @slot (default) - Text displayed below the tooltip. This will always be visible. - */ -@Component({ - tag: 'amplify-tooltip', - styleUrl: 'amplify-tooltip.scss', - shadow: true, -}) -export class AmplifyTooltip { - /** (Required) The text in the tooltip */ - @Prop() text: string; - /** (Optional) Whether or not the tooltip should be automatically shown, i.e. not disappear when not hovered */ - @Prop() shouldAutoShow: boolean = false; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( -
- -
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-tooltip/readme.md b/packages/amplify-ui-components/src/components/amplify-tooltip/readme.md deleted file mode 100644 index 277f5de78dd..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-tooltip/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# amplify-tooltip - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ---------------- | ------------------ | -------------------------------------------------------------------------------------------------------- | --------- | ----------- | -| `shouldAutoShow` | `should-auto-show` | (Optional) Whether or not the tooltip should be automatically shown, i.e. not disappear when not hovered | `boolean` | `false` | -| `text` | `text` | (Required) The text in the tooltip | `string` | `undefined` | - - -## Slots - -| Slot | Description | -| ------------- | -------------------------------------------------------------- | -| `"(default)"` | Text displayed below the tooltip. This will always be visible. | - - -## CSS Custom Properties - -| Name | Description | -| -------------------- | ------------------------------------------------- | -| `--background-color` | Background color of the tooltip | -| `--border-color` | Border color of the tooltip | -| `--color` | Text color within the tooltip | -| `--font-family` | Font family of the text placed within the tooltip | - - -## Dependencies - -### Used by - - - [amplify-icon-button](../amplify-icon-button) - -### Graph -```mermaid -graph TD; - amplify-icon-button --> amplify-tooltip - style amplify-tooltip fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-totp-setup/__snapshots__/amplify-totp-setup.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-totp-setup/__snapshots__/amplify-totp-setup.spec.ts.snap deleted file mode 100644 index 95bddffbb95..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-totp-setup/__snapshots__/amplify-totp-setup.spec.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-totp spec: Render logic -> should render a \`less than 2 mfa types available\` message by default 1`] = ` - - - -
- -
-
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup-interface.ts b/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup-interface.ts deleted file mode 100644 index 94ceaa29885..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup-interface.ts +++ /dev/null @@ -1 +0,0 @@ -export type TOTPSetupEventType = 'SETUP_TOTP'; diff --git a/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup.scss b/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup.scss deleted file mode 100644 index 83bb81c3b24..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup.scss +++ /dev/null @@ -1,9 +0,0 @@ -.totp-setup { - text-align: center; - margin-bottom: 30px; - - img { - height: 128px; - width: 128px; - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup.spec.ts b/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup.spec.ts deleted file mode 100644 index 09204c974b2..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup.spec.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyTOTPSetup } from './amplify-totp-setup'; - -describe('amplify-totp spec:', () => { - describe('Component logic ->', () => { - let totpSetup; - - beforeEach(() => { - totpSetup = new AmplifyTOTPSetup(); - }); - - it('should render `user` to be undefined by default', () => { - expect(totpSetup.user).toBeUndefined(); - }); - - it('should have `onTOTPEvent` be Defined', () => { - expect(totpSetup.onTOTPEvent).toBeDefined(); - }); - - it('should have `inputProps` have `autoFocus` set to true by default', () => { - expect(totpSetup.inputProps.autoFocus).toBe(true); - }); - - it('should have `code` be null by default', () => { - expect(totpSetup.code).toBeNull(); - }); - - it('should have `setUpMessage` be null by default', () => { - expect(totpSetup.setupMessage).toBeNull(); - }); - - it('should have `qrCodeImageSource` be undefined by default', () => { - expect(totpSetup.qrCodeImageSource).toBeUndefined(); - }); - - it('should have `qrCodeInput` be null by default', () => { - expect(totpSetup.qrCodeInput).toBeNull(); - }); - }); - describe('Render logic ->', () => { - it('should render a `less than 2 mfa types available` message by default', async () => { - const page = await newSpecPage({ - components: [AmplifyTOTPSetup], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup.stories.tsx b/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup.stories.tsx deleted file mode 100644 index e7d137b903d..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup.stories.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { storiesOf } from '@storybook/html'; - -const totpSetupStories = storiesOf('amplify-totp-setup', module); - -totpSetupStories.add('default', () => { - return ``; -}); diff --git a/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup.tsx b/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup.tsx deleted file mode 100644 index c8a09bb29a8..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-totp-setup/amplify-totp-setup.tsx +++ /dev/null @@ -1,212 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { I18n, Logger } from '@aws-amplify/core'; -import { Component, Prop, State, h, Host, Watch } from '@stencil/core'; -import QRCode from 'qrcode'; - -import { - CognitoUserInterface, - AuthStateHandler, - MfaOption, - AuthState, -} from '../../common/types/auth-types'; -import { Translations } from '../../common/Translations'; -import { NO_AUTH_MODULE_FOUND } from '../../common/constants'; -import { - dispatchToastHubEvent, - dispatchAuthStateChangeEvent, - onAuthUIStateChange, -} from '../../common/helpers'; -import { checkContact } from '../../common/auth-helpers'; - -const logger = new Logger('TOTP'); -@Component({ - tag: 'amplify-totp-setup', - styleUrl: 'amplify-totp-setup.scss', - shadow: true, -}) -export class AmplifyTOTPSetup { - private inputProps: object = { - autoFocus: true, - }; - - /** Used in order to configure TOTP for a user */ - @Prop() user: CognitoUserInterface; - /** Auth state change handler for this component */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - /** Used for header text in totp setup component */ - @Prop() headerText: string = Translations.TOTP_HEADER_TEXT; - /** Used for customizing the issuer string in the qr code image */ - @Prop() issuer: string = Translations.TOTP_ISSUER; - /** This is run after totp setup is complete. Useful if using this as standalone. */ - @Prop() handleComplete: ( - user: CognitoUserInterface - ) => void | Promise = this.onTOTPEvent; - /** Set this to true if this component is running outside the default `amplify-authenticator` usage */ - @Prop() standalone: boolean = false; - - @State() code: string | null = null; - @State() setupMessage: string | null = null; - @State() qrCodeImageSource: string; - @State() qrCodeInput: string | null = null; - @State() loading: boolean = false; - private removeHubListener: () => void; // unsubscribe function returned by onAuthUIStateChange - - async componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - - /** - * If this component is being used internally by the authenticator, we want to re-run - * setup only when the current auth state is `AuthState.TOTPSetup`. - * - * Ideally, we would only run the setup once when the component is mounted. This is not possible - * due to a bug with slots -- a slotted component will run its `componentWillLoad` lifecycle before - * it is even rendered. So instead we watch for authstate changes and run setup conditionally. - */ - if (!this.standalone) { - this.removeHubListener = onAuthUIStateChange(authState => { - if (authState === AuthState.TOTPSetup) this.setup(); - }); - } - await this.setup(); - } - - /** - * If this component is being used externally, we can use `@Watch` as normal. - */ - @Watch('user') - handleUserChange() { - this.standalone && this.setup(); - } - - disconnectedCallback() { - this.removeHubListener && this.removeHubListener(); // stop listening to `onAuthUIStateChange` - } - - private buildOtpAuthPath( - user: CognitoUserInterface, - issuer: string, - secretKey: string - ) { - return `otpauth://totp/${issuer}:${user.username}?secret=${secretKey}&issuer=${issuer}`; - } - - private async onTOTPEvent(user: CognitoUserInterface) { - logger.debug('on totp event'); - await checkContact(user, this.handleAuthStateChange); - } - - private handleTotpInputChange(event) { - this.setupMessage = null; - this.qrCodeInput = event.target.value; - } - - private async generateQRCode(codeFromTotp: string) { - try { - this.qrCodeImageSource = await QRCode.toDataURL(codeFromTotp); - } catch (error) { - dispatchToastHubEvent(error); - } - } - - private async setup() { - // ensure setup is only run once after totp setup is available - if (this.code || this.loading) { - logger.debug( - 'setup was attempted while another is in progress, skipping setup.' - ); - return; - } - - if (!this.user || !this.user.associateSoftwareToken) { - logger.debug( - 'setup was attempted with invalid `user`, skipping setup.', - this.user - ); - return; - } - if (!Auth || typeof Auth.setupTOTP !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - this.setupMessage = null; - const encodedIssuer = encodeURI(I18n.get(this.issuer)); - - this.loading = true; - try { - const secretKey = await Auth.setupTOTP(this.user); - logger.debug('secret key', secretKey); - this.code = this.buildOtpAuthPath(this.user, encodedIssuer, secretKey); - - this.generateQRCode(this.code); - } catch (error) { - dispatchToastHubEvent(error); - logger.debug(I18n.get(Translations.TOTP_SETUP_FAILURE), error); - } finally { - this.loading = false; - } - } - - private async verifyTotpToken(event: Event) { - if (event) { - event.preventDefault(); - } - - if (!this.qrCodeInput) { - logger.debug('No TOTP Code provided'); - return; - } - - const user = this.user; - - if ( - !Auth || - typeof Auth.verifyTotpToken !== 'function' || - typeof Auth.setPreferredMFA !== 'function' - ) { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - try { - await Auth.verifyTotpToken(user, this.qrCodeInput); - await Auth.setPreferredMFA(user, MfaOption.TOTP); - - this.setupMessage = I18n.get(Translations.TOTP_SUCCESS_MESSAGE); - logger.debug(I18n.get(Translations.TOTP_SUCCESS_MESSAGE)); - await this.handleComplete(user); - } catch (error) { - this.setupMessage = I18n.get(Translations.TOTP_SETUP_FAILURE); - logger.error(error); - } - } - - render() { - return ( - - this.verifyTotpToken(event)} - loading={this.loading} - > -
- {this.qrCodeImageSource && ( - {I18n.get(Translations.QR_CODE_ALT)} - )} - this.handleTotpInputChange(event)} - /> -
-
-
- ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-totp-setup/readme.md b/packages/amplify-ui-components/src/components/amplify-totp-setup/readme.md deleted file mode 100644 index e710ca6dc40..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-totp-setup/readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# amplify-totp - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | ------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------- | ------------------------------- | -| `handleAuthStateChange` | -- | Auth state change handler for this component | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | -| `handleComplete` | -- | This is run after totp setup is complete. Useful if using this as standalone. | `(user: CognitoUserInterface) => void \| Promise` | `this.onTOTPEvent` | -| `headerText` | `header-text` | Used for header text in totp setup component | `string` | `Translations.TOTP_HEADER_TEXT` | -| `issuer` | `issuer` | Used for customizing the issuer string in the qr code image | `string` | `Translations.TOTP_ISSUER` | -| `standalone` | `standalone` | Set this to true if this component is running outside the default `amplify-authenticator` usage | `boolean` | `false` | -| `user` | -- | Used in order to configure TOTP for a user | `CognitoUserInterface` | `undefined` | - - -## Dependencies - -### Used by - - - [amplify-authenticator](../amplify-authenticator) - - [amplify-select-mfa-type](../amplify-select-mfa-type) - -### Depends on - -- [amplify-form-section](../amplify-form-section) -- [amplify-form-field](../amplify-form-field) - -### Graph -```mermaid -graph TD; - amplify-totp-setup --> amplify-form-section - amplify-totp-setup --> amplify-form-field - amplify-form-section --> amplify-section - amplify-form-section --> amplify-button - amplify-form-section --> amplify-loading-spinner - amplify-button --> amplify-icon - amplify-loading-spinner --> amplify-icon - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-authenticator --> amplify-totp-setup - amplify-select-mfa-type --> amplify-totp-setup - style amplify-totp-setup fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-username-field/__snapshots__/amplify-username-field.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-username-field/__snapshots__/amplify-username-field.spec.ts.snap deleted file mode 100644 index dde2d300ba0..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-username-field/__snapshots__/amplify-username-field.spec.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-username-field spec: Render logic -> should render \`placeholder\` and \`label values 1`] = ` - - - -`; - -exports[`amplify-username-field spec: Render logic -> should render default values by default 1`] = ` - - - -`; diff --git a/packages/amplify-ui-components/src/components/amplify-username-field/amplify-username-field.e2e.ts b/packages/amplify-ui-components/src/components/amplify-username-field/amplify-username-field.e2e.ts deleted file mode 100644 index 3863e46c4e0..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-username-field/amplify-username-field.e2e.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { newE2EPage } from '@stencil/core/testing'; -import { pixelThreshold } from '../../common/testing'; - -describe('amplify-username-field e2e:', () => { - it('should render a amplify-username-field', async () => { - const page = await newE2EPage(); - await page.setContent(``); - const el = await page.find('amplify-username-field'); - expect(el).not.toBeNull(); - - const screenshot = await page.compareScreenshot('amplify-username-field', { - fullPage: true, - }); - expect(screenshot).toMatchScreenshot({ - allowableMismatchedPixels: pixelThreshold, - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-username-field/amplify-username-field.spec.ts b/packages/amplify-ui-components/src/components/amplify-username-field/amplify-username-field.spec.ts deleted file mode 100644 index 213c90faec7..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-username-field/amplify-username-field.spec.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; -import { AmplifyUsernameField } from './amplify-username-field'; - -describe('amplify-username-field spec:', () => { - describe('Component logic ->', () => { - let usernameField; - - beforeEach(() => { - usernameField = new AmplifyUsernameField(); - }); - - it('should render `username` for the field id', () => { - expect(usernameField.fieldId).toEqual('username'); - }); - - it('should have `label` render to `Username *` by default', () => { - expect(usernameField.label).toEqual('Username *'); - }); - - it('should have `placeholder` render to `Enter your username` by default', () => { - expect(usernameField.placeholder).toEqual('Enter your username'); - }); - - it('should have `required` set to `false` by default', () => { - expect(usernameField.required).toBe(false); - }); - }); - describe('Render logic ->', () => { - it('should render `placeholder` and `label values', async () => { - const page = await newSpecPage({ - components: [AmplifyUsernameField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - - it('should render default values by default', async () => { - const page = await newSpecPage({ - components: [AmplifyUsernameField], - html: ``, - }); - - expect(page.root).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-username-field/amplify-username-field.tsx b/packages/amplify-ui-components/src/components/amplify-username-field/amplify-username-field.tsx deleted file mode 100644 index b6f66e9c1e6..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-username-field/amplify-username-field.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { I18n } from '@aws-amplify/core'; -import { Component, Prop, FunctionalComponent, h } from '@stencil/core'; -import { USERNAME_SUFFIX } from '../../common/constants'; -import { Translations } from '../../common/Translations'; - -@Component({ - tag: 'amplify-username-field', -}) -export class AmplifyUsernameField { - /** Based on the type of field e.g. sign in, sign up, forgot password, etc. */ - @Prop() fieldId: string = USERNAME_SUFFIX; - /** Used for the username label */ - @Prop() label: string = Translations.USERNAME_LABEL; - /** Used for the placeholder label */ - @Prop() placeholder: string = Translations.USERNAME_PLACEHOLDER; - /** The required flag in order to make an input required prior to submitting a form */ - @Prop() required: boolean = false; - /** The callback, called when the input is modified by the user. */ - @Prop() handleInputChange?: (inputEvent: Event) => void; - /** The value of the content inside of the input field */ - @Prop() value?: string; - /** Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes */ - @Prop() inputProps?: object; - /** Will disable the input if set to true */ - @Prop() disabled?: boolean; - /** Used for the hint text that displays underneath the input field */ - @Prop() hint?: string | FunctionalComponent | null; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - render() { - return ( - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-username-field/readme.md b/packages/amplify-ui-components/src/components/amplify-username-field/readme.md deleted file mode 100644 index 8a3121b2e35..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-username-field/readme.md +++ /dev/null @@ -1,44 +0,0 @@ -# amplify-username-field - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------- | ----------------------------------- | -| `disabled` | `disabled` | Will disable the input if set to true | `boolean` | `undefined` | -| `fieldId` | `field-id` | Based on the type of field e.g. sign in, sign up, forgot password, etc. | `string` | `USERNAME_SUFFIX` | -| `handleInputChange` | -- | The callback, called when the input is modified by the user. | `(inputEvent: Event) => void` | `undefined` | -| `hint` | `hint` | Used for the hint text that displays underneath the input field | `FunctionalComponent<{}> \| string` | `undefined` | -| `inputProps` | -- | Attributes places on the input element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes | `object` | `undefined` | -| `label` | `label` | Used for the username label | `string` | `Translations.USERNAME_LABEL` | -| `placeholder` | `placeholder` | Used for the placeholder label | `string` | `Translations.USERNAME_PLACEHOLDER` | -| `required` | `required` | The required flag in order to make an input required prior to submitting a form | `boolean` | `false` | -| `value` | `value` | The value of the content inside of the input field | `string` | `undefined` | - - -## Dependencies - -### Used by - - - [amplify-auth-fields](../amplify-auth-fields) - -### Depends on - -- [amplify-form-field](../amplify-form-field) - -### Graph -```mermaid -graph TD; - amplify-username-field --> amplify-form-field - amplify-form-field --> amplify-label - amplify-form-field --> amplify-input - amplify-form-field --> amplify-hint - amplify-auth-fields --> amplify-username-field - style amplify-username-field fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/components/amplify-verify-contact/__snapshots__/amplify-verify-contact.spec.ts.snap b/packages/amplify-ui-components/src/components/amplify-verify-contact/__snapshots__/amplify-verify-contact.spec.ts.snap deleted file mode 100644 index ff1ab509d5c..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-verify-contact/__snapshots__/amplify-verify-contact.spec.ts.snap +++ /dev/null @@ -1,22 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`amplify-verify-contact stories withNoProps 1`] = ` - - - - - -`; - -exports[`amplify-verify-contact stories withUnverifiedUser 1`] = ` - - - -
- - -
-
-
-
-`; diff --git a/packages/amplify-ui-components/src/components/amplify-verify-contact/amplify-verify-contact.spec.ts b/packages/amplify-ui-components/src/components/amplify-verify-contact/amplify-verify-contact.spec.ts deleted file mode 100644 index d899364cb5e..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-verify-contact/amplify-verify-contact.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { newSpecPage } from '@stencil/core/testing'; - -import { AmplifyVerifyContact } from './amplify-verify-contact'; -import * as stories from './amplify-verify-contact.stories'; - -const { - default: { title }, - ...templates -} = stories; - -const components = [AmplifyVerifyContact]; - -describe(title, () => { - describe('stories', () => { - Object.entries(templates).forEach(([name, template]) => { - it(name, async () => { - const page = await newSpecPage({ components, template }); - - expect(page.root).toMatchSnapshot(); - }); - }); - }); -}); diff --git a/packages/amplify-ui-components/src/components/amplify-verify-contact/amplify-verify-contact.stories.tsx b/packages/amplify-ui-components/src/components/amplify-verify-contact/amplify-verify-contact.stories.tsx deleted file mode 100644 index b39453a4b8f..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-verify-contact/amplify-verify-contact.stories.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { h } from '@stencil/core'; - -export default { - title: 'amplify-verify-contact', -}; - -export const withNoProps = () => ; - -export const withUnverifiedUser = () => ( - console.info('onStateChange', ...args)} - // @ts-ignore Type '{ unverified: { email: string; phone_number: string; }; }' is missing the following properties from type 'CognitoUserInterface': challengeName, challengeParam - user={{ - unverified: { - email: 'email@amazon.com', - phone_number: '+12345678901', - }, - }} - /> -); diff --git a/packages/amplify-ui-components/src/components/amplify-verify-contact/amplify-verify-contact.tsx b/packages/amplify-ui-components/src/components/amplify-verify-contact/amplify-verify-contact.tsx deleted file mode 100644 index 46b0a032680..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-verify-contact/amplify-verify-contact.tsx +++ /dev/null @@ -1,195 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { I18n, Logger } from '@aws-amplify/core'; -import { Component, h, Prop, State, Host } from '@stencil/core'; -import { - AuthState, - AuthStateHandler, - CognitoUserInterface, -} from '../../common/types/auth-types'; -import { NO_AUTH_MODULE_FOUND } from '../../common/constants'; -import { - dispatchAuthStateChangeEvent, - dispatchToastHubEvent, -} from '../../common/helpers'; -import { Translations } from '../../common/Translations'; - -const logger = new Logger('AmplifyVerifyContact'); - -@Component({ - tag: 'amplify-verify-contact', - shadow: true, -}) -export class AmplifyVerifyContact { - /** Authentication state handler */ - @Prop() - handleAuthStateChange: AuthStateHandler = dispatchAuthStateChangeEvent; - /** User with unverified contact information */ - @Prop() user: CognitoUserInterface; - - @State() verifyAttr: any; - @State() loading: boolean = false; - @State() code: string; - @State() contact: 'email' | 'phone_number'; - - componentWillLoad() { - console.warn( - 'Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.' - ); - } - - private handleSubmit(event) { - event.preventDefault(); - - this.verifyAttr ? this.submit(this.code) : this.verify(this.contact); - } - - private async submit(code) { - const attr = this.verifyAttr; - - if (!Auth || typeof Auth.verifyCurrentUserAttributeSubmit !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - this.loading = true; - try { - const data = await Auth.verifyCurrentUserAttributeSubmit(attr, code); - - logger.debug(data); - this.handleAuthStateChange(AuthState.SignedIn, this.user); - this.verifyAttr = null; - } catch (error) { - dispatchToastHubEvent(error); - logger.error(error); - } finally { - this.loading = false; - } - } - - private async verify(contact: keyof CognitoUserInterface['unverified']) { - if (!contact) { - logger.error('Neither Email nor Phone Number selected'); - return; - } - - if (!Auth || typeof Auth.verifyCurrentUserAttribute !== 'function') { - throw new Error(NO_AUTH_MODULE_FOUND); - } - - this.loading = true; - try { - const data = await Auth.verifyCurrentUserAttribute(contact); - - logger.debug(data); - this.verifyAttr = contact; - } catch (error) { - dispatchToastHubEvent(error); - logger.error(error); - } finally { - this.loading = false; - } - } - - private handleInputChange(event) { - const inputName = event.target.name; - if (inputName === 'code') { - this.code = event.target.value; - } else if (inputName === 'contact') { - this.contact = event.target.value; - } - } - - private renderSubmit() { - return ( -
- this.handleInputChange(event)} - /> -
- ); - } - - private renderVerify() { - const user = this.user; - - if (!user) { - logger.debug('No user to verify'); - return null; - } - - const { unverified } = user; - - if (!unverified) { - logger.debug('Unverified variable does not exist on user'); - return null; - } - const { email, phone_number } = unverified; - - return ( -
- {email && ( - this.handleInputChange(event)} - inputProps={{ - 'data-test': 'verify-contact-email-radio', - }} - /> - )} - - {phone_number && ( - this.handleInputChange(event)} - inputProps={{ - 'data-test': 'verify-contact-phone-number-radio', - }} - /> - )} -
- ); - } - - render() { - return ( - - this.handleSubmit(event)} - headerText={I18n.get(Translations.VERIFY_CONTACT_HEADER_TEXT)} - loading={this.loading} - secondaryFooterContent={ - - - this.handleAuthStateChange(AuthState.SignedIn, this.user) - } - data-test="verify-contact-skip-link" - > - {I18n.get(Translations.SKIP)} - - - } - submitButtonText={ - this.verifyAttr - ? I18n.get(Translations.VERIFY_CONTACT_SUBMIT_LABEL) - : I18n.get(Translations.VERIFY_CONTACT_VERIFY_LABEL) - } - > - {this.verifyAttr ? this.renderSubmit() : this.renderVerify()} - - - ); - } -} diff --git a/packages/amplify-ui-components/src/components/amplify-verify-contact/readme.md b/packages/amplify-ui-components/src/components/amplify-verify-contact/readme.md deleted file mode 100644 index a75b06031f4..00000000000 --- a/packages/amplify-ui-components/src/components/amplify-verify-contact/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# amplify-verify-contact - - - - -## Properties - -| Property | Attribute | Description | Type | Default | -| ----------------------- | --------- | ---------------------------------------- | --------------------------------------------------- | ------------------------------ | -| `handleAuthStateChange` | -- | Authentication state handler | `(nextAuthState: AuthState, data?: object) => void` | `dispatchAuthStateChangeEvent` | -| `user` | -- | User with unverified contact information | `CognitoUserInterface` | `undefined` | - - -## Dependencies - -### Used by - - - [amplify-authenticator](../amplify-authenticator) - -### Depends on - -- [amplify-input](../amplify-input) -- [amplify-radio-button](../amplify-radio-button) -- [amplify-form-section](../amplify-form-section) -- [amplify-button](../amplify-button) - -### Graph -```mermaid -graph TD; - amplify-verify-contact --> amplify-input - amplify-verify-contact --> amplify-radio-button - amplify-verify-contact --> amplify-form-section - amplify-verify-contact --> amplify-button - amplify-radio-button --> amplify-label - amplify-form-section --> amplify-section - amplify-form-section --> amplify-button - amplify-form-section --> amplify-loading-spinner - amplify-button --> amplify-icon - amplify-loading-spinner --> amplify-icon - amplify-authenticator --> amplify-verify-contact - style amplify-verify-contact fill:#f9f,stroke:#333,stroke-width:4px -``` - ----------------------------------------------- - -*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/amplify-ui-components/src/global/breakpoint.scss b/packages/amplify-ui-components/src/global/breakpoint.scss deleted file mode 100644 index 06bdfa1b995..00000000000 --- a/packages/amplify-ui-components/src/global/breakpoint.scss +++ /dev/null @@ -1,31 +0,0 @@ -$breakpoint-sm: 320px; -$breakpoint-md: 672px; -$breakpoint-lg: 1056px; -$breakpoint-xl: 1321px; -$breakpoint-max: 1584px; - -@mixin sm { - @media (min-width: #{$breakpoint-sm}) { - @content; - } -} -@mixin md { - @media (min-width: #{$breakpoint-md}) { - @content; - } -} -@mixin lg { - @media (min-width: #{$breakpoint-lg}) { - @content; - } -} -@mixin xl { - @media (min-width: #{$breakpoint-xl}) { - @content; - } -} -@mixin max { - @media (min-width: #{$breakpoint-max}) { - @content; - } -} diff --git a/packages/amplify-ui-components/src/global/theme.ts b/packages/amplify-ui-components/src/global/theme.ts deleted file mode 100644 index d3c1342d2ac..00000000000 --- a/packages/amplify-ui-components/src/global/theme.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* eslint-disable */ -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 { browserOrNode } from '@aws-amplify/core'; - -if (browserOrNode().isBrowser) { - let customStyles = document.createElement('style'); - customStyles.appendChild( - document.createTextNode(` - :root { - /* Typography */ - --amplify-font-family: 'Amazon Ember', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; - - --amplify-text-xxs: 0.75rem; - --amplify-text-xs: 0.81rem; - --amplify-text-sm: 0.875rem; - --amplify-text-md: 1rem; - --amplify-text-md-sub: 1.15rem; - --amplify-text-lg: 1.5rem; - --amplify-text-xl: 2rem; - --amplify-text-xxl: 2.5rem; - - /* Colors */ - --amplify-primary-color: #ff9900; - --amplify-primary-contrast: var(--amplify-white); - --amplify-primary-tint: #ffac31; - --amplify-primary-shade: #e88b01; - - --amplify-secondary-color: #152939; - --amplify-secondary-contrast: var(--amplify-white); - --amplify-secondary-tint: #31465f; - --amplify-secondary-shade: #1F2A37; - - --amplify-tertiary-color: #5d8aff; - --amplify-tertiary-contrast: var(--amplify-white); - --amplify-tertiary-tint: #7da1ff; - --amplify-tertiary-shade: #537BE5; - - --amplify-background-color: var(--amplify-white); - - /* Neutral */ - --amplify-grey: #828282; - --amplify-light-grey: #c4c4c4; - --amplify-white: #ffffff; - --amplify-smoke-white: #f5f5f5; - --amplify-red: #dd3f5b; - --amplify-blue: #099ac8; - } - `) - ); - - let parentElement = document.getElementsByTagName('head')[0]; - const firstChild = parentElement.firstChild; - parentElement.insertBefore(customStyles, firstChild); -} diff --git a/packages/amplify-ui-components/src/index.html b/packages/amplify-ui-components/src/index.html deleted file mode 100644 index 976ef3c107c..00000000000 --- a/packages/amplify-ui-components/src/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Stencil Component Starter - - - - - - - diff --git a/packages/amplify-ui-components/src/index.ts b/packages/amplify-ui-components/src/index.ts deleted file mode 100644 index 04582d25405..00000000000 --- a/packages/amplify-ui-components/src/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from './common/types/auth-types'; -export * from './common/types/ui-types'; -export * from './common/types/storage-types'; -export { Translations } from './common/Translations'; -export { onAuthUIStateChange } from './common/helpers'; -export { - AUTH_CHANNEL, - UI_AUTH_CHANNEL, - TOAST_AUTH_ERROR_EVENT, - AUTH_STATE_CHANGE_EVENT, -} from './common/constants'; -export * from './components'; -export * from './components/amplify-auth-fields/amplify-auth-fields-interface'; -export * from './components/amplify-forgot-password/amplify-forgot-password-interface'; -export * from './components/amplify-sign-in/amplify-sign-in-interface'; -export * from './components/amplify-country-dial-code/amplify-country-dial-code-interface'; -export * from './components/amplify-select/amplify-select-interface'; -export * from './components/amplify-totp-setup/amplify-totp-setup-interface'; diff --git a/packages/amplify-ui-components/stencil.config.ts b/packages/amplify-ui-components/stencil.config.ts deleted file mode 100644 index 432aa7de758..00000000000 --- a/packages/amplify-ui-components/stencil.config.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { Config } from '@stencil/core'; -import { angularOutputTarget } from '@stencil/angular-output-target'; -import { reactOutputTarget } from '@stencil/react-output-target'; -import externals from 'rollup-plugin-node-externals'; -import nodePolyfills from 'rollup-plugin-node-polyfills'; -import { sass } from '@stencil/sass'; - -export const config: Config = { - extras: { - initializeNextTick: false, - }, - excludeSrc: ['**/*.e2e.*', '**/*.spec.*', '**/*.stories.*'], - namespace: 'amplify-ui-components', - plugins: [ - externals({ - // deps to include in externals (default: []) - include: [ - '@aws-amplify/auth', - '@aws-amplify/core', - '@aws-amplify/storage', - '@aws-amplify/xr', - '@aws-amplify/interactions', - ], - }), - nodePolyfills(), - sass({ - injectGlobalPaths: ['src/global/breakpoint.scss'], - }), - ], - nodeResolve: { - browser: true, - }, - commonjs: { - namedExports: { - '@aws-sdk/client-cognito-identity-browser': [ - 'CognitoIdentityClient', - 'GetIdCommand', - ], - '@aws-sdk/credential-provider-cognito-identity': [ - 'fromCognitoIdentity', - 'fromCognitoIdentityPool', - ], - '@aws-crypto/sha256-js': ['Sha256'], - '@aws-crypto/sha256-browser': ['Sha256'], - '@aws-sdk/config-resolver': [ - 'resolveRegionConfig', - 'resolveEndpointsConfig', - ], - '@aws-sdk/middleware-signing': [ - 'resolveAwsAuthConfig', - 'getAwsAuthPlugin', - ], - '@aws-sdk/middleware-retry': ['resolveRetryConfig', 'getRetryPlugin'], - '@aws-sdk/middleware-user-agent': [ - 'resolveUserAgentConfig', - 'getUserAgentPlugin', - ], - '@aws-sdk/smithy-client': ['Client', 'Command', 'isa'], - '@aws-sdk/protocol-http': ['HttpRequest'], - '@aws-sdk/middleware-serde': ['getSerdePlugin'], - '@aws-sdk/property-provider': ['ProviderError'], - '@aws-sdk/fetch-http-handler': ['FetchHttpHandler'], - '@aws-sdk/util-uri-escape': ['escapeUri'], - }, - }, - outputTargets: [ - // See: https://github.com/ionic-team/stencil-ds-plugins#angular - angularOutputTarget({ - componentCorePackage: '@aws-amplify/ui-components', - directivesProxyFile: '../amplify-ui-angular/src/directives/proxies.ts', - }), - reactOutputTarget({ - componentCorePackage: '@aws-amplify/ui-components', - proxiesFile: '../amplify-ui-react/src/components.ts', - }), - { type: 'dist' }, - { type: 'dist-custom-elements-bundle', dir: 'dist/components' }, - { type: 'docs-readme' }, - { type: 'docs-json', file: 'dist/docs.json' }, - { - type: 'www', - serviceWorker: null, // disable service workers - }, - ], - globalScript: 'src/global/theme.ts', -}; diff --git a/packages/amplify-ui-components/tsconfig.json b/packages/amplify-ui-components/tsconfig.json deleted file mode 100644 index 6ecf52cb8c8..00000000000 --- a/packages/amplify-ui-components/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "allowSyntheticDefaultImports": true, - "allowUnreachableCode": false, - "declaration": false, - "experimentalDecorators": true, - "lib": ["dom", "es2017", "ES2018.AsyncIterable", "ES2018.AsyncGenerator"], - "moduleResolution": "node", - "module": "esnext", - "target": "es2017", - "noUnusedLocals": true, - "noUnusedParameters": true, - "jsx": "react", - "jsxFactory": "h", - "typeRoots": ["../../node_modules/@types", "node_modules/@types", "./types"] - }, - "include": ["src", "types/jsx.d.ts"], - "exclude": ["node_modules", "../../node_modules"] -} diff --git a/packages/amplify-ui-react/.gitignore b/packages/amplify-ui-react/.gitignore deleted file mode 100755 index f77f473d1ef..00000000000 --- a/packages/amplify-ui-react/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore auto-generated scaffolding from StencilJS -src/components.ts -src/react-component-lib diff --git a/packages/amplify-ui-react/.npmignore b/packages/amplify-ui-react/.npmignore deleted file mode 100644 index 1163a0eef33..00000000000 --- a/packages/amplify-ui-react/.npmignore +++ /dev/null @@ -1,16 +0,0 @@ -__mocks__/** -__tests__/** -coverage/** -docs/** -media/** -node_modules/** -test_Setup/** -.vscode/** -.DS_Store -*.log -lib/.tsbuildinfo -lib-esm/.tsbuildinfo -prepend-license.js -cypress/** -cypress.json -tsc-out/** diff --git a/packages/amplify-ui-react/CHANGELOG.md b/packages/amplify-ui-react/CHANGELOG.md deleted file mode 100644 index 57634c0c9ae..00000000000 --- a/packages/amplify-ui-react/CHANGELOG.md +++ /dev/null @@ -1,627 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [1.2.61](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.60...@aws-amplify/ui-react@1.2.61) (2022-11-04) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.60](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.59...@aws-amplify/ui-react@1.2.60) (2022-10-27) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.59](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.58...@aws-amplify/ui-react@1.2.59) (2022-10-26) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.58](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.57...@aws-amplify/ui-react@1.2.58) (2022-10-25) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.57](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.56...@aws-amplify/ui-react@1.2.57) (2022-10-14) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.56](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.55...@aws-amplify/ui-react@1.2.56) (2022-10-14) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.55](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.53...@aws-amplify/ui-react@1.2.55) (2022-09-30) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.54](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.53...@aws-amplify/ui-react@1.2.54) (2022-09-20) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.53](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.52...@aws-amplify/ui-react@1.2.53) (2022-09-08) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.52](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.51...@aws-amplify/ui-react@1.2.52) (2022-09-01) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.51](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.50...@aws-amplify/ui-react@1.2.51) (2022-08-23) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.50](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.49...@aws-amplify/ui-react@1.2.50) (2022-08-18) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.49](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.48...@aws-amplify/ui-react@1.2.49) (2022-08-16) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.48](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.47...@aws-amplify/ui-react@1.2.48) (2022-08-01) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.47](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.46...@aws-amplify/ui-react@1.2.47) (2022-07-28) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.46](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.45...@aws-amplify/ui-react@1.2.46) (2022-07-21) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.45](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.44...@aws-amplify/ui-react@1.2.45) (2022-07-07) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.44](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.43...@aws-amplify/ui-react@1.2.44) (2022-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.43](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.42...@aws-amplify/ui-react@1.2.43) (2022-06-15) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.42](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.41...@aws-amplify/ui-react@1.2.42) (2022-05-24) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.41](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.40...@aws-amplify/ui-react@1.2.41) (2022-05-23) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.40](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.39...@aws-amplify/ui-react@1.2.40) (2022-05-12) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.39](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.38...@aws-amplify/ui-react@1.2.39) (2022-05-03) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.38](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.37...@aws-amplify/ui-react@1.2.38) (2022-04-14) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.37](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.36...@aws-amplify/ui-react@1.2.37) (2022-04-04) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.36](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.35...@aws-amplify/ui-react@1.2.36) (2022-03-28) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.35](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.34...@aws-amplify/ui-react@1.2.35) (2022-03-22) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.34](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.33...@aws-amplify/ui-react@1.2.34) (2022-03-10) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.33](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.32...@aws-amplify/ui-react@1.2.33) (2022-02-28) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.32](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.31...@aws-amplify/ui-react@1.2.32) (2022-02-03) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.31](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.30...@aws-amplify/ui-react@1.2.31) (2022-01-27) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.30](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.29...@aws-amplify/ui-react@1.2.30) (2022-01-07) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.29](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.28...@aws-amplify/ui-react@1.2.29) (2021-12-16) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.28](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.27...@aws-amplify/ui-react@1.2.28) (2021-12-03) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.27](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.26...@aws-amplify/ui-react@1.2.27) (2021-12-02) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.26](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.25...@aws-amplify/ui-react@1.2.26) (2021-11-18) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.25](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.24...@aws-amplify/ui-react@1.2.25) (2021-11-16) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.24](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.23...@aws-amplify/ui-react@1.2.24) (2021-11-12) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.23](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.22...@aws-amplify/ui-react@1.2.23) (2021-11-09) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.22](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.21...@aws-amplify/ui-react@1.2.22) (2021-10-28) - -**Note:** Version bump only for package @aws-amplify/ui-react - - - - - -## [1.2.21](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.20...@aws-amplify/ui-react@1.2.21) (2021-10-21) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.20](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.19...@aws-amplify/ui-react@1.2.20) (2021-10-07) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.19](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.18...@aws-amplify/ui-react@1.2.19) (2021-09-30) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.18](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.17...@aws-amplify/ui-react@1.2.18) (2021-09-24) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.17](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.16...@aws-amplify/ui-react@1.2.17) (2021-09-22) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.16](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.15...@aws-amplify/ui-react@1.2.16) (2021-09-17) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.14...@aws-amplify/ui-react@1.2.15) (2021-09-09) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.13...@aws-amplify/ui-react@1.2.14) (2021-09-07) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.12...@aws-amplify/ui-react@1.2.13) (2021-09-04) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.11...@aws-amplify/ui-react@1.2.12) (2021-09-02) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.10...@aws-amplify/ui-react@1.2.11) (2021-08-26) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.9...@aws-amplify/ui-react@1.2.10) (2021-08-19) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.8...@aws-amplify/ui-react@1.2.9) (2021-08-12) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.7...@aws-amplify/ui-react@1.2.8) (2021-07-28) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.6...@aws-amplify/ui-react@1.2.7) (2021-07-22) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.5...@aws-amplify/ui-react@1.2.6) (2021-07-16) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.4...@aws-amplify/ui-react@1.2.5) (2021-07-08) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.3...@aws-amplify/ui-react@1.2.4) (2021-06-24) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.2...@aws-amplify/ui-react@1.2.3) (2021-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.1...@aws-amplify/ui-react@1.2.2) (2021-06-10) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.2.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.2.0...@aws-amplify/ui-react@1.2.1) (2021-05-26) - -**Note:** Version bump only for package @aws-amplify/ui-react - -# [1.2.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.1.0...@aws-amplify/ui-react@1.2.0) (2021-05-14) - -### Features - -- **@aws-amplify/ui-react:** wrap withAuthenticator with `AmplifyAuthContainer` ([#8243](https://github.com/aws-amplify/amplify-js/issues/8243)) ([6528037](https://github.com/aws-amplify/amplify-js/commit/652803799d2697039e15ee3e44aace204ed4d417)) - -# [1.1.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.0.7...@aws-amplify/ui-react@1.1.0) (2021-05-06) - -### Features - -- **@aws-amplify/ui-react:** pass through props for the withAuthenticator HOC ([1d8ba06](https://github.com/aws-amplify/amplify-js/commit/1d8ba06468b70908a68316962d4205a882bdf077)) - -## [1.0.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.0.6...@aws-amplify/ui-react@1.0.7) (2021-04-15) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.0.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.0.5...@aws-amplify/ui-react@1.0.6) (2021-03-25) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.0.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.0.4...@aws-amplify/ui-react@1.0.5) (2021-03-12) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.0.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.0.3...@aws-amplify/ui-react@1.0.4) (2021-03-08) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.0.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.0.2...@aws-amplify/ui-react@1.0.3) (2021-02-25) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.0.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@1.0.1...@aws-amplify/ui-react@1.0.2) (2021-02-18) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [1.0.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.38...@aws-amplify/ui-react@1.0.1) (2021-02-15) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.38](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.37...@aws-amplify/ui-react@0.2.38) (2021-02-09) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.37](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.36...@aws-amplify/ui-react@0.2.37) (2021-02-03) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.36](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.35...@aws-amplify/ui-react@0.2.36) (2021-02-01) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.35](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.34...@aws-amplify/ui-react@0.2.35) (2021-01-29) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.34](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.33...@aws-amplify/ui-react@0.2.34) (2021-01-07) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.33](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.32...@aws-amplify/ui-react@0.2.33) (2020-12-17) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.32](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.31...@aws-amplify/ui-react@0.2.32) (2020-12-10) - -### Bug Fixes - -- **@aws-amplify/ui-react:** fix cant resolve 'fs' when bundling with webpack on windows ([#7222](https://github.com/aws-amplify/amplify-js/issues/7222)) ([a3f572e](https://github.com/aws-amplify/amplify-js/commit/a3f572ef0f6a8d30a08c859fe3d2107ccbf8e5ff)) - -## [0.2.31](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.30...@aws-amplify/ui-react@0.2.31) (2020-11-30) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.30](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.29...@aws-amplify/ui-react@0.2.30) (2020-11-23) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.29](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.28...@aws-amplify/ui-react@0.2.29) (2020-11-20) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.28](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.27...@aws-amplify/ui-react@0.2.28) (2020-11-13) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.27](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.26...@aws-amplify/ui-react@0.2.27) (2020-11-03) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.26](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.25...@aws-amplify/ui-react@0.2.26) (2020-10-31) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.25](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.24...@aws-amplify/ui-react@0.2.25) (2020-10-29) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.24](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.23...@aws-amplify/ui-react@0.2.24) (2020-10-15) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.23](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.22...@aws-amplify/ui-react@0.2.23) (2020-10-01) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.22](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.21...@aws-amplify/ui-react@0.2.22) (2020-09-25) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.21](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.20...@aws-amplify/ui-react@0.2.21) (2020-09-16) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.20](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.19...@aws-amplify/ui-react@0.2.20) (2020-09-15) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.19](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.18...@aws-amplify/ui-react@0.2.19) (2020-09-10) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.18](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.17...@aws-amplify/ui-react@0.2.18) (2020-09-03) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.17](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.16...@aws-amplify/ui-react@0.2.17) (2020-09-03) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.16](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.15...@aws-amplify/ui-react@0.2.16) (2020-09-01) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.14...@aws-amplify/ui-react@0.2.15) (2020-08-19) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.13...@aws-amplify/ui-react@0.2.14) (2020-08-06) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.12...@aws-amplify/ui-react@0.2.13) (2020-07-27) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.11...@aws-amplify/ui-react@0.2.12) (2020-07-22) - -### Bug Fixes - -- **@aws-amplify/ui-react:** Fix user not being set on initial render ([#6306](https://github.com/aws-amplify/amplify-js/issues/6306)) ([4603092](https://github.com/aws-amplify/amplify-js/commit/4603092749c058086f2a9a353df0b4d6f0a7071a)) -- **@aws-amplify/ui-react:** Remove side-effects on unmount ([#6312](https://github.com/aws-amplify/amplify-js/issues/6312)) ([3206a4f](https://github.com/aws-amplify/amplify-js/commit/3206a4fa05588674261ba6ac415c0315560ae968)) - -## [0.2.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.10...@aws-amplify/ui-react@0.2.11) (2020-07-09) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.9...@aws-amplify/ui-react@0.2.10) (2020-07-07) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.8...@aws-amplify/ui-react@0.2.9) (2020-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.7...@aws-amplify/ui-react@0.2.8) (2020-06-02) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.6...@aws-amplify/ui-react@0.2.7) (2020-05-22) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.5...@aws-amplify/ui-react@0.2.6) (2020-05-14) - -### Bug Fixes - -- **@aws-amplify/ui-components:** amplify-container component, use dispatch auth event on check user ([#5727](https://github.com/aws-amplify/amplify-js/issues/5727)) ([31709c0](https://github.com/aws-amplify/amplify-js/commit/31709c0a75f11e085f7fd8729653451d9cc9d488)) - -## [0.2.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.4...@aws-amplify/ui-react@0.2.5) (2020-04-30) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.3...@aws-amplify/ui-react@0.2.4) (2020-04-24) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.2...@aws-amplify/ui-react@0.2.3) (2020-04-14) - -**Note:** Version bump only for package @aws-amplify/ui-react - -## [0.2.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.1...@aws-amplify/ui-react@0.2.2) (2020-04-08) - -### Bug Fixes - -- **@aws-amplify/ui-react:** Exclude files via .npmignore rather… ([#5338](https://github.com/aws-amplify/amplify-js/issues/5338)) ([5fd7f24](https://github.com/aws-amplify/amplify-js/commit/5fd7f24f70aa4e30c2fe91afeacedfd80eba0578)) -- **@aws-amplify/ui-react:** Export CJS ([#5324](https://github.com/aws-amplify/amplify-js/issues/5324)) ([767025f](https://github.com/aws-amplify/amplify-js/commit/767025f82986f550866d06a5183497f82c0d31b9)), closes [/github.com/kulshekhar/ts-jest/issues/146#issuecomment-442871767](https://github.com//github.com/kulshekhar/ts-jest/issues/146/issues/issuecomment-442871767) -- **@aws-amplify/ui-react:** withAuthenticator returns Component ([#5327](https://github.com/aws-amplify/amplify-js/issues/5327)) ([01e21ef](https://github.com/aws-amplify/amplify-js/commit/01e21ef07ab5ba60f1f7a0bab73dbb83228b7987)) - -## [0.2.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.0...@aws-amplify/ui-react@0.2.1) (2020-04-07) - -**Note:** Version bump only for package @aws-amplify/ui-react - -# 0.2.0 (2020-04-02) - -### Features - -- **@aws-amplify/ui-components:** Framework Bindings for Authen… ([#4676](https://github.com/aws-amplify/amplify-js/issues/4676)) ([407089f](https://github.com/aws-amplify/amplify-js/commit/407089fb4f93afc79ff77b4926e0285dff3ad335)), closes [/github.com/yarnpkg/yarn/issues/5225#issuecomment-490462853](https://github.com//github.com/yarnpkg/yarn/issues/5225/issues/issuecomment-490462853) [#4706](https://github.com/aws-amplify/amplify-js/issues/4706) -- **@aws-amplify/ui-components:** User agent tracking for UI component packages ([#4804](https://github.com/aws-amplify/amplify-js/issues/4804)) ([15a0a2f](https://github.com/aws-amplify/amplify-js/commit/15a0a2fadeb96543721a6733faeb509efc26e1e2)) -- **@aws-amplify/ui-react:** withAuthenticator(Component[, props]) ([#5204](https://github.com/aws-amplify/amplify-js/issues/5204)) ([39d84e7](https://github.com/aws-amplify/amplify-js/commit/39d84e713dcbb1569877b299f251071fe1ceb3b1)) - -# 0.1.0 (2020-03-31) - -### Features - -- **@aws-amplify/ui-components:** Framework Bindings for Authen… ([#4676](https://github.com/aws-amplify/amplify-js/issues/4676)) ([407089f](https://github.com/aws-amplify/amplify-js/commit/407089fb4f93afc79ff77b4926e0285dff3ad335)), closes [/github.com/yarnpkg/yarn/issues/5225#issuecomment-490462853](https://github.com//github.com/yarnpkg/yarn/issues/5225/issues/issuecomment-490462853) [#4706](https://github.com/aws-amplify/amplify-js/issues/4706) -- **@aws-amplify/ui-components:** User agent tracking for UI component packages ([#4804](https://github.com/aws-amplify/amplify-js/issues/4804)) ([15a0a2f](https://github.com/aws-amplify/amplify-js/commit/15a0a2fadeb96543721a6733faeb509efc26e1e2)) -- **@aws-amplify/ui-react:** withAuthenticator(Component[, props]) ([#5204](https://github.com/aws-amplify/amplify-js/issues/5204)) ([39d84e7](https://github.com/aws-amplify/amplify-js/commit/39d84e713dcbb1569877b299f251071fe1ceb3b1)) diff --git a/packages/amplify-ui-react/README.md b/packages/amplify-ui-react/README.md deleted file mode 100644 index db9a3988294..00000000000 --- a/packages/amplify-ui-react/README.md +++ /dev/null @@ -1 +0,0 @@ -# Amplify UI React diff --git a/packages/amplify-ui-react/__tests__/withAuthenticator-test.tsx b/packages/amplify-ui-react/__tests__/withAuthenticator-test.tsx deleted file mode 100644 index c41cafd6a12..00000000000 --- a/packages/amplify-ui-react/__tests__/withAuthenticator-test.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import React from 'react'; -import { renderToStaticMarkup } from 'react-dom/server'; -import { withAuthenticator } from '../src/withAuthenticator'; - -const App = () =>

My App

; - -describe('withAuthenticator', () => { - it('should not render App initially', () => { - const Wrapped = withAuthenticator(App); - - expect(renderToStaticMarkup()).toMatchInlineSnapshot( - `""` - ); - }); - - it('should pass through props to the wrapped component', () => { - const Dummy = ({ prop1 }) =>
{prop1}
; - const mockProp = 'mockProp'; - - const useStateSpy = jest.spyOn(React, 'useState'); - useStateSpy.mockReturnValue([true, () => {}]); - - const Wrapped = withAuthenticator(Dummy); - - expect( - renderToStaticMarkup() - ).toMatchInlineSnapshot(`"
${mockProp}
"`); - - useStateSpy.mockRestore(); - }); -}); diff --git a/packages/amplify-ui-react/jest.config.js b/packages/amplify-ui-react/jest.config.js deleted file mode 100644 index f0b39f769db..00000000000 --- a/packages/amplify-ui-react/jest.config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - globals: { - 'ts-jest': { - tsConfig: { - esModuleInterop: true, - jsx: 'react', - }, - }, - }, - preset: 'ts-jest', - testEnvironment: 'node', -}; diff --git a/packages/amplify-ui-react/package.json b/packages/amplify-ui-react/package.json deleted file mode 100755 index 98d5c9d94dd..00000000000 --- a/packages/amplify-ui-react/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "@aws-amplify/ui-react", - "private": "true", - "sideEffects": false, - "version": "1.2.61", - "description": "React specific wrapper for @aws-amplify/ui-components", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/aws-amplify/amplify-js.git" - }, - "scripts": { - "test": "jest", - "build-with-test": "npm test && npm run build", - "build:cjs": "node ./build es5 && webpack && webpack --config ./webpack.config.dev.js", - "build:esm": "node ./build es6", - "build:cjs:watch": "node ./build es5 --watch", - "build:esm:watch": "node ./build es6 --watch", - "build:watch": "npm run build:esm:watch", - "build": "npm run clean && npm run build:cjs && npm run build:esm", - "clean": "rimraf lib-esm lib dist" - }, - "main": "./lib/index.js", - "module": "./lib-esm/index.js", - "typings": "./lib-esm/index.d.ts", - "devDependencies": { - "@types/react": "^16.0.41", - "@types/react-dom": "^16.0.11", - "react": "^16.7.0", - "react-dom": "^16.7.0", - "typescript": "^3.3.4000" - }, - "dependencies": { - "@aws-amplify/ui-components": "1.9.41" - }, - "peerDependencies": { - "react": ">= 16.7.0", - "react-dom": ">= 16.7.0" - } -} diff --git a/packages/amplify-ui-react/src/index.ts b/packages/amplify-ui-react/src/index.ts deleted file mode 100755 index 1232fd49b54..00000000000 --- a/packages/amplify-ui-react/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './components'; - -export { withAuthenticator } from './withAuthenticator'; diff --git a/packages/amplify-ui-react/src/withAuthenticator.tsx b/packages/amplify-ui-react/src/withAuthenticator.tsx deleted file mode 100644 index d36e6c81c5f..00000000000 --- a/packages/amplify-ui-react/src/withAuthenticator.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import React, { - ComponentType, - ComponentPropsWithRef, - FunctionComponent, -} from 'react'; -import { Auth, appendToCognitoUserAgent } from '@aws-amplify/auth'; -import { AmplifyContainer, AmplifyAuthenticator, AmplifyAuthContainer } from './'; -import { onAuthUIStateChange, AuthState } from '@aws-amplify/ui-components'; -import { Logger } from '@aws-amplify/core'; - -const logger = new Logger('withAuthenticator'); - -export function withAuthenticator( - Component: ComponentType, - authenticatorProps?: ComponentPropsWithRef -) { - const AppWithAuthenticator: FunctionComponent = props => { - const [signedIn, setSignedIn] = React.useState(false); - - React.useEffect(() => { - appendToCognitoUserAgent('withAuthenticator'); - - // checkUser returns an "unsubscribe" function to stop side-effects - return checkUser(); - }, []); - - function checkUser() { - setUser(); - - return onAuthUIStateChange(authState => { - if (authState === AuthState.SignedIn) { - setSignedIn(true); - } else if (authState === AuthState.SignedOut) { - setSignedIn(false); - } - }); - } - - async function setUser() { - try { - const user = await Auth.currentAuthenticatedUser(); - if (user) setSignedIn(true); - } catch (err) { - logger.debug(err); - } - }; - - if (!signedIn) { - return ( - - - - - - ); - } - - return ; - }; - - return AppWithAuthenticator; -} diff --git a/packages/amplify-ui-react/webpack.config.js b/packages/amplify-ui-react/webpack.config.js deleted file mode 100644 index 38c6b956dd9..00000000000 --- a/packages/amplify-ui-react/webpack.config.js +++ /dev/null @@ -1,56 +0,0 @@ -module.exports = { - entry: { - 'aws-amplify-react.min': './lib/index.js', - }, - externals: [ - '@aws-amplify/auth', - '@aws-amplify/analytics', - '@aws-amplify/api', - '@aws-amplify/core', - '@aws-amplify/interactions', - '@aws-amplify/storage', - '@aws-amplify/ui', - '@aws-amplify/ui/dist/style.css', - '@aws-amplify/xr', - 'aws-amplify', - 'react', - ], - output: { - filename: '[name].js', - path: __dirname + '/dist', - library: 'aws_amplify_react', - libraryTarget: 'umd', - umdNamedDefine: true, - globalObject: 'this', - devtoolModuleFilenameTemplate: require('../aws-amplify/webpack-utils') - .devtoolModuleFilenameTemplate, - }, - // Enable sourcemaps for debugging webpack's output. - devtool: 'source-map', - resolve: { - extensions: ['.js', '.json'], - }, - mode: 'production', - module: { - rules: [ - // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. - //{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader' }, - { - test: /\.js?$/, - exclude: /node_modules/, - use: [ - 'babel-loader', - { - loader: 'babel-loader', - options: { - presets: ['@babel/preset-env'], - }, - }, - ], - }, - ], - }, - node: { - fs: 'empty', - }, -}; diff --git a/packages/amplify-ui-storybook/.env b/packages/amplify-ui-storybook/.env deleted file mode 100644 index 6f809cc2540..00000000000 --- a/packages/amplify-ui-storybook/.env +++ /dev/null @@ -1 +0,0 @@ -SKIP_PREFLIGHT_CHECK=true diff --git a/packages/amplify-ui-storybook/.gitignore b/packages/amplify-ui-storybook/.gitignore deleted file mode 100644 index 4d29575de80..00000000000 --- a/packages/amplify-ui-storybook/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/packages/amplify-ui-storybook/.storybook/extractPropsFromComponentName.js b/packages/amplify-ui-storybook/.storybook/extractPropsFromComponentName.js deleted file mode 100644 index 9f8e34636ce..00000000000 --- a/packages/amplify-ui-storybook/.storybook/extractPropsFromComponentName.js +++ /dev/null @@ -1,42 +0,0 @@ -import { components } from '@aws-amplify/ui-components/dist/docs.json'; -import { extractProps } from '@storybook/addon-docs/dist/frameworks/react/extractProps'; - -// Borrowed from https://github.com/storybookjs/storybook/blob/aed5276e0bc05d1126b592b649499125508015be/addons/docs/src/frameworks/web-components/config.js -export function mapData(data) { - return data.map(function mapItem(item) { - return { - name: item.name, - type: { summary: item.type, detail: undefined }, - required: item.required, - description: item.docs, - defaultValue: { - summary: item.default === undefined ? '-' : item.default, - detail: undefined, - }, - }; - }); -} - -export function extractPropsFromComponentName(tagName) { - const component = components.find(function compareTag(component) { - return component.tag === tagName; - }); - - // Default to Storybook's automatic type extraction - if (!component) { - return extractProps(tagName); - } - - const sections = ['props', 'methods', 'events', 'styles', 'slots'].reduce( - (acc, section) => { - if (component[section].length) { - acc[section] = mapData(component[section]); - } - - return acc; - }, - {} - ); - - return { sections }; -} diff --git a/packages/amplify-ui-storybook/.storybook/main.js b/packages/amplify-ui-storybook/.storybook/main.js deleted file mode 100644 index 412c4c38787..00000000000 --- a/packages/amplify-ui-storybook/.storybook/main.js +++ /dev/null @@ -1,24 +0,0 @@ -const path = require('path'); - -module.exports = { - stories: ['../src/stories/**/*.stories.(ts|tsx|js|jsx|mdx)'], - addons: [ - '@storybook/addon-actions', - '@storybook/addon-knobs', - '@storybook/addon-links', - { - name: '@storybook/preset-create-react-app', - options: { - tsDocgenLoaderOptions: { - tsconfigPath: path.resolve(__dirname, '../tsconfig.json'), - }, - }, - }, - { - name: '@storybook/addon-docs', - options: { - configureJSX: true, - }, - }, - ], -}; diff --git a/packages/amplify-ui-storybook/.storybook/preview.js b/packages/amplify-ui-storybook/.storybook/preview.js deleted file mode 100644 index 6d03da3c511..00000000000 --- a/packages/amplify-ui-storybook/.storybook/preview.js +++ /dev/null @@ -1,30 +0,0 @@ -// // https://reactjs.org/blog/2018/10/01/create-react-app-v2.html#breaking-changes -import 'react-app-polyfill/ie11'; -import 'react-app-polyfill/stable'; - -import { addDecorator, addParameters } from '@storybook/react'; -import { create } from '@storybook/theming'; -import { extractPropsFromComponentName } from './extractPropsFromComponentName'; -import { withAmplify } from './withAmplify'; - -addDecorator(withAmplify); - -addParameters({ - docs: { - extractProps: extractPropsFromComponentName, - }, - - options: { - theme: create({ - appBg: '#F6F6F5', - base: 'light', - brandImage: - 'https://aws-amplify.github.io/docs/images/Logos/Amplify%20Logo.svg', - brandTitle: 'Amplify UI Components', - colorPrimary: '#232f3e', - colorSecondary: '#ff9900', - fontBase: '"Amazon Ember", "Helvetica", sans-serif', - fontCode: '"Source Code Pro", Monaco, monospace', - }), - }, -}); diff --git a/packages/amplify-ui-storybook/.storybook/withAmplify.js b/packages/amplify-ui-storybook/.storybook/withAmplify.js deleted file mode 100644 index 1e46a8c8ed9..00000000000 --- a/packages/amplify-ui-storybook/.storybook/withAmplify.js +++ /dev/null @@ -1,7 +0,0 @@ -import Amplify from 'aws-amplify'; - -export function withAmplify(storyFn) { - Amplify.configure({}); - - return storyFn(); -} diff --git a/packages/amplify-ui-storybook/CHANGELOG.md b/packages/amplify-ui-storybook/CHANGELOG.md deleted file mode 100644 index 52849b0fa6d..00000000000 --- a/packages/amplify-ui-storybook/CHANGELOG.md +++ /dev/null @@ -1,634 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [2.0.61](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.60...@aws-amplify/ui-storybook@2.0.61) (2022-11-04) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.60](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.59...@aws-amplify/ui-storybook@2.0.60) (2022-10-27) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.59](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.58...@aws-amplify/ui-storybook@2.0.59) (2022-10-26) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.58](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.57...@aws-amplify/ui-storybook@2.0.58) (2022-10-25) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.57](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.56...@aws-amplify/ui-storybook@2.0.57) (2022-10-14) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.56](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.55...@aws-amplify/ui-storybook@2.0.56) (2022-10-14) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.55](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.53...@aws-amplify/ui-storybook@2.0.55) (2022-09-30) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.54](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.53...@aws-amplify/ui-storybook@2.0.54) (2022-09-20) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.53](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.52...@aws-amplify/ui-storybook@2.0.53) (2022-09-08) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.52](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.51...@aws-amplify/ui-storybook@2.0.52) (2022-09-01) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.51](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.50...@aws-amplify/ui-storybook@2.0.51) (2022-08-23) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.50](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.49...@aws-amplify/ui-storybook@2.0.50) (2022-08-18) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.49](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.48...@aws-amplify/ui-storybook@2.0.49) (2022-08-16) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.48](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.47...@aws-amplify/ui-storybook@2.0.48) (2022-08-01) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.47](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.46...@aws-amplify/ui-storybook@2.0.47) (2022-07-28) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.46](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.45...@aws-amplify/ui-storybook@2.0.46) (2022-07-21) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.45](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.44...@aws-amplify/ui-storybook@2.0.45) (2022-07-07) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.44](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.43...@aws-amplify/ui-storybook@2.0.44) (2022-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.43](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.42...@aws-amplify/ui-storybook@2.0.43) (2022-06-15) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.42](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.41...@aws-amplify/ui-storybook@2.0.42) (2022-05-24) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.41](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.40...@aws-amplify/ui-storybook@2.0.41) (2022-05-23) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.40](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.39...@aws-amplify/ui-storybook@2.0.40) (2022-05-12) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.39](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.38...@aws-amplify/ui-storybook@2.0.39) (2022-05-03) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.38](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.37...@aws-amplify/ui-storybook@2.0.38) (2022-04-14) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.37](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.36...@aws-amplify/ui-storybook@2.0.37) (2022-04-04) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.36](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.35...@aws-amplify/ui-storybook@2.0.36) (2022-03-28) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.35](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.34...@aws-amplify/ui-storybook@2.0.35) (2022-03-22) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.34](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.33...@aws-amplify/ui-storybook@2.0.34) (2022-03-10) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.33](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.32...@aws-amplify/ui-storybook@2.0.33) (2022-02-28) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.32](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.31...@aws-amplify/ui-storybook@2.0.32) (2022-02-03) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.31](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.30...@aws-amplify/ui-storybook@2.0.31) (2022-01-27) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.30](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.29...@aws-amplify/ui-storybook@2.0.30) (2022-01-07) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.29](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.28...@aws-amplify/ui-storybook@2.0.29) (2021-12-16) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.28](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.27...@aws-amplify/ui-storybook@2.0.28) (2021-12-03) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.27](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.26...@aws-amplify/ui-storybook@2.0.27) (2021-12-02) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.26](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.25...@aws-amplify/ui-storybook@2.0.26) (2021-11-18) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.25](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.24...@aws-amplify/ui-storybook@2.0.25) (2021-11-16) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.24](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.23...@aws-amplify/ui-storybook@2.0.24) (2021-11-12) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.23](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.22...@aws-amplify/ui-storybook@2.0.23) (2021-11-09) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.22](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.21...@aws-amplify/ui-storybook@2.0.22) (2021-10-28) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - - - - - -## [2.0.21](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.20...@aws-amplify/ui-storybook@2.0.21) (2021-10-21) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.20](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.19...@aws-amplify/ui-storybook@2.0.20) (2021-10-07) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.19](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.18...@aws-amplify/ui-storybook@2.0.19) (2021-09-30) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.18](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.17...@aws-amplify/ui-storybook@2.0.18) (2021-09-24) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.17](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.16...@aws-amplify/ui-storybook@2.0.17) (2021-09-22) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.16](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.15...@aws-amplify/ui-storybook@2.0.16) (2021-09-17) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.14...@aws-amplify/ui-storybook@2.0.15) (2021-09-09) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.13...@aws-amplify/ui-storybook@2.0.14) (2021-09-07) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.12...@aws-amplify/ui-storybook@2.0.13) (2021-09-04) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.11...@aws-amplify/ui-storybook@2.0.12) (2021-09-02) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.10...@aws-amplify/ui-storybook@2.0.11) (2021-08-26) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.9...@aws-amplify/ui-storybook@2.0.10) (2021-08-19) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.8...@aws-amplify/ui-storybook@2.0.9) (2021-08-12) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.7...@aws-amplify/ui-storybook@2.0.8) (2021-07-28) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.6...@aws-amplify/ui-storybook@2.0.7) (2021-07-22) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.5...@aws-amplify/ui-storybook@2.0.6) (2021-07-16) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.4...@aws-amplify/ui-storybook@2.0.5) (2021-07-08) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.3...@aws-amplify/ui-storybook@2.0.4) (2021-06-24) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.2...@aws-amplify/ui-storybook@2.0.3) (2021-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@2.0.1...@aws-amplify/ui-storybook@2.0.2) (2021-06-10) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [2.0.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@1.0.12...@aws-amplify/ui-storybook@2.0.1) (2021-05-26) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [1.0.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@1.0.11...@aws-amplify/ui-storybook@1.0.12) (2021-05-14) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [1.0.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@1.0.10...@aws-amplify/ui-storybook@1.0.11) (2021-05-11) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [1.0.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@1.0.9...@aws-amplify/ui-storybook@1.0.10) (2021-05-06) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [1.0.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@1.0.8...@aws-amplify/ui-storybook@1.0.9) (2021-04-15) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [1.0.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@1.0.7...@aws-amplify/ui-storybook@1.0.8) (2021-03-25) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [1.0.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@1.0.6...@aws-amplify/ui-storybook@1.0.7) (2021-03-18) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [1.0.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@1.0.5...@aws-amplify/ui-storybook@1.0.6) (2021-03-12) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [1.0.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@1.0.4...@aws-amplify/ui-storybook@1.0.5) (2021-03-08) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [1.0.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@1.0.3...@aws-amplify/ui-storybook@1.0.4) (2021-03-03) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [1.0.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@1.0.2...@aws-amplify/ui-storybook@1.0.3) (2021-02-25) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [1.0.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@1.0.1...@aws-amplify/ui-storybook@1.0.2) (2021-02-18) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [1.0.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.38...@aws-amplify/ui-storybook@1.0.1) (2021-02-15) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.38](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.37...@aws-amplify/ui-storybook@0.2.38) (2021-02-09) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.37](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.36...@aws-amplify/ui-storybook@0.2.37) (2021-02-03) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.36](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.35...@aws-amplify/ui-storybook@0.2.36) (2021-02-01) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.35](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.34...@aws-amplify/ui-storybook@0.2.35) (2021-01-29) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.34](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.33...@aws-amplify/ui-storybook@0.2.34) (2021-01-07) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.33](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.32...@aws-amplify/ui-storybook@0.2.33) (2020-12-17) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.32](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.31...@aws-amplify/ui-storybook@0.2.32) (2020-12-10) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.31](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.30...@aws-amplify/ui-storybook@0.2.31) (2020-11-30) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.30](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.29...@aws-amplify/ui-storybook@0.2.30) (2020-11-23) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.29](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.28...@aws-amplify/ui-storybook@0.2.29) (2020-11-20) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.28](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.27...@aws-amplify/ui-storybook@0.2.28) (2020-11-13) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.27](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.26...@aws-amplify/ui-storybook@0.2.27) (2020-11-03) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.26](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.25...@aws-amplify/ui-storybook@0.2.26) (2020-10-31) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.25](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.24...@aws-amplify/ui-storybook@0.2.25) (2020-10-29) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.24](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.23...@aws-amplify/ui-storybook@0.2.24) (2020-10-15) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.23](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.22...@aws-amplify/ui-storybook@0.2.23) (2020-10-01) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.22](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.21...@aws-amplify/ui-storybook@0.2.22) (2020-09-25) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.21](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.20...@aws-amplify/ui-storybook@0.2.21) (2020-09-16) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.20](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.19...@aws-amplify/ui-storybook@0.2.20) (2020-09-15) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.19](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.18...@aws-amplify/ui-storybook@0.2.19) (2020-09-10) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.18](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.17...@aws-amplify/ui-storybook@0.2.18) (2020-09-03) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.17](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.16...@aws-amplify/ui-storybook@0.2.17) (2020-09-03) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.16](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.15...@aws-amplify/ui-storybook@0.2.16) (2020-09-01) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.14...@aws-amplify/ui-storybook@0.2.15) (2020-08-19) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.13...@aws-amplify/ui-storybook@0.2.14) (2020-08-06) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.12...@aws-amplify/ui-storybook@0.2.13) (2020-07-27) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.11...@aws-amplify/ui-storybook@0.2.12) (2020-07-22) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.10...@aws-amplify/ui-storybook@0.2.11) (2020-07-09) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.9...@aws-amplify/ui-storybook@0.2.10) (2020-07-07) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.8...@aws-amplify/ui-storybook@0.2.9) (2020-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.7...@aws-amplify/ui-storybook@0.2.8) (2020-06-02) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.6...@aws-amplify/ui-storybook@0.2.7) (2020-05-22) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.5...@aws-amplify/ui-storybook@0.2.6) (2020-05-14) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.4...@aws-amplify/ui-storybook@0.2.5) (2020-04-30) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.3...@aws-amplify/ui-storybook@0.2.4) (2020-04-24) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -## [0.2.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.2...@aws-amplify/ui-storybook@0.2.3) (2020-04-14) - -### Bug Fixes - -- **@aws-amplify/ui-storybook:** Fix yarn test ([#5353](https://github.com/aws-amplify/amplify-js/issues/5353)) ([9f13083](https://github.com/aws-amplify/amplify-js/commit/9f13083db80c43f15b77be9a504c6178faf85b46)) - -## [0.2.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.1...@aws-amplify/ui-storybook@0.2.2) (2020-04-08) - -### Bug Fixes - -- **@aws-amplify/ui-react:** withAuthenticator returns Component ([#5327](https://github.com/aws-amplify/amplify-js/issues/5327)) ([01e21ef](https://github.com/aws-amplify/amplify-js/commit/01e21ef07ab5ba60f1f7a0bab73dbb83228b7987)) - -## [0.2.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.0...@aws-amplify/ui-storybook@0.2.1) (2020-04-07) - -**Note:** Version bump only for package @aws-amplify/ui-storybook - -# 0.2.0 (2020-04-02) - -### Bug Fixes - -- **@aws-amplify/ui-components:** Fix shadow dom form submit ([#5160](https://github.com/aws-amplify/amplify-js/issues/5160)) ([766c5ac](https://github.com/aws-amplify/amplify-js/commit/766c5ac5bdcf22f772340f78f5d45790f3142b71)) - -### Features - -- **@aws-amplify/ui-components:** Storybook ([#4973](https://github.com/aws-amplify/amplify-js/issues/4973)) ([bfbb46a](https://github.com/aws-amplify/amplify-js/commit/bfbb46af6be247a9aebd934e0f88227f621d7d8a)) -- **@aws-amplify/ui-react:** withAuthenticator(Component[, props]) ([#5204](https://github.com/aws-amplify/amplify-js/issues/5204)) ([39d84e7](https://github.com/aws-amplify/amplify-js/commit/39d84e713dcbb1569877b299f251071fe1ceb3b1)) - -# 0.1.0 (2020-03-31) - -### Bug Fixes - -- **@aws-amplify/ui-components:** Fix shadow dom form submit ([#5160](https://github.com/aws-amplify/amplify-js/issues/5160)) ([766c5ac](https://github.com/aws-amplify/amplify-js/commit/766c5ac5bdcf22f772340f78f5d45790f3142b71)) - -### Features - -- **@aws-amplify/ui-components:** Storybook ([#4973](https://github.com/aws-amplify/amplify-js/issues/4973)) ([bfbb46a](https://github.com/aws-amplify/amplify-js/commit/bfbb46af6be247a9aebd934e0f88227f621d7d8a)) -- **@aws-amplify/ui-react:** withAuthenticator(Component[, props]) ([#5204](https://github.com/aws-amplify/amplify-js/issues/5204)) ([39d84e7](https://github.com/aws-amplify/amplify-js/commit/39d84e713dcbb1569877b299f251071fe1ceb3b1)) diff --git a/packages/amplify-ui-storybook/README.md b/packages/amplify-ui-storybook/README.md deleted file mode 100644 index 547dda4283e..00000000000 --- a/packages/amplify-ui-storybook/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# @aws-amplify/ui-storybook - -Collection of stories & documentation for `@aws-amplify/ui-components` and related view libraries. - -## Local Development - -_All commands take place in the monorepo root._ - -1. `yarn bootstrap` -1. In another tab, `yarn lerna run build:watch --parallel --scope="@aws-amplify/ui-*" --stream`. -1. `yarn workspace @aws-amplify/ui-storybook start` -1. Check out the stories! diff --git a/packages/amplify-ui-storybook/package.json b/packages/amplify-ui-storybook/package.json deleted file mode 100644 index 7ffadad354a..00000000000 --- a/packages/amplify-ui-storybook/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "@aws-amplify/ui-storybook", - "version": "2.0.61", - "private": true, - "dependencies": { - "@aws-amplify/ui-react": "0.2.38", - "@storybook/addon-knobs": "^5.3.13", - "@storybook/theming": "^5.3.14", - "@types/jest": "^24.0.0", - "@types/node": "^12.0.0", - "@types/react": "^16.9.0", - "@types/react-dom": "^16.9.0", - "aws-amplify": "4.3.43", - "react": "^16.12.0", - "react-app-polyfill": "^1.0.6", - "react-dom": "^16.12.0", - "react-scripts": "3.4.1" - }, - "scripts": { - "test": "CI=true react-scripts test --passWithNoTests", - "start": "start-storybook -p 3000 -s public", - "prebuild": "rimraf dist", - "build-storybook": "build-storybook -s public -o dist --quiet" - }, - "eslintConfig": { - "extends": "react-app" - }, - "browserslist": { - "production": [ - "ie 11", - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "ie 11", - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": { - "@storybook/addon-actions": "^5.3.13", - "@storybook/addon-docs": "^5.3.13", - "@storybook/addon-links": "^5.3.13", - "@storybook/addons": "^5.3.13", - "@storybook/preset-create-react-app": "^1.5.2", - "@storybook/react": "^5.3.13", - "typescript": "~3.7.2" - } -} diff --git a/packages/amplify-ui-storybook/public/favicon.ico b/packages/amplify-ui-storybook/public/favicon.ico deleted file mode 100644 index 57cbd29940d..00000000000 Binary files a/packages/amplify-ui-storybook/public/favicon.ico and /dev/null differ diff --git a/packages/amplify-ui-storybook/public/robots.txt b/packages/amplify-ui-storybook/public/robots.txt deleted file mode 100644 index e9e57dc4d41..00000000000 --- a/packages/amplify-ui-storybook/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/packages/amplify-ui-storybook/src/react-app-env.d.ts b/packages/amplify-ui-storybook/src/react-app-env.d.ts deleted file mode 100644 index 6431bc5fc6b..00000000000 --- a/packages/amplify-ui-storybook/src/react-app-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/packages/amplify-ui-storybook/src/stories/0-Welcome.stories.mdx b/packages/amplify-ui-storybook/src/stories/0-Welcome.stories.mdx deleted file mode 100644 index 58add271110..00000000000 --- a/packages/amplify-ui-storybook/src/stories/0-Welcome.stories.mdx +++ /dev/null @@ -1,8 +0,0 @@ -import { Description, Meta } from '@storybook/addon-docs/blocks'; -import Readme from '@aws-amplify/ui-components/Readme.md'; - - - -  - -{Readme} diff --git a/packages/amplify-ui-storybook/src/stories/AmplifyAuthenticator.mdx b/packages/amplify-ui-storybook/src/stories/AmplifyAuthenticator.mdx deleted file mode 100644 index 0757a75d307..00000000000 --- a/packages/amplify-ui-storybook/src/stories/AmplifyAuthenticator.mdx +++ /dev/null @@ -1,30 +0,0 @@ -import { Preview, Props, Story } from '@storybook/addon-docs/blocks'; - -# AmplifyAuthenticator - -The Authenticator is a drop-in UI component that provides: - -- User Sign in -- User Sign up -- User Sign out -- Forgot Password -- Federated authentication -- MFA (Multi-Factor Authentication) e.g. SMS, Email, and TOTP (Temporary One Time Password) -- Confirm MFA Code’s and Provide QR codes for TOTP - -## Live Demo - - - -## Props - - - -## Social Providers - - - - -## Initial State - - diff --git a/packages/amplify-ui-storybook/src/stories/AmplifyAuthenticator.stories.tsx b/packages/amplify-ui-storybook/src/stories/AmplifyAuthenticator.stories.tsx deleted file mode 100644 index 1048b02d11d..00000000000 --- a/packages/amplify-ui-storybook/src/stories/AmplifyAuthenticator.stories.tsx +++ /dev/null @@ -1,182 +0,0 @@ -import { Auth } from 'aws-amplify'; -import { - AmplifyAuthenticator, - AmplifySignOut, - withAuthenticator, -} from '@aws-amplify/ui-react'; -import { withKnobs, select, text } from '@storybook/addon-knobs'; -import React from 'react'; - -import page from './AmplifyAuthenticator.mdx'; - -export default { - title: 'AmplifyAuthenticator', - component: 'amplify-authenticator', - decorators: [withKnobs], - parameters: { docs: { page } }, -}; - -const App = () => ( - <> -

You are signed in!

- - -); - -export const basic = () => ( - - - -); - -export const FederatedIdentityProviders = () => ( - -); - -// Styles from https://developers.google.com/identity/sign-in/web/sign-in -export const FederatedOAuthProviders = () => ( - -
- - - - - -
-
-); - -FederatedOAuthProviders.story = { - name: 'Federated OAuth Providers', -}; - -export const initialState = () => { - const initialAuthState = select( - 'Initial Auth State', - ['signin', 'signup'], - 'signup' - ); - - return ( - - ); -}; - -export const BasicWithAuthenticator = () => { - const Wrapped = withAuthenticator(App); - - return ; -}; - -BasicWithAuthenticator.story = { - name: 'Basic withAuthenticator', -}; - -export const WithAuthenticatorWithUsernameAlias = () => { - const Wrapped = withAuthenticator(App, { usernameAlias: 'email' }); - - return ; -}; - -WithAuthenticatorWithUsernameAlias.story = { - name: 'withAuthenticator with usernameAlias', -}; diff --git a/packages/amplify-ui-storybook/src/types/mdx.d.ts b/packages/amplify-ui-storybook/src/types/mdx.d.ts deleted file mode 100644 index 1bd98689cae..00000000000 --- a/packages/amplify-ui-storybook/src/types/mdx.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -// types/mdx.d.ts -declare module '*.mdx' { - let MDXComponent: (props: any) => JSX.Element; - export default MDXComponent; -} diff --git a/packages/amplify-ui-storybook/tsconfig.json b/packages/amplify-ui-storybook/tsconfig.json deleted file mode 100644 index f2850b71613..00000000000 --- a/packages/amplify-ui-storybook/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react" - }, - "include": [ - "src" - ] -} diff --git a/packages/amplify-ui-vue/CHANGELOG.md b/packages/amplify-ui-vue/CHANGELOG.md deleted file mode 100644 index 52e292c0669..00000000000 --- a/packages/amplify-ui-vue/CHANGELOG.md +++ /dev/null @@ -1,624 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [1.1.55](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.54...@aws-amplify/ui-vue@1.1.55) (2022-11-04) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.54](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.53...@aws-amplify/ui-vue@1.1.54) (2022-10-27) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.53](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.52...@aws-amplify/ui-vue@1.1.53) (2022-10-26) - - -### Bug Fixes - -* remove dep on es2020.promise lib additions ([#10532](https://github.com/aws-amplify/amplify-js/issues/10532)) ([8ad200e](https://github.com/aws-amplify/amplify-js/commit/8ad200e7b98967d565e7abe29c2dfb971b9f52a1)) - - - - - -## [1.1.52](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.51...@aws-amplify/ui-vue@1.1.52) (2022-10-25) - - -### Bug Fixes - -* **@aws-amplify/datastore:** introduce "settlement" guarantees to stop() and clear() ([#10450](https://github.com/aws-amplify/amplify-js/issues/10450)) ([16c535b](https://github.com/aws-amplify/amplify-js/commit/16c535beda9386a027c2805f29a359fbeb8bac15)), closes [#10449](https://github.com/aws-amplify/amplify-js/issues/10449) - - - - - -## [1.1.51](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.50...@aws-amplify/ui-vue@1.1.51) (2022-10-14) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.50](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.49...@aws-amplify/ui-vue@1.1.50) (2022-10-14) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.49](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.47...@aws-amplify/ui-vue@1.1.49) (2022-09-30) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.48](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.47...@aws-amplify/ui-vue@1.1.48) (2022-09-20) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.47](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.46...@aws-amplify/ui-vue@1.1.47) (2022-09-08) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.46](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.45...@aws-amplify/ui-vue@1.1.46) (2022-09-01) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.45](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.44...@aws-amplify/ui-vue@1.1.45) (2022-08-23) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.44](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.43...@aws-amplify/ui-vue@1.1.44) (2022-08-18) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.43](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.42...@aws-amplify/ui-vue@1.1.43) (2022-08-16) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.42](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.41...@aws-amplify/ui-vue@1.1.42) (2022-08-01) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.41](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.40...@aws-amplify/ui-vue@1.1.41) (2022-07-28) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.40](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.39...@aws-amplify/ui-vue@1.1.40) (2022-07-21) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.39](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.38...@aws-amplify/ui-vue@1.1.39) (2022-07-07) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.38](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.37...@aws-amplify/ui-vue@1.1.38) (2022-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.37](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.36...@aws-amplify/ui-vue@1.1.37) (2022-06-15) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.36](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.35...@aws-amplify/ui-vue@1.1.36) (2022-05-24) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.35](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.34...@aws-amplify/ui-vue@1.1.35) (2022-05-23) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.34](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.33...@aws-amplify/ui-vue@1.1.34) (2022-05-12) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.33](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.32...@aws-amplify/ui-vue@1.1.33) (2022-05-03) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.32](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.31...@aws-amplify/ui-vue@1.1.32) (2022-04-14) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.31](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.30...@aws-amplify/ui-vue@1.1.31) (2022-04-04) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.30](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.29...@aws-amplify/ui-vue@1.1.30) (2022-03-28) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.29](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.28...@aws-amplify/ui-vue@1.1.29) (2022-03-22) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.28](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.27...@aws-amplify/ui-vue@1.1.28) (2022-03-10) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.27](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.26...@aws-amplify/ui-vue@1.1.27) (2022-02-28) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.26](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.25...@aws-amplify/ui-vue@1.1.26) (2022-02-03) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.25](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.24...@aws-amplify/ui-vue@1.1.25) (2022-01-27) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.24](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.23...@aws-amplify/ui-vue@1.1.24) (2022-01-07) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.23](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.22...@aws-amplify/ui-vue@1.1.23) (2021-12-16) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.22](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.21...@aws-amplify/ui-vue@1.1.22) (2021-12-03) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.21](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.20...@aws-amplify/ui-vue@1.1.21) (2021-12-02) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.20](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.19...@aws-amplify/ui-vue@1.1.20) (2021-11-18) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.19](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.18...@aws-amplify/ui-vue@1.1.19) (2021-11-16) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.18](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.17...@aws-amplify/ui-vue@1.1.18) (2021-11-12) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.17](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.16...@aws-amplify/ui-vue@1.1.17) (2021-11-09) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.16](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.15...@aws-amplify/ui-vue@1.1.16) (2021-10-28) - -**Note:** Version bump only for package @aws-amplify/ui-vue - - - - - -## [1.1.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.14...@aws-amplify/ui-vue@1.1.15) (2021-10-21) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.13...@aws-amplify/ui-vue@1.1.14) (2021-10-07) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.12...@aws-amplify/ui-vue@1.1.13) (2021-09-30) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.11...@aws-amplify/ui-vue@1.1.12) (2021-09-24) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.10...@aws-amplify/ui-vue@1.1.11) (2021-09-22) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.9...@aws-amplify/ui-vue@1.1.10) (2021-09-17) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.8...@aws-amplify/ui-vue@1.1.9) (2021-09-09) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.7...@aws-amplify/ui-vue@1.1.8) (2021-09-07) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.6...@aws-amplify/ui-vue@1.1.7) (2021-09-04) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.5...@aws-amplify/ui-vue@1.1.6) (2021-09-02) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.4...@aws-amplify/ui-vue@1.1.5) (2021-08-26) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.3...@aws-amplify/ui-vue@1.1.4) (2021-08-19) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.2...@aws-amplify/ui-vue@1.1.3) (2021-08-12) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.1...@aws-amplify/ui-vue@1.1.2) (2021-07-28) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.1.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.1.0...@aws-amplify/ui-vue@1.1.1) (2021-07-22) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -# [1.1.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.14...@aws-amplify/ui-vue@1.1.0) (2021-07-16) - -### Features - -- core/cloudwatch-logging ([#8588](https://github.com/aws-amplify/amplify-js/issues/8588)) ([6f28c7e](https://github.com/aws-amplify/amplify-js/commit/6f28c7e94ae8d41b37490292ff3547505100c6b2)) - -## [1.0.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.13...@aws-amplify/ui-vue@1.0.14) (2021-07-08) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.0.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.12...@aws-amplify/ui-vue@1.0.13) (2021-06-24) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.0.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.11...@aws-amplify/ui-vue@1.0.12) (2021-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.0.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.10...@aws-amplify/ui-vue@1.0.11) (2021-06-10) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.0.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.9...@aws-amplify/ui-vue@1.0.10) (2021-05-26) - -### Bug Fixes - -- **@aws-amplify/ui-vue:** exclude external types ([#8298](https://github.com/aws-amplify/amplify-js/issues/8298)) ([2627619](https://github.com/aws-amplify/amplify-js/commit/2627619f0b782faca4eba9df4d817ccdf12b0b2e)) - -## [1.0.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.8...@aws-amplify/ui-vue@1.0.9) (2021-05-14) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.0.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.7...@aws-amplify/ui-vue@1.0.8) (2021-05-06) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.0.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.6...@aws-amplify/ui-vue@1.0.7) (2021-04-15) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.0.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.5...@aws-amplify/ui-vue@1.0.6) (2021-03-25) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.0.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.4...@aws-amplify/ui-vue@1.0.5) (2021-03-12) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.0.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.3...@aws-amplify/ui-vue@1.0.4) (2021-03-08) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.0.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.2...@aws-amplify/ui-vue@1.0.3) (2021-02-25) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.0.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@1.0.1...@aws-amplify/ui-vue@1.0.2) (2021-02-18) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [1.0.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.3.2...@aws-amplify/ui-vue@1.0.1) (2021-02-15) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.3.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.3.1...@aws-amplify/ui-vue@0.3.2) (2021-02-09) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.3.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.3.0...@aws-amplify/ui-vue@0.3.1) (2021-02-03) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -# [0.3.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.34...@aws-amplify/ui-vue@0.3.0) (2021-02-01) - -### Features - -- **@aws-amplify/ui-vue:** Use `@aws-amplify/ui-components` for Vue 3 ([#7634](https://github.com/aws-amplify/amplify-js/issues/7634)) ([5574d95](https://github.com/aws-amplify/amplify-js/commit/5574d956d635c45a9c6e1f48fd03c96b0a8c336c)) - -## [0.2.34](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.33...@aws-amplify/ui-vue@0.2.34) (2021-01-29) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.33](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.32...@aws-amplify/ui-vue@0.2.33) (2021-01-07) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.32](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.31...@aws-amplify/ui-vue@0.2.32) (2020-12-17) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.31](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.30...@aws-amplify/ui-vue@0.2.31) (2020-12-10) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.30](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.29...@aws-amplify/ui-vue@0.2.30) (2020-11-30) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.29](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.28...@aws-amplify/ui-vue@0.2.29) (2020-11-23) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.28](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.27...@aws-amplify/ui-vue@0.2.28) (2020-11-20) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.27](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.26...@aws-amplify/ui-vue@0.2.27) (2020-11-13) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.26](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.25...@aws-amplify/ui-vue@0.2.26) (2020-11-03) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.25](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.24...@aws-amplify/ui-vue@0.2.25) (2020-10-31) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.24](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.23...@aws-amplify/ui-vue@0.2.24) (2020-10-29) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.23](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.22...@aws-amplify/ui-vue@0.2.23) (2020-10-15) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.22](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.21...@aws-amplify/ui-vue@0.2.22) (2020-10-01) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.21](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.20...@aws-amplify/ui-vue@0.2.21) (2020-09-25) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.20](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.19...@aws-amplify/ui-vue@0.2.20) (2020-09-16) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.19](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.18...@aws-amplify/ui-vue@0.2.19) (2020-09-15) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.18](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.17...@aws-amplify/ui-vue@0.2.18) (2020-09-10) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.17](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.16...@aws-amplify/ui-vue@0.2.17) (2020-09-03) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.16](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.15...@aws-amplify/ui-vue@0.2.16) (2020-09-03) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.14...@aws-amplify/ui-vue@0.2.15) (2020-09-01) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.13...@aws-amplify/ui-vue@0.2.14) (2020-08-19) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.12...@aws-amplify/ui-vue@0.2.13) (2020-08-06) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.11...@aws-amplify/ui-vue@0.2.12) (2020-07-27) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.10...@aws-amplify/ui-vue@0.2.11) (2020-07-22) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.9...@aws-amplify/ui-vue@0.2.10) (2020-07-09) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.8...@aws-amplify/ui-vue@0.2.9) (2020-07-07) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.7...@aws-amplify/ui-vue@0.2.8) (2020-06-18) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.6...@aws-amplify/ui-vue@0.2.7) (2020-06-02) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.5...@aws-amplify/ui-vue@0.2.6) (2020-05-22) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.4...@aws-amplify/ui-vue@0.2.5) (2020-05-14) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.3...@aws-amplify/ui-vue@0.2.4) (2020-04-30) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.2...@aws-amplify/ui-vue@0.2.3) (2020-04-24) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.1...@aws-amplify/ui-vue@0.2.2) (2020-04-08) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -## [0.2.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.0...@aws-amplify/ui-vue@0.2.1) (2020-04-07) - -**Note:** Version bump only for package @aws-amplify/ui-vue - -# 0.2.0 (2020-04-02) - -### Bug Fixes - -- **@aws-amplify/ui-components:** Fix Vue production ([#5084](https://github.com/aws-amplify/amplify-js/issues/5084)) ([342639b](https://github.com/aws-amplify/amplify-js/commit/342639b16d36ffec6ecd171d7714d5f93d51db33)) - -### Features - -- **@aws-amplify/ui-components:** Framework Bindings for Authen… ([#4676](https://github.com/aws-amplify/amplify-js/issues/4676)) ([407089f](https://github.com/aws-amplify/amplify-js/commit/407089fb4f93afc79ff77b4926e0285dff3ad335)), closes [/github.com/yarnpkg/yarn/issues/5225#issuecomment-490462853](https://github.com//github.com/yarnpkg/yarn/issues/5225/issues/issuecomment-490462853) [#4706](https://github.com/aws-amplify/amplify-js/issues/4706) - -# 0.1.0 (2020-03-31) - -### Bug Fixes - -- **@aws-amplify/ui-components:** Fix Vue production ([#5084](https://github.com/aws-amplify/amplify-js/issues/5084)) ([342639b](https://github.com/aws-amplify/amplify-js/commit/342639b16d36ffec6ecd171d7714d5f93d51db33)) - -### Features - -- **@aws-amplify/ui-components:** Framework Bindings for Authen… ([#4676](https://github.com/aws-amplify/amplify-js/issues/4676)) ([407089f](https://github.com/aws-amplify/amplify-js/commit/407089fb4f93afc79ff77b4926e0285dff3ad335)), closes [/github.com/yarnpkg/yarn/issues/5225#issuecomment-490462853](https://github.com//github.com/yarnpkg/yarn/issues/5225/issues/issuecomment-490462853) [#4706](https://github.com/aws-amplify/amplify-js/issues/4706) diff --git a/packages/amplify-ui-vue/README.md b/packages/amplify-ui-vue/README.md deleted file mode 100644 index c324e1663d0..00000000000 --- a/packages/amplify-ui-vue/README.md +++ /dev/null @@ -1 +0,0 @@ -# Amplify UI Vue diff --git a/packages/amplify-ui-vue/package.json b/packages/amplify-ui-vue/package.json deleted file mode 100644 index e45ecaedffd..00000000000 --- a/packages/amplify-ui-vue/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@aws-amplify/ui-vue", - "private": "true", - "sideEffects": true, - "version": "1.1.55", - "description": "Vue specific wrapper for @aws-amplify/ui-components", - "publishConfig": { - "access": "public" - }, - "main": "./dist/index.js", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", - "files": [ - "dist/" - ], - "repository": { - "type": "git", - "url": "https://github.com/aws-amplify/amplify-js.git" - }, - "dependencies": { - "@aws-amplify/ui-components": "1.9.41" - }, - "devDependencies": { - "rimraf": "^3.0.2" - }, - "peerDependencies": { - "vue": "2.x.x" - }, - "scripts": { - "build": "npm run clean && npm run compile", - "clean": "rimraf dist", - "compile": "npm run tsc", - "tsc": "tsc -p ." - } -} diff --git a/packages/amplify-ui-vue/src/index.ts b/packages/amplify-ui-vue/src/index.ts deleted file mode 100644 index d0d0265979b..00000000000 --- a/packages/amplify-ui-vue/src/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { - applyPolyfills, - defineCustomElements, -} from '@aws-amplify/ui-components/loader'; -import Vue from 'vue'; - -// Tell Vue to ignore all components defined in the @aws-amplify/ui-components -// package. The regex assumes all components names are prefixed -// 'amplify-' -if (Vue) { - Vue.config.ignoredElements = [/amplify-\w*/]; -} else { - throw new Error( - 'No Vue 2 export was found. For later versions of Vue, please use `@aws-amplify/ui-components` ' + - 'according to this guide: https://docs.amplify.aws/start/getting-started/setup/q/integration/vue.' - ); -} -// Bind the custom elements to the window object -applyPolyfills().then(() => { - defineCustomElements(window); -}); diff --git a/packages/amplify-ui-vue/tsconfig.json b/packages/amplify-ui-vue/tsconfig.json deleted file mode 100755 index 0db6e5d4edd..00000000000 --- a/packages/amplify-ui-vue/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "compilerOptions": { - "allowUnreachableCode": false, - "allowSyntheticDefaultImports": true, - "declaration": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "esModuleInterop": true, - "lib": ["dom", "es2015", "es2018.asynciterable", "es2018.asyncgenerator"], - "module": "es2015", - "moduleResolution": "node", - "noImplicitAny": true, - "noImplicitReturns": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "outDir": "dist", - "removeComments": false, - "sourceMap": true, - "jsx": "react", - "target": "es2015", - "types": [] - }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["**/__tests__/**"], - "compileOnSave": false, - "buildOnSave": false -} diff --git a/packages/amplify-ui/CHANGELOG.md b/packages/amplify-ui/CHANGELOG.md deleted file mode 100644 index bac46a5b32e..00000000000 --- a/packages/amplify-ui/CHANGELOG.md +++ /dev/null @@ -1,373 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [2.0.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@2.0.6...@aws-amplify/ui@2.0.7) (2022-10-26) - - -### Bug Fixes - -* remove dep on es2020.promise lib additions ([#10532](https://github.com/aws-amplify/amplify-js/issues/10532)) ([8ad200e](https://github.com/aws-amplify/amplify-js/commit/8ad200e7b98967d565e7abe29c2dfb971b9f52a1)) - - - - - -## [2.0.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@2.0.5...@aws-amplify/ui@2.0.6) (2022-10-25) - - -### Bug Fixes - -* **@aws-amplify/datastore:** introduce "settlement" guarantees to stop() and clear() ([#10450](https://github.com/aws-amplify/amplify-js/issues/10450)) ([16c535b](https://github.com/aws-amplify/amplify-js/commit/16c535beda9386a027c2805f29a359fbeb8bac15)), closes [#10449](https://github.com/aws-amplify/amplify-js/issues/10449) - - - - - -## [2.0.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@2.0.4...@aws-amplify/ui@2.0.5) (2021-12-03) - - -### Bug Fixes - -* **@aws-amplify/amplify-ui:** change private property to false in package.json ([#9303](https://github.com/aws-amplify/amplify-js/issues/9303)) ([454be65](https://github.com/aws-amplify/amplify-js/commit/454be65da7e071540447c13e12fa81032922fd28)) -* **@aws-amplify/amplify-ui:** remove private prop from package.json ([#9304](https://github.com/aws-amplify/amplify-js/issues/9304)) ([66626c2](https://github.com/aws-amplify/amplify-js/commit/66626c2f21df0a27f33309b120de072206ac0001)) - - - - - -## [2.0.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@2.0.3...@aws-amplify/ui@2.0.4) (2021-12-02) - -**Note:** Version bump only for package @aws-amplify/ui - - - - - -## [2.0.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@2.0.2...@aws-amplify/ui@2.0.3) (2021-05-14) - -**Note:** Version bump only for package @aws-amplify/ui - - - - - -## [2.0.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@2.0.1...@aws-amplify/ui@2.0.2) (2020-04-02) - -**Note:** Version bump only for package @aws-amplify/ui - - - - - -## [2.0.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.1.6...@aws-amplify/ui@2.0.1) (2020-03-31) - -**Note:** Version bump only for package @aws-amplify/ui - -## [1.1.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.1.5...@aws-amplify/ui@1.1.6) (2020-03-25) - -### Bug Fixes - -- **aws-amplify-react:** Fix Federated icons when using React Bo… ([#5073](https://github.com/aws-amplify/amplify-js/issues/5073)) ([49f8bfe](https://github.com/aws-amplify/amplify-js/commit/49f8bfeebea845779ef232d83295bd33ebb22fb2)) - -## [1.1.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.1.3...@aws-amplify/ui@1.1.5) (2020-02-07) - -### Bug Fixes - -- **@aws-amplify/ui:** Add padding to caret for SignUp component ([#4757](https://github.com/aws-amplify/amplify-js/issues/4757)) ([34cdc6c](https://github.com/aws-amplify/amplify-js/commit/34cdc6c9841b48c077eff42b21fa2b3fcc9a80be)) - -## [1.1.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.1.2...@aws-amplify/ui@1.1.3) (2019-10-23) - -**Note:** Version bump only for package @aws-amplify/ui - -## [1.1.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.1.0...@aws-amplify/ui@1.1.2) (2019-10-10) - -**Note:** Version bump only for package @aws-amplify/ui - -# [1.1.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.25...@aws-amplify/ui@1.1.0) (2019-10-10) - -### Features - -- Added Prettier formatting ([4dfd9aa](https://github.com/aws-amplify/amplify-js/commit/4dfd9aa9ab900307c9d17c68448a6ca4aa08fd5a)) - -## [1.0.25](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.23...@aws-amplify/ui@1.0.25) (2019-09-13) - -**Note:** Version bump only for package @aws-amplify/ui - -## [1.0.23](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.22...@aws-amplify/ui@1.0.23) (2019-07-30) - -**Note:** Version bump only for package @aws-amplify/ui - -## [1.0.22](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.20...@aws-amplify/ui@1.0.22) (2019-07-18) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.21-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.20...@aws-amplify/ui@1.0.21-unstable.0) (2019-07-12) - -### Bug Fixes - -- **@aws-amplify/ui:** Fix the issue that window is not defined in [@aws-amplify](https://github.com/aws-amplify)/ui in NodeJS ([#3512](https://github.com/aws-amplify/amplify-js/issues/3512)) ([f290a00](https://github.com/aws-amplify/amplify-js/commit/f290a00)) - - - -## [1.0.20](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.20-unstable.1...@aws-amplify/ui@1.0.20) (2019-06-17) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.20-unstable.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.20-unstable.0...@aws-amplify/ui@1.0.20-unstable.1) (2019-06-03) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.20-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.19...@aws-amplify/ui@1.0.20-unstable.0) (2019-05-24) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.19](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.19-unstable.1...@aws-amplify/ui@1.0.19) (2019-05-06) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.19-unstable.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.19-unstable.0...@aws-amplify/ui@1.0.19-unstable.1) (2019-04-19) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.19-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.18...@aws-amplify/ui@1.0.19-unstable.0) (2019-04-12) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.18](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.18-unstable.0...@aws-amplify/ui@1.0.18) (2019-03-28) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.18-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.17...@aws-amplify/ui@1.0.18-unstable.0) (2019-03-07) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.17](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.17-unstable.0...@aws-amplify/ui@1.0.17) (2019-03-06) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.17-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.16...@aws-amplify/ui@1.0.17-unstable.0) (2019-03-04) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.16](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.16-unstable.0...@aws-amplify/ui@1.0.16) (2019-03-04) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.16-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.15...@aws-amplify/ui@1.0.16-unstable.0) (2019-01-21) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.15](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.14...@aws-amplify/ui@1.0.15) (2019-01-10) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.13-unstable.0...@aws-amplify/ui@1.0.14) (2018-12-15) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.12...@aws-amplify/ui@1.0.13) (2018-12-14) - - - -## [1.0.13-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.12...@aws-amplify/ui@1.0.13-unstable.0) (2018-12-14) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.12-unstable.0...@aws-amplify/ui@1.0.12) (2018-12-14) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.12-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.11...@aws-amplify/ui@1.0.12-unstable.0) (2018-12-13) - -### Features - -- **@aws-amplify/interactions @aws-amplify/react @aws-amplify/react-native @aws-amplify/angular @aws-amplify/vue:** Update interactions to include voice ([#2121](https://github.com/aws-amplify/amplify-js/issues/2121)) ([938d2a5](https://github.com/aws-amplify/amplify-js/commit/938d2a5)) - - - -## [1.0.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.11-unstable.0...@aws-amplify/ui@1.0.11) (2018-12-13) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.11-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.10...@aws-amplify/ui@1.0.11-unstable.0) (2018-12-10) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.10](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.10-unstable.1...@aws-amplify/ui@1.0.10) (2018-12-03) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.10-unstable.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.10-unstable.0...@aws-amplify/ui@1.0.10-unstable.1) (2018-11-30) - -### Features - -- **aws-amplify-react:** disable sign in button while loading ([#2216](https://github.com/aws-amplify/amplify-js/issues/2216)) ([b196b7f](https://github.com/aws-amplify/amplify-js/commit/b196b7f)) - - - -## [1.0.10-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.9...@aws-amplify/ui@1.0.10-unstable.0) (2018-11-26) - - - -## [1.0.10-beta.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.10-beta.1...@aws-amplify/ui@1.0.10-beta.2) (2018-11-19) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.10-beta.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.10-beta.0...@aws-amplify/ui@1.0.10-beta.1) (2018-11-14) - -**Note:** Version bump only for package @aws-amplify/ui - - -## [1.0.10-beta.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.9-unstable.0...@aws-amplify/ui@1.0.10-beta.0) (2018-11-02) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.9-unstable.0...@aws-amplify/ui@1.0.9) (2018-11-01) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.9-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.8...@aws-amplify/ui@1.0.9-unstable.0) (2018-10-30) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.8-unstable.0...@aws-amplify/ui@1.0.8) (2018-10-29) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.8-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.7...@aws-amplify/ui@1.0.8-unstable.0) (2018-10-29) - -### Features - -- **aws-amplify-react:** Add Auth0 button ([b16ded3](https://github.com/aws-amplify/amplify-js/commit/b16ded3)) - - - -## [1.0.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.7-unstable.0...@aws-amplify/ui@1.0.7) (2018-10-17) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.7-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.6-unstable.0...@aws-amplify/ui@1.0.7-unstable.0) (2018-10-05) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.6-unstable.0...@aws-amplify/ui@1.0.6) (2018-10-04) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.6-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.5-unstable.0...@aws-amplify/ui@1.0.6-unstable.0) (2018-10-03) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.5](https://github.com/powerful23/aws-amplify/compare/@aws-amplify/ui@1.0.5-unstable.0...@aws-amplify/ui@1.0.5) (2018-10-03) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.5-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.4...@aws-amplify/ui@1.0.5-unstable.0) (2018-10-02) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.4-unstable.1...@aws-amplify/ui@1.0.4) (2018-09-27) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.4-unstable.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.4-unstable.0...@aws-amplify/ui@1.0.4-unstable.1) (2018-09-26) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.4-unstable.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.3...@aws-amplify/ui@1.0.4-unstable.0) (2018-09-26) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## [1.0.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.2...@aws-amplify/ui@1.0.3) (2018-09-17) - -### Bug Fixes - -- **aws-amplify-angular:** authState visibility issues on initial load ([#1657](https://github.com/aws-amplify/amplify-js/issues/1657)) ([50611fe](https://github.com/aws-amplify/amplify-js/commit/50611fe)) -- **aws-amplify-angular:** responsive styles for components ([650ddf2](https://github.com/aws-amplify/amplify-js/commit/650ddf2)) -- **aws-amplify-angular:** updates to responsive ui ([a036278](https://github.com/aws-amplify/amplify-js/commit/a036278)) - - - -## [1.0.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui@1.0.1-unstable.0...@aws-amplify/ui@1.0.2) (2018-08-28) - -**Note:** Version bump only for package @aws-amplify/ui - - - -## 1.0.1-unstable.0 (2018-08-28) - -- Amplify ui migration (#1517) ([41d3184](https://github.com/aws-amplify/amplify-js/commit/41d3184)), closes [#1517](https://github.com/aws-amplify/amplify-js/issues/1517) - -### BREAKING CHANGES - -- UI Components diff --git a/packages/amplify-ui/Readme.md b/packages/amplify-ui/Readme.md deleted file mode 100644 index 2b0948649cb..00000000000 --- a/packages/amplify-ui/Readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# AWS Amplify Package - Amplify UI - -AWS Amplify is a JavaScript library for frontend and mobile developers building cloud-enabled applications. The library is a declarative interface across different categories of operations in order to make common tasks easier to add into your application. The default implementation works with Amazon Web Services (AWS) resources but is designed to be open and pluggable for usage with other cloud services that wish to provide an implementation or custom backends. - -`@aws-amplify/ui` contains CSS modules as well as the core UI styleguide (css) and theme for Amplify UI component libraries. Documentation is available [here](https://aws-amplify.github.io/amplify-js/media/ui_guide) diff --git a/packages/amplify-ui/package.json b/packages/amplify-ui/package.json deleted file mode 100644 index 6ced5f42770..00000000000 --- a/packages/amplify-ui/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@aws-amplify/ui", - "version": "2.0.7", - "main": "dist/aws-amplify-ui.js", - "types": "lib/index.d.ts", - "publishConfig": { - "access": "public" - }, - "scripts": { - "format": "echo \"Not implemented\"", - "test": "webpack", - "start": "webpack-dev-server", - "clean": "rimraf dist lib", - "build": "npm run clean && webpack && copyfiles -u 1 ./src/*.css.d.ts ./lib" - }, - "license": "Apache-2.0", - "devDependencies": { - "autoprefixer": "^9.5.1", - "copyfiles": "^2.1.0", - "css-loader": "^2.1.1", - "dts-css-modules-loader": "^1.0.1", - "mini-css-extract-plugin": "^0.6.0", - "postcss-loader": "^3.0.0", - "rimraf": "^2.6.3", - "style-loader": "^0.23.1", - "ts-loader": "^5.4.4", - "webpack": "4.39.3", - "webpack-cli": "^3.3.1" - }, - "postcss": { - "plugins": { - "autoprefixer": {} - } - } -} diff --git a/packages/amplify-ui/postcss.config.js b/packages/amplify-ui/postcss.config.js deleted file mode 100644 index aeefe5ad6fd..00000000000 --- a/packages/amplify-ui/postcss.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - plugins: [require('autoprefixer')], -}; diff --git a/packages/amplify-ui/src/Anchor.css b/packages/amplify-ui/src/Anchor.css deleted file mode 100644 index f02d5790486..00000000000 --- a/packages/amplify-ui/src/Anchor.css +++ /dev/null @@ -1,10 +0,0 @@ -@import './Theme.css'; - -.a { - color: var(--link-color); - cursor: pointer; -} - -.a:hover { - text-decoration: underline; -} \ No newline at end of file diff --git a/packages/amplify-ui/src/Anchor.css.d.ts b/packages/amplify-ui/src/Anchor.css.d.ts deleted file mode 100644 index 51b3394cde3..00000000000 --- a/packages/amplify-ui/src/Anchor.css.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const a: string; diff --git a/packages/amplify-ui/src/Angular.css b/packages/amplify-ui/src/Angular.css deleted file mode 100644 index c4e72f5f00b..00000000000 --- a/packages/amplify-ui/src/Angular.css +++ /dev/null @@ -1,607 +0,0 @@ -body { - font-family: var(--font-family); -} - -h1 { - height: 50px; - font-weight: 500; -} - -h2 { - height: 42px; - font-weight: 300; -} - -h4 { - height: 28px; - font-weight: 400; -} - -h5 { - height: 21px; - font-weight: 400; -} - -p { - height: 16px; - font-weight: 300; -} - -span { - color: var(--color-gray); -} - -input:disabled { - background-color: #EDEDED; -} - -.amplify-component { - display: block; -} - -.amplify-container { - height: auto; - padding-bottom: 1em; -} - -/******************************************** -** Auth -*******************************************/ - -.amplify-authenticator { - width: var(--component-width-desktop); - margin: 0 auto; - border-radius: 6px; - background-color: var(--color-white); - box-shadow: var(--box-shadow); -} - -.amplify-signup-container { - height: 570px; -} - -.amplify-reset-password-container { - height: 270px; -} - -.amplify-confirm-reset-password-container { - height: 360px; -} - -.amplify-confirm-signup-container { - height: 370px; -} - -.amplify-confirm-signin-container { - height: 260px; -} - -.amplify-form-actions-left { - margin-top: 1em; - color: var(--color-gray); -} - -@media (min-width: 320px) and (max-width: 480px) { -.amplify-authenticator { - width: var(--component-width-mobile); - box-shadow: none; -} -} - -/******************************************** -** Storage -*******************************************/ - -.amplify-photo-picker { - width: var(--component-width-desktop); - margin: 1em auto; - border-radius: 6px; - background-color: var(--color-white); - box-shadow: var(--box-shadow); -} - -.amplify-photo-picker-container { - width: 400px; - margin: 0 auto; - padding: 1em; -} - -.amplify-album { - width: var(--component-width-desktop); - margin: 1em auto; - border-radius: 6px; - background-color: var(--color-white); - box-shadow: var(--box-shadow); -} - -.amplify-album-container { - width: 400px; - margin: 0 auto; - padding: 1em; -} - -.amplify-photo-picker-upload { - height: 212px; - width: 392px; - border: 2px dotted #979797; - border-radius: 4px; - background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAABBCAYAAACUyynLAAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAASASURBVHic7ZtZe7I6FEbfEMIMbe3p//+BfRyKzBk4F2pFvyJDMdiWda2bZD1JSHY2hHNeY2EQxtwN+Iks0kawSBvBIm0Ei7QRmLofyIXEerOHVOpbcahh4HUVgpl0opb1R/tI28Xpt4UBgFQKuzidoEXD0SqtLDmqSkwWr6oEypJPFq8vWqXFSf4jYnahTVpZclR8ulF2ouL6R5s2afccEbpHGxly9uRcoKg4pFSoB5xY67pGXlRj2tcb17FACOn9e0IASg04FgNjwzYRvaRVlcBun4HfYXo9AoyZeA49WFY/eZ3S0qyc7dWum+fIh+/Znb+7uablRfVnhAGHPWSfZaRVmlL1nxJ2YhenUOr2itUqLc2Lzj//RpSqkebFzd+0Sitm2Gk/Cl19b5UmhJy8MT+Frr7fXNP+KqPXtIV2tOfTvsJiJlzHgmWZYCb93NnXdQ0uJKpKIC+qu5xdxzCrNMsyEQUe7JadOCEEFjNhMROB76CsBOIkmzS9NIbZpD1HHnzPGfQf2zLxtoqQZgV2cXanlnWjXRohBK8v4cXoklIhy0sUJYeQEkrVMAwCk1I4NoPn2qD0vPz6ngPTNLHe7lEPyRxMhHZpq+fgU1hd14iTHEn672ZSqRqVEqi4QJzkCHwHUeB+rne2ZWL1HGC93WttP6D57RmFHhybATjk+N838ZfCviJJC7xv4ov7BcdmiELvLm29hTZplBoIjhmEuq6x3u7B+bANNOfynykZeJdTVwfanhaF3ufUipN8sLATnMuLTC0hRPto0yLNMAjc07SUqveUbCNJC0h5nqauzWAY/bO230WLNMc+p6KzvJwkZjMOIQSObU0Stw9apFnsfAs+VfbkOk7zGfdGizRKzx0ScprsyXWc5jPujRZppLHeTJU9uY5Dftuahkb/plqw/4mj8WCgRVrzTWdONI2u4zSfcW+0SOPinJU4nQi+y3Wc5jPujRZpzVoLz+2+V+zDdZyy0nenoWmkSfBj3p1SA4E/LCV0TeA7F0cnLuToE8YYZimAiQIXbOS+ijGKKHAvY+/15ta0SSuKCtVxCp1yakPFMUbx+hJeFLqUFdd+3ag1PbD5SKGOqR1qGHhbRb2nauA7eFtFoMa5yVIpbD/0VwFoTUJKqbDeJvhvdRgthBA8hR4CzxmUuQUO6aXNNtG61TihPXNbcYH3dYzVSwjzKIJSA2HgIrxaq9oQUmGz3X++XHQzy70nFxLv6w+kWTm4ODDNS7yvP2YTBsx4G3WqSkqyAoHnwHWs1iOWUodKyiQrHqJcYvbLYiEkdnGKXZzCNCmYSWEc347qeFn8CKKazC6tiXhAQV/RuqYNqPn9dXT1vVWazqTeo9HV91ZpjjVNNuIn0tX3VmlTZSN+Il19b5XGGB1coPIb8D2n80x8c3P7FLqtZVC/Edsy8RR2n0o6P76o6xof+xxp9r0L3kfH9xw8hW6vT4V6fxvFhUSWHQ7VUslBx59HhBCAGseEgGcP+kJ50AdlCweWQuURLNJGsEgbwSJtBIu0ESzSRrBIG8H/BsMLCwR4M6kAAAAASUVORK5CYII=') center no-repeat #FBFBFB; -} - -.amplify-upload-input { - margin-top: 0.5em; -} - -.amplify-upload-button { - margin: 0.5em auto !important; - width: 100% !important; -} - -.amplify-photo-picker-preview { - width: 100%; -} - -.amplify-image-container { - display: inline; -} - -.amplify-image { - width: 30%; - margin: 0.2em; - border-radius: 6px; - border: 2px solid var(--color-white); - cursor: pointer; -} - -@media (min-width: 320px) and (max-width: 480px) { - .amplify-photo-picker { - width: var(--component-width-mobile); - } - .amplify-image { - width: var(--component-width-mobile); - } - .amplify-album { - width: var(--component-width-mobile); - } - .amplify-album-container { - width: var(--component-width-mobile); - } - .amplify-photo-picker-container { - width: auto; - } - .amplify-photo-picker-upload { - width: auto; - } -} - -/********************************************** -** Interactions -**********************************************/ - -.amplify-interactions { - width: var(--component-width-desktop); - margin: 1em auto; - border-radius: 6px; - background-color: var(--color-white); - box-shadow: var(--box-shadow); -} - -.amplify-interactions-container { - width: 400px; - margin: 0 auto; - padding: 1em; -} - -.amplify-interactions-button { - background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAYAAABHomvIAAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAG2SURBVFiF7dfPKwRhHMfx9+xqhaItIg5KikgOlER2TzhQ4i+QwtndQe4O4uhCSQ57sC6SkotfR1uK2nWgrGJr8yvsjsO2bWtb+8w+88zOYT6nmWfmeebV95lfj6bruo6N4yo1oFAcoGwcoGwcoGwcoGxsDyyz5CqxawhtwPsTNA1C5wxobqGumvJv8d0+HM5B4jvT1jICw1tC3dVO8ds9VNaD25PdHj6A6LnQEOqAkSBs90HsBsZ2wVOVfTweFhpGDTAShMPZ1LQeL+QiNQ1qu0sETOOSidS+ruciu6bB2yE0nLkPyV9c1pU08K9AQx9Ut4AmVhvzKvgfDlKVfDyFmlZhHJgFLIQDaJ+CoVXDQ8sDRXG+dUOVS0cOqBgHMkARXJscDooFiuL8cjgoBmghDoy+B+MR2BmA5I8lODBSQT0JiU/oX8x/jsk4MAJ8CcHeBDQNwcCSJTgwAoxewkcMgpO5SEU4MHIPHs3DbSC1XeGF8QA8nMDzFfjWlODAyC9/9Cyz/fUKF8swvAkuT/4+JkQc2DwKVY3Q0At1PeAuV8jKRP2aRDK2X3Y6QNk4QNk4QNnYHvgLzPueuQw6nCEAAAAASUVORK5CYII=') center no-repeat var(--color-white); - border:none; - cursor: pointer; - width: 32px; -} - -.amplify-interactions-actions { - display:flex; - border-top: var(--input-border); - margin-bottom: -1em; - margin-left: -1.9em; - margin-right: -1.9em; -} - -.amplify-interactions-actions > input[type="text"] { - border: none; - margin-top: 0px; - margin-bottom: 0px; - margin-left: 0px; -} - -.amplify-interactions-actions > input[type="text"]:focus { -border: 0px solid var(--color-white) !important; -} - -.amplify-interactions-conversation { - margin: 1em; -} - -.amplify-interactions-input { - padding: 1em; - margin: 1em; - width: 75%; - margin-left: 5em; - border-radius: 20px 20px 0 20px; - background-color: #009ECF; - box-shadow: 1px 2px 4px 0 rgba(0,0,0,0.1); - color: var(--color-white); - font-size: 13px; - line-height: 16px; -} - -.amplify-interactions-input-timestamp { - color: #828282; - font-size: 10px; - letter-spacing: 0.5px; - line-height: 16px; - text-align:right; -} - -.amplify-interactions-response-timestamp { - color: #828282; - font-size: 10px; - letter-spacing: 0.5px; - line-height: 16px; - margin-left: 1.5em; -} - -.amplify-interactions-response { - padding: 1em; - margin: 1em; - width: 75%; - border-radius: 20px 20px 20px 0; - background-color: #DBDBDB; - box-shadow: 1px 2px 4px 0 rgba(0,0,0,0.1); - font-size: 13px; - line-height: 16px; - color: #4A4A4A; -} - -@media (min-width: 320px) and (max-width: 480px) { - .amplify-interactions { - width: var(--component-width-mobile) - } - .amplify-interactions-container { - width: 85%; - } -} - -/************************************ -** Input Groups -************************************/ - -.amplify-input-group { - display:flex; - margin-left: 0.3em; - margin-top: 0.5em; -} - -.amplify-input-group > div:first-of-type { - float:left; -} - -.amplify-input-group > div:last-child > input { - border-left: none !important; - width: 100%; -} - -.amplify-input-group > div:last-child { - display: flex; - width: 100%; -} - -.amplify-input-group > div { - float:right; -} - -.amplify-input-group-item > input { - margin-top:0px !important; - margin-left:0px !important; -} - -.amplify-input-group-label { - display:block; -} - -.amplify-select-phone-country { - height: 55px; - width: 68px; - border: var(--input-border); - border-radius: 3px 0 0 3px; - background-color: transparent; -} - -/** Ionic styles for material design */ -.md .amplify-select-phone-country { - border: none; - border-bottom: var(--input-border); - background-color: transparent; - margin-top: 0em; - min-width: 100% !important; - height: 47px !important; - padding-left: 0; -} - -.amplify-form-input-phone-ionic { - height: 36px; - min-width: 100%; - color: var(--color-accent-brown); - font-size: 14px; - letter-spacing: 0.4px; - line-height: 20px; - border: none; - border-bottom: var(--input-border); - border-radius: 0px; -} - -.amplify-ionic-grid-padding-left { - padding-left: 0 -} - -@media (min-width: 320px) and (max-width: 480px) { - .amplify-select-phone-country { - margin-top: 0.1em; - margin-right: 0em; - height:41px; - width: auto; - } - - /** Ionic styles for material design */ - .md .amplify-select-phone-country { - margin-top: 0.3em; - } -} - -/*********************************** -** Forms -***********************************/ - -.amplify-form-container { - height:100%; -} - -.amplify-form-header { - color: var(--color-primary-accent); - height: 28px; - font-size: 18px; - font-weight: bold; - letter-spacing: 0.49px; - line-height: 16px; - margin: 0.2em; -} - -.amplify-form-text { - height: 36px; - width: 90%; - color: var(--color-accent-brown); - font-size: 14px; - letter-spacing: 0.4px; - line-height: 20px; -} - -.amplify-input-label { - height: 18px; - width: 367.92px; - color: var(--color-accent); - font-family: var(--font-family); - font-size: 14px; - margin: 0.5em; - letter-spacing: 0.4px; - line-height: 18px; -} - -.amplify-form-input { - height: 42px; - width: 378px; - font-size: 14px; - letter-spacing: 0.4px; - border: var(--input-border); - border-radius: 3px; - background-color: #FFFFFF; - padding: var(--input-padding); - margin: 0.5em; -} - -.amplify-form-extra-details { - margin: 0.5em; - font-size: 12px; - color: var(--color-gray); -} - -/** Ionic styles for material design */ -.md .amplify-form-input { - border: none; - border-bottom: var(--input-border); - border-radius: 0px; -} - -.amplify-form-actions { - margin-top:1.8em; - padding-bottom: 1.5em; -} - -.amplify-signin-username { - margin-top: 0.8em; -} - -.amplify-form-row { - margin-top: 1em; -} - -.amplify-form-action { - margin: 0.5em; - font-size: 12px; -} - -.amplify-form-signup { - margin-top: 1em; - color: var(--color-gray); -} - -.amplify-form-body { - padding: 1.5em; -} - -.amplify-form-row { -display: block; -} - -.amplify-form-cell-left { -float: left; -margin: 8px 0 8px 8px; -} - -.amplify-form-cell-right { -float:right; -margin: 8px 8px 8px 0; -} - -.amplify-form-link { -cursor: pointer; -color: var(--color-primary); -} - -.amplify-form-link:hover { -color: var(--color-primary-highlight); -} - -.amplify-form-button { - margin: 0.4em 0 0 0.5em; - padding: 0.5em; - border: none; - height: var(--button-height); - width: 155px; - color: white; - text-transform: uppercase; - background-color: var(--color-primary); - cursor: pointer; -} - -.amplify-form-button:hover { - background-color: var(--color-primary-highlight); -} - -.amplify-greeting { - display: flex; - padding: 1em; - margin: 0 auto; -} - -.amplify-greeting-flex-spacer { - width: 30%; -} - -.amplify-greeting-sign-out { - flex: auto; -} - -.amplify-footer { - clear: both; -} - -.amplify-input-invalid { - border-color: red !important; -} - -@media (min-width: 320px) and (max-width: 480px) { - .amplify-form-input { - width: 100%; - } -} - -/************************************ -** Alert -************************************/ - -.amplify-alert-close { -float:right; -cursor: pointer; -color: var(--color-gray); -font-size: 24px; -line-height: 24px; -} - -.amplify-alert-close:hover { - color: var(--color-primary-accent); -} - -.amplify-alert-icon { -float:left; -font-size: 24px; -line-height: 24px; -color: var(--color-danger); -} - -.amplify-alert { -position: absolute; -min-height: 52px; -width: 460px; -margin-top: 5em; -border-radius: 6px; -background-color: #FFFFFF; -box-shadow: 0 0 5px 0 rgba(0,0,0,0.3); -} - -.amplify-alert-body { -padding:1em; -} - -.amplify-alert-message { -max-width: 85%; -display: inline-flex; -color: var(--color-primary-accent); -font-size: 15px; -line-height: 24px; -margin-left: 0.5em; -} - -@media (min-width: 320px) and (max-width: 480px) { -.amplify-alert { - width: 92%; - margin-top: 1em; - margin-left: 4%; - margin-right: 4%; -} -} - - -/************************************ -** Tooltip -************************************/ - -/* Tooltip container */ -.tooltip { -position: relative; -display: inline-block; -} - -/* Tooltip text */ -.tooltip .tooltip-text { -visibility: hidden; -width: 120px; -background-color: var(--color-primary-accent); -color:white; -text-align: center; -padding: 5px 0; -border-radius: 6px; -position: absolute; -z-index: 1; -} - -.tooltip:hover .tooltip-text { -visibility: visible; -} - -/************************************ -** Ionic -************************************/ - -.amplify-phone-ion-content { - height: 100px; -} diff --git a/packages/amplify-ui/src/Button.css b/packages/amplify-ui/src/Button.css deleted file mode 100644 index fe4a9cb89d9..00000000000 --- a/packages/amplify-ui/src/Button.css +++ /dev/null @@ -1,131 +0,0 @@ -@import './Theme.css'; - -.button { - min-width: 153px; - display: inline-block; - margin-bottom: 0; - font-size: 12px; - font-weight: 400; - line-height: 1.42857143; - text-align: center; - white-space: nowrap; - vertical-align: middle; - touch-action: manipulation; - cursor: pointer; - user-select: none; - background-image: none; - color: var(--button-color); - background-color: var(--button-background-color); - border-color: #ccc; - text-transform: uppercase; - padding: 14px 0; - letter-spacing: 1.1px; - border: none; -} - -.button:active { - opacity: 1; - background-color: var(--button-click); -} - -.button:hover, -.signInButton:hover { - opacity: 0.8; -} - -.button:disabled { - opacity: 1; - cursor: auto; - background-color: var(--ion-color-primary-tint); -} - -.signInButton { - position: relative; - width: 100%; - border-radius: 4px; - margin-bottom: 10px; - cursor: pointer; - padding: 0; - color: var(--deepSquidInk); - font-size: 14px; - box-sizing: content-box; -} - -#googleSignInButton { - background-color: #4285f4; - font-family: Roboto; - border: 1px solid #4285f4; - color: var(--white); -} - -#googleSignInButton > .signInButtonIcon { - background-color: var(--white); - border-radius: 4px 0 0 4px; - height: 28px; - width: 28px; - padding: 12px; -} - -#auth0SignInButton { - background-color: #eb5424; - font-family: Roboto; - border: 1px solid #e14615; - color: #fff; -} - -#auth0SignInButton > .signInButtonIcon { - border-radius: 4px 0 0 4px; - height: 28px; - width: 28px; - padding: 12px; - fill: #fff; -} - -#facebookSignInButton { - background-color: #4267b2; - border-color: #4267b2; - font-family: 'Helvetica Neue'; - color: var(--white); -} - -#facebookSignInButton > .signInButtonIcon { - height: 33px; - width: 18px; - padding: 10px 14px; -} - -#amazonSignInButton { - background-color: var(--amazonOrange); - border: none; - color: var(--white); - font-family: 'Amazon Ember'; -} - -#amazonSignInButton > .signInButtonIcon { - padding: 10px; - height: 32px; - width: 32px; -} - -#oAuthSignInButton { - background-color: var(--white); - color: var(--deepSquidInk); -} - -.signInButtonIcon { - position: absolute; - left: 0; - box-sizing: content-box; -} - -.signInButtonContent { - text-align: center; - display: block; - padding: 18px 0; - text-align: left; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - text-align: center; - line-height: initial; -} diff --git a/packages/amplify-ui/src/Button.css.d.ts b/packages/amplify-ui/src/Button.css.d.ts deleted file mode 100644 index 69094b6ed7c..00000000000 --- a/packages/amplify-ui/src/Button.css.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const button: string; -export const signInButton: string; -export const googleSignInButton: string; -export const signInButtonIcon: string; -export const auth0SignInButton: string; -export const facebookSignInButton: string; -export const amazonSignInButton: string; -export const oAuthSignInButton: string; -export const signInButtonContent: string; diff --git a/packages/amplify-ui/src/Form.css b/packages/amplify-ui/src/Form.css deleted file mode 100644 index 6124a25cbf0..00000000000 --- a/packages/amplify-ui/src/Form.css +++ /dev/null @@ -1,43 +0,0 @@ -@import './Theme.css'; - -.formContainer { - text-align: center; - margin-top: 20px; - margin: 5% auto 50px; -} - -.formSection { - position: relative; - margin-bottom: 20px; - background-color: var(--form-color); - padding: 35px 40px; - text-align: left; - display: inline-block; - min-width: 460px; - border-radius: 6px; - box-shadow: 1px 1px 4px 0 rgba(0,0,0,0.15); - box-sizing: border-box; -} - -.formField { - margin-bottom: 22px; -} - -.formRow { - margin-bottom: 12px; -} - -@media only screen and (max-width: 599px) { - .formContainer { - margin: 0; - } - - .formSection { - width: 100%; - box-sizing: border-box; - padding: 35px 25px; - box-shadow: none; - border-radius: 0; - min-width: auto; - } -} \ No newline at end of file diff --git a/packages/amplify-ui/src/Form.css.d.ts b/packages/amplify-ui/src/Form.css.d.ts deleted file mode 100644 index 35b3746e59d..00000000000 --- a/packages/amplify-ui/src/Form.css.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const formContainer: string; -export const formSection: string; -export const formField: string; -export const formRow: string; diff --git a/packages/amplify-ui/src/Hint.css b/packages/amplify-ui/src/Hint.css deleted file mode 100644 index 5cdd2d57053..00000000000 --- a/packages/amplify-ui/src/Hint.css +++ /dev/null @@ -1,6 +0,0 @@ -@import './Theme.css'; - -.hint { - color: var(--grey); - font-size: 12px; -} \ No newline at end of file diff --git a/packages/amplify-ui/src/Hint.css.d.ts b/packages/amplify-ui/src/Hint.css.d.ts deleted file mode 100644 index b76847e9b8c..00000000000 --- a/packages/amplify-ui/src/Hint.css.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const hint: string; diff --git a/packages/amplify-ui/src/Input.css b/packages/amplify-ui/src/Input.css deleted file mode 100644 index 2bb78517253..00000000000 --- a/packages/amplify-ui/src/Input.css +++ /dev/null @@ -1,41 +0,0 @@ -@import './Theme.css'; - -.input { - display: block; - width: 100%; - padding: 16px; - font-size: 14px; - color: var(--input-color); - background-color: var(--input-background-color); - background-image: none; - border: 1px solid var(--lightGrey); - border-radius: 3px; - box-sizing: border-box; - margin-bottom: 10px; -} - -.input:disabled { - color: #545454; - background-color: var(--silver); -} - -.inputLabel { - color: var(--input-color); - font-size: 14px; - margin-bottom: 8px; -} - -.label { - color: var(--input-color); -} - -.radio { - margin-right: 18px; - vertical-align: bottom; -} - -@media only screen and (max-width: 599px) { - .input { - font-size: 16px; - } -} \ No newline at end of file diff --git a/packages/amplify-ui/src/Input.css.d.ts b/packages/amplify-ui/src/Input.css.d.ts deleted file mode 100644 index b22715b2eaa..00000000000 --- a/packages/amplify-ui/src/Input.css.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const input: string; -export const inputLabel: string; -export const label: string; -export const radio: string; diff --git a/packages/amplify-ui/src/Nav.css b/packages/amplify-ui/src/Nav.css deleted file mode 100644 index 59e999ba27a..00000000000 --- a/packages/amplify-ui/src/Nav.css +++ /dev/null @@ -1,21 +0,0 @@ -.navBar { - position: relative; - border: 1px solid transparent; - border-color: #e7e7e7; - background-color: #fff; -} - -.navRight { - text-align: right -} - -.nav { - padding: 10px; -} - -.navItem { - display: inline-block; - padding: 10px 5px; - line-height: 20px; - margin-right: 12px; -} \ No newline at end of file diff --git a/packages/amplify-ui/src/Nav.css.d.ts b/packages/amplify-ui/src/Nav.css.d.ts deleted file mode 100644 index 90f9e5c7db3..00000000000 --- a/packages/amplify-ui/src/Nav.css.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const navBar: string; -export const navRight: string; -export const nav: string; -export const navItem: string; diff --git a/packages/amplify-ui/src/PhotoPicker.css b/packages/amplify-ui/src/PhotoPicker.css deleted file mode 100644 index 07839dfe247..00000000000 --- a/packages/amplify-ui/src/PhotoPicker.css +++ /dev/null @@ -1,15 +0,0 @@ -@import './Theme.css'; - -.photoPickerButton { - width: 100%; -} - -.photoPlaceholder { - border: 2px dotted var(--grey); - padding: 64px 0 64px; -} - -.photoPlaceholderIcon { - text-align: center; - opacity: 0.2; -} \ No newline at end of file diff --git a/packages/amplify-ui/src/PhotoPicker.css.d.ts b/packages/amplify-ui/src/PhotoPicker.css.d.ts deleted file mode 100644 index 5c1750f6385..00000000000 --- a/packages/amplify-ui/src/PhotoPicker.css.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const photoPickerButton: string; -export const photoPlaceholder: string; -export const photoPlaceholderIcon: string; diff --git a/packages/amplify-ui/src/Section.css b/packages/amplify-ui/src/Section.css deleted file mode 100644 index 2445ee2c922..00000000000 --- a/packages/amplify-ui/src/Section.css +++ /dev/null @@ -1,67 +0,0 @@ -@import './Theme.css'; - -.container { - font-weight: 400; -} - -.actionRow { - margin-bottom: 15px; -} - -.sectionHeader { - color: var(--deepSquidInk); - margin-bottom: 24px; - font-size: 18px; - font-weight: 500; -} - -.sectionHeaderHint { - color: var(--grey); - font-size: 16px; - font-weight: 400; - margin-top: 4px; -} - -.sectionBody { - margin-bottom: 30px; -} - -.sectionHeaderContent { -} - -.sectionFooter { - font-size: 14px; - color: var(--grey); - display: flex; - flex-direction: row-reverse; - align-items: flex-start; -} - -.sectionFooterPrimaryContent { - margin-left: auto; -} - -.sectionFooterSecondaryContent { - margin-right: auto; - align-self: center; -} - -@media only screen and (max-width: 599px) { - .sectionFooter { - flex-wrap: wrap; - } - - .sectionFooterPrimaryContent { - width: 100%; - margin-bottom: 32px; - } - - .sectionFooterPrimaryContent > button { - width: 100%; - } - - .sectionFooterSecondaryContent { - text-align: center; - flex: 0 0 100%; - } -} diff --git a/packages/amplify-ui/src/Section.css.d.ts b/packages/amplify-ui/src/Section.css.d.ts deleted file mode 100644 index 365eb8d8359..00000000000 --- a/packages/amplify-ui/src/Section.css.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const container: string; -export const actionRow: string; -export const sectionHeader: string; -export const sectionHeaderHint: string; -export const sectionBody: string; -export const sectionHeaderContent: string; -export const sectionFooter: string; -export const sectionFooterPrimaryContent: string; -export const sectionFooterSecondaryContent: string; diff --git a/packages/amplify-ui/src/SelectInput.css b/packages/amplify-ui/src/SelectInput.css deleted file mode 100644 index 99c0975a21c..00000000000 --- a/packages/amplify-ui/src/SelectInput.css +++ /dev/null @@ -1,36 +0,0 @@ -@import './Theme.css'; - -.selectInput { - display: flex; -} - -.selectInput > input { - flex: 1; - border-radius: 0 3px 3px 0 !important; -} - -.selectInput > select { - padding: 16px 20px 16px 16px; - font-size: 14px; - color: var(--deepSquidInk); - background-color: #fff; - background-image: none; - border: 1px solid var(--lightGrey); - border-right: none; - border-radius: 3px 0 0 3px; - box-sizing: border-box; - margin-bottom: 10px; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - flex-basis: 22%; - width: 1%; - - background-image: linear-gradient(45deg, transparent 50%, gray 50%), - linear-gradient(135deg, gray 50%, transparent 50%), - linear-gradient(to right, #ccc, #ccc); - background-position: calc(100% - 10px) calc(1em + 8px), - calc(100% - 4px) calc(1em + 8px), calc(100% - 2.5em) 0.5em; - background-size: 6px 5px, 6px 5px, 0px 1.5em; - background-repeat: no-repeat; -} diff --git a/packages/amplify-ui/src/SelectInput.css.d.ts b/packages/amplify-ui/src/SelectInput.css.d.ts deleted file mode 100644 index 6714e6106fc..00000000000 --- a/packages/amplify-ui/src/SelectInput.css.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const selectInput: string; diff --git a/packages/amplify-ui/src/Strike.css b/packages/amplify-ui/src/Strike.css deleted file mode 100644 index e4f77b8f2ef..00000000000 --- a/packages/amplify-ui/src/Strike.css +++ /dev/null @@ -1,17 +0,0 @@ -@import './Theme.css'; - -.strike { - width: 100%; - text-align: center; - border-bottom: 1px solid var(--lightGrey); - line-height: 0.1em; - margin: 32px 0; - color: var(--grey); -} - -.strikeContent { - background: var(--form-color); - padding: 0 25px; - font-size: 14px; - font-weight: 500; -} \ No newline at end of file diff --git a/packages/amplify-ui/src/Strike.css.d.ts b/packages/amplify-ui/src/Strike.css.d.ts deleted file mode 100644 index c741d60fd70..00000000000 --- a/packages/amplify-ui/src/Strike.css.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const strike: string; -export const strikeContent: string; diff --git a/packages/amplify-ui/src/Theme.css b/packages/amplify-ui/src/Theme.css deleted file mode 100644 index aeb39af69c4..00000000000 --- a/packages/amplify-ui/src/Theme.css +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -:root { - - /* Colors */ - --amazonOrange: #FF9900; - --lightAmazonOrange: #FFAC31; - --darkAmazonOrange: #E88B01; - --squidInk: #232F3E; - --lightSquidInk: #31465F; - --deepSquidInk: #152939; - --grey: #828282; - --lightGrey: #C4C4C4; - --silver: #E1E4EA; - --darkBlue: #31465F; - --red: #DD3F5B; - --white: #FFFFFF; - --light-blue: #00a1c9; - - - /* Theme */ - --button-color: var(--white); - --button-background-color: var(--amazonOrange); - --button-click: var(--darkAmazonOrange); - --link-color: var(--amazonOrange); - --form-color: var(--white); - --input-color: var(--deepSquidInk); - --input-background-color: var(--white); - - --font-family: "Amazon Ember","Helvetica Neue Light","Helvetica Neue","Helvetica" ,"Arial","sans-serif"; - --body-background: #F8F4F4; - - /** Angular Theme **/ - --component-width-desktop: 460px; - --component-width-mobile: 100%; - - --color-primary: #FF9900; - --color-primary-accent: #232F3E; - --color-primary-highlight: #FFC46D; - - --color-background:#232F3E; - - --color-secondary: #152939; - --color-secondary-accent: #31465F; - - --color-danger: #DD3F5B; - --color-error: #D0021B; - - --color-accent-brown: #828282; - --color-accent-blue: #E1E4EA; - - --gradient-blaze: linear-gradient(270deg, #FFC300 0%, #FF9000 100%); - - --color-blue: #007EB9; - --color-purple: #527FFF; - --color-gray: #828282; - --color-white: #FFFFFF; - - --input-border: 1px solid #C4C4C4; - --input-padding: 0.5em 0.5em 0.3em 1em; - - --box-shadow: 1px 1px 4px 0 rgba(0,0,0,0.15); - --button-height: 42px; - - --interactions-conversation-height: 250px; - - /* Ionic Theme */ - - /** primary **/ - --ion-color-primary: #FF9900; - --ion-color-primary-rgb: 255,153,0; - --ion-color-primary-contrast: #fff; - --ion-color-primary-contrast-rgb: 255,255,255; - --ion-color-primary-shade: #232F3E; - --ion-color-primary-tint: #FFC46D; - - /** secondary **/ - --ion-color-secondary: #32db64; - --ion-color-secondary-rgb: 50,219,100; - --ion-color-secondary-contrast: #fff; - --ion-color-secondary-contrast-rgb: 255,255,255; - --ion-color-secondary-shade: #2cc158; - --ion-color-secondary-tint: #47df74; - - /** tertiary **/ - --ion-color-tertiary: #f4a942; - --ion-color-tertiary-rgb: 244,169,66; - --ion-color-tertiary-contrast: #fff; - --ion-color-tertiary-contrast-rgb: 255,255,255; - --ion-color-tertiary-shade: #d7953a; - --ion-color-tertiary-tint: #f5b255; - - /** success **/ - --ion-color-success: #10dc60; - --ion-color-success-rgb: 16,220,96; - --ion-color-success-contrast: #fff; - --ion-color-success-contrast-rgb: 255,255,255; - --ion-color-success-shade: #0ec254; - --ion-color-success-tint: #28e070; - - /** warning **/ - --ion-color-warning: #ffce00; - --ion-color-warning-rgb: 255,206,0; - --ion-color-warning-contrast: #000; - --ion-color-warning-contrast-rgb: 0,0,0; - --ion-color-warning-shade: #e0b500; - --ion-color-warning-tint: #ffd31a; - - /** danger **/ - --ion-color-danger: #f53d3d; - --ion-color-danger-rgb: 245,61,61; - --ion-color-danger-contrast: #fff; - --ion-color-danger-contrast-rgb: 255,255,255; - --ion-color-danger-shade: #d83636; - --ion-color-danger-tint: #f65050; - - /** light **/ - --ion-color-light: #f4f4f4; - --ion-color-light-rgb: 244,244,244; - --ion-color-light-contrast: #000; - --ion-color-light-contrast-rgb: 0,0,0; - --ion-color-light-shade: #d7d7d7; - --ion-color-light-tint: #f5f5f5; - - /** medium **/ - --ion-color-medium: #989aa2; - --ion-color-medium-rgb: 152,154,162; - --ion-color-medium-contrast: #000; - --ion-color-medium-contrast-rgb: 0,0,0; - --ion-color-medium-shade: #86888f; - --ion-color-medium-tint: #a2a4ab; - - /** dark **/ - --ion-color-dark: #222; - --ion-color-dark-rgb: 34,34,34; - --ion-color-dark-contrast: #fff; - --ion-color-dark-contrast-rgb: 255,255,255; - --ion-color-dark-shade: #1e1e1e; - --ion-color-dark-tint: #383838; -} diff --git a/packages/amplify-ui/src/Toast.css b/packages/amplify-ui/src/Toast.css deleted file mode 100644 index 93942d6f2ac..00000000000 --- a/packages/amplify-ui/src/Toast.css +++ /dev/null @@ -1,63 +0,0 @@ -@import './Theme.css'; - -.toast { - display: flex; - justify-content: space-between; - position: absolute; - top: 0; - left: 0; - width: 100%; - z-index: 99; - box-shadow: 0 0 5px 0 rgba(0,0,0,0.3); - padding: 16px; - background-color: var(--lightSquidInk); - font-size: 14px; - color: #fff; - box-sizing: border-box; -} - -.toast > span { - margin-right: 10px; -} - -.toastClose { - margin-left: auto; - align-self: center; - position: relative; - width: 18px; - height: 18px; - overflow: hidden; - cursor: pointer; -} - -.toastClose::before, -.toastClose::after { - content: ''; - position: absolute; - height: 2px; - width: 100%; - top: 50%; - left: 0; - margin-top: -1px; - background: var(--lightGrey); -} - -.toastClose:hover::before, -.toastClose:hover::after { - background: var(--red); -} - -.toastClose::before { - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -ms-transform: rotate(45deg); - -o-transform: rotate(45deg); - transform: rotate(45deg); -} -.toastClose::after { - -webkit-transform: rotate(-45deg); - -moz-transform: rotate(-45deg); - -ms-transform: rotate(-45deg); - -o-transform: rotate(-45deg); - transform: rotate(-45deg); -} \ No newline at end of file diff --git a/packages/amplify-ui/src/Toast.css.d.ts b/packages/amplify-ui/src/Toast.css.d.ts deleted file mode 100644 index 87b1bca3a33..00000000000 --- a/packages/amplify-ui/src/Toast.css.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const toast: string; -export const toastClose: string; diff --git a/packages/amplify-ui/src/Totp.css b/packages/amplify-ui/src/Totp.css deleted file mode 100644 index 474373e5cd7..00000000000 --- a/packages/amplify-ui/src/Totp.css +++ /dev/null @@ -1,4 +0,0 @@ -.totpQrcode { - text-align: center; - margin-bottom: 30px; -} \ No newline at end of file diff --git a/packages/amplify-ui/src/Totp.css.d.ts b/packages/amplify-ui/src/Totp.css.d.ts deleted file mode 100644 index c1272fd777f..00000000000 --- a/packages/amplify-ui/src/Totp.css.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const totpQrcode: string; diff --git a/packages/amplify-ui/src/XR.css b/packages/amplify-ui/src/XR.css deleted file mode 100644 index b66748c4754..00000000000 --- a/packages/amplify-ui/src/XR.css +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 './Theme.css'; - -.sumerianSceneContainer { - width: 100%; - height: 100%; - position: relative; -} - -.sumerianScene { - width: 100%; - height: 100%; -} - -.loadingOverlay { - display: flex; - align-items: center; - justify-content: center; - width: 100%; - height: 100%; - background-color: var(--lightSquidInk); -} - -.loadingContainer { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} - -.loadingLogo { - margin-bottom: 20px; - width: 80px; - fill: var(--white); -} - -.loadingSceneName { - color: var(--white); - margin: 0 2px 20px 2px; - font-size: 18px; - font-family: 'Amazon Ember'; -} - -.loadingBar { - height: 2px; - width: 100%; - border-radius: 2px; - background-color: var(--deepSquidInk); -} - -.loadingBarFill { - background-color: var(--light-blue); - height: 100%; - border-radius: 2px; -} - -.sceneErrorText { - color: var(--red); - font-size: 14px; - font-family: 'Amazon Ember'; -} - -.sceneBar { - display: flex; - align-items: center; - font-size: 100%; - position: absolute; - bottom: 0; - width: 100%; -} - -.sceneName { - color: var(--white); - margin: 0 1.5em; - font-size: 1em; -} - -.sceneActions { - margin-left: auto; - margin-right: 16px; - margin-bottom: 16px; -} - -.actionButton { - position: relative; - padding: 0; - background: none; - height: 54px; - width: 54px; - cursor:pointer; - outline: none; - text-decoration: none; - border: none; - border-radius: 30px; - transition: all .3s ease-in-out; - color: var(--white); - fill: currentColor; -} - -.actionButton:hover { - background-color: var(--deepSquidInk); - box-shadow: 0.3px 0.3px 0.3px rgba(0, 0, 0, 0.3); -} - -.actionButton:hover > .tooltip { - display: block; -} - -.actionButton:hover > svg { - -webkit-filter: none; - filter: none; -} - -.actionButton:focus { - outline: none; -} - -.actionButton > svg { - width: 1.8em; - height: 1.8em; - -webkit-filter: drop-shadow(1px 1px 1px var(--grey)); - filter: drop-shadow(1px 1px 1px var(--grey)); -} - -.actionIcon { - fill: var(--white); -} - -.tooltip { - display: inline; - position: relative; - font-size: 12px; - font-family: 'Amazon Ember'; - margin: 0 0 0 16px; -} - -.autoShowTooltip .actionButton { - background-color: var(--deepSquidInk); -} - -.tooltip:after { - background-color: var(--deepSquidInk); - border-radius: 2px; - bottom: 46px; - color: var(--white); - content: attr(data-text); - text-decoration: none; - padding: 10px; - left: 50%; - -webkit-transform: translateX(-50%); - -moz-transform: translateX(-50%); - -ms-transform: translateX(-50%); - -o-transform: translateX(-50%); - transform: translateX(-50%); - position: absolute; - white-space: nowrap; - opacity: 0; - transition: all .3s ease-in-out; -} - -.tooltip:before { - border: solid; - border-color: var(--deepSquidInk) transparent transparent transparent; - border-width: 5px; - bottom: 36px; - content:""; - left: 50%; - -webkit-transform: translateX(-50%); - -moz-transform: translateX(-50%); - -ms-transform: translateX(-50%); - -o-transform: translateX(-50%); - transform: translateX(-50%); - position: absolute; - font-size: 14px; - opacity: 0; - transition: all .3s ease-in-out; -} - - -.autoShowTooltip:after, -.tooltip:hover:after { - opacity: 1; - transition-delay: 1s; -} - -.autoShowTooltip:before, -.tooltip:hover:before { - opacity: 1; - transition-delay: 1s; -} \ No newline at end of file diff --git a/packages/amplify-ui/src/XR.css.d.ts b/packages/amplify-ui/src/XR.css.d.ts deleted file mode 100644 index 97383bb71b5..00000000000 --- a/packages/amplify-ui/src/XR.css.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// AUTOMATICALLY GENERATED - DO NOT EDIT -export const sumerianSceneContainer: string; -export const sumerianScene: string; -export const loadingOverlay: string; -export const loadingContainer: string; -export const loadingLogo: string; -export const loadingSceneName: string; -export const loadingBar: string; -export const loadingBarFill: string; -export const sceneErrorText: string; -export const sceneBar: string; -export const sceneName: string; -export const sceneActions: string; -export const actionButton: string; -export const tooltip: string; -export const actionIcon: string; -export const autoShowTooltip: string; diff --git a/packages/amplify-ui/src/index.ts b/packages/amplify-ui/src/index.ts deleted file mode 100644 index b1fd7c4285c..00000000000 --- a/packages/amplify-ui/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 './Anchor.css'; -export * from './Button.css'; -export * from './Form.css'; -export * from './Hint.css'; -export * from './Input.css'; -export * from './Nav.css'; -export * from './PhotoPicker.css'; -export * from './Section.css'; -export * from './SelectInput.css'; -export * from './Strike.css'; -export * from './Toast.css'; -export * from './Totp.css'; -export * from './XR.css'; diff --git a/packages/amplify-ui/webpack.config.js b/packages/amplify-ui/webpack.config.js deleted file mode 100644 index a85d45f41a8..00000000000 --- a/packages/amplify-ui/webpack.config.js +++ /dev/null @@ -1,63 +0,0 @@ -const MiniCssExtractPlugin = require('mini-css-extract-plugin'); - -module.exports = { - entry: { - 'aws-amplify-ui': './src/index.ts', - 'aws-amplify-ui.min': './src/index.ts', - }, - output: { - filename: '[name].js', - path: __dirname + '/dist', - library: 'aws_amplify_ui', - libraryTarget: 'umd', - umdNamedDefine: true, - globalObject: 'this', - devtoolModuleFilenameTemplate: require('../aws-amplify/webpack-utils') - .devtoolModuleFilenameTemplate, - }, - // Enable sourcemaps for debugging webpack's output. - devtool: 'source-map', - resolve: { - extensions: ['.tsx', '.ts', '.js', '.css'], - }, - - mode: process.env.NODE_ENV || 'production', - - module: { - rules: [ - { test: /\.jsx?$/, use: 'ts-loader', exclude: /node_modules/ }, - { test: /\.tsx?$/, use: 'ts-loader', exclude: /node_modules/ }, - { - test: /\.css$/, - use: [ - { - loader: MiniCssExtractPlugin.loader, - options: { - hmr: process.env.NODE_ENV === 'development', - }, - }, - { - loader: 'dts-css-modules-loader', - options: { - banner: '// AUTOMATICALLY GENERATED - DO NOT EDIT', - namedExport: true, - }, - }, - { - loader: 'css-loader', - options: { - modules: true, - importLoaders: 1, - localIdentName: '[name]__[local]___[hash:base64:5]', - }, - }, - 'postcss-loader', - ], - }, - ], - }, - - plugins: [ - new MiniCssExtractPlugin({ filename: 'style.css', allChunks: true }), - ], -}; diff --git a/packages/analytics/.npmignore b/packages/analytics/.npmignore deleted file mode 100644 index fe4eeff4d82..00000000000 --- a/packages/analytics/.npmignore +++ /dev/null @@ -1,17 +0,0 @@ -__mocks__/** -__tests__/** -coverage/** -docs/** -node_modules/** -.vscode/** -.DS_Store -*.log -lib/.tsbuildinfo -lib-esm/.tsbuildinfo -prepend-license.js -prettier.config.json -tsconfig.json -tsfmt.json -tslint.json -typeDoc.js -webpack.config.js diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index 9b3ab5e9a19..652cf2423ed 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -3,14 +3,6 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -## [5.2.28](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/analytics@5.2.27...@aws-amplify/analytics@5.2.28) (2022-11-04) - -**Note:** Version bump only for package @aws-amplify/analytics - - - - - ## [5.2.27](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/analytics@5.2.26...@aws-amplify/analytics@5.2.27) (2022-10-27) **Note:** Version bump only for package @aws-amplify/analytics diff --git a/packages/analytics/__tests__/Analytics.test.ts b/packages/analytics/__tests__/Analytics.test.ts index ef1e88f0515..760b34d5c25 100644 --- a/packages/analytics/__tests__/Analytics.test.ts +++ b/packages/analytics/__tests__/Analytics.test.ts @@ -1,33 +1,17 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 jest.mock('../src/vendor/dom-utils', () => { return { delegate: jest.fn(), }; }); -import { - ClientDevice, - Parser, - ConsoleLogger as Logger, - Credentials, -} from '@aws-amplify/core'; -import { AnalyticsOptions, EventAttributes, EventMetrics } from '../src/types'; +import { ClientDevice, parseAWSExports, Hub } from '@aws-amplify/core'; import { AnalyticsClass as Analytics } from '../src/Analytics'; -import AWSAnalyticsProvider from '../src/Providers/AWSPinpointProvider'; - -const options: AnalyticsOptions = { - appId: 'appId', - platform: 'platform', - clientId: 'clientId', - region: 'region', -}; - -const credentials = { - accessKeyId: 'accessKeyId', - sessionToken: 'sessionToken', - secretAccessKey: 'secretAccessKey', - identityId: 'identityId', - authenticated: true, -}; +import { AWSPinpointProvider as AWSAnalyticsProvider } from '../src/Providers/AWSPinpointProvider'; + +jest.mock('@aws-amplify/core'); +const mockHubDispatch = Hub.dispatch as jest.Mock; jest.useFakeTimers(); @@ -38,26 +22,26 @@ const record_spyon = jest }); describe('Analytics test', () => { + beforeEach(() => { + (parseAWSExports as jest.Mock).mockReturnValueOnce({ + Analytics: { + AWSPinpoint: { + appId: 'appId', + }, + }, + }); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + describe('configure test', () => { test('happy case with default parser', () => { const analytics = new Analytics(); - const spyon = jest - .spyOn(ClientDevice, 'clientInfo') - .mockImplementationOnce(() => { - return 'clientInfo'; - }); - const spyon2 = jest - .spyOn(Parser, 'parseMobilehubConfig') - .mockImplementationOnce(() => { - return { - Analytics: { - AWSPinpoint: { - appId: 'appId', - }, - }, - }; - }); - const spyon3 = jest + ClientDevice.clientInfo = jest.fn().mockReturnValueOnce('clientInfo'); + + const mockAWSAnalyticsProviderConfigure = jest .spyOn(AWSAnalyticsProvider.prototype, 'configure') .mockImplementationOnce(() => { return; @@ -69,9 +53,7 @@ describe('Analytics test', () => { autoSessionRecord: true, }); - spyon.mockClear(); - spyon2.mockClear(); - spyon3.mockClear(); + mockAWSAnalyticsProviderConfigure.mockClear(); }); }); @@ -83,6 +65,16 @@ describe('Analytics test', () => { analytics.configure({ mock: 'value' }); await analytics.startSession(); + expect(mockHubDispatch).toBeCalledWith( + 'analytics', + { + event: 'record', + data: { name: '_session.start' }, + message: 'Recording Analytics session start event', + }, + 'Analytics', + expect.anything() + ); expect(record_spyon).toBeCalled(); }); }); @@ -95,6 +87,16 @@ describe('Analytics test', () => { analytics.configure({ mock: 'value' }); await analytics.stopSession(); + expect(mockHubDispatch).toBeCalledWith( + 'analytics', + { + event: 'record', + data: { name: '_session.stop' }, + message: 'Recording Analytics session stop event', + }, + 'Analytics', + expect.anything() + ); expect(record_spyon).toBeCalled(); }); }); @@ -105,16 +107,23 @@ describe('Analytics test', () => { const provider = new AWSAnalyticsProvider(); analytics.addPluggable(provider); analytics.configure({ mock: 'value' }); - - await analytics.record({ + const event = { name: 'event', - attributes: { - key: 'value', - }, - metrics: { - metric: 123, + attributes: { key: 'value' }, + metrics: { metric: 123 }, + }; + + await analytics.record(event); + expect(mockHubDispatch).toBeCalledWith( + 'analytics', + { + event: 'record', + data: event, + message: 'Recording Analytics event', }, - }); + 'Analytics', + expect.anything() + ); expect(record_spyon).toBeCalled(); }); }); diff --git a/packages/analytics/__tests__/Providers/AWSKinesisFirehoseProvider.test.ts b/packages/analytics/__tests__/Providers/AWSKinesisFirehoseProvider.test.ts index 240d407cd0e..96da963058e 100644 --- a/packages/analytics/__tests__/Providers/AWSKinesisFirehoseProvider.test.ts +++ b/packages/analytics/__tests__/Providers/AWSKinesisFirehoseProvider.test.ts @@ -3,7 +3,7 @@ import { PutRecordBatchCommand, } from '@aws-sdk/client-firehose'; import { Credentials } from '@aws-amplify/core'; -import KinesisFirehoseProvider from '../../src/Providers/AWSKinesisFirehoseProvider'; +import { AWSKinesisFirehoseProvider as KinesisFirehoseProvider } from '../../src/Providers/AWSKinesisFirehoseProvider'; jest.mock('@aws-sdk/client-firehose'); diff --git a/packages/analytics/__tests__/Providers/AWSKinesisProvider.test.ts b/packages/analytics/__tests__/Providers/AWSKinesisProvider.test.ts index 8223191a2d4..b45292ef172 100644 --- a/packages/analytics/__tests__/Providers/AWSKinesisProvider.test.ts +++ b/packages/analytics/__tests__/Providers/AWSKinesisProvider.test.ts @@ -1,5 +1,5 @@ import { Credentials } from '@aws-amplify/core'; -import KinesisProvider from '../../src/Providers/AWSKinesisProvider'; +import { AWSKinesisProvider as KinesisProvider } from '../../src/Providers/AWSKinesisProvider'; import { KinesisClient, PutRecordsCommand } from '@aws-sdk/client-kinesis'; jest.useFakeTimers(); diff --git a/packages/analytics/__tests__/Providers/AWSPinpointProvider.test.ts b/packages/analytics/__tests__/Providers/AWSPinpointProvider.test.ts index 138db8698fe..260b8211bb3 100644 --- a/packages/analytics/__tests__/Providers/AWSPinpointProvider.test.ts +++ b/packages/analytics/__tests__/Providers/AWSPinpointProvider.test.ts @@ -1,5 +1,5 @@ import { Credentials, ClientDevice } from '@aws-amplify/core'; -import AnalyticsProvider from '../../src/Providers/AWSPinpointProvider'; +import { AWSPinpointProvider as AnalyticsProvider } from '../../src/Providers/AWSPinpointProvider'; import { PinpointClient, UpdateEndpointCommand, diff --git a/packages/analytics/__tests__/Providers/AmazonPersonalizeProvider.test.ts b/packages/analytics/__tests__/Providers/AmazonPersonalizeProvider.test.ts index d7a265f63e4..26ded467686 100644 --- a/packages/analytics/__tests__/Providers/AmazonPersonalizeProvider.test.ts +++ b/packages/analytics/__tests__/Providers/AmazonPersonalizeProvider.test.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { Credentials } from '@aws-amplify/core'; import { AmazonPersonalizeProvider } from '../../src/Providers/AmazonPersonalizeProvider'; import { diff --git a/packages/analytics/__tests__/Providers/EventBuffer.test.ts b/packages/analytics/__tests__/Providers/EventBuffer.test.ts index 537ebe8a06d..f80bf7a04f1 100644 --- a/packages/analytics/__tests__/Providers/EventBuffer.test.ts +++ b/packages/analytics/__tests__/Providers/EventBuffer.test.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import EventBuffer from '../../src/Providers/EventBuffer'; const DEFAULT_CONFIG = { diff --git a/packages/analytics/__tests__/trackers/EventTracker.test.ts b/packages/analytics/__tests__/trackers/EventTracker.test.ts index 53037636403..c4849cca93e 100644 --- a/packages/analytics/__tests__/trackers/EventTracker.test.ts +++ b/packages/analytics/__tests__/trackers/EventTracker.test.ts @@ -9,7 +9,7 @@ jest.mock('../../src/vendor/dom-utils', () => { }; }); -import EventTracker from '../../src/trackers/EventTracker'; +import { EventTracker } from '../../src/trackers/EventTracker'; describe('EventTracer test', () => { describe('environment test', () => { diff --git a/packages/analytics/__tests__/trackers/SessionTracker-rn.test.ts b/packages/analytics/__tests__/trackers/SessionTracker-rn.test.ts index f36ffb04046..6d067c1f2a1 100644 --- a/packages/analytics/__tests__/trackers/SessionTracker-rn.test.ts +++ b/packages/analytics/__tests__/trackers/SessionTracker-rn.test.ts @@ -11,7 +11,7 @@ jest.mock('react-native', () => { }; }); -import SessionTracker from '../../src/trackers/SessionTracker-rn'; +import { SessionTracker } from '../../src/trackers/SessionTracker-rn'; import { AppState } from 'react-native'; const tracker = jest.fn().mockImplementation(() => { diff --git a/packages/analytics/__tests__/trackers/SessionTracker.test.ts b/packages/analytics/__tests__/trackers/SessionTracker.test.ts index e9fad9e58b6..963ff3b4880 100644 --- a/packages/analytics/__tests__/trackers/SessionTracker.test.ts +++ b/packages/analytics/__tests__/trackers/SessionTracker.test.ts @@ -1,4 +1,4 @@ -import SessionTracker from '../../src/trackers/SessionTracker'; +import { SessionTracker } from '../../src/trackers/SessionTracker'; const tracker = jest.fn().mockImplementation(() => { return Promise.resolve(); diff --git a/packages/analytics/__tests__/utils.test.ts b/packages/analytics/__tests__/utils.test.ts index 1c7ee95b006..c5de62a9576 100644 --- a/packages/analytics/__tests__/utils.test.ts +++ b/packages/analytics/__tests__/utils.test.ts @@ -1,5 +1,5 @@ import { isAppInForeground } from '../src/utils/AppUtils'; -import MethodEmbed from '../src/utils/MethodEmbed'; +import { MethodEmbed } from '../src/utils/MethodEmbed'; jest.mock('../src/utils/AppUtils.native', () => { return { diff --git a/packages/analytics/package.json b/packages/analytics/package.json index aceeac7828c..c5144d3f01c 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,16 +1,13 @@ { "name": "@aws-amplify/analytics", - "version": "5.2.28", + "version": "6.0.0", "description": "Analytics category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", "typings": "./lib-esm/index.d.ts", "sideEffects": [ - "./src/Analytics.ts", "./lib/Analytics.js", - "./lib-esm/Analytics.js", - "./dist/aws-amplify-analytics.js", - "./dist/aws-amplify-analytics.min.js" + "./lib-esm/Analytics.js" ], "publishConfig": { "access": "public" @@ -26,7 +23,8 @@ "build": "npm run clean && npm run build:esm && npm run build:cjs", "clean": "rimraf lib-esm lib dist", "format": "echo \"Not implemented\"", - "lint": "tslint 'src/**/*.ts'" + "lint": "tslint 'src/**/*.ts' && npm run ts-coverage", + "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 69.26" }, "react-native": { "./lib/index": "./lib-esm/index.js", @@ -42,16 +40,18 @@ "url": "https://github.com/aws/aws-amplify/issues" }, "homepage": "https://aws-amplify.github.io/", + "files": ["lib", "lib-esm", "src"], "dependencies": { - "@aws-amplify/cache": "4.0.63", - "@aws-amplify/core": "4.7.12", + "@aws-amplify/cache": "5.0.0", + "@aws-amplify/core": "5.0.0", "@aws-sdk/client-firehose": "3.6.1", "@aws-sdk/client-kinesis": "3.6.1", "@aws-sdk/client-personalize-events": "3.6.1", "@aws-sdk/client-pinpoint": "3.6.1", "@aws-sdk/util-utf8-browser": "3.6.1", "lodash": "^4.17.20", - "uuid": "^3.2.1" + "uuid": "^3.2.1", + "tslib": "^1.8.0" }, "jest": { "globals": { diff --git a/packages/analytics/src/Analytics.ts b/packages/analytics/src/Analytics.ts index 8142e2257c9..f55fe18f5eb 100644 --- a/packages/analytics/src/Analytics.ts +++ b/packages/analytics/src/Analytics.ts @@ -1,21 +1,11 @@ -/* - * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { Amplify, ConsoleLogger as Logger, Hub, - Parser, + parseAWSExports, } from '@aws-amplify/core'; import { AWSPinpointProvider } from './Providers/AWSPinpointProvider'; @@ -83,6 +73,7 @@ export class AnalyticsClass { Hub.listen('auth', listener); Hub.listen('storage', listener); Hub.listen('analytics', listener); + Hub.listen('core', listener); } public getModuleName() { @@ -95,7 +86,7 @@ export class AnalyticsClass { public configure(config?) { if (!config) return this._config; logger.debug('configure Analytics', config); - const amplifyConfig = Parser.parseMobilehubConfig(config); + const amplifyConfig = parseAWSExports(config); this._config = Object.assign( {}, this._config, @@ -217,7 +208,15 @@ export class AnalyticsClass { * @return - A promise which resolves if buffer doesn't overflow */ public async startSession(provider?: string) { - const params = { event: { name: '_session.start' }, provider }; + const event = { name: '_session.start' }; + const params = { event, provider }; + + dispatchAnalyticsEvent( + 'record', + event, + 'Recording Analytics session start event' + ); + return this._sendEvent(params); } @@ -227,7 +226,15 @@ export class AnalyticsClass { * @return - A promise which resolves if buffer doesn't overflow */ public async stopSession(provider?: string) { - const params = { event: { name: '_session.stop' }, provider }; + const event = { name: '_session.stop' }; + const params = { event, provider }; + + dispatchAnalyticsEvent( + 'record', + event, + 'Recording Analytics session stop event' + ); + return this._sendEvent(params); } @@ -239,43 +246,11 @@ export class AnalyticsClass { public async record( event: AnalyticsEvent | PersonalizeAnalyticsEvent | KinesisAnalyticsEvent, provider?: string - ); - /** - * Record one analytic event and send it to Pinpoint - * @deprecated Use the new syntax and pass in the event as an object instead. - * @param eventName - The name of the event - * @param [attributes] - Attributes of the event - * @param [metrics] - Event metrics - * @return - A promise which resolves if buffer doesn't overflow - */ - public async record( - eventName: string, - attributes?: EventAttributes, - metrics?: EventMetrics - ); - public async record( - event: - | string - | AnalyticsEvent - | PersonalizeAnalyticsEvent - | KinesisAnalyticsEvent, - providerOrAttributes?: string | EventAttributes, - metrics?: EventMetrics ) { - let params = null; - // this is just for compatibility, going to be deprecated - if (typeof event === 'string') { - params = { - event: { - name: event, - attributes: providerOrAttributes, - metrics, - }, - provider: 'AWSPinpoint', - }; - } else { - params = { event, provider: providerOrAttributes }; - } + const params = { event, provider }; + + dispatchAnalyticsEvent('record', params.event, 'Recording Analytics event'); + return this._sendEvent(params); } @@ -347,6 +322,8 @@ export class AnalyticsClass { let endpointUpdated = false; let authConfigured = false; let analyticsConfigured = false; +let credentialsConfigured = false; + const listener = capsule => { const { channel, payload } = capsule; logger.debug('on hub capsule ' + channel, payload); @@ -361,6 +338,9 @@ const listener = capsule => { case 'analytics': analyticsEvent(payload); break; + case 'core': + coreEvent(payload); + break; default: break; } @@ -415,7 +395,7 @@ const authEvent = payload => { return recordAuthEvent('auth_fail'); case 'configured': authConfigured = true; - if (authConfigured && analyticsConfigured) { + if (analyticsConfigured) { sendEvents(); } break; @@ -429,7 +409,21 @@ const analyticsEvent = payload => { switch (event) { case 'pinpointProvider_configured': analyticsConfigured = true; - if (authConfigured && analyticsConfigured) { + if (authConfigured || credentialsConfigured) { + sendEvents(); + } + break; + } +}; + +const coreEvent = payload => { + const { event } = payload; + if (!event) return; + + switch (event) { + case 'credentials_configured': + credentialsConfigured = true; + if (analyticsConfigured) { sendEvents(); } break; diff --git a/packages/analytics/src/Providers/AWSKinesisFirehoseProvider.ts b/packages/analytics/src/Providers/AWSKinesisFirehoseProvider.ts index 6bd37f68d39..788890d14fb 100644 --- a/packages/analytics/src/Providers/AWSKinesisFirehoseProvider.ts +++ b/packages/analytics/src/Providers/AWSKinesisFirehoseProvider.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { ConsoleLogger as Logger } from '@aws-amplify/core'; import { AWSKinesisProvider } from './AWSKinesisProvider'; @@ -111,8 +101,3 @@ export class AWSKinesisFirehoseProvider extends AWSKinesisProvider { return true; } } - -/** - * @deprecated use named import - */ -export default AWSKinesisFirehoseProvider; diff --git a/packages/analytics/src/Providers/AWSKinesisProvider.ts b/packages/analytics/src/Providers/AWSKinesisProvider.ts index fa3d5d7da70..9323f26a373 100644 --- a/packages/analytics/src/Providers/AWSKinesisProvider.ts +++ b/packages/analytics/src/Providers/AWSKinesisProvider.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { ConsoleLogger as Logger, @@ -251,8 +241,3 @@ export class AWSKinesisProvider implements AnalyticsProvider { }); } } - -/** - * @deprecated use named import - */ -export default AWSKinesisProvider; diff --git a/packages/analytics/src/Providers/AWSPinpointProvider.ts b/packages/analytics/src/Providers/AWSPinpointProvider.ts index 9ea8cab8ea8..10741e2e64a 100644 --- a/packages/analytics/src/Providers/AWSPinpointProvider.ts +++ b/packages/analytics/src/Providers/AWSPinpointProvider.ts @@ -1,24 +1,15 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { ConsoleLogger as Logger, ClientDevice, Credentials, Signer, - JS, Hub, getAmplifyUserAgent, + transferKeyToLowerCase, + transferKeyToUpperCase, } from '@aws-amplify/core'; import { EventsBatch, @@ -27,7 +18,7 @@ import { PutEventsCommandInput, UpdateEndpointCommand, } from '@aws-sdk/client-pinpoint'; -import Cache from '@aws-amplify/cache'; +import { Cache } from '@aws-amplify/cache'; import { AnalyticsProvider, @@ -40,10 +31,11 @@ import { import { v1 as uuid } from 'uuid'; import EventsBuffer from './EventBuffer'; -const AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && -typeof Symbol.for === 'function' - ? Symbol.for('amplify_default') - : '@@amplify_default') as Symbol; +const AMPLIFY_SYMBOL = ( + typeof Symbol !== 'undefined' && typeof Symbol.for === 'function' + ? Symbol.for('amplify_default') + : '@@amplify_default' +) as Symbol; const dispatchAnalyticsEvent = (event, data) => { Hub.dispatch('analytics', { event, data }, 'Analytics', AMPLIFY_SYMBOL); @@ -395,7 +387,7 @@ export class AWSPinpointProvider implements AnalyticsProvider { const request = this._endpointRequest( config, - JS.transferKeyToLowerCase( + transferKeyToLowerCase( event, [], ['attributes', 'userAttributes', 'Attributes', 'UserAttributes'] @@ -706,7 +698,7 @@ export class AWSPinpointProvider implements AnalyticsProvider { immediate, ...ret } = tmp; - return JS.transferKeyToUpperCase( + return transferKeyToUpperCase( ret, [], ['metrics', 'userAttributes', 'attributes'] @@ -735,8 +727,3 @@ export class AWSPinpointProvider implements AnalyticsProvider { } } } - -/** - * @deprecated use named import - */ -export default AWSPinpointProvider; diff --git a/packages/analytics/src/Providers/AmazonPersonalizeHelper/DataType.ts b/packages/analytics/src/Providers/AmazonPersonalizeHelper/DataType.ts index 37ff01d6924..08652a41d0f 100644 --- a/packages/analytics/src/Providers/AmazonPersonalizeHelper/DataType.ts +++ b/packages/analytics/src/Providers/AmazonPersonalizeHelper/DataType.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { ICredentials } from '@aws-amplify/core'; interface BasePayload { diff --git a/packages/analytics/src/Providers/AmazonPersonalizeHelper/MediaAutoTrack.ts b/packages/analytics/src/Providers/AmazonPersonalizeHelper/MediaAutoTrack.ts index 98d43a08754..328676741d1 100644 --- a/packages/analytics/src/Providers/AmazonPersonalizeHelper/MediaAutoTrack.ts +++ b/packages/analytics/src/Providers/AmazonPersonalizeHelper/MediaAutoTrack.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { RequestParams } from './DataType'; enum HTML5_MEDIA_EVENT { diff --git a/packages/analytics/src/Providers/AmazonPersonalizeHelper/SessionInfoManager.ts b/packages/analytics/src/Providers/AmazonPersonalizeHelper/SessionInfoManager.ts index c761d098ed4..aeaa5697e19 100644 --- a/packages/analytics/src/Providers/AmazonPersonalizeHelper/SessionInfoManager.ts +++ b/packages/analytics/src/Providers/AmazonPersonalizeHelper/SessionInfoManager.ts @@ -1,22 +1,11 @@ -/* - * Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { SessionInfo } from './DataType'; import isEmpty from 'lodash/isEmpty'; import isEqual from 'lodash/isEqual'; import { v1 as uuid } from 'uuid'; -import { ConsoleLogger as Logger, JS } from '@aws-amplify/core'; - -import Cache from '@aws-amplify/cache'; +import { ConsoleLogger as Logger, browserOrNode } from '@aws-amplify/core'; +import { Cache } from '@aws-amplify/cache'; const PERSONALIZE_CACHE = '_awsct'; const PERSONALIZE_CACHE_USERID = '_awsct_uid'; @@ -34,7 +23,7 @@ export class SessionInfoManager { private _timerKey; constructor(prefixKey = '') { - this._isBrowser = JS.browserOrNode().isBrowser; + this._isBrowser = browserOrNode().isBrowser; this._timerKey = uuid().substr(0, 15); this._refreshTimer(); } diff --git a/packages/analytics/src/Providers/AmazonPersonalizeHelper/index.ts b/packages/analytics/src/Providers/AmazonPersonalizeHelper/index.ts index 6cf38e1cac3..6ff07e58d30 100644 --- a/packages/analytics/src/Providers/AmazonPersonalizeHelper/index.ts +++ b/packages/analytics/src/Providers/AmazonPersonalizeHelper/index.ts @@ -1,15 +1,11 @@ -/* - * Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 './DataType'; -export * from './SessionInfoManager'; -export * from './MediaAutoTrack'; +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +export { + EventData, + RecordEventListPayload, + RecordEventPayload, + RequestParams, + SessionInfo, +} from './DataType'; +export { SessionInfoManager } from './SessionInfoManager'; +export { MediaAutoTrack } from './MediaAutoTrack'; diff --git a/packages/analytics/src/Providers/AmazonPersonalizeProvider.ts b/packages/analytics/src/Providers/AmazonPersonalizeProvider.ts index b5756c9c58a..53c8b4ec6ca 100644 --- a/packages/analytics/src/Providers/AmazonPersonalizeProvider.ts +++ b/packages/analytics/src/Providers/AmazonPersonalizeProvider.ts @@ -1,21 +1,11 @@ -/* - * Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { ConsoleLogger as Logger, Credentials, - JS, getAmplifyUserAgent, + browserOrNode, } from '@aws-amplify/core'; import { PersonalizeEventsClient, @@ -67,7 +57,7 @@ export class AmazonPersonalizeProvider implements AnalyticsProvider { this._config.trackingId ); } - this._isBrowser = JS.browserOrNode().isBrowser; + this._isBrowser = browserOrNode().isBrowser; // flush event buffer this._setupTimer(); @@ -260,10 +250,8 @@ export class AmazonPersonalizeProvider implements AnalyticsProvider { const events: RecordEventPayload[] = []; for (let i = 0; i < groupLen; i += 1) { const params: RequestParams = group.shift(); - const eventPayload: RecordEventPayload = this._generateSingleRecordPayload( - params, - sessionInfo - ); + const eventPayload: RecordEventPayload = + this._generateSingleRecordPayload(params, sessionInfo); events.push(eventPayload); } const payload = {}; @@ -407,8 +395,3 @@ export class AmazonPersonalizeProvider implements AnalyticsProvider { }); } } - -/** - * @deprecated use named import - */ -export default AmazonPersonalizeProvider; diff --git a/packages/analytics/src/index.ts b/packages/analytics/src/index.ts index 664c1a16f18..d4e8ea1215c 100644 --- a/packages/analytics/src/index.ts +++ b/packages/analytics/src/index.ts @@ -1,22 +1,11 @@ -/* - * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 -import { Analytics } from './Analytics'; -import { AnalyticsProvider } from './types'; - -/** - * @deprecated use named import - */ -export default Analytics; -export { AnalyticsProvider, Analytics }; -export * from './Providers'; +export { Analytics } from './Analytics'; +export { AnalyticsProvider } from './types'; +export { + AWSPinpointProvider, + AWSKinesisProvider, + AWSKinesisFirehoseProvider, + AmazonPersonalizeProvider, +} from './Providers'; diff --git a/packages/analytics/src/trackers/EventTracker.ts b/packages/analytics/src/trackers/EventTracker.ts index dfa15f8b0b0..86f4787d40a 100644 --- a/packages/analytics/src/trackers/EventTracker.ts +++ b/packages/analytics/src/trackers/EventTracker.ts @@ -1,19 +1,9 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { delegate } from '../vendor/dom-utils'; import { EventTrackOpts } from '../types'; -import { ConsoleLogger as Logger, JS } from '@aws-amplify/core'; +import { ConsoleLogger as Logger, browserOrNode } from '@aws-amplify/core'; const logger = new Logger('EventTracker'); @@ -30,7 +20,7 @@ export class EventTracker { private _delegates; constructor(tracker, opts) { - if (!JS.browserOrNode().isBrowser || !window.addEventListener) { + if (!browserOrNode().isBrowser || !window.addEventListener) { logger.debug('not in the supported web environment'); return; } @@ -123,8 +113,3 @@ export class EventTracker { }); } } - -/** - * @deprecated use named import - */ -export default EventTracker; diff --git a/packages/analytics/src/trackers/PageViewTracker.ts b/packages/analytics/src/trackers/PageViewTracker.ts index a9441395d28..05b48aa9449 100644 --- a/packages/analytics/src/trackers/PageViewTracker.ts +++ b/packages/analytics/src/trackers/PageViewTracker.ts @@ -1,25 +1,15 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { pageViewTrackOpts } from '../types'; import { MethodEmbed } from '../utils/MethodEmbed'; -import { ConsoleLogger as Logger, JS } from '@aws-amplify/core'; +import { ConsoleLogger as Logger, browserOrNode } from '@aws-amplify/core'; const logger = new Logger('PageViewTracker'); const PREV_URL_KEY = 'aws-amplify-analytics-prevUrl'; const getUrl = () => { - if (!JS.browserOrNode().isBrowser) return ''; + if (!browserOrNode().isBrowser) return ''; else return window.location.origin + window.location.pathname; }; @@ -71,7 +61,7 @@ export class PageViewTracker { private async _pageViewTrackDefault() { if ( - !JS.browserOrNode().isBrowser || + !browserOrNode().isBrowser || !window.addEventListener || !window.sessionStorage ) { @@ -106,7 +96,7 @@ export class PageViewTracker { private async _trackFunc() { if ( - !JS.browserOrNode().isBrowser || + !browserOrNode().isBrowser || !window.addEventListener || !history.pushState || !window.sessionStorage @@ -143,7 +133,7 @@ export class PageViewTracker { private _pageViewTrackSPA() { if ( - !JS.browserOrNode().isBrowser || + !browserOrNode().isBrowser || !window.addEventListener || !history.pushState ) { @@ -165,8 +155,3 @@ export class PageViewTracker { } } } - -/** - * @deprecated use named import - */ -export default PageViewTracker; diff --git a/packages/analytics/src/trackers/SessionTracker-rn.ts b/packages/analytics/src/trackers/SessionTracker-rn.ts index 537ea381de6..eef56d5393d 100644 --- a/packages/analytics/src/trackers/SessionTracker-rn.ts +++ b/packages/analytics/src/trackers/SessionTracker-rn.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 // the session tracker for react native @@ -142,8 +132,3 @@ export class SessionTracker { return this._config; } } - -/** - * @deprecated use named import - */ -export default SessionTracker; diff --git a/packages/analytics/src/trackers/SessionTracker.ts b/packages/analytics/src/trackers/SessionTracker.ts index 233d7ebfff9..da7bcdaae27 100644 --- a/packages/analytics/src/trackers/SessionTracker.ts +++ b/packages/analytics/src/trackers/SessionTracker.ts @@ -1,19 +1,14 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 // the session tracker for web -import { ConsoleLogger as Logger, Hub, JS, Constants } from '@aws-amplify/core'; +import { + ConsoleLogger as Logger, + Hub, + Constants, + browserOrNode, +} from '@aws-amplify/core'; import { SessionTrackOpts } from '../types'; const logger = new Logger('SessionTracker'); @@ -45,7 +40,7 @@ export class SessionTracker { } private _envCheck() { - if (!JS.browserOrNode().isBrowser) { + if (!browserOrNode().isBrowser) { return false; } @@ -182,8 +177,3 @@ export class SessionTracker { return this._config; } } - -/** - * @deprecated use named import - */ -export default SessionTracker; diff --git a/packages/analytics/src/trackers/index.ts b/packages/analytics/src/trackers/index.ts index 01beeb920e6..7043d4f4214 100644 --- a/packages/analytics/src/trackers/index.ts +++ b/packages/analytics/src/trackers/index.ts @@ -1,3 +1,3 @@ -export { default as PageViewTracker } from './PageViewTracker'; -export { default as EventTracker } from './EventTracker'; -export { default as SessionTracker } from './SessionTracker'; +export { PageViewTracker } from './PageViewTracker'; +export { EventTracker } from './EventTracker'; +export { SessionTracker } from './SessionTracker'; diff --git a/packages/analytics/src/types/Analytics.ts b/packages/analytics/src/types/Analytics.ts index 412945ed556..e92068829a7 100644 --- a/packages/analytics/src/types/Analytics.ts +++ b/packages/analytics/src/types/Analytics.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { ICredentials } from '@aws-amplify/core'; /** * Analytics instance options diff --git a/packages/analytics/src/types/Provider.ts b/packages/analytics/src/types/Provider.ts index c829b653a0e..1c8cad74481 100644 --- a/packages/analytics/src/types/Provider.ts +++ b/packages/analytics/src/types/Provider.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 export interface PromiseHandlers { resolve: Function; diff --git a/packages/analytics/src/types/index.ts b/packages/analytics/src/types/index.ts index e41d8d2d4ee..98702835ea4 100644 --- a/packages/analytics/src/types/index.ts +++ b/packages/analytics/src/types/index.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 export * from './Analytics'; export * from './Provider'; diff --git a/packages/analytics/src/utils/MethodEmbed.ts b/packages/analytics/src/utils/MethodEmbed.ts index 3d2c9f2afae..78f62aab16f 100644 --- a/packages/analytics/src/utils/MethodEmbed.ts +++ b/packages/analytics/src/utils/MethodEmbed.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 const lists: MethodEmbed[] = []; @@ -57,8 +47,3 @@ function getInstance(context, methodName): MethodEmbed { return instance; } - -/** - * @deprecated use named import - */ -export default MethodEmbed; diff --git a/packages/analytics/src/vendor/dom-utils/matches.ts b/packages/analytics/src/vendor/dom-utils/matches.ts index 1aa4a773abc..4a18d6c5421 100644 --- a/packages/analytics/src/vendor/dom-utils/matches.ts +++ b/packages/analytics/src/vendor/dom-utils/matches.ts @@ -2,10 +2,10 @@ * Copyright (c) 2017, Philip Walton */ -import { JS } from '@aws-amplify/core'; +import { browserOrNode } from '@aws-amplify/core'; const proto = - JS.browserOrNode().isBrowser && window['Element'] + browserOrNode().isBrowser && window['Element'] ? window['Element'].prototype : null; diff --git a/packages/analytics/src/vendor/dom-utils/parse-url.ts b/packages/analytics/src/vendor/dom-utils/parse-url.ts index ffead16e6ad..bc633af3e19 100644 --- a/packages/analytics/src/vendor/dom-utils/parse-url.ts +++ b/packages/analytics/src/vendor/dom-utils/parse-url.ts @@ -2,13 +2,13 @@ * Copyright (c) 2017, Philip Walton */ -import { JS } from '@aws-amplify/core'; +import { browserOrNode } from '@aws-amplify/core'; const HTTP_PORT = '80'; const HTTPS_PORT = '443'; const DEFAULT_PORT = RegExp(':(' + HTTP_PORT + '|' + HTTPS_PORT + ')$'); -const a = JS.browserOrNode().isBrowser ? document.createElement('a') : null; +const a = browserOrNode().isBrowser ? document.createElement('a') : null; const cache = {}; /** diff --git a/packages/analytics/tsconfig.build.json b/packages/analytics/tsconfig.build.json new file mode 100644 index 00000000000..af6adca185d --- /dev/null +++ b/packages/analytics/tsconfig.build.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": {}, + "include": ["lib*/**/*.ts", "src"] +} diff --git a/packages/api-graphql/.npmignore b/packages/api-graphql/.npmignore deleted file mode 100644 index 7843ccd1b80..00000000000 --- a/packages/api-graphql/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -__mocks__/** -__tests__/** -coverage/** -docs/** -node_modules/** -.vscode/** -.DS_Store -*.log -prepend-license.js -prettier.config.json -tsconfig.json -tsfmt.json -tslint.json -typeDoc.js -webpack.config.js \ No newline at end of file diff --git a/packages/api-graphql/CHANGELOG.md b/packages/api-graphql/CHANGELOG.md index bd648a7a502..9e809533060 100644 --- a/packages/api-graphql/CHANGELOG.md +++ b/packages/api-graphql/CHANGELOG.md @@ -3,14 +3,6 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -## [2.3.25](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api-graphql@2.3.24...@aws-amplify/api-graphql@2.3.25) (2022-11-04) - -**Note:** Version bump only for package @aws-amplify/api-graphql - - - - - ## [2.3.24](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api-graphql@2.3.23...@aws-amplify/api-graphql@2.3.24) (2022-10-27) **Note:** Version bump only for package @aws-amplify/api-graphql diff --git a/packages/api-graphql/__tests__/GraphQLAPI-test.ts b/packages/api-graphql/__tests__/GraphQLAPI-test.ts index 02209d919d7..6a00588b8c6 100644 --- a/packages/api-graphql/__tests__/GraphQLAPI-test.ts +++ b/packages/api-graphql/__tests__/GraphQLAPI-test.ts @@ -1,4 +1,4 @@ -import Auth from '@aws-amplify/auth'; +import { Auth } from '@aws-amplify/auth'; import { GraphQLAPIClass as API } from '../src'; import { graphqlOperation } from '../src/GraphQLAPI'; import { GRAPHQL_AUTH_MODE, GraphQLAuthError } from '../src/types'; @@ -11,8 +11,8 @@ import { Constants, INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, } from '@aws-amplify/core'; -import PubSub from '@aws-amplify/pubsub'; -import Cache from '@aws-amplify/cache'; +import { PubSub } from '@aws-amplify/pubsub'; +import { Cache } from '@aws-amplify/cache'; import * as Observable from 'zen-observable'; import axios, { CancelTokenStatic } from 'axios'; diff --git a/packages/api-graphql/package.json b/packages/api-graphql/package.json index 08a08c3f29d..dbcda88695f 100644 --- a/packages/api-graphql/package.json +++ b/packages/api-graphql/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/api-graphql", - "version": "2.3.25", + "version": "3.0.0", "description": "Api-graphql category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -9,11 +9,8 @@ "./lib/index": "./lib-esm/index.js" }, "sideEffects": [ - "./src/GraphQLAPI.ts", "./lib/GraphQLAPI.js", - "./lib-esm/GraphQLAPI.js", - "./dist/aws-amplify-api-graphql.js", - "./dist/aws-amplify-api-graphql.min.js" + "./lib-esm/GraphQLAPI.js" ], "publishConfig": { "access": "public" @@ -28,7 +25,8 @@ "build": "npm run clean && npm run build:esm && npm run build:cjs", "clean": "rimraf lib-esm lib dist", "format": "echo \"Not implemented\"", - "lint": "tslint 'src/**/*.ts'" + "lint": "tslint 'src/**/*.ts' && npm run ts-coverage", + "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 75.62" }, "repository": { "type": "git", @@ -43,15 +41,17 @@ "devDependencies": { "@types/zen-observable": "^0.8.0" }, + "files": ["lib", "lib-esm", "src"], "dependencies": { - "@aws-amplify/api-rest": "2.0.61", - "@aws-amplify/auth": "4.6.14", - "@aws-amplify/cache": "4.0.63", - "@aws-amplify/core": "4.7.12", - "@aws-amplify/pubsub": "4.5.11", + "@aws-amplify/api-rest": "3.0.0", + "@aws-amplify/auth": "5.0.0", + "@aws-amplify/cache": "5.0.0", + "@aws-amplify/core": "5.0.0", + "@aws-amplify/pubsub": "5.0.0", "graphql": "15.8.0", "uuid": "^3.2.1", - "zen-observable-ts": "0.8.19" + "zen-observable-ts": "0.8.19", + "tslib": "^1.8.0" }, "jest": { "globals": { diff --git a/packages/api-graphql/src/GraphQLAPI.ts b/packages/api-graphql/src/GraphQLAPI.ts index 9cd4828d29e..b112e893428 100644 --- a/packages/api-graphql/src/GraphQLAPI.ts +++ b/packages/api-graphql/src/GraphQLAPI.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { DocumentNode, OperationDefinitionNode, @@ -27,8 +17,8 @@ import { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, } from '@aws-amplify/core'; import { PubSub } from '@aws-amplify/pubsub'; -import Auth from '@aws-amplify/auth'; -import Cache from '@aws-amplify/cache'; +import { Auth } from '@aws-amplify/auth'; +import { Cache } from '@aws-amplify/cache'; import { GraphQLAuthError, GraphQLOptions, diff --git a/packages/api-graphql/src/index.ts b/packages/api-graphql/src/index.ts index c4ef4a0efbd..e69d50f6dd7 100644 --- a/packages/api-graphql/src/index.ts +++ b/packages/api-graphql/src/index.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { GraphQLAPI } from './GraphQLAPI'; export { GraphQLResult, GraphQLAuthError, GRAPHQL_AUTH_MODE } from './types'; diff --git a/packages/api-graphql/src/types/index.ts b/packages/api-graphql/src/types/index.ts index 2700600459c..dc7ee387970 100644 --- a/packages/api-graphql/src/types/index.ts +++ b/packages/api-graphql/src/types/index.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { Source, DocumentNode, GraphQLError } from 'graphql'; export { OperationTypeNode } from 'graphql'; import { GRAPHQL_AUTH_MODE } from '@aws-amplify/auth'; diff --git a/packages/api-graphql/tsconfig.build.json b/packages/api-graphql/tsconfig.build.json new file mode 100644 index 00000000000..af6adca185d --- /dev/null +++ b/packages/api-graphql/tsconfig.build.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": {}, + "include": ["lib*/**/*.ts", "src"] +} diff --git a/packages/api-rest/.npmignore b/packages/api-rest/.npmignore deleted file mode 100644 index 7843ccd1b80..00000000000 --- a/packages/api-rest/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -__mocks__/** -__tests__/** -coverage/** -docs/** -node_modules/** -.vscode/** -.DS_Store -*.log -prepend-license.js -prettier.config.json -tsconfig.json -tsfmt.json -tslint.json -typeDoc.js -webpack.config.js \ No newline at end of file diff --git a/packages/api-rest/CHANGELOG.md b/packages/api-rest/CHANGELOG.md index d41790e7693..8127d230891 100644 --- a/packages/api-rest/CHANGELOG.md +++ b/packages/api-rest/CHANGELOG.md @@ -3,14 +3,6 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -## [2.0.61](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api-rest@2.0.60...@aws-amplify/api-rest@2.0.61) (2022-11-04) - -**Note:** Version bump only for package @aws-amplify/api-rest - - - - - ## [2.0.60](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api-rest@2.0.59...@aws-amplify/api-rest@2.0.60) (2022-10-27) **Note:** Version bump only for package @aws-amplify/api-rest diff --git a/packages/api-rest/package.json b/packages/api-rest/package.json index fb8c660c50a..9fca04cab67 100644 --- a/packages/api-rest/package.json +++ b/packages/api-rest/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/api-rest", - "version": "2.0.61", + "version": "3.0.0", "description": "Api-rest category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -9,11 +9,8 @@ "./lib/index": "./lib-esm/index.js" }, "sideEffects": [ - "./src/RestAPI.ts", "./lib/RestAPI.js", - "./lib-esm/RestAPI.js", - "./dist/aws-amplify-api-rest.js", - "./dist/aws-amplify-api-rest.min.js" + "./lib-esm/RestAPI.js" ], "publishConfig": { "access": "public" @@ -28,7 +25,8 @@ "build": "npm run clean && npm run build:esm && npm run build:cjs", "clean": "rimraf lib-esm lib dist", "format": "echo \"Not implemented\"", - "lint": "tslint 'src/**/*.ts'" + "lint": "tslint 'src/**/*.ts' && npm run ts-coverage", + "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 65.41" }, "repository": { "type": "git", @@ -40,9 +38,11 @@ "url": "https://github.com/aws/aws-amplify/issues" }, "homepage": "https://aws-amplify.github.io/", + "files": ["lib", "lib-esm", "src"], "dependencies": { - "@aws-amplify/core": "4.7.12", - "axios": "0.26.0" + "@aws-amplify/core": "5.0.0", + "axios": "0.26.0", + "tslib": "^1.8.0" }, "jest": { "globals": { diff --git a/packages/api-rest/src/RestAPI.ts b/packages/api-rest/src/RestAPI.ts index 0ed75253e00..b424bfd9743 100644 --- a/packages/api-rest/src/RestAPI.ts +++ b/packages/api-rest/src/RestAPI.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { RestClient } from './RestClient'; import { Amplify, diff --git a/packages/api-rest/src/RestClient.ts b/packages/api-rest/src/RestClient.ts index a9337d9c55b..61e0d3f4bbb 100644 --- a/packages/api-rest/src/RestClient.ts +++ b/packages/api-rest/src/RestClient.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { ConsoleLogger as Logger, diff --git a/packages/api-rest/src/index.ts b/packages/api-rest/src/index.ts index a59db2ad9f3..1677bbc880b 100644 --- a/packages/api-rest/src/index.ts +++ b/packages/api-rest/src/index.ts @@ -1,18 +1,5 @@ -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 { RestAPI } from './RestAPI'; +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 export { RestAPI, RestAPIClass } from './RestAPI'; export { RestClient } from './RestClient'; -export default RestAPI; diff --git a/packages/api-rest/src/types/index.ts b/packages/api-rest/src/types/index.ts index 87e80a8ac38..7386370121e 100644 --- a/packages/api-rest/src/types/index.ts +++ b/packages/api-rest/src/types/index.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 /** * RestClient instance options diff --git a/packages/api-rest/tsconfig.build.json b/packages/api-rest/tsconfig.build.json new file mode 100644 index 00000000000..af6adca185d --- /dev/null +++ b/packages/api-rest/tsconfig.build.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": {}, + "include": ["lib*/**/*.ts", "src"] +} diff --git a/packages/api/.npmignore b/packages/api/.npmignore deleted file mode 100644 index fe4eeff4d82..00000000000 --- a/packages/api/.npmignore +++ /dev/null @@ -1,17 +0,0 @@ -__mocks__/** -__tests__/** -coverage/** -docs/** -node_modules/** -.vscode/** -.DS_Store -*.log -lib/.tsbuildinfo -lib-esm/.tsbuildinfo -prepend-license.js -prettier.config.json -tsconfig.json -tsfmt.json -tslint.json -typeDoc.js -webpack.config.js diff --git a/packages/api/CHANGELOG.md b/packages/api/CHANGELOG.md index ae02b671444..4166113a162 100644 --- a/packages/api/CHANGELOG.md +++ b/packages/api/CHANGELOG.md @@ -3,14 +3,6 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -## [4.0.61](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.60...@aws-amplify/api@4.0.61) (2022-11-04) - -**Note:** Version bump only for package @aws-amplify/api - - - - - ## [4.0.60](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.59...@aws-amplify/api@4.0.60) (2022-10-27) **Note:** Version bump only for package @aws-amplify/api diff --git a/packages/api/package.json b/packages/api/package.json index a977591baa3..0bf56ad67e9 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/api", - "version": "4.0.61", + "version": "5.0.0", "description": "Api category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -16,11 +16,8 @@ "./lib/index": "./lib-esm/index.js" }, "sideEffects": [ - "./src/API.ts", "./lib/API.js", - "./lib-esm/API.js", - "./dist/aws-amplify-api.js", - "./dist/aws-amplify-api.min.js" + "./lib-esm/API.js" ], "publishConfig": { "access": "public" @@ -35,7 +32,8 @@ "build": "npm run clean && npm run build:esm && npm run build:cjs", "clean": "rimraf lib-esm lib dist", "format": "echo \"Not implemented\"", - "lint": "tslint 'src/**/*.ts'" + "lint": "tslint 'src/**/*.ts' && npm run ts-coverage", + "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 91.93" }, "repository": { "type": "git", @@ -50,9 +48,11 @@ "devDependencies": { "@types/zen-observable": "^0.8.0" }, + "files": ["lib", "lib-esm", "src", "index.*.d.ts"], "dependencies": { - "@aws-amplify/api-graphql": "2.3.25", - "@aws-amplify/api-rest": "2.0.61" + "@aws-amplify/api-graphql": "3.0.0", + "@aws-amplify/api-rest": "3.0.0", + "tslib": "^1.8.0" }, "jest": { "globals": { diff --git a/packages/api/src/API.ts b/packages/api/src/API.ts index e0477e4f24a..4a94b0f0e2a 100644 --- a/packages/api/src/API.ts +++ b/packages/api/src/API.ts @@ -1,17 +1,7 @@ -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { Auth } from '@aws-amplify/auth'; -import Cache from '@aws-amplify/cache'; +import { Cache } from '@aws-amplify/cache'; import { AWSAppSyncRealTimeProvider } from '@aws-amplify/pubsub'; import { RestAPIClass } from '@aws-amplify/api-rest'; import { diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index 626e434038b..9d0bb40f389 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -1,17 +1,5 @@ -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 { API } from './API'; +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 export { GraphQLQuery, GraphQLSubscription } from './types'; export { API, APIClass } from './API'; @@ -22,8 +10,3 @@ export { } from '@aws-amplify/api-graphql'; export type { GraphQLResult } from '@aws-amplify/api-graphql'; - -/* - * @deprecated use named import - */ -export default API; diff --git a/packages/api/src/types/index.ts b/packages/api/src/types/index.ts index a40c7ef5c2f..1a11786619a 100644 --- a/packages/api/src/types/index.ts +++ b/packages/api/src/types/index.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 /** * This exports from the types directory is a temporary workaround, since Amplify CLI currently diff --git a/packages/api/tsconfig.build.json b/packages/api/tsconfig.build.json new file mode 100644 index 00000000000..af6adca185d --- /dev/null +++ b/packages/api/tsconfig.build.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": {}, + "include": ["lib*/**/*.ts", "src"] +} diff --git a/packages/auth/.npmignore b/packages/auth/.npmignore deleted file mode 100644 index fe4eeff4d82..00000000000 --- a/packages/auth/.npmignore +++ /dev/null @@ -1,17 +0,0 @@ -__mocks__/** -__tests__/** -coverage/** -docs/** -node_modules/** -.vscode/** -.DS_Store -*.log -lib/.tsbuildinfo -lib-esm/.tsbuildinfo -prepend-license.js -prettier.config.json -tsconfig.json -tsfmt.json -tslint.json -typeDoc.js -webpack.config.js diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 3d20a062731..10a1166aa01 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -3,14 +3,6 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -## [4.6.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.6.13...@aws-amplify/auth@4.6.14) (2022-11-04) - -**Note:** Version bump only for package @aws-amplify/auth - - - - - ## [4.6.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@4.6.12...@aws-amplify/auth@4.6.13) (2022-10-27) **Note:** Version bump only for package @aws-amplify/auth diff --git a/packages/auth/__tests__/auth-federation-unit-tests.ts b/packages/auth/__tests__/auth-federation-unit-tests.ts index 383eca25ece..388a769cd3b 100644 --- a/packages/auth/__tests__/auth-federation-unit-tests.ts +++ b/packages/auth/__tests__/auth-federation-unit-tests.ts @@ -1,9 +1,3 @@ -jest.mock('crypto-js/sha256', () => { - return { - default: jest.fn(() => ''), - }; -}); - jest.mock('../src/OAuth/oauthStorage', () => { return { clearAll: jest.fn(), diff --git a/packages/auth/__tests__/auth-unit-test.ts b/packages/auth/__tests__/auth-unit-test.ts index 8120dbefcb0..43b48ef62d1 100644 --- a/packages/auth/__tests__/auth-unit-test.ts +++ b/packages/auth/__tests__/auth-unit-test.ts @@ -13,12 +13,6 @@ import { const MAX_DEVICES: number = 60; -jest.mock('crypto-js/sha256', () => { - return { - default: jest.fn(() => ''), - }; -}); - jest.mock('../src/OAuth/oauthStorage', () => { return { clearAll: jest.fn(), @@ -280,14 +274,7 @@ const createMockLocalStorage = () => import { AuthOptions, SignUpParams, AwsCognitoOAuthOpts } from '../src/types'; import { AuthClass as Auth } from '../src/Auth'; -import Cache from '@aws-amplify/cache'; -import { - Credentials, - GoogleOAuth, - StorageHelper, - ICredentials, - Hub, -} from '@aws-amplify/core'; +import { Credentials, StorageHelper, Hub } from '@aws-amplify/core'; import { AuthError, NoUserPoolError } from '../src/Errors'; import { AuthErrorTypes } from '../src/types/Auth'; import { mockDeviceArray, transformedMockData } from './mockData'; @@ -1910,9 +1897,9 @@ describe('auth unit test', () => { const spyon2 = jest .spyOn(Credentials, 'refreshFederatedToken') - .mockImplementationOnce((() => { - return Promise.resolve('cred'); - }) as any); + .mockImplementationOnce(() => { + return Promise.resolve('cred' as any); + }); expect.assertions(1); expect(await auth.currentUserCredentials()).toBe('cred'); diff --git a/packages/auth/__tests__/cred-unit-test-rn.ts b/packages/auth/__tests__/cred-unit-test-rn.ts index 9d604e468e6..d570c668ad2 100644 --- a/packages/auth/__tests__/cred-unit-test-rn.ts +++ b/packages/auth/__tests__/cred-unit-test-rn.ts @@ -143,9 +143,7 @@ jest.mock('@aws-amplify/core', () => { }; }); -import { AuthOptions, SignUpParams } from '../src/types'; -import { AuthClass as Auth } from '../src/Auth'; -import Cache from '@aws-amplify/cache'; +import { AuthOptions } from '../src/types'; import { CognitoUserPool, CognitoUser, diff --git a/packages/auth/__tests__/hosted-ui.test.ts b/packages/auth/__tests__/hosted-ui.test.ts index 57df945a38c..cee6df74044 100644 --- a/packages/auth/__tests__/hosted-ui.test.ts +++ b/packages/auth/__tests__/hosted-ui.test.ts @@ -160,6 +160,11 @@ jest.mock('amazon-cognito-identity-js/lib/CognitoUser', () => { import * as AmplifyCore from '@aws-amplify/core'; const { Hub, Credentials, StorageHelper } = AmplifyCore; +// Mock the module to ensure that setters are available for spying +jest.mock('@aws-amplify/core', () => ({ + ...jest.requireActual('@aws-amplify/core'), +})); + const authOptionsWithOAuth: AuthOptions = { userPoolId: 'awsUserPoolsId', userPoolWebClientId: 'awsUserPoolsWebClientId', diff --git a/packages/auth/__tests__/totp-unit-test.ts b/packages/auth/__tests__/totp-unit-test.ts index 3eb0c836579..588575dc766 100644 --- a/packages/auth/__tests__/totp-unit-test.ts +++ b/packages/auth/__tests__/totp-unit-test.ts @@ -180,9 +180,7 @@ jest.mock('amazon-cognito-identity-js/lib/CognitoUser', () => { return CognitoUser; }); -import { AuthOptions, SignUpParams } from '../src/types'; import { AuthClass as Auth } from '../src/Auth'; -import Cache from '@aws-amplify/cache'; import { CognitoUserPool, CognitoUser, @@ -397,7 +395,7 @@ describe('auth unit test', () => { spyon2.mockClear(); }); - 'User has not verified software token mfa'; + ('User has not verified software token mfa'); test('totp not setup but TOTP chosed', async () => { const auth = new Auth(authOptions); diff --git a/packages/auth/package.json b/packages/auth/package.json index eef3a2941e5..9ee5dedc75b 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/auth", - "version": "4.6.14", + "version": "5.0.0", "description": "Auth category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -9,11 +9,8 @@ "./lib/index": "./lib-esm/index.js" }, "sideEffects": [ - "./src/Auth.ts", "./lib/Auth.js", - "./lib-esm/Auth.js", - "./dist/aws-amplify-auth.js", - "./dist/aws-amplify-auth.min.js" + "./lib-esm/Auth.js" ], "publishConfig": { "access": "public" @@ -28,7 +25,8 @@ "build": "npm run clean && npm run build:esm && npm run build:cjs", "clean": "rimraf lib-esm lib dist", "format": "echo \"Not implemented\"", - "lint": "tslint '{__tests__,src}/**/*.ts'" + "lint": "tslint '{__tests__,src}/**/*.ts' && npm run ts-coverage", + "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 77.44" }, "repository": { "type": "git", @@ -40,11 +38,11 @@ "url": "https://github.com/aws/aws-amplify/issues" }, "homepage": "https://aws-amplify.github.io/", + "files": ["lib", "lib-esm", "src"], "dependencies": { - "@aws-amplify/cache": "4.0.63", - "@aws-amplify/core": "4.7.12", - "amazon-cognito-identity-js": "5.2.12", - "crypto-js": "^4.1.1" + "@aws-amplify/core": "5.0.0", + "amazon-cognito-identity-js": "6.0.0", + "tslib": "^1.8.0" }, "devDependencies": { "@jest/test-sequencer": "^24.9.0" diff --git a/packages/auth/src/Auth.ts b/packages/auth/src/Auth.ts index a47b2ede23b..644f8e1e66e 100644 --- a/packages/auth/src/Auth.ts +++ b/packages/auth/src/Auth.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { AuthOptions, @@ -40,8 +30,8 @@ import { Hub, StorageHelper, ICredentials, - Parser, browserOrNode, + parseAWSExports, UniversalStorage, urlSafeDecode, HubCallback, @@ -150,7 +140,7 @@ export class AuthClass { const conf = Object.assign( {}, this._config, - Parser.parseMobilehubConfig(config).Auth, + parseAWSExports(config).Auth, config ); this._config = conf; diff --git a/packages/auth/src/Errors.ts b/packages/auth/src/Errors.ts index dcc34d1d886..7141714a71d 100644 --- a/packages/auth/src/Errors.ts +++ b/packages/auth/src/Errors.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { AuthErrorMessages, AuthErrorTypes } from './types'; import { ConsoleLogger as Logger } from '@aws-amplify/core'; diff --git a/packages/auth/src/OAuth/OAuth.ts b/packages/auth/src/OAuth/OAuth.ts index 275c931e94d..3b735172692 100644 --- a/packages/auth/src/OAuth/OAuth.ts +++ b/packages/auth/src/OAuth/OAuth.ts @@ -1,19 +1,10 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { parse } from 'url'; // Used for OAuth parsing of Cognito Hosted UI import { launchUri } from './urlOpener'; import * as oAuthStorage from './oauthStorage'; +import { Buffer } from 'buffer'; import { OAuthOpts, @@ -23,13 +14,12 @@ import { import { ConsoleLogger as Logger, Hub, urlSafeEncode } from '@aws-amplify/core'; -import sha256 from 'crypto-js/sha256'; -import Base64 from 'crypto-js/enc-base64'; - -const AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && -typeof Symbol.for === 'function' - ? Symbol.for('amplify_default') - : '@@amplify_default') as Symbol; +import { Sha256 } from '@aws-crypto/sha256-js'; +const AMPLIFY_SYMBOL = ( + typeof Symbol !== 'undefined' && typeof Symbol.for === 'function' + ? Symbol.for('amplify_default') + : '@@amplify_default' +) as Symbol; const dispatchAuthEvent = (event: string, data: any, message: string) => { Hub.dispatch('auth', { event, data, message }, 'Auth', AMPLIFY_SYMBOL); @@ -169,18 +159,15 @@ export default class OAuth { .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`) .join('&'); - const { - access_token, - refresh_token, - id_token, - error, - } = await ((await fetch(oAuthTokenEndpoint, { - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - }, - body, - })) as any).json(); + const { access_token, refresh_token, id_token, error } = await ( + (await fetch(oAuthTokenEndpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body, + })) as any + ).json(); if (error) { throw new Error(error); @@ -305,15 +292,18 @@ export default class OAuth { } private _generateChallenge(code: string) { - return this._base64URL(sha256(code)); + const awsCryptoHash = new Sha256(); + awsCryptoHash.update(code); + + const resultFromAWSCrypto = awsCryptoHash.digestSync(); + const b64 = Buffer.from(resultFromAWSCrypto).toString('base64'); + const base64URLFromAWSCrypto = this._base64URL(b64); + + return base64URLFromAWSCrypto; } private _base64URL(string) { - return string - .toString(Base64) - .replace(/=/g, '') - .replace(/\+/g, '-') - .replace(/\//g, '_'); + return string.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); } private _generateRandom(size: number) { diff --git a/packages/auth/src/OAuth/oauthStorage.native.ts b/packages/auth/src/OAuth/oauthStorage.native.ts index 86b10a8cbb6..838ae740afd 100644 --- a/packages/auth/src/OAuth/oauthStorage.native.ts +++ b/packages/auth/src/OAuth/oauthStorage.native.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 const obj: { oauth_state?: string; diff --git a/packages/auth/src/OAuth/oauthStorage.ts b/packages/auth/src/OAuth/oauthStorage.ts index 43d36aa518e..0d146eaa2ff 100644 --- a/packages/auth/src/OAuth/oauthStorage.ts +++ b/packages/auth/src/OAuth/oauthStorage.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 export const setState = (state: string) => { window.sessionStorage.setItem('oauth_state', state); diff --git a/packages/auth/src/OAuth/urlOpener.native.ts b/packages/auth/src/OAuth/urlOpener.native.ts index 5a79e2d0425..f9accd298d6 100644 --- a/packages/auth/src/OAuth/urlOpener.native.ts +++ b/packages/auth/src/OAuth/urlOpener.native.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { Linking } from 'react-native'; diff --git a/packages/auth/src/OAuth/urlOpener.ts b/packages/auth/src/OAuth/urlOpener.ts index 32d279569ed..6bf8250dbe8 100644 --- a/packages/auth/src/OAuth/urlOpener.ts +++ b/packages/auth/src/OAuth/urlOpener.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 const SELF = '_self'; diff --git a/packages/auth/src/index.ts b/packages/auth/src/index.ts index 3803e0aafd1..393c6795607 100644 --- a/packages/auth/src/index.ts +++ b/packages/auth/src/index.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { Auth } from './Auth'; import { diff --git a/packages/auth/src/types/Auth.ts b/packages/auth/src/types/Auth.ts index cbc668a1aa2..61996e767ec 100644 --- a/packages/auth/src/types/Auth.ts +++ b/packages/auth/src/types/Auth.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { ICookieStorageData, diff --git a/packages/auth/src/types/index.ts b/packages/auth/src/types/index.ts index c93082fe887..8fca837571e 100644 --- a/packages/auth/src/types/index.ts +++ b/packages/auth/src/types/index.ts @@ -1,14 +1,4 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 export * from './Auth'; diff --git a/packages/auth/src/urlListener.native.ts b/packages/auth/src/urlListener.native.ts index 3376a8c4567..aabb0fd2f9c 100644 --- a/packages/auth/src/urlListener.native.ts +++ b/packages/auth/src/urlListener.native.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { ConsoleLogger as Logger } from '@aws-amplify/core'; const logger = new Logger('urlListener'); diff --git a/packages/auth/src/urlListener.ts b/packages/auth/src/urlListener.ts index cad8429e2ce..f9b36b2fa67 100644 --- a/packages/auth/src/urlListener.ts +++ b/packages/auth/src/urlListener.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { browserOrNode } from '@aws-amplify/core'; export default callback => { diff --git a/packages/auth/tsconfig.build.json b/packages/auth/tsconfig.build.json new file mode 100644 index 00000000000..af6adca185d --- /dev/null +++ b/packages/auth/tsconfig.build.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": {}, + "include": ["lib*/**/*.ts", "src"] +} diff --git a/packages/aws-amplify-angular/CHANGELOG.md b/packages/aws-amplify-angular/CHANGELOG.md deleted file mode 100644 index e889ab4b7a3..00000000000 --- a/packages/aws-amplify-angular/CHANGELOG.md +++ /dev/null @@ -1,2139 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [6.0.61](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.60...aws-amplify-angular@6.0.61) (2022-11-04) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.60](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.59...aws-amplify-angular@6.0.60) (2022-10-27) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.59](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.58...aws-amplify-angular@6.0.59) (2022-10-26) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.58](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.57...aws-amplify-angular@6.0.58) (2022-10-25) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.57](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.56...aws-amplify-angular@6.0.57) (2022-10-14) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.56](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.55...aws-amplify-angular@6.0.56) (2022-10-14) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.55](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.53...aws-amplify-angular@6.0.55) (2022-09-30) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.54](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.53...aws-amplify-angular@6.0.54) (2022-09-20) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.53](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.52...aws-amplify-angular@6.0.53) (2022-09-08) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.52](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.51...aws-amplify-angular@6.0.52) (2022-09-01) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.51](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.50...aws-amplify-angular@6.0.51) (2022-08-23) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.50](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.49...aws-amplify-angular@6.0.50) (2022-08-18) - - -### Bug Fixes - -* An update to @types/lodash breaks the build - specify last working version to unblock ([#10221](https://github.com/aws-amplify/amplify-js/issues/10221)) ([f54b645](https://github.com/aws-amplify/amplify-js/commit/f54b64502bb163307a1e8701d686d9b6b90a6eee)) - - - - - -## [6.0.49](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.48...aws-amplify-angular@6.0.49) (2022-08-16) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.48](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.47...aws-amplify-angular@6.0.48) (2022-08-01) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.47](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.46...aws-amplify-angular@6.0.47) (2022-07-28) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.46](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.45...aws-amplify-angular@6.0.46) (2022-07-21) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.45](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.44...aws-amplify-angular@6.0.45) (2022-07-07) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.44](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.43...aws-amplify-angular@6.0.44) (2022-06-18) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.43](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.42...aws-amplify-angular@6.0.43) (2022-06-15) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.42](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.41...aws-amplify-angular@6.0.42) (2022-05-24) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.41](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.40...aws-amplify-angular@6.0.41) (2022-05-23) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.40](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.39...aws-amplify-angular@6.0.40) (2022-05-12) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.39](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.38...aws-amplify-angular@6.0.39) (2022-05-03) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.38](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.37...aws-amplify-angular@6.0.38) (2022-04-14) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.37](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.36...aws-amplify-angular@6.0.37) (2022-04-04) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.36](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.35...aws-amplify-angular@6.0.36) (2022-03-28) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.35](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.34...aws-amplify-angular@6.0.35) (2022-03-22) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.34](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.33...aws-amplify-angular@6.0.34) (2022-03-10) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.33](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.32...aws-amplify-angular@6.0.33) (2022-02-28) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.32](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.31...aws-amplify-angular@6.0.32) (2022-02-03) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.31](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.30...aws-amplify-angular@6.0.31) (2022-01-27) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.30](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.29...aws-amplify-angular@6.0.30) (2022-01-07) - - -### Bug Fixes - -* **aws-amplify-angular:** removed old zone package ([#9437](https://github.com/aws-amplify/amplify-js/issues/9437)) ([418725f](https://github.com/aws-amplify/amplify-js/commit/418725fa3bda44d431d0304afa639ed48df5927c)) - - - - - -## [6.0.29](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.28...aws-amplify-angular@6.0.29) (2021-12-16) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.28](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.27...aws-amplify-angular@6.0.28) (2021-12-03) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.27](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.26...aws-amplify-angular@6.0.27) (2021-12-02) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.26](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.25...aws-amplify-angular@6.0.26) (2021-11-18) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.25](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.24...aws-amplify-angular@6.0.25) (2021-11-16) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.24](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.23...aws-amplify-angular@6.0.24) (2021-11-12) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.23](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.22...aws-amplify-angular@6.0.23) (2021-11-09) - - -### Reverts - -* uuid dependency upgrade ([#9159](https://github.com/aws-amplify/amplify-js/issues/9159)) ([4ef8aa9](https://github.com/aws-amplify/amplify-js/commit/4ef8aa9c7c25dbe921fd02b6205b8defb93fbaec)) - - - - - -## [6.0.22](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.21...aws-amplify-angular@6.0.22) (2021-10-28) - -**Note:** Version bump only for package aws-amplify-angular - - - - - -## [6.0.21](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.20...aws-amplify-angular@6.0.21) (2021-10-21) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.20](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.19...aws-amplify-angular@6.0.20) (2021-10-07) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.19](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.18...aws-amplify-angular@6.0.19) (2021-09-30) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.18](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.17...aws-amplify-angular@6.0.18) (2021-09-24) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.17](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.16...aws-amplify-angular@6.0.17) (2021-09-22) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.16](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.15...aws-amplify-angular@6.0.16) (2021-09-17) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.15](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.14...aws-amplify-angular@6.0.15) (2021-09-09) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.14](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.13...aws-amplify-angular@6.0.14) (2021-09-07) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.13](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.12...aws-amplify-angular@6.0.13) (2021-09-04) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.11...aws-amplify-angular@6.0.12) (2021-09-02) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.10...aws-amplify-angular@6.0.11) (2021-08-26) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.9...aws-amplify-angular@6.0.10) (2021-08-19) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.8...aws-amplify-angular@6.0.9) (2021-08-12) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.7...aws-amplify-angular@6.0.8) (2021-07-28) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.6...aws-amplify-angular@6.0.7) (2021-07-22) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.5...aws-amplify-angular@6.0.6) (2021-07-16) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.4...aws-amplify-angular@6.0.5) (2021-07-08) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.3...aws-amplify-angular@6.0.4) (2021-06-24) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.2...aws-amplify-angular@6.0.3) (2021-06-18) - -**Note:** Version bump only for package aws-amplify-angular - -## [6.0.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@6.0.1...aws-amplify-angular@6.0.2) (2021-06-10) - -### Bug Fixes - -- **aws-amplify-angular:** remove util import to fix ng-12 build error ([#8369](https://github.com/aws-amplify/amplify-js/issues/8369)) ([ea97dda](https://github.com/aws-amplify/amplify-js/commit/ea97dda2895ba23466a50ec7defa0dcb44c3870d)) - -## [6.0.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.59...aws-amplify-angular@6.0.1) (2021-05-26) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.59](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.58...aws-amplify-angular@5.0.59) (2021-05-14) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.58](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.57...aws-amplify-angular@5.0.58) (2021-05-11) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.57](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.56...aws-amplify-angular@5.0.57) (2021-05-06) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.56](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.55...aws-amplify-angular@5.0.56) (2021-04-15) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.55](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.54...aws-amplify-angular@5.0.55) (2021-03-25) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.54](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.53...aws-amplify-angular@5.0.54) (2021-03-18) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.53](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.52...aws-amplify-angular@5.0.53) (2021-03-12) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.52](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.51...aws-amplify-angular@5.0.52) (2021-03-08) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.51](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.50...aws-amplify-angular@5.0.51) (2021-03-03) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.50](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.49...aws-amplify-angular@5.0.50) (2021-02-25) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.49](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.48...aws-amplify-angular@5.0.49) (2021-02-18) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.48](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.47...aws-amplify-angular@5.0.48) (2021-02-15) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.47](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.46...aws-amplify-angular@5.0.47) (2021-02-09) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.46](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.45...aws-amplify-angular@5.0.46) (2021-02-03) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.45](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.44...aws-amplify-angular@5.0.45) (2021-02-01) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.44](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.43...aws-amplify-angular@5.0.44) (2021-01-29) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.43](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.42...aws-amplify-angular@5.0.43) (2021-01-07) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.42](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.41...aws-amplify-angular@5.0.42) (2020-12-17) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.41](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.40...aws-amplify-angular@5.0.41) (2020-12-10) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.40](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.39...aws-amplify-angular@5.0.40) (2020-11-30) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.39](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.38...aws-amplify-angular@5.0.39) (2020-11-23) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.38](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.37...aws-amplify-angular@5.0.38) (2020-11-20) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.37](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.36...aws-amplify-angular@5.0.37) (2020-11-13) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.36](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.35...aws-amplify-angular@5.0.36) (2020-11-03) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.35](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.34...aws-amplify-angular@5.0.35) (2020-10-31) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.34](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.33...aws-amplify-angular@5.0.34) (2020-10-29) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.33](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.32...aws-amplify-angular@5.0.33) (2020-10-15) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.32](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.31...aws-amplify-angular@5.0.32) (2020-10-01) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.31](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.30...aws-amplify-angular@5.0.31) (2020-09-25) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.30](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.29...aws-amplify-angular@5.0.30) (2020-09-16) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.29](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.28...aws-amplify-angular@5.0.29) (2020-09-15) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.28](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.27...aws-amplify-angular@5.0.28) (2020-09-10) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.27](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.26...aws-amplify-angular@5.0.27) (2020-09-03) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.26](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.25...aws-amplify-angular@5.0.26) (2020-09-03) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.25](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.24...aws-amplify-angular@5.0.25) (2020-09-01) - -### Bug Fixes - -- **aws-amplify-angular:** remove rollup-plugin-node-builtins ([#6638](https://github.com/aws-amplify/amplify-js/issues/6638)) ([46770e9](https://github.com/aws-amplify/amplify-js/commit/46770e97427ca06c7855b78363669ea62b47cd76)) - -## [5.0.24](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.23...aws-amplify-angular@5.0.24) (2020-08-19) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.23](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.22...aws-amplify-angular@5.0.23) (2020-08-06) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.22](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.21...aws-amplify-angular@5.0.22) (2020-07-27) - -### Bug Fixes - -- **@aws-amplify/interactions:** fix interactions v3 bugs and refactor type ([#6381](https://github.com/aws-amplify/amplify-js/issues/6381)) ([8c6fb4a](https://github.com/aws-amplify/amplify-js/commit/8c6fb4aefa60b36ed33d89c431e743f674119bde)) - -## [5.0.21](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.20...aws-amplify-angular@5.0.21) (2020-07-22) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.20](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.19...aws-amplify-angular@5.0.20) (2020-07-09) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.19](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.18...aws-amplify-angular@5.0.19) (2020-07-07) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.18](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.17...aws-amplify-angular@5.0.18) (2020-06-18) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.17](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.16...aws-amplify-angular@5.0.17) (2020-06-09) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.16](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.15...aws-amplify-angular@5.0.16) (2020-06-04) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.15](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.14...aws-amplify-angular@5.0.15) (2020-06-03) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.14](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.13...aws-amplify-angular@5.0.14) (2020-06-02) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.13](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.12...aws-amplify-angular@5.0.13) (2020-05-26) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.11...aws-amplify-angular@5.0.12) (2020-05-22) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.10...aws-amplify-angular@5.0.11) (2020-05-14) - -### Bug Fixes - -- **aws-amplify-angular:** decorateSignUp matches Auth.signUp ([b569399](https://github.com/aws-amplify/amplify-js/commit/b569399fe73a2b0b4cd0aa1373b862e779ee7e0c)) -- **aws-amplify-angular:** pass signout options object in auth decorator ([#4185](https://github.com/aws-amplify/amplify-js/issues/4185)) ([ad4367a](https://github.com/aws-amplify/amplify-js/commit/ad4367a3d96eb3a4bb3b84ec7e31df0845957b36)) - -## [5.0.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.9...aws-amplify-angular@5.0.10) (2020-04-30) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.8...aws-amplify-angular@5.0.9) (2020-04-24) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.7...aws-amplify-angular@5.0.8) (2020-04-14) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.6...aws-amplify-angular@5.0.7) (2020-04-08) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.5...aws-amplify-angular@5.0.6) (2020-04-07) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.4...aws-amplify-angular@5.0.5) (2020-04-03) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.3...aws-amplify-angular@5.0.4) (2020-04-02) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.2...aws-amplify-angular@5.0.3) (2020-04-01) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.1...aws-amplify-angular@5.0.2) (2020-04-01) - -**Note:** Version bump only for package aws-amplify-angular - -## [5.0.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@4.1.9...aws-amplify-angular@5.0.1) (2020-03-31) - -### Bug Fixes - -- **aws-amplify-angular:** declare @aws-amplify/core as rollup external ([20a8bf8](https://github.com/aws-amplify/amplify-js/commit/20a8bf843b7284f0738763b2dcaac0f59d770ef3)) - -### Reverts - -- Revert "Publish" ([1319d31](https://github.com/aws-amplify/amplify-js/commit/1319d319b69717e76660fbfa6f1a845195c6d635)) - -## [4.1.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@4.1.8...aws-amplify-angular@4.1.9) (2020-03-30) - -**Note:** Version bump only for package aws-amplify-angular - -## [4.1.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@4.1.7...aws-amplify-angular@4.1.8) (2020-03-25) - -**Note:** Version bump only for package aws-amplify-angular - -## [4.1.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@4.1.6...aws-amplify-angular@4.1.7) (2020-02-28) - -**Note:** Version bump only for package aws-amplify-angular - -## [4.1.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@4.1.5...aws-amplify-angular@4.1.6) (2020-02-14) - -**Note:** Version bump only for package aws-amplify-angular - -## [4.1.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@4.1.3...aws-amplify-angular@4.1.5) (2020-02-07) - -### Bug Fixes - -- **aws-amplify-react) fix(aws-amplify-react-native) fix(aws-amplify-angular:** Fix peer dependencies ([#4647](https://github.com/aws-amplify/amplify-js/issues/4647)) ([c4c990e](https://github.com/aws-amplify/amplify-js/commit/c4c990ea62a77625add92e8fe94ba170b0dd2af1)) - -## [4.1.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@4.1.2...aws-amplify-angular@4.1.3) (2020-01-10) - -### Bug Fixes - -- correct Czech Republic phone country code ([#4694](https://github.com/aws-amplify/amplify-js/issues/4694)) ([9f8c7ed](https://github.com/aws-amplify/amplify-js/commit/9f8c7ed8515347bb4a5b6606202d85095406f7b9)) - -## [4.1.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@4.1.1...aws-amplify-angular@4.1.2) (2019-12-18) - -**Note:** Version bump only for package aws-amplify-angular - -## [4.1.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@4.1.0...aws-amplify-angular@4.1.1) (2019-12-03) - -**Note:** Version bump only for package aws-amplify-angular - -# [4.1.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.1.4...aws-amplify-angular@4.1.0) (2019-11-15) - -### Features - -- enable watch mode for builds ([#4358](https://github.com/aws-amplify/amplify-js/issues/4358)) ([055e530](https://github.com/aws-amplify/amplify-js/commit/055e5308efc308ae6beee78f8963bb2f812e1f85)) - -## [3.1.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.1.3...aws-amplify-angular@3.1.4) (2019-10-29) - -**Note:** Version bump only for package aws-amplify-angular - -## [3.1.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.1.2...aws-amplify-angular@3.1.3) (2019-10-23) - -**Note:** Version bump only for package aws-amplify-angular - -## [3.1.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.1.0...aws-amplify-angular@3.1.2) (2019-10-10) - -**Note:** Version bump only for package aws-amplify-angular - -# [3.1.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.15...aws-amplify-angular@3.1.0) (2019-10-10) - -### Features - -- Added Prettier formatting ([4dfd9aa](https://github.com/aws-amplify/amplify-js/commit/4dfd9aa9ab900307c9d17c68448a6ca4aa08fd5a)) - -## [3.0.15](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.13...aws-amplify-angular@3.0.15) (2019-09-13) - -**Note:** Version bump only for package aws-amplify-angular - -## [3.0.13](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.12...aws-amplify-angular@3.0.13) (2019-09-05) - -**Note:** Version bump only for package aws-amplify-angular - -## [3.0.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.11...aws-amplify-angular@3.0.12) (2019-09-04) - -**Note:** Version bump only for package aws-amplify-angular - -## [3.0.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.10...aws-amplify-angular@3.0.11) (2019-08-05) - -**Note:** Version bump only for package aws-amplify-angular - -## [3.0.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.9...aws-amplify-angular@3.0.10) (2019-08-01) - -**Note:** Version bump only for package aws-amplify-angular - -## [3.0.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.8...aws-amplify-angular@3.0.9) (2019-07-31) - -**Note:** Version bump only for package aws-amplify-angular - -## [3.0.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.7...aws-amplify-angular@3.0.8) (2019-07-30) - -**Note:** Version bump only for package aws-amplify-angular - -## [3.0.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.5...aws-amplify-angular@3.0.7) (2019-07-18) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.6-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.6-unstable.2...aws-amplify-angular@3.0.6-unstable.3) (2019-07-12) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.6-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.6-unstable.0...aws-amplify-angular@3.0.6-unstable.2) (2019-07-12) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.6-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.5...aws-amplify-angular@3.0.6-unstable.0) (2019-07-10) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.5-unstable.2...aws-amplify-angular@3.0.5) (2019-07-09) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.5-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.5-unstable.1...aws-amplify-angular@3.0.5-unstable.2) (2019-07-09) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.5-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.5-unstable.0...aws-amplify-angular@3.0.5-unstable.1) (2019-06-27) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.5-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.4...aws-amplify-angular@3.0.5-unstable.0) (2019-06-18) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.4-unstable.3...aws-amplify-angular@3.0.4) (2019-06-17) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.4-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.4-unstable.2...aws-amplify-angular@3.0.4-unstable.3) (2019-06-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.4-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.4-unstable.1...aws-amplify-angular@3.0.4-unstable.2) (2019-06-03) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.4-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.3...aws-amplify-angular@3.0.4-unstable.1) (2019-05-24) - -### Bug Fixes - -- **aws-amplify:** manual version bumps for lerna issue ([9ce5a72](https://github.com/aws-amplify/amplify-js/commit/9ce5a72)) - - - -## [3.0.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.3-unstable.4...aws-amplify-angular@3.0.3) (2019-05-14) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.3-unstable.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.3-unstable.3...aws-amplify-angular@3.0.3-unstable.4) (2019-05-14) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.3-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.3-unstable.2...aws-amplify-angular@3.0.3-unstable.3) (2019-05-13) - -### Bug Fixes - -- add a todo to the greeting object in order to adjust the Angular Greeting Component to match React, fix typo in requireNewPassword ([49eae14](https://github.com/aws-amplify/amplify-js/commit/49eae14)) - - - -## [3.0.3-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.3-unstable.1...aws-amplify-angular@3.0.3-unstable.2) (2019-05-13) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.3-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.3-unstable.0...aws-amplify-angular@3.0.3-unstable.1) (2019-05-10) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.3-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2...aws-amplify-angular@3.0.3-unstable.0) (2019-05-09) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.15...aws-amplify-angular@3.0.2) (2019-05-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.15](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.14...aws-amplify-angular@3.0.2-unstable.15) (2019-05-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.14](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.13...aws-amplify-angular@3.0.2-unstable.14) (2019-05-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.13](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.12...aws-amplify-angular@3.0.2-unstable.13) (2019-05-03) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.11...aws-amplify-angular@3.0.2-unstable.12) (2019-04-26) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.10...aws-amplify-angular@3.0.2-unstable.11) (2019-04-26) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.9...aws-amplify-angular@3.0.2-unstable.10) (2019-04-24) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.8...aws-amplify-angular@3.0.2-unstable.9) (2019-04-24) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.7...aws-amplify-angular@3.0.2-unstable.8) (2019-04-22) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.6...aws-amplify-angular@3.0.2-unstable.7) (2019-04-19) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.5...aws-amplify-angular@3.0.2-unstable.6) (2019-04-17) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.4...aws-amplify-angular@3.0.2-unstable.5) (2019-04-16) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.3...aws-amplify-angular@3.0.2-unstable.4) (2019-04-16) - -### Bug Fixes - -- **aws-amplify-angular:** clears error message on state change ([b19de01](https://github.com/aws-amplify/amplify-js/commit/b19de01)) - - - -## [3.0.2-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.2...aws-amplify-angular@3.0.2-unstable.3) (2019-04-15) - -### Bug Fixes - -- **aws-amplify-angular:** moves rxjs-compat to dependencies ([83e1cc2](https://github.com/aws-amplify/amplify-js/commit/83e1cc2)) - - - -## [3.0.2-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.1...aws-amplify-angular@3.0.2-unstable.2) (2019-04-15) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.2-unstable.0...aws-amplify-angular@3.0.2-unstable.1) (2019-04-12) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.2-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.1...aws-amplify-angular@3.0.2-unstable.0) (2019-04-12) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [3.0.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.0...aws-amplify-angular@3.0.1) (2019-04-11) - -### Bug Fixes - -- **aws-amplify-angular:** preparing release ([84f261a](https://github.com/aws-amplify/amplify-js/commit/84f261a)) - - - -# [3.0.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.0-unstable.2...aws-amplify-angular@3.0.0) (2019-04-11) - -**Note:** Version bump only for package aws-amplify-angular - - - -# [3.0.0-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@3.0.0-unstable.1...aws-amplify-angular@3.0.0-unstable.2) (2019-04-10) - -**Note:** Version bump only for package aws-amplify-angular - - - -# [3.0.0-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.13-unstable.0...aws-amplify-angular@3.0.0-unstable.1) (2019-04-09) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.13-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.12...aws-amplify-angular@2.1.13-unstable.0) (2019-04-09) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.12-unstable.3...aws-amplify-angular@2.1.12) (2019-04-09) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.12-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.12-unstable.2...aws-amplify-angular@2.1.12-unstable.3) (2019-04-08) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.12-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.12-unstable.1...aws-amplify-angular@2.1.12-unstable.2) (2019-04-08) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.12-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.12-unstable.0...aws-amplify-angular@2.1.12-unstable.1) (2019-04-07) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.12-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.11...aws-amplify-angular@2.1.12-unstable.0) (2019-04-05) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.11-unstable.1...aws-amplify-angular@2.1.11) (2019-04-04) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.11-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.11-unstable.0...aws-amplify-angular@2.1.11-unstable.1) (2019-04-04) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.11-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10...aws-amplify-angular@2.1.11-unstable.0) (2019-04-02) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.12...aws-amplify-angular@2.1.10) (2019-03-28) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.11...aws-amplify-angular@2.1.10-unstable.12) (2019-03-28) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.10...aws-amplify-angular@2.1.10-unstable.11) (2019-03-25) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.9...aws-amplify-angular@2.1.10-unstable.10) (2019-03-24) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.8...aws-amplify-angular@2.1.10-unstable.9) (2019-03-22) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.7...aws-amplify-angular@2.1.10-unstable.8) (2019-03-22) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.6...aws-amplify-angular@2.1.10-unstable.7) (2019-03-21) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.5...aws-amplify-angular@2.1.10-unstable.6) (2019-03-20) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.4...aws-amplify-angular@2.1.10-unstable.5) (2019-03-19) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.3...aws-amplify-angular@2.1.10-unstable.4) (2019-03-18) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.2...aws-amplify-angular@2.1.10-unstable.3) (2019-03-08) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.1...aws-amplify-angular@2.1.10-unstable.2) (2019-03-07) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.10-unstable.0...aws-amplify-angular@2.1.10-unstable.1) (2019-03-07) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.10-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.9...aws-amplify-angular@2.1.10-unstable.0) (2019-03-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.9-unstable.3...aws-amplify-angular@2.1.9) (2019-03-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.9-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.9-unstable.2...aws-amplify-angular@2.1.9-unstable.3) (2019-03-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.9-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.9-unstable.1...aws-amplify-angular@2.1.9-unstable.2) (2019-03-05) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.9-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.9-unstable.0...aws-amplify-angular@2.1.9-unstable.1) (2019-03-04) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.9-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.8...aws-amplify-angular@2.1.9-unstable.0) (2019-03-04) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7...aws-amplify-angular@2.1.8) (2019-03-04) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.16...aws-amplify-angular@2.1.7) (2019-03-04) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.16](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.15...aws-amplify-angular@2.1.7-unstable.16) (2019-03-04) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.15](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.14...aws-amplify-angular@2.1.7-unstable.15) (2019-03-04) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.14](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.13...aws-amplify-angular@2.1.7-unstable.14) (2019-03-01) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.13](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.12...aws-amplify-angular@2.1.7-unstable.13) (2019-02-28) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.11...aws-amplify-angular@2.1.7-unstable.12) (2019-02-27) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.10...aws-amplify-angular@2.1.7-unstable.11) (2019-02-27) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.9...aws-amplify-angular@2.1.7-unstable.10) (2019-02-27) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.8...aws-amplify-angular@2.1.7-unstable.9) (2019-02-20) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.7...aws-amplify-angular@2.1.7-unstable.8) (2019-02-11) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.6...aws-amplify-angular@2.1.7-unstable.7) (2019-01-22) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.5...aws-amplify-angular@2.1.7-unstable.6) (2019-01-21) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.4...aws-amplify-angular@2.1.7-unstable.5) (2019-01-21) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.3...aws-amplify-angular@2.1.7-unstable.4) (2019-01-18) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.2...aws-amplify-angular@2.1.7-unstable.3) (2019-01-17) - -### Bug Fixes - -- **@aws-amplify/aws-amplify-angular:** added labels for inputs in the forgot password component. ([38d44be](https://github.com/aws-amplify/amplify-js/commit/38d44be)) - - - -## [2.1.7-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.1...aws-amplify-angular@2.1.7-unstable.2) (2019-01-10) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.7-unstable.0...aws-amplify-angular@2.1.7-unstable.1) (2019-01-10) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.7-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.6...aws-amplify-angular@2.1.7-unstable.0) (2019-01-10) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.6-unstable.1...aws-amplify-angular@2.1.6) (2019-01-10) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.6-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.6-unstable.0...aws-amplify-angular@2.1.6-unstable.1) (2018-12-26) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.6-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.5...aws-amplify-angular@2.1.6-unstable.0) (2018-12-26) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.5-unstable.7...aws-amplify-angular@2.1.5) (2018-12-26) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.5-unstable.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.5-unstable.6...aws-amplify-angular@2.1.5-unstable.7) (2018-12-24) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.5-unstable.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.5-unstable.5...aws-amplify-angular@2.1.5-unstable.6) (2018-12-24) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.5-unstable.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.5-unstable.4...aws-amplify-angular@2.1.5-unstable.5) (2018-12-24) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.5-unstable.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.5-unstable.3...aws-amplify-angular@2.1.5-unstable.4) (2018-12-22) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.5-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.5-unstable.2...aws-amplify-angular@2.1.5-unstable.3) (2018-12-20) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.5-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.5-unstable.1...aws-amplify-angular@2.1.5-unstable.2) (2018-12-19) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.5-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.5-unstable.0...aws-amplify-angular@2.1.5-unstable.1) (2018-12-19) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.5-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.4...aws-amplify-angular@2.1.5-unstable.0) (2018-12-17) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.3-unstable.1...aws-amplify-angular@2.1.4) (2018-12-15) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.2...aws-amplify-angular@2.1.3) (2018-12-14) - - - -## [2.1.3-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.3-unstable.0...aws-amplify-angular@2.1.3-unstable.1) (2018-12-14) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.3-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.2...aws-amplify-angular@2.1.3-unstable.0) (2018-12-14) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.2-unstable.0...aws-amplify-angular@2.1.2) (2018-12-14) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.2-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.1...aws-amplify-angular@2.1.2-unstable.0) (2018-12-13) - -### Features - -- **@aws-amplify/interactions @aws-amplify/react @aws-amplify/react-native @aws-amplify/angular @aws-amplify/vue:** Update interactions to include voice ([#2121](https://github.com/aws-amplify/amplify-js/issues/2121)) ([938d2a5](https://github.com/aws-amplify/amplify-js/commit/938d2a5)) - - - -## [2.1.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.1-unstable.7...aws-amplify-angular@2.1.1) (2018-12-13) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.1-unstable.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.1-unstable.6...aws-amplify-angular@2.1.1-unstable.7) (2018-12-13) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.1-unstable.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.1-unstable.5...aws-amplify-angular@2.1.1-unstable.6) (2018-12-13) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.1-unstable.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.1-unstable.4...aws-amplify-angular@2.1.1-unstable.5) (2018-12-13) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.1-unstable.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.1-unstable.3...aws-amplify-angular@2.1.1-unstable.4) (2018-12-13) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.1-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.1-unstable.2...aws-amplify-angular@2.1.1-unstable.3) (2018-12-12) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.1-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.1-unstable.1...aws-amplify-angular@2.1.1-unstable.2) (2018-12-10) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.1-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.1-unstable.0...aws-amplify-angular@2.1.1-unstable.1) (2018-12-10) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.1-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.17-unstable.1...aws-amplify-angular@2.1.1-unstable.0) (2018-12-10) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.17-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.17-unstable.0...aws-amplify-angular@2.0.17-unstable.1) (2018-12-07) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.17-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.16...aws-amplify-angular@2.0.17-unstable.0) (2018-12-07) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.16](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.15...aws-amplify-angular@2.0.16) (2018-12-07) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.16-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.16-unstable.0...aws-amplify-angular@2.0.16-unstable.1) (2018-12-07) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.16-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.15...aws-amplify-angular@2.0.16-unstable.0) (2018-12-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.15](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14...aws-amplify-angular@2.0.15) (2018-12-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.15-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14...aws-amplify-angular@2.0.15-unstable.0) (2018-12-05) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.17...aws-amplify-angular@2.0.14) (2018-12-03) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.17](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.16...aws-amplify-angular@2.0.14-unstable.17) (2018-12-03) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.16](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.15...aws-amplify-angular@2.0.14-unstable.16) (2018-12-03) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.15](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.14...aws-amplify-angular@2.0.14-unstable.15) (2018-11-30) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.14](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.13...aws-amplify-angular@2.0.14-unstable.14) (2018-11-29) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.13](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.12...aws-amplify-angular@2.0.14-unstable.13) (2018-11-29) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.11...aws-amplify-angular@2.0.14-unstable.12) (2018-11-27) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.10...aws-amplify-angular@2.0.14-unstable.11) (2018-11-26) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.9...aws-amplify-angular@2.0.14-unstable.10) (2018-11-23) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.8...aws-amplify-angular@2.0.14-unstable.9) (2018-11-21) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.7...aws-amplify-angular@2.0.14-unstable.8) (2018-11-20) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.1.1-beta.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.1.1-beta.1...aws-amplify-angular@2.1.1-beta.2) (2018-11-19) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.6...aws-amplify-angular@2.0.14-unstable.7) (2018-11-19) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.5...aws-amplify-angular@2.0.14-unstable.6) (2018-11-19) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.4...aws-amplify-angular@2.0.14-unstable.5) (2018-11-19) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.3...aws-amplify-angular@2.0.14-unstable.4) (2018-11-17) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.2...aws-amplify-angular@2.0.14-unstable.3) (2018-11-16) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.1...aws-amplify-angular@2.0.14-unstable.2) (2018-11-16) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.14-unstable.0...aws-amplify-angular@2.0.14-unstable.1) (2018-11-15) - - - -## [2.1.1-beta.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.13-unstable.6...aws-amplify-angular@2.1.1-beta.1) (2018-11-14) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.14-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.13...aws-amplify-angular@2.0.14-unstable.0) (2018-11-13) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.13](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.13-unstable.6...aws-amplify-angular@2.0.13) (2018-11-12) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.13-unstable.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.13-unstable.5...aws-amplify-angular@2.0.13-unstable.6) (2018-11-12) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.13-unstable.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.13-unstable.4...aws-amplify-angular@2.0.13-unstable.5) (2018-11-10) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.13-unstable.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.13-unstable.3...aws-amplify-angular@2.0.13-unstable.4) (2018-11-09) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.13-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.13-unstable.2...aws-amplify-angular@2.0.13-unstable.3) (2018-11-09) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.13-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.13-unstable.1...aws-amplify-angular@2.0.13-unstable.2) (2018-11-09) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.13-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.13-unstable.0...aws-amplify-angular@2.0.13-unstable.1) (2018-11-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.13-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.12...aws-amplify-angular@2.0.13-unstable.0) (2018-11-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.12-unstable.4...aws-amplify-angular@2.0.12) (2018-11-01) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.12-unstable.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.12-unstable.3...aws-amplify-angular@2.0.12-unstable.4) (2018-11-01) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.12-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.12-unstable.2...aws-amplify-angular@2.0.12-unstable.3) (2018-10-30) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.12-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.12-unstable.1...aws-amplify-angular@2.0.12-unstable.2) (2018-10-30) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.12-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.12-unstable.0...aws-amplify-angular@2.0.12-unstable.1) (2018-10-30) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.12-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.11...aws-amplify-angular@2.0.12-unstable.0) (2018-10-30) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.11-unstable.3...aws-amplify-angular@2.0.11) (2018-10-29) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.11-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.11-unstable.2...aws-amplify-angular@2.0.11-unstable.3) (2018-10-29) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.11-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.11-unstable.1...aws-amplify-angular@2.0.11-unstable.2) (2018-10-29) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.11-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.11-unstable.0...aws-amplify-angular@2.0.11-unstable.1) (2018-10-18) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.11-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.10...aws-amplify-angular@2.0.11-unstable.0) (2018-10-18) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.10-unstable.4...aws-amplify-angular@2.0.10) (2018-10-17) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.10-unstable.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.10-unstable.3...aws-amplify-angular@2.0.10-unstable.4) (2018-10-17) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.10-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.10-unstable.2...aws-amplify-angular@2.0.10-unstable.3) (2018-10-16) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.10-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.10-unstable.1...aws-amplify-angular@2.0.10-unstable.2) (2018-10-08) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.10-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.10-unstable.0...aws-amplify-angular@2.0.10-unstable.1) (2018-10-05) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.10-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.9-unstable.2...aws-amplify-angular@2.0.10-unstable.0) (2018-10-05) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.9-unstable.2...aws-amplify-angular@2.0.9) (2018-10-04) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.9-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.9-unstable.1...aws-amplify-angular@2.0.9-unstable.2) (2018-10-03) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.9-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.9-unstable.0...aws-amplify-angular@2.0.9-unstable.1) (2018-10-03) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.9-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.8-unstable.7...aws-amplify-angular@2.0.9-unstable.0) (2018-10-03) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.8](https://github.com/powerful23/aws-amplify/compare/aws-amplify-angular@2.0.8-unstable.7...aws-amplify-angular@2.0.8) (2018-10-03) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.8-unstable.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.8-unstable.6...aws-amplify-angular@2.0.8-unstable.7) (2018-10-02) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.8-unstable.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.8-unstable.5...aws-amplify-angular@2.0.8-unstable.6) (2018-10-01) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.8-unstable.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.8-unstable.4...aws-amplify-angular@2.0.8-unstable.5) (2018-10-01) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.8-unstable.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.8-unstable.3...aws-amplify-angular@2.0.8-unstable.4) (2018-10-01) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.8-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.8-unstable.2...aws-amplify-angular@2.0.8-unstable.3) (2018-09-28) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.8-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.8-unstable.1...aws-amplify-angular@2.0.8-unstable.2) (2018-09-27) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.8-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.8-unstable.0...aws-amplify-angular@2.0.8-unstable.1) (2018-09-27) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.8-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.7...aws-amplify-angular@2.0.8-unstable.0) (2018-09-27) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.7-unstable.9...aws-amplify-angular@2.0.7) (2018-09-27) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.7-unstable.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.7-unstable.8...aws-amplify-angular@2.0.7-unstable.9) (2018-09-26) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.7-unstable.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.7-unstable.7...aws-amplify-angular@2.0.7-unstable.8) (2018-09-26) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.7-unstable.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.7-unstable.6...aws-amplify-angular@2.0.7-unstable.7) (2018-09-26) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.7-unstable.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.7-unstable.4...aws-amplify-angular@2.0.7-unstable.6) (2018-09-26) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.7-unstable.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.7-unstable.4...aws-amplify-angular@2.0.7-unstable.5) (2018-09-25) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.7-unstable.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.7-unstable.3...aws-amplify-angular@2.0.7-unstable.4) (2018-09-25) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.7-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.7-unstable.2...aws-amplify-angular@2.0.7-unstable.3) (2018-09-24) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.7-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.7-unstable.1...aws-amplify-angular@2.0.7-unstable.2) (2018-09-22) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.7-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.7-unstable.0...aws-amplify-angular@2.0.7-unstable.1) (2018-09-22) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.7-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.6...aws-amplify-angular@2.0.7-unstable.0) (2018-09-22) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.6-unstable.0...aws-amplify-angular@2.0.6) (2018-09-21) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.6-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.5-unstable.3...aws-amplify-angular@2.0.6-unstable.0) (2018-09-21) - -### Bug Fixes - -- bumping version for deploying on unstable tag ([#1706](https://github.com/aws-amplify/amplify-js/issues/1706)) ([b5d6468](https://github.com/aws-amplify/amplify-js/commit/b5d6468)) - - - -## [2.0.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.4...aws-amplify-angular@2.0.5) (2018-09-21) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.5-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.5-unstable.2...aws-amplify-angular@2.0.5-unstable.3) (2018-09-20) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.5-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.5-unstable.1...aws-amplify-angular@2.0.5-unstable.2) (2018-09-20) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.5-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.5-unstable.0...aws-amplify-angular@2.0.5-unstable.1) (2018-09-17) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.5-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.4...aws-amplify-angular@2.0.5-unstable.0) (2018-09-17) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.3...aws-amplify-angular@2.0.4) (2018-09-17) - -### Bug Fixes - -- **aws-amplify-angular:** authState visibility issues on initial load ([#1657](https://github.com/aws-amplify/amplify-js/issues/1657)) ([50611fe](https://github.com/aws-amplify/amplify-js/commit/50611fe)) - - - -## [2.0.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.2...aws-amplify-angular@2.0.3) (2018-09-12) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.2-unstable.0...aws-amplify-angular@2.0.2) (2018-09-09) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.2-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.1...aws-amplify-angular@2.0.2-unstable.0) (2018-09-09) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.1-unstable.2...aws-amplify-angular@2.0.1) (2018-09-09) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.1-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.0...aws-amplify-angular@2.0.1-unstable.2) (2018-09-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [2.0.1-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@2.0.0...aws-amplify-angular@2.0.1-unstable.1) (2018-08-30) - -**Note:** Version bump only for package aws-amplify-angular - - - -# [2.0.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@1.0.4-unstable.3...aws-amplify-angular@2.0.0) (2018-08-28) - -### Features - -- UI Components ([1ff1abd](https://github.com/aws-amplify/amplify-js/commit/1ff1abd)) - -### BREAKING CHANGES - -- UI Components - - - -## [1.0.4-unstable.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@1.0.4-unstable.2...aws-amplify-angular@1.0.4-unstable.3) (2018-08-28) - -- Amplify ui migration (#1517) ([41d3184](https://github.com/aws-amplify/amplify-js/commit/41d3184)), closes [#1517](https://github.com/aws-amplify/amplify-js/issues/1517) - -### BREAKING CHANGES - -- UI Components - - - -## [1.0.4-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@1.0.4-unstable.1...aws-amplify-angular@1.0.4-unstable.2) (2018-08-23) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [1.0.4-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@1.0.4-unstable.0...aws-amplify-angular@1.0.4-unstable.1) (2018-08-20) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [1.0.4-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@1.0.3...aws-amplify-angular@1.0.4-unstable.0) (2018-08-19) - -### Bug Fixes - -- **aws-amplify-angular:** Angular rollup ([#1441](https://github.com/aws-amplify/amplify-js/issues/1441)) ([eb84e01](https://github.com/aws-amplify/amplify-js/commit/eb84e01)) - - - -## [1.0.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@1.0.2-unstable.2...aws-amplify-angular@1.0.3) (2018-08-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [1.0.2-unstable.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@1.0.2...aws-amplify-angular@1.0.2-unstable.2) (2018-08-06) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [1.0.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@1.0.2-unstable.1...aws-amplify-angular@1.0.2) (2018-07-28) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [1.0.2-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@1.0.2-unstable.0...aws-amplify-angular@1.0.2-unstable.1) (2018-07-24) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [1.0.2-unstable.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@1.0.1...aws-amplify-angular@1.0.2-unstable.0) (2018-07-20) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [1.0.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@1.0.1-unstable.1...aws-amplify-angular@1.0.1) (2018-07-18) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [1.0.1-unstable.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@1.0.1...aws-amplify-angular@1.0.1-unstable.1) (2018-07-18) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [1.0.1-unstable.0](https://github.com/powerful23/aws-amplify/compare/aws-amplify-angular@1.0.1...aws-amplify-angular@1.0.1-unstable.0) (2018-07-18) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [0.1.6](https://github.com/aws/aws-amplify/compare/aws-amplify-angular@0.1.5-unstable.0...aws-amplify-angular@0.1.6) (2018-06-21) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [0.1.5](https://github.com/aws/aws-amplify/compare/aws-amplify-angular@0.1.4...aws-amplify-angular@0.1.5) (2018-06-20) - - - -## [0.1.5-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-angular@0.1.4...aws-amplify-angular@0.1.5-unstable.0) (2018-06-20) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [0.1.4](https://github.com/aws/aws-amplify/compare/aws-amplify-angular@0.1.3...aws-amplify-angular@0.1.4) (2018-06-04) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [0.1.3](https://github.com/aws/aws-amplify/compare/aws-amplify-angular@0.1.3-unstable.1...aws-amplify-angular@0.1.3) (2018-06-01) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [0.1.3-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-angular@0.1.2-unstable.4...aws-amplify-angular@0.1.3-unstable.1) (2018-06-01) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [0.1.2-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-angular@0.1.2-unstable.3...aws-amplify-angular@0.1.2-unstable.4) (2018-05-30) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [0.1.2-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-angular@0.1.1...aws-amplify-angular@0.1.2-unstable.3) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-angular - - - -## [0.1.2-unstable.2](https://github.com/mlabieniec/aws-amplify/compare/aws-amplify-angular@0.1.2-unstable.1...aws-amplify-angular@0.1.2-unstable.2) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-angular - -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. diff --git a/packages/aws-amplify-angular/LICENSE b/packages/aws-amplify-angular/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/packages/aws-amplify-angular/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/aws-amplify-angular/README.md b/packages/aws-amplify-angular/README.md deleted file mode 100644 index 589c9aed1a5..00000000000 --- a/packages/aws-amplify-angular/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# AWS Amplify Package - aws-amplify-angular - -AWS Amplify is a JavaScript library for frontend and mobile developers building cloud-enabled applications. The library is a declarative interface across different categories of operations in order to make common tasks easier to add into your application. The default implementation works with Amazon Web Services (AWS) resources but is designed to be open and pluggable for usage with other cloud services that wish to provide an implementation or custom backends. - -`aws-amplify-angular` is one of the AWS Amplify library packages, provide building blocks for Angular App development. Documentation is available [here](https://aws-amplify.github.io/docs/js/angular) diff --git a/packages/aws-amplify-angular/declarations/tsconfig.json b/packages/aws-amplify-angular/declarations/tsconfig.json deleted file mode 100644 index c1d70a635ec..00000000000 --- a/packages/aws-amplify-angular/declarations/tsconfig.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "../", - "emitDeclarationOnly": true, - "declaration": true, - "stripInternal": true, - "experimentalDecorators": true, - "strictNullChecks": false, - "noImplicitAny": false, - "module": "es2015", - "moduleResolution": "node", - "paths": { - "@angular/core": ["node_modules/@angular/core"], - "rxjs/*": ["node_modules/rxjs/*"] - }, - "rootDir": "../", - "outDir": "../dist", - "sourceMap": true, - "inlineSources": true, - "target": "es5", - "skipLibCheck": true, - "lib": [ - "es2015", - "dom" - ] - }, - "files": [ - "../index.ts" - ], - "angularCompilerOptions": { - "strictMetadataEmit": true - } -} \ No newline at end of file diff --git a/packages/aws-amplify-angular/index.ts b/packages/aws-amplify-angular/index.ts deleted file mode 100644 index 9ab6650b2e3..00000000000 --- a/packages/aws-amplify-angular/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { AmplifyAngularModule } from './src/aws-amplify-angular.module'; -export { AmplifyIonicModule } from './src/aws-amplify-ionic-module'; -export { AmplifyService, AmplifyModules } from './src/providers'; - -console.warn( - '`aws-amplify-angular` has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for more info on Amplify UI.' -); diff --git a/packages/aws-amplify-angular/ionic.css b/packages/aws-amplify-angular/ionic.css deleted file mode 100644 index a3e7d960906..00000000000 --- a/packages/aws-amplify-angular/ionic.css +++ /dev/null @@ -1,2 +0,0 @@ -@import "~@aws-amplify/ui/src/Theme.css"; -@import "~@aws-amplify/ui/src/Angular.css"; diff --git a/packages/aws-amplify-angular/jest.config.js b/packages/aws-amplify-angular/jest.config.js deleted file mode 100644 index 85dbae0998d..00000000000 --- a/packages/aws-amplify-angular/jest.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - preset: 'jest-preset-angular', - roots: ['src'], - setupFilesAfterEnv: ['/test_setup/setup-jest.ts'], - testURL: 'http://localhost/', -}; diff --git a/packages/aws-amplify-angular/package.json b/packages/aws-amplify-angular/package.json deleted file mode 100644 index 8d28866a558..00000000000 --- a/packages/aws-amplify-angular/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "aws-amplify-angular", - "private": "true", - "version": "6.0.61", - "description": "AWS Amplify Angular Components", - "main": "bundles/aws-amplify-angular.umd.js", - "module": "dist/index.js", - "typings": "dist/index.d.ts", - "scripts": { - "cleantemp": "rimraf coverage dist tmp docs", - "ngcompile": "node_modules/.bin/ngc -p tsconfig-aot.json", - "test": "jest -w 1 --maxWorkers 2", - "transpile": "ngc", - "package": "rollup -c rollup.config.js", - "minify": "uglifyjs dist/bundles/aws-amplify-angular.umd.js --compress --mangle --comments --output dist/bundles/aws-amplify-angular.umd.min.js", - "build": "npm run transpile && npm run package && npm run minify && npm run declarations", - "build:esm:watch": "ngc --watch", - "build:cjs:watch": "echo \"CommonJS modules are not exported in angular. Use target build:esm:watch\"", - "format": "echo \"Not implemented\"", - "declarations": "ngc --p ./declarations/" - }, - "jest": { - "transformIgnorePatterns": [ - "node_modules/(?!@ionic)" - ] - }, - "author": "Amazon Web Services", - "license": "Apache-2.0", - "devDependencies": { - "@angular/common": "^5.2.6", - "@angular/compiler": "^5.2.9", - "@angular/compiler-cli": "^5.2.9", - "@angular/core": "^5.2.6", - "@angular/forms": "^6.0.3", - "@angular/platform-browser": "^5.2.9", - "@angular/platform-browser-dynamic": "^5.2.9", - "@types/node": "^9.4.6", - "@types/paho-mqtt": "^1.0.3", - "@types/zen-observable": "^0.5.3", - "angular2-template-loader": "^0.6.2", - "awesome-typescript-loader": "^4.0.1", - "aws-amplify": "4.3.43", - "babel-core": "^6.26.3", - "babel-plugin-lodash": "^3.3.4", - "babel-preset-env": "^1.7.0", - "babel-preset-es2015": "^6.24.1", - "css-loader": "^0.28.1", - "jest-preset-angular": "^7.1.1", - "json-loader": "^0.5.4", - "ng-mocks": "7.x.x", - "raw-loader": "^0.5.1", - "rimraf": "^2.6.1", - "rollup": "^1.31.0", - "rollup-plugin-analyzer": "^3.2.2", - "rollup-plugin-angular-aot": "^0.0.4", - "rollup-plugin-babel": "^4.3.3", - "rollup-plugin-commonjs": "^10.1.0", - "rollup-plugin-json": "^4.0.0", - "rollup-plugin-multi-entry": "^2.1.0", - "rollup-plugin-node-globals": "^1.4.0", - "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-uglify": "^6.0.4", - "rxjs": "^6.2.1", - "source-map-explorer": "^1.3.3", - "to-string-loader": "^1.1.5", - "uglify-js": "^3.9.4", - "zone.js": "^0.8.26" - }, - "dependencies": { - "@aws-amplify/ui": "2.0.7", - "rxjs-compat": "^6.2.1" - }, - "peerDependencies": { - "aws-amplify": "3.x.x" - } -} diff --git a/packages/aws-amplify-angular/rollup.config.js b/packages/aws-amplify-angular/rollup.config.js deleted file mode 100644 index 9af1e75161d..00000000000 --- a/packages/aws-amplify-angular/rollup.config.js +++ /dev/null @@ -1,46 +0,0 @@ -import commonjs from 'rollup-plugin-commonjs'; -import nodeResolve from 'rollup-plugin-node-resolve'; -import angular from 'rollup-plugin-angular-aot'; -import globals from 'rollup-plugin-node-globals'; -import { plugin as analyze } from 'rollup-plugin-analyzer'; -import { uglify } from 'rollup-plugin-uglify'; -import json from 'rollup-plugin-json'; - -export default { - input: 'dist/index.js', - output: { - name: 'aws-amplify-angular', - file: 'dist/bundles/aws-amplify-angular.umd.js', - format: 'umd', - globals: { - lodash: '_', - '@ionic/angular': 'IonicModule', - 'aws-amplify': 'Amplify', - '@angular/core': 'ng.core', - '@angular/common': 'ng.common', - 'rxjs/Observable': 'Rx', - 'rxjs/Subscription': 'Rx', - 'rxjs/ReplaySubject': 'Rx', - 'rxjs/add/operator/map': 'Rx.Observable.prototype', - 'rxjs/add/operator/mergeMap': 'Rx.Observable.prototype', - 'rxjs/add/observable/fromEvent': 'Rx.Observable', - 'rxjs/add/observable/of': 'Rx.Observable', - }, - }, - external: [ - 'aws-sdk', - '@angular/core', - '@angular/common', - 'aws-amplify', - '@ionic/angular', - '@aws-amplify/core', - ], - plugins: [ - nodeResolve({ preferBuiltins: false, modulesOnly: true }), - commonjs({ include: 'node_modules/**' }), - globals(), - json(), - uglify(), - analyze({ limit: 1 }), - ], -}; diff --git a/packages/aws-amplify-angular/src/__mocks__/mock_module.ts b/packages/aws-amplify-angular/src/__mocks__/mock_module.ts deleted file mode 100644 index be846916dbf..00000000000 --- a/packages/aws-amplify-angular/src/__mocks__/mock_module.ts +++ /dev/null @@ -1,79 +0,0 @@ -const authModule = { - Auth: { - signIn: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - signUp: () => { - return new Promise((resolve, reject) => { - resolve({ username: 'fakename' }); - }); - }, - confirmSignIn: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - confirmSignUp: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - completeNewPassword: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - forgotPassword: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - forgotPasswordSubmit: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - signOut: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - currentAuthenticatedUser: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - setAuthState: () => { - return 1; - }, - }, -}; - -const interactionsModule = { - Interactions: { - onComplete: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - send: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - }, -}; - -const storageModule = { - Storage: { - put: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - }, -}; - -export { authModule, interactionsModule, storageModule }; diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/authenticator.component.core.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/authenticator.component.core.spec.ts deleted file mode 100644 index 23c334fd58e..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/authenticator.component.core.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Component } from '@angular/core'; -import { ComponentFixture, TestBed, async } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import Amplify from 'aws-amplify'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthenticatorComponentCore } from '../../../components/authenticator/authenticator/authenticator.component.core'; - -describe('AuthenticatorComponentCore: ', () => { - let component: AuthenticatorComponentCore; - let service: AmplifyService; - - beforeEach(() => { - service = new AmplifyService(Amplify); - component = new AuthenticatorComponentCore(service); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have a subscribe method', () => { - expect(component.subscribe).toBeTruthy(); - }); - - it('...should have a shouldHide method', () => { - expect(component.shouldHide).toBeTruthy(); - }); - - it('...the shouldHide method should return false when receiving a value not in the hide array', () => { - component.hide = ['value one', 'value two']; - expect(component.shouldHide('value three')).toEqual(false); - }); - - it('...the shouldHide method should return true when receiving a value in the hide array', () => { - component.hide = ['value one', 'value two']; - expect(component.shouldHide('value two')).toEqual(true); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/authenticator.component.ionic.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/authenticator.component.ionic.spec.ts deleted file mode 100644 index 1bc769dc57a..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/authenticator.component.ionic.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Component } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -import { AuthenticatorIonicComponent } from '../../../components/authenticator/authenticator/authenticator.component.ionic'; - -describe('AuthenticatorIonicComponent: ', () => { - let component: AuthenticatorIonicComponent; - let service: AmplifyService; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new AuthenticatorIonicComponent(service); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have a subscribe method', () => { - expect(component.subscribe).toBeTruthy(); - }); - - it('...should have a shouldHide method', () => { - expect(component.shouldHide).toBeTruthy(); - }); - - it('...the shouldHide method should return false when receiving a value not in the hide array', () => { - component.hide = ['value one', 'value two']; - expect(component.shouldHide('value three')).toEqual(false); - }); - - it('...the shouldHide method should return true when receiving a value in the hide array', () => { - component.hide = ['value one', 'value two']; - expect(component.shouldHide('value two')).toEqual(true); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/confirm-sign-in.component.core.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/confirm-sign-in.component.core.spec.ts deleted file mode 100644 index acb146aadc6..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/confirm-sign-in.component.core.spec.ts +++ /dev/null @@ -1,135 +0,0 @@ -import { Component } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { AmplifyAngularModule } from '../../../aws-amplify-angular.module'; -import { authModule } from '../../../__mocks__/mock_module'; -import { ConfirmSignInComponentCore } from '../../../components/authenticator/confirm-sign-in-component/confirm-sign-in-component.core'; - -describe('ConfirmSignInComponentCore: ', () => { - let component: ConfirmSignInComponentCore; - let fixtureComponent: ConfirmSignInComponentCore; - let service: AmplifyService; - let fixture; - let setAuthStateSpy; - let confirmSignInSpy; - let onConfirmSpy; - let onSignInSpy; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new ConfirmSignInComponentCore(service); - setAuthStateSpy = jest.spyOn(service, 'setAuthState'); - confirmSignInSpy = jest.spyOn(service.auth(), 'confirmSignIn'); - TestBed.configureTestingModule({ - declarations: [ConfirmSignInComponentCore], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(ConfirmSignInComponentCore); - fixtureComponent = fixture.componentInstance; - onConfirmSpy = jest.spyOn(fixtureComponent, 'onConfirm'); - onSignInSpy = jest.spyOn(fixtureComponent, 'onSignIn'); - }); - - afterEach(() => { - service = null; - component = null; - fixtureComponent = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have a setCode method', () => { - expect(component.setCode).toBeTruthy(); - }); - - it('...should have a code property that is initally undefined', () => { - expect(component.code).toBeUndefined(); - }); - - it("...the setCode method should set the component's code property", () => { - component.setCode('200'); - expect(component.code).toEqual('200'); - }); - - it('...should have an onConfirm method', () => { - expect(component.onConfirm).toBeTruthy(); - }); - - it('...should call confirmSignIn within the onConfirm method', () => { - component._authState = { - user: { challengeName: 'test-challange-name' }, - state: 'test-state', - }; - const callingAuthState = component.onConfirm(); - expect(service.auth().confirmSignIn).toBeCalled(); - }); - - it('...should have an onSignIn method', () => { - expect(component.onSignIn).toBeTruthy(); - }); - - it('...should call setAuthState within the onSignIn method', () => { - const callingAuthState = component.onSignIn(); - expect(service.setAuthState).toBeCalled(); - }); - - it('...should have a _setError method', () => { - expect(component._setError).toBeTruthy(); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-container' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-container' - ); - expect(rootEl).toBeTruthy(); - }); - - it('...should call onConfirm when button is clicked', () => { - fixtureComponent._show = true; - fixtureComponent._authState = { - state: 'confirmSignIn', - user: {}, - }; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-button' - ); - button.click(); - expect(onConfirmSpy).toHaveBeenCalled(); - expect(confirmSignInSpy).toHaveBeenCalled(); - }); - - it('...should call onSignIn when "a" tag is clicked', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const a = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-link' - ); - a.click(); - expect(onSignInSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/confirm-sign-in.component.ionic.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/confirm-sign-in.component.ionic.spec.ts deleted file mode 100644 index 962cf2df61b..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/confirm-sign-in.component.ionic.spec.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; - -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { AmplifyAngularModule } from '../../../aws-amplify-angular.module'; -import { authModule } from '../../../__mocks__/mock_module'; -import { ConfirmSignInComponentIonic } from '../../../components/authenticator/confirm-sign-in-component/confirm-sign-in-component.ionic'; - -describe('ConfirmSignInComponentIonic: ', () => { - let component: ConfirmSignInComponentIonic; - let fixtureComponent: ConfirmSignInComponentIonic; - let service: AmplifyService; - let fixture; - let setAuthStateSpy; - let confirmSignInSpy; - let onConfirmSpy; - let onSignInSpy; - - const modules = { - Auth: { - confirmSignIn: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - currentAuthenticatedUser: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - setAuthState: () => { - return new Promise((resolve, reject) => { - resolve(1); - }); - }, - }, - }; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new ConfirmSignInComponentIonic(service); - setAuthStateSpy = jest.spyOn(service, 'setAuthState'); - confirmSignInSpy = jest.spyOn(service.auth(), 'confirmSignIn'); - TestBed.configureTestingModule({ - declarations: [ConfirmSignInComponentIonic], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(ConfirmSignInComponentIonic); - fixtureComponent = fixture.componentInstance; - onConfirmSpy = jest.spyOn(fixtureComponent, 'onConfirm'); - onSignInSpy = jest.spyOn(fixtureComponent, 'onSignIn'); - }); - - afterEach(() => { - service = null; - component = null; - fixtureComponent = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have a setCode method', () => { - expect(component.setCode).toBeTruthy(); - }); - - it('...should have a code property that is initally undefined', () => { - expect(component.code).toBeUndefined(); - }); - - it("...the setCode method should set the component's code property", () => { - component.setCode('200'); - expect(component.code).toEqual('200'); - }); - - it('...should have an onConfirm method', () => { - expect(component.onConfirm).toBeTruthy(); - }); - - it('...should call confirmSignIn within the onConfirm method', () => { - component._authState = { - user: { challengeName: 'test-challange-name' }, - state: 'test-state', - }; - const callingAuthState = component.onConfirm(); - expect(service.auth().confirmSignIn).toBeCalled(); - }); - - it('...should have an onSignIn method', () => { - expect(component.onSignIn).toBeTruthy(); - }); - - it('...should call setAuthState within the onSignIn method', () => { - const callingAuthState = component.onSignIn(); - expect(service.setAuthState).toBeCalled(); - }); - - it('...should have a _setError method', () => { - expect(component._setError).toBeTruthy(); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-container' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-container' - ); - expect(rootEl).toBeTruthy(); - }); - - it('...should call onConfirm when button is clicked', () => { - fixtureComponent._show = true; - fixtureComponent._authState = { - state: 'confirmSignIn', - user: {}, - }; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector( - 'ion-button' - ); - button.click(); - expect(onConfirmSpy).toHaveBeenCalled(); - expect(confirmSignInSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/confirm-sign-up.component.core.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/confirm-sign-up.component.core.spec.ts deleted file mode 100644 index 19ca281954e..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/confirm-sign-up.component.core.spec.ts +++ /dev/null @@ -1,114 +0,0 @@ -import { Component } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -import { ConfirmSignUpComponentCore } from '../../../components/authenticator/confirm-sign-up-component/confirm-sign-up.component.core'; - -describe('ConfirmSignUpComponentCore: ', () => { - let component: ConfirmSignUpComponentCore; - let fixtureComponent: ConfirmSignUpComponentCore; - let service: AmplifyService; - let fixture; - let onSignInSpy; - let onConfirmSpy; - let confirmSignUpSpy; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new ConfirmSignUpComponentCore(service); - TestBed.configureTestingModule({ - declarations: [ConfirmSignUpComponentCore], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(ConfirmSignUpComponentCore); - fixtureComponent = fixture.componentInstance; - confirmSignUpSpy = jest.spyOn(service.auth(), 'confirmSignUp'); - onConfirmSpy = jest.spyOn(fixtureComponent, 'onConfirm'); - onSignInSpy = jest.spyOn(fixtureComponent, 'onSignIn'); - }); - - afterEach(() => { - service = null; - component = null; - fixtureComponent = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have an onConfirm method', () => { - expect(component.onConfirm).toBeTruthy(); - }); - - it('...should have an onResend method', () => { - expect(component.onResend).toBeTruthy(); - }); - - it('...should have an onSignIn method', () => { - expect(component.onSignIn).toBeTruthy(); - }); - - it('...should have an setCode method', () => { - expect(component.setCode).toBeTruthy(); - }); - - it('...should have an setUsername method', () => { - expect(component.setUsername).toBeTruthy(); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-container' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-container' - ); - expect(rootEl).toBeTruthy(); - }); - - it('...should call onConfirm when button is clicked', () => { - fixtureComponent._show = true; - fixtureComponent._authState = { - state: 'confirmSignIn', - user: {}, - }; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-button' - ); - button.click(); - expect(onConfirmSpy).toHaveBeenCalled(); - expect(confirmSignUpSpy).toHaveBeenCalled(); - }); - - it('...should call onSignIn when "a" tag is clicked', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const parent = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-actions-left' - ); - const a = parent.querySelector('.amplify-form-link'); - a.click(); - expect(onSignInSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/confirm-sign-up.component.ionic.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/confirm-sign-up.component.ionic.spec.ts deleted file mode 100644 index 537278223e5..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/confirm-sign-up.component.ionic.spec.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -import { ConfirmSignUpComponentIonic } from '../../../components/authenticator/confirm-sign-up-component/confirm-sign-up.component.ionic'; - -describe('ConfirmSignUpComponentIonic: ', () => { - let component: ConfirmSignUpComponentIonic; - let fixtureComponent: ConfirmSignUpComponentIonic; - let service: AmplifyService; - let fixture; - let onSignInSpy; - let onConfirmSpy; - let confirmSignUpSpy; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new ConfirmSignUpComponentIonic(service); - TestBed.configureTestingModule({ - declarations: [ConfirmSignUpComponentIonic], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(ConfirmSignUpComponentIonic); - fixtureComponent = fixture.componentInstance; - confirmSignUpSpy = jest.spyOn(service.auth(), 'confirmSignUp'); - onConfirmSpy = jest.spyOn(fixtureComponent, 'onConfirm'); - onSignInSpy = jest.spyOn(fixtureComponent, 'onSignIn'); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have an onConfirm method', () => { - expect(component.onConfirm).toBeTruthy(); - }); - - it('...should have an onResend method', () => { - expect(component.onResend).toBeTruthy(); - }); - - it('...should have an onSignIn method', () => { - expect(component.onSignIn).toBeTruthy(); - }); - - it('...should have an setCode method', () => { - expect(component.setCode).toBeTruthy(); - }); - - it('...should have an setUsername method', () => { - expect(component.setUsername).toBeTruthy(); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-authenticator-ionic' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-authenticator-ionic' - ); - expect(rootEl).toBeTruthy(); - }); - - it('...should call onConfirm when ion-button is clicked', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector( - 'ion-button' - ); - button.click(); - expect(onConfirmSpy).toHaveBeenCalled(); - expect(confirmSignUpSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/forgot-password.component.core.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/forgot-password.component.core.spec.ts deleted file mode 100644 index a42651727aa..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/forgot-password.component.core.spec.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { Component } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormsModule } from '@angular/forms'; -import { MockComponent } from 'ng-mocks'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -import { ForgotPasswordComponentCore } from '../../../components/authenticator/forgot-password-component/forgot-password.component.core'; -import { UsernameFieldComponentCore } from '../../../components/authenticator/username-field-component/username-field.component.core'; - -describe('ForgotPasswordComponentCore: ', () => { - let component: ForgotPasswordComponentCore; - let fixtureComponent: ForgotPasswordComponentCore; - let service: AmplifyService; - let fixture; - let onSubmitSpy; - let onSendSpy; - let forgotPasswordSpy; - let forgotPasswordSubmitSpy; - let onSignInSpy; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new ForgotPasswordComponentCore(service); - TestBed.configureTestingModule({ - declarations: [ - ForgotPasswordComponentCore, - MockComponent(UsernameFieldComponentCore), - ], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - imports: [FormsModule], - }).compileComponents(); - fixture = TestBed.createComponent(ForgotPasswordComponentCore); - fixtureComponent = fixture.componentInstance; - forgotPasswordSpy = jest.spyOn(service.auth(), 'forgotPassword'); - forgotPasswordSubmitSpy = jest.spyOn( - service.auth(), - 'forgotPasswordSubmit' - ); - onSubmitSpy = jest.spyOn(fixtureComponent, 'onSubmit'); - onSendSpy = jest.spyOn(fixtureComponent, 'onSend'); - onSignInSpy = jest.spyOn(fixtureComponent, 'onSignIn'); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have an onSend method', () => { - expect(component.onSend).toBeTruthy(); - }); - - it('...should have an onSignIn method', () => { - expect(component.onSignIn).toBeTruthy(); - }); - - it('...should have an onSubmit method', () => { - expect(component.onSubmit).toBeTruthy(); - }); - - it('...should have an setCode method', () => { - expect(component.setCode).toBeTruthy(); - }); - - it('...should have an _setError method', () => { - expect(component._setError).toBeTruthy(); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-container' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-container' - ); - expect(rootEl).toBeTruthy(); - }); - - it('...should call onSend when button is clicked and !codeSent', () => { - fixtureComponent._show = true; - fixtureComponent._authState = { - state: 'requireNewPassword', - user: {}, - }; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-button' - ); - button.click(); - expect(forgotPasswordSpy).not.toHaveBeenCalled(); - expect(onSendSpy).toHaveBeenCalled(); - fixtureComponent.username = 'username'; - fixture.detectChanges(); - button.click(); - expect(forgotPasswordSpy).toHaveBeenCalled(); - }); - - it('...should call onSubmit when button is clicked and codeSent', () => { - fixtureComponent._show = true; - fixtureComponent.code_sent = true; - fixtureComponent._authState = { - state: 'requireNewPassword', - user: {}, - }; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-button' - ); - button.click(); - expect(onSubmitSpy).toHaveBeenCalled(); - expect(forgotPasswordSubmitSpy).toHaveBeenCalled(); - }); - - it('...should call onSend when a tag is clicked and codeSent', () => { - fixtureComponent._show = true; - fixtureComponent.code_sent = true; - fixtureComponent._authState = { - state: 'requireNewPassword', - user: {}, - }; - fixture.detectChanges(); - const a = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-link' - ); - a.click(); - expect(onSendSpy).toHaveBeenCalled(); - expect(forgotPasswordSpy).toHaveBeenCalled(); - }); - - it('...should call onSignIn when a tag is clicked and !codeSent', () => { - fixtureComponent._show = true; - fixtureComponent._authState = { - state: 'requireNewPassword', - user: {}, - }; - fixture.detectChanges(); - const a = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-link' - ); - a.click(); - expect(onSignInSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/forgot-password.component.ionic.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/forgot-password.component.ionic.spec.ts deleted file mode 100644 index 49a15a30b6b..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/forgot-password.component.ionic.spec.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -import { ForgotPasswordComponentIonic } from '../../../components/authenticator/forgot-password-component/forgot-password.component.ionic'; - -describe('ForgotPasswordComponentIonic: ', () => { - let component: ForgotPasswordComponentIonic; - let fixtureComponent: ForgotPasswordComponentIonic; - let service: AmplifyService; - let fixture; - let onSubmitSpy; - let onSendSpy; - let forgotPasswordSpy; - let forgotPasswordSubmitSpy; - let onSignInSpy; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new ForgotPasswordComponentIonic(service); - TestBed.configureTestingModule({ - declarations: [ForgotPasswordComponentIonic], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(ForgotPasswordComponentIonic); - fixtureComponent = fixture.componentInstance; - forgotPasswordSpy = jest.spyOn(service.auth(), 'forgotPassword'); - forgotPasswordSubmitSpy = jest.spyOn( - service.auth(), - 'forgotPasswordSubmit' - ); - onSubmitSpy = jest.spyOn(fixtureComponent, 'onSubmit'); - onSendSpy = jest.spyOn(fixtureComponent, 'onSend'); - onSignInSpy = jest.spyOn(fixtureComponent, 'onSignIn'); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have an onSend method', () => { - expect(component.onSend).toBeTruthy(); - }); - - it('...should have an onSignIn method', () => { - expect(component.onSignIn).toBeTruthy(); - }); - - it('...should have an onSubmit method', () => { - expect(component.onSubmit).toBeTruthy(); - }); - - it('...should have an setCode method', () => { - expect(component.setCode).toBeTruthy(); - }); - - it('...should have an _setError method', () => { - expect(component._setError).toBeTruthy(); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-authenticator-ionic' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-authenticator-ionic' - ); - expect(rootEl).toBeTruthy(); - }); - - it('...should call onSend when button is clicked and !codeSent', () => { - fixtureComponent._show = true; - fixtureComponent._authState = { - state: 'requireNewPassword', - user: {}, - }; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector( - 'ion-button' - ); - button.click(); - expect(forgotPasswordSpy).not.toHaveBeenCalled(); - expect(onSendSpy).toHaveBeenCalled(); - fixtureComponent.username = 'username'; - fixture.detectChanges(); - button.click(); - expect(forgotPasswordSpy).toHaveBeenCalled(); - }); - - it('...should call onSubmit when button is clicked and codeSent', () => { - fixtureComponent._show = true; - fixtureComponent.code_sent = true; - fixtureComponent._authState = { - state: 'requireNewPassword', - user: {}, - }; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector( - 'ion-button' - ); - button.click(); - expect(onSubmitSpy).toHaveBeenCalled(); - expect(forgotPasswordSubmitSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/greetings.component.core.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/greetings.component.core.spec.ts deleted file mode 100644 index 60e57f64d9a..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/greetings.component.core.spec.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { Component } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { GreetingComponentCore } from '../../../components/authenticator/greeting-component/greeting.component.core'; -import { authModule } from '../../../__mocks__/mock_module'; - -describe('GreetingsComponentCore: ', () => { - let component: GreetingComponentCore; - let fixtureComponent: GreetingComponentCore; - let service: AmplifyService; - let fixture; - let onSignOutSpy; - let signOutSpy; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new GreetingComponentCore(service); - TestBed.configureTestingModule({ - declarations: [GreetingComponentCore], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(GreetingComponentCore); - fixtureComponent = fixture.componentInstance; - signOutSpy = jest.spyOn(service.auth(), 'signOut'); - onSignOutSpy = jest.spyOn(fixtureComponent, 'onSignOut'); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have an onSignOut method', () => { - expect(component.onSignOut).toBeTruthy(); - }); - - it('...should have a setAuthState method', () => { - expect(component.setAuthState).toBeTruthy(); - }); - - it('...should have a subscribe method', () => { - expect(component.subscribe).toBeTruthy(); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-greeting' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent.signedIn = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-greeting' - ); - expect(rootEl).toBeTruthy(); - }); - - it('...should call onSignOut when "a" tag is clicked', () => { - fixtureComponent.signedIn = true; - fixtureComponent.authState = { - state: 'signedIn', - user: {}, - }; - fixture.detectChanges(); - const a = fixture.debugElement.nativeElement.querySelector('a'); - a.click(); - expect(onSignOutSpy).toHaveBeenCalled(); - expect(signOutSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/greetings.component.ionic.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/greetings.component.ionic.spec.ts deleted file mode 100644 index 1623ebed861..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/greetings.component.ionic.spec.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -import { GreetingComponentIonic } from '../../../components/authenticator/greeting-component/greeting.component.ionic'; - -describe('GreetingsComponentCore: ', () => { - let component: GreetingComponentIonic; - let fixtureComponent: GreetingComponentIonic; - let service: AmplifyService; - let fixture; - let onSignOutSpy; - let signOutSpy; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new GreetingComponentIonic(service); - TestBed.configureTestingModule({ - declarations: [GreetingComponentIonic], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(GreetingComponentIonic); - fixtureComponent = fixture.componentInstance; - signOutSpy = jest.spyOn(service.auth(), 'signOut'); - onSignOutSpy = jest.spyOn(fixtureComponent, 'onSignOut'); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have an onSignOut method', () => { - expect(component.onSignOut).toBeTruthy(); - }); - - it('...should have a setAuthState method', () => { - expect(component.setAuthState).toBeTruthy(); - }); - - it('...should have a subscribe method', () => { - expect(component.subscribe).toBeTruthy(); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-greeting' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent.signedIn = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-greeting' - ); - expect(rootEl).toBeTruthy(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/phone-field.component.core.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/phone-field.component.core.spec.ts deleted file mode 100644 index b14a966b8d6..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/phone-field.component.core.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Component } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormsModule } from '@angular/forms'; -import { PhoneFieldComponentCore } from '../../../components/authenticator/phone-field-component/phone-field.component.core'; -import { MockComponent } from 'ng-mocks'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; - -describe('PhoneFieldComponentCore: ', () => { - let component: PhoneFieldComponentCore; - let fixtureComponent: PhoneFieldComponentCore; - let service: AmplifyService; - let fixture; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new PhoneFieldComponentCore(service); - TestBed.configureTestingModule({ - declarations: [PhoneFieldComponentCore], - imports: [FormsModule], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(PhoneFieldComponentCore); - fixtureComponent = fixture.componentInstance; - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/phone-field.component.ionic.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/phone-field.component.ionic.spec.ts deleted file mode 100644 index 21488485a02..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/phone-field.component.ionic.spec.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { PhoneFieldComponentIonic } from '../../../components/authenticator/phone-field-component/phone-field.component.ionic'; -import { MockComponent } from 'ng-mocks'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; - -describe('PhoneFieldComponentIonic: ', () => { - let component: PhoneFieldComponentIonic; - let fixtureComponent: PhoneFieldComponentIonic; - let service: AmplifyService; - let fixture; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new PhoneFieldComponentIonic(service); - TestBed.configureTestingModule({ - declarations: [PhoneFieldComponentIonic], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(PhoneFieldComponentIonic); - fixtureComponent = fixture.componentInstance; - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/require-new-password.component.core.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/require-new-password.component.core.spec.ts deleted file mode 100644 index 20a9b79bd0d..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/require-new-password.component.core.spec.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { Component } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -// tslint:disable:max-line-length -import { RequireNewPasswordComponentCore } from '../../../components/authenticator/require-new-password-component/require-new-password.component.core'; -// tslint:enable - -describe('RequireNewPasswordComponentCore: ', () => { - let component: RequireNewPasswordComponentCore; - let fixtureComponent: RequireNewPasswordComponentCore; - let service: AmplifyService; - let fixture; - let onSubmitSpy; - let completeNewPasswordSpy; - let onSignInSpy; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new RequireNewPasswordComponentCore(service); - TestBed.configureTestingModule({ - declarations: [RequireNewPasswordComponentCore], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(RequireNewPasswordComponentCore); - fixtureComponent = fixture.componentInstance; - completeNewPasswordSpy = jest.spyOn(service.auth(), 'completeNewPassword'); - onSubmitSpy = jest.spyOn(fixtureComponent, 'onSubmit'); - onSignInSpy = jest.spyOn(fixtureComponent, 'onSignIn'); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have an onSignIn method', () => { - expect(component.onSignIn).toBeTruthy(); - }); - - it('...should have an onSubmit method', () => { - expect(component.onSubmit).toBeTruthy(); - }); - - it('...should have a setPassword method', () => { - expect(component.setPassword).toBeTruthy(); - }); - - it('...should have a _setError method', () => { - expect(component._setError).toBeTruthy(); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-container' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-container' - ); - expect(rootEl).toBeTruthy(); - }); - - it('...should call onSubmit when button is clicked', () => { - fixtureComponent._show = true; - fixtureComponent.authState = { - state: 'requireNewPassword', - user: { challengeParam: {} }, - }; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector('button'); - button.click(); - expect(onSubmitSpy).toHaveBeenCalled(); - expect(completeNewPasswordSpy).toHaveBeenCalled(); - }); - - it('...should call onSignIn when "a" tag is clicked', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const a = fixture.debugElement.nativeElement.querySelector('a'); - a.click(); - expect(onSignInSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/require-new-password.component.ionic.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/require-new-password.component.ionic.spec.ts deleted file mode 100644 index 7ea27d0d103..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/require-new-password.component.ionic.spec.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -// tslint:disable:max-line-length -import { RequireNewPasswordComponentIonic } from '../../../components/authenticator/require-new-password-component/require-new-password.component.ionic'; -// tslint:enable - -describe('RequireNewPasswordComponentCore: ', () => { - let component: RequireNewPasswordComponentIonic; - let fixtureComponent: RequireNewPasswordComponentIonic; - let service: AmplifyService; - let fixture; - let onSubmitSpy; - let completeNewPasswordSpy; - let onSignInSpy; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new RequireNewPasswordComponentIonic(service); - TestBed.configureTestingModule({ - declarations: [RequireNewPasswordComponentIonic], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(RequireNewPasswordComponentIonic); - fixtureComponent = fixture.componentInstance; - completeNewPasswordSpy = jest.spyOn(service.auth(), 'completeNewPassword'); - onSubmitSpy = jest.spyOn(fixtureComponent, 'onSubmit'); - onSignInSpy = jest.spyOn(fixtureComponent, 'onSignIn'); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have an onSignIn method', () => { - expect(component.onSignIn).toBeTruthy(); - }); - - it('...should have an onSubmit method', () => { - expect(component.onSubmit).toBeTruthy(); - }); - - it('...should have a setPassword method', () => { - expect(component.setPassword).toBeTruthy(); - }); - - it('...should have a _setError method', () => { - expect(component._setError).toBeTruthy(); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-authenticator-ionic' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-authenticator-ionic' - ); - expect(rootEl).toBeTruthy(); - }); - - it('...should call onSignIn when button is clicked', () => { - fixtureComponent._show = true; - fixtureComponent.authState = { - state: 'requireNewPassword', - user: { challengeParam: {} }, - }; - fixture.detectChanges(); - const buttons = fixture.debugElement.nativeElement.querySelectorAll( - 'ion-button' - ); - const signInButton = Object.values(buttons).find( - el => (el as HTMLElement).innerHTML === 'Back to Sign In' - ); - (signInButton as HTMLElement).click(); - expect(onSignInSpy).toHaveBeenCalled(); - }); - - it('...should call onSubmit when button is clicked', () => { - fixtureComponent._show = true; - fixtureComponent.authState = { - state: 'requireNewPassword', - user: { challengeParam: {} }, - }; - fixture.detectChanges(); - const buttons = fixture.debugElement.nativeElement.querySelectorAll( - 'ion-button' - ); - const submitButton = Object.values(buttons).find( - el => (el as any).innerHTML === 'Submit' - ); - (submitButton as any).click(); - expect(onSubmitSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/sign-in.component.core.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/sign-in.component.core.spec.ts deleted file mode 100644 index b3388c52e50..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/sign-in.component.core.spec.ts +++ /dev/null @@ -1,160 +0,0 @@ -import { Component } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormsModule } from '@angular/forms'; -import { MockComponent } from 'ng-mocks'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -import { SignInComponentCore } from '../../../components/authenticator/sign-in-component/sign-in.component.core'; -import { UsernameFieldComponentCore } from '../../../components/authenticator/username-field-component/username-field.component.core'; - -describe('SignInComponentCore: ', () => { - let component: SignInComponentCore; - let fixtureComponent: SignInComponentCore; - let service: AmplifyService; - let fixture; - let setAuthStateSpy; - let signInSpy; - let onSignInSpy; - let onSignUpSpy; - let onForgotPasswordSpy; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new SignInComponentCore(service); - TestBed.configureTestingModule({ - declarations: [ - SignInComponentCore, - MockComponent(UsernameFieldComponentCore), - ], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - imports: [FormsModule], - }).compileComponents(); - fixture = TestBed.createComponent(SignInComponentCore); - fixtureComponent = fixture.componentInstance; - setAuthStateSpy = jest.spyOn(service, 'setAuthState'); - signInSpy = jest.spyOn(service.auth(), 'signIn'); - onSignInSpy = jest.spyOn(fixtureComponent, 'onSignIn'); - onSignUpSpy = jest.spyOn(fixtureComponent, 'onSignUp'); - onForgotPasswordSpy = jest.spyOn(fixtureComponent, 'onForgotPassword'); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have an onForgotPassword method', () => { - expect(component.onForgotPassword).toBeTruthy(); - }); - - it('...should call setAuthState within the onForgotPassword method', () => { - component.username = 'test-username2'; - const callingAuthState = component.onForgotPassword(); - expect(service.setAuthState).toBeCalled(); - }); - - it('...should have an onSignIn method', () => { - expect(component.onSignIn).toBeTruthy(); - }); - - it('...should call signIn within the onSignUp method', () => { - component.username = 'test-username3'; - component.password = 'test-password3'; - const callingAuthState = component.onSignIn(); - expect(signInSpy).toBeCalled(); - }); - - it('...should have an onSignUp method', () => { - expect(component.onSignUp).toBeTruthy(); - }); - - it('...should call setAuthState within the onSignUp method', () => { - component.username = 'test-username2'; - const callingAuthState = component.onSignUp(); - expect(service.setAuthState).toBeCalled(); - }); - - it('...should have a setPassword method', () => { - expect(component.setPassword).toBeTruthy(); - }); - - it('...should set this.password with the setPassword method', () => { - component.setPassword('my-test-password'); - expect(component.password).toEqual('my-test-password'); - }); - - it('...should have a setUsername method', () => { - expect(component.setUsername).toBeTruthy(); - }); - - it('...should set this.username with the setUsername method', () => { - component.setUsername('my-test-name'); - expect(component.username).toEqual('my-test-name'); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-container' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-container' - ); - expect(rootEl).toBeTruthy(); - }); - - it('...should call onSignIn when button is clicked', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-button' - ); - button.click(); - expect(onSignInSpy).toHaveBeenCalled(); - expect(signInSpy).toHaveBeenCalled(); - }); - - it('...should call onSignUp when "No account?" element is clicked', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const parent = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-signup' - ); - const a = parent.querySelector('.amplify-form-link'); - a.click(); - expect(onSignUpSpy).toHaveBeenCalled(); - }); - - it('...should call onForgotPassword when "Forgot password?" element is clicked', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const parent = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-action' - ); - const a = parent.querySelector('.amplify-form-link'); - a.click(); - expect(onForgotPasswordSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/sign-in.component.ionic.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/sign-in.component.ionic.spec.ts deleted file mode 100644 index 73a9244db51..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/sign-in.component.ionic.spec.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -import { SignInComponentIonic } from '../../../components/authenticator/sign-in-component/sign-in.component.ionic'; -import Amplify from 'aws-amplify'; - -describe('SignInComponentIonic: ', () => { - let component: SignInComponentIonic; - let fixtureComponent: SignInComponentIonic; - let fixture; - let service: AmplifyService; - let setAuthStateSpy; - let signInSpy; - let onSignInSpy; - let onSignUpSpy; - let onForgotPasswordSpy; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new SignInComponentIonic(service); - setAuthStateSpy = jest.spyOn(service, 'setAuthState'); - signInSpy = jest.spyOn(service.auth(), 'signIn'); - TestBed.configureTestingModule({ - declarations: [SignInComponentIonic], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(SignInComponentIonic); - fixtureComponent = fixture.componentInstance; - onSignInSpy = jest.spyOn(fixtureComponent, 'onSignIn'); - onSignUpSpy = jest.spyOn(fixtureComponent, 'onSignUp'); - onForgotPasswordSpy = jest.spyOn(fixtureComponent, 'onForgotPassword'); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have an onForgotPassword method', () => { - expect(component.onForgotPassword).toBeTruthy(); - }); - - it('...should call setAuthState within the onForgotPassword method', () => { - component.username = 'test-username2'; - const callingAuthState = component.onForgotPassword(); - expect(service.setAuthState).toBeCalled(); - setAuthStateSpy.mockRestore(); - }); - - it('...should have an onSignIn method', () => { - expect(component.onSignIn).toBeTruthy(); - }); - - it('...should call signIn within the onSignUp method', () => { - component.username = 'test-username3'; - component.password = 'test-password3'; - const callingAuthState = component.onSignIn(); - expect(signInSpy).toBeCalled(); - }); - - it('...should have an onSignUp method', () => { - expect(component.onSignUp).toBeTruthy(); - }); - - it('...should call setAuthState within the onSignUp method', () => { - component.username = 'test-username2'; - const callingAuthState = component.onSignUp(); - expect(service.setAuthState).toBeCalled(); - setAuthStateSpy.mockRestore(); - }); - - it('...should have a setPassword method', () => { - expect(component.setPassword).toBeTruthy(); - }); - - it('...should set this.password with the setPassword method', () => { - component.setPassword('my-test-password'); - expect(component.password).toEqual('my-test-password'); - }); - - it('...should have a setUsername method', () => { - expect(component.setUsername).toBeTruthy(); - }); - - it('...should set this.username with the setUsername method', () => { - component.setUsername('my-test-name'); - expect(component.username).toEqual('my-test-name'); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-authenticator' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-authenticator' - ); - expect(rootEl).toBeTruthy(); - }); - - it('...should call onSignIn when button is clicked', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector( - 'ion-button' - ); - button.click(); - expect(onSignInSpy).toHaveBeenCalled(); - expect(signInSpy).toHaveBeenCalled(); - }); - - it('...should call onSignUp when "No account?" element is clicked', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const parent = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-signup' - ); - const a = parent.querySelector('.amplify-form-link'); - a.click(); - expect(onSignUpSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/sign-up.component.core.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/sign-up.component.core.spec.ts deleted file mode 100644 index 700c2a53ff3..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/sign-up.component.core.spec.ts +++ /dev/null @@ -1,253 +0,0 @@ -import { Component, DebugElement } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormsModule } from '@angular/forms'; -import { MockComponent } from 'ng-mocks'; -import { By } from '@angular/platform-browser'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -import { - SignUpComponentCore, - SignUpField, -} from '../../../components/authenticator/sign-up-component/sign-up.component.core'; -import { PhoneFieldComponentCore } from '../../../components/authenticator/phone-field-component/phone-field.component.core'; -// tslint:enable - -describe('SignUpComponentCore (basics): ', () => { - let component: SignUpComponentCore; - let service: AmplifyService; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new SignUpComponentCore(service); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have an onConfirmSignUp method', () => { - expect(component.onConfirmSignUp).toBeTruthy(); - }); - - it('...should have an onSignIn method', () => { - expect(component.onSignIn).toBeTruthy(); - }); - - it('...should have an onSignUp method', () => { - expect(component.onSignUp).toBeTruthy(); - }); - - it('...should have an sortFields method', () => { - expect(component.sortFields).toBeTruthy(); - }); -}); - -describe('SignUpComponentCore (methods and UI): ', () => { - let component: SignUpComponentCore; - let fixture: ComponentFixture; - let service; - let fixtureComponent: SignUpComponentCore; - let amplifyService: AmplifyService; - let onSignUpSpy; - let signUpSpy; - let onSignInSpy; - - beforeEach(() => { - TestBed.configureTestingModule({ - declarations: [ - SignUpComponentCore, - MockComponent(PhoneFieldComponentCore), - ], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - imports: [FormsModule], - }).compileComponents(); - service = new AmplifyService(authModule); - fixture = TestBed.createComponent(SignUpComponentCore); - fixtureComponent = fixture.componentInstance; - component = fixture.componentInstance; - amplifyService = TestBed.get(AmplifyService); - onSignUpSpy = jest.spyOn(fixtureComponent, 'onSignUp'); - signUpSpy = jest.spyOn(service.auth(), 'signUp'); - onSignInSpy = jest.spyOn(fixtureComponent, 'onSignIn'); - }); - - afterEach(() => { - component.signUpConfig = undefined; - }); - - it('...should be created with 4 default signUpFields', () => { - expect(component.signUpFields.length).toBe(4); - expect(component.signUpFields.find(e => e.key === 'username')).toBeTruthy(); - expect(component.signUpFields.find(e => e.key === 'password')).toBeTruthy(); - expect(component.signUpFields.find(e => e.key === 'email')).toBeTruthy(); - expect( - component.signUpFields.find(e => e.key === 'phone_number') - ).toBeTruthy(); - }); - - describe('...with component ngOnInit...', () => { - beforeEach(async () => { - component.signUpConfig = { - signUpFields: [ - { - key: 'testkey', - label: 'testlabel', - }, - ], - }; - component.ngOnInit(); - await fixture.whenStable(); - }); - it('...should insert fields passed via signUpConfig', () => { - expect(component.signUpFields.length).toBe(5); - expect( - component.signUpFields.find(e => e.key === 'username') - ).toBeTruthy(); - expect( - component.signUpFields.find(e => e.key === 'password') - ).toBeTruthy(); - expect(component.signUpFields.find(e => e.key === 'email')).toBeTruthy(); - expect( - component.signUpFields.find(e => e.key === 'phone_number') - ).toBeTruthy(); - expect( - component.signUpFields.find(e => e.key === 'testkey') - ).toBeTruthy(); - }); - }); - - describe('...with component ngOnInit...', () => { - beforeEach(async () => { - component.signUpConfig = { - signUpFields: [ - { - key: 'testkey', - label: 'testlabel', - }, - ], - }; - component.ngOnInit(); - await fixture.whenStable(); - }); - it('...should insert only passed fields when hideDefaults is true', () => { - component.signUpConfig = { - hideDefaults: true, - signUpFields: [ - { - key: 'testkey', - label: 'testlabel', - }, - ], - }; - expect(component.signUpFields.length).toBe(1); - }); - }); - - describe('...with component ngOnInit...', () => { - beforeEach(async () => { - component.signUpConfig = { - hiddenDefaults: ['email'], - }; - component.ngOnInit(); - await fixture.whenStable(); - }); - it('...should exclude hiddentDefaults', () => { - expect(component.defaultSignUpFields.length).toBe(3); - }); - }); - - describe('...with component ngOnInit...', () => { - beforeEach(async () => { - component.signUpConfig = { - signUpFields: [ - { - key: 'testkey1', - label: 'testlabel1', - displayOrder: 6, - }, - { - key: 'testkey2', - label: 'testlabel2', - displayOrder: 5, - }, - ], - }; - component.ngOnInit(); - await fixture.whenStable(); - }); - it('...should order fields by display order', () => { - expect(component.signUpFields[5].key).toBe('testkey1'); - expect(component.signUpFields[4].key).toBe('testkey2'); - }); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-container' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-container' - ); - expect(rootEl).toBeTruthy(); - }); - - // tslint:disable:max-line-length - it('...should call onSignUp when button is clicked (but signUp will not be called if validation does not pass)', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector('button'); - button.click(); - expect(onSignUpSpy).toHaveBeenCalled(); - expect(signUpSpy).not.toHaveBeenCalled(); - }); - - it('...should call onSignUp when button is clicked and signUp will be called since validation passes', () => { - fixtureComponent._show = true; - fixtureComponent.user = { - username: 'testusername', - password: 'testpassword', - email: 'testemail', - }; - fixtureComponent.country_code = '1'; - fixtureComponent.local_phone_number = '123'; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector('button'); - button.click(); - expect(onSignUpSpy).toHaveBeenCalled(); - expect(signUpSpy).toHaveBeenCalled(); - }); - - it('...should call onSignIn when "amplify-form-link" is clicked', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const a = fixture.debugElement.nativeElement.querySelector( - '.amplify-form-link' - ); - a.click(); - expect(onSignInSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/sign-up.component.ionic.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/sign-up.component.ionic.spec.ts deleted file mode 100644 index 2a26fef44f0..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/sign-up.component.ionic.spec.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { FormsModule } from '@angular/forms'; - -import { authModule } from '../../../__mocks__/mock_module'; -import { SignUpComponentIonic } from '../../../components/authenticator/sign-up-component/sign-up.component.ionic'; - -describe('SignUpComponentCore: ', () => { - let component: SignUpComponentIonic; - let fixtureComponent: SignUpComponentIonic; - let service: AmplifyService; - let fixture; - let onSignUpSpy; - let signUpSpy; - let onSignInSpy; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new SignUpComponentIonic(service); - TestBed.configureTestingModule({ - declarations: [SignUpComponentIonic], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(SignUpComponentIonic); - fixtureComponent = fixture.componentInstance; - onSignUpSpy = jest.spyOn(fixtureComponent, 'onSignUp'); - signUpSpy = jest.spyOn(service.auth(), 'signUp'); - onSignInSpy = jest.spyOn(fixtureComponent, 'onSignIn'); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have an onConfirmSignUp method', () => { - expect(component.onConfirmSignUp).toBeTruthy(); - }); - - it('...should have an onSignIn method', () => { - expect(component.onSignIn).toBeTruthy(); - }); - - it('...should have an onSignUp method', () => { - expect(component.onSignUp).toBeTruthy(); - }); - - it('...should not display if _show is not set', () => { - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-authenticator' - ); - expect(rootEl).toBeFalsy(); - }); - - it('...should display if _show is set', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const rootEl = fixture.debugElement.nativeElement.querySelector( - '.amplify-authenticator' - ); - expect(rootEl).toBeTruthy(); - }); - - // tslint:disable:max-line-length - it('...should call onSignUp when button is clicked (but signUp will not be called if validation does not pass)', () => { - fixtureComponent._show = true; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector( - 'ion-button' - ); - button.click(); - expect(onSignUpSpy).toHaveBeenCalled(); - expect(signUpSpy).not.toHaveBeenCalled(); - }); - - it('...should call onSignUp when button is clicked and signUp will be called since validation passes', () => { - fixtureComponent._show = true; - fixtureComponent.user = { - username: 'testusername', - password: 'testpassword', - email: 'testemail', - }; - fixtureComponent.country_code = '1'; - fixtureComponent.local_phone_number = '123'; - fixture.detectChanges(); - const button = fixture.debugElement.nativeElement.querySelector( - 'ion-button' - ); - button.click(); - expect(onSignUpSpy).toHaveBeenCalled(); - expect(signUpSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/username-field.component.core.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/username-field.component.core.spec.ts deleted file mode 100644 index 65f41caf2e0..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/username-field.component.core.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Component } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { UsernameFieldComponentCore } from '../../../components/authenticator/username-field-component/username-field.component.core'; -import { MockComponent } from 'ng-mocks'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -import { PhoneFieldComponentCore } from '../../../components/authenticator/phone-field-component/phone-field.component.core'; - -describe('UsernameFieldComponentCore: ', () => { - let component: UsernameFieldComponentCore; - let fixtureComponent: UsernameFieldComponentCore; - let service: AmplifyService; - let fixture; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new UsernameFieldComponentCore(service); - TestBed.configureTestingModule({ - declarations: [ - UsernameFieldComponentCore, - MockComponent(PhoneFieldComponentCore), - ], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(UsernameFieldComponentCore); - fixtureComponent = fixture.componentInstance; - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/authenticator/username-field.component.ionic.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/authenticator/username-field.component.ionic.spec.ts deleted file mode 100644 index d89d4bf86e4..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/authenticator/username-field.component.ionic.spec.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { UsernameFieldComponentIonic } from '../../../components/authenticator/username-field-component/username-field.component.ionic'; -import { MockComponent } from 'ng-mocks'; -import { AmplifyService, AmplifyModules } from '../../../providers'; -import { authModule } from '../../../__mocks__/mock_module'; -import { PhoneFieldComponentIonic } from '../../../components/authenticator/phone-field-component/phone-field.component.ionic'; - -describe('UsernameFieldComponentCore: ', () => { - let component: UsernameFieldComponentIonic; - let fixtureComponent: UsernameFieldComponentIonic; - let service: AmplifyService; - let fixture; - - beforeEach(() => { - service = new AmplifyService(authModule); - component = new UsernameFieldComponentIonic(service); - TestBed.configureTestingModule({ - declarations: [ - UsernameFieldComponentIonic, - MockComponent(PhoneFieldComponentIonic), - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - providers: [ - { - provide: AmplifyService, - useFactory: () => { - return AmplifyModules({ - ...authModule, - }); - }, - }, - ], - }).compileComponents(); - fixture = TestBed.createComponent(UsernameFieldComponentIonic); - fixtureComponent = fixture.componentInstance; - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/common/form.component.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/common/form.component.spec.ts deleted file mode 100644 index a67e6802e5c..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/common/form.component.spec.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { TestBed } from '@angular/core/testing'; -import { FormComponent } from '../../../components/common/form.component'; - -describe('FormComponent:', () => { - let component: FormComponent; - - beforeEach(() => { - component = new FormComponent(); - }); - - afterEach(() => { - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have not have a default title', () => { - expect(component.title).toBeUndefined(); - }); - - afterAll(() => { - TestBed.resetTestEnvironment(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/interactions/chatbot.component.core.ionic.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/interactions/chatbot.component.core.ionic.spec.ts deleted file mode 100644 index 21fc074d207..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/interactions/chatbot.component.core.ionic.spec.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Component, ChangeDetectorRef } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { ChatbotComponentIonic } from '../../../components/interactions/chatbot/chatbot.component.ionic'; -import Amplify from 'aws-amplify'; - -describe('ChatbotComponentIonic: ', () => { - let component: ChatbotComponentIonic; - let service: AmplifyService; - let ref: ChangeDetectorRef; - - beforeEach(() => { - service = new AmplifyService(Amplify); - component = new ChatbotComponentIonic(ref, service); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have a performOnComplete method', () => { - expect(component.performOnComplete).toBeTruthy(); - }); - - it('...should have an onInputChange method', () => { - expect(component.onInputChange).toBeTruthy(); - }); - - it('...should have an onSubmit method', () => { - expect(component.onSubmit).toBeTruthy(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/interactions/chatbot.component.core.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/interactions/chatbot.component.core.spec.ts deleted file mode 100644 index d7964948ddb..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/interactions/chatbot.component.core.spec.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Component, ChangeDetectorRef } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { ChatbotComponentCore } from '../../../components/interactions/chatbot/chatbot.component.core'; -import Amplify from 'aws-amplify'; - -describe('ChatbotComponentIonic: ', () => { - let component: ChatbotComponentCore; - let service: AmplifyService; - let ref: ChangeDetectorRef; - - beforeEach(() => { - service = new AmplifyService(Amplify); - component = new ChatbotComponentCore(ref, service); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have a performOnComplete method', () => { - expect(component.performOnComplete).toBeTruthy(); - }); - - it('...should have an onInputChange method', () => { - expect(component.onInputChange).toBeTruthy(); - }); - - it('...should have an onSubmit method', () => { - expect(component.onSubmit).toBeTruthy(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/storage/s3-album.component.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/storage/s3-album.component.spec.ts deleted file mode 100644 index e6e6e45ff6c..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/storage/s3-album.component.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { AmplifyService } from '../../../providers/amplify.service'; -import Amplify from 'aws-amplify'; -import { S3AlbumComponentCore } from '../../../components/storage/s3-album-component/s3-album.component.core'; - -describe('S3AlbumComponentCore: ', () => { - let component: S3AlbumComponentCore; - let service: AmplifyService; - - beforeEach(() => { - service = new AmplifyService(Amplify); - component = new S3AlbumComponentCore(service); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/storage/s3-image.component.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/storage/s3-image.component.spec.ts deleted file mode 100644 index aa34b487738..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/storage/s3-image.component.spec.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Component } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting, -} from '@angular/platform-browser-dynamic/testing'; -import { AmplifyService } from '../../../providers/amplify.service'; -import Amplify from 'aws-amplify'; -import { S3ImageComponentCore } from '../../../components/storage/s3-image-component/s3-image.component.core'; - -describe('S3ImageComponentCore: ', () => { - let component: S3ImageComponentCore; - let service: AmplifyService; - - beforeEach(() => { - service = new AmplifyService(Amplify); - component = new S3ImageComponentCore(service); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/xr/sumerian-scene.component.core.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/xr/sumerian-scene.component.core.spec.ts deleted file mode 100644 index 96b2f2f7b6d..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/xr/sumerian-scene.component.core.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { AmplifyService } from '../../../providers/amplify.service'; -import { SumerianSceneComponentCore } from '../../../components/xr/sumerian-scene-component/sumerian-scene.component.core'; -import Amplify from 'aws-amplify'; - -describe('SumerianSceneComponentCore: ', () => { - let component: SumerianSceneComponentCore; - let service: AmplifyService; - - beforeEach(() => { - service = new AmplifyService(Amplify); - component = new SumerianSceneComponentCore(service); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have a enterVR method', () => { - expect(component.toggleVRPresentation).toBeTruthy(); - }); - - it('...should have an loadAndStartScene method', () => { - expect(component.loadAndStartScene).toBeTruthy(); - }); - - it('...should have an maximize method', () => { - expect(component.maximize).toBeTruthy(); - }); - - it('...should have an minimize method', () => { - expect(component.minimize).toBeTruthy(); - }); - - it('...should have an setMuted method', () => { - expect(component.setMuted).toBeTruthy(); - }); - - it('...should have an onFullscreenChange method', () => { - expect(component.onFullscreenChange).toBeTruthy(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/components/xr/sumerian-scene.component.ionic.spec.ts b/packages/aws-amplify-angular/src/__tests__/components/xr/sumerian-scene.component.ionic.spec.ts deleted file mode 100644 index 0e28c9b16e6..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/components/xr/sumerian-scene.component.ionic.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { AmplifyService } from '../../../providers/amplify.service'; -import { SumerianSceneComponentIonic } from '../../../components/xr/sumerian-scene-component/sumerian-scene.component.ionic'; -import Amplify from 'aws-amplify'; - -describe('SumerianSceneComponentIonic: ', () => { - let component: SumerianSceneComponentIonic; - let service: AmplifyService; - - beforeEach(() => { - service = new AmplifyService(Amplify); - component = new SumerianSceneComponentIonic(service); - }); - - afterEach(() => { - service = null; - component = null; - }); - - it('...should be created', () => { - expect(component).toBeTruthy(); - }); - - it('...should have a enterVR method', () => { - expect(component.toggleVRPresentation).toBeTruthy(); - }); - - it('...should have an loadAndStartScene method', () => { - expect(component.loadAndStartScene).toBeTruthy(); - }); - - it('...should have an maximize method', () => { - expect(component.maximize).toBeTruthy(); - }); - - it('...should have an minimize method', () => { - expect(component.minimize).toBeTruthy(); - }); - - it('...should have an setMuted method', () => { - expect(component.setMuted).toBeTruthy(); - }); - - it('...should have an onFullscreenChange method', () => { - expect(component.onFullscreenChange).toBeTruthy(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/providers/auth.decorator.spec.ts b/packages/aws-amplify-angular/src/__tests__/providers/auth.decorator.spec.ts deleted file mode 100644 index f361148cadf..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/providers/auth.decorator.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { TestBed } from '@angular/core/testing'; -import { authDecorator } from '../../providers/auth.decorator'; - -describe('AuthDecorator', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [authDecorator], - }); - }); - - it('should be created', () => { - expect(authDecorator).toBeTruthy(); - }); - - afterAll(() => { - TestBed.resetTestEnvironment(); - }); -}); diff --git a/packages/aws-amplify-angular/src/__tests__/providers/auth.state.spec.ts b/packages/aws-amplify-angular/src/__tests__/providers/auth.state.spec.ts deleted file mode 100644 index 60da915e68b..00000000000 --- a/packages/aws-amplify-angular/src/__tests__/providers/auth.state.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { TestBed } from '@angular/core/testing'; -import { Subject } from 'rxjs'; -import { AuthState } from '../../providers/auth.state'; - -describe('AuthState', () => { - beforeEach(() => { - TestBed.configureTestingModule({}); - }); - - it('...should be created', () => { - const AuthStateInterface = new Subject(); - expect(AuthStateInterface).toBeTruthy(); - }); - - afterAll(() => { - TestBed.resetTestEnvironment(); - }); -}); diff --git a/packages/aws-amplify-angular/src/assets/countries.ts b/packages/aws-amplify-angular/src/assets/countries.ts deleted file mode 100644 index 345a767c9ac..00000000000 --- a/packages/aws-amplify-angular/src/assets/countries.ts +++ /dev/null @@ -1,240 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable -class country { - countryCode: string; - value: string; - label: string; -} - -const countrylist = [ - { countryCode: 'US', value: '1', label: 'USA (+1)' }, - { countryCode: 'GB', value: '44', label: 'UK (+44)' }, - { countryCode: 'DZ', value: '213', label: 'Algeria (+213)' }, - { countryCode: 'AD', value: '376', label: 'Andorra (+376)' }, - { countryCode: 'AO', value: '244', label: 'Angola (+244)' }, - { countryCode: 'AI', value: '1264', label: 'Anguilla (+1264)' }, - { countryCode: 'AG', value: '1268', label: 'Antigua & Barbuda (+1268)' }, - { countryCode: 'AR', value: '54', label: 'Argentina (+54)' }, - { countryCode: 'AM', value: '374', label: 'Armenia (+374)' }, - { countryCode: 'AW', value: '297', label: 'Aruba (+297)' }, - { countryCode: 'AU', value: '61', label: 'Australia (+61)' }, - { countryCode: 'AT', value: '43', label: 'Austria (+43)' }, - { countryCode: 'AZ', value: '994', label: 'Azerbaijan (+994)' }, - { countryCode: 'BS', value: '1242', label: 'Bahamas (+1242)' }, - { countryCode: 'BH', value: '973', label: 'Bahrain (+973)' }, - { countryCode: 'BD', value: '880', label: 'Bangladesh (+880)' }, - { countryCode: 'BB', value: '1246', label: 'Barbados (+1246)' }, - { countryCode: 'BY', value: '375', label: 'Belarus (+375)' }, - { countryCode: 'BE', value: '32', label: 'Belgium (+32)' }, - { countryCode: 'BZ', value: '501', label: 'Belize (+501)' }, - { countryCode: 'BJ', value: '229', label: 'Benin (+229)' }, - { countryCode: 'BM', value: '1441', label: 'Bermuda (+1441)' }, - { countryCode: 'BT', value: '975', label: 'Bhutan (+975)' }, - { countryCode: 'BO', value: '591', label: 'Bolivia (+591)' }, - { countryCode: 'BA', value: '387', label: 'Bosnia Herzegovina (+387)' }, - { countryCode: 'BW', value: '267', label: 'Botswana (+267)' }, - { countryCode: 'BR', value: '55', label: 'Brazil (+55)' }, - { countryCode: 'BN', value: '673', label: 'Brunei (+673)' }, - { countryCode: 'BG', value: '359', label: 'Bulgaria (+359)' }, - { countryCode: 'BF', value: '226', label: 'Burkina Faso (+226)' }, - { countryCode: 'BI', value: '257', label: 'Burundi (+257)' }, - { countryCode: 'KH', value: '855', label: 'Cambodia (+855)' }, - { countryCode: 'CM', value: '237', label: 'Cameroon (+237)' }, - { countryCode: 'CA', value: '1', label: 'Canada (+1)' }, - { countryCode: 'CV', value: '238', label: 'Cape Verde Islands (+238)' }, - { countryCode: 'KY', value: '1345', label: 'Cayman Islands (+1345)' }, - { countryCode: 'CF', value: '236', label: 'Central African Republic (+236)' }, - { countryCode: 'CL', value: '56', label: 'Chile (+56)' }, - { countryCode: 'CN', value: '86', label: 'China (+86)' }, - { countryCode: 'CO', value: '57', label: 'Colombia (+57)' }, - { countryCode: 'KM', value: '269', label: 'Comoros (+269)' }, - { countryCode: 'CG', value: '242', label: 'Congo (+242)' }, - { countryCode: 'CK', value: '682', label: 'Cook Islands (+682)' }, - { countryCode: 'CR', value: '506', label: 'Costa Rica (+506)' }, - { countryCode: 'HR', value: '385', label: 'Croatia (+385)' }, - { countryCode: 'CU', value: '53', label: 'Cuba (+53)' }, - { countryCode: 'CW', value: '599', label: 'Curacao (+599)' }, - { countryCode: 'CY', value: '90392', label: 'Cyprus North (+90392)' }, - { countryCode: 'CY', value: '357', label: 'Cyprus South (+357)' }, - { countryCode: 'CZ', value: '420', label: 'Czech Republic (+420)' }, - { countryCode: 'DK', value: '45', label: 'Denmark (+45)' }, - { countryCode: 'DJ', value: '253', label: 'Djibouti (+253)' }, - { countryCode: 'DM', value: '1809', label: 'Dominica (+1809)' }, - { countryCode: 'DO', value: '1809', label: 'Dominican Republic (+1809)' }, - { countryCode: 'EC', value: '593', label: 'Ecuador (+593)' }, - { countryCode: 'EG', value: '20', label: 'Egypt (+20)' }, - { countryCode: 'SV', value: '503', label: 'El Salvador (+503)' }, - { countryCode: 'GQ', value: '240', label: 'Equatorial Guinea (+240)' }, - { countryCode: 'ER', value: '291', label: 'Eritrea (+291)' }, - { countryCode: 'EE', value: '372', label: 'Estonia (+372)' }, - { countryCode: 'ET', value: '251', label: 'Ethiopia (+251)' }, - { countryCode: 'FK', value: '500', label: 'Falkland Islands (+500)' }, - { countryCode: 'FO', value: '298', label: 'Faroe Islands (+298)' }, - { countryCode: 'FJ', value: '679', label: 'Fiji (+679)' }, - { countryCode: 'FI', value: '358', label: 'Finland (+358)' }, - { countryCode: 'FR', value: '33', label: 'France (+33)' }, - { countryCode: 'GF', value: '594', label: 'French Guiana (+594)' }, - { countryCode: 'PF', value: '689', label: 'French Polynesia (+689)' }, - { countryCode: 'GA', value: '241', label: 'Gabon (+241)' }, - { countryCode: 'GM', value: '220', label: 'Gambia (+220)' }, - { countryCode: 'GE', value: '7880', label: 'Georgia (+7880)' }, - { countryCode: 'DE', value: '49', label: 'Germany (+49)' }, - { countryCode: 'GH', value: '233', label: 'Ghana (+233)' }, - { countryCode: 'GI', value: '350', label: 'Gibraltar (+350)' }, - { countryCode: 'GR', value: '30', label: 'Greece (+30)' }, - { countryCode: 'GL', value: '299', label: 'Greenland (+299)' }, - { countryCode: 'GD', value: '1473', label: 'Grenada (+1473)' }, - { countryCode: 'GP', value: '590', label: 'Guadeloupe (+590)' }, - { countryCode: 'GU', value: '671', label: 'Guam (+671)' }, - { countryCode: 'GT', value: '502', label: 'Guatemala (+502)' }, - { countryCode: 'GN', value: '224', label: 'Guinea (+224)' }, - { countryCode: 'GW', value: '245', label: 'Guinea - Bissau (+245)' }, - { countryCode: 'GY', value: '592', label: 'Guyana (+592)' }, - { countryCode: 'HT', value: '509', label: 'Haiti (+509)' }, - { countryCode: 'HN', value: '504', label: 'Honduras (+504)' }, - { countryCode: 'HK', value: '852', label: 'Hong Kong (+852)' }, - { countryCode: 'HU', value: '36', label: 'Hungary (+36)' }, - { countryCode: 'IS', value: '354', label: 'Iceland (+354)' }, - { countryCode: 'IN', value: '91', label: 'India (+91)' }, - { countryCode: 'ID', value: '62', label: 'Indonesia (+62)' }, - { countryCode: 'IR', value: '98', label: 'Iran (+98)' }, - { countryCode: 'IQ', value: '964', label: 'Iraq (+964)' }, - { countryCode: 'IE', value: '353', label: 'Ireland (+353)' }, - { countryCode: 'IL', value: '972', label: 'Israel (+972)' }, - { countryCode: 'IT', value: '39', label: 'Italy (+39)' }, - { countryCode: 'JM', value: '1876', label: 'Jamaica (+1876)' }, - { countryCode: 'JP', value: '81', label: 'Japan (+81)' }, - { countryCode: 'JO', value: '962', label: 'Jordan (+962)' }, - { countryCode: 'KZ', value: '7', label: 'Kazakhstan (+7)' }, - { countryCode: 'KE', value: '254', label: 'Kenya (+254)' }, - { countryCode: 'KI', value: '686', label: 'Kiribati (+686)' }, - { countryCode: 'KP', value: '850', label: 'Korea North (+850)' }, - { countryCode: 'KR', value: '82', label: 'Korea South (+82)' }, - { countryCode: 'KW', value: '965', label: 'Kuwait (+965)' }, - { countryCode: 'KG', value: '996', label: 'Kyrgyzstan (+996)' }, - { countryCode: 'LA', value: '856', label: 'Laos (+856)' }, - { countryCode: 'LV', value: '371', label: 'Latvia (+371)' }, - { countryCode: 'LB', value: '961', label: 'Lebanon (+961)' }, - { countryCode: 'LS', value: '266', label: 'Lesotho (+266)' }, - { countryCode: 'LR', value: '231', label: 'Liberia (+231)' }, - { countryCode: 'LY', value: '218', label: 'Libya (+218)' }, - { countryCode: 'LI', value: '417', label: 'Liechtenstein (+417)' }, - { countryCode: 'LT', value: '370', label: 'Lithuania (+370)' }, - { countryCode: 'LU', value: '352', label: 'Luxembourg (+352)' }, - { countryCode: 'MO', value: '853', label: 'Macao (+853)' }, - { countryCode: 'MK', value: '389', label: 'Macedonia (+389)' }, - { countryCode: 'MG', value: '261', label: 'Madagascar (+261)' }, - { countryCode: 'MW', value: '265', label: 'Malawi (+265)' }, - { countryCode: 'MY', value: '60', label: 'Malaysia (+60)' }, - { countryCode: 'MV', value: '960', label: 'Maldives (+960)' }, - { countryCode: 'ML', value: '223', label: 'Mali (+223)' }, - { countryCode: 'MT', value: '356', label: 'Malta (+356)' }, - { countryCode: 'MH', value: '692', label: 'Marshall Islands (+692)' }, - { countryCode: 'MQ', value: '596', label: 'Martinique (+596)' }, - { countryCode: 'MR', value: '222', label: 'Mauritania (+222)' }, - { countryCode: 'YT', value: '269', label: 'Mayotte (+269)' }, - { countryCode: 'MX', value: '52', label: 'Mexico (+52)' }, - { countryCode: 'FM', value: '691', label: 'Micronesia (+691)' }, - { countryCode: 'MD', value: '373', label: 'Moldova (+373)' }, - { countryCode: 'MC', value: '377', label: 'Monaco (+377)' }, - { countryCode: 'MN', value: '976', label: 'Mongolia (+976)' }, - { countryCode: 'MS', value: '1664', label: 'Montserrat (+1664)' }, - { countryCode: 'MA', value: '212', label: 'Morocco (+212)' }, - { countryCode: 'MZ', value: '258', label: 'Mozambique (+258)' }, - { countryCode: 'MN', value: '95', label: 'Myanmar (+95)' }, - { countryCode: 'NA', value: '264', label: 'Namibia (+264)' }, - { countryCode: 'NR', value: '674', label: 'Nauru (+674)' }, - { countryCode: 'NP', value: '977', label: 'Nepal (+977)' }, - { countryCode: 'NL', value: '31', label: 'Netherlands (+31)' }, - { countryCode: 'NC', value: '687', label: 'New Caledonia (+687)' }, - { countryCode: 'NZ', value: '64', label: 'New Zealand (+64)' }, - { countryCode: 'NI', value: '505', label: 'Nicaragua (+505)' }, - { countryCode: 'NE', value: '227', label: 'Niger (+227)' }, - { countryCode: 'NG', value: '234', label: 'Nigeria (+234)' }, - { countryCode: 'NU', value: '683', label: 'Niue (+683)' }, - { countryCode: 'NF', value: '672', label: 'Norfolk Islands (+672)' }, - { countryCode: 'NP', value: '670', label: 'Northern Marianas (+670)' }, - { countryCode: 'NO', value: '47', label: 'Norway (+47)' }, - { countryCode: 'OM', value: '968', label: 'Oman (+968)' }, - { countryCode: 'PW', value: '680', label: 'Palau (+680)' }, - { countryCode: 'PA', value: '507', label: 'Panama (+507)' }, - { countryCode: 'PG', value: '675', label: 'Papua New Guinea (+675)' }, - { countryCode: 'PY', value: '595', label: 'Paraguay (+595)' }, - { countryCode: 'PE', value: '51', label: 'Peru (+51)' }, - { countryCode: 'PH', value: '63', label: 'Philippines (+63)' }, - { countryCode: 'PL', value: '48', label: 'Poland (+48)' }, - { countryCode: 'PT', value: '351', label: 'Portugal (+351)' }, - { countryCode: 'PR', value: '1787', label: 'Puerto Rico (+1787)' }, - { countryCode: 'QA', value: '974', label: 'Qatar (+974)' }, - { countryCode: 'RE', value: '262', label: 'Reunion (+262)' }, - { countryCode: 'RO', value: '40', label: 'Romania (+40)' }, - { countryCode: 'RU', value: '7', label: 'Russia (+7)' }, - { countryCode: 'RW', value: '250', label: 'Rwanda (+250)' }, - { countryCode: 'SM', value: '378', label: 'San Marino (+378)' }, - { countryCode: 'ST', value: '239', label: 'Sao Tome & Principe (+239)' }, - { countryCode: 'SA', value: '966', label: 'Saudi Arabia (+966)' }, - { countryCode: 'SN', value: '221', label: 'Senegal (+221)' }, - { countryCode: 'CS', value: '381', label: 'Serbia (+381)' }, - { countryCode: 'SC', value: '248', label: 'Seychelles (+248)' }, - { countryCode: 'SL', value: '232', label: 'Sierra Leone (+232)' }, - { countryCode: 'SX', value: '1', label: 'Sint Maarten (+1)' }, - { countryCode: 'SG', value: '65', label: 'Singapore (+65)' }, - { countryCode: 'SK', value: '421', label: 'Slovak Republic (+421)' }, - { countryCode: 'SI', value: '386', label: 'Slovenia (+386)' }, - { countryCode: 'SB', value: '677', label: 'Solomon Islands (+677)' }, - { countryCode: 'SO', value: '252', label: 'Somalia (+252)' }, - { countryCode: 'ZA', value: '27', label: 'South Africa (+27)' }, - { countryCode: 'ES', value: '34', label: 'Spain (+34)' }, - { countryCode: 'LK', value: '94', label: 'Sri Lanka (+94)' }, - { countryCode: 'SH', value: '290', label: 'St. Helena (+290)' }, - { countryCode: 'KN', value: '1869', label: 'St. Kitts (+1869)' }, - { countryCode: 'SC', value: '1758', label: 'St. Lucia (+1758)' }, - { countryCode: 'SD', value: '249', label: 'Sudan (+249)' }, - { countryCode: 'SR', value: '597', label: 'Suriname (+597)' }, - { countryCode: 'SZ', value: '268', label: 'Swaziland (+268)' }, - { countryCode: 'SE', value: '46', label: 'Sweden (+46)' }, - { countryCode: 'CH', value: '41', label: 'Switzerland (+41)' }, - { countryCode: 'SI', value: '963', label: 'Syria (+963)' }, - { countryCode: 'TW', value: '886', label: 'Taiwan (+886)' }, - { countryCode: 'TJ', value: '7', label: 'Tajikstan (+7)' }, - { countryCode: 'TH', value: '66', label: 'Thailand (+66)' }, - { countryCode: 'TG', value: '228', label: 'Togo (+228)' }, - { countryCode: 'TO', value: '676', label: 'Tonga (+676)' }, - { countryCode: 'TT', value: '1868', label: 'Trinidad & Tobago (+1868)' }, - { countryCode: 'TN', value: '216', label: 'Tunisia (+216)' }, - { countryCode: 'TR', value: '90', label: 'Turkey (+90)' }, - { countryCode: 'TM', value: '7', label: 'Turkmenistan (+7)' }, - { countryCode: 'TM', value: '993', label: 'Turkmenistan (+993)' }, - { countryCode: 'TC', value: '1649', label: 'Turks & Caicos Islands (+1649)' }, - { countryCode: 'TV', value: '688', label: 'Tuvalu (+688)' }, - { countryCode: 'UG', value: '256', label: 'Uganda (+256)' }, - { countryCode: 'UA', value: '380', label: 'Ukraine (+380)' }, - { countryCode: 'AE', value: '971', label: 'United Arab Emirates (+971)' }, - { countryCode: 'UY', value: '598', label: 'Uruguay (+598)' }, - { countryCode: 'UZ', value: '7', label: 'Uzbekistan (+7)' }, - { countryCode: 'VU', value: '678', label: 'Vanuatu (+678)' }, - { countryCode: 'VA', value: '379', label: 'Vatican City (+379)' }, - { countryCode: 'VE', value: '58', label: 'Venezuela (+58)' }, - { countryCode: 'VN', value: '84', label: 'Vietnam (+84)' }, - { countryCode: 'VG', value: '84', label: 'Virgin Islands - British (+1284)' }, - { countryCode: 'VI', value: '84', label: 'Virgin Islands - US (+1340)' }, - { countryCode: 'WF', value: '681', label: 'Wallis and Futuna (+681)' }, - { countryCode: 'YE', value: '969', label: 'Yemen (North) (+969)' }, - { countryCode: 'YE', value: '967', label: 'Yemen (South) (+967)' }, - { countryCode: 'ZM', value: '260', label: 'Zambia (+260)' }, - { countryCode: 'ZW', value: '263', label: 'Zimbabwe (+263)' }, -]; - -export { countrylist, country }; diff --git a/packages/aws-amplify-angular/src/assets/data-test-attributes.ts b/packages/aws-amplify-angular/src/assets/data-test-attributes.ts deleted file mode 100644 index d08744bf9c7..00000000000 --- a/packages/aws-amplify-angular/src/assets/data-test-attributes.ts +++ /dev/null @@ -1,183 +0,0 @@ -// tslint:disable -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable -// Auth -const signIn = { - section: 'sign-in-section', - headerSection: 'sign-in-header-section', - bodySection: 'sign-in-body-section', - footerSection: 'sign-in-footer-section', - usernameInput: 'username-input', - passwordInput: 'sign-in-password-input', - forgotPasswordLink: 'sign-in-forgot-password-link', - signInButton: 'sign-in-sign-in-button', - createAccountLink: 'sign-in-create-account-link', - signInError: 'authenticator-error', -}; - -const signOut = { - button: 'sign-out-button', - section: 'sign-out-section', -}; - -const signUp = { - section: 'sign-up-section', - headerSection: 'sign-up-header-section', - bodySection: 'sign-up-body-section', - nonPhoneNumberInput: 'sign-up-non-phone-number-input', - phoneNumberInput: 'sign-up-phone-number-input', - dialCodeSelect: 'sign-up-dial-code-select', - footerSection: 'sign-up-footer-section', - createAccountButton: 'sign-up-create-account-button', - signInLink: 'sign-up-sign-in-link', - signUpButton: 'sign-up-sign-up-button', - signInButton: 'sign-up-sign-in-button', - confirmButton: 'sign-up-confirm-button', -}; - -const verifyContact = { - section: 'verify-contact-section', - headerSection: 'verify-contact-header-section', - bodySection: 'verify-contact-body-section', - submitButton: 'verify-contact-submit-button', - verifyButton: 'verify-contact-verify-button', - skipLink: 'verify-contact-skip-link', -}; - -const TOTPSetup = { - component: 'totp-setup-component', -}; - -const requireNewPassword = { - section: 'require-new-password-section', - headerSection: 'require-new-password-header-section', - footerSection: 'require-new-password-footer-section', - bodySection: 'require-new-password-body-section', - newPasswordInput: 'require-new-password-new-password-input', - backToSignInLink: 'require-new-password-back-to-sign-in-link', - submitButton: 'require-new-password-submit-button', -}; - -const loading = { - section: 'loading-secton', -}; - -const greetings = { - navBar: 'greetings-nav-bar', - nav: 'greetings-nav', - navRight: 'greetings-nav-right', -}; - -// TODO: Change Angular Component (Greeting) to match React Component (Greetings) -const greeting = { - signOutButton: 'sign-out-button', - signOutLink: 'greeting-sign-out-link', - navRight: 'greetings-nav-right', -}; - -const federatedSignIn = { - section: 'federated-sign-in-section', - bodySection: 'federated-sign-in-body-section', - signInButtons: 'federated-sign-in-buttons', -}; - -const confirmSignUp = { - section: 'confirm-sign-up-section', - headerSection: 'confirm-sign-up-header-section', - bodySection: 'confirm-sign-up-body-section', - usernameInput: 'confirm-sign-up-username-input', - confirmationCodeInput: 'confirm-sign-up-confirmation-code-input', - resendCodeLink: 'confirm-sign-up-resend-code-link', - confirmButton: 'confirm-sign-up-confirm-button', - backToSignInLink: 'confirm-sign-up-back-to-sign-in-link', -}; - -const confirmSignIn = { - section: 'confirm-sign-in-section', - headerSection: 'confirm-sign-in-header-section', - bodySection: 'confirm-sign-in-body-section', - codeInput: 'confirm-sign-in-code-input', - confirmButton: 'confirm-sign-in-confirm-button', - backToSignInLink: 'confirm-sign-in-back-to-sign-in-link', -}; - -const setMFAComp = { - section: 'set-mfa-section', - headerSection: 'set-mfa-header-section', - bodySection: 'set-mfa-header-body-section', - smsInput: 'set-mfa-sms-input', - totpInput: 'set-mfa-totp-input', - noMfaInput: 'set-mfa-nomfa-input', - verificationCodeInput: 'set-mfa-verification-code-input', - setMfaButton: 'set-mfa-set-mfa-button', - verifyTotpTokenButton: 'set-mfa-verify-totp-token-button', - cancelButton: 'set-mfa-cancel-button', -}; - -const forgotPassword = { - section: 'forgot-password-section', - headerSection: 'forgot-password-header-section', - bodySection: 'forgot-password-body-section', - submitButton: 'forgot-password-submit-button', - sendCodeButton: 'forgot-password-send-code-button', - resendCodeLink: 'forgot-password-resend-code-link', - backToSignInLink: 'forgot-password-back-to-sign-in-link', - usernameInput: 'username-input', - codeInput: 'forgot-password-code-input', - newPasswordInput: 'forgot-password-new-password-input', -}; - -export const sumerianScene = { - container: 'sumerian-scene-container', - sumerianScene: 'sumerian-scene', - loading: 'sumerian-scene-loading', - loadingLogo: 'sumerian-scene-loading-logo', - loadingSceneName: 'sumerian-scene-loading-scene-name', - loadingBar: 'sumerian-scene-loading-bar', - errorText: 'sumerian-scene-error-text', - bar: 'sumerian-scene-bar', - actions: 'sumerian-scene-actions', -}; - -export const genericAttrs = { - usernameInput: 'username-input', - emailInput: 'email-input', - phoneNumberInput: 'phone-number-input', - dialCodeSelect: 'dial-code-select', -}; - -export const chatBot = { - title: 'chatbot-title', - dialog: 'chatbot-dialog', - messageInput: 'chatbot-message-input', - sendMessageButton: 'chatbot-send-message-button', -}; - -export const auth = { - signIn, - signOut, - signUp, - verifyContact, - TOTPSetup, - requireNewPassword, - loading, - genericAttrs, - greetings, - greeting, - federatedSignIn, - confirmSignUp, - confirmSignIn, - setMFAComp, - forgotPassword, -}; diff --git a/packages/aws-amplify-angular/src/assets/default-sign-up-fields.ts b/packages/aws-amplify-angular/src/assets/default-sign-up-fields.ts deleted file mode 100644 index 33462f419b6..00000000000 --- a/packages/aws-amplify-angular/src/assets/default-sign-up-fields.ts +++ /dev/null @@ -1,88 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable -export default [ - { - label: 'Username', - key: 'username', - required: false, - displayOrder: 1, - }, - { - label: 'Password', - key: 'password', - required: true, - type: 'password', - displayOrder: 2, - }, - { - label: 'Email', - key: 'email', - required: true, - type: 'email', - displayOrder: 3, - }, - { - label: 'Phone Number', - key: 'phone_number', - required: true, - displayOrder: 4, - }, -]; - -export const signUpWithEmailFields = [ - { - label: 'Email', - key: 'email', - required: true, - type: 'email', - displayOrder: 1, - }, - { - label: 'Password', - key: 'password', - required: true, - type: 'password', - displayOrder: 2, - }, - { - label: 'Phone Number', - key: 'phone_number', - required: true, - displayOrder: 3, - }, -]; - -export const signUpWithPhoneNumberFields = [ - { - label: 'Phone Number', - key: 'phone_number', - required: true, - displayOrder: 1, - }, - { - label: 'Password', - key: 'password', - required: true, - type: 'password', - displayOrder: 2, - }, - { - label: 'Email', - key: 'email', - required: true, - type: 'email', - displayOrder: 3, - }, -]; diff --git a/packages/aws-amplify-angular/src/aws-amplify-angular.module.ts b/packages/aws-amplify-angular/src/aws-amplify-angular.module.ts deleted file mode 100644 index 6315c5499be..00000000000 --- a/packages/aws-amplify-angular/src/aws-amplify-angular.module.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 { NgModule, forwardRef } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -// tslint:disable:max-line-length -import { AuthenticatorComponent } from './components/authenticator/authenticator/authenticator.factory'; -import { AuthenticatorComponentCore } from './components/authenticator/authenticator/authenticator.component.core'; -import { ConfirmSignInComponent } from './components/authenticator/confirm-sign-in-component/confirm-sign-in.factory'; -import { ConfirmSignInComponentCore } from './components/authenticator/confirm-sign-in-component/confirm-sign-in-component.core'; -import { ConfirmSignUpComponent } from './components/authenticator/confirm-sign-up-component/confirm-sign-up.factory'; -import { ConfirmSignUpComponentCore } from './components/authenticator/confirm-sign-up-component/confirm-sign-up.component.core'; -import { SignInComponent } from './components/authenticator/sign-in-component/sign-in.component.factory'; -import { SignInComponentCore } from './components/authenticator/sign-in-component/sign-in.component.core'; -import { SignUpComponent } from './components/authenticator/sign-up-component/sign-up.factory'; -import { SignUpComponentCore } from './components/authenticator/sign-up-component/sign-up.component.core'; -import { RequireNewPasswordComponent } from './components/authenticator/require-new-password-component/require-new-password.factory'; -import { RequireNewPasswordComponentCore } from './components/authenticator/require-new-password-component/require-new-password.component.core'; -import { GreetingComponent } from './components/authenticator/greeting-component/greeting.factory'; -import { GreetingComponentCore } from './components/authenticator/greeting-component/greeting.component.core'; -import { ForgotPasswordComponent } from './components/authenticator/forgot-password-component/forgot-password.factory'; -import { ForgotPasswordComponentCore } from './components/authenticator/forgot-password-component/forgot-password.component.core'; -import { UsernameFieldComponentCore } from './components/authenticator/username-field-component/username-field.component.core'; -import { PhoneFieldComponentCore } from './components/authenticator/phone-field-component/phone-field.component.core'; -import { S3AlbumComponent } from './components/storage/s3-album-component/s3-album.factory'; -import { S3AlbumComponentCore } from './components/storage/s3-album-component/s3-album.component.core'; -import { S3ImageComponent } from './components/storage/s3-image-component/s3-image.factory'; -import { S3ImageComponentCore } from './components/storage/s3-image-component/s3-image.component.core'; -import { PhotoPickerComponent } from './components/storage/photo-picker-component/photo-picker.factory'; -import { PhotoPickerComponentCore } from './components/storage/photo-picker-component/photo-picker.component.core'; -import { ChatBotComponent } from './components/interactions/chatbot/chatbot.factory'; -import { ChatbotComponentCore } from './components/interactions/chatbot/chatbot.component.core'; -import { DynamicComponentDirective } from './directives/dynamic.component.directive'; -import { FormComponent } from './components/common/form.component'; -import { SumerianSceneComponent } from './components/xr/sumerian-scene-component/sumerian-scene.factory'; -import { SumerianSceneComponentCore } from './components/xr/sumerian-scene-component/sumerian-scene.component.core'; -import { SumerianSceneLoadingComponentCore } from './components/xr/sumerian-scene-component/sumerian-scene-loading.component.core'; -// tslint:enable:max-line-length - -const components = [ - AuthenticatorComponent, - AuthenticatorComponentCore, - ConfirmSignInComponent, - ConfirmSignInComponentCore, - ConfirmSignUpComponent, - ConfirmSignUpComponentCore, - SignInComponent, - SignInComponentCore, - SignUpComponent, - SignUpComponentCore, - RequireNewPasswordComponent, - RequireNewPasswordComponentCore, - GreetingComponent, - GreetingComponentCore, - ForgotPasswordComponent, - ForgotPasswordComponentCore, - UsernameFieldComponentCore, - PhoneFieldComponentCore, - S3AlbumComponent, - S3AlbumComponentCore, - S3ImageComponent, - S3ImageComponentCore, - PhotoPickerComponent, - PhotoPickerComponentCore, - ChatBotComponent, - ChatbotComponentCore, - FormComponent, - SumerianSceneComponent, - SumerianSceneComponentCore, - SumerianSceneLoadingComponentCore, -]; - -@NgModule({ - imports: [CommonModule, FormsModule], - declarations: [DynamicComponentDirective, ...components], - entryComponents: [...components], - providers: [], - exports: [...components], -}) -export class AmplifyAngularModule {} diff --git a/packages/aws-amplify-angular/src/aws-amplify-ionic-module.ts b/packages/aws-amplify-angular/src/aws-amplify-ionic-module.ts deleted file mode 100644 index 5b0a5a4cbeb..00000000000 --- a/packages/aws-amplify-angular/src/aws-amplify-ionic-module.ts +++ /dev/null @@ -1,66 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; -import { AmplifyService } from './providers/amplify.service'; -// tslint:disable:max-line-length -import { AuthenticatorIonicComponent } from './components/authenticator/authenticator/authenticator.component.ionic'; -import { ConfirmSignInComponentIonic } from './components/authenticator/confirm-sign-in-component/confirm-sign-in-component.ionic'; -import { ConfirmSignUpComponentIonic } from './components/authenticator/confirm-sign-up-component/confirm-sign-up.component.ionic'; -import { ForgotPasswordComponentIonic } from './components/authenticator/forgot-password-component/forgot-password.component.ionic'; -import { GreetingComponentIonic } from './components/authenticator/greeting-component/greeting.component.ionic'; -import { SignInComponentIonic } from './components/authenticator/sign-in-component/sign-in.component.ionic'; -import { SignUpComponentIonic } from './components/authenticator/sign-up-component/sign-up.component.ionic'; -import { PhoneFieldComponentIonic } from './components/authenticator/phone-field-component/phone-field.component.ionic'; -import { UsernameFieldComponentIonic } from './components/authenticator/username-field-component/username-field.component.ionic'; -import { RequireNewPasswordComponentIonic } from './components/authenticator/require-new-password-component/require-new-password.component.ionic'; -import { PhotoPickerIonicComponent } from './components/storage/photo-picker-component/photo-picker.component.ionic'; -import { S3AlbumComponentIonic } from './components/storage/s3-album-component/s3-album.component.ionic'; -import { S3ImageComponentIonic } from './components/storage/s3-image-component/s3-image.component.ionic'; -import { ChatbotComponentIonic } from './components/interactions/chatbot/chatbot.component.ionic'; -import { SumerianSceneComponentIonic } from './components/xr/sumerian-scene-component/sumerian-scene.component.ionic'; -import { SumerianSceneLoadingComponentIonic } from './components/xr/sumerian-scene-component/sumerian-scene-loading.component.ionic'; -// tslint:enable:max-line-length - -const components = [ - AuthenticatorIonicComponent, - ConfirmSignInComponentIonic, - ConfirmSignUpComponentIonic, - ForgotPasswordComponentIonic, - GreetingComponentIonic, - SignInComponentIonic, - SignUpComponentIonic, - UsernameFieldComponentIonic, - PhoneFieldComponentIonic, - RequireNewPasswordComponentIonic, - PhotoPickerIonicComponent, - S3AlbumComponentIonic, - S3ImageComponentIonic, - ChatbotComponentIonic, - SumerianSceneComponentIonic, - SumerianSceneLoadingComponentIonic, -]; - -@NgModule({ - imports: [CommonModule, FormsModule], - declarations: [...components], - entryComponents: [...components], - providers: [AmplifyService], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - exports: [...components], -}) -export class AmplifyIonicModule {} diff --git a/packages/aws-amplify-angular/src/components/authenticator/authenticator/authenticator.class.ts b/packages/aws-amplify-angular/src/components/authenticator/authenticator/authenticator.class.ts deleted file mode 100644 index 4f66d39a5a3..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/authenticator/authenticator.class.ts +++ /dev/null @@ -1,18 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export class AuthClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/authenticator/authenticator.component.core.ts b/packages/aws-amplify-angular/src/components/authenticator/authenticator/authenticator.component.core.ts deleted file mode 100644 index 02d5aa23ed3..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/authenticator/authenticator.component.core.ts +++ /dev/null @@ -1,149 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, ViewEncapsulation, OnInit } from '@angular/core'; -import { AmplifyService, AuthState } from '../../../providers'; - -const template = ` -
- - - - - - - - - - - - - -
-`; - -@Component({ - selector: 'amplify-authenticator-core', - template, -}) -export class AuthenticatorComponentCore implements OnInit { - authState: AuthState = { - state: 'loading', - user: null, - }; - _signUpConfig: any = {}; - _usernameAttributes: string = 'username'; - - constructor(public amplifyService: AmplifyService) { - this.subscribe(); - } - - ngOnInit() { - if (!this.amplifyService.auth()) { - throw new Error('Auth module not registered on AmplifyService provider'); - } else { - const loadStatus = this.amplifyService - .auth() - .currentAuthenticatedUser() - .then(user => { - if (this.authState.state === 'loading' && user) { - this.amplifyService.setAuthState({ state: 'signedIn', user }); - } - }) - .catch(e => { - if (this.authState.state === 'loading') { - this.amplifyService.setAuthState({ state: 'signIn', user: null }); - } - }); - } - } - - @Input() - hide: string[] = []; - - @Input() - set data(data: any) { - if (data.signUpConfig) { - this._signUpConfig = data.signUpConfig; - } - if (data.hide) { - this.hide = data.hide; - } - - this._usernameAttributes = - data.usernameAttributes || this._usernameAttributes || 'username'; - } - - @Input() - set signUpConfig(signUpConfig: any) { - this._signUpConfig = signUpConfig; - } - - @Input() - set usernameAttributes(usernameAttributes: string) { - this._usernameAttributes = usernameAttributes || 'username'; - } - - subscribe() { - this.amplifyService.authStateChange$.subscribe( - state => { - this.authState = state; - }, - () => { - this.authState = { - state: 'signIn', - user: null, - }; - } - ); - } - - shouldHide(comp) { - return this.hide.filter(item => item === comp).length > 0; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/authenticator/authenticator.component.ionic.ts b/packages/aws-amplify-angular/src/components/authenticator/authenticator/authenticator.component.ionic.ts deleted file mode 100644 index a797eff2c00..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/authenticator/authenticator.component.ionic.ts +++ /dev/null @@ -1,87 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - ViewEncapsulation, - Injector, - ElementRef, -} from '@angular/core'; - -import { AmplifyService, AuthState } from '../../../providers'; -import { AuthenticatorComponentCore } from './authenticator.component.core'; - -const template = ` -
- - - - - - - - - - - - - - -
-`; - -@Component({ - selector: 'amplify-authenticator-ionic', - template, -}) -export class AuthenticatorIonicComponent extends AuthenticatorComponentCore { - constructor(public amplifyService: AmplifyService) { - super(amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/authenticator/authenticator.factory.ts b/packages/aws-amplify-angular/src/components/authenticator/authenticator/authenticator.factory.ts deleted file mode 100644 index 17a7ee3a486..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/authenticator/authenticator.factory.ts +++ /dev/null @@ -1,79 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, -} from '@angular/core'; - -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { AuthClass } from './authenticator.class'; -import { AuthenticatorIonicComponent } from './authenticator.component.ionic'; -import { AuthenticatorComponentCore } from './authenticator.component.core'; - -@Component({ - selector: 'amplify-authenticator', - template: ` -
- -
- `, -}) -export class AuthenticatorComponent implements OnInit, OnDestroy { - @Input() framework: string; - @Input() hide: string[] = []; - @Input() signUpConfig: any; - @Input() usernameAttributes: string = 'username'; - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - const authComponent = - this.framework && this.framework.toLowerCase() === 'ionic' - ? new ComponentMount(AuthenticatorIonicComponent, { - hide: this.hide, - signUpConfig: this.signUpConfig, - usernameAttributes: this.usernameAttributes, - }) - : new ComponentMount(AuthenticatorComponentCore, { - hide: this.hide, - signUpConfig: this.signUpConfig, - usernameAttributes: this.usernameAttributes, - }); - - const componentFactory = this.componentFactoryResolver.resolveComponentFactory( - authComponent.component - ); - - const viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - const componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = authComponent.data; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/authenticator/index.ts b/packages/aws-amplify-angular/src/components/authenticator/authenticator/index.ts deleted file mode 100644 index 20b8b6febc9..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/authenticator/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export { AuthenticatorComponent } from './authenticator.factory'; -export { AuthClass } from './authenticator.class'; -export { AuthenticatorComponentCore } from './authenticator.component.core'; -export { AuthenticatorIonicComponent } from './authenticator.component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/authenticator/common.ts b/packages/aws-amplify-angular/src/components/authenticator/common.ts deleted file mode 100644 index c3dd3c6b3a1..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/common.ts +++ /dev/null @@ -1,28 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export function includes(ary, match) { - return ary.filter(item => item === match).length > 0; -} - -export const labelMap = { - email: 'Email', - phone_number: 'Phone Number', - username: 'Username', -}; - -export const composePhoneNumber = (countryCode, local_phone_number) => { - return `+${countryCode}${local_phone_number.replace(/[-()]/g, '')}`; -}; diff --git a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/confirm-sign-in-component.core.ts b/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/confirm-sign-in-component.core.ts deleted file mode 100644 index a86ab9d87f5..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/confirm-sign-in-component.core.ts +++ /dev/null @@ -1,149 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, OnInit, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
-
{{ this.amplifyService.i18n().get('Confirm Sign in') }}
-
- - -
-
- -
- -
-
-
-
-
-
- -
{{ this.amplifyService.i18n().get(errorMessage) }}
- × -
-
-
-`; - -@Component({ - selector: 'amplify-auth-confirm-sign-in-core', - template, -}) -export class ConfirmSignInComponentCore implements OnInit { - _authState: AuthState; - _show: boolean; - code: string; - errorMessage: string; - protected logger: any; - - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - this.logger = this.amplifyService.logger('ConfiSignInComponent'); - } - - @Input() - set data(data: any) { - this.hide = data.hide ? data.hide : this.hide; - this._authState = data.authState; - this._show = data.authState.state === 'confirmSignIn'; - } - - @Input() - set authState(authState: AuthState) { - this._authState = authState; - this._show = authState.state === 'confirmSignIn'; - } - - @Input() hide: string[] = []; - - ngOnInit() { - if (!this.amplifyService.auth()) { - throw new Error('Auth module not registered on AmplifyService provider'); - } - } - - shouldHide(comp) { - return this.hide.filter(item => item === comp).length > 0; - } - - setCode(code: string) { - this.code = code; - } - - onConfirm() { - const { user } = this._authState; - const { challengeName } = user; - const mfaType = - challengeName === 'SOFTWARE_TOKEN_MFA' ? challengeName : null; - this.amplifyService - .auth() - .confirmSignIn(user, this.code, mfaType) - .then(() => { - this.onAlertClose(); - this.amplifyService.setAuthState({ state: 'signedIn', user }); - }) - .catch(err => this._setError(err)); - } - - onSignIn() { - this.onAlertClose(); - this.amplifyService.setAuthState({ state: 'signIn', user: null }); - } - - onAlertClose() { - this._setError(null); - } - - _setError(err) { - if (!err) { - this.errorMessage = null; - return; - } - - this.errorMessage = err.message || err; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/confirm-sign-in-component.ionic.ts b/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/confirm-sign-in-component.ionic.ts deleted file mode 100644 index a3ea9f0a013..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/confirm-sign-in-component.ionic.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Component, Input, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { ConfirmSignInComponentCore } from './confirm-sign-in-component.core'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
- {{ this.amplifyService.i18n().get('Confirm your sign in code') }} -
- - - - {{ this.amplifyService.i18n().get('Code *') }} - - - - - -
-
- {{ this.amplifyService.i18n().get('Confirm Code') }} -
-
-
- -
-
- -
{{ this.amplifyService.i18n().get(errorMessage) }}
- × -
-
- -
-`; - -@Component({ - selector: 'amplify-auth-confirm-sign-in-ionic', - template, -}) -export class ConfirmSignInComponentIonic extends ConfirmSignInComponentCore { - _authState: AuthState; - _show: boolean; - code: string; - errorMessage: string; - - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - super(amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/confirm-sign-in.class.ts b/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/confirm-sign-in.class.ts deleted file mode 100644 index 0eed86cc77b..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/confirm-sign-in.class.ts +++ /dev/null @@ -1,18 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export class ConfirmSignInClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/confirm-sign-in.factory.ts b/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/confirm-sign-in.factory.ts deleted file mode 100644 index 343a420372b..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/confirm-sign-in.factory.ts +++ /dev/null @@ -1,76 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, -} from '@angular/core'; -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { ConfirmSignInClass } from './confirm-sign-in.class'; -import { ConfirmSignInComponentIonic } from './confirm-sign-in-component.ionic'; -import { ConfirmSignInComponentCore } from './confirm-sign-in-component.core'; -import { AuthState } from '../../../providers'; - -@Component({ - selector: 'amplify-auth-confirm-sign-in', - template: ` -
- -
- `, -}) -export class ConfirmSignInComponent implements OnInit, OnDestroy { - @Input() framework: String; - @Input() authState: AuthState; - @Input() hide: string[] = []; - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - const authComponent = - this.framework && this.framework.toLowerCase() === 'ionic' - ? new ComponentMount(ConfirmSignInComponentIonic, { - authState: this.authState, - hide: this.hide, - }) - : new ComponentMount(ConfirmSignInComponentCore, { - authState: this.authState, - hide: this.hide, - }); - - const componentFactory = this.componentFactoryResolver.resolveComponentFactory( - authComponent.component - ); - - const viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - const componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = authComponent.data; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/index.ts b/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/index.ts deleted file mode 100644 index 8f4196fefd6..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-in-component/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export { ConfirmSignInComponent } from './confirm-sign-in.factory'; -export { ConfirmSignInClass } from './confirm-sign-in.class'; -export { ConfirmSignInComponentCore } from './confirm-sign-in-component.core'; -export { ConfirmSignInComponentIonic } from './confirm-sign-in-component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.class.ts b/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.class.ts deleted file mode 100644 index f3fb11ca6f6..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.class.ts +++ /dev/null @@ -1,18 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export class ConfirmSignUpClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.component.core.ts b/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.component.core.ts deleted file mode 100644 index e6815294d50..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.component.core.ts +++ /dev/null @@ -1,194 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, OnInit, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { labelMap } from '../common'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
-
- {{ this.amplifyService.i18n().get('Confirm Sign up') }}
-
- - -
-
- - - {{ this.amplifyService.i18n().get('Lost your code?') }} - {{ this.amplifyService.i18n().get('Resend Code') }} -
-
- -
- -
-
-
-
-
-
- -
{{ this.amplifyService.i18n().get(errorMessage) }}
- × -
-
-
-`; - -@Component({ - selector: 'amplify-auth-confirm-sign-up-core', - template, -}) -export class ConfirmSignUpComponentCore implements OnInit { - _authState: AuthState; - _show: boolean; - _usernameAttributes: string = 'username'; - username: string; - code: string; - errorMessage: string; - protected logger: any; - - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - this.logger = this.amplifyService.logger('ConfirmSignUpComponent'); - } - - @Input() - set data(data: any) { - this.hide = data.hide ? data.hide : this.hide; - this._authState = data.authState; - this._show = data.authState.state === 'confirmSignUp'; - this.username = data.authState.user - ? data.authState.user.username || '' - : ''; - } - - @Input() hide: string[] = []; - - @Input() - set authState(authState: AuthState) { - this._authState = authState; - this._show = authState.state === 'confirmSignUp'; - - this.username = authState.user ? authState.user.username || '' : ''; - } - - @Input() - set usernameAttributes(usernameAttributes: string) { - this._usernameAttributes = usernameAttributes; - } - - ngOnInit() { - if (!this.amplifyService.auth()) { - throw new Error('Auth module not registered on AmplifyService provider'); - } - } - shouldHide(comp) { - return this.hide.filter(item => item === comp).length > 0; - } - - setUsername(username: string) { - this.username = username; - } - - setCode(code: string) { - this.code = code; - } - - onConfirm() { - this.amplifyService - .auth() - .confirmSignUp(this.username, this.code) - .then(() => this.logger.info('confirm success')) - .catch(err => this._setError(err)); - } - - onResend() { - this.amplifyService - .auth() - .resendSignUp(this.username) - .then(() => this.logger.info('code resent')) - .catch(err => this._setError(err)); - } - - onSignIn() { - this.onAlertClose(); - this.amplifyService.setAuthState({ state: 'signIn', user: null }); - } - - onAlertClose() { - this._setError(null); - } - - _setError(err) { - if (!err) { - this.errorMessage = null; - return; - } - - this.errorMessage = err.message || err; - } - - getUsernameLabel() { - return ( - labelMap[this._usernameAttributes as string] || this._usernameAttributes - ); - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.component.ionic.ts b/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.component.ionic.ts deleted file mode 100644 index 7f3f43935ef..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.component.ionic.ts +++ /dev/null @@ -1,117 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { ConfirmSignUpComponentCore } from './confirm-sign-up.component.core'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
- {{ this.amplifyService.i18n().get('Confirm your sign up code') }} -
- - - - {{ this.amplifyService.i18n().get(getUsernameLabel()) }} - - - - - - - {{ this.amplifyService.i18n().get('Code *') }} - - - - - -
-
- - {{ this.amplifyService.i18n().get('Confirm Code') }} -
-
- - -
-
-
- -
-
- -
{{ this.amplifyService.i18n().get(errorMessage) }}
- × -
-
- -
-`; - -@Component({ - selector: 'amplify-auth-confirm-sign-up-ionic', - template, -}) -export class ConfirmSignUpComponentIonic extends ConfirmSignUpComponentCore { - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - super(amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.factory.ts b/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.factory.ts deleted file mode 100644 index e3c78a382ef..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.factory.ts +++ /dev/null @@ -1,79 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, -} from '@angular/core'; -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { ConfirmSignUpClass } from './confirm-sign-up.class'; -import { ConfirmSignUpComponentIonic } from './confirm-sign-up.component.ionic'; -import { ConfirmSignUpComponentCore } from './confirm-sign-up.component.core'; -import { AuthState } from '../../../providers'; - -@Component({ - selector: 'amplify-auth-confirm-sign-up', - template: ` -
- -
- `, -}) -export class ConfirmSignUpComponent implements OnInit, OnDestroy { - @Input() framework: string; - @Input() authState: AuthState; - @Input() usernameAttributes: string = 'username'; - @Input() hide: string[] = []; - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - const authComponent = - this.framework && this.framework.toLowerCase() === 'ionic' - ? new ComponentMount(ConfirmSignUpComponentIonic, { - authState: this.authState, - usernameAttributes: this.usernameAttributes, - hide: this.hide, - }) - : new ComponentMount(ConfirmSignUpComponentCore, { - authState: this.authState, - usernameAttributes: this.usernameAttributes, - hide: this.hide, - }); - - const componentFactory = this.componentFactoryResolver.resolveComponentFactory( - authComponent.component - ); - - const viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - const componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = authComponent.data; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/index.ts b/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/index.ts deleted file mode 100644 index b9e55b4f08a..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export { ConfirmSignUpComponent } from './confirm-sign-up.factory'; -export { ConfirmSignUpClass } from './confirm-sign-up.class'; -export { ConfirmSignUpComponentCore } from './confirm-sign-up.component.core'; -export { ConfirmSignUpComponentIonic } from './confirm-sign-up.component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/forgot-password.class.ts b/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/forgot-password.class.ts deleted file mode 100644 index 191fb3dcc94..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/forgot-password.class.ts +++ /dev/null @@ -1,18 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export class ForgotPasswordClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/forgot-password.component.core.ts b/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/forgot-password.component.core.ts deleted file mode 100644 index 5fd3eb0c745..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/forgot-password.component.core.ts +++ /dev/null @@ -1,270 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable -import { UsernameAttributes, UsernameFieldOutput } from '../types'; -import { Component, Input, OnInit, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { labelMap, composePhoneNumber } from '../common'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
-
- {{ this.amplifyService.i18n().get('Reset your password') }} -
-
- {{ this.amplifyService.i18n().get('You will receive a verification code') }} -
-
- {{ this.amplifyService.i18n().get('Enter the code you received and set a new password') }} -
- -
- - -
-
- - -
-
-
- - -
- -
-
-
-
-
- -
{{ this.amplifyService.i18n().get(errorMessage) }}
- × -
-
-
-`; - -@Component({ - selector: 'amplify-auth-forgot-password-core', - template, -}) -export class ForgotPasswordComponentCore implements OnInit { - _authState: AuthState; - _show: boolean; - _usernameAttributes: string = 'username'; - username: string; - code: string; - password: string; - errorMessage: string; - code_sent = false; - protected logger: any; - local_phone_number: string; - country_code: string = '1'; - email: string; - - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - this.logger = this.amplifyService.logger('ForgotPasswordComponent'); - } - - @Input() - set data(data: any) { - this._authState = data.authState; - this._show = data.authState.state === 'forgotPassword'; - this._usernameAttributes = data.usernameAttributes; - this.hide = data.hide ? data.hide : this.hide; - - this.username = - data.authState.user && data.authState.user.username - ? data.authState.user.username - : ''; - } - - @Input() hide: string[] = []; - - shouldHide(comp) { - return this.hide.filter(item => item === comp).length > 0; - } - - @Input() - set authState(authState: AuthState) { - this._authState = authState; - this._show = authState.state === 'forgotPassword'; - - this.email = - authState.user && authState.user.email ? authState.user.email : ''; - this.country_code = - authState.user && authState.user.contry_code - ? authState.user.country_code - : '1'; - this.local_phone_number = - authState.user && authState.user.local_phone_number - ? authState.user.local_phone_number - : ''; - this.username = - authState.user && authState.user.username ? authState.user.username : ''; - } - - ngOnInit() { - if (!this.amplifyService.auth()) { - throw new Error('Auth module not registered on AmplifyService provider'); - } - } - - @Input() - set usernameAttributes(usernameAttributes: string) { - this._usernameAttributes = usernameAttributes; - } - - setCode(code: string) { - this.code = code; - } - - setPassword(password: string) { - this.password = password; - } - - getforgotPwUsername() { - switch (this._usernameAttributes) { - case UsernameAttributes.EMAIL: - return this.email; - case UsernameAttributes.PHONE_NUMBER: - return composePhoneNumber(this.country_code, this.local_phone_number); - default: - return this.username; - } - } - - onSend() { - let forgotPwUsername = this.getforgotPwUsername(); - if (!forgotPwUsername) { - this.errorMessage = 'Username cannot be empty'; - return; - } - this.amplifyService - .auth() - .forgotPassword(forgotPwUsername) - .then(() => { - this.code_sent = true; - }) - .catch(err => { - this._setError(err); - this.code_sent = false; - }); - } - - onSubmit() { - this.amplifyService - .auth() - .forgotPasswordSubmit( - this.getforgotPwUsername(), - this.code, - this.password - ) - .then(() => { - const user = { username: this.username }; - this.onAlertClose(); - this.amplifyService.setAuthState({ state: 'signIn', user }); - }) - .catch(err => this._setError(err)); - } - - onSignIn() { - this.onAlertClose(); - this.amplifyService.setAuthState({ state: 'signIn', user: null }); - } - - onAlertClose() { - this._setError(null); - } - - _setError(err) { - if (!err) { - this.errorMessage = null; - return; - } - - this.errorMessage = err.message || err; - } - - getUsernameLabel() { - return ( - labelMap[this._usernameAttributes as string] || this._usernameAttributes - ); - } - - onUsernameFieldChanged(event: UsernameFieldOutput) { - this.email = event.email || this.email; - this.username = event.username || this.username; - this.country_code = event.country_code || this.country_code; - this.local_phone_number = - event.local_phone_number || this.local_phone_number; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/forgot-password.component.ionic.ts b/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/forgot-password.component.ionic.ts deleted file mode 100644 index 5ffcae2887f..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/forgot-password.component.ionic.ts +++ /dev/null @@ -1,139 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { ForgotPasswordComponentCore } from './forgot-password.component.core'; -import { includes } from '../common'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
- {{ this.amplifyService.i18n().get('Reset your password') }} -
-
- {{ this.amplifyService.i18n().get('You will receive a verification code to reset your password') }} -
- - - - - - {{ this.amplifyService.i18n().get('Code *') }} - - - - - - {{ this.amplifyService.i18n().get('Password *') }} - - - - -
-
- - {{ this.amplifyService.i18n().get('Submit') }} - {{ this.amplifyService.i18n().get('Verify') }} -
-
- - -
-
-
-
-
- -
{{ this.amplifyService.i18n().get(errorMessage) }}
- × -
-
- -
-`; - -@Component({ - selector: 'amplify-auth-forgot-password-ionic', - template, -}) -export class ForgotPasswordComponentIonic extends ForgotPasswordComponentCore { - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - super(amplifyService); - } - - onCodeChange(val) { - this.country_code = val; - } - - onNumberChange(val) { - this.local_phone_number = val; - } - - setUsername(username: string) { - this.username = username; - } - - setEmail(email: string) { - this.email = email; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/forgot-password.factory.ts b/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/forgot-password.factory.ts deleted file mode 100644 index bd92171d8b9..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/forgot-password.factory.ts +++ /dev/null @@ -1,79 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, -} from '@angular/core'; -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { ForgotPasswordClass } from './forgot-password.class'; -import { ForgotPasswordComponentIonic } from './forgot-password.component.ionic'; -import { ForgotPasswordComponentCore } from './forgot-password.component.core'; -import { AuthState } from '../../../providers'; - -@Component({ - selector: 'amplify-auth-forgot-password', - template: ` -
- -
- `, -}) -export class ForgotPasswordComponent implements OnInit, OnDestroy { - @Input() framework: string; - @Input() authState: AuthState; - @Input() usernameAttributes: string = 'username'; - @Input() hide: string[] = []; - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - const authComponent = - this.framework && this.framework.toLowerCase() === 'ionic' - ? new ComponentMount(ForgotPasswordComponentIonic, { - authState: this.authState, - hide: this.hide, - usernameAttributes: this.usernameAttributes, - }) - : new ComponentMount(ForgotPasswordComponentCore, { - authState: this.authState, - hide: this.hide, - usernameAttributes: this.usernameAttributes, - }); - - const componentFactory = this.componentFactoryResolver.resolveComponentFactory( - authComponent.component - ); - - const viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - const componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = authComponent.data; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/index.ts b/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/index.ts deleted file mode 100644 index 2c80f42dea9..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/forgot-password-component/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export { ForgotPasswordComponent } from './forgot-password.factory'; -export { ForgotPasswordClass } from './forgot-password.class'; -export { ForgotPasswordComponentCore } from './forgot-password.component.core'; -export { - ForgotPasswordComponentIonic, -} from './forgot-password.component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/authenticator/greeting-component/greeting.class.ts b/packages/aws-amplify-angular/src/components/authenticator/greeting-component/greeting.class.ts deleted file mode 100644 index 76845d7ce6f..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/greeting-component/greeting.class.ts +++ /dev/null @@ -1,18 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export class GreetingClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/greeting-component/greeting.component.core.ts b/packages/aws-amplify-angular/src/components/authenticator/greeting-component/greeting.component.core.ts deleted file mode 100644 index e2e6f929501..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/greeting-component/greeting.component.core.ts +++ /dev/null @@ -1,98 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { UsernameAttributes } from '../types'; -import { Component, Input, OnInit, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` - -`; - -@Component({ - selector: 'amplify-auth-greetings-core', - template, -}) -export class GreetingComponentCore implements OnInit { - signedIn: boolean; - greeting: string; - _usernameAttributes: string = 'username'; - protected logger: any; - - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - this.logger = this.amplifyService.logger('GreetingComponent'); - this.subscribe(); - } - - @Input() - authState: AuthState; - - @Input() - set usernameAttributes(usernameAttributes: string) { - this._usernameAttributes = usernameAttributes; - } - - ngOnInit() { - if (!this.amplifyService.auth()) { - throw new Error('Auth module not registered on AmplifyService provider'); - } - } - - subscribe() { - this.amplifyService.authStateChange$.subscribe(state => - this.setAuthState(state) - ); - } - - setAuthState(authState: AuthState) { - this.authState = authState; - this.signedIn = authState.state === 'signedIn'; - - let username = ''; - if (authState.user) { - if (this._usernameAttributes === UsernameAttributes.EMAIL) { - username = authState.user.attributes - ? authState.user.attributes.email - : authState.user.username; - } else if (this._usernameAttributes === UsernameAttributes.PHONE_NUMBER) { - username = authState.user.attributes - ? authState.user.attributes.phone_number - : authState.user.username; - } else { - username = authState.user.username; - } - } - - this.greeting = this.signedIn - ? this.amplifyService - .i18n() - .get('Hello, {{username}}') - .replace('{{username}}', username) - : ''; - } - - onSignOut() { - this.amplifyService.auth().signOut(); - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/greeting-component/greeting.component.ionic.ts b/packages/aws-amplify-angular/src/components/authenticator/greeting-component/greeting.component.ionic.ts deleted file mode 100644 index 5484f340a18..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/greeting-component/greeting.component.ionic.ts +++ /dev/null @@ -1,44 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { GreetingComponentCore } from './greeting.component.core'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
{{ greeting }}
-
- {{ this.amplifyService.i18n().get('Sign Out') }} -
-`; - -@Component({ - selector: 'amplify-auth-greetings-ionic', - template, -}) -export class GreetingComponentIonic extends GreetingComponentCore { - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - super(amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/greeting-component/greeting.factory.ts b/packages/aws-amplify-angular/src/components/authenticator/greeting-component/greeting.factory.ts deleted file mode 100644 index 146cd32063f..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/greeting-component/greeting.factory.ts +++ /dev/null @@ -1,77 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, -} from '@angular/core'; - -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { GreetingClass } from './greeting.class'; -import { GreetingComponentIonic } from './greeting.component.ionic'; -import { GreetingComponentCore } from './greeting.component.core'; -import { AuthState } from '../../../providers'; - -@Component({ - selector: 'amplify-auth-greetings', - template: ` -
- -
- `, -}) -export class GreetingComponent implements OnInit, OnDestroy { - @Input() framework: string; - @Input() authState: AuthState; - @Input() usernameAttributes: string = 'username'; - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - let authComponent = - this.framework && this.framework.toLowerCase() === 'ionic' - ? new ComponentMount(GreetingComponentIonic, { - authState: this.authState, - usernameAttributes: this.usernameAttributes, - }) - : new ComponentMount(GreetingComponentCore, { - authState: this.authState, - usernameAttributes: this.usernameAttributes, - }); - - const componentFactory = this.componentFactoryResolver.resolveComponentFactory( - authComponent.component - ); - - const viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - const componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = authComponent.data; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/greeting-component/index.ts b/packages/aws-amplify-angular/src/components/authenticator/greeting-component/index.ts deleted file mode 100644 index 8c24236dfdc..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/greeting-component/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export { GreetingComponent } from './greeting.factory'; -export { GreetingClass } from './greeting.class'; -export { GreetingComponentCore } from './greeting.component.core'; -export { GreetingComponentIonic } from './greeting.component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/authenticator/phone-field-component/phone-field.component.core.ts b/packages/aws-amplify-angular/src/components/authenticator/phone-field-component/phone-field.component.core.ts deleted file mode 100644 index 806dd0eac03..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/phone-field-component/phone-field.component.core.ts +++ /dev/null @@ -1,141 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - EventEmitter, - Inject, - Output, -} from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { PhoneFieldOutput } from '../types'; -import { countrylist, country } from '../../../assets/countries'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
- -
-
- -
-
- -
-
-
-`; - -@Component({ - selector: 'amplify-auth-phone-field-core', - template, -}) -export class PhoneFieldComponentCore implements OnInit { - _placeholder: string = ''; - _label: string = 'Phone Number'; - _required: boolean = true; - _country_code: string = '1'; - _local_phone_number: string = ''; - _countries: country[]; - - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - this._countries = countrylist; - } - - @Input() - set data(data: any) { - this._placeholder = data.placeholder || this._placeholder; - this._label = data.label || this._label; - this._country_code = data.defaultCountryCode || this._country_code; - this._required = - data.required === undefined ? this._required : data.required; - } - - @Input() - set placeholder(placeholder: string) { - this._placeholder = placeholder; - } - - @Input() - set label(label: string) { - this._label = label; - } - - @Input() - set required(required: boolean) { - this._required = required; - } - - @Input() - set defaultCountryCode(defaultCountryCode: string) { - this._country_code = defaultCountryCode; - } - - @Output() - phoneFieldChanged: EventEmitter = new EventEmitter< - PhoneFieldOutput - >(); - - ngOnInit() {} - - ngOnDestroy() {} - - setCountryCode(country_code: string) { - this._country_code = country_code; - this.phoneFieldChanged.emit({ - country_code: this._country_code, - local_phone_number: this._local_phone_number, - }); - } - - setLocalPhoneNumber(local_phone_number: string) { - this._local_phone_number = local_phone_number; - this.phoneFieldChanged.emit({ - country_code: this._country_code, - local_phone_number: this._local_phone_number, - }); - } - - getPlaceholder() { - return this.amplifyService - .i18n() - .get(`Enter your phone number` || this._placeholder); - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/phone-field-component/phone-field.component.ionic.ts b/packages/aws-amplify-angular/src/components/authenticator/phone-field-component/phone-field.component.ionic.ts deleted file mode 100644 index 776c9b526f6..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/phone-field-component/phone-field.component.ionic.ts +++ /dev/null @@ -1,67 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, Inject } from '@angular/core'; -import { PhoneFieldComponentCore } from './phone-field.component.core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` - - - - - {{ this.amplifyService.i18n().get(this._label) }} - * - - - - {{country.label}} - - - - -   - - - -`; - -@Component({ - selector: 'amplify-auth-phone-field-ionic', - template, -}) -export class PhoneFieldComponentIonic extends PhoneFieldComponentCore { - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - super(amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/index.ts b/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/index.ts deleted file mode 100644 index 8acdbb2de97..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export { RequireNewPasswordComponent } from './require-new-password.factory'; -export { RequireNewPasswordClass } from './require-new-password.class'; -export { - RequireNewPasswordComponentCore, -} from './require-new-password.component.core'; -export { - RequireNewPasswordComponentIonic, -} from './require-new-password.component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/require-new-password.class.ts b/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/require-new-password.class.ts deleted file mode 100644 index 5798ebe1687..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/require-new-password.class.ts +++ /dev/null @@ -1,18 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export class RequireNewPasswordClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/require-new-password.component.core.ts b/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/require-new-password.component.core.ts deleted file mode 100644 index 822102710f1..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/require-new-password.component.core.ts +++ /dev/null @@ -1,141 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, OnInit, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
-
- {{ this.amplifyService.i18n().get('You are required to update your password') }} -
-
- - -
-
- -
- -
-
-
-
-
-
- -
{{ this.amplifyService.i18n().get(errorMessage) }}
- × -
-
-
-`; - -@Component({ - selector: 'amplify-auth-require-new-password-core', - template, -}) -export class RequireNewPasswordComponentCore implements OnInit { - _authState: AuthState; - _show: boolean; - password: string; - errorMessage: string; - protected logger: any; - - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - this.logger = this.amplifyService.logger('RequireNewPasswordComponent'); - } - - @Input() - set authState(authState: AuthState) { - this._authState = authState; - this._show = authState.state === 'requireNewPassword'; - } - - @Input() hide: string[] = []; - - @Input() - set data(data: any) { - this._authState = data.authState; - this._show = data.authState.state === 'requireNewPassword'; - this.hide = data.hide ? data.hide : this.hide; - } - - ngOnInit() { - if (!this.amplifyService.auth()) { - throw new Error('Auth module not registered on AmplifyService provider'); - } - } - - shouldHide(comp) { - return this.hide.filter(item => item === comp).length > 0; - } - - setPassword(password: string) { - this.password = password; - } - - onSubmit() { - const { user } = this._authState; - const { requiredAttributes } = user.challengeParam; - this.amplifyService - .auth() - .completeNewPassword(user, this.password, requiredAttributes) - .then(() => { - this.onAlertClose(); - this.amplifyService.setAuthState({ state: 'signIn', user }); - }) - .catch(err => this._setError(err)); - } - - onSignIn() { - this.onAlertClose(); - this.amplifyService.setAuthState({ state: 'signIn', user: null }); - } - - onAlertClose() { - this._setError(null); - } - - _setError(err) { - if (!err) { - this.errorMessage = null; - return; - } - - this.errorMessage = err.message || err; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/require-new-password.component.ionic.ts b/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/require-new-password.component.ionic.ts deleted file mode 100644 index 57f2c5e9a7b..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/require-new-password.component.ionic.ts +++ /dev/null @@ -1,87 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { RequireNewPasswordComponentCore } from './require-new-password.component.core'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
- {{ this.amplifyService.i18n().get('Reset your password') }} -
- - - - {{ this.amplifyService.i18n().get('Password') }} - - - - - - -
-
- {{ this.amplifyService.i18n().get('Back to Sign In') }} -
-
- Submit -
-
-
-
-
- -
{{ errorMessage }}
- × -
-
-
-`; - -@Component({ - selector: 'amplify-auth-require-new-password-ionic', - template, -}) -export class RequireNewPasswordComponentIonic extends RequireNewPasswordComponentCore { - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - super(amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/require-new-password.factory.ts b/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/require-new-password.factory.ts deleted file mode 100644 index fb1cec7f7bb..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/require-new-password-component/require-new-password.factory.ts +++ /dev/null @@ -1,77 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, -} from '@angular/core'; -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { RequireNewPasswordClass } from './require-new-password.class'; -import { RequireNewPasswordComponentIonic } from './require-new-password.component.ionic'; -import { RequireNewPasswordComponentCore } from './require-new-password.component.core'; -import { AuthState } from '../../../providers'; - -@Component({ - selector: 'amplify-auth-require-new-password', - template: ` -
- -
- `, -}) -export class RequireNewPasswordComponent implements OnInit, OnDestroy { - @Input() framework: string; - @Input() authState: AuthState; - @Input() hide: string[] = []; - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - const requireNewPasswordComponent = - this.framework && this.framework.toLowerCase() === 'ionic' - ? new ComponentMount(RequireNewPasswordComponentIonic, { - authState: this.authState, - hide: this.hide, - }) - : new ComponentMount(RequireNewPasswordComponentCore, { - authState: this.authState, - hide: this.hide, - }); - - const componentFactory = this.componentFactoryResolver.resolveComponentFactory( - requireNewPasswordComponent.component - ); - - const viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - const componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = - requireNewPasswordComponent.data; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/index.ts b/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/index.ts deleted file mode 100644 index a5eddbd1933..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export { SignInComponent } from './sign-in.component.factory'; -export { SignInClass } from './sign-in.class'; -export { SignInComponentCore } from './sign-in.component.core'; -export { SignInComponentIonic } from './sign-in.component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/sign-in.class.ts b/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/sign-in.class.ts deleted file mode 100644 index 8d19183f7fa..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/sign-in.class.ts +++ /dev/null @@ -1,18 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export class SignInClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/sign-in.component.core.ts b/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/sign-in.component.core.ts deleted file mode 100644 index 3fba3548fe8..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/sign-in.component.core.ts +++ /dev/null @@ -1,253 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, OnInit, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { includes, labelMap, composePhoneNumber } from '../common'; -import { UsernameAttributes, UsernameFieldOutput } from '../types'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
-
- {{ this.amplifyService.i18n().get('Sign in to your account') }} -
- - -
-
- -
-
- -
-
-
-
-
-
- -
- {{ this.amplifyService.i18n().get(errorMessage) }}
- × -
-
-
-`; - -@Component({ - selector: 'amplify-auth-sign-in-core', - template, -}) -export class SignInComponentCore implements OnInit { - _authState: AuthState; - _show: boolean; - _usernameAttributes: string = 'username'; - username: string; - password: string; - errorMessage: string; - local_phone_number: string = ''; - country_code: string = '1'; - email: string = ''; - - signInUsername = ''; - protected logger: any; - - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - this.logger = this.amplifyService.logger('SignInComponent'); - this.onUsernameFieldChanged = this.onUsernameFieldChanged.bind(this); - } - - @Input() - set data(data: any) { - this.hide = data.hide ? data.hide : this.hide; - this._usernameAttributes = data.usernameAttributes; - this._authState = data.authState; - this._show = includes( - ['signIn', 'signedOut', 'signedUp'], - data.authState.state - ); - } - - @Input() hide: string[] = []; - - @Input() - set authState(authState: AuthState) { - this._authState = authState; - this._show = includes(['signIn', 'signedOut', 'signedUp'], authState.state); - this.username = authState.user ? authState.user.username || '' : ''; - this.email = authState.user ? authState.user.email || '' : ''; - this.country_code = - authState.user && authState.user.country_code - ? authState.user.country_code - : this.country_code; - this.local_phone_number = authState.user - ? authState.user.local_phone_number || '' - : ''; - } - - @Input() - set usernameAttributes(usernameAttributes: string) { - this._usernameAttributes = usernameAttributes; - } - - ngOnInit() { - if (!this.amplifyService.auth()) { - throw new Error('Auth module not registered on AmplifyService provider'); - } - } - - shouldHide(comp) { - return this.hide.filter(item => item === comp).length > 0; - } - - setUsername(username: string) { - this.username = username; - } - - setPassword(password: string) { - this.password = password; - } - - onSignIn() { - this.amplifyService - .auth() - .signIn(this.getSignInUsername(), this.password) - .then(user => { - if ( - user['challengeName'] === 'SMS_MFA' || - user['challengeName'] === 'SOFTWARE_TOKEN_MFA' - ) { - this.amplifyService.setAuthState({ state: 'confirmSignIn', user }); - } else if (user['challengeName'] === 'NEW_PASSWORD_REQUIRED') { - this.amplifyService.setAuthState({ - state: 'requireNewPassword', - user, - }); - } else if ( - user['challengeName'] === 'CUSTOM_CHALLENGE' && - user.challengeParam && - user.challengeParam.trigger === 'true' - ) { - this.amplifyService.setAuthState({ - state: 'customConfirmSignIn', - user, - }); - } - }) - .catch(err => { - this._setError(err); - }); - } - - onAlertClose() { - this._setError(null); - } - - getUserObj() { - const user = - this.username || this.email || this.local_phone_number - ? { - username: this.username, - email: this.email, - local_phone_number: this.local_phone_number, - courtry_code: this.country_code, - } - : null; - - return user; - } - - onForgotPassword() { - const user = this.getUserObj(); - this.onAlertClose(); - this.amplifyService.setAuthState({ state: 'forgotPassword', user }); - } - - onSignUp() { - const user = this.getUserObj(); - this.onAlertClose(); - this.amplifyService.setAuthState({ state: 'signUp', user }); - } - - _setError(err) { - if (!err) { - this.errorMessage = null; - return; - } - this.errorMessage = err.message || err; - this.logger.error(this.errorMessage); - } - - onUsernameFieldChanged(event: UsernameFieldOutput) { - this.email = event.email || this.email; - this.username = event.username || this.username; - this.country_code = event.country_code || this.country_code; - this.local_phone_number = - event.local_phone_number || this.local_phone_number; - } - - getSignInUsername() { - switch (this._usernameAttributes) { - case UsernameAttributes.EMAIL: - return this.email; - case UsernameAttributes.PHONE_NUMBER: - return composePhoneNumber(this.country_code, this.local_phone_number); - default: - return this.username; - } - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/sign-in.component.factory.ts b/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/sign-in.component.factory.ts deleted file mode 100644 index 724d64f77f9..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/sign-in.component.factory.ts +++ /dev/null @@ -1,79 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, -} from '@angular/core'; -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { SignInClass } from './sign-in.class'; -import { SignInComponentIonic } from './sign-in.component.ionic'; -import { SignInComponentCore } from './sign-in.component.core'; -import { AuthState } from '../../../providers'; - -@Component({ - selector: 'amplify-auth-sign-in', - template: ` -
- -
- `, -}) -export class SignInComponent implements OnInit, OnDestroy { - @Input() framework: string; - @Input() authState: AuthState; - @Input() usernameAttributes: string = 'username'; - @Input() hide: string[] = []; - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - let authComponent = - this.framework && this.framework === 'ionic' - ? new ComponentMount(SignInComponentIonic, { - authState: this.authState, - hide: this.hide, - usernameAttributes: this.usernameAttributes, - }) - : new ComponentMount(SignInComponentCore, { - authState: this.authState, - hide: this.hide, - usernameAttributes: this.usernameAttributes, - }); - - const componentFactory = this.componentFactoryResolver.resolveComponentFactory( - authComponent.component - ); - - const viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - const componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = authComponent.data; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/sign-in.component.ionic.ts b/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/sign-in.component.ionic.ts deleted file mode 100644 index 433e3a46fac..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/sign-in-component/sign-in.component.ionic.ts +++ /dev/null @@ -1,98 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { SignInComponentCore } from './sign-in.component.core'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
- {{ this.amplifyService.i18n().get('Sign in to your account') }} -
- - - - - {{ this.amplifyService.i18n().get('Password *') }} - - - - -
-
- {{ this.amplifyService.i18n().get('Sign In') }} -
- - - -
-
- -
-
- -
{{ this.amplifyService.i18n().get(errorMessage) }}
- × -
-
-
-`; - -@Component({ - selector: 'amplify-auth-sign-in-ionic', - template, -}) -export class SignInComponentIonic extends SignInComponentCore { - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - super(amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/index.ts b/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/index.ts deleted file mode 100644 index df10b1541d7..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export { SignUpComponent } from './sign-up.factory'; -export { SignUpClass } from './sign-up.class'; -export { SignUpComponentCore } from './sign-up.component.core'; -export { SignUpComponentIonic } from './sign-up.component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/sign-up.class.ts b/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/sign-up.class.ts deleted file mode 100644 index f99ccf87a73..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/sign-up.class.ts +++ /dev/null @@ -1,17 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable -export class SignUpClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/sign-up.component.core.ts b/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/sign-up.component.core.ts deleted file mode 100644 index 63f5f37c69f..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/sign-up.component.core.ts +++ /dev/null @@ -1,423 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, OnInit, Inject } from '@angular/core'; -import defaultSignUpFieldAssets, { - signUpWithEmailFields, - signUpWithPhoneNumberFields, -} from '../../../assets/default-sign-up-fields'; -import { UsernameAttributes, PhoneFieldOutput } from '../types'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { labelMap, composePhoneNumber } from '../common'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
-
{{ this.amplifyService.i18n().get(this.header) }}
-
-
- - -
- {{passwordPolicy}} -
-
-
- -
-
-
-
- -
-
- -
-
-
-
-
-
- -
{{ this.amplifyService.i18n().get(errorMessage) }}
- × -
-
-
-`; - -export class SignUpField { - label: string; - key: string; - required?: boolean; - type?: string; - displayOrder?: number; - invalid?: boolean; - custom?: boolean; - signUpWith?: boolean; -} - -@Component({ - selector: 'amplify-auth-sign-up-core', - template, -}) -export class SignUpComponentCore implements OnInit { - _authState: AuthState; - _show: boolean; - _signUpConfig: any; - _usernameAttributes: string = 'username'; - user: any = {}; - local_phone_number: string = ''; - country_code: string = '1'; - header: string = 'Create a new account'; - defaultSignUpFields: SignUpField[] = defaultSignUpFieldAssets; - signUpFields: SignUpField[] = this.defaultSignUpFields; - errorMessage: string; - hiddenFields: any = []; - passwordPolicy: string; - defaultCountryCode: string; - protected logger: any; - - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - this.logger = this.amplifyService.logger('SignUpComponent'); - } - - @Input() - set data(data: any) { - this._authState = data.authState; - this._show = data.authState.state === 'signUp'; - this._usernameAttributes = data.usernameAttributes; - if (data.signUpConfig) { - this._signUpConfig = data.signUpConfig; - if (this._signUpConfig.defaultCountryCode) { - this.country_code = this._signUpConfig.defaultCountryCode; - } - if (this._signUpConfig.signUpFields) { - this.signUpFields = this._signUpConfig.signUpFields; - } - if (this._signUpConfig.header) { - this.header = this._signUpConfig.header; - } - if (this._signUpConfig.hiddenDefaults) { - this.hiddenFields = this._signUpConfig.hiddenDefaults; - } - - if (this._usernameAttributes === UsernameAttributes.EMAIL) { - this.signUpFields = signUpWithEmailFields; - this.defaultSignUpFields = signUpWithEmailFields; - } else if (this._usernameAttributes === UsernameAttributes.PHONE_NUMBER) { - this.signUpFields = signUpWithPhoneNumberFields; - this.defaultSignUpFields = signUpWithPhoneNumberFields; - } - - if (this._signUpConfig.passwordPolicy) { - this.passwordPolicy = this._signUpConfig.passwordPolicy; - } - } - } - - @Input() hide: string[] = []; - - @Input() - set usernameAttributes(usernameAttributes: string) { - this._usernameAttributes = usernameAttributes; - if (this._usernameAttributes === UsernameAttributes.EMAIL) { - this.signUpFields = signUpWithEmailFields; - this.defaultSignUpFields = signUpWithEmailFields; - } else if (this._usernameAttributes === UsernameAttributes.PHONE_NUMBER) { - this.signUpFields = signUpWithPhoneNumberFields; - this.defaultSignUpFields = signUpWithPhoneNumberFields; - } - } - - @Input() - set authState(authState: AuthState) { - this._authState = authState; - this._show = authState.state === 'signUp'; - } - - @Input() - set signUpConfig(signUpConfig: any) { - if (signUpConfig) { - this._signUpConfig = signUpConfig; - if (this._signUpConfig.defaultCountryCode) { - this.country_code = this._signUpConfig.defaultCountryCode; - } - if (this._signUpConfig.signUpFields) { - this.signUpFields = this._signUpConfig.signUpFields; - } - if (this._signUpConfig.header) { - this.header = this._signUpConfig.header; - } - if (this._signUpConfig.hiddenDefaults) { - this.hiddenFields = this._signUpConfig.hiddenDefaults; - } - if (this._signUpConfig.passwordPolicy) { - this.passwordPolicy = this._signUpConfig.passwordPolicy; - } - } - } - - ngOnInit() { - if (!this.amplifyService.auth()) { - this.logger.warn('Auth module not registered on AmplifyService provider'); - } - this.sortFields(); - } - - shouldHide(comp) { - return this.hide.filter(item => item === comp).length > 0; - } - - onSignUp() { - // validate required inputs - const validation = this.validate(); - if (validation && validation.length > 0) { - return this._setError( - `The following fields need to be filled out: ${validation.join(', ')}` - ); - } - - // create user attribute property - this.user.attributes = {}; - - // format phone number if it is a signUpField - const phoneNumberRequested = this.signUpFields.find(el => { - return el.key === 'phone_number'; - }); - if (phoneNumberRequested) { - this.user.phone_number = composePhoneNumber( - this.country_code, - this.local_phone_number - ); - } - - // create user key and value arrays - const userKeys = Object.keys(this.user); - const userValues = userKeys.map(key => this.user[key]); - - // format data for Cognito user pool - userKeys.forEach((key, index) => { - if (key !== 'username' && key !== 'password' && key !== 'attributes') { - // needsPrefix determines if a custom attribute is indicated - // and prepends 'custom:' to the key before sending to Cognito if needed - const newKey = `${this.needPrefix(key) ? 'custom:' : ''}${key}`; - this.user.attributes[newKey] = userValues[index]; - } - }); - - let labelCheck = false; - this.signUpFields.forEach(field => { - if (field.label === this.getUsernameLabel()) { - this.amplifyService.logger( - `Changing the username to the value of ${field.label}`, - 'DEBUG' - ); - this.user.username = - this.user.attributes[field.key] || this.user.username; - labelCheck = true; - } - }); - if (!labelCheck && !this.user.username) { - // if the customer customized the username field in the sign up form - // He needs to either set the key of that field to 'username' - // Or make the label of the field the same as the 'usernameAttributes' - throw new Error( - `Couldn't find the label: ${this.getUsernameLabel()}, in sign up fields according to usernameAttributes!` - ); - } - - this.amplifyService - .auth() - .signUp(this.user) - .then(user => { - const username = this.user.username; - this.user = {}; - this.onAlertClose(); - this.amplifyService.setAuthState({ - state: 'confirmSignUp', - user: { username: username }, - }); - }) - .catch(err => this._setError(err)); - } - - onSignIn() { - this.onAlertClose(); - this.amplifyService.setAuthState({ state: 'signIn', user: null }); - } - - needPrefix(key) { - const field = this.signUpFields.find(e => e.key === key); - if (key.indexOf('custom:') !== 0) { - return field.custom; - } else if (key.indexOf('custom:') === 0 && field.custom === false) { - this.logger.warn( - 'Custom prefix prepended to key but custom field flag is set to false' - ); - } - return null; - } - - onConfirmSignUp() { - this.onAlertClose(); - this.amplifyService.setAuthState({ - state: 'confirmSignUp', - user: { username: this.user.username }, - }); - } - - sortFields() { - if (this.hiddenFields.length > 0) { - this.defaultSignUpFields = this.defaultSignUpFields.filter(d => { - return !this.hiddenFields.includes(d.key); - }); - } - - if ( - this._signUpConfig && - this._signUpConfig.signUpFields && - this._signUpConfig.signUpFields.length > 0 - ) { - if (!this._signUpConfig.hideAllDefaults) { - // see if fields passed to component should override defaults - this.defaultSignUpFields.forEach((f, i) => { - const matchKey = this.signUpFields.findIndex(d => { - return d.key === f.key; - }); - if (matchKey === -1) { - this.signUpFields.push(f); - } - }); - } - - /* - sort fields based on following rules: - 1. Fields with displayOrder are sorted before those without displayOrder - 2. Fields with conflicting displayOrder are sorted alphabetically by key - 3. Fields without displayOrder are sorted alphabetically by key - */ - this.signUpFields.sort((a, b) => { - if (a.displayOrder && b.displayOrder) { - if (a.displayOrder < b.displayOrder) { - return -1; - } else if (a.displayOrder > b.displayOrder) { - return 1; - } else { - if (a.key < b.key) { - return -1; - } else { - return 1; - } - } - } else if (!a.displayOrder && b.displayOrder) { - return 1; - } else if (a.displayOrder && !b.displayOrder) { - return -1; - } else if (!a.displayOrder && !b.displayOrder) { - if (a.key < b.key) { - return -1; - } else { - return 1; - } - } - }); - this.signUpFields = this.removeHiddenFields(); - } - } - - onAlertClose() { - this._setError(null); - } - - removeHiddenFields() { - return this.signUpFields.filter(f => { - return !f.displayOrder || f.displayOrder !== -1; - }); - } - - validate() { - const invalids = []; - this.signUpFields.map(el => { - if (el.key !== 'phone_number') { - if (el.required && !this.user[el.key]) { - el.invalid = true; - invalids.push(this.amplifyService.i18n().get(el.label)); - } else { - el.invalid = false; - } - } else { - if (el.required && (!this.country_code || !this.local_phone_number)) { - el.invalid = true; - invalids.push(this.amplifyService.i18n().get(el.label)); - } else { - el.invalid = false; - } - } - }); - return invalids; - } - - _setError(err) { - if (!err) { - this.errorMessage = null; - return; - } - - this.errorMessage = err.message || err; - } - - getUsernameLabel() { - return ( - labelMap[this._usernameAttributes as string] || this._usernameAttributes - ); - } - - onPhoneFieldChanged(event: PhoneFieldOutput) { - this.country_code = event.country_code; - this.local_phone_number = event.local_phone_number; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/sign-up.component.ionic.ts b/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/sign-up.component.ionic.ts deleted file mode 100644 index c9523e7c660..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/sign-up.component.ionic.ts +++ /dev/null @@ -1,113 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, Inject } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { AuthState } from '../../../providers/auth.state'; -import { SignUpComponentCore } from './sign-up.component.core'; -import { countrylist, country } from '../../../assets/countries'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
- {{ this.amplifyService.i18n().get(this.header) }}
- - - - {{ this.amplifyService.i18n().get(field.label) }} - * - - - - - - - -
-
- {{ this.amplifyService.i18n().get('Create Account') }} -
-
- - -
-
-
-
-
- -
{{ this.amplifyService.i18n().get(errorMessage) }}
- × -
-
-
-`; - -@Component({ - selector: 'amplify-auth-sign-up-ionic', - template, -}) -export class SignUpComponentIonic extends SignUpComponentCore { - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - super(amplifyService); - } - - setProp(target) { - return (this.user[target.name] = target.value); - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/sign-up.factory.ts b/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/sign-up.factory.ts deleted file mode 100644 index 6e7b6b335aa..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/sign-up-component/sign-up.factory.ts +++ /dev/null @@ -1,82 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, -} from '@angular/core'; -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { SignUpClass } from './sign-up.class'; -import { SignUpComponentIonic } from './sign-up.component.ionic'; -import { SignUpComponentCore } from './sign-up.component.core'; -import { AuthState } from '../../../providers'; - -@Component({ - selector: 'amplify-auth-sign-up', - template: ` -
- -
- `, -}) -export class SignUpComponent implements OnInit, OnDestroy { - @Input() framework: string; - @Input() authState: AuthState; - @Input() signUpConfig: any; - @Input() usernameAttributes: string = 'username'; - @Input() hide: string[] = []; - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - const authComponent = - this.framework && this.framework.toLowerCase() === 'ionic' - ? new ComponentMount(SignUpComponentIonic, { - authState: this.authState, - signUpConfig: this.signUpConfig, - usernameAttributes: this.usernameAttributes, - hide: this.hide, - }) - : new ComponentMount(SignUpComponentCore, { - authState: this.authState, - signUpConfig: this.signUpConfig, - usernameAttributes: this.usernameAttributes, - hide: this.hide, - }); - - const componentFactory = this.componentFactoryResolver.resolveComponentFactory( - authComponent.component - ); - - const viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - const componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = authComponent.data; - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/types.ts b/packages/aws-amplify-angular/src/components/authenticator/types.ts deleted file mode 100644 index a96a64ed229..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/types.ts +++ /dev/null @@ -1,17 +0,0 @@ -export enum UsernameAttributes { - EMAIL = 'email', - PHONE_NUMBER = 'phone_number', - USERNAME = 'username', -} - -export type UsernameFieldOutput = { - username?: string; - email?: string; - country_code?: string; - local_phone_number?: string; -}; - -export type PhoneFieldOutput = { - country_code: string; - local_phone_number: string; -}; diff --git a/packages/aws-amplify-angular/src/components/authenticator/username-field-component/username-field.component.core.ts b/packages/aws-amplify-angular/src/components/authenticator/username-field-component/username-field.component.core.ts deleted file mode 100644 index 12ab9cec0bc..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/username-field-component/username-field.component.core.ts +++ /dev/null @@ -1,146 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - EventEmitter, - Inject, - Output, -} from '@angular/core'; -import { labelMap } from '../common'; -import { - UsernameAttributes, - UsernameFieldOutput, - PhoneFieldOutput, -} from '../types'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` - -`; - -@Component({ - selector: 'amplify-auth-username-field-core', - template, -}) -export class UsernameFieldComponentCore implements OnInit { - _usernameAttributes: string = UsernameAttributes.USERNAME; - _placeholder: string = ''; - username: string; - - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - this.onPhoneFieldChanged = this.onPhoneFieldChanged.bind(this); - } - - @Input() - set data(data: any) { - this._usernameAttributes = data.usernameAttributes; - this._placeholder = data.placeholder; - } - - @Input() - set usernameAttributes(usernameAttributes: string) { - this._usernameAttributes = usernameAttributes; - } - - @Input() - set placeholder(placeholder: string) { - this._placeholder = placeholder; - } - - @Output() - usernameFieldChanged: EventEmitter = new EventEmitter< - UsernameFieldOutput - >(); - - ngOnInit() { - if ( - window && - window.location && - window.location.search && - this._usernameAttributes !== 'email' && - this._usernameAttributes !== 'phone_number' - ) { - const searchParams = new URLSearchParams(window.location.search); - const username = searchParams ? searchParams.get('username') : undefined; - this.setUsername(username); - this.username = username; - } - } - - ngOnDestroy() {} - - setUsername(username: string) { - this.usernameFieldChanged.emit({ - username, - }); - } - - setEmail(email: string) { - this.usernameFieldChanged.emit({ - email, - }); - } - - getUsernameLabel() { - return ( - labelMap[this._usernameAttributes as string] || this._usernameAttributes - ); - } - - getPlaceholder() { - return this.amplifyService - .i18n() - .get(`${this.getUsernameLabel()}` || this._placeholder); - } - - onPhoneFieldChanged(event: PhoneFieldOutput) { - this.usernameFieldChanged.emit({ - ...event, - }); - } -} diff --git a/packages/aws-amplify-angular/src/components/authenticator/username-field-component/username-field.component.ionic.ts b/packages/aws-amplify-angular/src/components/authenticator/username-field-component/username-field.component.ionic.ts deleted file mode 100644 index 12ac16b7aec..00000000000 --- a/packages/aws-amplify-angular/src/components/authenticator/username-field-component/username-field.component.ionic.ts +++ /dev/null @@ -1,61 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, Inject } from '@angular/core'; -import { UsernameFieldComponentCore } from './username-field.component.core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { auth } from '../../../assets/data-test-attributes'; - -const template = ` - - - {{ this.amplifyService.i18n().get('Email *') }} - - - - - - - {{ this.amplifyService.i18n().get(getUsernameLabel()) }} * - - - -`; - -@Component({ - selector: 'amplify-auth-username-field-ionic', - template, -}) -export class UsernameFieldComponentIonic extends UsernameFieldComponentCore { - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - super(amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/common/form.component.ts b/packages/aws-amplify-angular/src/components/common/form.component.ts deleted file mode 100644 index 359cfc55a8f..00000000000 --- a/packages/aws-amplify-angular/src/components/common/form.component.ts +++ /dev/null @@ -1,41 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input } from '@angular/core'; - -const template = ` -
-
-
{{ title }}
-
-
- -
- -
-`; - -@Component({ - selector: 'amplify-form', - template: template, -}) -export class FormComponent { - @Input() - set title(title: string) { - this.title = title; - } -} diff --git a/packages/aws-amplify-angular/src/components/component.mount.ts b/packages/aws-amplify-angular/src/components/component.mount.ts deleted file mode 100644 index 5c876b6c300..00000000000 --- a/packages/aws-amplify-angular/src/components/component.mount.ts +++ /dev/null @@ -1,20 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Type } from '@angular/core'; - -export class ComponentMount { - constructor(public component: Type, public data: any) {} -} diff --git a/packages/aws-amplify-angular/src/components/interactions/chatbot/aws-lex-audio.js b/packages/aws-amplify-angular/src/components/interactions/chatbot/aws-lex-audio.js deleted file mode 100644 index 7e7756abf8d..00000000000 --- a/packages/aws-amplify-angular/src/components/interactions/chatbot/aws-lex-audio.js +++ /dev/null @@ -1,991 +0,0 @@ -// Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, -// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -(function e(t, n, r) { - function s(o, u) { - if (!n[o]) { - if (!t[o]) { - var a = typeof require == 'function' && require; - if (!u && a) return a(o, !0); - if (i) return i(o, !0); - var f = new Error("Cannot find module '" + o + "'"); - throw ((f.code = 'MODULE_NOT_FOUND'), f); - } - var l = (n[o] = { exports: {} }); - t[o][0].call( - l.exports, - function(e) { - var n = t[o][1][e]; - return s(n ? n : e); - }, - l, - l.exports, - e, - t, - n, - r - ); - } - return n[o].exports; - } - var i = typeof require == 'function' && require; - for (var o = 0; o < r.length; o++) s(r[o]); - return s; -})( - { - 1: [ - function(require, module, exports) { - (function() { - 'use strict'; - var rec = require('./recorder.js'); - var recorder, - audioRecorder, - checkAudioSupport, - audioSupported, - playbackSource, - UNSUPPORTED = 'Audio is not supported.'; - - /** - * Represents an audio control that can start and stop recording, - * export captured audio, play an audio buffer, and check if audio - * is supported. - */ - exports.audioControl = function(options) { - options = options || {}; - this.checkAudioSupport = options.checkAudioSupport !== false; - - /** - * This callback type is called `onSilenceCallback`. - * - * @callback onSilenceCallback - */ - - /** - * Visualize callback: `visualizerCallback`. - * - * @callback visualizerCallback - * @param {Uint8Array} dataArray - * @param {number} bufferLength - */ - - /** - * Clears the previous buffer and starts buffering audio. - * - * @param {?onSilenceCallback} onSilence - Called when silence is detected. - * @param {?visualizerCallback} visualizer - Can be used to visualize the captured buffer. - * @param {silenceDetectionConfig} - Specify custom silence detection values. - * @throws {Error} If audio is not supported. - */ - var startRecording = function( - onSilence, - visualizer, - silenceDetectionConfig - ) { - onSilence = - onSilence || - function() { - /* no op */ - }; - visualizer = - visualizer || - function() { - /* no op */ - }; - audioSupported = audioSupported !== false; - if (!audioSupported) { - throw new Error(UNSUPPORTED); - } - const context = audioRecorder.audioContext(); - context.resume().then(() => { - recorder = audioRecorder.createRecorder(silenceDetectionConfig); - recorder.record(onSilence, visualizer); - }); - }; - - /** - * Stops buffering audio. - * - * @throws {Error} If audio is not supported. - */ - var stopRecording = function() { - audioSupported = audioSupported !== false; - if (!audioSupported) { - throw new Error(UNSUPPORTED); - } - recorder.stop(); - }; - - /** - * On export complete callback: `onExportComplete`. - * - * @callback onExportComplete - * @param {Blob} blob The exported audio as a Blob. - */ - - /** - * Exports the captured audio buffer. - * - * @param {onExportComplete} callback - Called when the export is complete. - * @param {sampleRate} The sample rate to use in the export. - * @throws {Error} If audio is not supported. - */ - var exportWAV = function(callback, sampleRate) { - audioSupported = audioSupported !== false; - if (!audioSupported) { - throw new Error(UNSUPPORTED); - } - if (!(callback && typeof callback === 'function')) { - throw new Error('You must pass a callback function to export.'); - } - sampleRate = - typeof sampleRate !== 'undefined' ? sampleRate : 16000; - recorder.exportWAV(callback, sampleRate); - recorder.clear(); - }; - - /** - * On playback complete callback: `onPlaybackComplete`. - * - * @callback onPlaybackComplete - */ - - /** - * Plays the audio buffer with an HTML5 audio tag. - * @param {Uint8Array} buffer - The audio buffer to play. - * @param {?onPlaybackComplete} callback - Called when audio playback is complete. - */ - var playHtmlAudioElement = function(buffer, callback) { - if (typeof buffer === 'undefined') { - return; - } - var myBlob = new Blob([buffer]); - var audio = document.createElement('audio'); - var objectUrl = window.URL.createObjectURL(myBlob); - audio.src = objectUrl; - audio.addEventListener('ended', function() { - audio.currentTime = 0; - if (typeof callback === 'function') { - callback(); - } - }); - audio.play(); - }; - - /** - * On playback complete callback: `onPlaybackComplete`. - * - * @callback onPlaybackComplete - */ - - /** - * Plays the audio buffer with a WebAudio AudioBufferSourceNode. - * @param {Uint8Array} buffer - The audio buffer to play. - * @param {?onPlaybackComplete} callback - Called when audio playback is complete. - */ - var play = function(buffer, callback) { - if (typeof buffer === 'undefined') { - return; - } - var myBlob = new Blob([buffer]); - // We'll use a FileReader to create and ArrayBuffer out of the audio response. - var fileReader = new FileReader(); - fileReader.onload = function() { - // Once we have an ArrayBuffer we can create our BufferSource and decode the result as an AudioBuffer. - playbackSource = audioRecorder - .audioContext() - .createBufferSource(); - audioRecorder - .audioContext() - .decodeAudioData(this.result, function(buf) { - // Set the source buffer as our new AudioBuffer. - playbackSource.buffer = buf; - // Set the destination (the actual audio-rendering device--your device's speakers). - playbackSource.connect( - audioRecorder.audioContext().destination - ); - // Add an "on ended" callback. - playbackSource.onended = function(event) { - if (typeof callback === 'function') { - callback(); - } - }; - // Start the playback. - playbackSource.start(0); - }); - }; - fileReader.readAsArrayBuffer(myBlob); - }; - - /** - * Stops the playback source (created by the play method) if it exists. The `onPlaybackComplete` - * callback will be called. - */ - var stop = function() { - if (typeof playbackSource === 'undefined') { - return; - } - playbackSource.stop(); - }; - - /** - * Clear the recording buffer. - */ - var clear = function() { - recorder.clear(); - }; - - /** - * On audio supported callback: `onAudioSupported`. - * - * @callback onAudioSupported - * @param {boolean} - */ - - /** - * Checks that getUserMedia is supported and the user has given us access to the mic. - * @param {onAudioSupported} callback - Called with the result. - */ - var supportsAudio = function(callback) { - callback = - callback || - function() { - /* no op */ - }; - if ( - navigator.mediaDevices && - navigator.mediaDevices.getUserMedia - ) { - audioRecorder = rec.audioRecorder(); - audioRecorder - .requestDevice() - .then(function(stream) { - audioSupported = true; - callback(audioSupported); - }) - .catch(function(error) { - audioSupported = false; - callback(audioSupported); - }); - } else { - audioSupported = false; - callback(audioSupported); - } - }; - - if (this.checkAudioSupport) { - supportsAudio(); - } - - return { - startRecording: startRecording, - stopRecording: stopRecording, - exportWAV: exportWAV, - play: play, - stop: stop, - clear: clear, - playHtmlAudioElement: playHtmlAudioElement, - supportsAudio: supportsAudio, - }; - }; - })(); - }, - { './recorder.js': 5 }, - ], - 2: [ - function(require, module, exports) { - (function() { - 'use strict'; - var AudioControl = require('./control.js').audioControl; - - var DEFAULT_LATEST = '$LATEST'; - var DEFAULT_CONTENT_TYPE = 'audio/x-l16; sample-rate=16000'; - var DEFAULT_USER_ID = 'userId'; - var DEFAULT_ACCEPT_HEADER_VALUE = 'audio/mpeg'; - var MESSAGES = Object.freeze({ - PASSIVE: 'Passive', - LISTENING: 'Listening', - SENDING: 'Sending', - SPEAKING: 'Speaking', - }); - - var lexruntime, - audioControl = new AudioControl({ checkAudioSupport: false }); - - exports.conversation = function( - config, - onStateChange, - onSuccess, - onError, - onAudioData - ) { - var currentState; - - // Apply default values. - this.config = applyDefaults(config); - this.lexConfig = this.config.lexConfig; - this.messages = MESSAGES; - onStateChange = - onStateChange || - function() { - /* no op */ - }; - this.onSuccess = - onSuccess || - function() { - /* no op */ - }; - this.onError = - onError || - function() { - /* no op */ - }; - this.onAudioData = - onAudioData || - function() { - /* no op */ - }; - - // Validate input. - if (!this.config.lexConfig.botName) { - this.onError('A Bot name must be provided.'); - return; - } - if (!AWS.config.credentials) { - this.onError('AWS Credentials must be provided.'); - return; - } - if (!AWS.config.region) { - this.onError('A Region value must be provided.'); - return; - } - - lexruntime = new AWS.LexRuntime(); - - this.onSilence = function() { - if (config.silenceDetection) { - audioControl.stopRecording(); - currentState.advanceConversation(); - } - }; - - this.transition = function(conversation) { - currentState = conversation; - var state = currentState.state; - onStateChange(state.message); - - // If we are transitioning into SENDING or SPEAKING we want to immediately advance the conversation state - // to start the service call or playback. - if ( - state.message === state.messages.SENDING || - state.message === state.messages.SPEAKING - ) { - currentState.advanceConversation(); - } - // If we are transitioning in to sending and we are not detecting silence (this was a manual state change) - // we need to do some cleanup: stop recording, and stop rendering. - if ( - state.message === state.messages.SENDING && - !this.config.silenceDetection - ) { - audioControl.stopRecording(); - } - }; - - this.advanceConversation = function() { - audioControl.supportsAudio(function(supported) { - if (supported) { - currentState.advanceConversation(); - } else { - onError('Audio is not supported.'); - } - }); - }; - - this.updateConfig = function(newValue) { - this.config = applyDefaults(newValue); - this.lexConfig = this.config.lexConfig; - }; - - this.reset = function() { - audioControl.clear(); - currentState = new Initial(currentState.state); - }; - - currentState = new Initial(this); - - return { - advanceConversation: this.advanceConversation, - updateConfig: this.updateConfig, - reset: this.reset, - }; - }; - - var Initial = function(state) { - this.state = state; - state.message = state.messages.PASSIVE; - this.advanceConversation = function() { - audioControl.startRecording( - state.onSilence, - state.onAudioData, - state.config.silenceDetectionConfig - ); - state.transition(new Listening(state)); - }; - }; - - var Listening = function(state) { - this.state = state; - state.message = state.messages.LISTENING; - this.advanceConversation = function() { - audioControl.exportWAV(function(blob) { - state.audioInput = blob; - state.transition(new Sending(state)); - }); - }; - }; - - var Sending = function(state) { - this.state = state; - state.message = state.messages.SENDING; - this.advanceConversation = function() { - state.lexConfig.inputStream = state.audioInput; - lexruntime.postContent(state.lexConfig, function(err, data) { - if (err) { - state.onError(err); - state.transition(new Initial(state)); - } else { - state.audioOutput = data; - state.transition(new Speaking(state)); - state.onSuccess(data); - } - }); - }; - }; - - var Speaking = function(state) { - this.state = state; - state.message = state.messages.SPEAKING; - this.advanceConversation = function() { - if (state.audioOutput.contentType === 'audio/mpeg') { - audioControl.play(state.audioOutput.audioStream, function() { - if ( - state.audioOutput.dialogState === 'ReadyForFulfillment' || - state.audioOutput.dialogState === 'Fulfilled' || - state.audioOutput.dialogState === 'Failed' || - !state.config.silenceDetection - ) { - state.transition(new Initial(state)); - } else { - audioControl.startRecording( - state.onSilence, - state.onAudioData, - state.config.silenceDetectionConfig - ); - state.transition(new Listening(state)); - } - }); - } else { - state.transition(new Initial(state)); - } - }; - }; - - var applyDefaults = function(config) { - config = config || {}; - config.silenceDetection = config.hasOwnProperty('silenceDetection') - ? config.silenceDetection - : true; - - var lexConfig = config.lexConfig || {}; - lexConfig.botAlias = lexConfig.hasOwnProperty('botAlias') - ? lexConfig.botAlias - : DEFAULT_LATEST; - lexConfig.botName = lexConfig.hasOwnProperty('botName') - ? lexConfig.botName - : ''; - lexConfig.contentType = lexConfig.hasOwnProperty('contentType') - ? lexConfig.contentType - : DEFAULT_CONTENT_TYPE; - lexConfig.userId = lexConfig.hasOwnProperty('userId') - ? lexConfig.userId - : DEFAULT_USER_ID; - lexConfig.accept = lexConfig.hasOwnProperty('accept') - ? lexConfig.accept - : DEFAULT_ACCEPT_HEADER_VALUE; - config.lexConfig = lexConfig; - - return config; - }; - })(); - }, - { './control.js': 1 }, - ], - 3: [ - function(require, module, exports) { - (function(global) { - /** - * @module LexAudio - * @description The global namespace for Amazon Lex Audio - */ - global.LexAudio = global.LexAudio || {}; - global.LexAudio.audioControl = require('./control.js').audioControl; - global.LexAudio.conversation = require('./conversation.js').conversation; - module.exports = global.LexAudio; - }.call( - this, - typeof global !== 'undefined' - ? global - : typeof self !== 'undefined' - ? self - : typeof window !== 'undefined' - ? window - : {} - )); - }, - { './control.js': 1, './conversation.js': 2 }, - ], - 4: [ - function(require, module, exports) { - var bundleFn = arguments[3]; - var sources = arguments[4]; - var cache = arguments[5]; - - var stringify = JSON.stringify; - - module.exports = function(fn, options) { - var wkey; - var cacheKeys = Object.keys(cache); - - for (var i = 0, l = cacheKeys.length; i < l; i++) { - var key = cacheKeys[i]; - var exp = cache[key].exports; - // Using babel as a transpiler to use esmodule, the export will always - // be an object with the default export as a property of it. To ensure - // the existing api and babel esmodule exports are both supported we - // check for both - if (exp === fn || (exp && exp.default === fn)) { - wkey = key; - break; - } - } - - if (!wkey) { - wkey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16); - var wcache = {}; - for (var i = 0, l = cacheKeys.length; i < l; i++) { - var key = cacheKeys[i]; - wcache[key] = key; - } - sources[wkey] = [ - Function(['require', 'module', 'exports'], '(' + fn + ')(self)'), - wcache, - ]; - } - var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16); - - var scache = {}; - scache[wkey] = wkey; - sources[skey] = [ - Function( - ['require'], - // try to call default if defined to also support babel esmodule - // exports - 'var f = require(' + - stringify(wkey) + - ');' + - '(f.default ? f.default : f)(self);' - ), - scache, - ]; - - var workerSources = {}; - resolveSources(skey); - - function resolveSources(key) { - workerSources[key] = true; - - for (var depPath in sources[key][1]) { - var depKey = sources[key][1][depPath]; - if (!workerSources[depKey]) { - resolveSources(depKey); - } - } - } - - var src = - '(' + - bundleFn + - ')({' + - Object.keys(workerSources) - .map(function(key) { - return ( - stringify(key) + - ':[' + - sources[key][0] + - ',' + - stringify(sources[key][1]) + - ']' - ); - }) - .join(',') + - '},{},[' + - stringify(skey) + - '])'; - var URL = - window.URL || window.webkitURL || window.mozURL || window.msURL; - - var blob = new Blob([src], { type: 'text/javascript' }); - if (options && options.bare) { - return blob; - } - var workerUrl = URL.createObjectURL(blob); - var worker = new Worker(workerUrl); - worker.objectURL = workerUrl; - return worker; - }; - }, - {}, - ], - 5: [ - function(require, module, exports) { - (function() { - 'use strict'; - var work = require('webworkify'); - var worker = work(require('./worker.js')); - var audio_context, audio_stream; - - /** - * The Recorder object. Sets up the onaudioprocess callback and communicates - * with the web worker to perform audio actions. - */ - var recorder = function(source, silenceDetectionConfig) { - silenceDetectionConfig = silenceDetectionConfig || {}; - silenceDetectionConfig.time = silenceDetectionConfig.hasOwnProperty( - 'time' - ) - ? silenceDetectionConfig.time - : 1500; - silenceDetectionConfig.amplitude = silenceDetectionConfig.hasOwnProperty( - 'amplitude' - ) - ? silenceDetectionConfig.amplitude - : 0.2; - - var recording = false, - currCallback, - start, - silenceCallback, - visualizationCallback; - - // Create a ScriptProcessorNode with a bufferSize of 4096 and a single input and output channel - var node = source.context.createScriptProcessor(4096, 1, 1); - - worker.onmessage = function(message) { - var blob = message.data; - currCallback(blob); - }; - - worker.postMessage({ - command: 'init', - config: { - sampleRate: source.context.sampleRate, - }, - }); - - /** - * Sets the silence and viz callbacks, resets the silence start time, and sets recording to true. - * @param {?onSilenceCallback} onSilence - Called when silence is detected. - * @param {?visualizerCallback} visualizer - Can be used to visualize the captured buffer. - */ - var record = function(onSilence, visualizer) { - silenceCallback = onSilence; - visualizationCallback = visualizer; - start = Date.now(); - recording = true; - }; - - /** - * Sets recording to false. - */ - var stop = function() { - recording = false; - }; - - /** - * Posts "clear" message to the worker. - */ - var clear = function() { - stop(); - worker.postMessage({ command: 'clear' }); - }; - - /** - * Sets the export callback and posts an "export" message to the worker. - * @param {onExportComplete} callback - Called when the export is complete. - * @param {sampleRate} The sample rate to use in the export. - */ - var exportWAV = function(callback, sampleRate) { - currCallback = callback; - worker.postMessage({ - command: 'export', - sampleRate: sampleRate, - }); - }; - - /** - * Checks the time domain data to see if the amplitude of the audio waveform is more than - * the silence threshold. If it is, "noise" has been detected and it resets the start time. - * If the elapsed time reaches the time threshold the silence callback is called. If there is a - * visualizationCallback it invokes the visualization callback with the time domain data. - */ - var analyse = function() { - analyser.fftSize = 2048; - var bufferLength = analyser.fftSize; - var dataArray = new Uint8Array(bufferLength); - var amplitude = silenceDetectionConfig.amplitude; - var time = silenceDetectionConfig.time; - - analyser.getByteTimeDomainData(dataArray); - - if (typeof visualizationCallback === 'function') { - visualizationCallback(dataArray, bufferLength); - } - - for (var i = 0; i < bufferLength; i++) { - // Normalize between -1 and 1. - var curr_value_time = dataArray[i] / 128 - 1.0; - if ( - curr_value_time > amplitude || - curr_value_time < -1 * amplitude - ) { - start = Date.now(); - } - } - var newtime = Date.now(); - var elapsedTime = newtime - start; - if (elapsedTime > time) { - silenceCallback(); - } - }; - - /** - * The onaudioprocess event handler of the ScriptProcessorNode interface. It is the EventHandler to be - * called for the audioprocess event that is dispatched to ScriptProcessorNode node types. - * @param {AudioProcessingEvent} audioProcessingEvent - The audio processing event. - */ - node.onaudioprocess = function(audioProcessingEvent) { - if (!recording) { - return; - } - worker.postMessage({ - command: 'record', - buffer: [audioProcessingEvent.inputBuffer.getChannelData(0)], - }); - analyse(); - }; - - var analyser = source.context.createAnalyser(); - analyser.minDecibels = -90; - analyser.maxDecibels = -10; - analyser.smoothingTimeConstant = 0.85; - - source.connect(analyser); - analyser.connect(node); - node.connect(source.context.destination); - - return { - record: record, - stop: stop, - clear: clear, - exportWAV: exportWAV, - }; - }; - - /** - * Audio recorder object. Handles setting up the audio context, - * accessing the mike, and creating the Recorder object. - */ - exports.audioRecorder = function() { - /** - * Creates an audio context and calls getUserMedia to request the mic (audio). - */ - var requestDevice = function() { - if (typeof audio_context === 'undefined') { - window.AudioContext = - window.AudioContext || window.webkitAudioContext; - audio_context = new AudioContext(); - } - - return navigator.mediaDevices - .getUserMedia({ audio: true }) - .then(function(stream) { - audio_stream = stream; - }); - }; - - var createRecorder = function(silenceDetectionConfig) { - return recorder( - audio_context.createMediaStreamSource(audio_stream), - silenceDetectionConfig - ); - }; - - var audioContext = function() { - return audio_context; - }; - - return { - requestDevice: requestDevice, - createRecorder: createRecorder, - audioContext: audioContext, - }; - }; - })(); - }, - { './worker.js': 6, webworkify: 4 }, - ], - 6: [ - function(require, module, exports) { - module.exports = function(self) { - 'use strict'; - var recLength = 0, - recBuffer = [], - recordSampleRate; - - self.addEventListener('message', function(e) { - switch (e.data.command) { - case 'init': - init(e.data.config); - break; - case 'record': - record(e.data.buffer); - break; - case 'export': - exportBuffer(e.data.sampleRate); - break; - case 'clear': - clear(); - break; - } - }); - - function init(config) { - recordSampleRate = config.sampleRate; - } - - function record(inputBuffer) { - recBuffer.push(inputBuffer[0]); - recLength += inputBuffer[0].length; - } - - function exportBuffer(exportSampleRate) { - var mergedBuffers = mergeBuffers(recBuffer, recLength); - var downsampledBuffer = downsampleBuffer( - mergedBuffers, - exportSampleRate - ); - var encodedWav = encodeWAV(downsampledBuffer); - var audioBlob = new Blob([encodedWav], { - type: 'application/octet-stream', - }); - postMessage(audioBlob); - } - - function clear() { - recLength = 0; - recBuffer = []; - } - - function downsampleBuffer(buffer, exportSampleRate) { - if (exportSampleRate === recordSampleRate) { - return buffer; - } - var sampleRateRatio = recordSampleRate / exportSampleRate; - var newLength = Math.round(buffer.length / sampleRateRatio); - var result = new Float32Array(newLength); - var offsetResult = 0; - var offsetBuffer = 0; - while (offsetResult < result.length) { - var nextOffsetBuffer = Math.round( - (offsetResult + 1) * sampleRateRatio - ); - var accum = 0, - count = 0; - for ( - var i = offsetBuffer; - i < nextOffsetBuffer && i < buffer.length; - i++ - ) { - accum += buffer[i]; - count++; - } - result[offsetResult] = accum / count; - offsetResult++; - offsetBuffer = nextOffsetBuffer; - } - return result; - } - - function mergeBuffers(bufferArray, recLength) { - var result = new Float32Array(recLength); - var offset = 0; - for (var i = 0; i < bufferArray.length; i++) { - result.set(bufferArray[i], offset); - offset += bufferArray[i].length; - } - return result; - } - - function floatTo16BitPCM(output, offset, input) { - for (var i = 0; i < input.length; i++, offset += 2) { - var s = Math.max(-1, Math.min(1, input[i])); - output.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7fff, true); - } - } - - function writeString(view, offset, string) { - for (var i = 0; i < string.length; i++) { - view.setUint8(offset + i, string.charCodeAt(i)); - } - } - - function encodeWAV(samples) { - var buffer = new ArrayBuffer(44 + samples.length * 2); - var view = new DataView(buffer); - - writeString(view, 0, 'RIFF'); - view.setUint32(4, 32 + samples.length * 2, true); - writeString(view, 8, 'WAVE'); - writeString(view, 12, 'fmt '); - view.setUint32(16, 16, true); - view.setUint16(20, 1, true); - view.setUint16(22, 1, true); - view.setUint32(24, recordSampleRate, true); - view.setUint32(28, recordSampleRate * 2, true); - view.setUint16(32, 2, true); - view.setUint16(34, 16, true); - writeString(view, 36, 'data'); - view.setUint32(40, samples.length * 2, true); - floatTo16BitPCM(view, 44, samples); - - return view; - } - }; - }, - {}, - ], - }, - {}, - [3] -); diff --git a/packages/aws-amplify-angular/src/components/interactions/chatbot/chatbot.class.ts b/packages/aws-amplify-angular/src/components/interactions/chatbot/chatbot.class.ts deleted file mode 100644 index 6601496eaf3..00000000000 --- a/packages/aws-amplify-angular/src/components/interactions/chatbot/chatbot.class.ts +++ /dev/null @@ -1,18 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export class ChatBotClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/interactions/chatbot/chatbot.component.core.ts b/packages/aws-amplify-angular/src/components/interactions/chatbot/chatbot.component.core.ts deleted file mode 100644 index d9656d50f19..00000000000 --- a/packages/aws-amplify-angular/src/components/interactions/chatbot/chatbot.component.core.ts +++ /dev/null @@ -1,352 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - Output, - EventEmitter, - OnInit, - ChangeDetectorRef, - Inject, -} from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { chatBot } from '../../../assets/data-test-attributes'; -require('./aws-lex-audio.js'); - -const template = ` -
-
-
-
-
-
-
{{message.me}}
-
{{message.meSentTime}}
-
{{message.bot}}
-
{{message.botSentTime}}
-
-
-
-
- - - - - -
-
-
-
-`; -declare var LexAudio: any; - -const STATES = { - INITIAL: { MESSAGE: 'Type your message or click 🎤', ICON: '🎤' }, - LISTENING: { MESSAGE: 'Listening... click 🔴 again to cancel', ICON: '🔴' }, - SENDING: { MESSAGE: 'Please wait...', ICON: '🔊' }, - SPEAKING: { MESSAGE: 'Speaking...', ICON: '...' }, -}; - -const defaultVoiceConfig = { - silenceDetectionConfig: { - time: 2000, - amplitude: 0.2, - }, -}; - -@Component({ - selector: 'amplify-interactions-core', - template, -}) -export class ChatbotComponentCore implements OnInit { - errorMessage: string; - inputText: string = ''; - botName: string; - chatTitle: string; - clearComplete: boolean = false; - messages: any = []; - completions: any = {}; - currentVoiceState: string = STATES.INITIAL.MESSAGE; - inputDisabled: boolean = false; - micText: string = STATES.INITIAL.ICON; - voiceConfig: any = defaultVoiceConfig; - continueConversation: boolean = false; - micButtonDisabled: boolean = false; - audioInput: any; - lexResponse: any; - conversationModeOn: boolean = false; - ref: ChangeDetectorRef; - voiceEnabled: boolean = false; - textEnabled: boolean = true; - audioControl: any; - protected logger; - - @Output() - complete: EventEmitter = new EventEmitter(); - - constructor( - ref: ChangeDetectorRef, - @Inject(AmplifyService) public amplifyService: AmplifyService - ) { - this.ref = ref; - this.continueConversation = false; - this.logger = this.amplifyService.logger('ChatbotComponent'); - } - - @Input() - set data(data: any) { - this.botName = data.bot; - this.chatTitle = data.title; - this.clearComplete = data.clearComplete; - this.conversationModeOn = - data.conversationModeOn === undefined ? false : data.conversationModeOn; - this.voiceEnabled = - data.voiceEnabled === undefined ? false : data.voiceEnabled; - this.textEnabled = data.textEnabled === undefined ? true : data.textEnabled; - this.voiceConfig = data.voiceConfig || this.voiceConfig; - this.performOnComplete = this.performOnComplete.bind(this); - this.amplifyService - .interactions() - .onComplete(this.botName, this.performOnComplete); - - if (!this.textEnabled && this.voiceEnabled) { - this.currentVoiceState = 'Click the mic button'; - STATES.INITIAL.MESSAGE = 'Click the mic button'; - } - - if (!this.voiceEnabled && this.textEnabled) { - this.currentVoiceState = 'Type a message'; - STATES.INITIAL.MESSAGE = 'Type a message'; - } - - if (this.voiceEnabled) { - this.audioControl = new LexAudio.audioControl(); - } - } - - @Input() - set bot(botName: string) { - this.botName = botName; - this.performOnComplete = this.performOnComplete.bind(this); - this.amplifyService - .interactions() - .onComplete(botName, this.performOnComplete); - } - - @Input() - set title(title: string) { - this.chatTitle = title; - } - - @Input() - set clearOnComplete(clearComplete: boolean) { - this.clearComplete = clearComplete; - } - - ngOnInit() { - if (!this.amplifyService.interactions()) { - throw new Error( - 'Interactions module not registered on AmplifyService provider' - ); - } - } - - performOnComplete(evt) { - this.complete.emit(evt); - if (this.clearComplete) { - this.messages = []; - } - } - - onInputChange(value: string) { - this.inputText = value; - } - - onSubmit(e) { - if (!this.inputText) { - return; - } - const message = { - me: this.inputText, - meSentTime: new Date().toLocaleTimeString(), - bot: '', - botSentTime: '', - }; - this.amplifyService - .interactions() - .send(this.botName, this.inputText) - .then((response: any) => { - this.inputText = ''; - message.bot = response.message; - message.botSentTime = new Date().toLocaleTimeString(); - this.messages.push(message); - }) - .catch(error => this.logger.error(error)); - } - - onSilenceHandler = () => { - if (!this.continueConversation) { - return; - } - this.audioControl.exportWAV(blob => { - this.currentVoiceState = STATES.SENDING.MESSAGE; - this.audioInput = blob; - this.micText = STATES.SENDING.ICON; - this.micButtonDisabled = true; - this.lexResponseHandler(); - }); - this.ref.detectChanges(); - }; - - reset() { - this.audioControl.clear(); - this.inputText = ''; - this.currentVoiceState = STATES.INITIAL.MESSAGE; - this.inputDisabled = false; - this.micText = STATES.INITIAL.ICON; - this.continueConversation = false; - this.micButtonDisabled = false; - this.ref.detectChanges(); - } - - onError(error) { - this.logger.error(error); - } - - async lexResponseHandler() { - if (!this.continueConversation) { - return; - } - - const interactionsMessage = { - content: this.audioInput, - options: { - messageType: 'voice', - }, - }; - - const response = await this.amplifyService - .interactions() - .send(this.botName, interactionsMessage); - - this.lexResponse = response; - this.currentVoiceState = STATES.SPEAKING.MESSAGE; - this.micText = STATES.SPEAKING.ICON; - this.micButtonDisabled = true; - - const message = { - me: this.lexResponse.inputTranscript, - meSentTime: new Date().toLocaleTimeString(), - bot: '', - botSentTime: '', - }; - - this.inputText = ''; - message.bot = this.lexResponse.message; - message.botSentTime = new Date().toLocaleTimeString(); - this.messages.push(message); - this.doneSpeakingHandler(); - this.ref.detectChanges(); - } - - doneSpeakingHandler() { - if (!this.continueConversation) { - return; - } - if (this.lexResponse.contentType === 'audio/mpeg') { - this.audioControl.play(this.lexResponse.audioStream, () => { - if ( - this.lexResponse.dialogState === 'ReadyForFulfillment' || - this.lexResponse.dialogState === 'Fulfilled' || - this.lexResponse.dialogState === 'Failed' || - !this.conversationModeOn - ) { - this.inputDisabled = false; - this.currentVoiceState = STATES.INITIAL.MESSAGE; - this.micText = STATES.INITIAL.ICON; - this.micButtonDisabled = false; - this.continueConversation = false; - this.ref.detectChanges(); - } else { - this.currentVoiceState = STATES.LISTENING.MESSAGE; - this.micText = STATES.LISTENING.ICON; - this.micButtonDisabled = false; - this.audioControl.startRecording( - this.onSilenceHandler, - null, - this.voiceConfig.silenceDetectionConfig - ); - this.ref.detectChanges(); - } - }); - } else { - this.inputDisabled = false; - this.currentVoiceState = STATES.INITIAL.MESSAGE; - this.micText = STATES.INITIAL.ICON; - this.micButtonDisabled = false; - this.continueConversation = false; - this.ref.detectChanges(); - } - } - - async micButtonHandler() { - if (this.continueConversation) { - this.reset(); - this.ref.detectChanges(); - } else { - this.inputDisabled = true; - this.continueConversation = true; - this.currentVoiceState = STATES.LISTENING.MESSAGE; - this.micText = STATES.LISTENING.ICON; - this.micButtonDisabled = false; - this.audioControl.startRecording( - this.onSilenceHandler, - null, - this.voiceConfig.silenceDetectionConfig - ); - this.ref.detectChanges(); - } - } -} diff --git a/packages/aws-amplify-angular/src/components/interactions/chatbot/chatbot.component.ionic.ts b/packages/aws-amplify-angular/src/components/interactions/chatbot/chatbot.component.ionic.ts deleted file mode 100644 index 7b35ced9369..00000000000 --- a/packages/aws-amplify-angular/src/components/interactions/chatbot/chatbot.component.ionic.ts +++ /dev/null @@ -1,121 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, ViewChild, ChangeDetectorRef, Inject } from '@angular/core'; -import { ChatbotComponentCore } from './chatbot.component.core'; -import { AmplifyService } from '../../../providers/amplify.service'; - -const template = ` -
-
- - - - - -
- - {{chatTitle}} - -
-
- -   - -
-
-
- - - - -
-   -
-
- - - {{message.me}} - - -
- - - - {{message.bot}} - - - -
-   -
-
-
-
-
-
-
- - - - {{micText}} - - - Send - -
-
-
-`; - -@Component({ - selector: 'amplify-interactions-ionic', - template, -}) -export class ChatbotComponentIonic extends ChatbotComponentCore { - inputValue; - - constructor( - ref: ChangeDetectorRef, - @Inject(AmplifyService) - public amplifyService: AmplifyService - ) { - super(ref, amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/interactions/chatbot/chatbot.factory.ts b/packages/aws-amplify-angular/src/components/interactions/chatbot/chatbot.factory.ts deleted file mode 100644 index 57bd9229de1..00000000000 --- a/packages/aws-amplify-angular/src/components/interactions/chatbot/chatbot.factory.ts +++ /dev/null @@ -1,92 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, - Output, - EventEmitter, -} from '@angular/core'; -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { ChatBotClass } from './chatbot.class'; -import { ChatbotComponentIonic } from './chatbot.component.ionic'; -import { ChatbotComponentCore } from './chatbot.component.core'; - -@Component({ - selector: 'amplify-interactions', - template: ` -
- -
- `, -}) -export class ChatBotComponent implements OnInit, OnDestroy { - @Input() framework: string; - @Input() bot: string; - @Input() title: string; - @Input() clearComplete: boolean; - @Input() conversationModeOn: boolean; - @Input() voiceConfig: any; - @Input() voiceEnabled: boolean; - @Input() textEnabled: boolean; - @Output() - complete: EventEmitter = new EventEmitter(); - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - const interactionParams = { - bot: this.bot, - title: this.title, - clearComplete: this.clearComplete, - conversationModeOn: this.conversationModeOn, - voiceConfig: this.voiceConfig, - voiceEnabled: this.voiceEnabled, - textEnabled: this.textEnabled, - }; - - const interactionComponent = - this.framework && this.framework.toLowerCase() === 'ionic' - ? new ComponentMount(ChatbotComponentIonic, interactionParams) - : new ComponentMount(ChatbotComponentCore, interactionParams); - - const componentFactory = this.componentFactoryResolver.resolveComponentFactory( - interactionComponent.component - ); - - const viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - const componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = interactionComponent.data; - - componentRef.instance.complete.subscribe(e => { - this.complete.emit(e); - }); - } -} diff --git a/packages/aws-amplify-angular/src/components/interactions/chatbot/index.ts b/packages/aws-amplify-angular/src/components/interactions/chatbot/index.ts deleted file mode 100644 index 014476b4fc0..00000000000 --- a/packages/aws-amplify-angular/src/components/interactions/chatbot/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export { ChatBotComponent } from './chatbot.factory'; -export { ChatBotClass } from './chatbot.class'; -export { ChatbotComponentCore } from './chatbot.component.core'; -export { ChatbotComponentIonic } from './chatbot.component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/storage/photo-picker-component/index.ts b/packages/aws-amplify-angular/src/components/storage/photo-picker-component/index.ts deleted file mode 100644 index 9e522a0e0f2..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/photo-picker-component/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export { PhotoPickerComponent } from './photo-picker.factory'; -export { PhotoPickerClass } from './photo-picker.class'; -export { PhotoPickerComponentCore } from './photo-picker.component.core'; -export { PhotoPickerIonicComponent } from './photo-picker.component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/storage/photo-picker-component/photo-picker.class.ts b/packages/aws-amplify-angular/src/components/storage/photo-picker-component/photo-picker.class.ts deleted file mode 100644 index 0a257f65ff5..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/photo-picker-component/photo-picker.class.ts +++ /dev/null @@ -1,18 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export class PhotoPickerClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/storage/photo-picker-component/photo-picker.component.core.ts b/packages/aws-amplify-angular/src/components/storage/photo-picker-component/photo-picker.component.core.ts deleted file mode 100644 index a55b3a90edf..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/photo-picker-component/photo-picker.component.core.ts +++ /dev/null @@ -1,187 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - Output, - EventEmitter, - OnInit, - Inject, -} from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; - -const template = ` -
-
-
Select Photos
-
-
- -
-
- - -
-
-
-
- -
{{ errorMessage }}
- × -
-
-
-`; - -@Component({ - selector: 'amplify-photo-picker-core', - template, -}) -export class PhotoPickerComponentCore implements OnInit { - photoUrl: string; - hasPhoto: boolean = false; - uploading: boolean = false; - s3ImageFile: any = null; - s3ImagePath: string = ''; - _storageOptions: any = {}; - errorMessage: string; - protected logger: any; - - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - this.logger = this.amplifyService.logger('PhotoPickerComponent'); - } - - @Input() - set url(url: string) { - this.photoUrl = url; - this.hasPhoto = true; - } - - @Input() - set storageOptions(storageOptions: any) { - this._storageOptions = Object.assign(this._storageOptions, storageOptions); - } - - @Input() - set path(path: string) { - this.s3ImagePath = path; - } - - @Input() - set data(data: any) { - this.photoUrl = data.url; - this.s3ImagePath = data.path; - this._storageOptions = Object.assign( - this._storageOptions, - data.storageOptions - ); - this.hasPhoto = true; - } - - @Output() - picked: EventEmitter = new EventEmitter(); - - @Output() - loaded: EventEmitter = new EventEmitter(); - - @Output() - uploaded: EventEmitter = new EventEmitter(); - - ngOnInit() { - if (!this.amplifyService.storage()) { - throw new Error( - 'Storage module not registered on AmplifyService provider' - ); - } - } - - pick(evt) { - const file = evt.target.files[0]; - if (!file) { - return; - } - if (!this._storageOptions.contentType) { - this._storageOptions.contentType = file.type; - } - const { name, size, type } = file; - this.picked.emit(file); - - this.s3ImagePath = `${this.s3ImagePath}/${file.name}`; - this.s3ImageFile = file; - const that = this; - const reader = new FileReader(); - reader.onload = function(e) { - const target: any = e.target; - const url = target.result; - that.photoUrl = url; - that.hasPhoto = true; - that.loaded.emit(url); - }; - reader.readAsDataURL(file); - } - - uploadFile() { - this.uploading = true; - this.amplifyService - .storage() - .put(this.s3ImagePath, this.s3ImageFile, this._storageOptions) - .then(result => { - this.uploaded.emit(result); - this.completeFileUpload(); - }) - .catch(error => { - this.completeFileUpload(error); - }); - } - - completeFileUpload(error?: any) { - if (error) { - return this._setError(error); - } - this.s3ImagePath = ''; - this.photoUrl = null; - this.s3ImageFile = null; - this.uploading = false; - } - - onPhotoError() { - this.hasPhoto = false; - } - - onAlertClose() { - this._setError(null); - } - - _setError(err) { - if (!err) { - this.errorMessage = null; - return; - } - this.errorMessage = err.message || err; - } -} diff --git a/packages/aws-amplify-angular/src/components/storage/photo-picker-component/photo-picker.component.ionic.ts b/packages/aws-amplify-angular/src/components/storage/photo-picker-component/photo-picker.component.ionic.ts deleted file mode 100644 index e2fb8b2ecfd..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/photo-picker-component/photo-picker.component.ionic.ts +++ /dev/null @@ -1,63 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable -import { Component, Inject } from '@angular/core'; - -import { AmplifyService } from '../../../providers/amplify.service'; -import { PhotoPickerComponentCore } from './photo-picker.component.core'; - -const template = ` -
-
-
Select Photos
-
-
- -
-
- - -
-
-
-
- -
{{ errorMessage }}
- × -
-
-
-`; - -@Component({ - selector: 'amplify-photo-picker-ionic', - template, -}) -export class PhotoPickerIonicComponent extends PhotoPickerComponentCore { - constructor(@Inject(AmplifyService) public amplifyService: AmplifyService) { - super(amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/storage/photo-picker-component/photo-picker.factory.ts b/packages/aws-amplify-angular/src/components/storage/photo-picker-component/photo-picker.factory.ts deleted file mode 100644 index 26bd9f2d5a7..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/photo-picker-component/photo-picker.factory.ts +++ /dev/null @@ -1,98 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, - Output, - EventEmitter, -} from '@angular/core'; -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { PhotoPickerClass } from './photo-picker.class'; -import { PhotoPickerIonicComponent } from './photo-picker.component.ionic'; -import { PhotoPickerComponentCore } from './photo-picker.component.core'; - -@Component({ - selector: 'amplify-photo-picker', - template: ` -
- -
- `, -}) -export class PhotoPickerComponent implements OnInit, OnDestroy { - @Input() framework: string; - @Input() url: string; - @Input() path: string; - @Input() storageOptions: any; - @Output() - picked: EventEmitter = new EventEmitter(); - @Output() - loaded: EventEmitter = new EventEmitter(); - @Output() - uploaded: EventEmitter = new EventEmitter(); - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - const photoPickerComponent = - this.framework && this.framework.toLowerCase() === 'ionic' - ? new ComponentMount(PhotoPickerIonicComponent, { - url: this.url, - path: this.path, - storageOptions: this.storageOptions, - }) - : new ComponentMount(PhotoPickerComponentCore, { - url: this.url, - path: this.path, - storageOptions: this.storageOptions, - }); - - const componentFactory = this.componentFactoryResolver.resolveComponentFactory( - photoPickerComponent.component - ); - - const viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - const componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = photoPickerComponent.data; - - componentRef.instance.picked.subscribe(e => { - this.picked.emit(e); - }); - - componentRef.instance.loaded.subscribe(e => { - this.loaded.emit(e); - }); - - componentRef.instance.uploaded.subscribe(e => { - this.uploaded.emit(e); - }); - } -} diff --git a/packages/aws-amplify-angular/src/components/storage/s3-album-component/index.ts b/packages/aws-amplify-angular/src/components/storage/s3-album-component/index.ts deleted file mode 100644 index 9c043b94a33..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/s3-album-component/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export { S3AlbumComponent } from './s3-album.factory'; -export { S3AlbumClass } from './s3-album.class'; -export { S3AlbumComponentCore } from './s3-album.component.core'; -export { S3AlbumComponentIonic } from './s3-album.component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/storage/s3-album-component/s3-album.class.ts b/packages/aws-amplify-angular/src/components/storage/s3-album-component/s3-album.class.ts deleted file mode 100644 index 00c46b3ce1f..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/s3-album-component/s3-album.class.ts +++ /dev/null @@ -1,18 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export class S3AlbumClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/storage/s3-album-component/s3-album.component.core.ts b/packages/aws-amplify-angular/src/components/storage/s3-album-component/s3-album.component.core.ts deleted file mode 100644 index aed6b41ecf5..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/s3-album-component/s3-album.component.core.ts +++ /dev/null @@ -1,93 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; - -const template = ` -
-
- -
-
-`; - -@Component({ - selector: 'amplify-s3-album-core', - template, -}) -export class S3AlbumComponentCore implements OnInit { - list: Array; - _path: string; - _options: any = {}; - protected logger: any; - - @Output() - selected: EventEmitter = new EventEmitter(); - - constructor(public amplifyService: AmplifyService) { - this.logger = this.amplifyService.logger('S3AlbumComponent'); - } - - ngOnInit() { - if (!this.amplifyService.storage()) { - throw new Error( - 'Storage module not registered on AmplifyService provider' - ); - } - this.getList(this._path, this._options); - } - - onImageSelected(event) { - this.selected.emit(event); - } - - @Input() set data(data: any) { - if (!data.path) { - return; - } - this._path = data.path; - this._options = data.options; - } - - @Input() set path(path: string) { - this._path = path; - } - - @Input() set options(options: any) { - this._options = options; - } - - getList(path, options) { - if (!path) { - return; - } - this.amplifyService - .storage() - .list(path, options) - .then(data => { - this.list = data.map(item => { - return { path: item.key }; - }); - }) - .catch(e => console.error(e)); - } -} diff --git a/packages/aws-amplify-angular/src/components/storage/s3-album-component/s3-album.component.ionic.ts b/packages/aws-amplify-angular/src/components/storage/s3-album-component/s3-album.component.ionic.ts deleted file mode 100644 index ff1b7dca23f..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/s3-album-component/s3-album.component.ionic.ts +++ /dev/null @@ -1,47 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - ViewEncapsulation, - Injector, - ElementRef, -} from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { S3AlbumComponentCore } from './s3-album.component.core'; - -const template = ` -
-
- -
-
-`; - -@Component({ - selector: 'amplify-s3-album-ionic', - template, -}) -export class S3AlbumComponentIonic extends S3AlbumComponentCore { - constructor(public amplifyService: AmplifyService) { - super(amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/storage/s3-album-component/s3-album.factory.ts b/packages/aws-amplify-angular/src/components/storage/s3-album-component/s3-album.factory.ts deleted file mode 100644 index 794da39d586..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/s3-album-component/s3-album.factory.ts +++ /dev/null @@ -1,82 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable -import { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, - Output, - EventEmitter, -} from '@angular/core'; -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { S3AlbumClass } from './s3-album.class'; -import { S3AlbumComponentIonic } from './s3-album.component.ionic'; -import { S3AlbumComponentCore } from './s3-album.component.core'; - -@Component({ - selector: 'amplify-s3-album', - template: ` -
- -
- `, -}) -export class S3AlbumComponent implements OnInit, OnDestroy { - @Input() framework: string; - @Input() path: string; - @Input() options: any; - @Output() - selected: EventEmitter = new EventEmitter(); - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - const albumComponent = - this.framework && this.framework.toLowerCase() === 'ionic' - ? new ComponentMount(S3AlbumComponentIonic, { - path: this.path, - options: this.options, - }) - : new ComponentMount(S3AlbumComponentCore, { - path: this.path, - options: this.options, - }); - - const componentFactory = this.componentFactoryResolver.resolveComponentFactory( - albumComponent.component - ); - - const viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - const componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = albumComponent.data; - - componentRef.instance.selected.subscribe(e => { - this.selected.emit(e); - }); - } -} diff --git a/packages/aws-amplify-angular/src/components/storage/s3-image-component/index.ts b/packages/aws-amplify-angular/src/components/storage/s3-image-component/index.ts deleted file mode 100644 index ed1171894c7..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/s3-image-component/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export { S3ImageComponent } from './s3-image.factory'; -export { S3ImageClass } from './s3-image.class'; -export { S3ImageComponentCore } from './s3-image.component.core'; -export { S3ImageComponentIonic } from './s3-image.component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/storage/s3-image-component/s3-image.class.ts b/packages/aws-amplify-angular/src/components/storage/s3-image-component/s3-image.class.ts deleted file mode 100644 index fab8142cf10..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/s3-image-component/s3-image.class.ts +++ /dev/null @@ -1,18 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -export class S3ImageClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/storage/s3-image-component/s3-image.component.core.ts b/packages/aws-amplify-angular/src/components/storage/s3-image-component/s3-image.component.core.ts deleted file mode 100644 index e0635823a95..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/s3-image-component/s3-image.component.core.ts +++ /dev/null @@ -1,86 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; - -const template = ` - -`; - -@Component({ - selector: 'amplify-s3-image-core', - template, -}) -export class S3ImageComponentCore implements OnInit { - url: any; - _path: string; - _options: any = {}; - protected logger: any; - - @Output() - selected: EventEmitter = new EventEmitter(); - - constructor(public amplifyService: AmplifyService) { - this.logger = this.amplifyService.logger('S3ImageComponent'); - } - - @Input() - set data(data: any) { - if (!data.path) { - return; - } - this._path = data.path; - this._options = data.options; - } - - @Input() - set path(path: string) { - this._path = path; - } - - @Input() - set options(options: any) { - this._options = options; - } - - ngOnInit() { - if (!this._path) { - return; - } - if (!this.amplifyService.storage()) { - throw new Error( - 'Storage module not registered on AmplifyService provider' - ); - } - this.getImage(this._path, this._options); - } - - onImageClicked() { - this.selected.emit(this.url); - } - - getImage(path, options) { - this.amplifyService - .storage() - .get(path, options) - .then(url => (this.url = url)) - .catch(e => console.error(e)); - } -} diff --git a/packages/aws-amplify-angular/src/components/storage/s3-image-component/s3-image.component.ionic.ts b/packages/aws-amplify-angular/src/components/storage/s3-image-component/s3-image.component.ionic.ts deleted file mode 100644 index 509569ee100..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/s3-image-component/s3-image.component.ionic.ts +++ /dev/null @@ -1,42 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - ViewEncapsulation, - Injector, - ElementRef, -} from '@angular/core'; -import { AmplifyService } from '../../../providers/amplify.service'; -import { S3ImageComponentCore } from './s3-image.component.core'; - -const template = ` - -`; - -@Component({ - selector: 'amplify-s3-image-ionic', - template, -}) -export class S3ImageComponentIonic extends S3ImageComponentCore { - constructor(public amplifyService: AmplifyService) { - super(amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/storage/s3-image-component/s3-image.factory.ts b/packages/aws-amplify-angular/src/components/storage/s3-image-component/s3-image.factory.ts deleted file mode 100644 index b23270d0ab5..00000000000 --- a/packages/aws-amplify-angular/src/components/storage/s3-image-component/s3-image.factory.ts +++ /dev/null @@ -1,83 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, - Output, - EventEmitter, -} from '@angular/core'; -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { S3ImageClass } from './s3-image.class'; -import { S3ImageComponentIonic } from './s3-image.component.ionic'; -import { S3ImageComponentCore } from './s3-image.component.core'; - -@Component({ - selector: 'amplify-s3-image', - template: ` -
- -
- `, -}) -export class S3ImageComponent implements OnInit, OnDestroy { - @Input() framework: string; - @Input() path: string; - @Input() options: any; - @Output() - selected: EventEmitter = new EventEmitter(); - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - const imageComponent = - this.framework && this.framework.toLowerCase() === 'ionic' - ? new ComponentMount(S3ImageComponentIonic, { - path: this.path, - options: this.options, - }) - : new ComponentMount(S3ImageComponentCore, { - path: this.path, - options: this.options, - }); - - const componentFactory = this.componentFactoryResolver.resolveComponentFactory( - imageComponent.component - ); - - const viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - const componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = imageComponent.data; - - componentRef.instance.selected.subscribe(e => { - this.selected.emit(e); - }); - } -} diff --git a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/index.ts b/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/index.ts deleted file mode 100644 index 9346a98dead..00000000000 --- a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 { SumerianSceneComponentCore } from './sumerian-scene.component.core'; -export { SumerianSceneComponentIonic } from './sumerian-scene.component.ionic'; diff --git a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene-loading.component.core.ts b/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene-loading.component.core.ts deleted file mode 100644 index fd5e94cdb8e..00000000000 --- a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene-loading.component.core.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 { Component, Input } from '@angular/core'; -import * as AmplifyUI from '@aws-amplify/ui'; - -import { sumerianScene } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
- - - - - - - - - -
-
{{sceneName}}
-
{{sceneError}}
-
-
-
-
-
-`; - -@Component({ - selector: 'sumerian-scene-loading-core', - template, -}) -export class SumerianSceneLoadingComponentCore { - @Input() loadPercentage: number; - @Input() sceneName: string; - @Input() sceneError: string | null; - - AmplifyUI: any; - - constructor() { - this.AmplifyUI = AmplifyUI; - } -} diff --git a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene-loading.component.ionic.ts b/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene-loading.component.ionic.ts deleted file mode 100644 index f9a9050e238..00000000000 --- a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene-loading.component.ionic.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 { Component } from '@angular/core'; -import { SumerianSceneLoadingComponentCore } from './sumerian-scene-loading.component.core'; - -import { sumerianScene } from '../../../assets/data-test-attributes'; - -const template = ` -
-
-
- - - - - - - - - -
-
{{sceneName}}
-
{{sceneError}}
-
-
-
-
-
-`; - -@Component({ - selector: 'sumerian-scene-loading-ionic', - template, -}) -export class SumerianSceneLoadingComponentIonic extends SumerianSceneLoadingComponentCore { - constructor() { - super(); - } -} diff --git a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene.class.ts b/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene.class.ts deleted file mode 100644 index a75dfc767cd..00000000000 --- a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene.class.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 class SumerianSceneClass { - data: any; -} diff --git a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene.component.core.ts b/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene.component.core.ts deleted file mode 100644 index ce19f78557b..00000000000 --- a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene.component.core.ts +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 { Component, OnInit, OnDestroy, Input } from '@angular/core'; -import { AmplifyService } from '../../../providers'; - -import * as AmplifyUI from '@aws-amplify/ui'; - -import { sumerianScene } from '../../../assets/data-test-attributes'; - -const template = ` -
-
- -
-
- -
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-`; - -@Component({ - selector: 'sumerian-scene-core', - template, -}) -export class SumerianSceneComponentCore implements OnInit, OnDestroy { - @Input() sceneName: string; - - loading = false; - loadPercentage = 0; - muted = false; - showEnableAudio = false; - isVRCapable = false; - isVRPresentationActive = false; - isFullscreen = false; - sceneError = null; - amplifyUI: any; - protected logger: any; - - @Input() - set data(data: any) { - this.sceneName = data.sceneName; - } - - constructor(public amplifyService: AmplifyService) { - this.amplifyUI = AmplifyUI; - this.logger = this.amplifyService.logger('SumerianSceneComponentCore'); - } - - ngOnInit() { - document.addEventListener( - 'fullscreenchange', - this.onFullscreenChange.bind(this) - ); - document.addEventListener( - 'webkitfullscreenchange', - this.onFullscreenChange.bind(this) - ); - document.addEventListener( - 'mozfullscreenchange', - this.onFullscreenChange.bind(this) - ); - document.addEventListener( - 'MSFullscreenChange', - this.onFullscreenChange.bind(this) - ); - - if (!this.amplifyService.xr()) { - throw new Error('XR module not registered on AmplifyService provider'); - } - - this.loadAndStartScene(); - } - - ngOnDestroy() { - document.removeEventListener( - 'fullscreenchange', - this.onFullscreenChange.bind(this) - ); - document.removeEventListener( - 'webkitfullscreenchange', - this.onFullscreenChange.bind(this) - ); - document.removeEventListener( - 'mozfullscreenchange', - this.onFullscreenChange.bind(this) - ); - document.removeEventListener( - 'MSFullscreenChange', - this.onFullscreenChange.bind(this) - ); - } - - progressCallback = progress => { - const percentage = progress * 100; - this.loadPercentage = percentage; - }; - - async loadAndStartScene() { - this.loading = true; - const sceneOptions = { - progressCallback: this.progressCallback, - }; - try { - await this.amplifyService - .xr() - .loadScene(this.sceneName, 'sumerian-scene-dom-id', sceneOptions); - } catch (e) { - this.sceneError = 'Failed to load scene'; - this.logger.error(this.sceneError, e); - return; - } - this.amplifyService.xr().start(this.sceneName); - - this.loading = false; - this.muted = this.amplifyService.xr().isMuted(this.sceneName); - - this.isVRCapable = this.amplifyService.xr().isVRCapable(this.sceneName); - this.isVRPresentationActive = this.amplifyService - .xr() - .isVRPresentationActive(this.sceneName); - - this.amplifyService - .xr() - .onSceneEvent( - this.sceneName, - 'AudioEnabled', - () => (this.showEnableAudio = false) - ); - this.amplifyService - .xr() - .onSceneEvent( - this.sceneName, - 'AudioDisabled', - () => (this.showEnableAudio = true) - ); - } - - setMuted(muted) { - this.muted = muted; - this.amplifyService.xr().setMuted(this.sceneName, muted); - if (this.showEnableAudio) { - this.amplifyService.xr().enableAudio(this.sceneName); - this.showEnableAudio = false; - } - } - - toggleVRPresentation() { - try { - if (this.isVRPresentationActive) { - this.amplifyService.xr().exitVR(this.sceneName); - } else { - this.amplifyService.xr().enterVR(this.sceneName); - } - } catch (e) { - this.logger.error('Unable to start/stop WebVR System: ' + e.message); - return; - } - this.isVRPresentationActive = !this.isVRPresentationActive; - } - - onFullscreenChange() { - const doc: any = document; - this.isFullscreen = doc.fullscreenElement !== null; - } - - async maximize() { - const sceneDomElement: any = document.getElementById( - 'sumerian-scene-container' - ); - const requestFullScreen = - sceneDomElement.requestFullscreen || - sceneDomElement.msRequestFullscreen || - sceneDomElement.mozRequestFullScreen || - sceneDomElement.webkitRequestFullscreen; - requestFullScreen.call(sceneDomElement); - } - - async minimize() { - const doc: any = document; - if (doc.exitFullscreen) { - doc.exitFullscreen(); - } else if (doc.mozCancelFullScreen) { - doc.mozCancelFullScreen(); - } else if (doc.webkitExitFullscreen) { - doc.webkitExitFullscreen(); - } - } -} diff --git a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene.component.ionic.ts b/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene.component.ionic.ts deleted file mode 100644 index 7d9c2ddd491..00000000000 --- a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene.component.ionic.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 { Component } from '@angular/core'; -import { SumerianSceneComponentCore } from './sumerian-scene.component.core'; -import { AmplifyService } from '../../../providers'; -import * as AmplifyUI from '@aws-amplify/ui'; - -import { sumerianScene } from '../../../assets/data-test-attributes'; - -const template = ` -
-
- -
-
- -
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-`; - -@Component({ - selector: 'sumerian-scene-ionic', - template, -}) -export class SumerianSceneComponentIonic extends SumerianSceneComponentCore { - amplifyUI: any; - - constructor(public amplifyService: AmplifyService) { - super(amplifyService); - } -} diff --git a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene.factory.ts b/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene.factory.ts deleted file mode 100644 index 73df4b2c897..00000000000 --- a/packages/aws-amplify-angular/src/components/xr/sumerian-scene-component/sumerian-scene.factory.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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 { - Component, - Input, - OnInit, - ViewChild, - ComponentFactoryResolver, - OnDestroy, -} from '@angular/core'; - -import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive'; -import { ComponentMount } from '../../component.mount'; -import { SumerianSceneClass } from './sumerian-scene.class'; -import { SumerianSceneComponentCore } from './sumerian-scene.component.core'; -import { SumerianSceneComponentIonic } from './sumerian-scene.component.ionic'; - -@Component({ - selector: 'amplify-sumerian-scene', - template: ` - - `, -}) -export class SumerianSceneComponent implements OnInit, OnDestroy { - @Input() framework: string; - @Input() sceneName: string; - @ViewChild(DynamicComponentDirective) - componentHost: DynamicComponentDirective; - - constructor(private componentFactoryResolver: ComponentFactoryResolver) {} - - ngOnInit() { - this.loadComponent(); - } - - ngOnDestroy() {} - - loadComponent() { - let sumerianScene = - this.framework && this.framework.toLowerCase() === 'ionic' - ? new ComponentMount(SumerianSceneComponentIonic, { - sceneName: this.sceneName, - }) - : new ComponentMount(SumerianSceneComponentCore, { - sceneName: this.sceneName, - }); - - let componentFactory = this.componentFactoryResolver.resolveComponentFactory( - sumerianScene.component - ); - - let viewContainerRef = this.componentHost.viewContainerRef; - viewContainerRef.clear(); - - let componentRef = viewContainerRef.createComponent(componentFactory); - (componentRef.instance).data = sumerianScene.data; - } -} diff --git a/packages/aws-amplify-angular/src/directives/dynamic.component.directive.ts b/packages/aws-amplify-angular/src/directives/dynamic.component.directive.ts deleted file mode 100644 index 187e540f86f..00000000000 --- a/packages/aws-amplify-angular/src/directives/dynamic.component.directive.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Directive, ViewContainerRef } from '@angular/core'; - -@Directive({ - selector: '[component-host]', -}) -export class DynamicComponentDirective { - constructor(public viewContainerRef: ViewContainerRef) {} -} diff --git a/packages/aws-amplify-angular/src/directives/index.ts b/packages/aws-amplify-angular/src/directives/index.ts deleted file mode 100644 index c2431d40f4b..00000000000 --- a/packages/aws-amplify-angular/src/directives/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { DynamicComponentDirective } from './dynamic.component.directive'; diff --git a/packages/aws-amplify-angular/src/providers/amplify.compose.service.ts b/packages/aws-amplify-angular/src/providers/amplify.compose.service.ts deleted file mode 100644 index df4ebe9270c..00000000000 --- a/packages/aws-amplify-angular/src/providers/amplify.compose.service.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { AmplifyService } from './amplify.service'; - -export default modules => { - return new AmplifyService(modules); -}; diff --git a/packages/aws-amplify-angular/src/providers/amplify.service.ts b/packages/aws-amplify-angular/src/providers/amplify.service.ts deleted file mode 100644 index 26d0a1ac716..00000000000 --- a/packages/aws-amplify-angular/src/providers/amplify.service.ts +++ /dev/null @@ -1,106 +0,0 @@ -// tslint:disable -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ -// tslint:enable - -import { Injectable, Optional, Inject } from '@angular/core'; -import { Observable, Subject } from 'rxjs'; -import Amplify, { Logger, I18n } from '@aws-amplify/core'; -import { AuthState } from './auth.state'; -import { authDecorator } from './auth.decorator'; - -import { Analytics } from '@aws-amplify/analytics'; - -import { Auth } from '@aws-amplify/auth'; -import { Storage } from '@aws-amplify/storage'; -import { API } from '@aws-amplify/api'; -import { PubSub } from '@aws-amplify/pubsub'; -import { Interactions } from '@aws-amplify/interactions'; -import { XR } from '@aws-amplify/xr'; - -@Injectable() -export class AmplifyService { - private _auth: any; - private _analytics: any; - private _storage: any; - private _api: any; - private _cache: any; - private _pubsub: any; - private _interactions: any; - private _logger: any; - private _xr: any; - private _i18n: any; - private _authState = new Subject(); - authStateChange$ = this._authState.asObservable(); - - constructor( - @Inject('modules') - @Optional() - private modules: any = {} - ) { - const source = modules || Amplify; - - authDecorator(this._authState, source.Auth); - - this._auth = source.Auth; - this._analytics = source.Analytics; - this._storage = source.Storage; - this._api = source.API; - this._cache = source.Cache; - this._pubsub = source.PubSub; - this._interactions = source.Interactions; - this._xr = source.XR; - - // i18n and logger instantiated by default (do not change) - this._i18n = I18n; - this._logger = Logger; - } - - auth(): any { - return this._auth || Auth; - } - analytics(): any { - return this._analytics || Analytics; - } - storage(): any { - return this._storage || Storage; - } - api(): any { - return this._api || API; - } - interactions(): any { - return this._interactions || Interactions; - } - cache(): any { - return this._cache; - } - pubsub(): any { - return this._pubsub || PubSub; - } - logger(name, level?): Logger { - return new this._logger(name, level); - } - xr(): any { - return this._xr || XR; - } - i18n(): any { - return this._i18n; - } - - authState() { - return this._authState; - } - setAuthState(state: AuthState) { - this._authState.next(state); - } -} diff --git a/packages/aws-amplify-angular/src/providers/auth.decorator.ts b/packages/aws-amplify-angular/src/providers/auth.decorator.ts deleted file mode 100644 index b4a05f5f389..00000000000 --- a/packages/aws-amplify-angular/src/providers/auth.decorator.ts +++ /dev/null @@ -1,140 +0,0 @@ -import { Subject } from 'rxjs'; -import { Amplify, Logger, Hub } from '@aws-amplify/core'; -import { AuthState } from './auth.state'; -import * as _ from 'lodash'; - -const logger = new Logger('AuthDecorator'); - -function check(authState: Subject, Auth) { - // check for current authenticated user to init authState - Auth.currentAuthenticatedUser() - .then(user => { - logger.debug('has authenticated user', user); - authState.next({ state: 'signedIn', user }); - }) - .catch(err => { - logger.debug('no authenticated user', err); - authState.next({ state: 'signedOut', user: null }); - }); -} - -function listen(authState: Subject) { - const config = Amplify.configure(null); - if (_.has(config, 'Auth.oauth')) { - Hub.listen( - 'auth', - { - onHubCapsule: capsule => { - const { channel, payload } = capsule; - if (channel === 'auth') { - const { username } = payload.data; - logger.debug('authentication oauth event', payload); - authState.next({ state: payload.event, user: { username } }); - } - }, - }, - 'angularAuthListener' - ); - } -} - -function decorateSignIn(authState: Subject, Auth) { - const _signIn = Auth.signIn; - Auth.signIn = (username: string, password: string): Promise => { - return _signIn - .call(Auth, username, password) - .then(user => { - logger.debug('signIn success'); - if (!user.challengeName) { - authState.next({ state: 'signedIn', user }); - return user; - } - - logger.debug('signIn challenge: ' + user.challengeName); - if (user.challengeName === 'NEW_PASSWORD_REQUIRED') { - authState.next({ state: 'requireNewPassword', user }); - } else if (user.challengeName === 'MFA_SETUP') { - authState.next({ state: 'setupMFA', user }); - } else if ( - user.challengeName === 'SMS_MFA' || - user.challengeName === 'SOFTWARE_TOKEN_MFA' - ) { - authState.next({ state: 'confirmSignIn', user }); - } else { - logger.debug( - 'warning: unhandled challengeName ' + user.challengeName - ); - } - return user; - }) - .catch(err => { - logger.debug('signIn error', err); - throw err; - }); - }; -} - -function decorateSignOut(authState: Subject, Auth) { - const _signOut = Auth.signOut; - Auth.signOut = (opts: { global: boolean } | undefined): Promise => { - return _signOut - .call(Auth, opts) - .then(data => { - logger.debug('signOut success'); - authState.next({ state: 'signedOut', user: null }); - return data; - }) - .catch(err => { - logger.debug('signOut error', err); - throw err; - }); - }; -} - -function decorateSignUp(authState: Subject, Auth) { - const _signUp = Auth.signUp; - Auth.signUp = ( - username: string, - password: string, - email: string, - phone_number: string - ): Promise => { - return _signUp - .call(Auth, username, password, email, phone_number) - .then(data => { - logger.debug('signUp success'); - authState.next({ state: 'confirmSignUp', user: { username } }); - return data; - }) - .catch(err => { - logger.debug('signUp error', err); - throw err; - }); - }; -} - -function decorateConfirmSignUp(authState: Subject, Auth) { - const _confirmSignUp = Auth.confirmSignUp; - Auth.confirmSignUp = (username: string, code: string): Promise => { - return _confirmSignUp - .call(Auth, username, code) - .then(data => { - logger.debug('confirmSignUp success'); - authState.next({ state: 'signIn', user: { username } }); - return data; - }) - .catch(err => { - logger.debug('confirmSignUp error', err); - throw err; - }); - }; -} - -export function authDecorator(authState: Subject, authModule) { - check(authState, authModule); - listen(authState); - decorateSignIn(authState, authModule); - decorateSignOut(authState, authModule); - decorateSignUp(authState, authModule); - decorateConfirmSignUp(authState, authModule); -} diff --git a/packages/aws-amplify-angular/src/providers/auth.state.ts b/packages/aws-amplify-angular/src/providers/auth.state.ts deleted file mode 100644 index 4ce5d2a5b96..00000000000 --- a/packages/aws-amplify-angular/src/providers/auth.state.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface AuthState { - state: string; // signedOut, signedIn, mfaRequired, newPasswordRequired - user: any; -} diff --git a/packages/aws-amplify-angular/src/providers/index.ts b/packages/aws-amplify-angular/src/providers/index.ts deleted file mode 100644 index 40dfd60833a..00000000000 --- a/packages/aws-amplify-angular/src/providers/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { AmplifyService } from './amplify.service'; -export { AuthState } from './auth.state'; -export { default as AmplifyModules } from './amplify.compose.service'; diff --git a/packages/aws-amplify-angular/src/tsconfig.spec.json b/packages/aws-amplify-angular/src/tsconfig.spec.json deleted file mode 100644 index 52d8df47f6a..00000000000 --- a/packages/aws-amplify-angular/src/tsconfig.spec.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/spec", - "module": "commonjs", - "target": "es5", - "baseUrl": "", - "allowJs": true - }, - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ] -} \ No newline at end of file diff --git a/packages/aws-amplify-angular/test_setup/setup-jest.ts b/packages/aws-amplify-angular/test_setup/setup-jest.ts deleted file mode 100644 index 0381fc3c0bb..00000000000 --- a/packages/aws-amplify-angular/test_setup/setup-jest.ts +++ /dev/null @@ -1,25 +0,0 @@ -import 'jest-preset-angular'; - -window.alert = msg => { - console.log(msg); -}; - -function noOp(): any {} - -if (typeof window.URL.createObjectURL === 'undefined') { - Object.defineProperty(window.URL, 'createObjectURL', { value: noOp }); -} - -class MockWorker implements Worker { - onmessage = noOp; - postMessage = noOp; - terminate = noOp; - addEventListener = noOp; - removeEventListener = noOp; - onerror = noOp; - dispatchEvent(event: Event): boolean { - throw new Error('Method not implemented.'); - } -} - -window.Worker = MockWorker; diff --git a/packages/aws-amplify-angular/theme.css b/packages/aws-amplify-angular/theme.css deleted file mode 100644 index 2d8b39fe7b4..00000000000 --- a/packages/aws-amplify-angular/theme.css +++ /dev/null @@ -1,3 +0,0 @@ -@import "~@aws-amplify/ui/src/Theme.css"; -@import "~@aws-amplify/ui/src/Angular.css"; -@import "~@aws-amplify/ui/dist/style.css"; diff --git a/packages/aws-amplify-angular/tsconfig.json b/packages/aws-amplify-angular/tsconfig.json deleted file mode 100644 index bfd20b1ab1e..00000000000 --- a/packages/aws-amplify-angular/tsconfig.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": ".", - "allowJs": true, - "stripInternal": true, - "experimentalDecorators": true, - "strictNullChecks": false, - "noImplicitAny": false, - "module": "es2015", - "moduleResolution": "node", - "paths": { - "@angular/core": ["node_modules/@angular/core"], - "rxjs/*": ["node_modules/rxjs/*"] - }, - "rootDir": ".", - "outDir": "dist", - "sourceMap": true, - "inlineSources": true, - "target": "es5", - "skipLibCheck": true, - "lib": [ - "es2015", - "dom" - ] - }, - "files": [ - "index.ts", - "src/components/interactions/chatbot/aws-lex-audio.js" - ], - "angularCompilerOptions": { - "strictMetadataEmit": true - } -} \ No newline at end of file diff --git a/packages/aws-amplify-react-native/.npmignore b/packages/aws-amplify-react-native/.npmignore deleted file mode 100644 index aecea949298..00000000000 --- a/packages/aws-amplify-react-native/.npmignore +++ /dev/null @@ -1,10 +0,0 @@ -__mocks__/** -__tests__/** -Authenticator_Architecture.png -docs/** -jsDoc.config.json -node_modules/** -README.md -.vscode/** -.DS_Store -*.log diff --git a/packages/aws-amplify-react-native/package.json b/packages/aws-amplify-react-native/package.json index cb7fe698f36..9b72923e51f 100644 --- a/packages/aws-amplify-react-native/package.json +++ b/packages/aws-amplify-react-native/package.json @@ -1,6 +1,6 @@ { "name": "aws-amplify-react-native", - "version": "6.0.8", + "version": "7.0.0", "description": "AWS Amplify is a JavaScript library for Frontend and mobile developers building cloud-enabled applications.", "main": "dist/index.js", "scripts": { @@ -40,12 +40,12 @@ "react-test-renderer": "^17.0.2", "rimraf": "^2.6.2" }, - "dependencies": { + "dependencies": { "buffer": "^5.2.1" }, "peerDependencies": { "@react-native-picker/picker": ">=1.2", - "aws-amplify": "4.x.x", + "aws-amplify": "5.x.x", "graphql": "^14.0.0" }, "repository": { diff --git a/packages/aws-amplify-react-native/src/API/GraphQL/index.ts b/packages/aws-amplify-react-native/src/API/GraphQL/index.ts index 32c87ba7b89..f7a08143b2c 100644 --- a/packages/aws-amplify-react-native/src/API/GraphQL/index.ts +++ b/packages/aws-amplify-react-native/src/API/GraphQL/index.ts @@ -1,14 +1,4 @@ -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 export { default as Connect } from './Connect'; diff --git a/packages/aws-amplify-react-native/src/API/index.ts b/packages/aws-amplify-react-native/src/API/index.ts index c5cc10efb99..68d1b3d5fcd 100644 --- a/packages/aws-amplify-react-native/src/API/index.ts +++ b/packages/aws-amplify-react-native/src/API/index.ts @@ -1,14 +1,4 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 -export * from './GraphQL'; +export { Connect } from './GraphQL'; diff --git a/packages/aws-amplify-react-native/src/AmplifyI18n.ts b/packages/aws-amplify-react-native/src/AmplifyI18n.ts index c93858c38f2..08d75260260 100644 --- a/packages/aws-amplify-react-native/src/AmplifyI18n.ts +++ b/packages/aws-amplify-react-native/src/AmplifyI18n.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 const dict = { de: { diff --git a/packages/aws-amplify-react-native/src/AmplifyMessageMap.ts b/packages/aws-amplify-react-native/src/AmplifyMessageMap.ts index 836abae8302..b76e9c40c00 100644 --- a/packages/aws-amplify-react-native/src/AmplifyMessageMap.ts +++ b/packages/aws-amplify-react-native/src/AmplifyMessageMap.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { I18n } from 'aws-amplify'; diff --git a/packages/aws-amplify-react-native/src/AmplifyTestIDs.js b/packages/aws-amplify-react-native/src/AmplifyTestIDs.js index ad938922770..3b0550935a1 100644 --- a/packages/aws-amplify-react-native/src/AmplifyTestIDs.js +++ b/packages/aws-amplify-react-native/src/AmplifyTestIDs.js @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 // Using CJS so these can be used with Detox tests. module.exports = { diff --git a/packages/aws-amplify-react-native/src/AmplifyTheme.ts b/packages/aws-amplify-react-native/src/AmplifyTheme.ts index 98f4f32d31d..06d784c9ed6 100644 --- a/packages/aws-amplify-react-native/src/AmplifyTheme.ts +++ b/packages/aws-amplify-react-native/src/AmplifyTheme.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { Platform, StyleSheet } from 'react-native'; diff --git a/packages/aws-amplify-react-native/src/Auth/common/default-sign-up-fields.ts b/packages/aws-amplify-react-native/src/Auth/common/default-sign-up-fields.ts index b6651aa6073..5440809574c 100644 --- a/packages/aws-amplify-react-native/src/Auth/common/default-sign-up-fields.ts +++ b/packages/aws-amplify-react-native/src/Auth/common/default-sign-up-fields.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import TEST_ID from '../../AmplifyTestIDs'; import { ISignUpField } from '../../../types'; diff --git a/packages/aws-amplify-react-native/src/Interactions/ChatBot.tsx b/packages/aws-amplify-react-native/src/Interactions/ChatBot.tsx index 4583510fb4e..b3672db42f0 100644 --- a/packages/aws-amplify-react-native/src/Interactions/ChatBot.tsx +++ b/packages/aws-amplify-react-native/src/Interactions/ChatBot.tsx @@ -1,12 +1,6 @@ import React, { Component } from 'react'; -import { - View, - TextInput, - Text, - KeyboardAvoidingView, - ScrollView, -} from 'react-native'; -import Interactions from '@aws-amplify/interactions'; +import { View, TextInput, Text, KeyboardAvoidingView, ScrollView } from 'react-native'; +import { Interactions } from '@aws-amplify/interactions'; import { I18n } from 'aws-amplify'; import { AmplifyButton } from '../AmplifyUI'; import { ConsoleLogger as Logger } from '@aws-amplify/core'; @@ -194,13 +188,10 @@ export class ChatBot extends Component { return; } - await new Promise(resolve => + await new Promise((resolve) => this.setState( { - dialog: [ - ...this.state.dialog, - { message: this.state.inputText, from: 'me' }, - ], + dialog: [...this.state.dialog, { message: this.state.inputText, from: 'me' }], }, resolve ) @@ -214,15 +205,9 @@ export class ChatBot extends Component { messageType: 'text', }, }; - response = await Interactions.send( - this.props.botName, - interactionsMessage - ); + response = await Interactions.send(this.props.botName, interactionsMessage); } else { - response = await Interactions.send( - this.props.botName, - this.state.inputText - ); + response = await Interactions.send(this.props.botName, this.state.inputText); } this.setState( @@ -254,19 +239,16 @@ export class ChatBot extends Component { const path = `${RNFS.DocumentDirectoryPath}/responseAudio.mp3`; const data = Buffer.from(response.audioStream).toString('base64'); await RNFS.writeFile(path, data, 'base64'); - const speech = new Sound(path, '', async err => { + const speech = new Sound(path, '', async (err) => { if (!err) { speech.play(async () => { speech.release(); - RNFS.exists(path).then(res => { + RNFS.exists(path).then((res) => { if (res) { RNFS.unlink(path); } }); - if ( - response.dialogState === 'ElicitSlot' && - this.props.conversationModeOn - ) { + if (response.dialogState === 'ElicitSlot' && this.props.conversationModeOn) { await this.startRecognizing(); } }); @@ -284,10 +266,7 @@ export class ChatBot extends Component { this.setState( { - dialog: [ - ...(!clearOnComplete && this.state.dialog), - message && { from: 'bot', message }, - ].filter(Boolean), + dialog: [...(!clearOnComplete && this.state.dialog), message && { from: 'bot', message }].filter(Boolean), }, () => { setTimeout(() => { @@ -394,11 +373,7 @@ export class ChatBot extends Component { const { styles: overrideStyles } = this.props; return ( - + { textEnabled={this.props.textEnabled} styles={styles} overrideStyles={overrideStyles} - onChangeText={inputText => this.setState({ inputText })} + onChangeText={(inputText) => this.setState({ inputText })} inputText={this.state.inputText} onSubmitEditing={this.submit} editable={this.state.inputEditable} @@ -455,12 +430,7 @@ function ChatBotInputs(props) { } if (!voiceEnabled && !textEnabled) { - return ( - - No Chatbot inputs enabled. Set at least one of voiceEnabled or - textEnabled in the props.{' '} - - ); + return No Chatbot inputs enabled. Set at least one of voiceEnabled or textEnabled in the props. ; } return ( @@ -552,11 +522,7 @@ function ChatBotMicButton(props) { } return ( - + ); } diff --git a/packages/aws-amplify-react-native/src/Interactions/index.ts b/packages/aws-amplify-react-native/src/Interactions/index.ts index 4717527a60d..e7a8217e7b9 100644 --- a/packages/aws-amplify-react-native/src/Interactions/index.ts +++ b/packages/aws-amplify-react-native/src/Interactions/index.ts @@ -1 +1 @@ -export * from './ChatBot'; +export { ChatBot } from './ChatBot'; diff --git a/packages/aws-amplify-react-native/src/Storage/index.ts b/packages/aws-amplify-react-native/src/Storage/index.ts index e0556bcaa92..e7f47236b49 100644 --- a/packages/aws-amplify-react-native/src/Storage/index.ts +++ b/packages/aws-amplify-react-native/src/Storage/index.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 export { default as S3Image } from './S3Image'; export { default as S3Album } from './S3Album'; diff --git a/packages/aws-amplify-react-native/src/index.ts b/packages/aws-amplify-react-native/src/index.ts index a5f08628964..213617ec44e 100644 --- a/packages/aws-amplify-react-native/src/index.ts +++ b/packages/aws-amplify-react-native/src/index.ts @@ -1,28 +1,42 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 import { default as AmplifyCore, I18n } from 'aws-amplify'; import dict from './AmplifyI18n'; export { default as AmplifyTheme } from './AmplifyTheme'; export { MapEntries as AmplifyMessageMapEntries } from './AmplifyMessageMap'; -export * from './AmplifyUI'; -export * from './Auth'; -export * from './API'; -export * from './Storage'; -export * from './Interactions'; +export { + AmplifyButton, + Container, + ErrorRow, + FormField, + Header, + LinkCell, + PhoneField, + SignedOutMessage, + Wrapper, +} from './AmplifyUI'; +export { + AuthPiece, + Authenticator, + ConfirmSignIn, + ConfirmSignUp, + ForgotPassword, + Greetings, + Loading, + RequireNewPassword, + SignIn, + SignUp, + VerifyContact, + withAuthenticator, + withOAuth, +} from './Auth'; +export { Connect } from './API'; +export { S3Album, S3Image } from './Storage'; +export { ChatBot } from './Interactions'; -const configure = function(config) { +const configure = function (config) { const msg = [ '', '\x1b[33mWarning: Amplify.configure() is deprecated from aws-amplify-react-native.', diff --git a/packages/aws-amplify-react-native/tsconfig.build.json b/packages/aws-amplify-react-native/tsconfig.build.json new file mode 100644 index 00000000000..ebeb1f1498e --- /dev/null +++ b/packages/aws-amplify-react-native/tsconfig.build.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": {}, + "include": ["src"] +} diff --git a/packages/aws-amplify-react-native/types.d.ts b/packages/aws-amplify-react-native/types.d.ts index 7da2b2f6a5d..95a1100682f 100644 --- a/packages/aws-amplify-react-native/types.d.ts +++ b/packages/aws-amplify-react-native/types.d.ts @@ -1,15 +1,5 @@ -/* - * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://aws.amazon.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file 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. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 export type HubCapsule = { channel: string; diff --git a/packages/aws-amplify-react/.npmignore b/packages/aws-amplify-react/.npmignore deleted file mode 100644 index 45a02706f47..00000000000 --- a/packages/aws-amplify-react/.npmignore +++ /dev/null @@ -1,16 +0,0 @@ -__mocks__/** -__tests__/** -coverage/** -docs/** -media/** -node_modules/** -test_Setup/** -.vscode/** -.DS_Store -*.log -lib/.tsbuildinfo -lib-esm/.tsbuildinfo -prepend-license.js -cypress/** -cypress.json -tsc-out/** \ No newline at end of file diff --git a/packages/aws-amplify-react/CHANGELOG.md b/packages/aws-amplify-react/CHANGELOG.md deleted file mode 100644 index 402a6d6a073..00000000000 --- a/packages/aws-amplify-react/CHANGELOG.md +++ /dev/null @@ -1,2427 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.1.44](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.43...aws-amplify-react@5.1.44) (2022-11-04) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.43](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.42...aws-amplify-react@5.1.43) (2022-10-27) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.42](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.41...aws-amplify-react@5.1.42) (2022-10-26) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.41](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.40...aws-amplify-react@5.1.41) (2022-10-25) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.40](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.39...aws-amplify-react@5.1.40) (2022-10-14) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.39](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.38...aws-amplify-react@5.1.39) (2022-10-14) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.38](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.36...aws-amplify-react@5.1.38) (2022-09-30) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.37](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.36...aws-amplify-react@5.1.37) (2022-09-20) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.36](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.35...aws-amplify-react@5.1.36) (2022-09-08) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.35](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.34...aws-amplify-react@5.1.35) (2022-09-01) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.34](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.33...aws-amplify-react@5.1.34) (2022-08-23) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.33](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.32...aws-amplify-react@5.1.33) (2022-08-18) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.32](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.31...aws-amplify-react@5.1.32) (2022-08-16) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.31](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.30...aws-amplify-react@5.1.31) (2022-08-01) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.30](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.29...aws-amplify-react@5.1.30) (2022-07-28) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.29](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.28...aws-amplify-react@5.1.29) (2022-07-21) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.28](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.27...aws-amplify-react@5.1.28) (2022-07-07) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.27](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.26...aws-amplify-react@5.1.27) (2022-06-18) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.26](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.25...aws-amplify-react@5.1.26) (2022-06-15) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.25](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.24...aws-amplify-react@5.1.25) (2022-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.24](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.23...aws-amplify-react@5.1.24) (2022-05-23) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.23](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.22...aws-amplify-react@5.1.23) (2022-05-12) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.22](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.21...aws-amplify-react@5.1.22) (2022-05-03) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.21](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.20...aws-amplify-react@5.1.21) (2022-04-14) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.20](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.19...aws-amplify-react@5.1.20) (2022-04-04) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.19](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.18...aws-amplify-react@5.1.19) (2022-03-28) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.18](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.17...aws-amplify-react@5.1.18) (2022-03-22) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.17](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.16...aws-amplify-react@5.1.17) (2022-03-10) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.16](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.15...aws-amplify-react@5.1.16) (2022-02-28) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.15](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.14...aws-amplify-react@5.1.15) (2022-02-03) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.14](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.13...aws-amplify-react@5.1.14) (2022-01-27) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.13](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.12...aws-amplify-react@5.1.13) (2022-01-07) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.11...aws-amplify-react@5.1.12) (2021-12-16) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.10...aws-amplify-react@5.1.11) (2021-12-03) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.9...aws-amplify-react@5.1.10) (2021-12-02) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.8...aws-amplify-react@5.1.9) (2021-11-18) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.7...aws-amplify-react@5.1.8) (2021-11-16) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.6...aws-amplify-react@5.1.7) (2021-11-12) - -**Note:** Version bump only for package aws-amplify-react - - - - - -## [5.1.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.5...aws-amplify-react@5.1.6) (2021-11-09) - - -### Bug Fixes - -* **@aws-amplify/storage:** Automatically adjust systemClockoffset in Storage ([#9115](https://github.com/aws-amplify/amplify-js/issues/9115)) ([873941c](https://github.com/aws-amplify/amplify-js/commit/873941c655d9fe87a75238eadc0ae57dacc2fa16)) - - - - - -## [5.1.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.4...aws-amplify-react@5.1.5) (2021-10-28) - - -### Bug Fixes - -* error when input type is checkbox ([#8048](https://github.com/aws-amplify/amplify-js/issues/8048)) ([5d01a1d](https://github.com/aws-amplify/amplify-js/commit/5d01a1d1dad122f7b17d286b362c48f4d8f66eff)) - - - - - -## [5.1.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.3...aws-amplify-react@5.1.4) (2021-10-21) - -**Note:** Version bump only for package aws-amplify-react - -## [5.1.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.2...aws-amplify-react@5.1.3) (2021-10-07) - -**Note:** Version bump only for package aws-amplify-react - -## [5.1.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.1...aws-amplify-react@5.1.2) (2021-09-30) - -**Note:** Version bump only for package aws-amplify-react - -## [5.1.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.1.0...aws-amplify-react@5.1.1) (2021-09-24) - -**Note:** Version bump only for package aws-amplify-react - -# [5.1.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.16...aws-amplify-react@5.1.0) (2021-09-22) - -### Features - -- **@aws-amplify/storage:** Storage category public API Typescript improvement ([1c3b281](https://github.com/aws-amplify/amplify-js/commit/1c3b281d564db8745d3085489643bb33ac067177)) - -## [5.0.16](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.15...aws-amplify-react@5.0.16) (2021-09-17) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.15](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.14...aws-amplify-react@5.0.15) (2021-09-09) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.14](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.13...aws-amplify-react@5.0.14) (2021-09-07) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.13](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.12...aws-amplify-react@5.0.13) (2021-09-04) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.11...aws-amplify-react@5.0.12) (2021-09-02) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.10...aws-amplify-react@5.0.11) (2021-08-26) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.9...aws-amplify-react@5.0.10) (2021-08-19) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.8...aws-amplify-react@5.0.9) (2021-08-12) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.7...aws-amplify-react@5.0.8) (2021-07-28) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.6...aws-amplify-react@5.0.7) (2021-07-22) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.5...aws-amplify-react@5.0.6) (2021-07-16) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.4...aws-amplify-react@5.0.5) (2021-07-08) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.3...aws-amplify-react@5.0.4) (2021-06-24) - -### Bug Fixes - -- (aws-amplify-react): Fix type definition of onSubscriptionMsg ([#4484](https://github.com/aws-amplify/amplify-js/issues/4484)) ([e3ed324](https://github.com/aws-amplify/amplify-js/commit/e3ed324a18bb8b439e6cd1103f71949a6bcfdf6b)) - -## [5.0.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.2...aws-amplify-react@5.0.3) (2021-06-18) - -**Note:** Version bump only for package aws-amplify-react - -## [5.0.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@5.0.1...aws-amplify-react@5.0.2) (2021-06-10) - -### Bug Fixes - -- **aws-amplify-react:** "preview" prop of accept boolean value on TypeScript([#7908](https://github.com/aws-amplify/amplify-js/issues/7908)) ([#8017](https://github.com/aws-amplify/amplify-js/issues/8017)) ([90b6d7c](https://github.com/aws-amplify/amplify-js/commit/90b6d7cdc0938985d41ec6dbe751f23388afbfef)) - -## [5.0.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.34...aws-amplify-react@5.0.1) (2021-05-26) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.34](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.33...aws-amplify-react@4.2.34) (2021-05-14) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.33](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.32...aws-amplify-react@4.2.33) (2021-05-11) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.32](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.31...aws-amplify-react@4.2.32) (2021-05-06) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.31](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.30...aws-amplify-react@4.2.31) (2021-04-15) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.30](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.29...aws-amplify-react@4.2.30) (2021-03-25) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.29](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.28...aws-amplify-react@4.2.29) (2021-03-18) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.28](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.27...aws-amplify-react@4.2.28) (2021-03-12) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.27](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.26...aws-amplify-react@4.2.27) (2021-03-08) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.26](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.25...aws-amplify-react@4.2.26) (2021-03-03) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.25](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.24...aws-amplify-react@4.2.25) (2021-02-25) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.24](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.23...aws-amplify-react@4.2.24) (2021-02-18) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.23](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.22...aws-amplify-react@4.2.23) (2021-02-15) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.22](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.21...aws-amplify-react@4.2.22) (2021-02-09) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.21](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.20...aws-amplify-react@4.2.21) (2021-02-03) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.20](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.19...aws-amplify-react@4.2.20) (2021-02-01) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.19](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.18...aws-amplify-react@4.2.19) (2021-01-29) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.18](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.17...aws-amplify-react@4.2.18) (2021-01-07) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.17](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.16...aws-amplify-react@4.2.17) (2020-12-17) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.16](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.15...aws-amplify-react@4.2.16) (2020-12-10) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.15](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.14...aws-amplify-react@4.2.15) (2020-11-30) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.14](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.13...aws-amplify-react@4.2.14) (2020-11-23) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.13](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.12...aws-amplify-react@4.2.13) (2020-11-20) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.11...aws-amplify-react@4.2.12) (2020-11-13) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.10...aws-amplify-react@4.2.11) (2020-11-03) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.9...aws-amplify-react@4.2.10) (2020-10-31) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.8...aws-amplify-react@4.2.9) (2020-10-29) - -### Bug Fixes - -- rewrite "forget password" to "forgot password" ([#7009](https://github.com/aws-amplify/amplify-js/issues/7009)) ([fd989e4](https://github.com/aws-amplify/amplify-js/commit/fd989e405a7bc024f780cc7df552ebd489e0be60)), closes [#6921](https://github.com/aws-amplify/amplify-js/issues/6921) - -## [4.2.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.7...aws-amplify-react@4.2.8) (2020-10-15) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.6...aws-amplify-react@4.2.7) (2020-10-01) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.5...aws-amplify-react@4.2.6) (2020-09-25) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.4...aws-amplify-react@4.2.5) (2020-09-16) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.3...aws-amplify-react@4.2.4) (2020-09-15) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.2...aws-amplify-react@4.2.3) (2020-09-10) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.1...aws-amplify-react@4.2.2) (2020-09-03) - -**Note:** Version bump only for package aws-amplify-react - -## [4.2.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.0...aws-amplify-react@4.2.1) (2020-09-03) - -**Note:** Version bump only for package aws-amplify-react - -# [4.2.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.23...aws-amplify-react@4.2.0) (2020-09-01) - -### Features - -- **@aws-amplify/ui-components:** Add Chatbot UI to main ([#6684](https://github.com/aws-amplify/amplify-js/issues/6684)) ([4e25f92](https://github.com/aws-amplify/amplify-js/commit/4e25f923723441c6fb705584fcc3349214806558)), closes [#5024](https://github.com/aws-amplify/amplify-js/issues/5024) [#6648](https://github.com/aws-amplify/amplify-js/issues/6648) [#6652](https://github.com/aws-amplify/amplify-js/issues/6652) [#6678](https://github.com/aws-amplify/amplify-js/issues/6678) - -## [4.1.23](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.22...aws-amplify-react@4.1.23) (2020-08-19) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.22](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.21...aws-amplify-react@4.1.22) (2020-08-06) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.21](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.20...aws-amplify-react@4.1.21) (2020-07-27) - -### Bug Fixes - -- **@aws-amplify/interactions:** fix interactions v3 bugs and refactor type ([#6381](https://github.com/aws-amplify/amplify-js/issues/6381)) ([8c6fb4a](https://github.com/aws-amplify/amplify-js/commit/8c6fb4aefa60b36ed33d89c431e743f674119bde)) - -## [4.1.20](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.19...aws-amplify-react@4.1.20) (2020-07-22) - -### Bug Fixes - -- **aws-amplify-react-native:** Update authState after a successful Auth.signIn call ([#6276](https://github.com/aws-amplify/amplify-js/issues/6276)) ([e79a805](https://github.com/aws-amplify/amplify-js/commit/e79a805534c25dcd52ea4e55ef8b4fbd0f5dce36)) - -## [4.1.19](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.18...aws-amplify-react@4.1.19) (2020-07-09) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.18](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.17...aws-amplify-react@4.1.18) (2020-07-07) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.17](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.16...aws-amplify-react@4.1.17) (2020-06-18) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.16](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.15...aws-amplify-react@4.1.16) (2020-06-09) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.15](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.14...aws-amplify-react@4.1.15) (2020-06-04) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.14](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.13...aws-amplify-react@4.1.14) (2020-06-03) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.13](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.12...aws-amplify-react@4.1.13) (2020-06-02) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.12](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.11...aws-amplify-react@4.1.12) (2020-05-26) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.10...aws-amplify-react@4.1.11) (2020-05-22) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.9...aws-amplify-react@4.1.10) (2020-05-14) - -### Bug Fixes - -- **@aws-amplify/aws-amplify-react:** Improve french translations ([#5166](https://github.com/aws-amplify/amplify-js/issues/5166)) ([f756ee1](https://github.com/aws-amplify/amplify-js/commit/f756ee1367205f139509873f6dfc6689a556028a)) - -## [4.1.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.8...aws-amplify-react@4.1.9) (2020-04-30) - -### Bug Fixes - -- **aws-amplify-react:** ([#5341](https://github.com/aws-amplify/amplify-js/issues/5341)) ([ebe0b69](https://github.com/aws-amplify/amplify-js/commit/ebe0b69f563e6e4fc1d55fdd9ced842f04cfec75)) - -## [4.1.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.7...aws-amplify-react@4.1.8) (2020-04-24) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.6...aws-amplify-react@4.1.7) (2020-04-14) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.5...aws-amplify-react@4.1.6) (2020-04-08) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.4...aws-amplify-react@4.1.5) (2020-04-07) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.3...aws-amplify-react@4.1.4) (2020-04-03) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.2...aws-amplify-react@4.1.3) (2020-04-02) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.1...aws-amplify-react@4.1.2) (2020-04-01) - -**Note:** Version bump only for package aws-amplify-react - -## [4.1.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.1.0...aws-amplify-react@4.1.1) (2020-04-01) - -**Note:** Version bump only for package aws-amplify-react - -# [4.1.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@3.1.9...aws-amplify-react@4.1.0) (2020-03-31) - -### Bug Fixes - -- **aws-amplify-react:** BREAKING - Remove "import '[@aws-amplify](https://github.com/aws-amplify)… ([#5138](https://github.com/aws-amplify/amplify-js/issues/5138)) ([1cad8b9](https://github.com/aws-amplify/amplify-js/commit/1cad8b9214ff798eedefeee1b07fdfc2e020fc05)) -- **core, auth, aws-amplify-react:** fix tests ([bdd162c](https://github.com/aws-amplify/amplify-js/commit/bdd162c2dd03488168a299f8dd8c554f76ca8a12)) - -### Features - -- **aws-amplify-react): publish ES2015/ESM artifacts:** publish ES2015/ESM artifacts ([3a60350](https://github.com/aws-amplify/amplify-js/commit/3a6035028c2b61744bd1154e7125eed38339b140)) - -### Reverts - -- Revert "Publish" ([1319d31](https://github.com/aws-amplify/amplify-js/commit/1319d319b69717e76660fbfa6f1a845195c6d635)) - -## [3.1.9](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@3.1.8...aws-amplify-react@3.1.9) (2020-03-30) - -**Note:** Version bump only for package aws-amplify-react - -## [3.1.8](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@3.1.7...aws-amplify-react@3.1.8) (2020-03-25) - -**Note:** Version bump only for package aws-amplify-react - -## [3.1.7](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@3.1.6...aws-amplify-react@3.1.7) (2020-02-28) - -**Note:** Version bump only for package aws-amplify-react - -## [3.1.6](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@3.1.5...aws-amplify-react@3.1.6) (2020-02-14) - -### Bug Fixes - -- **aws-amplify-react:** added prop onS3ImageSuccess to the S3Image component to have a clear sepration of concerns ([#4848](https://github.com/aws-amplify/amplify-js/issues/4848)) ([0c336ef](https://github.com/aws-amplify/amplify-js/commit/0c336ef5895401be365b2b22db4aecdbf7f81b8a)) - -## [3.1.5](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@3.1.3...aws-amplify-react@3.1.5) (2020-02-07) - -### Bug Fixes - -- **aws-amplify-react) fix(aws-amplify-react-native) fix(aws-amplify-angular:** Fix peer dependencies ([#4647](https://github.com/aws-amplify/amplify-js/issues/4647)) ([c4c990e](https://github.com/aws-amplify/amplify-js/commit/c4c990ea62a77625add92e8fe94ba170b0dd2af1)) - -## [3.1.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@3.1.2...aws-amplify-react@3.1.3) (2020-01-10) - -### Bug Fixes - -- [#4311](https://github.com/aws-amplify/amplify-js/issues/4311) Update main entry field to point to CJS builds instead of webpack bundles ([#4678](https://github.com/aws-amplify/amplify-js/issues/4678)) ([54fbdf4](https://github.com/aws-amplify/amplify-js/commit/54fbdf4b1393567735fb7b5f4144db273f1a5f6a)) - -## [3.1.2](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@3.1.1...aws-amplify-react@3.1.2) (2019-12-18) - -**Note:** Version bump only for package aws-amplify-react - -## [3.1.1](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@3.1.0...aws-amplify-react@3.1.1) (2019-12-03) - -**Note:** Version bump only for package aws-amplify-react - -# [3.1.0](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@2.5.4...aws-amplify-react@3.1.0) (2019-11-15) - -### Features - -- enable watch mode for builds ([#4358](https://github.com/aws-amplify/amplify-js/issues/4358)) ([055e530](https://github.com/aws-amplify/amplify-js/commit/055e5308efc308ae6beee78f8963bb2f812e1f85)) - -## [2.5.4](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@2.5.3...aws-amplify-react@2.5.4) (2019-10-29) - -**Note:** Version bump only for package aws-amplify-react - -## [2.5.3](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@2.5.2...aws-amplify-react@2.5.3) (2019-10-23) - -**Note:** Version bump only for package aws-amplify-react - -## [2.5.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.5.0...aws-amplify-react@2.5.2) (2019-10-10) - -**Note:** Version bump only for package aws-amplify-react - -# [2.5.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.4.4...aws-amplify-react@2.5.0) (2019-10-10) - -### Bug Fixes - -- Pinpoint analytics stopSession event ([422806e](https://github.com/aws/aws-amplify/commit/422806e58525490b0fec28055a818024f2681769)), closes [#3786](https://github.com/aws/aws-amplify/issues/3786) [#3042](https://github.com/aws/aws-amplify/issues/3042) - -### Features - -- Added Prettier formatting ([4dfd9aa](https://github.com/aws/aws-amplify/commit/4dfd9aa9ab900307c9d17c68448a6ca4aa08fd5a)) - -## [2.4.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.4.2...aws-amplify-react@2.4.4) (2019-09-13) - -**Note:** Version bump only for package aws-amplify-react - -## [2.4.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.13...aws-amplify-react@2.4.2) (2019-09-05) - -**Note:** Version bump only for package aws-amplify-react - -## [2.3.13](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.12...aws-amplify-react@2.3.13) (2019-09-04) - -**Note:** Version bump only for package aws-amplify-react - -## [2.3.12](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.11...aws-amplify-react@2.3.12) (2019-07-30) - -**Note:** Version bump only for package aws-amplify-react - -## [2.3.11](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.10...aws-amplify-react@2.3.11) (2019-07-18) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.10](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.10-unstable.2...aws-amplify-react@2.3.10) (2019-07-09) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.10-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.10-unstable.1...aws-amplify-react@2.3.10-unstable.2) (2019-07-09) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.10-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.10-unstable.0...aws-amplify-react@2.3.10-unstable.1) (2019-07-03) - -### Bug Fixes - -- **aws-amplify-react:** image will reload when level is changed ([0b39eb6](https://github.com/aws/aws-amplify/commit/0b39eb6)) - - - -## [2.3.10-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.9...aws-amplify-react@2.3.10-unstable.0) (2019-06-27) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.9](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.9-unstable.3...aws-amplify-react@2.3.9) (2019-06-17) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.9-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.9-unstable.2...aws-amplify-react@2.3.9-unstable.3) (2019-06-07) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.9-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.9-unstable.1...aws-amplify-react@2.3.9-unstable.2) (2019-06-06) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.9-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.9-unstable.0...aws-amplify-react@2.3.9-unstable.1) (2019-05-31) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.9-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.8...aws-amplify-react@2.3.9-unstable.0) (2019-05-24) - -### Bug Fixes - -- German localisation ([80c87ea](https://github.com/aws/aws-amplify/commit/80c87ea)) -- **aws-amplify-react:** adds e.preventDefault to confirm function in ConfirmSignIn component to prevent page reload ([b4ee413](https://github.com/aws/aws-amplify/commit/b4ee413)) -- **aws-amplify-react:** Fix typo in german localisation ([a5592f2](https://github.com/aws/aws-amplify/commit/a5592f2)) - -### Features - -- **aws-amplify-react:** allow user to sign up with email or phone number ([b81f89e](https://github.com/aws/aws-amplify/commit/b81f89e)) - - - -## [2.3.8](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.8-unstable.1...aws-amplify-react@2.3.8) (2019-05-14) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.8-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.8-unstable.0...aws-amplify-react@2.3.8-unstable.1) (2019-05-14) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.8-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.7...aws-amplify-react@2.3.8-unstable.0) (2019-05-13) - -### Bug Fixes - -- add a todo to the greeting object in order to adjust the Angular Greeting Component to match React, fix typo in requireNewPassword ([49eae14](https://github.com/aws/aws-amplify/commit/49eae14)) - - - -## [2.3.7](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.7-unstable.4...aws-amplify-react@2.3.7) (2019-05-06) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.7-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.7-unstable.3...aws-amplify-react@2.3.7-unstable.4) (2019-04-26) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.7-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.7-unstable.2...aws-amplify-react@2.3.7-unstable.3) (2019-04-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.7-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.7-unstable.1...aws-amplify-react@2.3.7-unstable.2) (2019-04-19) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.7-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.7-unstable.0...aws-amplify-react@2.3.7-unstable.1) (2019-04-19) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.7-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.6...aws-amplify-react@2.3.7-unstable.0) (2019-04-16) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.6](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.6-unstable.0...aws-amplify-react@2.3.6) (2019-04-11) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.6-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.5...aws-amplify-react@2.3.6-unstable.0) (2019-04-10) - -### Bug Fixes - -- **@aws-amplify/auth:** Valide OAuth state only when generated by Amlify ([#3069](https://github.com/aws/aws-amplify/issues/3069)) ([30e828f](https://github.com/aws/aws-amplify/commit/30e828f)), closes [#3054](https://github.com/aws/aws-amplify/issues/3054) [#3055](https://github.com/aws/aws-amplify/issues/3055) - - - -## [2.3.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.5-unstable.1...aws-amplify-react@2.3.5) (2019-04-09) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.5-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.5-unstable.0...aws-amplify-react@2.3.5-unstable.1) (2019-04-08) - -### Features - -- **@aws-amplify/auth:** Easier Federation with OAuth ([#3005](https://github.com/aws/aws-amplify/issues/3005)) ([76cde59](https://github.com/aws/aws-amplify/commit/76cde59)) - - - -## [2.3.5-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.4...aws-amplify-react@2.3.5-unstable.0) (2019-04-04) - -### Bug Fixes - -- update cypress version and fix auth text check ([4fb2356](https://github.com/aws/aws-amplify/commit/4fb2356)) - - - -## [2.3.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.4-unstable.1...aws-amplify-react@2.3.4) (2019-04-04) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.4-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.4-unstable.0...aws-amplify-react@2.3.4-unstable.1) (2019-04-02) - -### Bug Fixes - -- check is component is mounted ([47ae0b9](https://github.com/aws/aws-amplify/commit/47ae0b9)) - - - -## [2.3.4-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.3...aws-amplify-react@2.3.4-unstable.0) (2019-03-29) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.3-unstable.8...aws-amplify-react@2.3.3) (2019-03-28) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.3-unstable.8](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.3-unstable.7...aws-amplify-react@2.3.3-unstable.8) (2019-03-28) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.3-unstable.7](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.3-unstable.6...aws-amplify-react@2.3.3-unstable.7) (2019-03-26) - -### Bug Fixes - -- **aws-amplify-react:** the username should not be undefined ([5ebddcb](https://github.com/aws/aws-amplify/commit/5ebddcb)) - - - -## [2.3.3-unstable.6](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.3-unstable.5...aws-amplify-react@2.3.3-unstable.6) (2019-03-23) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.3-unstable.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.3-unstable.4...aws-amplify-react@2.3.3-unstable.5) (2019-03-22) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.3-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.3-unstable.3...aws-amplify-react@2.3.3-unstable.4) (2019-03-22) - -### Bug Fixes - -- **core:** Remove unneeded Hub.dispatch and Hub.listen ([#2919](https://github.com/aws/aws-amplify/issues/2919)) ([aea7fa9](https://github.com/aws/aws-amplify/commit/aea7fa9)), closes [#2623](https://github.com/aws/aws-amplify/issues/2623) - - - -## [2.3.3-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.3-unstable.2...aws-amplify-react@2.3.3-unstable.3) (2019-03-20) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.3-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.3-unstable.1...aws-amplify-react@2.3.3-unstable.2) (2019-03-19) - -### Bug Fixes - -- remove stray semicolon after app wrapper ([d2d5fa3](https://github.com/aws/aws-amplify/commit/d2d5fa3)) - - - -## [2.3.3-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.3-unstable.0...aws-amplify-react@2.3.3-unstable.1) (2019-03-14) - -### Bug Fixes - -- **aws-amplify-react:** use
for the login component ([8f94b32](https://github.com/aws/aws-amplify/commit/8f94b32)) - - - -## [2.3.3-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.2...aws-amplify-react@2.3.3-unstable.0) (2019-03-11) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.2-unstable.0...aws-amplify-react@2.3.2) (2019-03-06) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.2-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.1...aws-amplify-react@2.3.2-unstable.0) (2019-03-05) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.1-unstable.5...aws-amplify-react@2.3.1) (2019-03-04) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.1-unstable.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.1-unstable.4...aws-amplify-react@2.3.1-unstable.5) (2019-03-04) - -### Features - -- **aws-amplify-react-native:** Add withOAuth HOC for Cognito Hosted UI ([#2665](https://github.com/aws/aws-amplify/issues/2665)) ([ac4d232](https://github.com/aws/aws-amplify/commit/ac4d232)) - - - -## [2.3.1-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.1-unstable.3...aws-amplify-react@2.3.1-unstable.4) (2019-03-04) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.1-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.1-unstable.2...aws-amplify-react@2.3.1-unstable.3) (2019-03-02) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.1-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.1-unstable.1...aws-amplify-react@2.3.1-unstable.2) (2019-02-27) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.1-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.1-unstable.0...aws-amplify-react@2.3.1-unstable.1) (2019-02-11) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.3.1-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.3.0...aws-amplify-react@2.3.1-unstable.0) (2019-01-18) - -**Note:** Version bump only for package aws-amplify-react - - - -# [2.3.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.6-unstable.1...aws-amplify-react@2.3.0) (2019-01-10) - -### Features - -- **aws-amplify-react:** add identityId prop to S3Album, S3Image, S3Text ([#2459](https://github.com/aws/aws-amplify/issues/2459)) ([26e1345](https://github.com/aws/aws-amplify/commit/26e1345)), closes [#2424](https://github.com/aws/aws-amplify/issues/2424) - - - -## [2.2.6-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.6-unstable.0...aws-amplify-react@2.2.6-unstable.1) (2018-12-28) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.6-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.5...aws-amplify-react@2.2.6-unstable.0) (2018-12-28) - -### Bug Fixes - -- **aws-amplify-react:** transfer the children object to array ([b734d99](https://github.com/aws/aws-amplify/commit/b734d99)) - - - -## [2.2.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.5-unstable.1...aws-amplify-react@2.2.5) (2018-12-26) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.5-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.5-unstable.0...aws-amplify-react@2.2.5-unstable.1) (2018-12-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.5-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.4...aws-amplify-react@2.2.5-unstable.0) (2018-12-19) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.3-unstable.2...aws-amplify-react@2.2.4) (2018-12-15) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.2...aws-amplify-react@2.2.3) (2018-12-14) - - - -## [2.2.3-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.3-unstable.1...aws-amplify-react@2.2.3-unstable.2) (2018-12-14) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.3-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.3-unstable.0...aws-amplify-react@2.2.3-unstable.1) (2018-12-14) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.3-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.2...aws-amplify-react@2.2.3-unstable.0) (2018-12-14) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.2-unstable.1...aws-amplify-react@2.2.2) (2018-12-14) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.2-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.2-unstable.0...aws-amplify-react@2.2.2-unstable.1) (2018-12-14) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.2-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.1...aws-amplify-react@2.2.2-unstable.0) (2018-12-13) - -### Features - -- **@aws-amplify/interactions @aws-amplify/react @aws-amplify/react-native @aws-amplify/angular @aws-amplify/vue:** Update interactions to include voice ([#2121](https://github.com/aws/aws-amplify/issues/2121)) ([938d2a5](https://github.com/aws/aws-amplify/commit/938d2a5)) - - - -## [2.2.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.1-unstable.2...aws-amplify-react@2.2.1) (2018-12-13) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.1-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.1-unstable.1...aws-amplify-react@2.2.1-unstable.2) (2018-12-13) - -### Bug Fixes - -- **aws-amplify-react:** fix instances of missing theme prop ([77904be](https://github.com/aws/aws-amplify/commit/77904be)) - - - -## [2.2.1-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.1-unstable.0...aws-amplify-react@2.2.1-unstable.1) (2018-12-11) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.1-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.8-unstable.0...aws-amplify-react@2.2.1-unstable.0) (2018-12-10) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.8-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.7...aws-amplify-react@2.1.8-unstable.0) (2018-12-07) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.7](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.6...aws-amplify-react@2.1.7) (2018-12-07) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.7-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.7-unstable.0...aws-amplify-react@2.1.7-unstable.1) (2018-12-06) - -### Bug Fixes - -- **aws-amplify-react:** correctly hide links under production mode ([8a52918](https://github.com/aws/aws-amplify/commit/8a52918)) - - - -## [2.1.7-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.6...aws-amplify-react@2.1.7-unstable.0) (2018-12-06) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.6](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.5...aws-amplify-react@2.1.6) (2018-12-06) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.6-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.6-unstable.0...aws-amplify-react@2.1.6-unstable.1) (2018-12-05) - -### Bug Fixes - -- **aws-amplify-react:** authData in Greetings ([a1fef5b](https://github.com/aws/aws-amplify/commit/a1fef5b)) - - - -## [2.1.6-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.5...aws-amplify-react@2.1.6-unstable.0) (2018-12-04) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.5-unstable.7...aws-amplify-react@2.1.5) (2018-12-03) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.5-unstable.7](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.5-unstable.6...aws-amplify-react@2.1.5-unstable.7) (2018-12-03) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.5-unstable.6](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.5-unstable.5...aws-amplify-react@2.1.5-unstable.6) (2018-11-30) - -### Features - -- **aws-amplify-react:** disable sign in button while loading ([#2216](https://github.com/aws/aws-amplify/issues/2216)) ([b196b7f](https://github.com/aws/aws-amplify/commit/b196b7f)) - - - -## [2.1.5-unstable.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.5-unstable.4...aws-amplify-react@2.1.5-unstable.5) (2018-11-26) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.5-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.5-unstable.3...aws-amplify-react@2.1.5-unstable.4) (2018-11-23) - -### Bug Fixes - -- **aws-amplify-react:** add I18n in Greetings ([e549db7](https://github.com/aws/aws-amplify/commit/e549db7)) - - - -## [2.1.5-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.5-unstable.2...aws-amplify-react@2.1.5-unstable.3) (2018-11-21) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.5-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.5-unstable.1...aws-amplify-react@2.1.5-unstable.2) (2018-11-21) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.1-beta.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.1-beta.4...aws-amplify-react@2.2.1-beta.5) (2018-11-19) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.5-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.5-unstable.0...aws-amplify-react@2.1.5-unstable.1) (2018-11-19) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.5-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.4...aws-amplify-react@2.1.5-unstable.0) (2018-11-16) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.1-beta.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.1-beta.3...aws-amplify-react@2.2.1-beta.4) (2018-11-15) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.2.1-beta.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.2.1-beta.2...aws-amplify-react@2.2.1-beta.3) (2018-11-14) - - - -## [2.2.1-beta.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.4-unstable.4...aws-amplify-react@2.2.1-beta.2) (2018-11-14) - -### Bug Fixes - -- **aws-amplify-react:** check if gapi is inited when mounting the component ([9a7d306](https://github.com/aws/aws-amplify/commit/9a7d306)) - - - -## [2.1.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.4-unstable.4...aws-amplify-react@2.1.4) (2018-11-12) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.4-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.4-unstable.3...aws-amplify-react@2.1.4-unstable.4) (2018-11-09) - -### Features - -- **aws-amplify-react:** adding loading page ([c47f72a](https://github.com/aws/aws-amplify/commit/c47f72a)) - - - -## [2.1.4-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.4-unstable.2...aws-amplify-react@2.1.4-unstable.3) (2018-11-08) - -### Bug Fixes - -- **aws-amplify-react:** change the way to import qrcode ([8afd5dd](https://github.com/aws/aws-amplify/commit/8afd5dd)) - - - -## [2.1.4-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.4-unstable.1...aws-amplify-react@2.1.4-unstable.2) (2018-11-07) - -### Bug Fixes - -- **aws-amplify-react:** change to forgetpassword state if need to reset password ([0c1e994](https://github.com/aws/aws-amplify/commit/0c1e994)) - - - -## [2.1.4-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.4-unstable.0...aws-amplify-react@2.1.4-unstable.1) (2018-11-06) - -### Bug Fixes - -- **aws-amplify-react:** only call Auth signOut if some error happens during signed in ([1ceb3ef](https://github.com/aws/aws-amplify/commit/1ceb3ef)) - - - -## [2.1.4-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.3...aws-amplify-react@2.1.4-unstable.0) (2018-11-05) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.3-unstable.4...aws-amplify-react@2.1.3) (2018-11-01) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.3-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.3-unstable.3...aws-amplify-react@2.1.3-unstable.4) (2018-11-01) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.3-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.3-unstable.2...aws-amplify-react@2.1.3-unstable.3) (2018-10-31) - -### Bug Fixes - -- **@aws-amplify/auth:** Adding theme support to the FederatedButtons "or" Strike ([554c1fc](https://github.com/aws/aws-amplify/commit/554c1fc)) - - - -## [2.1.3-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.3-unstable.1...aws-amplify-react@2.1.3-unstable.2) (2018-10-30) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.3-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.3-unstable.0...aws-amplify-react@2.1.3-unstable.1) (2018-10-30) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.3-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.2...aws-amplify-react@2.1.3-unstable.0) (2018-10-30) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.2-unstable.5...aws-amplify-react@2.1.2) (2018-10-29) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.2-unstable.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.2-unstable.4...aws-amplify-react@2.1.2-unstable.5) (2018-10-29) - -### Bug Fixes - -- **aws-amplify-react:** show the link of create account when using customized signup component ([1b4de49](https://github.com/aws/aws-amplify/commit/1b4de49)) - - - -## [2.1.2-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.2-unstable.3...aws-amplify-react@2.1.2-unstable.4) (2018-10-29) - -### Bug Fixes - -- **aws-amplify-react:** pass the user name when signin error happens ([b857101](https://github.com/aws/aws-amplify/commit/b857101)) - - - -## [2.1.2-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.2-unstable.2...aws-amplify-react@2.1.2-unstable.3) (2018-10-29) - -### Features - -- **aws-amplify-react:** Add Auth0 button ([b16ded3](https://github.com/aws/aws-amplify/commit/b16ded3)) - - - -## [2.1.2-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.2-unstable.1...aws-amplify-react@2.1.2-unstable.2) (2018-10-25) - -### Features - -- **aws-amplify-react:** federated sign out methods refactor ([9edbd6e](https://github.com/aws/aws-amplify/commit/9edbd6e)) - - - -## [2.1.2-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.2-unstable.0...aws-amplify-react@2.1.2-unstable.1) (2018-10-25) - -### Bug Fixes - -- **aws-amplify-react aws-amplify-react-native:** Connect component ([#1868](https://github.com/aws/aws-amplify/issues/1868)) ([8dd6b55](https://github.com/aws/aws-amplify/commit/8dd6b55)) - - - -## [2.1.2-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.1.1...aws-amplify-react@2.1.2-unstable.0) (2018-10-23) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.1.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.8-unstable.2...aws-amplify-react@2.1.1) (2018-10-17) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.8-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.8-unstable.1...aws-amplify-react@2.0.8-unstable.2) (2018-10-16) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.8-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.8-unstable.0...aws-amplify-react@2.0.8-unstable.1) (2018-10-08) - -### Bug Fixes - -- **aws-amplify-react:** jump to the initial state if not signed in ([d8779eb](https://github.com/aws/aws-amplify/commit/d8779eb)) - - - -## [2.0.8-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.7-unstable.1...aws-amplify-react@2.0.8-unstable.0) (2018-10-05) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.7](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.7-unstable.1...aws-amplify-react@2.0.7) (2018-10-04) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.7-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.7-unstable.0...aws-amplify-react@2.0.7-unstable.1) (2018-10-03) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.7-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.6-unstable.1...aws-amplify-react@2.0.7-unstable.0) (2018-10-03) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.6](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.6-unstable.1...aws-amplify-react@2.0.6) (2018-10-03) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.6-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.6-unstable.0...aws-amplify-react@2.0.6-unstable.1) (2018-10-02) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.6-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.5...aws-amplify-react@2.0.6-unstable.0) (2018-10-02) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.5-unstable.1...aws-amplify-react@2.0.5) (2018-09-27) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.5-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.5-unstable.0...aws-amplify-react@2.0.5-unstable.1) (2018-09-26) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.5-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.4...aws-amplify-react@2.0.5-unstable.0) (2018-09-26) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.4-unstable.0...aws-amplify-react@2.0.4) (2018-09-21) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.4-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.3-unstable.0...aws-amplify-react@2.0.4-unstable.0) (2018-09-21) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.2...aws-amplify-react@2.0.3) (2018-09-21) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.3-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.2...aws-amplify-react@2.0.3-unstable.0) (2018-09-20) - -### Bug Fixes - -- **aws-amplify-react:** Fix import statement ([#1695](https://github.com/aws/aws-amplify/issues/1695)) ([07bdfc2](https://github.com/aws/aws-amplify/commit/07bdfc2)), closes [#1482](https://github.com/aws/aws-amplify/issues/1482) [#1484](https://github.com/aws/aws-amplify/issues/1484) - - - -## [2.0.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.1...aws-amplify-react@2.0.2) (2018-09-17) - -### Bug Fixes - -- **@aws-amplify-react/auth:** handle required attributes in NEW_PASSWORD_REQUIRED challenge ([5ee6288](https://github.com/aws/aws-amplify/commit/5ee6288)) -- **aws-amplify-react:** fix PhotoPicker preview ([db3331e](https://github.com/aws/aws-amplify/commit/db3331e)) -- **aws-amplify-react:** fix the phone number format in sign up component ([a21d486](https://github.com/aws/aws-amplify/commit/a21d486)) - - - -## [2.0.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.1-unstable.0...aws-amplify-react@2.0.1) (2018-09-09) - -**Note:** Version bump only for package aws-amplify-react - - - -## [2.0.1-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@2.0.0...aws-amplify-react@2.0.1-unstable.0) (2018-09-07) - -### Bug Fixes - -- **aws-amplify-react:** fix the break change of federatedSignIn ([5ca239c](https://github.com/aws/aws-amplify/commit/5ca239c)) - - - -# [2.0.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.26...aws-amplify-react@2.0.0) (2018-08-28) - -### Features - -- UI Components ([1ff1abd](https://github.com/aws/aws-amplify/commit/1ff1abd)) - -### BREAKING CHANGES - -- UI Components - - - -## [1.0.7-unstable.26](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.25...aws-amplify-react@1.0.7-unstable.26) (2018-08-28) - -- Amplify ui migration (#1517) ([41d3184](https://github.com/aws/aws-amplify/commit/41d3184)), closes [#1517](https://github.com/aws/aws-amplify/issues/1517) - -### BREAKING CHANGES - -- UI Components - - - -## [1.0.7-unstable.25](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.24...aws-amplify-react@1.0.7-unstable.25) (2018-08-27) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.24](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.23...aws-amplify-react@1.0.7-unstable.24) (2018-08-27) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.23](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.21...aws-amplify-react@1.0.7-unstable.23) (2018-08-27) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.22](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.21...aws-amplify-react@1.0.7-unstable.22) (2018-08-25) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.21](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.20...aws-amplify-react@1.0.7-unstable.21) (2018-08-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.20](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.19...aws-amplify-react@1.0.7-unstable.20) (2018-08-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.19](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.17...aws-amplify-react@1.0.7-unstable.19) (2018-08-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.18](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.17...aws-amplify-react@1.0.7-unstable.18) (2018-08-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.17](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.15...aws-amplify-react@1.0.7-unstable.17) (2018-08-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.16](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.15...aws-amplify-react@1.0.7-unstable.16) (2018-08-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.15](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.14...aws-amplify-react@1.0.7-unstable.15) (2018-08-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.14](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.13...aws-amplify-react@1.0.7-unstable.14) (2018-08-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.13](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.11...aws-amplify-react@1.0.7-unstable.13) (2018-08-23) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.12](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.11...aws-amplify-react@1.0.7-unstable.12) (2018-08-23) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.11](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.10...aws-amplify-react@1.0.7-unstable.11) (2018-08-23) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.10](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.9...aws-amplify-react@1.0.7-unstable.10) (2018-08-23) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.9](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.8...aws-amplify-react@1.0.7-unstable.9) (2018-08-23) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.8](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.7...aws-amplify-react@1.0.7-unstable.8) (2018-08-22) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.7](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.6...aws-amplify-react@1.0.7-unstable.7) (2018-08-22) - -### Bug Fixes - -- **aws-amplify-react:** Fix import statement ([fe1826a](https://github.com/aws/aws-amplify/commit/fe1826a)), closes [#1482](https://github.com/aws/aws-amplify/issues/1482) - - - -## [1.0.7-unstable.6](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.5...aws-amplify-react@1.0.7-unstable.6) (2018-08-21) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.4...aws-amplify-react@1.0.7-unstable.5) (2018-08-21) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.3...aws-amplify-react@1.0.7-unstable.4) (2018-08-20) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.2...aws-amplify-react@1.0.7-unstable.3) (2018-08-19) - -### Bug Fixes - -- **aws-amplify-angular:** Angular rollup ([#1441](https://github.com/aws/aws-amplify/issues/1441)) ([eb84e01](https://github.com/aws/aws-amplify/commit/eb84e01)) - - - -## [1.0.7-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.1...aws-amplify-react@1.0.7-unstable.2) (2018-08-18) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.7-unstable.0...aws-amplify-react@1.0.7-unstable.1) (2018-08-16) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.7-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.6...aws-amplify-react@1.0.7-unstable.0) (2018-08-15) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.6](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.6-unstable.5...aws-amplify-react@1.0.6) (2018-08-14) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.6-unstable.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.6-unstable.4...aws-amplify-react@1.0.6-unstable.5) (2018-08-14) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.6-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.6-unstable.3...aws-amplify-react@1.0.6-unstable.4) (2018-08-13) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.6-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.6-unstable.2...aws-amplify-react@1.0.6-unstable.3) (2018-08-13) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.6-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.6-unstable.1...aws-amplify-react@1.0.6-unstable.2) (2018-08-09) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.6-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.6-unstable.0...aws-amplify-react@1.0.6-unstable.1) (2018-08-07) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.6-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.5...aws-amplify-react@1.0.6-unstable.0) (2018-08-07) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.5-unstable.7...aws-amplify-react@1.0.5) (2018-08-06) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.5-unstable.7](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.5-unstable.6...aws-amplify-react@1.0.5-unstable.7) (2018-08-06) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.5-unstable.6](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.5-unstable.5...aws-amplify-react@1.0.5-unstable.6) (2018-08-06) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.5-unstable.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.5-unstable.3...aws-amplify-react@1.0.5-unstable.5) (2018-08-06) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.5-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.5-unstable.2...aws-amplify-react@1.0.5-unstable.3) (2018-07-31) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.5-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.5-unstable.1...aws-amplify-react@1.0.5-unstable.2) (2018-07-31) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.5-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.5-unstable.0...aws-amplify-react@1.0.5-unstable.1) (2018-07-30) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.5-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.4...aws-amplify-react@1.0.5-unstable.0) (2018-07-30) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.4-unstable.1...aws-amplify-react@1.0.4) (2018-07-28) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.4-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.4-unstable.0...aws-amplify-react@1.0.4-unstable.1) (2018-07-28) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.4-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.14...aws-amplify-react@1.0.4-unstable.0) (2018-07-27) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.15](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.14...aws-amplify-react@1.0.3-unstable.15) (2018-07-27) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.14](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.13...aws-amplify-react@1.0.3-unstable.14) (2018-07-27) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.13](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.12...aws-amplify-react@1.0.3-unstable.13) (2018-07-26) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.12](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.11...aws-amplify-react@1.0.3-unstable.12) (2018-07-26) - -### Bug Fixes - -- **@aws-amplify/auth:** currentAuthenticatedUser throws error when the user is disabled/deleted ([1b09e2f](https://github.com/aws/aws-amplify/commit/1b09e2f)) - - - -## [1.0.3-unstable.11](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.10...aws-amplify-react@1.0.3-unstable.11) (2018-07-26) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.10](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.9...aws-amplify-react@1.0.3-unstable.10) (2018-07-26) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.9](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.8...aws-amplify-react@1.0.3-unstable.9) (2018-07-25) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.8](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.7...aws-amplify-react@1.0.3-unstable.8) (2018-07-25) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.7](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.6...aws-amplify-react@1.0.3-unstable.7) (2018-07-25) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.6](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.5...aws-amplify-react@1.0.3-unstable.6) (2018-07-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.4...aws-amplify-react@1.0.3-unstable.5) (2018-07-23) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.3...aws-amplify-react@1.0.3-unstable.4) (2018-07-23) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.2...aws-amplify-react@1.0.3-unstable.3) (2018-07-23) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.1...aws-amplify-react@1.0.3-unstable.2) (2018-07-20) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.3-unstable.0...aws-amplify-react@1.0.3-unstable.1) (2018-07-20) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.3-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.2...aws-amplify-react@1.0.3-unstable.0) (2018-07-20) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.2-unstable.1...aws-amplify-react@1.0.2) (2018-07-19) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.2-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.1...aws-amplify-react@1.0.2-unstable.1) (2018-07-19) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.2-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.1...aws-amplify-react@1.0.2-unstable.0) (2018-07-19) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.1-unstable.4...aws-amplify-react@1.0.1) (2018-07-18) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.1-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.1-unstable.3...aws-amplify-react@1.0.1-unstable.4) (2018-07-18) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.1-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.1-unstable.2...aws-amplify-react@1.0.1-unstable.3) (2018-07-18) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.1-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.1-unstable.1...aws-amplify-react@1.0.1-unstable.2) (2018-07-18) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.1-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.1...aws-amplify-react@1.0.1-unstable.1) (2018-07-18) - -**Note:** Version bump only for package aws-amplify-react - - - -## [1.0.1-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@1.0.1...aws-amplify-react@1.0.1-unstable.0) (2018-07-18) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.55-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.55-unstable.0...aws-amplify-react@0.1.55-unstable.1) (2018-07-03) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.55-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.54...aws-amplify-react@0.1.55-unstable.0) (2018-07-02) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.54](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.54-unstable.5...aws-amplify-react@0.1.54) (2018-06-29) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.54-unstable.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.54-unstable.4...aws-amplify-react@0.1.54-unstable.5) (2018-06-29) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.54-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.54-unstable.3...aws-amplify-react@0.1.54-unstable.4) (2018-06-29) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.54-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.54-unstable.2...aws-amplify-react@0.1.54-unstable.3) (2018-06-28) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.54-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.54-unstable.1...aws-amplify-react@0.1.54-unstable.2) (2018-06-27) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.54-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.54-unstable.0...aws-amplify-react@0.1.54-unstable.1) (2018-06-27) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.54-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.53-unstable.2...aws-amplify-react@0.1.54-unstable.0) (2018-06-27) - -### Features - -- **interactions:** Interactions UI components for react and react native ([#1105](https://github.com/aws/aws-amplify/issues/1105)) ([57de248](https://github.com/aws/aws-amplify/commit/57de248)) - - - -## [0.1.53](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.53-unstable.2...aws-amplify-react@0.1.53) (2018-06-27) - -### Features - -- **interactions:** Interactions UI components for react and react native ([#1105](https://github.com/aws/aws-amplify/issues/1105)) ([57de248](https://github.com/aws/aws-amplify/commit/57de248)) - - - -## [0.1.53-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.53-unstable.1...aws-amplify-react@0.1.53-unstable.2) (2018-06-26) - -### Bug Fixes - -- **integration tests:** CircleCI workflows and Cypress integration testing ([#1071](https://github.com/aws/aws-amplify/issues/1071)) ([bfa4776](https://github.com/aws/aws-amplify/commit/bfa4776)) - - - -## [0.1.53-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.53-unstable.0...aws-amplify-react@0.1.53-unstable.1) (2018-06-22) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.53-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.52...aws-amplify-react@0.1.53-unstable.0) (2018-06-22) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.52](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.51-unstable.3...aws-amplify-react@0.1.52) (2018-06-21) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.51](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.47...aws-amplify-react@0.1.51) (2018-06-20) - - - -## [0.1.51-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.51-unstable.2...aws-amplify-react@0.1.51-unstable.3) (2018-06-21) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.51-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.51-unstable.1...aws-amplify-react@0.1.51-unstable.2) (2018-06-21) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.51-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.51-unstable.0...aws-amplify-react@0.1.51-unstable.1) (2018-06-20) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.51-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.47...aws-amplify-react@0.1.51-unstable.0) (2018-06-20) - -### Bug Fixes - -- **pushnotification:** revert change in pr 952 ([b8d167c](https://github.com/aws/aws-amplify/commit/b8d167c)) -- **pushnotification:** revert change in pr 952 ([257fc40](https://github.com/aws/aws-amplify/commit/257fc40)) - - - -## [0.1.50](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.33...aws-amplify-react@0.1.50) (2018-06-04) - -### Bug Fixes - -- **pushnotification:** revert change in pr 952 ([b8d167c](https://github.com/aws/aws-amplify/commit/b8d167c)) -- **pushnotification:** revert change in pr 952 ([257fc40](https://github.com/aws/aws-amplify/commit/257fc40)) - - - -## [0.1.49](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48...aws-amplify-react@0.1.49) (2018-06-02) - - - -## [0.1.48-unstable.47](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.46...aws-amplify-react@0.1.48-unstable.47) (2018-06-19) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.46](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.45...aws-amplify-react@0.1.48-unstable.46) (2018-06-18) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.45](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.44...aws-amplify-react@0.1.48-unstable.45) (2018-06-18) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.44](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.43...aws-amplify-react@0.1.48-unstable.44) (2018-06-16) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.43](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.42...aws-amplify-react@0.1.48-unstable.43) (2018-06-13) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.42](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.41...aws-amplify-react@0.1.48-unstable.42) (2018-06-13) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.41](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.40...aws-amplify-react@0.1.48-unstable.41) (2018-06-12) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.40](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.39...aws-amplify-react@0.1.48-unstable.40) (2018-06-11) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.39](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.38...aws-amplify-react@0.1.48-unstable.39) (2018-06-08) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.38](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.37...aws-amplify-react@0.1.48-unstable.38) (2018-06-08) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.37](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.36...aws-amplify-react@0.1.48-unstable.37) (2018-06-07) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.36](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.35...aws-amplify-react@0.1.48-unstable.36) (2018-06-06) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.35](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.34...aws-amplify-react@0.1.48-unstable.35) (2018-06-05) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.34](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.33...aws-amplify-react@0.1.48-unstable.34) (2018-06-04) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.33](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.32...aws-amplify-react@0.1.48-unstable.33) (2018-06-04) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.30...aws-amplify-react@0.1.48) (2018-06-01) - - - -## [0.1.48-unstable.32](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.31...aws-amplify-react@0.1.48-unstable.32) (2018-06-04) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.31](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.30...aws-amplify-react@0.1.48-unstable.31) (2018-06-02) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.30](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.29...aws-amplify-react@0.1.48-unstable.30) (2018-06-01) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.29](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.28...aws-amplify-react@0.1.48-unstable.29) (2018-06-01) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.28](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.27...aws-amplify-react@0.1.48-unstable.28) (2018-06-01) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.27](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.26...aws-amplify-react@0.1.48-unstable.27) (2018-05-31) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.26](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.23...aws-amplify-react@0.1.48-unstable.26) (2018-05-31) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.23](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.22...aws-amplify-react@0.1.48-unstable.23) (2018-05-31) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.22](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.21...aws-amplify-react@0.1.48-unstable.22) (2018-05-31) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.21](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.20...aws-amplify-react@0.1.48-unstable.21) (2018-05-30) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.20](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.19...aws-amplify-react@0.1.48-unstable.20) (2018-05-29) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.19](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.18...aws-amplify-react@0.1.48-unstable.19) (2018-05-29) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.18](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.17...aws-amplify-react@0.1.48-unstable.18) (2018-05-29) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.17](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.16...aws-amplify-react@0.1.48-unstable.17) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.16](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.15...aws-amplify-react@0.1.48-unstable.16) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.15](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.14...aws-amplify-react@0.1.48-unstable.15) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.14](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.13...aws-amplify-react@0.1.48-unstable.14) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.13](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.12...aws-amplify-react@0.1.48-unstable.13) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.12](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.11...aws-amplify-react@0.1.48-unstable.12) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.11](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.10...aws-amplify-react@0.1.48-unstable.11) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.10](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.47...aws-amplify-react@0.1.48-unstable.10) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.9](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.8...aws-amplify-react@0.1.48-unstable.9) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.8](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.7...aws-amplify-react@0.1.48-unstable.8) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.7](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.6...aws-amplify-react@0.1.48-unstable.7) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.6](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.5...aws-amplify-react@0.1.48-unstable.6) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.5](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.4...aws-amplify-react@0.1.48-unstable.5) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.4](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.3...aws-amplify-react@0.1.48-unstable.4) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.3](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.2...aws-amplify-react@0.1.48-unstable.3) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.2](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.1...aws-amplify-react@0.1.48-unstable.2) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.1](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.48-unstable.0...aws-amplify-react@0.1.48-unstable.1) (2018-05-24) - -**Note:** Version bump only for package aws-amplify-react - - - -## [0.1.48-unstable.0](https://github.com/aws/aws-amplify/compare/aws-amplify-react@0.1.47...aws-amplify-react@0.1.48-unstable.0) (2018-05-23) - -**Note:** Version bump only for package aws-amplify-react diff --git a/packages/aws-amplify-react/LICENSE b/packages/aws-amplify-react/LICENSE deleted file mode 100644 index 8dada3edaf5..00000000000 --- a/packages/aws-amplify-react/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/aws-amplify-react/README.md b/packages/aws-amplify-react/README.md deleted file mode 100644 index 934fe15ec17..00000000000 --- a/packages/aws-amplify-react/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# AWS Amplify Package - aws-amplify-react - -AWS Amplify is a JavaScript library for frontend and mobile developers building cloud-enabled applications. The library is a declarative interface across different categories of operations in order to make common tasks easier to add into your application. The default implementation works with Amazon Web Services (AWS) resources but is designed to be open and pluggable for usage with other cloud services that wish to provide an implementation or custom backends. - -`aws-amplify-react` is one of the AWS Amplify library packages, provide building blocks for React App development. Documentation is available [here](https://github.com/aws-amplify/amplify-js/blob/main/README.md) diff --git a/packages/aws-amplify-react/__mocks__/styleMock.ts b/packages/aws-amplify-react/__mocks__/styleMock.ts deleted file mode 100644 index f053ebf7976..00000000000 --- a/packages/aws-amplify-react/__mocks__/styleMock.ts +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; diff --git a/packages/aws-amplify-react/__tests__/Amplify-UI/Amplify-UI-Components-React-test.tsx b/packages/aws-amplify-react/__tests__/Amplify-UI/Amplify-UI-Components-React-test.tsx deleted file mode 100644 index 18630a9f977..00000000000 --- a/packages/aws-amplify-react/__tests__/Amplify-UI/Amplify-UI-Components-React-test.tsx +++ /dev/null @@ -1,202 +0,0 @@ -import * as React from 'react'; -import * as UI from '../../src/Amplify-UI/Amplify-UI-Components-React'; - -describe('AmplifyUi test', () => { - test('render Container correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render FormContainer correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SectionHeader correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SectionHeaderContent correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SectionFooter correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SectionFooterPrimaryContent correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SectionFooterSecondaryContent correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SectionBody correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render Strike correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render StrikeContent correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render FormRow correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render Radio correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render RadioRow correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render InputRow correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render Input correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SelectInput correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - // test('render CheckboxRow correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render MessageRow correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render ButtonRow correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render Link correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render ErrorSection correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render ActionRow correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render Checkbox correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render Button correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render ButtonContent correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render SignInButton correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render Label correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render Space correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render NavBar correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render Nav correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render NavRight correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render NavItem correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); - - // test('render NavButton correctly', () => { - // const wrapper = shallow(); - // wrapper.setProps({ theme: 'theme' }); - // expect(wrapper).toMatchSnapshot(); - // }); -}); diff --git a/packages/aws-amplify-react/__tests__/Amplify-UI/__snapshots__/Amplify-UI-Components-React-test.tsx.snap b/packages/aws-amplify-react/__tests__/Amplify-UI/__snapshots__/Amplify-UI-Components-React-test.tsx.snap deleted file mode 100644 index 0436fbad90b..00000000000 --- a/packages/aws-amplify-react/__tests__/Amplify-UI/__snapshots__/Amplify-UI-Components-React-test.tsx.snap +++ /dev/null @@ -1,132 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AmplifyUi test render Container correctly 1`] = ` -
-`; - -exports[`AmplifyUi test render FormContainer correctly 1`] = ` -
-`; - -exports[`AmplifyUi test render FormRow correctly 1`] = ` -
-`; - -exports[`AmplifyUi test render Input correctly 1`] = ` - -`; - -exports[`AmplifyUi test render InputRow correctly 1`] = ` - - - -`; - -exports[`AmplifyUi test render Radio correctly 1`] = ` - -`; - -exports[`AmplifyUi test render RadioRow correctly 1`] = ` - - - - -`; - -exports[`AmplifyUi test render SectionBody correctly 1`] = ` -
-`; - -exports[`AmplifyUi test render SectionFooter correctly 1`] = ` -
-`; - -exports[`AmplifyUi test render SectionFooterPrimaryContent correctly 1`] = ` - -`; - -exports[`AmplifyUi test render SectionFooterSecondaryContent correctly 1`] = ` - -`; - -exports[`AmplifyUi test render SectionHeader correctly 1`] = ` -
- -
-`; - -exports[`AmplifyUi test render SectionHeaderContent correctly 1`] = ` - -`; - -exports[`AmplifyUi test render SelectInput correctly 1`] = ` -
-`; - -exports[`AmplifyUi test render Strike correctly 1`] = ` -
- -
-`; - -exports[`AmplifyUi test render StrikeContent correctly 1`] = ` - -`; diff --git a/packages/aws-amplify-react/__tests__/AmplifyMessageMap-test.tsx b/packages/aws-amplify-react/__tests__/AmplifyMessageMap-test.tsx deleted file mode 100644 index 002a5d5fc24..00000000000 --- a/packages/aws-amplify-react/__tests__/AmplifyMessageMap-test.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { MapEntries, AmplifyMessageMap } from '../src/AmplifyMessageMap'; - -test('MapEntries', () => { - expect(MapEntries).toEqual([ - ['User does not exist', /user.*not.*exist/i], - ['User already exists', /user.*already.*exist/i], - ['Incorrect username or password', /incorrect.*username.*password/i], - ['Invalid password format', /validation.*password/i], - [ - 'Invalid phone number format', - /invalid.*phone/i, - 'Invalid phone number format. Please use a phone number format of +12345678900', - ], - ]); -}); - -test('AmplifyMessageMap error message', () => { - expect(AmplifyMessageMap('user not exist')).toBe('User does not exist'); -}); - -test('AmplifyMessageMap happy case', () => { - expect(AmplifyMessageMap('')).toBe(''); -}); - -test('AmplifyMessageMap no match', () => { - expect(AmplifyMessageMap('abc')).toBe('abc'); -}); - -test('AmplifyMessageMap return message instead of i18n token if message exists', () => { - expect(AmplifyMessageMap('invalid phone')).toBe( - 'Invalid phone number format. Please use a phone number format of +12345678900' - ); -}); diff --git a/packages/aws-amplify-react/__tests__/AmplifyUI-test.tsx b/packages/aws-amplify-react/__tests__/AmplifyUI-test.tsx deleted file mode 100644 index 58bd8c0f8f6..00000000000 --- a/packages/aws-amplify-react/__tests__/AmplifyUI-test.tsx +++ /dev/null @@ -1,178 +0,0 @@ -import * as React from 'react'; -import * as UI from '../src/AmplifyUI'; - -describe('AmplifyUi test', () => { - test('render InputRow correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render RadioRow correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render CheckboxRow correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render MessageRow correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render ButtonRow correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render Link correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render Container correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render FormContainer correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render FormSection correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render ErrorSection correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SectionHeader correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SectionHeaderContent correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SectionFooter correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SectionFooterContent correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SectionBody correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render ActionRow correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render FormRow correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render Radio correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render Checkbox correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render Button correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render ButtonContent correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render SignInButton correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render Label correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render Space correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render NavBar correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render Nav correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render NavRight correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render NavItem correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render NavButton correctly', () => { - const wrapper = shallow(); - wrapper.setProps({ theme: 'theme' }); - expect(wrapper).toMatchSnapshot(); - }); -}); diff --git a/packages/aws-amplify-react/__tests__/Analytics/__snapshots__/trackLifecycle-test.tsx.snap b/packages/aws-amplify-react/__tests__/Analytics/__snapshots__/trackLifecycle-test.tsx.snap deleted file mode 100644 index 6f7b69f313d..00000000000 --- a/packages/aws-amplify-react/__tests__/Analytics/__snapshots__/trackLifecycle-test.tsx.snap +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`trackLifecycle test render correctly 1`] = ``; diff --git a/packages/aws-amplify-react/__tests__/Analytics/trackLifecycle-test.tsx b/packages/aws-amplify-react/__tests__/Analytics/trackLifecycle-test.tsx deleted file mode 100644 index 55b04518d82..00000000000 --- a/packages/aws-amplify-react/__tests__/Analytics/trackLifecycle-test.tsx +++ /dev/null @@ -1,78 +0,0 @@ -jest.mock('@aws-amplify/analytics', () => { - return { - Analytics: { - record: jest.fn(), - }, - }; -}); - -import * as React from 'react'; -import { Analytics } from '@aws-amplify/analytics'; -import { trackLifecycle } from '../../src/Analytics/trackLifecycle'; - -describe('trackLifecycle test', () => { - test('render correctly', () => { - const spyon = jest.spyOn(Analytics, 'record'); - const MockComp = class extends React.Component { - render() { - return
; - } - }; - const CompWithAuth = trackLifecycle(MockComp, 'trackername'); - const wrapper = shallow(); - - expect(wrapper).toMatchSnapshot(); - expect(spyon).toBeCalled(); - - spyon.mockClear(); - }); - - test('track when mounting', () => { - const spyon = jest.spyOn(Analytics, 'record'); - const MockComp = class extends React.Component { - render() { - return
; - } - }; - const CompWithAuth = trackLifecycle(MockComp, 'trackername'); - const wrapper = mount(); - - expect(spyon.mock.calls.length).toBe(2); - - spyon.mockClear(); - wrapper.unmount(); - }); - - test('track when unmounting', () => { - const spyon = jest.spyOn(Analytics, 'record'); - const MockComp = class extends React.Component { - render() { - return
; - } - }; - const CompWithAuth = trackLifecycle(MockComp, 'trackername'); - const wrapper = shallow(); - - wrapper.unmount(); - expect(spyon.mock.calls.length).toBe(2); - - spyon.mockClear(); - }); - - test('track when updating', () => { - const spyon = jest.spyOn(Analytics, 'record'); - const MockComp = class extends React.Component { - render() { - return
; - } - }; - const CompWithAuth = trackLifecycle(MockComp, 'trackername'); - const wrapper = shallow(); - - wrapper.update(); - - expect(spyon.mock.calls.length).toBe(2); - - spyon.mockClear(); - }); -}); diff --git a/packages/aws-amplify-react/__tests__/Auth/AuthPiece-test.tsx b/packages/aws-amplify-react/__tests__/Auth/AuthPiece-test.tsx deleted file mode 100644 index fcc2025fa0c..00000000000 --- a/packages/aws-amplify-react/__tests__/Auth/AuthPiece-test.tsx +++ /dev/null @@ -1,206 +0,0 @@ -import * as React from 'react'; -import { AuthPiece } from '../../src/Auth/AuthPiece'; - -class TestPiece extends AuthPiece { - constructor(props) { - super(props); - } - render() { - return
; - } -} - -describe('AuthPiece test', () => { - describe('usernameFromAuthData test', () => { - test('happy case with string type authdata', () => { - const props = { - authData: 'username', - }; - const wrapper = shallow(); - const testPiece = wrapper.instance(); - wrapper.setProps(props); - - expect(testPiece.usernameFromAuthData()).toBe('username'); - }); - - test('happy case with object type authdata', () => { - const props = { - authData: { - username: 'username', - }, - }; - const props2 = { - authData: { - user: { - username: 'username', - }, - }, - }; - const wrapper = shallow(); - const testPiece = wrapper.instance(); - wrapper.setProps(props); - - expect(testPiece.usernameFromAuthData()).toBe('username'); - - wrapper.setProps(props2); - - expect(testPiece.usernameFromAuthData()).toBe('username'); - }); - - test('no authData', () => { - const wrapper = shallow(); - const testPiece = wrapper.instance(); - - expect(testPiece.usernameFromAuthData()).toBe(''); - }); - }); - - describe('errorMessage test', () => { - test('happy case', () => { - const wrapper = shallow(); - const testPiece = wrapper.instance(); - - expect(testPiece.errorMessage('err')).toBe('err'); - }); - - test('happy case with object param', () => { - const wrapper = shallow(); - const testPiece = wrapper.instance(); - - expect(testPiece.errorMessage({ message: 'err' })).toBe('err'); - expect(testPiece.errorMessage({ something: 'something' })).toBe( - JSON.stringify({ something: 'something' }) - ); - }); - }); - - describe('triggerAuthEvent test', () => { - test('happy case', () => { - const mockFn = jest.fn(); - const props = { - authState: 'state', - onAuthEvent: mockFn, - }; - const wrapper = shallow(); - const testPiece = wrapper.instance(); - wrapper.setProps(props); - - testPiece.triggerAuthEvent('event'); - - expect(mockFn).toBeCalledWith('state', 'event'); - }); - - test('no onAuthEvent', () => { - const props = { - authState: 'state', - }; - const wrapper = shallow(); - const testPiece = wrapper.instance(); - wrapper.setProps(props); - - testPiece.triggerAuthEvent('event'); - }); - }); - - describe('changeState test', () => { - test('happy case', () => { - const spyon = jest - .spyOn(AuthPiece.prototype, 'triggerAuthEvent') - .mockImplementationOnce(() => { - return; - }); - - const mockFn = jest.fn(); - const props = { - onStateChange: mockFn, - }; - const wrapper = shallow(); - const testPiece = wrapper.instance(); - wrapper.setProps(props); - - testPiece.changeState('state', 'data'); - - expect(mockFn).toBeCalledWith('state', 'data'); - expect(spyon).toBeCalledWith({ data: 'state', type: 'stateChange' }); - - spyon.mockClear(); - }); - - test('happy case', () => { - const spyon = jest - .spyOn(AuthPiece.prototype, 'triggerAuthEvent') - .mockImplementationOnce(() => { - return; - }); - const wrapper = shallow(); - const testPiece = wrapper.instance(); - - testPiece.changeState('state', 'data'); - expect(spyon).toBeCalledWith({ data: 'state', type: 'stateChange' }); - - spyon.mockClear(); - }); - }); - - describe('error test', () => { - test('happy case', () => { - const spyon = jest - .spyOn(AuthPiece.prototype, 'triggerAuthEvent') - .mockImplementationOnce(() => { - return; - }); - - const spyon2 = jest - .spyOn(AuthPiece.prototype, 'errorMessage') - .mockImplementationOnce(() => { - return 'errMessage'; - }); - - const wrapper = shallow(); - const testPiece = wrapper.instance(); - - testPiece.error('err'); - - expect(spyon).toBeCalledWith({ data: 'errMessage', type: 'error' }); - - spyon.mockClear(); - spyon2.mockClear(); - }); - }); - - describe('handleInputChange test', () => { - test('happy case', () => { - const event = { - target: { - name: 'name', - value: 'value', - type: 'radio', - checked: true, - }, - }; - const wrapper = shallow(); - const testPiece = wrapper.instance(); - - testPiece.handleInputChange(event); - - expect(testPiece.inputs).toEqual({ checkedValue: 'value', name: 'true' }); - }); - - test('happy case without checke_type', () => { - const event = { - target: { - name: 'name', - value: 'value', - type: 'other_type', - checked: '', - }, - }; - const wrapper = shallow(); - const testPiece = wrapper.instance(); - - testPiece.handleInputChange(event); - - expect(testPiece.inputs).toEqual({ checkedValue: null, name: 'value' }); - }); - }); -}); diff --git a/packages/aws-amplify-react/__tests__/Auth/Authenticator-test.tsx b/packages/aws-amplify-react/__tests__/Auth/Authenticator-test.tsx deleted file mode 100644 index 73081c03033..00000000000 --- a/packages/aws-amplify-react/__tests__/Auth/Authenticator-test.tsx +++ /dev/null @@ -1,188 +0,0 @@ -import * as React from 'react'; -import { Auth } from '@aws-amplify/auth'; -import { Authenticator, EmptyContainer } from '../../src/Auth/Authenticator'; -import { SignIn } from '../../src/Auth/SignIn'; -import AmplifyTheme from '../../src/AmplifyTheme'; -import { - Button, - InputRow, - Container, -} from '../../src/Amplify-UI/Amplify-UI-Components-React'; - -const waitForResolve = Promise.resolve(); - -describe('Authenticator', () => { - beforeAll(() => { - const localStorageMock = { - getItem: jest.fn(), - setItem: jest.fn(), - removeItem: jest.fn(), - clear: jest.fn(), - }; - global.localStorage = localStorageMock; - }); - afterAll(() => { - jest.resetAllMocks(); - }); - describe('normal case', () => { - test('render if no error', () => { - const wrapper = shallow(); - wrapper.setProps({ - authState: 'signIn', - theme: AmplifyTheme, - }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render with hidedefault', () => { - const wrapper = shallow(); - wrapper.setProps({ - authState: 'signIn', - theme: AmplifyTheme, - }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render if no error with children', () => { - const wrapper = shallow( - -
-
- ); - wrapper.setProps({ - authState: 'signIn', - theme: AmplifyTheme, - }); - expect(wrapper).toMatchSnapshot(); - }); - }); - - describe.skip('handleStateChange test', () => { - test('when user sign in and need confirmation', async () => { - const wrapper = shallow(); - - const spyon = jest - .spyOn(Auth, 'signIn') - .mockImplementationOnce((user, password) => { - return new Promise((res, rej) => { - res({ - challengeName: 'SMS_MFA', - }); - }); - }); - - const event_username = { - target: { - name: 'username', - value: 'user1', - }, - }; - const event_password = { - target: { - name: 'password', - value: 'abc', - }, - }; - - const signInWrapper = wrapper.find(SignIn).dive(); - signInWrapper - .find(InputRow) - .at(0) - .simulate('change', event_username); - signInWrapper - .find(InputRow) - .at(1) - .simulate('change', event_password); - await signInWrapper.find(Button).simulate('click'); - - expect(wrapper.state()).toEqual({ - auth: 'confirmSignIn', - authData: { challengeName: 'SMS_MFA' }, - error: null, - }); - - spyon.mockClear(); - }); - }); - - describe.skip('handleAuthEvent test', () => { - test('when user sign in failed', async () => { - const wrapper = shallow(); - - const spyon = jest - .spyOn(Auth, 'signIn') - .mockImplementationOnce((user, password) => { - return new Promise((res, rej) => { - rej('err'); - }); - }); - - const event_username = { - target: { - name: 'username', - value: 'user1', - }, - }; - const event_password = { - target: { - name: 'password', - value: 'abc', - }, - }; - - const signInWrapper = wrapper.find(SignIn).dive(); - signInWrapper - .find(Input) - .at(0) - .simulate('change', event_username); - signInWrapper - .find(Input) - .at(1) - .simulate('change', event_password); - await signInWrapper.find(Button).simulate('click'); - - expect(wrapper.state()).toEqual({ - auth: 'signIn', - }); - - spyon.mockClear(); - }); - }); - - describe('checkUser test', () => { - test('happy case', async () => { - const wrapper = shallow(); - const authenticator = wrapper.instance(); - - const spyon = jest - .spyOn(Auth, 'currentAuthenticatedUser') - .mockImplementationOnce(() => { - return Promise.resolve('user'); - }); - - await authenticator.checkUser(); - - expect(spyon).toBeCalled(); - }); - }); - - describe('container component', () => { - test('use provided Container component if this.props.container is truthy', () => { - const CustomContainer = ({ children }) => { - return
{children}
; - }; - const wrapper = mount(); - expect(wrapper.childAt(0).type()).toBe(CustomContainer); - }); - - test('use AWS Amplify UI Container if this.props.container is undefined', () => { - const wrapper = mount(); - expect(wrapper.childAt(0).type()).toBe(Container); - }); - - test('use EmptyContainer if this.props.container is falsey', () => { - const wrapper = mount(); - expect(wrapper.childAt(0).type()).toBe(EmptyContainer); - }); - }); -}); diff --git a/packages/aws-amplify-react/__tests__/Auth/ConfirmSignIn-test.tsx b/packages/aws-amplify-react/__tests__/Auth/ConfirmSignIn-test.tsx deleted file mode 100644 index 6446fb4bbb7..00000000000 --- a/packages/aws-amplify-react/__tests__/Auth/ConfirmSignIn-test.tsx +++ /dev/null @@ -1,212 +0,0 @@ -import * as React from 'react'; -import { Auth } from '@aws-amplify/auth'; -import { ConfirmSignIn } from '../../src/Auth/ConfirmSignIn'; -import AmplifyTheme from '../../src/AmplifyTheme'; -import { - Input, - Button, - Link, -} from '../../src/Amplify-UI/Amplify-UI-Components-React'; - -const acceptedStates = ['confirmSignIn']; - -const deniedStates = [ - 'signIn', - 'signedUp', - 'signedOut', - 'signUp', - 'signedIn', - 'confirmSignUp', - 'forgotPassword', - 'verifyContact', -]; - -const fakeEvent = { - preventDefault: jest.fn(), -}; - -describe('ConfirmSignIn', () => { - describe('render test', () => { - test('render correctly with Props confirmSignIn', () => { - const wrapper = shallow(); - for (let i = 0; i < acceptedStates.length; i += 1) { - wrapper.setProps({ - authState: acceptedStates[i], - theme: AmplifyTheme, - }); - expect(wrapper).toMatchSnapshot(); - } - }); - - test('render corrently with other authstate', () => { - const wrapper = shallow(); - - for (let i = 0; i < deniedStates.length; i += 1) { - wrapper.setProps({ - authState: deniedStates[i], - theme: AmplifyTheme, - }); - - expect(wrapper).toMatchSnapshot(); - } - }); - - test('hidden if hide include confirmSignIn', () => { - const wrapper = shallow(); - wrapper.setProps({ - authState: acceptedStates[0], - hide: [ConfirmSignIn], - }); - expect(wrapper).toMatchSnapshot(); - }); - }); - - describe('confirm test', () => { - test('user with challengeName SOFTWARE_TOKEN_MFA', async () => { - const wrapper = shallow(); - - const spyon = jest - .spyOn(Auth, 'confirmSignIn') - .mockImplementationOnce(() => { - return Promise.resolve(); - }); - - wrapper.setProps({ - authState: acceptedStates[0], - theme: AmplifyTheme, - authData: { - user: { - challengeName: 'SOFTWARE_TOKEN_MFA', - }, - }, - }); - - const confirmSignIn = wrapper.instance(); - - await confirmSignIn.confirm(); - - expect(spyon).toBeCalled(); - - spyon.mockClear(); - }); - }); - - describe('normal case', () => { - test('simulate clicking confirm button', async () => { - const spyon = jest - .spyOn(Auth, 'confirmSignIn') - .mockImplementation((user, code) => { - return new Promise((res, rej) => { - res(); - }); - }); - - const wrapper = shallow(); - const spyon2 = jest.spyOn(wrapper.instance(), 'checkContact'); - wrapper.setProps({ - authState: acceptedStates[0], - theme: AmplifyTheme, - authData: 'user', - }); - - const event_code = { - target: { - name: 'code', - value: '123456', - }, - }; - - wrapper - .find(Input) - .at(0) - .simulate('change', event_code); - wrapper - .find('form') - .at(0) - .simulate('submit', fakeEvent); - - await Promise.resolve(); - - expect.assertions(3); - expect(spyon.mock.calls[0][0]).toBe('user'); - expect(spyon.mock.calls[0][1]).toBe('123456'); - expect(spyon2).toBeCalled(); - - spyon.mockClear(); - spyon2.mockClear(); - }); - - test('back to sign in', () => { - const wrapper = shallow(); - const spyon2 = jest.spyOn(wrapper.instance(), 'changeState'); - wrapper.setProps({ - authState: acceptedStates[0], - theme: AmplifyTheme, - authData: 'user', - }); - - wrapper - .find(Link) - .at(0) - .simulate('click'); - expect(spyon2).toBeCalledWith('signIn'); - - spyon2.mockClear(); - }); - }); - - describe('checkContact test', () => { - test('contact verified', async () => { - const wrapper = shallow(); - const confirmSignIn = wrapper.instance(); - - const spyon = jest - .spyOn(Auth, 'verifiedContact') - .mockImplementationOnce(() => { - return Promise.resolve({ - verified: { - email: 'xxx@xxx.com', - }, - }); - }); - - const spyon2 = jest.spyOn(confirmSignIn, 'changeState'); - - await confirmSignIn.checkContact({ - user: 'user', - }); - - expect(spyon2).toBeCalledWith('signedIn', { user: 'user' }); - - spyon.mockClear(); - spyon2.mockClear(); - }); - - test('contact not verified', async () => { - const wrapper = shallow(); - const confirmSignIn = wrapper.instance(); - - const spyon = jest - .spyOn(Auth, 'verifiedContact') - .mockImplementationOnce(() => { - return Promise.resolve({ - verified: {}, - }); - }); - - const spyon2 = jest.spyOn(confirmSignIn, 'changeState'); - - await confirmSignIn.checkContact({ - user: 'user', - }); - - expect(spyon2).toBeCalledWith('verifyContact', { - user: 'user', - verified: {}, - }); - - spyon.mockClear(); - spyon2.mockClear(); - }); - }); -}); diff --git a/packages/aws-amplify-react/__tests__/Auth/ConfirmSignUp-test.tsx b/packages/aws-amplify-react/__tests__/Auth/ConfirmSignUp-test.tsx deleted file mode 100644 index 56bd3d78ff8..00000000000 --- a/packages/aws-amplify-react/__tests__/Auth/ConfirmSignUp-test.tsx +++ /dev/null @@ -1,160 +0,0 @@ -import * as React from 'react'; -import { Auth } from '@aws-amplify/auth'; -import { ConfirmSignUp } from '../../src/Auth/ConfirmSignUp'; -import AmplifyTheme from '../../src/AmplifyTheme'; -import { - Input, - Button, - Link, -} from '../../src/Amplify-UI/Amplify-UI-Components-React'; - -const acceptedStates = ['confirmSignUp']; - -const deniedStates = [ - 'signIn', - 'signedUp', - 'signedOut', - 'signUp', - 'signedIn', - 'confirmSignIn', - 'forgotPassword', - 'verifyContact', -]; - -describe('ConfirmSignIn', () => { - describe('normal case', () => { - test('render correctly with Props confirmSignUp', () => { - const wrapper = shallow(); - for (let i = 0; i < acceptedStates.length; i += 1) { - wrapper.setProps({ - authState: acceptedStates[i], - theme: AmplifyTheme, - }); - expect(wrapper).toMatchSnapshot(); - } - }); - - test('render correctly with hide', () => { - const wrapper = shallow(); - for (let i = 0; i < acceptedStates.length; i += 1) { - wrapper.setProps({ - authState: acceptedStates[i], - theme: AmplifyTheme, - hide: [ConfirmSignUp], - }); - expect(wrapper).toMatchSnapshot(); - } - }); - - test('simulate clicking confirm button with username already defined in auth data', async () => { - const spyon = jest - .spyOn(Auth, 'confirmSignUp') - .mockImplementation((user, code) => { - return new Promise((res, rej) => { - res(); - }); - }); - - const spyon3 = jest - .spyOn(ConfirmSignUp.prototype, 'usernameFromAuthData') - .mockImplementation(() => { - return 'user'; - }); - - const wrapper = shallow(); - const spyon2 = jest.spyOn(wrapper.instance(), 'changeState'); - wrapper.setProps({ - authState: acceptedStates[0], - theme: AmplifyTheme, - hide: false, - }); - - const event_code = { - target: { - name: 'code', - value: '123456', - }, - }; - - wrapper - .find(Input) - .at(0) - .simulate('change', event_code); - await wrapper - .find(Button) - .at(0) - .simulate('click'); - - expect.assertions(2); - expect(spyon).toBeCalledWith('user', '123456'); - expect(spyon2).toBeCalledWith('signedUp'); - - spyon.mockClear(); - spyon2.mockClear(); - spyon3.mockClear(); - }); - - test('simulate clicking resend button with username already defined in auth data', async () => { - const spyon = jest - .spyOn(Auth, 'resendSignUp') - .mockImplementation(user => { - return new Promise((res, rej) => { - res(); - }); - }); - - const spyon3 = jest - .spyOn(ConfirmSignUp.prototype, 'usernameFromAuthData') - .mockImplementation(() => { - return 'user'; - }); - - const wrapper = shallow(); - - wrapper.setProps({ - authState: acceptedStates[0], - theme: AmplifyTheme, - hide: false, - }); - - const event_code = { - target: { - name: 'code', - value: '123456', - }, - }; - - const event_username = { - target: { - name: 'username', - value: 'user1', - }, - }; - - await wrapper - .find(Link) - .at(0) - .simulate('click'); - - expect.assertions(1); - expect(spyon).toBeCalledWith('user'); - - spyon.mockClear(); - }); - }); - - describe('null case with other authState', () => { - test('render corrently', () => { - const wrapper = shallow(); - - for (let i = 0; i < deniedStates.length; i += 1) { - wrapper.setProps({ - authState: deniedStates[i], - theme: AmplifyTheme, - }); - - expect(wrapper).toMatchSnapshot(); - } - }); - }); -}); diff --git a/packages/aws-amplify-react/__tests__/Auth/FederatedSignIn-test.tsx b/packages/aws-amplify-react/__tests__/Auth/FederatedSignIn-test.tsx deleted file mode 100644 index 9eb97653301..00000000000 --- a/packages/aws-amplify-react/__tests__/Auth/FederatedSignIn-test.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import * as React from 'react'; -import { Auth } from '@aws-amplify/auth'; -import { - FederatedSignIn, - FederatedButtons, -} from '../../src/Auth/FederatedSignIn'; - -const spyon = jest.spyOn(Auth, 'configure').mockImplementation(() => { - return { - hostedUIOptions: {}, - }; -}); - -describe('FederatedSignIn test', () => { - describe('render test', () => { - test('render with correct authState', () => { - const wrapper = shallow(); - - wrapper.setProps({ - federated: {}, - authState: 'signIn', - onStateChange: jest.fn(), - }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render nothing with incorrect authState', () => { - const wrapper = shallow(); - - wrapper.setProps({ - federated: {}, - authState: 'signedIn', - onStateChange: jest.fn(), - }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render nothing with no federated prop', () => { - const wrapper = shallow(); - - wrapper.setProps({ - federated: undefined, - authState: 'signIn', - onStateChange: jest.fn(), - }); - expect(wrapper).toMatchSnapshot(); - }); - }); -}); - -describe('FederatedButtons test', () => { - describe('render test', () => { - test('render with correct authState', () => { - const wrapper = shallow(); - - wrapper.setProps({ - federated: { - google_client_id: 'google_client_id', - facebook_app_id: 'facebook_app_id', - }, - authState: 'signIn', - }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render with correct authState and only google id', () => { - const wrapper = shallow(); - - wrapper.setProps({ - federated: { - facebook_app_id: 'facebook_app_id', - }, - authState: 'signIn', - }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render with correct authState and only facebook id', () => { - const wrapper = shallow(); - - wrapper.setProps({ - federated: { - google_client_id: 'google_client_id', - }, - authState: 'signIn', - }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render nothing with incorrect authState', () => { - const wrapper = shallow(); - - wrapper.setProps({ - federated: {}, - authState: 'signedIn', - }); - expect(wrapper).toMatchSnapshot(); - }); - - test('render nothing with no federated prop', () => { - const wrapper = shallow(); - - wrapper.setProps({ - federated: {}, - authState: 'signIn', - }); - expect(wrapper).toMatchSnapshot(); - }); - }); -}); diff --git a/packages/aws-amplify-react/__tests__/Auth/ForgotPassword-test.tsx b/packages/aws-amplify-react/__tests__/Auth/ForgotPassword-test.tsx deleted file mode 100644 index eb9c5dad569..00000000000 --- a/packages/aws-amplify-react/__tests__/Auth/ForgotPassword-test.tsx +++ /dev/null @@ -1,159 +0,0 @@ -import * as React from 'react'; -import { Auth } from '@aws-amplify/auth'; -import { ForgotPassword } from '../../src/Auth/ForgotPassword'; -import AmplifyTheme from '../../src/AmplifyTheme'; -import { - Input, - Button, -} from '../../src/Amplify-UI/Amplify-UI-Components-React'; - -const acceptedStates = ['forgotPassword']; - -const deniedStates = [ - 'signIn', - 'signedUp', - 'signedOut', - 'signUp', - 'signedIn', - 'confirmSignIn', - 'confirmSignUp', - 'verifyContact', -]; - -describe('forgotPassword', () => { - describe('normal case', () => { - test('render correctly with authState forgotPassword', () => { - for (let i = 0; i < acceptedStates.length; i += 1) { - const wrapper = shallow(); - wrapper.setProps({ - authState: acceptedStates[i], - theme: AmplifyTheme, - }); - expect(wrapper).toMatchSnapshot(); - } - }); - - test('render correctly with state delivery set', () => { - for (let i = 0; i < acceptedStates.length; i += 1) { - const wrapper = shallow(); - wrapper.setProps({ - authState: acceptedStates[i], - theme: AmplifyTheme, - }); - wrapper.setState({ delivery: true }); - - expect(wrapper).toMatchSnapshot(); - } - }); - - test('hidden if hide include ForgotPassword', () => { - const wrapper = shallow(); - wrapper.setProps({ - authState: acceptedStates[0], - hide: [ForgotPassword], - }); - expect(wrapper).toMatchSnapshot(); - }); - - test('simulating clicking submit', async () => { - const spyon = jest - .spyOn(Auth, 'forgotPasswordSubmit') - .mockImplementationOnce(() => { - return new Promise((res, rej) => { - res('data'); - }); - }); - const wrapper = shallow(); - wrapper.setProps({ - authState: acceptedStates[0], - theme: AmplifyTheme, - }); - wrapper.setState({ delivery: true }); - - // const event_username = { - // target: { - // name: 'username', - // value: 'user1' - // } - // } - const event_code = { - target: { - name: 'code', - value: 'code', - }, - }; - - const event_password = { - target: { - name: 'password', - value: 'abc', - }, - }; - - wrapper - .find(Input) - .at(0) - .simulate('change', event_code); - wrapper - .find(Input) - .at(1) - .simulate('change', event_password); - - await wrapper.find(Button).simulate('click'); - - expect(spyon).toBeCalledWith(undefined, 'code', 'abc'); - - spyon.mockClear(); - }); - - test('simulating clicking send', async () => { - const spyon = jest - .spyOn(Auth, 'forgotPassword') - .mockImplementationOnce(() => { - return new Promise((res, rej) => { - res('data'); - }); - }); - - const wrapper = shallow(); - wrapper.setProps({ - authState: acceptedStates[0], - theme: AmplifyTheme, - }); - wrapper.setState({ delivery: false }); - - const event_username = { - target: { - name: 'username', - value: 'user1', - }, - }; - - wrapper - .find(Input) - .at(0) - .simulate('change', event_username); - - await wrapper.find(Button).simulate('click'); - - expect(spyon).toBeCalledWith('user1'); - - spyon.mockClear(); - }); - }); - - describe('null case with other authState', () => { - test('render corrently', () => { - const wrapper = shallow(); - - for (let i = 0; i < deniedStates.length; i += 1) { - wrapper.setProps({ - authState: deniedStates[i], - theme: AmplifyTheme, - }); - - expect(wrapper).toMatchSnapshot(); - } - }); - }); -}); diff --git a/packages/aws-amplify-react/__tests__/Auth/Greetings-test.tsx b/packages/aws-amplify-react/__tests__/Auth/Greetings-test.tsx deleted file mode 100644 index 7da6344e6bf..00000000000 --- a/packages/aws-amplify-react/__tests__/Auth/Greetings-test.tsx +++ /dev/null @@ -1,171 +0,0 @@ -import { Auth } from '@aws-amplify/auth'; -import { Hub } from '@aws-amplify/core'; -import * as React from 'react'; -import { Greetings } from '../../src/Auth/Greetings'; - -const acceptedStates = ['signedIn']; - -const deniedStates = [ - 'signIn', - 'signedUp', - 'signedOut', - 'forgotPassword', - 'signUp', - 'confirmSignIn', - 'confirmSignUp', - 'verifyContact', -]; - -describe('Greetings', () => { - describe('normal case', () => { - test('render correctly with authState signedIn', () => { - const wrapper = shallow(); - for (let i = 0; i < acceptedStates.length; i += 1) { - wrapper.setProps({ - authState: acceptedStates[i], - authData: { - attributes: { - name: 'username', - }, - }, - theme: 'theme', - }); - expect(wrapper).toMatchSnapshot(); - } - }); - - test('render correctly with hide', () => { - const wrapper = shallow(); - for (let i = 0; i < acceptedStates.length; i += 1) { - wrapper.setProps({ - authState: acceptedStates[i], - theme: 'theme', - hide: [Greetings], - }); - expect(wrapper).toMatchSnapshot(); - } - }); - }); - - test('render corrently with other authStates', () => { - const wrapper = shallow(); - - for (let i = 0; i < deniedStates.length; i += 1) { - wrapper.setProps({ - authState: deniedStates[i], - theme: 'theme', - }); - - expect(wrapper).toMatchSnapshot(); - } - }); - - describe('Greetings lifecycle', () => { - test('componentDidMount', async () => { - const spy = jest.spyOn(Greetings.prototype, 'componentDidMount'); - const greetings = mount().instance(); - greetings.componentDidMount(); - expect(greetings._isMounted).toBeTruthy(); - expect(spy).toHaveBeenCalled(); - spy.mockClear(); - }); - test('componentWillUnmount', async () => { - const wrapper = shallow(); - const greetings = wrapper.instance(); - const componentWillUnmount = jest.spyOn( - greetings, - 'componentWillUnmount' - ); - wrapper.unmount(); - expect(greetings._isMounted).toBeFalsy(); - expect(componentWillUnmount).toHaveBeenCalled(); - }); - }); - - describe('findState tests', () => { - test('findState is called', () => { - const spy = jest.spyOn(Greetings.prototype, 'findState'); - const greetings = mount().instance(); - expect(spy).toHaveBeenCalled(); - spy.mockClear(); - }); - test('Auth.currentAuthenticatedUser is not called if auth props are present', () => { - const spy = jest - .spyOn(Auth, 'currentAuthenticatedUser') - .mockImplementationOnce(() => { - return new Promise((res, rej) => { - res({ - user: {}, - }); - }); - }); - const props = { - authState: 'signedIn', - authData: {}, - }; - const wrapper = shallow(); - const greetings = wrapper.instance(); - expect(spy).not.toHaveBeenCalled(); - spy.mockClear(); - }); - test('Auth.currentAuthenticatedUser is called if auth props are not present', () => { - const spy = jest - .spyOn(Auth, 'currentAuthenticatedUser') - .mockImplementationOnce(() => { - return new Promise((res, rej) => { - res({ - user: {}, - }); - }); - }); - const props = {}; - const wrapper = shallow(); - const greetings = wrapper.instance(); - expect(spy).toHaveBeenCalled(); - spy.mockClear(); - }); - test('Auth.currentAuthenticatedUser results in state being set', async () => { - const spy = jest.spyOn(Greetings.prototype, 'setState'); - const props = {}; - const wrapper = shallow(); - const greetings = wrapper.instance(); - await greetings.findState(); - expect(greetings.state.stateFromStorage).toEqual(true); - expect(spy).toHaveBeenCalled(); - spy.mockClear(); - }); - }); - - describe('onHubCapsule tests', () => { - test('onHubCapsule is present', () => { - const greetings = mount().instance(); - expect(greetings.onHubCapsule).toBeTruthy(); - }); - test('onHubCapsule is called on a Hub event', () => { - const spy = jest.spyOn(Greetings.prototype, 'onHubCapsule'); - const greetings = mount().instance(); - Hub.dispatch('auth', { event: 'test' }); - expect(spy).toHaveBeenCalled(); - spy.mockClear(); - }); - test('onHubCapsule should setState with authState = "signedIn" when "signIn" auth event fires', () => { - const spy = jest.spyOn(Greetings.prototype, 'setState'); - const greetings = mount().instance(); - Hub.dispatch('auth', { event: 'signIn', data: { foo: 'bar' } }); - expect(spy).toHaveBeenCalledWith({ - authState: 'signedIn', - authData: { foo: 'bar' }, - }); - spy.mockClear(); - }); - test('onHubCapsule should setState with authState = "signIn" when "customSignOut" auth event fires', () => { - const spy = jest.spyOn(Greetings.prototype, 'setState'); - const greetings = mount().instance(); - Hub.dispatch('auth', { event: 'signOut' }); - expect(spy).toHaveBeenCalledWith({ - authState: 'signIn', - }); - spy.mockClear(); - }); - }); -}); diff --git a/packages/aws-amplify-react/__tests__/Auth/PhoneField-test.tsx b/packages/aws-amplify-react/__tests__/Auth/PhoneField-test.tsx deleted file mode 100644 index e3db2bec550..00000000000 --- a/packages/aws-amplify-react/__tests__/Auth/PhoneField-test.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { PhoneField } from '../../src/Auth/PhoneField'; -import * as React from 'react'; -import AmplifyTheme from '../../src/AmplifyTheme'; -import AuthPiece from '../../src/Auth/AuthPiece'; -import { Input } from '../../src/Amplify-UI/Amplify-UI-Components-React'; - -describe('PhoneField', () => { - test('render correctly', () => { - const wrapper = shallow(); - expect(wrapper).toMatchSnapshot(); - }); - - test('trigger handleInputChange if countryCode changed', () => { - const wrapper = shallow(); - const mockOnChangeText = jest.fn(); - wrapper.setProps({ - onChangeText: mockOnChangeText, - }); - - const event = { - target: { - name: 'countryCode', - value: '1', - }, - }; - wrapper - .find('select') - .at(0) - .simulate('change', event); - expect(mockOnChangeText).toBeCalled(); - }); - - test('trigger handleInputChange if phone line number changed', () => { - const wrapper = shallow(); - const mockOnChangeText = jest.fn(); - wrapper.setProps({ - onChangeText: mockOnChangeText, - }); - - const event = { - target: { - name: 'phone_line_number', - value: '1234567890', - }, - }; - wrapper - .find(Input) - .at(0) - .simulate('change', event); - expect(mockOnChangeText).toBeCalled(); - }); -}); diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/index-test.tsx.snap b/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/index-test.tsx.snap deleted file mode 100644 index 221b4ef8296..00000000000 --- a/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/index-test.tsx.snap +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`withFederated test render test render correctly 1`] = ``; diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withAmazon-test.tsx.snap b/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withAmazon-test.tsx.snap deleted file mode 100644 index fb2ad98e416..00000000000 --- a/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withAmazon-test.tsx.snap +++ /dev/null @@ -1,17 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AmazonButton test render test render correctly 1`] = ` -
- - -`; - -exports[`IconButton renders successfully with variant 1`] = ` - - -
- -
-
-
-`; diff --git a/packages/aws-amplify-react/__tests__/XR/__snapshots__/Loading-test.tsx.snap b/packages/aws-amplify-react/__tests__/XR/__snapshots__/Loading-test.tsx.snap deleted file mode 100644 index 353f593be92..00000000000 --- a/packages/aws-amplify-react/__tests__/XR/__snapshots__/Loading-test.tsx.snap +++ /dev/null @@ -1,131 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Loading renders successfully with no props 1`] = ` - -
-
-
- - - - - - - - - -
-
-
-
-
-
-
- -`; - -exports[`Loading renders successfully with percentage 1`] = ` - -
-
-
- - - - - - - - - -
-
-
-
-
-
-
- -`; diff --git a/packages/aws-amplify-react/__tests__/XR/__snapshots__/SumerianScene-test.tsx.snap b/packages/aws-amplify-react/__tests__/XR/__snapshots__/SumerianScene-test.tsx.snap deleted file mode 100644 index 7d86ac1825f..00000000000 --- a/packages/aws-amplify-react/__tests__/XR/__snapshots__/SumerianScene-test.tsx.snap +++ /dev/null @@ -1,96 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`SumerianScene renders successfully 1`] = ` - -
-
- -
-
-
- - - - - - - - - -
-
- TestSceneName -
-
-
-
-
-
- -
-
- -
-
- -`; diff --git a/packages/aws-amplify-react/__tests__/XR/__snapshots__/Tooltip-test.tsx.snap b/packages/aws-amplify-react/__tests__/XR/__snapshots__/Tooltip-test.tsx.snap deleted file mode 100644 index 65a4051eef2..00000000000 --- a/packages/aws-amplify-react/__tests__/XR/__snapshots__/Tooltip-test.tsx.snap +++ /dev/null @@ -1,20 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Tooltip renders successfully with no props 1`] = ` - -
- -`; - -exports[`Tooltip renders successfully with text 1`] = ` - -
- -`; diff --git a/packages/aws-amplify-react/__tests__/__snapshots__/AmplifyUI-test.tsx.snap b/packages/aws-amplify-react/__tests__/__snapshots__/AmplifyUI-test.tsx.snap deleted file mode 100644 index bc3779a1bee..00000000000 --- a/packages/aws-amplify-react/__tests__/__snapshots__/AmplifyUI-test.tsx.snap +++ /dev/null @@ -1,251 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AmplifyUi test render ActionRow correctly 1`] = ` -
-`; - -exports[`AmplifyUi test render Button correctly 1`] = ` - -`; - -exports[`AmplifyUi test render ButtonContent correctly 1`] = ` - -`; - -exports[`AmplifyUi test render ButtonRow correctly 1`] = ` -
- -
-`; - -exports[`AmplifyUi test render Checkbox correctly 1`] = ` - -`; - -exports[`AmplifyUi test render CheckboxRow correctly 1`] = ` - - - - -`; - -exports[`AmplifyUi test render Container correctly 1`] = ` -
-`; - -exports[`AmplifyUi test render ErrorSection correctly 1`] = ` -
- -
-`; - -exports[`AmplifyUi test render FormContainer correctly 1`] = ` -
-`; - -exports[`AmplifyUi test render FormRow correctly 1`] = ` -
-`; - -exports[`AmplifyUi test render FormSection correctly 1`] = ` - -
- -`; - -exports[`AmplifyUi test render InputRow correctly 1`] = ` - - - -`; - -exports[`AmplifyUi test render Label correctly 1`] = ` -