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

Implement button atom component/#19 #24

Merged
merged 16 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
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
10 changes: 10 additions & 0 deletions .storybook/preview-body.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard-dynamic-subset.min.css"
/>

<style>
* {
font-family: 'Pretendard';
}
</style>
1 change: 1 addition & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Preview } from '@storybook/react';
import '../app/globals.css';

const preview: Preview = {
parameters: {
Expand Down
14 changes: 9 additions & 5 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
}
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}

*,
a {
font-family: 'Pretendard';
}

a:-webkit-any-link {
text-decoration: none;
}
11 changes: 7 additions & 4 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import './globals.css';

const inter = Inter({ subsets: ['latin'] });

export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
Expand All @@ -16,7 +13,13 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<head>
<link
href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard.css"
rel="stylesheet"
/>
</head>
<body>{children}</body>
Comment on lines +16 to +22
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[comment]

  • next์—์„œ font ์ตœ์ ํ™”๋ฅผ ์œ„ํ•œ ๋ฐฉ๋ฒ•์„ ์ œ๊ณตํ•˜๋Š” ๊ฒƒ์œผ๋กœ ์•„๋Š”๋ฐ ํ•ด๋‹น ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•œ ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š”?
  • ๊ฐœ๋ฐœ์„ ์œ„ํ•œ ์ž„์‹œ์šฉ๋„๋ผ๋ฉด ๊ดœ์ฐฎ์œผ๋‚˜ ์•„๋‹ˆ๋ผ๋ฉด ์ˆ˜์ •์ด ํ•„์š”ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next์—์„œ font ์ตœ์ ํ™”๋ฅผ ์ œ๊ณตํ•ด์ฃผ๋Š” ์ง€ ๋ชฐ๋ž์Šต๋‹ˆ๋‹ค
์ถ”ํ›„ ์ˆ˜์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค! ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋„ต ์ฐธ๊ณ  ๋งํฌ ์ฒจ๋ถ€ํ•ด๋†“๊ฒ ์Šต๋‹ˆ๋‹ค
https://nextjs.org/docs/app/building-your-application/optimizing/fonts

</html>
);
}
89 changes: 89 additions & 0 deletions app/ui/view/atom/button/button.stories.tsx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[comment]
์Šคํ† ๋ฆฌ๋ถ ํ™•์ธํ–ˆ๋Š”๋ฐ ์ƒ๊ฐ๋ณด๋‹ค ํ›จ์”ฌ ๋ฉ‹์žˆ๋„ค์š”!! ๋„ˆ๋ฌด ์ข‹์Šต๋‹ˆ๋‹ค. ํ™•์ธ ํ›„ ์งˆ๋ฌธ๊ณผ ์˜๊ฒฌ์„ ๋‚จ๊น๋‹ˆ๋‹ค.

  • ๋ฌธ์„œํ™”๋ฅผ ์œ„ํ•ด meta์˜ description๊ณผ argtype์„ ์ƒ์„ธํ•˜๊ฒŒ ์ž‘์„ฑํ•ด์ฃผ์‹  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ์ด ๊ณผ์ •์—์„œ ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋‘ ๋ฒˆ ๊ฐœ๋ฐœํ•œ๋‹ค๋Š” ๋Š๋‚Œ์ด ๋“ค์—ˆ๊ฑฐ๋‚˜, ์‹œ๊ฐ„์ด ๋„ˆ๋ฌด ์˜ค๋ž˜ ๊ฑธ๋ฆฌ์ง€ ์•Š์•˜๋‚˜์š”?
  • ๋งŒ์•ฝ ๋ถˆํŽธํ•จ์„ ๋Š๊ผˆ๋‹ค๋ฉด, ๋ฌธ์„œํ™”๋Š” ๊ฐœ๋ฐœ ๋‹จ๊ณ„๊ฐ€ ์•ˆ์ •ํ™”๋˜์—ˆ์„ ๋•Œ ์ง„ํ–‰ํ•˜๋Š” ๊ฒƒ์€ ์–ด๋–จ๊นŒ์š”? ์ดˆ๋ฐ˜์—๋Š” atom ์ปดํฌ๋„ŒํŠธ๋ผ๋„ ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ๋งŽ์„ ๊ฒƒ์œผ๋กœ ์˜ˆ์ƒ๋˜๋ฏ€๋กœ, ๋ฌธ์„œํ™”๋ฅผ ๋™์‹œ์— ์ง„ํ–‰ํ•˜๊ฒŒ ๋˜๋ฉด ์ž‘์—… ๋ถ€๋‹ด์ด ๋„ˆ๋ฌด ์ปค์งˆ ๊ฒƒ ๊ฐ™์•„ ๊ฑฑ์ •์ด ๋ฉ๋‹ˆ๋‹ค.
  • ์ •๋ฆฌํ•˜๋ฉด ์Šคํ† ๋ฆฌ๋ถ์€ ๊ฐœ๋ฐœ(์‹œ๊ฐํ™” ๋„๊ตฌ)๊ณผ ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•ด์„œ ์‚ฌ์šฉํ•˜๊ณ  docs์œ„ํ•œ ์„ธํŒ…์€ ๊ฐœ๋ฐœ์ด ์•ˆ์ •๋˜์—ˆ์„ ๋•Œ ํ•˜๋Š”๊ฒŒ ์–ด๋–จ๊นŒ์š”?

