@lobehub/ui 2.0.4 → 2.0.6
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/Button/Button.js +2 -12
- package/es/Button/style.d.ts +0 -2
- package/es/Button/style.js +3 -5
- package/es/Drawer/Drawer.js +32 -32
- package/es/Drawer/type.d.ts +1 -1
- package/es/styles/theme/antdTheme.js +1 -4
- package/package.json +1 -1
package/es/Button/Button.js
CHANGED
|
@@ -34,7 +34,7 @@ var Button = /*#__PURE__*/memo(function (_ref) {
|
|
|
34
34
|
styles = _useStyles.styles,
|
|
35
35
|
cx = _useStyles.cx,
|
|
36
36
|
theme = _useStyles.theme;
|
|
37
|
-
var defaultVariant = type
|
|
37
|
+
var defaultVariant = type ? undefined : variant || (theme.isDarkMode ? 'filled' : 'outlined');
|
|
38
38
|
var variants = useMemo(function () {
|
|
39
39
|
return cva(styles.root, {
|
|
40
40
|
defaultVariants: {
|
|
@@ -43,15 +43,6 @@ var Button = /*#__PURE__*/memo(function (_ref) {
|
|
|
43
43
|
},
|
|
44
44
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
45
45
|
variants: {
|
|
46
|
-
variant: {
|
|
47
|
-
filled: styles.filled,
|
|
48
|
-
outlined: styles.outlined,
|
|
49
|
-
dashed: null,
|
|
50
|
-
text: null,
|
|
51
|
-
link: null,
|
|
52
|
-
normal: null,
|
|
53
|
-
solid: null
|
|
54
|
-
},
|
|
55
46
|
glass: {
|
|
56
47
|
false: null,
|
|
57
48
|
true: styles.glass
|
|
@@ -67,8 +58,7 @@ var Button = /*#__PURE__*/memo(function (_ref) {
|
|
|
67
58
|
return /*#__PURE__*/_jsx(AntdButton, _objectSpread(_objectSpread({
|
|
68
59
|
className: cx(variants({
|
|
69
60
|
glass: glass,
|
|
70
|
-
shadow: shadow
|
|
71
|
-
variant: defaultVariant
|
|
61
|
+
shadow: shadow
|
|
72
62
|
}), className),
|
|
73
63
|
color: color || (defaultVariant === 'filled' ? 'default' : undefined),
|
|
74
64
|
danger: danger,
|
package/es/Button/style.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
2
|
-
filled: import("antd-style").SerializedStyles;
|
|
3
2
|
glass: string;
|
|
4
|
-
outlined: import("antd-style").SerializedStyles;
|
|
5
3
|
root: import("antd-style").SerializedStyles;
|
|
6
4
|
shadow: import("antd-style").SerializedStyles;
|
|
7
5
|
}>;
|
package/es/Button/style.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _templateObject, _templateObject2
|
|
1
|
+
var _templateObject, _templateObject2;
|
|
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) {
|
|
@@ -7,10 +7,8 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
7
7
|
stylish = _ref.stylish,
|
|
8
8
|
prefixCls = _ref.prefixCls;
|
|
9
9
|
return {
|
|
10
|
-
filled: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.", "-btn.", "-btn-variant-filled {\n ", ";\n }\n "])), prefixCls, prefixCls, stylish.variantFilled),
|
|
11
10
|
glass: stylish.blur,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
shadow: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n box-shadow: ", " !important;\n "])), token.boxShadowTertiary)
|
|
11
|
+
root: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.", "-btn {\n > .", "-btn-icon {\n display: flex;\n }\n }\n "])), prefixCls, prefixCls),
|
|
12
|
+
shadow: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n box-shadow: ", " !important;\n "])), token.boxShadowTertiary)
|
|
15
13
|
};
|
|
16
14
|
});
|
package/es/Drawer/Drawer.js
CHANGED
|
@@ -88,6 +88,34 @@ var Drawer = /*#__PURE__*/memo(function (_ref) {
|
|
|
88
88
|
onClick: onClose
|
|
89
89
|
}, closeIconProps))]
|
|
90
90
|
});
|
|
91
|
+
var sidebarContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
92
|
+
children: [/*#__PURE__*/_jsx(Flexbox, {
|
|
93
|
+
className: classNames === null || classNames === void 0 ? void 0 : classNames.sidebar,
|
|
94
|
+
paddingBlock: 12,
|
|
95
|
+
paddingInline: 16,
|
|
96
|
+
style: _objectSpread({
|
|
97
|
+
background: theme.colorBgLayout,
|
|
98
|
+
borderRight: "1px solid ".concat(theme.colorBorderSecondary),
|
|
99
|
+
height: '100%',
|
|
100
|
+
overflowX: 'hidden',
|
|
101
|
+
overflowY: 'auto'
|
|
102
|
+
}, styles === null || styles === void 0 ? void 0 : styles.sidebar),
|
|
103
|
+
width: sidebarWidth,
|
|
104
|
+
children: sidebar
|
|
105
|
+
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
106
|
+
className: classNames === null || classNames === void 0 ? void 0 : classNames.sidebarContent,
|
|
107
|
+
flex: 1,
|
|
108
|
+
paddingBlock: 12,
|
|
109
|
+
paddingInline: 16,
|
|
110
|
+
style: _objectSpread({
|
|
111
|
+
background: theme.colorBgContainer,
|
|
112
|
+
height: '100%',
|
|
113
|
+
overflowX: 'hidden',
|
|
114
|
+
overflowY: 'auto'
|
|
115
|
+
}, styles === null || styles === void 0 ? void 0 : styles.sidebarContent),
|
|
116
|
+
children: children
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
91
119
|
return /*#__PURE__*/_jsx(AntdDrawer, _objectSpread(_objectSpread({
|
|
92
120
|
classNames: classNames,
|
|
93
121
|
closable: false,
|
|
@@ -100,7 +128,8 @@ var Drawer = /*#__PURE__*/memo(function (_ref) {
|
|
|
100
128
|
styles: _objectSpread(_objectSpread({}, styles), {}, {
|
|
101
129
|
body: _objectSpread({
|
|
102
130
|
background: 'transparent',
|
|
103
|
-
|
|
131
|
+
paddingBlock: sidebar ? 0 : 12,
|
|
132
|
+
paddingInline: sidebar ? 0 : 16
|
|
104
133
|
}, styles === null || styles === void 0 ? void 0 : styles.body),
|
|
105
134
|
content: _objectSpread({
|
|
106
135
|
background: sidebar ? "linear-gradient(to right, ".concat(theme.colorBgLayout, " 49.9%, ").concat(theme.colorBgContainer, " 50%)") : theme.colorBgContainer
|
|
@@ -132,43 +161,14 @@ var Drawer = /*#__PURE__*/memo(function (_ref) {
|
|
|
132
161
|
}, rest), {}, {
|
|
133
162
|
children: /*#__PURE__*/_jsxs(Flexbox, {
|
|
134
163
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.bodyContent,
|
|
135
|
-
height: '100%',
|
|
136
164
|
horizontal: !!sidebar,
|
|
137
|
-
paddingBlock: sidebar ? undefined : 12,
|
|
138
|
-
paddingInline: sidebar ? undefined : 16,
|
|
139
165
|
style: _objectSpread({
|
|
140
166
|
justifySelf: 'center',
|
|
141
167
|
maxWidth: containerMaxWidth,
|
|
168
|
+
minHeight: '100%',
|
|
142
169
|
width: '100%'
|
|
143
170
|
}, styles === null || styles === void 0 ? void 0 : styles.bodyContent),
|
|
144
|
-
children: [noHeader && extraNode, sidebar ?
|
|
145
|
-
children: [/*#__PURE__*/_jsx(Flexbox, {
|
|
146
|
-
className: classNames === null || classNames === void 0 ? void 0 : classNames.sidebar,
|
|
147
|
-
paddingBlock: 12,
|
|
148
|
-
paddingInline: 16,
|
|
149
|
-
style: _objectSpread({
|
|
150
|
-
background: theme.colorBgLayout,
|
|
151
|
-
borderRight: "1px solid ".concat(theme.colorBorderSecondary),
|
|
152
|
-
height: '100%',
|
|
153
|
-
overflowX: 'hidden',
|
|
154
|
-
overflowY: 'auto'
|
|
155
|
-
}, styles === null || styles === void 0 ? void 0 : styles.sidebar),
|
|
156
|
-
width: sidebarWidth,
|
|
157
|
-
children: sidebar
|
|
158
|
-
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
159
|
-
className: classNames === null || classNames === void 0 ? void 0 : classNames.sidebarContent,
|
|
160
|
-
flex: 1,
|
|
161
|
-
paddingBlock: 12,
|
|
162
|
-
paddingInline: 16,
|
|
163
|
-
style: _objectSpread({
|
|
164
|
-
background: theme.colorBgContainer,
|
|
165
|
-
height: '100%',
|
|
166
|
-
overflowX: 'hidden',
|
|
167
|
-
overflowY: 'auto'
|
|
168
|
-
}, styles === null || styles === void 0 ? void 0 : styles.sidebarContent),
|
|
169
|
-
children: children
|
|
170
|
-
})]
|
|
171
|
-
}) : children]
|
|
171
|
+
children: [noHeader && extraNode, sidebar ? sidebarContent : children]
|
|
172
172
|
})
|
|
173
173
|
}));
|
|
174
174
|
});
|
package/es/Drawer/type.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface DrawerProps extends Omit<AntdDrawerProps, 'styles' | 'className
|
|
|
10
10
|
title?: string;
|
|
11
11
|
};
|
|
12
12
|
closeIconProps?: ActionIconProps;
|
|
13
|
-
containerMaxWidth?: number;
|
|
13
|
+
containerMaxWidth?: number | string;
|
|
14
14
|
noHeader?: boolean;
|
|
15
15
|
ref?: Ref<HTMLDivElement>;
|
|
16
16
|
sidebar?: ReactNode;
|
|
@@ -22,10 +22,7 @@ export var createLobeAntdTheme = function createLobeAntdTheme(_ref) {
|
|
|
22
22
|
algorithm: isDark ? darkAlgorithm : lightAlgorithm,
|
|
23
23
|
components: {
|
|
24
24
|
Button: {
|
|
25
|
-
contentFontSizeSM: 12
|
|
26
|
-
defaultActiveBorderColor: baseToken.colorBorder,
|
|
27
|
-
defaultActiveColor: baseToken.colorText,
|
|
28
|
-
groupBorderColor: baseToken.colorBorder
|
|
25
|
+
contentFontSizeSM: 12
|
|
29
26
|
},
|
|
30
27
|
DatePicker: {
|
|
31
28
|
activeBorderColor: baseToken.colorBorder,
|