hikari-components 0.2.2

Core UI components (40+) for the Hikari design system
// Skeleton Component Styles
// Loading placeholder styles for various content types

// Base skeleton wrapper
.hi-skeleton-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

// Base skeleton element
.hi-skeleton {
    background: linear-gradient(
        90deg,
        var(--hi-surface, #f0f0f0) 25%,
        var(--hi-color-background, #e0e0e0) 50%,
        var(--hi-surface, #f0f0f0) 75%
    );
    background-size: 200% 100%;
    border-radius: 4px;
    display: inline-block;
}

// Active animation state
.hi-skeleton-active {
    animation: hi-skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes hi-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

// Text skeleton - for paragraphs and lines
.hi-skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;

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

    // Variant widths for more natural look
    &.hi-skeleton-text-sm { width: 60%; }
    &.hi-skeleton-text-md { width: 80%; }
    &.hi-skeleton-text-lg { width: 100%; }
}

// Avatar skeleton - circular placeholder
.hi-skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;

    &.hi-skeleton-avatar-sm {
        width: 24px;
        height: 24px;
    }

    &.hi-skeleton-avatar-md {
        width: 32px;
        height: 32px;
    }

    &.hi-skeleton-avatar-lg {
        width: 48px;
        height: 48px;
    }
}

// Image/cover skeleton - rectangular placeholder
.hi-skeleton-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
}

// Button skeleton - for interactive elements
.hi-skeleton-button {
    height: 32px;
    width: 80px;
    border-radius: 4px;

    &.hi-skeleton-button-sm {
        height: 24px;
        width: 60px;
    }

    &.hi-skeleton-button-md {
        height: 32px;
        width: 80px;
    }

    &.hi-skeleton-button-lg {
        height: 40px;
        width: 100px;
    }
}

// Input skeleton - for form elements
.hi-skeleton-input {
    height: 32px;
    width: 100%;
    border-radius: 4px;
}

// Rect skeleton - generic rectangular placeholder
.hi-skeleton-rect {
    display: inline-block;

    &.hi-skeleton-rect-sm {
        width: 60px;
        height: 20px;
    }

    &.hi-skeleton-rect-md {
        width: 120px;
        height: 24px;
    }

    &.hi-skeleton-rect-lg {
        width: 200px;
        height: 32px;
    }
}

// Dark theme adjustments
[data-theme="dark"] .hi-skeleton,
[data-theme="tairitsu"] .hi-skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
}

// Accessibility: respect prefers-reduced-motion
@media (prefers-reduced-motion: reduce) {
    .hi-skeleton-active {
        animation: none;
    }
}