2023-10-25 09:48:25 -04:00
|
|
|
<script lang="ts">
|
|
|
|
|
import type { AriaRole } from 'svelte/elements';
|
|
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
interface Props {
|
|
|
|
|
size?: string | number;
|
|
|
|
|
color?: string;
|
|
|
|
|
path: string;
|
|
|
|
|
title?: string | null;
|
|
|
|
|
desc?: string;
|
|
|
|
|
flipped?: boolean;
|
|
|
|
|
class?: string;
|
|
|
|
|
viewBox?: string;
|
|
|
|
|
role?: AriaRole;
|
|
|
|
|
ariaHidden?: boolean | undefined;
|
|
|
|
|
ariaLabel?: string | undefined;
|
|
|
|
|
ariaLabelledby?: string | undefined;
|
|
|
|
|
strokeWidth?: number;
|
|
|
|
|
strokeColor?: string;
|
|
|
|
|
spin?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let {
|
|
|
|
|
size = '1em',
|
|
|
|
|
color = 'currentColor',
|
|
|
|
|
path,
|
|
|
|
|
title = null,
|
|
|
|
|
desc = '',
|
|
|
|
|
flipped = false,
|
|
|
|
|
class: className = '',
|
|
|
|
|
viewBox = '0 0 24 24',
|
|
|
|
|
role = 'img',
|
|
|
|
|
ariaHidden = undefined,
|
|
|
|
|
ariaLabel = undefined,
|
|
|
|
|
ariaLabelledby = undefined,
|
|
|
|
|
strokeWidth = 0,
|
|
|
|
|
strokeColor = 'currentColor',
|
|
|
|
|
spin = false,
|
|
|
|
|
}: Props = $props();
|
2023-10-25 09:48:25 -04:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<svg
|
|
|
|
|
width={size}
|
|
|
|
|
height={size}
|
|
|
|
|
{viewBox}
|
2024-09-04 23:38:55 -04:00
|
|
|
class="{className} {flipped ? '-scale-x-100' : ''} {spin ? 'animate-spin' : ''}"
|
2023-10-25 09:48:25 -04:00
|
|
|
{role}
|
2024-08-09 19:45:52 +02:00
|
|
|
stroke={strokeColor}
|
|
|
|
|
stroke-width={strokeWidth}
|
2023-10-25 09:48:25 -04:00
|
|
|
aria-label={ariaLabel}
|
|
|
|
|
aria-hidden={ariaHidden}
|
|
|
|
|
aria-labelledby={ariaLabelledby}
|
|
|
|
|
>
|
|
|
|
|
{#if title}
|
|
|
|
|
<title>{title}</title>
|
|
|
|
|
{/if}
|
|
|
|
|
{#if desc}
|
|
|
|
|
<desc>{desc}</desc>
|
|
|
|
|
{/if}
|
|
|
|
|
<path d={path} fill={color} />
|
|
|
|
|
</svg>
|