x-ui-design 1.0.29 → 1.0.31-gamma.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.
- package/README.md +1 -22
- package/dist/{esm/types/components → components}/DatePicker/DatePicker.d.ts +1 -2
- package/dist/{esm/types/components → components}/DatePicker/RangePicker/RangePicker.d.ts +1 -2
- package/dist/{esm/types/components → components}/Dropdown/Dropdown.d.ts +1 -2
- package/dist/{esm/types/components → components}/Empty/Empty.d.ts +1 -2
- package/dist/{esm/types/components → components}/Form/Item/Item.d.ts +1 -2
- package/dist/components/Icons/Icons.d.ts +18 -0
- package/dist/{esm/types/components → components}/Input/Input.d.ts +1 -2
- package/dist/{esm/types/components → components}/Input/Textarea/Textarea.d.ts +1 -2
- package/dist/{esm/types/components → components}/Popover/Popover.d.ts +1 -2
- package/dist/{esm/types/components → components}/Radio/Button/Button.d.ts +1 -2
- package/dist/{esm/types/components → components}/Radio/Group/Group.d.ts +1 -2
- package/dist/{esm/types/components → components}/Radio/Radio.d.ts +1 -2
- package/dist/{esm/types/components → components}/Result/Result.d.ts +1 -2
- package/dist/{esm/types/components → components}/Switch/Switch.d.ts +1 -2
- package/dist/{esm/types/components → components}/Upload/Upload.d.ts +1 -2
- package/dist/esm/types/index.d.ts +0 -50
- package/dist/index.d.ts +1 -144
- package/dist/index.esm.js +3436 -3863
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3398 -3825
- package/dist/index.js.map +1 -1
- package/package.json +22 -20
- package/.github/workflows/x-ui-design.yml +0 -14
- package/compile.sh +0 -15
- package/dist/esm/types/components/Icons/Icons.d.ts +0 -19
- package/eslint.config.mjs +0 -16
- package/lib/components/Button/Button.tsx +0 -136
- package/lib/components/Button/index.ts +0 -1
- package/lib/components/Button/style.css +0 -197
- package/lib/components/Checkbox/Checkbox.tsx +0 -131
- package/lib/components/Checkbox/index.ts +0 -1
- package/lib/components/Checkbox/style.css +0 -95
- package/lib/components/ConditionalWrapper/index.tsx +0 -12
- package/lib/components/DatePicker/DatePicker.tsx +0 -526
- package/lib/components/DatePicker/RangePicker/RangePicker.tsx +0 -500
- package/lib/components/DatePicker/RangePicker/index.ts +0 -1
- package/lib/components/DatePicker/RangePicker/style.css +0 -434
- package/lib/components/DatePicker/TimePicker/TimePicker.tsx +0 -497
- package/lib/components/DatePicker/TimePicker/index.ts +0 -1
- package/lib/components/DatePicker/TimePicker/style.css +0 -197
- package/lib/components/DatePicker/index.ts +0 -1
- package/lib/components/DatePicker/style.css +0 -318
- package/lib/components/Dropdown/Dropdown.tsx +0 -234
- package/lib/components/Dropdown/index.ts +0 -1
- package/lib/components/Dropdown/style.css +0 -124
- package/lib/components/Empty/Empty.tsx +0 -45
- package/lib/components/Empty/index.ts +0 -1
- package/lib/components/Empty/style.css +0 -13
- package/lib/components/Form/Form.tsx +0 -130
- package/lib/components/Form/Item/Item.tsx +0 -294
- package/lib/components/Form/Item/index.ts +0 -1
- package/lib/components/Form/Item/style.css +0 -61
- package/lib/components/Form/index.ts +0 -1
- package/lib/components/Icons/Icons.tsx +0 -433
- package/lib/components/Icons/index.ts +0 -15
- package/lib/components/Input/Input.tsx +0 -216
- package/lib/components/Input/Textarea/Textarea.tsx +0 -110
- package/lib/components/Input/Textarea/index.ts +0 -1
- package/lib/components/Input/Textarea/style.css +0 -104
- package/lib/components/Input/index.ts +0 -1
- package/lib/components/Input/style.css +0 -137
- package/lib/components/Menu/Item/Item.tsx +0 -65
- package/lib/components/Menu/Menu.tsx +0 -261
- package/lib/components/Menu/SubMenu/SubMenu.tsx +0 -68
- package/lib/components/Menu/index.css +0 -145
- package/lib/components/Menu/index.ts +0 -1
- package/lib/components/Popover/Popover.tsx +0 -135
- package/lib/components/Popover/index.ts +0 -1
- package/lib/components/Popover/style.css +0 -82
- package/lib/components/Radio/Button/Button.tsx +0 -42
- package/lib/components/Radio/Button/index.ts +0 -1
- package/lib/components/Radio/Button/style.css +0 -43
- package/lib/components/Radio/Group/Group.tsx +0 -105
- package/lib/components/Radio/Group/index.ts +0 -1
- package/lib/components/Radio/Group/style.css +0 -53
- package/lib/components/Radio/Radio.tsx +0 -83
- package/lib/components/Radio/index.ts +0 -1
- package/lib/components/Radio/style.css +0 -73
- package/lib/components/Result/Result.tsx +0 -39
- package/lib/components/Result/index.ts +0 -1
- package/lib/components/Result/style.css +0 -173
- package/lib/components/Select/Option/Option.tsx +0 -49
- package/lib/components/Select/Option/index.ts +0 -1
- package/lib/components/Select/Option/style.css +0 -50
- package/lib/components/Select/Select.tsx +0 -935
- package/lib/components/Select/Tag/Tag.tsx +0 -43
- package/lib/components/Select/Tag/index.ts +0 -1
- package/lib/components/Select/Tag/style.css +0 -87
- package/lib/components/Select/index.ts +0 -1
- package/lib/components/Select/style.css +0 -186
- package/lib/components/Skeleton/Avatar/Avatar.tsx +0 -61
- package/lib/components/Skeleton/Avatar/index.ts +0 -1
- package/lib/components/Skeleton/Avatar/style.css +0 -27
- package/lib/components/Skeleton/Button/Button.tsx +0 -44
- package/lib/components/Skeleton/Button/index.ts +0 -1
- package/lib/components/Skeleton/Button/style.css +0 -50
- package/lib/components/Skeleton/Image/Image.tsx +0 -45
- package/lib/components/Skeleton/Image/index.ts +0 -1
- package/lib/components/Skeleton/Image/style.css +0 -23
- package/lib/components/Skeleton/Input/Input.tsx +0 -42
- package/lib/components/Skeleton/Input/index.ts +0 -1
- package/lib/components/Skeleton/Input/style.css +0 -56
- package/lib/components/Skeleton/Skeleton.tsx +0 -97
- package/lib/components/Skeleton/index.ts +0 -1
- package/lib/components/Skeleton/style.css +0 -84
- package/lib/components/Switch/Switch.tsx +0 -68
- package/lib/components/Switch/index.css +0 -50
- package/lib/components/Switch/index.ts +0 -1
- package/lib/components/Upload/Upload.tsx +0 -291
- package/lib/components/Upload/index.ts +0 -1
- package/lib/components/Upload/style.css +0 -151
- package/lib/global.d.ts +0 -1
- package/lib/helpers/flatten.ts +0 -26
- package/lib/helpers/index.ts +0 -52
- package/lib/helpers/mask.ts +0 -52
- package/lib/hooks/useForm.ts +0 -548
- package/lib/hooks/usePosition.ts +0 -206
- package/lib/hooks/useWatch.ts +0 -41
- package/lib/hooks/useWatchError.ts +0 -20
- package/lib/index.ts +0 -184
- package/lib/styles/global.css +0 -57
- package/lib/types/button.ts +0 -83
- package/lib/types/checkbox.ts +0 -32
- package/lib/types/datepicker.ts +0 -165
- package/lib/types/dropdown.ts +0 -41
- package/lib/types/empty.ts +0 -8
- package/lib/types/form.ts +0 -179
- package/lib/types/index.ts +0 -38
- package/lib/types/input.ts +0 -72
- package/lib/types/menu.ts +0 -55
- package/lib/types/popover.ts +0 -16
- package/lib/types/radio.ts +0 -69
- package/lib/types/result.ts +0 -22
- package/lib/types/select.ts +0 -126
- package/lib/types/skeleton.ts +0 -62
- package/lib/types/switch.ts +0 -22
- package/lib/types/upload.ts +0 -67
- package/lib/utils/index.ts +0 -37
- package/lib/utils/lazy.ts +0 -17
- package/next.config.ts +0 -7
- package/rollup.config.js +0 -71
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +0 -48
- package/src/app/layout.d.ts +0 -5
- package/src/app/layout.tsx +0 -16
- package/src/app/page.d.ts +0 -1
- package/src/app/page.tsx +0 -21
- package/tsconfig.json +0 -46
- /package/dist/{esm/types/components → components}/Button/Button.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Button/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Checkbox/Checkbox.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Checkbox/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/ConditionalWrapper/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/DatePicker/RangePicker/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/DatePicker/TimePicker/TimePicker.d.ts +0 -0
- /package/dist/{esm/types/components → components}/DatePicker/TimePicker/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/DatePicker/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Dropdown/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Empty/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Form/Form.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Form/Item/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Form/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Icons/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Input/Textarea/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Input/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Menu/Item/Item.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Menu/Menu.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Menu/SubMenu/SubMenu.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Menu/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Popover/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Radio/Button/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Radio/Group/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Radio/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Result/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Select/Option/Option.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Select/Option/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Select/Select.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Select/Tag/Tag.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Select/Tag/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Select/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Skeleton/Avatar/Avatar.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Skeleton/Avatar/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Skeleton/Button/Button.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Skeleton/Button/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Skeleton/Image/Image.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Skeleton/Image/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Skeleton/Input/Input.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Skeleton/Input/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Skeleton/Skeleton.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Skeleton/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Switch/index.d.ts +0 -0
- /package/dist/{esm/types/components → components}/Upload/index.d.ts +0 -0
- /package/dist/{esm/types/helpers → helpers}/flatten.d.ts +0 -0
- /package/dist/{esm/types/helpers → helpers}/index.d.ts +0 -0
- /package/dist/{esm/types/helpers → helpers}/mask.d.ts +0 -0
- /package/dist/{esm/types/hooks → hooks}/useForm.d.ts +0 -0
- /package/dist/{esm/types/hooks → hooks}/usePosition.d.ts +0 -0
- /package/dist/{esm/types/hooks → hooks}/useWatch.d.ts +0 -0
- /package/dist/{esm/types/hooks → hooks}/useWatchError.d.ts +0 -0
- /package/dist/{esm/types/types → types}/button.d.ts +0 -0
- /package/dist/{esm/types/types → types}/checkbox.d.ts +0 -0
- /package/dist/{esm/types/types → types}/datepicker.d.ts +0 -0
- /package/dist/{esm/types/types → types}/dropdown.d.ts +0 -0
- /package/dist/{esm/types/types → types}/empty.d.ts +0 -0
- /package/dist/{esm/types/types → types}/form.d.ts +0 -0
- /package/dist/{esm/types/types → types}/index.d.ts +0 -0
- /package/dist/{esm/types/types → types}/input.d.ts +0 -0
- /package/dist/{esm/types/types → types}/menu.d.ts +0 -0
- /package/dist/{esm/types/types → types}/popover.d.ts +0 -0
- /package/dist/{esm/types/types → types}/radio.d.ts +0 -0
- /package/dist/{esm/types/types → types}/result.d.ts +0 -0
- /package/dist/{esm/types/types → types}/select.d.ts +0 -0
- /package/dist/{esm/types/types → types}/skeleton.d.ts +0 -0
- /package/dist/{esm/types/types → types}/switch.d.ts +0 -0
- /package/dist/{esm/types/types → types}/upload.d.ts +0 -0
- /package/dist/{esm/types/utils → utils}/index.d.ts +0 -0
- /package/dist/{esm/types/utils → utils}/lazy.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,47 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-ui-design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31-gamma.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"author": "Gabriel Boyajyan",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"main": "dist/index.js",
|
|
7
8
|
"module": "dist/index.esm.js",
|
|
8
9
|
"types": "dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
9
13
|
"scripts": {
|
|
10
|
-
"dev": "
|
|
11
|
-
"build": "
|
|
12
|
-
"start": "next start",
|
|
13
|
-
"lint": "next lint",
|
|
14
|
+
"dev": "vite",
|
|
15
|
+
"build": "vite build && npm run build:types",
|
|
14
16
|
"build:types": "tsc --emitDeclarationOnly",
|
|
15
17
|
"build:rollup": "rollup -c --bundleConfigAsCjs",
|
|
16
18
|
"rollup": "npm run build:types && npm run build:rollup"
|
|
17
19
|
},
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"react": "^19",
|
|
22
|
+
"react-dom": "^19"
|
|
20
23
|
},
|
|
21
24
|
"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",
|
|
26
25
|
"@rollup/plugin-alias": "^5.1.1",
|
|
27
26
|
"@rollup/plugin-babel": "^6.0.4",
|
|
28
27
|
"@rollup/plugin-commonjs": "^24.1.0",
|
|
29
28
|
"@rollup/plugin-node-resolve": "^15.3.1",
|
|
30
29
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
31
|
-
"@types/
|
|
32
|
-
"@types/react": "^19
|
|
33
|
-
"@
|
|
34
|
-
"
|
|
35
|
-
"eslint-config-next": "15.2.0",
|
|
30
|
+
"@types/react": "^19",
|
|
31
|
+
"@types/react-dom": "^19",
|
|
32
|
+
"@vitejs/plugin-react": "^4",
|
|
33
|
+
"path": "^0.12.7",
|
|
36
34
|
"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
|
-
"
|
|
41
|
+
"tslib": "^2.8.1",
|
|
42
|
+
"typescript": "^5.8.3",
|
|
43
|
+
"vite": "^5"
|
|
42
44
|
},
|
|
43
|
-
"
|
|
44
|
-
"react": "^
|
|
45
|
-
"
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@babel/preset-react": "^7.28.5",
|
|
47
|
+
"@babel/preset-typescript": "^7.28.5"
|
|
46
48
|
}
|
|
47
49
|
}
|
package/compile.sh
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ResultStatusType } from '../../types/result';
|
|
3
|
-
declare const ClearIcon: () => React.JSX.Element;
|
|
4
|
-
declare const ArrowIcon: ({ isOpen }: {
|
|
5
|
-
isOpen: boolean;
|
|
6
|
-
}) => React.JSX.Element;
|
|
7
|
-
declare const LoadingIcon: () => React.JSX.Element;
|
|
8
|
-
declare const CheckIcon: () => React.JSX.Element;
|
|
9
|
-
declare const SearchIcon: () => React.JSX.Element;
|
|
10
|
-
declare const CalendarIcon: () => React.JSX.Element;
|
|
11
|
-
declare const SuccessIcon: () => React.JSX.Element;
|
|
12
|
-
declare const ErrorIcon: () => React.JSX.Element;
|
|
13
|
-
declare const DateDistanceIcon: () => React.JSX.Element;
|
|
14
|
-
declare const TimeIcon: () => React.JSX.Element;
|
|
15
|
-
declare const StampleIcon: () => React.JSX.Element;
|
|
16
|
-
declare const TrashIcon: () => React.JSX.Element;
|
|
17
|
-
declare const SpinerIcon: () => React.JSX.Element;
|
|
18
|
-
declare const renderDefaultIcon: (status: ResultStatusType) => React.JSX.Element | null;
|
|
19
|
-
export { ClearIcon, ArrowIcon, LoadingIcon, CheckIcon, SearchIcon, CalendarIcon, SuccessIcon, ErrorIcon, DateDistanceIcon, TimeIcon, StampleIcon, TrashIcon, SpinerIcon, renderDefaultIcon };
|
package/eslint.config.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { dirname } from "path";
|
|
2
|
-
import { fileURLToPath } from "url";
|
|
3
|
-
import { FlatCompat } from "@eslint/eslintrc";
|
|
4
|
-
|
|
5
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = dirname(__filename);
|
|
7
|
-
|
|
8
|
-
const compat = new FlatCompat({
|
|
9
|
-
baseDirectory: __dirname,
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const eslintConfig = [
|
|
13
|
-
...compat.extends("next/core-web-vitals", "next/typescript"),
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
export default eslintConfig;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement, useEffect, useMemo, useState } from 'react';
|
|
2
|
-
import { clsx } from '../../helpers';
|
|
3
|
-
import { ButtonProps } from '../../types/button';
|
|
4
|
-
import { prefixClsButton, prefixClsButtonV3 } from '../../utils';
|
|
5
|
-
import './style.css';
|
|
6
|
-
|
|
7
|
-
const ButtonComponent = ({
|
|
8
|
-
type = 'default',
|
|
9
|
-
variant = 'solid',
|
|
10
|
-
color = 'default',
|
|
11
|
-
shape = 'default',
|
|
12
|
-
size = 'middle',
|
|
13
|
-
htmlType = 'button',
|
|
14
|
-
className,
|
|
15
|
-
rootClassName,
|
|
16
|
-
classNames: customClassNames = {},
|
|
17
|
-
styles = {},
|
|
18
|
-
prefixCls = prefixClsButton,
|
|
19
|
-
prefixClsV3 = prefixClsButtonV3,
|
|
20
|
-
icon,
|
|
21
|
-
iconPosition = 'start',
|
|
22
|
-
loading = false,
|
|
23
|
-
disabled = false,
|
|
24
|
-
ghost = false,
|
|
25
|
-
danger = false,
|
|
26
|
-
block = false,
|
|
27
|
-
children,
|
|
28
|
-
href,
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
30
|
-
// @ts-expect-error
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
|
-
__injected,
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
34
|
-
child,
|
|
35
|
-
...restProps
|
|
36
|
-
}: ButtonProps): ReactElement => {
|
|
37
|
-
const [innerLoading, setInnerLoading] = useState(false);
|
|
38
|
-
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (typeof loading === 'boolean') {
|
|
41
|
-
setInnerLoading(loading);
|
|
42
|
-
} else if (typeof loading === 'object' && loading.delay) {
|
|
43
|
-
const timeout = setTimeout(() => setInnerLoading(true), loading.delay);
|
|
44
|
-
|
|
45
|
-
return () => clearTimeout(timeout);
|
|
46
|
-
} else {
|
|
47
|
-
setInnerLoading(!!loading);
|
|
48
|
-
}
|
|
49
|
-
}, [loading]);
|
|
50
|
-
|
|
51
|
-
const classes = useMemo(() => {
|
|
52
|
-
return clsx([...new Set([
|
|
53
|
-
prefixCls,
|
|
54
|
-
prefixClsV3,
|
|
55
|
-
rootClassName,
|
|
56
|
-
`${prefixCls}-${type}`,
|
|
57
|
-
`${prefixCls}-variant-${variant}`,
|
|
58
|
-
`${prefixCls}-color-${color}`,
|
|
59
|
-
`${prefixCls}-shape-${shape}`,
|
|
60
|
-
`${prefixCls}-size-${size}`,
|
|
61
|
-
`${prefixClsV3}-${type}`,
|
|
62
|
-
`${prefixClsV3}-variant-${variant}`,
|
|
63
|
-
`${prefixClsV3}-color-${color}`,
|
|
64
|
-
`${prefixClsV3}-shape-${shape}`,
|
|
65
|
-
`${prefixClsV3}-size-${size}`,
|
|
66
|
-
{
|
|
67
|
-
[`${prefixCls}-block`]: block,
|
|
68
|
-
[`${prefixCls}-ghost`]: ghost,
|
|
69
|
-
[`${prefixCls}-danger`]: danger,
|
|
70
|
-
[`${prefixCls}-loading`]: innerLoading,
|
|
71
|
-
[`${prefixCls}-disabled`]: disabled,
|
|
72
|
-
[`${prefixClsV3}-block`]: block,
|
|
73
|
-
[`${prefixClsV3}-ghost`]: ghost,
|
|
74
|
-
[`${prefixClsV3}-danger`]: danger,
|
|
75
|
-
[`${prefixClsV3}-loading`]: innerLoading,
|
|
76
|
-
[`${prefixClsV3}-disabled`]: disabled
|
|
77
|
-
},
|
|
78
|
-
className
|
|
79
|
-
])])
|
|
80
|
-
}, [block, className, color, danger, disabled, ghost, innerLoading, prefixCls, prefixClsV3, rootClassName, shape, size, type, variant]);
|
|
81
|
-
|
|
82
|
-
const iconNode = innerLoading
|
|
83
|
-
? (typeof loading === 'object' && loading.icon) || (
|
|
84
|
-
<span className={`${prefixCls}-spinner ${prefixClsV3}-spinner`} />
|
|
85
|
-
)
|
|
86
|
-
: icon;
|
|
87
|
-
|
|
88
|
-
const content = (
|
|
89
|
-
<>
|
|
90
|
-
{iconNode && iconPosition === 'start' && (
|
|
91
|
-
<span
|
|
92
|
-
className={clsx(`${prefixCls}-icon ${prefixClsV3}-icon`, customClassNames.icon)}
|
|
93
|
-
style={styles.icon}
|
|
94
|
-
>
|
|
95
|
-
{iconNode}
|
|
96
|
-
</span>
|
|
97
|
-
)}
|
|
98
|
-
<span className={`${prefixCls}-content ${prefixClsV3}-content`}>{children}</span>
|
|
99
|
-
{iconNode && iconPosition === 'end' && (
|
|
100
|
-
<span
|
|
101
|
-
className={clsx(`${prefixCls}-icon ${prefixClsV3}-icon`, customClassNames.icon)}
|
|
102
|
-
style={styles.icon}
|
|
103
|
-
>
|
|
104
|
-
{iconNode}
|
|
105
|
-
</span>
|
|
106
|
-
)}
|
|
107
|
-
</>
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
const mergedDisabled = disabled || innerLoading;
|
|
111
|
-
|
|
112
|
-
if (href) {
|
|
113
|
-
return (
|
|
114
|
-
<a
|
|
115
|
-
className={classes}
|
|
116
|
-
href={mergedDisabled ? undefined : href}
|
|
117
|
-
aria-disabled={mergedDisabled}
|
|
118
|
-
>
|
|
119
|
-
{content}
|
|
120
|
-
</a>
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return (
|
|
125
|
-
<button
|
|
126
|
-
type={htmlType}
|
|
127
|
-
className={classes}
|
|
128
|
-
disabled={mergedDisabled}
|
|
129
|
-
{...restProps}
|
|
130
|
-
>
|
|
131
|
-
{content}
|
|
132
|
-
</button>
|
|
133
|
-
);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export default ButtonComponent
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Button } from './Button'
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
html .xUi-button {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
font-weight: 400;
|
|
6
|
-
white-space: nowrap;
|
|
7
|
-
vertical-align: middle;
|
|
8
|
-
user-select: none;
|
|
9
|
-
border: 1px solid transparent;
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
transition: all 0.3s ease;
|
|
12
|
-
border-radius: 6px;
|
|
13
|
-
line-height: 1.5715;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
html .xUi-button-content {
|
|
17
|
-
display: inline-flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
html .xUi-button-icon {
|
|
23
|
-
display: inline-flex;
|
|
24
|
-
align-items: center;
|
|
25
|
-
justify-content: center;
|
|
26
|
-
line-height: 0;
|
|
27
|
-
margin-right: 0.5em;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
html .xUi-button-icon:last-child {
|
|
31
|
-
margin-right: 0;
|
|
32
|
-
margin-left: 0.5em;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
html .xUi-button-spinner {
|
|
36
|
-
width: 1em;
|
|
37
|
-
height: 1em;
|
|
38
|
-
border: 1px solid transparent;
|
|
39
|
-
border-top-color: var(--xui-text-color);
|
|
40
|
-
border-radius: 50%;
|
|
41
|
-
animation: xUi-spin 1s linear infinite;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@keyframes xUi-spin {
|
|
45
|
-
0% {
|
|
46
|
-
transform: rotate(0deg);
|
|
47
|
-
}
|
|
48
|
-
100% {
|
|
49
|
-
transform: rotate(360deg);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
html .xUi-button-size-small {
|
|
54
|
-
padding: 4px 12px;
|
|
55
|
-
font-size: 12px;
|
|
56
|
-
height: 24px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
html .xUi-button-size-middle {
|
|
60
|
-
padding: 0 16px;
|
|
61
|
-
font-size: 14px;
|
|
62
|
-
height: 32px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
html .xUi-button-size-large {
|
|
66
|
-
padding: 8px 20px;
|
|
67
|
-
font-size: 16px;
|
|
68
|
-
height: 44px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
html .xUi-button-shape-circle {
|
|
72
|
-
padding: 0;
|
|
73
|
-
border-radius: 50%;
|
|
74
|
-
justify-content: center;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
html .xUi-button-shape-circle .xUi-button-size-small {
|
|
78
|
-
width: 24px;
|
|
79
|
-
height: 24px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
html .xUi-button-shape-circle .xUi-button-size-large {
|
|
83
|
-
width: 44px;
|
|
84
|
-
height: 44px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
html .xUi-button-shape-round {
|
|
88
|
-
border-radius: 9999px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
html .xUi-button-default {
|
|
92
|
-
background-color: #fff;
|
|
93
|
-
border-color: var(--xui-border-color);
|
|
94
|
-
color: rgba(0, 0, 0, 0.85);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
html .xUi-button-default:hover {
|
|
98
|
-
border-color: var(--xui-primary-color);
|
|
99
|
-
color: var(--xui-primary-color);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
html .xUi-button-primary {
|
|
103
|
-
background-color: var(--xui-primary-color);
|
|
104
|
-
border-color: var(--xui-primary-color);
|
|
105
|
-
color: #fff;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
html .xUi-button-primary:hover {
|
|
109
|
-
background-color: var(--xui-primary-color-hover);
|
|
110
|
-
border-color: var(--xui-primary-color-hover);
|
|
111
|
-
color: #fff;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
html .xUi-button-variant-dashed {
|
|
115
|
-
border-style: dashed;
|
|
116
|
-
background-color: #fff;
|
|
117
|
-
color: rgba(0, 0, 0, 0.85);
|
|
118
|
-
border-color: var(--xui-border-color);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
html .xUi-button-variant-dashed:hover {
|
|
122
|
-
border-color: var(--xui-primary-color);
|
|
123
|
-
color: var(--xui-primary-color);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
html .xUi-button-variant-text {
|
|
127
|
-
background-color: transparent;
|
|
128
|
-
border-color: transparent !important;
|
|
129
|
-
color: rgba(0, 0, 0, 0.88);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
html .xUi-button-variant-text:hover {
|
|
133
|
-
color: rgba(0, 0, 0, 0.88);
|
|
134
|
-
border-color: transparent;
|
|
135
|
-
background-color: rgba(0, 0, 0, 0.04);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
html .xUi-button-variant-link {
|
|
139
|
-
background-color: transparent;
|
|
140
|
-
border-color: transparent !important;
|
|
141
|
-
color: var(--xui-primary-color);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
html .xUi-button-variant-link:hover {
|
|
145
|
-
border-color: transparent;
|
|
146
|
-
color: var(--xui-primary-color-light);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
html .xUi-button-variant-outlined {
|
|
150
|
-
background-color: transparent;
|
|
151
|
-
border-color: var(--xui-border-color);
|
|
152
|
-
color: #fff;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
html .xUi-button-variant-filled {
|
|
156
|
-
background-color: transparent;
|
|
157
|
-
color: var(--xui-text-color);
|
|
158
|
-
border-color: var(--xui-border-color);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
html .xUi-button-danger {
|
|
162
|
-
background-color: transparent;
|
|
163
|
-
border-color: var(--xui-error-color);
|
|
164
|
-
color: var(--xui-error-color);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
html .xUi-button-danger:hover {
|
|
168
|
-
color: var(--xui-error-color-light);
|
|
169
|
-
border-color: var(--xui-error-color-light);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
html .xUi-button-ghost {
|
|
173
|
-
opacity: 0;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
html .xUi-button-ghost:hover {
|
|
177
|
-
opacity: 1;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
html .xUi-button-block {
|
|
181
|
-
display: flex;
|
|
182
|
-
width: 100%;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
html .xUi-button-disabled,
|
|
186
|
-
html .xUi-button-loading {
|
|
187
|
-
cursor: not-allowed;
|
|
188
|
-
opacity: 0.5;
|
|
189
|
-
color: var(--xui-text-color);
|
|
190
|
-
border-color: var(--xui-border-color);
|
|
191
|
-
background-color: var(--xui-color-disabled);
|
|
192
|
-
pointer-events: none;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
html .xUi-button-loading {
|
|
196
|
-
background-color: transparent
|
|
197
|
-
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import React, {
|
|
4
|
-
MouseEvent,
|
|
5
|
-
ReactElement,
|
|
6
|
-
useEffect,
|
|
7
|
-
useRef,
|
|
8
|
-
useState
|
|
9
|
-
} from 'react';
|
|
10
|
-
import { clsx } from '../../../lib/helpers';
|
|
11
|
-
import { SyntheticBaseEvent } from '../../types';
|
|
12
|
-
import { CheckboxProps } from '../../types/checkbox';
|
|
13
|
-
import { prefixClsCheckbox, prefixClsCheckboxV3 } from '../../../lib/utils';
|
|
14
|
-
import './style.css';
|
|
15
|
-
|
|
16
|
-
const Checkbox = ({
|
|
17
|
-
prefixCls = prefixClsCheckbox,
|
|
18
|
-
prefixClsV3 = prefixClsCheckboxV3,
|
|
19
|
-
className = '',
|
|
20
|
-
defaultChecked = false,
|
|
21
|
-
checked,
|
|
22
|
-
style,
|
|
23
|
-
disabled = false,
|
|
24
|
-
onChange,
|
|
25
|
-
onClick,
|
|
26
|
-
onMouseEnter,
|
|
27
|
-
onMouseLeave,
|
|
28
|
-
onKeyPress,
|
|
29
|
-
onKeyDown,
|
|
30
|
-
tabIndex,
|
|
31
|
-
name,
|
|
32
|
-
children,
|
|
33
|
-
id,
|
|
34
|
-
autoFocus,
|
|
35
|
-
type = 'checkbox',
|
|
36
|
-
value = false,
|
|
37
|
-
required = false,
|
|
38
|
-
noStyle,
|
|
39
|
-
titleClick,
|
|
40
|
-
ref,
|
|
41
|
-
controlled = false
|
|
42
|
-
}: CheckboxProps,
|
|
43
|
-
): ReactElement => {
|
|
44
|
-
const isChecked = checked !== undefined ? checked : defaultChecked || value;
|
|
45
|
-
const [internalChecked, setInternalChecked] = useState(isChecked);
|
|
46
|
-
|
|
47
|
-
const checkboxRef = useRef<HTMLInputElement | null>(null);
|
|
48
|
-
|
|
49
|
-
const handleClick = (
|
|
50
|
-
e: MouseEvent<HTMLInputElement> & SyntheticBaseEvent
|
|
51
|
-
) => {
|
|
52
|
-
if (disabled) {
|
|
53
|
-
e.stopPropagation();
|
|
54
|
-
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (checkboxRef.current) {
|
|
59
|
-
if (!controlled) {
|
|
60
|
-
e.target.value = !internalChecked;
|
|
61
|
-
setInternalChecked(!internalChecked);
|
|
62
|
-
checkboxRef.current.checked = !internalChecked
|
|
63
|
-
} else {
|
|
64
|
-
e.target.value = !checked;
|
|
65
|
-
checkboxRef.current.checked = !checked
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
onClick?.(e);
|
|
70
|
-
onChange?.(e);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
if (checked !== undefined) {
|
|
75
|
-
setInternalChecked(checked);
|
|
76
|
-
}
|
|
77
|
-
}, [checked]);
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<div className={`${prefixCls}-wrapper ${prefixClsV3}-wrapper`}>
|
|
81
|
-
<div
|
|
82
|
-
ref={ref}
|
|
83
|
-
tabIndex={0}
|
|
84
|
-
role="button"
|
|
85
|
-
style={style}
|
|
86
|
-
onClick={handleClick}
|
|
87
|
-
className={clsx([
|
|
88
|
-
prefixCls,
|
|
89
|
-
prefixClsV3,
|
|
90
|
-
className,
|
|
91
|
-
{
|
|
92
|
-
noStyle: noStyle,
|
|
93
|
-
[`${prefixCls}-disabled ${prefixClsV3}-disabled`]: disabled,
|
|
94
|
-
[`${prefixCls}-checked ${prefixClsV3}-checked`]: internalChecked
|
|
95
|
-
}
|
|
96
|
-
])}
|
|
97
|
-
>
|
|
98
|
-
<input
|
|
99
|
-
id={id}
|
|
100
|
-
type={type}
|
|
101
|
-
name={name}
|
|
102
|
-
ref={checkboxRef}
|
|
103
|
-
disabled={disabled}
|
|
104
|
-
tabIndex={tabIndex}
|
|
105
|
-
required={required}
|
|
106
|
-
autoFocus={autoFocus}
|
|
107
|
-
onKeyDown={onKeyDown}
|
|
108
|
-
onKeyPress={onKeyPress}
|
|
109
|
-
onMouseEnter={onMouseEnter}
|
|
110
|
-
onMouseLeave={onMouseLeave}
|
|
111
|
-
/>
|
|
112
|
-
|
|
113
|
-
<span className={`${prefixCls}-box ${prefixClsV3}-box`}>
|
|
114
|
-
<span
|
|
115
|
-
className={`${prefixCls}-check ${prefixClsV3}-check`}
|
|
116
|
-
style={{ opacity: internalChecked ? 1 : 0 }}
|
|
117
|
-
/>
|
|
118
|
-
</span>
|
|
119
|
-
</div>
|
|
120
|
-
|
|
121
|
-
{titleClick
|
|
122
|
-
? <div onClick={handleClick}>{children}</div>
|
|
123
|
-
: children && <span className={`${prefixCls}-label ${prefixClsV3}-label`}>{children}</span>
|
|
124
|
-
}
|
|
125
|
-
</div>
|
|
126
|
-
);
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
Checkbox.displayName = 'Checkbox';
|
|
130
|
-
|
|
131
|
-
export default Checkbox;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Checkbox } from './Checkbox'
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
.xUi-checkbox-wrapper {
|
|
2
|
-
cursor: pointer;
|
|
3
|
-
font-size: var(--xui-font-size-md);
|
|
4
|
-
align-items: center;
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
color: var(--xui-main-color);
|
|
7
|
-
margin: 16px 0;
|
|
8
|
-
|
|
9
|
-
&:has([tabindex="0"]:focus-visible) {
|
|
10
|
-
border-color: var(--xui-primary-color);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.xUi-checkbox {
|
|
15
|
-
width: 14px;
|
|
16
|
-
height: 14px;
|
|
17
|
-
position: relative;
|
|
18
|
-
border-radius: var(--xui-border-radius-sm);
|
|
19
|
-
transition: all 0.3s;
|
|
20
|
-
display: inline-block;
|
|
21
|
-
background-color: transparent;
|
|
22
|
-
border: 1px solid var(--xui-border-color);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.xUi-checkbox.xUi-checkbox-checked {
|
|
26
|
-
border-color: var(--xui-primary-color);
|
|
27
|
-
background-color: #f0f5ff;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.xUi-checkbox input {
|
|
31
|
-
inset: 0;
|
|
32
|
-
opacity: 0;
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
position: absolute;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.xUi-checkbox-inner {
|
|
38
|
-
top: 50%;
|
|
39
|
-
left: 50%;
|
|
40
|
-
width: 10px;
|
|
41
|
-
height: 6px;
|
|
42
|
-
border-top: 0;
|
|
43
|
-
border-left: 0;
|
|
44
|
-
position: absolute;
|
|
45
|
-
border: 2px solid var(--xui-background-color);
|
|
46
|
-
transform: rotate(45deg) scale(0);
|
|
47
|
-
transition: transform 0.2s ease-in-out;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.xUi-checkbox-check {
|
|
51
|
-
width: 100%;
|
|
52
|
-
height: 100%;
|
|
53
|
-
display: block;
|
|
54
|
-
position: relative;
|
|
55
|
-
transition: 0.1s ease;
|
|
56
|
-
border-color: var(--xui-primary-color);
|
|
57
|
-
background-color: var(--xui-primary-color);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.xUi-checkbox-check::after {
|
|
61
|
-
top: 1px;
|
|
62
|
-
left: 3px;
|
|
63
|
-
width: 5px;
|
|
64
|
-
height: 8px;
|
|
65
|
-
content: "";
|
|
66
|
-
position: absolute;
|
|
67
|
-
border: solid white;
|
|
68
|
-
transform: rotate(45deg);
|
|
69
|
-
border-width: 0 2px 2px 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.xUi-checkbox-disabled,
|
|
73
|
-
.xUi-checkbox-disabled .xUi-checkbox-check {
|
|
74
|
-
opacity: 0.5;
|
|
75
|
-
cursor: not-allowed;
|
|
76
|
-
background-color: var(--xui-color-disabled);
|
|
77
|
-
border-color: var(--xui-border-color) !important;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.xUi-checkbox-label {
|
|
81
|
-
margin-left: 8px;
|
|
82
|
-
user-select: none;
|
|
83
|
-
font-size: 14px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.xUi-checkbox:hover:not(.disabled),
|
|
87
|
-
.xUi-checkbox:focus:not(.disabled) {
|
|
88
|
-
border-color: var(--xui-primary-color);
|
|
89
|
-
cursor: pointer;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.xUi-checkbox.disabled {
|
|
93
|
-
opacity: 0.5;
|
|
94
|
-
cursor: not-allowed;
|
|
95
|
-
}
|