joyent-portal/packages/icons/src/loading.js

77 lines
1.7 KiB
JavaScript
Raw Normal View History

import React from 'react';
2017-11-23 14:18:38 +02:00
import rndId from 'rnd-id';
import Rotate from './rotate';
import calcFill from './fill';
const ids = [rndId()];
2017-11-23 14:18:38 +02:00
export default ({
fill = null,
light = false,
secondary = false,
disabled = false,
direction = 'down',
2018-01-17 21:10:39 +02:00
colors = {},
2017-11-23 14:18:38 +02:00
style = {},
...rest
}) => (
2018-01-17 21:10:39 +02:00
<Rotate direction={direction}>
{({ style: rotateStyle }) => (
<svg
width="24"
height="6"
viewBox="0 0 24 6"
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
style={{ ...style, ...rotateStyle }}
{...rest}
>
<use
xlinkHref={`#${ids[0]}`}
fill={calcFill({
fill,
disabled,
light,
colors: {
...colors,
text: secondary ? colors.text : colors.primary
}
})}
/>
<use
xlinkHref={`#${ids[0]}`}
transform="translate(9)"
opacity=".5"
fill={calcFill({
fill,
disabled,
light,
colors: {
...colors,
text: secondary ? colors.text : colors.primary
}
})}
/>
<use
xlinkHref={`#${ids[0]}`}
transform="translate(18)"
opacity=".25"
fill={calcFill({
fill,
disabled,
light,
colors: {
...colors,
text: secondary ? colors.text : colors.primary
}
})}
/>
<defs>
<path id={ids[0]} fillRule="evenodd" d="M0 0h6v6H0V0z" />
</defs>
</svg>
)}
2018-01-17 21:10:39 +02:00
</Rotate>
);