-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(FieldBox): FieldBox 컴포넌트에 TopAddon을 추가합니다. (#223)
* feat: Add FieldBox/TopAddon * cs * fix: TopAddon 을 활용한 방식으로 문서 수정,
- Loading branch information
Showing
8 changed files
with
102 additions
and
20 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sopt-makers/ui': minor | ||
--- | ||
|
||
Add FieldBox/TopAddon |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { HTMLAttributes, ReactNode } from 'react'; | ||
import { forwardRef } from 'react'; | ||
import { topAddonContainerStyle } from '../style.css'; | ||
|
||
export interface FieldBoxTopAddonProps extends HTMLAttributes<HTMLDivElement> { | ||
leftAddon?: ReactNode; | ||
rightAddon?: ReactNode; | ||
} | ||
|
||
export const TopAddon = forwardRef<HTMLDivElement, FieldBoxTopAddonProps>((props, forwardedRef) => { | ||
const { leftAddon, rightAddon } = props; | ||
|
||
return ( | ||
<div className={topAddonContainerStyle} ref={forwardedRef}> | ||
{leftAddon} | ||
{rightAddon} | ||
</div> | ||
); | ||
}); | ||
|
||
TopAddon.displayName = 'TopAddon'; |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './Label'; | ||
export * from './TopAddon'; | ||
export * from './BottomAddon'; | ||
export * from './ErrorMessage'; |
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