/**
 *
 * @ai-apps/angular v2.152.0 | _text-area.scss
 *
 * Copyright 2014, 2023 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


//
// Copyright IBM Corp. 2016, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

//-----------------------------
// Text area
//-----------------------------

@import '../../globals/scss/vars';
@import '../../globals/scss/typography';
@import '../../globals/scss/css--reset';
@import '../../globals/scss/helper-mixins';
@import '../../globals/scss/vendor/@carbon/elements/scss/import-once/import-once';
@import '../form/form';

/// Text area styles
/// @access private
/// @group text-area
@mixin text-area {
  .#{$prefix}--text-area {
    @include reset;
    @include type-style('body-long-01');
    @include focus-outline('reset');

    width: 100%;
    min-width: 10rem;
    height: 100%;
    min-height: rem(40px);
    padding: rem(11px) $carbon--spacing-05;
    border: none;
    border-bottom: 1px solid $ui-04;
    background-color: $field-01;
    color: $text-01;
    resize: vertical;
    transition: background-color $duration--fast-01 motion(standard, productive),
      outline $duration--fast-01 motion(standard, productive);
  }

  .#{$prefix}--text-area:focus,
  .#{$prefix}--text-area:active {
    @include focus-outline('outline');
  }

  .#{$prefix}--text-area::placeholder {
    @include placeholder-colors;
    @include type-style('body-long-01');
  }

  .#{$prefix}--text-area--light {
    background-color: $field-02;
  }

  .#{$prefix}--text-area--invalid {
    padding-right: $carbon--spacing-08;
  }

  .#{$prefix}--text-area__wrapper {
    position: relative;
    display: flex;
    width: 100%;
  }

  .#{$prefix}--text-area__invalid-icon {
    position: absolute;
    top: $carbon--spacing-04;
    right: $carbon--spacing-05;
    fill: $support-01;
  }

  //-----------------------------
  // Disabled
  //-----------------------------
  .#{$prefix}--text-area:disabled {
    border-bottom: 1px solid transparent;
    background-color: $disabled-01;
    color: $disabled-02;
    cursor: not-allowed;
    outline: none;
  }

  .#{$prefix}--text-area:disabled::placeholder {
    color: $disabled-02;
  }

  .#{$prefix}--text-area.#{$prefix}--text-area--light:disabled {
    background-color: $field-02;
  }

  // Skeleton State
  .#{$prefix}--text-area.#{$prefix}--skeleton {
    @include skeleton;

    height: rem(100px);

    &::placeholder {
      color: transparent;
    }
  }
}

@include exports('text-area') {
  @include text-area;
}
