@lobehub/ui 1.170.2 → 1.170.4
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/Avatar/style.js
CHANGED
|
@@ -10,7 +10,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
10
10
|
size = _ref2.size,
|
|
11
11
|
isEmoji = _ref2.isEmoji;
|
|
12
12
|
var backgroundColor = background !== null && background !== void 0 ? background : token.colorBgContainer;
|
|
13
|
-
var color = readableColor(backgroundColor);
|
|
13
|
+
var color = backgroundColor ? readableColor(backgroundColor) : token.colorText;
|
|
14
14
|
return {
|
|
15
15
|
avatar: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n background: ", ";\n border: 1px solid ", ";\n\n > .", "-avatar-string {\n font-size: ", "px;\n font-weight: 700;\n line-height: 1 !important;\n color: ", ";\n }\n\n > * {\n cursor: pointer;\n }\n "])), backgroundColor, background ? 'transparent' : token.colorSplit, prefixCls, size * (isEmoji ? 0.7 : 0.5), color)
|
|
16
16
|
};
|
|
@@ -71,7 +71,7 @@ var ColorSwatches = /*#__PURE__*/memo(function (_ref) {
|
|
|
71
71
|
children: /*#__PURE__*/_jsx(Center, {
|
|
72
72
|
className: cx(styles.container, isActive && styles.active),
|
|
73
73
|
onClick: function onClick() {
|
|
74
|
-
return setActive(color);
|
|
74
|
+
return setActive(c.color || undefined);
|
|
75
75
|
},
|
|
76
76
|
style: {
|
|
77
77
|
background: color,
|
|
@@ -97,7 +97,7 @@ var ColorSwatches = /*#__PURE__*/memo(function (_ref) {
|
|
|
97
97
|
position: 'relative'
|
|
98
98
|
},
|
|
99
99
|
children: [isCustomActive && /*#__PURE__*/_jsx(Icon, {
|
|
100
|
-
color: rgba(readableColor(active), 0.33),
|
|
100
|
+
color: enableColorSwatches ? '#222' : rgba(readableColor(active), 0.33),
|
|
101
101
|
icon: CheckIcon,
|
|
102
102
|
size: {
|
|
103
103
|
fontSize: 14,
|
|
@@ -110,13 +110,17 @@ var ColorSwatches = /*#__PURE__*/memo(function (_ref) {
|
|
|
110
110
|
}
|
|
111
111
|
}), /*#__PURE__*/_jsx(ColorPicker, {
|
|
112
112
|
arrow: false,
|
|
113
|
-
className: cx(styles.picker, isCustomActive && styles.active),
|
|
113
|
+
className: cx(styles.picker, enableColorSwatches && styles.conic, isCustomActive && styles.active),
|
|
114
114
|
disabledAlpha: true,
|
|
115
115
|
format: 'hex',
|
|
116
116
|
onChangeComplete: function onChangeComplete(c) {
|
|
117
|
-
|
|
117
|
+
if (c.toHexString() === theme.colorPrimary) {
|
|
118
|
+
setActive('');
|
|
119
|
+
} else {
|
|
120
|
+
setActive(c.toHexString());
|
|
121
|
+
}
|
|
118
122
|
},
|
|
119
|
-
presets: [{
|
|
123
|
+
presets: enableColorSwatches ? undefined : [{
|
|
120
124
|
colors: colors.map(function (c) {
|
|
121
125
|
return c.color;
|
|
122
126
|
}),
|
|
@@ -125,7 +129,7 @@ var ColorSwatches = /*#__PURE__*/memo(function (_ref) {
|
|
|
125
129
|
style: {
|
|
126
130
|
borderRadius: shape === 'circle' ? '50%' : theme.borderRadius
|
|
127
131
|
},
|
|
128
|
-
value: active
|
|
132
|
+
value: enableColorSwatches ? undefined : active
|
|
129
133
|
})]
|
|
130
134
|
})
|
|
131
135
|
})]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const useStyles: (props?: number | undefined) => import("antd-style").ReturnStyles<{
|
|
2
2
|
active: import("antd-style").SerializedStyles;
|
|
3
|
+
conic: import("antd-style").SerializedStyles;
|
|
3
4
|
container: import("antd-style").SerializedStyles;
|
|
4
5
|
picker: import("antd-style").SerializedStyles;
|
|
5
6
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
export var useStyles = createStyles(function (_ref, size) {
|
|
@@ -7,7 +7,8 @@ export var useStyles = createStyles(function (_ref, size) {
|
|
|
7
7
|
prefixCls = _ref.prefixCls;
|
|
8
8
|
return {
|
|
9
9
|
active: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 20%);\n "]))),
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
conic: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: conic-gradient(\n ", ",\n ", ",\n ", ",\n ", ",\n ", ",\n ", ",\n ", ",\n ", ",\n ", ",\n ", ",\n ", ",\n ", ",\n ", "\n );\n .", "-color-picker-color-block {\n opacity: 0;\n }\n "])), token.red, token.volcano, token.orange, token.gold, token.yellow, token.lime, token.green, token.cyan, token.blue, token.geekblue, token.purple, token.magenta, token.red, prefixCls),
|
|
11
|
+
container: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n flex: none;\n\n width: ", "px;\n min-width: ", "px;\n height: ", "px;\n min-height: ", "px;\n\n background: ", ";\n box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 5%);\n\n &:hover {\n box-shadow:\n inset 0 0 0 1px rgba(0, 0, 0, 5%),\n 0 0 0 2px ", ";\n }\n "])), size, size, size, size, token.colorBgContainer, token.colorText),
|
|
12
|
+
picker: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow: hidden;\n flex: none;\n\n width: ", "px;\n min-width: ", "px;\n height: ", "px;\n min-height: ", "px;\n padding: 0;\n\n border: none;\n box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 5%);\n\n &:hover {\n box-shadow:\n inset 0 0 0 1px rgba(0, 0, 0, 5%),\n 0 0 0 2px ", ";\n }\n\n .", "-color-picker-color-block {\n width: 100%;\n height: 100%;\n border: none;\n border-radius: inherit;\n }\n "])), size, size, size, size, token.colorText, prefixCls)
|
|
12
13
|
};
|
|
13
14
|
});
|