@lobehub/ui 1.170.6 → 1.170.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.
- package/es/Drawer/index.js +3 -3
- package/es/Modal/index.js +56 -45
- package/es/Modal/style.js +1 -1
- package/es/styles/theme/customToken.js +6 -2
- package/es/types/customToken.d.ts +1 -0
- package/package.json +1 -1
package/es/Drawer/index.js
CHANGED
|
@@ -102,7 +102,7 @@ var Drawer = /*#__PURE__*/memo(function (_ref) {
|
|
|
102
102
|
padding: '0 4px'
|
|
103
103
|
}, styles === null || styles === void 0 ? void 0 : styles.body),
|
|
104
104
|
content: _objectSpread({
|
|
105
|
-
background: sidebar ? "linear-gradient(to right, ".concat(theme.
|
|
105
|
+
background: sidebar ? "linear-gradient(to right, ".concat(theme.colorBgLayout, " 49.9%, ").concat(theme.colorBgContainer, " 50%)") : theme.colorBgContainer
|
|
106
106
|
}, styles === null || styles === void 0 ? void 0 : styles.content),
|
|
107
107
|
header: _objectSpread({
|
|
108
108
|
background: 'transparent',
|
|
@@ -146,7 +146,7 @@ var Drawer = /*#__PURE__*/memo(function (_ref) {
|
|
|
146
146
|
paddingBlock: 12,
|
|
147
147
|
paddingInline: 16,
|
|
148
148
|
style: _objectSpread({
|
|
149
|
-
background: theme.
|
|
149
|
+
background: theme.colorBgLayout,
|
|
150
150
|
borderRight: "1px solid ".concat(theme.colorBorderSecondary),
|
|
151
151
|
height: '100%',
|
|
152
152
|
overflowX: 'hidden',
|
|
@@ -160,7 +160,7 @@ var Drawer = /*#__PURE__*/memo(function (_ref) {
|
|
|
160
160
|
paddingBlock: 12,
|
|
161
161
|
paddingInline: 16,
|
|
162
162
|
style: _objectSpread({
|
|
163
|
-
background: theme.
|
|
163
|
+
background: theme.colorBgContainer,
|
|
164
164
|
height: '100%',
|
|
165
165
|
overflowX: 'hidden',
|
|
166
166
|
overflowY: 'auto'
|
package/es/Modal/index.js
CHANGED
|
@@ -20,7 +20,6 @@ import { Modal as AntModal, Button, ConfigProvider, Drawer } from 'antd';
|
|
|
20
20
|
import { useResponsive } from 'antd-style';
|
|
21
21
|
import { isNumber } from 'lodash-es';
|
|
22
22
|
import { Maximize2, Minimize2, X } from 'lucide-react';
|
|
23
|
-
import { lighten } from 'polished';
|
|
24
23
|
import { memo, useState } from 'react';
|
|
25
24
|
import ActionIcon from "../ActionIcon";
|
|
26
25
|
import Icon from "../Icon";
|
|
@@ -71,57 +70,69 @@ var Modal = /*#__PURE__*/memo(function (_ref) {
|
|
|
71
70
|
var body = stylesProps.body,
|
|
72
71
|
restStyles = _objectWithoutProperties(stylesProps, _excluded2);
|
|
73
72
|
var hideFooter = footer === false || footer === null;
|
|
74
|
-
if (enableResponsive && mobile) return /*#__PURE__*/_jsx(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}),
|
|
79
|
-
destroyOnClose: destroyOnClose,
|
|
80
|
-
extra: allowFullscreen && /*#__PURE__*/_jsx(ActionIcon, {
|
|
81
|
-
icon: fullscreen ? Minimize2 : Maximize2,
|
|
82
|
-
onClick: function onClick() {
|
|
83
|
-
return setFullscreen(!fullscreen);
|
|
73
|
+
if (enableResponsive && mobile) return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
74
|
+
theme: {
|
|
75
|
+
token: {
|
|
76
|
+
colorBgElevated: theme.colorBgContainer
|
|
84
77
|
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
children:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
78
|
+
},
|
|
79
|
+
children: /*#__PURE__*/_jsx(Drawer, _objectSpread(_objectSpread({
|
|
80
|
+
className: cx(styles.drawerContent, className),
|
|
81
|
+
closeIcon: /*#__PURE__*/_jsx(ActionIcon, {
|
|
82
|
+
icon: X
|
|
83
|
+
}),
|
|
84
|
+
destroyOnClose: destroyOnClose,
|
|
85
|
+
extra: allowFullscreen && /*#__PURE__*/_jsx(ActionIcon, {
|
|
86
|
+
icon: fullscreen ? Minimize2 : Maximize2,
|
|
87
|
+
onClick: function onClick() {
|
|
88
|
+
return setFullscreen(!fullscreen);
|
|
89
|
+
}
|
|
90
|
+
}),
|
|
91
|
+
footer: hideFooter ? null : footer || /*#__PURE__*/_jsxs(_Fragment, {
|
|
92
|
+
children: [/*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
93
|
+
color: 'default',
|
|
94
|
+
onClick: onCancel,
|
|
95
|
+
variant: 'filled'
|
|
96
|
+
}, cancelButtonProps), {}, {
|
|
97
|
+
children: cancelText || 'Cancel'
|
|
98
|
+
})), /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
99
|
+
loading: confirmLoading,
|
|
100
|
+
onClick: onOk,
|
|
101
|
+
type: "primary"
|
|
102
|
+
}, okButtonProps), {}, {
|
|
103
|
+
style: _objectSpread({
|
|
104
|
+
marginInlineStart: 8
|
|
105
|
+
}, okButtonProps === null || okButtonProps === void 0 ? void 0 : okButtonProps.style),
|
|
106
|
+
children: okText || 'OK'
|
|
107
|
+
}))]
|
|
108
|
+
}),
|
|
109
|
+
height: fullscreen ? 'calc(100% - env(safe-area-inset-top))' : maxHeight || '75vh',
|
|
110
|
+
maskClassName: cx(styles.wrap, wrapClassName),
|
|
111
|
+
onClose: onCancel,
|
|
112
|
+
open: open,
|
|
113
|
+
placement: 'bottom',
|
|
114
|
+
styles: _objectSpread({
|
|
115
|
+
body: _objectSpread({
|
|
116
|
+
paddingBlock: "16px ".concat(footer ? 0 : '16px'),
|
|
117
|
+
paddingInline: (_paddings$desktop = paddings === null || paddings === void 0 ? void 0 : paddings.desktop) !== null && _paddings$desktop !== void 0 ? _paddings$desktop : 16
|
|
118
|
+
}, body)
|
|
119
|
+
}, restStyles),
|
|
120
|
+
title: title
|
|
121
|
+
}, rest), {}, {
|
|
122
|
+
children: children
|
|
123
|
+
}))
|
|
124
|
+
});
|
|
117
125
|
return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
118
126
|
theme: {
|
|
119
127
|
token: {
|
|
120
|
-
colorBgElevated:
|
|
128
|
+
colorBgElevated: theme.colorBgContainer
|
|
121
129
|
}
|
|
122
130
|
},
|
|
123
131
|
children: /*#__PURE__*/_jsx(AntModal, _objectSpread(_objectSpread({
|
|
124
|
-
cancelButtonProps:
|
|
132
|
+
cancelButtonProps: _objectSpread({
|
|
133
|
+
color: 'default',
|
|
134
|
+
variant: 'filled'
|
|
135
|
+
}, cancelButtonProps),
|
|
125
136
|
cancelText: cancelText,
|
|
126
137
|
className: cx(styles.content, className),
|
|
127
138
|
closable: true,
|
package/es/Modal/style.js
CHANGED
|
@@ -11,7 +11,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
11
11
|
var maxHeight = _ref2.maxHeight;
|
|
12
12
|
return {
|
|
13
13
|
content: cx(maxHeight && css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-modal-body {\n overflow: auto;\n max-height: ", ";\n }\n "])), prefixCls, maxHeight), css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", "-modal-footer {\n margin: 0;\n padding: 16px;\n }\n .", "-modal-header {\n display: flex;\n gap: 4px;\n align-items: center;\n justify-content: center;\n\n height: 56px;\n margin-block-end: 0;\n padding: 16px;\n }\n .", "-modal-content {\n overflow: hidden;\n padding: 0;\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n "])), prefixCls, prefixCls, prefixCls, token.colorSplit, token.borderRadiusLG)),
|
|
14
|
-
drawerContent: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n
|
|
14
|
+
drawerContent: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", "-drawer-close {\n padding: 0;\n }\n\n .", "-drawer-header {\n flex: none;\n height: ", "px !important;\n padding-block: 0;\n padding-inline: 16px;\n }\n\n .", "-drawer-footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n padding: 16px;\n\n border: none;\n }\n "])), prefixCls, prefixCls, HEADER_HEIGHT, prefixCls),
|
|
15
15
|
wrap: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow: hidden auto;\n "])))
|
|
16
16
|
};
|
|
17
17
|
});
|
|
@@ -12,6 +12,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
12
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
13
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
14
|
import { camelCase } from 'lodash-es';
|
|
15
|
+
import { mix } from 'polished';
|
|
15
16
|
import { colorScales } from "../../color/colors";
|
|
16
17
|
var generateColorPalette = function generateColorPalette(_ref) {
|
|
17
18
|
var _ref2;
|
|
@@ -62,7 +63,8 @@ var generateCustomColorPalette = function generateCustomColorPalette(_ref3) {
|
|
|
62
63
|
}));
|
|
63
64
|
};
|
|
64
65
|
export var generateCustomToken = function generateCustomToken(_ref4) {
|
|
65
|
-
var isDarkMode = _ref4.isDarkMode
|
|
66
|
+
var isDarkMode = _ref4.isDarkMode,
|
|
67
|
+
token = _ref4.token;
|
|
66
68
|
var colorCustomToken = {};
|
|
67
69
|
for (var _i = 0, _Object$entries = Object.entries(colorScales); _i < _Object$entries.length; _i++) {
|
|
68
70
|
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
@@ -74,5 +76,7 @@ export var generateCustomToken = function generateCustomToken(_ref4) {
|
|
|
74
76
|
scale: scale
|
|
75
77
|
}));
|
|
76
78
|
}
|
|
77
|
-
return colorCustomToken
|
|
79
|
+
return _objectSpread(_objectSpread({}, colorCustomToken), {}, {
|
|
80
|
+
colorBgContainerSecondary: mix(0.5, token.colorBgLayout, token.colorBgContainer)
|
|
81
|
+
});
|
|
78
82
|
};
|