phosphor-solid
Version:
A clean and friendly icon family for Solid-js
353 lines (250 loc) • 19.4 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="156.284 188.284 128 160 99.716 188.284" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$2 = template(`<svg><line x1="128" y1="232" x2="128" y2="160" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true),
_tmpl$3 = template(`<svg><polyline points="99.716 67.716 128 96 156.284 67.716" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$4 = template(`<svg><line x1="128" y1="24" x2="128" y2="96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true),
_tmpl$5 = template(`<svg><polyline points="67.716 156.284 96 128 67.716 99.716" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$6 = template(`<svg><line x1="24" y1="128" x2="96" y2="128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true),
_tmpl$7 = template(`<svg><polyline points="188.284 99.716 160 128 188.284 156.284" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$8 = template(`<svg><line x1="232" y1="128" x2="160" y2="128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true),
_tmpl$9 = template(`<svg><polyline points="156.284 188.284 128 160 99.716 188.284" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$10 = template(`<svg><line x1="128" y1="232" x2="128" y2="160" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true),
_tmpl$11 = template(`<svg><polyline points="99.716 67.716 128 96 156.284 67.716" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$12 = template(`<svg><line x1="128" y1="24" x2="128" y2="96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true),
_tmpl$13 = template(`<svg><polyline points="67.716 156.284 96 128 67.716 99.716" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$14 = template(`<svg><line x1="24" y1="128" x2="96" y2="128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true),
_tmpl$15 = template(`<svg><polyline points="188.284 99.716 160 128 188.284 156.284" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$16 = template(`<svg><line x1="232" y1="128" x2="160" y2="128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true),
_tmpl$17 = template(`<svg><g><path d="M133.65723,154.34277c-.05323-.05334-.11133-.09851-.166-.15-.13623-.12872-.27246-.25769-.417-.37671-.10449-.08575-.21436-.16083-.32178-.24048-.10254-.07593-.20166-.15533-.3081-.22638-.11817-.0791-.24073-.14795-.36231-.22009-.10351-.06165-.2041-.12659-.31055-.18359-.11865-.06324-.24023-.11683-.36084-.17371-.11669-.05518-.23144-.11328-.35107-.1629-.1123-.04657-.22754-.084-.3418-.12519-.13281-.048-.26367-.09851-.39941-.13952-.10938-.033-.2207-.057-.33106-.08521-.14257-.03644-.2832-.07586-.42822-.10455-.12158-.024-.24414-.0376-.3667-.05591-.13574-.02039-.27-.04547-.4082-.0589-.20215-.01977-.40479-.02624-.60742-.0307C128.11768,152.00763,128.05957,152,128,152s-.11768.00763-.17676.00891c-.20263.00446-.40527.01093-.60742.0307-.13818.01343-.27246.03851-.4082.0589-.12256.01831-.24512.03186-.3667.05591-.145.02869-.28565.06811-.42822.10455-.11036.02826-.22168.05219-.33106.08521-.13574.041-.2666.09155-.39941.13952-.11426.0412-.2295.07862-.3418.12519-.11963.04962-.23438.10772-.35107.1629-.12061.05688-.24219.11047-.36084.17371-.10645.057-.207.12194-.31055.18359-.12158.07214-.24414.141-.36231.22009-.10644.07105-.20556.15045-.3081.22638-.10742.07965-.21729.15473-.32178.24048-.14453.119-.28076.248-.417.37671-.05469.05151-.11279.09668-.166.15L94.05859,182.627a8.00053,8.00053,0,0,0,11.31446,11.31446L120,179.31384V232a8,8,0,0,0,16,0V179.31384L150.627,193.94141A8.00053,8.00053,0,0,0,161.94141,182.627Z"></path><path d="M122.34277,101.65723c.0542.05432.11377.10034.16895.15277.13525.12762.27.25561.41406.37365.10645.08759.21826.16431.32813.24555.10009.074.19726.15173.30078.22113.12207.0816.248.15265.37353.22681.09912.059.19629.12152.29834.17627.124.06646.25147.12292.37842.18237.11035.05194.21875.10712.332.15411.1211.05011.24463.0907.36768.13465.12353.04431.2456.09173.37207.13006.12158.03681.24512.06384.36816.09473.13037.03284.25879.06927.3916.09558.14063.028.28321.04456.42481.06482.1167.01666.231.03876.34912.05035.26221.02588.52588.03992.78955.03992s.52734-.014.78955-.03992c.11816-.01159.23242-.03369.34912-.05035.1416-.02026.28418-.03687.42481-.06482.13281-.02631.26123-.06274.3916-.09558.123-.03089.24658-.05792.36816-.09473.12647-.03833.24854-.08575.37207-.13006.12305-.04395.24658-.08454.36768-.13465.11328-.047.22168-.10217.332-.15411.127-.05945.25439-.11591.37842-.18237.10205-.05475.19922-.11725.29834-.17627.12549-.07416.25146-.14521.37353-.22681.10352-.0694.20069-.1471.30078-.22113.10987-.08124.22168-.158.32813-.24555.144-.118.27881-.246.41406-.37365.05518-.05243.11475-.09845.16895-.15277l28.28418-28.28418A8.00053,8.00053,0,0,0,150.627,62.05859L136,76.68616V24a8,8,0,0,0-16,0V76.68616L105.37305,62.05859A8.00053,8.00053,0,0,0,94.05859,73.37305Z"></path><path d="M101.81592,133.48169c.12549-.13287.251-.26532.36719-.40649.0913-.11072.17138-.22718.25537-.34156.07031-.09564.14453-.18805.21093-.28686.085-.12659.15918-.25782.23584-.38806.05567-.09443.11524-.18622.167-.28309.06933-.12915.12841-.26184.18994-.39379.04931-.10547.10205-.20874.147-.31665.05225-.12653.09522-.25568.14063-.38428.042-.11817.0874-.2345.124-.35517.03906-.1289.06787-.25982.10058-.39019.03077-.123.06543-.24414.09034-.36933.02978-.15149.04834-.30444.06933-.45715.01465-.1059.03516-.2099.0459-.31714a8.02155,8.02155,0,0,0,0-1.58386c-.01074-.10724-.03125-.21124-.0459-.31714-.021-.15271-.03955-.30566-.06933-.45715-.02491-.12519-.05957-.24634-.09034-.36933-.03271-.13037-.06152-.26129-.10058-.39019-.03662-.12067-.082-.237-.124-.35517-.04541-.1286-.08838-.25775-.14063-.38428-.04492-.10791-.09766-.21118-.147-.31665-.06153-.132-.12061-.26464-.18994-.39379-.05176-.09687-.11133-.18866-.167-.28309-.07666-.13024-.15087-.26147-.23584-.38806-.0664-.09881-.14062-.19122-.21093-.28686-.084-.11438-.16407-.23084-.25537-.34156-.11622-.14117-.2417-.27362-.36719-.40649-.0542-.05768-.10205-.11914-.15869-.17554L73.37305,94.05859a8.00053,8.00053,0,0,0-11.31446,11.31446L76.686,120H24a8,8,0,0,0,0,16H76.686L62.05859,150.627a8.00053,8.00053,0,0,0,11.31446,11.31446l28.28418-28.28418C101.71387,133.60083,101.76172,133.53937,101.81592,133.48169Z"></path><path d="M232,120H179.314l14.62745-14.62695A8.00053,8.00053,0,0,0,182.627,94.05859l-28.28418,28.28418c-.05664.0564-.10449.11786-.15869.17554-.12549.13287-.251.26532-.36719.40649-.0913.11072-.17138.22718-.25537.34156-.07031.09564-.14453.188-.21093.28686-.085.12659-.15918.25782-.23584.38806-.05567.09443-.11524.18622-.167.28309-.06933.12915-.12841.26184-.18994.39379-.04931.10547-.10205.20874-.147.31665-.05225.12653-.09522.25568-.14063.38428-.042.11817-.0874.2345-.124.35517-.03906.1289-.06787.25982-.10058.39019-.03077.123-.06543.24414-.09034.36933-.02978.15149-.04834.30444-.06933.45715-.01465.1059-.03516.2099-.0459.31714a8.02155,8.02155,0,0,0,0,1.58386c.01074.10724.03125.21124.0459.31714.021.15271.03955.30566.06933.45715.02491.12519.05957.24634.09034.36933.03271.13037.06152.26129.10058.39019.03662.12067.082.237.124.35517.04541.1286.08838.25775.14063.38428.04492.10791.09766.21118.147.31665.06153.13195.12061.26464.18994.39379.05176.09687.11133.18866.167.28309.07666.13024.15087.26147.23584.38806.0664.09881.14062.19122.21093.28686.084.11438.16407.23084.25537.34156.11622.14117.2417.27362.36719.40649.0542.05768.10205.11914.15869.17554L182.627,161.94141A8.00053,8.00053,0,0,0,193.94141,150.627L179.314,136H232a8,8,0,0,0,0-16Z"></path></g></svg>`, 12, true),
_tmpl$18 = template(`<svg><polyline points="156.284 188.284 128 160 99.716 188.284" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$19 = template(`<svg><line x1="128" y1="232" x2="128" y2="160" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true),
_tmpl$20 = template(`<svg><polyline points="99.716 67.716 128 96 156.284 67.716" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$21 = template(`<svg><line x1="128" y1="24" x2="128" y2="96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true),
_tmpl$22 = template(`<svg><polyline points="67.716 156.284 96 128 67.716 99.716" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$23 = template(`<svg><line x1="24" y1="128" x2="96" y2="128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true),
_tmpl$24 = template(`<svg><polyline points="188.284 99.716 160 128 188.284 156.284" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$25 = template(`<svg><line x1="232" y1="128" x2="160" y2="128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true),
_tmpl$26 = template(`<svg><polyline points="156.284 188.284 128 160 99.716 188.284" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$27 = template(`<svg><line x1="128" y1="232" x2="128" y2="160" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true),
_tmpl$28 = template(`<svg><polyline points="99.716 67.716 128 96 156.284 67.716" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$29 = template(`<svg><line x1="128" y1="24" x2="128" y2="96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true),
_tmpl$30 = template(`<svg><polyline points="67.716 156.284 96 128 67.716 99.716" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$31 = template(`<svg><line x1="24" y1="128" x2="96" y2="128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true),
_tmpl$32 = template(`<svg><polyline points="188.284 99.716 160 128 188.284 156.284" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$33 = template(`<svg><line x1="232" y1="128" x2="160" y2="128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true),
_tmpl$34 = 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;
}(), 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;
}(), function () {
var _el$7 = _tmpl$7.cloneNode(true);
setAttribute(_el$7, "stroke", color);
return _el$7;
}(), function () {
var _el$8 = _tmpl$8.cloneNode(true);
setAttribute(_el$8, "stroke", color);
return _el$8;
}()];
case "duotone":
return [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;
}(), 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;
}(), function () {
var _el$14 = _tmpl$14.cloneNode(true);
setAttribute(_el$14, "stroke", color);
return _el$14;
}(), function () {
var _el$15 = _tmpl$15.cloneNode(true);
setAttribute(_el$15, "stroke", color);
return _el$15;
}(), function () {
var _el$16 = _tmpl$16.cloneNode(true);
setAttribute(_el$16, "stroke", color);
return _el$16;
}()];
case "fill":
return _tmpl$17.cloneNode(true);
case "light":
return [function () {
var _el$18 = _tmpl$18.cloneNode(true);
setAttribute(_el$18, "stroke", color);
return _el$18;
}(), function () {
var _el$19 = _tmpl$19.cloneNode(true);
setAttribute(_el$19, "stroke", color);
return _el$19;
}(), function () {
var _el$20 = _tmpl$20.cloneNode(true);
setAttribute(_el$20, "stroke", color);
return _el$20;
}(), function () {
var _el$21 = _tmpl$21.cloneNode(true);
setAttribute(_el$21, "stroke", color);
return _el$21;
}(), function () {
var _el$22 = _tmpl$22.cloneNode(true);
setAttribute(_el$22, "stroke", color);
return _el$22;
}(), function () {
var _el$23 = _tmpl$23.cloneNode(true);
setAttribute(_el$23, "stroke", color);
return _el$23;
}(), function () {
var _el$24 = _tmpl$24.cloneNode(true);
setAttribute(_el$24, "stroke", color);
return _el$24;
}(), function () {
var _el$25 = _tmpl$25.cloneNode(true);
setAttribute(_el$25, "stroke", color);
return _el$25;
}()];
case "thin":
return [function () {
var _el$26 = _tmpl$26.cloneNode(true);
setAttribute(_el$26, "stroke", color);
return _el$26;
}(), function () {
var _el$27 = _tmpl$27.cloneNode(true);
setAttribute(_el$27, "stroke", color);
return _el$27;
}(), function () {
var _el$28 = _tmpl$28.cloneNode(true);
setAttribute(_el$28, "stroke", color);
return _el$28;
}(), function () {
var _el$29 = _tmpl$29.cloneNode(true);
setAttribute(_el$29, "stroke", color);
return _el$29;
}(), function () {
var _el$30 = _tmpl$30.cloneNode(true);
setAttribute(_el$30, "stroke", color);
return _el$30;
}(), function () {
var _el$31 = _tmpl$31.cloneNode(true);
setAttribute(_el$31, "stroke", color);
return _el$31;
}(), function () {
var _el$32 = _tmpl$32.cloneNode(true);
setAttribute(_el$32, "stroke", color);
return _el$32;
}(), function () {
var _el$33 = _tmpl$33.cloneNode(true);
setAttribute(_el$33, "stroke", color);
return _el$33;
}()];
case "regular":
return [function () {
var _el$34 = _tmpl$9.cloneNode(true);
setAttribute(_el$34, "stroke", color);
return _el$34;
}(), function () {
var _el$35 = _tmpl$10.cloneNode(true);
setAttribute(_el$35, "stroke", color);
return _el$35;
}(), function () {
var _el$36 = _tmpl$11.cloneNode(true);
setAttribute(_el$36, "stroke", color);
return _el$36;
}(), function () {
var _el$37 = _tmpl$12.cloneNode(true);
setAttribute(_el$37, "stroke", color);
return _el$37;
}(), function () {
var _el$38 = _tmpl$13.cloneNode(true);
setAttribute(_el$38, "stroke", color);
return _el$38;
}(), function () {
var _el$39 = _tmpl$14.cloneNode(true);
setAttribute(_el$39, "stroke", color);
return _el$39;
}(), function () {
var _el$40 = _tmpl$15.cloneNode(true);
setAttribute(_el$40, "stroke", color);
return _el$40;
}(), function () {
var _el$41 = _tmpl$16.cloneNode(true);
setAttribute(_el$41, "stroke", color);
return _el$41;
}()];
default:
console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".');
return null;
}
};
var ArrowsInCardinal = function ArrowsInCardinal(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$42 = _tmpl$34.cloneNode(true),
_el$43 = _el$42.firstChild;
var _ref$ = ref;
typeof _ref$ === "function" ? _ref$(_el$42) : ref = _el$42;
setAttribute(_el$42, "width", size != null ? size : contextSize);
setAttribute(_el$42, "height", size != null ? size : contextSize);
setAttribute(_el$42, "fill", color != null ? color : contextColor);
setAttribute(_el$42, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined);
spread(_el$42, restContext, true, true);
spread(_el$42, restProps, true, true);
insert(_el$42, children, _el$43);
insert(_el$42, function () {
return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor);
}, null);
return _el$42;
}();
};
export default ArrowsInCardinal;
//# sourceMappingURL=ArrowsInCardinal.esm.js.map