@cloudtower/eagle 0.35.6 → 0.35.7

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,5 @@
1
+ import React from "react";
2
+ import { CopyButtonProps } from "./CopyButton.type";
3
+ export type { CopyButtonProps };
4
+ declare const CopyButton: React.FC<CopyButtonProps>;
5
+ export default CopyButton;
@@ -0,0 +1,8 @@
1
+ export interface CopyButtonProps {
2
+ /** 复制文本 */
3
+ text: string;
4
+ /** 按钮文本 */
5
+ buttonText?: string;
6
+ /** 提示文本 */
7
+ tooltipText?: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { CopyTooltipProps } from "./CopyTooltip.typs";
3
+ export type { CopyTooltipProps };
4
+ declare const CopyTooltip: React.ForwardRefExoticComponent<CopyTooltipProps & React.RefAttributes<HTMLSpanElement>>;
5
+ export default CopyTooltip;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { TooltipProps } from "../../core/Tooltip";
3
+ export interface CopyTooltipProps {
4
+ /** 复制文本 */
5
+ text: string;
6
+ /** 复制前提示文本 */
7
+ beforeTooltip?: string;
8
+ /** 复制后提示文本 */
9
+ afterTooltip?: string;
10
+ /** Tooltip 组件的属性 */
11
+ tooltipProps?: Omit<TooltipProps, "title">;
12
+ /** 子元素 */
13
+ children?: React.ReactNode;
14
+ /** 自定义类名 */
15
+ className?: string;
16
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./CopyButton";
2
+ export * from "./CopyTooltip";
@@ -4,6 +4,7 @@ export * from "./ChartWithTooltip";
4
4
  export * from "./CheckPointList";
5
5
  export * from "./CircleLoading";
6
6
  export * from "./common";
7
+ export * from "./Copy";
7
8
  export * from "./Counting";
8
9
  export * from "./CronCalendar";
9
10
  export * from "./CronPlan";
@@ -0,0 +1,66 @@
1
+ import { CopyButtonProps } from "../../../../src/coreX/Copy/CopyButton";
2
+ import { Meta, StoryObj } from "@storybook/react";
3
+ import React from "react";
4
+ /**
5
+ *
6
+ * CopyButton 组件是一个带有复制功能的按钮,点击后会将指定文本复制到剪贴板,并通过 tooltip 提供复制成功的反馈。
7
+ *
8
+ * ### 主要特性
9
+ * - 点击按钮复制指定文本到剪贴板
10
+ * - 复制成功后显示 tooltip 提示(默认显示 1 秒)
11
+ * - 支持自定义按钮文本和 tooltip 提示文本
12
+ * - 使用现代的 `navigator.clipboard` API
13
+ *
14
+ */
15
+ declare const meta: Meta<React.FC<CopyButtonProps>>;
16
+ export default meta;
17
+ /**
18
+ *
19
+ * 最基本的用法,使用默认的按钮文本和提示文本。
20
+ *
21
+ * 点击按钮后会显示"已复制到剪贴板"的提示。
22
+ *
23
+ */
24
+ export declare const Default: StoryObj<CopyButtonProps>;
25
+ /**
26
+ *
27
+ * 自定义按钮的显示文本,可以根据业务场景提供更明确的按钮文案。
28
+ *
29
+ */
30
+ export declare const CustomButtonText: StoryObj<CopyButtonProps>;
31
+ /**
32
+ *
33
+ * 自定义复制成功后的 tooltip 提示文本。
34
+ *
35
+ */
36
+ export declare const CustomTooltipText: StoryObj<CopyButtonProps>;
37
+ /**
38
+ *
39
+ * 在实际业务场景中使用,如复制配置文件、命令行、代码片段等。
40
+ *
41
+ */
42
+ export declare const RealWorldScenarios: StoryObj<CopyButtonProps>;
43
+ /**
44
+ *
45
+ * 多个复制按钮组合使用,比如在表单或信息展示页面中。
46
+ *
47
+ */
48
+ export declare const MultipleButtons: StoryObj<CopyButtonProps>;
49
+ /**
50
+ *
51
+ * 复制超长文本内容,如大型配置文件、日志等。
52
+ *
53
+ */
54
+ export declare const LongText: StoryObj<CopyButtonProps>;
55
+ /**
56
+ *
57
+ * 边界场景测试,包括空文本、特殊字符等。
58
+ *
59
+ */
60
+ export declare const EdgeCases: StoryObj<CopyButtonProps>;
61
+ /**
62
+ *
63
+ * 在卡片布局中使用复制按钮。
64
+ *
65
+ */
66
+ export declare const InCard: StoryObj<CopyButtonProps>;
@@ -0,0 +1,66 @@
1
+ import { CopyTooltipProps } from "../../../../src/coreX/Copy/CopyTooltip";
2
+ import { Meta, StoryObj } from "@storybook/react";
3
+ import React from "react";
4
+ /**
5
+ *
6
+ * CopyTooltip 组件用于复制文本到剪贴板,并通过 tooltip 提供交互反馈。适用于需要复制文本的场景,如复制 ID、地址、配置等。
7
+ *
8
+ * ### 主要特性
9
+ * - 支持自定义复制前后的 tooltip 提示文本
10
+ * - 支持自定义触发复制的子元素
11
+ * - 内置默认的复制图标
12
+ * - 鼠标悬浮时显示复制提示,点击后显示复制成功提示
13
+ *
14
+ */
15
+ declare const meta: Meta<React.FC<CopyTooltipProps>>;
16
+ export default meta;
17
+ /**
18
+ *
19
+ * 最基本的用法,使用默认的复制图标和默认的提示文本。
20
+ *
21
+ * 鼠标悬浮时显示"点击复制",点击后显示"复制成功"。
22
+ *
23
+ */
24
+ export declare const Default: StoryObj<CopyTooltipProps>;
25
+ /**
26
+ *
27
+ * 自定义复制前后的 tooltip 提示文本,可以根据业务场景提供更友好的提示信息。
28
+ *
29
+ */
30
+ export declare const CustomTooltipText: StoryObj<CopyTooltipProps>;
31
+ /**
32
+ *
33
+ * 可以自定义触发复制的子元素,比如使用文本、按钮或其他图标。
34
+ *
35
+ */
36
+ export declare const CustomChildren: StoryObj<CopyTooltipProps>;
37
+ /**
38
+ *
39
+ * 复制长文本内容,如配置文件、日志等。
40
+ *
41
+ */
42
+ export declare const LongText: StoryObj<CopyTooltipProps>;
43
+ /**
44
+ *
45
+ * 在表格中使用,复制单元格内容。
46
+ *
47
+ */
48
+ export declare const InTable: StoryObj<CopyTooltipProps>;
49
+ /**
50
+ *
51
+ * 自定义 tooltip 的样式和位置等属性。
52
+ *
53
+ */
54
+ export declare const CustomTooltipProps: StoryObj<CopyTooltipProps>;
55
+ /**
56
+ *
57
+ * 复制包含特殊字符和换行的文本内容。
58
+ *
59
+ */
60
+ export declare const SpecialCharacters: StoryObj<CopyTooltipProps>;
61
+ /**
62
+ *
63
+ * 空文本或极端场景下的处理。
64
+ *
65
+ */
66
+ export declare const EdgeCases: StoryObj<CopyTooltipProps>;