@oceanbase/design 1.0.0-alpha.0 → 1.0.0-alpha.10
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/dist/design.min.css +1 -1
- package/dist/design.min.js +1 -1
- package/dist/reset.css +2 -1
- package/dist/static/Inter-Medium.ea234620.woff2 +0 -0
- package/dist/static/Inter-Regular.34ba43c9.woff2 +0 -0
- package/dist/static/Inter-SemiBold.95439fb4.woff2 +0 -0
- package/es/_util/genComponentStyleHook.d.ts +21 -4
- package/es/_util/genComponentStyleHook.js +68 -20
- package/es/alert/index.d.ts +2 -2
- package/es/alert/index.js +22 -6
- package/es/alert/style/index.d.ts +2 -5
- package/es/alert/style/index.js +157 -67
- package/es/app/index.d.ts +8 -0
- package/es/app/index.js +43 -1
- package/es/app/style/index.d.ts +6 -0
- package/es/app/style/index.js +9 -0
- package/es/badge/index.js +15 -7
- package/es/badge/style/index.d.ts +2 -5
- package/es/badge/style/index.js +13 -18
- package/es/button/index.js +10 -4
- package/es/button/style/index.d.ts +4 -5
- package/es/button/style/index.js +40 -7
- package/es/card/index.d.ts +11 -0
- package/es/card/index.js +151 -9
- package/es/card/style/index.d.ts +2 -5
- package/es/card/style/index.js +83 -18
- package/es/checkbox/index.js +9 -2
- package/es/checkbox/style/index.d.ts +2 -5
- package/es/checkbox/style/index.js +14 -11
- package/es/config-provider/context.d.ts +11 -0
- package/es/config-provider/context.js +2 -1
- package/es/config-provider/index.d.ts +4 -3
- package/es/config-provider/index.js +92 -40
- package/es/descriptions/index.d.ts +10 -0
- package/es/descriptions/index.js +62 -5
- package/es/descriptions/style/index.d.ts +3 -6
- package/es/descriptions/style/index.js +70 -10
- package/es/drawer/index.js +10 -7
- package/es/drawer/style/index.d.ts +2 -5
- package/es/drawer/style/index.js +44 -17
- package/es/dropdown/dropdown-button.js +26 -6
- package/es/dropdown/style/index.d.ts +6 -0
- package/es/{_util/genStyle.js → dropdown/style/index.js} +14 -11
- package/es/empty/index.js +4 -3
- package/es/empty/style/index.d.ts +2 -5
- package/es/empty/style/index.js +10 -10
- package/es/fonts/Inter-Medium.woff2 +0 -0
- package/es/fonts/Inter-Regular.woff2 +0 -0
- package/es/fonts/Inter-SemiBold.woff2 +0 -0
- package/es/form/FormItem.d.ts +2 -1
- package/es/form/FormItem.js +26 -11
- package/es/form/index.js +9 -2
- package/es/form/style/index.d.ts +2 -5
- package/es/form/style/index.js +19 -8
- package/es/index.d.ts +4 -3
- package/es/index.js +1 -1
- package/es/input/Input.d.ts +2 -0
- package/es/input/Input.js +30 -7
- package/es/input/Password.js +24 -5
- package/es/input/Search.js +24 -5
- package/es/input/TextArea.js +24 -5
- package/es/input/style/index.d.ts +6 -0
- package/es/input/style/index.js +32 -0
- package/es/input-number/index.d.ts +2 -1
- package/es/input-number/index.js +18 -4
- package/es/input-number/style/index.d.ts +6 -0
- package/es/input-number/style/index.js +19 -0
- package/es/locale/en-US.js +4 -1
- package/es/locale/index.d.ts +2 -0
- package/es/locale/ja-JP.d.ts +3 -0
- package/es/locale/ja-JP.js +31 -0
- package/es/locale/zh-CN.js +4 -1
- package/es/locale/zh-TW.js +4 -1
- package/es/modal/Modal.js +29 -8
- package/es/modal/style/index.d.ts +2 -5
- package/es/modal/style/index.js +67 -26
- package/es/radio/index.js +9 -2
- package/es/radio/style/index.d.ts +2 -5
- package/es/radio/style/index.js +16 -10
- package/es/result/index.d.ts +2 -2
- package/es/result/index.js +14 -6
- package/es/result/style/index.d.ts +2 -5
- package/es/result/style/index.js +3 -6
- package/es/segmented/index.d.ts +1 -0
- package/es/segmented/index.js +24 -9
- package/es/segmented/style/index.d.ts +1 -4
- package/es/segmented/style/index.js +4 -6
- package/es/select/index.js +9 -2
- package/es/select/style/index.d.ts +2 -5
- package/es/select/style/index.js +6 -7
- package/es/slider/index.js +9 -2
- package/es/slider/style/index.d.ts +2 -5
- package/es/slider/style/index.js +11 -11
- package/es/space/index.js +9 -2
- package/es/space/style/index.d.ts +2 -5
- package/es/space/style/index.js +3 -6
- package/es/spin/index.js +9 -2
- package/es/spin/style/index.d.ts +2 -5
- package/es/spin/style/index.js +27 -27
- package/es/static-function/index.js +13 -4
- package/es/style/cssVariables.d.ts +25 -0
- package/es/style/cssVariables.js +48 -0
- package/es/style/cssVariablesMeta.d.ts +24 -0
- package/es/style/cssVariablesMeta.js +974 -0
- package/es/style/global.d.ts +8 -0
- package/es/style/global.js +121 -0
- package/es/style/reset.css +2 -1
- package/es/switch/index.js +9 -2
- package/es/switch/style/index.d.ts +2 -5
- package/es/switch/style/index.js +3 -6
- package/es/table/index.d.ts +1 -4
- package/es/table/index.js +67 -34
- package/es/table/style/index.d.ts +2 -5
- package/es/table/style/index.js +58 -36
- package/es/tabs/index.js +9 -2
- package/es/tabs/style/index.d.ts +2 -5
- package/es/tabs/style/index.js +10 -10
- package/es/tag/index.d.ts +1 -0
- package/es/tag/index.js +17 -4
- package/es/tag/style/index.d.ts +3 -8
- package/es/tag/style/index.js +39 -35
- package/es/theme/compact.d.ts +1 -1
- package/es/theme/compact.js +2 -6
- package/es/theme/dark.d.ts +1 -48
- package/es/theme/default.d.ts +48 -2
- package/es/theme/default.js +333 -78
- package/es/theme/index.d.ts +20 -57
- package/es/theme/interface.d.ts +130 -0
- package/es/theme/interface.js +4 -1
- package/es/theme/style/aliyun.less +86 -86
- package/es/theme/style/compact.less +199 -170
- package/es/theme/style/dark.less +103 -103
- package/es/theme/style/default.less +202 -173
- package/es/tooltip/index.js +4 -4
- package/es/tooltip/style/index.d.ts +2 -5
- package/es/tooltip/style/index.js +10 -13
- package/es/tree-select/index.js +9 -2
- package/es/tree-select/style/index.d.ts +2 -5
- package/es/tree-select/style/index.js +3 -6
- package/es/typography/Link.js +9 -2
- package/es/typography/Paragraph.js +9 -2
- package/es/typography/Text.d.ts +1 -0
- package/es/typography/Text.js +12 -4
- package/es/typography/Title.js +9 -2
- package/es/typography/hooks/useClassName.d.ts +1 -1
- package/es/typography/hooks/useClassName.js +2 -2
- package/es/typography/index.d.ts +12 -1
- package/es/typography/index.js +2 -1
- package/es/typography/style/index.d.ts +2 -5
- package/es/typography/style/index.js +36 -28
- package/lib/_util/genComponentStyleHook.d.ts +21 -4
- package/lib/_util/genComponentStyleHook.js +50 -31
- package/lib/alert/index.d.ts +2 -2
- package/lib/alert/index.js +20 -11
- package/lib/alert/style/index.d.ts +2 -5
- package/lib/alert/style/index.js +174 -79
- package/lib/app/index.d.ts +8 -0
- package/lib/app/index.js +36 -1
- package/lib/app/style/index.d.ts +6 -0
- package/lib/{_util/getWeakenBorderColor.js → app/style/index.js} +15 -10
- package/lib/badge/index.js +32 -23
- package/lib/badge/style/index.d.ts +2 -5
- package/lib/badge/style/index.js +14 -16
- package/lib/button/index.js +5 -4
- package/lib/button/style/index.d.ts +4 -5
- package/lib/button/style/index.js +48 -9
- package/lib/card/index.d.ts +11 -0
- package/lib/card/index.js +160 -12
- package/lib/card/style/index.d.ts +2 -5
- package/lib/card/style/index.js +132 -21
- package/lib/checkbox/index.js +4 -3
- package/lib/checkbox/style/index.d.ts +2 -5
- package/lib/checkbox/style/index.js +10 -8
- package/lib/config-provider/DefaultRenderEmpty.js +4 -3
- package/lib/config-provider/context.d.ts +11 -0
- package/lib/config-provider/index.d.ts +4 -3
- package/lib/config-provider/index.js +133 -30
- package/lib/descriptions/hooks/useItems.js +5 -4
- package/lib/descriptions/index.d.ts +10 -0
- package/lib/descriptions/index.js +54 -6
- package/lib/descriptions/style/index.d.ts +3 -6
- package/lib/descriptions/style/index.js +117 -7
- package/lib/drawer/index.js +46 -35
- package/lib/drawer/style/index.d.ts +2 -5
- package/lib/drawer/style/index.js +44 -14
- package/lib/dropdown/dropdown-button.js +26 -3
- package/lib/dropdown/index.js +2 -2
- package/lib/dropdown/style/index.d.ts +6 -0
- package/lib/dropdown/style/index.js +46 -0
- package/lib/empty/colored.js +413 -327
- package/lib/empty/database.js +267 -222
- package/lib/empty/default.js +16 -21
- package/lib/empty/guide.js +201 -184
- package/lib/empty/index.js +25 -20
- package/lib/empty/style/index.d.ts +2 -5
- package/lib/empty/style/index.js +9 -10
- package/lib/fonts/Inter-Medium.woff2 +0 -0
- package/lib/fonts/Inter-Regular.woff2 +0 -0
- package/lib/fonts/Inter-SemiBold.woff2 +0 -0
- package/lib/form/FormItem.d.ts +2 -1
- package/lib/form/FormItem.js +19 -8
- package/lib/form/index.js +8 -5
- package/lib/form/style/index.d.ts +2 -5
- package/lib/form/style/index.js +28 -7
- package/lib/grid/col.js +2 -1
- package/lib/grid/row.js +2 -1
- package/lib/index.d.ts +4 -3
- package/lib/index.js +3 -1
- package/lib/input/Input.d.ts +2 -0
- package/lib/input/Input.js +37 -13
- package/lib/input/Password.js +22 -4
- package/lib/input/Search.js +32 -12
- package/lib/input/TextArea.js +22 -4
- package/lib/input/style/index.d.ts +6 -0
- package/lib/input/style/index.js +74 -0
- package/lib/input-number/index.d.ts +2 -1
- package/lib/input-number/index.js +19 -3
- package/lib/input-number/style/index.d.ts +6 -0
- package/lib/{_util/genStyle.js → input-number/style/index.js} +22 -17
- package/lib/list/index.js +3 -2
- package/lib/locale/en-US.js +3 -0
- package/lib/locale/index.d.ts +2 -0
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +63 -0
- package/lib/locale/zh-CN.js +3 -0
- package/lib/locale/zh-TW.js +3 -0
- package/lib/lottie/index.js +2 -1
- package/lib/modal/Modal.js +35 -11
- package/lib/modal/Progress.js +9 -5
- package/lib/modal/style/index.d.ts +2 -5
- package/lib/modal/style/index.js +81 -24
- package/lib/radio/index.js +4 -3
- package/lib/radio/style/index.d.ts +2 -5
- package/lib/radio/style/index.js +17 -8
- package/lib/result/403.js +156 -121
- package/lib/result/404.js +328 -267
- package/lib/result/500.js +295 -257
- package/lib/result/Error.js +127 -99
- package/lib/result/Processing.js +246 -213
- package/lib/result/Success.js +233 -169
- package/lib/result/Warning.js +611 -515
- package/lib/result/index.d.ts +2 -2
- package/lib/result/index.js +14 -13
- package/lib/result/style/index.d.ts +2 -5
- package/lib/result/style/index.js +3 -6
- package/lib/segmented/index.d.ts +1 -0
- package/lib/segmented/index.js +17 -6
- package/lib/segmented/style/index.d.ts +1 -4
- package/lib/segmented/style/index.js +4 -6
- package/lib/select/index.js +4 -3
- package/lib/select/style/index.d.ts +2 -5
- package/lib/select/style/index.js +7 -7
- package/lib/slider/index.js +4 -3
- package/lib/slider/style/index.d.ts +2 -5
- package/lib/slider/style/index.js +12 -11
- package/lib/space/index.js +3 -2
- package/lib/space/style/index.d.ts +2 -5
- package/lib/space/style/index.js +3 -6
- package/lib/spin/index.js +7 -6
- package/lib/spin/style/index.d.ts +2 -5
- package/lib/spin/style/index.js +26 -28
- package/lib/static-function/index.js +7 -1
- package/lib/style/cssVariables.d.ts +25 -0
- package/lib/style/cssVariables.js +261 -0
- package/lib/style/cssVariablesMeta.d.ts +24 -0
- package/lib/style/cssVariablesMeta.js +1059 -0
- package/lib/style/global.d.ts +8 -0
- package/lib/style/global.js +176 -0
- package/lib/style/reset.css +2 -1
- package/lib/switch/index.js +4 -3
- package/lib/switch/style/index.d.ts +2 -5
- package/lib/switch/style/index.js +3 -6
- package/lib/table/index.d.ts +1 -4
- package/lib/table/index.js +114 -68
- package/lib/table/style/index.d.ts +2 -5
- package/lib/table/style/index.js +68 -32
- package/lib/tabs/index.js +12 -7
- package/lib/tabs/style/index.d.ts +2 -5
- package/lib/tabs/style/index.js +12 -8
- package/lib/tag/index.d.ts +1 -0
- package/lib/tag/index.js +18 -8
- package/lib/tag/style/index.d.ts +3 -8
- package/lib/tag/style/index.js +45 -36
- package/lib/theme/compact.d.ts +1 -1
- package/lib/theme/compact.js +1 -5
- package/lib/theme/dark.d.ts +1 -48
- package/lib/theme/default.d.ts +48 -2
- package/lib/theme/default.js +412 -79
- package/lib/theme/index.d.ts +20 -57
- package/lib/theme/interface.d.ts +130 -0
- package/lib/theme/style/aliyun.less +86 -86
- package/lib/theme/style/compact.less +199 -170
- package/lib/theme/style/dark.less +103 -103
- package/lib/theme/style/default.less +202 -173
- package/lib/tooltip/MouseTooltip.js +43 -39
- package/lib/tooltip/ReactStickyMouseTooltip.js +5 -4
- package/lib/tooltip/index.js +17 -13
- package/lib/tooltip/style/index.d.ts +2 -5
- package/lib/tooltip/style/index.js +10 -13
- package/lib/tree-select/index.js +4 -3
- package/lib/tree-select/style/index.d.ts +2 -5
- package/lib/tree-select/style/index.js +3 -6
- package/lib/typography/Link.js +7 -6
- package/lib/typography/Paragraph.js +7 -6
- package/lib/typography/Text.d.ts +1 -0
- package/lib/typography/Text.js +9 -8
- package/lib/typography/Title.js +7 -6
- package/lib/typography/hooks/useClassName.d.ts +1 -1
- package/lib/typography/hooks/useClassName.js +3 -2
- package/lib/typography/index.d.ts +12 -1
- package/lib/typography/index.js +6 -5
- package/lib/typography/style/index.d.ts +2 -5
- package/lib/typography/style/index.js +34 -26
- package/package.json +11 -10
- package/dist/static/Inter.f6bcdfb6.woff2 +0 -0
- package/es/_util/genStyle.d.ts +0 -2
- package/es/_util/getWeakenBorderColor.d.ts +0 -1
- package/es/_util/getWeakenBorderColor.js +0 -4
- package/es/fonts/Inter.woff2 +0 -0
- package/es/global.css +0 -48
- package/lib/_util/genStyle.d.ts +0 -2
- package/lib/_util/getWeakenBorderColor.d.ts +0 -1
- package/lib/fonts/Inter.woff2 +0 -0
- package/lib/global.css +0 -48
|
@@ -20,20 +20,59 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var style_exports = {};
|
|
21
21
|
__export(style_exports, {
|
|
22
22
|
default: () => style_default,
|
|
23
|
-
genButtonStyle: () => genButtonStyle
|
|
23
|
+
genButtonStyle: () => genButtonStyle,
|
|
24
|
+
genPresetColorStyle: () => genPresetColorStyle
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(style_exports);
|
|
27
|
+
var import_interface = require("../../theme/interface");
|
|
26
28
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
+
var genPresetColorStyle = (token) => {
|
|
30
|
+
const { componentCls } = token;
|
|
31
|
+
const addPresetColors = ["primary", "dangerous"];
|
|
32
|
+
return [...import_interface.PresetColors, ...addPresetColors].reduce(
|
|
33
|
+
(prev, colorKey) => {
|
|
34
|
+
const colorKeyMap = {
|
|
35
|
+
primary: "blue",
|
|
36
|
+
dangerous: "red"
|
|
37
|
+
};
|
|
38
|
+
const bgColor = addPresetColors.includes(colorKey) ? token[`${colorKeyMap[colorKey]}4`] : token[`${colorKey}6`];
|
|
39
|
+
return {
|
|
40
|
+
...prev,
|
|
41
|
+
[`&${componentCls}-color-${colorKey}:hover`]: {
|
|
42
|
+
color: token.colorTextLightSolid,
|
|
43
|
+
background: bgColor,
|
|
44
|
+
borderColor: bgColor
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
{}
|
|
49
|
+
);
|
|
29
50
|
};
|
|
30
|
-
var
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
51
|
+
var genButtonStyle = (token) => {
|
|
52
|
+
const { componentCls } = token;
|
|
53
|
+
return {
|
|
54
|
+
[`${componentCls}`]: {
|
|
55
|
+
// remove box-shadow for button
|
|
56
|
+
boxShadow: "none !important",
|
|
57
|
+
[`&${componentCls}-variant-outlined, &${componentCls}-variant-dashed`]: {
|
|
58
|
+
[`&:not(:disabled):not(${componentCls}-disabled):hover`]: {
|
|
59
|
+
[`&:not(${componentCls}-color-dangerous)`]: {
|
|
60
|
+
borderColor: token.gray7,
|
|
61
|
+
color: token.colorText
|
|
62
|
+
},
|
|
63
|
+
[`&:not(${componentCls}-loading)`]: {
|
|
64
|
+
...genPresetColorStyle(token)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
35
70
|
};
|
|
71
|
+
var style_default = (0, import_genComponentStyleHook.genStyleHooks)("Button", (token) => {
|
|
72
|
+
return [genButtonStyle(token)];
|
|
73
|
+
});
|
|
36
74
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
75
|
0 && (module.exports = {
|
|
38
|
-
genButtonStyle
|
|
76
|
+
genButtonStyle,
|
|
77
|
+
genPresetColorStyle
|
|
39
78
|
});
|
package/lib/card/index.d.ts
CHANGED
|
@@ -5,9 +5,20 @@ export * from 'antd/es/card';
|
|
|
5
5
|
export interface CardTabListType extends AntCardTabListType {
|
|
6
6
|
tag?: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
+
export interface CardLocale {
|
|
9
|
+
viewDocument?: string;
|
|
10
|
+
}
|
|
8
11
|
export interface CardProps extends AntCardProps {
|
|
12
|
+
subTitle?: React.ReactNode;
|
|
13
|
+
document?: string | React.MouseEventHandler<HTMLAnchorElement> | React.ReactNode;
|
|
9
14
|
divided?: boolean;
|
|
15
|
+
gray?: boolean;
|
|
10
16
|
tabList?: CardTabListType[];
|
|
17
|
+
collapsible?: boolean;
|
|
18
|
+
defaultCollapsed?: boolean;
|
|
19
|
+
collapsed?: boolean;
|
|
20
|
+
onCollapse?: (collapsed: boolean) => void;
|
|
21
|
+
locale?: CardLocale;
|
|
11
22
|
}
|
|
12
23
|
declare const _default: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>> & {
|
|
13
24
|
Grid: React.FC<import("antd/es/card").CardGridProps>;
|
package/lib/card/index.js
CHANGED
|
@@ -37,36 +37,148 @@ var import_util = require("@oceanbase/util");
|
|
|
37
37
|
var import_antd = require("antd");
|
|
38
38
|
var import_classnames = __toESM(require("classnames"));
|
|
39
39
|
var import_react = __toESM(require("react"));
|
|
40
|
+
var import_icons = require("@oceanbase/icons");
|
|
40
41
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
42
|
+
var import_en_US = __toESM(require("../locale/en-US"));
|
|
41
43
|
var import_util2 = require("../_util");
|
|
44
|
+
var import_theme = __toESM(require("../theme"));
|
|
42
45
|
var import_style = __toESM(require("./style"));
|
|
43
46
|
__reExport(card_exports, require("antd/es/card/Card"), module.exports);
|
|
44
47
|
__reExport(card_exports, require("antd/es/card"), module.exports);
|
|
48
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
49
|
var Card = import_react.default.forwardRef(
|
|
46
50
|
({
|
|
47
51
|
children,
|
|
48
52
|
size,
|
|
49
53
|
title,
|
|
54
|
+
subTitle,
|
|
55
|
+
document,
|
|
56
|
+
extra,
|
|
50
57
|
tabList,
|
|
58
|
+
tabProps,
|
|
59
|
+
tabBarExtraContent,
|
|
51
60
|
divided: outerDivided,
|
|
61
|
+
gray,
|
|
52
62
|
prefixCls: customizePrefixCls,
|
|
53
63
|
bodyStyle,
|
|
54
64
|
styles,
|
|
55
65
|
className,
|
|
66
|
+
collapsible,
|
|
67
|
+
defaultCollapsed,
|
|
68
|
+
collapsed: outerCollapsed,
|
|
69
|
+
onCollapse,
|
|
70
|
+
locale: customLocale,
|
|
56
71
|
...restProps
|
|
57
72
|
}, ref) => {
|
|
58
73
|
var _a;
|
|
59
|
-
const {
|
|
74
|
+
const {
|
|
75
|
+
getPrefixCls,
|
|
76
|
+
card: contextCard,
|
|
77
|
+
locale: contextLocale
|
|
78
|
+
} = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
79
|
+
const { token } = import_theme.default.useToken();
|
|
60
80
|
const divided = outerDivided ?? (contextCard == null ? void 0 : contextCard.divided) ?? true;
|
|
81
|
+
const cardLocale = {
|
|
82
|
+
...import_en_US.default.Card,
|
|
83
|
+
...contextLocale == null ? void 0 : contextLocale.Card,
|
|
84
|
+
...customLocale
|
|
85
|
+
};
|
|
61
86
|
const prefixCls = getPrefixCls("card", customizePrefixCls);
|
|
62
87
|
const tabsPrefixCls = getPrefixCls("tabs", customizePrefixCls);
|
|
63
|
-
const
|
|
88
|
+
const [wrapCSSVar] = (0, import_style.default)(prefixCls, tabsPrefixCls);
|
|
89
|
+
const [internalCollapsed, setInternalCollapsed] = (0, import_react.useState)(defaultCollapsed ?? false);
|
|
90
|
+
const collapsed = outerCollapsed !== void 0 ? outerCollapsed : internalCollapsed;
|
|
91
|
+
const handleCollapse = (0, import_react.useCallback)(() => {
|
|
92
|
+
const newCollapsed = !collapsed;
|
|
93
|
+
if (outerCollapsed === void 0) {
|
|
94
|
+
setInternalCollapsed(newCollapsed);
|
|
95
|
+
}
|
|
96
|
+
onCollapse == null ? void 0 : onCollapse(newCollapsed);
|
|
97
|
+
}, [collapsed, outerCollapsed, onCollapse]);
|
|
98
|
+
const documentLink = typeof document === "string" ? document : void 0;
|
|
99
|
+
const documentClick = typeof document === "function" ? document : void 0;
|
|
100
|
+
const cardTitle = (0, import_react.useMemo)(() => {
|
|
101
|
+
if (!collapsible && !subTitle && !document) {
|
|
102
|
+
return title;
|
|
103
|
+
}
|
|
104
|
+
if (!title) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
const titleContent = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
108
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: title }),
|
|
109
|
+
(subTitle || document) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { className: `${prefixCls}-sub-title-wrapper`, size: "small", children: [
|
|
110
|
+
subTitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-sub-title`, children: subTitle }),
|
|
111
|
+
document && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { size: "small", children: [
|
|
112
|
+
document && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Divider, { type: "vertical", className: `${prefixCls}-document-divider` }),
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tooltip, { title: cardLocale.viewDocument, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
114
|
+
"a",
|
|
115
|
+
{
|
|
116
|
+
href: documentLink,
|
|
117
|
+
target: "_blank",
|
|
118
|
+
rel: "noopener noreferrer",
|
|
119
|
+
onClick: documentClick,
|
|
120
|
+
className: `${prefixCls}-document-icon`,
|
|
121
|
+
children: documentLink || documentClick ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DocumentIcon, { className: `${prefixCls}-document-default-icon` }) : document
|
|
122
|
+
}
|
|
123
|
+
) })
|
|
124
|
+
] })
|
|
125
|
+
] })
|
|
126
|
+
] });
|
|
127
|
+
if (!collapsible) {
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
className: `${prefixCls}-title-wrapper`,
|
|
132
|
+
style: { display: "flex", alignItems: "center" },
|
|
133
|
+
children: titleContent
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
138
|
+
"div",
|
|
139
|
+
{
|
|
140
|
+
className: `${prefixCls}-title-wrapper`,
|
|
141
|
+
onClick: handleCollapse,
|
|
142
|
+
style: { cursor: "pointer", display: "flex", alignItems: "center" },
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
145
|
+
import_icons.CaretRightFilled,
|
|
146
|
+
{
|
|
147
|
+
className: `${prefixCls}-collapsible-icon`,
|
|
148
|
+
style: {
|
|
149
|
+
transition: `transform ${token.motionDurationMid}`,
|
|
150
|
+
transform: collapsed ? void 0 : "rotate(90deg)",
|
|
151
|
+
color: token.colorIcon,
|
|
152
|
+
marginRight: token.marginXS
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
titleContent
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}, [
|
|
161
|
+
collapsible,
|
|
162
|
+
title,
|
|
163
|
+
subTitle,
|
|
164
|
+
document,
|
|
165
|
+
documentLink,
|
|
166
|
+
documentClick,
|
|
167
|
+
collapsed,
|
|
168
|
+
prefixCls,
|
|
169
|
+
token,
|
|
170
|
+
handleCollapse,
|
|
171
|
+
cardLocale.viewDocument
|
|
172
|
+
]);
|
|
64
173
|
const noBodyHorizontalPadding = (0, import_util2.isHorizontalPaddingZero)(bodyStyle == null ? void 0 : bodyStyle.padding) || (0, import_util2.isHorizontalPaddingZero)((_a = styles == null ? void 0 : styles.body) == null ? void 0 : _a.padding);
|
|
65
174
|
const cardCls = (0, import_classnames.default)(
|
|
66
175
|
{
|
|
67
|
-
[`${prefixCls}-has-
|
|
176
|
+
[`${prefixCls}-has-head`]: !!(title || extra || tabList || tabBarExtraContent),
|
|
68
177
|
[`${prefixCls}-no-divider`]: !divided,
|
|
69
|
-
[`${prefixCls}-
|
|
178
|
+
[`${prefixCls}-gray`]: gray,
|
|
179
|
+
[`${prefixCls}-no-body-horizontal-padding`]: noBodyHorizontalPadding,
|
|
180
|
+
[`${prefixCls}-collapsible`]: collapsible,
|
|
181
|
+
[`${prefixCls}-collapsed`]: collapsed
|
|
70
182
|
},
|
|
71
183
|
className
|
|
72
184
|
);
|
|
@@ -74,26 +186,37 @@ var Card = import_react.default.forwardRef(
|
|
|
74
186
|
if (!(0, import_util.isNullValue)(item.tag)) {
|
|
75
187
|
return {
|
|
76
188
|
...item,
|
|
77
|
-
tab: /* @__PURE__ */
|
|
189
|
+
tab: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { size: 4, children: [
|
|
190
|
+
item.tab,
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tag, { bordered: false, className: `${tabsPrefixCls}-tab-tag`, children: item.tag })
|
|
192
|
+
] })
|
|
78
193
|
};
|
|
79
194
|
}
|
|
80
195
|
return item;
|
|
81
196
|
});
|
|
82
|
-
return
|
|
83
|
-
/* @__PURE__ */
|
|
197
|
+
return wrapCSSVar(
|
|
198
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
199
|
import_antd.Card,
|
|
85
200
|
{
|
|
86
201
|
ref,
|
|
87
202
|
size,
|
|
88
|
-
title,
|
|
203
|
+
title: cardTitle,
|
|
204
|
+
extra,
|
|
89
205
|
tabList: newTabList,
|
|
206
|
+
tabBarExtraContent,
|
|
207
|
+
tabProps: {
|
|
208
|
+
size: size === "small" ? "small" : "middle",
|
|
209
|
+
...tabProps
|
|
210
|
+
},
|
|
90
211
|
prefixCls: customizePrefixCls,
|
|
91
|
-
bodyStyle
|
|
212
|
+
bodyStyle: {
|
|
213
|
+
...bodyStyle
|
|
214
|
+
},
|
|
92
215
|
styles,
|
|
93
216
|
className: cardCls,
|
|
94
|
-
...restProps
|
|
95
|
-
|
|
96
|
-
|
|
217
|
+
...restProps,
|
|
218
|
+
children
|
|
219
|
+
}
|
|
97
220
|
)
|
|
98
221
|
);
|
|
99
222
|
}
|
|
@@ -101,6 +224,31 @@ var Card = import_react.default.forwardRef(
|
|
|
101
224
|
if (process.env.NODE_ENV !== "production") {
|
|
102
225
|
Card.displayName = import_antd.Card.displayName;
|
|
103
226
|
}
|
|
227
|
+
var DocumentIcon = ({ className }) => {
|
|
228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
229
|
+
"svg",
|
|
230
|
+
{
|
|
231
|
+
width: "16",
|
|
232
|
+
height: "16",
|
|
233
|
+
viewBox: "0 0 16 16",
|
|
234
|
+
fill: "none",
|
|
235
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
236
|
+
className,
|
|
237
|
+
children: [
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { clipPath: "url(#clip0_61186_2038)", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
239
|
+
"path",
|
|
240
|
+
{
|
|
241
|
+
d: "M7.99992 4.66667C7.99992 3.95942 7.71897 3.28115 7.21887 2.78105C6.71877 2.28095 6.0405 2 5.33325 2H1.33325V12H5.99992C6.53035 12 7.03906 12.2107 7.41413 12.5858C7.78921 12.9609 7.99992 13.4696 7.99992 14M7.99992 4.66667V14M7.99992 4.66667C7.99992 3.95942 8.28087 3.28115 8.78097 2.78105C9.28106 2.28095 9.95934 2 10.6666 2H14.6666V12H9.99992C9.46949 12 8.96078 12.2107 8.5857 12.5858C8.21063 12.9609 7.99992 13.4696 7.99992 14",
|
|
242
|
+
stroke: "currentColor",
|
|
243
|
+
strokeLinecap: "round",
|
|
244
|
+
strokeLinejoin: "round"
|
|
245
|
+
}
|
|
246
|
+
) }),
|
|
247
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("clipPath", { id: "clip0_61186_2038", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
};
|
|
104
252
|
var card_default = Object.assign(Card, {
|
|
105
253
|
Grid: import_antd.Card.Grid,
|
|
106
254
|
Meta: import_antd.Card.Meta,
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
|
-
import type { FullToken, GenerateStyle } from '
|
|
3
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
4
4
|
export type CardToken = FullToken<'Card'> & {
|
|
5
5
|
tabsComponentCls: string;
|
|
6
6
|
tabsPrefixCls: string;
|
|
7
7
|
};
|
|
8
8
|
export declare const genTableStyle: (padding: number, token: Partial<CardToken>) => CSSObject;
|
|
9
9
|
export declare const genCardStyle: GenerateStyle<CardToken>;
|
|
10
|
-
declare const _default: (prefixCls: string, tabsPrefixCls: string) =>
|
|
11
|
-
wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
12
|
-
hashId: string;
|
|
13
|
-
};
|
|
10
|
+
declare const _default: (prefixCls: string, tabsPrefixCls: string) => readonly [(node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, string, string];
|
|
14
11
|
export default _default;
|
package/lib/card/style/index.js
CHANGED
|
@@ -55,19 +55,40 @@ var genTableStyle = (padding, token) => {
|
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
var genCardStyle = (token) => {
|
|
58
|
-
|
|
58
|
+
var _a;
|
|
59
|
+
const { componentCls, antCls, tabsComponentCls, tabsPrefixCls, paddingSM, paddingLG, calc } = token;
|
|
59
60
|
const tableComponentCls = `${antCls}-table`;
|
|
60
61
|
return {
|
|
61
62
|
[`${componentCls}`]: {
|
|
62
|
-
// nested Card style
|
|
63
|
-
[`${componentCls}:not(${componentCls}-bordered):not(${componentCls}-type-inner)`]: {
|
|
64
|
-
boxShadow: "none"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
[`${componentCls}${componentCls}-no-divider`]: {
|
|
68
63
|
[`${componentCls}-head`]: {
|
|
69
|
-
//
|
|
70
|
-
|
|
64
|
+
// subTitle style
|
|
65
|
+
[`${componentCls}-sub-title-wrapper`]: {
|
|
66
|
+
marginInlineStart: token.marginXS
|
|
67
|
+
},
|
|
68
|
+
[`${componentCls}-sub-title`]: {
|
|
69
|
+
fontWeight: "normal",
|
|
70
|
+
fontSize: token.fontSize,
|
|
71
|
+
color: token.colorTextDescription
|
|
72
|
+
},
|
|
73
|
+
[`${componentCls}-document-divider`]: {
|
|
74
|
+
marginInline: 0,
|
|
75
|
+
height: token.size
|
|
76
|
+
},
|
|
77
|
+
[`${componentCls}-document-icon`]: {
|
|
78
|
+
display: "inline-block",
|
|
79
|
+
color: token.colorIcon,
|
|
80
|
+
fontSize: token.fontSizeLG,
|
|
81
|
+
cursor: "pointer",
|
|
82
|
+
"&:hover": {
|
|
83
|
+
color: token.colorLinkHover
|
|
84
|
+
},
|
|
85
|
+
"&:active": {
|
|
86
|
+
color: token.colorLinkActive
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
[`${componentCls}-document-default-icon`]: {
|
|
90
|
+
marginTop: (token.controlHeight - token.fontSizeLG) / 2
|
|
91
|
+
},
|
|
71
92
|
// remove divider for top and bottom tabs
|
|
72
93
|
[tabsComponentCls]: {
|
|
73
94
|
[`&${tabsComponentCls}-top, &${tabsComponentCls}-bottom`]: {
|
|
@@ -76,16 +97,61 @@ var genCardStyle = (token) => {
|
|
|
76
97
|
}
|
|
77
98
|
}
|
|
78
99
|
}
|
|
100
|
+
},
|
|
101
|
+
[`${componentCls}-body`]: {
|
|
102
|
+
paddingTop: token.padding
|
|
103
|
+
},
|
|
104
|
+
// nested Card style
|
|
105
|
+
[`${componentCls}:not(${componentCls}-bordered):not(${componentCls}-type-inner)`]: {
|
|
106
|
+
boxShadow: "none"
|
|
107
|
+
},
|
|
108
|
+
// nested and bordered Card radius
|
|
109
|
+
[`${componentCls}${componentCls}-bordered`]: {
|
|
110
|
+
borderRadius: calc(token.borderRadiusLG).sub(2).equal(),
|
|
111
|
+
[`${componentCls}${componentCls}-bordered`]: {
|
|
112
|
+
borderRadius: token.borderRadius,
|
|
113
|
+
[`${componentCls}${componentCls}-bordered`]: {
|
|
114
|
+
borderRadius: token.borderRadiusSM
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
[`${componentCls}${componentCls}-has-head${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
|
120
|
+
[`${componentCls}-body`]: {
|
|
121
|
+
paddingTop: 0
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
[`${componentCls}:not(${componentCls}-has-head)`]: {
|
|
125
|
+
[`${componentCls}-body`]: {
|
|
126
|
+
paddingTop: paddingLG
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
[`${componentCls}${componentCls}-no-divider`]: {
|
|
130
|
+
[`${componentCls}-head`]: {
|
|
131
|
+
// hide bottom border by setting borderBottomColor to transparent
|
|
132
|
+
borderBottomColor: "transparent"
|
|
79
133
|
}
|
|
80
134
|
},
|
|
81
135
|
[`${componentCls}${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
|
136
|
+
[`${componentCls}-head`]: {
|
|
137
|
+
paddingTop: token.paddingLG,
|
|
138
|
+
paddingBottom: token.padding
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
[`${componentCls}${componentCls}-small:not(${componentCls}-has-head)`]: {
|
|
82
142
|
[`${componentCls}-body`]: {
|
|
83
|
-
|
|
143
|
+
paddingTop: paddingSM
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
[`${componentCls}${componentCls}-small${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
|
147
|
+
[`${componentCls}-head`]: {
|
|
148
|
+
paddingTop: token.paddingSM,
|
|
149
|
+
paddingBottom: token.paddingXS
|
|
84
150
|
}
|
|
85
151
|
},
|
|
86
|
-
[`${componentCls}-small
|
|
152
|
+
[`${componentCls}-small`]: {
|
|
87
153
|
[`${componentCls}-body`]: {
|
|
88
|
-
|
|
154
|
+
paddingTop: token.paddingXS
|
|
89
155
|
}
|
|
90
156
|
},
|
|
91
157
|
[`${componentCls}-small${componentCls}-contain-tabs >${componentCls}-head`]: {
|
|
@@ -94,11 +160,13 @@ var genCardStyle = (token) => {
|
|
|
94
160
|
}
|
|
95
161
|
},
|
|
96
162
|
[`${componentCls}${componentCls}-contain-tabs`]: {
|
|
97
|
-
[`${componentCls}-head`]:
|
|
98
|
-
...
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
163
|
+
[`${componentCls}-head`]: {
|
|
164
|
+
...(0, import_style.genTabsStyle)({
|
|
165
|
+
...token,
|
|
166
|
+
componentCls: tabsComponentCls,
|
|
167
|
+
prefixCls: tabsPrefixCls
|
|
168
|
+
})
|
|
169
|
+
}
|
|
102
170
|
},
|
|
103
171
|
[`${componentCls}${componentCls}-contain-grid`]: {
|
|
104
172
|
[`${componentCls}-head`]: {
|
|
@@ -113,21 +181,64 @@ var genCardStyle = (token) => {
|
|
|
113
181
|
}
|
|
114
182
|
},
|
|
115
183
|
// reduce margin between card title and table
|
|
116
|
-
[`&${componentCls}-has-
|
|
184
|
+
[`&${componentCls}-has-head${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
|
117
185
|
[`${componentCls}-body`]: {
|
|
118
186
|
[`& > ${tableComponentCls}-wrapper ${tableComponentCls}:not(${tableComponentCls}-bordered):first-child`]: {
|
|
119
|
-
marginTop:
|
|
187
|
+
marginTop: calc((_a = token.Table) == null ? void 0 : _a.cellPaddingBlock).mul(-1).equal()
|
|
120
188
|
}
|
|
121
189
|
}
|
|
122
190
|
},
|
|
123
191
|
// no body horizontal padding card
|
|
124
192
|
[`${componentCls}${componentCls}-no-body-horizontal-padding`]: genTableStyle(paddingLG, token),
|
|
125
193
|
// no body horizontal padding small card
|
|
126
|
-
[`${componentCls}${componentCls}-no-body-horizontal-padding${componentCls}-small`]: genTableStyle(paddingSM, token)
|
|
194
|
+
[`${componentCls}${componentCls}-no-body-horizontal-padding${componentCls}-small`]: genTableStyle(paddingSM, token),
|
|
195
|
+
// collapsible card style
|
|
196
|
+
[`${componentCls}${componentCls}-collapsible`]: {
|
|
197
|
+
[`${componentCls}-title-wrapper`]: {
|
|
198
|
+
userSelect: "none",
|
|
199
|
+
[`${componentCls}-collapsible-icon`]: {
|
|
200
|
+
fontSize: token.fontSizeLG
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
[`${componentCls}-body`]: {
|
|
204
|
+
overflow: "hidden"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
[`${componentCls}${componentCls}-collapsible${componentCls}-collapsed`]: {
|
|
208
|
+
[`${componentCls}-body`]: {
|
|
209
|
+
maxHeight: 0,
|
|
210
|
+
paddingTop: 0,
|
|
211
|
+
paddingBottom: 0,
|
|
212
|
+
opacity: 0,
|
|
213
|
+
overflow: "hidden",
|
|
214
|
+
border: "none",
|
|
215
|
+
margin: 0
|
|
216
|
+
},
|
|
217
|
+
// hide bottom border of head when collapsed, avoid double border
|
|
218
|
+
[`${componentCls}-head`]: {
|
|
219
|
+
borderBottomColor: "transparent"
|
|
220
|
+
},
|
|
221
|
+
[`&${componentCls}-no-divider`]: {
|
|
222
|
+
[`${componentCls}-head`]: {
|
|
223
|
+
paddingBottom: paddingLG
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
[`&${componentCls}-no-divider${componentCls}-small`]: {
|
|
227
|
+
[`${componentCls}-head`]: {
|
|
228
|
+
paddingBottom: paddingSM
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
// gray background card style
|
|
233
|
+
[`${componentCls}${componentCls}-gray`]: {
|
|
234
|
+
boxShadow: "none",
|
|
235
|
+
borderRadius: token.borderRadiusMD,
|
|
236
|
+
backgroundColor: token.colorFillQuaternary
|
|
237
|
+
}
|
|
127
238
|
};
|
|
128
239
|
};
|
|
129
240
|
var style_default = (prefixCls, tabsPrefixCls) => {
|
|
130
|
-
const useStyle = (0, import_genComponentStyleHook.
|
|
241
|
+
const useStyle = (0, import_genComponentStyleHook.genStyleHooks)("Card", (token) => {
|
|
131
242
|
return [
|
|
132
243
|
genCardStyle({
|
|
133
244
|
...token,
|
package/lib/checkbox/index.js
CHANGED
|
@@ -39,14 +39,15 @@ var import_react = __toESM(require("react"));
|
|
|
39
39
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
40
40
|
var import_style = __toESM(require("./style"));
|
|
41
41
|
__reExport(checkbox_exports, require("antd/es/checkbox"), module.exports);
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
43
|
var InternalCheckbox = import_react.default.forwardRef(
|
|
43
44
|
({ prefixCls: customizePrefixCls, className, ...restProps }, ref) => {
|
|
44
45
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
45
46
|
const prefixCls = getPrefixCls("checkbox", customizePrefixCls);
|
|
46
|
-
const
|
|
47
|
+
const [wrapCSSVar] = (0, import_style.default)(prefixCls);
|
|
47
48
|
const checkboxCls = (0, import_classnames.default)(className);
|
|
48
|
-
return
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
return wrapCSSVar(
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
51
|
import_antd.Checkbox,
|
|
51
52
|
{
|
|
52
53
|
ref,
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type CheckboxToken = FullToken<'Checkbox'>;
|
|
4
4
|
export declare const genCheckboxStyle: GenerateStyle<CheckboxToken>;
|
|
5
|
-
declare const _default: (prefixCls: string) =>
|
|
6
|
-
wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
7
|
-
hashId: string;
|
|
8
|
-
};
|
|
5
|
+
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, string, string];
|
|
9
6
|
export default _default;
|
|
@@ -23,26 +23,28 @@ __export(style_exports, {
|
|
|
23
23
|
genCheckboxStyle: () => genCheckboxStyle
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_cssinjs = require("@ant-design/cssinjs");
|
|
26
27
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
28
|
var genCheckboxStyle = (token) => {
|
|
28
|
-
const { componentCls, fontSize,
|
|
29
|
+
const { componentCls, fontSize, lineHeight, lineWidth, controlInteractiveSize, calc } = token;
|
|
30
|
+
const translateY = calc(fontSize).mul(lineHeight).sub(controlInteractiveSize).sub(lineWidth).div(2).equal();
|
|
29
31
|
return {
|
|
30
32
|
[`${componentCls}-wrapper`]: {
|
|
31
33
|
[`${componentCls}`]: {
|
|
32
34
|
alignSelf: "baseline",
|
|
33
35
|
[`${componentCls}-inner`]: {
|
|
34
|
-
transform: `translate(0px, ${(
|
|
36
|
+
transform: `translate(0px, ${(0, import_cssinjs.unit)(translateY)})`
|
|
35
37
|
}
|
|
38
|
+
},
|
|
39
|
+
[`&:hover ${componentCls}:not(${componentCls}-disabled):not(${componentCls}-checked) ${componentCls}-inner`]: {
|
|
40
|
+
borderColor: token.gray7
|
|
36
41
|
}
|
|
37
42
|
}
|
|
38
43
|
};
|
|
39
44
|
};
|
|
40
|
-
var style_default = (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
44
|
-
return useStyle(prefixCls);
|
|
45
|
-
};
|
|
45
|
+
var style_default = (0, import_genComponentStyleHook.genStyleHooks)("Checkbox", (token) => {
|
|
46
|
+
return [genCheckboxStyle(token)];
|
|
47
|
+
});
|
|
46
48
|
// Annotate the CommonJS export names for ESM import in node:
|
|
47
49
|
0 && (module.exports = {
|
|
48
50
|
genCheckboxStyle
|
|
@@ -32,9 +32,10 @@ __export(DefaultRenderEmpty_exports, {
|
|
|
32
32
|
default: () => DefaultRenderEmpty_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(DefaultRenderEmpty_exports);
|
|
35
|
-
var import_react =
|
|
35
|
+
var import_react = require("react");
|
|
36
36
|
var import__ = require(".");
|
|
37
37
|
var import_empty = __toESM(require("../empty"));
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
39
|
var DefaultRenderEmpty = (props) => {
|
|
39
40
|
const { componentName } = props;
|
|
40
41
|
const { getPrefixCls } = (0, import_react.useContext)(import__.ConfigContext);
|
|
@@ -45,9 +46,9 @@ var DefaultRenderEmpty = (props) => {
|
|
|
45
46
|
case "Cascader":
|
|
46
47
|
case "Transfer":
|
|
47
48
|
case "Mentions":
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_empty.default, { image: import_empty.default.PRESENTED_IMAGE_SIMPLE, className: `${prefix}-small` });
|
|
49
50
|
default:
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_empty.default, { image: import_empty.default.PRESENTED_IMAGE_SIMPLE });
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
54
|
var DefaultRenderEmpty_default = DefaultRenderEmpty;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
+
import type { ThemeConfig as AntThemeConfig, MappingAlgorithm } from 'antd';
|
|
2
|
+
import type { AliasToken, OverrideToken } from '../theme/interface';
|
|
1
3
|
export * from 'antd/es/config-provider/context';
|
|
4
|
+
type ComponentsConfig = {
|
|
5
|
+
[key in keyof OverrideToken]?: OverrideToken[key] & {
|
|
6
|
+
algorithm?: boolean | MappingAlgorithm | MappingAlgorithm[];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export interface ThemeConfig extends AntThemeConfig {
|
|
10
|
+
token?: Partial<AliasToken>;
|
|
11
|
+
components?: ComponentsConfig;
|
|
12
|
+
}
|