@cloudtower/eagle 0.33.0 → 0.33.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.
Files changed (36) hide show
  1. package/README.md +6 -0
  2. package/dist/cjs/UIKitProvider/index.js +3 -4
  3. package/dist/cjs/core/Alert/index.js +10 -4
  4. package/dist/cjs/core/TableForm/TableFormBodyCell.js +2 -1
  5. package/dist/cjs/core/TableForm/TableFormHeaderCell.js +4 -2
  6. package/dist/cjs/core/message/index.js +7 -2
  7. package/dist/cjs/core/message-group/index.js +3 -1
  8. package/dist/cjs/index.js +1 -0
  9. package/dist/cjs/stats1.html +1 -1
  10. package/dist/cjs/styles/token/color.js +24 -0
  11. package/dist/components.css +1029 -923
  12. package/dist/esm/UIKitProvider/index.js +3 -4
  13. package/dist/esm/core/Alert/index.js +10 -4
  14. package/dist/esm/core/TableForm/TableFormBodyCell.js +2 -1
  15. package/dist/esm/core/TableForm/TableFormHeaderCell.js +4 -2
  16. package/dist/esm/core/message/index.js +7 -3
  17. package/dist/esm/core/message-group/index.js +3 -1
  18. package/dist/esm/index.js +1 -1
  19. package/dist/esm/stats1.html +1 -1
  20. package/dist/esm/styles/token/color.js +24 -0
  21. package/dist/src/UIKitProvider/index.d.ts +4 -4
  22. package/dist/src/core/Legend/__test__/h5_css.test.d.ts +1 -0
  23. package/dist/src/core/Legend/index.d.ts +9 -0
  24. package/dist/src/core/Legend/legend.type.d.ts +25 -0
  25. package/dist/src/core/TableForm/types.d.ts +1 -0
  26. package/dist/src/core/message/index.d.ts +1 -0
  27. package/dist/src/styles/token/color.d.ts +24 -0
  28. package/dist/stories/docs/core/Legend.stories.d.ts +19 -0
  29. package/dist/stories/docs/core/SearchInput.stories.d.ts +20 -20
  30. package/dist/stories/docs/core/Select.stories.d.ts +94 -13
  31. package/dist/stories/docs/core/StatusCapsule.stories.d.ts +8 -0
  32. package/dist/stories/docs/core/message-group.stories.d.ts +4 -0
  33. package/dist/style.css +928 -826
  34. package/dist/token.css +20 -26
  35. package/dist/variables.scss +21 -0
  36. package/package.json +7 -7
@@ -188,6 +188,30 @@ const Color = {
188
188
  "yellow-8": "#926102",
189
189
  "yellow-9": "#6B4803",
190
190
  "yellow-10": "#483100"
191
+ },
192
+ pink: {
193
+ "pink-1": "#FED1FE",
194
+ "pink-2": "#FDBCFD",
195
+ "pink-3": "#F99BF8",
196
+ "pink-4": "#F573F2",
197
+ "pink-5": "#ED5BE5",
198
+ "pink-6": "#E136C6",
199
+ "pink-7": "#CF23A9",
200
+ "pink-8": "#B5158D",
201
+ "pink-9": "#910B6E",
202
+ "pink-10": "#64054B"
203
+ },
204
+ cyan: {
205
+ "cyan-1": "#A0ECEC",
206
+ "cyan-2": "#83E2E3",
207
+ "cyan-3": "#67D8D9",
208
+ "cyan-4": "#3AC4C6",
209
+ "cyan-5": "#1AACB4",
210
+ "cyan-6": "#048BA1",
211
+ "cyan-7": "#00728E",
212
+ "cyan-8": "#00607B",
213
+ "cyan-9": "#005068",
214
+ "cyan-10": "#004155"
191
215
  }
192
216
  },
