@akinon/ui-button 1.0.0 → 1.1.0
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/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +15 -8
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +15 -8
- package/package.json +5 -5
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,gBAAiB,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,gBAAiB,YAAY,sBA0J/C,CAAC;AAEF,mBAAmB,SAAS,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -22,6 +22,7 @@ const Button = (buttonProps) => {
|
|
|
22
22
|
const { getPrefixCls, theme } = react_1.default.useContext(antd_1.ConfigProvider.ConfigContext);
|
|
23
23
|
const { token, hashId } = (0, ui_theme_1.useToken)();
|
|
24
24
|
const buttonToken = token.Button;
|
|
25
|
+
const customTokens = theme.CustomTokens || {};
|
|
25
26
|
const useStyle = (0, cssinjs_1.useStyleRegister)({
|
|
26
27
|
token: token,
|
|
27
28
|
path: ['Button'],
|
|
@@ -37,8 +38,8 @@ const Button = (buttonProps) => {
|
|
|
37
38
|
backgroundColor: (_a = buttonToken.colorBgContainerDisabled) !== null && _a !== void 0 ? _a : token.colorBgContainerDisabled,
|
|
38
39
|
color: (_b = buttonToken.colorTextDisabled) !== null && _b !== void 0 ? _b : token.colorTextDisabled,
|
|
39
40
|
borderColor: buttonToken.borderColorDisabled,
|
|
40
|
-
cursor:
|
|
41
|
-
boxShadow:
|
|
41
|
+
cursor: customTokens.others.cursorNotAllowed,
|
|
42
|
+
boxShadow: customTokens.layout.displayNone
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
45
|
// END: Disabled
|
|
@@ -46,7 +47,10 @@ const Button = (buttonProps) => {
|
|
|
46
47
|
// MARK: - All
|
|
47
48
|
[`${prefixCls}`]: {
|
|
48
49
|
['> *']: {
|
|
49
|
-
verticalAlign:
|
|
50
|
+
verticalAlign: customTokens.others.verticalAlignMiddle
|
|
51
|
+
},
|
|
52
|
+
['> span']: {
|
|
53
|
+
alignSelf: `${customTokens.layout.flexCenter} !important`
|
|
50
54
|
}
|
|
51
55
|
},
|
|
52
56
|
// END: All
|
|
@@ -55,10 +59,10 @@ const Button = (buttonProps) => {
|
|
|
55
59
|
[`&:not(:disabled)${prefixCls}-sm`]: {
|
|
56
60
|
backgroundColor: buttonToken.defaultBgSm,
|
|
57
61
|
color: buttonToken.colorText,
|
|
58
|
-
borderColor:
|
|
62
|
+
borderColor: customTokens.others.colorTransparent,
|
|
59
63
|
'&:hover': {
|
|
60
64
|
backgroundColor: buttonToken.defaultBgSmHover,
|
|
61
|
-
borderColor:
|
|
65
|
+
borderColor: customTokens.others.colorTransparent,
|
|
62
66
|
color: buttonToken.colorTextHover
|
|
63
67
|
},
|
|
64
68
|
[`&${prefixCls}-dangerous`]: {
|
|
@@ -67,6 +71,9 @@ const Button = (buttonProps) => {
|
|
|
67
71
|
color: buttonToken.colorErrorSMHover,
|
|
68
72
|
backgroundColor: buttonToken.colorErrorBgSMHover
|
|
69
73
|
}
|
|
74
|
+
},
|
|
75
|
+
['span']: {
|
|
76
|
+
lineHeight: 'normal !important'
|
|
70
77
|
}
|
|
71
78
|
}
|
|
72
79
|
},
|
|
@@ -85,15 +92,15 @@ const Button = (buttonProps) => {
|
|
|
85
92
|
// MARK: Icon
|
|
86
93
|
[`${prefixCls}-icon`]: {
|
|
87
94
|
['> *']: {
|
|
88
|
-
backgroundColor:
|
|
95
|
+
backgroundColor: customTokens.others.colorTransparent,
|
|
89
96
|
// Since this button is transparent, we are using success bg color for the icon.
|
|
90
97
|
color: (_j = buttonToken.colorSuccessBg) !== null && _j !== void 0 ? _j : token.colorSuccessBg,
|
|
91
|
-
verticalAlign:
|
|
98
|
+
verticalAlign: customTokens.others.verticalAlignMiddle,
|
|
92
99
|
'&:hover:not(:disabled)': {
|
|
93
100
|
color: (_k = buttonToken.colorSuccessBg) !== null && _k !== void 0 ? _k : token.colorSuccessBg
|
|
94
101
|
},
|
|
95
102
|
'&:active': {
|
|
96
|
-
boxShadow:
|
|
103
|
+
boxShadow: customTokens.layout.displayNone
|
|
97
104
|
}
|
|
98
105
|
},
|
|
99
106
|
'&:disabled': {
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,gBAAiB,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,gBAAiB,YAAY,sBA0J/C,CAAC;AAEF,mBAAmB,SAAS,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export const Button = (buttonProps) => {
|
|
|
19
19
|
const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
|
|
20
20
|
const { token, hashId } = useToken();
|
|
21
21
|
const buttonToken = token.Button;
|
|
22
|
+
const customTokens = theme.CustomTokens || {};
|
|
22
23
|
const useStyle = useStyleRegister({
|
|
23
24
|
token: token,
|
|
24
25
|
path: ['Button'],
|
|
@@ -34,8 +35,8 @@ export const Button = (buttonProps) => {
|
|
|
34
35
|
backgroundColor: (_a = buttonToken.colorBgContainerDisabled) !== null && _a !== void 0 ? _a : token.colorBgContainerDisabled,
|
|
35
36
|
color: (_b = buttonToken.colorTextDisabled) !== null && _b !== void 0 ? _b : token.colorTextDisabled,
|
|
36
37
|
borderColor: buttonToken.borderColorDisabled,
|
|
37
|
-
cursor:
|
|
38
|
-
boxShadow:
|
|
38
|
+
cursor: customTokens.others.cursorNotAllowed,
|
|
39
|
+
boxShadow: customTokens.layout.displayNone
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
42
|
// END: Disabled
|
|
@@ -43,7 +44,10 @@ export const Button = (buttonProps) => {
|
|
|
43
44
|
// MARK: - All
|
|
44
45
|
[`${prefixCls}`]: {
|
|
45
46
|
['> *']: {
|
|
46
|
-
verticalAlign:
|
|
47
|
+
verticalAlign: customTokens.others.verticalAlignMiddle
|
|
48
|
+
},
|
|
49
|
+
['> span']: {
|
|
50
|
+
alignSelf: `${customTokens.layout.flexCenter} !important`
|
|
47
51
|
}
|
|
48
52
|
},
|
|
49
53
|
// END: All
|
|
@@ -52,10 +56,10 @@ export const Button = (buttonProps) => {
|
|
|
52
56
|
[`&:not(:disabled)${prefixCls}-sm`]: {
|
|
53
57
|
backgroundColor: buttonToken.defaultBgSm,
|
|
54
58
|
color: buttonToken.colorText,
|
|
55
|
-
borderColor:
|
|
59
|
+
borderColor: customTokens.others.colorTransparent,
|
|
56
60
|
'&:hover': {
|
|
57
61
|
backgroundColor: buttonToken.defaultBgSmHover,
|
|
58
|
-
borderColor:
|
|
62
|
+
borderColor: customTokens.others.colorTransparent,
|
|
59
63
|
color: buttonToken.colorTextHover
|
|
60
64
|
},
|
|
61
65
|
[`&${prefixCls}-dangerous`]: {
|
|
@@ -64,6 +68,9 @@ export const Button = (buttonProps) => {
|
|
|
64
68
|
color: buttonToken.colorErrorSMHover,
|
|
65
69
|
backgroundColor: buttonToken.colorErrorBgSMHover
|
|
66
70
|
}
|
|
71
|
+
},
|
|
72
|
+
['span']: {
|
|
73
|
+
lineHeight: 'normal !important'
|
|
67
74
|
}
|
|
68
75
|
}
|
|
69
76
|
},
|
|
@@ -82,15 +89,15 @@ export const Button = (buttonProps) => {
|
|
|
82
89
|
// MARK: Icon
|
|
83
90
|
[`${prefixCls}-icon`]: {
|
|
84
91
|
['> *']: {
|
|
85
|
-
backgroundColor:
|
|
92
|
+
backgroundColor: customTokens.others.colorTransparent,
|
|
86
93
|
// Since this button is transparent, we are using success bg color for the icon.
|
|
87
94
|
color: (_j = buttonToken.colorSuccessBg) !== null && _j !== void 0 ? _j : token.colorSuccessBg,
|
|
88
|
-
verticalAlign:
|
|
95
|
+
verticalAlign: customTokens.others.verticalAlignMiddle,
|
|
89
96
|
'&:hover:not(:disabled)': {
|
|
90
97
|
color: (_k = buttonToken.colorSuccessBg) !== null && _k !== void 0 ? _k : token.colorSuccessBg
|
|
91
98
|
},
|
|
92
99
|
'&:active': {
|
|
93
|
-
boxShadow:
|
|
100
|
+
boxShadow: customTokens.layout.displayNone
|
|
94
101
|
}
|
|
95
102
|
},
|
|
96
103
|
'&:disabled': {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/ui-button",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A basic button react component.",
|
|
6
6
|
"type": "module",
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"antd": "5.22.6",
|
|
14
|
-
"@akinon/
|
|
15
|
-
"@akinon/
|
|
16
|
-
"@akinon/ui-
|
|
14
|
+
"@akinon/ui-theme": "1.0.1",
|
|
15
|
+
"@akinon/icons": "1.0.1",
|
|
16
|
+
"@akinon/ui-tooltip": "1.1.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"clean-package": "2.2.0",
|
|
20
20
|
"copyfiles": "^2.4.1",
|
|
21
21
|
"rimraf": "^5.0.5",
|
|
22
22
|
"typescript": "*",
|
|
23
|
-
"@akinon/typescript-config": "1.0.
|
|
23
|
+
"@akinon/typescript-config": "1.0.1"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": ">=18",
|