phosphor-solid
Version:
A clean and friendly icon family for Solid-js
173 lines (124 loc) • 8.49 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><line x1="40" y1="128" x2="216" y2="128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true),
_tmpl$2 = template(`<svg><g><path d="M75.11111,88c0-22.09139,21.96094-40,52.88889-40,23.77865,0,42.25677,10.58606,49.529,25.52014" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path><path d="M72,168c0,22.09139,25.07205,40,56,40s56-17.90861,56-40c0-23.76634-21.62275-32.97043-45.59723-40.00076" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></g></svg>`, 8, true),
_tmpl$3 = template(`<svg><line x1="40" y1="128" x2="216" y2="128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true),
_tmpl$4 = template(`<svg><path d="M76.334,96.00294A25.48209,25.48209,0,0,1,75.11111,88c0-22.09139,21.96094-40,52.88889-40,23.77865,0,42.25677,10.58606,49.529,25.52014" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$5 = template(`<svg><path d="M72,168c0,22.09139,25.07205,40,56,40s56-17.90861,56-40c0-23.76634-21.62275-32.97043-45.59723-40.00076" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$6 = template(`<svg><path d="M224,128a7.99977,7.99977,0,0,1-8,8H175.93091C185.11755,143.11133,192,153.20166,192,168c0,13.33936-7.01465,25.6958-19.75244,34.79395C160.32568,211.31006,144.61133,216,128,216S95.67432,211.31006,83.75244,202.794C71.01465,193.6958,64,181.33936,64,168a8,8,0,0,1,16,0c0,17.3457,21.98145,32,48,32s48-14.6543,48-32c0-14.85425-10.54053-23.58228-38.76587-32H40a8,8,0,0,1,0-16h98.239c.03028-.00049.06055.00024.0907,0H216A7.99977,7.99977,0,0,1,224,128ZM76.33252,104.00488a8.00573,8.00573,0,0,0,7.60254-10.49609A17.42935,17.42935,0,0,1,83.11133,88c0-18.24316,19.29785-32,44.88867-32,19.5,0,36.11768,8.25195,42.33643,21.02246a7.99984,7.99984,0,1,0,14.38476-7.00488C175.70557,51.502,153.97119,40,128,40,93.2876,40,67.11133,60.63574,67.11133,88a33.60555,33.60555,0,0,0,1.62158,10.49707A8.00289,8.00289,0,0,0,76.33252,104.00488Z"></path></svg>`, 4, true),
_tmpl$7 = template(`<svg><line x1="40" y1="128" x2="216" y2="128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true),
_tmpl$8 = template(`<svg><g><path d="M76.334,96.00294A25.48209,25.48209,0,0,1,75.11111,88c0-22.09139,21.96094-40,52.88889-40,23.77865,0,42.25677,10.58606,49.529,25.52014" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path><path d="M72,168c0,22.09139,25.07205,40,56,40s56-17.90861,56-40c0-23.76634-21.62275-32.97043-45.59723-40.00076" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></g></svg>`, 8, true),
_tmpl$9 = template(`<svg><line x1="40" y1="128" x2="216" y2="128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true),
_tmpl$10 = template(`<svg><g><path d="M76.334,96.00294A25.48209,25.48209,0,0,1,75.11111,88c0-22.09139,21.96094-40,52.88889-40,23.77865,0,42.25677,10.58606,49.529,25.52014" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path><path d="M72,168c0,22.09139,25.07205,40,56,40s56-17.90861,56-40c0-23.76634-21.62275-32.97043-45.59723-40.00076" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></g></svg>`, 8, true),
_tmpl$11 = template(`<svg><g><path d="M76.334,96.00294A25.48209,25.48209,0,0,1,75.11111,88c0-22.09139,21.96094-40,52.88889-40,23.77865,0,42.25677,10.58606,49.529,25.52014" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path><path d="M72,168c0,22.09139,25.07205,40,56,40s56-17.90861,56-40c0-23.76634-21.62275-32.97043-45.59723-40.00076" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></g></svg>`, 8, 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),
_el$3 = _el$2.firstChild,
_el$4 = _el$3.nextSibling;
setAttribute(_el$3, "stroke", color);
setAttribute(_el$4, "stroke", color);
return _el$2;
}()];
case "duotone":
return [function () {
var _el$5 = _tmpl$3.cloneNode(true);
setAttribute(_el$5, "stroke", color);
return _el$5;
}(), function () {
var _el$6 = _tmpl$4.cloneNode(true);
setAttribute(_el$6, "stroke", color);
return _el$6;
}(), function () {
var _el$7 = _tmpl$5.cloneNode(true);
setAttribute(_el$7, "stroke", color);
return _el$7;
}()];
case "fill":
return _tmpl$6.cloneNode(true);
case "light":
return [function () {
var _el$9 = _tmpl$7.cloneNode(true);
setAttribute(_el$9, "stroke", color);
return _el$9;
}(), function () {
var _el$10 = _tmpl$8.cloneNode(true),
_el$11 = _el$10.firstChild,
_el$12 = _el$11.nextSibling;
setAttribute(_el$11, "stroke", color);
setAttribute(_el$12, "stroke", color);
return _el$10;
}()];
case "thin":
return [function () {
var _el$13 = _tmpl$9.cloneNode(true);
setAttribute(_el$13, "stroke", color);
return _el$13;
}(), function () {
var _el$14 = _tmpl$10.cloneNode(true),
_el$15 = _el$14.firstChild,
_el$16 = _el$15.nextSibling;
setAttribute(_el$15, "stroke", color);
setAttribute(_el$16, "stroke", color);
return _el$14;
}()];
case "regular":
return [function () {
var _el$17 = _tmpl$3.cloneNode(true);
setAttribute(_el$17, "stroke", color);
return _el$17;
}(), function () {
var _el$18 = _tmpl$11.cloneNode(true),
_el$19 = _el$18.firstChild,
_el$20 = _el$19.nextSibling;
setAttribute(_el$19, "stroke", color);
setAttribute(_el$20, "stroke", color);
return _el$18;
}()];
default:
console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".');
return null;
}
};
var TextStrikethrough = function TextStrikethrough(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$21 = _tmpl$12.cloneNode(true),
_el$22 = _el$21.firstChild;
var _ref$ = ref;
typeof _ref$ === "function" ? _ref$(_el$21) : ref = _el$21;
setAttribute(_el$21, "width", size != null ? size : contextSize);
setAttribute(_el$21, "height", size != null ? size : contextSize);
setAttribute(_el$21, "fill", color != null ? color : contextColor);
setAttribute(_el$21, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined);
spread(_el$21, restContext, true, true);
spread(_el$21, restProps, true, true);
insert(_el$21, children, _el$22);
insert(_el$21, function () {
return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor);
}, null);
return _el$21;
}();
};
export default TextStrikethrough;
//# sourceMappingURL=TextStrikethrough.esm.js.map