UNPKG

@atlaskit/motion

Version:

A set of utilities to apply motion in your application.

35 lines (34 loc) • 1.44 kB
/* icon-motion-rotate.tsx generated by @compiled/babel-plugin v3.0.4 */ import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; var _excluded = ["isActive"]; import "./icon-motion-rotate.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import { forwardRef } from 'react'; import { cx } from '@atlaskit/css'; import IconMotionBase from './icon-motion-base'; /** * The pose held by `IconMotion.Rotate`. `baseRotate` defines the transition back to neutral, and * `rotate` is the pose held while `isActive`. Under reduced motion the pose still changes, but * without a transition. */ var rotatePoses = { baseRotate: "_6fl4v1ec _1oec1mzy _k8m01e03 _t9ec1ul7 _m6k41e03 _156yru3m", rotate: "_t9ec14w8" }; /** * __IconMotion.Rotate__ * * `IconMotion` that also rotates the icon 90° while `isActive`, and eases it back when it is not. * It takes every `IconMotion` prop, and still animates icons that are swapped. */ var IconMotionRotate = /*#__PURE__*/forwardRef(function IconMotionRotate(_ref, ref) { var isActive = _ref.isActive, props = _objectWithoutProperties(_ref, _excluded); return /*#__PURE__*/React.createElement(IconMotionBase, _extends({}, props, { xcss: cx(rotatePoses.baseRotate, isActive && rotatePoses.rotate), ref: ref })); }); export default IconMotionRotate;