@aozi6666/bee-design 0.1.0 → 0.2.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.
Files changed (102) hide show
  1. package/dist/App.d.ts +4 -0
  2. package/{build → dist}/components/AutoComplete/autoComplete.d.ts +2 -2
  3. package/{build → dist}/components/AutoComplete/autoComplete.types.d.ts +4 -4
  4. package/{build → dist}/components/AutoComplete/autoCompleteDropdown.d.ts +2 -2
  5. package/dist/components/AutoComplete/index.d.ts +4 -0
  6. package/{build → dist}/components/Button/button.d.ts +2 -2
  7. package/{build → dist}/components/Button/button.types.d.ts +1 -1
  8. package/dist/components/Button/index.d.ts +2 -0
  9. package/{build → dist}/components/Icon/icon.d.ts +2 -2
  10. package/dist/components/Icon/icon.types.d.ts +6 -0
  11. package/dist/components/Icon/index.d.ts +2 -0
  12. package/dist/components/Input/index.d.ts +4 -0
  13. package/dist/components/Input/input.d.ts +5 -0
  14. package/{build → dist}/components/Input/input.types.d.ts +4 -4
  15. package/{build → dist}/components/Menu/index.d.ts +4 -4
  16. package/{build → dist}/components/Menu/menu.d.ts +2 -10
  17. package/dist/components/Menu/menuContext.d.ts +9 -0
  18. package/{build → dist}/components/Menu/menuItem.d.ts +2 -2
  19. package/{build → dist}/components/Menu/subMenu.d.ts +1 -1
  20. package/dist/components/Progress/index.d.ts +2 -0
  21. package/dist/components/Progress/progress.d.ts +4 -0
  22. package/{build → dist}/components/Progress/progress.types.d.ts +2 -2
  23. package/dist/components/Transition/index.d.ts +3 -0
  24. package/dist/components/Transition/transition.d.ts +4 -0
  25. package/dist/components/Transition/transition.types.d.ts +9 -0
  26. package/{build → dist}/components/Upload/dragger.d.ts +1 -1
  27. package/dist/components/Upload/index.d.ts +2 -0
  28. package/{build → dist}/components/Upload/upload.d.ts +2 -2
  29. package/{build → dist}/components/Upload/upload.types.d.ts +7 -11
  30. package/{build → dist}/components/Upload/uploadList.d.ts +2 -2
  31. package/dist/hooks/useClickOutside.d.ts +3 -0
  32. package/dist/hooks/useDebounce.d.ts +2 -0
  33. package/dist/index.cjs +16272 -0
  34. package/dist/index.cjs.map +1 -0
  35. package/{build → dist}/index.css +24 -24
  36. package/dist/index.d.ts +9 -0
  37. package/dist/index.esm.js +709 -0
  38. package/dist/index.esm.js.map +1 -0
  39. package/dist/index.umd.js +14381 -0
  40. package/dist/index.umd.js.map +1 -0
  41. package/dist/main.d.ts +1 -0
  42. package/dist/setupIcons.d.ts +1 -0
  43. package/dist/setupTests.d.ts +1 -0
  44. package/package.json +61 -48
  45. package/README.md +0 -73
  46. package/build/App.d.ts +0 -4
  47. package/build/App.js +0 -137
  48. package/build/components/AutoComplete/autoComplete.js +0 -123
  49. package/build/components/AutoComplete/autoComplete.types.js +0 -1
  50. package/build/components/AutoComplete/autoCompleteDropdown.js +0 -17
  51. package/build/components/AutoComplete/index.d.ts +0 -4
  52. package/build/components/AutoComplete/index.js +0 -3
  53. package/build/components/Button/button.js +0 -43
  54. package/build/components/Button/button.types.js +0 -19
  55. package/build/components/Button/index.d.ts +0 -2
  56. package/build/components/Button/index.js +0 -2
  57. package/build/components/Icon/icon.js +0 -24
  58. package/build/components/Icon/icon.types.d.ts +0 -6
  59. package/build/components/Icon/icon.types.js +0 -2
  60. package/build/components/Icon/index.d.ts +0 -2
  61. package/build/components/Icon/index.js +0 -2
  62. package/build/components/Input/index.d.ts +0 -4
  63. package/build/components/Input/index.js +0 -3
  64. package/build/components/Input/input.d.ts +0 -5
  65. package/build/components/Input/input.js +0 -32
  66. package/build/components/Input/input.types.js +0 -1
  67. package/build/components/Menu/index.js +0 -9
  68. package/build/components/Menu/menu.js +0 -48
  69. package/build/components/Menu/menuItem.js +0 -20
  70. package/build/components/Menu/subMenu.js +0 -56
  71. package/build/components/Progress/index.d.ts +0 -2
  72. package/build/components/Progress/index.js +0 -2
  73. package/build/components/Progress/progress.d.ts +0 -4
  74. package/build/components/Progress/progress.js +0 -6
  75. package/build/components/Progress/progress.types.js +0 -2
  76. package/build/components/Transition/index.d.ts +0 -3
  77. package/build/components/Transition/index.js +0 -2
  78. package/build/components/Transition/transition.d.ts +0 -4
  79. package/build/components/Transition/transition.js +0 -18
  80. package/build/components/Transition/transition.types.d.ts +0 -10
  81. package/build/components/Transition/transition.types.js +0 -1
  82. package/build/components/Upload/dragger.js +0 -42
  83. package/build/components/Upload/index.d.ts +0 -2
  84. package/build/components/Upload/index.js +0 -2
  85. package/build/components/Upload/native/axios-react.js +0 -99
  86. package/build/components/Upload/native/from-html.js +0 -5
  87. package/build/components/Upload/upload.js +0 -192
  88. package/build/components/Upload/upload.types.js +0 -3
  89. package/build/components/Upload/uploadList.js +0 -13
  90. package/build/hooks/useClickOutside.d.ts +0 -3
  91. package/build/hooks/useClickOutside.js +0 -18
  92. package/build/hooks/useDebounce.d.ts +0 -2
  93. package/build/hooks/useDebounce.js +0 -14
  94. package/build/index.css.map +0 -1
  95. package/build/index.d.ts +0 -9
  96. package/build/index.js +0 -12
  97. package/build/main.d.ts +0 -1
  98. package/build/main.js +0 -7
  99. package/build/setupTests.d.ts +0 -1
  100. package/build/setupTests.js +0 -1
  101. /package/{build → dist}/components/Upload/native/axios-react.d.ts +0 -0
  102. /package/{build → dist}/components/Upload/native/from-html.d.ts +0 -0
