From 44710de5f242452aec088d2a6fd9bed74564a390 Mon Sep 17 00:00:00 2001 From: sylwia-werner Date: Wed, 12 Nov 2025 13:58:42 +0100 Subject: [PATCH 1/2] fix: add clickable icon button to input component --- src/components/atoms/Input/Input.tsx | 23 +++++++++++++++---- .../molecules/NavbarSearch/NavbarSearch.tsx | 11 +++++++-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/components/atoms/Input/Input.tsx b/src/components/atoms/Input/Input.tsx index 92268a21..48aa9730 100644 --- a/src/components/atoms/Input/Input.tsx +++ b/src/components/atoms/Input/Input.tsx @@ -4,6 +4,7 @@ import { cn } from "@/lib/utils" import { CloseIcon } from "@/icons" import { useEffect, useState } from "react" import { EyeMini, EyeSlashMini } from "@medusajs/icons" +import { IconButton } from "../IconButton/IconButton" interface InputProps extends React.InputHTMLAttributes { label?: string @@ -11,6 +12,8 @@ interface InputProps extends React.InputHTMLAttributes { clearable?: boolean error?: boolean changeValue?: (value: string) => void + onIconClick?: () => void + iconAriaLabel?: string } export function Input({ @@ -20,6 +23,8 @@ export function Input({ className, error, changeValue, + onIconClick, + iconAriaLabel, ...props }: InputProps) { const [showPassword, setShowPassword] = useState(false) @@ -47,10 +52,20 @@ export function Input({ } return ( -