diff --git a/src/App.tsx b/src/App.tsx index adfe7bc..330418d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,7 @@ import logo from "/logo.svg"; import { css } from "../styled-system/css"; import { Button } from "./components/Button"; +import { Heading } from "./components/Heading"; function App() { return ( @@ -23,9 +24,9 @@ function App() {
-

Welcome Dale UI!

+ Welcome Dale UI!
-

유용한 링크

+ 유용한 링크
-

섹션 2

+ 섹션 2
diff --git a/src/components/Heading/Heading.stories.tsx b/src/components/Heading/Heading.stories.tsx index c0d6a28..211e369 100644 --- a/src/components/Heading/Heading.stories.tsx +++ b/src/components/Heading/Heading.stories.tsx @@ -56,12 +56,10 @@ export const Contrasts: StoryObj = { render: (args) => { return (
- + 낮은 명암비 - - 높은 명암비 - + 높은 명암비
); }, @@ -69,7 +67,7 @@ export const Contrasts: StoryObj = { children: { control: false, }, - contrast: { + muted: { control: false, }, }, diff --git a/src/components/Heading/Heading.test.tsx b/src/components/Heading/Heading.test.tsx index bbefd54..4e0f57e 100644 --- a/src/components/Heading/Heading.test.tsx +++ b/src/components/Heading/Heading.test.tsx @@ -46,10 +46,10 @@ test("applies the correct color for low and high contrast", () => { render(); expect(screen.getByRole("heading", { name: "낮은 명암비" })).toHaveClass( - "c_text" + "c_text.muted" ); expect(screen.getByRole("heading", { name: "높은 명암비" })).toHaveClass( - "c_text.contrast" + "c_text" ); }); diff --git a/src/components/Heading/Heading.tsx b/src/components/Heading/Heading.tsx index 6ec755a..b7b3a94 100644 --- a/src/components/Heading/Heading.tsx +++ b/src/components/Heading/Heading.tsx @@ -14,20 +14,21 @@ export interface HeadingProps extends HTMLAttributes { /** 굵기 */ weight?: FontWeight; /** 명암비 */ - contrast?: "low" | "high"; + muted?: boolean; } /** * - `level` 속성을 통해서 `

`, `

`, `

`, `

`, `

`, `
` 요소 중 하나를 선택할 수 있습니다. * - `level` 속성은 단계 별 기본 텍스트 스타일을 제공합니다. * - `size` 속성과 `weight` 속성을 통해서 기본 스타일을 변경할 수 있습니다. + * - `muted` 속성을 주시면 글자색이 옅어집니다. 명암비가 낮아지므로 접근성 측면에서 주의해서 사용하세요. */ export const Heading = ({ children, level, size, weight, - contrast = "low", + muted = false, ...rest }: HeadingProps) => { if (!level) { @@ -41,7 +42,7 @@ export const Heading = ({ return (