UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

173 lines (130 loc) 9.29 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><rect x="32" y="48" width="192" height="160" rx="8" transform="translate(256) rotate(90)" stroke-width="24" stroke-linecap="round" stroke-linejoin="round" fill="none"></rect></svg>`, 4, true), _tmpl$2 = template(`<svg><line x1="92" y1="76" x2="164" y2="76" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true), _tmpl$3 = template(`<svg><circle cx="104" cy="128" r="16"></circle></svg>`, 4, true), _tmpl$4 = template(`<svg><circle cx="152" cy="128" r="16"></circle></svg>`, 4, true), _tmpl$5 = template(`<svg><circle cx="104" cy="176" r="16"></circle></svg>`, 4, true), _tmpl$6 = template(`<svg><circle cx="152" cy="176" r="16"></circle></svg>`, 4, true), _tmpl$7 = template(`<svg><rect x="80" y="64" width="96" height="48" opacity="0.2"></rect></svg>`, 4, true), _tmpl$8 = template(`<svg><rect x="80" y="64" width="96" height="48" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" fill="none"></rect></svg>`, 4, true), _tmpl$9 = template(`<svg><rect x="31.99995" y="48.00781" width="192" height="160" rx="8" transform="translate(256.00777 0.00786) rotate(90)" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" fill="none"></rect></svg>`, 4, true), _tmpl$10 = template(`<svg><circle cx="88" cy="148" r="12"></circle></svg>`, 4, true), _tmpl$11 = template(`<svg><circle cx="128" cy="148" r="12"></circle></svg>`, 4, true), _tmpl$12 = template(`<svg><circle cx="168" cy="148" r="12"></circle></svg>`, 4, true), _tmpl$13 = template(`<svg><circle cx="88" cy="188" r="12"></circle></svg>`, 4, true), _tmpl$14 = template(`<svg><circle cx="128" cy="188" r="12"></circle></svg>`, 4, true), _tmpl$15 = template(`<svg><circle cx="168" cy="188" r="12"></circle></svg>`, 4, true), _tmpl$16 = template(`<svg><path d="M200,24H56A16.01833,16.01833,0,0,0,40,40V216a16.01833,16.01833,0,0,0,16,16H200a16.01833,16.01833,0,0,0,16-16V40A16.01833,16.01833,0,0,0,200,24ZM88,199.99219a12,12,0,1,1,12-12A12.01375,12.01375,0,0,1,88,199.99219Zm0-40a12,12,0,1,1,12-12A12.01375,12.01375,0,0,1,88,159.99219Zm40,40a12,12,0,1,1,12-12A12.01375,12.01375,0,0,1,128,199.99219Zm0-40a12,12,0,1,1,12-12A12.01375,12.01375,0,0,1,128,159.99219Zm40,40a12,12,0,1,1,12-12A12.01375,12.01375,0,0,1,168,199.99219Zm0-40a12,12,0,1,1,12-12A12.01375,12.01375,0,0,1,168,159.99219Zm16-56a7.99977,7.99977,0,0,1-8,8H80a7.99977,7.99977,0,0,1-8-8v-40a7.99977,7.99977,0,0,1,8-8h96a7.99977,7.99977,0,0,1,8,8Z"></path></svg>`, 4, true), _tmpl$17 = template(`<svg><rect x="80" y="64" width="96" height="48" stroke-width="12" stroke-linecap="round" stroke-linejoin="round" fill="none"></rect></svg>`, 4, true), _tmpl$18 = template(`<svg><rect x="32" y="48" width="192" height="160" rx="8" transform="translate(256) rotate(90)" stroke-width="12" stroke-linecap="round" stroke-linejoin="round" fill="none"></rect></svg>`, 4, true), _tmpl$19 = template(`<svg><circle cx="88" cy="148" r="10"></circle></svg>`, 4, true), _tmpl$20 = template(`<svg><circle cx="128" cy="148" r="10"></circle></svg>`, 4, true), _tmpl$21 = template(`<svg><circle cx="168" cy="148" r="10"></circle></svg>`, 4, true), _tmpl$22 = template(`<svg><circle cx="88" cy="188" r="10"></circle></svg>`, 4, true), _tmpl$23 = template(`<svg><circle cx="128" cy="188" r="10"></circle></svg>`, 4, true), _tmpl$24 = template(`<svg><circle cx="168" cy="188" r="10"></circle></svg>`, 4, true), _tmpl$25 = template(`<svg><rect x="80" y="64" width="96" height="48" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" fill="none"></rect></svg>`, 4, true), _tmpl$26 = template(`<svg><rect x="32" y="48" width="192" height="160" rx="8" transform="translate(256) rotate(90)" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" fill="none"></rect></svg>`, 4, true), _tmpl$27 = template(`<svg><circle cx="88" cy="148" r="8"></circle></svg>`, 4, true), _tmpl$28 = template(`<svg><circle cx="128" cy="148" r="8"></circle></svg>`, 4, true), _tmpl$29 = template(`<svg><circle cx="168" cy="148" r="8"></circle></svg>`, 4, true), _tmpl$30 = template(`<svg><circle cx="88" cy="188" r="8"></circle></svg>`, 4, true), _tmpl$31 = template(`<svg><circle cx="128" cy="188" r="8"></circle></svg>`, 4, true), _tmpl$32 = template(`<svg><circle cx="168" cy="188" r="8"></circle></svg>`, 4, true), _tmpl$33 = template(`<svg><rect x="32" y="48" width="192" height="160" rx="8" transform="translate(256) rotate(90)" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" fill="none"></rect></svg>`, 4, true), _tmpl$34 = 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; }(), _tmpl$3.cloneNode(true), _tmpl$4.cloneNode(true), _tmpl$5.cloneNode(true), _tmpl$6.cloneNode(true)]; case "duotone": return [_tmpl$7.cloneNode(true), function () { var _el$8 = _tmpl$8.cloneNode(true); setAttribute(_el$8, "stroke", color); return _el$8; }(), function () { var _el$9 = _tmpl$9.cloneNode(true); setAttribute(_el$9, "stroke", color); return _el$9; }(), _tmpl$10.cloneNode(true), _tmpl$11.cloneNode(true), _tmpl$12.cloneNode(true), _tmpl$13.cloneNode(true), _tmpl$14.cloneNode(true), _tmpl$15.cloneNode(true)]; case "fill": return _tmpl$16.cloneNode(true); case "light": return [function () { var _el$17 = _tmpl$17.cloneNode(true); setAttribute(_el$17, "stroke", color); return _el$17; }(), function () { var _el$18 = _tmpl$18.cloneNode(true); setAttribute(_el$18, "stroke", color); return _el$18; }(), _tmpl$19.cloneNode(true), _tmpl$20.cloneNode(true), _tmpl$21.cloneNode(true), _tmpl$22.cloneNode(true), _tmpl$23.cloneNode(true), _tmpl$24.cloneNode(true)]; case "thin": return [function () { var _el$25 = _tmpl$25.cloneNode(true); setAttribute(_el$25, "stroke", color); return _el$25; }(), function () { var _el$26 = _tmpl$26.cloneNode(true); setAttribute(_el$26, "stroke", color); return _el$26; }(), _tmpl$27.cloneNode(true), _tmpl$28.cloneNode(true), _tmpl$29.cloneNode(true), _tmpl$30.cloneNode(true), _tmpl$31.cloneNode(true), _tmpl$32.cloneNode(true)]; case "regular": return [function () { var _el$33 = _tmpl$8.cloneNode(true); setAttribute(_el$33, "stroke", color); return _el$33; }(), function () { var _el$34 = _tmpl$33.cloneNode(true); setAttribute(_el$34, "stroke", color); return _el$34; }(), _tmpl$10.cloneNode(true), _tmpl$11.cloneNode(true), _tmpl$12.cloneNode(true), _tmpl$13.cloneNode(true), _tmpl$14.cloneNode(true), _tmpl$15.cloneNode(true)]; default: console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'); return null; } }; var Calculator = function Calculator(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$41 = _tmpl$34.cloneNode(true), _el$42 = _el$41.firstChild; var _ref$ = ref; typeof _ref$ === "function" ? _ref$(_el$41) : ref = _el$41; setAttribute(_el$41, "width", size != null ? size : contextSize); setAttribute(_el$41, "height", size != null ? size : contextSize); setAttribute(_el$41, "fill", color != null ? color : contextColor); setAttribute(_el$41, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined); spread(_el$41, restContext, true, true); spread(_el$41, restProps, true, true); insert(_el$41, children, _el$42); insert(_el$41, function () { return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor); }, null); return _el$41; }(); }; export default Calculator; //# sourceMappingURL=Calculator.esm.js.map