UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

183 lines (130 loc) 8.05 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="176" y1="168" x2="64" y2="56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true), _tmpl$2 = template(`<svg><polyline points="64 156 64 56 164 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true), _tmpl$3 = template(`<svg><line x1="216" y1="215.99627" x2="40" y2="215.99627" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true), _tmpl$4 = template(`<svg><line x1="176" y1="168" x2="64" y2="56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true), _tmpl$5 = template(`<svg><polyline points="64 156 64 56 164 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true), _tmpl$6 = template(`<svg><line x1="216" y1="215.99627" x2="40" y2="215.99627" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true), _tmpl$7 = template(`<svg><path d="M176,176a7.977,7.977,0,0,1-5.65723-2.34326L72,75.31372V156a8,8,0,0,1-16,0V56c0-.26349.01416-.52686.04-.78931.01123-.11853.03369-.23358.05029-.35052.02051-.14136.03711-.28314.06494-.42352.02637-.13349.063-.26294.09571-.39393.03076-.12194.05761-.24462.09423-.36535.03907-.129.08741-.25354.13282-.37976.043-.11994.08252-.2406.13135-.35877.04882-.11792.10644-.231.16064-.346.05713-.12182.11133-.24462.17529-.364.0586-.11011.126-.2146.18994-.32153.06983-.11688.13575-.23517.21192-.34912.07959-.11878.168-.23053.25342-.34473.07129-.09466.13671-.19189.21289-.28406a8.04368,8.04368,0,0,1,1.1167-1.11694c.08837-.07233.18115-.135.27148-.203.11816-.08893.23438-.18048.35791-.26282.10986-.07367.22412-.13739.33691-.205.11133-.06653.21973-.13611.33448-.19732.11474-.06147.2334-.11353.35058-.169.11914-.05658.23682-.116.35938-.16675.11279-.04663.228-.0841.34228-.12536.13184-.04767.26221-.098.397-.1388.11377-.0343.229-.05914.34326-.08826.13818-.03515.2749-.0736.416-.1015.12989-.02575.26172-.04065.39258-.05993.12695-.01868.25244-.04236.38135-.055.23193-.02282.46484-.03271.69824-.03527C63.94141,48.00415,63.97021,48,64,48H164a8,8,0,0,1,0,16H83.31348l98.34375,98.34326A8,8,0,0,1,176,176ZM32,215.99609a8.00008,8.00008,0,0,0,8,8H216a8,8,0,0,0,0-16H40A8.00009,8.00009,0,0,0,32,215.99609Z"></path></svg>`, 4, true), _tmpl$8 = template(`<svg><line x1="176" y1="168" x2="64" y2="56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true), _tmpl$9 = template(`<svg><polyline points="64 156 64 56 164 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true), _tmpl$10 = template(`<svg><line x1="216" y1="215.99627" x2="40" y2="215.99627" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true), _tmpl$11 = template(`<svg><line x1="176" y1="168" x2="64" y2="56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true), _tmpl$12 = template(`<svg><polyline points="64 156 64 56 164 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true), _tmpl$13 = template(`<svg><line x1="216" y1="215.99627" x2="40" y2="215.99627" 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 ArrowLineUpLeft = function ArrowLineUpLeft(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 ArrowLineUpLeft; //# sourceMappingURL=ArrowLineUpLeft.esm.js.map