UNPKG

phosphor-solid

Version:

A clean and friendly icon family for Solid-js

188 lines (135 loc) 9.21 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="M172,128h52a8,8,0,0,1,8,8v64a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V136a8,8,0,0,1,8-8H84" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true), _tmpl$2 = template(`<svg><line x1="128" y1="128" x2="128" y2="24" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true), _tmpl$3 = template(`<svg><polyline points="80 72 128 24 176 72" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true), _tmpl$4 = template(`<svg><circle cx="188" cy="168" r="16"></circle></svg>`, 4, true), _tmpl$5 = template(`<svg><rect x="24" y="128" width="208" height="80" rx="8" opacity="0.2"></rect></svg>`, 4, true), _tmpl$6 = template(`<svg><path d="M176,128h48a8,8,0,0,1,8,8v64a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V136a8,8,0,0,1,8-8H80" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true), _tmpl$7 = template(`<svg><line x1="128" y1="128" x2="128" y2="24" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true), _tmpl$8 = template(`<svg><polyline points="80 72 128 24 176 72" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true), _tmpl$9 = template(`<svg><circle cx="188" cy="168" r="12"></circle></svg>`, 4, true), _tmpl$10 = template(`<svg><g><path d="M85.65674,77.65723,120,43.31348V128a8,8,0,0,0,16,0V43.31348l34.34326,34.34375a8.00018,8.00018,0,0,0,11.31348-11.31446l-48-48c-.023-.02246-.04785-.0415-.0708-.064-.165-.16113-.33545-.31787-.51416-.46485-.09619-.07861-.19776-.14746-.29639-.22119-.11035-.08252-.21826-.168-.333-.24511-.11377-.07618-.23242-.14209-.34912-.21192-.10742-.06445-.2124-.13183-.32324-.19092-.11572-.062-.23535-.11425-.35352-.17041-.11865-.05615-.23584-.11523-.35742-.166-.11181-.0459-.22558-.083-.33887-.12354-.1333-.04834-.26513-.09961-.40185-.14062-.10889-.0332-.21973-.05664-.33008-.085-.14258-.03662-.28369-.07617-.42969-.105-.12109-.02393-.24365-.0376-.36523-.05567-.13623-.0205-.271-.04541-.40918-.05908-.20215-.01953-.40479-.02637-.60742-.03076C128.11768,16.00781,128.05957,16,128,16s-.11768.00781-.17676.00879c-.20263.00439-.40527.01123-.60742.03076-.13818.01367-.27295.03858-.40918.05908-.12158.01807-.24414.03174-.36523.05567-.146.02881-.28711.06836-.42969.105-.11035.02832-.22119.05176-.33008.085-.13672.041-.26855.09228-.40185.14062-.11329.04053-.22706.07764-.33887.12354-.12158.05078-.23877.10986-.35742.166-.11817.05616-.2378.1084-.35352.17041-.11084.05909-.21582.12647-.32324.19092-.1167.06983-.23535.13574-.34912.21192-.11475.07714-.22266.16259-.333.24511-.09863.07373-.2002.14258-.29639.22119-.17578.14454-.34277.29834-.50537.457-.02588.0249-.0542.04638-.07959.07177l-48,48A8.00018,8.00018,0,0,0,85.65674,77.65723Z"></path><path d="M224,120H152v8a24,24,0,0,1-48,0v-8H32a16.01833,16.01833,0,0,0-16,16v64a16.01833,16.01833,0,0,0,16,16H224a16.01833,16.01833,0,0,0,16-16V136A16.01833,16.01833,0,0,0,224,120Zm-35.99951,60a12,12,0,1,1,12-12A12,12,0,0,1,188.00049,180Z"></path></g></svg>`, 8, true), _tmpl$11 = template(`<svg><path d="M176,128h48a8,8,0,0,1,8,8v64a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V136a8,8,0,0,1,8-8H80" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true), _tmpl$12 = template(`<svg><line x1="128" y1="128" x2="128" y2="24" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true), _tmpl$13 = template(`<svg><polyline points="80 72 128 24 176 72" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true), _tmpl$14 = template(`<svg><circle cx="188" cy="168" r="10"></circle></svg>`, 4, true), _tmpl$15 = template(`<svg><path d="M176,128h48a8,8,0,0,1,8,8v64a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V136a8,8,0,0,1,8-8H80" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></svg>`, 4, true), _tmpl$16 = template(`<svg><line x1="128" y1="128" x2="128" y2="24" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true), _tmpl$17 = template(`<svg><polyline points="80 72 128 24 176 72" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true), _tmpl$18 = template(`<svg><circle cx="188" cy="168" r="8"></circle></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; }(), _tmpl$4.cloneNode(true)]; 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; }(), _tmpl$9.cloneNode(true)]; 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; }(), _tmpl$14.cloneNode(true)]; 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; }(), _tmpl$18.cloneNode(true)]; 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; }(), _tmpl$9.cloneNode(true)]; default: console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'); return null; } }; var Upload = function Upload(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 Upload; //# sourceMappingURL=Upload.esm.js.map