UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

149 lines (106 loc) 6.86 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="232.002 200 136.002 104 96.002 144 24.002 72" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true), _tmpl$2 = template(`<svg><polyline points="232.002 136 232.002 200 168.002 200" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true), _tmpl$3 = template(`<svg><polyline points="232.002 200 136.002 104 96.002 144 24.002 72" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true), _tmpl$4 = template(`<svg><polyline points="232.002 136 232.002 200 168.002 200" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true), _tmpl$5 = template(`<svg><path d="M238.41943,204.76245c.07862-.10571.16065-.20862.23438-.31836.08057-.1206.15088-.24585.22461-.36987.05957-.1001.12207-.19751.17724-.30029.06788-.126.125-.25538.18506-.384.05078-.1084.10547-.2146.15137-.32568.05127-.12463.09326-.25195.13867-.37842.04248-.11987.08887-.238.126-.36059.03857-.12769.06738-.25757.09912-.38672.03125-.124.06592-.24622.09131-.37244.02978-.15088.04785-.30334.06933-.45544.01465-.10645.03516-.21094.0459-.31861q.03955-.39769.04-.79712V136a8,8,0,0,0-16,0v44.686L141.65967,98.34326a8.00122,8.00122,0,0,0-11.31446,0L96.00244,132.686,29.65967,66.34326A8.00018,8.00018,0,1,0,18.34521,77.65674l72,72a8.00122,8.00122,0,0,0,11.31446,0L136.00244,115.314,212.68848,192h-44.686a8,8,0,1,0,0,16h64c.26367,0,.52735-.014.78955-.03992.11817-.01159.23242-.03369.34912-.05041.1416-.02027.28418-.03687.42481-.0647.13428-.02661.26465-.0636.39648-.09692.12061-.0304.24219-.05689.36231-.093.1289-.03931.2539-.08765.38037-.13318.12012-.043.24072-.0824.35888-.13147.11719-.04858.2295-.10547.34375-.15942.12256-.05762.2461-.11206.36622-.17627.10888-.0586.21289-.12525.31933-.18872.11768-.07032.23682-.13684.35156-.21363.11622-.078.22608-.16479.33789-.24853.09717-.07263.19678-.14014.291-.21765.18652-.153.36426-.31531.53565-.48413.01611-.016.03417-.02918.05029-.04529.02051-.02051.0376-.04321.05762-.064.16357-.167.32177-.33935.47021-.52026C238.27051,204.97192,238.34277,204.866,238.41943,204.76245Z"></path></svg>`, 4, true), _tmpl$6 = template(`<svg><polyline points="232.002 200 136.002 104 96.002 144 24.002 72" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true), _tmpl$7 = template(`<svg><polyline points="232.002 136 232.002 200 168.002 200" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true), _tmpl$8 = template(`<svg><polyline points="232.002 200 136.002 104 96.002 144 24.002 72" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true), _tmpl$9 = template(`<svg><polyline points="232.002 136 232.002 200 168.002 200" 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 TrendDown = function TrendDown(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 TrendDown; //# sourceMappingURL=TrendDown.esm.js.map