{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "retro-theme-provider",
  "title": "NostalgiaProvider",
  "description": "A Mac OS 9 theme provider that injects all OS9 CSS variables and utility classes so consumers can use nostalgia-ui components without manual globals.css setup.",
  "registryDependencies": [
    "https://nostalgia-ui.com/r/nostalgia-theme.json"
  ],
  "files": [
    {
      "path": "registry/new-york/ui/retro-theme-provider.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\n/* ------------------------------------------------------------------ */\n/*  OS9 Design Tokens                                                  */\n/* ------------------------------------------------------------------ */\n\nconst os9Tokens: Record<string, string> = {\n  /* Primary colors */\n  \"--os9-black\": \"#262626\",\n  \"--os9-white\": \"#ffffff\",\n\n  /* Gray scale */\n  \"--os9-gray-200\": \"#eeeeee\",\n  \"--os9-gray-300\": \"#dddddd\",\n  \"--os9-gray-400\": \"#cccccc\",\n  \"--os9-gray-500\": \"#bbbbbb\",\n  \"--os9-gray-600\": \"#999999\",\n  \"--os9-gray-700\": \"#808080\",\n  \"--os9-gray-800\": \"#666666\",\n\n  /* Accent colors */\n  \"--os9-azul\": \"#333399\",\n  \"--os9-lavender\": \"#ccccff\",\n  \"--os9-focus\": \"#6666cc\",\n\n  /* Typography */\n  \"--os9-font-heading\": '\"Charcoal\", \"ChicagoFLF\", \"Geneva\", \"Arial\", sans-serif',\n  \"--os9-font-sans\": '\"Geneva\", \"Verdana\", \"Helvetica Neue\", sans-serif',\n  \"--os9-font-mono\": '\"Monaco\", \"Courier New\", monospace',\n\n  /* Bevel shadow tokens */\n  \"--os9-shadow-raised\":\n    \"inset 1px 1px 0 var(--os9-white), inset -1px -1px 0 var(--os9-gray-700)\",\n  \"--os9-shadow-pressed\":\n    \"inset 1px 1px 0 var(--os9-gray-700), inset -1px -1px 0 var(--os9-white)\",\n  \"--os9-shadow-inset\":\n    \"inset 1px 1px 0 var(--os9-gray-700), inset -1px -1px 0 var(--os9-white)\",\n  \"--os9-shadow-window\":\n    \"2px 2px 0 var(--os9-black), inset 2px 2px 0 rgba(255,255,255,0.6), inset -2px -2px 0 rgba(38,38,38,0.4)\",\n}\n\n/* ------------------------------------------------------------------ */\n/*  OS9 Utility Classes (injected via <style>)                         */\n/* ------------------------------------------------------------------ */\n\nconst os9UtilityCSS = `\n.os9-raised {\n  border: 1px solid var(--os9-black);\n  background-color: var(--os9-gray-300);\n  box-shadow: inset 1px 1px 0 var(--os9-white), inset -1px -1px 0 var(--os9-gray-700);\n}\n.os9-pressed {\n  border: 1px solid var(--os9-black);\n  background-color: var(--os9-gray-700);\n  box-shadow: inset 1px 1px 0 var(--os9-gray-700), inset -1px -1px 0 var(--os9-white);\n}\n.os9-inset {\n  border: 1px solid var(--os9-black);\n  background-color: var(--os9-white);\n  box-shadow: inset 1px 1px 0 var(--os9-gray-700), inset -1px -1px 0 var(--os9-white);\n}\n.os9-window {\n  border: 1px solid var(--os9-black);\n  background-color: var(--os9-gray-200);\n  box-shadow: 2px 2px 0 var(--os9-black), inset 2px 2px 0 rgba(255,255,255,0.6), inset -2px -2px 0 rgba(38,38,38,0.4);\n}\n.os9-stripes {\n  background-image: repeating-linear-gradient(to bottom, transparent, transparent 1px, var(--os9-gray-600) 1px, var(--os9-gray-600) 2px);\n  background-color: var(--os9-gray-300);\n}\n.os9-focus-ring {\n  outline: none;\n  box-shadow: 0 0 0 2px var(--os9-focus);\n}\n.os9-heading {\n  font-family: var(--os9-font-heading);\n  letter-spacing: 0.42px;\n  line-height: 0.98;\n}\n`.trim()\n\n/* ------------------------------------------------------------------ */\n/*  Theme type (extensible for future variants)                        */\n/* ------------------------------------------------------------------ */\n\ntype NostalgiaTheme = \"classic\"\n\ninterface NostalgiaProviderProps extends React.HTMLAttributes<HTMLDivElement> {\n  /** Theme variant. Currently only \"classic\" is supported. */\n  theme?: NostalgiaTheme\n}\n\n/* ------------------------------------------------------------------ */\n/*  NostalgiaProvider                                                   */\n/* ------------------------------------------------------------------ */\n\n/**\n * Runtime override for the OS9 design tokens.\n *\n * Sets the `--os9-*` custom properties inline on a wrapper div,\n * so you can re-theme a subtree (or restore the classic values inside a\n * differently-themed page) without touching your global CSS.\n *\n * This is NOT a replacement for the base stylesheet: component classes such\n * as `bg-os9-gray-300` and `text-os9-black` are Tailwind utilities that only\n * exist when the `@theme` mappings are in your CSS. Install those once with\n * the `nostalgia-theme` registry item:\n *\n *   npx shadcn@latest add https://nostalgia-ui.com/r/nostalgia-theme.json\n */\n\nconst NostalgiaProvider = React.forwardRef<HTMLDivElement, NostalgiaProviderProps>(\n  function NostalgiaProvider({ className, theme = \"classic\", children, ...props }, ref) {\n    /* Build the inline style object from the token map */\n    const tokenStyles = React.useMemo(() => {\n      const styles: Record<string, string> = {}\n      for (const [key, value] of Object.entries(os9Tokens)) {\n        styles[key] = value\n      }\n      return styles\n    }, [])\n\n    return (\n      <>\n        {/* Inject the plain-CSS .os9-* helper classes (Tailwind utilities\n            still come from the nostalgia-theme base stylesheet) */}\n        <style\n          dangerouslySetInnerHTML={{ __html: os9UtilityCSS }}\n          data-nostalgia-ui\n        />\n\n        <div\n          ref={ref}\n          className={cn(\"font-[family-name:var(--os9-font-sans)] text-[10px]\", className)}\n          style={tokenStyles as React.CSSProperties}\n          data-nostalgia-theme={theme}\n          {...props}\n        >\n          {children}\n        </div>\n      </>\n    )\n  }\n)\nNostalgiaProvider.displayName = \"NostalgiaProvider\"\n\nexport { NostalgiaProvider }\nexport type { NostalgiaTheme, NostalgiaProviderProps }\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}