UNPKG

@atlaskit/icon

Version:

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

63 lines • 4.69 kB
/* ai-generative-remove-silence.tsx generated by @compiled/babel-plugin v3.0.4 */ import _extends from "@babel/runtime/helpers/extends"; import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; import "./ai-generative-remove-silence.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, useMemo } from 'react'; import Icon from '../components/icon-new'; import { useAnimatedIconPlayback } from '../components/use-animated-icon-playback'; import { useSvgMaskId } from '../components/use-svg-mask-id'; // Ring will rotate (0 to 284deg) from 0-700ms. It will snap to 429deg at 700ms and hold until 950ms. // Ring will rotate (429 to 720deg) from 950-1650ms // Mask will be applied onto the Ring from 0-700ms and hold until 950ms // Mask will be removed from the Ring from 950-1650ms // Star will scale (1 to 0.5) from 0-700ms and hold until 950ms // Star will scale (0.5 to 1) from 950-1650ms and hold until 1650ms var TIMELINE = [{ phase: 'start', durationMs: 700 }, { phase: 'hold', durationMs: 250 }, { phase: 'end', durationMs: 700 }]; var animatedStyles = { base: "_ejdbzlwc _12lu1ytf _1siv1ul7 _1awx5cps _14vt1h7a _1uiia7zz _3auyrjzu", ringStart: "_1sivi9nn _1awxpwmj _1uii1juc _3auy1tme _1narpwmj", ringHold: "_1siv1x55 _1awx5cps _1uiiotmx _3auydoql _1nar5cps", end: "_1siv16b3 _1awxpwmj _1uii1odr _3auydoql _1narpwmj _btkspwmj", starShrink: "_14vt1jia _btkspwmj" }; var getGlyph = function getGlyph(maskId) { return "\n<defs>\n<mask id=\"".concat(maskId, "\" maskUnits=\"userSpaceOnUse\" x=\"-4\" y=\"-4\" width=\"24\" height=\"24\">\n\t<circle data-anim=\"window\" cx=\"8\" cy=\"8\" r=\"7.25\" pathLength=\"360\" fill=\"none\" stroke=\"white\" stroke-width=\"4\" transform=\"rotate(-90 8 8)\"/>\n\t<path d=\"M11.795 9.494a.75.75 0 0 1 1.41 0l.615 1.687 1.686.615a.75.75 0 0 1 0 1.41l-1.686.615-.615 1.686a.75.75 0 0 1-1.41 0l-.615-1.686-1.686-.615a.75.75 0 0 1 0-1.41l1.686-.615z\" fill=\"black\" stroke=\"black\" stroke-width=\"2\" stroke-linejoin=\"round\"/>\n</mask>\n</defs>\n<g mask=\"url(#").concat(maskId, ")\">\n<g data-anim=\"ring\" style=\"transform-origin: 8px 8px;\">\n\t<path d=\"M3.115 1.664A7.98 7.98 0 0 1 8 0v1.5a6.48 6.48 0 0 0-3.968 1.35zM1.5 8c0 1.664.635 3.326 1.904 4.595A6.48 6.48 0 0 0 8 14.5V16a7.98 7.98 0 0 1-5.657-2.343A7.97 7.97 0 0 1 0 8z\" fill=\"currentColor\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/>\n\t<path d=\"m2.92 3.95-1.17-.94A7.98 7.98 0 0 0 0 8a7.97 7.97 0 0 0 2.34 5.66A7.98 7.98 0 0 0 8 16v-1.5a6.48 6.48 0 0 1-4.6-1.9A6.48 6.48 0 0 1 1.5 8c0-1.44.47-2.87 1.42-4.05m10.45-1.8a.75.75 0 0 1-1 1.11l-.02-.01a.75.75 0 1 1 1-1.12zM10.69.55a.75.75 0 1 1-.5 1.41l-.02-.01a.75.75 0 1 1 .5-1.41zm4.59 4.27a.75.75 0 0 0-1.41.5l.01.02a.75.75 0 1 0 1.41-.5zM16 8.06a.75.75 0 0 0-1.5-.08V8a.75.75 0 0 0 1.5.08v-.01z\" fill=\"currentColor\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/>\n</g>\n</g>\n<path data-anim=\"star\" d=\"M11.795 9.494a.75.75 0 0 1 1.41 0l.615 1.687 1.686.615a.75.75 0 0 1 0 1.41l-1.686.615-.615 1.686a.75.75 0 0 1-1.41 0l-.615-1.686-1.686-.615a.75.75 0 0 1 0-1.41l1.686-.615z\" fill=\"currentColor\" style=\"transform-origin: 12.5px 12.5px;\"/>\n"); }; /** * Animated AI remove silence icon: the ring turns and the star shrinks and returns. */ var AiGenerativeRemoveSilenceAnimatedIcon = /*#__PURE__*/forwardRef(function AiGenerativeRemoveSilenceAnimatedIcon(props, ref) { var _useAnimatedIconPlayb = useAnimatedIconPlayback(ref, TIMELINE, { nonInterruptible: true }), _useAnimatedIconPlayb2 = _slicedToArray(_useAnimatedIconPlayb, 1), phase = _useAnimatedIconPlayb2[0]; var maskId = useSvgMaskId('remove-silence-mask'); var glyph = useMemo(function () { return getGlyph(maskId); }, [maskId]); return /*#__PURE__*/React.createElement("span", { className: ax([animatedStyles.base, (phase === 'start' || phase === 'hold') && animatedStyles.starShrink, phase === 'start' && animatedStyles.ringStart, phase === 'hold' && animatedStyles.ringHold, phase === 'end' && animatedStyles.end]) }, /*#__PURE__*/React.createElement(Icon, _extends({ name: "AiGenerativeRemoveSilenceIcon", dangerouslySetGlyph: glyph, isAnimatedIcon: true // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props }, props, { size: "medium" }))); }); AiGenerativeRemoveSilenceAnimatedIcon.displayName = 'AiGenerativeRemoveSilenceIcon'; export default AiGenerativeRemoveSilenceAnimatedIcon;