Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[기본 레이아웃 컴포넌트] 고니(정우시) 미션 제출합니다. #1

Merged
merged 25 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a0df9df
📦 chore: 환경 설정
jeongwusi Sep 17, 2023
447e776
✨ feat: Container 컴포넌트 구현
jeongwusi Sep 17, 2023
9556497
✨ feat: Flex 컴포넌트 구현
jeongwusi Sep 17, 2023
e0d9845
✨ feat: Grid 컴포넌트 구현
jeongwusi Sep 17, 2023
5534e89
📝 docs: 사용자를 위한 README.md 작성
jeongwusi Sep 17, 2023
2f889a6
📝 docs: 라이센스 부분의 문단 구조 수정
jeongwusi Sep 17, 2023
18465e4
📦 chore: 버전 수정
jeongwusi Sep 17, 2023
e4bfee4
📦 chore: 불필요한 의존성 제거
jeongwusi Sep 17, 2023
6c4eb54
📦 chore: .npmignore 파일에 `.github/` 추가
jeongwusi Sep 17, 2023
59e40e3
📦 chore: .gitignore 파일에 /dist 추가와 tsconfig.json 설정 수정
jeongwusi Sep 17, 2023
4ea5d3e
📦 chore: 라이브러리 버전 0.0.5로 수정
jeongwusi Sep 17, 2023
be50657
📦 chore: .npmignore 파일 수정
jeongwusi Sep 17, 2023
b8d2d93
♻️ refactor: 파일 구조 수정
jeongwusi Sep 17, 2023
34b7220
📦 chore: 라이브러리 버전 수정
jeongwusi Sep 17, 2023
8a7ac63
📝 docs: Grid 컴포넌트와 Flex 컴포넌트의 Props 관련 내용 수정
jeongwusi Sep 17, 2023
c0f2d92
♻️ refactor: gap 속성을 선택적 Props로 수정
jeongwusi Sep 17, 2023
848427a
📦 chore: index.ts의 불필요한 주석 제거와 라이브러리 버전 수정
jeongwusi Sep 17, 2023
8551728
📦 chore: 스토리북 환경 설정
jeongwusi Sep 18, 2023
cedbab7
♻️ refactor: Container 컴포넌트 수정 (관련 내용 상세에 첨부)
jeongwusi Sep 18, 2023
f769cc3
♻️ refactor: Flex 컴포넌트 수정 (관련 내용 상세에 첨부)
jeongwusi Sep 18, 2023
39426ff
♻️ refactor: Grid 컴포넌트 수정 (관련 내용 상세에 첨부)
jeongwusi Sep 18, 2023
de06499
✨ feat: 공통으로 사용하는 Unit 타입 추가
jeongwusi Sep 18, 2023
57efa4f
✨ feat: 각 컴포넌트에 맞는 스토리북 코드 작성
jeongwusi Sep 18, 2023
430cce3
🎨 style: 불필요한 코드 삭제
jeongwusi Sep 19, 2023
1b0d358
📝 docs: README.md 수정
jeongwusi Sep 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build
/dist

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
src/
public/
tsconfig.json
.github/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [2023] [Kim Goni]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
122 changes: 116 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,116 @@
<p align="middle" >
<img width="100px;" src="https://em-content.zobj.net/source/skype/289/straight-ruler_1f4cf.png"/>
</p>
<h2 align="middle">누구나 사용할 수 있는 레이아웃 컴포넌트</h2>
<p align="middle">재사용 가능한 레이아웃 컴포넌트 제작과 배포</p>
<br/>
# **React Layout Component**

이 라이브러리는 React를 사용하여 다양한 레이아웃을 쉽게 구현할 수 있는 컴포넌트를 제공합니다. 라이브러리는 TypeScript로 작성되었으며, 각 컴포넌트는 화면 레이아웃을 만들 때 도움이 됩니다.

## **설치**

먼저 npm을 사용하여 패키지를 설치합니다:

```bash
npm install goni-layout-component
```

## **Container 컴포넌트**

**Container** 컴포넌트는 화면의 폭에 따라 내용의 최대 폭을 제한하고 중앙에 배치하는 레이아웃을 구현합니다.

### **Props**

- **`minWidth`** (number): 최소 폭을 지정합니다.
- **`maxWidth`** (number): 최대 폭을 지정합니다.

### **사용 예제**

```jsx
import React from "react";
import { Container } from "goni-layout-component";

const App = () => {
return (
<Container minWidth={600} maxWidth={960}>
<div>Content</div>
</Container>
);
};

export default App;
```

## **Grid 컴포넌트**

**Grid** 컴포넌트는 CSS Grid를 사용하여 자식 컴포넌트들을 격자 형태로 배열하는 레이아웃을 구현합니다.

### **Props**

**필수**

- **`rows`** (number): 격자의 행 수를 지정합니다.
- **`columns`** (number): 격자의 열 수를 지정합니다.

**선택 (기본값 0)**

- **`gap`** (number): 자식 컴포넌트 간의 간격을 조절합니다.

### **사용 예제**

```jsx
import React from "react";
import { Grid } from "goni-layout-component";

const App = () => {
return (
<Grid rows={3} columns={3} gap={10}>
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
</Grid>
);
};

export default App;
```

## **Flex 컴포넌트**

**Flex** 컴포넌트는 CSS Flexbox를 사용하여 자식 컴포넌트들을 유연하게 배열하는 레이아웃을 구현합니다.

### **Props**

**필수**

- **`direction`** ('row' | 'column'): 배열 방향을 지정합니다.
- **`justify`** ('flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around'): 주 축 정렬을 지정합니다.
- **`align`** ('flex-start' | 'flex-end' | 'center' | 'stretch'): 교차 축 정렬을 지정합니다.

**선택 (기본값 0)**

- **`gap`** (number): 자식 컴포넌트 간의 간격을 조절합니다.

### **사용 예제**

```jsx
import React from "react";
import { Flex } from "goni-layout-component";

const App = () => {
return (
<Flex direction="row" justify="center" align="center" gap={5}>
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
</Flex>
);
};

export default App;
```

## **기여**

이 프로젝트에 기여하려면 GitHub 저장소를 방문하십시오: **[GitHub 저장소 링크](https://github.com/jeongwusi/layout-component)**

## **라이센스**

이 프로젝트는 MIT 라이센스 하에 릴리스되었습니다.

자세한 정보는 LICENSE 파일을 참조하십시오: **[LICENSE 파일](https://raw.githubusercontent.com/jeongwusi/layout-component/main/LICENSE)**
Loading