phosphor-solid
Version:
A clean and friendly icon family for Solid-js
149 lines (106 loc) • 6.93 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="176.167 99.716 224.167 99.716 224.167 51.716" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></polyline></svg>`, 4, true),
_tmpl$2 = template(`<svg><path d="M190.2254,190.2254a88,88,0,1,1,0-124.4508l33.94112,33.94113" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"></path></svg>`, 4, true),
_tmpl$3 = template(`<svg><polyline points="176.167 99.716 224.167 99.716 224.167 51.716" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>`, 4, true),
_tmpl$4 = template(`<svg><path d="M190.2254,190.2254a88,88,0,1,1,0-124.4508l33.94112,33.94113" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path></svg>`, 4, true),
_tmpl$5 = template(`<svg><path d="M225.33447,107.62115c.13135-.01928.26319-.03424.39356-.06005.14038-.02777.27661-.0661.4143-.10114.115-.02923.23072-.05426.34449-.08862.13427-.04059.26367-.0907.39477-.13806.11524-.04151.2312-.07929.345-.12629.12085-.05011.23682-.10876.35449-.16455.11915-.05621.23926-.10907.356-.17144.11133-.0597.21729-.12757.32544-.1922.116-.06928.2334-.13483.34644-.21051.11718-.07831.22729-.16553.33984-.24976.09644-.07227.19556-.1394.28955-.21655.18628-.1529.36426-.31531.53589-.48413.01611-.01593.03394-.02918.05-.04529.02051-.02051.0376-.04321.05762-.06391.16357-.16711.32177-.33941.47045-.52032.08277-.10059.15479-.20648.23194-.31006.07861-.10571.1604-.20862.23389-.3183.08081-.12072.15112-.24591.22485-.36993.05932-.1.12231-.19757.17749-.30035.06738-.12592.12475-.25531.18481-.384.05078-.1084.10523-.21466.15137-.32568.05151-.12463.09326-.25189.13843-.37848.04272-.11987.08911-.238.12622-.36047.03857-.12775.06714-.25757.09936-.38678.03077-.124.06568-.24622.09082-.37244.03-.15088.04834-.30328.06958-.45544.01465-.10645.03541-.21094.0459-.31867a7.97366,7.97366,0,0,0,.04-.79706V51.71582a8,8,0,0,0-16,0v28.686L195.88281,60.11768a95.9551,95.9551,0,1,0,0,135.76464,8.00018,8.00018,0,1,0-11.31445-11.31347,80.00009,80.00009,0,1,1,0-113.1377L204.853,91.71582H176.167a8,8,0,0,0,0,16h48c.02979,0,.0586-.00415.08838-.00446.23316-.00256.46631-.01245.69824-.03527C225.08252,107.66351,225.20752,107.63977,225.33447,107.62115Z"></path></svg>`, 4, true),
_tmpl$6 = template(`<svg><polyline points="176.167 99.716 224.167 99.716 224.167 51.716" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></polyline></svg>`, 4, true),
_tmpl$7 = template(`<svg><path d="M190.2254,190.2254a88,88,0,1,1,0-124.4508l33.94112,33.94113" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="12"></path></svg>`, 4, true),
_tmpl$8 = template(`<svg><polyline points="176.167 99.716 224.167 99.716 224.167 51.716" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></polyline></svg>`, 4, true),
_tmpl$9 = template(`<svg><path d="M190.2254,190.2254a88,88,0,1,1,0-124.4508l33.94112,33.94113" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"></path></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 ArrowClockwise = function ArrowClockwise(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 ArrowClockwise;
//# sourceMappingURL=ArrowClockwise.esm.js.map