package/dist/App.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { FC } from "react";
2
+ import "./styles/index.scss";
3
+ declare const App: FC;
4
+ export default App;
@@ -1,5 +1,5 @@
1
- import type { AutoCompleteProps } from './autoComplete.types';
2
- export type { AutoCompleteProps, DataSourceType } from './autoComplete.types';
1
+ import type { AutoCompleteProps } from "./autoComplete.types";
2
+ export type { AutoCompleteProps, DataSourceType } from "./autoComplete.types";
3
3
  /**
4
4
  * 输入框自动完成功能。当输入值需要自动完成时使用,支持同步和异步两种方式
5
5
  * 支持 Input 组件的所有属性 支持键盘事件选择
@@ -1,10 +1,10 @@
1
- import type { ReactElement } from 'react';
2
- import type { InputProps } from '../Input/input.types';
1
+ import type { ReactElement } from "react";
2
+ import type { InputProps } from "../Input/input.types";
3
3
  interface DataSourceObject {
4
4
  value: string;
5
5
  }
6
- export type DataSourceType<T = {}> = T & DataSourceObject;
7
- export interface AutoCompleteProps extends Omit<InputProps, 'onSelect' | 'onChange'> {
6
+ export type DataSourceType<T = Record<string, unknown>> = T & DataSourceObject;
7
+ export interface AutoCompleteProps extends Omit<InputProps, "onSelect" | "onChange"> {
8
8
  /**
9
9
  * 返回输入建议的方法,可以拿到当前的输入,然后返回同步的数组或者是异步的 Promise
10
10
  */
