import { Figma, Heart, Star, Zap, Settings, Edit3, Search, Eye, Mail, Lock, BookOpen, RotateCcw, LoaderPinwheel, Loader, Minus, Check, X, LoaderCircle, RefreshCw } from "lucide-react-native"; import type { VariantProps } from 'class-variance-authority'; import { iconVariants } from "@consensys/ds3/src/components/icon/styles"; // Extract actual types from the icon component type IconColor = NonNullable['color']>; type IconSize = NonNullable['size']>; // Get the actual color and size values from the component const colors: IconColor[] = ['neutral', 'primary', 'secondary', 'error', 'warning', 'success']; const sizes: IconSize[] = ['sm', 'md', 'lg']; // Available icons for examples const availableIcons = [ { icon: 'Figma', component: Figma, label: 'Figma' }, { icon: 'Heart', component: Heart, label: 'Heart' }, { icon: 'Star', component: Star, label: 'Star' }, { icon: 'Zap', component: Zap, label: 'Zap' }, { icon: 'Settings', component: Settings, label: 'Settings' }, { icon: 'Edit3', component: Edit3, label: 'Edit3' }, { icon: 'Search', component: Search, label: 'Search' }, { icon: 'Eye', component: Eye, label: 'Eye' }, { icon: 'Mail', component: Mail, label: 'Mail' }, { icon: 'Lock', component: Lock, label: 'Lock' }, { icon: 'BookOpen', component: BookOpen, label: 'BookOpen' }, { icon: 'RotateCcw', component: RotateCcw, label: 'RotateCcw' }, { icon: 'LoaderPinwheel', component: LoaderPinwheel, label: 'LoaderPinwheel' }, { icon: 'Loader', component: Loader, label: 'Loader' }, { icon: 'Minus', component: Minus, label: 'Minus' }, { icon: 'Check', component: Check, label: 'Check' }, { icon: 'X', component: X, label: 'X' }, { icon: 'LoaderCircle', component: LoaderCircle, label: 'LoaderCircle' }, { icon: 'RefreshCw', component: RefreshCw, label: 'RefreshCw' } ] as const; // Helper function to generate JSX for a single icon const generateIconJSX = (icon: string, color?: IconColor, size?: IconSize) => { const colorProp = color && color !== 'neutral' ? ` color="${color}"` : ''; const sizeProp = size && size !== 'md' ? ` size="${size}"` : ''; return ``; }; // Helper function to generate JSX for icon with label const generateIconWithLabelJSX = (label: string, icon: string, color?: IconColor, size?: IconSize) => { return ` ${label} ${generateIconJSX(icon, color, size)} `; }; export const iconExamples = { "colors": { name: "Icon Colors", jsx: ` ${colors.map(color => ` ${generateIconWithLabelJSX(color.charAt(0).toUpperCase() + color.slice(1), 'Figma', color, 'md')}`).join('\n')} ` }, "sizes": { name: "Icon Sizes", jsx: ` ${sizes.map(size => ` ${size.charAt(0).toUpperCase() + size.slice(1)} ${colors.map(color => ` ${generateIconJSX('Figma', color, size)}`).join('\n')} `).join('\n')} ` }, "all-combinations": { name: "All Combinations", jsx: ` ${colors.map(color => ` ${color.charAt(0).toUpperCase() + color.slice(1)} ${sizes.map(size => ` ${generateIconJSX('Figma', color, size)}`).join('\n')} `).join('\n')} ` }, "icon-variety": { name: "Icon Variety", jsx: ` ${availableIcons.slice(0, 10).map(({ icon, label }) => ` ${generateIconWithLabelJSX(label, icon, 'primary', 'md')}`).join('\n')} ` }, "color-variants": { name: "Color Variants", jsx: ` ${colors.map(color => ` ${color.charAt(0).toUpperCase() + color.slice(1)} ${sizes.map(size => ` ${generateIconJSX('Figma', color, size)}`).join('\n')} `).join('\n')} ` }, "size-variants": { name: "Size Variants", jsx: ` ${sizes.map(size => ` ${size.charAt(0).toUpperCase() + size.slice(1)} ${colors.map(color => ` ${generateIconJSX('Figma', color, size)}`).join('\n')} `).join('\n')} ` }, "common-icons": { name: "Common Icons", jsx: ` ${availableIcons.map(({ icon, label }) => ` ${generateIconWithLabelJSX(label, icon, 'primary', 'md')}`).join('\n')} ` }, "icon-colors": { name: "Icons with Colors", jsx: ` ${availableIcons.slice(0, 6).map(({ icon, label }, index) => ` ${label} ${colors.map(color => ` ${generateIconJSX(icon, color, 'md')}`).join('\n')} `).join('\n')} ` }, "mixed-examples": { name: "Mixed Examples", jsx: ` Different Sizes ${sizes.map(size => ` ${generateIconWithLabelJSX(size.charAt(0).toUpperCase() + size.slice(1), 'Figma', 'primary', size)}`).join('\n')} Different Colors ${colors.map(color => ` ${generateIconWithLabelJSX(color.charAt(0).toUpperCase() + color.slice(1), 'Heart', color, 'md')}`).join('\n')} Different Icons ${availableIcons.slice(0, 8).map(({ icon, label }) => ` ${generateIconWithLabelJSX(label, icon, 'secondary', 'lg')}`).join('\n')} Complex Combinations ${generateIconJSX('Star', 'warning', 'lg')} ${generateIconJSX('Zap', 'error', 'sm')} ${generateIconJSX('Settings', 'success', 'md')} ${generateIconJSX('Edit3', 'primary', 'lg')} ${generateIconJSX('Search', 'secondary', 'sm')} ` } };