UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

116 lines (83 loc) 5.54 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="M209.53911,80.402,175.88745,112l32,88-24,24-47.80786-69.97929L111.88745,176v24l-24,24L73.695,182.14581,31.88745,168l24-24h24l24-24-72-48,24-24,88,32L175.598,46.46089l-.68109.56855A24,24,0,1,1,208.858,80.97056Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true), _tmpl$2 = template(`<svg><path d="M209.53911,80.402,175.88745,112l32,88-24,24-47.80786-69.97929L111.88745,176v24l-24,24L73.695,182.14581,31.88745,168l24-24h24l24-24-72-48,24-24,88,32L175.598,46.46089l-.68109.56855A24,24,0,1,1,208.858,80.97056Z" opacity="0.2"></path></svg>`, 4, true), _tmpl$3 = template(`<svg><path d="M209.53911,80.402,175.88745,112l32,88-24,24-47.80786-69.97929L111.88745,176v24l-24,24L73.695,182.14581,31.88745,168l24-24h24l24-24-72-48,24-24,88,32L175.598,46.46089l-.68109.56855A24,24,0,1,1,208.858,80.97056Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true), _tmpl$4 = template(`<svg><path d="M215.01538,86.23437l-29.80762,27.98829,30.19824,83.043a8.00184,8.00184,0,0,1-1.86181,8.39161l-24,24A7.99924,7.99924,0,0,1,177.282,228.5127l-42.58691-62.33692-18.80762,17.33106V204a8.0008,8.0008,0,0,1-2.34326,5.65723l-20,20a7.99986,7.99986,0,0,1-13.23291-3.08789L67.38745,188.457l-38.064-12.87891a8.00081,8.00081,0,0,1-3.09326-13.23535l20-20A8.00235,8.00235,0,0,1,51.88745,140H72.574l18.75635-18.75684L27.45,78.65625a8.00073,8.00073,0,0,1-1.21973-12.31348l24-24a8.003,8.003,0,0,1,8.39111-1.86132l83.0625,30.20507,26.606-28.14062a7.98306,7.98306,0,0,1,.97071-1.17383,32.0006,32.0006,0,0,1,47.01806,43.34375A8.03536,8.03536,0,0,1,215.01538,86.23437Z"></path></svg>`, 4, true), _tmpl$5 = template(`<svg><path d="M209.53911,80.402,175.88745,112l32,88-24,24-47.80786-69.97929L111.88745,176v24l-24,24L73.695,182.14581,31.88745,168l24-24h24l24-24-72-48,24-24,88,32L175.598,46.46089l-.68109.56855A24,24,0,1,1,208.858,80.97056Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true), _tmpl$6 = template(`<svg><path d="M209.53911,80.402,175.88745,112l32,88-24,24-47.80786-69.97929L111.88745,176v24l-24,24L73.695,182.14581,31.88745,168l24-24h24l24-24-72-48,24-24,88,32L175.598,46.46089l-.68109.56855A24,24,0,1,1,208.858,80.97056Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true), _tmpl$7 = 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$; }(); case "duotone": return [_tmpl$2.cloneNode(true), function () { var _el$3 = _tmpl$3.cloneNode(true); setAttribute(_el$3, "stroke", color); return _el$3; }()]; case "fill": return _tmpl$4.cloneNode(true); case "light": return function () { var _el$5 = _tmpl$5.cloneNode(true); setAttribute(_el$5, "stroke", color); return _el$5; }(); case "thin": return function () { var _el$6 = _tmpl$6.cloneNode(true); setAttribute(_el$6, "stroke", color); return _el$6; }(); case "regular": return function () { var _el$7 = _tmpl$3.cloneNode(true); setAttribute(_el$7, "stroke", color); return _el$7; }(); default: console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'); return null; } }; var AirplaneTilt = function AirplaneTilt(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$8 = _tmpl$7.cloneNode(true), _el$9 = _el$8.firstChild; var _ref$ = ref; typeof _ref$ === "function" ? _ref$(_el$8) : ref = _el$8; setAttribute(_el$8, "width", size != null ? size : contextSize); setAttribute(_el$8, "height", size != null ? size : contextSize); setAttribute(_el$8, "fill", color != null ? color : contextColor); setAttribute(_el$8, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined); spread(_el$8, restContext, true, true); spread(_el$8, restProps, true, true); insert(_el$8, children, _el$9); insert(_el$8, function () { return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor); }, null); return _el$8; }(); }; export default AirplaneTilt; //# sourceMappingURL=AirplaneTilt.esm.js.map