x-ui-design 1.0.31-gamma.1 → 1.0.33
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/.github/workflows/x-ui-design.yml +14 -0
- package/README.md +22 -1
- package/compile.sh +15 -0
- package/dist/{components → esm/types/components}/DatePicker/DatePicker.d.ts +2 -1
- package/dist/{components → esm/types/components}/DatePicker/RangePicker/RangePicker.d.ts +2 -1
- package/dist/{components → esm/types/components}/Dropdown/Dropdown.d.ts +2 -1
- package/dist/{components → esm/types/components}/Empty/Empty.d.ts +2 -1
- package/dist/{components → esm/types/components}/Form/Item/Item.d.ts +2 -1
- package/dist/esm/types/components/Icons/Icons.d.ts +19 -0
- package/dist/{components → esm/types/components}/Input/Input.d.ts +2 -1
- package/dist/{components → esm/types/components}/Input/Textarea/Textarea.d.ts +2 -1
- package/dist/{components → esm/types/components}/Popover/Popover.d.ts +2 -1
- package/dist/{components → esm/types/components}/Radio/Button/Button.d.ts +2 -1
- package/dist/{components → esm/types/components}/Radio/Group/Group.d.ts +2 -1
- package/dist/{components → esm/types/components}/Radio/Radio.d.ts +2 -1
- package/dist/{components → esm/types/components}/Result/Result.d.ts +2 -1
- package/dist/{components → esm/types/components}/Switch/Switch.d.ts +2 -1
- package/dist/{components → esm/types/components}/Upload/Upload.d.ts +2 -1
- package/dist/esm/types/index.d.ts +50 -0
- package/dist/{types → esm/types/types}/input.d.ts +2 -2
- package/dist/index.d.ts +144 -1
- package/dist/index.esm.js +4233 -3792
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4338 -3897
- package/dist/index.js.map +1 -1
- package/eslint.config.mjs +16 -0
- package/lib/components/Button/Button.tsx +136 -0
- package/lib/components/Button/index.ts +1 -0
- package/lib/components/Button/style.css +197 -0
- package/lib/components/Checkbox/Checkbox.tsx +131 -0
- package/lib/components/Checkbox/index.ts +1 -0
- package/lib/components/Checkbox/style.css +95 -0
- package/lib/components/ConditionalWrapper/index.tsx +12 -0
- package/lib/components/DatePicker/DatePicker.tsx +526 -0
- package/lib/components/DatePicker/RangePicker/RangePicker.tsx +500 -0
- package/lib/components/DatePicker/RangePicker/index.ts +1 -0
- package/lib/components/DatePicker/RangePicker/style.css +434 -0
- package/lib/components/DatePicker/TimePicker/TimePicker.tsx +497 -0
- package/lib/components/DatePicker/TimePicker/index.ts +1 -0
- package/lib/components/DatePicker/TimePicker/style.css +197 -0
- package/lib/components/DatePicker/index.ts +1 -0
- package/lib/components/DatePicker/style.css +318 -0
- package/lib/components/Dropdown/Dropdown.tsx +234 -0
- package/lib/components/Dropdown/index.ts +1 -0
- package/lib/components/Dropdown/style.css +124 -0
- package/lib/components/Empty/Empty.tsx +45 -0
- package/lib/components/Empty/index.ts +1 -0
- package/lib/components/Empty/style.css +13 -0
- package/lib/components/Form/Form.tsx +130 -0
- package/lib/components/Form/Item/Item.tsx +294 -0
- package/lib/components/Form/Item/index.ts +1 -0
- package/lib/components/Form/Item/style.css +61 -0
- package/lib/components/Form/index.ts +1 -0
- package/lib/components/Icons/Icons.tsx +433 -0
- package/lib/components/Icons/index.ts +15 -0
- package/lib/components/Input/Input.tsx +218 -0
- package/lib/components/Input/Textarea/Textarea.tsx +110 -0
- package/lib/components/Input/Textarea/index.ts +1 -0
- package/lib/components/Input/Textarea/style.css +104 -0
- package/lib/components/Input/index.ts +1 -0
- package/lib/components/Input/style.css +137 -0
- package/lib/components/Menu/Item/Item.tsx +65 -0
- package/lib/components/Menu/Menu.tsx +261 -0
- package/lib/components/Menu/SubMenu/SubMenu.tsx +68 -0
- package/lib/components/Menu/index.css +145 -0
- package/lib/components/Menu/index.ts +1 -0
- package/lib/components/Popover/Popover.tsx +135 -0
- package/lib/components/Popover/index.ts +1 -0
- package/lib/components/Popover/style.css +82 -0
- package/lib/components/Radio/Button/Button.tsx +42 -0
- package/lib/components/Radio/Button/index.ts +1 -0
- package/lib/components/Radio/Button/style.css +43 -0
- package/lib/components/Radio/Group/Group.tsx +105 -0
- package/lib/components/Radio/Group/index.ts +1 -0
- package/lib/components/Radio/Group/style.css +53 -0
- package/lib/components/Radio/Radio.tsx +83 -0
- package/lib/components/Radio/index.ts +1 -0
- package/lib/components/Radio/style.css +73 -0
- package/lib/components/Result/Result.tsx +39 -0
- package/lib/components/Result/index.ts +1 -0
- package/lib/components/Result/style.css +173 -0
- package/lib/components/Select/Option/Option.tsx +49 -0
- package/lib/components/Select/Option/index.ts +1 -0
- package/lib/components/Select/Option/style.css +50 -0
- package/lib/components/Select/Select.tsx +935 -0
- package/lib/components/Select/Tag/Tag.tsx +43 -0
- package/lib/components/Select/Tag/index.ts +1 -0
- package/lib/components/Select/Tag/style.css +87 -0
- package/lib/components/Select/index.ts +1 -0
- package/lib/components/Select/style.css +186 -0
- package/lib/components/Skeleton/Avatar/Avatar.tsx +61 -0
- package/lib/components/Skeleton/Avatar/index.ts +1 -0
- package/lib/components/Skeleton/Avatar/style.css +27 -0
- package/lib/components/Skeleton/Button/Button.tsx +44 -0
- package/lib/components/Skeleton/Button/index.ts +1 -0
- package/lib/components/Skeleton/Button/style.css +50 -0
- package/lib/components/Skeleton/Image/Image.tsx +45 -0
- package/lib/components/Skeleton/Image/index.ts +1 -0
- package/lib/components/Skeleton/Image/style.css +23 -0
- package/lib/components/Skeleton/Input/Input.tsx +42 -0
- package/lib/components/Skeleton/Input/index.ts +1 -0
- package/lib/components/Skeleton/Input/style.css +56 -0
- package/lib/components/Skeleton/Skeleton.tsx +97 -0
- package/lib/components/Skeleton/index.ts +1 -0
- package/lib/components/Skeleton/style.css +84 -0
- package/lib/components/Switch/Switch.tsx +68 -0
- package/lib/components/Switch/index.css +50 -0
- package/lib/components/Switch/index.ts +1 -0
- package/lib/components/Upload/Upload.tsx +291 -0
- package/lib/components/Upload/index.ts +1 -0
- package/lib/components/Upload/style.css +151 -0
- package/lib/global.d.ts +1 -0
- package/lib/helpers/flatten.ts +26 -0
- package/lib/helpers/index.ts +52 -0
- package/lib/helpers/mask.ts +52 -0
- package/lib/hooks/useForm.ts +548 -0
- package/lib/hooks/usePosition.ts +206 -0
- package/lib/hooks/useWatch.ts +41 -0
- package/lib/hooks/useWatchError.ts +20 -0
- package/lib/index.ts +184 -0
- package/lib/styles/global.css +57 -0
- package/lib/types/button.ts +83 -0
- package/lib/types/checkbox.ts +32 -0
- package/lib/types/datepicker.ts +165 -0
- package/lib/types/dropdown.ts +41 -0
- package/lib/types/empty.ts +8 -0
- package/lib/types/form.ts +179 -0
- package/lib/types/index.ts +38 -0
- package/lib/types/input.ts +72 -0
- package/lib/types/menu.ts +55 -0
- package/lib/types/popover.ts +16 -0
- package/lib/types/radio.ts +69 -0
- package/lib/types/result.ts +22 -0
- package/lib/types/select.ts +126 -0
- package/lib/types/skeleton.ts +62 -0
- package/lib/types/switch.ts +22 -0
- package/lib/types/upload.ts +67 -0
- package/lib/utils/index.ts +37 -0
- package/lib/utils/lazy.ts +17 -0
- package/next.config.ts +7 -0
- package/package.json +18 -20
- package/rollup.config.js +71 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +48 -0
- package/src/app/layout.d.ts +5 -0
- package/src/app/layout.tsx +16 -0
- package/src/app/page.d.ts +1 -0
- package/src/app/page.tsx +22 -0
- package/tsconfig.json +46 -0
- package/dist/components/Icons/Icons.d.ts +0 -18
- /package/dist/{components → esm/types/components}/Button/Button.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Button/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Checkbox/Checkbox.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Checkbox/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/ConditionalWrapper/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/DatePicker/RangePicker/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/DatePicker/TimePicker/TimePicker.d.ts +0 -0
- /package/dist/{components → esm/types/components}/DatePicker/TimePicker/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/DatePicker/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Dropdown/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Empty/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Form/Form.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Form/Item/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Form/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Icons/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Input/Textarea/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Input/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Menu/Item/Item.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Menu/Menu.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Menu/SubMenu/SubMenu.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Menu/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Popover/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Radio/Button/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Radio/Group/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Radio/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Result/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Select/Option/Option.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Select/Option/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Select/Select.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Select/Tag/Tag.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Select/Tag/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Select/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Skeleton/Avatar/Avatar.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Skeleton/Avatar/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Skeleton/Button/Button.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Skeleton/Button/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Skeleton/Image/Image.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Skeleton/Image/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Skeleton/Input/Input.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Skeleton/Input/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Skeleton/Skeleton.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Skeleton/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Switch/index.d.ts +0 -0
- /package/dist/{components → esm/types/components}/Upload/index.d.ts +0 -0
- /package/dist/{helpers → esm/types/helpers}/flatten.d.ts +0 -0
- /package/dist/{helpers → esm/types/helpers}/index.d.ts +0 -0
- /package/dist/{helpers → esm/types/helpers}/mask.d.ts +0 -0
- /package/dist/{hooks → esm/types/hooks}/useForm.d.ts +0 -0
- /package/dist/{hooks → esm/types/hooks}/usePosition.d.ts +0 -0
- /package/dist/{hooks → esm/types/hooks}/useWatch.d.ts +0 -0
- /package/dist/{hooks → esm/types/hooks}/useWatchError.d.ts +0 -0
- /package/dist/{types → esm/types/types}/button.d.ts +0 -0
- /package/dist/{types → esm/types/types}/checkbox.d.ts +0 -0
- /package/dist/{types → esm/types/types}/datepicker.d.ts +0 -0
- /package/dist/{types → esm/types/types}/dropdown.d.ts +0 -0
- /package/dist/{types → esm/types/types}/empty.d.ts +0 -0
- /package/dist/{types → esm/types/types}/form.d.ts +0 -0
- /package/dist/{types → esm/types/types}/index.d.ts +0 -0
- /package/dist/{types → esm/types/types}/menu.d.ts +0 -0
- /package/dist/{types → esm/types/types}/popover.d.ts +0 -0
- /package/dist/{types → esm/types/types}/radio.d.ts +0 -0
- /package/dist/{types → esm/types/types}/result.d.ts +0 -0
- /package/dist/{types → esm/types/types}/select.d.ts +0 -0
- /package/dist/{types → esm/types/types}/skeleton.d.ts +0 -0
- /package/dist/{types → esm/types/types}/switch.d.ts +0 -0
- /package/dist/{types → esm/types/types}/upload.d.ts +0 -0
- /package/dist/{utils → esm/types/utils}/index.d.ts +0 -0
- /package/dist/{utils → esm/types/utils}/lazy.d.ts +0 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeEventHandler,
|
|
3
|
+
CSSProperties,
|
|
4
|
+
FocusEventHandler,
|
|
5
|
+
ForwardedRef,
|
|
6
|
+
Key,
|
|
7
|
+
KeyboardEventHandler,
|
|
8
|
+
MouseEvent,
|
|
9
|
+
MouseEventHandler,
|
|
10
|
+
ReactElement,
|
|
11
|
+
ReactEventHandler,
|
|
12
|
+
ReactNode
|
|
13
|
+
} from 'react';
|
|
14
|
+
import { DefaultProps, Placement, RuleType, RuleTypes, TargetProps } from '.';
|
|
15
|
+
|
|
16
|
+
export type SelectProps = DefaultProps & {
|
|
17
|
+
id?: string;
|
|
18
|
+
searchValue?: string;
|
|
19
|
+
onSearch?: (value: string) => void;
|
|
20
|
+
autoClearSearchValue?: boolean;
|
|
21
|
+
onSelect?: (value: RuleTypes, option?: OptionType) => void;
|
|
22
|
+
onDeselect?: (value: string, option?: OptionType) => void;
|
|
23
|
+
filterOption?: boolean | ((input: string, option: OptionType) => boolean);
|
|
24
|
+
optionFilterProp?: string;
|
|
25
|
+
options?: OptionType[];
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
defaultActiveFirstOption?: boolean;
|
|
28
|
+
listHeight?: number;
|
|
29
|
+
menuItemSelectedIcon?: ReactNode;
|
|
30
|
+
mode?: 'default' | 'multiple' | 'tags';
|
|
31
|
+
value?: RuleTypes;
|
|
32
|
+
defaultValue?: RuleTypes;
|
|
33
|
+
maxCount?: number;
|
|
34
|
+
onChange?: (e: RuleTypes, option?: OptionType) => void;
|
|
35
|
+
iconClick?: () => void;
|
|
36
|
+
iconClickClear?: boolean;
|
|
37
|
+
onClose?: () => void;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
allowClear?: boolean;
|
|
42
|
+
filterable?: boolean;
|
|
43
|
+
defaultOpen?: boolean;
|
|
44
|
+
size?: 'small' | 'middle' | 'large';
|
|
45
|
+
onClear?: () => void;
|
|
46
|
+
error?: boolean;
|
|
47
|
+
showSearch?: boolean;
|
|
48
|
+
tagRender?: ((props: CustomTagProps) => ReactElement) | undefined;
|
|
49
|
+
maxTagPlaceholder?:
|
|
50
|
+
| ReactNode
|
|
51
|
+
| ((omittedValues: DisplayValueType[]) => ReactNode);
|
|
52
|
+
dropdownClassName?: string;
|
|
53
|
+
showArrow?: boolean;
|
|
54
|
+
onBlur?: FocusEventHandler<HTMLElement> | undefined;
|
|
55
|
+
onDropdownVisibleChange?: ((open: boolean, selected: RuleType) => void) | undefined;
|
|
56
|
+
showAction?: ('click' | 'focus')[] | undefined;
|
|
57
|
+
suffixIcon?: ReactNode;
|
|
58
|
+
searchIcon?: ReactNode;
|
|
59
|
+
open?: boolean;
|
|
60
|
+
notFoundContent?: ReactNode;
|
|
61
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
62
|
+
dropdownRender?: (menu: ReactNode) => ReactNode;
|
|
63
|
+
feedbackIcons?: boolean;
|
|
64
|
+
placement?: Placement;
|
|
65
|
+
removeIcon?: ReactNode;
|
|
66
|
+
maxTagCount?: number | 'responsive',
|
|
67
|
+
ref?: ForwardedRef<HTMLDivElement>,
|
|
68
|
+
closeFromParent?: boolean;
|
|
69
|
+
controlled?: boolean
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export interface OptionType {
|
|
73
|
+
value: RuleType;
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
children?: ReactNode;
|
|
76
|
+
className?: string;
|
|
77
|
+
style?: CSSProperties;
|
|
78
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
79
|
+
render?: (label: string) => ReactNode;
|
|
80
|
+
prefixCls?: string;
|
|
81
|
+
label?: RuleType;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type CustomTagProps = DefaultProps & {
|
|
85
|
+
label?: ReactNode;
|
|
86
|
+
value?: string;
|
|
87
|
+
onClose?: (e: MouseEvent<HTMLSpanElement> & TargetProps) => void;
|
|
88
|
+
onMouseDown?: MouseEventHandler | undefined;
|
|
89
|
+
onLoadCapture?: ReactEventHandler | undefined;
|
|
90
|
+
closable?: boolean;
|
|
91
|
+
isMaxTag?: boolean;
|
|
92
|
+
color?: string;
|
|
93
|
+
icon?: ReactNode;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type TagProps = DefaultProps & {
|
|
97
|
+
values?: string[];
|
|
98
|
+
onClose: (e: MouseEvent<HTMLSpanElement> & TargetProps) => void;
|
|
99
|
+
icon?: ReactNode;
|
|
100
|
+
closable?: boolean;
|
|
101
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
102
|
+
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export interface DisplayValueType {
|
|
106
|
+
key?: Key;
|
|
107
|
+
value?: RuleType;
|
|
108
|
+
label?: ReactNode;
|
|
109
|
+
title?: string | number;
|
|
110
|
+
disabled?: boolean;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface OptionProps {
|
|
114
|
+
value: RuleType;
|
|
115
|
+
disabled?: boolean;
|
|
116
|
+
children?: ReactNode;
|
|
117
|
+
className?: string;
|
|
118
|
+
style?: CSSProperties;
|
|
119
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
120
|
+
render?: (label: string) => ReactNode;
|
|
121
|
+
onMouseEnter?: MouseEventHandler<HTMLDivElement>;
|
|
122
|
+
prefixCls?: string;
|
|
123
|
+
prefixClsV3?: string;
|
|
124
|
+
selected?: boolean;
|
|
125
|
+
title?: string;
|
|
126
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { DefaultProps } from '.';
|
|
3
|
+
|
|
4
|
+
declare type widthUnit = number | string;
|
|
5
|
+
|
|
6
|
+
export interface SkeletonElementProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
size?: 'large' | 'small' | 'default' | number;
|
|
10
|
+
shape?: 'circle' | 'square' | 'round';
|
|
11
|
+
active?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type SkeletonProps = DefaultProps & {
|
|
15
|
+
active?: boolean;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
className?: string;
|
|
18
|
+
style?: CSSProperties;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
avatar?: SkeletonAvatarProps | boolean;
|
|
21
|
+
title?: SkeletonTitleProps | boolean;
|
|
22
|
+
paragraph?: SkeletonParagraphProps | boolean;
|
|
23
|
+
round?: boolean;
|
|
24
|
+
teamLogo?: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
interface SkeletonTitleProps {
|
|
28
|
+
className?: string;
|
|
29
|
+
style?: CSSProperties;
|
|
30
|
+
width?: number | string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface SkeletonParagraphProps {
|
|
34
|
+
className?: string;
|
|
35
|
+
style?: CSSProperties;
|
|
36
|
+
width?: widthUnit | Array<widthUnit>;
|
|
37
|
+
rows?: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type SkeletonAvatarProps = Omit<SkeletonElementProps, 'shape'> &
|
|
41
|
+
DefaultProps & {
|
|
42
|
+
shape?: 'circle' | 'square';
|
|
43
|
+
active?: boolean;
|
|
44
|
+
applyElementStyle?: boolean;
|
|
45
|
+
wrapperStyle?: CSSProperties;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type SkeletonImageProps = DefaultProps &
|
|
49
|
+
Omit<SkeletonElementProps, 'size' | 'shape' | 'active'>;
|
|
50
|
+
|
|
51
|
+
export type SkeletonInputProps = Omit<SkeletonElementProps, 'size' | 'shape'> &
|
|
52
|
+
DefaultProps & {
|
|
53
|
+
size?: 'large' | 'small' | 'default';
|
|
54
|
+
block?: boolean;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type SkeletonButtonProps = Omit<SkeletonElementProps, 'size'> &
|
|
58
|
+
DefaultProps & {
|
|
59
|
+
size?: 'large' | 'small' | 'default';
|
|
60
|
+
block?: boolean;
|
|
61
|
+
applyElementStyle?: boolean;
|
|
62
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ReactNode
|
|
3
|
+
} from 'react';
|
|
4
|
+
import { DefaultProps } from '.';
|
|
5
|
+
|
|
6
|
+
export type SwitchProps = DefaultProps & {
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
onChange?: (value: boolean) => void;
|
|
9
|
+
onClick?: (value: boolean) => void;
|
|
10
|
+
value?: boolean;
|
|
11
|
+
tabIndex?: number;
|
|
12
|
+
name?: string;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
id?: string;
|
|
15
|
+
autoFocus?: boolean;
|
|
16
|
+
type?: string;
|
|
17
|
+
skipGroup?: boolean;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
defaultChecked?: boolean;
|
|
20
|
+
checked?: boolean;
|
|
21
|
+
controlled?: boolean;
|
|
22
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DefaultProps, RuleType } from '.';
|
|
2
|
+
|
|
3
|
+
export interface RcFile extends File {
|
|
4
|
+
uid: string;
|
|
5
|
+
lastModifiedDate: Date;
|
|
6
|
+
webkitRelativePath: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type UploadFile<RcFile> = {
|
|
10
|
+
originFileObj: RcFile;
|
|
11
|
+
uid: string;
|
|
12
|
+
name: string;
|
|
13
|
+
status?: 'uploading' | 'done' | 'error' | 'removed';
|
|
14
|
+
percent?: number;
|
|
15
|
+
url?: string;
|
|
16
|
+
file?: RcFile;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type UploadChangeParam = {
|
|
20
|
+
file: UploadFile<RuleType>;
|
|
21
|
+
fileList: UploadFile<RuleType>[];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type UploadProps = DefaultProps & {
|
|
25
|
+
type?: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
defaultFileList?: UploadFile<RuleType>[];
|
|
28
|
+
fileList?: UploadFile<RuleType>[];
|
|
29
|
+
action?:
|
|
30
|
+
| string
|
|
31
|
+
| ((file: RcFile) => string)
|
|
32
|
+
| ((file: RcFile) => PromiseLike<string>);
|
|
33
|
+
directory?: boolean;
|
|
34
|
+
data?:
|
|
35
|
+
| Record<string, unknown>
|
|
36
|
+
| ((
|
|
37
|
+
file: UploadFile<RuleType>
|
|
38
|
+
) => Record<string, unknown> | Promise<Record<string, unknown>>);
|
|
39
|
+
method?: 'POST' | 'PUT' | 'PATCH';
|
|
40
|
+
headers?: Record<string, string>;
|
|
41
|
+
showUploadList?: boolean;
|
|
42
|
+
multiple?: boolean;
|
|
43
|
+
accept?: string;
|
|
44
|
+
beforeUpload?: (file: RcFile, fileList: File[]) => boolean | Promise<boolean>;
|
|
45
|
+
onChange?: (info: UploadChangeParam) => void;
|
|
46
|
+
onDrop?: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
47
|
+
listType?: string;
|
|
48
|
+
className?: string;
|
|
49
|
+
rootClassName?: string;
|
|
50
|
+
onPreview?: (file: UploadFile<RuleType>) => void;
|
|
51
|
+
onDownload?: (file: UploadFile<RuleType>) => void;
|
|
52
|
+
onRemove?: (
|
|
53
|
+
file: UploadFile<RuleType>
|
|
54
|
+
) => void | boolean | Promise<void | boolean>;
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
style?: React.CSSProperties;
|
|
57
|
+
customRequest?: (options: {
|
|
58
|
+
file: RcFile;
|
|
59
|
+
onSuccess: (response: RuleType) => void;
|
|
60
|
+
onError: (error: RuleType) => void;
|
|
61
|
+
onProgress: (event: ProgressEvent) => void;
|
|
62
|
+
}) => void;
|
|
63
|
+
withCredentials?: boolean;
|
|
64
|
+
openFileDialogOnClick?: boolean;
|
|
65
|
+
maxCount?: number;
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const prefixClsForm = 'xUi-form';
|
|
2
|
+
export const prefixClsFormItem = 'xUi-form-item';
|
|
3
|
+
export const prefixClsEmpty = 'xUi-empty';
|
|
4
|
+
export const prefixClsInput = 'xUi-input';
|
|
5
|
+
export const prefixClsSelect = 'xUi-select';
|
|
6
|
+
export const prefixClsCheckbox = 'xUi-checkbox';
|
|
7
|
+
export const prefixClsSwitch = 'xUi-switch';
|
|
8
|
+
export const prefixClsRadio = 'xUi-radio';
|
|
9
|
+
export const prefixClsTextArea = 'xUi-textarea';
|
|
10
|
+
export const prefixClsUpload = 'xUi-upload';
|
|
11
|
+
export const prefixClsDatePicker = 'xUi-datepicker';
|
|
12
|
+
export const prefixClsRangePicker = 'xUi-rangepicker';
|
|
13
|
+
export const prefixClsTimePicker = 'xUi-timepicker';
|
|
14
|
+
export const prefixClsButton = 'xUi-button';
|
|
15
|
+
export const prefixClsSkeleton = 'xUi-skeleton';
|
|
16
|
+
export const prefixClsMenu = 'xUi-menu';
|
|
17
|
+
export const prefixClsDropdown = 'xUi-dropdown';
|
|
18
|
+
export const prefixClsPopover = 'xUi-popover';
|
|
19
|
+
export const prefixClsResult = 'xUi-result';
|
|
20
|
+
|
|
21
|
+
export const prefixClsFormV3 = 'v3-form';
|
|
22
|
+
export const prefixClsFormItemV3 = 'v3-form-item';
|
|
23
|
+
export const prefixClsEmptyV3 = 'v3-empty';
|
|
24
|
+
export const prefixClsInputV3 = 'v3-input';
|
|
25
|
+
export const prefixClsSelectV3 = 'v3-select';
|
|
26
|
+
export const prefixClsCheckboxV3 = 'v3-checkbox-input';
|
|
27
|
+
export const prefixClsSwitchV3 = 'v3-switch';
|
|
28
|
+
export const prefixClsRadioV3 = 'v3-radio';
|
|
29
|
+
export const prefixClsTextAreaV3 = 'v3-textarea';
|
|
30
|
+
export const prefixClsButtonV3 = 'v3-btn';
|
|
31
|
+
export const prefixClsUploadV3 = 'v3-upload';
|
|
32
|
+
|
|
33
|
+
// non updates
|
|
34
|
+
export const prefixClsSkeletonV3 = 'v3-skeleton';
|
|
35
|
+
export const prefixClsDatePickerV3 = 'v3-datepicker';
|
|
36
|
+
export const prefixClsRangePickerV3 = 'v3-rangepicker';
|
|
37
|
+
export const prefixClsTimePickerV3 = 'v3-timepicker';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RuleType } from '../types';
|
|
2
|
+
import { ComponentType, lazy as lazily } from 'react';
|
|
3
|
+
|
|
4
|
+
export const lazy = <T extends {}, U extends keyof T>(
|
|
5
|
+
loader: (x?: string) => Promise<T>
|
|
6
|
+
): T =>
|
|
7
|
+
new Proxy({} as unknown as T, {
|
|
8
|
+
get: (target, componentName: string | symbol) => {
|
|
9
|
+
if (typeof componentName === 'string') {
|
|
10
|
+
return lazily(() =>
|
|
11
|
+
loader(componentName).then(x => ({
|
|
12
|
+
default: x[componentName as U] as RuleType as ComponentType<RuleType>
|
|
13
|
+
}))
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
package/next.config.ts
ADDED
package/package.json
CHANGED
|
@@ -1,49 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-ui-design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.33",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"author": "Gabriel Boyajyan",
|
|
6
|
-
"type": "module",
|
|
7
6
|
"main": "dist/index.js",
|
|
8
7
|
"module": "dist/index.esm.js",
|
|
9
8
|
"types": "dist/index.d.ts",
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
13
9
|
"scripts": {
|
|
14
|
-
"dev": "
|
|
15
|
-
"build": "
|
|
10
|
+
"dev": "next dev --turbopack",
|
|
11
|
+
"build": "next build",
|
|
12
|
+
"start": "next start",
|
|
13
|
+
"lint": "next lint",
|
|
16
14
|
"build:types": "tsc --emitDeclarationOnly",
|
|
17
15
|
"build:rollup": "rollup -c --bundleConfigAsCjs",
|
|
18
16
|
"rollup": "npm run build:types && npm run build:rollup"
|
|
19
17
|
},
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"react-dom": "^19"
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"next": "15.2.0"
|
|
23
20
|
},
|
|
24
21
|
"devDependencies": {
|
|
22
|
+
"@babel/core": "^7.27.1",
|
|
23
|
+
"@babel/preset-react": "^7.27.1",
|
|
24
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
25
|
+
"@eslint/eslintrc": "^3",
|
|
25
26
|
"@rollup/plugin-alias": "^5.1.1",
|
|
26
27
|
"@rollup/plugin-babel": "^6.0.4",
|
|
27
28
|
"@rollup/plugin-commonjs": "^24.1.0",
|
|
28
29
|
"@rollup/plugin-node-resolve": "^15.3.1",
|
|
29
30
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
31
|
+
"@types/node": "^20",
|
|
30
32
|
"@types/react": "^19",
|
|
31
33
|
"@types/react-dom": "^19",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
+
"eslint": "^9",
|
|
35
|
+
"eslint-config-next": "15.2.0",
|
|
34
36
|
"postcss": "^8.5.3",
|
|
35
|
-
"react": "^19.2.4",
|
|
36
|
-
"react-dom": "^19.2.4",
|
|
37
37
|
"rollup": "^3.0.0",
|
|
38
38
|
"rollup-plugin-dts": "^5.0.0",
|
|
39
39
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
40
40
|
"rollup-plugin-postcss": "^4.0.2",
|
|
41
|
-
"
|
|
42
|
-
"typescript": "^5.8.3",
|
|
43
|
-
"vite": "^5"
|
|
41
|
+
"typescript": "^5.8.3"
|
|
44
42
|
},
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"react": "^19.1.0",
|
|
45
|
+
"react-dom": "^19.1.0"
|
|
48
46
|
}
|
|
49
47
|
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// rollup.config.js
|
|
2
|
+
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
|
|
3
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
4
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
5
|
+
import typescript from '@rollup/plugin-typescript';
|
|
6
|
+
import postcss from 'rollup-plugin-postcss';
|
|
7
|
+
import babel from '@rollup/plugin-babel';
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
10
|
+
const dts = require('rollup-plugin-dts').default;
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
12
|
+
const packageJson = require('./package.json');
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line import/no-anonymous-default-export
|
|
15
|
+
export default [
|
|
16
|
+
{
|
|
17
|
+
input: 'lib/index.ts',
|
|
18
|
+
inlineDynamicImports: true,
|
|
19
|
+
external: ["react", /^react\/.*/, "react-dom", /react-dom\/.*/],
|
|
20
|
+
output: [
|
|
21
|
+
{
|
|
22
|
+
file: packageJson.main,
|
|
23
|
+
format: 'cjs',
|
|
24
|
+
sourcemap: true,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
file: packageJson.module,
|
|
28
|
+
format: 'esm',
|
|
29
|
+
sourcemap: true
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
plugins: [
|
|
33
|
+
peerDepsExternal(),
|
|
34
|
+
resolve({
|
|
35
|
+
extensions: ['.mjs', '.js', '.jsx', '.json', '.ts', '.tsx', '.css'],
|
|
36
|
+
}),
|
|
37
|
+
commonjs(),
|
|
38
|
+
typescript({
|
|
39
|
+
outputToFilesystem: false,
|
|
40
|
+
tsconfig: './tsconfig.json',
|
|
41
|
+
paths: {
|
|
42
|
+
"@/*": ["lib/*"]
|
|
43
|
+
}
|
|
44
|
+
}),
|
|
45
|
+
babel({
|
|
46
|
+
babelHelpers: 'bundled',
|
|
47
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
48
|
+
presets: ['@babel/preset-react', '@babel/preset-typescript']
|
|
49
|
+
}),
|
|
50
|
+
postcss({
|
|
51
|
+
inject: true,
|
|
52
|
+
minimize: true,
|
|
53
|
+
modules: false
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
// Generate .d.ts files
|
|
59
|
+
input: 'dist/esm/types/index.d.ts',
|
|
60
|
+
output: [
|
|
61
|
+
{
|
|
62
|
+
file: 'dist/index.d.ts',
|
|
63
|
+
format: 'es'
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
plugins: [
|
|
67
|
+
dts()
|
|
68
|
+
],
|
|
69
|
+
external: [/\.css/]
|
|
70
|
+
},
|
|
71
|
+
];
|
|
Binary file
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* MAIN */
|
|
3
|
+
--xui-color-hover: #f5f5f5;
|
|
4
|
+
--xui-color-disabled: #e6e6e6;
|
|
5
|
+
|
|
6
|
+
--xui-primary-color: #1677ff;
|
|
7
|
+
--xui-primary-color-hover: #0267ff;
|
|
8
|
+
--xui-primary-color-light: #40a9ff;
|
|
9
|
+
|
|
10
|
+
--xui-text-color: rgba(0, 0, 0, 0.88);
|
|
11
|
+
--xui-text-color-light: rgba(0, 0, 0, 0.5);
|
|
12
|
+
|
|
13
|
+
--xui-error-color: #ff4d4f;
|
|
14
|
+
--xui-error-color-light: #ff6668;
|
|
15
|
+
--xui-success-color: #52c41a;
|
|
16
|
+
|
|
17
|
+
--xui-background-color: #ffffff;
|
|
18
|
+
|
|
19
|
+
/* FONTS */
|
|
20
|
+
--xui-font-size-xs: 12px;
|
|
21
|
+
--xui-font-size-sm: 14px;
|
|
22
|
+
--xui-font-size-md: 14px;
|
|
23
|
+
--xui-font-size-lg: 16px;
|
|
24
|
+
|
|
25
|
+
/* BORDERS */
|
|
26
|
+
--xui-border-radius-sm: 4px;
|
|
27
|
+
--xui-border-radius-md: 4px;
|
|
28
|
+
--xui-border-radius-lg: 6px;
|
|
29
|
+
|
|
30
|
+
--xui-border-color: #d9d9d9;
|
|
31
|
+
|
|
32
|
+
/* SELECT */
|
|
33
|
+
--xui-select-primary-color: var(--xui-primary-color);
|
|
34
|
+
--xui-select-background-color: var(--xui-background-color);
|
|
35
|
+
|
|
36
|
+
/* MENU */
|
|
37
|
+
--xui-menu-inline-bg: rgba(0, 0, 0, 0.02);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
html {
|
|
41
|
+
font-family: sans-serif;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.globalEllipsis {
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Home(): import("react/jsx-runtime").JSX.Element;
|
package/src/app/page.tsx
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Result } from "../../lib/components/Result";
|
|
4
|
+
import { Button } from '../../lib/components/Button';
|
|
5
|
+
import { Popover } from '../../lib/components/Popover';
|
|
6
|
+
import { Select } from "../../lib/components/Select";
|
|
7
|
+
import Option from "../../lib/components/Select/Option/Option";
|
|
8
|
+
import Tag from "../../lib/components/Select/Tag/Tag";
|
|
9
|
+
|
|
10
|
+
export default function Home() {
|
|
11
|
+
return (
|
|
12
|
+
<Select mode="tags"
|
|
13
|
+
tagRender={(tagProps) => {
|
|
14
|
+
return <Tag {...tagProps}>{tagProps.value}</Tag>
|
|
15
|
+
}}
|
|
16
|
+
options={[{ value: 'tag_1', label: 'Tag 1' }]}
|
|
17
|
+
/>
|
|
18
|
+
// {/* <Option value={'tag_1'}>tag 1</Option> */}
|
|
19
|
+
// </Select>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"declaration": true,
|
|
4
|
+
"declarationDir": "dist/esm/types",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"target": "ESNext",
|
|
7
|
+
"emitDeclarationOnly": true,
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"moduleResolution": "node",
|
|
10
|
+
"jsx": "preserve",
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"allowSyntheticDefaultImports": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"strict": true,
|
|
15
|
+
"rootDir": "lib",
|
|
16
|
+
"baseUrl": "./",
|
|
17
|
+
"paths": {
|
|
18
|
+
"@/*": [
|
|
19
|
+
"./lib/*"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"allowJs": true,
|
|
23
|
+
"incremental": true,
|
|
24
|
+
"resolveJsonModule": true,
|
|
25
|
+
"isolatedModules": true,
|
|
26
|
+
"plugins": [
|
|
27
|
+
{
|
|
28
|
+
"name": "next"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"lib": [
|
|
32
|
+
"dom",
|
|
33
|
+
"dom.iterable",
|
|
34
|
+
"esnext"
|
|
35
|
+
],
|
|
36
|
+
"noEmit": true
|
|
37
|
+
},
|
|
38
|
+
"include": [
|
|
39
|
+
"lib",
|
|
40
|
+
"lib/global.d.ts",
|
|
41
|
+
".next/types/**/*.ts"
|
|
42
|
+
],
|
|
43
|
+
"exclude": [
|
|
44
|
+
"node_modules"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ResultStatusType } from '../../types/result';
|
|
2
|
-
declare const ClearIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare const ArrowIcon: ({ isOpen }: {
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare const LoadingIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare const CheckIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare const SearchIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
declare const CalendarIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
declare const SuccessIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare const ErrorIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
declare const DateDistanceIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
declare const TimeIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
declare const StampleIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
declare const TrashIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
declare const SpinerIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
declare const renderDefaultIcon: (status: ResultStatusType) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
-
export { ClearIcon, ArrowIcon, LoadingIcon, CheckIcon, SearchIcon, CalendarIcon, SuccessIcon, ErrorIcon, DateDistanceIcon, TimeIcon, StampleIcon, TrashIcon, SpinerIcon, renderDefaultIcon };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|