@digitalc/dxp-ui 0.0.5-alpha.1 → 0.0.5-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/assets/token.json +1 -1
- package/es/components/Amount/designTokens.d.ts +6 -0
- package/es/components/Amount/designTokens.js +10 -0
- package/es/components/Amount/designTokens.js.map +1 -0
- package/es/components/Amount/index.js +16 -20
- package/es/components/Amount/index.js.map +1 -1
- package/es/components/Amount/style/index.less +4 -4
- package/es/components/Button/index.d.ts +2 -2
- package/es/components/Button/index.js +1 -1
- package/es/components/Button/index.js.map +1 -1
- package/es/components/Chip/index.js +2 -15
- package/es/components/Chip/index.js.map +1 -1
- package/es/components/Chip/style/index.less +3 -1
- package/es/components/Divider/style/index.less +8 -7
- package/es/components/IconButton/designTokens.d.ts +21 -0
- package/es/components/IconButton/designTokens.js +40 -0
- package/es/components/IconButton/designTokens.js.map +1 -0
- package/es/components/IconButton/index.d.ts +23 -0
- package/es/components/IconButton/index.js +107 -0
- package/es/components/IconButton/index.js.map +1 -0
- package/es/components/IconButton/style/index.less +59 -0
- package/es/components/IconButton/style/variables.less +5 -0
- package/es/components/IconButtonGroup/index.d.ts +15 -0
- package/es/components/IconButtonGroup/index.js +23 -0
- package/es/components/IconButtonGroup/index.js.map +1 -0
- package/es/components/Input/designTokens.d.ts +26 -0
- package/es/components/Input/designTokens.js +35 -0
- package/es/components/Input/designTokens.js.map +1 -0
- package/es/components/Input/index.d.ts +10 -0
- package/es/components/Input/index.js +84 -0
- package/es/components/Input/index.js.map +1 -0
- package/es/components/Input/style/index.less +13 -0
- package/es/components/Input/style/variables.less +5 -0
- package/es/components/Modal/designTokens.d.ts +3 -12
- package/es/components/Modal/designTokens.js +6 -18
- package/es/components/Modal/designTokens.js.map +1 -1
- package/es/components/Modal/index.js.map +1 -1
- package/es/components/Modal/style/index.less +39 -19
- package/es/components/Stepper/designTokens.d.ts +16 -0
- package/es/components/Stepper/designTokens.js +52 -0
- package/es/components/Stepper/designTokens.js.map +1 -0
- package/es/components/Stepper/index.d.ts +15 -0
- package/es/components/Stepper/index.js +89 -0
- package/es/components/Stepper/index.js.map +1 -0
- package/es/components/Stepper/style/index.less +67 -0
- package/es/components/Stepper/style/variables.less +5 -0
- package/es/components/StickyFooter/designTokens.d.ts +10 -0
- package/es/components/StickyFooter/designTokens.js +18 -0
- package/es/components/StickyFooter/designTokens.js.map +1 -0
- package/es/components/StickyFooter/index.d.ts +13 -0
- package/es/components/StickyFooter/index.js +71 -0
- package/es/components/StickyFooter/index.js.map +1 -0
- package/es/components/StickyFooter/style/index.less +18 -0
- package/es/components/StickyFooter/style/variables.less +4 -0
- package/es/components/Tabs/style/index.less +5 -4
- package/es/components/Tag/designTokens.d.ts +92 -0
- package/es/components/Tag/designTokens.js +128 -0
- package/es/components/Tag/designTokens.js.map +1 -0
- package/es/components/Tag/index.d.ts +15 -0
- package/es/components/Tag/index.js +86 -0
- package/es/components/Tag/index.js.map +1 -0
- package/es/components/Tag/style/index.less +9 -0
- package/es/components/Tag/style/variables.less +4 -0
- package/es/components/Text/designTokens.d.ts +6 -0
- package/es/components/Text/designTokens.js +10 -0
- package/es/components/Text/designTokens.js.map +1 -0
- package/es/components/Text/index.d.ts +4 -9
- package/es/components/Text/index.js +23 -42
- package/es/components/Text/index.js.map +1 -1
- package/es/components/Text/style/index.less +225 -117
- package/es/components/Toast/designTokens.js.map +1 -1
- package/es/components/Toast/index.js +4 -18
- package/es/components/Toast/index.js.map +1 -1
- package/es/components/index.d.ts +11 -0
- package/es/components/index.js +6 -3
- package/es/components/index.js.map +1 -1
- package/es/utils/scaleTool.d.ts +12 -0
- package/es/utils/scaleTool.js +49 -0
- package/es/utils/scaleTool.js.map +1 -0
- package/es/utils/theme.d.ts +11 -0
- package/es/utils/theme.js +16 -0
- package/es/utils/theme.js.map +1 -0
- package/es/utils/tokenManager.d.ts +2 -0
- package/es/utils/tokenManager.js +332 -331
- package/es/utils/tokenManager.js.map +1 -1
- package/lib/assets/token.json +1 -1
- package/lib/components/Amount/designTokens.d.ts +6 -0
- package/lib/components/Amount/designTokens.js +34 -0
- package/lib/components/Amount/designTokens.js.map +7 -0
- package/lib/components/Amount/index.js +17 -15
- package/lib/components/Amount/index.js.map +3 -3
- package/lib/components/Amount/style/index.less +4 -4
- package/lib/components/Button/index.d.ts +2 -2
- package/lib/components/Button/index.js +1 -1
- package/lib/components/Button/index.js.map +2 -2
- package/lib/components/Chip/index.js +2 -8
- package/lib/components/Chip/index.js.map +2 -2
- package/lib/components/Chip/style/index.less +3 -1
- package/lib/components/Divider/style/index.less +8 -7
- package/lib/components/IconButton/designTokens.d.ts +21 -0
- package/lib/components/IconButton/designTokens.js +62 -0
- package/lib/components/IconButton/designTokens.js.map +7 -0
- package/lib/components/IconButton/index.d.ts +23 -0
- package/lib/components/IconButton/index.js +203 -0
- package/lib/components/IconButton/index.js.map +7 -0
- package/lib/components/IconButton/style/index.less +59 -0
- package/lib/components/IconButton/style/variables.less +5 -0
- package/lib/components/IconButtonGroup/index.d.ts +15 -0
- package/lib/components/IconButtonGroup/index.js +54 -0
- package/lib/components/IconButtonGroup/index.js.map +7 -0
- package/lib/components/Input/designTokens.d.ts +26 -0
- package/lib/components/Input/designTokens.js +76 -0
- package/lib/components/Input/designTokens.js.map +7 -0
- package/lib/components/Input/index.d.ts +10 -0
- package/lib/components/Input/index.js +132 -0
- package/lib/components/Input/index.js.map +7 -0
- package/lib/components/Input/style/index.less +13 -0
- package/lib/components/Input/style/variables.less +5 -0
- package/lib/components/Modal/designTokens.d.ts +3 -12
- package/lib/components/Modal/designTokens.js +12 -12
- package/lib/components/Modal/designTokens.js.map +2 -2
- package/lib/components/Modal/index.js.map +1 -1
- package/lib/components/Modal/style/index.less +39 -19
- package/lib/components/Stepper/designTokens.d.ts +16 -0
- package/lib/components/Stepper/designTokens.js +78 -0
- package/lib/components/Stepper/designTokens.js.map +7 -0
- package/lib/components/Stepper/index.d.ts +15 -0
- package/lib/components/Stepper/index.js +111 -0
- package/lib/components/Stepper/index.js.map +7 -0
- package/lib/components/Stepper/style/index.less +67 -0
- package/lib/components/Stepper/style/variables.less +5 -0
- package/lib/components/StickyFooter/designTokens.d.ts +10 -0
- package/lib/components/StickyFooter/designTokens.js +42 -0
- package/lib/components/StickyFooter/designTokens.js.map +7 -0
- package/lib/components/StickyFooter/index.d.ts +13 -0
- package/lib/components/StickyFooter/index.js +133 -0
- package/lib/components/StickyFooter/index.js.map +7 -0
- package/lib/components/StickyFooter/style/index.less +18 -0
- package/lib/components/StickyFooter/style/variables.less +4 -0
- package/lib/components/Tabs/style/index.less +5 -4
- package/lib/components/Tag/designTokens.d.ts +92 -0
- package/lib/components/Tag/designTokens.js +184 -0
- package/lib/components/Tag/designTokens.js.map +7 -0
- package/lib/components/Tag/index.d.ts +15 -0
- package/lib/components/Tag/index.js +147 -0
- package/lib/components/Tag/index.js.map +7 -0
- package/lib/components/Tag/style/index.less +9 -0
- package/lib/components/Tag/style/variables.less +4 -0
- package/lib/components/Text/designTokens.d.ts +6 -0
- package/lib/components/Text/designTokens.js +34 -0
- package/lib/components/Text/designTokens.js.map +7 -0
- package/lib/components/Text/index.d.ts +4 -9
- package/lib/components/Text/index.js +33 -37
- package/lib/components/Text/index.js.map +2 -2
- package/lib/components/Text/style/index.less +225 -117
- package/lib/components/Toast/designTokens.js.map +2 -2
- package/lib/components/Toast/index.js +19 -25
- package/lib/components/Toast/index.js.map +2 -2
- package/lib/components/index.d.ts +11 -0
- package/lib/components/index.js +12 -0
- package/lib/components/index.js.map +2 -2
- package/lib/utils/scaleTool.d.ts +12 -0
- package/lib/utils/scaleTool.js +67 -0
- package/lib/utils/scaleTool.js.map +7 -0
- package/lib/utils/theme.d.ts +11 -0
- package/lib/utils/theme.js +33 -0
- package/lib/utils/theme.js.map +7 -0
- package/lib/utils/tokenManager.d.ts +2 -0
- package/lib/utils/tokenManager.js +330 -329
- package/lib/utils/tokenManager.js.map +2 -2
- package/package.json +1 -1
- package/es/components/Button/index_backup.d.ts +0 -72
- package/es/components/Button/index_backup.js +0 -114
- package/es/components/Button/index_backup.js.map +0 -1
- package/es/components/Modal/index_backup.d.ts +0 -72
- package/es/components/Modal/index_backup.js +0 -114
- package/es/components/Modal/index_backup.js.map +0 -1
- package/lib/components/Button/index_backup.d.ts +0 -72
- package/lib/components/Button/index_backup.js +0 -176
- package/lib/components/Button/index_backup.js.map +0 -7
- package/lib/components/Modal/index_backup.d.ts +0 -72
- package/lib/components/Modal/index_backup.js +0 -176
- package/lib/components/Modal/index_backup.js.map +0 -7
package/es/assets/token.json
CHANGED
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"colorRibbonSecondary2": "#E8F6FF",
|
|
100
100
|
"colorRibbonSecondaryDark": "#1482CC",
|
|
101
101
|
"colorTagPrimary": "#D01660",
|
|
102
|
-
"colorTagSecondary": "#
|
|
102
|
+
"colorTagSecondary": "#1700E8",
|
|
103
103
|
"colorTextAlert": "#bc1430",
|
|
104
104
|
"colorTextCoachmark": "#ffffff",
|
|
105
105
|
"colorTextCta": "#4D28E8",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getToken } from "../../utils/tokenHelper";
|
|
2
|
+
var designTokens = {
|
|
3
|
+
colorCardTextTitle: getToken('colorCardTextTitle'),
|
|
4
|
+
// title颜色
|
|
5
|
+
colorCardTextPriceStrikethrough: getToken('colorCardTextPriceStrikethrough'),
|
|
6
|
+
// 划线价颜色
|
|
7
|
+
colorCardTextPrice: getToken('colorCardTextPrice') // 金额颜色
|
|
8
|
+
};
|
|
9
|
+
export { designTokens };
|
|
10
|
+
//# sourceMappingURL=designTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getToken","designTokens","colorCardTextTitle","colorCardTextPriceStrikethrough","colorCardTextPrice"],"sources":["../../../src/components/Amount/designTokens.ts"],"sourcesContent":["import { getToken } from '@/utils/tokenHelper';\n\nconst designTokens = {\n colorCardTextTitle: getToken('colorCardTextTitle'), // title颜色\n colorCardTextPriceStrikethrough: getToken('colorCardTextPriceStrikethrough'), // 划线价颜色\n colorCardTextPrice: getToken('colorCardTextPrice'), // 金额颜色\n};\n\nexport { designTokens };\n"],"mappings":"AAAA,SAASA,QAAQ;AAEjB,IAAMC,YAAY,GAAG;EACnBC,kBAAkB,EAAEF,QAAQ,CAAC,oBAAoB,CAAC;EAAE;EACpDG,+BAA+B,EAAEH,QAAQ,CAAC,iCAAiC,CAAC;EAAE;EAC9EI,kBAAkB,EAAEJ,QAAQ,CAAC,oBAAoB,CAAC,CAAE;AACtD,CAAC;AAED,SAASC,YAAY"}
|
|
@@ -5,13 +5,12 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
var _excluded = ["children", "className", "size", "title", "position", "prefixCls", "priceStrikethrough", "style"];
|
|
8
|
+
var _excluded = ["children", "className", "size", "title", "position", "prefixCls", "priceStrikethrough", "style", "priceColor", "textColor", "colorStrikethrough"];
|
|
9
9
|
import React, { PureComponent } from 'react';
|
|
10
|
-
import { DownOutlined } from '@ant-design/icons';
|
|
11
10
|
import { default as classNames } from 'classnames';
|
|
12
|
-
import
|
|
11
|
+
import { designTokens } from "./designTokens";
|
|
13
12
|
import { cssClasses } from "../../constants";
|
|
14
|
-
import { Text } from "../index";
|
|
13
|
+
import { Text, Icon } from "../index";
|
|
15
14
|
import "./style/index.less";
|
|
16
15
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
16
|
var Amount = /*#__PURE__*/function (_PureComponent) {
|
|
@@ -33,15 +32,13 @@ var Amount = /*#__PURE__*/function (_PureComponent) {
|
|
|
33
32
|
prefixCls = _this$props.prefixCls,
|
|
34
33
|
priceStrikethrough = _this$props.priceStrikethrough,
|
|
35
34
|
style = _this$props.style,
|
|
35
|
+
priceColor = _this$props.priceColor,
|
|
36
|
+
textColor = _this$props.textColor,
|
|
37
|
+
colorStrikethrough = _this$props.colorStrikethrough,
|
|
36
38
|
attr = _objectWithoutProperties(_this$props, _excluded);
|
|
37
|
-
var colorCardTextPrice =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var colorCardTextPriceStrikethrough = TokenManager.tokenKey('colorCardTextPriceStrikethrough');
|
|
41
|
-
var colorValue = undefined;
|
|
42
|
-
if (typeof colorIconNeutral === 'string') {
|
|
43
|
-
colorValue = colorIconNeutral;
|
|
44
|
-
}
|
|
39
|
+
var colorCardTextPrice = designTokens.colorCardTextPrice,
|
|
40
|
+
colorCardTextPriceStrikethrough = designTokens.colorCardTextPriceStrikethrough,
|
|
41
|
+
colorCardTextTitle = designTokens.colorCardTextTitle;
|
|
45
42
|
var baseProps = {
|
|
46
43
|
className: classNames(prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-size-").concat(size), size), "".concat(prefixCls, "-position-").concat(position), position), className),
|
|
47
44
|
style: style
|
|
@@ -65,18 +62,17 @@ var Amount = /*#__PURE__*/function (_PureComponent) {
|
|
|
65
62
|
children: title === 'discount' ? /*#__PURE__*/_jsx(Text, {
|
|
66
63
|
size: "smallBodyBold",
|
|
67
64
|
style: {
|
|
68
|
-
color: '#D01660'
|
|
65
|
+
color: textColor || '#D01660'
|
|
69
66
|
},
|
|
70
67
|
children: "Discount"
|
|
71
68
|
}) : /*#__PURE__*/_jsxs(Text, {
|
|
72
69
|
size: "smallbodyRegular",
|
|
73
70
|
style: {
|
|
74
|
-
color:
|
|
71
|
+
color: textColor || colorCardTextTitle
|
|
75
72
|
},
|
|
76
|
-
children: [title, /*#__PURE__*/_jsx(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
73
|
+
children: [title, /*#__PURE__*/_jsx(Icon, {
|
|
74
|
+
size: 12,
|
|
75
|
+
name: "icon-a-Arrow-Down"
|
|
80
76
|
})]
|
|
81
77
|
})
|
|
82
78
|
});
|
|
@@ -85,7 +81,7 @@ var Amount = /*#__PURE__*/function (_PureComponent) {
|
|
|
85
81
|
return /*#__PURE__*/_jsx(Text, {
|
|
86
82
|
size: getSize(size),
|
|
87
83
|
style: {
|
|
88
|
-
color:
|
|
84
|
+
color: priceColor || colorCardTextPrice
|
|
89
85
|
},
|
|
90
86
|
children: children
|
|
91
87
|
});
|
|
@@ -94,7 +90,7 @@ var Amount = /*#__PURE__*/function (_PureComponent) {
|
|
|
94
90
|
return /*#__PURE__*/_jsx(Text, {
|
|
95
91
|
size: "smallBodyStrikethrough",
|
|
96
92
|
style: {
|
|
97
|
-
color: colorCardTextPriceStrikethrough
|
|
93
|
+
color: colorStrikethrough || colorCardTextPriceStrikethrough
|
|
98
94
|
},
|
|
99
95
|
children: priceStrikethrough
|
|
100
96
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","
|
|
1
|
+
{"version":3,"names":["React","PureComponent","default","classNames","designTokens","cssClasses","Text","Icon","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Amount","_PureComponent","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","render","_this$props","props","children","className","size","title","position","prefixCls","priceStrikethrough","style","priceColor","textColor","colorStrikethrough","attr","_objectWithoutProperties","_excluded","colorCardTextPrice","colorCardTextPriceStrikethrough","colorCardTextTitle","baseProps","_defineProperty","concat","getSize","fontSize","TitleDom","color","name","PriceDom","PriceStrikethroughDom","positionLeft","positionRight","positionUp","positionDown","_objectSpread","onClick","onMouseDown","PREFIX"],"sources":["../../../src/components/Amount/index.tsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { default as classNames } from 'classnames';\nimport { designTokens } from './designTokens';\nimport { cssClasses } from '../../constants';\nimport { Text, Icon } from '../index';\nimport './style/index.less';\n\nexport type Size = '12' | '16' | '20' | '24';\nexport type Position = 'up' | 'right' | 'down' | 'left';\n\nexport interface AmountProps{\n children?: React.ReactNode;\n className?: string;\n size?: Size;\n position?: Position;\n style?: React.CSSProperties;\n onClick?: React.MouseEventHandler;\n [key: string]: any;\n}\n\nexport default class Amount extends PureComponent<AmountProps> {\n static defaultProps = {\n size: '20',\n title: 'Total',\n position: 'down',\n prefixCls: cssClasses.PREFIX + '-amount',\n };\n\n render() {\n const {\n children,\n className,\n size,\n title,\n position,\n prefixCls,\n priceStrikethrough,\n style,\n priceColor,\n textColor,\n colorStrikethrough,\n ...attr\n } = this.props;\n\n\n const {\n colorCardTextPrice,\n colorCardTextPriceStrikethrough,\n colorCardTextTitle,\n } = designTokens;\n\n const baseProps = {\n className: classNames(\n prefixCls,\n {\n // 映射secondary为default,tertiary为dashed\n [`${prefixCls}-size-${size}`]: size,\n [`${prefixCls}-position-${position}`]: position,\n },\n className,\n ),\n style,\n };\n\n const getSize = (fontSize: string | undefined) => {\n switch (fontSize) {\n case '12':\n return 'smallbodyRegular';\n case '16':\n return 'bodyBold';\n case '20':\n return 'header';\n case '24':\n return 'sectionTitle';\n default:\n return 'smallbodyRegular';\n }\n }\n\n const TitleDom = () => (\n <>\n {title === 'discount' ? (\n <Text size=\"smallBodyBold\" style={{ color: textColor || '#D01660' }}>\n Discount\n </Text>\n ) : (\n <Text size=\"smallbodyRegular\" style={{ color: textColor || colorCardTextTitle}}>\n {title}\n <Icon size={12} name=\"icon-a-Arrow-Down\" />\n </Text>\n )}\n </>\n )\n\n const PriceDom = () => (\n <Text size={getSize(size)} style={{ color: priceColor || colorCardTextPrice}}>\n {children}\n </Text>\n )\n\n const PriceStrikethroughDom = () => (\n <Text size=\"smallBodyStrikethrough\" style={{ color: colorStrikethrough || colorCardTextPriceStrikethrough}}>\n {priceStrikethrough}\n </Text>\n )\n\n const positionLeft = () => (\n <>\n <TitleDom />\n <div>\n <PriceStrikethroughDom />\n <PriceDom />\n </div>\n </>\n )\n\n const positionRight = () => (\n <>\n <TitleDom />\n <div>\n <PriceDom />\n <PriceStrikethroughDom />\n </div>\n </>\n )\n\n const positionUp = () => (\n <>\n <TitleDom />\n <PriceStrikethroughDom />\n <PriceDom />\n </>\n )\n\n const positionDown = () => (\n <>\n <TitleDom />\n <PriceDom />\n <PriceStrikethroughDom />\n </>\n )\n\n return (\n <span\n onClick={this.props.onClick} \n {...baseProps}\n onMouseDown={this.props.onMouseDown}\n {...attr}\n >\n {position === 'left' && positionLeft()}\n {position === 'right' && positionRight()}\n {position === 'up' && positionUp()}\n {position === 'down' && positionDown()}\n </span>\n );\n }\n}\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,OAAO,IAAIC,UAAU,QAAQ,YAAY;AAClD,SAASC,YAAY;AACrB,SAASC,UAAU;AACnB,SAASC,IAAI,EAAEC,IAAI;AACnB;AAA4B,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAAA,IAePC,MAAM,0BAAAC,cAAA;EAAAC,SAAA,CAAAF,MAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,MAAA;EAAA,SAAAA,OAAA;IAAAK,eAAA,OAAAL,MAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,MAAA;IAAAS,GAAA;IAAAC,KAAA,EAQzB,SAAAC,OAAA,EAAS;MACP,IAAAC,WAAA,GAaI,IAAI,CAACC,KAAK;QAZZC,QAAQ,GAAAF,WAAA,CAARE,QAAQ;QACRC,SAAS,GAAAH,WAAA,CAATG,SAAS;QACTC,IAAI,GAAAJ,WAAA,CAAJI,IAAI;QACJC,KAAK,GAAAL,WAAA,CAALK,KAAK;QACLC,QAAQ,GAAAN,WAAA,CAARM,QAAQ;QACRC,SAAS,GAAAP,WAAA,CAATO,SAAS;QACTC,kBAAkB,GAAAR,WAAA,CAAlBQ,kBAAkB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AAM,IAAAZ,OAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
|
+
import type { TextProps } from "../Text";
|
|
2
3
|
import { noop } from '../../utils/noop';
|
|
3
4
|
import './style/index.less';
|
|
4
5
|
export type HtmlType = 'button' | 'reset' | 'submit';
|
|
5
6
|
export type Size = 'middle' | 'small' | 'large';
|
|
6
7
|
export type ButtonType = 'primary' | 'default' | 'dashed' | 'link' | 'text';
|
|
7
8
|
export type ButtonColorType = 'default' | 'primary' | 'danger' | 'blue' | 'purple' | 'cyan' | 'green' | 'magenta' | 'pink' | 'red' | 'orange' | 'yellow' | 'volcano' | 'geekblue' | 'lime' | 'gold';
|
|
8
|
-
export type fontSize = 'bannerTitle' | 'pageTitle' | 'sectionTitle' | 'header' | 'bodyBold' | 'bodyRegular' | 'bodyStrikethrough' | 'smallbodyRegular' | 'smallBodyStrikethrough' | 'smallBodySemiBold' | 'smallBodyBold' | 'smallBodyLink' | 'textLink' | 'mediumBody' | 'mediumBodyBold';
|
|
9
9
|
export interface xDXpProps {
|
|
10
10
|
'x-dxp-prop'?: string;
|
|
11
11
|
}
|
|
@@ -16,7 +16,7 @@ export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonE
|
|
|
16
16
|
loading?: boolean;
|
|
17
17
|
htmlType?: HtmlType;
|
|
18
18
|
size?: Size;
|
|
19
|
-
fontSize?:
|
|
19
|
+
fontSize?: TextProps['size'];
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
block?: boolean;
|
|
22
22
|
style?: React.CSSProperties;
|
|
@@ -11,9 +11,9 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
11
11
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
12
12
|
var _excluded = ["fontSize", "theme", "inverse"];
|
|
13
13
|
import React, { PureComponent } from 'react';
|
|
14
|
+
import Text from "../Text";
|
|
14
15
|
import { cssClasses } from "../../constants";
|
|
15
16
|
import { noop } from "../../utils/noop";
|
|
16
|
-
import Text from "../Text";
|
|
17
17
|
import { designTokens, inverseDesignTokens } from "./designTokens";
|
|
18
18
|
|
|
19
19
|
// 这种是另一方 定制 antd 的 style 的方式; 现在使用了上面的 designTokens.ts 的方式。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","
|
|
1
|
+
{"version":3,"names":["React","PureComponent","Text","cssClasses","noop","designTokens","inverseDesignTokens","jsx","_jsx","Fragment","_Fragment","Button","_PureComponent","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","render","_this$props","props","children","inverse","fontSize","_this$props2","_","__","theme","___","filteredProps","_objectWithoutProperties","_excluded","_ConfigProvider","wave","disabled","prefixCls","PREFIX","components","_objectSpread","cssVar","hashed","_Button","size","_defineProperty","type","htmlType","onMouseDown","onClick","onMouseEnter","onMouseLeave","default"],"sources":["../../../src/components/Button/index.tsx"],"sourcesContent":["import { Button as AntdBtn, ConfigProvider } from 'antd';\nimport React, { PureComponent } from 'react';\nimport Text from '@/components/Text';\nimport type { TextProps } from '@/components/Text';\n\nimport { cssClasses } from '../../constants';\nimport { noop } from '../../utils/noop';\nimport { designTokens, inverseDesignTokens } from './designTokens';\n\n// 这种是另一方 定制 antd 的 style 的方式; 现在使用了上面的 designTokens.ts 的方式。\nimport './style/index.less';\n\n// const { htmlTypes, btnTypes, sizes } = strings;\n\nexport type HtmlType = 'button' | 'reset' | 'submit';\nexport type Size = 'middle' | 'small' | 'large';\n// export type Theme = 'solid' | 'borderless' | 'light' | 'outline';\nexport type ButtonType = 'primary' | 'default' | 'dashed' | 'link' | 'text';\nexport type ButtonColorType = 'default' | 'primary' | 'danger' | 'blue' | 'purple' | 'cyan' | 'green' | 'magenta' | 'pink' | 'red' | 'orange' | 'yellow' | 'volcano' | 'geekblue' | 'lime' | 'gold';\n\nexport interface xDXpProps {\n 'x-dxp-prop'?: string;\n // 其他可能的属性\n}\nexport interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'color'> {\n type?: ButtonType;\n color?: ButtonColorType;\n inverse?: boolean;\n loading?: boolean;\n htmlType?: HtmlType;\n size?: Size;\n fontSize?: TextProps['size'];\n disabled?: boolean;\n block?: boolean;\n style?: React.CSSProperties;\n theme?: string;\n prefixCls?: string;\n 'aria-label'?: React.AriaAttributes['aria-label'];\n contentClassName?: string;\n [key: string]: any;\n}\n\nexport default class Button extends PureComponent<ButtonProps> {\n static defaultProps = {\n disabled: false,\n size: 'large',\n fontSize: 'bodyBold',\n type: 'default',\n theme: 'light',\n htmlType: 'button',\n onMouseDown: noop,\n onClick: noop,\n onMouseEnter: noop,\n onMouseLeave: noop,\n prefixCls: cssClasses.PREFIX + '-button',\n };\n\n render() {\n const { children, inverse, fontSize } = this.props;\n\n // Filter out fontSize from props to avoid passing it to AntdBtn\n // const { fontSize: _, ...filteredProps } = this.props;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { fontSize: _, theme: __, inverse: ___, ...filteredProps } = this.props;\n return (\n <>\n <ConfigProvider\n wave={{ disabled: true }}\n prefixCls={cssClasses.PREFIX}\n theme={{\n // 这个外层的 Seed Token,影响范围大。\n // token: designTokens,\n components: {\n Button: {\n ...(inverse ? inverseDesignTokens : designTokens),\n },\n },\n cssVar: true,\n hashed: false,\n }}\n >\n <AntdBtn {...filteredProps}>\n <Text size={fontSize}>{children}</Text>\n </AntdBtn>\n </ConfigProvider>\n </>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,OAAOC,IAAI;AAGX,SAASC,UAAU;AACnB,SAASC,IAAI;AACb,SAASC,YAAY,EAAEC,mBAAmB;;AAE1C;AACA;;AAEA;;AAIA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAAA,IA0BqBC,MAAM,0BAAAC,cAAA;EAAAC,SAAA,CAAAF,MAAA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C;EAAA,OAAAd,MAAA;AAAA,EA7CiCV,aAAa;AAAA8C,eAAA,CAA5BpC,MAAM,kBACH;EACpB2B,QAAQ,EAAE,KAAK;EACfQ,IAAI,EAAE,OAAO;EACbnB,QAAQ,EAAE,UAAU;EACpBqB,IAAI,EAAE,SAAS;EACfjB,KAAK,EAAE,OAAO;EACdkB,QAAQ,EAAE,QAAQ;EAClBC,WAAW,EAAE9C,IAAI;EACjB+C,OAAO,EAAE/C,IAAI;EACbgD,YAAY,EAAEhD,IAAI;EAClBiD,YAAY,EAAEjD,IAAI;EAClBmC,SAAS,EAAEpC,UAAU,CAACqC,MAAM,GAAG;AACjC,CAAC;AAAA,SAbkB7B,MAAM,IAAA2C,OAAA"}
|
|
@@ -6,26 +6,13 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
6
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
7
|
var _excluded = ["types", "children", "prefixCls", "checked", "onChange", "style"];
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import {
|
|
9
|
+
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
10
|
+
import { theme } from "../../utils/theme";
|
|
10
11
|
import { designTokens } from "./designTokens";
|
|
11
12
|
import { BASE_CLASS_PREFIX } from "../../constants";
|
|
12
13
|
import Text from "../Text";
|
|
13
14
|
import "./style/index.less";
|
|
14
|
-
|
|
15
|
-
// 定义设计令牌类型
|
|
16
|
-
|
|
17
|
-
// 定义派生令牌类型
|
|
18
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
// 定义派生函数
|
|
20
|
-
var derivativeFunc = function derivativeFunc(token) {
|
|
21
|
-
return {
|
|
22
|
-
buttonColor: token.primaryColor,
|
|
23
|
-
buttonFontSize: token.fontSize * 1.2
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// 创建主题
|
|
28
|
-
var theme = new Theme(derivativeFunc);
|
|
29
16
|
var Chip = function Chip(props) {
|
|
30
17
|
var _props$types = props.types,
|
|
31
18
|
types = _props$types === void 0 ? 'textOnly' : _props$types,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","useStyleRegister","theme","designTokens","BASE_CLASS_PREFIX","Text","jsx","_jsx","Chip","props","_props$types","types","children","_props$prefixCls","prefixCls","checked","_props$onChange","onChange","style","attr","_objectWithoutProperties","_excluded","borderRadiusChip","colorChipBackgroundStandard","colorChipBorderStandard","borderWidthChip","spacingChipPaddingHorizontal","spacingChipPaddingVertical","colorChipBackgroundHover","colorChipTextInactive","colorChipBackgroundActive","colorChipBorderActive","colorChipTextActive","sizingChipIconClose","useCustomButtonStyle","hashId","token","baseColor","path","concat","_ConfigProvider","components","Tag","borderRadiusSM","defaultBg","colorBorder","lineWidth","colorText","marginXS","fontSizeIcon","className","onClick","size","_Tag","_objectSpread","padding"],"sources":["../../../src/components/Chip/index.tsx"],"sourcesContent":["import React from 'react';\nimport { ConfigProvider, Tag as AntdTag } from 'antd';\nimport { useStyleRegister } from '@ant-design/cssinjs';\nimport { theme } from '../../utils/theme';\nimport { designTokens } from './designTokens';\nimport { BASE_CLASS_PREFIX } from '../../constants';\nimport Text from '../Text';\nimport './style/index.less';\n\nexport interface ChipProps {\n prefixCls?: string;\n children?: React.ReactNode;\n types?: 'textOnly' | 'removable';\n style?: React.CSSProperties;\n [key: string]: any;\n}\nconst Chip = (props: ChipProps) => {\n const {\n types = 'textOnly',\n children,\n prefixCls = 'tag',\n checked,\n onChange = () => {},\n style,\n ...attr\n } = props;\n\n const {\n borderRadiusChip,\n colorChipBackgroundStandard,\n colorChipBorderStandard,\n borderWidthChip,\n spacingChipPaddingHorizontal,\n spacingChipPaddingVertical,\n colorChipBackgroundHover,\n colorChipTextInactive,\n colorChipBackgroundActive,\n colorChipBorderActive,\n colorChipTextActive,\n sizingChipIconClose,\n // spacingChipTextLinkPaddingVertical,\n // spacingChipTextLinkPaddingHorizontal,\n } = designTokens;\n \n const useCustomButtonStyle = () => {\n const hashId = useStyleRegister({\n theme: theme,\n token: { baseColor: 'blue' },\n path: ['tag-textonly'],\n }, () => `\n .tag-textonly {\n color: ${colorChipTextInactive};\n border-color: ${colorChipBorderStandard};\n border-width: ${borderWidthChip}px;\n border-radius: ${borderRadiusChip}px;\n background-color: ${colorChipBackgroundStandard};\n padding: ${spacingChipPaddingVertical}px ${spacingChipPaddingHorizontal}px;\n }\n .tag-textonly:hover {\n background-color: ${colorChipBackgroundHover};\n }\n .tag-textonly:active {\n background-color: ${colorChipBackgroundHover};\n }\n .tag-active,\n .tag-active:hover,\n .tag-active:active {\n color: ${colorChipTextActive};\n border-color: ${colorChipBorderActive};\n background-color: ${colorChipBackgroundActive};\n }\n `);\n return hashId;\n };\n useCustomButtonStyle();\n \n return (\n <ConfigProvider\n prefixCls={BASE_CLASS_PREFIX}\n theme={{\n components: {\n Tag: {\n borderRadiusSM: borderRadiusChip,\n defaultBg: colorChipBackgroundActive,\n colorBorder: colorChipBorderActive,\n lineWidth: borderWidthChip,\n colorText: colorChipTextActive,\n marginXS: 16,\n fontSizeIcon: sizingChipIconClose,\n // spacingChipTextLinkPaddingVertical,\n // spacingChipTextLinkPaddingHorizontal,\n },\n },\n }}\n >\n {types === 'textOnly' ? (\n <span\n className={`${BASE_CLASS_PREFIX}-${prefixCls}-${types} tag-textonly ${checked ? 'tag-active' : ''}`}\n onClick={() => onChange()}\n style={style}\n >\n <Text size='bodyRegular' >{children}</Text>\n </span>\n ) : (\n <AntdTag\n {...attr}\n className={`${BASE_CLASS_PREFIX}-${prefixCls}-${types}`}\n style={{ padding: `${spacingChipPaddingVertical}px ${spacingChipPaddingHorizontal}px`, ...style }}\n >\n <Text size='bodyRegular'>{children}</Text>\n </AntdTag>\n )}\n </ConfigProvider>\n );\n};\n\nexport default Chip;"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,gBAAgB,QAAQ,q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,EAAE,SAAAA,QAAA;QAAA,OAAMlC,QAAQ,CAAC,CAAC;MAAA,CAAC;MAC1BC,KAAK,EAAEA,KAAM;MAAAN,QAAA,eAEbL,IAAA,CAACF,IAAI;QAAC+C,IAAI,EAAC,aAAa;QAAAxC,QAAA,EAAGA;MAAQ,CAAO;IAAC,CACvC,CAAC,gBAEPL,IAAA,CAAA8C,IAAA,EAAAC,aAAA,CAAAA,aAAA,KACMnC,IAAI;MACR+B,SAAS,KAAAX,MAAA,CAAKnC,iBAAiB,OAAAmC,MAAA,CAAIzB,SAAS,OAAAyB,MAAA,CAAI5B,KAAK,CAAG;MACxDO,KAAK,EAAAoC,aAAA;QAAIC,OAAO,KAAAhB,MAAA,CAAKZ,0BAA0B,SAAAY,MAAA,CAAMb,4BAA4B;MAAI,GAAKR,KAAK,CAAG;MAAAN,QAAA,eAElGL,IAAA,CAACF,IAAI;QAAC+C,IAAI,EAAC,aAAa;QAAAxC,QAAA,EAAEA;MAAQ,CAAO;IAAC,EACnC;EACV,CACa,CAAC;AAErB,CAAC;AAED,eAAeJ,IAAI"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
|
|
2
2
|
@import './variables.less';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
@components: divider;
|
|
5
|
+
.@{prefix}-@{components} {
|
|
5
6
|
width: 100%;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
.@{prefix}-@{components}-type-solid {
|
|
9
10
|
border-bottom: 1px solid #BFBFC7;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
.@{prefix}-@{components}-type-dashed {
|
|
13
14
|
border-bottom: 1px dashed #E6E6E6;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
.@{prefix}-@{components}-type-eight {
|
|
17
18
|
border-bottom: 8px solid #F5F5F8;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
.@{prefix}-@{components}-type-whiteBg {
|
|
20
21
|
position: relative;
|
|
21
22
|
padding-top: 8px;
|
|
22
23
|
overflow: hidden;
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
border-bottom: 2px dashed #EBEBEB;
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
.@{prefix}-@{components}-type-grayBg {
|
|
48
49
|
position: relative;
|
|
49
50
|
padding-top: 8px;
|
|
50
51
|
overflow: hidden;
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
border-bottom: 2px dashed #F2F2F2;
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
+
.@{prefix}-@{components}-type-vertical {
|
|
74
75
|
width: auto;
|
|
75
76
|
min-height: 12px;
|
|
76
77
|
border-left: 1px solid #BFBFC7;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const designTokens: {
|
|
2
|
+
colorIconButtonNeutral: any;
|
|
3
|
+
colorIconButtonInverse: any;
|
|
4
|
+
sizingIconButtonMedium: any;
|
|
5
|
+
sizingIconButtonSmall: any;
|
|
6
|
+
spacingIconButtonPaddingVertical: any;
|
|
7
|
+
spacingIconButtonPaddingVerticalSm: any;
|
|
8
|
+
spacingIconButtonPaddingHorizontal: any;
|
|
9
|
+
spacingIconButtonPaddingHorizontalSm: any;
|
|
10
|
+
spacingIconButtonHorizontalGap: any;
|
|
11
|
+
spacingIconButtonHorizontalGapSm: any;
|
|
12
|
+
colorIconButtonDisabled: any;
|
|
13
|
+
colorIconButtonHover: any;
|
|
14
|
+
colorIconButtonActive: any;
|
|
15
|
+
transitionIconButton: string;
|
|
16
|
+
};
|
|
17
|
+
declare const otherDesignTokens: {
|
|
18
|
+
[x: string]: string;
|
|
19
|
+
};
|
|
20
|
+
export { designTokens, otherDesignTokens, };
|
|
21
|
+
export default designTokens;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import { getToken } from "../../utils/tokenHelper";
|
|
3
|
+
import { cssClasses } from "../../constants";
|
|
4
|
+
var prefixCls = cssClasses.PREFIX + '-icon-button';
|
|
5
|
+
|
|
6
|
+
// 设计令牌定义
|
|
7
|
+
var designTokens = {
|
|
8
|
+
// 图标按钮颜色
|
|
9
|
+
colorIconButtonNeutral: getToken('colorIconButtonNeutral'),
|
|
10
|
+
colorIconButtonInverse: getToken('colorIconButtonInverse'),
|
|
11
|
+
// 反色
|
|
12
|
+
|
|
13
|
+
// 图标按钮尺寸
|
|
14
|
+
sizingIconButtonMedium: getToken('sizingIconButtonIconMedium'),
|
|
15
|
+
// Medium Icon: 24px x 24px
|
|
16
|
+
sizingIconButtonSmall: getToken('sizingIconButtonIconSmall'),
|
|
17
|
+
// Small Icon: 16px x 16px
|
|
18
|
+
|
|
19
|
+
// padding
|
|
20
|
+
spacingIconButtonPaddingVertical: getToken('spacingIconButtonPaddingVertical'),
|
|
21
|
+
// Medium
|
|
22
|
+
spacingIconButtonPaddingVerticalSm: getToken('spacingIconButtonPaddingVerticalSm'),
|
|
23
|
+
// Small
|
|
24
|
+
|
|
25
|
+
spacingIconButtonPaddingHorizontal: getToken('spacingIconButtonPaddingHorizontal'),
|
|
26
|
+
spacingIconButtonPaddingHorizontalSm: getToken('spacingIconButtonPaddingHorizontalSm'),
|
|
27
|
+
spacingIconButtonHorizontalGap: getToken('spacingIconButtonHorizontalGap'),
|
|
28
|
+
spacingIconButtonHorizontalGapSm: getToken('spacingIconButtonHorizontalGapSm'),
|
|
29
|
+
colorIconButtonDisabled: getToken('colorIconButtonDisabled'),
|
|
30
|
+
colorIconButtonHover: getToken('colorIconButtonHover'),
|
|
31
|
+
colorIconButtonActive: getToken('colorIconButtonActive'),
|
|
32
|
+
// 过渡动画
|
|
33
|
+
transitionIconButton: '0.3s'
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// 其他样式属性
|
|
37
|
+
var otherDesignTokens = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "--".concat(prefixCls, "-color"), "".concat(getToken('colorIconButtonNeutral'))), "--".concat(prefixCls, "-color-inverse"), "".concat(getToken('colorIconButtonInverse'))), "--".concat(prefixCls, "-color-disabled"), "".concat(getToken('colorIconButtonDisabled'))), "--".concat(prefixCls, "-transition"), "all ".concat(designTokens.transitionIconButton));
|
|
38
|
+
export { designTokens, otherDesignTokens };
|
|
39
|
+
export default designTokens;
|
|
40
|
+
//# sourceMappingURL=designTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getToken","cssClasses","prefixCls","PREFIX","designTokens","colorIconButtonNeutral","colorIconButtonInverse","sizingIconButtonMedium","sizingIconButtonSmall","spacingIconButtonPaddingVertical","spacingIconButtonPaddingVerticalSm","spacingIconButtonPaddingHorizontal","spacingIconButtonPaddingHorizontalSm","spacingIconButtonHorizontalGap","spacingIconButtonHorizontalGapSm","colorIconButtonDisabled","colorIconButtonHover","colorIconButtonActive","transitionIconButton","otherDesignTokens","_defineProperty","concat"],"sources":["../../../src/components/IconButton/designTokens.ts"],"sourcesContent":["import { getToken } from '@/utils/tokenHelper';\nimport { cssClasses } from '@/constants';\n\nconst prefixCls = cssClasses.PREFIX + '-icon-button';\n\n// 设计令牌定义\nconst designTokens = {\n // 图标按钮颜色\n colorIconButtonNeutral: getToken('colorIconButtonNeutral'),\n colorIconButtonInverse: getToken('colorIconButtonInverse'), // 反色\n\n // 图标按钮尺寸\n sizingIconButtonMedium: getToken('sizingIconButtonIconMedium'), // Medium Icon: 24px x 24px\n sizingIconButtonSmall: getToken('sizingIconButtonIconSmall'), // Small Icon: 16px x 16px\n\n // padding\n spacingIconButtonPaddingVertical: getToken('spacingIconButtonPaddingVertical'), // Medium\n spacingIconButtonPaddingVerticalSm: getToken('spacingIconButtonPaddingVerticalSm'), // Small\n\n spacingIconButtonPaddingHorizontal: getToken('spacingIconButtonPaddingHorizontal'),\n spacingIconButtonPaddingHorizontalSm: getToken('spacingIconButtonPaddingHorizontalSm'),\n\n spacingIconButtonHorizontalGap: getToken('spacingIconButtonHorizontalGap'),\n spacingIconButtonHorizontalGapSm: getToken('spacingIconButtonHorizontalGapSm'),\n\n colorIconButtonDisabled: getToken('colorIconButtonDisabled'),\n colorIconButtonHover: getToken('colorIconButtonHover'),\n colorIconButtonActive: getToken('colorIconButtonActive'),\n\n // 过渡动画\n transitionIconButton: '0.3s',\n};\n\n// 其他样式属性\nconst otherDesignTokens = {\n [`--${prefixCls}-color`]: `${getToken('colorIconButtonNeutral')}`,\n [`--${prefixCls}-color-inverse`]: `${getToken('colorIconButtonInverse')}`,\n [`--${prefixCls}-color-disabled`]: `${getToken('colorIconButtonDisabled')}`,\n [`--${prefixCls}-transition`]: `all ${designTokens.transitionIconButton}`,\n};\n\nexport {\n designTokens,\n otherDesignTokens,\n};\n\nexport default designTokens;\n\n"],"mappings":";AAAA,SAASA,QAAQ;AACjB,SAASC,UAAU;AAEnB,IAAMC,SAAS,GAAGD,UAAU,CAACE,MAAM,GAAG,cAAc;;AAEpD;AACA,IAAMC,YAAY,GAAG;EACnB;EACAC,sBAAsB,EAAEL,QAAQ,CAAC,wBAAwB,CAAC;EAC1DM,sBAAsB,EAAEN,QAAQ,CAAC,wBAAwB,CAAC;EAAE;;EAE5D;EACAO,sBAAsB,EAAEP,QAAQ,CAAC,4BAA4B,CAAC;EAAE;EAChEQ,qBAAqB,EAAGR,QAAQ,CAAC,2BAA2B,CAAC;EAAG;;EAEhE;EACAS,gCAAgC,EAAET,QAAQ,CAAC,kCAAkC,CAAC;EAAE;EAChFU,kCAAkC,EAAEV,QAAQ,CAAC,oCAAoC,CAAC;EAAG;;EAErFW,kCAAkC,EAAEX,QAAQ,CAAC,oCAAoC,CAAC;EAClFY,oCAAoC,EAAEZ,QAAQ,CAAC,sCAAsC,CAAC;EAEtFa,8BAA8B,EAAEb,QAAQ,CAAC,gCAAgC,CAAC;EAC1Ec,gCAAgC,EAAEd,QAAQ,CAAC,kCAAkC,CAAC;EAE9Ee,uBAAuB,EAAEf,QAAQ,CAAC,yBAAyB,CAAC;EAC5DgB,oBAAoB,EAAEhB,QAAQ,CAAC,sBAAsB,CAAC;EACtDiB,qBAAqB,EAAEjB,QAAQ,CAAC,uBAAuB,CAAC;EAExD;EACAkB,oBAAoB,EAAE;AACxB,CAAC;;AAED;AACA,IAAMC,iBAAiB,GAAAC,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,UAAAC,MAAA,CACfnB,SAAS,gBAAAmB,MAAA,CAAcrB,QAAQ,CAAC,wBAAwB,CAAC,SAAAqB,MAAA,CACzDnB,SAAS,wBAAAmB,MAAA,CAAsBrB,QAAQ,CAAC,wBAAwB,CAAC,SAAAqB,MAAA,CACjEnB,SAAS,yBAAAmB,MAAA,CAAuBrB,QAAQ,CAAC,yBAAyB,CAAC,SAAAqB,MAAA,CACnEnB,SAAS,yBAAAmB,MAAA,CAAuBjB,YAAY,CAACc,oBAAoB,EACxE;AAED,SACEd,YAAY,EACZe,iBAAiB;AAGnB,eAAef,YAAY"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style/index.less';
|
|
3
|
+
export type Size = 'medium' | 'small';
|
|
4
|
+
export interface IconButtonProps {
|
|
5
|
+
prefixCls?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
size?: Size | string | number;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
className?: string;
|
|
11
|
+
inverse?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
15
|
+
onMouseDown?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
16
|
+
onMouseEnter?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
17
|
+
onMouseLeave?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
declare const IconButton: React.FC<IconButtonProps>;
|
|
21
|
+
import IconButtonGroup from '../IconButtonGroup';
|
|
22
|
+
export { IconButtonGroup };
|
|
23
|
+
export default IconButton;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["prefixCls", "size", "disabled", "loading", "style", "className", "onMouseDown", "onClick", "onMouseEnter", "onMouseLeave"];
|
|
4
|
+
import Icon from "../Icon";
|
|
5
|
+
import { Theme, useStyleRegister } from '@ant-design/cssinjs';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { cssClasses } from "../../constants";
|
|
9
|
+
import { noop } from "../../utils/noop";
|
|
10
|
+
import { designTokens, otherDesignTokens } from "./designTokens";
|
|
11
|
+
|
|
12
|
+
// 这种是另一方 定制 antd 的 style 的方式; 现在使用了上面的 designTokens.ts 的方式。
|
|
13
|
+
import "./style/index.less";
|
|
14
|
+
|
|
15
|
+
// 定义设计令牌类型
|
|
16
|
+
|
|
17
|
+
// 定义派生令牌类型
|
|
18
|
+
|
|
19
|
+
// 定义派生函数
|
|
20
|
+
var derivativeFunc = function derivativeFunc(token) {
|
|
21
|
+
return {
|
|
22
|
+
buttonColor: token.primaryColor,
|
|
23
|
+
buttonFontSize: token.fontSize * 1.2
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// 创建主题
|
|
28
|
+
var theme = new Theme(derivativeFunc);
|
|
29
|
+
var IconButton = function IconButton(props) {
|
|
30
|
+
var _props$prefixCls = props.prefixCls,
|
|
31
|
+
prefixCls = _props$prefixCls === void 0 ? cssClasses.PREFIX + '-icon-button' : _props$prefixCls,
|
|
32
|
+
_props$size = props.size,
|
|
33
|
+
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
34
|
+
_props$disabled = props.disabled,
|
|
35
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
36
|
+
_props$loading = props.loading,
|
|
37
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
|
38
|
+
style = props.style,
|
|
39
|
+
className = props.className,
|
|
40
|
+
_props$onMouseDown = props.onMouseDown,
|
|
41
|
+
onMouseDown = _props$onMouseDown === void 0 ? noop : _props$onMouseDown,
|
|
42
|
+
_props$onClick = props.onClick,
|
|
43
|
+
onClick = _props$onClick === void 0 ? noop : _props$onClick,
|
|
44
|
+
_props$onMouseEnter = props.onMouseEnter,
|
|
45
|
+
onMouseEnter = _props$onMouseEnter === void 0 ? noop : _props$onMouseEnter,
|
|
46
|
+
_props$onMouseLeave = props.onMouseLeave,
|
|
47
|
+
onMouseLeave = _props$onMouseLeave === void 0 ? noop : _props$onMouseLeave,
|
|
48
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
49
|
+
console.log('IconButton', props);
|
|
50
|
+
|
|
51
|
+
// 获取图标尺寸
|
|
52
|
+
var getIconSize = function getIconSize() {
|
|
53
|
+
if (size === 'medium') {
|
|
54
|
+
return designTokens.sizingIconButtonMedium;
|
|
55
|
+
} else if (size === 'small') {
|
|
56
|
+
return designTokens.sizingIconButtonSmall;
|
|
57
|
+
}
|
|
58
|
+
return designTokens.sizingIconButtonMedium;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// 处理点击事件
|
|
62
|
+
var handleClick = function handleClick(e) {
|
|
63
|
+
if (disabled || loading) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
onClick === null || onClick === void 0 || onClick(e);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// 使用 useStyleRegister 注册自定义样式
|
|
70
|
+
var useCustomIconButtonStyle = function useCustomIconButtonStyle() {
|
|
71
|
+
var iconSize = getIconSize();
|
|
72
|
+
console.log('iconSize', iconSize);
|
|
73
|
+
var gap = size === 'medium' ? designTokens.spacingIconButtonHorizontalGap : designTokens.spacingIconButtonHorizontalGapSm;
|
|
74
|
+
var hashId = useStyleRegister({
|
|
75
|
+
theme: theme,
|
|
76
|
+
token: {},
|
|
77
|
+
path: [prefixCls]
|
|
78
|
+
}, function () {
|
|
79
|
+
return "\n .".concat(prefixCls, "-container {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n // width: ").concat(iconSize, "px;\n // height: ").concat(iconSize, "px;\n cursor: ").concat(disabled ? 'not-allowed' : 'pointer', ";\n opacity: ").concat(disabled ? 0.5 : 1, ";\n transition: ").concat(designTokens.transitionIconButton, ";\n }\n\n .").concat(prefixCls, "-medium {\n width: ").concat(designTokens.sizingIconButtonMedium, "px;\n height: ").concat(designTokens.sizingIconButtonMedium, "px;\n padding: ").concat(designTokens.spacingIconButtonPaddingHorizontal, "px ").concat(designTokens.spacingIconButtonPaddingVertical, "px;\n }\n\n .").concat(prefixCls, "-small {\n width: ").concat(designTokens.sizingIconButtonSmall, "px;\n height: ").concat(designTokens.sizingIconButtonSmall, "px;\n padding: ").concat(designTokens.spacingIconButtonPaddingHorizontalSm, "px ").concat(designTokens.spacingIconButtonPaddingVerticalSm, "px;\n }\n\n .").concat(prefixCls, "-container:hover {\n opacity: 0.8;\n color: ").concat(designTokens.colorIconButtonHover, ";\n }\n\n .").concat(prefixCls, "-container:active {\n opacity: 0.7;\n color: ").concat(designTokens.colorIconButtonActive, ";\n }\n\n .").concat(prefixCls, "-loading .anticon {\n animation: loadingCircle 1s infinite linear;\n }\n\n .").concat(prefixCls, "-group {\n gap: ").concat(gap, "px;\n }\n\n .").concat(prefixCls, "-group .").concat(prefixCls, "-medium + .").concat(prefixCls, "-medium {\n padding-left: ").concat(designTokens.spacingIconButtonHorizontalGap, "px;\n }\n\n .").concat(prefixCls, "-group .").concat(prefixCls, "-small + .").concat(prefixCls, "-small {\n padding-left: ").concat(designTokens.spacingIconButtonHorizontalGapSm, "px;\n }\n ");
|
|
80
|
+
});
|
|
81
|
+
return hashId;
|
|
82
|
+
};
|
|
83
|
+
var hashId = useCustomIconButtonStyle();
|
|
84
|
+
var iconSize = getIconSize();
|
|
85
|
+
return /*#__PURE__*/_jsx("div", {
|
|
86
|
+
className: classNames("".concat(prefixCls, " ").concat(prefixCls, "-container ").concat(prefixCls, "-").concat(size, " ").concat(loading ? "".concat(prefixCls, "-loading") : ''), hashId, className),
|
|
87
|
+
style: style,
|
|
88
|
+
onClick: handleClick,
|
|
89
|
+
onMouseDown: onMouseDown,
|
|
90
|
+
onMouseEnter: onMouseEnter,
|
|
91
|
+
onMouseLeave: onMouseLeave,
|
|
92
|
+
children: /*#__PURE__*/_jsx(Icon, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
93
|
+
size: iconSize,
|
|
94
|
+
style: _objectSpread({}, otherDesignTokens)
|
|
95
|
+
}))
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// 导入IconButtonGroup组件
|
|
100
|
+
import IconButtonGroup from "../IconButtonGroup";
|
|
101
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
102
|
+
// 导出组件
|
|
103
|
+
export { IconButtonGroup };
|
|
104
|
+
|
|
105
|
+
// 默认导出
|
|
106
|
+
export default IconButton;
|
|
107
|
+
//# sourceMappingURL=index.js.map
|