@yuntijs/ui
Version:
☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps
42 lines • 2.6 kB
JavaScript
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
import { createStyles } from 'antd-style';
export var getNumberBySize = function getNumberBySize(size) {
switch (size) {
case 'small':
{
return {
cardWidth: 144,
imgHeight: 32
};
}
case 'large':
{
return {
cardWidth: 200,
imgHeight: 64
};
}
default:
{
return {
cardWidth: 168,
imgHeight: 40
};
}
}
};
export var useStyles = createStyles(function (_ref, _ref2) {
var css = _ref.css,
token = _ref.token,
prefixCls = _ref.prefixCls;
var disabled = _ref2.disabled,
size = _ref2.size;
var _getNumberBySize = getNumberBySize(size),
cardWidth = _getNumberBySize.cardWidth;
return {
option: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n\n cursor: ", ";\n\n padding: ", "px;\n\n transition: all ", ";\n\n width: ", "px;\n min-height: 108px;\n\n ", "\n\n ", "\n\n div.", "-typography {\n margin-bottom: 0;\n }\n "])), token.colorBorder, token.borderRadius, disabled ? 'not-allowed' : 'pointer', token.padding, token.motionDurationFast, cardWidth, disabled && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n .", "-typography {\n color: ", ";\n &.", "-typography-secondary {\n color: ", ";\n }\n }\n "])), token.colorBgContainerDisabled, prefixCls, token.colorTextDisabled, prefixCls, token.colorTextDisabled), !disabled && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n &:hover {\n border-color: ", ";\n }\n "])), token.colorPrimaryBorderHover), prefixCls),
optionSelected: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-color: ", ";\n &:hover {\n border-color: ", ";\n }\n "])), token.colorPrimary, token.colorPrimaryActive),
check: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n right: ", "px;\n bottom: ", "px;\n color: ", ";\n "])), token.marginXS, token.marginXS, token.colorPrimary)
};
});