phosphor-solid
Version:
A clean and friendly icon family for Solid-js
69 lines (68 loc) • 4.77 kB
JSX
/* GENERATED FILE */
import { useContext } from "solid-js";
import { IconContext } from "../lib";
const renderPathFor = (weight, color) => {
switch (weight) {
case "bold":
return (<>
<rect x="48" y="48" width="60" height="60" stroke-width="24" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="148" y="48" width="60" height="60" stroke-width="24" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="48" y="148" width="60" height="60" stroke-width="24" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="148" y="148" width="60" height="60" stroke-width="24" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
</>);
case "duotone":
return (<>
<rect x="48" y="48" width="64" height="64" opacity="0.2"/>
<rect x="144" y="48" width="64" height="64" opacity="0.2"/>
<rect x="48" y="144" width="64" height="64" opacity="0.2"/>
<rect x="144" y="144" width="64" height="64" opacity="0.2"/>
<rect x="144" y="144" width="64" height="64" stroke-width="16" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="48" y="48" width="64" height="64" stroke-width="16" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="144" y="48" width="64" height="64" stroke-width="16" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="48" y="144" width="64" height="64" stroke-width="16" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
</>);
case "fill":
return (<>
<g>
<rect x="40" y="40" width="80" height="80" rx="8"/>
<rect x="136" y="40" width="80" height="80" rx="8"/>
<rect x="40" y="136" width="80" height="80" rx="8"/>
<rect x="136" y="136" width="80" height="80" rx="8"/>
</g>
</>);
case "light":
return (<>
<rect x="48" y="48" width="64" height="64" stroke-width="12" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="144" y="48" width="64" height="64" stroke-width="12" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="48" y="144" width="64" height="64" stroke-width="12" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="144" y="144" width="64" height="64" stroke-width="12" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
</>);
case "thin":
return (<>
<rect x="48" y="48" width="64" height="64" stroke-width="8" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="144" y="48" width="64" height="64" stroke-width="8" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="48" y="144" width="64" height="64" stroke-width="8" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="144" y="144" width="64" height="64" stroke-width="8" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
</>);
case "regular":
return (<>
<rect x="48" y="48" width="64" height="64" stroke-width="16" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="144" y="48" width="64" height="64" stroke-width="16" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="48" y="144" width="64" height="64" stroke-width="16" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
<rect x="144" y="144" width="64" height="64" stroke-width="16" stroke={color} stroke-linecap="round" stroke-linejoin="round" fill="none"/>
</>);
default:
console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".');
return null;
}
};
const SquaresFour = (props, ref) => {
const { color, size, weight, mirrored, children, ...restProps } = props;
const { color: contextColor, size: contextSize, weight: contextWeight, mirrored: contextMirrored, ...restContext } = useContext(IconContext);
return (<svg ref={ref} xmlns="http://www.w3.org/2000/svg" width={size ?? contextSize} height={size ?? contextSize} fill={color ?? contextColor} viewBox="0 0 256 256" transform={mirrored || contextMirrored ? "scale(-1, 1)" : undefined} {...restContext} {...restProps}>
{children}
<rect width="256" height="256" fill="none"/>
{renderPathFor(weight ?? contextWeight, color ?? contextColor)}
</svg>);
};
export default SquaresFour;