UNPKG

@atlaskit/motion

Version:

A set of utilities to apply motion in your application.

34 lines (33 loc) • 1.26 kB
/* icon-motion-rotate.tsx generated by @compiled/babel-plugin v3.0.4 */ import _extends from "@babel/runtime/helpers/extends"; 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. */ const 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. */ const IconMotionRotate = /*#__PURE__*/forwardRef(function IconMotionRotate({ isActive, ...props }, ref) { return /*#__PURE__*/React.createElement(IconMotionBase, _extends({}, props, { xcss: cx(rotatePoses.baseRotate, isActive && rotatePoses.rotate), ref: ref })); }); export default IconMotionRotate;