Skip to content

Commit

Permalink
refactor: text input 컴포넌트 border 옵션 추가 (#ATR-606)
Browse files Browse the repository at this point in the history
  • Loading branch information
LC-02s committed Sep 14, 2024
1 parent 598b139 commit 20d5684
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ const meta: Meta<typeof TextInput> = {
defaultValue: { summary: 'sm' },
},
},
border: {
description: '인풋의 테두리 지정 여부를 지정합니다.',
control: 'select',
options: ['default', 'none'],
table: {
type: { summary: ['default', 'none'].join(' | ') },
defaultValue: { summary: 'default' },
},
},
disabled: {
description: '인풋의 비활성화 상태를 지정합니다.',
control: 'boolean',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export const variants = {
none: '',
with: getTextInputModifier('background'),
},
border: {
default: '',
none: getTextInputModifier('border-none'),
},
}

export const textInputVariants = cva(textInputClassName, {
Expand All @@ -37,5 +41,6 @@ export const textInputVariants = cva(textInputClassName, {
size: 'md',
round: 'sm',
background: 'none',
border: 'default',
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface TextProps
state?: keyof TextInputVariant['state']
size?: keyof TextInputVariant['size']
round?: keyof TextInputVariant['round']
border?: keyof TextInputVariant['border']
withBackground?: boolean
label?: React.ReactNode
description?: React.ReactNode
Expand All @@ -33,6 +34,7 @@ const TextInput = React.forwardRef<HTMLInputElement, TextProps>(
size,
round,
withBackground,
border,
...props
},
ref,
Expand All @@ -44,6 +46,7 @@ const TextInput = React.forwardRef<HTMLInputElement, TextProps>(
size,
round,
background: withBackground ? 'with' : null,
border,
}),
className,
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,8 @@
font-size: variable.$ds-font-size-400;
}
}

&--border-none > input {
border: none;
}
}

0 comments on commit 20d5684

Please sign in to comment.