-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
68 deletions.
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
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,35 +1,29 @@ | ||
import { RoundedType, SizeType, VariantsType } from "../types"; | ||
import { SizeType, VariantsType } from "../types"; | ||
|
||
export const VARIANTS = { | ||
PRIMARY: "primary", | ||
ERROR: "error", | ||
BORDER: "border", | ||
WARNING: "warning", | ||
SUCCESS: "success", | ||
SECONDARY: "secondary", | ||
} as const; | ||
|
||
export const SIZE = { | ||
SIZE_44: "h-44", | ||
SIZE_40: "h-40", | ||
SIZE_29: "h-29", | ||
} as const; | ||
|
||
export const ROUNDED = { | ||
ROUNDED_12: "rounded-12", | ||
ROUNDED_8: "rounded-8", | ||
SMALL: "small", | ||
MEDIUM: "medium", | ||
LARGE: "large", | ||
} as const; | ||
|
||
export const LABEL_VARIANTS: Record<VariantsType, string> = { | ||
[VARIANTS.PRIMARY]: "bg-primary-00 text-primary-03", | ||
[VARIANTS.ERROR]: "bg-[#ff526033] text-error", | ||
[VARIANTS.BORDER]: "bg-transparent text-primary-03 border border-primary-01", | ||
[VARIANTS.ERROR]: "bg-rose-100 text-rose-500", | ||
[VARIANTS.WARNING]: "bg-amber-100 text-amber-500", | ||
[VARIANTS.SUCCESS]: "bg-green-100 text-green-500", | ||
[VARIANTS.SECONDARY]: "bg-gray-02 text-gray-06", | ||
}; | ||
|
||
export const LABEL_SIZE: Record<SizeType, string> = { | ||
[SIZE.SIZE_44]: "h-11 py-2.5", | ||
[SIZE.SIZE_40]: "h-10 py-2", | ||
[SIZE.SIZE_29]: "h-[1.8125rem] py-1", | ||
}; | ||
|
||
export const LABEL_ROUNDED: Record<RoundedType, string> = { | ||
[ROUNDED.ROUNDED_12]: "rounded-xl", | ||
[ROUNDED.ROUNDED_8]: "rounded-lg", | ||
[SIZE.SMALL]: "text-body-03-regular px-1.5 py-0.5 rounded-md", | ||
[SIZE.MEDIUM]: "text-body-02-regular px-2 py-1 rounded-md", | ||
[SIZE.LARGE]: "text-body-01-regular px-2 py-1 rounded-lg", | ||
}; |
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 |
---|---|---|
@@ -1,20 +1,14 @@ | ||
import { ThemeTypography } from "@/types"; | ||
import { HTMLAttributes } from "react"; | ||
|
||
import { ROUNDED, SIZE, VARIANTS } from "../constants"; | ||
import { SIZE, VARIANTS } from "../constants"; | ||
|
||
export type VariantsType = typeof VARIANTS[keyof typeof VARIANTS]; | ||
|
||
export type SizeType = typeof SIZE[keyof typeof SIZE]; | ||
|
||
export type RoundedType = typeof ROUNDED[keyof typeof ROUNDED]; | ||
|
||
export type ThemeType = Extract<ThemeTypography, "body-01-bold" | "body-02-bold">; | ||
|
||
export interface LabelProps extends HTMLAttributes<HTMLDivElement>{ | ||
variants: VariantsType | ||
height: SizeType | ||
theme?: ThemeType | ||
rounded: RoundedType | ||
size: SizeType | ||
label: string | ||
icon?: React.ReactNode | ||
} |