aha-components 1.7.12 → 1.8.2
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.
- package/README.md +10 -0
- package/dist/Avatar.esm.js +2 -0
- package/dist/Avatar.esm.js.map +1 -0
- package/dist/Avatar.js +2 -0
- package/dist/Avatar.js.map +1 -0
- package/dist/Badge.esm.js +2 -0
- package/dist/Badge.esm.js.map +1 -0
- package/dist/Badge.js +2 -0
- package/dist/Badge.js.map +1 -0
- package/dist/Checkbox.esm.js +1 -1
- package/dist/Checkbox.esm.js.map +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/Checkbox.js.map +1 -1
- package/dist/Input.esm.js +1 -1
- package/dist/Input.esm.js.map +1 -1
- package/dist/Input.js +1 -1
- package/dist/Input.js.map +1 -1
- package/dist/Pagination.esm.js +1 -1
- package/dist/Pagination.esm.js.map +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/Pagination.js.map +1 -1
- package/dist/Radio.esm.js +1 -1
- package/dist/Radio.esm.js.map +1 -1
- package/dist/Radio.js +1 -1
- package/dist/Radio.js.map +1 -1
- package/dist/Table.esm.js +1 -1
- package/dist/Table.esm.js.map +1 -1
- package/dist/Table.js +1 -1
- package/dist/Table.js.map +1 -1
- package/dist/Tag.esm.js +1 -1
- package/dist/Tag.esm.js.map +1 -1
- package/dist/Tag.js +1 -1
- package/dist/Tag.js.map +1 -1
- package/dist/Textarea.esm.js +1 -1
- package/dist/Textarea.esm.js.map +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/Textarea.js.map +1 -1
- package/dist/components/Avatar/Avatar.stories.d.ts +12 -0
- package/dist/components/Avatar/index.d.ts +42 -0
- package/dist/components/Badge/Badge.stories.d.ts +15 -0
- package/dist/components/Badge/index.d.ts +71 -0
- package/dist/components/Checkbox/Checkbox.stories 2.d.ts +12 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +5 -4
- package/dist/components/Checkbox/index 2.d.ts +12 -0
- package/dist/components/Checkbox/index.d.ts +6 -0
- package/dist/components/DatePicker/DatePicker.stories 2.d.ts +25 -0
- package/dist/components/DatePicker/index 2.d.ts +96 -0
- package/dist/components/Drawer/Drawer.stories 2.d.ts +9 -0
- package/dist/components/Drawer/index 2.d.ts +58 -0
- package/dist/components/Form/Form.stories 2.d.ts +15 -0
- package/dist/components/Form/FormContext 2.d.ts +41 -0
- package/dist/components/Form/FormItem 2.d.ts +58 -0
- package/dist/components/Form/index 2.d.ts +85 -0
- package/dist/components/Input/Input.stories 2.d.ts +16 -0
- package/dist/components/Input/Input.stories.d.ts +7 -4
- package/dist/components/Input/InputGroup.d.ts +25 -0
- package/dist/components/Input/InputTags.d.ts +17 -0
- package/dist/components/Input/index 2.d.ts +41 -0
- package/dist/components/Input/index.d.ts +7 -18
- package/dist/components/Loading/Loading.stories 2.d.ts +11 -0
- package/dist/components/Loading/index 2.d.ts +10 -0
- package/dist/components/MenuList/MenuList.stories 2.d.ts +17 -0
- package/dist/components/MenuList/MenuList.test 2.d.ts +1 -0
- package/dist/components/MenuList/index 2.d.ts +85 -0
- package/dist/components/Pagination/Pagination.stories 2.d.ts +16 -0
- package/dist/components/Pagination/index 2.d.ts +27 -0
- package/dist/components/Popover/Popover.stories 2.d.ts +11 -0
- package/dist/components/Popover/index 2.d.ts +31 -0
- package/dist/components/Progress/Progress.stories 2.d.ts +18 -0
- package/dist/components/Progress/Progress.test 2.d.ts +1 -0
- package/dist/components/Progress/index 2.d.ts +33 -0
- package/dist/components/Radio/Radio.stories 2.d.ts +10 -0
- package/dist/components/Radio/Radio.stories.d.ts +6 -4
- package/dist/components/Radio/index 2.d.ts +13 -0
- package/dist/components/Radio/index.d.ts +6 -0
- package/dist/components/Select/Select.stories 2.d.ts +17 -0
- package/dist/components/Select/index 2.d.ts +74 -0
- package/dist/components/Switch/Switch.stories 2.d.ts +14 -0
- package/dist/components/Switch/index 2.d.ts +27 -0
- package/dist/components/Tab/Tab.stories 2.d.ts +19 -0
- package/dist/components/Tab/index 2.d.ts +26 -0
- package/dist/components/Table/Table.stories 2.d.ts +21 -0
- package/dist/components/Table/index 2.d.ts +167 -0
- package/dist/components/Tag/Tag.stories.d.ts +5 -8
- package/dist/components/Tag/index.d.ts +24 -2
- package/dist/components/Textarea/Textarea.stories 2.d.ts +15 -0
- package/dist/components/Textarea/Textarea.stories.d.ts +3 -6
- package/dist/components/Textarea/TextareaTags.d.ts +8 -0
- package/dist/components/Textarea/index 2.d.ts +38 -0
- package/dist/components/Textarea/index.d.ts +6 -17
- package/dist/components/Tooltip/Tooltip.stories 2.d.ts +20 -0
- package/dist/components/Tooltip/index 2.d.ts +35 -0
- package/dist/design-tokens/theme.css +26 -0
- package/dist/design-tokens/theme.tailwind4.css +26 -0
- package/dist/icons/index 2.d.ts +33 -0
- package/dist/index.css +4810 -1
- package/dist/index.d.ts +195 -39
- package/dist/index.esm.css +4810 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/stories/DesignTokens.stories 2.d.ts +5 -0
- package/dist/theme/Theme.stories 2.d.ts +10 -0
- package/dist/theme/ThemeContext 2.d.ts +11 -0
- package/dist/theme/utils 2.d.ts +10 -0
- package/dist/theme.css +26 -0
- package/dist/tokens.d.ts +30 -0
- package/package.json +1 -1
- package/dist/AlertComponent.esm.js +0 -2
- package/dist/AlertComponent.esm.js.map +0 -1
- package/dist/AlertComponent.js +0 -2
- package/dist/AlertComponent.js.map +0 -1
- package/dist/Card.esm.js +0 -2
- package/dist/Card.esm.js.map +0 -1
- package/dist/Card.js +0 -2
- package/dist/Card.js.map +0 -1
- package/dist/TestComponent.esm.js +0 -2
- package/dist/TestComponent.esm.js.map +0 -1
- package/dist/TestComponent.js +0 -2
- package/dist/TestComponent.js.map +0 -1
- package/dist/Toast.css +0 -1
- package/dist/Toast.esm.css +0 -1
- package/dist/components/AlertComponent/index.d.ts +0 -9
- package/dist/components/Card/index.d.ts +0 -10
- package/dist/components/TestComponent/index.d.ts +0 -7
|
@@ -1,41 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'suffix'> {
|
|
3
|
-
/** 输入框大小 */
|
|
4
3
|
size?: 'small' | 'mediumSmall' | 'medium' | 'large';
|
|
5
|
-
/** 是否禁用 */
|
|
6
4
|
disabled?: boolean;
|
|
7
|
-
/** 是否显示错误状态 */
|
|
8
5
|
error?: boolean;
|
|
9
|
-
/** 是否只读 */
|
|
10
6
|
readOnly?: boolean;
|
|
11
|
-
/** 输入框前缀图标 */
|
|
12
7
|
prefix?: React.ReactNode;
|
|
13
|
-
/** 输入框后缀图标 */
|
|
14
8
|
suffix?: React.ReactNode;
|
|
15
|
-
/** 允许清除 */
|
|
16
9
|
allowClear?: boolean;
|
|
17
|
-
/** 清除回调 */
|
|
18
10
|
onClear?: () => void;
|
|
19
|
-
/** 自定义类名 */
|
|
20
11
|
className?: string;
|
|
21
|
-
/** 自定义样式 */
|
|
22
12
|
style?: React.CSSProperties;
|
|
23
|
-
/** 输入框类型 */
|
|
24
13
|
type?: string;
|
|
25
|
-
/** 占位符 */
|
|
26
14
|
placeholder?: string;
|
|
27
|
-
/** 值 */
|
|
28
15
|
value?: string;
|
|
29
|
-
/** 默认值 */
|
|
30
16
|
defaultValue?: string;
|
|
31
|
-
/** 变化回调 */
|
|
32
17
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
33
|
-
/** 聚焦回调 */
|
|
34
18
|
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
35
|
-
/** 失焦回调 */
|
|
36
19
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
37
|
-
/** 按下回车回调 */
|
|
38
20
|
onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
21
|
+
label?: string;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
hintText?: string;
|
|
39
24
|
}
|
|
40
25
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
41
26
|
export default Input;
|
|
27
|
+
export { default as InputGroup } from './InputGroup';
|
|
28
|
+
export type { InputGroupProps } from './InputGroup';
|
|
29
|
+
export { default as InputTags } from './InputTags';
|
|
30
|
+
export type { InputTagsProps } from './InputTags';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Loading from './index';
|
|
3
|
+
import '../../index.css';
|
|
4
|
+
declare const meta: Meta<typeof Loading>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof Loading>;
|
|
7
|
+
export declare const Basic: Story;
|
|
8
|
+
export declare const DifferentSizes: Story;
|
|
9
|
+
export declare const CustomColors: Story;
|
|
10
|
+
export declare const StrokeWidthVariants: Story;
|
|
11
|
+
export declare const InlineUsage: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import MenuList from './index';
|
|
3
|
+
declare const meta: Meta<typeof MenuList>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MenuList>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const WithoutIcons: Story;
|
|
8
|
+
export declare const MixedIcons: Story;
|
|
9
|
+
export declare const FullExample: Story;
|
|
10
|
+
export declare const WithUserProfile: Story;
|
|
11
|
+
export declare const WithDisabled: Story;
|
|
12
|
+
export declare const WithDanger: Story;
|
|
13
|
+
export declare const Controlled: Story;
|
|
14
|
+
export declare const CustomRender: Story;
|
|
15
|
+
export declare const CustomUserProfile: Story;
|
|
16
|
+
export declare const ClickEvents: Story;
|
|
17
|
+
export declare const UnifiedClickEvent: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MenuItemType {
|
|
3
|
+
/** 唯一标识 */
|
|
4
|
+
key: string;
|
|
5
|
+
/** 菜单项标签 */
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/** 菜单项图标 */
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
/** 菜单项右侧图标 */
|
|
10
|
+
suffixIcon?: React.ReactNode;
|
|
11
|
+
/** 是否禁用 */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** 是否危险项(红色) */
|
|
14
|
+
danger?: boolean;
|
|
15
|
+
/** 自定义渲染函数,如果提供则完全自定义该项的渲染 */
|
|
16
|
+
render?: (item: MenuItemType, isSelected: boolean) => React.ReactNode;
|
|
17
|
+
/** 自定义类名 */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** 自定义样式 */
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
/** 点击事件 */
|
|
22
|
+
onClick?: (info: {
|
|
23
|
+
key: string;
|
|
24
|
+
keyPath: string[];
|
|
25
|
+
}) => void;
|
|
26
|
+
/** 是否跳过全局点击事件(MenuList 的 onClick),默认为 false */
|
|
27
|
+
skipGlobalClick?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface MenuGroupType {
|
|
30
|
+
/** 分组标题 */
|
|
31
|
+
title?: React.ReactNode;
|
|
32
|
+
/** 分组下的菜单项 */
|
|
33
|
+
children: MenuItemType[];
|
|
34
|
+
/** 自定义类名 */
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface UserProfileType {
|
|
38
|
+
/** 用户头像 */
|
|
39
|
+
avatar?: React.ReactNode;
|
|
40
|
+
/** 用户姓名 */
|
|
41
|
+
name: React.ReactNode;
|
|
42
|
+
/** 用户邮箱 */
|
|
43
|
+
email?: React.ReactNode;
|
|
44
|
+
/** 在线状态 */
|
|
45
|
+
online?: boolean;
|
|
46
|
+
/** 自定义渲染函数,如果提供则完全自定义用户资料的渲染 */
|
|
47
|
+
render?: (profile: UserProfileType) => React.ReactNode;
|
|
48
|
+
/** 点击事件 */
|
|
49
|
+
onClick?: () => void;
|
|
50
|
+
}
|
|
51
|
+
export interface MenuListProps {
|
|
52
|
+
/** 菜单项数据 */
|
|
53
|
+
items: (MenuItemType | MenuGroupType)[];
|
|
54
|
+
/** 用户资料信息(显示在顶部) */
|
|
55
|
+
userProfile?: UserProfileType;
|
|
56
|
+
/** 当前选中的菜单项 key */
|
|
57
|
+
selectedKeys?: string[];
|
|
58
|
+
/** 默认选中的菜单项 key */
|
|
59
|
+
defaultSelectedKeys?: string[];
|
|
60
|
+
/** 选中项变化时的回调 */
|
|
61
|
+
onSelect?: (info: {
|
|
62
|
+
key: string;
|
|
63
|
+
keyPath: string[];
|
|
64
|
+
selectedKeys: string[];
|
|
65
|
+
}) => void;
|
|
66
|
+
/** 取消选中时的回调 */
|
|
67
|
+
onDeselect?: (info: {
|
|
68
|
+
key: string;
|
|
69
|
+
keyPath: string[];
|
|
70
|
+
selectedKeys: string[];
|
|
71
|
+
}) => void;
|
|
72
|
+
/** 统一的点击事件,无论点击哪个子项都会触发 */
|
|
73
|
+
onClick?: (info: {
|
|
74
|
+
key: string;
|
|
75
|
+
keyPath: string[];
|
|
76
|
+
}) => void;
|
|
77
|
+
/** 自定义类名 */
|
|
78
|
+
className?: string;
|
|
79
|
+
/** 自定义样式 */
|
|
80
|
+
style?: React.CSSProperties;
|
|
81
|
+
/** 菜单宽度 */
|
|
82
|
+
width?: number | string;
|
|
83
|
+
}
|
|
84
|
+
declare const MenuList: React.FC<MenuListProps>;
|
|
85
|
+
export default MenuList;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Pagination from './index';
|
|
3
|
+
declare const meta: Meta<typeof Pagination>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Pagination>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const Controlled: Story;
|
|
8
|
+
export declare const WithTotal: Story;
|
|
9
|
+
export declare const WithSizeChanger: Story;
|
|
10
|
+
export declare const WithQuickJumper: Story;
|
|
11
|
+
export declare const FullFeatures: Story;
|
|
12
|
+
export declare const Simple: Story;
|
|
13
|
+
export declare const Sizes: Story;
|
|
14
|
+
export declare const LargeTotal: Story;
|
|
15
|
+
export declare const CustomGoButton: Story;
|
|
16
|
+
export declare const Responsive: Story;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface PaginationProps {
|
|
3
|
+
current?: number;
|
|
4
|
+
defaultCurrent?: number;
|
|
5
|
+
total?: number;
|
|
6
|
+
pageSize?: number;
|
|
7
|
+
defaultPageSize?: number;
|
|
8
|
+
showSizeChanger?: boolean;
|
|
9
|
+
pageSizeOptions?: string[];
|
|
10
|
+
showQuickJumper?: boolean | {
|
|
11
|
+
goButton?: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
showTotal?: (total: number, range: [number, number]) => React.ReactNode;
|
|
14
|
+
onChange?: (page: number, pageSize?: number) => void;
|
|
15
|
+
onShowSizeChange?: (current: number, size: number) => void;
|
|
16
|
+
simple?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
hideOnSinglePage?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
size?: "default" | "small";
|
|
22
|
+
responsive?: boolean;
|
|
23
|
+
showLessItems?: boolean;
|
|
24
|
+
itemRender?: (page: number, type: "page" | "prev" | "next" | "jump-prev" | "jump-next", originalElement: React.ReactNode) => React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
declare const Pagination: React.FC<PaginationProps>;
|
|
27
|
+
export default Pagination;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Popover from "./index";
|
|
3
|
+
declare const meta: Meta<typeof Popover>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Popover>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const HoverTrigger: Story;
|
|
8
|
+
export declare const Placements: Story;
|
|
9
|
+
export declare const CustomWidth: Story;
|
|
10
|
+
export declare const MobileWidthAndAutoFlip: Story;
|
|
11
|
+
export declare const CloseByContentClick: Story;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type PopoverTrigger = "click" | "hover";
|
|
3
|
+
export type PopoverPlacement = "top" | "right" | "bottom" | "left";
|
|
4
|
+
export interface PopoverProps {
|
|
5
|
+
/** 触发节点 */
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/** Popover 内容 */
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
/** 触发模式 */
|
|
10
|
+
trigger?: PopoverTrigger;
|
|
11
|
+
/** 是否显示(受控) */
|
|
12
|
+
open?: boolean;
|
|
13
|
+
/** 默认是否显示(非受控) */
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
/** 显示状态变化回调 */
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
/** 展示方向 */
|
|
18
|
+
placement?: PopoverPlacement;
|
|
19
|
+
/** 内容宽度 */
|
|
20
|
+
width?: string | number;
|
|
21
|
+
/** 触发节点和 Popover 的间距 */
|
|
22
|
+
offset?: number;
|
|
23
|
+
/** 自定义容器类名 */
|
|
24
|
+
className?: string;
|
|
25
|
+
/** 自定义 Popover 类名 */
|
|
26
|
+
popoverClassName?: string;
|
|
27
|
+
/** 是否禁用 */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare const Popover: React.FC<PopoverProps>;
|
|
31
|
+
export default Popover;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Progress from './index';
|
|
3
|
+
import '../../index.css';
|
|
4
|
+
declare const meta: Meta<typeof Progress>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof Progress>;
|
|
7
|
+
export declare const Circle: Story;
|
|
8
|
+
export declare const Semicircle: Story;
|
|
9
|
+
export declare const WithTitle: Story;
|
|
10
|
+
export declare const WithoutPercent: Story;
|
|
11
|
+
export declare const DifferentSizes: Story;
|
|
12
|
+
export declare const SemicircleSizes: Story;
|
|
13
|
+
export declare const WithTitleAndPercent: Story;
|
|
14
|
+
export declare const TitlePositionInside: Story;
|
|
15
|
+
export declare const TitlePositionOutside: Story;
|
|
16
|
+
export declare const StatusVariants: Story;
|
|
17
|
+
export declare const AnimatedProgress: Story;
|
|
18
|
+
export declare const CustomColors: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ProgressType = 'circle' | 'semicircle' | string;
|
|
3
|
+
export type ProgressStatus = 'normal' | 'success' | 'exception' | 'active';
|
|
4
|
+
export type TitlePosition = 'inside' | 'outside';
|
|
5
|
+
export interface ProgressProps {
|
|
6
|
+
/** 进度百分比,范围 0-100 */
|
|
7
|
+
percent?: number;
|
|
8
|
+
/** 进度条类型,目前支持 circle(圆形)和 semicircle(半圆) */
|
|
9
|
+
type?: ProgressType;
|
|
10
|
+
/** 进度条宽度(尺寸),单位 px */
|
|
11
|
+
width?: number;
|
|
12
|
+
/** 标题文本 */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** 标题位置,圆内(inside)或圆外(outside),圆外时显示在圆下方 */
|
|
15
|
+
titlePosition?: TitlePosition;
|
|
16
|
+
/** 是否显示百分比 */
|
|
17
|
+
showPercent?: boolean;
|
|
18
|
+
/** 是否启用动画效果 */
|
|
19
|
+
animated?: boolean;
|
|
20
|
+
/** 进度条状态 */
|
|
21
|
+
status?: ProgressStatus;
|
|
22
|
+
/** 自定义类名 */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** 自定义样式 */
|
|
25
|
+
style?: React.CSSProperties;
|
|
26
|
+
/** 进度条颜色,不设置则使用主题色 */
|
|
27
|
+
strokeColor?: string;
|
|
28
|
+
/** 进度条轨道颜色 */
|
|
29
|
+
trailColor?: string;
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
|
32
|
+
declare const Progress: React.FC<ProgressProps>;
|
|
33
|
+
export default Progress;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Radio from './index';
|
|
3
|
+
declare const meta: Meta<typeof Radio>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Radio>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const Checked: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
9
|
+
export declare const RadioGroup: Story;
|
|
10
|
+
export declare const Sizes: Story;
|
|
@@ -3,8 +3,10 @@ import Radio from './index';
|
|
|
3
3
|
declare const meta: Meta<typeof Radio>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof Radio>;
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const Disabled: Story;
|
|
9
|
-
export declare const RadioGroup: Story;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithHint: Story;
|
|
10
8
|
export declare const Sizes: Story;
|
|
9
|
+
export declare const AllStates: Story;
|
|
10
|
+
export declare const Focused: Story;
|
|
11
|
+
export declare const RadioGroup: Story;
|
|
12
|
+
export declare const RadioGroupWithHint: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface RadioProps {
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
value?: any;
|
|
10
|
+
name?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const Radio: React.FC<RadioProps>;
|
|
13
|
+
export default Radio;
|
|
@@ -8,6 +8,12 @@ export interface RadioProps {
|
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
value?: any;
|
|
10
10
|
name?: string;
|
|
11
|
+
/** sm = 16px, md = 20px */
|
|
12
|
+
size?: 'sm' | 'md';
|
|
13
|
+
/** Secondary description rendered below the label */
|
|
14
|
+
hint?: React.ReactNode;
|
|
15
|
+
/** Force focused appearance (useful for Storybook demos) */
|
|
16
|
+
isFocused?: boolean;
|
|
11
17
|
}
|
|
12
18
|
declare const Radio: React.FC<RadioProps>;
|
|
13
19
|
export default Radio;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Select from './index';
|
|
3
|
+
declare const meta: Meta<typeof Select>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Select>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const Sizes: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
9
|
+
export declare const Error: Story;
|
|
10
|
+
export declare const Searchable: Story;
|
|
11
|
+
export declare const Multiple: Story;
|
|
12
|
+
export declare const MultipleWithMaxTag: Story;
|
|
13
|
+
export declare const WithClear: Story;
|
|
14
|
+
export declare const Controlled: Story;
|
|
15
|
+
export declare const WithDisabledOption: Story;
|
|
16
|
+
export declare const LongList: Story;
|
|
17
|
+
export declare const AllStates: Story;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SelectOption {
|
|
3
|
+
label: React.ReactNode;
|
|
4
|
+
value: string | number;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export interface SelectProps {
|
|
9
|
+
/** 当前选中的值 */
|
|
10
|
+
value?: string | number | (string | number)[];
|
|
11
|
+
/** 默认选中的值 */
|
|
12
|
+
defaultValue?: string | number | (string | number)[];
|
|
13
|
+
/** 选项数据 */
|
|
14
|
+
options?: SelectOption[];
|
|
15
|
+
/** 是否支持多选 */
|
|
16
|
+
mode?: 'multiple' | 'tags';
|
|
17
|
+
/** 是否禁用 */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** 是否显示错误状态 */
|
|
20
|
+
error?: boolean;
|
|
21
|
+
/** 占位符 */
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
/** 尺寸 */
|
|
24
|
+
size?: 'small' | 'mediumSmall' | 'medium' | 'large';
|
|
25
|
+
/** 是否可搜索 */
|
|
26
|
+
showSearch?: boolean;
|
|
27
|
+
/** 搜索过滤函数 */
|
|
28
|
+
filterOption?: boolean | ((input: string, option: SelectOption) => boolean);
|
|
29
|
+
/** 是否允许清除 */
|
|
30
|
+
allowClear?: boolean;
|
|
31
|
+
/** 变化回调 */
|
|
32
|
+
onChange?: (value: string | number | (string | number)[], option: SelectOption | SelectOption[]) => void;
|
|
33
|
+
/** 选择回调 */
|
|
34
|
+
onSelect?: (value: string | number, option: SelectOption) => void;
|
|
35
|
+
/** 取消选择回调 */
|
|
36
|
+
onDeselect?: (value: string | number, option: SelectOption) => void;
|
|
37
|
+
/** 搜索回调 */
|
|
38
|
+
onSearch?: (value: string) => void;
|
|
39
|
+
/** 聚焦回调 */
|
|
40
|
+
onFocus?: (e: React.FocusEvent) => void;
|
|
41
|
+
/** 失焦回调 */
|
|
42
|
+
onBlur?: (e: React.FocusEvent) => void;
|
|
43
|
+
/** 下拉框打开回调 */
|
|
44
|
+
onDropdownVisibleChange?: (open: boolean) => void;
|
|
45
|
+
/** 自定义类名 */
|
|
46
|
+
className?: string;
|
|
47
|
+
/** 自定义样式 */
|
|
48
|
+
style?: React.CSSProperties;
|
|
49
|
+
/** 下拉框类名 */
|
|
50
|
+
dropdownClassName?: string;
|
|
51
|
+
/** 下拉框样式 */
|
|
52
|
+
dropdownStyle?: React.CSSProperties;
|
|
53
|
+
/** 是否默认打开 */
|
|
54
|
+
defaultOpen?: boolean;
|
|
55
|
+
/** 是否打开(受控) */
|
|
56
|
+
open?: boolean;
|
|
57
|
+
/** 最大标签数量 */
|
|
58
|
+
maxTagCount?: number | 'responsive';
|
|
59
|
+
/** 标签渲染函数 */
|
|
60
|
+
tagRender?: (props: {
|
|
61
|
+
label: React.ReactNode;
|
|
62
|
+
value: string | number;
|
|
63
|
+
closable: boolean;
|
|
64
|
+
onClose: () => void;
|
|
65
|
+
}) => React.ReactNode;
|
|
66
|
+
/** 选项渲染函数 */
|
|
67
|
+
optionRender?: (option: SelectOption, info: {
|
|
68
|
+
selected: boolean;
|
|
69
|
+
focused: boolean;
|
|
70
|
+
disabled: boolean;
|
|
71
|
+
}) => React.ReactNode;
|
|
72
|
+
}
|
|
73
|
+
declare const Select: React.FC<SelectProps>;
|
|
74
|
+
export default Select;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Switch from './index';
|
|
3
|
+
declare const meta: Meta<typeof Switch>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Switch>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const Sizes: Story;
|
|
8
|
+
export declare const Checked: Story;
|
|
9
|
+
export declare const Unchecked: Story;
|
|
10
|
+
export declare const Disabled: Story;
|
|
11
|
+
export declare const Loading: Story;
|
|
12
|
+
export declare const WithChildren: Story;
|
|
13
|
+
export declare const Controlled: Story;
|
|
14
|
+
export declare const AllStates: Story;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SwitchProps {
|
|
3
|
+
/** 是否选中 */
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
/** 默认是否选中 */
|
|
6
|
+
defaultChecked?: boolean;
|
|
7
|
+
/** 是否禁用 */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** 变化回调 */
|
|
10
|
+
onChange?: (checked: boolean, event: React.MouseEvent) => void;
|
|
11
|
+
/** 点击回调 */
|
|
12
|
+
onClick?: (checked: boolean, event: React.MouseEvent) => void;
|
|
13
|
+
/** 选中时的内容 */
|
|
14
|
+
checkedChildren?: React.ReactNode;
|
|
15
|
+
/** 非选中时的内容 */
|
|
16
|
+
unCheckedChildren?: React.ReactNode;
|
|
17
|
+
/** 尺寸 */
|
|
18
|
+
size?: 'small' | 'default';
|
|
19
|
+
/** 加载状态 */
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
/** 自定义类名 */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** 自定义样式 */
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
}
|
|
26
|
+
declare const Switch: React.FC<SwitchProps>;
|
|
27
|
+
export default Switch;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Tab from './index';
|
|
3
|
+
declare const meta: Meta<typeof Tab>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Tab>;
|
|
6
|
+
export declare const Underline: Story;
|
|
7
|
+
export declare const UnderlineWithBadge: Story;
|
|
8
|
+
export declare const UnderlineWithIcon: Story;
|
|
9
|
+
export declare const BackgroundEqual: Story;
|
|
10
|
+
export declare const BackgroundSpaced: Story;
|
|
11
|
+
export declare const BackgroundWithIconAndBadge: Story;
|
|
12
|
+
export declare const WithCustomElement: Story;
|
|
13
|
+
export declare const ValueMode: Story;
|
|
14
|
+
export declare const WithDisabled: Story;
|
|
15
|
+
export declare const FullExample: Story;
|
|
16
|
+
export declare const WithNumberArray: Story;
|
|
17
|
+
export declare const StringArrayWithValue: Story;
|
|
18
|
+
export declare const ControlledWithNumbers: Story;
|
|
19
|
+
export declare const ScrollableTabs: Story;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type TabVariant = 'underline' | 'background';
|
|
3
|
+
export type TabLayout = 'equal' | 'spaced';
|
|
4
|
+
export interface TabItem {
|
|
5
|
+
key: string | number;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
icon?: React.ReactElement | React.ComponentType<any>;
|
|
8
|
+
badge?: number | string;
|
|
9
|
+
customElement?: React.ReactNode;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export interface TabProps {
|
|
14
|
+
items: TabItem[] | string[] | number[];
|
|
15
|
+
variant?: TabVariant;
|
|
16
|
+
layout?: TabLayout;
|
|
17
|
+
defaultValue?: string | number;
|
|
18
|
+
value?: string | number;
|
|
19
|
+
onChange?: (value: string | number) => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
mode?: 'children' | 'value';
|
|
22
|
+
scrollable?: boolean;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}
|
|
25
|
+
declare const Tab: React.FC<TabProps>;
|
|
26
|
+
export default Tab;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Table from './index';
|
|
3
|
+
declare const meta: Meta<typeof Table>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Table>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const Loading: Story;
|
|
8
|
+
export declare const LoadingCustom: Story;
|
|
9
|
+
export declare const Empty: Story;
|
|
10
|
+
export declare const EmptyWithCustomText: Story;
|
|
11
|
+
export declare const EmptyWithCustomNode: Story;
|
|
12
|
+
export declare const WithPagination: Story;
|
|
13
|
+
export declare const WithRowSelection: Story;
|
|
14
|
+
export declare const WithSorting: Story;
|
|
15
|
+
export declare const WithSorterChange: Story;
|
|
16
|
+
export declare const WithFixedColumns: Story;
|
|
17
|
+
export declare const WithColumnWidth: Story;
|
|
18
|
+
export declare const WithRowSelectionDisabled: Story;
|
|
19
|
+
export declare const WithCustomRender: Story;
|
|
20
|
+
export declare const WithAlign: Story;
|
|
21
|
+
export declare const WithPaginationChange: Story;
|