phosphor-solid
Version:
A clean and friendly icon family for Solid-js
226 lines (163 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><circle cx="188" cy="32.00002" r="12" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></circle></svg>`, 4, true),
_tmpl$2 = template(`<svg><path d="M161.026,172.00058a72.17425,72.17425,0,0,1-66.05159.0002" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$3 = template(`<svg><path d="M59.408,89.87843C77.71654,78.7483,101.71994,72,128,72s50.28346,6.7483,68.592,17.87843l-.00129.00213a24.002,24.002,0,1,1,31.61564,34.788l.002-.00083A51.61606,51.61606,0,0,1,232,144c0,39.7645-46.56239,72-104,72S24,183.7645,24,144a51.61624,51.61624,0,0,1,3.79162-19.3323l.00206.00082a24.00228,24.00228,0,1,1,31.61564-34.788Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$4 = template(`<svg><polyline points="128 72 136 24 176.138 30.175" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$5 = template(`<svg><circle cx="88" cy="128" r="20"></circle></svg>`, 4, true),
_tmpl$6 = template(`<svg><circle cx="168" cy="128" r="20"></circle></svg>`, 4, true),
_tmpl$7 = template(`<svg><path d="M240,104a24.00125,24.00125,0,0,0-43.40918-14.11938l.001-.0022C178.28369,78.74831,154.28027,72,128,72S77.7168,78.74831,59.4082,89.87844l.001.0022A24.00186,24.00186,0,1,0,27.794,124.66848l-.00245-.00073A51.62014,51.62014,0,0,0,24,144c0,39.76441,46.5625,72,104,72s104-32.23559,104-72a51.62014,51.62014,0,0,0-3.7915-19.33227l-.002.00073A23.98866,23.98866,0,0,0,240,104Z" opacity="0.2"></path></svg>`, 4, true),
_tmpl$8 = template(`<svg><circle cx="188" cy="32.00002" r="16" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></circle></svg>`, 4, true),
_tmpl$9 = template(`<svg><path d="M161.026,176.00058a72.17425,72.17425,0,0,1-66.05159.0002" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$10 = template(`<svg><polyline points="128 72 136 24 172.185 29.567" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$11 = template(`<svg><path d="M59.408,89.87843C77.71654,78.7483,101.71994,72,128,72s50.28346,6.7483,68.592,17.87843l-.00129.00213a24.002,24.002,0,1,1,31.61564,34.788l.002-.00083A51.61606,51.61606,0,0,1,232,144c0,39.7645-46.56239,72-104,72S24,183.7645,24,144a51.61624,51.61624,0,0,1,3.79162-19.3323l.00206.00082a24.00228,24.00228,0,1,1,31.61564-34.788Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$12 = template(`<svg><circle cx="88" cy="132" r="16"></circle></svg>`, 4, true),
_tmpl$13 = template(`<svg><circle cx="168" cy="132" r="16"></circle></svg>`, 4, true),
_tmpl$14 = template(`<svg><path d="M248,104a31.99228,31.99228,0,0,0-52.9375-24.19043c-16.75439-8.90112-36.76172-14.279-57.666-15.52539l5.19581-31.17578,21.83105,3.3584a24.00409,24.00409,0,1,0,2.43506-15.814l-29.64209-4.56006a7.996,7.996,0,0,0-9.10742,6.5918l-6.91309,41.478c-21.83887.94165-42.813,6.37891-60.2583,15.647a31.99266,31.99266,0,0,0-42.59229,47.74024A59.04669,59.04669,0,0,0,16,144c0,21.93457,12.042,42.35156,33.90723,57.48926C70.875,216.00588,98.60938,224,128,224s57.125-7.99414,78.09277-22.51074C227.958,186.35158,240,165.93459,240,144a59.01726,59.01726,0,0,0-2.3457-16.44922A32.17163,32.17163,0,0,0,248,104ZM72,132a16,16,0,1,1,16,16A16.01833,16.01833,0,0,1,72,132Zm92.69629,51.10938a80.122,80.122,0,0,1-73.39209,0,8,8,0,0,1,7.34033-14.2168,64.09433,64.09433,0,0,0,58.71094,0,8.00008,8.00008,0,0,1,7.34082,14.2168ZM168,148a16,16,0,1,1,16-16A16.01833,16.01833,0,0,1,168,148Z"></path></svg>`, 4, true),
_tmpl$15 = template(`<svg><circle cx="188" cy="32.00002" r="16" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></circle></svg>`, 4, true),
_tmpl$16 = template(`<svg><path d="M161.026,176.00058a72.17425,72.17425,0,0,1-66.05159.0002" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true),
_tmpl$17 = template(`<svg><polyline points="128 72 136 24 172.185 29.567" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$18 = template(`<svg><path d="M59.408,89.87843C77.71654,78.7483,101.71994,72,128,72s50.28346,6.7483,68.592,17.87843l-.00129.00213a24.002,24.002,0,1,1,31.61564,34.788l.002-.00083A51.61606,51.61606,0,0,1,232,144c0,39.7645-46.56239,72-104,72S24,183.7645,24,144a51.61624,51.61624,0,0,1,3.79162-19.3323l.00206.00082a24.00228,24.00228,0,1,1,31.61564-34.788Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true),
_tmpl$19 = template(`<svg><circle cx="88" cy="132.00002" r="14"></circle></svg>`, 4, true),
_tmpl$20 = template(`<svg><circle cx="168" cy="132.00002" r="14"></circle></svg>`, 4, true),
_tmpl$21 = template(`<svg><circle cx="188" cy="32.00002" r="16" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></circle></svg>`, 4, true),
_tmpl$22 = template(`<svg><path d="M161.026,176.00058a72.17425,72.17425,0,0,1-66.05159.0002" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true),
_tmpl$23 = template(`<svg><polyline points="128 72 136 24 172.185 29.567" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$24 = template(`<svg><path d="M59.408,89.87843C77.71654,78.7483,101.71994,72,128,72s50.28346,6.7483,68.592,17.87843l-.00129.00213a24.002,24.002,0,1,1,31.61564,34.788l.002-.00083A51.61606,51.61606,0,0,1,232,144c0,39.7645-46.56239,72-104,72S24,183.7645,24,144a51.61624,51.61624,0,0,1,3.79162-19.3323l.00206.00082a24.00228,24.00228,0,1,1,31.61564-34.788Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true),
_tmpl$25 = template(`<svg><circle cx="88" cy="132.00002" r="12"></circle></svg>`, 4, true),
_tmpl$26 = template(`<svg><circle cx="168" cy="132.00002" r="12"></circle></svg>`, 4, true),
_tmpl$27 = 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;
}(), _tmpl$5.cloneNode(true), _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;
}(), function () {
var _el$11 = _tmpl$11.cloneNode(true);
setAttribute(_el$11, "stroke", color);
return _el$11;
}(), _tmpl$12.cloneNode(true), _tmpl$13.cloneNode(true)];
case "fill":
return _tmpl$14.cloneNode(true);
case "light":
return [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;
}(), function () {
var _el$17 = _tmpl$17.cloneNode(true);
setAttribute(_el$17, "stroke", color);
return _el$17;
}(), function () {
var _el$18 = _tmpl$18.cloneNode(true);
setAttribute(_el$18, "stroke", color);
return _el$18;
}(), _tmpl$19.cloneNode(true), _tmpl$20.cloneNode(true)];
case "thin":
return [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;
}(), _tmpl$25.cloneNode(true), _tmpl$26.cloneNode(true)];
case "regular":
return [function () {
var _el$27 = _tmpl$8.cloneNode(true);
setAttribute(_el$27, "stroke", color);
return _el$27;
}(), function () {
var _el$28 = _tmpl$9.cloneNode(true);
setAttribute(_el$28, "stroke", color);
return _el$28;
}(), function () {
var _el$29 = _tmpl$10.cloneNode(true);
setAttribute(_el$29, "stroke", color);
return _el$29;
}(), function () {
var _el$30 = _tmpl$11.cloneNode(true);
setAttribute(_el$30, "stroke", color);
return _el$30;
}(), _tmpl$12.cloneNode(true), _tmpl$13.cloneNode(true)];
default:
console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".');
return null;
}
};
var RedditLogo = function RedditLogo(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$33 = _tmpl$27.cloneNode(true),
_el$34 = _el$33.firstChild;
var _ref$ = ref;
typeof _ref$ === "function" ? _ref$(_el$33) : ref = _el$33;
setAttribute(_el$33, "width", size != null ? size : contextSize);
setAttribute(_el$33, "height", size != null ? size : contextSize);
setAttribute(_el$33, "fill", color != null ? color : contextColor);
setAttribute(_el$33, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined);
spread(_el$33, restContext, true, true);
spread(_el$33, restProps, true, true);
insert(_el$33, children, _el$34);
insert(_el$33, function () {
return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor);
}, null);
return _el$33;
}();
};
export default RedditLogo;
//# sourceMappingURL=RedditLogo.esm.js.map