phosphor-solid
Version:
A clean and friendly icon family for Solid-js
183 lines (130 loc) • 8.2 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="80 152 32 104 80 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$2 = template(`<svg><polyline points="136 152 88 104 136 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$3 = template(`<svg><path d="M224,200a96,96,0,0,0-96-96H88" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$4 = template(`<svg><polyline points="80 152 32 104 80 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$5 = template(`<svg><polyline points="128 152 80 104 128 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$6 = template(`<svg><path d="M224,200a96,96,0,0,0-96-96H80" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$7 = template(`<svg><g><path d="M43.31348,104,85.65723,61.65723A8.00053,8.00053,0,0,0,74.34277,50.34277l-48,48a8.00122,8.00122,0,0,0,0,11.31446l48,48a8.00053,8.00053,0,0,0,11.31446-11.31446Z"></path><path d="M128,96H99.31372l34.34351-34.34277a8.00053,8.00053,0,0,0-11.31446-11.31446l-48,48c-.05639.05664-.10424.11768-.15869.17578-.12524.13282-.25122.26514-.36719.40625-.09106.11084-.17114.22706-.25537.3418-.07055.09522-.14477.188-.21093.28662-.085.12647-.15894.25782-.23584.38819-.05567.09423-.11524.186-.16724.2832-.06909.12891-.12817.26172-.1897.39355-.04931.10547-.10205.209-.147.31641-.05225.127-.095.25586-.14063.38477-.042.11816-.08764.23437-.12426.355-.03907.1289-.06787.25976-.10034.39013-.03052.12305-.06519.24414-.09009.36914-.03.15186-.04859.30469-.06983.45752-.01465.106-.03515.20948-.04565.3169a8.02276,8.02276,0,0,0,0,1.584c.0105.10742.031.21094.04565.3169.02124.15283.0398.30566.06983.45752.0249.125.05957.24609.09009.36914.03247.13037.06127.26123.10034.39013.03662.12061.08227.23682.12426.355.04566.12891.08838.25782.14063.38477.04492.10742.09766.21094.147.31641.06153.13183.12061.26464.1897.39355.052.09717.11157.189.16724.2832.0769.13037.15088.26172.23584.38819.06616.09863.14038.1914.21093.28662.08423.11474.16431.231.25537.3418.116.14111.242.27343.36719.40625.05445.0581.1023.11914.15869.17578l48,48a8.00053,8.00053,0,0,0,11.31446-11.31446L99.31372,112H128a88.09957,88.09957,0,0,1,88,88,8,8,0,0,0,16,0A104.11791,104.11791,0,0,0,128,96Z"></path></g></svg>`, 8, true),
_tmpl$8 = template(`<svg><polyline points="80 152 32 104 80 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$9 = template(`<svg><polyline points="128 152 80 104 128 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$10 = template(`<svg><path d="M224,200a96,96,0,0,0-96-96H80" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true),
_tmpl$11 = template(`<svg><polyline points="80 152 32 104 80 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$12 = template(`<svg><polyline points="128 152 80 104 128 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$13 = template(`<svg><path d="M224,200a96,96,0,0,0-96-96H80" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true),
_tmpl$14 = 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;
}(), function () {
var _el$3 = _tmpl$3.cloneNode(true);
setAttribute(_el$3, "stroke", color);
return _el$3;
}()];
case "duotone":
return [function () {
var _el$4 = _tmpl$4.cloneNode(true);
setAttribute(_el$4, "stroke", color);
return _el$4;
}(), function () {
var _el$5 = _tmpl$5.cloneNode(true);
setAttribute(_el$5, "stroke", color);
return _el$5;
}(), function () {
var _el$6 = _tmpl$6.cloneNode(true);
setAttribute(_el$6, "stroke", color);
return _el$6;
}()];
case "fill":
return _tmpl$7.cloneNode(true);
case "light":
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;
}(), function () {
var _el$10 = _tmpl$10.cloneNode(true);
setAttribute(_el$10, "stroke", color);
return _el$10;
}()];
case "thin":
return [function () {
var _el$11 = _tmpl$11.cloneNode(true);
setAttribute(_el$11, "stroke", color);
return _el$11;
}(), function () {
var _el$12 = _tmpl$12.cloneNode(true);
setAttribute(_el$12, "stroke", color);
return _el$12;
}(), function () {
var _el$13 = _tmpl$13.cloneNode(true);
setAttribute(_el$13, "stroke", color);
return _el$13;
}()];
case "regular":
return [function () {
var _el$14 = _tmpl$4.cloneNode(true);
setAttribute(_el$14, "stroke", color);
return _el$14;
}(), function () {
var _el$15 = _tmpl$5.cloneNode(true);
setAttribute(_el$15, "stroke", color);
return _el$15;
}(), function () {
var _el$16 = _tmpl$6.cloneNode(true);
setAttribute(_el$16, "stroke", color);
return _el$16;
}()];
default:
console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".');
return null;
}
};
var ArrowBendDoubleUpLeft = function ArrowBendDoubleUpLeft(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$17 = _tmpl$14.cloneNode(true),
_el$18 = _el$17.firstChild;
var _ref$ = ref;
typeof _ref$ === "function" ? _ref$(_el$17) : ref = _el$17;
setAttribute(_el$17, "width", size != null ? size : contextSize);
setAttribute(_el$17, "height", size != null ? size : contextSize);
setAttribute(_el$17, "fill", color != null ? color : contextColor);
setAttribute(_el$17, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined);
spread(_el$17, restContext, true, true);
spread(_el$17, restProps, true, true);
insert(_el$17, children, _el$18);
insert(_el$17, function () {
return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor);
}, null);
return _el$17;
}();
};
export default ArrowBendDoubleUpLeft;
//# sourceMappingURL=ArrowBendDoubleUpLeft.esm.js.map