"use strict";
/**
 * @desc 按钮样式
 * @author denghuan
 */
Object.defineProperty(exports, "__esModule", { value: true });
const styled_components_1 = require("styled-components");
const color_tool_1 = require("../../_utils/color-tool");
const buttonStyle = styled_components_1.css `
  .ant-btn {
    border: none;
    height: 32px;
    padding-left: 22px;
    padding-right: 22px;
    min-width: 80px;
    font-weight: 500;

    &:before {
      opacity: 0;
    }

    &,
    &:hover,
    &:active,
    &:focus,
    &.normal {
      background-color: ${({ theme }) => theme.button.normal.bg};
      color: ${({ theme }) => theme.button.normal.title};
    }

    &.primary,
    &.ant-btn-primary {
      color: ${({ theme }) => theme.button.title};
      background-image: linear-gradient(
        180deg,
        ${({ theme }) => theme.button.primary.from} 0%,
        ${({ theme }) => theme.button.primary.to} 100%
      );

      &:hover {
        background-image: linear-gradient(
          180deg,
          ${({ theme }) => theme.button.primary.from} 0%,
          ${({ theme }) => color_tool_1.rgba(theme.button.primary.to, 0.8)} 100%
        );
      }

      &:active {
        background-image: linear-gradient(
          180deg,
          ${({ theme }) => color_tool_1.rgba(theme.button.primary.from, 0.8)} 0%,
          ${({ theme }) => color_tool_1.rgba(theme.button.primary.to, 0.8)} 100%
        );
      }
    }

    &&.link {
      color: ${({ theme }) => theme.main};
      background-color: transparent;
      font-weight: 400;

      &:hover {
        &:not([disabled]) {
          span {
            text-decoration: underline;
          }
        }
      }

      &:active {
        opacity: 0.8;
      }
    }

    &.danger {
      color: ${({ theme }) => theme.button.title};
      background-image: linear-gradient(
        180deg,
        ${({ theme }) => theme.button.danger.from} 0%,
        ${({ theme }) => theme.button.danger.to} 100%
      );

      &:hover,
      &:active {
        background-image: linear-gradient(
          180deg,
          ${({ theme }) => theme.button.danger.from} 0%,
          ${({ theme }) => color_tool_1.rgba(theme.button.danger.to, 0.7)} 100%
        );
      }
    }

    &&.outline {
      color: ${({ theme }) => theme.button.title};
      &:not([disabled]) {
        background: initial;
        color: ${({ theme }) => theme.main};
        border: 1px solid ${({ theme }) => theme.main};
      }

      &:active {
        opacity: 0.8;
      }
    }

    &[disabled]:not(.link) {
      opacity: 0.6;
      background: ${({ theme }) => theme.button.disabled.bg};
      color: ${({ theme }) => theme.button.disabled.title};
      font-weight: 300;
    }

    // 消除波纹动画
    &[ant-click-animating-without-extra-node='true']::after {
      animation: none;
    }

    & > .anticon + span,
    & > span + .anticon {
      margin-left: 6px;
    }
  }
`;
const ButtonStyle = styled_components_1.createGlobalStyle `${buttonStyle}`;
exports.default = ButtonStyle;
