261023_01_ENH: 자동완성 옵션 툴팁 추가 및 문자 편집기 LMS·MMS 분리와 UTF-8 바이트 계산 적용
This commit is contained in:
40
.tooling/components/ui/tooltip.tsx
Normal file
40
.tooling/components/ui/tooltip.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { HTMLAttributes, ReactNode } from "react";
|
||||
import { renderAsChild } from "@/lib/as-child";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export interface TooltipProviderProps {
|
||||
delayDuration?: number;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
export function TooltipProvider({ children }: TooltipProviderProps) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
export interface TooltipProps {
|
||||
open?: boolean;
|
||||
onOpenChange?: (open: boolean) => void;
|
||||
delayDuration?: number;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
export function Tooltip({ children }: TooltipProps) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
export function TooltipTrigger({
|
||||
asChild,
|
||||
children,
|
||||
...props
|
||||
}: HTMLAttributes<HTMLElement> & { asChild?: boolean }) {
|
||||
return renderAsChild(asChild, children, props);
|
||||
}
|
||||
|
||||
export interface TooltipContentProps extends HTMLAttributes<HTMLDivElement> {
|
||||
side?: "top" | "right" | "bottom" | "left";
|
||||
sideOffset?: number;
|
||||
}
|
||||
|
||||
export function TooltipContent({ className, side, sideOffset, ...props }: TooltipContentProps) {
|
||||
return <div data-side={side} className={cn(className)} {...props} />;
|
||||
}
|
||||
Reference in New Issue
Block a user