{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "smj-theme-optional", "title": "Optional theme context", "description": "Defaults to cyber skin + dark mode if no provider mounted.", "files": [ { "path": "registry/lib/use-theme-optional.ts", "content": "'use client';\n\nimport { createContext, useContext, type ReactNode } from 'react';\n\nexport type Skin = 'cyber' | 'apple' | 'figma';\n\ninterface ThemeValue {\n skin: Skin;\n isDark: boolean;\n}\n\nconst ThemeCtx = createContext(null);\n\n/**\n * Optional theme provider. Defaults to `{ skin: 'cyber', isDark: true }` if absent.\n *\n * Most components in this registry are designed for the `cyber` skin (dark + gold/cyan accents).\n * The `apple` and `figma` skins are placeholders for consumers who want to remap the look.\n */\nexport function ThemeProviderOptional({\n value,\n children,\n}: {\n value: ThemeValue;\n children: ReactNode;\n}) {\n return {children};\n}\n\nexport function useThemeOptional(): ThemeValue {\n return useContext(ThemeCtx) ?? { skin: 'cyber', isDark: true };\n}\n", "type": "registry:lib", "target": "lib/use-theme-optional.tsx" } ], "type": "registry:lib" }