-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 공통 인풋 컴포넌트 분리 및 적용 (#ATR-603)
- Loading branch information
Showing
10 changed files
with
91 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
@import 'label'; | ||
@import 'select'; | ||
@import 'dimmed'; | ||
@import 'input-description'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/design-system/packages/core/src/components/input-description/InputDescription.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react' | ||
import { cn } from '@attraction/utils' | ||
|
||
interface InputDescriptionProps | ||
extends React.DetailedHTMLProps< | ||
React.HTMLAttributes<HTMLParagraphElement>, | ||
HTMLParagraphElement | ||
> {} | ||
|
||
const InputDescription = React.forwardRef< | ||
HTMLParagraphElement, | ||
InputDescriptionProps | ||
>(({ className, ...props }, ref) => { | ||
if (!props.children) { | ||
return null | ||
} | ||
return ( | ||
<p ref={ref} className={cn('ds-input-description', className)} {...props} /> | ||
) | ||
}) | ||
|
||
export default InputDescription |
42 changes: 42 additions & 0 deletions
42
packages/design-system/packages/core/src/components/input-description/_index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
@use '../../token/variable'; | ||
|
||
.ds-input-description { | ||
display: block; | ||
width: 100%; | ||
height: auto; | ||
box-sizing: border-box; | ||
margin: 0px; | ||
margin-top: 0.75rem; | ||
padding: 0px 0.25rem; | ||
font-size: variable.$ds-font-size-300; | ||
font-weight: variable.$ds-font-weight-regular; | ||
color: variable.$ds-gray-500; | ||
line-height: variable.$ds-leading-normal; | ||
word-break: keep-all; | ||
.dark & { | ||
color: variable.$ds-gray-400; | ||
} | ||
|
||
*[class$='--size-lg'] & { | ||
margin-top: 1rem; | ||
} | ||
|
||
*[class$='--danger'] & { | ||
color: variable.$ds-red-400; | ||
.dark & { | ||
color: variable.$ds-red-300; | ||
} | ||
} | ||
*[class$='--warn'] & { | ||
color: variable.$ds-yellow-400; | ||
.dark & { | ||
color: variable.$ds-yellow-300; | ||
} | ||
} | ||
*[class$='--success'] & { | ||
color: variable.$ds-green-400; | ||
.dark & { | ||
color: variable.$ds-green-300; | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/design-system/packages/core/src/components/input-description/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as InputDescription } from './InputDescription' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters