UNPKG

@atlaskit/icon

Version:

An icon is a symbol representing a command, device, directory, or common action.

40 lines • 3.45 kB
/* magic-wand.tsx generated by @compiled/babel-plugin v3.0.4 */ import _extends from "@babel/runtime/helpers/extends"; import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; import "./magic-wand.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; /* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors -- Animated glyphs are injected HTML strings, so inner elements can only be styled via nested selectors on the wrapper. */ import { forwardRef } from 'react'; import Icon from '../components/icon-new'; import { useAnimatedIconPlayback } from '../components/use-animated-icon-playback'; // Lifts the whole icon from (0, 0) to (0, -2) from 0-500ms // Wand will rotate (0 to 12deg) from 250m-500ms and returns to 0deg from 500ms-750ms // Sparkles will scale and move sequentially with the first sparkle starting at 0ms and the last sparkle ending at 450ms. // Sparkles will start returning sequentially with the first sparkle starting at 550ms and the last sparkle ending at 1000ms. var TIMELINE = [{ phase: 'interaction', durationMs: 500 }]; var animatedStyles = { base: "_ejdb1e03 _12lu1ytf _ovzv1kli _14xf1bs3 _162z1ul7 _142u1doz _stft1h7a _e3j41doz _1fe914ed _1md41h7a _1tc91doz _nroj1yx9 _g6631h7a _22cj1doz _g88o6ebc _3gtk1h7a _1onv1doz _1d9sfnf5 _gz891h7a _mxri1doz _1hss1doz", interaction: "_ovzvp1qy _14xf1bs3 _162z1egq _1q2i1doz _142u1doz _stft11yi _1fe9fnf5 _e3j41doz _1md41nul _nroj6ebc _1tc91doz _g663s43i _g88o1yx9 _22cj1doz _3gtk1nhn _1d9s14ed _1onv1doz _gz891qlk _1hss5cps _mxri1doz" }; var glyph = "\n<g data-anim=\"lift\">\n\t<path data-anim=\"wand\" d=\"M9.027 3.911a1.376 1.376 0 0 1 1.841-.094l.105.094 1.116 1.116a1.376 1.376 0 0 1 0 1.946l-8.616 8.616a1.376 1.376 0 0 1-1.946 0L.411 14.473a1.376 1.376 0 0 1 0-1.946zM1.561 13.5l.939.94L7.938 9 7 8.061zM8.061 7l.938.938L10.939 6l-.94-.94z\" fill=\"currentColor\" style=\"transform-origin: 0.969px 15.031px;\"/>\n\t<path data-anim=\"sparkle0\" d=\"M7.982 2.422l-1.06 1.06-1.414-1.414 1.06-1.06z\" fill=\"currentColor\" style=\"transform-origin: 6.745px 2.245px;\"/>\n\t<path data-anim=\"sparkle1\" d=\"M11 0v2H9.5V0z\" fill=\"currentColor\" style=\"transform-origin: 10.25px 1px;\"/>\n\t<path data-anim=\"sparkle2\" d=\"M14.992 2.068l-1.414 1.414-1.06-1.06 1.414-1.414z\" fill=\"currentColor\" style=\"transform-origin: 13.755px 2.245px;\"/>\n\t<path data-anim=\"sparkle3\" d=\"M16 5v1.5h-2V5z\" fill=\"currentColor\" style=\"transform-origin: 15px 5.75px;\"/>\n\t<path data-anim=\"sparkle4\" d=\"M14.992 9.433l-1.06 1.06-1.415-1.414 1.061-1.06z\" fill=\"currentColor\" style=\"transform-origin: 13.755px 9.256px;\"/>\n</g>\n"; var MagicWandAnimatedIcon = /*#__PURE__*/forwardRef(function MagicWandAnimatedIcon(props, ref) { var _useAnimatedIconPlayb = useAnimatedIconPlayback(ref, TIMELINE), _useAnimatedIconPlayb2 = _slicedToArray(_useAnimatedIconPlayb, 1), phase = _useAnimatedIconPlayb2[0]; return /*#__PURE__*/React.createElement("span", { className: ax([animatedStyles.base, phase === 'interaction' && animatedStyles.interaction]) }, /*#__PURE__*/React.createElement(Icon, _extends({ name: "MagicWandIcon", dangerouslySetGlyph: glyph, isAnimatedIcon: true // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props }, props, { size: "medium" }))); }); MagicWandAnimatedIcon.displayName = 'MagicWandIcon'; export default MagicWandAnimatedIcon;