diff --git a/packages/input/InputGroup.tsx b/packages/input/InputGroup.tsx index 3ab5b99e..7c651686 100644 --- a/packages/input/InputGroup.tsx +++ b/packages/input/InputGroup.tsx @@ -5,11 +5,19 @@ import { InputGroupProps } from './types.js' export const InputGroup = forwardRef( ( - { fullwidth = false, error, success, children, ...rest }: InputGroupProps, + { + fullwidth = false, + error, + success, + warning, + children, + ...rest + }: InputGroupProps, ref?: ForwardedRef, ) => { const hasError = !!error const hasSuccess = !!success && !error + const hasWarning = !hasError && !!warning // `error` overrides `warning` return ( @@ -20,6 +28,9 @@ export const InputGroup = forwardRef( {hasSuccess && ( {success} )} + {hasWarning && ( + {warning} + )} ) }, diff --git a/packages/input/types.ts b/packages/input/types.ts index ffa30a00..9d262155 100644 --- a/packages/input/types.ts +++ b/packages/input/types.ts @@ -62,6 +62,7 @@ export type InputGroupProps = LidoComponentProps< fullwidth?: boolean error?: ReactNode success?: ReactNode + warning?: ReactNode } >