Files
nova-design-system/src/components/Icons/download/download.astro
T

27 lines
813 B
Plaintext
Raw Normal View History

2026-05-15 20:59:28 +02:00
---
import download16 from './svgs/download-16.svg?raw';
import download24 from './svgs/download-24.svg?raw';
import download32 from './svgs/download-32.svg?raw';
export interface Props {
size: 16 | 24 | 32;
label?: string;
class?: string;
}
const { size = 24, label, class: className } = Astro.props;
let raw: string;
if (size === 16) raw = download16;
else if (size === 24) raw = download24;
else if (size === 32) raw = download32;
else raw = '';
const classes = ['nds-icon-download', className].filter(Boolean).join(' ');
const svg = raw
.replace(/fill="#[A-Fa-f0-9]{3,8}"/g, 'fill="currentColor"')
.replace('<svg ', `<svg class="${classes}" aria-hidden="${label ? 'false' : 'true'}" ${label ? `aria-label="${label}" role="img"` : ''} `);
---
<Fragment set:html={svg} />