|
1 | | -type SpacingExampleProps = { |
2 | | - name: string; |
3 | | - value: string; |
4 | | - spacingClass: string; |
5 | | -}; |
| 1 | +import { Chip } from "#/components/chip"; |
6 | 2 |
|
7 | | -function GapExample({ name, value, spacingClass }: SpacingExampleProps) { |
8 | | - return ( |
9 | | - <div className="ygi:flex ygi:flex-col ygi:gap-sm"> |
10 | | - <div className="ygi:flex ygi:items-center ygi:justify-between"> |
11 | | - <span className="ygi:body-14-sb ygi:text-gray-900">{name}</span> |
12 | | - <span className="ygi:caption-12-md ygi:text-gray-500">{value}</span> |
13 | | - </div> |
14 | | - <div className={`ygi:flex ${spacingClass}`}> |
15 | | - <div className="ygi:w-16 ygi:h-16 ygi:bg-palette-primary-500 ygi:rounded-sm" /> |
16 | | - <div className="ygi:w-16 ygi:h-16 ygi:bg-palette-primary-500 ygi:rounded-sm" /> |
17 | | - <div className="ygi:w-16 ygi:h-16 ygi:bg-palette-primary-500 ygi:rounded-sm" /> |
18 | | - </div> |
19 | | - </div> |
20 | | - ); |
21 | | -} |
22 | 3 |
|
23 | | -function PaddingExample({ name, value, spacingClass }: SpacingExampleProps) { |
24 | | - return ( |
25 | | - <div className="ygi:flex ygi:flex-col ygi:gap-sm"> |
26 | | - <div className="ygi:flex ygi:items-center ygi:justify-between"> |
27 | | - <span className="ygi:body-14-sb ygi:text-gray-900">{name}</span> |
28 | | - <span className="ygi:caption-12-md ygi:text-gray-500">{value}</span> |
29 | | - </div> |
30 | | - <div className="ygi:bg-palette-gray-200 ygi:rounded-sm ygi:inline-flex"> |
31 | | - <div className={`ygi:bg-palette-primary-500 ygi:rounded-sm ${spacingClass}`}> |
32 | | - <div className="ygi:w-16 ygi:h-16 ygi:bg-palette-secondary-500 ygi:rounded-xs" /> |
33 | | - </div> |
34 | | - </div> |
35 | | - </div> |
36 | | - ); |
37 | | -} |
38 | | - |
39 | | -function MarginExample({ name, value, spacingClass }: SpacingExampleProps) { |
40 | | - return ( |
41 | | - <div className="ygi:flex ygi:flex-col ygi:gap-sm"> |
42 | | - <div className="ygi:flex ygi:items-center ygi:justify-between"> |
43 | | - <span className="ygi:body-14-sb ygi:text-gray-900">{name}</span> |
44 | | - <span className="ygi:caption-12-md ygi:text-gray-500">{value}</span> |
45 | | - </div> |
46 | | - <div className="ygi:bg-palette-gray-200 ygi:p-2 ygi:rounded-sm ygi:inline-flex ygi:flex-col"> |
47 | | - <div className={`ygi:w-16 ygi:h-16 ygi:bg-palette-primary-500 ygi:rounded-sm ${spacingClass}`} /> |
48 | | - <div className="ygi:w-16 ygi:h-16 ygi:bg-palette-secondary-500 ygi:rounded-sm" /> |
49 | | - </div> |
50 | | - </div> |
51 | | - ); |
52 | | -} |
53 | 4 |
|
54 | 5 | export default function Home() { |
55 | | - return ( |
56 | | - <div className="ygi:flex ygi:flex-col ygi:gap-xl ygi:p-xl"> |
57 | | - {/* Gap Section */} |
58 | | - <div className="ygi:flex ygi:flex-col ygi:gap-md"> |
59 | | - <h1 className="ygi:display-28-bd ygi:text-gray-900">Spacing System</h1> |
| 6 | + return ( |
| 7 | + <div className="ygi:flex ygi:flex-col ygi:gap-xl ygi:p-xl"> |
| 8 | + <div className="ygi:flex ygi:flex-col ygi:gap-md"> |
| 9 | + <h1 className="ygi:display-28-bd ygi:text-gray-900"> |
| 10 | + Chip Component |
| 11 | + </h1> |
| 12 | + |
| 13 | + {/* Default State */} |
| 14 | + <div className="ygi:flex ygi:flex-col ygi:gap-sm"> |
| 15 | + <h2 className="ygi:heading-20-sb ygi:text-gray-900"> |
| 16 | + Default State |
| 17 | + </h2> |
| 18 | + <div className="ygi:flex ygi:flex-wrap ygi:gap-md"> |
| 19 | + <Chip>Default</Chip> |
| 20 | + <Chip disabled>Default Disabled</Chip> |
| 21 | + </div> |
| 22 | + <p className="ygi:body-14-rg ygi:text-gray-500"> |
| 23 | + 기본 상태입니다. Hover 시 배경색과 텍스트 색상이 |
| 24 | + 변경됩니다. |
| 25 | + </p> |
| 26 | + </div> |
60 | 27 |
|
61 | | - <div className="ygi:flex ygi:flex-col ygi:gap-md"> |
62 | | - <h2 className="ygi:heading-20-sb ygi:text-gray-900">Gap</h2> |
63 | | - <div className="ygi:flex ygi:gap-md ygi:flex-wrap"> |
64 | | - <GapExample name="gap-2xs" value="4px" spacingClass="ygi:gap-2xs" /> |
65 | | - <GapExample name="gap-xs" value="8px" spacingClass="ygi:gap-xs" /> |
66 | | - <GapExample name="gap-sm" value="12px" spacingClass="ygi:gap-sm" /> |
67 | | - <GapExample name="gap-md" value="16px" spacingClass="ygi:gap-md" /> |
68 | | - <GapExample name="gap-xl" value="24px" spacingClass="ygi:gap-xl" /> |
69 | | - </div> |
70 | | - </div> |
71 | | - </div> |
| 28 | + {/* Selected State */} |
| 29 | + <div className="ygi:flex ygi:flex-col ygi:gap-sm"> |
| 30 | + <h2 className="ygi:heading-20-sb ygi:text-gray-900"> |
| 31 | + Selected State |
| 32 | + </h2> |
| 33 | + <div className="ygi:flex ygi:flex-wrap ygi:gap-md"> |
| 34 | + <Chip selected>Selected</Chip> |
| 35 | + <Chip selected disabled> |
| 36 | + Selected Disabled |
| 37 | + </Chip> |
| 38 | + </div> |
| 39 | + <p className="ygi:body-14-rg ygi:text-gray-500"> |
| 40 | + 선택된 상태입니다. 주요 액션을 강조하는 데 사용됩니다. |
| 41 | + </p> |
| 42 | + </div> |
72 | 43 |
|
73 | | - {/* Padding Section */} |
74 | | - <div className="ygi:flex ygi:flex-col ygi:gap-md"> |
75 | | - <h2 className="ygi:heading-20-sb ygi:text-gray-900">Padding</h2> |
76 | | - <div className="ygi:flex ygi:gap-md ygi:flex-wrap"> |
77 | | - <PaddingExample name="p-2xs" value="4px" spacingClass="ygi:p-2xs" /> |
78 | | - <PaddingExample name="p-xs" value="8px" spacingClass="ygi:p-xs" /> |
79 | | - <PaddingExample name="p-sm" value="12px" spacingClass="ygi:p-sm" /> |
80 | | - <PaddingExample name="p-md" value="16px" spacingClass="ygi:p-md" /> |
81 | | - <PaddingExample name="p-xl" value="24px" spacingClass="ygi:p-xl" /> |
82 | | - </div> |
83 | | - </div> |
| 44 | + {/* All States */} |
| 45 | + <div className="ygi:flex ygi:flex-col ygi:gap-sm"> |
| 46 | + <h2 className="ygi:heading-20-sb ygi:text-gray-900"> |
| 47 | + All States |
| 48 | + </h2> |
| 49 | + <div className="ygi:flex ygi:flex-wrap ygi:gap-md"> |
| 50 | + <Chip>Default</Chip> |
| 51 | + <Chip disabled>Default Disabled</Chip> |
| 52 | + <Chip selected>Selected</Chip> |
| 53 | + <Chip selected disabled> |
| 54 | + Selected Disabled |
| 55 | + </Chip> |
| 56 | + </div> |
| 57 | + <p className="ygi:body-14-rg ygi:text-gray-500"> |
| 58 | + 모든 상태를 한눈에 확인할 수 있습니다. Hover 효과를 직접 |
| 59 | + 테스트해보세요. |
| 60 | + </p> |
| 61 | + </div> |
84 | 62 |
|
85 | | - {/* Margin Section */} |
86 | | - <div className="ygi:flex ygi:flex-col ygi:gap-md"> |
87 | | - <h2 className="ygi:heading-20-sb ygi:text-gray-900">Margin</h2> |
88 | | - <div className="ygi:flex ygi:gap-md ygi:flex-wrap"> |
89 | | - <MarginExample name="mb-2xs" value="4px" spacingClass="ygi:mb-2xs" /> |
90 | | - <MarginExample name="mb-xs" value="8px" spacingClass="ygi:mb-xs" /> |
91 | | - <MarginExample name="mb-sm" value="12px" spacingClass="ygi:mb-sm" /> |
92 | | - <MarginExample name="mb-md" value="16px" spacingClass="ygi:mb-md" /> |
93 | | - <MarginExample name="mb-xl" value="24px" spacingClass="ygi:mb-xl" /> |
94 | | - </div> |
95 | | - </div> |
96 | | - </div> |
97 | | - ); |
| 63 | + {/* Interactive Example */} |
| 64 | + <div className="ygi:flex ygi:flex-col ygi:gap-sm"> |
| 65 | + <h2 className="ygi:heading-20-sb ygi:text-gray-900"> |
| 66 | + Interactive Example |
| 67 | + </h2> |
| 68 | + <div className="ygi:flex ygi:flex-wrap ygi:gap-md"> |
| 69 | + <Chip>카테고리 1</Chip> |
| 70 | + <Chip>카테고리 2</Chip> |
| 71 | + <Chip selected>카테고리 3</Chip> |
| 72 | + <Chip>카테고리 4</Chip> |
| 73 | + <Chip>카테고리 5</Chip> |
| 74 | + </div> |
| 75 | + <p className="ygi:body-14-rg ygi:text-gray-500"> |
| 76 | + 실제 사용 예시입니다. 필터링이나 카테고리 선택에 활용할 |
| 77 | + 수 있습니다. |
| 78 | + </p> |
| 79 | + </div> |
| 80 | + </div> |
| 81 | + </div> |
| 82 | + ); |
98 | 83 | } |
0 commit comments