UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

183 lines (130 loc) 8.09 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><line x1="80" y1="88" x2="192" y2="200" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true), _tmpl$2 = template(`<svg><polyline points="192 100 192 200 92 200" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true), _tmpl$3 = template(`<svg><line x1="40" y1="40.00373" x2="216" y2="40.00373" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true), _tmpl$4 = template(`<svg><line x1="80" y1="88" x2="192" y2="200" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true), _tmpl$5 = template(`<svg><polyline points="192 100 192 200 92 200" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true), _tmpl$6 = template(`<svg><line x1="40" y1="40.00373" x2="216" y2="40.00373" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true), _tmpl$7 = template(`<svg><path d="M200,100V200c0,.26349-.01416.52686-.04.78937-.01123.118-.03369.23248-.05029.34887-.02.142-.03662.28437-.06494.4253-.02588.13238-.0625.2608-.09522.39081-.03076.1231-.0581.24688-.09472.36877-.03858.1272-.08643.25-.13135.37439-.04346.12189-.0835.24457-.1333.36462-.04737.11481-.10352.22486-.15625.33686-.0586.12518-.11426.25134-.18018.3739-.05566.10406-.11963.20288-.17969.30414-.07324.1231-.14257.24743-.22314.36737-.07227.108-.15283.20916-.23047.31329-.07812.10541-.15186.2132-.23584.31555-.13574.16516-.28125.32147-.4292.47522-.03418.0354-.06348.07379-.09814.10877-.03565.03552-.07471.06512-.11084.09985-.15332.14764-.30909.29279-.47364.42792-.10009.0824-.20556.15436-.30908.23114-.10644.079-.21.1615-.32031.23529-.11768.07879-.23975.14722-.36035.21911-.10352.06159-.20459.12665-.311.18366-.12109.06476-.24511.11969-.36865.17773-.11377.05353-.2251.11023-.3418.15851-.11816.04907-.23974.08869-.35986.13178-.126.04528-.25049.09369-.37939.13269-.11963.03613-.24122.06262-.36231.09308-.13184.03338-.26269.07037-.397.097-.13965.02765-.28028.044-.42041.06415-.11817.01691-.23389.03925-.353.051C192.52686,207.986,192.26367,208,192,208H92a8,8,0,0,1,0-16h80.686L74.34277,93.65674A8.00018,8.00018,0,1,1,85.65723,82.34326L184,180.68585V100a8,8,0,0,1,16,0Zm16-67.99609H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"></path></svg>`, 4, true), _tmpl$8 = template(`<svg><line x1="80" y1="88" x2="192" y2="200" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true), _tmpl$9 = template(`<svg><polyline points="192 100 192 200 92 200" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true), _tmpl$10 = template(`<svg><line x1="40" y1="40.00373" x2="216" y2="40.00373" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true), _tmpl$11 = template(`<svg><line x1="80" y1="88" x2="192" y2="200" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true), _tmpl$12 = template(`<svg><polyline points="192 100 192 200 92 200" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true), _tmpl$13 = template(`<svg><line x1="40" y1="40.00373" x2="216" y2="40.00373" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true), _tmpl$14 = 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; }(), function () { var _el$3 = _tmpl$3.cloneNode(true); setAttribute(_el$3, "stroke", color); return _el$3; }()]; case "duotone": return [function () { var _el$4 = _tmpl$4.cloneNode(true); setAttribute(_el$4, "stroke", color); return _el$4; }(), function () { var _el$5 = _tmpl$5.cloneNode(true); setAttribute(_el$5, "stroke", color); return _el$5; }(), function () { var _el$6 = _tmpl$6.cloneNode(true); setAttribute(_el$6, "stroke", color); return _el$6; }()]; case "fill": return _tmpl$7.cloneNode(true); case "light": 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; }(), function () { var _el$10 = _tmpl$10.cloneNode(true); setAttribute(_el$10, "stroke", color); return _el$10; }()]; case "thin": return [function () { var _el$11 = _tmpl$11.cloneNode(true); setAttribute(_el$11, "stroke", color); return _el$11; }(), function () { var _el$12 = _tmpl$12.cloneNode(true); setAttribute(_el$12, "stroke", color); return _el$12; }(), function () { var _el$13 = _tmpl$13.cloneNode(true); setAttribute(_el$13, "stroke", color); return _el$13; }()]; case "regular": return [function () { var _el$14 = _tmpl$4.cloneNode(true); setAttribute(_el$14, "stroke", color); return _el$14; }(), function () { var _el$15 = _tmpl$5.cloneNode(true); setAttribute(_el$15, "stroke", color); return _el$15; }(), function () { var _el$16 = _tmpl$6.cloneNode(true); setAttribute(_el$16, "stroke", color); return _el$16; }()]; default: console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'); return null; } }; var ArrowLineDownRight = function ArrowLineDownRight(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$17 = _tmpl$14.cloneNode(true), _el$18 = _el$17.firstChild; var _ref$ = ref; typeof _ref$ === "function" ? _ref$(_el$17) : ref = _el$17; setAttribute(_el$17, "width", size != null ? size : contextSize); setAttribute(_el$17, "height", size != null ? size : contextSize); setAttribute(_el$17, "fill", color != null ? color : contextColor); setAttribute(_el$17, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined); spread(_el$17, restContext, true, true); spread(_el$17, restProps, true, true); insert(_el$17, children, _el$18); insert(_el$17, function () { return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor); }, null); return _el$17; }(); }; export default ArrowLineDownRight; //# sourceMappingURL=ArrowLineDownRight.esm.js.map