-
Notifications
You must be signed in to change notification settings - Fork 2
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
0 parents
commit 8df2ca0
Showing
15 changed files
with
9,561 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_size = 2 |
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,38 @@ | ||
name: github-pages | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
deploy: | ||
name: github-pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Cache dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- run: npm ci --no-optional | ||
- name: Build pages | ||
run: npm run build-pages | ||
env: | ||
GITHUB_PAGES: true | ||
- name: Export pages | ||
run: npm run export-pages | ||
- name: Build API docs | ||
run: npm run build-docs | ||
- name: Deploy pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/out |
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,32 @@ | ||
name: npm-publish | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
jobs: | ||
npm-publish: | ||
name: npm-publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
registry-url: https://registry.npmjs.org/ | ||
scope: "@arch-inc" | ||
- name: Cache dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- run: npm ci | ||
- name: Build package | ||
run: npm run build | ||
- name: Publish package | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |
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 @@ | ||
node_modules/ | ||
dist/ | ||
.next/ | ||
out/ |
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,3 @@ | ||
{ | ||
"editor.formatOnSave": true | ||
} |
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 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/types/global" /> |
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,7 @@ | ||
const basePath = process.env.GITHUB_PAGES ? "/react-color-modal" : ""; | ||
module.exports = { | ||
experimental: { | ||
basePath | ||
}, | ||
env: { BASE_PATH: basePath } | ||
} |
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,137 @@ | ||
import { useMemo, useRef, useEffect } from "react"; | ||
import { NextPage } from "next"; | ||
import Head from "next/head"; | ||
import { | ||
Container, | ||
Message, | ||
Divider, | ||
List, | ||
Icon, | ||
Header, | ||
} from "semantic-ui-react"; | ||
|
||
const basePath = process.env.BASE_PATH.replace(/\/$/, ""); | ||
const packageName = "react-color-modal"; | ||
const description = "Yet another color picker component for React"; | ||
|
||
const Index: NextPage = () => { | ||
return ( | ||
<> | ||
<Head> | ||
<title key="title"> | ||
{packageName} | {description} | ||
</title> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css" | ||
></link> | ||
</Head> | ||
<style jsx>{` | ||
:global(html, body) { | ||
background: #eee; | ||
} | ||
div.hero { | ||
padding: 3em 0; | ||
} | ||
div.main.content { | ||
background: #fff; | ||
padding: 2em 0 0 0; | ||
} | ||
div.demo-wrapper { | ||
background: #f5f5f5; | ||
margin: 2em auto 0 auto; | ||
padding: 2em 0; | ||
} | ||
footer { | ||
padding: 2em 0; | ||
} | ||
`}</style> | ||
<div className="hero"> | ||
<Container> | ||
<Header as="h1" content={packageName} subheader={description} /> | ||
</Container> | ||
</div> | ||
<div className="main content"> | ||
<Container> | ||
<Message | ||
header="How to install" | ||
content={ | ||
<> | ||
<pre>npm i @arch-inc/{packageName}</pre> | ||
<p> | ||
For more details on how to use this library, please refer to | ||
the following documents. | ||
</p> | ||
</> | ||
} | ||
/> | ||
<div className="ui selection divided list"> | ||
<a | ||
className="item" | ||
href={`https://www.npmjs.com/package/@arch-inc/${packageName}`} | ||
> | ||
<i className="npm icon"></i> | ||
<div className="content"> | ||
<div className="header">NPM package registry</div> | ||
<div className="description">@arch-inc/{packageName}</div> | ||
</div> | ||
</a> | ||
<a | ||
className="item" | ||
href={`https://github.com/arch-inc/${packageName}`} | ||
> | ||
<i className="github icon"></i> | ||
<div className="content"> | ||
<div className="header">GitHub repository</div> | ||
<div className="description">@arch-inc/{packageName}</div> | ||
</div> | ||
</a> | ||
<a | ||
className="item" | ||
href={`https://arch-inc.github.io/${packageName}/api/globals.html`} | ||
> | ||
<i className="file alternate outline icon"></i> | ||
<div className="content"> | ||
<div className="header">API document</div> | ||
<div className="description"> | ||
automatically generated with TypeDoc | ||
</div> | ||
</div> | ||
</a> | ||
</div> | ||
</Container> | ||
<div className="demo-wrapper"> | ||
<Container> | ||
<Header as="h3" content="Live demo" /> | ||
<p>...</p> | ||
<Divider /> | ||
<p>...</p> | ||
</Container> | ||
</div> | ||
</div> | ||
<footer> | ||
<Container> | ||
<List horizontal divided> | ||
<List.Item | ||
content={ | ||
<> | ||
© <a href="//research.archinc.jp">Arch Inc.</a> 2020 | ||
</> | ||
} | ||
/> | ||
<List.Item | ||
content={ | ||
<a href={`https://github.com/arch-inc/${packageName}`}> | ||
<Icon name="github" /> arch-inc/{packageName} | ||
</a> | ||
} | ||
/> | ||
</List> | ||
</Container> | ||
</footer> | ||
</> | ||
); | ||
}; | ||
|
||
export default Index; |
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,26 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": [ | ||
"dom", | ||
"dom.iterable", | ||
"esnext" | ||
], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"strict": false, | ||
"forceConsistentCasingInFileNames": true, | ||
"noEmit": true, | ||
"esModuleInterop": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve" | ||
}, | ||
"include": [ | ||
"./next-env.d.ts", | ||
"**/*.ts", | ||
"**/*.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,3 @@ | ||
export function hello() { | ||
console.log("hello world!"); | ||
} |
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 * from "./hello"; |
Oops, something went wrong.