Skip to content

Commit 4746911

Browse files
author
sw-yx
committed
fix dist
1 parent 807e68c commit 4746911

10 files changed

+5866
-2
lines changed

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.log
2+
.DS_Store
3+
node_modules
4+
.rts2_cache_cjs
5+
.rts2_cache_es
6+
.rts2_cache_umd
7+
dist
8+
node_modules

.size-snapshot.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"/Users/swyx/Netlify/react-netlify-identity-widget/dist/reactNetlifyIdentityWidget.cjs.development.js": {
3+
"bundled": 1146,
4+
"minified": 831,
5+
"gzipped": 428
6+
},
7+
"/Users/swyx/Netlify/react-netlify-identity-widget/dist/reactNetlifyIdentityWidget.cjs.production.js": {
8+
"bundled": 1146,
9+
"minified": 831,
10+
"gzipped": 428
11+
},
12+
"/Users/swyx/Netlify/react-netlify-identity-widget/dist/reactNetlifyIdentityWidget.umd.development.js": {
13+
"bundled": 1604,
14+
"minified": 988,
15+
"gzipped": 520
16+
},
17+
"/Users/swyx/Netlify/react-netlify-identity-widget/dist/reactNetlifyIdentityWidget.umd.production.js": {
18+
"bundled": 1604,
19+
"minified": 988,
20+
"gzipped": 520
21+
},
22+
"/Users/swyx/Netlify/react-netlify-identity-widget/dist/reactNetlifyIdentityWidget.es.production.js": {
23+
"bundled": 979,
24+
"minified": 703,
25+
"gzipped": 364,
26+
"treeshaked": {
27+
"rollup": {
28+
"code": 67,
29+
"import_statements": 67
30+
},
31+
"webpack": {
32+
"code": 1117
33+
}
34+
}
35+
}
36+
}

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# TSDX Bootstrap
2+
3+
This project was bootstrapped with [TSDX](https://github.com/jaredpalmer/tsdx).

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "react-netlify-identity-widget",
33
"version": "0.0.1",
44
"main": "dist/index.js",
5-
"umd:main": "dist/react-netlify-identity-widget.umd.production.js",
6-
"module": "dist/react-netlify-identity-widget.es.production.js",
5+
"umd:main": "dist/reactNetlifyIdentityWidget.umd.production.js",
6+
"module": "dist/reactNetlifyIdentityWidget.es.production.js",
77
"typings": "dist/index.d.ts",
88
"files": [
99
"dist"

src/index.tsx

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from "react"
2+
import {
3+
// Dialog,
4+
DialogOverlay,
5+
DialogContent
6+
} from "@reach/dialog"
7+
import VisuallyHidden from "@reach/visually-hidden"
8+
9+
type ModalProps = {
10+
/** pass a boolean to be true or false */
11+
showDialog: boolean
12+
/** modal will call this function to set the state of showDialog to false */
13+
onCloseDialog: () => void
14+
}
15+
export function Modal({ showDialog, onCloseDialog }: ModalProps) {
16+
return (
17+
<DialogOverlay isOpen={showDialog}>
18+
<DialogContent
19+
style={{
20+
border: "solid 5px hsla(0, 0%, 0%, 0.5)",
21+
borderRadius: "10px"
22+
}}
23+
>
24+
<p>I have a nice border now.</p>
25+
<p>
26+
Note that we could have used the simpler <code>Dialog</code> instead.
27+
</p>
28+
29+
<button className="close-button" onClick={onCloseDialog}>
30+
<VisuallyHidden>Close</VisuallyHidden>
31+
<span aria-hidden>×</span>
32+
</button>
33+
</DialogContent>
34+
</DialogOverlay>
35+
)
36+
}

test/blah.test.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { sum } from '../src';
2+
3+
describe('fuck', () => {
4+
it('works', () => {
5+
expect(sum(1, 1)).toEqual(2);
6+
});
7+
});

tsconfig.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es6",
4+
"module": "ESNext",
5+
"lib": ["dom", "esnext"],
6+
"declaration": true,
7+
"sourceMap": true,
8+
"rootDir": "./",
9+
"strict": true,
10+
"noImplicitAny": true,
11+
"strictNullChecks": true,
12+
"strictFunctionTypes": true,
13+
"strictPropertyInitialization": true,
14+
"noImplicitThis": true,
15+
"alwaysStrict": true,
16+
"noUnusedLocals": true,
17+
"noUnusedParameters": true,
18+
"noImplicitReturns": true,
19+
"noFallthroughCasesInSwitch": true,
20+
"moduleResolution": "node",
21+
"baseUrl": "./",
22+
"paths": {
23+
"*": ["src/*", "node_modules/*"]
24+
},
25+
"jsx": "react",
26+
"esModuleInterop": true
27+
},
28+
"include": ["src", "types"]
29+
}

types/reachdialog.d.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
declare module "@reach/dialog" {
2+
import React from "react"
3+
4+
export type DialogProps = {
5+
isOpen?: boolean
6+
onDismiss?: () => void
7+
children?: React.ReactNode
8+
} & React.HTMLProps<HTMLDivElement>
9+
10+
type DialogOverlayProps = {
11+
initialFocusRef?: React.RefObject<HTMLElement>
12+
} & DialogProps
13+
14+
type DialogContentProps = {
15+
children?: React.ReactNode
16+
} & React.HTMLProps<HTMLDivElement>
17+
18+
export const Dialog: React.SFC<DialogProps>
19+
export const DialogOverlay: React.SFC<DialogOverlayProps>
20+
export const DialogContent: React.SFC<DialogContentProps>
21+
}

types/reachvisuallyhidden.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare module "@reach/visually-hidden" {
2+
const VisuallyHidden: React.SFC
3+
4+
export default VisuallyHidden
5+
}

0 commit comments

Comments
 (0)