UNPKG

@atlaskit/icon

Version:

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

42 lines • 2.82 kB
/* ai-generative-text.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-text.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'; // Pencil will rotate (0 to -24deg) from 0-200ms and hold until 400ms // Star will scale (1 to 0.5) from 200ms-400ms // Exit duration is 250ms to return to original state var TIMELINE = [{ phase: 'interaction', durationMs: 400 }]; var animatedStyles = { base: "_ejdb1e03 _12lu1ytf _1lbi1doz _1px31ul7 _14vt1h7a", interaction: "_1px31x44 _7q9ufnf5 _14vt1jia _1b24fnf5 _btksfnf5" }; var glyph = "\n\t<path\n\t\tdata-anim=\"star\"\n\t\td=\"M12.617 9.011a.75.75 0 0 1 .588.483l.615 1.687 1.687.615a.75.75 0 0 1 0 1.41l-1.687.615-.615 1.686a.75.75 0 0 1-1.409 0l-.616-1.686-1.686-.616a.75.75 0 0 1 0-1.409l1.686-.615.616-1.687.048-.106A.75.75 0 0 1 12.5 9z\"\n\t\tfill=\"currentColor\"\n\t\tstyle=\"transform-origin: 12.5px 12.5px;\"\n\t/>\n\t<path\n\t\tdata-anim=\"pencil\"\n\t\td=\"M9.337.604a2 2 0 0 1 2.828 0l1.233 1.232a2 2 0 0 1 0 2.828l-8.1 8.099a2 2 0 0 1-1.022.547l-3.378.676a.75.75 0 0 1-.883-.883l.676-3.38a2 2 0 0 1 .546-1.02zm-7.04 9.159a.5.5 0 0 0-.136.256l-.456 2.275 2.278-.455a.5.5 0 0 0 .254-.137l6.078-6.078-1.94-1.94zm8.808-8.099a.5.5 0 0 0-.707 0l-.961.961 1.94 1.94.96-.961a.5.5 0 0 0 0-.707z\"\n\t\tfill=\"currentColor\"\n\t\tfill-rule=\"evenodd\"\n\t\tclip-rule=\"evenodd\"\n\t\tstyle=\"transform-origin: 12.5px 12.5px;\"\n\t/>"; /** * Animated AI write icon: the pencil tilts and the star shrinks. */ var AiGenerativeTextAnimatedIcon = /*#__PURE__*/forwardRef(function AiGenerativeTextAnimatedIcon(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: "AiGenerativeTextIcon", dangerouslySetGlyph: glyph, isAnimatedIcon: true // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props }, props, { size: "medium" }))); }); AiGenerativeTextAnimatedIcon.displayName = 'AiGenerativeTextIcon'; export default AiGenerativeTextAnimatedIcon;