tango-ui-cw 0.2.5 → 0.2.7

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 (38) hide show
  1. package/dist/index.js +256 -15
  2. package/dist/index.mjs +26118 -1301
  3. package/package.json +11 -12
  4. package/src/component/CSSFab/useTangoStyle.jsx +0 -182
  5. package/src/component/MaterialButton/MaterialButton.module.css +0 -64
  6. package/src/component/MaterialButton/index.jsx +0 -69
  7. package/src/component/MaterialInput/MaterialInput.module.css +0 -37
  8. package/src/component/MaterialInput/index.jsx +0 -34
  9. package/src/component/TButton/TButton.module.css +0 -184
  10. package/src/component/TButton/index.jsx +0 -81
  11. package/src/component/TColorPicker/TColorPicker.module.css +0 -24
  12. package/src/component/TColorPicker/index.jsx +0 -107
  13. package/src/component/TDate/index.jsx +0 -145
  14. package/src/component/TDatePicker/TDatePicker.module.css +0 -12
  15. package/src/component/TDatePicker/index.jsx +0 -72
  16. package/src/component/TDrawer/TDrawer.module.css +0 -203
  17. package/src/component/TDrawer/index.jsx +0 -80
  18. package/src/component/TInput/TInput.module.css +0 -67
  19. package/src/component/TInput/index.jsx +0 -94
  20. package/src/component/TLayout/TLayout.css +0 -88
  21. package/src/component/TLayout/index.jsx +0 -76
  22. package/src/component/TLine/TLine.module.css +0 -52
  23. package/src/component/TLine/index.jsx +0 -47
  24. package/src/component/TMark/TMark.module.css +0 -6
  25. package/src/component/TMark/index.jsx +0 -68
  26. package/src/component/TModal/TModal.module.css +0 -109
  27. package/src/component/TModal/index.jsx +0 -75
  28. package/src/component/TNotice/TNotice.module.css +0 -50
  29. package/src/component/TNotice/index.jsx +0 -37
  30. package/src/component/TNotice/useNotice.jsx +0 -53
  31. package/src/component/TSearch/TSearch.module.css +0 -80
  32. package/src/component/TSearch/index.jsx +0 -86
  33. package/src/component/TSpace/TSpace.module.css +0 -43
  34. package/src/component/TSpace/index.jsx +0 -60
  35. package/src/component/TTable/TTable.module.css +0 -26
  36. package/src/component/TTable/index.jsx +0 -72
  37. package/src/component/TTooltip/TTooltip.module.css +0 -66
  38. package/src/component/TTooltip/index.jsx +0 -33
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-ui-cw",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "A lightweight ui library with ClayW",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -12,11 +12,13 @@
12
12
  },
13
13
  "devDependencies": {
14
14
  "@vitejs/plugin-react": "^4.4.1",
15
+ "react": "^19.1.0",
16
+ "react-dom": "^19.1.0",
15
17
  "vite": "^6.3.5"
16
18
  },
17
19
  "peerDependencies": {
18
- "react": "^18.0.0",
19
- "react-dom": "^18.0.0"
20
+ "react": "^19.0.0",
21
+ "react-dom": "^19.0.0"
20
22
  },
21
23
  "peerDependenciesMeta": {
22
24
  "react": {
@@ -27,18 +29,15 @@
27
29
  }
28
30
  },
29
31
  "files": [
30
- "dist",
31
- "src/component"
32
+ "dist"
32
33
  ],
33
34
  "exports": {
34
- ".": {
35
- "import": "./dist/index.mjs",
36
- "require": "./dist/index.js"
35
+ ".": {
36
+ "import": "./dist/index.mjs",
37
+ "require": "./dist/index.js"
38
+ },
39
+ "./index.css": "./dist/index.css"
37
40
  },
38
- "./dist/index.css": {
39
- "default": "./dist/index.css"
40
- }
41
- },
42
41
  "dependencies": {
43
42
  "prop-types": "^15.8.1"
44
43
  }
