@import '../styles/themes/themes.less';

@info-border-color: #c5daff;
@info-background-color: #f0f8ff;
@info-icon-color: #3a84ff;

@success-border-color: #94f5a4;
@success-background-color: #f2fff4;
@success-icon-color: #2dcb56;

@warning-border-color: #ffdfac;
@warning-background-color: #fff4e2;
@warning-icon-color: #ff9c01;

@danger-border-color: #ffd2d2;
@danger-background-color: #ffeded;
@danger-icon-color: #ea3636;

.@{bk-prefix}-alert {
  position: relative;
  font-size: @font-size-base;
  color: #63656e;
  text-align: left;
  word-wrap: break-word;
  border: @border-width-base @border-style-base;
  border-radius: @border-radius-base;

  .@{bk-prefix}-alert-icon-info {
    display: flex; // 修复 svg 对不齐的问题（svg 是一个 inline 元素）
    height: 16px;
    margin-right: 8px;
    font-size: 16px;
    line-height: 1;
  }

}

.@{bk-prefix}-alert-wraper {
  display: flex;
  padding: 8px 10px;
}

.@{bk-prefix}-alert-info {
  background-color: @info-background-color;
  border-color: @info-border-color;

  .@{bk-prefix}-alert-icon-info {
    color: @info-icon-color;
  }
}

.@{bk-prefix}-alert-success {
  background-color: @success-background-color;
  border-color: @success-border-color;

  .@{bk-prefix}-alert-icon-info {
    color: @success-icon-color;
  }
}

.@{bk-prefix}-alert-warning {
  background-color: @warning-background-color;
  border-color: @warning-border-color;

  .@{bk-prefix}-alert-icon-info {
    color: @warning-icon-color;
  }
}

.@{bk-prefix}-alert-danger {
  background-color: @danger-background-color;
  border-color: @danger-border-color;

  .@{bk-prefix}-alert-icon-info {
    color: @danger-icon-color;
  }
}
// 兼容历史 prop theme 的配置 error 调整为danger
.@{bk-prefix}-alert-error {
  background-color: @danger-background-color;
  border-color: @danger-border-color;

  .@{bk-prefix}-alert-icon-info {
    color: @danger-icon-color;
  }
}
// 兼容历史 prop theme 的配置 error 调整为danger

.@{bk-prefix}-alert-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.@{bk-prefix}-alert-title {
  line-height: 16px;
}

.@{bk-prefix}-alert-close {
  padding: 8px 12px 0 6px;
  margin-top: -8px;
  margin-right: -10px;
  font-size: 12px;
  color: #c4c6cc;
  white-space: nowrap;
  cursor: pointer;

  &:hover {
    color: #979ba5;
  }
}

.@{bk-prefix}-alert-close-icon {
  line-height: 1;
}

.@{bk-prefix}-alert-leave-leave {
  opacity: 1;
}

.@{bk-prefix}-alert-leave-leave-active {
  overflow: hidden;
  transition: opacity .15s, height .2s;
}

.@{bk-prefix}-alert-leave-leave-to {
  opacity: 0;
}