Copy link
Member Author

@gahyuun gahyuun Feb 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • button component๋ฅผ ๊ฐœ๋ฐœํ•˜๋ฉด์„œ ๋Š๋ผ์ง„ ๋ชปํ–ˆ์ง€๋งŒ ๊ฒฐ๊ตญ ์–ธ์  ๊ฐ€ storybook ์ž‘์„ฑ์ด ๋ถ€๋‹ด์ด ๋  ๊ฒƒ ๊ฐ™๊ธดํ•ฉ๋‹ˆ๋‹ค
  • ๊ทธ๋ž˜์„œ ์ €๋„ ๊ฐœ๋ฐœ์ด ์•ˆ์ •๋˜๊ธฐ ์ „๊นŒ์ง€๋Š” ์Šคํ† ๋ฆฌ๋ถ์„ ์‹œ๊ฐ์  ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•ด์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ฑฐ ์ข‹์Šต๋‹ˆ๋‹ค
  • ๋‹ค๋งŒ description์€ ๊ตณ์ด ๊ฐœ๋ฐœ์„ ํ•˜๋ฉด์„œ ์ž‘์„ฑํ•  ํ•„์š”๋Š” ์—†์ง€๋งŒ , argType์€ ๊ฐœ๋ฐœํ•  ๋•Œ ์ž‘์„ฑ์„ ํ•ด์•ผ control ํ•˜๋ฉด์„œ props ๊ฐ’์— ๋”ฐ๋ฅธ ๋ Œ๋”๋ง ๋ณ€ํ™”๋ฅผ ํ™•์ธํ•˜๋ฉฐ ์‹œ๊ฐ์  ํ…Œ์ŠคํŠธ๋ฅผ ํ•  ์ˆ˜ ์žˆ์ง€ ์•Š์„๊นŒ์š”?!

Copy link
Collaborator

@seonghunYang seonghunYang Feb 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • argtype์ด ์žˆ์–ด์•ผ conrol ์• ๋“œ์˜จ ์‚ฌ์šฉ์ด ๊ฐ€๋Šฅํ•œ ๊ฑด๊ฐ€์š”? ๊ทธ๋Ÿฐ๊ฑฐ๋ผ๋ฉด ํ•„์š”ํ•  ๋“ฏ ํ•˜๋„ค์š”
  • ๊ด€๋ จ ๋ถ€๋ถ„์€ ์ œ๊ฐ€ ์Šคํ† ๋ฆฌ๋ถ์„ ์ข€ ๋” ์—ฐ๊ตฌํ•ด๋ณด๊ณ  ์ถ”ํ›„ ์–ด๋–ป๊ฒŒ ํ•˜๋ฉด ๊ฐ€์žฅ ์ž˜ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์„์ง€ ์˜๊ฒฌ ๊ณต์œ ํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!

Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { Button } from './button';

