phosphor-solid
Version:
A clean and friendly icon family for Solid-js
353 lines (250 loc) • 18.9 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><polyline points="168 48 208 48 208 88" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$2 = template(`<svg><line x1="152" y1="104" x2="208" y2="48" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true),
_tmpl$3 = template(`<svg><polyline points="88 208 48 208 48 168" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$4 = template(`<svg><line x1="104" y1="152" x2="48" y2="208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true),
_tmpl$5 = template(`<svg><polyline points="208 168 208 208 168 208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$6 = template(`<svg><line x1="152" y1="152" x2="208" y2="208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true),
_tmpl$7 = template(`<svg><polyline points="48 88 48 48 88 48" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$8 = template(`<svg><line x1="104" y1="104" x2="48" y2="48" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></line></svg>`, 4, true),
_tmpl$9 = template(`<svg><polyline points="168 48 208 48 208 88" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$10 = template(`<svg><line x1="152" y1="104" x2="208" y2="48" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true),
_tmpl$11 = template(`<svg><polyline points="88 208 48 208 48 168" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$12 = template(`<svg><line x1="104" y1="152" x2="48" y2="208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true),
_tmpl$13 = template(`<svg><polyline points="208 168 208 208 168 208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$14 = template(`<svg><line x1="152" y1="152" x2="208" y2="208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true),
_tmpl$15 = template(`<svg><polyline points="48 88 48 48 88 48" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$16 = template(`<svg><line x1="104" y1="104" x2="48" y2="48" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>`, 4, true),
_tmpl$17 = template(`<svg><g><path d="M152,112a7.97619,7.97619,0,0,0,5.65723-2.34326L200,67.314V88a8,8,0,0,0,16,0V48.00488c0-.26562-.01367-.53174-.04-.79687-.01074-.10742-.03125-.21143-.0459-.31739-.021-.15234-.03955-.30517-.06933-.45654-.02539-.126-.06006-.248-.09082-.37207-.03223-.12939-.061-.25928-.09961-.38721-.03711-.12207-.083-.23925-.12549-.35839-.04541-.12745-.0874-.25586-.13965-.38086-.04541-.11035-.09912-.21582-.1499-.32325-.06055-.12939-.11817-.25976-.186-.38671-.0542-.10108-.1167-.19776-.17529-.29639-.07422-.12549-.14551-.252-.227-.374-.07178-.10694-.15186-.20752-.22852-.31055-.07861-.106-.15283-.21484-.23779-.31787-.13916-.16992-.28857-.33057-.44141-.48828-.02978-.03125-.05517-.06494-.08593-.09522-.02735-.02734-.05762-.05029-.085-.07715-.16114-.15625-.32618-.30908-.5-.45166-.09913-.081-.20313-.15234-.30518-.228-.10742-.08008-.2124-.16358-.32373-.2378-.11768-.0791-.23975-.14746-.36084-.21924-.103-.06152-.2041-.12646-.31006-.18359-.12158-.06494-.24609-.12012-.37012-.17822-.11328-.05322-.22461-.10987-.34082-.1582-.11865-.04883-.23974-.08838-.36035-.13184-.126-.04492-.25-.09326-.3789-.13233-.12012-.03662-.2417-.063-.36329-.09326-.13183-.0332-.26171-.07031-.396-.09668-.13965-.02783-.28076-.04443-.42139-.06445-.11719-.01709-.23291-.03906-.35205-.05078-.26269-.02588-.52588-.04-.78955-.04H168a8,8,0,0,0,0,16h20.686L146.34277,98.34326A8,8,0,0,0,152,112Z"></path><path d="M98.34277,146.34326,56,188.686V168a8,8,0,0,0-16,0v39.99512c0,.26562.01367.53174.04.79687.01074.10742.03125.21192.0459.31787.021.15235.03955.30518.06933.45606.02539.126.06006.248.09082.37207.03223.12939.061.25928.09961.38721.03711.12207.083.23974.12549.35888.04541.12744.0874.25537.13916.38037.0459.11035.09961.21582.15039.32325.06055.12939.11817.25976.186.38671.0542.10059.11572.19629.17383.29444.0747.126.14648.25342.229.37646.07129.106.15039.20606.22656.3086.0791.10644.15381.21582.23926.31933.13916.16992.28857.33057.44141.48828.02978.03125.05517.06494.08593.09522.02735.02734.05762.05029.085.07715.16114.15625.32618.30908.5.45166.1001.082.20557.15429.30909.231.106.07862.209.16114.31884.23438.11914.07959.24268.14892.36475.22168.10205.061.20215.125.30713.18164.12256.06543.249.12109.374.18018.11182.05224.22119.10839.33545.15576.12207.05029.2461.09131.37012.13525.12256.044.24365.09082.36865.12891.12354.03759.249.06494.374.09619.12842.03222.25538.06836.38624.09424.14208.02832.28564.04492.42871.06543.11572.0166.229.03857.3457.0498.26221.02588.52588.04.78955.04H88a8,8,0,0,0,0-16H67.314l42.34327-42.34326a8.00018,8.00018,0,0,0-11.31446-11.31348Z"></path><path d="M214.42383,212.75391c.07617-.10254.15527-.20264.22656-.3086.08252-.123.1543-.25049.229-.37646.05811-.09815.11963-.19385.17383-.29444.06787-.12695.12549-.25732.186-.38671.05078-.10743.10449-.2129.15039-.32325.05176-.125.09375-.25293.13916-.38037.04248-.11914.08838-.23681.12549-.35888.03857-.12793.06738-.25782.09961-.38721.03076-.124.06543-.2461.09082-.37207.02978-.15088.04834-.30371.06933-.45606.01465-.106.03516-.21045.0459-.31787.02637-.26513.04-.53125.04-.79687V168a8,8,0,0,0-16,0v20.686l-42.34277-42.34278a8.00018,8.00018,0,0,0-11.31446,11.31348L188.686,200H168a8,8,0,0,0,0,16h40c.26367,0,.52734-.01416.78955-.04.1167-.01123.23-.0332.3457-.0498.14307-.02051.28662-.03711.42871-.06543.13086-.02588.25782-.062.38624-.09424.125-.03125.25048-.0586.374-.09619.125-.03809.24609-.085.36865-.12891.124-.04394.24805-.085.37012-.13525.11426-.04737.22363-.10352.33545-.15576.125-.05909.25146-.11475.374-.18018.105-.05664.20508-.12061.30713-.18164.12207-.07276.24561-.14209.36475-.22168.10986-.07324.21289-.15576.31884-.23438.10352-.07666.209-.14892.30909-.231.17382-.14258.33886-.29541.5-.45166.02734-.02686.05761-.04981.085-.07715.03076-.03028.05615-.064.08593-.09522.15284-.15771.30225-.31836.44141-.48828C214.27,212.96973,214.34473,212.86035,214.42383,212.75391Z"></path><path d="M67.314,56H88a8,8,0,0,0,0-16H48c-.26367,0-.52686.01416-.78955.04-.11914.01172-.23486.03369-.352.05078-.14063.02-.28174.03662-.42139.06445-.13428.02637-.26416.06348-.396.09668-.12159.03028-.24317.05664-.36329.09326-.1289.03907-.25293.08741-.3789.13233-.12061.04346-.2417.083-.36035.13184-.11621.04833-.22754.105-.34082.1582-.124.0581-.24854.11328-.37012.17822-.106.05713-.207.12207-.31006.18359-.12109.07178-.24316.14014-.36084.21924-.11133.07422-.21631.15772-.32373.2378-.102.07568-.206.147-.30518.228-.17382.14258-.33886.29541-.5.45166-.02734.02686-.05761.04981-.085.07715-.03076.03028-.05615.064-.08593.09522-.15284.15771-.30225.31836-.44141.48828-.085.103-.15918.21191-.23779.31787-.07666.103-.15674.20361-.22852.31055-.08154.12207-.15283.24853-.227.374-.05859.09863-.12109.19531-.17529.29639-.06787.127-.12549.25732-.186.38671-.05078.10743-.10449.2129-.1499.32325-.05225.125-.09424.25341-.13965.38086-.04248.11914-.08838.23632-.12549.35839-.03857.12793-.06738.25782-.09961.38721-.03076.124-.06543.2461-.09082.37207-.02978.15137-.04834.3042-.06933.45654-.01465.106-.03516.21-.0459.31739-.02637.26513-.04.53125-.04.79687V88a8,8,0,0,0,16,0V67.314l42.34277,42.34278a8.00018,8.00018,0,0,0,11.31446-11.31348Z"></path></g></svg>`, 12, true),
_tmpl$18 = template(`<svg><polyline points="168 48 208 48 208 88" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$19 = template(`<svg><line x1="152" y1="104" x2="208" y2="48" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true),
_tmpl$20 = template(`<svg><polyline points="88 208 48 208 48 168" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$21 = template(`<svg><line x1="104" y1="152" x2="48" y2="208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true),
_tmpl$22 = template(`<svg><polyline points="208 168 208 208 168 208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$23 = template(`<svg><line x1="152" y1="152" x2="208" y2="208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true),
_tmpl$24 = template(`<svg><polyline points="48 88 48 48 88 48" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$25 = template(`<svg><line x1="104" y1="104" x2="48" y2="48" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></line></svg>`, 4, true),
_tmpl$26 = template(`<svg><polyline points="168 48 208 48 208 88" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$27 = template(`<svg><line x1="152" y1="104" x2="208" y2="48" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true),
_tmpl$28 = template(`<svg><polyline points="88 208 48 208 48 168" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$29 = template(`<svg><line x1="104" y1="152" x2="48" y2="208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true),
_tmpl$30 = template(`<svg><polyline points="208 168 208 208 168 208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$31 = template(`<svg><line x1="152" y1="152" x2="208" y2="208" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true),
_tmpl$32 = template(`<svg><polyline points="48 88 48 48 88 48" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$33 = template(`<svg><line x1="104" y1="104" x2="48" y2="48" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></line></svg>`, 4, true),
_tmpl$34 = 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;
}(), function () {
var _el$5 = _tmpl$5.cloneNode(true);
setAttribute(_el$5, "stroke", color);
return _el$5;
}(), 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;
}()];
case "duotone":
return [function () {
var _el$9 = _tmpl$9.cloneNode(true);
setAttribute(_el$9, "stroke", color);
return _el$9;
}(), function () {
var _el$10 = _tmpl$10.cloneNode(true);
setAttribute(_el$10, "stroke", color);
return _el$10;
}(), 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;
}(), 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;
}()];
case "fill":
return _tmpl$17.cloneNode(true);
case "light":
return [function () {
var _el$18 = _tmpl$18.cloneNode(true);
setAttribute(_el$18, "stroke", color);
return _el$18;
}(), function () {
var _el$19 = _tmpl$19.cloneNode(true);
setAttribute(_el$19, "stroke", color);
return _el$19;
}(), function () {
var _el$20 = _tmpl$20.cloneNode(true);
setAttribute(_el$20, "stroke", color);
return _el$20;
}(), function () {
var _el$21 = _tmpl$21.cloneNode(true);
setAttribute(_el$21, "stroke", color);
return _el$21;
}(), function () {
var _el$22 = _tmpl$22.cloneNode(true);
setAttribute(_el$22, "stroke", color);
return _el$22;
}(), function () {
var _el$23 = _tmpl$23.cloneNode(true);
setAttribute(_el$23, "stroke", color);
return _el$23;
}(), function () {
var _el$24 = _tmpl$24.cloneNode(true);
setAttribute(_el$24, "stroke", color);
return _el$24;
}(), function () {
var _el$25 = _tmpl$25.cloneNode(true);
setAttribute(_el$25, "stroke", color);
return _el$25;
}()];
case "thin":
return [function () {
var _el$26 = _tmpl$26.cloneNode(true);
setAttribute(_el$26, "stroke", color);
return _el$26;
}(), function () {
var _el$27 = _tmpl$27.cloneNode(true);
setAttribute(_el$27, "stroke", color);
return _el$27;
}(), function () {
var _el$28 = _tmpl$28.cloneNode(true);
setAttribute(_el$28, "stroke", color);
return _el$28;
}(), function () {
var _el$29 = _tmpl$29.cloneNode(true);
setAttribute(_el$29, "stroke", color);
return _el$29;
}(), function () {
var _el$30 = _tmpl$30.cloneNode(true);
setAttribute(_el$30, "stroke", color);
return _el$30;
}(), function () {
var _el$31 = _tmpl$31.cloneNode(true);
setAttribute(_el$31, "stroke", color);
return _el$31;
}(), function () {
var _el$32 = _tmpl$32.cloneNode(true);
setAttribute(_el$32, "stroke", color);
return _el$32;
}(), function () {
var _el$33 = _tmpl$33.cloneNode(true);
setAttribute(_el$33, "stroke", color);
return _el$33;
}()];
case "regular":
return [function () {
var _el$34 = _tmpl$9.cloneNode(true);
setAttribute(_el$34, "stroke", color);
return _el$34;
}(), function () {
var _el$35 = _tmpl$10.cloneNode(true);
setAttribute(_el$35, "stroke", color);
return _el$35;
}(), function () {
var _el$36 = _tmpl$11.cloneNode(true);
setAttribute(_el$36, "stroke", color);
return _el$36;
}(), function () {
var _el$37 = _tmpl$12.cloneNode(true);
setAttribute(_el$37, "stroke", color);
return _el$37;
}(), function () {
var _el$38 = _tmpl$13.cloneNode(true);
setAttribute(_el$38, "stroke", color);
return _el$38;
}(), function () {
var _el$39 = _tmpl$14.cloneNode(true);
setAttribute(_el$39, "stroke", color);
return _el$39;
}(), function () {
var _el$40 = _tmpl$15.cloneNode(true);
setAttribute(_el$40, "stroke", color);
return _el$40;
}(), function () {
var _el$41 = _tmpl$16.cloneNode(true);
setAttribute(_el$41, "stroke", color);
return _el$41;
}()];
default:
console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".');
return null;
}
};
var ArrowsOut = function ArrowsOut(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$42 = _tmpl$34.cloneNode(true),
_el$43 = _el$42.firstChild;
var _ref$ = ref;
typeof _ref$ === "function" ? _ref$(_el$42) : ref = _el$42;
setAttribute(_el$42, "width", size != null ? size : contextSize);
setAttribute(_el$42, "height", size != null ? size : contextSize);
setAttribute(_el$42, "fill", color != null ? color : contextColor);
setAttribute(_el$42, "transform", mirrored || contextMirrored ? "scale(-1, 1)" : undefined);
spread(_el$42, restContext, true, true);
spread(_el$42, restProps, true, true);
insert(_el$42, children, _el$43);
insert(_el$42, function () {
return renderPathFor(weight != null ? weight : contextWeight, color != null ? color : contextColor);
}, null);
return _el$42;
}();
};
export default ArrowsOut;
//# sourceMappingURL=ArrowsOut.esm.js.map