diff --git a/packages/amplify-ui/src/Section.css b/packages/amplify-ui/src/Section.css index acf16c24977..2445ee2c922 100644 --- a/packages/amplify-ui/src/Section.css +++ b/packages/amplify-ui/src/Section.css @@ -1,64 +1,67 @@ @import './Theme.css'; .container { - font-weight: 400; + font-weight: 400; } .actionRow { - margin-bottom: 15px; + margin-bottom: 15px; } .sectionHeader { - color: var(--deepSquidInk); - margin-bottom: 24px; - font-size: 18px; - font-weight: 500; + 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; + color: var(--grey); + font-size: 16px; + font-weight: 400; + margin-top: 4px; } .sectionBody { - margin-bottom: 30px; + margin-bottom: 30px; +} + +.sectionHeaderContent { } .sectionFooter { - font-size: 14px; - color: var(--grey); - display: flex; - flex-direction: row-reverse; - align-items: flex-start; + font-size: 14px; + color: var(--grey); + display: flex; + flex-direction: row-reverse; + align-items: flex-start; } .sectionFooterPrimaryContent { - margin-left: auto; + margin-left: auto; } .sectionFooterSecondaryContent { - margin-right: auto; - align-self: center; + margin-right: auto; + align-self: center; } @media only screen and (max-width: 599px) { - .sectionFooter { - flex-wrap: wrap; - } + .sectionFooter { + flex-wrap: wrap; + } - .sectionFooterPrimaryContent { - width: 100%; - margin-bottom: 32px; - } + .sectionFooterPrimaryContent { + width: 100%; + margin-bottom: 32px; + } - .sectionFooterPrimaryContent > button { - width: 100%; - } + .sectionFooterPrimaryContent > button { + width: 100%; + } - .sectionFooterSecondaryContent { - text-align: center; - flex: 0 0 100%; - } -} \ No newline at end of file + .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 index 7ca8882d778..365eb8d8359 100644 --- a/packages/amplify-ui/src/Section.css.d.ts +++ b/packages/amplify-ui/src/Section.css.d.ts @@ -4,6 +4,7 @@ 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/aws-amplify-react/__mocks__/styleMock.js b/packages/aws-amplify-react/__mocks__/styleMock.ts similarity index 100% rename from packages/aws-amplify-react/__mocks__/styleMock.js rename to packages/aws-amplify-react/__mocks__/styleMock.ts diff --git a/packages/aws-amplify-react/__tests__/Amplify-UI/Amplify-UI-Components-React-test.js b/packages/aws-amplify-react/__tests__/Amplify-UI/Amplify-UI-Components-React-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Amplify-UI/Amplify-UI-Components-React-test.js rename to packages/aws-amplify-react/__tests__/Amplify-UI/Amplify-UI-Components-React-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Amplify-UI/__snapshots__/Amplify-UI-Components-React-test.js.snap b/packages/aws-amplify-react/__tests__/Amplify-UI/__snapshots__/Amplify-UI-Components-React-test.tsx.snap similarity index 97% rename from packages/aws-amplify-react/__tests__/Amplify-UI/__snapshots__/Amplify-UI-Components-React-test.js.snap rename to packages/aws-amplify-react/__tests__/Amplify-UI/__snapshots__/Amplify-UI-Components-React-test.tsx.snap index 9e1ac84deac..0436fbad90b 100644 --- a/packages/aws-amplify-react/__tests__/Amplify-UI/__snapshots__/Amplify-UI-Components-React-test.js.snap +++ b/packages/aws-amplify-react/__tests__/Amplify-UI/__snapshots__/Amplify-UI-Components-React-test.tsx.snap @@ -102,6 +102,7 @@ exports[`AmplifyUi test render SectionHeader correctly 1`] = ` exports[`AmplifyUi test render SectionHeaderContent correctly 1`] = ` `; diff --git a/packages/aws-amplify-react/__tests__/AmplifyMessageMap-test.js b/packages/aws-amplify-react/__tests__/AmplifyMessageMap-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/AmplifyMessageMap-test.js rename to packages/aws-amplify-react/__tests__/AmplifyMessageMap-test.tsx diff --git a/packages/aws-amplify-react/__tests__/AmplifyUI-test.js b/packages/aws-amplify-react/__tests__/AmplifyUI-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/AmplifyUI-test.js rename to packages/aws-amplify-react/__tests__/AmplifyUI-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Analytics/__snapshots__/trackLifecycle-test.js.snap b/packages/aws-amplify-react/__tests__/Analytics/__snapshots__/trackLifecycle-test.tsx.snap similarity index 100% rename from packages/aws-amplify-react/__tests__/Analytics/__snapshots__/trackLifecycle-test.js.snap rename to packages/aws-amplify-react/__tests__/Analytics/__snapshots__/trackLifecycle-test.tsx.snap diff --git a/packages/aws-amplify-react/__tests__/Analytics/trackLifecycle-test.js b/packages/aws-amplify-react/__tests__/Analytics/trackLifecycle-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Analytics/trackLifecycle-test.js rename to packages/aws-amplify-react/__tests__/Analytics/trackLifecycle-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/AuthPiece-test.js b/packages/aws-amplify-react/__tests__/Auth/AuthPiece-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/AuthPiece-test.js rename to packages/aws-amplify-react/__tests__/Auth/AuthPiece-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/Authenticator-test.js b/packages/aws-amplify-react/__tests__/Auth/Authenticator-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/Authenticator-test.js rename to packages/aws-amplify-react/__tests__/Auth/Authenticator-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/ConfirmSignIn-test.js b/packages/aws-amplify-react/__tests__/Auth/ConfirmSignIn-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/ConfirmSignIn-test.js rename to packages/aws-amplify-react/__tests__/Auth/ConfirmSignIn-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/ConfirmSignUp-test.js b/packages/aws-amplify-react/__tests__/Auth/ConfirmSignUp-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/ConfirmSignUp-test.js rename to packages/aws-amplify-react/__tests__/Auth/ConfirmSignUp-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/FederatedSignIn-test.js b/packages/aws-amplify-react/__tests__/Auth/FederatedSignIn-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/FederatedSignIn-test.js rename to packages/aws-amplify-react/__tests__/Auth/FederatedSignIn-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/ForgotPassword-test.js b/packages/aws-amplify-react/__tests__/Auth/ForgotPassword-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/ForgotPassword-test.js rename to packages/aws-amplify-react/__tests__/Auth/ForgotPassword-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/Greetings-test.js b/packages/aws-amplify-react/__tests__/Auth/Greetings-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/Greetings-test.js rename to packages/aws-amplify-react/__tests__/Auth/Greetings-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/PhoneField-test.js b/packages/aws-amplify-react/__tests__/Auth/PhoneField-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/PhoneField-test.js rename to packages/aws-amplify-react/__tests__/Auth/PhoneField-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/index-test.js.snap b/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/index-test.tsx.snap similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/index-test.js.snap rename to packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/index-test.tsx.snap diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withAmazon-test.js.snap b/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withAmazon-test.tsx.snap similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withAmazon-test.js.snap rename to packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withAmazon-test.tsx.snap diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withAuth0-test.js.snap b/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withAuth0-test.tsx.snap similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withAuth0-test.js.snap rename to packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withAuth0-test.tsx.snap diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withFacebook-test.js.snap b/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withFacebook-test.tsx.snap similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withFacebook-test.js.snap rename to packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withFacebook-test.tsx.snap diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withGoogle-test.js.snap b/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withGoogle-test.tsx.snap similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withGoogle-test.js.snap rename to packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withGoogle-test.tsx.snap diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withOAuth-test.js.snap b/packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withOAuth-test.tsx.snap similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withOAuth-test.js.snap rename to packages/aws-amplify-react/__tests__/Auth/Provider/__snapshots__/withOAuth-test.tsx.snap diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/index-test.js b/packages/aws-amplify-react/__tests__/Auth/Provider/index-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/Provider/index-test.js rename to packages/aws-amplify-react/__tests__/Auth/Provider/index-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/withAmazon-test.js b/packages/aws-amplify-react/__tests__/Auth/Provider/withAmazon-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/Provider/withAmazon-test.js rename to packages/aws-amplify-react/__tests__/Auth/Provider/withAmazon-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/withAuth0-test.js b/packages/aws-amplify-react/__tests__/Auth/Provider/withAuth0-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/Provider/withAuth0-test.js rename to packages/aws-amplify-react/__tests__/Auth/Provider/withAuth0-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/withFacebook-test.js b/packages/aws-amplify-react/__tests__/Auth/Provider/withFacebook-test.tsx similarity index 100% rename from packages/aws-amplify-react/__tests__/Auth/Provider/withFacebook-test.js rename to packages/aws-amplify-react/__tests__/Auth/Provider/withFacebook-test.tsx diff --git a/packages/aws-amplify-react/__tests__/Auth/Provider/withGoogle-test.js b/packages/aws-amplify-react/__tests__/Auth/Provider/withGoogle-test.js deleted file mode 100644 index 39079a9d640..00000000000 --- a/packages/aws-amplify-react/__tests__/Auth/Provider/withGoogle-test.js +++ /dev/null @@ -1,486 +0,0 @@ -import Auth from '@aws-amplify/auth'; -import * as React from 'react'; -import { Component } from 'react'; -import withGoogle, { - GoogleButton -} from '../../../src/Auth/Provider/withGoogle'; -import { SignInButton, Button } from '../../../src/AmplifyUI'; - -describe('withGoogle test', () => { - describe('render test', () => { - test('render correctly', () => { - window.gapi = null; - const MockComp = class extends Component { - render() { - return
; - } - }; - const Comp = withGoogle(MockComp); - const wrapper = shallow({text}diff --git a/packages/aws-amplify-react/src/Storage/index.js b/packages/aws-amplify-react/src/Storage/index.tsx similarity index 100% rename from packages/aws-amplify-react/src/Storage/index.js rename to packages/aws-amplify-react/src/Storage/index.tsx diff --git a/packages/aws-amplify-react/src/Widget/PhotoPicker.js b/packages/aws-amplify-react/src/Widget/PhotoPicker.tsx similarity index 87% rename from packages/aws-amplify-react/src/Widget/PhotoPicker.js rename to packages/aws-amplify-react/src/Widget/PhotoPicker.tsx index b4c07dfc5e9..266d2f0e84f 100644 --- a/packages/aws-amplify-react/src/Widget/PhotoPicker.js +++ b/packages/aws-amplify-react/src/Widget/PhotoPicker.tsx @@ -30,7 +30,25 @@ const PickerPreview = { const logger = new Logger('PhotoPicker'); -export default class PhotoPicker extends Component { +export interface IPhotoPickerProps { + headerHint?: string; + headerText?: string; + onLoad?: (dataUrl: any) => void; + onPick?: (data: any) => void; + preview?: 'hidden'; + previewSrc?: string; + title?: string; + theme?: any; +} + +export interface IPhotoPickerState { + previewSrc?: string; +} + +export default class PhotoPicker extends Component< + IPhotoPickerProps, + IPhotoPickerState +> { constructor(props) { super(props); diff --git a/packages/aws-amplify-react/src/Widget/Picker.js b/packages/aws-amplify-react/src/Widget/Picker.tsx similarity index 91% rename from packages/aws-amplify-react/src/Widget/Picker.js rename to packages/aws-amplify-react/src/Widget/Picker.tsx index 36959ad8bfd..4aeba32639d 100644 --- a/packages/aws-amplify-react/src/Widget/Picker.js +++ b/packages/aws-amplify-react/src/Widget/Picker.tsx @@ -31,7 +31,14 @@ const PickerInput = { const logger = new Logger('Picker'); -export default class Picker extends Component { +export interface IPickerProps { + accept?: string; + onPick?: (data: any) => void; + title?: string; + theme?: any; +} + +export default class Picker extends Component