const meta = {
title: 'ui/view/atom/Button',
component: Button,
tags: ['autodocs'],
parameters: {
componentSubtitle: 'Button์€ ์‚ฌ์šฉ์ž๊ฐ€ ํ•œ ๋ฒˆ์˜ ํƒญ์œผ๋กœ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๊ณ  ์„ ํƒํ•  ์ˆ˜ ์žˆ๋Š” ์ปดํฌ๋„ŒํŠธ์ž…๋‹ˆ๋‹ค.',
docs: {
description: {
component: `
- variant๊ฐ’์œผ๋กœ "primary" | "secondary" | "text" | "delete" ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.\n
- size๊ฐ’์œผ๋กœ "lg" | "md" | "sm" | "xs" | "default" ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.\n
- href ๊ฐ’์œผ๋กœ url์„ ํ• ๋‹นํ•  ์ˆ˜ ์žˆ๊ณ  Link Button ์ผ ๋•Œ ํ•„์ˆ˜์ ์œผ๋กœ ํ• ๋‹นํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.\n
- label ๊ฐ’์œผ๋กœ button ํƒœ๊ทธ์— ์กด์žฌํ•˜๋Š” text๋ฅผ ์˜๋ฏธํ•˜๊ณ  ํ•„์ˆ˜์ ์œผ๋กœ ํ• ๋‹นํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค
`,
},
},
},
argTypes: {
variant: {
description: 'Button์˜ Variant๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.',
table: {
type: { summary: 'ButtonVariant' },
defaultValue: { summary: 'primary' },
},
options: ['primary', 'secondary', 'text', 'delete'],
control: {
type: 'radio',
},
},
size: {
description: 'Button์˜ size๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.',
table: {
type: { summary: 'ButtonSize' },
defaultValue: { summary: 'md' },
},
options: ['lg', 'md', 'sm', 'xs', 'default'],
control: {
type: 'radio',
},
},
href: {
description: 'Link Button์ผ ๋•Œ url์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.',
table: {
type: { summary: 'ButtonHref' },
defaultValue: { summary: '' },
},
},
label: {
description: 'Button์˜ label์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค',
table: {
type: { summary: 'ButtonLabel' },
defaultValue: { summary: '' },
},
},
},
} satisfies Meta<typeof Button>;

export default meta;

export const PrimaryButton: StoryObj<typeof Button> = {
args: {
size: 'md',
variant: 'primary',
label: '์ˆ˜๊ฐ•ํ˜„ํ™ฉ ์ž์„ธํžˆ๋ณด๊ธฐ',
},
render: (args) => <Button {...args} />,
};

export const SecondaryButton: StoryObj<typeof Button> = {
args: {
size: 'xs',
variant: 'secondary',
label: '์ปค์Šคํ…€ํ•˜๊ธฐ',
},
render: (args) => <Button {...args} />,
};

export const DeleteButton: StoryObj<typeof Button> = {
args: {
size: 'default',
variant: 'delete',
label: '์‚ญ์ œ',
},
render: (args) => <Button {...args} />,
};
Comment on lines +56 to +81
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[comment]

  • text ํƒ€์ž…์ด ๋น ์ง„ ๊ฒƒ ๊ฐ™์€๋ฐ ์ด์œ ๊ฐ€ ์žˆ์—ˆ๋‚˜์š”?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ฒ˜์Œ์—๋Š” text๋ฅผ label์ด ์•„๋‹Œ children์œผ๋กœ ๋ฐ›์•˜๊ธฐ์— ์ง€์ •ํ•ด์ฃผ๋Š” ๋ณ„ ๋‹ค๋ฅธ ์Šคํƒ€์ผ์ด ์—†์—ˆ๊ณ  ์Šคํ† ๋ฆฌ๋ถ์— ๊ตณ์ด ์ž‘์„ฑํ•ง ํ•„์š”๊ฐ€ ์—†๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ ์ž‘์„ฑํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค!
ํ•˜์ง€๋งŒ text๋ฅผ label prop์œผ๋กœ ๋ฐ›๋Š” ๊ฑธ๋กœ ๋ณ€๊ฒฝํ•ด์„œ,,,, ์ถ”๊ฐ€์ ์œผ๋กœ ์ž‘์„ฑํ•ด์„œ ์ปค๋ฐ‹ํ–ˆ์Šต๋‹ˆ๋‹ค!
e76ded8

41 changes: 41 additions & 0 deletions app/ui/view/atom/button/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { cva } from 'class-variance-authority';
import Link from 'next/link';
import { ButtonHTMLAttributes } from 'react';

interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
label: string;
variant?: 'primary' | 'secondary' | 'text' | 'delete';
size?: 'xs' | 'sm' | 'md' | 'lg' | 'default';
href?: string;
}
export function Button({ label, variant = 'primary', size = 'default', href, ...props }: ButtonProps) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[request change]

  • ์žฌ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์ปดํฌ๋„ŒํŠธ๋ผ๋ฉด, forwardRef๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ref๋ฅผ prop์œผ๋กœ ๋ฐ›์„ ์ˆ˜ ์žˆ๋„๋ก ํ•ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ €๋„ forwardRef๋ฅผ ์‚ฌ์šฉํ•ด์•ผํ• ๊นŒ? ๋ผ๋Š” ๊ณ ๋ฏผ์„ ํ–ˆ์—ˆ๋Š”๋ฐ, input์€ focusํ•  ๋•Œ ์‚ฌ์šฉ์ด ๋˜์ง€๋งŒ button์€ ref๋ฅผ ์‚ฌ์šฉํ•  ์ผ์ด ๋”ฑํžˆ ๋– ์˜ค๋ฅด์ง€ ์•Š์•„์„œ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค!
ํ†ต์ผ์„ฑ ๋•Œ๋ฌธ์ธ์ง€, ํ™•์žฅ ๊ฐ€๋Šฅ์„ฑ ๋•Œ๋ฌธ์ธ์ง€, ์•„๋‹ˆ๋ฉด ref๋ฅผ ์“ธ ์ผ์ด ์ •๋ง ๋งŽ๊ธฐ ๋•Œ๋ฌธ์ธ์ง€ ์ถ”๊ฐ€์ ์œผ๋กœ ์„ค๋ช…ํ•ด์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค~!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ํ™•์žฅ์„ฑ๊ณผ ์™„์„ฑ๋„ ๋•Œ๋ฌธ์ด๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ref๊ฐ€ ์ง€๊ธˆ ๋‹น์žฅ ํ•„์š”ํ•˜์ง€ ์•Š์€ ๋ถ€๋ถ„์— ์‚ฌ์šฉ๋˜๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์ผ ์ˆ˜ ์žˆ์ง€๋งŒ, button๊ณผ ๊ฐ™์ด ์žฌ์‚ฌ์šฉ ๊ฐ€๋Šฅ์„ฑ์ด ๋†’์€ ์ตœํ•˜์œ„ ์ปดํฌ๋„ŒํŠธ์˜ ๊ฒฝ์šฐ ref๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ์ง€์›ํ•ด์•ผ ํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•ด์š”.
  • ref๋Š” ์‹ค์ œ DOM์— ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ฃผ๋Š” ๊ธฐ๋Šฅ์ด๋ฏ€๋กœ, ์‹ค์ œ DOM ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฐ€์žฅ ๊ธฐ๋ณธ์ ์ธ ์ปดํฌ๋„ŒํŠธ๋Š” ์ด๋ฅผ ์ง€์›ํ•ด์•ผ์ง€, ๋‚˜์ค‘์— ์ด ์ปดํฌ๋„ŒํŠธ๋ฅผ ์žฌ์‚ฌ์šฉํ•  ๋•Œ ์˜คํ•ด๊ฐ€ ์ƒ๊ธฐ์ง€ ์•Š์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•— ๊ทธ๋ ‡๊ตฐ์š” ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค~!
8323010

