UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

176 lines (127 loc) 9.12 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="M83,112h90l22.61071-60.29524a4,4,0,0,1,7.61026.37384l27.32935,102.4851a8,8,0,0,1-3.1762,8.63883l-94.82044,65.64492a8,8,0,0,1-9.10736,0L28.62588,163.20255a8,8,0,0,1-3.1762-8.63883L52.779,52.07862a4,4,0,0,1,7.61026-.37384Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true), _tmpl$2 = template(`<svg><g><line x1="128.65903" y1="230.2426" x2="173" y2="112.00002" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line><polyline points="83 112 83 112 127.341 230.243" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></g></svg>`, 8, true), _tmpl$3 = template(`<svg><path d="M127.341,230.2426,83,112h90L128.659,230.2426l0,.0002a8.017,8.017,0,0,1-1.3181,0Z" opacity="0.2"></path></svg>`, 4, true), _tmpl$4 = template(`<svg><path d="M219.2,112l-15.979-59.9214a4,4,0,0,0-7.61026-.37384L173,112Z" opacity="0.2"></path></svg>`, 4, true), _tmpl$5 = template(`<svg><path d="M36.8,112l15.979-59.9214a4,4,0,0,1,7.61026-.37384L83,112H36.8Z" opacity="0.2"></path></svg>`, 4, true), _tmpl$6 = template(`<svg><path d="M83,112h90l22.61071-60.29524a4,4,0,0,1,7.61026.37384l27.32935,102.4851a8,8,0,0,1-3.1762,8.63883l-94.82044,65.64492a8,8,0,0,1-9.10736,0L28.62588,163.20255a8,8,0,0,1-3.1762-8.63883L52.779,52.07862a4,4,0,0,1,7.61026-.37384Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true), _tmpl$7 = template(`<svg><polyline points="128.659 230.243 173 112 219.2 112" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true), _tmpl$8 = template(`<svg><polyline points="36.8 112 83 112 83 112 127.341 230.243" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true), _tmpl$9 = template(`<svg><path d="M238.28027,152.50246,210.95068,50.01662a12.00021,12.00021,0,0,0-22.83056-1.12109L167.45605,104H88.544L67.87988,48.89651a12.00012,12.00012,0,0,0-22.831,1.12109L17.71973,152.50246a16.03981,16.03981,0,0,0,6.35254,17.27783l94.82031,65.64454a15.91589,15.91589,0,0,0,7.093,2.69336c.22131.03808.44567.05517.67065.0747.09387.00781.1875.01514.28149.02149.13526.00683.26807.03076.40406.03076.06445,0,.12939-.00733.19409-.00879.15478.00439.30932.01709.46411.01709s.30933-.0127.46411-.01709c.0647.00146.12964.00879.19409.00879.13587,0,.26831-.02393.40345-.03076q.1419-.00952.2832-.02149c.22436-.02.44812-.03662.66882-.0747a15.91868,15.91868,0,0,0,7.09375-2.69336l94.82031-65.64454A16.03981,16.03981,0,0,0,238.28027,152.50246ZM33.17969,156.625,42.94617,120H77.45605l34.07544,90.86865Zm111.28882,54.24365L178.544,120h34.50988l9.76648,36.625Z"></path></svg>`, 4, true), _tmpl$10 = template(`<svg><path d="M83,112h90l22.61071-60.29524a4,4,0,0,1,7.61026.37384l27.32935,102.4851a8,8,0,0,1-3.1762,8.63883l-94.82044,65.64492a8,8,0,0,1-9.10736,0L28.62588,163.20255a8,8,0,0,1-3.1762-8.63883L52.779,52.07862a4,4,0,0,1,7.61026-.37384Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true), _tmpl$11 = template(`<svg><g><polyline points="128.659 230.243 173 112 219.2 112" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline><polyline points="36.8 112 83 112 83 112 127.341 230.243" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></g></svg>`, 8, true), _tmpl$12 = template(`<svg><path d="M83,112h90l22.61071-60.29524a4,4,0,0,1,7.61026.37384l27.32935,102.4851a8,8,0,0,1-3.1762,8.63883l-94.82044,65.64492a8,8,0,0,1-9.10736,0L28.62588,163.20255a8,8,0,0,1-3.1762-8.63883L52.779,52.07862a4,4,0,0,1,7.61026-.37384Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true), _tmpl$13 = template(`<svg><g><polyline points="128.659 230.243 173 112 219.2 112" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline><polyline points="36.8 112 83 112 83 112 127.341 230.243" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></g></svg>`, 8, true), _tmpl$14 = template(`<svg><g><polyline points="128.659 230.243 173 112 219.2 112" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline><polyline points="36.8 112 83 112 83 112 127.341 230.243" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></g></svg>`, 8, 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), _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 [_tmpl$3.cloneNode(true), _tmpl$4.cloneNode(true), _tmpl$5.cloneNode(true), function () { var _el$8 = _tmpl$6.cloneNode(true); setAttribute(_el$8, "stroke", color); return _el$8; }(), function () { var _el$9 = _tmpl$7.cloneNode(true); setAttribute(_el$9, "stroke", color); return _el$9; }(), function () { var _el$10 = _tmpl$8.cloneNode(true); setAttribute(_el$10, "stroke", color); return _el$10; }()]; case "fill": return _tmpl$9.cloneNode(true); case "light": return [function () { var _el$12 = _tmpl$10.cloneNode(true); setAttribute(_el$12, "stroke", color); return _el$12; }(), function () { var _el$13 = _tmpl$11.cloneNode(true), _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling; setAttribute(_el$14, "stroke", color); setAttribute(_el$15, "stroke", color); return _el$13; }()]; case "thin": return [function () { var _el$16 = _tmpl$12.cloneNode(true); setAttribute(_el$16, "stroke", color); return _el$16; }(), function () { var _el$17 = _tmpl$13.cloneNode(true), _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling; setAttribute(_el$18, "stroke", color); setAttribute(_el$19, "stroke", color); return _el$17; }()]; case "regular": return [function () { var _el$20 = _tmpl$6.cloneNode(true); setAttribute(_el$20, "stroke", color); return _el$20; }(), function () { var _el$21 = _tmpl$14.cloneNode(true), _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling; setAttribute(_el$22, "stroke", color); setAttribute(_el$23, "stroke", color); return _el$21; }()]; default: console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'); return null; } }; var GitlabLogo = function GitlabLogo(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$24 = _tmpl$15.cloneNode(true), _el$25 = _el$24.firstChild; var _ref$ = ref; typeof _ref$ === "function" ? _ref$(_el$24) : ref = _el$24; setAttribute(_el$24, "width", size != null ? size : contextSize); setAttribute(_el$24, "height", size != null ? size : contextSize); setAttribute(_el$24, "fill", color != null ? color : contextColor); setAttribute(_el$24, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined); spread(_el$24, restContext, true, true); spread(_el$24, restProps, true, true); insert(_el$24, children, _el$25); insert(_el$24, function () { return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor); }, null); return _el$24; }(); }; export default GitlabLogo; //# sourceMappingURL=GitlabLogo.esm.js.map