import React from 'react'; import { Screen, View, IconButton, Text } from '@idealyst/components'; import { useUnistyles } from 'react-native-unistyles'; export const IconButtonExamples = () => { const handlePress = (label: string) => { console.log(`IconButton pressed: ${label}`); }; const { theme } = useUnistyles(); return ( IconButton Examples {/* Type Variants */} Variants handlePress('contained')} /> handlePress('outlined')} /> handlePress('text')} /> {/* All Intents */} All Intents {(Object.keys(theme.intents) as Array).map((intent) => ( handlePress(`intent-${intent}`)} /> ))} {/* Outlined Intents */} Outlined Intents handlePress('outlined-primary')} /> handlePress('outlined-success')} /> handlePress('outlined-warning')} /> handlePress('outlined-danger')} /> handlePress('outlined-neutral')} /> {/* Sizes */} Sizes handlePress('xs')} /> handlePress('sm')} /> handlePress('md')} /> handlePress('lg')} /> handlePress('xl')} /> {/* Disabled States */} Disabled States handlePress('disabled-contained')} /> handlePress('disabled-outlined')} /> handlePress('disabled-text')} /> {/* Gradient Overlay */} Gradient Overlay handlePress('no-gradient')} /> handlePress('gradient-darken')} /> handlePress('gradient-lighten')} /> {/* Gradient with Different Intents */} Gradient Intents (Darken) handlePress('gradient-primary')} /> handlePress('gradient-success')} /> handlePress('gradient-warning')} /> handlePress('gradient-danger')} /> handlePress('gradient-neutral')} /> {/* Loading State */} Loading State handlePress('loading-contained')} /> handlePress('loading-outlined')} /> handlePress('loading-text')} /> {/* Interactive Loading */} Interactive Loading {/* Common Use Cases */} Common Use Cases handlePress('search')} /> handlePress('notifications')} /> handlePress('settings')} /> handlePress('more')} /> handlePress('close')} /> handlePress('add')} /> handlePress('delete')} /> ); }; const InteractiveLoadingIconButton = () => { const [loading, setLoading] = React.useState(false); const handlePress = async () => { setLoading(true); await new Promise(resolve => setTimeout(resolve, 2000)); setLoading(false); }; return ( ); };