const ButtonVariants = cva(`flex justify-center items-center px-[6px] py-[1px]`, {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[comment]

  • CVA๋ฅผ ์‚ฌ์šฉํ•ด๋ณด์ง„ ์•Š์•˜์ง€๋งŒ, variant ๊ด€๋ฆฌ๊ฐ€ ํŽธ๋ฆฌํ•ด ๋ณด์ด๋„ค์š”. ์ข‹์Šต๋‹ˆ๋‹ค~

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ชจ๋ฅด๊ณ  ์žˆ๋˜ ๋ฐฉ๋ฒ•์ธ๋ฐ ๋•๋ถ„์— ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค ๐Ÿ‘

variants: {
variant: {
primary: 'bg-primary rounded-[100px] text-white border-0',
secondary: 'bg-white rounded-[100px] border-solid border-[1px] border-gray',
text: '',
delete: 'py-[7px] px-[14px] bg-[#35353559] rounded-[7px] text-white leading-5 font-medium text-[18px]',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[request change]

  • ๊ธฐ์กด ์กธ๋ถ€๋ณด๋‹ค UX๋ฅผ ๊ฐœ์„ ํ•˜๊ธฐ ์œ„ํ•ด ๋ฒ„ํŠผ์ด hover ๋˜์—ˆ์„ ๋•Œ ์†์„ฑ์„ ์ถ”๊ฐ€ํ•˜๋ฉด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค. ์ œ๊ฐ€ ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ์‹ ๊ณต์œ ํ• ๊ฒŒ์š”
  • primary hover ์ƒํƒœ์ผ ๋•Œ background์™€ border color๋Š” ์›์ƒ‰๋ณด๋‹ค shade๊ฐ€ 200 ์ •๋„ ๋†’๊ฒŒ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.
  • secondary๋Š” background color๋ฅผ ์›์ƒ‰์— ํˆฌ๋ช…๋„ 20%๋ฅผ ์ฃผ๋Š” ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
  • text๋Š” text color๋ฅผ ์›์ƒ‰๋ณด๋‹ค shade๋ฅผ 200์ •๋„ ๋†’๊ฒŒ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

์ €ํฌ๊ฐ€ ์ปฌ๋Ÿฌ ํŒ”๋ ˆํŠธ๊ฐ€ ๋”ฐ๋กœ ์—†๋Š” ๊ฒƒ์œผ๋กœ ์•Œ๊ณ  ์žˆ๋Š”๋ฐ, theme ์„ค์ •์— ๋Œ€ํ•ด ๋…ผ์˜๋ฅผ ํ•ด๋ด์•ผ๊ฒ ๋„ค์š”. ์ž‘์„ฑํ•˜๋Š” ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‹ˆ color์— ๋Œ€ํ•ด์„œ ๊ณ ๋ฏผํ•˜์‹  ๊ฒƒ ๊ฐ™์€๋ฐ, ์ข‹์€ ์˜๊ฒฌ์ด๋‚˜ ์ƒ๊ฐํ•˜์‹  ๋ฐฉ์•ˆ์ด ์žˆ์œผ๋ฉด ์˜๊ฒฌ ๋‚˜๋ˆ„๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hover ์ ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค! 77241e9
secondary๋Š” button ์‚ฌ์šฉํ•˜๋Š” ์ปดํฌ๋„ŒํŠธ์˜ ๋ฐฐ๊ฒฝ์ƒ‰์ด white์ธ ๊ฒฝ์šฐ๊ฐ€ ์žˆ์–ด์„œ ํˆฌ๋ช…๋„๋ฅผ ์ฃผ์—ˆ์„ ๋•Œ ์•„๋ฌด๋Ÿฐ ํšจ๊ณผ๊ฐ€ ์—†์–ด๋ณด์ผ ๊ฒƒ ๊ฐ™์•„ ๋”ฐ๋กœ ์ƒ‰์„ ์ง€์ •ํ•ด์คฌ์Šต๋‹ˆ๋‹ค!
ํŒ”๋ ˆํŠธ ๊ฐ™์€ ๊ฒฝ์šฐ ๋‚ด์ผ ํšŒ์˜ ๋•Œ ๊ฐ„๋‹จํžˆ ์–˜๊ธฐํ•ด๋ด๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค. ์Šคํ† ๋ฆฌ๋ถ ์žˆ์œผ๋‹ˆ๊นŒ ํ™•์ธํ•˜๊ธฐ ๋„ˆ๋ฌด ์ข‹๋„ค์š”

},
size: {
default: '',
xs: 'w-[116px] h-[47px] text-lg font-medium leading-5',
sm: 'w-[144px] h-10 text-sm font-medium leading-3',
md: 'w-[198px] h-12 text-lg font-medium leading-3',
lg: 'w-[396px] h-20 text-3xl font-medium leading-9',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ฐ˜์‘ํ˜•์— ๋”ฐ๋ฅธ ํฌ๊ธฐ ์กฐ์ •์ด ๊ฐ€๋Šฅํ•œ๊ฐ€์š”?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ผ๋‹จ์€ width๋ฅผ padding์œผ๋กœ ๋ณ€๊ฒฝํ•œ ์ƒํƒœ์ž…๋‹ˆ๋‹ค! breakpoint์— ๋”ฐ๋ฅธ ์กฐ์ •์ด ํ•„์š”ํ•˜๋‹ค๋ฉด ๊ฐœ๋ฐœ ์ง„ํ–‰ํ•˜๋ฉด์„œ ๋ฆฌํŒฉํ† ๋ง ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค
43a32f3

},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[comment]

  • ๋ฒ„ํŠผ์˜ ํฌ๊ธฐ๋ฅผ ์„ค์ •ํ•  ๋•Œ๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ๋‘ ๊ฐ€์ง€ ๋ฐฉ์‹์ด ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋Š”๋ฐ์š”. 1. ๋„“์ด๋ฅผ ์ง€์ •ํ•˜๋Š” ๋ฐฉ์‹, 2. ํŒจ๋”ฉ๊ณผ ํฐํŠธ ํฌ๊ธฐ๋ฅผ ์ง€์ •ํ•˜๋Š” ๋ฐฉ์‹์ž…๋‹ˆ๋‹ค.
  • ๊ธฐ์กด ๋””์ž์ธ ์‹œ์Šคํ…œ์— ๋งž์ถ”๊ธฐ ์œ„ํ•ด ๋„“์ด ์ง€์ • ๋ฐฉ์‹์„ ์„ ํƒํ•œ ๊ฒƒ ๊ฐ™์•„ ๋ณด์ž…๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ œ ๊ฐœ์ธ์ ์œผ๋กœ ๊ธฐ์กด ๋””์ž์ธ ์‹œ์Šคํ…œ์„ ๋”ฐ๋ฅด๋Š”๊ฒŒ ์˜ฌ๋ฐ”๋ฅธ ์„ ํƒ์ธ๊ฐ€์— ๋Œ€ํ•œ ์˜๋ฌธ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ €๋ฒˆ ๊ฐœ๋ฐœ ๋•Œ๋„ ๋””์ž์ธ ์‹œ์Šคํ…œ์„ ๋””์ž์ด๋„ˆ ๋ถ„๋“ค์ด ๊ณต์‹์ ์œผ๋กœ ๋งŒ๋“  ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ๊ฐœ๋ฐœ ๊ณผ์ •์—์„œ ๋ฌธ์ œ๊ฐ€ ๋งŽ์•˜๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.
  • ๋„“์ด๋ฅผ ์ง์ ‘ ์ง€์ •ํ•˜๋Š” ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•˜๋ฉด ๋‹ค์–‘ํ•œ ์œ ์Šค์ผ€์ด์Šค๋ฅผ ์ปค๋ฒ„ํ•˜๊ธฐ ์–ด๋ ต๋‹ค๋Š” ๋‹จ์ ์ด ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ์ด์— ๋Œ€ํ•ด ๋‚˜์ค‘์— ๊ณ ๋ฏผ์ด ํ•„์š”ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
  • ์ˆ˜์ • ์š”์ฒญ์€ ์•„๋‹ˆ๊ณ , ์ด์ „ ๊ฐœ๋ฐœ ๋‹น์‹œ์— ์ด์Šˆ๊ฐ€ ์žˆ์—ˆ๋‹ค๋Š” ์ ์„ ๊ณต์œ ํ•˜๊ณ , ๋‚˜์ค‘์— ์ˆ˜์ •์ด ํ•„์š”ํ•˜๋‹ค๋ฉด ๋…ผ์˜๋ฅผ ํ•˜๊ธฐ ์œ„ํ•ด ์ง€์‹ ๊ณต์œ  ์ฐจ ์˜๊ฒฌ ๋‚จ๊น๋‹ˆ๋‹ค.์ง€์‹ ๊ณต์œ ๋ฅผ ํ•ฉ๋‹ˆ๋‹ค.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค! ์ˆ˜์ •ํ•  ๋•Œ ์ฐธ๊ณ ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!

},
});

if (href)
return (
<Link className={ButtonVariants({ variant, size })} href={href}>
{label}
</Link>
);
return (
<button className={ButtonVariants({ variant, size })} {...props}>
{label}
</button>
);
}
Loading
Loading