2024-01-07 15:59:19 +01:00
|
|
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
|
|
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
2024-01-29 13:48:14 -05:00
|
|
|
import { getJSBanner } from './license.mjs';
|
2024-01-07 15:59:19 +01:00
|
|
|
|
2024-05-22 13:08:34 +02:00
|
|
|
export default ({ iconName, children, componentName, getSvg, deprecated, deprecationReason }) => {
|
2024-01-07 15:59:19 +01:00
|
|
|
const svgContents = getSvg();
|
|
|
|
|
const svgBase64 = base64SVG(svgContents);
|
|
|
|
|
|
|
|
|
|
return `\
|
2022-12-04 22:38:56 +01:00
|
|
|
<script lang="ts">
|
2024-01-29 13:48:14 -05:00
|
|
|
${getJSBanner()}
|
2022-02-17 17:46:55 +01:00
|
|
|
import Icon from '../Icon.svelte';
|
2023-12-24 06:45:57 -05:00
|
|
|
import type { IconNode, IconProps } from '../types.js';
|
|
|
|
|
|
|
|
|
|
type $$Props = IconProps;
|
2022-12-04 22:38:56 +01:00
|
|
|
|
|
|
|
|
const iconNode: IconNode = ${JSON.stringify(children)};
|
2024-01-07 15:59:19 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @component @name ${componentName}
|
|
|
|
|
* @description Lucide SVG icon component, renders SVG Element with children.
|
|
|
|
|
*
|
|
|
|
|
* @preview  - https://lucide.dev/icons/${iconName}
|
|
|
|
|
* @see https://lucide.dev/guide/packages/lucide-svelte - Documentation
|
|
|
|
|
*
|
|
|
|
|
* @param {Object} props - Lucide icons props and any valid SVG attribute
|
2024-01-25 08:23:34 +01:00
|
|
|
* @returns {FunctionalComponent} Svelte component
|
2024-05-22 13:08:34 +02:00
|
|
|
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
|
2024-01-07 15:59:19 +01:00
|
|
|
*/
|
2022-02-17 17:46:55 +01:00
|
|
|
</script>
|
|
|
|
|
|
2022-12-04 22:38:56 +01:00
|
|
|
<Icon name="${iconName}" {...$$props} iconNode={iconNode}>
|
2022-02-17 17:46:55 +01:00
|
|
|
<slot/>
|
|
|
|
|
</Icon>
|
|
|
|
|
`;
|
2024-01-07 15:59:19 +01:00
|
|
|
};
|