init create-react-library@3.1.1

This commit is contained in:
Chantha
2020-10-16 10:22:02 +07:00
commit bbd7655e83
29 changed files with 23289 additions and 0 deletions

5
src/.eslintrc Normal file
View File

@@ -0,0 +1,5 @@
{
"env": {
"jest": true
}
}

7
src/index.test.tsx Normal file
View File

@@ -0,0 +1,7 @@
import { ExampleComponent } from '.'
describe('ExampleComponent', () => {
it('is truthy', () => {
expect(ExampleComponent).toBeTruthy()
})
})

10
src/index.tsx Normal file
View File

@@ -0,0 +1,10 @@
import * as React from 'react'
import styles from './styles.module.css'
interface Props {
text: string
}
export const ExampleComponent = ({ text }: Props) => {
return <div className={styles.test}>Example Component: {text}</div>
}

9
src/styles.module.css Normal file
View File

@@ -0,0 +1,9 @@
/* add css module styles here (optional) */
.test {
margin: 2em;
padding: 0.5em;
border: 2px solid #000;
font-size: 2em;
text-align: center;
}

17
src/typings.d.ts vendored Normal file
View File

@@ -0,0 +1,17 @@
/**
* Default CSS definition for typescript,
* will be overridden with file-specific definitions by rollup
*/
declare module '*.css' {
const content: { [className: string]: string };
export default content;
}
interface SvgrComponent extends React.StatelessComponent<React.SVGAttributes<SVGElement>> {}
declare module '*.svg' {
const svgUrl: string;
const svgComponent: SvgrComponent;
export default svgUrl;
export { svgComponent as ReactComponent }
}