Skip to content
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

[Feature] component 페이지 마크업 (avatar, checkbox, switch, header) #197

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0d4f419
feat: avatar guide svg 이미지
soulchicken Jan 23, 2025
264b4a0
feat: avatar 컴포넌트 페이지 마크업
soulchicken Jan 23, 2025
809721a
feat: avatar 페이지 오타 수정
soulchicken Jan 24, 2025
ec57a1e
feat: header 페이지 마크업
soulchicken Jan 24, 2025
572509b
feat: header guideline 컴포넌트
soulchicken Jan 24, 2025
d8177df
feat: header componentTab 컴포넌트
soulchicken Jan 24, 2025
a585a45
feat: switch 페이지 마크업
soulchicken Jan 24, 2025
73ffcb8
feat: switch GuidelineTab 컴포넌트
soulchicken Jan 24, 2025
581135e
feat: switch ComponentTab 컴포넌트
soulchicken Jan 24, 2025
dd8bcf2
fix: 폴더명, alt text 변경
soulchicken Jan 24, 2025
1e7196b
feat: checkbox component 페이지의 이미지 삽입
soulchicken Jan 24, 2025
4d0f837
feat: checkbox component 페이지 마크업
soulchicken Jan 24, 2025
ddfab69
feat: checkbox guideline 컴포넌트
soulchicken Jan 24, 2025
d517708
feat: checkbox componentTab 컴포넌트
soulchicken Jan 24, 2025
cbc5346
fix: color, spacing, typo의 metadata 부분 수정
soulchicken Jan 24, 2025
753e23d
feat: 코드리뷰 반영하여 checkbox 컴포넌트 탭 수정
soulchicken Jan 26, 2025
02b4c33
feat: 코드리뷰 반영하여 SwitchBtn Card 수정
soulchicken Jan 26, 2025
6c189f1
feat: header 페이지 GDSC에서 GDG로 변경
soulchicken Jan 26, 2025
776e54d
refactor: checkbox componentTab 상수화, map 순회
soulchicken Jan 26, 2025
4056513
fix: 사용하지 않는 이미지 태그 제거
soulchicken Feb 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions apps/wow-docs/app/component/avatar/_components/ComponentTab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import Card from "@components/Card";
import Space from "@components/Space";
import Text from "@components/Text";
import { Flex } from "@styled-system/jsx";
import Avatar from "wowds-ui/Avatar";

const ComponentTab = () => {
return (
<>
<Space height={48} />
<Text typo="display2WebPage">Component</Text>
<Space height={40} />
<Text typo="headingWebPage">S Size</Text>
<Space height={20} />
<Card style={{ padding: "46px auto" }}>
<Flex gap={12}>
<Avatar size="sm" />
<Avatar size="sm" variant="green" />
<Avatar size="sm" variant="yellow" />
<Avatar size="sm" variant="red" />
</Flex>
</Card>
<Space height={40} />
<Text typo="headingWebPage">L Size</Text>
<Space height={20} />
<Card style={{ padding: "32px auto" }}>
<Flex gap={20}>
<Avatar />
<Avatar variant="green" />
<Avatar variant="yellow" />
<Avatar variant="red" />
</Flex>
</Card>
</>
);
};

export default ComponentTab;
83 changes: 83 additions & 0 deletions apps/wow-docs/app/component/avatar/_components/GuidelineTab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import Card from "@components/Card";
import Space from "@components/Space";
import Text from "@components/Text";
import Title from "@components/Text/Title";
import Image from "next/image";
import Divider from "wowds-ui/Divider";

