shadow-design 0.3.0

Modular, high-performance UI component library for Dioxus 0.7 applications
// ==============================================================================
// Shadow Design — Input Styles
// ==============================================================================
@use '../variables' as *;
@use '../mixins' as *;

@layer sd-components {
.sd-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  font-family: $font-sans;
}

.sd-input-label {
  font-size: 13px;
  font-weight: 500;
  color: $zinc-300;
  user-select: none;
}

.sd-input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.sd-input {
  width: 100%;
  height: 42px;
  background-color: #08080c;
  color: $zinc-100;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--sd-radius-md, $radius-md);
  padding: 0 14px;
  font-family: $font-sans;
  font-size: 14px;
  line-height: normal;
  outline: none;
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: all $duration-fast ease;

  &::placeholder {
    color: #8b8b94;
  }

  &:focus {
    border-color: var(--sd-focus-ring, rgba(168, 85, 247, 0.6));
    background-color: var(--sd-surface-2, $color-surface-2);
    box-shadow: 0 0 16px var(--sd-accent-glow, rgba(168, 85, 247, 0.35));
  }

  &--error {
    border-color: rgba(244, 63, 94, 0.7);
    &:focus {
      border-color: #fb7185;
      box-shadow: 0 0 16px rgba(244, 63, 94, 0.35);
    }
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  // Modificatori spaziali automatici per icone
  &--has-left-icon {
    padding-left: 42px !important;
  }

  &--has-right-icon {
    padding-right: 42px !important;
  }

  &--has-both-icons {
    padding-left: 42px !important;
    padding-right: 42px !important;
  }
}

// Icone vettoriali posizionate con precisione assoluta a metà altezza
.sd-input-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: $zinc-400;
  z-index: 10;
  line-height: 1;
  transition: color $duration-fast ease;

  &--left {
    left: 14px;
    pointer-events: none;
  }

  &--right {
    right: 14px;
  }

  &--interactive {
    pointer-events: auto !important;
    cursor: pointer !important;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    outline: none;

    &:hover {
      color: #ffffff;
    }

    &:active {
      transform: translateY(-50%) scale(0.88);
    }
  }

  svg {
    display: block;
    margin: auto;
    flex-shrink: 0;
  }
}

.sd-input-error {
  font-size: 11px;
  color: $color-danger;
  margin-top: 2px;
  font-weight: 500;
}

.sd-input-help {
  font-size: 11px;
  color: $zinc-400;
  margin-top: 2px;
}
}