@aplus-frontend/ui
Version:
136 lines (135 loc) • 3.44 kB
JavaScript
import { genComponentStyleHook as e } from "../../utils/cssinjs/index.mjs";
import { defaultToken as n } from "./token.mjs";
const o = (t) => {
const { componentCls: i } = t;
return {
[i]: {
display: "flex",
"& + &": {
marginBlockStart: t.spaceXS
},
[`${i}-tip`]: {
marginInlineStart: t.spaceXS,
color: t.textColor3
},
[`${i}-wrapper`]: {
display: "flex",
width: "100%"
},
[`${i}-status`]: {
width: "14px",
"&.ant-badge.ant-badge-status": {
lineHeight: t.lineHeight
}
},
[`${i}-icon`]: {
marginInlineEnd: t.spaceXL
},
[`${i}-trend-icon`]: {
width: 0,
height: 0,
borderInlineEnd: "3px solid transparent",
borderBlockEnd: "6px solid #000",
borderInlineStart: "3px solid transparent",
"&-up": {
transform: "rotate(0deg) translateY(-1px)"
},
"&-down": {
transform: "rotate(180deg) translateY(1px)"
}
},
[`${i}-content`]: {
width: "100%",
".ant-statistic-content": {
fontSize: t.fontSizeXXL,
lineHeight: t.lineHeightLG,
fontWeight: "bold"
}
},
[`${i}-description`]: {
width: "100%",
marginTop: "4px"
},
".ant-statistic-title": {
color: t.textColor2,
fontSize: t.fontSize,
lineHeight: t.lineHeight,
marginBlockEnd: t.space
},
"&-size-small": {
".ant-statistic-title": {
marginBlockEnd: t.spaceXS
},
[`${i}-content`]: {
"div.ant-statistic-content": {
fontSize: t.fontSizeXL,
lineHeight: t.lineHeightLG
}
}
},
[`${i}-trend-up`]: {
".ant-statistic-content": {
color: t.colorError
},
[`${i}-trend-icon`]: {
borderBlockEndColor: t.colorError
}
},
[`${i}-trend-down`]: {
".ant-statistic-content": {
color: t.colorSuccess
},
[`${i}-trend-icon`]: {
borderBlockEndColor: t.colorSuccess
}
},
[`${i}-layout-horizontal`]: {
display: "flex",
justifyContent: "space-between",
".ant-statistic-title": {
marginBlockEnd: 0,
color: t.textColor3,
fontSize: t.fontSize,
lineHeight: t.lineHeight,
fontWeight: "500"
},
".ant-statistic-content": {
color: t.textColor1,
fontSize: t.fontSize,
lineHeight: t.lineHeight,
fontWeight: "500"
}
},
[`${i}-layout-inline`]: {
display: "inline-flex",
".ant-statistic-title": {
marginInlineEnd: t.spaceSM,
marginBlockEnd: 0,
color: t.textColor3,
fontSize: t.fontSize,
lineHeight: t.lineHeight,
fontWeight: "500"
},
".ant-statistic-content": {
color: t.textColor1,
fontSize: t.fontSize,
lineHeight: t.lineHeight,
fontWeight: "500"
}
},
[`${i}-layout-vertical-center`]: {
display: "flex",
flexDirection: "column",
alignItems: "center"
}
}
};
}, a = e(
"ProCard.Statistic",
(t) => [o(t)],
n
);
export {
a as default,
o as genProCardStatisticsStyle
};