Skip to content

Commit a0703f8

Browse files
authored
Merge pull request #27 from Leets-Official/24-feat/Header-컴포넌트-수정-및-리팩토링
[Feat] Header 컴포넌트 수정 및 리팩토링
2 parents 54db360 + c9e093d commit a0703f8

26 files changed

Lines changed: 849 additions & 165 deletions

.github/workflows/storybook.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy Storybook to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: 'pages'
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build-and-deploy:
19+
runs-on: ubuntu-latest
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '22'
31+
32+
- name: Enable Corepack
33+
run: corepack enable
34+
35+
- name: Install dependencies
36+
run: yarn install --immutable
37+
38+
- name: Build Storybook
39+
run: yarn build-storybook
40+
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v4
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: storybook-static
48+
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ storybook-static
4141
!.yarn/releases
4242

4343
# Vercel
44-
.vercel
44+
.vercel

eslint.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ import storybook from 'eslint-plugin-storybook';
1212

1313
export default [
1414
{
15-
ignores: ['dist', 'node_modules', '.yarn', '.pnp.*', '*.config.js', 'storybook-static'],
15+
ignores: [
16+
'dist',
17+
'build',
18+
'node_modules',
19+
'.yarn',
20+
'.pnp.*',
21+
'*.config.js',
22+
'storybook-static',
23+
],
1624
},
1725
js.configs.recommended,
1826
...tseslint.configs.recommended,

src/pages/playground.tsx

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,26 @@ import { TextField } from '@shared/ui/TextField/TextField';
1010
import { useState } from 'react';
1111

1212
export default function Playground() {
13+
const [radioValue, setRadioValue] = useState('option1');
1314
const [isModalOpen, setIsModalOpen] = useState(false);
1415

1516
return (
1617
<div className="flex flex-col gap-6 p-8">
1718
<h1 className="typo-title-2">UI Playground</h1>
18-
1919
{/* Header */}
2020
<section className="flex flex-col gap-4">
2121
<h2 className="typo-body-1">Header</h2>
22+
<p className="typo-caption-2 text-gray-600">비로그인 상태</p>
2223
<Header />
24+
<p className="typo-caption-2 mt-4 text-gray-600">로그인 상태</p>
25+
<Header isLoggedIn user={{ profileImage: '/profile-sample.jpg', nickname: '홍길동' }} />
2326
</section>
24-
2527
{/* Button */}
2628
<section className="flex flex-col gap-4">
2729
<h2 className="typo-body-1">Button</h2>
2830
<p className="typo-caption-2 text-gray-600">
2931
Hover와 Focus 상태를 확인하려면 마우스를 올리거나 Tab 키로 포커스를 이동하세요.
3032
</p>
31-
3233
<div className="flex flex-col gap-4">
3334
<div className="flex items-center gap-4">
3435
<span className="typo-caption-1 w-24">Fill</span>
@@ -37,7 +38,6 @@ export default function Playground() {
3738
Disabled
3839
</Button>
3940
</div>
40-
4141
<div className="flex items-center gap-4">
4242
<span className="typo-caption-1 w-24">Outline</span>
4343
<Button variant="outline">Default</Button>
@@ -47,7 +47,6 @@ export default function Playground() {
4747
</div>
4848
</div>
4949
</section>
50-
5150
{/* Checkbox */}
5251
<section className="flex flex-col gap-4">
5352
<h2 className="typo-body-1">Checkbox</h2>
@@ -58,59 +57,66 @@ export default function Playground() {
5857
<Checkbox checked disabled label="Checked + Disabled" />
5958
</div>
6059
</section>
61-
6260
{/* Radio Button */}
6361
<section className="flex flex-col gap-4">
6462
<h2 className="typo-body-1">Radio Button</h2>
6563
<div className="flex flex-col gap-2">
66-
<RadioButton label="Default" />
67-
<RadioButton checked label="Selected" />
68-
<RadioButton disabled label="Disabled" />
69-
<RadioButton checked disabled label="Selected + Disabled" />
64+
<RadioButton
65+
name="demo"
66+
checked={radioValue === 'option1'}
67+
onChange={() => setRadioValue('option1')}
68+
label="Option 1"
69+
/>
70+
<RadioButton
71+
name="demo"
72+
checked={radioValue === 'option2'}
73+
onChange={() => setRadioValue('option2')}
74+
label="Option 2"
75+
/>
76+
<RadioButton
77+
name="demo"
78+
checked={radioValue === 'option3'}
79+
onChange={() => setRadioValue('option3')}
80+
label="Option 3"
81+
/>
82+
<RadioButton name="demo-disabled" disabled label="Disabled" />
7083
</div>
7184
</section>
72-
7385
{/* Profile */}
7486
<section className="flex flex-col gap-4">
7587
<h2 className="typo-body-1">Profile</h2>
7688
<p className="typo-caption-2 text-gray-600">
7789
size variant 및 placeholder 상태를 확인합니다.
7890
</p>
79-
8091
<div className="flex items-center gap-10">
8192
<div className="flex flex-col items-center gap-2">
82-
<Profile size="sm" imageUrl="/profile-sample.jpg" />
93+
<Profile size="sm" image="/profile-sample.jpg" />
8394
<span className="typo-caption-2">Small Image</span>
8495
</div>
85-
8696
<div className="flex flex-col items-center gap-2">
87-
<Profile size="lg" imageUrl="/profile-sample.jpg" />
97+
<Profile size="lg" image="/profile-sample.jpg" />
8898
<span className="typo-caption-2">Large Image</span>
8999
</div>
90-
91100
<div className="flex flex-col items-center gap-2">
92101
<Profile size="sm" />
93102
<span className="typo-caption-2 text-gray-500">Small Placeholder</span>
94103
</div>
95-
96104
<div className="flex flex-col items-center gap-2">
97105
<Profile size="lg" />
98106
<span className="typo-caption-2 text-gray-500">Large Placeholder</span>
99107
</div>
100108
</div>
101109
</section>
102-
103110
{/* Card */}
104111
<section className="flex flex-col gap-4">
105112
<h2 className="typo-body-1">Card</h2>
106113
<Card
107-
imageSrc="/iphone11.png"
108-
titleText="Title 인데 제목이 정말 길 경우에는 두줄 까지만 보이고, 뒤엔 점 처리"
109-
priceText="0,000원"
110-
dateText="1일 전"
114+
image="/iphone11.png"
115+
title="Title 인데 제목이 정말 길 경우에는 두줄 까지만 보이고, 뒤엔 점 처리"
116+
price="0,000원"
117+
date="1일 전"
111118
/>
112119
</section>
113-
114120
{/* BannerCard */}
115121
<section className="flex flex-col gap-4">
116122
<h2 className="typo-body-1">Banner Card</h2>
@@ -127,13 +133,10 @@ export default function Playground() {
127133
buttonText="바로가기"
128134
/>
129135
</section>
130-
131136
{/* Modal */}
132137
<section className="flex flex-col gap-4">
133138
<h2 className="typo-body-1">Modal</h2>
134-
135139
<Button onClick={() => setIsModalOpen(true)}>Open Modal</Button>
136-
137140
{isModalOpen && (
138141
<Modal
139142
title="해당 게시물을 삭제하시겠어요?"
@@ -145,16 +148,13 @@ export default function Playground() {
145148
/>
146149
)}
147150
</section>
148-
149151
{/* TextField 예시 */}
150152
<section className="flex flex-col gap-4">
151153
<h2 className="typo-body-1">TextField</h2>
152-
153154
<div className="flex flex-wrap gap-10">
154155
{/* Char Field */}
155156
<div className="flex flex-col gap-4">
156157
<h3 className="typo-caption-1 font-semibold">Char Field</h3>
157-
158158
<div className="w-127.25">
159159
<TextField
160160
type="char"
@@ -164,7 +164,6 @@ export default function Playground() {
164164
helperText="Default"
165165
/>
166166
</div>
167-
168167
<div className="w-127.25">
169168
<TextField
170169
type="char"
@@ -175,7 +174,6 @@ export default function Playground() {
175174
helperText="Error"
176175
/>
177176
</div>
178-
179177
<div className="w-127.25">
180178
<TextField
181179
type="char"
@@ -187,11 +185,9 @@ export default function Playground() {
187185
/>
188186
</div>
189187
</div>
190-
191188
{/* TextArea Field */}
192189
<div className="flex flex-col gap-4">
193190
<h3 className="typo-caption-1 font-semibold">TextArea Field</h3>
194-
195191
<div className="w-127.25">
196192
<TextField
197193
type="textarea"
@@ -201,7 +197,6 @@ export default function Playground() {
201197
helperText="Default"
202198
/>
203199
</div>
204-
205200
<div className="w-127.25">
206201
<TextField
207202
type="textarea"
@@ -212,7 +207,6 @@ export default function Playground() {
212207
helperText="Error"
213208
/>
214209
</div>
215-
216210
<div className="w-127.25">
217211
<TextField
218212
type="textarea"
@@ -224,11 +218,9 @@ export default function Playground() {
224218
/>
225219
</div>
226220
</div>
227-
228221
{/* Price Field */}
229222
<div className="flex flex-col gap-4">
230223
<h3 className="typo-caption-1 font-semibold">Price Field</h3>
231-
232224
<div className="w-127.25">
233225
<TextField
234226
type="price"
@@ -238,7 +230,6 @@ export default function Playground() {
238230
helperText="Default"
239231
/>
240232
</div>
241-
242233
<div className="w-127.25">
243234
<TextField
244235
type="price"
@@ -249,7 +240,6 @@ export default function Playground() {
249240
helperText="Error"
250241
/>
251242
</div>
252-
253243
<div className="w-127.25">
254244
<TextField
255245
type="price"
Lines changed: 3 additions & 0 deletions
Loading

src/shared/assets/icons/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
import CaretDownMdIcon from './common/caret-down-md.svg?react';
12
import CheckIcon from './common/check.svg?react';
23
import DoneIcon from './common/done.svg?react';
34

4-
export { CheckIcon, DoneIcon };
5+
export { CaretDownMdIcon, CheckIcon, DoneIcon };

src/shared/assets/logo/logo4.svg

Lines changed: 7 additions & 0 deletions
Loading

src/shared/ui/Button/Button.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const AllStates: Story = {
8080
</div>
8181
</div>
8282
<p className="typo-caption-2 max-w-md text-gray-600">
83-
Hover와 Focus 상태를 확인하려면 마우스를 올리거나 Tab 키로 포커스를 이동하세요.
83+
Hover, Focus 상태 확인: 마우스 오버 또는 Tab 키 이동
8484
</p>
8585
</div>
8686
),

src/shared/ui/Button/Button.variants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export const buttonVariants = tv({
5959
size: {
6060
default: ['w-[163px]'],
6161
auto: ['w-auto'],
62+
full: ['w-full'],
6263
},
6364
},
6465

0 commit comments

Comments
 (0)