Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip component #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Tooltip component #8

wants to merge 4 commits into from

Conversation

nighto
Copy link
Collaborator

@nighto nighto commented Oct 17, 2024

No description provided.

* Tooltip title. Can be optionally used as tooltip children.
*/
export const TooltipTitle = ({ children }: TooltipTitleProps) => (
<h1 className={cl['bk-tooltip--title']}>{children}</h1>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think class name bk-tooltip--title should be bk-tooltip__title in BEM (https://getbem.com/naming/).
The same goes for bk-tooltip--alert and bk-tooltip--icon in the code below.

@@ -26,7 +32,44 @@ export const Tooltip = ({ unstyled = false, ...propsRest }: TooltipProps) => {
bk: true,
[cl['bk-tooltip']]: !unstyled,
'bk-body-text': !unstyled,
[cl['bk-tooltip--size-small']]: size === 'small',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bk-tooltip--size-small can be bk-tooltip--small if we follow the same way as different components like bk-spinner--small or bk-link--small format.

<h1 className={cl['bk-tooltip--title']}>{children}</h1>
);

export type TooltipItemProps = React.PropsWithChildren<ComponentProps<'h1'> & {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ComponentProps<'h1'> should be ComponentProps<'p'> as TooltipItem has p element?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants