import dynamicIconImports from "lucide-react/dynamicIconImports"; import { flagIconImports } from "../flag/dynamic-imports.js"; import { socialMediaIconImports } from "../social-media/dynamic-imports.js"; import type { ComponentType, SVGProps } from "react"; /** * Base props shared by all icon types (Lucide, custom, flag, social media). */ export interface IconComponentProps extends SVGProps { size?: string | number; absoluteStrokeWidth?: boolean; strokeWidth?: string | number; } /** * Custom icon dynamic imports (stroke-based, like Lucide) */ const customIconImports = {} as const; /** * Unified dynamic icon imports: Lucide + custom + flag + social media. * Used by DynamicIcon to resolve any icon name at runtime. * * @example * import { DynamicIcon } from "@brightlocal/icons/dynamic"; * * * */ export const iconImports: Record< string, () => Promise<{ default: ComponentType }> > = { ...dynamicIconImports, ...customIconImports, ...flagIconImports, ...socialMediaIconImports, }; /** * Icons that accept stroke props (absoluteStrokeWidth, strokeWidth). * Flag and social media icons are fill-based and don't support these. */ export const strokeIconNames: Set = new Set([ ...Object.keys(dynamicIconImports), ...Object.keys(customIconImports), ]); export type IconImportName = | keyof typeof dynamicIconImports | keyof typeof customIconImports | keyof typeof flagIconImports | keyof typeof socialMediaIconImports;