phosphor-solid
Version:
A clean and friendly icon family for Solid-js
150 lines (107 loc) • 8.48 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><polygon points="164 128 108 92 108 164 164 128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polygon></svg>`, 4, true),
_tmpl$2 = template(`<svg><path d="M24,128c0,29.75546,3.07414,47.21382,5.41108,56.18664a15.91682,15.91682,0,0,0,9.63282,10.89441C72.52083,207.94575,128,207.5925,128,207.5925s55.47857.35324,88.9558-12.51137a15.91684,15.91684,0,0,0,9.6329-10.89432C228.92572,175.214,232,157.75554,232,128s-3.07415-47.21382-5.41108-56.18664A15.91682,15.91682,0,0,0,216.9561,60.919C183.47917,48.05425,128,48.4075,128,48.4075s-55.47857-.35324-88.9558,12.51137a15.91684,15.91684,0,0,0-9.6329,10.89432C27.07427,80.786,24,98.24446,24,128Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$3 = template(`<svg><path d="M226.58887,71.81348A15.91692,15.91692,0,0,0,216.95605,60.919C183.479,48.0542,128,48.40747,128,48.40747S72.52148,48.0542,39.044,60.919a15.91766,15.91766,0,0,0-9.63282,10.89428C27.07422,80.78613,24,98.24438,24,128c0,29.75537,3.07422,47.21387,5.41113,56.18652A15.91692,15.91692,0,0,0,39.044,195.08105C72.521,207.9458,128,207.59253,128,207.59253s55.47852.35327,88.95605-12.51148a15.91655,15.91655,0,0,0,9.63282-10.89428C228.92578,175.21387,232,157.75562,232,128,232,98.24463,228.92578,80.78613,226.58887,71.81348ZM112,160V96l48,32Z" opacity="0.2"></path></svg>`, 4, true),
_tmpl$4 = template(`<svg><polygon points="160 128 112 96 112 160 160 128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polygon></svg>`, 4, true),
_tmpl$5 = template(`<svg><path d="M24,128c0,29.75546,3.07414,47.21382,5.41108,56.18664a15.91682,15.91682,0,0,0,9.63282,10.89441C72.52083,207.94575,128,207.5925,128,207.5925s55.47857.35324,88.9558-12.51137a15.91684,15.91684,0,0,0,9.6329-10.89432C228.92572,175.214,232,157.75554,232,128s-3.07415-47.21382-5.41108-56.18664A15.91682,15.91682,0,0,0,216.9561,60.919C183.47917,48.05425,128,48.4075,128,48.4075s-55.47857-.35324-88.9558,12.51137a15.91684,15.91684,0,0,0-9.6329,10.89432C27.07427,80.786,24,98.24446,24,128Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$6 = template(`<svg><path d="M234.33057,69.79736a23.96369,23.96369,0,0,0-14.50489-16.34619C185.55615,40.28223,130.97949,40.39209,128,40.40771c-2.978-.02392-57.55518-.126-91.8252,13.04346A23.96415,23.96415,0,0,0,21.66992,69.79639C19.083,79.72705,16,97.88574,16,128c0,30.11377,3.083,48.27246,5.66943,58.20264a23.96369,23.96369,0,0,0,14.50489,16.34619c32.80615,12.60693,84.22168,13.04541,91.167,13.04541.6206.00049.69678.00049,1.31738,0,6.95069-.00049,58.36231-.43945,91.16651-13.04541a23.96415,23.96415,0,0,0,14.50488-16.34522C236.917,176.273,240,158.11426,240,128,240,97.88623,236.917,79.72754,234.33057,69.79736Zm-72.11182,61.53076-48,32A3.99967,3.99967,0,0,1,108,160V96a3.99968,3.99968,0,0,1,6.21875-3.32813l48,32a3.99979,3.99979,0,0,1,0,6.65625Z"></path></svg>`, 4, true),
_tmpl$7 = template(`<svg><polygon points="160 128 112 96 112 160 160 128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polygon></svg>`, 4, true),
_tmpl$8 = template(`<svg><path d="M24,128c0,29.75546,3.07414,47.21382,5.41108,56.18664a15.91682,15.91682,0,0,0,9.63282,10.89441C72.52083,207.94575,128,207.5925,128,207.5925s55.47857.35324,88.9558-12.51137a15.91684,15.91684,0,0,0,9.6329-10.89432C228.92572,175.214,232,157.75554,232,128s-3.07415-47.21382-5.41108-56.18664A15.91682,15.91682,0,0,0,216.9561,60.919C183.47917,48.05425,128,48.4075,128,48.4075s-55.47857-.35324-88.9558,12.51137a15.91684,15.91684,0,0,0-9.6329,10.89432C27.07427,80.786,24,98.24446,24,128Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true),
_tmpl$9 = template(`<svg><polygon points="160 128 112 96 112 160 160 128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polygon></svg>`, 4, true),
_tmpl$10 = template(`<svg><path d="M24,128c0,29.75546,3.07414,47.21382,5.41108,56.18664a15.91682,15.91682,0,0,0,9.63282,10.89441C72.52083,207.94575,128,207.5925,128,207.5925s55.47857.35324,88.9558-12.51137a15.91684,15.91684,0,0,0,9.6329-10.89432C228.92572,175.214,232,157.75554,232,128s-3.07415-47.21382-5.41108-56.18664A15.91682,15.91682,0,0,0,216.9561,60.919C183.47917,48.05425,128,48.4075,128,48.4075s-55.47857-.35324-88.9558,12.51137a15.91684,15.91684,0,0,0-9.6329,10.89432C27.07427,80.786,24,98.24446,24,128Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true),
_tmpl$11 = 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;
}()];
case "duotone":
return [_tmpl$3.cloneNode(true), 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;
}()];
case "fill":
return _tmpl$6.cloneNode(true);
case "light":
return [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 "thin":
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;
}()];
case "regular":
return [function () {
var _el$11 = _tmpl$4.cloneNode(true);
setAttribute(_el$11, "stroke", color);
return _el$11;
}(), function () {
var _el$12 = _tmpl$5.cloneNode(true);
setAttribute(_el$12, "stroke", color);
return _el$12;
}()];
default:
console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".');
return null;
}
};
var YoutubeLogo = function YoutubeLogo(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$13 = _tmpl$11.cloneNode(true),
_el$14 = _el$13.firstChild;
var _ref$ = ref;
typeof _ref$ === "function" ? _ref$(_el$13) : ref = _el$13;
setAttribute(_el$13, "width", size != null ? size : contextSize);
setAttribute(_el$13, "height", size != null ? size : contextSize);
setAttribute(_el$13, "fill", color != null ? color : contextColor);
setAttribute(_el$13, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined);
spread(_el$13, restContext, true, true);
spread(_el$13, restProps, true, true);
insert(_el$13, children, _el$14);
insert(_el$13, function () {
return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor);
}, null);
return _el$13;
}();
};
export default YoutubeLogo;
//# sourceMappingURL=YoutubeLogo.esm.js.map