@import '../style/variable.less';

.@{prefix}-input {
  width: 100%;
  display: flex;
  align-items: center;
  border-style: solid;
  border-width: 1px;
  box-sizing: border-box;
  border-color: var(--kt-input-border);
  border-radius: 2px;
  background-color: var(--input-background);
  height: 28px;
  padding: 0px 8px;
  font-size: 12px;

  &:focus-within {
    border-color: var(--focusBorder);
  }

  &:hover {
    border-color: var(--focusBorder);
  }

  &-disabled {
    color: var(--kt-input-disableForeground);
    background-color: var(--kt-input-disableBackground);

    input,
    textarea {
      cursor: not-allowed;
    }
  }

  &-box {
    flex: 1;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;

    input,
    textarea {
      width: 100%;
      height: 100%;
      color: var(--input-foreground);
      background-color: transparent;
      outline: none;
      border-width: 0;
      display: inline-block;

      &::placeholder {
        color: var(--input-placeholderForeground);
      }

      &::selection {
        background-color: var(--kt-input-selectionBackground);
      }
    }
  }

  &-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
  }

  &-addon {
    display: flex;
    align-items: center;
    height: 100%;
  }

  &-addon-before {
    margin-right: 4px;
  }

  &-addon-after {
    margin-left: 4px;
  }

  &-large {
    height: 32px;
    font-size: 14px;
  }

  &-small {
    height: 22px;
    font-size: 12px;
  }
}
