lucide-preact
Version:
A Lucide icon library package for Preact applications.
42 lines (38 loc) • 934 B
JavaScript
/**
* @license lucide-preact v1.25.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import { createContext, h } from 'preact';
import { useContext, useMemo } from 'preact/hooks';
const LucideContext = createContext({
size: 24,
color: "currentColor",
strokeWidth: 2,
absoluteStrokeWidth: false,
class: ""
});
function LucideProvider({
children,
size,
color,
strokeWidth,
absoluteStrokeWidth,
class: className
}) {
const value = useMemo(
() => ({
size,
color,
strokeWidth,
absoluteStrokeWidth,
class: className
}),
[size, color, strokeWidth, absoluteStrokeWidth, className]
);
return h(LucideContext.Provider, { value }, children);
}
const useLucideContext = () => useContext(LucideContext);
export { LucideProvider, useLucideContext };
//# sourceMappingURL=context.mjs.map