-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds fast-development-site for testing component libraries (#7)
* feat: adds fast-development-site for testing component libraries * updates the locations of interfaces for the development site * updates tslint rules in development site because they already extend react rules * updates exports to be future proof for development site and add a null check
- Loading branch information
1 parent
e70acfd
commit 53ce962
Showing
23 changed files
with
12,053 additions
and
288 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -57,3 +57,5 @@ typings/ | |
# dotenv environment variables file | ||
.env | ||
|
||
# Ignore distribution directory | ||
dist/ |
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 @@ | ||
# FAST development site | ||
This is the development site which can be used to create a react environment for a group of react or web components. |
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,63 @@ | ||
import * as React from "react"; | ||
import * as ReactDOM from "react-dom"; | ||
import Site, { ISiteProps, ICategoryProps } from "../src"; | ||
|
||
import Button from "./components/button"; | ||
import Paragraph from "./components/paragraph"; | ||
import PolymerHeading from "./components/polymer-heading"; | ||
|
||
const items: ICategoryProps[] = [ | ||
{ | ||
name: "components", | ||
items: [ | ||
{ | ||
name: "button", | ||
component: Button, | ||
data: [ | ||
{ | ||
children: "foo" | ||
}, | ||
{ | ||
children: "bar" | ||
}, | ||
{ | ||
children: "bat" | ||
} | ||
] | ||
}, | ||
{ | ||
name: "paragraph", | ||
component: Paragraph, | ||
data: [{}, {}, {}, {}] | ||
}, | ||
{ | ||
name: "polymer-heading", | ||
component: PolymerHeading, | ||
type: "polymer", | ||
data: [ | ||
{ | ||
class: "foo", | ||
children: "Heading 1" | ||
}, | ||
{ | ||
class: "bar", | ||
children: "Heading 2" | ||
}, | ||
{ | ||
class: "bat", | ||
children: "Heading 3" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
]; | ||
|
||
const render: any = (): void => { | ||
ReactDOM.render( | ||
<Site categories={items} />, | ||
document.getElementById("root") | ||
); | ||
}; | ||
|
||
render(); |
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,14 @@ | ||
import * as React from "react"; | ||
|
||
class Button extends React.Component<{}, {}> { | ||
|
||
public render(): JSX.Element { | ||
return ( | ||
<button> | ||
{this.props.children} | ||
</button> | ||
); | ||
} | ||
} | ||
|
||
export default Button; |
14 changes: 14 additions & 0 deletions
14
packages/fast-development-site/app/components/paragraph.tsx
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,14 @@ | ||
import * as React from "react"; | ||
|
||
class Paragraph extends React.Component<{}, {}> { | ||
|
||
public render(): JSX.Element { | ||
return ( | ||
<p> | ||
paragraph | ||
</p> | ||
); | ||
} | ||
} | ||
|
||
export default Paragraph; |
31 changes: 31 additions & 0 deletions
31
packages/fast-development-site/app/components/polymer-heading.ts
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 @@ | ||
import { | ||
Element as PolymerElement | ||
} from "../../node_modules/@polymer/polymer/polymer-element.js"; | ||
|
||
export default class PolymerHeading extends PolymerElement { | ||
private class: string; | ||
|
||
constructor() { | ||
super(); | ||
|
||
this.class = ""; | ||
} | ||
|
||
static get is(): string { | ||
return "polymer-heading"; | ||
} | ||
|
||
static get template(): string { | ||
const style: string = `<style></style>`; | ||
const element: string = `<h2 class="[[class]]"><slot></slot></h2>`; | ||
return style + element; | ||
} | ||
|
||
static get properties(): any { | ||
return { | ||
class: String | ||
}; | ||
} | ||
} | ||
|
||
customElements.define(PolymerHeading.is, PolymerHeading); |
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,11 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<title>FAST development app</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
Oops, something went wrong.