mirror of
https://github.com/aljazceru/opencode.git
synced 2026-02-23 00:35:24 +01:00
feat(desktop): better tooltips
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { Tooltip as KobalteTooltip } from "@kobalte/core/tooltip"
|
||||
import { children, createEffect, createSignal, splitProps } from "solid-js"
|
||||
import { children, createEffect, createSignal, splitProps, type JSX } from "solid-js"
|
||||
import type { ComponentProps } from "solid-js"
|
||||
|
||||
export interface TooltipProps extends ComponentProps<typeof KobalteTooltip> {
|
||||
value: string | (() => string)
|
||||
value: JSX.Element
|
||||
class?: string
|
||||
}
|
||||
|
||||
@@ -29,13 +29,13 @@ export function Tooltip(props: TooltipProps) {
|
||||
})
|
||||
|
||||
return (
|
||||
<KobalteTooltip forceMount {...others} open={open()} onOpenChange={setOpen}>
|
||||
<KobalteTooltip forceMount {...others} open={open()} onOpenChange={setOpen} gutter={4}>
|
||||
<KobalteTooltip.Trigger as={"div"} data-component="tooltip-trigger" class={local.class}>
|
||||
{c()}
|
||||
</KobalteTooltip.Trigger>
|
||||
<KobalteTooltip.Portal>
|
||||
<KobalteTooltip.Content data-component="tooltip" data-placement={props.placement}>
|
||||
{typeof others.value === "function" ? others.value() : others.value}
|
||||
{others.value}
|
||||
{/* <KobalteTooltip.Arrow data-slot="arrow" /> */}
|
||||
</KobalteTooltip.Content>
|
||||
</KobalteTooltip.Portal>
|
||||
|
||||
Reference in New Issue
Block a user