diff --git a/ui-core/src/components/inputs/Input.tsx b/ui-core/src/components/inputs/Input.tsx index 90553ef4a..da7802e64 100644 --- a/ui-core/src/components/inputs/Input.tsx +++ b/ui-core/src/components/inputs/Input.tsx @@ -67,6 +67,7 @@ const Input = React.forwardRef( readOnly = false, statusWithMessage, inputFieldWrapperClassname = '', + statusIconPosition, small = false, withIcons = [], onKeyUp, @@ -86,7 +87,7 @@ const Input = React.forwardRef( disabled={disabled} required={required} small={small} - statusIconPosition="before-status-message" + statusIconPosition={statusIconPosition} className={cx('input-field-wrapper', inputFieldWrapperClassname)} >
{showIcon && } diff --git a/ui-core/src/stories/Input.stories.tsx b/ui-core/src/stories/Input.stories.tsx index 7be7d09cd..a8c4183f0 100644 --- a/ui-core/src/stories/Input.stories.tsx +++ b/ui-core/src/stories/Input.stories.tsx @@ -172,7 +172,23 @@ export const ErrorInput: Story = { }, }, }; + export const TooltipErrorInput: Story = { + args: { + label: 'Name', + type: 'text', + required: true, + value: 'Michel Sardou', + statusWithMessage: { + tooltip: 'right', + status: 'error', + message: '“Michel Sardou” can’t be used', + }, + statusIconPosition: 'before-status-message', + }, +}; + +export const TwoTooltipErrorInput: Story = { decorators: [ (Story) => (
diff --git a/ui-core/src/styles/inputs/fieldWrapper.css b/ui-core/src/styles/inputs/fieldWrapper.css index 6845d24fc..ca29703bb 100644 --- a/ui-core/src/styles/inputs/fieldWrapper.css +++ b/ui-core/src/styles/inputs/fieldWrapper.css @@ -33,40 +33,33 @@ } } - input:focus:has(.status-message-wrapper-tooltip) .status-message-wrapper-tooltip { - z-index: 2; - } - .status-message-wrapper-tooltip { position: absolute; display: flex; align-items: center; width: 320px; - top: 60px; + top: 74px; gap: 12px; border-radius: 8px; box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgba(255, 255, 255, 0.6) inset; - background-color: theme('colors.error.5'); - opacity: 1; - padding: 8px 12px; + padding: 6px 12px 10px; min-height: 64px; - z-index: 10; transition: var(--tooltip-transition-duration) ease; .status-message { - opacity: 1; - color: theme('colors.error.60'); - font-size: 16px; font-weight: 600; - font-style: SemiBold; - letter-spacing: 0px; text-align: left; - line-height: 24px; } } + + .error { + background-color: theme('colors.error.5'); + color: theme('colors.error.60'); + } + .tooltip-left { left: -5px; }