-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,326 additions
and
1,365 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
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 |
---|---|---|
|
@@ -12,11 +12,11 @@ | |
"release": "turbo run build --filter=!./apps/* && changeset publish" | ||
}, | ||
"devDependencies": { | ||
"@changesets/cli": "^2.27.5", | ||
"eslint": "^9.4.0", | ||
"@changesets/cli": "^2.27.7", | ||
"eslint": "^9.6.0", | ||
"eslint-config-parte": "workspace:*", | ||
"prettier": "^3.3.2", | ||
"turbo": "^2.0.3" | ||
"turbo": "^2.0.6" | ||
}, | ||
"packageManager": "[email protected]", | ||
"name": "parte" | ||
|
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,5 +1,11 @@ | ||
# @parte-ds/ui | ||
|
||
## 1.22.8 | ||
|
||
### Patch Changes | ||
|
||
- Fix filter button to foward ref comp | ||
|
||
## 1.22.7 | ||
|
||
### Patch Changes | ||
|
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 |
---|---|---|
@@ -1,28 +1,30 @@ | ||
import { forwardRef } from "react"; | ||
import { FilterButtonProps } from "./FilterButton.types"; | ||
import { forwardRef, PropsWithChildren } from "react"; | ||
import { FilterTwoIcon } from "../../../parte-icons/src"; | ||
import { StyledFilterButton } from "./FilterButton.styled"; | ||
import { Caption } from "../@foundations"; | ||
import type { FilterButtonProps } from "./FilterButton.types"; | ||
|
||
export const FilterButton = ({ | ||
selectedCount, | ||
size = "large", | ||
type = "fill", | ||
text = "필터", | ||
}: FilterButtonProps) => { | ||
return ( | ||
<StyledFilterButton | ||
selectedCount={selectedCount} | ||
size={size} | ||
type={type} | ||
data-selected={selectedCount ? selectedCount > 0 : false} | ||
> | ||
<FilterTwoIcon size={size === "large" ? 20 : 16} /> | ||
<Caption size={size === "large" ? 300 : 200}> | ||
{text} {selectedCount === 0 ? "" : selectedCount} | ||
</Caption> | ||
</StyledFilterButton> | ||
); | ||
}; | ||
export const FilterButton = forwardRef< | ||
HTMLButtonElement, | ||
PropsWithChildren<FilterButtonProps> | ||
>( | ||
( | ||
{ selectedCount, size = "large", variant = "fill", children, ...rest }, | ||
ref, | ||
) => { | ||
return ( | ||
<StyledFilterButton | ||
ref={ref} | ||
$size={size} | ||
$variant={variant} | ||
data-active={selectedCount ? selectedCount > 0 : false} | ||
type="button" | ||
{...rest} | ||
> | ||
<FilterTwoIcon size={size === "large" ? 20 : 16} /> | ||
{children} {selectedCount === 0 ? "" : selectedCount} | ||
</StyledFilterButton> | ||
); | ||
}, | ||
); | ||
|
||
FilterButton.displayName = "FilterButton"; |
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,8 +1,13 @@ | ||
export type FilterButtonType = "fill" | "outline"; | ||
export type FilterButtonVariant = "fill" | "outline"; | ||
export type FilterButtonSize = "medium" | "large"; | ||
export type FilterButtonProps = { | ||
selectedCount?: number; | ||
size?: FilterButtonSize; | ||
type?: FilterButtonType; | ||
variant?: FilterButtonVariant; | ||
text?: string; | ||
}; | ||
|
||
export type FilterButtonStyledProps = { | ||
$size: FilterButtonSize; | ||
$variant: FilterButtonVariant; | ||
}; |
Oops, something went wrong.