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

v1.0.0 #35

Merged
merged 42 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f1bd82f
fix: subtitle typo font-weight 수정
nijuy Jan 31, 2024
7909e69
feat(component): TextField.type.ts 추가
nijuy Jan 31, 2024
d8a39cf
feat(component): TextField.style.ts 추가
nijuy Jan 31, 2024
25b6422
feat(component): TextField 컴포넌트 추가
nijuy Jan 31, 2024
9c3df68
feat(component): SimpleTextField.type.ts 추가
nijuy Jan 31, 2024
4e22ffe
feat(component): SimpleTextField 컴포넌트 추가
nijuy Jan 31, 2024
796b4b4
docs(component): SimpleTextField.stories.tsx 추가
nijuy Jan 31, 2024
d87ae73
fix: icons -> iconsAsset 폴더명 변경
nijuy Feb 1, 2024
a669707
Merge pull request #29 from yourssu/fix/missing-folder
nijuy Feb 1, 2024
73fb956
docs: update README.md
Hanna922 Feb 1, 2024
fa99257
docs: create issue template
Hanna922 Feb 1, 2024
561265c
docs: modify reviewer
Hanna922 Feb 1, 2024
fdcc577
Merge pull request #30 from yourssu/docs/modify-docs
Hanna922 Feb 1, 2024
384f4ed
Merge branch 'develop' of https://github.com/yourssu/YDS-React into f…
nijuy Feb 1, 2024
7787965
feat(component): TextFieldProps 타입에 width 속성 추가
nijuy Feb 1, 2024
4ef304e
feat(component): width 속성을 스타일 컴포넌트에 적용
nijuy Feb 1, 2024
23429a1
docs(component): SimpleTextField.stories 수정
nijuy Feb 1, 2024
4376998
fix(component): StyledTextFieldWrapper 오타 수정
nijuy Feb 1, 2024
4a4729a
Merge pull request #27 from yourssu/feat/textField
nijuy Feb 1, 2024
93eec5e
docs: foundation 사용법 문서 작성
nijuy Feb 4, 2024
19db1b2
docs: Icons 문서에 아이콘 이름 추가
nijuy Feb 4, 2024
36f99b8
docs: styled-component.d.ts 파일 생성 관련 내용 추가
nijuy Feb 5, 2024
d7778d8
Merge pull request #31 from yourssu/docs/foundation
nijuy Feb 5, 2024
a63131f
chore: storybook main.ts 내 docs 설정 변경
nijuy Feb 7, 2024
3113cba
chore: Badge.type JSDoc 추가
nijuy Feb 7, 2024
a86ae24
chore: Toggle.type JSDoc 추가
nijuy Feb 7, 2024
5fa8c72
docs: Toggle 문서 생성
nijuy Feb 7, 2024
829be15
chore: TextField.type JSDoc 추가
nijuy Feb 7, 2024
4c6363e
docs: SimpleTextField 문서 생성
nijuy Feb 7, 2024
19426c2
chore: Toast.type JSDoc 추가
nijuy Feb 7, 2024
ed7618f
docs: Toast 문서 생성
nijuy Feb 7, 2024
909d9d0
Merge pull request #32 from yourssu/docs/component-bori
nijuy Feb 7, 2024
67cb81f
docs: modify readme command
Hanna922 Feb 7, 2024
cc245b8
remove: remove Test, iconContext docs
Hanna922 Feb 7, 2024
a564871
docs: add BoxButton jsdocs
Hanna922 Feb 7, 2024
82e5fd1
feat: add CheckBox jsdocs
Hanna922 Feb 7, 2024
5bc507b
feat: add ListItem jsdocs
Hanna922 Feb 7, 2024
0c45848
feat: add PlainButton jsdocs
Hanna922 Feb 7, 2024
3bb7bc3
feat: modify boolean type in BoxButton
Hanna922 Feb 7, 2024
e2572d0
Merge pull request #33 from yourssu/docs/components-hanna
Hanna922 Feb 7, 2024
24762f0
chore: update version
Hanna922 Feb 7, 2024
d5234a0
Merge pull request #34 from yourssu/chore/version-up
Hanna922 Feb 7, 2024
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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @HyunsDev @nijuy @Hanna922
* @nijuy @Hanna922
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ISSUE ✅ :

## 📖 Summary

