This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from calmery-chan/feature/storybook
Storybook を導入する
- Loading branch information
Showing
11 changed files
with
4,712 additions
and
214 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,26 @@ | ||
name: Build Storybook | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
node-version: [14.15.0] | ||
os: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: yarn run build-storybook --no-dll | ||
- run: | | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
- run: gh-pages -d storybook-static |
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 |
---|---|---|
|
@@ -32,3 +32,6 @@ yarn-error.log* | |
|
||
# vercel | ||
.vercel | ||
|
||
# storybook | ||
storybook-static/ |
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,12 @@ | ||
module.exports = { | ||
addons: ["@storybook/addon-essentials", "@storybook/addon-links"], | ||
stories: ["../src/**/*.stories.tsx"], | ||
webpackFinal(config) { | ||
config.module.rules.push({ | ||
test: /\.scss$/, | ||
use: ["style-loader", "css-loader", "postcss-loader", "sass-loader"], | ||
}); | ||
|
||
return config; | ||
}, | ||
}; |
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,5 @@ | ||
import "../src/styles/globals.scss"; | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
}; |
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
Empty file.
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,8 @@ | ||
import React from "react"; | ||
import { Example as ExampleComponent } from "./Example"; | ||
|
||
export default { | ||
title: "Example", | ||
}; | ||
|
||
export const Example = () => <ExampleComponent />; |
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,101 @@ | ||
import React from "react"; | ||
|
||
export const Example: React.FC = () => { | ||
return ( | ||
<div className="bg-gray-200"> | ||
<div className="flex flex-col items-center justify-center h-screen"> | ||
<div className="flex flex-col"> | ||
<label className="inline-flex items-center mt-3"> | ||
<input | ||
type="checkbox" | ||
className="form-checkbox h-5 w-5 text-gray-600" | ||
checked | ||
/> | ||
<span className="ml-2 text-gray-700">label</span> | ||
</label> | ||
|
||
<label className="inline-flex items-center mt-3"> | ||
<input | ||
type="checkbox" | ||
className="form-checkbox h-5 w-5 text-red-600" | ||
checked | ||
/> | ||
<span className="ml-2 text-gray-700">label</span> | ||
</label> | ||
|
||
<label className="inline-flex items-center mt-3"> | ||
<input | ||
type="checkbox" | ||
className="form-checkbox h-5 w-5 text-orange-600" | ||
checked | ||
/> | ||
<span className="ml-2 text-gray-700">label</span> | ||
</label> | ||
|
||
<label className="inline-flex items-center mt-3"> | ||
<input | ||
type="checkbox" | ||
className="form-checkbox h-5 w-5 text-yellow-600" | ||
checked | ||
/> | ||
<span className="ml-2 text-gray-700">label</span> | ||
</label> | ||
|
||
<label className="inline-flex items-center mt-3"> | ||
<input | ||
type="checkbox" | ||
className="form-checkbox h-5 w-5 text-green-600" | ||
checked | ||
/> | ||
<span className="ml-2 text-gray-700">label</span> | ||
</label> | ||
|
||
<label className="inline-flex items-center mt-3"> | ||
<input | ||
type="checkbox" | ||
className="form-checkbox h-5 w-5 text-teal-600" | ||
checked | ||
/> | ||
<span className="ml-2 text-gray-700">label</span> | ||
</label> | ||
|
||
<label className="inline-flex items-center mt-3"> | ||
<input | ||
type="checkbox" | ||
className="form-checkbox h-5 w-5 text-blue-600" | ||
checked | ||
/> | ||
<span className="ml-2 text-gray-700">label</span> | ||
</label> | ||
|
||
<label className="inline-flex items-center mt-3"> | ||
<input | ||
type="checkbox" | ||
className="form-checkbox h-5 w-5 text-indigo-600" | ||
checked | ||
/> | ||
<span className="ml-2 text-gray-700">label</span> | ||
</label> | ||
|
||
<label className="inline-flex items-center mt-3"> | ||
<input | ||
type="checkbox" | ||
className="form-checkbox h-5 w-5 text-purple-600" | ||
checked | ||
/> | ||
<span className="ml-2 text-gray-700">label</span> | ||
</label> | ||
|
||
<label className="inline-flex items-center mt-3"> | ||
<input | ||
type="checkbox" | ||
className="form-checkbox h-5 w-5 text-pink-600" | ||
checked | ||
/> | ||
<span className="ml-2 text-gray-700">label</span> | ||
</label> | ||
</div> | ||
</div> | ||
</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 |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import React from "react"; | ||
import { Example } from "~/components/Example"; | ||
import { useI18n } from "~/utils/i18n"; | ||
|
||
const Dummy = () => { | ||
const { t } = useI18n(); | ||
|
||
return <p>{t("message")}</p>; | ||
return ( | ||
<> | ||
<p>{t("message")}</p> | ||
<Example /> | ||
</> | ||
); | ||
}; | ||
|
||
export default Dummy; |
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 |
---|---|---|
|
@@ -8,5 +8,5 @@ module.exports = { | |
extend: {}, | ||
}, | ||
variants: {}, | ||
plugins: [], | ||
plugins: [require("@tailwindcss/custom-forms")], | ||
}; |
Oops, something went wrong.