/** * Figma-like React components * * API inspired by react-figma but outputs JSON instead of Figma nodes */ import * as React from 'react' // Re-export defineVars for use in .figma.tsx files export { defineVars, figmaVar, isVariable, loadVariablesIntoRegistry, isRegistryLoaded, type FigmaVariable } from './vars.ts' // Component registry - tracks defined components and their instances interface ComponentDef { name: string element: React.ReactElement guid?: string // Set after first render creates the component } const componentRegistry = new Map() export function resetComponentRegistry() { componentRegistry.clear() } export function getComponentRegistry() { return componentRegistry } /** * Define a reusable Figma component * * @example * const Button = defineComponent('Button', * * Click * * ) * * export default () => ( * *