phosphor-solid
Version:
A clean and friendly icon family for Solid-js
185 lines (132 loc) • 8.36 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><circle cx="128" cy="128" r="96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></circle></svg>`, 4, true),
_tmpl$2 = template(`<svg><path d="M179.1333,116.32931a112.19069,112.19069,0,0,0-102.3584.04859" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$3 = template(`<svg><path d="M158.73682,155.34884a67.9512,67.9512,0,0,0-61.56592.04737" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$4 = template(`<svg><circle cx="128" cy="128" r="96" opacity="0.2"></circle></svg>`, 4, true),
_tmpl$5 = template(`<svg><circle cx="128" cy="128" r="96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></circle></svg>`, 4, true),
_tmpl$6 = template(`<svg><g><path d="M179.1333,108.32931a112.19069,112.19069,0,0,0-102.3584.04859" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path><path d="M164.29541,136.71457a79.94058,79.94058,0,0,0-72.68359.04736" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path><path d="M149.47217,165.07248a47.97816,47.97816,0,0,0-43.03662.04736" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></g></svg>`, 10, true),
_tmpl$7 = template(`<svg><path d="M128,24A104,104,0,1,0,232,128,104.1179,104.1179,0,0,0,128,24Zm28.624,144.65722a8.00058,8.00058,0,0,1-10.73633,3.56641,39.98258,39.98258,0,0,0-35.85156.04,7.99966,7.99966,0,1,1-7.20117-14.28711,55.97479,55.97479,0,0,1,50.22217-.05566A7.99977,7.99977,0,0,1,156.624,168.65719Zm14.79737-28.30664a8.00153,8.00153,0,0,1-10.76221,3.49024,71.9412,71.9412,0,0,0-65.40234.042,7.99976,7.99976,0,1,1-7.29-14.24219,87.94,87.94,0,0,1,79.96484-.05176A7.9994,7.9994,0,0,1,171.42139,140.35055Zm14.82666-28.36426a8.00037,8.00037,0,0,1-10.77246,3.458,104.1903,104.1903,0,0,0-95.03614.04492,8,8,0,1,1-7.3291-14.22265,120.19311,120.19311,0,0,1,109.68066-.05274A7.99973,7.99973,0,0,1,186.24805,111.98629Z"></path></svg>`, 4, true),
_tmpl$8 = template(`<svg><circle cx="128" cy="128" r="96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></circle></svg>`, 4, true),
_tmpl$9 = template(`<svg><g><path d="M179.1333,108.32931a112.19069,112.19069,0,0,0-102.3584.04859" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path><path d="M164.29541,136.71457a79.94058,79.94058,0,0,0-72.68359.04736" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path><path d="M149.47217,165.07248a47.97816,47.97816,0,0,0-43.03662.04736" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></g></svg>`, 10, true),
_tmpl$10 = template(`<svg><circle cx="128" cy="128" r="96" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></circle></svg>`, 4, true),
_tmpl$11 = template(`<svg><g><path d="M179.1333,108.32931a112.19069,112.19069,0,0,0-102.3584.04859" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path><path d="M164.29541,136.71457a79.94058,79.94058,0,0,0-72.68359.04736" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path><path d="M149.47217,165.07248a47.97816,47.97816,0,0,0-43.03662.04736" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></g></svg>`, 10, true),
_tmpl$12 = 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 [_tmpl$4.cloneNode(true), function () {
var _el$5 = _tmpl$5.cloneNode(true);
setAttribute(_el$5, "stroke", color);
return _el$5;
}(), function () {
var _el$6 = _tmpl$6.cloneNode(true),
_el$7 = _el$6.firstChild,
_el$8 = _el$7.nextSibling,
_el$9 = _el$8.nextSibling;
setAttribute(_el$7, "stroke", color);
setAttribute(_el$8, "stroke", color);
setAttribute(_el$9, "stroke", color);
return _el$6;
}()];
case "fill":
return _tmpl$7.cloneNode(true);
case "light":
return [function () {
var _el$11 = _tmpl$8.cloneNode(true);
setAttribute(_el$11, "stroke", color);
return _el$11;
}(), function () {
var _el$12 = _tmpl$9.cloneNode(true),
_el$13 = _el$12.firstChild,
_el$14 = _el$13.nextSibling,
_el$15 = _el$14.nextSibling;
setAttribute(_el$13, "stroke", color);
setAttribute(_el$14, "stroke", color);
setAttribute(_el$15, "stroke", color);
return _el$12;
}()];
case "thin":
return [function () {
var _el$16 = _tmpl$10.cloneNode(true);
setAttribute(_el$16, "stroke", color);
return _el$16;
}(), function () {
var _el$17 = _tmpl$11.cloneNode(true),
_el$18 = _el$17.firstChild,
_el$19 = _el$18.nextSibling,
_el$20 = _el$19.nextSibling;
setAttribute(_el$18, "stroke", color);
setAttribute(_el$19, "stroke", color);
setAttribute(_el$20, "stroke", color);
return _el$17;
}()];
case "regular":
return [function () {
var _el$21 = _tmpl$5.cloneNode(true);
setAttribute(_el$21, "stroke", color);
return _el$21;
}(), function () {
var _el$22 = _tmpl$6.cloneNode(true),
_el$23 = _el$22.firstChild,
_el$24 = _el$23.nextSibling,
_el$25 = _el$24.nextSibling;
setAttribute(_el$23, "stroke", color);
setAttribute(_el$24, "stroke", color);
setAttribute(_el$25, "stroke", color);
return _el$22;
}()];
default:
console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".');
return null;
}
};
var SpotifyLogo = function SpotifyLogo(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$26 = _tmpl$12.cloneNode(true),
_el$27 = _el$26.firstChild;
var _ref$ = ref;
typeof _ref$ === "function" ? _ref$(_el$26) : ref = _el$26;
setAttribute(_el$26, "width", size != null ? size : contextSize);
setAttribute(_el$26, "height", size != null ? size : contextSize);
setAttribute(_el$26, "fill", color != null ? color : contextColor);
setAttribute(_el$26, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined);
spread(_el$26, restContext, true, true);
spread(_el$26, restProps, true, true);
insert(_el$26, children, _el$27);
insert(_el$26, function () {
return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor);
}, null);
return _el$26;
}();
};
export default SpotifyLogo;
//# sourceMappingURL=SpotifyLogo.esm.js.map