1 line
26 KiB
JSON
1 line
26 KiB
JSON
|
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { mergeToken } from '../../theme/internal';\nexport const genHoverStyle = token => ({\n borderColor: token.hoverBorderColor,\n backgroundColor: token.hoverBg\n});\nexport const genDisabledStyle = token => ({\n color: token.colorTextDisabled,\n backgroundColor: token.colorBgContainerDisabled,\n borderColor: token.colorBorder,\n boxShadow: 'none',\n cursor: 'not-allowed',\n opacity: 1,\n 'input[disabled], textarea[disabled]': {\n cursor: 'not-allowed'\n },\n '&:hover:not([disabled])': Object.assign({}, genHoverStyle(mergeToken(token, {\n hoverBorderColor: token.colorBorder,\n hoverBg: token.colorBgContainerDisabled\n })))\n});\n/* ============== Outlined ============== */\nexport const genBaseOutlinedStyle = (token, options) => ({\n background: token.colorBgContainer,\n borderWidth: token.lineWidth,\n borderStyle: token.lineType,\n borderColor: options.borderColor,\n '&:hover': {\n borderColor: options.hoverBorderColor,\n backgroundColor: token.hoverBg\n },\n '&:focus, &:focus-within': {\n borderColor: options.activeBorderColor,\n boxShadow: options.activeShadow,\n outline: 0,\n backgroundColor: token.activeBg\n }\n});\nconst genOutlinedStatusStyle = (token, options) => ({\n [`&${token.componentCls}-status-${options.status}:not(${token.componentCls}-disabled)`]: Object.assign(Object.assign({}, genBaseOutlinedStyle(token, options)), {\n [`${token.componentCls}-prefix, ${token.componentCls}-suffix`]: {\n color: options.affixColor\n }\n }),\n [`&${token.componentCls}-status-${options.status}${token.componentCls}-disabled`]: {\n borderColor: options.borderColor\n }\n});\nexport const genOutlinedStyle = (token, extraStyles) => ({\n '&-outlined': Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseOutlinedStyle(token, {\n borderColor: token.colorBorder,\n hoverBorderColor: token.hoverBorderColor,\n activeBorderColor: token.activeBorderColor,\n activeShadow: token.activeShadow\n })), {\n [`&${token.componentCls}-disabled, &[disabled]`]: Object.assign({}, genDisabledStyle(token))\n }), genOutlinedStatusStyle(token, {\n status: 'error',\n borderColor: token.colorError,\n hoverBorderColor: token.colorErrorBorderHover,\n activeBorderColor: token.colorError,\n activeShadow: token.errorActiveShadow,\n affixColor: token.colorError\n })), genOutlinedStatusStyle(token, {\n status: 'warning',\n borderColor: token.colorWarning,\n hoverBorderColor: token.colorWarningBorderHover,\n activeBorderColor: token.colorWarning,\n activeShadow: token.warningActiveShadow,\n affixColor: token.colorWarning\n })), extraStyles)\n});\nconst genOutlinedGroupStatusStyle = (token, options) => ({\n [`&${token.componentCls}-group-wrapper-status-${options.status}`]: {\n [`${token.componentCls}-group-addon`]: {\n borderColor: options.addonBorderColor,\n color: options.addonColor\n }\n }\n});\nexport const genOutlinedGroupStyle = token => ({\n '&-outlined': Object.assign(Object.assign(Object.assign({\n [`${token.componentCls}-group`]: {\n '&-addon': {\n background: token.addonBg,\n border: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`\n },\n '&-addon:first-child': {\n borderInlineEnd: 0\n },\n '&-addon:last-child': {\n borderInlineStart: 0\n }\n }\n }, genOutlinedGroupStatusStyle(token, {\n status: 'error',\n addonBorderColor: token.colorError,\n addonColor: token.colorErrorText\n })), genOutlinedGroupStatusStyle(token, {\n status: 'warning',\n addonBorderColor: token.colorWarning,\n addonColor: token.colorWarningText\n })), {\n [`&${token.componentCls}-group-wrapper-disabled`]: {\n [`${token.componentCls}-group-addon`]: Object.assign({}, genDisabledStyle(token))\n }\n })\n});\n/* ============ Borderless ============ */\nexport const genBorderlessStyle = (token, extraStyles) => {\n const {\n componentCls\n }
|