From 99d7d701dd91470e641e058f46af3d23d72deaf8 Mon Sep 17 00:00:00 2001 From: Maksim Efremov Date: Wed, 6 Mar 2024 18:32:07 +0300 Subject: [PATCH] fix: better question-icon position (cherry picked from commit 258f9d7c3a26211ce96735b116e91dffbd247a6f) --- src/dialog/Dialog/Dialog.scss | 5 +++++ src/dialog/Dialog/Dialog.tsx | 2 +- src/dialog/Icon/Icon.tsx | 3 ++- src/stories/dialog/00_Base_controls.stories.tsx | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/dialog/Dialog/Dialog.scss b/src/dialog/Dialog/Dialog.scss index eb301cc..1c4040c 100644 --- a/src/dialog/Dialog/Dialog.scss +++ b/src/dialog/Dialog/Dialog.scss @@ -238,4 +238,9 @@ padding: var(--yc-dialog-body-padding); flex: 1 1 100%; } + + &__q-icon { + position: relative; + top: 2px; + } } diff --git a/src/dialog/Dialog/Dialog.tsx b/src/dialog/Dialog/Dialog.tsx index 00ebfa8..4b04bc6 100644 --- a/src/dialog/Dialog/Dialog.tsx +++ b/src/dialog/Dialog/Dialog.tsx @@ -514,7 +514,7 @@ class Dialog< delayClosing={150} placement={['bottom', 'top', 'right']} > - + )} diff --git a/src/dialog/Icon/Icon.tsx b/src/dialog/Icon/Icon.tsx index 2e7152c..e18a031 100644 --- a/src/dialog/Icon/Icon.tsx +++ b/src/dialog/Icon/Icon.tsx @@ -118,9 +118,10 @@ export function WarningIcon(props: React.SVGProps) { ); } -export function TooltipIcon() { +export function TooltipIcon({className}: {className?: string} = {}) { return ( (type: T, extras?: E) { - const res = {type, name: type, required: true, caption: type}; + const res = {type, name: type, required: true, caption: type, tooltip: `Help for ${type}`}; if (extras) { Object.assign(res, {extras}); }