const GuidelineTab = () => {
return (
<>
<Space height={48} />
<Text typo="display2WebPage">Guideline</Text>
<Space height={40} />
<Title
main="Style"
sub="기본 아바타 그래픽은 4종을 제공해요. 프로필 이미지를 지정할 경우 대체하여 사용해요."
variant="component"
/>
<Space height={20} />
<Card style={{ padding: "49px auto" }}>
<Image
alt="기본 아바타 그래픽을 제공하고 사용자 지정 이미지를 사용할 수 있습니다"
height={138}
src="/component/avatar/avatar-guide-1.svg"
width={354}
/>
</Card>
<Space height={40} />
<Divider />
<Space height={40} />
<Title
main="Size"
sub="크기에 따라 다른 방식으로 활용해요."
variant="component"
/>
<Space height={40} />
<Title
main="S Size"
sub="이름과 함께 병행하여 사용 가능"
variant="component"
/>
<Space height={20} />
<Card style={{ padding: "32px auto" }}>
<Image
alt="S size를 아바타만 사용하거나 이름과 병행한 이미지"
height={140}
src="/component/avatar/avatar-guide-2.svg"
width={908}
/>
</Card>
<Space height={40} />
<Text color="sub" typo="body1">
헤더에 적용할 경우, 아바타만 사용하거나 이름과 병행 가능
</Text>
<Space height={20} />
<Card style={{ padding: "32px auto" }}>
<Image
alt="S size를 헤더에 적용한 경우, 아바타만 사용하거나 이름과 병행한 이미지"
height={150}
src="/component/avatar/avatar-guide-3.svg"
width={390}
/>
</Card>
<Space height={40} />
<Title
main="L Size"
sub="헤더에 적용할 경우, 아바타만 사용하거나 이름과 병행 가능"
variant="component"
/>
<Space height={20} />
<Card style={{ padding: "32px auto" }}>
<Image
alt="L size를 아바타만 사용하거나 이름과 병행한 이미지"
height={233}
src="/component/avatar/avatar-guide-4.svg"
width={908}
/>
</Card>
</>
);
};

export default GuidelineTab;
40 changes: 40 additions & 0 deletions apps/wow-docs/app/component/avatar/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import Card from "@components/Card";
import ComponentDetailTabs from "@components/ComponentDetailTabs";
import Space from "@components/Space";
import Title from "@components/Text/Title";
import { componentItems } from "@constants/pageData";
import type { Metadata } from "next/types";
import Avatar from "wowds-ui/Avatar";

import ComponentTab from "@/component/avatar/_components/ComponentTab";
import GuidelineTab from "@/component/avatar/_components/GuidelineTab";

export const metadata: Metadata = {
title: "Avatar",
description: "와우 디자인 시스템의 avatar component 입니다.",
};

const AvatarPage = () => {
const avatarPageData = componentItems.find((item) => item.title === "Avatar");
return (
<>
<Title
main={avatarPageData?.title ?? ""}
sub={avatarPageData?.description ?? ""}
variant="header"
/>
<Space height={40} />
<Card style={{ padding: "50px 144px" }}>
<Avatar />
</Card>
<Space height={92} />
<ComponentDetailTabs
componentTab={<ComponentTab />}
guidelineTab={<GuidelineTab />}
/>
<Space height={92} />
</>
);
};

export default AvatarPage;
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import Card from "@components/Card";
import Space from "@components/Space";
import Text from "@components/Text";
import { Flex } from "@styled-system/jsx";
import Image from "next/image";
import type { CheckboxProps } from "wowds-ui/Checkbox";
import Checkbox from "wowds-ui/Checkbox";

type CheckboxItem = CheckboxProps & {
key: number;
pressed?: boolean;
};

const checkboxAndTexts: CheckboxItem[] = [
{
key: 1,
position: "vertical",
label: "Text",
defaultChecked: true,
},
{
key: 2,
position: "vertical",
label: "Text",
},
{
key: 3,
label: "Text",
defaultChecked: true,
},
{ key: 4, label: "Text" },
];

const ComponentTab = () => {
return (
<>
<Space height={48} />
<Text typo="display2WebPage">Component</Text>
<Space height={40} />
<Text typo="headingWebPage">Box</Text>
<Space height={20} />
<Card>
<Image
alt="사용되는 텍스트의 길이 및 용도에 따라 컴포넌트 버전을 선택"
height={60}
src="/component/checkbox/checkbox-component-box.svg"
width={220}
/>
</Card>
<Space height={40} />
<Text typo="headingWebPage">Box + Text</Text>
<Space height={20} />
<Card>
<Flex gap="2rem">
{checkboxAndTexts.map((props) => (
<Checkbox {...props} />
))}
</Flex>
</Card>
</>
);
};

