Skip to content

Commit

Permalink
fix: padding error on startIcon and endIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
nahoc committed May 3, 2024
1 parent 2d36c49 commit bd553bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(({ startIcon, endIcon, cl
className={cn(
"peer flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm transition-colors disabled:cursor-not-allowed file:border-0 file:bg-transparent file:font-medium file:text-sm placeholder:text-muted-foreground disabled:opacity-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
startIcon && "pl-9",
endIcon && "pr-9",
className,
)}
ref={ref}
Expand All @@ -22,14 +23,14 @@ const Input = forwardRef<HTMLInputElement, InputProps>(({ startIcon, endIcon, cl
{startIcon &&
cloneElement(startIcon as ReactElement, {
className: cn(
"absolute top-2.5 left-3 mr-2 size-4 text-muted-foreground peer-disabled:text-muted peer-focus-visible:text-primary",
"absolute top-2.5 left-3 size-4 text-muted-foreground peer-disabled:text-muted peer-focus-visible:text-primary",
startIcon.props.className,
),
})}
{endIcon &&
cloneElement(endIcon as ReactElement, {
className: cn(
"absolute top-2.5 right-3 mr-2 size-4 text-muted-foreground peer-disabled:text-muted peer-focus-visible:text-primary",
"absolute top-2.5 right-3 size-4 text-muted-foreground peer-disabled:text-muted peer-focus-visible:text-primary",
endIcon.props.className,
),
})}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@risc0/ui",
"version": "0.0.60",
"version": "0.0.61",
"sideEffects": false,
"type": "module",
"scripts": {
Expand Down

0 comments on commit bd553bd

Please sign in to comment.