/* ============================================================
UI — helpers compartidos
- Icon (Lucide)
- Alias de los componentes del Design System a window
- Reveal: animación de entrada al hacer scroll
============================================================ */
/* Componentes del Design System (bundle) */
const DS = window.YanTrottaDesignSystem_581c59 || {};
const { Avatar, Badge, Button, SectionLabel, ContactRow, ExperienceItem, ProjectCard } = DS;
/* ---- Icon (Lucide) ---- */
function Icon({ name, size = 18, stroke = 2, style = {} }) {
const ref = React.useRef(null);
React.useEffect(() => {
if (ref.current && window.lucide) {
ref.current.innerHTML = '';
const el = document.createElement('i');
el.setAttribute('data-lucide', name);
ref.current.appendChild(el);
window.lucide.createIcons({ attrs: { width: size, height: size, 'stroke-width': stroke }, nameAttr: 'data-lucide' });
}
}, [name, size, stroke]);
return ;
}
/* ---- Reveal on scroll ---- */
function Reveal({ children, delay = 0, y = 16, style = {}, as = 'div' }) {
const ref = React.useRef(null);
const [shown, setShown] = React.useState(false);
React.useEffect(() => {
const el = ref.current;
if (!el) return;
if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) { setShown(true); return; }
const io = new IntersectionObserver((entries) => {
entries.forEach((e) => { if (e.isIntersecting) { setShown(true); io.disconnect(); } });
}, { threshold: 0.12 });
io.observe(el);
return () => io.disconnect();
}, []);
const El = as;
return (
{kicker}
: null}