hikari-extra-components 0.2.1

Advanced UI components (node graph, rich text, etc.) for the Hikari design system
// styles/components/timeline.scss
// Timeline component with 

.hi-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;

  &:not(.hi-timeline-line) {
    .hi-timeline-item::before {
      display: none;
    }
  }
}

// Position variants
.hi-timeline-left {
  align-items: flex-start;
}

.hi-timeline-center {
  align-items: center;

  .hi-timeline-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;

    .hi-timeline-dot {
      order: 1;
    }

    .hi-timeline-content {
      order: 2;
      flex: 1;
    }
  }
}

.hi-timeline-right {
  align-items: flex-end;
}

// Timeline item
.hi-timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding-left: 0;

  // Connecting line
  &::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 24px;
    width: 2px;
    height: calc(100% - 24px);
    background: linear-gradient(
      to bottom,
      var(--hi-color-border, #e0e0e0) 0%,
      transparent 100%
    );
    z-index: 0;
  }

  // Remove line from last item
  &:last-child::before {
    display: none;
  }

  // Position-specific adjustments
  .hi-timeline-right & {
    align-items: flex-end;

    .hi-timeline-content {
      text-align: right;
    }

    &::before {
      left: auto;
      right: 12px;
    }

    .hi-timeline-dot {
      margin-left: auto;
      margin-right: 0;
    }
  }
}

// Timeline dot
.hi-timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--hi-color-surface, #ffffff);
  border: 2px solid var(--hi-color-border, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  z-index: 1;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

// Timeline icon
.hi-timeline-icon {
  font-size: 1rem;
  line-height: 1;
}

// Status variants
.hi-timeline-dot-pending {
  border-color: var(--hi-color-text-secondary, #666);
  background-color: var(--hi-color-surface, #ffffff);
}

.hi-timeline-dot-in-progress {
  border-color: var(--hi-color-primary, #00A0E9);
  background-color: var(--hi-color-primary-alpha10, rgba(0, 160, 233, 0.1));
  animation: hi-timeline-pulse 2s ease-in-out infinite;
}

.hi-timeline-dot-completed {
  border-color: var(--hi-color-success, #52c41a);
  background-color: var(--hi-color-success-alpha10, rgba(82, 196, 26, 0.1));
}

.hi-timeline-dot-cancelled {
  border-color: var(--hi-color-error, #f5222d);
  background-color: var(--hi-color-error-alpha10, rgba(245, 34, 45, 0.1));
}

// Item status
.hi-timeline-pending {
  opacity: 0.6;
}

.hi-timeline-in-progress {
  .hi-timeline-title {
    color: var(--hi-color-primary, #00A0E9);
  }
}

.hi-timeline-completed {
  .hi-timeline-dot {
    border-color: var(--hi-color-success, #52c41a);
  }
}

.hi-timeline-cancelled {
  opacity: 0.5;
  text-decoration: line-through;
}

// Timeline content
.hi-timeline-content {
  flex: 1;
  min-width: 0;
  padding-left: 0.5rem;

  .hi-timeline-right & {
    padding-left: 0;
    padding-right: 0.5rem;
  }
}

// Timeline header
.hi-timeline-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;

  &:hover {
    .hi-timeline-title {
      color: var(--hi-color-primary, #00A0E9);
    }
  }
}

// Timeline title
.hi-timeline-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--hi-color-text-primary, #333);
  transition: color 0.2s ease;
}

// Timeline time
.hi-timeline-time {
  font-size: 0.875rem;
  color: var(--hi-color-text-secondary, #666);
  font-family: var(--hi-font-family-mono, ui-monospace, monospace);
}

// Timeline description
.hi-timeline-description {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--hi-color-border-light, #f0f0f0);

  p {
    margin: 0 0 0.75rem 0;
    line-height: 1.6;
  }
}

// Timeline extra
.hi-timeline-extra {
  margin-top: 0.75rem;

  .hi-badge {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
  }
}

// glow effects
.hi-timeline-dot-in-progress {
  box-shadow: 0 0 20px var(--hi-color-primary-glow, rgba(0, 160, 233, 0.3));
}

.hi-timeline-dot-completed {
  box-shadow: 0 0 20px var(--hi-color-success-glow, rgba(82, 196, 26, 0.2));
}

// Pulse animation for in-progress items
@keyframes hi-timeline-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

// Tairitsu theme (dark)
[data-theme="tairitsu"] {
  .hi-timeline {
    .hi-timeline-item::before {
      background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.12) 0%,
        transparent 100%
      );
    }

    .hi-timeline-dot {
      background-color: #1a1a1a;
      border-color: rgba(255, 255, 255, 0.24);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .hi-timeline-title {
      color: rgba(255, 255, 255, 0.95);
    }

    .hi-timeline-time {
      color: rgba(255, 255, 255, 0.6);
    }

    .hi-timeline-description {
      border-top-color: rgba(255, 255, 255, 0.08);
    }
  }

  .hi-timeline-dot-in-progress {
    border-color: var(--hi-color-primary);
    background-color: rgba(26, 35, 126, 0.2);
    box-shadow: 0 0 20px rgba(26, 35, 126, 0.4);
  }

  .hi-timeline-dot-completed {
    border-color: #2e7d32;
    background-color: rgba(46, 125, 50, 0.2);
    box-shadow: 0 0 20px rgba(46, 125, 50, 0.3);
  }

  .hi-timeline-dot-cancelled {
    border-color: #c62828;
    background-color: rgba(198, 40, 40, 0.2);
  }

  .hi-timeline-in-progress .hi-timeline-title {
    color: var(--hi-color-primary);
  }
}

// Animation for line expansion
.hi-timeline-line {
  .hi-timeline-item::before {
    opacity: 0;
    animation: hi-timeline-line-expand 0.6s ease-out forwards;
  }

  .hi-timeline-item:nth-child(1)::before {
    animation-delay: 0.1s;
  }

  .hi-timeline-item:nth-child(2)::before {
    animation-delay: 0.2s;
  }

  .hi-timeline-item:nth-child(3)::before {
    animation-delay: 0.3s;
  }

  .hi-timeline-item:nth-child(4)::before {
    animation-delay: 0.4s;
  }

  .hi-timeline-item:nth-child(n+5)::before {
    animation-delay: 0.5s;
  }
}

@keyframes hi-timeline-line-expand {
  from {
    opacity: 0;
    height: 0;
  }
  to {
    opacity: 1;
  }
}

// Responsive adjustments
@media (max-width: 768px) {
  .hi-timeline-center {
    .hi-timeline-item {
      flex-direction: column;
      align-items: flex-start;

      .hi-timeline-dot {
        order: 0;
      }

      .hi-timeline-content {
        order: 1;
        text-align: left;
      }
    }
  }

  .hi-timeline-right {
    align-items: flex-start;

    .hi-timeline-item {
      align-items: flex-start;
    }

    .hi-timeline-content {
      text-align: left;
      padding-left: 0.5rem;
      padding-right: 0;
    }

    .hi-timeline-dot {
      margin-left: 0;
      margin-right: 0;
    }

    .hi-timeline-item::before {
      left: 12px;
      right: auto;
    }
  }
}