@@ -1,5 +1,5 @@
1
- import type { FC, ReactElement } from 'react';
2
- import type { DataSourceType } from './autoComplete.types';
1
+ import type { FC, ReactElement } from "react";
2
+ import type { DataSourceType } from "./autoComplete.types";
3
3
  export interface AutoCompleteDropdownProps {
4
4
  loading: boolean;
5
5
  showDropdown: boolean;
@@ -0,0 +1,4 @@
1
+ import AutoComplete from "./autoComplete";
2
+ export default AutoComplete;
3
+ export { AutoComplete } from "./autoComplete";
4
+ export type { AutoCompleteProps, DataSourceType } from "./autoComplete.types";
@@ -1,5 +1,5 @@
1
- import type { FC } from 'react';
2
- import { ButtonSize, ButtonType, type AnchorButtonProps, type ButtonProps, type NativeButtonProps } from './button.types';
1
+ import type { FC } from "react";
2
+ import { ButtonSize, ButtonType, type AnchorButtonProps, type ButtonProps, type NativeButtonProps } from "./button.types";
3
3
  declare const Button: FC<ButtonProps>;
4
4
  export default Button;
5
5
  export { ButtonSize, ButtonType };
@@ -1,4 +1,4 @@
1
- import type { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from 'react';
1
+ import type { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from "react";
2
2
  export declare const ButtonSize: {
3
3
  readonly Large: "lg";
4
4
  readonly Small: "sm";
@@ -0,0 +1,2 @@
1
+ import Button from "./button";
2
+ export default Button;
@@ -1,5 +1,5 @@
1
- import type { FC } from 'react';
2
- import type { IconProps } from './icon.types';
1
+ import type { FC } from "react";
2
+ import type { IconProps } from "./icon.types";
3
3
  /**
4
4
  * 提供了一套常用的图标集合 基于 react-fontawesome。
5
5
  *
@@ -0,0 +1,6 @@
1
+ import type { FontAwesomeIconProps } from "@fortawesome/react-fontawesome";
2
+ export type ThemeProps = "primary" | "secondary" | "success" | "info" | "warning" | "danger" | "light" | "dark";
3
+ export interface IconProps extends FontAwesomeIconProps {
4
+ /** 支持框架主题,根据主题显示不同的颜色 */
5
+ theme?: ThemeProps;
6
+ }
@@ -0,0 +1,2 @@
1
+ import Icon from "./icon";
2
+ export default Icon;
@@ -0,0 +1,4 @@
1
+ import Input from "./input";
2
+ export default Input;
3
+ export { Input } from "./input";
4
+ export type * from "./input.types";
@@ -0,0 +1,5 @@
1
+ import type { FC } from "react";
2
+ import type { InputProps } from "./input.types";
3
+ export type { InputProps, InputSize } from "./input.types";
4
+ export declare const Input: FC<InputProps>;
5
+ export default Input;
@@ -1,7 +1,7 @@
1
- import type { ChangeEvent, InputHTMLAttributes, ReactElement } from 'react';
2
- import type { IconProp } from '@fortawesome/fontawesome-svg-core';
3
- export type InputSize = 'lg' | 'sm';
4
- export interface InputProps extends Omit<InputHTMLAttributes<HTMLElement>, 'size'> {
1
+ import type { ChangeEvent, InputHTMLAttributes, ReactElement } from "react";
2
+ import type { IconProp } from "@fortawesome/fontawesome-svg-core";
3
+ export type InputSize = "lg" | "sm";
4
+ export interface InputProps extends Omit<InputHTMLAttributes<HTMLElement>, "size"> {
5
5
  /** 是否禁用 Input */
6
6
  disabled?: boolean;
7
7
  /** 设置 input 大小,支持 lg 或者是 sm */
@@ -1,7 +1,7 @@
1
- import type { FC } from 'react';
2
- import { type MenuProps } from './menu';
3
- import { type SubMenuProps } from './subMenu';
4
- import { type MenuItemProps } from './menuItem';
1
+ import type { FC } from "react";
2
+ import { type MenuProps } from "./menu";
3
+ import { type SubMenuProps } from "./subMenu";
4
+ import { type MenuItemProps } from "./menuItem";
5
5
  export type IMenuComponent = FC<MenuProps> & {
6
6
  Item: FC<MenuItemProps>;
7
7
  SubMenu: FC<SubMenuProps>;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import type { FC, CSSProperties, ReactNode } from 'react';
3
- type MenuMode = 'horizontal' | 'vertical';
1
+ import type { FC, CSSProperties, ReactNode } from "react";
2
+ type MenuMode = "horizontal" | "vertical";
4
3
  export interface MenuProps {
5
4
  /**默认 active 的菜单项的索引值 */
6
5
  defaultIndex?: string;
@@ -14,13 +13,6 @@ export interface MenuProps {
14
13
  defaultOpenSubMenus?: string[];
15
14
  children?: ReactNode;
16
15
  }
17
- interface IMenuContext {
18
- index: string;
19
- onSelect?: (selectedIndex: string) => void;
20
- mode?: MenuMode;
21
- defaultOpenSubMenus?: string[];
22
- }
23
- export declare const MenuContext: React.Context<IMenuContext>;
24
16
  /**
25
17
  * 为网站提供导航功能的菜单。支持横向纵向两种模式,支持下拉菜单。
26
18
  *
@@ -0,0 +1,9 @@
1
+ type MenuMode = "horizontal" | "vertical";
2
+ export interface IMenuContext {
3
+ index: string;
4
+ onSelect?: (selectedIndex: string) => void;
5
+ mode?: MenuMode;
6
+ defaultOpenSubMenus?: string[];
7
+ }
8
+ export declare const MenuContext: import("react").Context<IMenuContext>;
9
+ export {};
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import type { FC, ReactNode } from 'react';
1
+ import React from "react";
2
+ import type { FC, ReactNode } from "react";
3
3
  export interface MenuItemProps {
4
4
  index?: string;
5
5
  /**选项是否被禁用 */
@@ -1,4 +1,4 @@
1
- import type { FC, ReactNode } from 'react';
1
+ import type { FC, ReactNode } from "react";
2
2
  export interface SubMenuProps {
3
3
  index?: string;
4
4
  /**下拉菜单选项的文字 */
@@ -0,0 +1,2 @@
1
+ import Progress from "./progress";
2
+ export default Progress;
@@ -0,0 +1,4 @@
1
+ import type { FC } from "react";
2
+ import type { ProgressProps } from "./progress.types";
3
+ declare const Progress: FC<ProgressProps>;
4
+ export default Progress;
@@ -1,5 +1,5 @@
1
- import type { CSSProperties } from 'react';
2
- import type { ThemeProps } from '../Icon/icon.types';
1
+ import type { CSSProperties } from "react";
2
+ import type { ThemeProps } from "../Icon/icon.types";
3
3
  export interface ProgressProps {
4
4
  percent: number;
5
5
  strokeHeight?: number;
@@ -0,0 +1,3 @@
1
+ import Transition from "./transition";
2
+ export default Transition;
3
+ export type { AnimationName, TransitionProps } from "./transition";
@@ -0,0 +1,4 @@
1
+ import type { TransitionProps } from "./transition.types";
2
+ export type { AnimationName, TransitionProps } from "./transition.types";
3
+ declare const Transition: (props: TransitionProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default Transition;
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from "react";
2
+ import type { CSSTransitionProps } from "react-transition-group/CSSTransition";
3
+ export type AnimationName = "zoom-in-top" | "zoom-in-left" | "zoom-in-bottom" | "zoom-in-right";
4
+ export type TransitionProps = Omit<CSSTransitionProps<HTMLElement>, "timeout"> & {
5
+ animation?: AnimationName;
6
+ wrapper?: boolean;
7
+ children?: ReactNode;
8
+ timeout: NonNullable<CSSTransitionProps<HTMLElement>["timeout"]>;
9
+ };
@@ -1,4 +1,4 @@
1
- import type { FC, ReactNode } from 'react';
1
+ import type { FC, ReactNode } from "react";
2
2
  interface DraggerProps {
3
3
  onFile: (files: FileList) => void;
4
4
  children?: ReactNode;
@@ -0,0 +1,2 @@
1
+ import Upload from "./upload";
2
+ export default Upload;
@@ -1,5 +1,5 @@
1
- import type { FC } from 'react';
2
- import type { UploadProps } from './upload.types';
1
+ import type { FC } from "react";
2
+ import type { UploadProps } from "./upload.types";
3
3
  /**
4
4
  * 通过点击或者拖拽上传文件
5
5
  * ### 引用方法
@@ -1,4 +1,4 @@
1
- export type UploadFileStatus = 'ready' | 'uploading' | 'success' | 'error';
1
+ export type UploadFileStatus = "ready" | "uploading" | "success" | "error";
2
2
  export interface UploadFile {
3
3
  uid: string;
4
4
  size: number;
@@ -6,8 +6,8 @@ export interface UploadFile {
6
6
  status?: UploadFileStatus;
7
7
  percent: number;
8
8
  raw?: File;
9
- response?: any;
10
- error?: any;
9
+ response?: unknown;
10
+ error?: unknown;
11
11
  }
12
12
  export interface UploadProps {
13
13
  /** 必选参数, 上传的地址 */
@@ -19,23 +19,19 @@ export interface UploadProps {
19
19
  /** 文件上传时的钩子 */
20
20
  onProgress?: (percentage: number, file: UploadFile) => void;
21
21
  /** 文件上传成功时的钩子 */
22
- onSuccess?: (data: any, file: UploadFile) => void;
22
+ onSuccess?: (data: unknown, file: UploadFile) => void;
23
23
  /** 文件上传失败时的钩子 */
24
- onError?: (err: any, file: UploadFile) => void;
24
+ onError?: (err: unknown, file: UploadFile) => void;
25
25
  /** 文件状态改变时的钩子,上传成功或者失败时都会被调用 */
26
26
  onChange?: (file: UploadFile) => void;
27
27
  /** 文件列表移除文件时的钩子 */
28
28
  onRemove?: (file: UploadFile) => void;
29
29
  /** 设置上传的请求头部 */
30
- headers?: {
31
- [key: string]: any;
32
- };
30
+ headers?: Record<string, string>;
33
31
  /** 上传的文件字段名 */
34
32
  name?: string;
35
33
  /** 上传时附带的额外参数 */
36
- data?: {
37
- [key: string]: any;
38
- };
34
+ data?: Record<string, string>;
39
35
  /** 是否发送 cookie 凭证信息 */
40
36
  withCredentials?: boolean;
41
37
  /** 可选参数, 接受上传的文件类型 */
@@ -1,5 +1,5 @@
1
- import type { FC } from 'react';
2
- import type { UploadFile } from './upload.types';
1
+ import type { FC } from "react";
2
+ import type { UploadFile } from "./upload.types";
3
3
  interface UploadListProps {
4
4
  fileList: UploadFile[];
5
5
  onRemove: (_file: UploadFile) => void;
@@ -0,0 +1,3 @@
1
+ import type { RefObject } from "react";
2
+ declare function useClickOutside<T extends HTMLElement>(ref: RefObject<T | null>, handler: (event: MouseEvent) => void, eventType?: "click" | "mousedown"): void;
3
+ export default useClickOutside;
@@ -0,0 +1,2 @@
1
+ declare function useDebounce<T>(value: T, delay?: number): T;
2
+ export default useDebounce;