@atlaskit/icon
Version:
An icon is a symbol representing a command, device, directory, or common action.
49 lines (48 loc) • 4.56 kB
JavaScript
/* magic-wand.tsx generated by @compiled/babel-plugin v3.0.4 */
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
require("./magic-wand.compiled.css");
var _react = _interopRequireWildcard(require("react"));
var React = _react;
var _runtime = require("@compiled/react/runtime");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _iconNew = _interopRequireDefault(require("../components/icon-new"));
var _useAnimatedIconPlayback = require("../components/use-animated-icon-playback");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
/* 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. */
// 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__*/(0, _react.forwardRef)(function MagicWandAnimatedIcon(props, ref) {
var _useAnimatedIconPlayb = (0, _useAnimatedIconPlayback.useAnimatedIconPlayback)(ref, TIMELINE),
_useAnimatedIconPlayb2 = (0, _slicedToArray2.default)(_useAnimatedIconPlayb, 1),
phase = _useAnimatedIconPlayb2[0];
return /*#__PURE__*/React.createElement("span", {
className: (0, _runtime.ax)([animatedStyles.base, phase === 'interaction' && animatedStyles.interaction])
}, /*#__PURE__*/React.createElement(_iconNew.default, (0, _extends2.default)({
name: "MagicWandIcon",
dangerouslySetGlyph: glyph,
isAnimatedIcon: true
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
}, props, {
size: "medium"
})));
});
MagicWandAnimatedIcon.displayName = 'MagicWandIcon';
var _default = exports.default = MagicWandAnimatedIcon;