/**
 * @license
 * Copyright Akveo. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

@use '../../styles/theming' as *;
@use '../form-field/form-field.component.theme' as form-field-theme;
@use 'input-statuses';
@use 'input-sizes';
@use 'input-shapes';

@mixin nb-input-theme() {
  [nbInput] {
    @include nb-input-core-theme();
    @include input-statuses.input-statuses();
    @include input-sizes.input-sizes();
    @include input-shapes.input-shapes();
  }

  @include form-field-theme.nb-form-field-root-component('[nbInput]');

  @each $size in nb-get-sizes() {
    @include form-field-theme.nb-form-field-with-prefix('[nbInput].size-#{$size}', $size);
    @include form-field-theme.nb-form-field-with-suffix('[nbInput].size-#{$size}', $size);
  }
}

@mixin nb-input-core-theme() {
  border-style: nb-theme(input-border-style);
  border-width: nb-theme(input-border-width);
  font-family: nb-theme(input-text-font-family);
  appearance: none; // removes inner shadow on iOS

  &.nb-transition {
    @include nb-component-animation(border, background-color, color, box-shadow);
  }

  &::placeholder {
    font-family: nb-theme(input-placeholder-text-font-family);
    text-overflow: ellipsis;
  }

  &:focus {
    outline: none;
  }

  &.input-full-width {
    width: 100%;
  }
}
