phosphor-solid
Version:
A clean and friendly icon family for Solid-js
149 lines (106 loc) • 6.65 kB
JavaScript
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><line x1="64" y1="192" x2="192" y2="64" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true),
_tmpl$2 = template(`<svg><polyline points="88 64 192 64 192 168" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$3 = template(`<svg><line x1="64" y1="192" x2="192" y2="64" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true),
_tmpl$4 = template(`<svg><polyline points="88 64 192 64 192 168" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$5 = template(`<svg><path d="M199.999,63.978q-.00145-.38379-.03906-.7666c-.01172-.12061-.03418-.2378-.05127-.35694-.02-.13965-.03613-.27929-.064-.41748-.02637-.13525-.06348-.26611-.09717-.39892-.03027-.12012-.05664-.24073-.09277-.35987-.03956-.13037-.0879-.25586-.13379-.3833-.04248-.11914-.08155-.23877-.13038-.356-.04882-.11767-.106-.23-.16015-.34472-.05762-.12256-.11182-.2461-.17627-.36572-.05762-.10791-.12354-.21-.186-.315-.0708-.11914-.13867-.24023-.2163-.35644-.07618-.11328-.16065-.22022-.24219-.3291-.07471-.1001-.144-.20264-.22412-.3003-.14893-.18115-.30762-.35449-.47168-.522-.02-.02051-.03711-.04248-.05713-.063-.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-.02051-.271-.04541-.40918-.05908-.20215-.01953-.40479-.02637-.60742-.03076C192.11768,56.00781,192.05957,56,192,56H88a8,8,0,0,0,0,16h84.686L58.34326,186.34277a8.00018,8.00018,0,0,0,11.31348,11.31446L184,83.314V168a8,8,0,0,0,16,0V64Z"></path></svg>`, 4, true),
_tmpl$6 = template(`<svg><line x1="64" y1="192" x2="192" y2="64" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true),
_tmpl$7 = template(`<svg><polyline points="88 64 192 64 192 168" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$8 = template(`<svg><line x1="64" y1="192" x2="192" y2="64" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true),
_tmpl$9 = template(`<svg><polyline points="88 64 192 64 192 168" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$10 = 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;
}()];
case "duotone":
return [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 "fill":
return _tmpl$5.cloneNode(true);
case "light":
return [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;
}()];
case "thin":
return [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 "regular":
return [function () {
var _el$10 = _tmpl$3.cloneNode(true);
setAttribute(_el$10, "stroke", color);
return _el$10;
}(), function () {
var _el$11 = _tmpl$4.cloneNode(true);
setAttribute(_el$11, "stroke", color);
return _el$11;
}()];
default:
console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".');
return null;
}
};
var ArrowUpRight = function ArrowUpRight(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$12 = _tmpl$10.cloneNode(true),
_el$13 = _el$12.firstChild;
var _ref$ = ref;
typeof _ref$ === "function" ? _ref$(_el$12) : ref = _el$12;
setAttribute(_el$12, "width", size != null ? size : contextSize);
setAttribute(_el$12, "height", size != null ? size : contextSize);
setAttribute(_el$12, "fill", color != null ? color : contextColor);
setAttribute(_el$12, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined);
spread(_el$12, restContext, true, true);
spread(_el$12, restProps, true, true);
insert(_el$12, children, _el$13);
insert(_el$12, function () {
return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor);
}, null);
return _el$12;
}();
};
export default ArrowUpRight;
//# sourceMappingURL=ArrowUpRight.esm.js.map