@ai-matrx/icons 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/static-icons.ts","../src/custom-icons.ts","../src/svg-registry.ts","../src/lucide-name-normalize.ts","../src/lucide-module-icon.ts","../src/resolver.tsx","../src/cn.ts"],"sourcesContent":["// Statically import commonly used Lucide icons to reduce bundle size.\n// This curated hot set is the product: a hit here renders synchronously,\n// with zero dynamic-import latency and no fallback flash.\nimport {\n Zap,\n Home,\n User,\n Settings,\n Search,\n Bell,\n Menu,\n X,\n ChevronDown,\n ChevronUp,\n ChevronLeft,\n ChevronRight,\n Plus,\n Minus,\n Edit,\n Trash,\n Check,\n AlertCircle,\n Info,\n HelpCircle,\n Eye,\n EyeOff,\n Copy,\n Download,\n Upload,\n Save,\n MoreVertical,\n MoreHorizontal,\n Filter,\n SortAsc,\n SortDesc,\n Calendar,\n Clock,\n Mail,\n Phone,\n MapPin,\n Link,\n ExternalLink,\n File,\n Folder,\n Image,\n Video,\n Music,\n FileText,\n Database,\n Cloud,\n Server,\n Code,\n Terminal,\n Globe,\n Lock,\n Unlock,\n Shield,\n Key,\n LogIn,\n LogOut,\n UserPlus,\n Users,\n Star,\n Heart,\n Bookmark,\n Share,\n Send,\n MessageSquare,\n MessageCircle,\n Hash,\n AtSign,\n Paperclip,\n Mic,\n Volume2,\n Play,\n Pause,\n SkipForward,\n SkipBack,\n RefreshCw,\n RotateCw,\n Loader,\n Loader2,\n Circle,\n Square,\n Triangle,\n Hexagon,\n Package,\n Box,\n Archive,\n Inbox,\n Layers,\n Layout,\n Grid,\n List,\n Columns,\n Sidebar,\n Maximize,\n Minimize,\n ZoomIn,\n ZoomOut,\n Move,\n Scissors,\n Clipboard,\n PieChart,\n BarChart,\n TrendingUp,\n TrendingDown,\n Activity,\n Cpu,\n HardDrive,\n Wifi,\n WifiOff,\n Bluetooth,\n Battery,\n BatteryCharging,\n Power,\n Sun,\n Moon,\n CloudRain,\n Droplet,\n Wind,\n Tag,\n Tags,\n Flag,\n Award,\n Gift,\n ShoppingCart,\n CreditCard,\n DollarSign,\n Percent,\n Target,\n Crosshair,\n Navigation,\n Compass,\n Map,\n Smile,\n Frown,\n Meh,\n ThumbsUp,\n ThumbsDown,\n} from \"lucide-react\";\nimport type { IconComponentType } from \"./types\";\n\nexport { Zap as fallbackZapIcon };\n\n// Statically imported Lucide icons map (commonly used icons for optimal bundle size)\n// Exported so callers can spread it as a scope without importing the full lucide namespace.\nexport const staticLucideIconMap: Record<string, IconComponentType> = {\n Zap,\n Home,\n User,\n Settings,\n Search,\n Bell,\n Menu,\n X,\n ChevronDown,\n ChevronUp,\n ChevronLeft,\n ChevronRight,\n Plus,\n Minus,\n Edit,\n Trash,\n Check,\n AlertCircle,\n Info,\n HelpCircle,\n Eye,\n EyeOff,\n Copy,\n Download,\n Upload,\n Save,\n MoreVertical,\n MoreHorizontal,\n Filter,\n SortAsc,\n SortDesc,\n Calendar,\n Clock,\n Mail,\n Phone,\n MapPin,\n Link,\n ExternalLink,\n File,\n Folder,\n Image,\n Video,\n Music,\n FileText,\n Database,\n Cloud,\n Server,\n Code,\n Terminal,\n Globe,\n Lock,\n Unlock,\n Shield,\n Key,\n LogIn,\n LogOut,\n UserPlus,\n Users,\n Star,\n Heart,\n Bookmark,\n Share,\n Send,\n MessageSquare,\n MessageCircle,\n Hash,\n AtSign,\n Paperclip,\n Mic,\n Volume2,\n Play,\n Pause,\n SkipForward,\n SkipBack,\n RefreshCw,\n RotateCw,\n Loader,\n Loader2,\n Circle,\n Square,\n Triangle,\n Hexagon,\n Package,\n Box,\n Archive,\n Inbox,\n Layers,\n Layout,\n Grid,\n List,\n Columns,\n Sidebar,\n Maximize,\n Minimize,\n ZoomIn,\n ZoomOut,\n Move,\n Scissors,\n Clipboard,\n PieChart,\n BarChart,\n TrendingUp,\n TrendingDown,\n Activity,\n Cpu,\n HardDrive,\n Wifi,\n WifiOff,\n Bluetooth,\n Battery,\n BatteryCharging,\n Power,\n Sun,\n Moon,\n CloudRain,\n Droplet,\n Wind,\n Tag,\n Tags,\n Flag,\n Award,\n Gift,\n ShoppingCart,\n CreditCard,\n DollarSign,\n Percent,\n Target,\n Crosshair,\n Navigation,\n Compass,\n Map,\n Smile,\n Frown,\n Meh,\n ThumbsUp,\n ThumbsDown,\n};\n\n/**\n * Extend the static (synchronous, zero-latency) icon map with host-supplied\n * components — extra statically imported Lucide icons a host uses on hot paths,\n * or any component matching {@link IconComponentType}. Merges in place; later\n * registrations override earlier entries of the same name.\n */\nexport function extendStaticIcons(map: Record<string, IconComponentType>): void {\n Object.assign(staticLucideIconMap, map);\n}\n","/**\n * Curated brand/custom icon names served from the OPTIONAL `react-icons` peer.\n *\n * Coupling inversion vs. the original (which statically imported react-icons):\n * `react-icons` is an optional peerDependency, so these are lazy-imported on first\n * use and cached at module level. When the host has not installed `react-icons`,\n * loading degrades to null and the resolver renders the fallback icon instead —\n * no install-time or import-time failure.\n */\nimport type { IconComponentType } from \"./types\";\n\n/** name → react-icons subpackage the export lives in. */\nconst CUSTOM_ICON_SOURCES: Record<string, \"fc\" | \"fa6\"> = {\n FaBrave: \"fa6\",\n FcGoogle: \"fc\",\n FcBrokenLink: \"fc\",\n FcFilm: \"fc\",\n FcDownload: \"fc\",\n FcBiotech: \"fc\",\n FcElectronics: \"fc\",\n FcGraduationCap: \"fc\",\n FcLibrary: \"fc\",\n FcMusic: \"fc\",\n FcParallelTasks: \"fc\",\n FcSalesPerformance: \"fc\",\n FcCalendar: \"fc\",\n FcDocument: \"fc\",\n FcEngineering: \"fc\",\n FcDataProtection: \"fc\",\n FcAssistant: \"fc\",\n FcSms: \"fc\",\n FcTodoList: \"fc\",\n FcWikipedia: \"fc\",\n FcCommandLine: \"fc\",\n FcConferenceCall: \"fc\",\n FcManager: \"fc\",\n FcAreaChart: \"fc\",\n FcMultipleInputs: \"fc\",\n FcShipped: \"fc\",\n FcBusinessContact: \"fc\",\n FcAlphabeticalSortingAz: \"fc\",\n FcAlphabeticalSortingZa: \"fc\",\n FcFeedback: \"fc\",\n FcBusiness: \"fc\",\n FcSignature: \"fc\",\n};\n\n/** Cache for lazily loaded custom icons (also the sync-lookup source once loaded). */\nexport const customIconCache: Record<string, IconComponentType> = {};\n\n/** True when `name` is one of the curated custom (react-icons) ids. */\nexport function isCustomIconName(name: string): boolean {\n return Object.prototype.hasOwnProperty.call(CUSTOM_ICON_SOURCES, name);\n}\n\n/** The curated custom icon ids (known without loading react-icons). */\nexport function listCustomIconNames(): string[] {\n return Object.keys(CUSTOM_ICON_SOURCES);\n}\n\n/**\n * Lazy-load a curated custom icon from the optional `react-icons` peer.\n * Returns null for unknown names, a missing export, or when `react-icons`\n * is not installed — the caller degrades to the fallback icon.\n */\nexport async function loadCustomIcon(\n name: string,\n): Promise<IconComponentType | null> {\n const cached = customIconCache[name];\n if (cached) {\n return cached;\n }\n const source = CUSTOM_ICON_SOURCES[name];\n if (!source) {\n return null;\n }\n try {\n const mod: Record<string, unknown> =\n source === \"fc\"\n ? await import(\"react-icons/fc\")\n : await import(\"react-icons/fa6\");\n const exported = mod[name];\n if (typeof exported !== \"function\") {\n return null;\n }\n const IconComponent = exported as IconComponentType;\n customIconCache[name] = IconComponent;\n return IconComponent;\n } catch {\n // react-icons not installed (optional peer) — degrade to the fallback icon.\n return null;\n }\n}\n","/**\n * Injectable registry for host-owned SVG assets. Stored icon ids use the form\n * `svg:<path-without-leading-slash-and-without-extension>` e.g. `svg:icons/Home`\n * → whatever URL the host registered for the id `icons/Home` (typically `/icons/Home.svg`).\n *\n * The package ships EMPTY — the host application registers its own asset paths once at\n * startup via {@link registerSvgIcons}. An unregistered `svg:` value resolves to null\n * and the resolver falls back exactly as it does for an unknown Lucide name.\n */\nconst svgIconRegistry: Record<string, string> = {};\n\nconst SVG_PREFIX = \"svg:\";\n\n/**\n * Register (or override) `svg:` icon ids → asset URLs. Merges into the module-level\n * registry, so multiple calls compose. Ids are stored without the `svg:` prefix.\n */\nexport function registerSvgIcons(map: Record<string, string>): void {\n for (const [rawId, path] of Object.entries(map)) {\n const id = rawId.startsWith(SVG_PREFIX)\n ? rawId.slice(SVG_PREFIX.length).replace(/^\\/+/, \"\")\n : rawId.replace(/^\\/+/, \"\");\n if (id && path) {\n svgIconRegistry[id] = path;\n }\n }\n}\n\n/** The registered asset URL for a `svg:…` icon value, or null when not a registered svg icon. */\nexport function parseSvgIconPath(value: string): string | null {\n if (!value.startsWith(SVG_PREFIX)) {\n return null;\n }\n const id = value.slice(SVG_PREFIX.length).replace(/^\\/+/, \"\");\n const path = svgIconRegistry[id];\n return path ?? null;\n}\n\n/** True if `value` is a `svg:…` id with a registered asset path. */\nexport function isSvgIconValue(value: string | null | undefined): boolean {\n if (!value || !value.startsWith(SVG_PREFIX)) {\n return false;\n }\n const id = value.slice(SVG_PREFIX.length).replace(/^\\/+/, \"\");\n return Boolean(svgIconRegistry[id]);\n}\n\n/** Every registered svg icon value, `svg:` prefix included (for pickers/galleries). */\nexport function listSvgIconValues(): string[] {\n return Object.keys(svgIconRegistry).map((id) => `${SVG_PREFIX}${id}`);\n}\n","/**\n * Lucide.dev lists icons in kebab-case (e.g. `alarm-clock`); the React package\n * exports PascalCase (`AlarmClock`). Normalize pasted / typed names into candidates\n * to validate against `lucide-react` exports.\n */\n\n/**\n * If the user pasted Lucide's JSX snippet (e.g. `'<BugPlay />'` or `<AlignCenterHorizontal />`),\n * return the component name only. Otherwise return null.\n *\n * Supports optional outer quotes and optional attributes before the closing `/>`.\n */\nexport function extractLucideJsxIconName(raw: string): string | null {\n let s = raw.trim();\n if (!s) return null;\n if (\n (s.startsWith(\"'\") && s.endsWith(\"'\") && s.length >= 2) ||\n (s.startsWith('\"') && s.endsWith('\"') && s.length >= 2)\n ) {\n s = s.slice(1, -1).trim();\n }\n const m = s.match(/^<\\s*([A-Za-z][A-Za-z0-9]*)(?:\\s[^>]*)?\\s*\\/\\s*>$/);\n return m?.[1] ?? null;\n}\n\n/** `alarm-clock` → `AlarmClock`, `a-arrow-down` → `AArrowDown` */\nexport function kebabCaseToLucidePascalCase(raw: string): string {\n const s = raw.trim();\n if (!s.includes(\"-\")) {\n return s;\n }\n return s\n .split(\"-\")\n .filter(Boolean)\n .map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1).toLowerCase())\n .join(\"\");\n}\n\n/**\n * Ordered unique candidates: exact input, first-letter fix, kebab → Pascal variants.\n * Skip Lucide heuristics for `svg:…` asset values (caller should pass only those as `[trimmed]`).\n */\nexport function collectLucideIconNameCandidates(raw: string): string[] {\n const t = raw.trim();\n if (!t) {\n return [];\n }\n\n const out: string[] = [];\n const push = (s: string) => {\n if (s && !out.includes(s)) {\n out.push(s);\n }\n };\n\n push(t);\n\n if (t[0] === t[0]!.toLowerCase()) {\n push(t.charAt(0).toUpperCase() + t.slice(1));\n }\n\n if (t.includes(\"-\")) {\n push(kebabCaseToLucidePascalCase(t));\n const lower = t.toLowerCase();\n if (lower !== t) {\n push(kebabCaseToLucidePascalCase(lower));\n }\n }\n\n return out;\n}\n","/**\n * lucide-react namespaced exports: icons are ForwardRef/Memo objects in current builds,\n * not plain functions. Only createLucideIcon and default are non-icon exports we skip.\n */\nconst LUCIDE_NAMESPACE_DENYLIST = new Set([\"default\", \"createLucideIcon\"]);\n\n/**\n * True if `exported` is the value of a Lucide icon entry for `name` in `import * as Lucide`.\n * Does not mean the icon exists in the static resolver map — only that the lucide-react\n * module exposes this name as a renderable component type.\n */\nexport function isLucideModuleIconExport(\n name: string,\n exported: unknown,\n): boolean {\n if (!name || LUCIDE_NAMESPACE_DENYLIST.has(name)) return false;\n if (exported == null) return false;\n if (typeof exported === \"function\") return true;\n if (typeof exported === \"object\" && \"$$typeof\" in (exported as object)) {\n return true;\n }\n return false;\n}\n","\"use client\";\n\nimport React, { useState, useEffect } from \"react\";\nimport { cn } from \"./cn\";\nimport {\n staticLucideIconMap,\n fallbackZapIcon as Zap,\n} from \"./static-icons\";\nimport {\n customIconCache,\n isCustomIconName,\n listCustomIconNames,\n loadCustomIcon,\n} from \"./custom-icons\";\nimport { isLucideModuleIconExport } from \"./lucide-module-icon\";\nimport {\n isSvgIconValue,\n listSvgIconValues,\n parseSvgIconPath,\n} from \"./svg-registry\";\nimport type { IconComponentType, IconRenderProps } from \"./types\";\n\n// Cache for dynamically loaded icons to prevent re-importing\nconst dynamicIconCache: Record<string, IconComponentType> = {};\n\n/**\n * Finite list for a curated icon gallery: every statically bundled Lucide name,\n * curated custom ids (react-icons), and all registered `svg:…` assets.\n */\nexport function getCuratedIconIdsForPicker(): string[] {\n const set = new Set<string>();\n for (const k of Object.keys(staticLucideIconMap)) {\n set.add(k);\n }\n for (const k of listCustomIconNames()) {\n set.add(k);\n }\n for (const id of listSvgIconValues()) {\n set.add(id);\n }\n return Array.from(set).sort((a, b) =>\n a.localeCompare(b, undefined, { sensitivity: \"base\" }),\n );\n}\n\n/**\n * True if this exact name maps to a known icon (static Lucide, curated custom id, or\n * previously resolved dynamic Lucide cached under this key).\n *\n * Does not import lucide-react — use with {@link isRegisteredOrLucideIconName} for full checks.\n */\nexport function isIconRegisteredSync(\n iconName: string | null | undefined,\n): boolean {\n if (!iconName || iconName.trim() === \"\") {\n return false;\n }\n const name = iconName;\n if (isCustomIconName(name)) return true;\n if (staticLucideIconMap[name]) return true;\n return Boolean(dynamicIconCache[name]);\n}\n\n/**\n * True if `iconName` is a real icon id: custom/static/cached, a registered `svg:…`\n * asset, or a Lucide export that is a renderable component (not the fallback Zap).\n *\n * Prefer this over truthiness on {@link getIconComponent}, which always returns a component.\n */\nexport async function isRegisteredOrLucideIconName(\n iconName: string | null | undefined,\n): Promise<boolean> {\n if (!iconName || iconName.trim() === \"\") {\n return false;\n }\n if (isSvgIconValue(iconName)) {\n return true;\n }\n if (isIconRegisteredSync(iconName)) {\n return true;\n }\n try {\n const iconModule = await import(\"lucide-react\");\n const Exported = iconModule[iconName as keyof typeof iconModule];\n return isLucideModuleIconExport(iconName, Exported);\n } catch {\n return false;\n }\n}\n\n/**\n * HOW TO ADD MORE STATIC ICONS:\n *\n * The curated hot set ships in the package (src/static-icons.ts). A host that\n * frequently renders an icon outside the set keeps it zero-latency by statically\n * importing it and registering it once at startup:\n *\n * import { YourIcon } from \"lucide-react\";\n * import { extendStaticIcons } from \"@ai-matrx/icons\";\n * extendStaticIcons({ YourIcon });\n */\n\nexport interface IconResolverProps {\n iconName: string | null;\n className?: string | undefined;\n size?: number | undefined;\n fallbackIcon?: string | undefined;\n style?: React.CSSProperties | undefined;\n}\n\n/**\n * IconResolver - A unified component for resolving and rendering icons by name\n * Uses hybrid approach: static imports for common icons, dynamic imports for others\n * Supports all lucide-react icons, curated custom icons (optional react-icons peer),\n * and registered `svg:…` public assets.\n */\nconst IconResolver: React.FC<IconResolverProps> = ({\n iconName,\n className = \"h-4 w-4\",\n size,\n fallbackIcon = \"Zap\",\n style,\n}) => {\n const svgSrc = iconName ? parseSvgIconPath(iconName) : null;\n const [DynamicIcon, setDynamicIcon] = useState<IconComponentType | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n\n useEffect(() => {\n const loadIcon = async () => {\n if (!iconName) {\n setDynamicIcon(null);\n setIsLoading(false);\n return;\n }\n\n if (parseSvgIconPath(iconName)) {\n setDynamicIcon(null);\n setIsLoading(false);\n return;\n }\n\n // Check custom icons first (already-loaded cache hit is synchronous)\n const cachedCustom = customIconCache[iconName];\n if (cachedCustom) {\n setDynamicIcon(() => cachedCustom);\n return;\n }\n\n // Check statically imported Lucide icons\n const staticIcon = staticLucideIconMap[iconName];\n if (staticIcon) {\n setDynamicIcon(() => staticIcon);\n return;\n }\n\n // Check if already cached\n const cachedDynamic = dynamicIconCache[iconName];\n if (cachedDynamic) {\n setDynamicIcon(() => cachedDynamic);\n return;\n }\n\n // Curated custom icon: lazy-import the optional react-icons peer;\n // degrade to the fallback icon when it is absent.\n if (isCustomIconName(iconName)) {\n setIsLoading(true);\n const loaded = await loadCustomIcon(iconName);\n if (loaded) {\n setDynamicIcon(() => loaded);\n } else {\n setDynamicIcon(() => staticLucideIconMap[fallbackIcon] || Zap);\n }\n setIsLoading(false);\n return;\n }\n\n // Dynamically import from lucide-react\n setIsLoading(true);\n try {\n const iconModule = await import(\"lucide-react\");\n const exported: unknown = iconModule[iconName as keyof typeof iconModule];\n\n if (isLucideModuleIconExport(iconName, exported)) {\n const IconComponent = exported as IconComponentType;\n dynamicIconCache[iconName] = IconComponent;\n setDynamicIcon(() => IconComponent);\n } else {\n // Icon not found, use fallback\n setDynamicIcon(() => staticLucideIconMap[fallbackIcon] || Zap);\n }\n } catch (error) {\n console.warn(`Failed to load icon: ${iconName}`, error);\n setDynamicIcon(() => staticLucideIconMap[fallbackIcon] || Zap);\n } finally {\n setIsLoading(false);\n }\n };\n\n loadIcon();\n }, [iconName, fallbackIcon]);\n\n if (svgSrc) {\n return (\n <img\n src={svgSrc}\n alt=\"\"\n className={cn(\"object-contain shrink-0\", className)}\n width={size}\n height={size}\n style={style}\n />\n );\n }\n\n // Get the icon component to render\n const IconComponent = DynamicIcon || staticLucideIconMap[fallbackIcon] || Zap;\n\n // Build exact-optional props (never pass an explicit undefined through)\n const iconProps: IconRenderProps = {\n ...(className !== undefined ? { className } : {}),\n ...(size !== undefined ? { size } : {}),\n ...(style !== undefined ? { style } : {}),\n };\n\n // Show fallback while loading dynamic icons (seamless experience)\n if (isLoading && !DynamicIcon) {\n const FallbackIcon = staticLucideIconMap[fallbackIcon] || Zap;\n return <FallbackIcon {...iconProps} />;\n }\n\n return <IconComponent {...iconProps} />;\n};\n\nexport default IconResolver;\n\n/**\n * Synchronous utility function for getting icon components directly\n * Only works with statically imported icons plus already-loaded custom/dynamic icons.\n * For dynamic Lucide icons not in the static map, use the IconResolver component instead\n *\n * **Always returns a component** (default/fallback Zap when unknown). Do not use the return\n * value to infer whether `iconName` exists — use {@link isIconRegisteredSync} or\n * {@link isRegisteredOrLucideIconName} instead.\n */\nexport const getIconComponent = (\n iconName: string | null | undefined,\n fallbackIcon: string = \"Zap\",\n): IconComponentType => {\n if (!iconName) {\n return staticLucideIconMap[fallbackIcon] || Zap;\n }\n\n // First check custom icons (loaded lazily; a hit means it is already cached)\n const custom = customIconCache[iconName];\n if (custom) {\n return custom;\n }\n\n // Then check statically imported Lucide icons\n const staticIcon = staticLucideIconMap[iconName];\n if (staticIcon) {\n return staticIcon;\n }\n\n // Check dynamic cache\n const dynamic = dynamicIconCache[iconName];\n if (dynamic) {\n return dynamic;\n }\n\n // Fallback to default icon\n return staticLucideIconMap[fallbackIcon] || Zap;\n};\n\n/**\n * Renders an icon element directly with optional props\n * This is the preferred method for rendering icons in JSX\n */\nexport const renderIcon = (\n iconName: string | null | undefined,\n props?: IconRenderProps,\n fallbackIcon: string = \"Zap\",\n) => {\n const IconComponent = getIconComponent(iconName, fallbackIcon);\n return <IconComponent {...props} />;\n};\n\n/**\n * Utility to detect if a string is a hex color code\n */\nexport const isHexColor = (color: string): boolean => {\n return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);\n};\n\nexport const getTextColorClass = (color?: string) => {\n if (!color) return \"text-gray-600 dark:text-gray-400\";\n\n // If it's a hex color, return null (we'll use inline styles instead)\n if (isHexColor(color)) return null;\n\n const colorMap: Record<string, string> = {\n gray: \"text-gray-600 dark:text-gray-400\",\n rose: \"text-rose-600 dark:text-rose-400\",\n blue: \"text-blue-600 dark:text-blue-400\",\n amber: \"text-amber-600 dark:text-amber-400\",\n cyan: \"text-cyan-600 dark:text-cyan-400\",\n emerald: \"text-emerald-600 dark:text-emerald-400\",\n fuchsia: \"text-fuchsia-600 dark:text-fuchsia-400\",\n green: \"text-green-600 dark:text-green-400\",\n indigo: \"text-indigo-600 dark:text-indigo-400\",\n lime: \"text-lime-600 dark:text-lime-400\",\n neutral: \"text-neutral-600 dark:text-neutral-400\",\n orange: \"text-orange-600 dark:text-orange-400\",\n pink: \"text-pink-600 dark:text-pink-400\",\n purple: \"text-purple-600 dark:text-purple-400\",\n red: \"text-red-600 dark:text-red-400\",\n sky: \"text-sky-600 dark:text-sky-400\",\n slate: \"text-slate-600 dark:text-slate-400\",\n stone: \"text-stone-600 dark:text-stone-400\",\n teal: \"text-teal-600 dark:text-teal-400\",\n violet: \"text-violet-600 dark:text-violet-400\",\n yellow: \"text-yellow-600 dark:text-yellow-400\",\n zinc: \"text-zinc-600 dark:text-zinc-400\",\n };\n\n return colorMap[color.toLowerCase()] || \"text-gray-600 dark:text-gray-400\";\n};\n\n/**\n * Utility function for rendering an icon with color and size\n * Note: This is synchronous and only works with statically imported icons\n * For dynamic icons, use the DynamicIcon component instead\n */\nexport const getIconWithColorAndSize = (\n iconName: string | null,\n color: string = \"gray\",\n size: number = 4,\n) => {\n const IconComponent = getIconComponent(iconName);\n const colorClass = getTextColorClass(color);\n return <IconComponent className={`h-${size} w-${size} ${colorClass}`} />;\n};\n\n/**\n * Simple Icon component for direct usage with color and size support\n * Uses IconResolver internally to support both static and dynamic icons\n *\n * Supports both Tailwind color names (e.g., \"blue\", \"red\", \"zinc\") and hex colors (e.g., \"#ff0000\", \"#666\")\n */\nexport interface DynamicIconProps {\n name: string | null;\n color?: string | undefined;\n size?: number | undefined;\n className?: string | undefined;\n fallbackIcon?: string | undefined;\n}\n\nexport const DynamicIcon: React.FC<DynamicIconProps> = ({\n name,\n color = \"gray\",\n size = 4,\n className,\n fallbackIcon = \"Zap\",\n}) => {\n const isHex = color && isHexColor(color);\n const colorClass = isHex ? null : getTextColorClass(color);\n const sizeClass = `h-${size} w-${size}`;\n\n // Build className: always include size, include colorClass if not hex, include custom className\n const combinedClassName = [sizeClass, !isHex && colorClass, className]\n .filter(Boolean)\n .join(\" \")\n .trim();\n\n // If hex color, apply as inline style\n const style = isHex ? { color } : undefined;\n\n return (\n <IconResolver\n iconName={name}\n className={combinedClassName}\n fallbackIcon={fallbackIcon}\n style={style}\n />\n );\n};\n","/**\n * Minimal className join — the only piece of `cn` this package needs.\n * No tailwind-merge / clsx dependency by design: callers pass literal strings.\n */\nexport function cn(\n ...values: Array<string | null | undefined | false>\n): string {\n return values.filter(Boolean).join(\" \").trim();\n}\n"],"mappings":";;;AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOA,IAAM,sBAAyD;AAAA,EACpE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAC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AQ;AAAA,IACR,KAAK;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,MAAM;AAAA,EACR;AAEA,SAAO,SAAS,MAAM,YAAY,CAAC,KAAK;AAC1C;AAOO,IAAM,0BAA0B,CACrC,UACA,QAAgB,QAChB,OAAe,MACZ;AACH,QAAM,gBAAgB,iBAAiB,QAAQ;AAC/C,QAAM,aAAa,kBAAkB,KAAK;AAC1C,SAAO,oBAAC,iBAAc,WAAW,KAAK,IAAI,MAAM,IAAI,IAAI,UAAU,IAAI;AACxE;AAgBO,IAAM,cAA0C,CAAC;AAAA,EACtD;AAAA,EACA,QAAQ;AAAA,EACR,OAAO;AAAA,EACP;AAAA,EACA,eAAe;AACjB,MAAM;AACJ,QAAM,QAAQ,SAAS,WAAW,KAAK;AACvC,QAAM,aAAa,QAAQ,OAAO,kBAAkB,KAAK;AACzD,QAAM,YAAY,KAAK,IAAI,MAAM,IAAI;AAGrC,QAAM,oBAAoB,CAAC,WAAW,CAAC,SAAS,YAAY,SAAS,EAClE,OAAO,OAAO,EACd,KAAK,GAAG,EACR,KAAK;AAGR,QAAM,QAAQ,QAAQ,EAAE,MAAM,IAAI;AAElC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU;AAAA,MACV,WAAW;AAAA,MACX;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;","names":["DynamicIcon","IconComponent"]}
package/package.json ADDED
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "@ai-matrx/icons",
3
+ "version": "0.1.0",
4
+ "description": "The AI Matrx icon resolver: turn any icon NAME into a rendered component — a curated static map of ~140 hot Lucide icons for zero-latency hits, a validated dynamic import for the rest of the Lucide catalog, a module-level cache, kebab/PascalCase name normalization, an injectable svg: public-asset registry, and a fallback icon while loading.",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "license": "MIT",
10
+ "keywords": [
11
+ "icons",
12
+ "lucide",
13
+ "react",
14
+ "dynamic-icons",
15
+ "icon-resolver",
16
+ "ai-matrx"
17
+ ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/AI-Matrix-Engine/aidream.git",
21
+ "directory": "apps/shared/icons"
22
+ },
23
+ "homepage": "https://github.com/AI-Matrix-Engine/aidream/tree/main/apps/shared/icons#readme",
24
+ "bugs": {
25
+ "url": "https://github.com/AI-Matrix-Engine/aidream/issues"
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "README.md",
30
+ "LICENSE",
31
+ "CHANGELOG.md"
32
+ ],
33
+ "exports": {
34
+ ".": {
35
+ "import": {
36
+ "types": "./dist/index.d.ts",
37
+ "default": "./dist/index.js"
38
+ },
39
+ "require": {
40
+ "types": "./dist/index.d.cts",
41
+ "default": "./dist/index.cjs"
42
+ }
43
+ },
44
+ "./package.json": "./package.json"
45
+ },
46
+ "peerDependencies": {
47
+ "react": ">=18.0.0",
48
+ "lucide-react": ">=0.400.0",
49
+ "react-icons": ">=5.0.0"
50
+ },
51
+ "peerDependenciesMeta": {
52
+ "react-icons": {
53
+ "optional": true
54
+ }
55
+ },
56
+ "devDependencies": {
57
+ "@arethetypeswrong/cli": "^0.18.5",
58
+ "@testing-library/react": "^16.3.0",
59
+ "@types/node": "^22.20.0",
60
+ "@types/react": "^19.1.0",
61
+ "jsdom": "^25.0.1",
62
+ "lucide-react": "^1.35.0",
63
+ "publint": "^0.3.24",
64
+ "react": "^19.1.0",
65
+ "react-dom": "^19.1.0",
66
+ "react-icons": "^5.7.0",
67
+ "tsup": "^8.5.1",
68
+ "typescript": "^5.9.3",
69
+ "vitest": "^4.1.6"
70
+ },
71
+ "publishConfig": {
72
+ "access": "public",
73
+ "registry": "https://registry.npmjs.org/"
74
+ },
75
+ "engines": {
76
+ "node": ">=20"
77
+ },
78
+ "sideEffects": false,
79
+ "scripts": {
80
+ "build": "tsup",
81
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
82
+ "check:package": "pnpm build && publint && pnpm verify:tarball",
83
+ "typecheck": "tsc -p tsconfig.json --noEmit",
84
+ "test": "vitest run",
85
+ "test:watch": "vitest",
86
+ "verify:tarball": "node ./scripts/verify-tarball.mjs"
87
+ }
88
+ }