@lobehub/ui 1.170.3 → 1.170.5
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
|
};
|
|
@@ -16,6 +16,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
16
16
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
17
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
18
|
import { ColorPicker } from 'antd';
|
|
19
|
+
import chroma from 'chroma-js';
|
|
19
20
|
import { CheckIcon } from 'lucide-react';
|
|
20
21
|
import { readableColor, rgba } from 'polished';
|
|
21
22
|
import { memo } from 'react';
|
|
@@ -57,7 +58,7 @@ var ColorSwatches = /*#__PURE__*/memo(function (_ref) {
|
|
|
57
58
|
return c.color === active;
|
|
58
59
|
});
|
|
59
60
|
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
60
|
-
gap:
|
|
61
|
+
gap: 6,
|
|
61
62
|
horizontal: true,
|
|
62
63
|
style: _objectSpread({
|
|
63
64
|
flexWrap: 'wrap'
|
|
@@ -66,15 +67,16 @@ var ColorSwatches = /*#__PURE__*/memo(function (_ref) {
|
|
|
66
67
|
children: [enableColorSwatches && colors.map(function (c) {
|
|
67
68
|
var color = c.color || theme.colorPrimary;
|
|
68
69
|
var isActive = !active && !c.color || color === active;
|
|
70
|
+
var isTransparent = c.color === 'transparent' || chroma(c.color).alpha() === 0;
|
|
69
71
|
return /*#__PURE__*/_jsx(Tooltip, {
|
|
70
72
|
title: c.label,
|
|
71
73
|
children: /*#__PURE__*/_jsx(Center, {
|
|
72
|
-
className: cx(styles.container, isActive && styles.active),
|
|
74
|
+
className: cx(styles.container, isTransparent && styles.transparent, isActive && styles.active),
|
|
73
75
|
onClick: function onClick() {
|
|
74
|
-
return setActive(c.color);
|
|
76
|
+
return setActive(c.color || undefined);
|
|
75
77
|
},
|
|
76
78
|
style: {
|
|
77
|
-
background: color,
|
|
79
|
+
background: isTransparent ? undefined : color,
|
|
78
80
|
borderRadius: shape === 'circle' ? '50%' : theme.borderRadius
|
|
79
81
|
},
|
|
80
82
|
children: isActive && /*#__PURE__*/_jsx(Icon, {
|
|
@@ -3,4 +3,5 @@ export declare const useStyles: (props?: number | undefined) => import("antd-sty
|
|
|
3
3
|
conic: import("antd-style").SerializedStyles;
|
|
4
4
|
container: import("antd-style").SerializedStyles;
|
|
5
5
|
picker: import("antd-style").SerializedStyles;
|
|
6
|
+
transparent: import("antd-style").SerializedStyles;
|
|
6
7
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
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) {
|
|
@@ -6,9 +6,10 @@ export var useStyles = createStyles(function (_ref, size) {
|
|
|
6
6
|
token = _ref.token,
|
|
7
7
|
prefixCls = _ref.prefixCls;
|
|
8
8
|
return {
|
|
9
|
-
active: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-shadow: inset 0 0 0 1px
|
|
9
|
+
active: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-shadow: inset 0 0 0 1px ", ";\n "])), token.colorFill),
|
|
10
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
|
|
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
|
|
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 ", ";\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.colorFillSecondary, 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 ", ";\n\n &:hover {\n box-shadow:\n inset 0 0 0 1px ", ",\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.colorFillSecondary, token.colorFillSecondary, token.colorText, prefixCls),
|
|
13
|
+
transparent: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-image: conic-gradient(\n ", " 25%,\n transparent 25% 50%,\n ", " 50% 75%,\n transparent 75% 100%\n );\n background-size: 50% 50%;\n "])), token.colorFillSecondary, token.colorFillSecondary)
|
|
13
14
|
};
|
|
14
15
|
});
|
|
@@ -9,10 +9,10 @@ export interface FormSubmitFooterProps extends FlexboxProps {
|
|
|
9
9
|
float?: boolean;
|
|
10
10
|
onReset?: () => void;
|
|
11
11
|
resetButtonProps?: Omit<ButtonProps, 'children'>;
|
|
12
|
-
resetText?: ReactNode;
|
|
13
12
|
saveButtonProps?: Omit<ButtonProps, 'children'>;
|
|
14
|
-
saveText?: ReactNode;
|
|
15
13
|
texts?: {
|
|
14
|
+
reset?: string;
|
|
15
|
+
submit?: string;
|
|
16
16
|
unSaved?: string;
|
|
17
17
|
unSavedWarning?: string;
|
|
18
18
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["enableReset", "buttonProps", "float", "
|
|
2
|
+
var _excluded = ["enableReset", "buttonProps", "float", "onReset", "saveButtonProps", "resetButtonProps", "enableUnsavedWarning", "children", "texts", "className"];
|
|
3
3
|
var _templateObject, _templateObject2;
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -42,10 +42,6 @@ var FormSubmitFooter = /*#__PURE__*/memo(function (_ref2) {
|
|
|
42
42
|
enableReset = _ref2$enableReset === void 0 ? true : _ref2$enableReset,
|
|
43
43
|
buttonProps = _ref2.buttonProps,
|
|
44
44
|
float = _ref2.float,
|
|
45
|
-
_ref2$saveText = _ref2.saveText,
|
|
46
|
-
saveText = _ref2$saveText === void 0 ? 'Submit' : _ref2$saveText,
|
|
47
|
-
_ref2$resetText = _ref2.resetText,
|
|
48
|
-
resetText = _ref2$resetText === void 0 ? 'Reset' : _ref2$resetText,
|
|
49
45
|
onReset = _ref2.onReset,
|
|
50
46
|
saveButtonProps = _ref2.saveButtonProps,
|
|
51
47
|
resetButtonProps = _ref2.resetButtonProps,
|
|
@@ -119,14 +115,14 @@ var FormSubmitFooter = /*#__PURE__*/memo(function (_ref2) {
|
|
|
119
115
|
shape: float ? 'round' : undefined,
|
|
120
116
|
variant: 'filled'
|
|
121
117
|
}, buttonProps), resetButtonProps), {}, {
|
|
122
|
-
children:
|
|
118
|
+
children: (texts === null || texts === void 0 ? void 0 : texts.reset) || 'Reset'
|
|
123
119
|
})), /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread(_objectSpread({
|
|
124
120
|
htmlType: "submit",
|
|
125
121
|
loading: submitLoading,
|
|
126
122
|
shape: float ? 'round' : undefined,
|
|
127
123
|
type: "primary"
|
|
128
124
|
}, buttonProps), saveButtonProps), {}, {
|
|
129
|
-
children:
|
|
125
|
+
children: (texts === null || texts === void 0 ? void 0 : texts.submit) || 'Submit'
|
|
130
126
|
}))]
|
|
131
127
|
});
|
|
132
128
|
if (!float) return /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
|