UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

218 lines (155 loc) 11.5 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="224 56 128 144 32 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true), _tmpl$2 = template(`<svg><path d="M32,56H224a0,0,0,0,1,0,0V192a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56A0,0,0,0,1,32,56Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true), _tmpl$3 = template(`<svg><line x1="110.54541" y1="128.00013" x2="34.4668" y2="197.73926" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true), _tmpl$4 = template(`<svg><line x1="221.53418" y1="197.73926" x2="145.45424" y2="127.99964" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true), _tmpl$5 = template(`<svg><polygon points="224.006 56 128.006 144 32.006 56 224.006 56" opacity="0.2"></polygon></svg>`, 4, true), _tmpl$6 = template(`<svg><polyline points="224 56 128 144 32 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true), _tmpl$7 = template(`<svg><path d="M32,56H224a0,0,0,0,1,0,0V192a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56A0,0,0,0,1,32,56Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true), _tmpl$8 = template(`<svg><line x1="110.54541" y1="128.00013" x2="34.4668" y2="197.73926" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true), _tmpl$9 = template(`<svg><line x1="221.53418" y1="197.73926" x2="145.45424" y2="127.99964" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true), _tmpl$10 = template(`<svg><path d="M231.99023,55.80933q-.00511-.22192-.02246-.44312-.01391-.18054-.03564-.35864c-.01709-.13819-.03858-.27564-.063-.41309-.022-.124-.0459-.24707-.07324-.36889-.02979-.13038-.064-.25953-.1001-.38843-.03467-.12329-.07031-.24536-.11035-.366-.042-.126-.08887-.25-.13721-.374-.0459-.11865-.09326-.23609-.14453-.35156-.05469-.12207-.11377-.24195-.17432-.36158-.05761-.11352-.11669-.22583-.17919-.33618-.06543-.114-.13428-.22607-.20508-.33765-.07178-.11254-.14551-.2229-.22266-.33154-.07226-.10229-.148-.20263-.22558-.30224-.0879-.11206-.17872-.221-.272-.32813-.04394-.05054-.082-.10425-.12744-.154-.03857-.042-.08105-.07764-.1206-.11865-.0962-.10108-.19629-.198-.29786-.29395-.09423-.08887-.189-.177-.28662-.26074-.09619-.082-.19531-.15967-.29541-.23731-.10937-.085-.21826-.16919-.33105-.24755-.09766-.06812-.19873-.13135-.29932-.19507-.11914-.0752-.23779-.15015-.35986-.21851-.10645-.05957-.21582-.11352-.32471-.16821-.1206-.0603-.24023-.1211-.36328-.175-.11963-.05274-.24219-.09863-.36475-.14551-.11767-.04492-.23486-.09057-.354-.12964-.12939-.04272-.26172-.07837-.39355-.1145-.11866-.03223-.23633-.0647-.35547-.09131-.13184-.02954-.26563-.05273-.39991-.07568-.12646-.02149-.25293-.04248-.38037-.05786-.12646-.01538-.2539-.02564-.38232-.03491-.13965-.01026-.2793-.01832-.41943-.02125C224.1123,48.00732,224.05713,48,224,48H32c-.05371,0-.10547.00708-.15918.00806-.14746.00293-.29492.01123-.44189.02221-.12159.00928-.24219.0188-.36182.03321-.13428.01611-.26758.03808-.40137.06128-.12744.022-.25488.0437-.37988.07177-.126.02808-.25.06226-.375.09644-.126.03467-.25195.0686-.37549.10913-.125.041-.248.08862-.37158.136-.1167.04492-.23389.08886-.34815.13891-.12744.05591-.252.1189-.377.18189-.105.05273-.21.10424-.312.16137-.125.07007-.24707.147-.36914.22437-.09766.062-.19629.12353-.291.1897-.11474.07959-.22558.165-.33642.25146-.09864.07642-.19629.15308-.291.23413-.09863.08423-.19385.17285-.28955.26294-.10107.09522-.20019.1919-.29639.29224-.03906.04126-.082.07715-.1206.11914-.04541.0498-.0835.10351-.12744.154-.09326.10718-.18408.21607-.272.32813-.07763.09961-.15332.2-.22558.30224-.07715.10864-.15088.219-.22266.33154-.0708.11158-.13965.22364-.20508.33765-.0625.11035-.12158.22266-.17919.33618-.06055.11963-.11963.23951-.17432.36158-.05127.11547-.09863.23291-.14453.35156-.04834.124-.09522.248-.13721.374-.04.12061-.07568.24268-.11035.366-.03613.1289-.07031.25805-.1001.38843-.02734.12182-.05127.24487-.07324.36889-.02441.13745-.0459.2749-.063.41309q-.022.17834-.03564.35864-.01758.22156-.02246.44312C24.0083,55.87329,24,55.93555,24,56V192a16.01833,16.01833,0,0,0,16,16H216a16.01833,16.01833,0,0,0,16-16V56C232,55.93555,231.9917,55.87329,231.99023,55.80933ZM40,74.18628l58.70605,53.814L40,181.814ZM52.56738,192l57.97852-53.14673,12.04785,11.04395a8.00113,8.00113,0,0,0,10.8125,0L145.45459,138.853,203.43311,192ZM157.294,128l58.70751-53.81519.00782,107.63672Z"></path></svg>`, 4, true), _tmpl$11 = template(`<svg><polyline points="224 56 128 144 32 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true), _tmpl$12 = template(`<svg><path d="M32,56H224a0,0,0,0,1,0,0V192a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56A0,0,0,0,1,32,56Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true), _tmpl$13 = template(`<svg><line x1="110.54541" y1="128.00013" x2="34.4668" y2="197.73926" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true), _tmpl$14 = template(`<svg><line x1="221.53418" y1="197.73926" x2="145.45424" y2="127.99964" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true), _tmpl$15 = template(`<svg><polyline points="224 56 128 144 32 56" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true), _tmpl$16 = template(`<svg><path d="M32,56H224a0,0,0,0,1,0,0V192a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56A0,0,0,0,1,32,56Z" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true), _tmpl$17 = template(`<svg><line x1="110.54541" y1="128.00013" x2="34.4668" y2="197.73926" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true), _tmpl$18 = template(`<svg><line x1="221.53418" y1="197.73926" x2="145.45424" y2="127.99964" 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 Envelope = function Envelope(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 Envelope; //# sourceMappingURL=Envelope.esm.js.map