phosphor-solid
Version:
A clean and friendly icon family for Solid-js
245 lines (176 loc) • 11.8 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><path d="M92.91969,166.06177a50.7769,50.7769,0,0,1,70.145,0" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$2 = template(`<svg><line x1="224" y1="56" x2="176" y2="104" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true),
_tmpl$3 = template(`<svg><line x1="224" y1="104" x2="176" y2="56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true),
_tmpl$4 = template(`<svg><path d="M25.06379,98.17952A145.90174,145.90174,0,0,1,127.99219,56.0029q4.03231,0,8.0117.21441" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$5 = template(`<svg><path d="M58.97857,132.12064a98.11506,98.11506,0,0,1,69.01362-28.11774q4.04751,0,8.0141.319" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$6 = template(`<svg><circle cx="128" cy="200" r="16"></circle></svg>`, 4, true),
_tmpl$7 = template(`<svg><path d="M20.20855,75.93124c63.48474-47.90809,152.098-47.90812,215.58263.00015a8.015,8.015,0,0,1,1.201,11.61025c-19.04723,22.44929-82.94714,97.76169-102.95188,121.33925a7.93583,7.93583,0,0,1-12.14044-.0705L19.03968,87.57941A8.055,8.055,0,0,1,20.20855,75.93124Z" opacity="0.2"></path></svg>`, 4, true),
_tmpl$8 = template(`<svg><line x1="224" y1="56" x2="176" y2="104" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true),
_tmpl$9 = template(`<svg><line x1="224" y1="104" x2="176" y2="56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true),
_tmpl$10 = template(`<svg><path d="M202.73959,127.91193c-25.42164,29.962-55.96036,65.9549-68.69927,80.969a7.93583,7.93583,0,0,1-12.14044-.0705L19.03968,87.57941a8.055,8.055,0,0,1,1.16887-11.64817A179.20728,179.20728,0,0,1,147.6789,41.073" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$11 = template(`<svg><g><path d="M211.30223,79.99421,229.645,61.65143A8.00018,8.00018,0,1,0,218.33153,50.337L199.98827,68.68024,181.645,50.337a8.00018,8.00018,0,1,0-11.31348,11.31445L188.6743,79.99421,170.33153,98.337A8.00018,8.00018,0,0,0,181.645,109.65143l18.34326-18.34326,18.34326,18.34326A8.00018,8.00018,0,0,0,229.645,98.337Z"></path><path d="M199.98827,113.93561l-7.03113,7.03125a24.00024,24.00024,0,0,1-33.93933-33.9436l7.02905-7.029-7.0299-7.03a24.03027,24.03027,0,0,1,4.60974-37.55127A187.51454,187.51454,0,0,0,15.39061,69.54548a15.73529,15.73529,0,0,0-6.21142,10.936,16.27674,16.27674,0,0,0,3.76074,12.27393L115.85985,214.05768a15.95117,15.95117,0,0,0,12.17383,5.65528A15.77638,15.77638,0,0,0,140.081,214.127l74.647-87.97925a23.97614,23.97614,0,0,1-7.71021-5.18262Z"></path></g></svg>`, 8, true),
_tmpl$12 = template(`<svg><path d="M92.91969,166.06177a50.7769,50.7769,0,0,1,70.145,0" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true),
_tmpl$13 = template(`<svg><line x1="224" y1="56" x2="176" y2="104" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true),
_tmpl$14 = template(`<svg><line x1="224" y1="104" x2="176" y2="56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true),
_tmpl$15 = template(`<svg><path d="M25.06379,98.17952A145.90174,145.90174,0,0,1,127.99219,56.0029a148.757,148.757,0,0,1,16.01524.86162" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true),
_tmpl$16 = template(`<svg><path d="M58.97857,132.12064a98.11506,98.11506,0,0,1,69.01362-28.11774,99.87589,99.87589,0,0,1,16.02985,1.28855" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true),
_tmpl$17 = template(`<svg><circle cx="128" cy="200" r="10"></circle></svg>`, 4, true),
_tmpl$18 = template(`<svg><path d="M92.91969,166.06177a50.7769,50.7769,0,0,1,70.145,0" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true),
_tmpl$19 = template(`<svg><line x1="224" y1="56" x2="176" y2="104" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true),
_tmpl$20 = template(`<svg><line x1="224" y1="104" x2="176" y2="56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true),
_tmpl$21 = template(`<svg><path d="M25.06379,98.17952A145.90174,145.90174,0,0,1,127.99219,56.0029a148.757,148.757,0,0,1,16.01524.86162" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true),
_tmpl$22 = template(`<svg><path d="M58.97857,132.12064a98.11506,98.11506,0,0,1,69.01362-28.11774,99.87589,99.87589,0,0,1,16.02985,1.28855" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true),
_tmpl$23 = template(`<svg><circle cx="128" cy="200" r="8"></circle></svg>`, 4, true),
_tmpl$24 = template(`<svg><path d="M92.91969,166.06177a50.7769,50.7769,0,0,1,70.145,0" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$25 = template(`<svg><path d="M25.06379,98.17952A145.90174,145.90174,0,0,1,127.99219,56.0029a148.757,148.757,0,0,1,16.01524.86162" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$26 = template(`<svg><path d="M58.97857,132.12064a98.11506,98.11506,0,0,1,69.01362-28.11774,99.87589,99.87589,0,0,1,16.02985,1.28855" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$27 = template(`<svg><circle cx="128" cy="200" r="12"></circle></svg>`, 4, true),
_tmpl$28 = 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;
}(), _tmpl$6.cloneNode(true)];
case "duotone":
return [_tmpl$7.cloneNode(true), 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 "fill":
return _tmpl$11.cloneNode(true);
case "light":
return [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;
}(), _tmpl$17.cloneNode(true)];
case "thin":
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;
}(), _tmpl$23.cloneNode(true)];
case "regular":
return [function () {
var _el$24 = _tmpl$24.cloneNode(true);
setAttribute(_el$24, "stroke", color);
return _el$24;
}(), function () {
var _el$25 = _tmpl$8.cloneNode(true);
setAttribute(_el$25, "stroke", color);
return _el$25;
}(), function () {
var _el$26 = _tmpl$9.cloneNode(true);
setAttribute(_el$26, "stroke", color);
return _el$26;
}(), function () {
var _el$27 = _tmpl$25.cloneNode(true);
setAttribute(_el$27, "stroke", color);
return _el$27;
}(), function () {
var _el$28 = _tmpl$26.cloneNode(true);
setAttribute(_el$28, "stroke", color);
return _el$28;
}(), _tmpl$27.cloneNode(true)];
default:
console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".');
return null;
}
};
var WifiX = function WifiX(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$30 = _tmpl$28.cloneNode(true),
_el$31 = _el$30.firstChild;
var _ref$ = ref;
typeof _ref$ === "function" ? _ref$(_el$30) : ref = _el$30;
setAttribute(_el$30, "width", size != null ? size : contextSize);
setAttribute(_el$30, "height", size != null ? size : contextSize);
setAttribute(_el$30, "fill", color != null ? color : contextColor);
setAttribute(_el$30, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined);
spread(_el$30, restContext, true, true);
spread(_el$30, restProps, true, true);
insert(_el$30, children, _el$31);
insert(_el$30, function () {
return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor);
}, null);
return _el$30;
}();
};
export default WifiX;
//# sourceMappingURL=WifiX.esm.js.map