버그를 간단히 요약해주세요.

## Error Script

에러 내용 전체를 첨부해주세요.

## Photo

버그 재현 스크린샷을 첨부해주세요.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ISSUE ✅ :

## 📖 Summary

이슈를 간단히 요약해주세요.
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ dist-ssr
.yarn
storybook-static
package.tgz
icons
iconsAsset
.storybook
2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const config: StorybookConfig = {
options: {},
},
docs: {
autodocs: 'tag',
autodocs: true,
},
};
export default config;
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,39 @@ YDS는 숭실대학교 동아리 유어슈에서 사용하는 디자인 시스
YDS 문서는 노션 페이지에서 관리됩니다.
컴포넌트 정보와 사용 예시 등을 확인할 수 있습니다.

[YDS Storybook](http://yds-react-storybook.s3-website.ap-northeast-2.amazonaws.com/?path=/docs/foundation-iconcontext--docs)

## 🖌 피그마

[YDS Figma](https://www.figma.com/community/file/1146974544001355129)

## 🛠 설치 방법
## 🛠 사용 방법

1. YDS 패키지 및 styled-components를 설치합니다.

```
npm install @yourssu/design-system-react styled-components

yarn add @yourssu/design-system-react styled-components

pnpm install @yourssu/design-system-react styled-components
```

2. Root Component에 YDSWrapper를 감싸줍니다.

개발 중
```jsx
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<YDSWrapper>
<App />
</YDSWrapper>
</React.StrictMode>
);
```

## 📱 YDS를 사용해 개발한 프로덕트

개발 중
[Soomsil-Web](https://github.com/yourssu/Soomsil-Web)

## 💻 타 버전 저장소

Expand Down
10 changes: 5 additions & 5 deletions icons/convert.mjs → iconsAsset/convert.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import prettier from 'prettier';
import { DOMParser, XMLSerializer } from 'xmldom';

const __dirname = path.resolve();
const ICONS_DIR = path.join(__dirname, './icons/static');
const ICONS_DIR = path.join(__dirname, './iconsAsset/static');
const ICONS_COMPONENTS_DIR = path.join(__dirname, './src/style/foundation/icons/generated');
const ICONS_INDEX_PATH = path.join(__dirname, './src/style/foundation/icons/generated/index.ts');
const ICONS_STORIES_PATH = path.join(__dirname, './src/style/foundation/icons/icons.stories.tsx');
Expand Down Expand Up @@ -52,8 +52,8 @@ function camelizeElementAttributes(elem) {
}

const SVGComponentTemplate = (name, viewBox, svg) => `/**
* 이 파일은 icons/convert.js에 의해 자동 생성되었습니다.
* 직접 수정하는 대신 icons/convert.js를 수정하세요.
* 이 파일은 iconsAsset/convert.js에 의해 자동 생성되었습니다.
* 직접 수정하는 대신 iconsAsset/convert.js를 수정하세요.
*/

import { memo, forwardRef } from 'react';
Expand All @@ -69,8 +69,8 @@ export const ${name} = memo(forwardRef<SVGSVGElement, IconProps>((props, ref) =>
`;

const StoryTemplate = (icons) => `/**
* 이 파일은 icons/convert.js에 의해 자동 생성되었습니다.
* 직접 수정하는 대신 icons/convert.js를 수정하세요.
* 이 파일은 iconsAsset/convert.js에 의해 자동 생성되었습니다.
* 직접 수정하는 대신 iconsAsset/convert.js를 수정하세요.
*/

import { Meta, StoryObj } from '@storybook/react';
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "@yourssu/design-system-react",
"private": false,
"version": "0.1.0",
"version": "1.0.0",
"description": "Yourssu Design System for React",
"keywords": [
"yourssu",
"design system",
"react",
"design system"
"react"
],
"repository": "yourssu/YDS-React",
"license": "MIT",
Expand All @@ -29,7 +28,7 @@
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"convert-icon": "node ./icons/convert.mjs"
"convert-icon": "node ./iconsAsset/convert.mjs"
},
"peerDependencies": {
"react": "^18.2.0",
Expand Down
3 changes: 3 additions & 0 deletions src/components/Badge/Badge.type.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { SemanticBGColor } from '@/style';

export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
/** 배경 색상 */
color?: SemanticBGColor;
/** Badge 안에 들어갈 텍스트 */
children?: React.ReactNode;
/** 텍스트 왼쪽에 들어갈 아이콘 */
leftIcon?: React.ReactNode;
}
38 changes: 38 additions & 0 deletions src/components/BoxButton/BoxButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,50 @@ import { Meta, StoryObj } from '@storybook/react';
import { IcGroundLine } from '@/style';

import { BoxButton } from './BoxButton';
import { Stories, Primary as PrimaryBlock, Controls, Title } from '@storybook/blocks';

const meta: Meta<typeof BoxButton> = {
title: 'Atoms/BoxButton',
component: BoxButton,
parameters: {
layout: 'centered',
docs: {
page: () => (
<>
<Title />
<PrimaryBlock />
<Controls />
<h2> Size에 따른 속성 </h2>
<h3> extraLarge </h3>
<span>
{
'이 옵션을 선택하면 `height = 56`, `typo = button1`, `iconSize = medium(24*24)`, `horizontal Padding = 16` 으로 설정됩니다.'
}
</span>
<h3> large </h3>
<span>
{
'이 옵션을 선택하면 `height = 48`, `typo = button2`, `iconSize = medium(24*24)`, `horizontal Padding = 16` 으로 설정됩니다.'
}
</span>
<h3> medium </h3>
<span>
{
'이 옵션을 선택하면 `height = 40`, `typo = button2`, `iconSize = medium(24*24)`, `horizontal Padding = 12` 으로 설정됩니다.'
}
</span>
<h3> small </h3>
<span>
{
'이 옵션을 선택하면 `height = 32`, `typo = button4`, `iconSize = small(16*16)`, `horizontal Padding = 12` 으로 설정됩니다.'
}
</span>
<h2> 속성 우선순위 </h2>
<span>{'속성이 충돌할 때는 isDisabled > isWarned 순으로 우선됩니다.'}</span>
<Stories />
</>
),
},
},
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/BoxButton/BoxButton.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {
interface StyledBoxButtonProps {
$size: BoxButtonSize;
$variant: BoxButtonVariant;
$isWarned: BoxButtonProps['isWarned'];
$rounding: BoxButtonRounding;
$width: BoxButtonProps['width'];
$rounding?: BoxButtonRounding;
$isWarned?: BoxButtonProps['isWarned'];
$width?: BoxButtonProps['width'];
}

const getNormalStyle = ($variant: BoxButtonVariant) => {
Expand Down
15 changes: 12 additions & 3 deletions src/components/BoxButton/BoxButton.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@ export type BoxButtonRounding = 4 | 8;
export type BoxButtonVariant = 'filled' | 'tinted' | 'line';

export interface BoxButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
/** BoxButton의 크기를 결정하는 속성 */
size: BoxButtonSize;
rounding: BoxButtonRounding;
isDisabled: HTMLButtonElement['disabled'];
isWarned: boolean;
/** BoxButton의 모양을 결정하는 속성 */
variant: BoxButtonVariant;
/** BoxButton의 모서리를 결정하는 속성 */
rounding: BoxButtonRounding;
/** BoxButton의 비활성화 여부를 결정하는 속성, 비활성화 상태에는 pressed 효과가 존재하지 않습니다. */
isDisabled?: HTMLButtonElement['disabled'];
/** BoxButton의 경고 여부를 결정하는 속성 */
isWarned?: boolean;
/** BoxButton의 왼쪽에 들어갈 아이콘 */
leftIcon?: React.ReactNode;
/** BoxButton의 내용 */
children?: React.ReactNode;
/** BoxButton의 오른쪽에 들어갈 아이콘 */
rightIcon?: React.ReactNode;
/** BoxButton의 width */
width?: string | number;
}
32 changes: 32 additions & 0 deletions src/components/CheckBox/CheckBox.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
import { Meta, StoryObj } from '@storybook/react';

import { CheckBox } from './CheckBox';
import { Stories, Primary as PrimaryBlock, Controls, Title } from '@storybook/blocks';

const meta: Meta<typeof CheckBox> = {
title: 'Atoms/CheckBox',
component: CheckBox,
parameters: {
layout: 'centered',
docs: {
page: () => (
<>
<Title />
<PrimaryBlock />
<Controls />
<h2> Size에 따른 속성 </h2>
<h3> large </h3>
<span>
{
'이 옵션을 선택하면 `iconSize = medium(24*24)`, `typo = button3`, `CheckBox icon과 label 사이 여백 = 8` 으로 설정됩니다.'
}
</span>
<h3> medium </h3>
<span>
{
'이 옵션을 선택하면 `iconSize = small(20*20)`, `typo = button3`, `CheckBox icon과 label 사이 여백 = 8` 으로 설정됩니다.'
}
</span>
<h3> small </h3>
<span>
{
'이 옵션을 선택하면 `iconSize = extraSmall(16*16)`, `typo = button4`, `CheckBox icon과 label 사이 여백 = 4` 으로 설정됩니다.'
}
</span>
<h2> 속성 우선순위 </h2>
<span>{'속성이 충돌할 때는 isDisabled > isSelected 순으로 우선됩니다.'}</span>
<Stories />
</>
),
},
},
};

Expand Down
4 changes: 4 additions & 0 deletions src/components/CheckBox/CheckBox.type.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
export type CheckBoxSize = 'small' | 'medium' | 'large';

export interface CheckBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
/** CheckBox의 크기를 결정하는 속성 */
size?: CheckBoxSize;
/** CheckBox의 선택 여부를 결정하는 속성 */
isSelected?: HTMLInputElement['checked'];
/** CheckBox의 비활성화 여부를 결정하는 속성 */
isDisabled?: HTMLInputElement['disabled'];
/** CheckBox의 내용 */
children?: React.ReactNode;
}
5 changes: 5 additions & 0 deletions src/components/ListItem/ListItem.type.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
export interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {
/** ListItem의 선택 여부를 나타내는 속성 */
isPressed?: boolean;
/** ListItem의 width */
width?: string | number;
/** ListItem의 내용 */
children?: React.ReactNode;
/** ListItem의 왼쪽에 들어갈 아이콘 */
leftIcon?: React.ReactNode;
/** ListItem의 오른쪽에 들어갈 아이콘 */
rightIcon?: React.ReactNode;
}
28 changes: 28 additions & 0 deletions src/components/PlainButton/PlainButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,40 @@ import { Meta, StoryObj } from '@storybook/react';
import { IcGroundLine } from '@/style';

import { PlainButton } from './PlainButton';
import { Stories, Primary as PrimaryBlock, Controls, Title } from '@storybook/blocks';

const meta: Meta<typeof PlainButton> = {
title: 'Atoms/PlainButton',
component: PlainButton,
parameters: {
layout: 'centered',
docs: {
page: () => (
<>
<Title />
<PrimaryBlock />
<Controls />
<h2> Size에 따른 속성 </h2>
<h3> large </h3>
<span>
{
'이 옵션을 선택하면 `iconSize = medium(24*24)` 으로 설정됩니다. text는 보이지 않습니다.'
}
</span>
<h3> medium </h3>
<span>
{'이 옵션을 선택하면 `typo = button3`, `iconSize = small(20*20)` 으로 설정됩니다.'}
</span>
<h3> small </h3>
<span>
{'이 옵션을 선택하면 `typo = button4`, `iconSize = extraSmall(16*16)` 으로 설정됩니다.'}
</span>
<h2> 속성 우선순위 </h2>
<span>{'속성이 충돌할 때는 isDisabled > isWarned > isPointed 순으로 우선됩니다.'}</span>
<Stories />
</>
),
},
},
};

Expand Down
6 changes: 6 additions & 0 deletions src/components/PlainButton/PlainButton.type.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
export type PlainButtonSize = 'small' | 'medium' | 'large';

export interface PlainButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
/** PlainButton의 크기를 결정하는 속성 */
size: PlainButtonSize;
/** PlainButton의 Pointed 여부를 결정하는 속성 */
isPointed: boolean;
/** PlainButton의 경고 여부를 결정하는 속성 */
isWarned: boolean;
/** PlainButton의 왼쪽에 들어갈 아이콘 */
leftIcon?: React.ReactNode;
/** PlainButton의 내용 */
children?: React.ReactNode;
/** PlainButton의 오른쪽에 들어갈 아이콘 */
rightIcon?: React.ReactNode;
}
20 changes: 0 additions & 20 deletions src/components/Test/Test.stories.tsx

This file was deleted.

Loading
Loading