Skip to content

Commit 82aa066

Browse files
authored
Merge pull request #107 from COW-dev/refactor/#99-select
[REFACTOR] Select 컴포넌트 크기 맞춤, drag svg 추가
2 parents 0844966 + 31f707b commit 82aa066

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

src/shared/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export { FileUpload } from './ui/FileUpload/FileUpload';
1111
export { Flex } from './ui/Flex';
1212
export { Icon } from './ui/Icon';
1313
export { IconButton } from './ui/IconButton';
14-
export { Input } from './ui/Input/Input';
14+
export { Input } from './ui/Input';
1515
export { ImageGallery } from './ui/ImageGallery';
1616
export { Modal } from './ui/Modal';
1717
export { MediaUpload } from './ui/MediaUpload';

src/shared/ui/Select/SelectButton.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,46 @@ type Props = {
2121
* The size of the button.
2222
*/
2323
size?: 'md' | 'lg';
24+
/**
25+
* Custom class name for styling.
26+
*/
27+
className?: string;
2428
};
2529

2630
const sizeVariants = {
27-
md: 'px-3 py-1 text-sm min-w-24',
28-
lg: 'px-4 py-3.5 min-w-64 text-lg',
31+
md: 'px-3 py-1 text-sm min-w-24 rounded-lg',
32+
lg: 'px-4 py-3.5 min-w-64 min-h-[52px] rounded-xl',
2933
} as const;
3034

31-
export function SelectButton({ selected, onClick, isOpen, size = 'lg' }: Props) {
35+
export function SelectButton({
36+
selected,
37+
onClick,
38+
isOpen,
39+
size = 'lg',
40+
className,
41+
...props
42+
}: Props) {
3243
return (
3344
<Flex
3445
alignItems="center"
3546
onClick={onClick}
3647
className={cn(
3748
sizeVariants[size],
38-
'w-full rounded-lg border border-gray-200 bg-white font-semibold text-gray-400'
49+
'w-full border border-gray-200 bg-white font-semibold text-gray-400',
50+
className
3951
)}
52+
{...props}
4053
>
4154
<button
4255
type="button"
4356
className={cn(
44-
'flex w-full cursor-pointer items-center justify-between rounded-lg align-middle',
57+
'flex w-full cursor-pointer items-center justify-between rounded-xl align-middle leading-none',
4558
isOpen && 'hover:rounded-b-none'
4659
)}
4760
>
4861
{selected}
4962
<Icon
63+
size={20}
5064
name="arrowDown"
5165
className={cn(
5266
'transform transition-transform duration-300',

src/shared/ui/assets/drag.svg

Lines changed: 4 additions & 0 deletions
Loading

src/shared/ui/assets/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Check from './check.svg';
99
import Close from './close.svg';
1010
import Dots from './dots.svg';
1111
import DownLoad from './download.svg';
12+
import Drag from './drag.svg';
1213
import Dustpan from './dustpan.svg';
1314
import Etc from './etc.svg';
1415
import File from './file.svg';
@@ -39,6 +40,7 @@ export const Icons = {
3940
camera: Camera,
4041
chart: Chart,
4142
download: DownLoad,
43+
drag: Drag,
4244
dots: Dots,
4345
dustpan: Dustpan,
4446
peoples: Peoples,

0 commit comments

Comments
 (0)