phosphor-solid
Version:
A clean and friendly icon family for Solid-js
149 lines (106 loc) • 6.59 kB
JavaScript
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="128 160 80 208 32 160" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$2 = template(`<svg><polyline points="224 64 80 64 80 208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$3 = template(`<svg><polyline points="128 160 80 208 32 160" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$4 = template(`<svg><polyline points="224 64 80 64 80 208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$5 = template(`<svg><path d="M224,56H80a8.00008,8.00008,0,0,0-8,8V188.6864L37.65723,154.34326a8.00018,8.00018,0,0,0-11.31446,11.31348l48,48c.01612.01611.03394.0293.05.04529.17163.16882.34961.33117.53589.48413.09448.07751.19385.145.291.21765.11206.08374.22143.17053.33789.24853.11474.07679.23388.14331.3518.21363.1062.06347.21.13012.31934.18872.11987.06421.24341.11865.366.17627.11425.05395.22656.11084.34375.15942.11816.04907.23877.0885.35888.13147.12647.04553.25122.09387.38062.13318.11963.03613.24121.06262.3623.093.13184.03332.262.07031.39624.09692.14087.02783.283.04443.42481.0647.11645.01672.231.03882.34912.05041C79.4729,215.986,79.73633,216,80,216s.5271-.014.78955-.03992c.11816-.01159.23267-.03369.34912-.05041.14185-.02027.28394-.03687.42481-.0647.13427-.02661.2644-.0636.39624-.09692.12109-.0304.24267-.05689.3623-.093.1294-.03931.25415-.08765.38062-.13318.12011-.043.24072-.0824.35888-.13147.11719-.04858.2295-.10547.34375-.15942.12256-.05762.2461-.11206.366-.17627.10938-.0586.21313-.12525.31934-.18872.11792-.07032.23706-.13684.3518-.21363.11646-.078.22583-.16479.33789-.24853.09717-.07263.19654-.14014.291-.21765.18628-.153.36426-.31531.53589-.48413.01611-.016.03393-.02918.05-.04529l48-48a8.00018,8.00018,0,0,0-11.31446-11.31348L88,188.6864V72H224a8,8,0,0,0,0-16Z"></path></svg>`, 4, true),
_tmpl$6 = template(`<svg><polyline points="128 160 80 208 32 160" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$7 = template(`<svg><polyline points="224 64 80 64 80 208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$8 = template(`<svg><polyline points="128 160 80 208 32 160" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$9 = template(`<svg><polyline points="224 64 80 64 80 208" 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 ArrowElbowLeftDown = function ArrowElbowLeftDown(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 ArrowElbowLeftDown;
//# sourceMappingURL=ArrowElbowLeftDown.esm.js.map