diff --git a/src/lib/form/field.tsx b/src/lib/form/field.tsx index 2f39236..41cf2b9 100644 --- a/src/lib/form/field.tsx +++ b/src/lib/form/field.tsx @@ -73,8 +73,18 @@ export const baseInputStyle = css` } `; -const StyledInput = styled.input` - padding: 14px 40px 14px 16px; +const StyledInput = styled.input<{ + variant?: string; + Icon?: React.FC>; +}>` + padding-top: 14px; + padding-bottom: 14px; + padding-left: 16px; + padding-right: ${({ Icon, variant }) => { + if (Icon) return "56px"; + if (variant) return "44px"; + return "16px"; + }}; ${baseInputStyle} `; @@ -101,20 +111,47 @@ const StyledSmall = styled.small` color: ${variantColor}; `; +const IconContainer = styled.div` + display: flex; + width: 44px; + height: 43px; + position: absolute; + top: 1px; + right: 1px; + align-items: center; + justify-content: center; + background: ${(props) => props.theme.klerosUIComponentsLightBlue}; + border-left: 1px solid ${(props) => props.theme.klerosUIComponentsStroke}; +`; + +const StyledIconSVG = styled.svg` + width: 24px; + height: 24px; +`; + type FieldProps = VariantProp & - InputHTMLAttributes & { message?: string }; + InputHTMLAttributes & { + message?: string; + Icon?: React.FC>; + }; const Field: React.FC = ({ variant, message, + Icon, className, ...props }) => ( - + {variant === "success" && } {variant === "warning" && } {variant === "error" && } + {Icon && ( + + + + )} {message && ( {variant === "info" && (