Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

4.6 KB
Raw Blame
.b3-form {
  &__space {
    margin: 16px 24px;

    &--small {
      margin: 8px 16px;
    }
  }

  &__icon {
    position: relative;
    color: var(--b3-theme-on-surface);

    &-icon {
      position: absolute;
      left: 9px;
      top: 6px;
      height: 16px;
      width: 16px;
    }

    &-list {
      height: 28px;
      width: 42px;
      display: flex;
      justify-content: center;
      align-items: center;
      position: absolute;
    }

    &-input {
      padding-left: 34px !important;
    }

    &--small {
      .b3-form__icon-icon {
        left: 5px;
        top: 4px;
        height: 14px;
        width: 14px;
      }

      .b3-form__icon-input {
        padding-left: 25px !important;
      }
    }
  }

  &__icon-clear {
    position: absolute;
    height: 18px;
    width: 16px;
    opacity: .68;
    transition: var(--b3-transition);
    right: 0;
    cursor: pointer;

    &:hover:not([disabled]) {
      opacity: 1;
    }

    &[disabled] {
      opacity: .38;
      cursor: not-allowed;
    }
  }

  // repo password & av description
  &__icona {
    position: relative;
    color: var(--b3-theme-on-surface);
    line-height: normal;

    &-icon {
      position: absolute;
      right: 1px;
      top: 1px;
      height: 16px;
      width: 16px;
      cursor: pointer;
      padding: 5px;
      border-radius: 0 calc(var(--b3-border-radius) - 1px) calc(var(--b3-border-radius) - 1px) 0;

      &:hover {
        color: var(--b3-theme-on-background);
        background-color: var(--b3-list-icon-hover);
      }
    }

    &-input {
      width: 100%;
      padding-right: 35px !important;
    }
  }

  &__img {
    align-items: center;
    border-radius: var(--b3-border-radius);
    box-shadow: inset 0 0 0 1px var(--b3-border-color);
    background-color: var(--b3-theme-background);
    transition: box-shadow 120ms 0ms cubic-bezier(0, 0, .2, 1);
    overflow: hidden;

    &:hover {
      box-shadow: inset 0 0 0 1px var(--b3-border-color), 0 0 0 .6px var(--b3-border-color);
    }

    &:focus-within {
      box-shadow: inset 0 0 0 1px var(--b3-theme-primary-light), 0 0 0 .6px var(--b3-theme-primary-lighter);
    }

    &-captcha {
      height: 25px;
      margin: 1px;
      border-radius: var(--b3-border-radius) 0 0 var(--b3-border-radius);
      border-right: 1px solid var(--b3-border-color);
    }

    .b3-text-field {
      border-radius: 0;
      outline: none;
      box-shadow: none;
      background-color: transparent;

      &:not(.b3-text-field--text):hover,
      &:not(.b3-text-field--text):focus {
        box-shadow: none;
      }
    }
  }

  &__upload {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: .001;
    overflow: hidden;
    cursor: pointer;
    font-size: 0;
  }
}

.password-strength {
  position: relative;
  margin-top: 10px;
  padding-top: 8px;
  color: var(--b3-theme-on-surface);
  font-size: 12px;
  --password-strength-color: var(--b3-theme-error);

  &::before,
  &::after {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    border-radius: 2px;
    content: "";
  }

  &::before {
    width: 100%;
    background-color: var(--b3-theme-surface-lighter);
  }

  &::after {
    width: 33%;
    background-color: var(--password-strength-color);
    transition: width var(--b3-transition);
  }

  &[data-strength="weak"] {
    --password-strength-color: var(--b3-theme-error);
  }

  &[data-strength="medium"] {
    --password-strength-color: var(--b3-theme-secondary);

    &::after {
      width: 66%;
    }
  }

  &[data-strength="strong"] {
    --password-strength-color: var(--b3-theme-success);

    &::after {
      width: 100%;
    }
  }
}

.b3-label {
  border-bottom: 1px solid var(--b3-border-color);
  padding: 16px 24px;
  line-height: 20px;

  &__text {
    // import 的话会导致设置关于中 ft__error 无效
    color: var(--b3-theme-on-surface);
    font-size: 14px !important;
    margin-top: 4px;
    overflow: hidden !important;
  }

  &__icon {
    width: 36px;
    height: 36px;
    align-self: center;
    margin-right: 16px;
    color: var(--b3-theme-on-surface);
  }

  &--inner {
    border-bottom: 0;
    padding: 0 0 16px 0;

    &:last-child {
      padding-bottom: 0;
    }
  }

  &:last-child,
  &--noborder {
    border-bottom: 0;
  }

  &--bordr {
    border-bottom: 1px solid var(--b3-border-color) !important;
  }
}


@media screen and (max-width: 750px) {
  .b3-label--inner {
    flex-wrap: wrap;

    & > .b3-text-field,
    & > .b3-select,
    & > .b3-form__icona {
      width: 100%;
      margin-top: 8px;
    }

    & > .b3-button {
      width: 100%;

      &:not(:first-child) {
        margin-top: 16px;
      }
    }
  }
}