phosphor-solid
Version:
A clean and friendly icon family for Solid-js
149 lines (106 loc) • 6.61 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="152 176 104 224 56 176" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$2 = template(`<svg><path d="M200,32a96,96,0,0,0-96,96v96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$3 = template(`<svg><polyline points="152 176 104 224 56 176" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$4 = template(`<svg><path d="M200,32a96,96,0,0,0-96,96v96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$5 = template(`<svg><path d="M200,24A104.11791,104.11791,0,0,0,96,128v76.68652L61.65723,170.34277a8.00053,8.00053,0,0,0-11.31446,11.31446l48,48c.05445.0542.11377.10058.16919.15283.135.12744.26978.25537.41358.37353.10644.08789.2185.16455.32837.24561.10009.07422.19726.15185.30078.22119.12182.08154.248.15234.37329.22656.09936.05909.19629.12159.29858.17627.124.0669.25147.123.37842.18262.11035.05176.21875.10693.332.15381.1211.05029.24487.09082.36792.13476.12354.04444.24536.0918.37183.13038.12158.03662.24511.06347.36816.09472.13037.03272.259.06885.3916.09522.14087.02832.283.04492.42481.06494.11645.0166.231.03857.34912.05029.26245.02588.52588.04.78955.04s.5271-.01416.78955-.04c.11816-.01172.23267-.03369.34912-.05029.14185-.02.28394-.03662.42481-.06494.13256-.02637.26123-.0625.3916-.09522.123-.03125.24658-.0581.36816-.09472.12647-.03858.24829-.08594.37183-.13038.123-.04394.24682-.08447.36792-.13476.11328-.04688.22168-.102.332-.15381.12695-.05957.25439-.11572.37842-.18262.10229-.05468.19922-.11718.29858-.17627.12525-.07422.25147-.145.37329-.22656.10352-.06934.20069-.147.30078-.22119.10987-.08106.22193-.15772.32837-.24561.1438-.11816.27857-.24609.41358-.37353.05542-.05225.11474-.09863.16919-.15283l48-48a8.00053,8.00053,0,0,0-11.31446-11.31446L112,204.68652V128a88.09957,88.09957,0,0,1,88-88,8,8,0,0,0,0-16Z"></path></svg>`, 4, true),
_tmpl$6 = template(`<svg><polyline points="152 176 104 224 56 176" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$7 = template(`<svg><path d="M200,32a96,96,0,0,0-96,96v96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true),
_tmpl$8 = template(`<svg><polyline points="152 176 104 224 56 176" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$9 = template(`<svg><path d="M200,32a96,96,0,0,0-96,96v96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></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 ArrowBendLeftDown = function ArrowBendLeftDown(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 ArrowBendLeftDown;
//# sourceMappingURL=ArrowBendLeftDown.esm.js.map