UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

184 lines (131 loc) 8.31 kB
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="M20,216H92a52,52,0,1,0-52-52C40,200,20,216,20,216Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true), _tmpl$2 = template(`<svg><path d="M112.40713,116.15918c19.194-25.86782,68.02669-85.12974,112.56343-85.12974,0,44.53626-59.26065,93.36835-85.12891,112.56282" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true), _tmpl$3 = template(`<svg><path d="M138.41669,84.55047a92.45653,92.45653,0,0,1,33.01749,33.00663" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true), _tmpl$4 = template(`<svg><path d="M132.96191,90.647A84.40614,84.40614,0,0,1,165.353,123.03809C192.66992,99.12988,224.9707,63.91016,224.9707,31.0293,192.08984,31.0293,156.87012,63.33008,132.96191,90.647Z" opacity="0.2"></path></svg>`, 4, true), _tmpl$5 = template(`<svg><path d="M20,216H92a52,52,0,1,0-52-52C40,200,20,216,20,216Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true), _tmpl$6 = template(`<svg><path d="M112.40713,116.15918c19.194-25.86782,68.02669-85.12974,112.56343-85.12974,0,44.53626-59.26065,93.36835-85.12891,112.56282" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true), _tmpl$7 = template(`<svg><path d="M132.9608,90.6464a84.40058,84.40058,0,0,1,32.3928,32.3928" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true), _tmpl$8 = template(`<svg><path d="M224.9707,23.0293c-21.30468,0-45.23242,11.74316-71.11914,34.90234-18.04687,16.146-33.54394,34.64258-44.27978,48.69922A59.99965,59.99965,0,0,0,32,164c0,31.21094-16.23926,45.12109-17.041,45.78809A8,8,0,0,0,20,224H92a60.00007,60.00007,0,0,0,57.36914-77.57227c14.05664-10.73535,32.55371-26.23193,48.7002-44.28027C221.22852,76.26172,232.9707,52.334,232.9707,31.0293A8.00039,8.00039,0,0,0,224.9707,23.0293ZM124.44189,113.56689c2.8628-3.66259,6.29053-7.91308,10.1753-12.49218a76.22114,76.22114,0,0,1,20.3081,20.3081c-4.5791,3.88477-8.82959,7.3125-12.49267,10.1753A60.4544,60.4544,0,0,0,124.44189,113.56689Zm42.54883-2.86718a92.19891,92.19891,0,0,0-21.69043-21.69043c19.60987-21.18408,45.98389-44.37354,70.79834-49.10791C211.36426,64.71631,188.1748,91.08984,166.99072,110.69971Z"></path></svg>`, 4, true), _tmpl$9 = template(`<svg><path d="M20,216H92a52,52,0,1,0-52-52C40,200,20,216,20,216Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true), _tmpl$10 = template(`<svg><path d="M112.40713,116.15918c19.194-25.86782,68.02669-85.12974,112.56343-85.12974,0,44.53626-59.26065,93.36835-85.12891,112.56282" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true), _tmpl$11 = template(`<svg><path d="M132.9608,90.6464a84.40058,84.40058,0,0,1,32.3928,32.3928" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true), _tmpl$12 = template(`<svg><path d="M20,216H92a52,52,0,1,0-52-52C40,200,20,216,20,216Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true), _tmpl$13 = template(`<svg><path d="M112.40713,116.15918c19.194-25.86782,68.02669-85.12974,112.56343-85.12974,0,44.53626-59.26065,93.36835-85.12891,112.56282" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true), _tmpl$14 = template(`<svg><path d="M132.9608,90.6464a84.40058,84.40058,0,0,1,32.3928,32.3928" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true), _tmpl$15 = 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; }()]; case "duotone": return [_tmpl$4.cloneNode(true), function () { var _el$5 = _tmpl$5.cloneNode(true); setAttribute(_el$5, "stroke", color); return _el$5; }(), function () { var _el$6 = _tmpl$6.cloneNode(true); setAttribute(_el$6, "stroke", color); return _el$6; }(), function () { var _el$7 = _tmpl$7.cloneNode(true); setAttribute(_el$7, "stroke", color); return _el$7; }()]; case "fill": return _tmpl$8.cloneNode(true); case "light": 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; }(), function () { var _el$11 = _tmpl$11.cloneNode(true); setAttribute(_el$11, "stroke", color); return _el$11; }()]; case "thin": return [function () { var _el$12 = _tmpl$12.cloneNode(true); setAttribute(_el$12, "stroke", color); return _el$12; }(), function () { var _el$13 = _tmpl$13.cloneNode(true); setAttribute(_el$13, "stroke", color); return _el$13; }(), function () { var _el$14 = _tmpl$14.cloneNode(true); setAttribute(_el$14, "stroke", color); return _el$14; }()]; case "regular": return [function () { var _el$15 = _tmpl$5.cloneNode(true); setAttribute(_el$15, "stroke", color); return _el$15; }(), function () { var _el$16 = _tmpl$6.cloneNode(true); setAttribute(_el$16, "stroke", color); return _el$16; }(), function () { var _el$17 = _tmpl$7.cloneNode(true); setAttribute(_el$17, "stroke", color); return _el$17; }()]; default: console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'); return null; } }; var PaintBrush = function PaintBrush(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$18 = _tmpl$15.cloneNode(true), _el$19 = _el$18.firstChild; var _ref$ = ref; typeof _ref$ === "function" ? _ref$(_el$18) : ref = _el$18; setAttribute(_el$18, "width", size != null ? size : contextSize); setAttribute(_el$18, "height", size != null ? size : contextSize); setAttribute(_el$18, "fill", color != null ? color : contextColor); setAttribute(_el$18, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined); spread(_el$18, restContext, true, true); spread(_el$18, restProps, true, true); insert(_el$18, children, _el$19); insert(_el$18, function () { return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor); }, null); return _el$18; }(); }; export default PaintBrush; //# sourceMappingURL=PaintBrush.esm.js.map