UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

185 lines (132 loc) 9.19 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="M192,120h26.66667a8,8,0,0,0,7.38461-4.92308l15.32021-36.76848a8,8,0,0,0-3.19184-9.89019L192,40" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true), _tmpl$2 = template(`<svg><path d="M64,120H37.33333a8,8,0,0,1-7.38461-4.92308L14.62851,78.30844a8,8,0,0,1,3.19184-9.89019L64,40" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true), _tmpl$3 = template(`<svg><path d="M160,40a32,32,0,0,1-64,0H64V208a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V40Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true), _tmpl$4 = template(`<svg><path d="M192,120h27.05573a8,8,0,0,0,7.15542-4.42229l18.40439-36.80878a8,8,0,0,0-3.18631-10.52366L192,40" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true), _tmpl$5 = template(`<svg><path d="M64,120H36.94427a8,8,0,0,1-7.15542-4.42229L11.38446,78.76893a8,8,0,0,1,3.18631-10.52366L64,40" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true), _tmpl$6 = template(`<svg><path d="M192,120h27.05573a8,8,0,0,0,7.15542-4.42229l18.40439-36.80878a8,8,0,0,0-3.18631-10.52366L192,40Z" opacity="0.2"></path></svg>`, 4, true), _tmpl$7 = template(`<svg><path d="M64,120H36.94427a8,8,0,0,1-7.15542-4.42229L11.38446,78.76893a8,8,0,0,1,3.18631-10.52366L64,40Z" opacity="0.2"></path></svg>`, 4, true), _tmpl$8 = template(`<svg><path d="M160,40a32,32,0,0,1-64,0H64V208a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V40Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true), _tmpl$9 = template(`<svg><path d="M245.39844,61.29932,195.96924,33.0542c-.01953-.01123-.04-.019-.05957-.03027-.15833-.08887-.32215-.16846-.48694-.24659-.07752-.03686-.15393-.07763-.23206-.11181-.14917-.06494-.30322-.12012-.45691-.176-.09912-.03638-.19726-.07666-.29724-.10888-.11938-.03809-.24243-.06714-.36425-.09986-.13868-.03735-.27662-.07739-.41614-.10693-.08631-.01807-.17493-.0293-.26209-.04468-.1781-.03149-.35583-.06226-.53442-.08154-.07031-.00757-.142-.00928-.21265-.0149-.19653-.01586-.39282-.02856-.58911-.02978-.01953,0-.03833-.00293-.05786-.00293H160a7.99977,7.99977,0,0,0-8,8,24,24,0,0,1-48,0,7.99977,7.99977,0,0,0-8-8H64c-.02576,0-.05054.00366-.07629.00391-.16809.00146-.33606.01318-.50428.02539-.09814.00708-.19726.01025-.29443.02075-.15137.0166-.302.0437-.453.06909-.11365.019-.2284.03394-.34046.05786-.11706.0249-.23291.05933-.34936.08985-.14331.03735-.28736.072-.42749.11694-.08545.02759-.16931.0625-.25415.09326-.16724.05982-.334.12012-.49573.19067-.07251.03174-.14343.06983-.21545.10376-.16907.08008-.33692.16163-.49927.25269-.01953.011-.0398.0188-.05933.03L10.60107,61.29932A16.00794,16.00794,0,0,0,4.229,82.34668l18.4043,36.80811A15.91231,15.91231,0,0,0,36.94434,128H56v80a16.01833,16.01833,0,0,0,16,16H184a16.01833,16.01833,0,0,0,16-16V128h19.05566a15.91146,15.91146,0,0,0,14.31055-8.84473l18.40527-36.80908A16.00784,16.00784,0,0,0,245.39844,61.29932ZM36.94434,112,18.54,75.19092,56,53.7854V112Zm182.11132,0H200V53.7854l37.46045,21.406Z"></path></svg>`, 4, true), _tmpl$10 = template(`<svg><path d="M192,120h27.05573a8,8,0,0,0,7.15542-4.42229l18.40439-36.80878a8,8,0,0,0-3.18631-10.52366L192,40" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true), _tmpl$11 = template(`<svg><path d="M64,120H36.94427a8,8,0,0,1-7.15542-4.42229L11.38446,78.76893a8,8,0,0,1,3.18631-10.52366L64,40" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true), _tmpl$12 = template(`<svg><path d="M160,40a32,32,0,0,1-64,0H64V208a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V40Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true), _tmpl$13 = template(`<svg><path d="M192,120h27.05573a8,8,0,0,0,7.15542-4.42229l18.40439-36.80878a8,8,0,0,0-3.18631-10.52366L192,40" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true), _tmpl$14 = template(`<svg><path d="M64,120H36.94427a8,8,0,0,1-7.15542-4.42229L11.38446,78.76893a8,8,0,0,1,3.18631-10.52366L64,40" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true), _tmpl$15 = template(`<svg><path d="M160,40a32,32,0,0,1-64,0H64V208a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V40Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true), _tmpl$16 = 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 [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; }(), _tmpl$6.cloneNode(true), _tmpl$7.cloneNode(true), function () { var _el$8 = _tmpl$8.cloneNode(true); setAttribute(_el$8, "stroke", color); return _el$8; }()]; case "fill": return _tmpl$9.cloneNode(true); case "light": return [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; }(), function () { var _el$12 = _tmpl$12.cloneNode(true); setAttribute(_el$12, "stroke", color); return _el$12; }()]; case "thin": return [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; }(), function () { var _el$15 = _tmpl$15.cloneNode(true); setAttribute(_el$15, "stroke", color); return _el$15; }()]; case "regular": return [function () { var _el$16 = _tmpl$4.cloneNode(true); setAttribute(_el$16, "stroke", color); return _el$16; }(), function () { var _el$17 = _tmpl$5.cloneNode(true); setAttribute(_el$17, "stroke", color); return _el$17; }(), function () { var _el$18 = _tmpl$8.cloneNode(true); setAttribute(_el$18, "stroke", color); return _el$18; }()]; default: console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'); return null; } }; var TShirt = function TShirt(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$19 = _tmpl$16.cloneNode(true), _el$20 = _el$19.firstChild; var _ref$ = ref; typeof _ref$ === "function" ? _ref$(_el$19) : ref = _el$19; setAttribute(_el$19, "width", size != null ? size : contextSize); setAttribute(_el$19, "height", size != null ? size : contextSize); setAttribute(_el$19, "fill", color != null ? color : contextColor); setAttribute(_el$19, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined); spread(_el$19, restContext, true, true); spread(_el$19, restProps, true, true); insert(_el$19, children, _el$20); insert(_el$19, function () { return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor); }, null); return _el$19; }(); }; export default TShirt; //# sourceMappingURL=TShirt.esm.js.map