2025-10-16 17:57:23 +02:00
|
|
|
import { createContext, splitProps, type JSXElement } from 'solid-js';
|
2025-06-18 20:21:58 +02:00
|
|
|
|
|
|
|
|
export const LucideContext = createContext<{
|
|
|
|
|
size?: number;
|
|
|
|
|
color?: string;
|
|
|
|
|
strokeWidth?: number;
|
|
|
|
|
absoluteStrokeWidth?: boolean;
|
2025-12-12 10:29:24 +01:00
|
|
|
class?: string;
|
2025-06-18 20:21:58 +02:00
|
|
|
}>({
|
|
|
|
|
size: 24,
|
|
|
|
|
color: 'currentColor',
|
|
|
|
|
strokeWidth: 2,
|
2025-07-04 11:17:34 +02:00
|
|
|
absoluteStrokeWidth: false,
|
2025-12-12 10:29:24 +01:00
|
|
|
class: '',
|
2025-06-18 20:21:58 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
interface LucideProviderProps {
|
|
|
|
|
children: JSXElement;
|
2025-10-16 17:57:23 +02:00
|
|
|
size?: number;
|
2025-06-18 20:21:58 +02:00
|
|
|
color?: string;
|
|
|
|
|
strokeWidth?: number;
|
|
|
|
|
absoluteStrokeWidth?: boolean;
|
2025-12-12 10:29:24 +01:00
|
|
|
class?: string;
|
2025-06-18 20:21:58 +02:00
|
|
|
}
|
|
|
|
|
|
2025-07-04 11:17:34 +02:00
|
|
|
export function LucideProvider(props: LucideProviderProps) {
|
2025-12-12 10:55:29 +01:00
|
|
|
const [value, rest] = splitProps(props, [
|
|
|
|
|
'size',
|
|
|
|
|
'color',
|
|
|
|
|
'strokeWidth',
|
|
|
|
|
'absoluteStrokeWidth',
|
|
|
|
|
'class',
|
|
|
|
|
]);
|
2025-07-04 11:17:34 +02:00
|
|
|
|
2025-10-16 17:57:23 +02:00
|
|
|
return <LucideContext.Provider value={value}>{rest.children}</LucideContext.Provider>;
|
2025-06-18 20:21:58 +02:00
|
|
|
}
|