193
217
  white: {
@@ -1,14 +1,14 @@
1
1
  import { ParrotI18nSupportLng } from "@cloudtower/parrot";
2
2
  import { BatchHelper } from "../core";
3
- import { MessageApi } from "../core/message";
3
+ import { ConfigOptions as MessageConfigOptions, MessageApi } from "../core/message";
4
4
  import React, { PropsWithChildren } from "react";
5
- import { Kit } from "../spec";
6
5
  import { ConfigProps } from "../core/ConfigProvider";
6
+ import { Kit } from "../spec";
7
+ type MessageConfigOptionsType = MessageConfigOptions;
7
8
  export interface IProps {
8
9
  kit?: Kit;
9
- message?: {
10
+ message?: MessageConfigOptionsType & {
10
11
  batch?: BatchHelper;
11
- maxCount?: number;
12
12
  };
13
13
  lng?: ParrotI18nSupportLng;
14
14
  config?: ConfigProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { LegendColor, LegendComponentType, LegendShapes } from "./legend.type";
3
+ export declare const LegendPresetColors: LegendColor[];
4
+ export declare const StatusIcon: React.FC<{
5
+ shape: LegendShapes;
6
+ }>;
7
+ declare const Legend: LegendComponentType;
8
+ export default Legend;
9
+ export * from "./legend.type";
@@ -0,0 +1,25 @@
1
+ import { CSSProperties } from "react";
2
+ export type LegendColor = "red" | "yellow" | "green" | "blue" | "gray" | "purple" | "success" | "danger" | "warning";
3
+ export type LegendShapes = "circle" | "square" | "loading";
4
+ export type LegendComponentType = React.FC<{
5
+ /** Text label to be displayed next to the legend item, or you can use children */
6
+ label?: string;
7
+ /** Additional CSS class name(s) to be applied to the legend item */
8
+ className?: string;
9
+ /** Custom inline styles to be applied to the legend item */
10
+ style?: CSSProperties;
11
+ /** Color of the legend item. Can be one of: 'red', 'yellow', 'green', 'blue', 'gray', 'purple', 'success', 'danger', 'warning' */
12
+ color?: LegendColor;
13
+ /** Shape of the legend item. Can be: 'circle', 'square', or 'loading' */
14
+ shape?: LegendShapes;
15
+ /** Whether the legend item should show hover effects */
16
+ hoverable?: boolean;
17
+ /** Enables tint mode styling for the legend item */
18
+ onTintMode?: boolean;
19
+ /** Numeric value to be displayed alongside the legend item */
20
+ number?: number;
21
+ /** Unique identifier for the legend item */
22
+ key?: string | number;
23
+ /** Callback function triggered when the legend item is clicked */
24
+ onClick?: (e: React.MouseEvent<HTMLDivElement>, key?: string | number) => void;
25
+ }>;
@@ -19,6 +19,7 @@ export type CustomizedColumnRenderProps = {
19
19
  placeholder?: string;
20
20
  isHeader: boolean;
21
21
  error?: boolean;
22
+ formValue: any;
22
23
  };
23
24
  export type TableFormColumn = {
24
25
  /**
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  type NoticeType = "info" | "success" | "error" | "warning" | "loading";
3
+ export declare const DEFAULT_DURATION = 3;
3
4
  export declare function getKeyThenIncreaseKey(): number;
4
5
  export interface ConfigOptions {
5
6
  top?: number;
@@ -189,6 +189,30 @@ export declare const Color: {
189
189
  readonly "yellow-9": "#6B4803";
190
190
  readonly "yellow-10": "#483100";
191
191
  };
192
+ readonly pink: {
193
+ readonly "pink-1": "#FED1FE";
194
+ readonly "pink-2": "#FDBCFD";
195
+ readonly "pink-3": "#F99BF8";
196
+ readonly "pink-4": "#F573F2";
197
+ readonly "pink-5": "#ED5BE5";
198
+ readonly "pink-6": "#E136C6";
199
+ readonly "pink-7": "#CF23A9";
200
+ readonly "pink-8": "#B5158D";
201
+ readonly "pink-9": "#910B6E";
202
+ readonly "pink-10": "#64054B";
203
+ };
204
+ readonly cyan: {
205
+ readonly "cyan-1": "#A0ECEC";
206
+ readonly "cyan-2": "#83E2E3";
207
+ readonly "cyan-3": "#67D8D9";
208
+ readonly "cyan-4": "#3AC4C6";
209
+ readonly "cyan-5": "#1AACB4";
210
+ readonly "cyan-6": "#048BA1";
211
+ readonly "cyan-7": "#00728E";
212
+ readonly "cyan-8": "#00607B";
213
+ readonly "cyan-9": "#005068";
214
+ readonly "cyan-10": "#004155";
215
+ };
192
216
  };
193
217
  readonly white: {
194
218
  readonly white: "#FFFFFF";
@@ -0,0 +1,19 @@
1
+ import { LegendColor, LegendComponentType } from "../../../src/core/Legend/legend.type";
2
+ import { Meta, StoryObj } from "@storybook/react";
3
+ /**
4
+ * 图例组件,用于展示状态。
5
+ *
6
+ * 圆形:作为"状态灯"表示状态,用法类似[**状态胶囊**](/docs/core-statuscapsule-状态胶囊--docs)
7
+ *
8
+ * 方形:用作图例使用常配合 Charts、多颜色计数等使用
9
+ */
10
+ declare const story: Meta<LegendComponentType>;
11
+ export declare const Basic: StoryObj<LegendComponentType>;
12
+ export declare const Default: StoryObj<{
13
+ content: string;
14
+ color: LegendColor;
15
+ hoverable: boolean;
16
+ offWhiteMode?: boolean;
17
+ number?: number;
18
+ }>;
19
+ export default story;
@@ -1,20 +1,20 @@
1
- import React from "react";
2
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, Omit<import("antd/lib/input").InputProps, "onChange"> & {
3
- debounceWait?: number | undefined;
4
- total?: number | undefined;
5
- onSearchNext?: ((value: string, current: number) => void) | undefined;
6
- onSearchPrev?: ((value: string, current: number) => void) | undefined;
7
- onChange: (value: string) => void;
8
- } & {
9
- children?: React.ReactNode;
10
- }>;
11
- export default _default;
12
- export declare const Simple: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, Omit<import("antd/lib/input").InputProps, "onChange"> & {
13
- debounceWait?: number | undefined;
14
- total?: number | undefined;
15
- onSearchNext?: ((value: string, current: number) => void) | undefined;
16
- onSearchPrev?: ((value: string, current: number) => void) | undefined;
17
- onChange: (value: string) => void;
18
- } & {
19
- children?: React.ReactNode;
20
- }>;
1
+ import SearchInput from "../../../src/core/SearchInput";
2
+ import type { StoryObj } from "@storybook/react";
3
+ /**
4
+ * * tower legacy 组件, 带 debounce 的搜索框
5
+ * * MR: http://gitlab.smartx.com/frontend/tower/-/merge_requests/930
6
+ */
7
+ declare const meta: {
8
+ component: import("../../../src/core/SearchInput").SearchInputComponentType;
9
+ title: "Core/SearchInput | 搜索框";
10
+ args: {
11
+ debounceWait: number;
12
+ onSearchPrev: undefined;
13
+ onSearchNext: undefined;
14
+ total: undefined;
15
+ };
16
+ };
17
+ export default meta;
18
+ type Story = StoryObj<typeof SearchInput>;
19
+ export declare const Basic: Story;
20
+ export declare const withTotal: Story;
@@ -1,16 +1,97 @@
1
- import { Meta } from "@storybook/react";
2
- import React from "react";
3
- declare const meta: Meta;
4
- export default meta;
5
- export declare const Basic: {
6
- (): React.JSX.Element;
7
- story: {
8
- name: string;
9
- parameters: {
10
- design: {
11
- type: string;
12
- url: string;
13
- };
1
+ import Select from "../../../src/core/Select";
2
+ import type { StoryObj } from "@storybook/react";
3
+ /**
4
+ * Select 组件是基于 antd Select 的封装,提供了更符合设计规范的样式和交互。
5
+ *
6
+ * ### 参数说明
7
+ *
8
+ * | 参数 | 说明 | 类型 | 默认值 |
9
+ * | --- | --- | --- | --- |
10
+ * | size | 选择器大小,large 用于表单场景,small 用于表格等紧凑场景 | 'large' \| 'middle' \| 'small' | 'middle' |
11
+ * | loading | 加载状态,显示加载中的动画效果 | boolean | false |
12
+ * | isLoadingValue | 是否正在加载选项值,用于异步加载选项时的加载状态 | boolean | false |
13
+ * | disabled | 是否禁用选择器,禁用后不可点击选择 | boolean | false |
14
+ * | mode | 设置选择模式,multiple 为多选,tags 为自由输入多选 | 'multiple' \| 'tags' | - |
15
+ * | showSearch | 是否可搜索,开启后可通过输入关键字过滤选项 | boolean | false |
16
+ * | danger | 错误状态,用于表单校验失败等场景 | boolean | false |
17
+ * | placeholder | 选择框默认文本 | string | - |
18
+ * | value | 指定当前选中的条目 | string \| string[] | - |
19
+ * | defaultValue | 指定默认选中的条目 | string \| string[] | - |
20
+ * | onChange | 选中值发生变化时的回调 | function(value, option) | - |
21
+ *
22
+ * 更多属性请参考 antd Select 组件文档
23
+ */
24
+ declare const meta: {
25
+ component: import("../../../src/core").SelectComponentType<any, HTMLElement>;
26
+ title: "Core/Select | 选择器";
27
+ args: {
28
+ placeholder: string;
29
+ options: ({
30
+ value: string;
31
+ label: string;
32
+ disabled?: undefined;
33
+ } | {
34
+ value: string;
35
+ label: string;
36
+ disabled: true;
37
+ })[];
38
+ input: {
39
+ value: string;
14
40
  };
15
41
  };
16
42
  };
43
+ export default meta;
44
+ type Story = StoryObj<typeof Select>;
45
+ /**
46
+ * Select 组件提供了三种尺寸:
47
+ * - large: 适用于表单中的主要选择器
48
+ * - middle: 默认尺寸,适用于大多数场景
49
+ * - small: 适用于表格等紧凑型界面
50
+ */
51
+ export declare const Basic: Story;
52
+ /**
53
+ * Select 组件支持在选项中添加前缀和后缀图标:
54
+ * - prefix: 在选项文本前显示图标,常用于表示状态或类型
55
+ * - suffix: 在选项文本后显示图标,常用于显示额外信息
56
+ */
57
+ export declare const WithIcons: Story;
58
+ /**
59
+ * 多选模式下可以选择多个选项,选中的选项会以 Tag 的形式展示。
60
+ * 支持以下特性:
61
+ * - 可以通过点击 Tag 的关闭按钮删除已选项
62
+ * - 可以通过键盘删除键(Backspace)删除最后一个已选项
63
+ * - 支持通过搜索快速定位选项
64
+ */
65
+ export declare const Multiple: Story;
66
+ /**
67
+ * Select 组件提供了两种加载状态:
68
+ * 1. loading: 原生的加载中
69
+ * 2. isLoadingValue: value 在加载,select 不能点击
70
+ */
71
+ export declare const Loading: Story;
72
+ /**
73
+ * 可搜索模式下,用户可以输入关键字过滤选项。
74
+ * 可以通过 filterOption 属性自定义搜索逻辑。
75
+ */
76
+ export declare const SearchSelect: Story;
77
+ /**
78
+ * Select 支持自定义触发器,可以替换默认的下拉箭头图标。
79
+ * 常见用法是使用自定义图标来表达特定的筛选含义。
80
+ */
81
+ export declare const CustomTrigger: Story;
82
+ /**
83
+ * 错误状态有两种实现方式:
84
+ * 1. 使用 className="select-error" 添加错误样式
85
+ * 2. 使用 danger 属性(推荐)
86
+ */
87
+ export declare const Error: Story;
88
+ /**
89
+ * 禁用状态下,选择器不可点击,显示为灰色。
90
+ */
91
+ export declare const Disabled: Story;
92
+ /**
93
+ * Select 组件可以通过特定的样式类实现组合效果:
94
+ * - LeftEndSelectStyle: 左侧圆角
95
+ * - RightEndSelectStyle: 右侧圆角
96
+ */
97
+ export declare const Combined: Story;
@@ -1,5 +1,13 @@
1
1
  import { StatusCapsuleColor, StatusCapsuleComponentType } from "../../../src/core/StatusCapsule/statusCapsule.type";
2
2
  import { Meta, StoryObj } from "@storybook/react";
3
+ /**
4
+ * 状态胶囊,用于展示状态。
5
+ *
6
+ * 根据使用场景,可选:
7
+ *
8
+ * - 是否带计数
9
+ * - 背景色是否突出:Colorful 较突出、Off-White 较不突出
10
+ */
3
11
  declare const story: Meta<StatusCapsuleComponentType>;
4
12
  export declare const Basic: StoryObj<StatusCapsuleComponentType>;
5
13
  export declare const Default: StoryObj<{
@@ -15,6 +15,9 @@ declare const meta: {
15
15
  maxCount: {
16
16
  name: "boolean";
17
17
  };
18
+ top: {
19
+ name: "number";
20
+ };
18
21
  };
19
22
  };
20
23
  description: string;
@@ -27,4 +30,5 @@ export declare const BasicInfo: Story;
27
30
  export declare const BasicWarning: Story;
28
31
  export declare const BasicError: Story;
29
32
  export declare const MaxCount: Story;
33
+ export declare const CustomTopPosition: Story;
30
34
  export declare const BatchMessage: Story;