/**
 *
 * @ai-apps/angular v2.152.0 | motion.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. 2018, 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.
//

/// @access public
/// @group @carbon/motion
$fast-01: 70ms !default;

/// @access public
/// @group @carbon/motion
$fast-02: 110ms !default;

/// @access public
/// @group @carbon/motion
$moderate-01: 150ms !default;

/// @access public
/// @group @carbon/motion
$moderate-02: 240ms !default;

/// @access public
/// @group @carbon/motion
$slow-01: 400ms !default;

/// @access public
/// @group @carbon/motion
$slow-02: 700ms !default;

/// Common component easings
/// @type Map
/// @access public
/// @group @carbon/motion
$carbon--easings: (
  standard: (
    productive: cubic-bezier(0.2, 0, 0.38, 0.9),
    expressive: cubic-bezier(0.4, 0.14, 0.3, 1),
  ),
  entrance: (
    productive: cubic-bezier(0, 0, 0.38, 0.9),
    expressive: cubic-bezier(0, 0, 0.3, 1),
  ),
  exit: (
    productive: cubic-bezier(0.2, 0, 1, 0.9),
    expressive: cubic-bezier(0.4, 0.14, 1, 1),
  ),
);

/// Get the transition-timing-function for a given easing and motion mode
/// @param {String} $name - Can be `standard`, `entrance`, or `exit`
/// @param {String} $mode [productive] - Can be `productive` or `expressive`
/// @param {Map} $easings [$carbon--easings] - Easings map
/// @access public
/// @group @carbon/motion
/// @return {Function} CSS `cubic-bezier()` function
@function carbon--motion($name, $mode: productive, $easings: $carbon--easings) {
  @if map-has-key($easings, $name) {
    $easing: map-get($easings, $name);
    @if map-has-key($easing, $mode) {
      @return map-get($easing, $mode);
    } @else {
      @error 'Unable to find a mode for the easing #{$easing} called: #{$mode}.';
    }
  } @else {
    @error 'Unable to find an easing named #{$name} in our supported easings.';
  }
}

/// Set the transition-timing-function for a given easing and motion mode
/// @param {String} $name - The name of the easing curve to apply
/// @param {String} $mode - The mode for the easing curve to use
/// @access public
/// @group @carbon/motion
@mixin carbon--motion($name, $mode) {
  transition-timing-function: carbon--motion($name, $mode);
}
