-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: JDS Hero/Title/Label 컴포넌트 제거 #441
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
Open
ccconac
wants to merge
17
commits into
dev
Choose a base branch
from
refactor/hero
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f30a1e8
feat(jds): 텍스트 스타일 토큰 생성 방식 개선
ccconac 5b04ff0
docs(typography): 텍스트 스타일 유틸 가이드 추가
ccconac d9d77a4
refactor(hero): Hero 컴포넌트 제거
ccconac 32de6f7
refactor(title): Title 컴포넌트 제거
ccconac 849f341
refactor(label): Label 컴포넌트 제거
ccconac f4b22c6
chore(tokens): token build로 인한 생성 시간 수정점 반영
ccconac 7c01712
chore(package): tailwind-merge 설치
ccconac c6248b0
feat(cn): 스타일 클래스 병합을 위한 유틸리티 함수 구현
ccconac 7dcbc25
refactor(typography): Hero, Title, Label 로컬 컴포넌트로 교체
ccconac 5240637
refactor: JDS 타이포그래피 유틸로 내부 컴포넌트 전환
ccconac 290e17b
docs: 토큰 사용 가이드 갱신
ccconac 1ab38dd
fix: 컴포넌트 레이블 스타일 우선순위 이슈 방지
ccconac 7013656
fix(package): CSS 명시적으로 import 하도록 보장
ccconac c1a92a6
fix: typography textAlign에 실제 text-align 적용
ccconac 1763b14
refactor: 사용되지 않는 typography token maps 제거
ccconac 9590017
fix(typography): 사용되지 않는 prop(color) 제거
ccconac 712e592
Merge branch 'dev' into refactor/hero
ccconac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,50 @@ | ||
| import type { HTMLAttributes, ReactNode } from "react"; | ||
|
|
||
| import { cn } from "@/utils/cn"; | ||
|
|
||
| type HeroSize = "lg" | "md" | "sm" | "xs"; | ||
| type HeroAlign = "center" | "left" | "right"; | ||
|
|
||
| interface HeroProps extends Omit<HTMLAttributes<HTMLDivElement>, "style"> { | ||
| size?: HeroSize; | ||
| textAlign?: HeroAlign; | ||
| children: ReactNode; | ||
| } | ||
|
|
||
| const sizeClassName: Record<HeroSize, string> = { | ||
| lg: "semantic-textStyle-title-4", | ||
| md: "semantic-textStyle-title-3", | ||
| sm: "semantic-textStyle-title-2", | ||
| xs: "semantic-textStyle-title-1", | ||
| }; | ||
|
|
||
| const alignClassName: Record<HeroAlign, string> = { | ||
| center: "justify-center text-center", | ||
| left: "justify-start text-left", | ||
| right: "justify-end text-right", | ||
| }; | ||
|
|
||
| function Hero({ | ||
| size = "lg", | ||
| textAlign = "center", | ||
| className, | ||
| children, | ||
| ...props | ||
| }: HeroProps) { | ||
| return ( | ||
| <div | ||
| className={cn( | ||
| "flex cursor-default items-center", | ||
| sizeClassName[size], | ||
| alignClassName[textAlign], | ||
| "text-(--semantic-object-boldest)", | ||
| className, | ||
| )} | ||
| {...props} | ||
| > | ||
| {children} | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default Hero; | ||
This file contains hidden or 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,78 @@ | ||
| import type { ElementType, HTMLAttributes, ReactNode } from "react"; | ||
|
|
||
| import { cn } from "@/utils/cn"; | ||
|
|
||
| type LabelSize = "lg" | "md" | "sm" | "xs"; | ||
| type LabelAlign = "center" | "left" | "right"; | ||
| type LabelWeight = "bold" | "normal" | "subtle"; | ||
| type LabelCursor = "pointer" | "default"; | ||
|
|
||
| interface LabelProps extends Omit<HTMLAttributes<HTMLElement>, "style"> { | ||
| as?: ElementType; | ||
| size?: LabelSize; | ||
| textAlign?: LabelAlign; | ||
| weight?: LabelWeight; | ||
| cursor?: LabelCursor; | ||
| htmlFor?: string; | ||
| children: ReactNode; | ||
| } | ||
|
|
||
| const sizeWeightClassName: Record<LabelSize, Record<LabelWeight, string>> = { | ||
| lg: { | ||
| bold: "semantic-textStyle-label-lg-bold", | ||
| normal: "semantic-textStyle-label-lg-normal", | ||
| subtle: "semantic-textStyle-label-lg-subtle", | ||
| }, | ||
| md: { | ||
| bold: "semantic-textStyle-label-md-bold", | ||
| normal: "semantic-textStyle-label-md-normal", | ||
| subtle: "semantic-textStyle-label-md-subtle", | ||
| }, | ||
| sm: { | ||
| bold: "semantic-textStyle-label-sm-bold", | ||
| normal: "semantic-textStyle-label-sm-normal", | ||
| subtle: "semantic-textStyle-label-sm-subtle", | ||
| }, | ||
| xs: { | ||
| bold: "semantic-textStyle-label-xs-bold", | ||
| normal: "semantic-textStyle-label-xs-normal", | ||
| subtle: "semantic-textStyle-label-xs-subtle", | ||
| }, | ||
| }; | ||
|
|
||
| const alignClassName: Record<LabelAlign, string> = { | ||
| center: "justify-center text-center", | ||
| left: "justify-start text-left", | ||
| right: "justify-end text-right", | ||
| }; | ||
|
|
||
| function Label({ | ||
| as, | ||
| size = "md", | ||
| textAlign = "left", | ||
| weight = "normal", | ||
| cursor = "default", | ||
| className, | ||
| children, | ||
| ...props | ||
| }: LabelProps) { | ||
| const Component = as ?? "label"; | ||
|
|
||
| return ( | ||
| <Component | ||
| className={cn( | ||
| "flex items-center", | ||
| sizeWeightClassName[size][weight], | ||
| alignClassName[textAlign], | ||
| cursor === "pointer" ? "cursor-pointer" : "cursor-default", | ||
| "text-(--semantic-object-bold)", | ||
| className, | ||
| )} | ||
| {...props} | ||
| > | ||
| {children} | ||
| </Component> | ||
| ); | ||
| } | ||
|
|
||
| export default Label; |
This file contains hidden or 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,50 @@ | ||
| import type { HTMLAttributes, ReactNode } from "react"; | ||
|
|
||
| import { cn } from "@/utils/cn"; | ||
|
|
||
| type TitleSize = "lg" | "md" | "sm" | "xs"; | ||
| type TitleTextAlign = "center" | "left" | "right"; | ||
|
|
||
| interface TitleProps extends Omit<HTMLAttributes<HTMLDivElement>, "style"> { | ||
| size?: TitleSize; | ||
| textAlign?: TitleTextAlign; | ||
| children: ReactNode; | ||
| } | ||
|
|
||
| const sizeClassName: Record<TitleSize, string> = { | ||
| lg: "semantic-textStyle-title-4", | ||
| md: "semantic-textStyle-title-3", | ||
| sm: "semantic-textStyle-title-2", | ||
| xs: "semantic-textStyle-title-1", | ||
| }; | ||
|
|
||
| const alignClassName: Record<TitleTextAlign, string> = { | ||
| center: "justify-center text-center", | ||
| left: "justify-start text-left", | ||
| right: "justify-end text-right", | ||
| }; | ||
|
|
||
| function Title({ | ||
| size = "md", | ||
| textAlign = "left", | ||
| className, | ||
| children, | ||
| ...props | ||
| }: TitleProps) { | ||
| return ( | ||
| <div | ||
| className={cn( | ||
| "flex cursor-default items-center", | ||
| sizeClassName[size], | ||
| alignClassName[textAlign], | ||
| "text-(--semantic-object-bolder)", | ||
| className, | ||
| )} | ||
| {...props} | ||
| > | ||
| {children} | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default Title; |
This file contains hidden or 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,3 @@ | ||
| export { default as Hero } from "./Hero"; | ||
| export { default as Label } from "./Label"; | ||
| export { default as Title } from "./Title"; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Title, Hero, Label 모두
textAlign이 현재 flex 정렬만 설정하고 실제 CSS text-align을 설정하지 않는데 의도된 동작인지 궁금합니다Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
레이아웃만 생각해서 생긴 단순 누락입니다. 😅 반영해 두었습니다. c1a92a6