UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

218 lines (155 loc) 10.1 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><polyline points="128 80 128 128 176 128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true), _tmpl$2 = template(`<svg><circle cx="128" cy="128" r="88" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></circle></svg>`, 4, true), _tmpl$3 = template(`<svg><line x1="201.53911" y1="20.51977" x2="235.48023" y2="54.46089" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true), _tmpl$4 = template(`<svg><line x1="20.51977" y1="54.46089" x2="54.46089" y2="20.51977" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true), _tmpl$5 = template(`<svg><circle cx="128" cy="128" r="88" opacity="0.2"></circle></svg>`, 4, true), _tmpl$6 = template(`<svg><polyline points="128 72 128 128 184 128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true), _tmpl$7 = template(`<svg><circle cx="128" cy="128" r="88" fill="none" stroke-miterlimit="10" stroke-width="16"></circle></svg>`, 4, true), _tmpl$8 = template(`<svg><line x1="195.88225" y1="26.17662" x2="229.82338" y2="60.11775" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true), _tmpl$9 = template(`<svg><line x1="26.17662" y1="60.11775" x2="60.11775" y2="26.17662" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true), _tmpl$10 = template(`<svg><g><path d="M235.48047,54.46094,201.53906,20.51953a8,8,0,0,0-11.31347,11.314L224.1665,65.77441a8,8,0,1,0,11.314-11.31347Z"></path><path d="M65.77441,20.51953a8,8,0,0,0-11.31347,0L20.51953,54.46094a8,8,0,0,0,11.314,11.31347L65.77441,31.8335A8.00061,8.00061,0,0,0,65.77441,20.51953Z"></path><path d="M223.957,125.22363c-.02051-.71777-.0459-1.43408-.082-2.14892-.001-.02491-.00293-.04932-.00439-.07373A96.003,96.003,0,0,0,132.999,32.12939c-.02441-.00146-.04882-.00341-.07373-.00439-.71484-.03613-1.43115-.06152-2.14892-.082-.10742-.00293-.21436-.00879-.32227-.01172Q129.2295,32.00048,128,32q-1.22973,0-2.4541.03125c-.10791.00293-.21485.00879-.32227.01172-.71777.02051-1.43408.0459-2.14892.082-.02491.001-.04932.00293-.07373.00439A96.004,96.004,0,0,0,32.12939,123.001c-.00146.02441-.00341.04882-.00439.07373-.03613.71484-.06152,1.43115-.082,2.14892-.00293.10742-.00879.21436-.01172.32227Q32.00048,126.7705,32,128q0,1.22973.03125,2.4541c.00293.10791.00879.21485.01172.32227.02051.71777.0459,1.43408.082,2.14892.001.02491.00293.04932.00439.07373A96.003,96.003,0,0,0,123.001,223.87061c.02441.00146.04882.00341.07373.00439.71484.03613,1.43115.06152,2.14892.082.10742.00293.21436.00879.32227.01172q1.2246.03077,2.4541.03125,1.22973,0,2.4541-.03125c.10791-.00293.21485-.00879.32227-.01172.71777-.02051,1.43408-.0459,2.14892-.082.02491-.001.04932-.00293.07373-.00439A96.004,96.004,0,0,0,223.87061,132.999c.00146-.02441.00341-.04882.00439-.07373.03613-.71484.06152-1.43115.082-2.14892.00293-.10742.00879-.21436.01172-.32227Q223.99952,129.2295,224,128q0-1.22973-.03125-2.4541C223.96582,125.438,223.96,125.33105,223.957,125.22363ZM184,136H128a8.00008,8.00008,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"></path></g></svg>`, 10, true), _tmpl$11 = template(`<svg><polyline points="128 72 128 128 184 128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true), _tmpl$12 = template(`<svg><circle cx="128" cy="128" r="88" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></circle></svg>`, 4, true), _tmpl$13 = template(`<svg><line x1="195.88225" y1="26.17662" x2="229.82338" y2="60.11775" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true), _tmpl$14 = template(`<svg><line x1="26.17662" y1="60.11775" x2="60.11775" y2="26.17662" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true), _tmpl$15 = template(`<svg><polyline points="128 72 128 128 184 128" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true), _tmpl$16 = template(`<svg><circle cx="128" cy="128" r="88" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></circle></svg>`, 4, true), _tmpl$17 = template(`<svg><line x1="195.88225" y1="26.17662" x2="229.82338" y2="60.11775" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true), _tmpl$18 = template(`<svg><line x1="26.17662" y1="60.11775" x2="60.11775" y2="26.17662" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true), _tmpl$19 = 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; }(), function () { var _el$4 = _tmpl$4.cloneNode(true); setAttribute(_el$4, "stroke", color); return _el$4; }()]; case "duotone": return [_tmpl$5.cloneNode(true), 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; }(), 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; }()]; case "fill": return _tmpl$10.cloneNode(true); case "light": return [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; }(), 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 "thin": return [function () { var _el$15 = _tmpl$15.cloneNode(true); setAttribute(_el$15, "stroke", color); return _el$15; }(), function () { var _el$16 = _tmpl$16.cloneNode(true); setAttribute(_el$16, "stroke", color); return _el$16; }(), 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; }()]; case "regular": return [function () { var _el$19 = _tmpl$6.cloneNode(true); setAttribute(_el$19, "stroke", color); return _el$19; }(), function () { var _el$20 = _tmpl$7.cloneNode(true); setAttribute(_el$20, "stroke", color); return _el$20; }(), function () { var _el$21 = _tmpl$8.cloneNode(true); setAttribute(_el$21, "stroke", color); return _el$21; }(), function () { var _el$22 = _tmpl$9.cloneNode(true); setAttribute(_el$22, "stroke", color); return _el$22; }()]; default: console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'); return null; } }; var Alarm = function Alarm(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$23 = _tmpl$19.cloneNode(true), _el$24 = _el$23.firstChild; var _ref$ = ref; typeof _ref$ === "function" ? _ref$(_el$23) : ref = _el$23; setAttribute(_el$23, "width", size != null ? size : contextSize); setAttribute(_el$23, "height", size != null ? size : contextSize); setAttribute(_el$23, "fill", color != null ? color : contextColor); setAttribute(_el$23, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined); spread(_el$23, restContext, true, true); spread(_el$23, restProps, true, true); insert(_el$23, children, _el$24); insert(_el$23, function () { return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor); }, null); return _el$23; }(); }; export default Alarm; //# sourceMappingURL=Alarm.esm.js.map