phosphor-solid
Version:
A clean and friendly icon family for Solid-js
132 lines (99 loc) • 8.31 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="M223.9944,127.41159a95.69791,95.69791,0,0,1-28.17312,68.53158c-36.94566,36.88079-97.30608,37.29538-134.72958.89956a95.99643,95.99643,0,0,1,67.48515-164.8372,8.01374,8.01374,0,0,1,7.80464,9.7612,31.99345,31.99345,0,0,0,30.85987,39.031,8.02776,8.02776,0,0,1,7.96088,7.96088,31.99346,31.99346,0,0,0,39.03035,30.86A8.01158,8.01158,0,0,1,223.9944,127.41159Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$2 = template(`<svg><circle cx="156" cy="172" r="16"></circle></svg>`, 4, true),
_tmpl$3 = template(`<svg><circle cx="92" cy="164" r="16"></circle></svg>`, 4, true),
_tmpl$4 = template(`<svg><circle cx="84" cy="108" r="16"></circle></svg>`, 4, true),
_tmpl$5 = template(`<svg><circle cx="136" cy="124" r="16"></circle></svg>`, 4, true),
_tmpl$6 = template(`<svg><path d="M223.9944,127.41159a95.69791,95.69791,0,0,1-28.17312,68.53158c-36.94566,36.88079-97.30608,37.29538-134.72958.89956a95.99643,95.99643,0,0,1,67.48515-164.8372,8.01374,8.01374,0,0,1,7.80464,9.7612,31.99345,31.99345,0,0,0,30.85987,39.031,8.02776,8.02776,0,0,1,7.96088,7.96088,31.99346,31.99346,0,0,0,39.03035,30.86A8.01158,8.01158,0,0,1,223.9944,127.41159Z" opacity="0.2"></path></svg>`, 4, true),
_tmpl$7 = template(`<svg><path d="M223.9944,127.41159a95.69791,95.69791,0,0,1-28.17312,68.53158c-36.94566,36.88079-97.30608,37.29538-134.72958.89956a95.99643,95.99643,0,0,1,67.48515-164.8372,8.01374,8.01374,0,0,1,7.80464,9.7612,31.99345,31.99345,0,0,0,30.85987,39.031,8.02776,8.02776,0,0,1,7.96088,7.96088,31.99346,31.99346,0,0,0,39.03035,30.86A8.01158,8.01158,0,0,1,223.9944,127.41159Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$8 = template(`<svg><circle cx="156" cy="172" r="12"></circle></svg>`, 4, true),
_tmpl$9 = template(`<svg><circle cx="92" cy="164" r="12"></circle></svg>`, 4, true),
_tmpl$10 = template(`<svg><circle cx="84" cy="108" r="12"></circle></svg>`, 4, true),
_tmpl$11 = template(`<svg><circle cx="136" cy="124" r="12"></circle></svg>`, 4, true),
_tmpl$12 = template(`<svg><path d="M225.94092,114.89844a15.91968,15.91968,0,0,0-13.46094-3.085,23.99389,23.99389,0,0,1-29.27832-23.14063,15.94771,15.94771,0,0,0-15.87354-15.875A23.99268,23.99268,0,0,1,144.187,43.51953a16.01308,16.01308,0,0,0-15.562-19.51367c-.21729-.001-.43018-.00195-.647-.00195A104,104,0,1,0,231.99463,127.3623v-.001A15.97461,15.97461,0,0,0,225.94092,114.89844ZM75.51465,99.51465a12.0001,12.0001,0,1,1,0,16.9707A12.00062,12.00062,0,0,1,75.51465,99.51465Zm24.9707,72.9707a12.0001,12.0001,0,1,1,0-16.9707A12.00062,12.00062,0,0,1,100.48535,172.48535Zm27.0293-40a12.0001,12.0001,0,1,1,16.9707,0A12.00019,12.00019,0,0,1,127.51465,132.48535Zm36.9707,48a12.0001,12.0001,0,1,1,0-16.9707A12.00062,12.00062,0,0,1,164.48535,180.48535Z"></path></svg>`, 4, true),
_tmpl$13 = template(`<svg><path d="M223.9944,127.41159a95.69791,95.69791,0,0,1-28.17312,68.53158c-36.94566,36.88079-97.30608,37.29538-134.72958.89956a95.99643,95.99643,0,0,1,67.48515-164.8372,8.01374,8.01374,0,0,1,7.80464,9.7612,31.99345,31.99345,0,0,0,30.85987,39.031,8.02776,8.02776,0,0,1,7.96088,7.96088,31.99346,31.99346,0,0,0,39.03035,30.86A8.01158,8.01158,0,0,1,223.9944,127.41159Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true),
_tmpl$14 = template(`<svg><circle cx="156" cy="172" r="10"></circle></svg>`, 4, true),
_tmpl$15 = template(`<svg><circle cx="92" cy="164" r="10"></circle></svg>`, 4, true),
_tmpl$16 = template(`<svg><circle cx="84" cy="108" r="10"></circle></svg>`, 4, true),
_tmpl$17 = template(`<svg><circle cx="136" cy="124" r="10"></circle></svg>`, 4, true),
_tmpl$18 = template(`<svg><path d="M223.9944,127.41159a95.69791,95.69791,0,0,1-28.17312,68.53158c-36.94566,36.88079-97.30608,37.29538-134.72958.89956a95.99643,95.99643,0,0,1,67.48515-164.8372,8.01374,8.01374,0,0,1,7.80464,9.7612,31.99345,31.99345,0,0,0,30.85987,39.031,8.02776,8.02776,0,0,1,7.96088,7.96088,31.99346,31.99346,0,0,0,39.03035,30.86A8.01158,8.01158,0,0,1,223.9944,127.41159Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true),
_tmpl$19 = template(`<svg><circle cx="156" cy="172" r="8"></circle></svg>`, 4, true),
_tmpl$20 = template(`<svg><circle cx="92" cy="164" r="8"></circle></svg>`, 4, true),
_tmpl$21 = template(`<svg><circle cx="84" cy="108" r="8"></circle></svg>`, 4, true),
_tmpl$22 = template(`<svg><circle cx="136" cy="124" r="8"></circle></svg>`, 4, true),
_tmpl$23 = 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$;
}(), _tmpl$2.cloneNode(true), _tmpl$3.cloneNode(true), _tmpl$4.cloneNode(true), _tmpl$5.cloneNode(true)];
case "duotone":
return [_tmpl$6.cloneNode(true), function () {
var _el$7 = _tmpl$7.cloneNode(true);
setAttribute(_el$7, "stroke", color);
return _el$7;
}(), _tmpl$8.cloneNode(true), _tmpl$9.cloneNode(true), _tmpl$10.cloneNode(true), _tmpl$11.cloneNode(true)];
case "fill":
return _tmpl$12.cloneNode(true);
case "light":
return [function () {
var _el$13 = _tmpl$13.cloneNode(true);
setAttribute(_el$13, "stroke", color);
return _el$13;
}(), _tmpl$14.cloneNode(true), _tmpl$15.cloneNode(true), _tmpl$16.cloneNode(true), _tmpl$17.cloneNode(true)];
case "thin":
return [function () {
var _el$18 = _tmpl$18.cloneNode(true);
setAttribute(_el$18, "stroke", color);
return _el$18;
}(), _tmpl$19.cloneNode(true), _tmpl$20.cloneNode(true), _tmpl$21.cloneNode(true), _tmpl$22.cloneNode(true)];
case "regular":
return [function () {
var _el$23 = _tmpl$7.cloneNode(true);
setAttribute(_el$23, "stroke", color);
return _el$23;
}(), _tmpl$8.cloneNode(true), _tmpl$9.cloneNode(true), _tmpl$10.cloneNode(true), _tmpl$11.cloneNode(true)];
default:
console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".');
return null;
}
};
var Cookie = function Cookie(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$28 = _tmpl$23.cloneNode(true),
_el$29 = _el$28.firstChild;
var _ref$ = ref;
typeof _ref$ === "function" ? _ref$(_el$28) : ref = _el$28;
setAttribute(_el$28, "width", size != null ? size : contextSize);
setAttribute(_el$28, "height", size != null ? size : contextSize);
setAttribute(_el$28, "fill", color != null ? color : contextColor);
setAttribute(_el$28, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined);
spread(_el$28, restContext, true, true);
spread(_el$28, restProps, true, true);
insert(_el$28, children, _el$29);
insert(_el$28, function () {
return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor);
}, null);
return _el$28;
}();
};
export default Cookie;
//# sourceMappingURL=Cookie.esm.js.map