phosphor-solid
Version:
A clean and friendly icon family for Solid-js
149 lines (106 loc) • 6.65 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="104 176 152 224 200 176" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$2 = template(`<svg><path d="M56,32a96,96,0,0,1,96,96v96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$3 = template(`<svg><polyline points="104 176 152 224 200 176" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$4 = template(`<svg><path d="M56,32a96,96,0,0,1,96,96v96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$5 = template(`<svg><path d="M205.65723,170.34277a8.003,8.003,0,0,0-11.31446,0L160,204.68628V128A104.11791,104.11791,0,0,0,56,24a8,8,0,0,0,0,16,88.09957,88.09957,0,0,1,88,88v76.68628l-34.34277-34.34351a8.00053,8.00053,0,0,0-11.31446,11.31446l48,48c.05445.0542.11377.10034.16919.15283.135.12744.26978.25561.41358.37353.10644.08765.2185.16431.32837.24561.10009.074.19726.15185.30078.22119.12182.08154.248.15259.37329.22681.09936.05884.19629.12134.29858.17627.124.0664.25147.1228.37842.18237.11035.05176.21875.10693.332.15405.1211.05.24487.09058.36792.13452.12354.04444.24536.0918.37183.13013.12158.03687.24511.064.36816.09473.13037.033.259.06933.3916.0957.14087.02783.283.04443.42481.0647.11645.0166.231.03882.34912.05029.26245.02588.52588.04.78955.04s.5271-.01416.78955-.04c.11816-.01147.23267-.03369.34912-.05029.14185-.02027.28394-.03687.42481-.0647.13256-.02637.26123-.06274.3916-.0957.123-.03076.24658-.05786.36816-.09473.12647-.03833.24829-.08569.37183-.13013.12305-.04394.24682-.08447.36792-.13452.11328-.04712.22168-.10229.332-.15405.127-.05957.25439-.116.37842-.18237.10229-.05493.19922-.11743.29858-.17627.12525-.07422.25147-.14527.37329-.22681.10352-.06934.20069-.14722.30078-.22119.10987-.0813.22193-.158.32837-.24561.1438-.11792.27857-.24609.41358-.37353.05542-.05249.11474-.09863.16919-.15283l48-48A8.00122,8.00122,0,0,0,205.65723,170.34277Z"></path></svg>`, 4, true),
_tmpl$6 = template(`<svg><polyline points="104 176 152 224 200 176" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$7 = template(`<svg><path d="M56,32a96,96,0,0,1,96,96v96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true),
_tmpl$8 = template(`<svg><polyline points="104 176 152 224 200 176" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$9 = template(`<svg><path d="M56,32a96,96,0,0,1,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 ArrowBendRightDown = function ArrowBendRightDown(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 ArrowBendRightDown;
//# sourceMappingURL=ArrowBendRightDown.esm.js.map