{"version":3,"file":"RefreshSpinner.jsx","names":["stylex","memo","interaction","size","spin","keyframes","from","rotate","to","throb","opacity","styles","create","svg","fill","idle","animationName","animationDuration","animationTimingFunction","animationIterationCount","animationDirection","pulling","progressDegree","maskImage","refreshing","done","visibility","sizes","small","width","px4","height","maxWidth","maxHeight","medium","px8","RefreshSpinner","t0","$","_c","status","pullPosition","style","t1","props","inert","t2","Symbol","for","t3"],"sources":["../src/RefreshSpinner.tsx"],"sourcesContent":["import * as stylex from \"@stylexjs/stylex\";\nimport { memo } from \"react\";\nimport { interaction } from \"./mixins\";\nimport { size } from \"./tokens.stylex\";\n\nexport interface RefreshSpinnerProps {\n\tsize: \"small\" | \"medium\";\n\tstatus: RefreshSpinnerStatus;\n\tpullPosition?: number;\n\n\tstyle?: stylex.StyleXStyles<{\n\t\tzIndex?: number;\n\t}>;\n}\n\nexport type RefreshSpinnerStatus = \"idle\" | \"pulling\" | \"refreshing\" | \"done\";\n\nconst spin = stylex.keyframes({\n\tfrom: {\n\t\trotate: \"0deg\",\n\t},\n\tto: {\n\t\trotate: \"360deg\",\n\t},\n});\n\nconst throb = stylex.keyframes({\n\tfrom: {\n\t\topacity: 0.1,\n\t},\n\tto: {\n\t\topacity: 0.5,\n\t},\n});\n\nconst styles = stylex.create({\n\tsvg: {\n\t\tfill: \"currentColor\",\n\t\topacity: 0.5,\n\t},\n\n\tidle: {\n\t\tanimationName: throb,\n\t\tanimationDuration: \"1s\",\n\t\tanimationTimingFunction: \"ease-in-out\",\n\t\tanimationIterationCount: \"infinite\",\n\t\tanimationDirection: \"alternate\",\n\t},\n\tpulling: (progressDegree) => ({\n\t\tmaskImage: `conic-gradient(from ${progressDegree}deg, #fff0, #ffff)`,\n\t}),\n\trefreshing: {\n\t\tanimationName: spin,\n\t\tanimationDuration: \"3s\",\n\t\tanimationTimingFunction: \"linear\",\n\t\tanimationIterationCount: \"infinite\",\n\t},\n\tdone: {\n\t\t// We're setting the class instantly and don't remember the previous state\n\t\t// This means that the icon may be spinning before\n\t\t// we cannot retain its position, so it will jump back to the initial rotation. This would be visible if we'd animate the opacity.\n\t\t// transition: `opacity ${duration.slow}`,\n\t\tvisibility: \"hidden\",\n\t},\n});\n\nconst sizes = stylex.create({\n\tsmall: {\n\t\twidth: size.px4,\n\t\theight: size.px4,\n\t\tmaxWidth: size.px4,\n\t\tmaxHeight: size.px4,\n\t},\n\tmedium: {\n\t\twidth: size.px8,\n\t\theight: size.px8,\n\t\tmaxWidth: size.px8,\n\t\tmaxHeight: size.px8,\n\t},\n});\n\nexport default memo(function RefreshSpinner({\n\tsize,\n\tstatus,\n\tpullPosition,\n\tstyle,\n}: RefreshSpinnerProps) {\n\treturn (\n\t\t// biome-ignore lint/a11y/noSvgWithoutTitle: it's a spinner, it doesn't need a title\n\t\t<svg\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\twidth=\"24\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 1024 1024\"\n\t\t\t{...stylex.props(\n\t\t\t\tinteraction.inert,\n\t\t\t\tstyles.svg,\n\t\t\t\tsizes[size],\n\t\t\t\tstatus === \"pulling\"\n\t\t\t\t\t? styles.pulling(pullPosition)\n\t\t\t\t\t: styles[status],\n\t\t\t\tstyle,\n\t\t\t)}\n\t\t>\n\t\t\t<path d=\"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.2 0l136 135.8a32 32 0 0 1-45.3 45.3L195.2 240.4a32 32 0 0 1 0-45.2zm452.5 452.5a32 32 0 0 1 45.3 0l135.8 135.9a32 32 0 0 1-45.2 45.2L647.7 693a32 32 0 0 1 0-45.3z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