aha-components 1.6.3 → 1.7.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,9 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import Drawer from "./index";
3
+ declare const meta: Meta<typeof Drawer>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Drawer>;
6
+ export declare const Basic: Story;
7
+ export declare const Placements: Story;
8
+ export declare const NonControlled: Story;
9
+ export declare const MobileWidthDemo: Story;
@@ -0,0 +1,58 @@
1
+ import React from "react";
2
+ export type DrawerPlacement = "left" | "right" | "top" | "bottom";
3
+ export interface DrawerProps {
4
+ /** 是否打开(受控) */
5
+ open?: boolean;
6
+ /** 默认是否打开(非受控) */
7
+ defaultOpen?: boolean;
8
+ /** 关闭回调 */
9
+ onClose?: (e?: React.MouseEvent | React.KeyboardEvent) => void;
10
+ /** 打开/关闭动画结束回调 */
11
+ afterOpenChange?: (open: boolean) => void;
12
+ /** 抽屉标题 */
13
+ title?: React.ReactNode;
14
+ /** 头部右侧内容 */
15
+ extra?: React.ReactNode;
16
+ /** 底部内容 */
17
+ footer?: React.ReactNode;
18
+ /** 内容 */
19
+ children?: React.ReactNode;
20
+ /** 打开方向 */
21
+ placement?: DrawerPlacement;
22
+ /** PC 端宽度(移动端始终使用 100vw) */
23
+ width?: number | string;
24
+ /** 高度(top/bottom 生效,移动端同样支持) */
25
+ height?: number | string;
26
+ /** 是否显示遮罩 */
27
+ mask?: boolean;
28
+ /** 点击遮罩是否关闭 */
29
+ maskClosable?: boolean;
30
+ /** 是否显示右上角关闭按钮 */
31
+ closable?: boolean;
32
+ /** 自定义关闭图标 */
33
+ closeIcon?: React.ReactNode;
34
+ /** 是否支持 Esc 关闭 */
35
+ keyboard?: boolean;
36
+ /** 是否在关闭后销毁内容 */
37
+ destroyOnClose?: boolean;
38
+ /** 层级 */
39
+ zIndex?: number;
40
+ /** 移动端断点 */
41
+ mobileBreakpoint?: number;
42
+ /** 容器类名 */
43
+ className?: string;
44
+ /** 容器样式 */
45
+ style?: React.CSSProperties;
46
+ /** 抽屉面板类名 */
47
+ drawerStyle?: React.CSSProperties;
48
+ /** 头部样式 */
49
+ headerStyle?: React.CSSProperties;
50
+ /** 内容样式 */
51
+ bodyStyle?: React.CSSProperties;
52
+ /** 底部样式 */
53
+ footerStyle?: React.CSSProperties;
54
+ /** 遮罩样式 */
55
+ maskStyle?: React.CSSProperties;
56
+ }
57
+ declare const Drawer: React.FC<DrawerProps>;
58
+ export default Drawer;
@@ -6,6 +6,8 @@ export interface MenuItemType {
6
6
  label: React.ReactNode;
7
7
  /** 菜单项图标 */
8
8
  icon?: React.ReactNode;
9
+ /** 菜单项右侧图标 */
10
+ suffixIcon?: React.ReactNode;
9
11
  /** 是否禁用 */
10
12
  disabled?: boolean;
11
13
  /** 是否危险项(红色) */
@@ -0,0 +1,10 @@
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;
@@ -0,0 +1,25 @@
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
+ placement?: PopoverPlacement;
13
+ /** 内容宽度 */
14
+ width?: string | number;
15
+ /** 触发节点和 Popover 的间距 */
16
+ offset?: number;
17
+ /** 自定义容器类名 */
18
+ className?: string;
19
+ /** 自定义 Popover 类名 */
20
+ popoverClassName?: string;
21
+ /** 是否禁用 */
22
+ disabled?: boolean;
23
+ }
24
+ declare const Popover: React.FC<PopoverProps>;
25
+ export default Popover;
@@ -4,6 +4,8 @@ declare const meta: Meta<typeof Table>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Table>;
6
6
  export declare const Basic: Story;
7
+ export declare const Loading: Story;
8
+ export declare const LoadingCustom: Story;
7
9
  export declare const Empty: Story;
8
10
  export declare const EmptyWithCustomText: Story;
9
11
  export declare const EmptyWithCustomNode: Story;
