@ldkj/web-ui 0.13.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,93 @@
1
+ import * as React from "react";
2
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3
+ import { type SxProps } from "@/styling";
4
+ export type TooltipTone = "dark" | "light" | "primary";
5
+ type WithStyleProps = {
6
+ className?: string;
7
+ class?: string;
8
+ sx?: SxProps;
9
+ };
10
+ export type TooltipTriggerProps = Omit<React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>, "className" | "style"> & WithStyleProps & {
11
+ style?: React.CSSProperties;
12
+ /**
13
+ * 当 `asChild` 为 true 时,指定用于包裹 children 的元素或组件。
14
+ *
15
+ * @default "span"
16
+ */
17
+ asChildWrapper?: React.ElementType;
18
+ };
19
+ export type TooltipContentProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & WithStyleProps & {
20
+ /**
21
+ * 控制 Tooltip 内容的视觉语气。
22
+ *
23
+ * @default "dark"
24
+ */
25
+ tone?: TooltipTone;
26
+ /**
27
+ * 是否显示指向触发元素的箭头。
28
+ *
29
+ * @default false
30
+ */
31
+ arrow?: boolean;
32
+ };
33
+ export type TooltipArrowProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow> & WithStyleProps & {
34
+ /**
35
+ * 箭头颜色语气;通常与 TooltipContent 的 tone 保持一致。
36
+ *
37
+ * @default "dark"
38
+ */
39
+ tone?: TooltipTone;
40
+ };
41
+ /**
42
+ * TooltipProvider 用于配置当前 React 子树内 Tooltip 的延迟和跳过延迟行为。
43
+ */
44
+ declare const TooltipProvider: ({ delayDuration, ...props }: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>) => import("react/jsx-runtime").JSX.Element;
45
+ /**
46
+ * Tooltip 是 Radix Tooltip Root 的组件库导出,用于包裹单个提示实例。
47
+ */
48
+ declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
49
+ /**
50
+ * TooltipPortal 用于将 TooltipContent 渲染到独立 Portal 容器。
51
+ */
52
+ declare const TooltipPortal: React.FC<TooltipPrimitive.TooltipPortalProps>;
53
+ /**
54
+ * TooltipTrigger 用于声明 Tooltip 的触发元素,支持 `asChild` 组合业务组件。
55
+ */
56
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<Omit<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref">, "className" | "style"> & WithStyleProps & {
57
+ style?: React.CSSProperties;
58
+ /**
59
+ * 当 `asChild` 为 true 时,指定用于包裹 children 的元素或组件。
60
+ *
61
+ * @default "span"
62
+ */
63
+ asChildWrapper?: React.ElementType;
64
+ } & React.RefAttributes<HTMLElement>>;
65
+ /**
66
+ * TooltipArrow 渲染 Tooltip 的箭头,可单独用于自定义 Content 结构。
67
+ */
68
+ declare const TooltipArrow: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipArrowProps & React.RefAttributes<SVGSVGElement>, "ref"> & WithStyleProps & {
69
+ /**
70
+ * 箭头颜色语气;通常与 TooltipContent 的 tone 保持一致。
71
+ *
72
+ * @default "dark"
73
+ */
74
+ tone?: TooltipTone;
75
+ } & React.RefAttributes<SVGSVGElement>>;
76
+ /**
77
+ * TooltipContent 渲染提示内容,内置基础动画、tone 语气和可选 arrow。
78
+ */
79
+ declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & WithStyleProps & {
80
+ /**
81
+ * 控制 Tooltip 内容的视觉语气。
82
+ *
83
+ * @default "dark"
84
+ */
85
+ tone?: TooltipTone;
86
+ /**
87
+ * 是否显示指向触发元素的箭头。
88
+ *
89
+ * @default false
90
+ */
91
+ arrow?: boolean;
92
+ } & React.RefAttributes<HTMLDivElement>>;
93
+ export { Tooltip, TooltipProvider, TooltipTrigger, TooltipContent, TooltipPortal, TooltipArrow, };
@@ -0,0 +1 @@
1
+ export * from "./Tooltip";