Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
55241bf
chore: 패키지 이름 수정
hongggyelim Mar 11, 2025
8da8e2d
d.ts 파일 추가
hongggyelim Mar 11, 2025
a58d705
chore: 바닐라 익스트랙트 설치
hongggyelim Mar 11, 2025
1789b2e
feat: 스토리북 vanilla extract 적용
hongggyelim Mar 11, 2025
a6c974f
chore: 색상 변수 추가
hongggyelim Mar 11, 2025
bb908e1
feat: 유틸리티 타입 추가
hongggyelim Mar 11, 2025
7714904
chore: 스타일 정의
hongggyelim Mar 11, 2025
cfc8bca
feat: globalcss 적용(스토리북만)
hongggyelim Mar 12, 2025
8e1f00d
feat: 이미지 파일 선택 시 프리뷰 추가
hongggyelim Mar 12, 2025
5f32be9
feat: 프리뷰 삭제 기능 추가
hongggyelim Mar 12, 2025
73994f2
chore: 사진 등록 로직 일부 수정
hongggyelim Mar 12, 2025
35bc846
feat: 프리뷰 dnd
hongggyelim Mar 12, 2025
b80b419
fix: 파일 개수 선택 제한 수정
hongggyelim Mar 12, 2025
43353aa
chore: img 드래그 방지
hongggyelim Mar 12, 2025
e75107c
feat: 파일 드래그 업로드
hongggyelim Mar 12, 2025
7b6d916
feat: PR에서 크로매틱 배포
hongggyelim Mar 12, 2025
ee79de2
fix: storybook build script수정
hongggyelim Mar 12, 2025
ca16f42
fix: main.ts에 globalcss 삭제
hongggyelim Mar 12, 2025
37bee12
feat: yaml 수정 깃헙봇추가
hongggyelim Mar 12, 2025
a3153a0
chore: yml 원복
hongggyelim Mar 12, 2025
9148b04
feat: yml 수정
hongggyelim Mar 12, 2025
4eef9df
chore: 오타 수정 및 불필요한 스토리 삭제
hongggyelim Mar 12, 2025
5221d6b
chore: 색상 변수 추가
hongggyelim Mar 13, 2025
46e00e7
feat: button variant + 상태 스타일 정의
hongggyelim Mar 13, 2025
243a104
feat: 버튼 컴포넌트 구성 완료
hongggyelim Mar 13, 2025
ba605cc
feat: 버튼 스토리북 추가
hongggyelim Mar 13, 2025
23c762c
fix: PR 리뷰 반영
hongggyelim Mar 13, 2025
c40225d
delete: package/ui eslint.config.js 삭제
hongggyelim Mar 13, 2025
2ebbd6e
Merge branch 'feat/file_upload' into feat/component
hongggyelim Mar 13, 2025
60476b5
feat: 버튼 스토리북 추가
hongggyelim Mar 13, 2025
d5d694d
feat: 개발 버튼 스토리북 추가
hongggyelim Mar 13, 2025
5951712
feat: 아이콘을 포함한 버튼 추가
hongggyelim Mar 13, 2025
08926dd
feat: sprinkles 수정
hongggyelim Mar 13, 2025
8c077a6
feat: 스토리북 컬러 팔레트 추가
hongggyelim Mar 14, 2025
13988bd
delete: 불필요한 패키지 삭제
hongggyelim Mar 14, 2025
e87ec23
fix: 세미콜론 지움
hongggyelim Mar 14, 2025
d4663b7
feat: pr리뷰반영
hongggyelim Mar 15, 2025
b211cc0
fix: 빌드 에러
Mar 17, 2025
258632b
fix: alias 적용
Mar 17, 2025
43e4de5
fix: package/ui에 eslint config별도 추가
hongggyelim Mar 18, 2025
6c3d76b
chore: 오타, 경로 수정
hongggyelim Mar 18, 2025
2b2509f
chore: 불필요한 핸들러 삭제
hongggyelim Mar 18, 2025
fa1b736
chore: 컴포넌트 폴더명 수정
hongggyelim Mar 18, 2025
9cfe952
chore: px 표시 추가
hongggyelim Mar 18, 2025
8290e57
refactor: 이미지 핸들러 로직 수정
hongggyelim Mar 18, 2025
94615d0
chore: pr리뷰 반영
hongggyelim Mar 18, 2025
2efa170
chore: inputWrapper 컴포넌트 삭제
hongggyelim Mar 18, 2025
d9297f1
refactor: recipe로 스타일링 변경
hongggyelim Mar 18, 2025
5280cdc
refactor: 불필요한 상태 ref로 변경
hongggyelim Mar 18, 2025
56e8086
fix: 버튼 disabled hover 스타일 변경
hongggyelim Mar 18, 2025
4768d7c
Merge branch 'main' into feat/component
hongggyelim Mar 18, 2025
f23f888
chore: reset 후 다시 커밋
hongggyelim Mar 19, 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
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
{
"mode": "auto"
}
]
],
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "explicit"
}
}
7 changes: 6 additions & 1 deletion apps/storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ import type { StorybookConfig } from "@storybook/react-vite";
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";

