2024-01-15 15:41:40 +08:00
|
|
|
import { unit, type CSSObject } from '@ant-design/cssinjs';
|
|
|
|
|
2023-12-21 20:43:40 +08:00
|
|
|
import { genBorderlessStyle, genFilledStyle, genOutlinedStyle } from '../../input/style/variants';
|
2024-01-15 15:41:40 +08:00
|
|
|
import type { PickerToken } from './token';
|
|
|
|
|
|
|
|
const genVariantsStyle = (token: PickerToken): CSSObject => {
|
|
|
|
const { componentCls } = token;
|
2023-12-21 20:43:40 +08:00
|
|
|
|
2024-01-15 15:41:40 +08:00
|
|
|
return {
|
|
|
|
[componentCls]: [
|
|
|
|
{
|
|
|
|
...genOutlinedStyle(token),
|
|
|
|
...genFilledStyle(token),
|
|
|
|
...genBorderlessStyle(token),
|
|
|
|
},
|
|
|
|
// ========================= Multiple =========================
|
|
|
|
{
|
|
|
|
'&-outlined': {
|
|
|
|
[`&${componentCls}-multiple ${componentCls}-selection-item`]: {
|
|
|
|
background: token.multipleItemBg,
|
|
|
|
border: `${unit(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'&-filled': {
|
|
|
|
[`&${componentCls}-multiple ${componentCls}-selection-item`]: {
|
|
|
|
background: token.colorBgContainer,
|
|
|
|
border: `${unit(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'&-borderless': {
|
|
|
|
[`&${componentCls}-multiple ${componentCls}-selection-item`]: {
|
|
|
|
background: token.multipleItemBg,
|
|
|
|
border: `${unit(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
};
|
2023-12-21 20:43:40 +08:00
|
|
|
|
|
|
|
export default genVariantsStyle;
|