UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

149 lines (106 loc) 6.64 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="192" y1="64" x2="64" y2="192" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true), _tmpl$2 = template(`<svg><polyline points="168 192 64 192 64 88" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true), _tmpl$3 = template(`<svg><line x1="192" y1="64" x2="64" y2="192" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true), _tmpl$4 = template(`<svg><polyline points="168 192 64 192 64 88" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true), _tmpl$5 = template(`<svg><path d="M57.59033,196.772c-.08154-.10888-.166-.21582-.24219-.3291-.07763-.11621-.1455-.2373-.2163-.35644-.0625-.105-.12842-.207-.186-.315-.06445-.11962-.11865-.24316-.17627-.36572-.0542-.11474-.11133-.227-.16015-.34472-.04883-.11719-.0879-.23682-.13038-.356-.04589-.12744-.09423-.25293-.13379-.3833-.03613-.11914-.0625-.23975-.09277-.35987-.03369-.13281-.0708-.26367-.09717-.39892-.02783-.13819-.04394-.27783-.064-.41748-.01709-.11914-.03955-.23633-.05127-.35694q-.03808-.38232-.03906-.7666L56,192V88a8,8,0,0,1,16,0v84.686L186.34326,58.34277a8.00018,8.00018,0,1,1,11.31348,11.31446L83.314,184H168a8,8,0,0,1,0,16H64c-.26367,0-.52686-.01416-.78955-.04-.11914-.01172-.23486-.03369-.353-.05078-.14013-.02-.28076-.03662-.42041-.064-.13428-.02685-.26513-.064-.397-.09716-.12109-.03028-.24268-.05713-.36231-.09326-.1289-.03907-.2539-.08741-.37988-.13282-.12012-.043-.24121-.08252-.35937-.13135-.1167-.04882-.229-.10546-.34327-.15966-.12255-.05762-.24658-.11231-.36669-.17676-.10791-.05762-.21-.12305-.31446-.18555-.11963-.07129-.24072-.13867-.35693-.21679-.11279-.07569-.21924-.15967-.32764-.24073-.10058-.07519-.2041-.14551-.30176-.22558-.17822-.14649-.34765-.30225-.51269-.46338-.02295-.023-.04883-.042-.07178-.06494-.02-.02051-.03711-.04248-.05713-.063-.16406-.16748-.32275-.34082-.47168-.522C57.73438,196.97461,57.665,196.87207,57.59033,196.772Z"></path></svg>`, 4, true), _tmpl$6 = template(`<svg><line x1="192" y1="64" x2="64" y2="192" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true), _tmpl$7 = template(`<svg><polyline points="168 192 64 192 64 88" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true), _tmpl$8 = template(`<svg><line x1="192" y1="64" x2="64" y2="192" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true), _tmpl$9 = template(`<svg><polyline points="168 192 64 192 64 88" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></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 ArrowDownLeft = function ArrowDownLeft(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 ArrowDownLeft; //# sourceMappingURL=ArrowDownLeft.esm.js.map