2025-03-31 14:20:33 +00:00
|
|
|
---
|
2026-09-04 16:38:01 +02:00
|
|
|
import buildLucideIconNode from './utils/buildLucideIconNode';
|
2025-03-31 14:20:33 +00:00
|
|
|
import type { IconProps as Props } from './types';
|
2026-01-20 15:55:02 +01:00
|
|
|
import { hasA11yProp } from './utils/hasA11yProp';
|
|
|
|
|
|
2025-03-31 14:20:33 +00:00
|
|
|
const {
|
|
|
|
|
color = 'currentColor',
|
|
|
|
|
size = 24,
|
2026-09-04 16:38:01 +02:00
|
|
|
width,
|
|
|
|
|
height,
|
2025-03-31 14:20:33 +00:00
|
|
|
'stroke-width': strokeWidth = 2,
|
|
|
|
|
absoluteStrokeWidth = false,
|
2026-09-04 16:38:01 +02:00
|
|
|
nonScalingStroke = false,
|
|
|
|
|
iconNode,
|
|
|
|
|
icon = {
|
|
|
|
|
node: iconNode,
|
|
|
|
|
aliases: [],
|
|
|
|
|
size: 24,
|
|
|
|
|
},
|
2025-03-31 14:20:33 +00:00
|
|
|
class: className,
|
|
|
|
|
...rest
|
|
|
|
|
} = Astro.props;
|
2026-09-04 16:38:01 +02:00
|
|
|
|
|
|
|
|
const [, builtIconAttributes, builtIconNode = []] = buildLucideIconNode(icon, {
|
|
|
|
|
color,
|
|
|
|
|
width: width ?? size,
|
|
|
|
|
height: height ?? size,
|
|
|
|
|
strokeWidth,
|
|
|
|
|
absoluteStrokeWidth,
|
|
|
|
|
nonScalingStroke,
|
|
|
|
|
className,
|
|
|
|
|
hasA11yProp: hasA11yProp(rest),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const iconAttributes = {
|
|
|
|
|
...builtIconAttributes,
|
|
|
|
|
...rest,
|
|
|
|
|
};
|
2025-03-31 14:20:33 +00:00
|
|
|
---
|
|
|
|
|
|
2026-09-04 16:38:01 +02:00
|
|
|
<svg {...iconAttributes}>
|
|
|
|
|
{builtIconNode.map(([Tag, attrs]) => <Tag {...attrs} />)}
|
2025-03-31 14:20:33 +00:00
|
|
|
<slot />
|
|
|
|
|
</svg>
|