phosphor-solid
Version:
A clean and friendly icon family for Solid-js
169 lines (121 loc) • 7.95 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><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$5 = 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$6 = 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$7 = 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$8 = 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$9 = 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$10 = 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),
_el$7 = _el$6.firstChild,
_el$8 = _el$7.nextSibling;
setAttribute(_el$7, "stroke", color);
setAttribute(_el$8, "stroke", color);
return _el$6;
}()];
case "fill":
return _tmpl$5.cloneNode(true);
case "light":
return [function () {
var _el$10 = _tmpl$6.cloneNode(true);
setAttribute(_el$10, "stroke", color);
return _el$10;
}(), function () {
var _el$11 = _tmpl$7.cloneNode(true),
_el$12 = _el$11.firstChild,
_el$13 = _el$12.nextSibling;
setAttribute(_el$12, "stroke", color);
setAttribute(_el$13, "stroke", color);
return _el$11;
}()];
case "thin":
return [function () {
var _el$14 = _tmpl$8.cloneNode(true);
setAttribute(_el$14, "stroke", color);
return _el$14;
}(), function () {
var _el$15 = _tmpl$9.cloneNode(true),
_el$16 = _el$15.firstChild,
_el$17 = _el$16.nextSibling;
setAttribute(_el$16, "stroke", color);
setAttribute(_el$17, "stroke", color);
return _el$15;
}()];
case "regular":
return [function () {
var _el$18 = _tmpl$3.cloneNode(true);
setAttribute(_el$18, "stroke", color);
return _el$18;
}(), function () {
var _el$19 = _tmpl$4.cloneNode(true),
_el$20 = _el$19.firstChild,
_el$21 = _el$20.nextSibling;
setAttribute(_el$20, "stroke", color);
setAttribute(_el$21, "stroke", color);
return _el$19;
}()];
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$22 = _tmpl$10.cloneNode(true),
_el$23 = _el$22.firstChild;
var _ref$ = ref;
typeof _ref$ === "function" ? _ref$(_el$22) : ref = _el$22;
setAttribute(_el$22, "width", size != null ? size : contextSize);
setAttribute(_el$22, "height", size != null ? size : contextSize);
setAttribute(_el$22, "fill", color != null ? color : contextColor);
setAttribute(_el$22, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined);
spread(_el$22, restContext, true, true);
spread(_el$22, restProps, true, true);
insert(_el$22, children, _el$23);
insert(_el$22, function () {
return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor);
}, null);
return _el$22;
}();
};
export default TextStrikethrough;
//# sourceMappingURL=TextStrikethrough.esm.js.map