Skip to content

The Open Standard for Generative UI

2.8 KB
Raw Blame
@use "../../cssUtils" as cssUtils;

.openui-value-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: cssUtils.$space-m;
  width: 100%;
  min-width: 0;
  padding: cssUtils.$space-s-m;
  box-sizing: border-box;
  border: 1px solid cssUtils.$border-default;
  border-radius: cssUtils.$radius-2xl;
  background-color: cssUtils.$sunk-light;
  position: relative;
  overflow: hidden;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;

  &--static {
    background-color: cssUtils.$sunk-light;
    border-color: cssUtils.$border-default;
    box-shadow: none;
  }

  &--clickable {
    background-color: cssUtils.$foreground;
    border-color: cssUtils.$border-interactive;
    box-shadow: cssUtils.$shadow-s;
    cursor: pointer;

    &:hover {
      box-shadow: none;
      transform: scale(0.995);
    }

    &:focus-visible {
      outline: 2px solid cssUtils.$border-accent;
      outline-offset: 2px;
    }
  }
}

.openui-value-card__lhs {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.openui-value-card__lhs > * {
  min-width: 0;
}

.openui-value-card__rhs {
  flex-shrink: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  margin-left: cssUtils.$space-m;
  color: cssUtils.$text-neutral-primary;
  @include cssUtils.typography(number, large-heavy);
}

.openui-value-card__rhs-content {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
}

.openui-value-card__lhs .openui-icon-text,
.openui-value-card__lhs .openui-image-text,
.openui-value-card__lhs .openui-icon-text__content,
.openui-value-card__lhs .openui-image-text__content,
.openui-value-card__lhs .openui-text-block,
.openui-value-card__rhs-content,
.openui-value-card__rhs-content > *,
.openui-value-card__rhs .openui-text-block {
  min-width: 0;
}

.openui-value-card__lhs .openui-icon-text,
.openui-value-card__lhs .openui-image-text,
.openui-value-card__lhs .openui-text-block,
.openui-value-card__rhs-content {
  width: 100%;
  overflow: hidden;
}

.openui-value-card__rhs .openui-text-block {
  align-items: flex-end;
  width: auto;
  max-width: 100%;
  overflow: hidden;
  text-align: right;
}

.openui-value-card__lhs .openui-text-block__primary,
.openui-value-card__lhs .openui-text-block__secondary,
.openui-value-card__rhs .openui-text-block__primary,
.openui-value-card__rhs .openui-text-block__secondary {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.openui-value-card__rhs .openui-text-block--align-left {
  align-items: flex-end;
  text-align: right;
}

.openui-value-card__chevron {
  color: cssUtils.$text-neutral-secondary;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}