-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Handy Semantic 토큰 추가 #132
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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
Next
Next commit
feat: semantic token 구현 완료
- Loading branch information
commit c6ec757308b3f71ffa91bcfebb35143c264bd86f
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './primitiveColor'; | ||
// export * from './semanticColor'; | ||
export * from './semanticColor'; |
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,3 +1,2 @@ | ||
export type * from './primitiveColor.type'; | ||
export { primitiveColorPalette } from './primitiveColorPalette'; | ||
export type { PrimitiveColorPalette } from './primitiveColorPalette'; |
38 changes: 21 additions & 17 deletions
38
src/style/foundation/color/primitiveColor/primitiveColor.type.ts
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,31 @@ | ||
// https://www.figma.com/design/gvwhMF6iNkuYKzxipKzkaG/Handy-v1-(demo)?node-id=636-131805&t=Wr7H8VzVaJXsyDQT-1 | ||
|
||
type PrimitiveVariousColor<ColorName extends string> = | ||
| `${ColorName}050` | ||
| `${ColorName}100` | ||
| `${ColorName}200` | ||
| `${ColorName}300` | ||
| `${ColorName}400` | ||
| `${ColorName}500` | ||
| `${ColorName}600` | ||
| `${ColorName}700` | ||
| `${ColorName}800` | ||
| `${ColorName}900` | ||
| `${ColorName}950`; | ||
import { MergeVariants } from '@/types/variant'; | ||
|
||
export type PrimitiveVioletColor = PrimitiveVariousColor<'violet'>; | ||
export type PrimitiveGrayColor = PrimitiveVariousColor<'gray'>; | ||
type PrimitiveColorSaturationVariant = | ||
| '050' | ||
| '100' | ||
| '200' | ||
| '300' | ||
| '400' | ||
| '500' | ||
| '600' | ||
| '700' | ||
| '800' | ||
| '900' | ||
| '950'; | ||
|
||
export type PrimitiveNeutralColor = 'neutralBlack' | 'neutralWhite' | 'neutralTransparent'; | ||
export type PrimitiveVioletColor = MergeVariants<'violet', PrimitiveColorSaturationVariant>; | ||
export type PrimitiveGrayColor = MergeVariants<'gray', PrimitiveColorSaturationVariant>; | ||
|
||
export type PrimitiveStatusColor = 'statusRedMain' | 'statusRedSub'; | ||
export type PrimitiveNeutralColor = MergeVariants<'neutral', 'black' | 'white' | 'transparent'>; | ||
|
||
export type PrimitiveColor = | ||
export type PrimitiveStatusColor = MergeVariants<'status', 'red', 'main' | 'sub'>; | ||
|
||
export type PrimitiveColorType = | ||
| PrimitiveVioletColor | ||
| PrimitiveGrayColor | ||
| PrimitiveNeutralColor | ||
| PrimitiveStatusColor; | ||
|
||
export type PrimitiveColorPalette = Readonly<Record<PrimitiveColorType, string>>; |
4 changes: 1 addition & 3 deletions
4
src/style/foundation/color/primitiveColor/primitiveColorPalette.ts
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export type * from './semanticColor.type'; | ||
export { semanticColorPalette } from './semanticColorPalette'; |
121 changes: 121 additions & 0 deletions
121
src/style/foundation/color/semanticColor/semanticColor.type.ts
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,121 @@ | ||
import { MergeVariants } from '@/types/variant'; | ||
|
||
type StaticBasicVariant = 'primary' | 'secondary' | 'tertiary' | 'disabled' | 'white'; | ||
type StaticBrandVariant = 'primary' | 'secondary'; | ||
type StatusVariant = 'negative' | 'positive'; | ||
type InteractiveVariant = 'enabled' | 'pressed' | 'disabled'; | ||
type SelectableVariant = 'selected' | 'unselected'; | ||
type SelectableVariantWithDisabled = SelectableVariant | 'disabled'; | ||
|
||
export type SemanticBackgroundBasicColor = MergeVariants< | ||
'bg', | ||
'basic', | ||
'default' | 'light' | 'strong' | 'black' | ||
>; | ||
|
||
export type SemanticBackgroundBrandColor = MergeVariants<'bg', 'brand', StaticBrandVariant>; | ||
|
||
export type SemanticBackgroundStatusColor = MergeVariants<'bg', 'status', StatusVariant>; | ||
|
||
export type SemanticTextBasicColor = MergeVariants<'text', 'basic', StaticBasicVariant>; | ||
|
||
export type SemanticTextBrandColor = MergeVariants<'text', 'brand', StaticBrandVariant>; | ||
|
||
export type SemanticTextStatusColor = MergeVariants<'text', 'status', StatusVariant>; | ||
|
||
export type SemanticLineBasicColor = MergeVariants<'line', 'basic', 'light' | 'medium' | 'strong'>; | ||
|
||
export type SemanticLineStatusColor = MergeVariants<'line', 'status', StatusVariant>; | ||
|
||
export type SemanticButtonBoxPrimaryColor = MergeVariants< | ||
'button', | ||
'box', | ||
'primary', | ||
InteractiveVariant | ||
>; | ||
|
||
export type SemanticButtonBoxSecondaryColor = MergeVariants< | ||
'button', | ||
'box', | ||
'secondary', | ||
InteractiveVariant | ||
>; | ||
|
||
export type SemanticButtonBoxTertiaryColor = MergeVariants< | ||
'button', | ||
'box', | ||
'tertiary', | ||
InteractiveVariant | ||
>; | ||
|
||
export type SemanticButtonFabPrimaryColor = MergeVariants< | ||
'button', | ||
'fab', | ||
'primary', | ||
InteractiveVariant | ||
>; | ||
|
||
export type SemanticButtonFabSecondaryColor = MergeVariants< | ||
'button', | ||
'fab', | ||
'secondary', | ||
InteractiveVariant | ||
>; | ||
|
||
export type SemanticButtonTextPrimaryColor = MergeVariants< | ||
'button', | ||
'text', | ||
'primary', | ||
InteractiveVariant | ||
>; | ||
|
||
export type SemanticButtonTextSecondaryColor = MergeVariants< | ||
'button', | ||
'text', | ||
'secondary', | ||
InteractiveVariant | ||
>; | ||
|
||
export type SemanticButtonRadioColor = MergeVariants< | ||
'button', | ||
'radio', | ||
SelectableVariantWithDisabled | ||
>; | ||
|
||
export type SemanticIconBasicColor = MergeVariants<'icon', 'basic', StaticBasicVariant>; | ||
|
||
export type SemanticIconBrandColor = MergeVariants<'icon', 'brand', StaticBrandVariant>; | ||
|
||
export type SemanticCheckboxColor = MergeVariants<'checkbox', SelectableVariantWithDisabled>; | ||
|
||
export type SemanticChipColor = MergeVariants<'chip', SelectableVariantWithDisabled>; | ||
|
||
export type SemanticPaginationBrandColor = MergeVariants<'pagination', 'brand', 'pressed'>; | ||
|
||
export type SemanticPaginationBasicColor = MergeVariants<'pagination', 'basic', SelectableVariant>; | ||
|
||
export type SemanticColorType = | ||
| SemanticBackgroundBasicColor | ||
| SemanticBackgroundBrandColor | ||
| SemanticBackgroundStatusColor | ||
| SemanticTextBasicColor | ||
| SemanticTextBrandColor | ||
| SemanticTextStatusColor | ||
| SemanticLineBasicColor | ||
| SemanticLineStatusColor | ||
| SemanticButtonBoxPrimaryColor | ||
| SemanticButtonBoxSecondaryColor | ||
| SemanticButtonBoxTertiaryColor | ||
| SemanticButtonFabPrimaryColor | ||
| SemanticButtonFabSecondaryColor | ||
| SemanticButtonTextPrimaryColor | ||
| SemanticButtonTextSecondaryColor | ||
| SemanticButtonRadioColor | ||
| SemanticIconBasicColor | ||
| SemanticIconBrandColor | ||
| SemanticCheckboxColor | ||
| SemanticChipColor | ||
| SemanticPaginationBrandColor | ||
| SemanticPaginationBasicColor; | ||
|
||
export type SemanticColorPalette = Readonly<Record<SemanticColorType, string>>; |
88 changes: 88 additions & 0 deletions
88
src/style/foundation/color/semanticColor/semanticColorPalette.ts
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,88 @@ | ||
import { primitiveColorPalette } from '@/style/foundation/color/primitiveColor'; | ||
import { SemanticColorPalette } from '@/style/foundation/color/semanticColor/semanticColor.type'; | ||
|
||
export const semanticColorPalette: SemanticColorPalette = { | ||
bgBasicDefault: primitiveColorPalette.neutralWhite, | ||
bgBasicLight: primitiveColorPalette.gray050, | ||
bgBasicStrong: primitiveColorPalette.gray100, | ||
bgBasicBlack: primitiveColorPalette.neutralBlack, | ||
|
||
bgBrandPrimary: primitiveColorPalette.violet500, | ||
bgBrandSecondary: primitiveColorPalette.violet050, | ||
|
||
bgStatusNegative: primitiveColorPalette.statusRedMain, | ||
bgStatusPositive: primitiveColorPalette.violet500, | ||
|
||
textBasicPrimary: primitiveColorPalette.neutralBlack, | ||
textBasicSecondary: primitiveColorPalette.gray700, | ||
textBasicTertiary: primitiveColorPalette.gray500, | ||
textBasicDisabled: primitiveColorPalette.gray300, | ||
textBasicWhite: primitiveColorPalette.neutralWhite, | ||
|
||
textBrandPrimary: primitiveColorPalette.violet500, | ||
textBrandSecondary: primitiveColorPalette.violet600, | ||
|
||
textStatusNegative: primitiveColorPalette.statusRedMain, | ||
textStatusPositive: primitiveColorPalette.violet500, | ||
|
||
lineBasicLight: primitiveColorPalette.gray100, | ||
lineBasicMedium: primitiveColorPalette.gray200, | ||
lineBasicStrong: primitiveColorPalette.gray300, | ||
|
||
lineStatusNegative: primitiveColorPalette.statusRedMain, | ||
lineStatusPositive: primitiveColorPalette.violet500, | ||
|
||
buttonBoxPrimaryEnabled: primitiveColorPalette.violet500, | ||
buttonBoxPrimaryPressed: primitiveColorPalette.violet700, | ||
buttonBoxPrimaryDisabled: primitiveColorPalette.gray100, | ||
|
||
buttonBoxSecondaryEnabled: primitiveColorPalette.violet050, | ||
buttonBoxSecondaryPressed: primitiveColorPalette.violet200, | ||
buttonBoxSecondaryDisabled: primitiveColorPalette.gray100, | ||
|
||
buttonBoxTertiaryEnabled: primitiveColorPalette.neutralTransparent, | ||
buttonBoxTertiaryPressed: primitiveColorPalette.gray100, | ||
buttonBoxTertiaryDisabled: primitiveColorPalette.neutralTransparent, | ||
|
||
buttonTextPrimaryEnabled: primitiveColorPalette.neutralTransparent, | ||
buttonTextPrimaryPressed: primitiveColorPalette.violet050, | ||
buttonTextPrimaryDisabled: primitiveColorPalette.neutralTransparent, | ||
|
||
buttonFabPrimaryEnabled: primitiveColorPalette.violet500, | ||
buttonFabPrimaryPressed: primitiveColorPalette.violet700, | ||
buttonFabPrimaryDisabled: primitiveColorPalette.gray100, | ||
|
||
buttonRadioSelected: primitiveColorPalette.violet500, | ||
buttonRadioUnselected: primitiveColorPalette.gray200, | ||
buttonRadioDisabled: primitiveColorPalette.neutralWhite, | ||
|
||
buttonTextSecondaryEnabled: primitiveColorPalette.neutralTransparent, | ||
buttonTextSecondaryPressed: primitiveColorPalette.gray100, | ||
buttonTextSecondaryDisabled: primitiveColorPalette.neutralTransparent, | ||
|
||
buttonFabSecondaryEnabled: primitiveColorPalette.neutralWhite, | ||
buttonFabSecondaryPressed: primitiveColorPalette.gray100, | ||
buttonFabSecondaryDisabled: primitiveColorPalette.neutralWhite, | ||
|
||
iconBasicPrimary: primitiveColorPalette.neutralBlack, | ||
iconBasicSecondary: primitiveColorPalette.gray700, | ||
iconBasicTertiary: primitiveColorPalette.gray500, | ||
iconBasicDisabled: primitiveColorPalette.gray200, | ||
iconBasicWhite: primitiveColorPalette.neutralWhite, | ||
|
||
iconBrandPrimary: primitiveColorPalette.violet500, | ||
iconBrandSecondary: primitiveColorPalette.violet600, | ||
|
||
checkboxSelected: primitiveColorPalette.violet500, | ||
checkboxUnselected: primitiveColorPalette.neutralWhite, | ||
checkboxDisabled: primitiveColorPalette.gray200, | ||
|
||
chipSelected: primitiveColorPalette.violet100, | ||
chipUnselected: primitiveColorPalette.gray100, | ||
chipDisabled: primitiveColorPalette.gray050, | ||
|
||
paginationBrandPressed: primitiveColorPalette.violet050, | ||
|
||
paginationBasicSelected: primitiveColorPalette.neutralBlack, | ||
paginationBasicUnselected: primitiveColorPalette.gray500, | ||
} as const; |
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,2 +1,2 @@ | ||
export * from './spacing'; | ||
export * from './spacing.type'; | ||
export * from './primitiveSpacing'; | ||
export * from './semanticSpacing'; |
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 @@ | ||
export type * from './primitiveSpacing.type'; | ||
export { primitiveSpacing } from './primitiveSpacing'; |
11 changes: 11 additions & 0 deletions
11
src/style/foundation/spacing/primitiveSpacing/primitiveSpacing.ts
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,11 @@ | ||
import { PrimitiveSpacing } from '@/style/foundation/spacing/primitiveSpacing/primitiveSpacing.type'; | ||
|
||
const primitiveSpacing: PrimitiveSpacing = { | ||
'8': 8, | ||
'10': 10, | ||
'12': 12, | ||
'14': 14, | ||
'16': 16, | ||
} as const; | ||
|
||
export { primitiveSpacing }; |
5 changes: 5 additions & 0 deletions
5
src/style/foundation/spacing/primitiveSpacing/primitiveSpacing.type.ts
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,5 @@ | ||
type PrimitiveSpacingType = '8' | '10' | '12' | '14' | '16'; | ||
|
||
type PrimitiveSpacing = Readonly<Record<PrimitiveSpacingType, number>>; | ||
|
||
export type { PrimitiveSpacingType, PrimitiveSpacing }; |
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 @@ | ||
export * from './semanticSpacing.type'; | ||
export { semanticSpacing } from './semanticSpacing'; |
12 changes: 12 additions & 0 deletions
12
src/style/foundation/spacing/semanticSpacing/semanticSpacing.ts
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 굿 같이 수정하겠습니다 |
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,12 @@ | ||
import { primitiveSpacing } from '@/style/foundation/spacing/primitiveSpacing'; | ||
import { SemanticSpacing } from '@/style/foundation/spacing/semanticSpacing/semanticSpacing.type'; | ||
|
||
const semanticSpacing: SemanticSpacing = { | ||
spacingRadiusXS: primitiveSpacing[8], | ||
spacingRadiusS: primitiveSpacing[10], | ||
spacingRadiusM: primitiveSpacing[12], | ||
spacingRadiusL: primitiveSpacing[14], | ||
spacingRadiusXL: primitiveSpacing[16], | ||
} as const; | ||
|
||
export { semanticSpacing }; |
11 changes: 11 additions & 0 deletions
11
src/style/foundation/spacing/semanticSpacing/semanticSpacing.type.ts
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,11 @@ | ||
import { MergeVariants } from '@/types/variant'; | ||
|
||
export type SemanticSpacingRadius = MergeVariants< | ||
'spacing', | ||
'radius', | ||
'XS' | 's' | 'm' | 'l' | 'XL' | ||
>; | ||
|
||
export type SemanticSpacingType = SemanticSpacingRadius; | ||
|
||
export type SemanticSpacing = Readonly<Record<SemanticSpacingType, number>>; |
This file was deleted.
Oops, something went wrong.
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.
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.
채널 확인을 늦게 했는데
Spcing(Radius)
로 되어있던 이름이Number
로 바뀌었네요.....🤔저는 지금처럼
Spacing
들어간 게 의도를 드러내기 좋다고 생각하는데피그마 이름과 달라지는 부분이라 조심스럽네용
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.
저는 약간 바뀐게 좋다고 생각하는게
padding
,margin
만 쓰이는거면spacing
이 맥락상 맞아보이는데그 값들과 연계되는
border-radius
까지 설정되어 버리니까spacing
보다는number
또는sizing
이 더 좋아보이긴하네요