const config: StorybookConfig = {
stories: ["../../../packages/ui/src/**/*.stories.@(js|jsx|ts|tsx)"],
stories: [
"../../../packages/ui/src/**/*.stories.@(js|jsx|ts|tsx)",
"../../../packages/ui/src/**/*.mdx", // 문서화용 MDX 파일 추가
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-docs", // 문서화 애드온
"@storybook/blocks",
],
framework: {
name: "@storybook/react-vite",
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "@repo/ui/src/globalStyle/global.css";
import type { Preview } from "@storybook/react";
import "../../../packages/ui/src/globalStyle/global.css"; // alias 설정해도 안됨

const preview: Preview = {
parameters: {
Expand Down
3 changes: 3 additions & 0 deletions apps/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
},
"devDependencies": {
"@chromatic-com/storybook": "3.2.5",
"@mdx-js/react": "^3.1.0",
"@mdx-js/rollup": "^3.1.0",
"@storybook/addon-actions": "^8.6.4",
"@storybook/addon-docs": "^8.6.4",
"@storybook/addon-essentials": "8.6.4",
"@storybook/addon-interactions": "8.6.4",
"@storybook/addon-links": "^8.6.4",
Expand Down
3 changes: 1 addition & 2 deletions apps/storybook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"incremental": true,
"baseUrl": ".", // alias 기준 설정
"paths": {
"@/*": ["./src/*"],
"@repo/ui/*": ["../../../packages/ui/*"] // alias 설정
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
Expand Down
1 change: 1 addition & 0 deletions apps/user/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// import "@repo/ui/globalStyle";
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
Expand Down
13 changes: 4 additions & 9 deletions apps/user/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import Image from "next/image";
import styles from "./page.module.css";

export default function Home() {
return (
<div className={styles.page}>
<main className={styles.main}>
<div>
<main>
<Image
className={styles.logo}
src="/next.svg"
alt="Next.js logo"
width={180}
Expand All @@ -20,15 +18,13 @@ export default function Home() {
<li>Save and see your changes instantly.</li>
</ol>

<div className={styles.ctas}>
<div>
<a
className={styles.primary}
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className={styles.logo}
src="/vercel.svg"
alt="Vercel logomark"
width={20}
Expand All @@ -40,13 +36,12 @@ export default function Home() {
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
className={styles.secondary}
>
Read our docs
</a>
</div>
</main>
<footer className={styles.footer}>
<footer>
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import baseConfig from "@repo/eslint-config/base";

export default [...baseConfig];
4 changes: 4 additions & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"./*": {
"types": "./src/*.ts",
"default": "./dist/*.js"
},
"./global.css": {
"types": "./src/globalStyle/global.css.ts",
"default": "./dist/globalStyle/global.css.js"
}
},
"scripts": {
Expand Down
35 changes: 0 additions & 35 deletions packages/ui/src/button.css

This file was deleted.

43 changes: 0 additions & 43 deletions packages/ui/src/button.stories.ts

This file was deleted.

22 changes: 0 additions & 22 deletions packages/ui/src/button.tsx

This file was deleted.

67 changes: 67 additions & 0 deletions packages/ui/src/buttonComponent/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import type { Meta, StoryObj } from "@storybook/react";
import ButtonComponent from "./ButtonComponent";
import type { MouseEvent } from "react";
import { FiUserPlus } from "react-icons/fi";

const meta: Meta<typeof ButtonComponent> = {
component: ButtonComponent,
title: "UI/Button/Variant",
argTypes: {
children: { control: "text" },
type: {
control: "radio",
options: ["button", "submit", "reset"],
},
variant: {
control: "radio",
options: ["primary", "secondary", "outline", "accent"],
},
onClick: (e: MouseEvent) => alert("클릭 이벤트 발생"),
disabled: { control: "boolean" },
},
tags: ["!autodocs"],
};

export default meta;
type Story = StoryObj<typeof meta>;

export const Primary_Button: Story = {
args: {
variant: "primary",
disabled: false,
children: "버튼입니다",
},
};

export const Secondary_Button: Story = {
args: {
variant: "secondary",
disabled: false,
children: "버튼입니다",
},
};

export const Accent_Button: Story = {
args: {
variant: "accent",
disabled: false,
children: "버튼입니다",
},
};

export const Outline_Button: Story = {
args: {
variant: "outline",
disabled: false,
children: "버튼입니다",
},
};

export const Icon_Button: Story = {
args: {
variant: "outline",
disabled: false,
children: "버튼입니다",
icon: <FiUserPlus />,
},
};
72 changes: 72 additions & 0 deletions packages/ui/src/buttonComponent/ButtonComponent.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import type { Meta, StoryObj } from "@storybook/react";
import { FiUserPlus } from "react-icons/fi";
import ButtonComponent from "./ButtonComponent";
import { block, story } from "./storyStyle.css";

const meta: Meta<typeof ButtonComponent> = {
component: ButtonComponent,
title: "UI/Button",
tags: ["!autodocs"],
};

export default meta;
type Story = StoryObj<typeof meta>;

export const Button: Story = {
render: () => {
return (
<div className={story}>
<h3>primary</h3>
<div className={block}>
<ButtonComponent type="button" variant="primary">
DEFAULT
</ButtonComponent>
<ButtonComponent type="button" variant="primary" disabled>
DISABLED
</ButtonComponent>
</div>
<h3>secondary</h3>
<div className={block}>
<ButtonComponent type="button" variant="secondary">
DEFAULT
</ButtonComponent>
<ButtonComponent type="button" variant="secondary" disabled>
DISABLED
</ButtonComponent>
</div>
<h3>outline</h3>
<div className={block}>
<ButtonComponent type="button" variant="outline">
DEFAULT
</ButtonComponent>
<ButtonComponent type="button" variant="outline" disabled>
DISABLED
</ButtonComponent>
</div>
<h3>accent</h3>
<div className={block}>
<ButtonComponent type="button" variant="accent">
DEFAULT
</ButtonComponent>
<ButtonComponent type="button" variant="accent" disabled>
DISABLED
</ButtonComponent>
</div>
<h3>with Icon</h3>
<div className={block}>
<ButtonComponent type="button" variant="accent" icon={<FiUserPlus />}>
DEFAULT
</ButtonComponent>
<ButtonComponent
type="button"
variant="accent"
icon={<FiUserPlus />}
disabled
>
DISABLED
</ButtonComponent>
</div>
</div>
);
},
};
23 changes: 23 additions & 0 deletions packages/ui/src/buttonComponent/ButtonComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { ComponentPropsWithoutRef, ReactNode } from "react";
import { buttonStyle } from "./style.css";

interface ButtonProps extends ComponentPropsWithoutRef<"button"> {
children: React.ReactNode;
variant: "primary" | "secondary" | "outline" | "accent";
icon?: ReactNode;
}

const ButtonComponent = ({ type, ...args }: ButtonProps) => {
return (
<button
type={type || "button"}
className={`${buttonStyle[args.variant]} ${args.className}`}
{...args}
>
{args.icon}
{args.children}
</button>
);
};

export default ButtonComponent;
Loading
Loading