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

typography 디자인 토큰 스토리 작성 #23

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

YuHyun-P
Copy link
Member

closed #19

✅ 작업 내용

  • typography 디자인 토큰 스토리 작성
  • typography.$semantic 상수 타입화

📌 이슈 사항

  • 없습니다

✍ 궁금한 점

  • 코멘트로 남기겠습니다!

@YuHyun-P YuHyun-P self-assigned this Jan 27, 2024
Copy link

github-actions bot commented Jan 27, 2024

Chromatic Report

See Our Preivew ⚪️🔳🔲

import typography from "./typography";

const meta: Meta<typeof Text> = {
title: "Design Tokens/Typography",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- Components
  - Button
- Design Tokens
  - Typography

디자인 토큰 / 컴포넌트 그룹으로 나누면 좋을 거 같아서 우선 디자인 토큰만 폴더로 나눠봤습니다. 괜찮나요?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아우 너무 좋아요 ㅎㅎ


import typography from "./typography";

const meta: Meta<typeof Text> = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typography는 컴포넌트가 아니라서 docs가 없어도 괜찮을 거 같은데 어떻게 생각하시나요!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저는 개인적으로 통일성때문에 있었으면 좋겠어요...😊
className에 적용해서 사용하면 된다는 간단한 설명 있으면 좋지 않을까요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋습니다!! 반영했습니다 7bf8eba

Comment on lines +12 to +20
// radio label을 mm-semantic-typography-h1에서 h1로 변경
labels: Object.fromEntries(
Object.entries(typography.$semantic).map(([key, value]) => [
value,
key,
]),
),
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

labels이 없으면 아래처럼 options 값으로 보이는데 "mm-sementic-typography" 는 없어도 괜찮을 거 같아서 변경해봤습니다! (다시 보니 라벨 없을 때도 괜찮은 거 같네요🤔)

라벨 없을 때 라벨 있을 때
image image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ㅎㅎ 둘 다 좋아요! 보편적으로는 오른쪽이 보기 편한 것 같아요! 굿굿👍🏻

@YuHyun-P YuHyun-P added the test 테스트 코드 추가 label Feb 20, 2024

import typography from "./typography";

const meta: Meta<typeof Text> = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋습니다!! 반영했습니다 7bf8eba

Comment on lines +58 to +64
export interface TextProps<Key extends TypographySementicKey> {
/** className에 typography 토큰을 설정해 적용할 수 있습니다. */
className: (typeof typography.$semantic)[Key];
children: string;
}

export function Text<Key extends TypographySementicKey>({
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TextProps, Text는 스토리에서만 사용되는데 외부로 export 하는 이유는 스토리북 autodocs 때문입니다. autodocs 기능은 내부적으로 react-docgen-typescript를 사용하는데 props랑 컴포넌트를 named export 해야 적용된다네요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test 테스트 코드 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

typography 디자인 토큰 스토리 작성
2 participants