@@ -1,182 +0,0 @@
1
- // 封装sx属性值
2
- export const useTangoStyle = (sx) => {
3
- return Object.entries(sx).reduce((acc, [key, value]) => {
4
- const pxValue = `${value}px`;
5
-
6
- switch (key) {
7
- case "mt":
8
- acc.marginTop = typeof value === "number" ? `${value}px` : value;
9
- break;
10
- case "mr":
11
- acc.marginRight = typeof value === "number" ? `${value}px` : value;
12
- break;
13
- case "mb":
14
- acc.marginBottom = typeof value === "number" ? `${value}px` : value;
15
- break;
16
- case "ml":
17
- acc.marginLeft = typeof value === "number" ? `${value}px` : value;
18
- break;
19
- case "m":
20
- acc.margin = typeof value === "number" ? `${value}px` : value;
21
- break;
22
-
23
- case "pt":
24
- acc.paddingTop = pxValue;
25
- break;
26
- case "pr":
27
- acc.paddingRight = pxValue;
28
- break;
29
- case "pb":
30
- acc.paddingBottom = pxValue;
31
- break;
32
- case "pl":
33
- acc.paddingLeft = pxValue;
34
- break;
35
- case "p":
36
- acc.padding = pxValue;
37
- break;
38
- case "br":
39
- acc.borderRadius = typeof value === "number" ? `${value}px` : value;
40
- break;
41
- case "bg":
42
- acc.background = value; // 直接使用传入的背景值
43
- break;
44
- case "c":
45
- acc.color = value;
46
- break;
47
- case "b":
48
- acc.border = value === 1 ? "1px solid red" : value; // 如果值是 1,则设置为 "1px solid red"
49
- break;
50
- case "center":
51
- acc.position = "absolute"; // 设置绝对定位
52
- acc.inset = 0; // 设置inset为0
53
- acc.margin = "auto"; // 设置margin为auto,保证元素居中
54
- break;
55
- case "pot":
56
- acc.top = pxValue;
57
- break;
58
- case "por":
59
- acc.right = pxValue;
60
- break;
61
- case "pob":
62
- acc.bottom = pxValue;
63
- break;
64
- case "pol":
65
- acc.left = pxValue;
66
- break;
67
- case "rel":
68
- acc.position = "relative"; // 设置相对定位
69
- break;
70
- case "ab":
71
- acc.position = "absolute"; // 设置绝对定位
72
- break;
73
- case "fixed":
74
- acc.position = "fixed"; // 设置窗口定位
75
- break;
76
- case "w":
77
- acc.width = pxValue;
78
- break;
79
- case "h":
80
- acc.height = pxValue;
81
- break;
82
- case "vw":
83
- acc.width = `${value}vw`; // 将宽度值转换为 vw 单位
84
- break;
85
- case "vh":
86
- acc.height = `${value}vh`; // 将高度值转换为 vh 单位
87
- break;
88
- case "presentw":
89
- acc.width = `${value}%`; // 将宽度值转换为 % 单位
90
- break;
91
- case "presenth":
92
- acc.height = `${value}%`; // 将高度值转换为 % 单位
93
- break;
94
- case "mw":
95
- acc.minWidth = pxValue;
96
- break;
97
- case "mh":
98
- acc.minHieght = pxValue;
99
- break;
100
- case "fl":
101
- acc.float = "left";
102
- break;
103
- case "fr":
104
- acc.float = "right";
105
- break;
106
- case "size":
107
- acc.fontSize = pxValue;
108
- break;
109
- case "tac":
110
- acc.textAlign = "center";
111
- break;
112
- case "z":
113
- acc.zIndex = value;
114
- break;
115
- case "tran":
116
- acc.transition = `${value}s`;
117
- break;
118
- case "flex":
119
- acc.display = "flex";
120
- break;
121
- case "aic":
122
- acc.alignItems = "center";
123
- break;
124
- case "jcc":
125
- acc.justifyContent = "center";
126
- break;
127
- case "jc":
128
- acc.justifyContent = value;
129
- break;
130
- case "oh":
131
- acc.overflow = "hidden";
132
- break;
133
- case "ohauto":
134
- acc.overflow = "auto";
135
- break;
136
- case "op":
137
- acc.opacity = value;
138
- break;
139
- case "none":
140
- acc.display = "none";
141
- break;
142
- case "ar":
143
- acc.aspectRatio = value;
144
- break;
145
- case "ls":
146
- acc.letterSpacing = pxValue;
147
- break;
148
- case "lh":
149
- acc.lineHeight = pxValue;
150
- break;
151
- case "fwb":
152
- acc.fontWeight = "bold";
153
- break;
154
- case "boxsizing":
155
- acc.boxSizing = "border-box";
156
- break;
157
- case "boxshadow":
158
- acc.boxShadow = value;
159
- break;
160
-
161
- case "f":
162
- acc.flex = typeof value === "number" ? value : `${value}`; // 支持数字或字符串
163
- break;
164
- case "bColor":
165
- acc.borderColor = value; // 直接使用传入的背景值
166
- break;
167
- case "bgSize":
168
- acc.backgroundSize = value; // 直接使用传入的背景值
169
- break;
170
- case "bgPosition":
171
- acc.backgroundPosition = value; // 直接使用传入的背景值
172
- break;
173
- case "bgRepeat":
174
- acc.backgroundRepeat = value; // 直接使用传入的背景值
175
- break;
176
- default:
177
- acc[key] = value; // 允许其他样式直接传入,理论上可以支持所有的CSS样式传入
178
- }
179
-
180
- return acc;
181
- }, {});
182
- };
@@ -1,64 +0,0 @@
1
- .materialBtn {
2
- position: relative;
3
- overflow: hidden;
4
- border: none;
5
- border-radius: 6px;
6
- cursor: pointer;
7
- font-family: Arial, sans-serif;
8
- font-weight: 500;
9
- color: white;
10
- background-color: #4caf50;
11
- transition: background-color 0.3s ease;
12
- user-select: none;
13
- outline: none;
14
- padding: 10px 20px;
15
- }
16
-
17
- .materialBtn:hover:not(.materialBtnDisabled) {
18
- background-color: #45a047;
19
- }
20
-
21
- .materialBtn:active:not(.materialBtnDisabled) {
22
- background-color: #388e3c;
23
- }
24
-
25
- /* 不同大小 */
26
- .materialBtnSmall {
27
- font-size: 12px;
28
- padding: 6px 12px;
29
- }
30
-
31
- .materialBtnMedium {
32
- font-size: 14px;
33
- padding: 10px 20px;
34
- }
35
-
36
- .materialBtnLarge {
37
- font-size: 18px;
38
- padding: 14px 28px;
39
- }
40
-
41
- /* 禁用 */
42
- .materialBtnDisabled {
43
- background-color: #e0e0e0;
44
- color: #a0a0a0;
45
- cursor: not-allowed;
46
- }
47
-
48
- /* 波纹效果 */
49
- .ripple {
50
- position: absolute;
51
- border-radius: 50%;
52
- background: rgba(255, 255, 255, 0.6);
53
- transform: scale(0);
54
- animation: ripple-effect 600ms linear;
55
- pointer-events: none;
56
- z-index: 0;
57
- }
58
-
59
- @keyframes ripple-effect {
60
- to {
61
- transform: scale(4);
62
- opacity: 0;
63
- }
64
- }
@@ -1,69 +0,0 @@
1
- import React, { useRef } from "react";
2
- import styles from "./MaterialButton.module.css"; // 使用模块化 CSS
3
- import { useTangoStyle } from "../CSSFab/useTangoStyle";
4
-
5
- export default function MaterialButton({
6
- size = "medium",
7
- sx = {},
8
- style = {},
9
- className = "",
10
- onClick,
11
- children,
12
- disabled = false,
13
- ...rest
14
- }) {
15
- const buttonRef = useRef(null);
16
-
17
- const sxStyle = useTangoStyle(sx);
18
- const combinedStyle = { ...sxStyle, ...style };
19
-
20
- function handleRipple(e) {
21
- if (disabled) return;
22
-
23
- const button = buttonRef.current;
24
- const circle = document.createElement("span");
25
- const diameter = Math.max(button.clientWidth, button.clientHeight);
26
- const radius = diameter / 2;
27
-
28
- circle.classList.add(styles.ripple); // 模块化样式
29
- circle.style.width = circle.style.height = `${diameter}px`;
30
- circle.style.left = `${e.clientX - button.getBoundingClientRect().left - radius}px`;
31
- circle.style.top = `${e.clientY - button.getBoundingClientRect().top - radius}px`;
32
-
33
- const oldRipple = button.querySelector(`.${styles.ripple}`);
34
- if (oldRipple) oldRipple.remove();
35
-
36
- button.appendChild(circle);
37
- }
38
-
39
- const sizeClass = styles[`materialBtn${capitalize(size)}`]; // 动态大小样式
40
- const combinedClassName = [
41
- styles.materialBtn,
42
- sizeClass,
43
- disabled ? styles.materialBtnDisabled : "",
44
- className, // 用户自定义 className(外部样式)
45
- ]
46
- .filter(Boolean)
47
- .join(" ");
48
-
49
- return (
50
- <button
51
- ref={buttonRef}
52
- className={combinedClassName}
53
- style={combinedStyle}
54
- onClick={(e) => {
55
- handleRipple(e);
56
- onClick?.(e);
57
- }}
58
- disabled={disabled}
59
- {...rest}
60
- >
61
- {children}
62
- </button>
63
- );
64
- }
65
-
66
- // 辅助函数:首字母大写
67
- function capitalize(str) {
68
- return str.charAt(0).toUpperCase() + str.slice(1);
69
- }
@@ -1,37 +0,0 @@
1
- .materialInput {
2
- width: 100%;
3
- }
4
-
5
- .inputWrapper {
6
- position: relative;
7
- margin: 10px 0;
8
- width: 100%;
9
- }
10
-
11
- .materialInputField {
12
- width: 100%;
13
- padding: 16px 8px 8px 8px;
14
- font-size: 16px;
15
- border: none;
16
- border-bottom: 1px solid grey;
17
- background: transparent;
18
- outline: none;
19
- }
20
-
21
- .materialLabel {
22
- position: absolute;
23
- left: 8px;
24
- top: 16px;
25
- font-size: 16px;
26
- color: grey;
27
- transition: all 0.2s ease;
28
- pointer-events: none;
29
- }
30
-
31
- /* 上浮状态样式 */
32
- .filled ~ .materialLabel,
33
- .float {
34
- top: 2px;
35
- font-size: 12px;
36
- color: #45a047;
37
- }
@@ -1,34 +0,0 @@
1
- // Material风格Input
2
- import { useState } from "react";
3
- import styles from "./MaterialInput.module.css";
4
-
5
- export default function FloatInput({ label, type = "text" }) {
6
- const [focused, setFocused] = useState(false);
7
- const [value, setValue] = useState("");
8
-
9
- const isFloating = focused || value;
10
-
11
- return (
12
- <div className={styles.materialInput}>
13
- <div className={styles.inputWrapper}>
14
- <input
15
- type={type}
16
- className={`${styles.materialInputField} ${
17
- isFloating ? styles.filled : ""
18
- }`}
19
- onFocus={() => setFocused(true)}
20
- onBlur={() => setFocused(false)}
21
- onChange={(e) => setValue(e.target.value)}
22
- value={value}
23
- />
24
- <label
25
- className={`${styles.materialLabel} ${
26
- isFloating ? styles.float : ""
27
- }`}
28
- >
29
- {label}
30
- </label>
31
- </div>
32
- </div>
33
- );
34
- }
@@ -1,184 +0,0 @@
1
- /* TButton.module.css */
2
-
3
- .btn {
4
- font-family: Arial, sans-serif;
5
- border: none;
6
- cursor: pointer;
7
- padding: 8px 16px;
8
- border-radius: 8px;
9
- transition: all 0.3s;
10
- letter-spacing: 2px;
11
- }
12
-
13
- .btn:hover {
14
- transition: 0.5s;
15
- animation: btn-content 1s;
16
- outline: 0.1em solid transparent;
17
- outline-offset: 0.2em;
18
- }
19
-
20
- .btn-default {
21
- background-color: rgb(213, 213, 213);
22
- color: #000;
23
- }
24
-
25
- .btn-default:hover {
26
- box-shadow: 0 0 0.4em 0 rgb(213, 213, 213);
27
- }
28
-
29
- .btn-transparent {
30
- background-color: transparent;
31
- color: black;
32
- }
33
-
34
- .btn-transparent:hover {
35
- box-shadow: 0 0 0.4em 0 rgb(213, 213, 213);
36
- }
37
-
38
- .btn-danger {
39
- background-color: #dc3545;
40
- color: #fff;
41
- }
42
-
43
- .btn-danger:hover {
44
- box-shadow: 0 0 0.4em 0 #dc3545;
45
- }
46
-
47
- .btn-success {
48
- background-color: #4caf50;
49
- color: #fff;
50
- }
51
-
52
- .btn-success:hover {
53
- box-shadow: 0 0 0.4em 0 #4caf50;
54
- }
55
-
56
- .btn-outline {
57
- background-color: transparent;
58
- border-width: 1px;
59
- border-color: #000;
60
- }
61
-
62
- .btn-default.btn-outline {
63
- color: #000;
64
- border: 1px solid #d5d5d5;
65
- }
66
-
67
- .btn-default.btn-outline:hover {
68
- box-shadow: 0 0 0.4em 0 #d5d5d5;
69
- }
70
-
71
- .btn-success.btn-outline {
72
- color: #28a745;
73
- border: 1px solid #28a745;
74
- }
75
-
76
- .btn-success.btn-outline:hover {
77
- box-shadow: 0 0 0.4em 0 #28a745;
78
- }
79
-
80
- .btn-danger.btn-outline {
81
- color: #dc3545;
82
- border: 1px solid #dc3545;
83
- }
84
-
85
- .btn-danger.btn-outline:hover {
86
- box-shadow: 0 0 0.4em 0 #dc3545;
87
- }
88
-
89
- .btn-transparent.btn-outline {
90
- color: black;
91
- border: 1px solid #6c757d;
92
- }
93
-
94
- .btn-transparent.btn-outline:hover {
95
- box-shadow: 0 0 0.4em 0 #6c757d;
96
- }
97
-
98
- .btn-Neumorphism {
99
- background: #e0e0e0;
100
- box-shadow: 4px 4px 8px #bebebe, -4px -4px 8px #ffffff;
101
- color: white;
102
- }
103
-
104
- .btn-Neumorphism:hover {
105
- box-shadow: inset 4px 4px 8px rgba(190, 190, 190, 0.6), inset -4px -4px 8px rgba(255, 255, 255, 0.8), 4px 4px 8px rgba(190, 190, 190, 0.6), -4px -4px 8px rgba(255, 255, 255, 0.8);
106
- transform: translateY(-2px);
107
- }
108
-
109
- .btn-Neumorphism:active {
110
- box-shadow: inset 4px 4px 8px #bebebe, inset -4px -4px 8px #ffffff;
111
- transform: translateY(1px);
112
- }
113
-
114
- .btn-success.btn-Neumorphism {
115
- background-color: #28a745;
116
- box-shadow: inset 4px 4px 8px rgba(20, 90, 37, 0.6), inset -4px -4px 8px rgba(50, 200, 100, 0.8), 4px 4px 8px rgba(20, 90, 37, 0.3), -4px -4px 8px rgba(50, 200, 100, 0.5);
117
- }
118
-
119
- .btn-success.btn-Neumorphism:hover {
120
- box-shadow: inset 3px 3px 6px rgba(20, 90, 37, 0.8), inset -3px -3px 6px rgba(50, 200, 100, 0.9), 3px 3px 6px rgba(20, 90, 37, 0.5), -3px -3px 6px rgba(50, 200, 100, 0.7);
121
- }
122
-
123
- .btn-success.btn-Neumorphism:active {
124
- box-shadow: inset 4px 4px 8px rgba(20, 90, 37, 0.9), inset -4px -4px 8px rgba(50, 200, 100, 1);
125
- }
126
-
127
- .btn-transparent.btn-Neumorphism {
128
- background-color: transparent;
129
- color: white;
130
- border: 1px solid rgba(0, 0, 0, 0.1);
131
- box-shadow: 4px 4px 8px rgba(190, 190, 190, 0.6), -4px -4px 8px rgba(255, 255, 255, 0.8);
132
- }
133
-
134
- .btn-transparent.btn-Neumorphism:hover {
135
- box-shadow: inset 4px 4px 8px rgba(190, 190, 190, 0.6), inset -4px -4px 8px rgba(255, 255, 255, 0.8), 0 0 0.4em rgba(213, 213, 213, 0.8);
136
- }
137
-
138
- .btn-transparent.btn-Neumorphism:active {
139
- box-shadow: inset 6px 6px 12px rgba(190, 190, 190, 0.8), inset -6px -6px 12px rgba(255, 255, 255, 1);
140
- }
141
-
142
- .btn-danger.btn-Neumorphism {
143
- background-color: #dc3545;
144
- box-shadow: 4px 4px 8px rgba(145, 40, 50, 0.6), -4px -4px 8px rgba(255, 102, 112, 0.8);
145
- }
146
-
147
- .btn-danger.btn-Neumorphism:hover {
148
- box-shadow: inset 4px 4px 8px rgba(145, 40, 50, 0.6), inset -4px -4px 8px rgba(255, 102, 112, 0.8), 0 0 0.4em rgba(220, 53, 69, 0.8);
149
- }
150
-
151
- .btn-danger.btn-Neumorphism:active {
152
- box-shadow: inset 6px 6px 12px rgba(145, 40, 50, 0.8), inset -6px -6px 12px rgba(255, 102, 112, 1);
153
- }
154
-
155
- .btn-small {
156
- font-size: 12px;
157
- padding: 4px 8px;
158
- }
159
-
160
- .btn-medium {
161
- font-size: 14px;
162
- padding: 8px 16px;
163
- }
164
-
165
- .btn-large {
166
- font-size: 16px;
167
- padding: 12px 20px;
168
- }
169
-
170
- .btn-huge {
171
- font-size: 25px;
172
- padding: 18px 45px;
173
- }
174
-
175
- .btn-disabled {
176
- background-color: #e0e0e0;
177
- color: #a0a0a0;
178
- cursor: not-allowed;
179
- }
180
-
181
- .btn-disabled:hover {
182
- transition: 0s;
183
- box-shadow: none;
184
- }
@@ -1,81 +0,0 @@
1
- // 封装的button组件
2
- import React from "react";
3
- import PropTypes from "prop-types";
4
- import styles from './TButton.module.css' // 引入样式文件
5
- import { useTangoStyle } from "../CSSFab/useTangoStyle"; // 导入 useFastStyle 函数
6
-
7
- export default function Button(props) {
8
- // 接收属性参数,调整按钮样式
9
- const {
10
- type = "default",
11
- size = "medium",
12
- sx = {},
13
- style: userStyle = {},
14
- className: userClassName = "", // 允许用户自定义 className
15
- onClick,
16
- children,
17
- disabled,
18
- outline,
19
- Neumorphism,
20
- } = props;
21
-
22
- // 使用类名控制按钮的样式:按钮类型,按钮尺寸,按钮是否禁用
23
- const className = [
24
- styles.btn,
25
- styles[`btn-${type}`],
26
- styles[`btn-${size}`],
27
- disabled ? styles['btn-disabled'] : '',
28
- outline ? styles['btn-outline'] : '',
29
- Neumorphism ? styles['btn-Neumorphism'] : '',
30
- userClassName // 用户传入的 className 保持字符串形式
31
- ]
32
- .filter(Boolean) // 过滤掉空值
33
- .join(" ");
34
- // 合并用户传入的 className
35
-
36
- // 用于接收sx属性设置的属性样式
37
- const sxStyle = useTangoStyle(sx);
38
-
39
- // 合并 sx 和 style,确保 style 优先级更高
40
- const combinedStyle = { ...sxStyle, ...userStyle };
41
-
42
- // 定义属性类型
43
- Button.propTypes = {
44
- type: PropTypes.oneOf(["default", "transparent", "danger", "success"]), // 按钮类型:默认、透明、警告、成功
45
- size: PropTypes.oneOf(["small", "medium", "large", "huge"]), // 按钮大小
46
- sx: PropTypes.object, // 自定义样式对象
47
- style: PropTypes.object, // 用户传入的 style 属性,保证style属性优先级最高
48
- onClick: PropTypes.func, // 点击事件
49
- className: PropTypes.string, // 添加 className PropTypes
50
- children: PropTypes.node.isRequired, // 按钮内容
51
- disabled: PropTypes.bool, // 是否禁用
52
- outline: PropTypes.bool, // 是否为轮廓按钮
53
- Neumorphism: PropTypes.bool, // 是否为新拟态风格按钮
54
- };
55
-
56
- // 默认属性
57
- Button.defaultProps = {
58
- type: "default",
59
- size: "medium",
60
- sx: {},
61
- style: {},
62
- onClick: () => {},
63
- className: "", // 默认值为空字符串
64
- disabled: false,
65
- outline: false,
66
- Neumorphism: false,
67
- };
68
-
69
- return (
70
- <button
71
- className={className}
72
- style={combinedStyle} // 应用解析后的内联样式
73
- onClick={onClick}
74
- disabled={disabled}
75
- outline={outline}
76
- Neumorphism={Neumorphism}
77
- >
78
- {children}
79
- </button>
80
- );
81
- };