-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#53) NPM Publish
- Loading branch information
Showing
29 changed files
with
637 additions
and
230 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,2 @@ | ||
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 |
---|---|---|
@@ -1,48 +1,46 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true, | ||
"jest": true | ||
}, | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@stylistic", | ||
"react" | ||
], | ||
"rules": { | ||
"@stylistic/jsx-indent": ["error", 2], | ||
"@stylistic/quotes": ["error", "double"], | ||
"@stylistic/object-curly-spacing": ["error", "always"], | ||
"@stylistic/comma-dangle": ["error", "always-multiline"], | ||
"@stylistic/eol-last": ["error", "always"], | ||
"@stylistic/no-trailing-spaces": "error", | ||
// "@stylistic/no-var": "error", | ||
"@stylistic/no-multi-spaces": "error", | ||
"@stylistic/comma-spacing": ["error", { "before": false, "after": true }], | ||
"@stylistic/key-spacing": ["error", { "afterColon": true, "beforeColon": false }], | ||
"@stylistic/semi": ["error", "always"], | ||
"@stylistic/space-in-parens": ["error", "never"], | ||
// "@stylistic/curly": "error", | ||
"@stylistic/arrow-spacing": "error", | ||
"@stylistic/no-extra-semi": "error", | ||
"@stylistic/array-bracket-spacing": ["error","always",{"singleValue": false}], | ||
"@stylistic/comma-style": ["error","last"], | ||
"@stylistic/array-element-newline" : ["error","consistent"], | ||
"@stylistic/arrow-parens": ["error", "as-needed"], | ||
"@stylistic/block-spacing": "error", | ||
"@stylistic/brace-style": "error", | ||
"@stylistic/jsx-equals-spacing": [2, "always"], | ||
"@stylistic/function-call-argument-newline": ["error", "consistent"], | ||
"@stylistic/no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1 }], | ||
"react/jsx-first-prop-new-line": ["error", "multiline"], | ||
"@typescript-eslint/no-inferrable-types": "off" | ||
} | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true, | ||
"jest": true | ||
}, | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@stylistic", | ||
"react" | ||
], | ||
"rules": { | ||
"@stylistic/jsx-indent": ["error", 2], | ||
"@stylistic/quotes": ["error", "double"], | ||
"@stylistic/object-curly-spacing": ["error", "always"], | ||
"@stylistic/comma-dangle": ["error", "always-multiline"], | ||
"@stylistic/eol-last": ["error", "always"], | ||
"@stylistic/no-trailing-spaces": "error", | ||
"@stylistic/no-multi-spaces": "error", | ||
"@stylistic/comma-spacing": ["error", { "before": false, "after": true }], | ||
"@stylistic/key-spacing": ["error", { "afterColon": true, "beforeColon": false }], | ||
"@stylistic/semi": ["error", "always"], | ||
"@stylistic/space-in-parens": ["error", "never"], | ||
"@stylistic/arrow-spacing": "error", | ||
"@stylistic/no-extra-semi": "error", | ||
"@stylistic/array-bracket-spacing": ["error","always",{"singleValue": false}], | ||
"@stylistic/comma-style": ["error","last"], | ||
"@stylistic/array-element-newline" : ["error","consistent"], | ||
"@stylistic/arrow-parens": ["error", "as-needed"], | ||
"@stylistic/block-spacing": "error", | ||
"@stylistic/brace-style": "error", | ||
"@stylistic/jsx-equals-spacing": [2, "always"], | ||
"@stylistic/function-call-argument-newline": ["error", "consistent"], | ||
"@stylistic/no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1 }], | ||
"react/jsx-first-prop-new-line": ["error", "multiline"], | ||
"@typescript-eslint/no-inferrable-types": "off" | ||
} | ||
} |
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 and Publish Storybook to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- "chore/publish" | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16.x" | ||
- uses: bitovi/[email protected] | ||
with: | ||
install_command: yarn install | ||
build_command: yarn storybook:build | ||
path: storybook-static | ||
checkout: false |
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 |
---|---|---|
|
@@ -22,3 +22,4 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
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
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 |
---|---|---|
@@ -1,27 +1,95 @@ | ||
# React + TypeScript + Vite | ||
# bbodek-ui | ||
|
||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
## 📦 Installation | ||
|
||
Currently, two official plugins are available: | ||
```bash | ||
# With npm | ||
npm install bbodek-ui | ||
|
||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh | ||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh | ||
# With yarn | ||
yarn add bbodek-ui | ||
``` | ||
|
||
## ⚙️ Setup | ||
Edit your `tailwind.config.ts` file: | ||
```ts | ||
// @ts-ignore | ||
import BbodekConfig from "bbodek-ui/tailwind.config.js"; | ||
import type { Config } from 'tailwindcss'; | ||
|
||
## Expanding the ESLint configuration | ||
const config: Config = { | ||
...BbodekConfig, | ||
content: [ | ||
...BbodekConfig.content, | ||
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}', | ||
'./src/components/**/*.{js,ts,jsx,tsx,mdx}', | ||
'./src/app/**/*.{js,ts,jsx,tsx,mdx}', | ||
], | ||
} | ||
export default config | ||
``` | ||
Edit your `_app.tsx` file: | ||
```tsx | ||
import "bbodek-ui/bbodek-theme.css"; // add bbodek-theme.css | ||
import type { AppProps } from 'next/app'; | ||
|
||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: | ||
export default function App({ Component, pageProps }: AppProps) { | ||
return <Component {...pageProps} /> | ||
} | ||
``` | ||
|
||
- Configure the top-level `parserOptions` property like this: | ||
## 🔗 Peer Dependencies | ||
bbodek-ui is designed to work alongside specific versions of certain peer dependencies. Ensure that your project has the following peer dependencies installed: | ||
```json | ||
"peerDependencies": { | ||
"@types/react": "18.2.0", | ||
"@types/react-dom": "18.2.0", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"tailwindcss": "3.3.5" | ||
} | ||
``` | ||
|
||
```js | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: ['./tsconfig.json', './tsconfig.node.json'], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
### ✅ Resolving Peer Dependencies | ||
Add the following to your package.json to align your project with the required versions: | ||
```json | ||
"resolutions": { | ||
"@types/react": "18.2.0", | ||
} | ||
``` | ||
|
||
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` | ||
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` | ||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list | ||
## ✨ Usage | ||
```tsx | ||
import { Button } from "bbodek-ui"; | ||
import { useState } from "react"; | ||
|
||
export default function Home() { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
return ( | ||
<> | ||
<div id="modal"/> | ||
<ModalPopUp | ||
className="w-[30rem] h-[30rem]" | ||
isOpen={isOpen} | ||
onClose={() => setIsOpen(false)} | ||
> | ||
Open ModalPopUp | ||
</ModalPopUp> | ||
<Button | ||
className="w-[20rem]" | ||
color="white" | ||
backgroundColor="primary-03" | ||
content="버튼 테스트" | ||
size="h-48" | ||
onClick={() => setIsOpen(true)} | ||
/> | ||
<> | ||
) | ||
} | ||
|
||
``` | ||
|
||
## License | ||
|
||
bbodek-ui is made available under the MIT License. |
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 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
Oops, something went wrong.