export default ComponentTab;
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import Card from "@components/Card";
import Space from "@components/Space";
import Text from "@components/Text";
import Image from "next/image";

const GuidelineTab = () => {
return (
<>
<Space height={48} />
<Text as="h2" typo="display2WebPage">
Guideline
</Text>
<Space height={40} />
<Text color="sub" typo="body1">
사용되는 텍스트의 길이 및 용도에 따라 컴포넌트 버전을 선택
</Text>
<Space height={20} />
<Card>
<Image
alt="사용되는 텍스트의 길이 및 용도에 따라 컴포넌트 버전을 선택"
height={90}
src="/component/checkbox/checkbox-guide-1.svg"
width={379}
/>
</Card>
<Space height={40} />
<Text color="sub" typo="body1">
너비 규칙은 Horizontal에만 적용
</Text>
<Space height={20} />
<Card>
<Image
alt="너비 규칙은 Horizontal에만 적용"
height={140}
src="/component/checkbox/checkbox-guide-2.svg"
width={908}
/>
</Card>
</>
);
};

export default GuidelineTab;
49 changes: 49 additions & 0 deletions apps/wow-docs/app/component/checkbox/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import Card from "@components/Card";
import ComponentDetailTabs from "@components/ComponentDetailTabs";
import Space from "@components/Space";
import Title from "@components/Text/Title";
import { componentItems } from "@constants/pageData";
import { css } from "@styled-system/css";
import type { Metadata } from "next/types";
import Checkbox from "wowds-ui/Checkbox";

import ComponentTab from "@/component/checkbox/_components/ComponentTab";
import GuidelineTab from "@/component/checkbox/_components/GuidelineTab";

export const metadata: Metadata = {
title: "Checkbox",
description: "와우 디자인 시스템의 Checkbox 입니다.",
};

const CheckboxComponentPage = () => {
const CheckboxPageData = componentItems.find(
(item) => item.title === "Checkbox"
);
return (
<>
<Title
main={CheckboxPageData?.title ?? ""}
sub={CheckboxPageData?.description ?? ""}
variant="header"
/>
<Space height={40} />
<Card className={cardStyle}>
<Checkbox checked label="Text" />
<Checkbox label="Text" />
</Card>
<Space height={92} />
<ComponentDetailTabs
componentTab={<ComponentTab />}
guidelineTab={<GuidelineTab />}
/>
<Space height={92} />
</>
);
};

export default CheckboxComponentPage;

const cardStyle = css({
alignItems: "end",
gap: "32px",
});
57 changes: 57 additions & 0 deletions apps/wow-docs/app/component/header/_components/ComponentTab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import Card from "@components/Card";
import Space from "@components/Space";
import Text from "@components/Text";
import { css } from "@styled-system/css";
import { Flex } from "@styled-system/jsx";
import Header from "wowds-ui/Header";

const ComponentTab = () => {
return (
<>
<Space height={48} />
<Text typo="display2WebPage">Component</Text>
<Space height={40} />
<Text typo="headingWebPage">Mobile Ver.</Text>
<Space height={20} />
<Card style={{ padding: "46px auto" }}>
<Flex
className={mobileHeaderContainerStyle}
direction="column"
gap={20}
>
<Header username="김홍익" variant="username" />
<Header variant="login" />
<Header variant="none" />
</Flex>
</Card>
<Space height={40} />
<Text typo="headingWebPage">PC Ver.</Text>
<Space height={20} />
<Card style={{ padding: "32px auto" }}>
<Flex className={pcHeaderContainerStyle} direction="column" gap={20}>
<Header username="김홍익" variant="username" />
<Header variant="login" />
<Header variant="none" />
</Flex>
</Card>
</>
);
};

export default ComponentTab;

const mobileHeaderContainerStyle = css({
width: "390px",
"& > header": {
backgroundColor: "background",
height: "66px",
},
});

const pcHeaderContainerStyle = css({
width: "880px",
"& > header": {
backgroundColor: "background",
height: "43.2px",
},
});
Loading
Loading