aws / amazon-chime-sdk-component-library-react

Amazon Chime React Component Library with integrations with the Amazon Chime SDK.
Apache License 2.0
268 stars 160 forks source link

Remove defining the DefaultTheme from library DTS #832

Closed xuesichao closed 2 years ago

xuesichao commented 2 years ago

Issue #829 :

After PR https://github.com/aws/amazon-chime-sdk-component-library-react/pull/589, DefaultTheme and 'styled-components' module declaration appear in the library files. This pull requests allows defining DefaultTheme type on the application level without forcing to library structure.

Ex. Current implementation doesn't allow extending theme colors on the application level.

declare module 'styled-components' {
  export interface DefaultTheme {
    colors: {
      myCustomColorForAnotherLibrary: string;
// TS Error: Subsequent property declarations must have the same type.  Property 'colors' must be of type '{ primary: ColorType; secondary: ColorType; error: ColorType; success: ColorType; info: ColorType; warning: 
    }
  }
}

Testing

  1. Have you successfully run npm run build:release locally? Yes

  2. How did you test these changes? Tested by checking running 'npm build' locally and checking 'lib' folder.

  3. If you made changes to the component library, have you provided corresponding documentation changes? NA

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

xuesichao commented 2 years ago

Close in favor of #829