package/dist/index.d.ts CHANGED
@@ -770,6 +770,8 @@ interface MenuItemType {
770
770
  label: React.ReactNode;
771
771
  /** 菜单项图标 */
772
772
  icon?: React.ReactNode;
773
+ /** 菜单项右侧图标 */
774
+ suffixIcon?: React.ReactNode;
773
775
  /** 是否禁用 */
774
776
  disabled?: boolean;
775
777
  /** 是否危险项(红色) */
@@ -879,6 +881,87 @@ interface TooltipProps {
879
881
  }
880
882
  declare const Tooltip: React.FC<TooltipProps>;
881
883
 
884
+ type PopoverTrigger = "click" | "hover";
885
+ type PopoverPlacement = "top" | "right" | "bottom" | "left";
886
+ interface PopoverProps {
887
+ /** 触发节点 */
888
+ children: React.ReactNode;
889
+ /** Popover 内容 */
890
+ content: React.ReactNode;
891
+ /** 触发模式 */
892
+ trigger?: PopoverTrigger;
893
+ /** 展示方向 */
894
+ placement?: PopoverPlacement;
895
+ /** 内容宽度 */
896
+ width?: string | number;
897
+ /** 触发节点和 Popover 的间距 */
898
+ offset?: number;
899
+ /** 自定义容器类名 */
900
+ className?: string;
901
+ /** 自定义 Popover 类名 */
902
+ popoverClassName?: string;
903
+ /** 是否禁用 */
904
+ disabled?: boolean;
905
+ }
906
+ declare const Popover: React.FC<PopoverProps>;
907
+
908
+ type DrawerPlacement = "left" | "right" | "top" | "bottom";
909
+ interface DrawerProps {
910
+ /** 是否打开(受控) */
911
+ open?: boolean;
912
+ /** 默认是否打开(非受控) */
913
+ defaultOpen?: boolean;
914
+ /** 关闭回调 */
915
+ onClose?: (e?: React.MouseEvent | React.KeyboardEvent) => void;
916
+ /** 打开/关闭动画结束回调 */
917
+ afterOpenChange?: (open: boolean) => void;
918
+ /** 抽屉标题 */
919
+ title?: React.ReactNode;
920
+ /** 头部右侧内容 */
921
+ extra?: React.ReactNode;
922
+ /** 底部内容 */
923
+ footer?: React.ReactNode;
924
+ /** 内容 */
925
+ children?: React.ReactNode;
926
+ /** 打开方向 */
927
+ placement?: DrawerPlacement;
928
+ /** PC 端宽度(移动端始终使用 100vw) */
929
+ width?: number | string;
930
+ /** 高度(top/bottom 生效,移动端同样支持) */
931
+ height?: number | string;
932
+ /** 是否显示遮罩 */
933
+ mask?: boolean;
934
+ /** 点击遮罩是否关闭 */
935
+ maskClosable?: boolean;
936
+ /** 是否显示右上角关闭按钮 */
937
+ closable?: boolean;
938
+ /** 自定义关闭图标 */
939
+ closeIcon?: React.ReactNode;
940
+ /** 是否支持 Esc 关闭 */
941
+ keyboard?: boolean;
942
+ /** 是否在关闭后销毁内容 */
943
+ destroyOnClose?: boolean;
944
+ /** 层级 */
945
+ zIndex?: number;
946
+ /** 移动端断点 */
947
+ mobileBreakpoint?: number;
948
+ /** 容器类名 */
949
+ className?: string;
950
+ /** 容器样式 */
951
+ style?: React.CSSProperties;
952
+ /** 抽屉面板类名 */
953
+ drawerStyle?: React.CSSProperties;
954
+ /** 头部样式 */
955
+ headerStyle?: React.CSSProperties;
956
+ /** 内容样式 */
957
+ bodyStyle?: React.CSSProperties;
958
+ /** 底部样式 */
959
+ footerStyle?: React.CSSProperties;
960
+ /** 遮罩样式 */
961
+ maskStyle?: React.CSSProperties;
962
+ }
963
+ declare const Drawer: React.FC<DrawerProps>;
964
+
882
965
  interface ThemeConfig {
883
966
  primaryColor?: string;
884
967
  }
@@ -898,4 +981,4 @@ declare const MinusIcon: React.FC<{
898
981
  style?: React.CSSProperties;
899
982
  }>;
900
983
 
901
- export { Alert, AlertProps, Button, ButtonProps, CheckIcon, Checkbox, CheckboxProps, ColumnType, DatePicker, DatePickerProps, DateRange, FormWithItem as Form, FormInstance, FormItemProps, FormProps, Input, InputProps, MenuGroupType, MenuItemType, MenuList, MenuListProps, MinusIcon, Pagination, PaginationProps, Progress, ProgressProps, ProgressStatus, ProgressType, Radio, RadioProps, Select, SelectOption, SelectProps, SortOrder, SorterResult, Switch, SwitchProps, Tab, TabItem, TabLayout, TabProps, TabVariant, Table, TableCurrentDataSource, TableLayout, TableProps, TableRowSelection, TableSize, Tag, TagProps, Textarea, TextareaProps, ThemeConfig, ThemeProvider, ThemeProviderProps, Toast, ToastPosition, ToastProps, ToastProvider, ToastType, Tooltip, TooltipPosition, TooltipProps, UserProfileType, clearAllToasts, closeToast, debugToast, toast, toastError, toastInfo, toastQuestion, toastSuccess, useTheme };
984
+ export { Alert, AlertProps, Button, ButtonProps, CheckIcon, Checkbox, CheckboxProps, ColumnType, DatePicker, DatePickerProps, DateRange, Drawer, DrawerPlacement, DrawerProps, FormWithItem as Form, FormInstance, FormItemProps, FormProps, Input, InputProps, MenuGroupType, MenuItemType, MenuList, MenuListProps, MinusIcon, Pagination, PaginationProps, Popover, PopoverPlacement, PopoverProps, PopoverTrigger, Progress, ProgressProps, ProgressStatus, ProgressType, Radio, RadioProps, Select, SelectOption, SelectProps, SortOrder, SorterResult, Switch, SwitchProps, Tab, TabItem, TabLayout, TabProps, TabVariant, Table, TableCurrentDataSource, TableLayout, TableProps, TableRowSelection, TableSize, Tag, TagProps, Textarea, TextareaProps, ThemeConfig, ThemeProvider, ThemeProviderProps, Toast, ToastPosition, ToastProps, ToastProvider, ToastType, Tooltip, TooltipPosition, TooltipProps, UserProfileType, clearAllToasts, closeToast, debugToast, toast, toastError, toastInfo, toastQuestion, toastSuccess, useTheme };