-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
126 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { Foo } from './components/Foo'; | ||
export { Bar } from './components/Bar'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type React from 'react'; | ||
import { parent } from './styles'; | ||
|
||
type Props = { | ||
color: 'red' | 'blue'; | ||
children: React.ReactNode; | ||
}; | ||
|
||
export const Bar: React.FC<Props> = ({ color = 'black', children }) => ( | ||
<div style={{ color }}> | ||
Bar{children ? <div style={parent}>{children}</div> : null} | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type React from 'react'; | ||
import { parent } from './styles'; | ||
|
||
type Props = { | ||
color: 'red' | 'blue'; | ||
children: React.ReactNode; | ||
}; | ||
|
||
export const Foo: React.FC<Props> = ({ color = 'black', children }) => ( | ||
<div style={{ color }}> | ||
Foo{children ? <div style={parent}>{children}</div> : null} | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const parent = { | ||
border: '4px solid currentColor', | ||
padding: '10px 10px 10px 15px', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = { | ||
components: './components.ts', | ||
snippets: './snippets.ts', | ||
outputPath: './dist', | ||
openBrowser: false, | ||
storageKey: 'playroom-example-typescript', | ||
webpackConfig: () => ({ | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
exclude: /node_modules/, | ||
use: [ | ||
{ | ||
loader: require.resolve('babel-loader'), | ||
options: { | ||
presets: [ | ||
require.resolve('@babel/preset-env'), | ||
[ | ||
require.resolve('@babel/preset-react'), | ||
{ runtime: 'automatic' }, | ||
], | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export default [ | ||
{ | ||
group: 'Foo', | ||
name: 'Default', | ||
code: '<Foo>Foo</Foo>', | ||
}, | ||
{ | ||
group: 'Foo', | ||
name: 'Red', | ||
code: '<Foo color="red">Red Foo</Foo>', | ||
}, | ||
{ | ||
group: 'Bar', | ||
name: 'Default', | ||
code: '<Bar>Bar</Bar>', | ||
}, | ||
{ | ||
group: 'Bar', | ||
name: 'Blue', | ||
code: '<Bar color="blue">Blue Bar</Bar>', | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"skipLibCheck": true, | ||
"moduleResolution": "node", | ||
"module": "es2022", | ||
"allowImportingTsExtensions": true, | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"isolatedModules": true, | ||
"resolveJsonModule": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"jsx": "react-jsx", | ||
"lib": ["dom", "es2022"], | ||
"target": "es2022" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters