Newer
Older
vmk-ui-kit / src / scss / components / _lists.scss
/* =========================
   Lists
   Figma: Lists / Menu items.
========================= */

@use "../kit-deps" as *;

.list {
  margin: 0;
  padding: $space-2 0;
  list-style: none;
  border: $border-width-base $border-style-base $border-color-muted;
  border-radius: $radius-md;
  background-color: $surface-panel-muted;
  min-width: 240px;
  max-width: 100%;
}

.list-item {
  display: flex;
  align-items: center;
  gap: $space-3;
  padding: $space-3 $space-4;
  color: $neutral-900;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color $motion-base $motion-ease;

  &:hover:not(.is-disabled) {
    background-color: rgba($neutral-900, 0.04);
  }

  &:focus-visible {
    @include focus_ring;
    outline-offset: -2px;
  }

  &.is-active {
    background-color: rgba($mint-500, 0.12);
    color: $neutral-900;
  }

  &.is-disabled {
    color: $neutral-400;
    cursor: not-allowed;
  }

  .list-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: $neutral-600;
    flex-shrink: 0;
  }

  .list-item-meta {
    margin-left: auto;
    color: $neutral-500;
    font-size: 12px;
    font-weight: $font-weight-semibold;
  }
}

.list-compact {
  padding: $space-1 0;

  .list-item {
    padding: $space-2 $space-3;
    font-size: 13px;
  }
}

.list-flush {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;

  .list-item {
    border-radius: $radius-md;
  }
}

.list-divided {
  .list-item + .list-item {
    border-top: $border-width-base $border-style-base $border-color-muted;
  }
}

.list-actions {
  width: 100%;
  max-width: 420px;
  border: 0;
  background: transparent;
  padding: 0;

  .list-item {
    justify-content: space-between;
    align-items: flex-start;
    gap: $space-3;
    padding: $space-3 0;
    border-bottom: $border-width-base $border-style-base rgba($neutral-900, 0.08);

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

    .list-content {
      display: flex;
      flex-direction: column;
      gap: $space-1;
    }

    .list-title {
      font-size: 15px;
      font-weight: $font-weight-semibold;
      color: $neutral-900;
    }

    .list-subtitle {
      font-size: 13px;
      color: $neutral-600;
      line-height: 1.4;
    }

    .list-controls {
      display: flex;
      align-items: center;
      flex-shrink: 0;
    }

    &.list-item-muted {
      opacity: 0.6;
    }
  }
}