1 line
22 KiB
JSON
1 line
22 KiB
JSON
|
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { resetComponent, resetIcon } from '../../style';\nimport { genCollapseMotion } from '../../style/motion';\nimport { genStyleHooks, mergeToken } from '../../theme/internal';\nexport const genBaseStyle = token => {\n const {\n componentCls,\n contentBg,\n padding,\n headerBg,\n headerPadding,\n collapseHeaderPaddingSM,\n collapseHeaderPaddingLG,\n collapsePanelBorderRadius,\n lineWidth,\n lineType,\n colorBorder,\n colorText,\n colorTextHeading,\n colorTextDisabled,\n fontSizeLG,\n lineHeight,\n lineHeightLG,\n marginSM,\n paddingSM,\n paddingLG,\n paddingXS,\n motionDurationSlow,\n fontSizeIcon,\n contentPadding,\n fontHeight,\n fontHeightLG\n } = token;\n const borderBase = `${unit(lineWidth)} ${lineType} ${colorBorder}`;\n return {\n [componentCls]: Object.assign(Object.assign({}, resetComponent(token)), {\n backgroundColor: headerBg,\n border: borderBase,\n borderRadius: collapsePanelBorderRadius,\n '&-rtl': {\n direction: 'rtl'\n },\n [`& > ${componentCls}-item`]: {\n borderBottom: borderBase,\n '&:last-child': {\n [`\n &,\n & > ${componentCls}-header`]: {\n borderRadius: `0 0 ${unit(collapsePanelBorderRadius)} ${unit(collapsePanelBorderRadius)}`\n }\n },\n [`> ${componentCls}-header`]: {\n position: 'relative',\n // Compatible with old version of antd, should remove in next version\n display: 'flex',\n flexWrap: 'nowrap',\n alignItems: 'flex-start',\n padding: headerPadding,\n color: colorTextHeading,\n lineHeight,\n cursor: 'pointer',\n transition: `all ${motionDurationSlow}, visibility 0s`,\n [`> ${componentCls}-header-text`]: {\n flex: 'auto'\n },\n '&:focus': {\n outline: 'none'\n },\n // >>>>> Arrow\n [`${componentCls}-expand-icon`]: {\n height: fontHeight,\n display: 'flex',\n alignItems: 'center',\n paddingInlineEnd: marginSM\n },\n [`${componentCls}-arrow`]: Object.assign(Object.assign({}, resetIcon()), {\n fontSize: fontSizeIcon,\n // when `transform: rotate()` is applied to icon's root element\n transition: `transform ${motionDurationSlow}`,\n // when `transform: rotate()` is applied to icon's child element\n svg: {\n transition: `transform ${motionDurationSlow}`\n }\n }),\n // >>>>> Text\n [`${componentCls}-header-text`]: {\n marginInlineEnd: 'auto'\n }\n },\n [`${componentCls}-icon-collapsible-only`]: {\n cursor: 'unset',\n [`${componentCls}-expand-icon`]: {\n cursor: 'pointer'\n }\n }\n },\n [`${componentCls}-content`]: {\n color: colorText,\n backgroundColor: contentBg,\n borderTop: borderBase,\n [`& > ${componentCls}-content-box`]: {\n padding: contentPadding\n },\n '&-hidden': {\n display: 'none'\n }\n },\n '&-small': {\n [`> ${componentCls}-item`]: {\n [`> ${componentCls}-header`]: {\n padding: collapseHeaderPaddingSM,\n paddingInlineStart: paddingXS,\n [`> ${componentCls}-expand-icon`]: {\n // Arrow offset\n marginInlineStart: token.calc(paddingSM).sub(paddingXS).equal()\n }\n },\n [`> ${componentCls}-content > ${componentCls}-content-box`]: {\n padding: paddingSM\n }\n }\n },\n '&-large': {\n [`> ${componentCls}-item`]: {\n fontSize: fontSizeLG,\n lineHeight: lineHeightLG,\n [`> ${componentCls}-header`]: {\n padding: collapseHeaderPaddingLG,\n p
|