MonEspacePro/pro/src/icons.tsx

65 lines
4.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Svg, { Circle, Path, Rect } from 'react-native-svg';
/**
* Icônes de l'app (aucun emoji) : tracés 24 × 24, trait de 2, extrémités arrondies,
* dans le style des pictogrammes du site vitrine. La couleur suit le texte autour par défaut.
*/
const ICONS = {
megaphone: <Path d="M3 10.5v3a1 1 0 0 0 1 1h2.5L12 19V5L6.5 9.5H4a1 1 0 0 0-1 1zM15.5 8.5a4.5 4.5 0 0 1 0 7M18.5 5.5a8.5 8.5 0 0 1 0 13" />,
gift: <><Rect x={3} y={8} width={18} height={4.5} rx={1} /><Path d="M5 12.5V20h14v-7.5M12 8v12M12 8c-2 0-4.5-.8-4.5-2.8S10.5 3 12 8zM12 8c2 0 4.5-.8 4.5-2.8S13.5 3 12 8z" /></>,
lock: <><Rect x={5} y={11} width={14} height={9.5} rx={2} /><Path d="M8 11V8a4 4 0 0 1 8 0v3" /></>,
star: <Path d="M12 3.2l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17.2l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z" />,
hourglass: <Path d="M6.5 3h11M6.5 21h11M7.5 3v2.5a4.5 4.5 0 0 0 9 0V3M7.5 21v-2.5a4.5 4.5 0 0 1 9 0V21" />,
check: <Path d="M5 12.5l4.5 4.5L19 7.5" />,
checkCircle: <><Circle cx={12} cy={12} r={9} /><Path d="M8.2 12.4l2.6 2.6 5-5.2" /></>,
plus: <Path d="M12 5v14M5 12h14" />,
plusCircle: <><Circle cx={12} cy={12} r={9} /><Path d="M12 8v8M8 12h8" /></>,
alert: <Path d="M12 3.5l9.5 16.5h-19zM12 10v4.5M12 17.5h.01" />,
list: <><Rect x={5.5} y={4} width={13} height={17} rx={2} /><Path d="M9 3v2h6V3M9 10h6M9 13.5h6M9 17h3.5" /></>,
palette: <><Path d="M12 3a9 9 0 1 0 0 18c1 0 1.6-.7 1.6-1.5 0-.4-.2-.8-.4-1.1-.2-.3-.4-.7-.4-1.1 0-.9.7-1.5 1.5-1.5H17a4 4 0 0 0 4-4C21 7 17 3 12 3z" /><Circle cx={7.5} cy={11.5} r={1} /><Circle cx={9.5} cy={7.5} r={1} /><Circle cx={14.5} cy={7.5} r={1} /></>,
users: <Path d="M9 11.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7zM2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14a6 6 0 0 1 3.5 6" />,
userPlus: <Path d="M9 11.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7zM2.5 20a6.5 6.5 0 0 1 13 0M19 8v6M16 11h6" />,
puzzle: <Path d="M10 4.5a2 2 0 0 1 4 0V6h4v4h-1.5a2 2 0 0 0 0 4H18v4h-4v-1.5a2 2 0 0 0-4 0V18H6v-4h1.5a2 2 0 0 0 0-4H6V6h4z" />,
receipt: <Path d="M6 3h12v18l-2-1.4-2 1.4-2-1.4-2 1.4-2-1.4L6 21zM9 8h6M9 11.5h6M9 15h3.5" />,
chart: <Path d="M4 20V11M10 20V5M16 20v-6M21 20H3" />,
history: <Path d="M3.5 12a8.5 8.5 0 1 0 2.5-6M3.5 4.5V9H8M12 7.5V12l3 2" />,
key: <><Circle cx={8} cy={15} r={4} /><Path d="M11 12l9-9M16.5 6.5l2.5 2.5M14.5 8.5l2 2" /></>,
camera: <><Path d="M4 8h3l1.8-2.6h6.4L17 8h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z" /><Circle cx={12} cy={13.5} r={3.5} /></>,
close: <Path d="M6 6l12 12M18 6L6 18" />,
flashlight: <Path d="M8 2.5h8v3.5l-2 4V21a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V10L8 6zM8 6h8M12 13v2.5" />,
sparkle: <Path d="M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8zM19 15.5l.7 1.8 1.8.7-1.8.7-.7 1.8-.7-1.8-1.8-.7 1.8-.7z" />,
repeat: <Path d="M17 2.5l3.5 3.5L17 9.5M3.5 11V9.5A3.5 3.5 0 0 1 7 6h13.5M7 21.5L3.5 18 7 14.5M20.5 13v1.5A3.5 3.5 0 0 1 17 18H3.5" />,
euro: <Path d="M17.5 6.6A7 7 0 1 0 17.5 17.4M4 10h9.5M4 14h9.5" />,
timer: <><Circle cx={12} cy={13.5} r={7.5} /><Path d="M12 10v3.5l2.2 1.8M9.5 2.5h5M12 2.5V6" /></>,
idCard: <><Rect x={3} y={5} width={18} height={14} rx={2} /><Circle cx={9} cy={11} r={2.2} /><Path d="M5.5 16.5a3.5 3.5 0 0 1 7 0M15 10h3.5M15 13.5h2.5" /></>,
wifiOff: <Path d="M3 3l18 18M8.5 16.4a5 5 0 0 1 6.2-.5M5 12.6a10 10 0 0 1 5-2.5M16.6 10.3A10 10 0 0 1 19 12.6M2 9a15 15 0 0 1 4.5-2.8M10.5 5.1A15 15 0 0 1 22 9M12 20h.01" />,
store: <Path d="M3 9.5L4.6 4h14.8L21 9.5M3 9.5h18v1a3 3 0 0 1-6 0 3 3 0 0 1-6 0 3 3 0 0 1-6 0zM5 13.5V21h14v-7.5M10 21v-4.5h4V21" />,
search: <><Circle cx={11} cy={11} r={6.5} /><Path d="M16 16l4.5 4.5" /></>,
tool: <Path d="M14.5 6.5a4.5 4.5 0 0 0 5.6 5.6L21.5 13.5 13.5 21.5l-1.4-1.4a4.5 4.5 0 0 0-5.6-5.6L4 17v3h3l2.5-2.5M14.5 6.5L17 4l3 3-2.5 2.5" />,
bell: <Path d="M6 16.5v-5.5a6 6 0 0 1 12 0v5.5l1.5 2h-15zM10 21h4" />,
clock: <><Circle cx={12} cy={12} r={9} /><Path d="M12 7v5l3 2" /></>,
cake: <Path d="M4 21h16M5 21v-7.5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2V21M5 15.5c1.2 1 2.4 1 3.5 0s2.3-1 3.5 0 2.3 1 3.5 0 2.3-1 3.5 0M12 11.5V8M12 4.5c.8.8.8 1.7 0 2.2-.8-.5-.8-1.4 0-2.2z" />,
tag: <><Path d="M3 11.5V4h7.5l10 10-7.5 7.5z" /><Circle cx={7.5} cy={8} r={1.3} /></>,
chevronRight: <Path d="M9 5l7 7-7 7" />,
} as const;
export type IconName = keyof typeof ICONS;
export function Icon({ name, size = 22, color = '#1C1C19', strokeWidth = 2 }: { name: IconName; size?: number; color?: string; strokeWidth?: number }) {
return (
<Svg
width={size}
height={size}
viewBox="0 0 24 24"
fill="none"
stroke={color}
strokeWidth={strokeWidth}
strokeLinecap="round"
strokeLinejoin="round"
accessibilityElementsHidden
importantForAccessibility="no-hide-descendants"
>
{ICONS[name]}
</Svg>
);
}