UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

149 lines (106 loc) 6.56 kB
import { useContext } from 'solid-js'; import { IconContext } from '../lib/index.esm.js'; import { template, setAttribute, spread, insert } from 'solid-js/web'; import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../_virtual/_rollupPluginBabelHelpers.js'; const _tmpl$ = template(`<svg><polyline points="80 152 32 104 80 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true), _tmpl$2 = template(`<svg><path d="M224,200a96,96,0,0,0-96-96H32" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true), _tmpl$3 = template(`<svg><polyline points="80 152 32 104 80 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true), _tmpl$4 = template(`<svg><path d="M224,200a96,96,0,0,0-96-96H32" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true), _tmpl$5 = template(`<svg><path d="M128,96H51.31372L85.65723,61.65723A8.00053,8.00053,0,0,0,74.34277,50.34277l-48,48c-.05639.0564-.10424.11792-.15869.17554-.12524.13281-.25122.26538-.36719.40649-.09106.11084-.17114.22706-.25537.34156-.07055.0957-.14477.188-.21093.28686-.085.12647-.15894.25782-.23584.38819-.05567.09423-.11524.186-.16724.283-.06909.12915-.12817.262-.1897.39379-.04931.10547-.102.20874-.147.31665-.05225.12647-.095.25562-.14063.38428-.042.11817-.08764.23462-.12426.35523-.03907.1289-.06787.25976-.10034.39013-.03052.12305-.06519.24414-.09009.36939-.03.15136-.04859.30444-.06983.457-.01465.106-.03515.21-.04565.31714a8.02276,8.02276,0,0,0,0,1.584c.0105.10718.031.21118.04565.31714.02124.15259.0398.30566.06983.457.0249.12525.05957.24634.09009.36939.03247.13037.06127.26123.10034.39013.03662.12061.08227.23706.12426.35523.04566.12866.08838.25781.14063.38428.04492.10791.09766.21118.147.31665.06153.13183.12061.26464.1897.39379.052.09693.11157.18873.16724.283.0769.13037.15087.26172.23584.38819.06616.09887.14038.19116.21093.28686.08423.1145.16431.23072.25537.34156.116.14111.24195.27368.36719.40649.05445.05762.1023.11914.15869.17554l48,48a8.00053,8.00053,0,0,0,11.31446-11.31446L51.31372,112H128a88.09957,88.09957,0,0,1,88,88,8,8,0,0,0,16,0A104.11791,104.11791,0,0,0,128,96Z"></path></svg>`, 4, true), _tmpl$6 = template(`<svg><polyline points="80 152 32 104 80 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true), _tmpl$7 = template(`<svg><path d="M224,200a96,96,0,0,0-96-96H32" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true), _tmpl$8 = template(`<svg><polyline points="80 152 32 104 80 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true), _tmpl$9 = template(`<svg><path d="M224,200a96,96,0,0,0-96-96H32" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true), _tmpl$10 = template(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"></rect></svg>`, 4); var renderPathFor = function renderPathFor(weight, color) { switch (weight) { case "bold": return [function () { var _el$ = _tmpl$.cloneNode(true); setAttribute(_el$, "stroke", color); return _el$; }(), function () { var _el$2 = _tmpl$2.cloneNode(true); setAttribute(_el$2, "stroke", color); return _el$2; }()]; case "duotone": return [function () { var _el$3 = _tmpl$3.cloneNode(true); setAttribute(_el$3, "stroke", color); return _el$3; }(), function () { var _el$4 = _tmpl$4.cloneNode(true); setAttribute(_el$4, "stroke", color); return _el$4; }()]; case "fill": return _tmpl$5.cloneNode(true); case "light": return [function () { var _el$6 = _tmpl$6.cloneNode(true); setAttribute(_el$6, "stroke", color); return _el$6; }(), function () { var _el$7 = _tmpl$7.cloneNode(true); setAttribute(_el$7, "stroke", color); return _el$7; }()]; case "thin": return [function () { var _el$8 = _tmpl$8.cloneNode(true); setAttribute(_el$8, "stroke", color); return _el$8; }(), function () { var _el$9 = _tmpl$9.cloneNode(true); setAttribute(_el$9, "stroke", color); return _el$9; }()]; case "regular": return [function () { var _el$10 = _tmpl$3.cloneNode(true); setAttribute(_el$10, "stroke", color); return _el$10; }(), function () { var _el$11 = _tmpl$4.cloneNode(true); setAttribute(_el$11, "stroke", color); return _el$11; }()]; default: console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'); return null; } }; var ArrowBendUpLeft = function ArrowBendUpLeft(props, ref) { var color = props.color, size = props.size, weight = props.weight, mirrored = props.mirrored, children = props.children, restProps = _objectWithoutPropertiesLoose(props, ["color", "size", "weight", "mirrored", "children"]); var _useContext = useContext(IconContext), contextColor = _useContext.color, contextSize = _useContext.size, contextWeight = _useContext.weight, contextMirrored = _useContext.mirrored, restContext = _objectWithoutPropertiesLoose(_useContext, ["color", "size", "weight", "mirrored"]); return function () { var _el$12 = _tmpl$10.cloneNode(true), _el$13 = _el$12.firstChild; var _ref$ = ref; typeof _ref$ === "function" ? _ref$(_el$12) : ref = _el$12; setAttribute(_el$12, "width", size != null ? size : contextSize); setAttribute(_el$12, "height", size != null ? size : contextSize); setAttribute(_el$12, "fill", color != null ? color : contextColor); setAttribute(_el$12, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined); spread(_el$12, restContext, true, true); spread(_el$12, restProps, true, true); insert(_el$12, children, _el$13); insert(_el$12, function () { return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor); }, null); return _el$12; }(); }; export default ArrowBendUpLeft; //# sourceMappingURL=ArrowBendUpLeft.esm.js.map